Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367003
b: refs/heads/master
c: a2192cf
h: refs/heads/master
i:
  367001: dde7cd5
  366999: 2cd0b4d
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 14, 2013
1 parent c6f70f8 commit b657c5a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d047795c590f63d42160b84ac778b09af297d914
refs/heads/master: a2192cf47f593681cd65798880853c5224066c81
2 changes: 1 addition & 1 deletion trunk/drivers/media/dvb-core/dvb_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct analog_demod_ops {
void (*set_params)(struct dvb_frontend *fe,
struct analog_parameters *params);
int (*has_signal)(struct dvb_frontend *fe);
int (*get_afc)(struct dvb_frontend *fe);
int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
void (*tuner_status)(struct dvb_frontend *fe);
void (*standby)(struct dvb_frontend *fe);
void (*release)(struct dvb_frontend *fe);
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/media/tuners/tda9887.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,22 +596,22 @@ static void tda9887_tuner_status(struct dvb_frontend *fe)
priv->data[1], priv->data[2], priv->data[3]);
}

static int tda9887_get_afc(struct dvb_frontend *fe)
static int tda9887_get_afc(struct dvb_frontend *fe, s32 *afc)
{
struct tda9887_priv *priv = fe->analog_demod_priv;
static int AFC_BITS_2_kHz[] = {
static const int AFC_BITS_2_kHz[] = {
-12500, -37500, -62500, -97500,
-112500, -137500, -162500, -187500,
187500, 162500, 137500, 112500,
97500 , 62500, 37500 , 12500
};
int afc=0;
__u8 reg = 0;

if (1 == tuner_i2c_xfer_recv(&priv->i2c_props,&reg,1))
afc = AFC_BITS_2_kHz[(reg>>1)&0x0f];

return afc;
if (priv->mode != V4L2_TUNER_RADIO)
return 0;
if (1 == tuner_i2c_xfer_recv(&priv->i2c_props, &reg, 1))
*afc = AFC_BITS_2_kHz[(reg >> 1) & 0x0f];
return 0;
}

static void tda9887_standby(struct dvb_frontend *fe)
Expand Down
14 changes: 2 additions & 12 deletions trunk/drivers/media/v4l2-core/tuner-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b657c5a

Please sign in to comment.