mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
[media] tda18218: implement .get_if_frequency()
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
022568f058
commit
522fdf7319
@ -141,19 +141,21 @@ static int tda18218_set_params(struct dvb_frontend *fe,
|
|||||||
switch (params->u.ofdm.bandwidth) {
|
switch (params->u.ofdm.bandwidth) {
|
||||||
case BANDWIDTH_6_MHZ:
|
case BANDWIDTH_6_MHZ:
|
||||||
LP_Fc = 0;
|
LP_Fc = 0;
|
||||||
LO_Frac = params->frequency + 4000000;
|
priv->if_frequency = 4000000;
|
||||||
break;
|
break;
|
||||||
case BANDWIDTH_7_MHZ:
|
case BANDWIDTH_7_MHZ:
|
||||||
LP_Fc = 1;
|
LP_Fc = 1;
|
||||||
LO_Frac = params->frequency + 3500000;
|
priv->if_frequency = 3500000;
|
||||||
break;
|
break;
|
||||||
case BANDWIDTH_8_MHZ:
|
case BANDWIDTH_8_MHZ:
|
||||||
default:
|
default:
|
||||||
LP_Fc = 2;
|
LP_Fc = 2;
|
||||||
LO_Frac = params->frequency + 4000000;
|
priv->if_frequency = 4000000;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LO_Frac = params->frequency + priv->if_frequency;
|
||||||
|
|
||||||
/* band-pass filter */
|
/* band-pass filter */
|
||||||
if (LO_Frac < 188000000)
|
if (LO_Frac < 188000000)
|
||||||
BP_Filter = 3;
|
BP_Filter = 3;
|
||||||
@ -206,6 +208,14 @@ error:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int tda18218_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||||
|
{
|
||||||
|
struct tda18218_priv *priv = fe->tuner_priv;
|
||||||
|
*frequency = priv->if_frequency;
|
||||||
|
dbg("%s: if=%d", __func__, *frequency);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int tda18218_sleep(struct dvb_frontend *fe)
|
static int tda18218_sleep(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
struct tda18218_priv *priv = fe->tuner_priv;
|
struct tda18218_priv *priv = fe->tuner_priv;
|
||||||
@ -268,6 +278,8 @@ static const struct dvb_tuner_ops tda18218_tuner_ops = {
|
|||||||
.sleep = tda18218_sleep,
|
.sleep = tda18218_sleep,
|
||||||
|
|
||||||
.set_params = tda18218_set_params,
|
.set_params = tda18218_set_params,
|
||||||
|
|
||||||
|
.get_if_frequency = tda18218_get_if_frequency,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe,
|
struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe,
|
||||||
|
@ -100,6 +100,8 @@ struct tda18218_priv {
|
|||||||
struct tda18218_config *cfg;
|
struct tda18218_config *cfg;
|
||||||
struct i2c_adapter *i2c;
|
struct i2c_adapter *i2c;
|
||||||
|
|
||||||
|
u32 if_frequency;
|
||||||
|
|
||||||
u8 regs[TDA18218_NUM_REGS];
|
u8 regs[TDA18218_NUM_REGS];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user