V4L/DVB (10523): em28xx-audio: Add macros EM28XX_START_AUDIO / EM28XX_STOP_AUDIO
authorDouglas Schilling Landgraf <dougsland@redhat.com>
Sun, 8 Feb 2009 04:38:10 +0000 (01:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:44 +0000 (12:42 -0300)
Added macros EM28XX_START_AUDIO and EM28XX_STOP_AUDIO for em28xx_cmd().

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-audio.c
drivers/media/video/em28xx/em28xx.h

index 05d145f78b6ec76ea96cc99cd7e440ffe07e4cb3..abbf9ee0d39a49e2af1d0803a1fb54c5128563d0 100644 (file)
@@ -224,10 +224,10 @@ static int em28xx_cmd(struct em28xx *dev, int cmd, int arg)
 
        switch (cmd) {
        case EM28XX_CAPTURE_STREAM_EN:
-               if (dev->adev.capture_stream == STREAM_OFF && arg == 1) {
+               if (dev->adev.capture_stream == STREAM_OFF && arg == EM28XX_START_AUDIO) {
                        dev->adev.capture_stream = STREAM_ON;
                        em28xx_init_audio_isoc(dev);
-               } else if (dev->adev.capture_stream == STREAM_ON && arg == 0) {
+               } else if (dev->adev.capture_stream == STREAM_ON && arg == EM28XX_STOP_AUDIO) {
                        dev->adev.capture_stream = STREAM_OFF;
                        em28xx_deinit_isoc_audio(dev);
                } else {
@@ -369,7 +369,7 @@ static int snd_em28xx_hw_capture_free(struct snd_pcm_substream *substream)
        dprintk("Stop capture, if needed\n");
 
        if (dev->adev.capture_stream == STREAM_ON)
-               em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
+               em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, EM28XX_STOP_AUDIO);
 
        return 0;
 }
@@ -391,11 +391,11 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream,
        spin_lock(&dev->adev.slock);
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
-               em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1);
+               em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, EM28XX_START_AUDIO);
                retval = 0;
                break;
        case SNDRV_PCM_TRIGGER_STOP:
-               em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
+               em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, EM28XX_STOP_AUDIO);
                retval = 0;
                break;
        default:
index 11f0db650261311579c760567849c8ee5aecd0e5..6844b98e1b67235ed7dd0b8cb068d9df585c5f38 100644 (file)
 #define EM28XX_BOARD_NOT_VALIDATED 1
 #define EM28XX_BOARD_VALIDATED    0
 
+/* Params for em28xx_cmd() audio */
+#define EM28XX_START_AUDIO      1
+#define EM28XX_STOP_AUDIO       0
+
 /* maximum number of em28xx boards */
 #define EM28XX_MAXBOARDS 4 /*FIXME: should be bigger */