V4L/DVB (4727): Support status readout for saa713x based FM radio
authorHartmut Hackmann <hartmut.hackmann@t-online.de>
Fri, 6 Oct 2006 22:45:23 +0000 (19:45 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sat, 14 Oct 2006 03:43:52 +0000 (00:43 -0300)
This patch adds readout for stereo and signal level for
saa713x cards which use the saa713x as FM demodulator.
These are many cards based on saa7133, tda8290 and tda8275a.
FM channel search should work now.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/saa7134/saa7134-video.c

index 203302f21827e5104e8b7d1b2485afbb369b76c2..830617ea81cc5ca0b6c68fce66fe45be112a1fc8 100644 (file)
@@ -2248,7 +2248,11 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
                t->type = V4L2_TUNER_RADIO;
 
                saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t);
-
+               if (dev->input->amux == TV) {
+                       t->signal = 0xf800 - ((saa_readb(0x581) & 0x1f) << 11);
+                       t->rxsubchans = (saa_readb(0x529) & 0x08) ?
+                                       V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
+               }
                return 0;
        }
        case VIDIOC_S_TUNER: