diff options
author | Igor M. Liplianin <liplianin@me.by> | 2012-12-28 17:40:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-28 18:30:29 -0500 |
commit | 43385c8a645a25ddef7a45df8786ff26806f7e5d (patch) | |
tree | 22635c660eab8e6d75f0cd24fe6aaad7bfbda1be | |
parent | 38f7889cea9d5754493fa601a2d466ba33f13f55 (diff) |
[media] ds3000: lock led procedure added
TeVii s660 and others have LED for lock indication.
Let's use it in right order.
Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb-frontends/ds3000.c | 12 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/ds3000.h | 2 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb/dw2102.c | 7 |
3 files changed, 20 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index fded9b67456c..d128f85844e7 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c | |||
@@ -460,6 +460,9 @@ static int ds3000_read_status(struct dvb_frontend *fe, fe_status_t* status) | |||
460 | return 1; | 460 | return 1; |
461 | } | 461 | } |
462 | 462 | ||
463 | if (state->config->set_lock_led) | ||
464 | state->config->set_lock_led(fe, *status == 0 ? 0 : 1); | ||
465 | |||
463 | dprintk("%s: status = 0x%02x\n", __func__, lock); | 466 | dprintk("%s: status = 0x%02x\n", __func__, lock); |
464 | 467 | ||
465 | return 0; | 468 | return 0; |
@@ -809,6 +812,10 @@ static int ds3000_diseqc_send_burst(struct dvb_frontend *fe, | |||
809 | static void ds3000_release(struct dvb_frontend *fe) | 812 | static void ds3000_release(struct dvb_frontend *fe) |
810 | { | 813 | { |
811 | struct ds3000_state *state = fe->demodulator_priv; | 814 | struct ds3000_state *state = fe->demodulator_priv; |
815 | |||
816 | if (state->config->set_lock_led) | ||
817 | state->config->set_lock_led(fe, 0); | ||
818 | |||
812 | dprintk("%s\n", __func__); | 819 | dprintk("%s\n", __func__); |
813 | kfree(state); | 820 | kfree(state); |
814 | } | 821 | } |
@@ -1037,6 +1044,11 @@ static int ds3000_tune(struct dvb_frontend *fe, | |||
1037 | 1044 | ||
1038 | static enum dvbfe_algo ds3000_get_algo(struct dvb_frontend *fe) | 1045 | static enum dvbfe_algo ds3000_get_algo(struct dvb_frontend *fe) |
1039 | { | 1046 | { |
1047 | struct ds3000_state *state = fe->demodulator_priv; | ||
1048 | |||
1049 | if (state->config->set_lock_led) | ||
1050 | state->config->set_lock_led(fe, 0); | ||
1051 | |||
1040 | dprintk("%s()\n", __func__); | 1052 | dprintk("%s()\n", __func__); |
1041 | return DVBFE_ALGO_HW; | 1053 | return DVBFE_ALGO_HW; |
1042 | } | 1054 | } |
diff --git a/drivers/media/dvb-frontends/ds3000.h b/drivers/media/dvb-frontends/ds3000.h index 67eeaf9bdbce..478ad66c63d7 100644 --- a/drivers/media/dvb-frontends/ds3000.h +++ b/drivers/media/dvb-frontends/ds3000.h | |||
@@ -30,6 +30,8 @@ struct ds3000_config { | |||
30 | u8 ci_mode; | 30 | u8 ci_mode; |
31 | /* Set device param to start dma */ | 31 | /* Set device param to start dma */ |
32 | int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured); | 32 | int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured); |
33 | /* Hook for Lock LED */ | ||
34 | void (*set_lock_led)(struct dvb_frontend *fe, int offon); | ||
33 | }; | 35 | }; |
34 | 36 | ||
35 | #if defined(CONFIG_DVB_DS3000) || \ | 37 | #if defined(CONFIG_DVB_DS3000) || \ |
diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index 5ae3529f81ad..d8a5ebb43626 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c | |||
@@ -955,6 +955,11 @@ static struct ts2020_config dw2104_ts2020_config = { | |||
955 | .tuner_address = 0x60, | 955 | .tuner_address = 0x60, |
956 | }; | 956 | }; |
957 | 957 | ||
958 | static struct ds3000_config s660_ds3000_config = { | ||
959 | .demod_address = 0x68, | ||
960 | .set_lock_led = dw210x_led_ctrl, | ||
961 | }; | ||
962 | |||
958 | static struct stv0900_config dw2104a_stv0900_config = { | 963 | static struct stv0900_config dw2104a_stv0900_config = { |
959 | .demod_address = 0x6a, | 964 | .demod_address = 0x6a, |
960 | .demod_mode = 0, | 965 | .demod_mode = 0, |
@@ -1200,7 +1205,7 @@ static int ds3000_frontend_attach(struct dvb_usb_adapter *d) | |||
1200 | struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; | 1205 | struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; |
1201 | u8 obuf[] = {7, 1}; | 1206 | u8 obuf[] = {7, 1}; |
1202 | 1207 | ||
1203 | d->fe_adap[0].fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, | 1208 | d->fe_adap[0].fe = dvb_attach(ds3000_attach, &s660_ds3000_config, |
1204 | &d->dev->i2c_adap); | 1209 | &d->dev->i2c_adap); |
1205 | 1210 | ||
1206 | if (d->fe_adap[0].fe == NULL) | 1211 | if (d->fe_adap[0].fe == NULL) |