V4L/DVB (7213): tda18271: consolidate tune functions
combine tda18271c1_tune and tda18271c2_tune into a single function Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
4d2d42bcd8
commit
d1c53424f3
1 changed files with 17 additions and 45 deletions
|
@ -195,8 +195,8 @@ static int tda18271_read_thermometer(struct dvb_frontend *fe)
|
||||||
return tm;
|
return tm;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tda18271_rf_tracking_filters_correction(struct dvb_frontend *fe,
|
static int tda18271c2_rf_tracking_filters_correction(struct dvb_frontend *fe,
|
||||||
u32 freq)
|
u32 freq)
|
||||||
{
|
{
|
||||||
struct tda18271_priv *priv = fe->tuner_priv;
|
struct tda18271_priv *priv = fe->tuner_priv;
|
||||||
struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state;
|
struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state;
|
||||||
|
@ -630,26 +630,6 @@ static int tda18271_init(struct dvb_frontend *fe)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tda18271c2_tune(struct dvb_frontend *fe,
|
|
||||||
u32 ifc, u32 freq, u32 bw, u8 std, int radio)
|
|
||||||
{
|
|
||||||
struct tda18271_priv *priv = fe->tuner_priv;
|
|
||||||
|
|
||||||
tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
|
|
||||||
|
|
||||||
tda18271_init(fe);
|
|
||||||
|
|
||||||
mutex_lock(&priv->lock);
|
|
||||||
|
|
||||||
tda18271_rf_tracking_filters_correction(fe, freq);
|
|
||||||
|
|
||||||
tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
|
|
||||||
|
|
||||||
mutex_unlock(&priv->lock);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
|
static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
|
||||||
|
@ -747,19 +727,28 @@ static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tda18271c1_tune(struct dvb_frontend *fe,
|
/* ------------------------------------------------------------------ */
|
||||||
u32 ifc, u32 freq, u32 bw, u8 std, int radio)
|
|
||||||
|
static int tda18271_tune(struct dvb_frontend *fe,
|
||||||
|
u32 ifc, u32 freq, u32 bw, u8 std, int radio)
|
||||||
{
|
{
|
||||||
struct tda18271_priv *priv = fe->tuner_priv;
|
struct tda18271_priv *priv = fe->tuner_priv;
|
||||||
|
|
||||||
|
tda_dbg("freq = %d, ifc = %d, bw = %d, std = 0x%02x\n",
|
||||||
|
freq, ifc, bw, std);
|
||||||
|
|
||||||
tda18271_init(fe);
|
tda18271_init(fe);
|
||||||
|
|
||||||
mutex_lock(&priv->lock);
|
mutex_lock(&priv->lock);
|
||||||
|
|
||||||
tda_dbg("freq = %d, ifc = %d\n", freq, ifc);
|
switch (priv->id) {
|
||||||
|
case TDA18271HDC1:
|
||||||
tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
|
tda18271c1_rf_tracking_filter_calibration(fe, freq, bw);
|
||||||
|
break;
|
||||||
|
case TDA18271HDC2:
|
||||||
|
tda18271c2_rf_tracking_filters_correction(fe, freq);
|
||||||
|
break;
|
||||||
|
}
|
||||||
tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
|
tda18271_channel_configuration(fe, ifc, freq, bw, std, radio);
|
||||||
|
|
||||||
mutex_unlock(&priv->lock);
|
mutex_unlock(&priv->lock);
|
||||||
|
@ -767,23 +756,6 @@ static int tda18271c1_tune(struct dvb_frontend *fe,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int tda18271_tune(struct dvb_frontend *fe,
|
|
||||||
u32 ifc, u32 freq, u32 bw, u8 std, int radio)
|
|
||||||
{
|
|
||||||
struct tda18271_priv *priv = fe->tuner_priv;
|
|
||||||
int ret = -EINVAL;
|
|
||||||
|
|
||||||
switch (priv->id) {
|
|
||||||
case TDA18271HDC1:
|
|
||||||
ret = tda18271c1_tune(fe, ifc, freq, bw, std, radio);
|
|
||||||
break;
|
|
||||||
case TDA18271HDC2:
|
|
||||||
ret = tda18271c2_tune(fe, ifc, freq, bw, std, radio);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
static int tda18271_set_params(struct dvb_frontend *fe,
|
static int tda18271_set_params(struct dvb_frontend *fe,
|
||||||
|
|
Loading…
Add table
Reference in a new issue