diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-04-06 04:35:27 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-14 19:43:40 -0300 |
commit | a2192cf47f593681cd65798880853c5224066c81 (patch) | |
tree | 1883c7aa872f02413ff8c3da558e40c4f3b3ab1c /drivers/media/v4l2-core | |
parent | d047795c590f63d42160b84ac778b09af297d914 (diff) | |
download | op-kernel-dev-a2192cf47f593681cd65798880853c5224066c81.zip op-kernel-dev-a2192cf47f593681cd65798880853c5224066c81.tar.gz |
[media] tuner-core/tda9887: get_afc can be tuner mode specific
The get_afc op in tda9887 is valid only for the radio mode.
But due to the way get_afc in analog_demod_ops was designed it would
overwrite the afc value with a bogus value when in TV mode.
Pass a pointer to the afc value instead, and when not in radio mode
leave it alone in the tda9887.
This broke a long time ago in 2.6.19 when the get_afc op was introduced.
Before that the afc was only set for radio mode in the tda9887.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/tuner-core.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c index 7d60c5d..a0b10e6 100644 --- a/drivers/media/v4l2-core/tuner-core.c +++ b/drivers/media/v4l2-core/tuner-core.c @@ -228,16 +228,6 @@ static int fe_has_signal(struct dvb_frontend *fe) return strength; } -static int fe_get_afc(struct dvb_frontend *fe) -{ - s32 afc; - - if (fe->ops.tuner_ops.get_afc(fe, &afc) < 0) - return 0; - - return afc; -} - static int fe_set_config(struct dvb_frontend *fe, void *priv_cfg) { struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops; @@ -448,7 +438,7 @@ static void set_type(struct i2c_client *c, unsigned int type, if (fe_tuner_ops->get_rf_strength) analog_ops->has_signal = fe_has_signal; if (fe_tuner_ops->get_afc) - analog_ops->get_afc = fe_get_afc; + analog_ops->get_afc = fe_tuner_ops->get_afc; } else { t->name = analog_ops->info.name; @@ -1190,7 +1180,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) if (check_mode(t, vt->type) == -EINVAL) return 0; if (vt->type == t->mode && analog_ops->get_afc) - vt->afc = analog_ops->get_afc(&t->fe); + analog_ops->get_afc(&t->fe, &vt->afc); if (analog_ops->has_signal) vt->signal = analog_ops->has_signal(&t->fe); if (vt->type != V4L2_TUNER_RADIO) { |