From 8c71d17e53e261338327fc6892cd0456c19deaa1 Mon Sep 17 00:00:00 2001 From: Gerd Knorr Date: Wed, 30 Jun 2004 14:13:20 +0000 Subject: - tda9887: radio afc support by Robert DeLuca. --- linux/drivers/media/video/tda9887.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index cc53fe001..7fbf7c8ff 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -662,6 +662,24 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) } tda9887_configure(t); } + case VIDIOC_G_TUNER: + { + static int AFC_BITS_2_kHz[] = { + -12500, -37500, -62500, -97500, + -112500, -137500, -162500, -187500, + 187500, 162500, 137500, 112500, + 97500 , 62500, 37500 , 12500 + }; + struct v4l2_tuner* tuner = arg; + + if (t->radio) { + __u8 reg = 0; + tuner->afc=0; + if (1 == i2c_master_recv(&t->client,®,1)) + tuner->afc = AFC_BITS_2_kHz[(reg>>1)&0x0f]; + } + break; + } default: /* nothing */ break; -- cgit v1.2.3