[media] tda8261: don't use set_state/get_state callbacks
Those callbacks are meant to be used only on some very specific cases. There's absolutely no need to do that at tda8261, as the only parameter that it allows to be set/get is the frequency. So, use the standard get_params() and get_frequency() kABI ops. There's no need to touch at any bridge driver, as all interactions are done via the macros at tda8261_cfg.h. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Bu işleme şunda yer alıyor:
@@ -21,17 +21,15 @@ static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
|
||||
{
|
||||
struct dvb_frontend_ops *frontend_ops = &fe->ops;
|
||||
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
|
||||
struct tuner_state t_state;
|
||||
int err = 0;
|
||||
|
||||
if (tuner_ops->get_state) {
|
||||
err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
|
||||
if (tuner_ops->get_frequency) {
|
||||
err = tuner_ops->get_frequency(fe, frequency);
|
||||
if (err < 0) {
|
||||
printk("%s: Invalid parameter\n", __func__);
|
||||
pr_err("%s: Invalid parameter\n", __func__);
|
||||
return err;
|
||||
}
|
||||
*frequency = t_state.frequency;
|
||||
printk("%s: Frequency=%d\n", __func__, t_state.frequency);
|
||||
pr_debug("%s: Frequency=%d\n", __func__, *frequency);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -40,37 +38,24 @@ static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
|
||||
{
|
||||
struct dvb_frontend_ops *frontend_ops = &fe->ops;
|
||||
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
|
||||
struct tuner_state t_state;
|
||||
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
||||
int err = 0;
|
||||
|
||||
t_state.frequency = frequency;
|
||||
|
||||
if (tuner_ops->set_state) {
|
||||
err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state);
|
||||
if (tuner_ops->set_params) {
|
||||
err = tuner_ops->set_params(fe);
|
||||
if (err < 0) {
|
||||
printk("%s: Invalid parameter\n", __func__);
|
||||
pr_err("%s: Invalid parameter\n", __func__);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
printk("%s: Frequency=%d\n", __func__, t_state.frequency);
|
||||
pr_debug("%s: Frequency=%d\n", __func__, c->frequency);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
|
||||
{
|
||||
struct dvb_frontend_ops *frontend_ops = &fe->ops;
|
||||
struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
|
||||
struct tuner_state t_state;
|
||||
int err = 0;
|
||||
/* FIXME! need to calculate Bandwidth */
|
||||
*bandwidth = 40000000;
|
||||
|
||||
if (tuner_ops->get_state) {
|
||||
err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state);
|
||||
if (err < 0) {
|
||||
printk("%s: Invalid parameter\n", __func__);
|
||||
return err;
|
||||
}
|
||||
*bandwidth = t_state.bandwidth;
|
||||
printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Yeni konuda referans
Bir kullanıcı engelle