summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/tda9887.c18
1 files changed, 18 insertions, 0 deletions
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,&reg,1))
+ tuner->afc = AFC_BITS_2_kHz[(reg>>1)&0x0f];
+ }
+ break;
+ }
default:
/* nothing */
break;