V4L/DVB: tm6000: Improve set bitrate routines used by alsa
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 7 Jun 2010 14:57:01 +0000 (11:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 2 Aug 2010 17:05:58 +0000 (14:05 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/tm6000/tm6000-alsa.c
drivers/staging/tm6000/tm6000-core.c

index 6df2dc8..087137d 100644 (file)
@@ -85,6 +85,8 @@ static int _tm6000_start_audio_dma(struct snd_tm6000_card *chip)
        val |= 0x20;
        tm6000_set_reg(core, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val);
 
+       tm6000_set_audio_bitrate(core, 48000);
+
        tm6000_set_reg(core, TM6010_REQ08_R01_A_INIT, 0x80);
 
        return 0;
index 1656440..cded411 100644 (file)
@@ -603,8 +603,17 @@ int tm6000_set_audio_bitrate(struct tm6000_core *dev, int bitrate)
 {
        int val;
 
+       if (dev->dev_type == TM6010) {
+               val = tm6000_get_reg(dev, TM6010_REQ08_R0A_A_I2S_MOD, 0);
+               if (val < 0)
+                       return val;
+               val = (val & 0xf0) | 0x1; /* 48 kHz, not muted */
+               val = tm6000_set_reg(dev, TM6010_REQ08_R0A_A_I2S_MOD, val);
+               if (val < 0)
+                       return val;
+       }
+
        val = tm6000_get_reg(dev, REQ_07_SET_GET_AVREG, 0xeb, 0x0);
-       printk("Original value=%d\n", val);
        if (val < 0)
                return val;