diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-11-11 18:42:00 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-11-17 06:45:05 -0200 |
commit | 65f0f686de9fcbad7dadcedae94de77ab8b558b7 (patch) | |
tree | 82a613aaec8c8313668a53532d281415747eb8c3 /drivers/media/dvb-frontends/stb6100.c | |
parent | b2d3afcfbdb7cd48759433ab9a0dd1bf20cc6aa8 (diff) | |
download | op-kernel-dev-65f0f686de9fcbad7dadcedae94de77ab8b558b7.zip op-kernel-dev-65f0f686de9fcbad7dadcedae94de77ab8b558b7.tar.gz |
[media] stb6100: get rid of get_state()/set_state()
It is tricky to get rid of those ops here, as the stv0299 driver
wants to set frequency in separate from setting the bandwidth.
So, we use a small trick: we temporarely fill the cache with
0 for either frequency or bandwidth and add some logic at
set_params to only change the property(ies) that aren't zero.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/stb6100.c')
-rw-r--r-- | drivers/media/dvb-frontends/stb6100.c | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/drivers/media/dvb-frontends/stb6100.c b/drivers/media/dvb-frontends/stb6100.c index 5d8dbde..c978c80 100644 --- a/drivers/media/dvb-frontends/stb6100.c +++ b/drivers/media/dvb-frontends/stb6100.c @@ -502,49 +502,22 @@ static int stb6100_init(struct dvb_frontend *fe) * iqsense = 1 * tunerstep = 125000 */ - state->bandwidth = 36000000; /* Hz */ + state->bandwidth = 36000000; /* Hz */ state->reference = refclk / 1000; /* kHz */ /* Set default bandwidth. Modified, PN 13-May-10 */ return 0; } -static int stb6100_get_state(struct dvb_frontend *fe, - enum tuner_param param, - struct tuner_state *state) +static int stb6100_set_params(struct dvb_frontend *fe) { - switch (param) { - case DVBFE_TUNER_FREQUENCY: - stb6100_get_frequency(fe, &state->frequency); - break; - case DVBFE_TUNER_BANDWIDTH: - stb6100_get_bandwidth(fe, &state->bandwidth); - break; - default: - break; - } + struct dtv_frontend_properties *c = &fe->dtv_property_cache; - return 0; -} + if (c->frequency > 0) + stb6100_set_frequency(fe, c->frequency); -static int stb6100_set_state(struct dvb_frontend *fe, - enum tuner_param param, - struct tuner_state *state) -{ - struct stb6100_state *tstate = fe->tuner_priv; - - switch (param) { - case DVBFE_TUNER_FREQUENCY: - stb6100_set_frequency(fe, state->frequency); - tstate->frequency = state->frequency; - break; - case DVBFE_TUNER_BANDWIDTH: - stb6100_set_bandwidth(fe, state->bandwidth); - tstate->bandwidth = state->bandwidth; - break; - default: - break; - } + if (c->bandwidth_hz > 0) + stb6100_set_bandwidth(fe, c->bandwidth_hz); return 0; } @@ -560,8 +533,9 @@ static struct dvb_tuner_ops stb6100_ops = { .init = stb6100_init, .sleep = stb6100_sleep, .get_status = stb6100_get_status, - .get_state = stb6100_get_state, - .set_state = stb6100_set_state, + .set_params = stb6100_set_params, + .get_frequency = stb6100_get_frequency, + .get_bandwidth = stb6100_get_bandwidth, .release = stb6100_release }; |