diff options
author | Igor M. Liplianin <liplianin@me.by> | 2011-02-25 16:41:23 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:26 -0400 |
commit | 52c506e09cd624cbf7d21d9c16283f3e8b32f4bc (patch) | |
tree | 3087157687e8b98c9d0dace9d077744cf9c8a8fb /drivers/media/dvb | |
parent | 69519c3eff2a4a164351792d70666efa900b697e (diff) |
[media] dw2102: corrections for TeVii s660 LNB power control
There are two TeVii s660 modifications with different LNB power control
implementations. It is safe to call both methods for each card.
Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dw2102.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index d1ddf7e81735..0ab377e3d6f2 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c | |||
@@ -85,6 +85,10 @@ struct su3000_state { | |||
85 | u8 initialized; | 85 | u8 initialized; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | struct s6x0_state { | ||
89 | int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v); | ||
90 | }; | ||
91 | |||
88 | /* debug */ | 92 | /* debug */ |
89 | static int dvb_usb_dw2102_debug; | 93 | static int dvb_usb_dw2102_debug; |
90 | module_param_named(debug, dvb_usb_dw2102_debug, int, 0644); | 94 | module_param_named(debug, dvb_usb_dw2102_debug, int, 0644); |
@@ -854,6 +858,19 @@ static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | |||
854 | return 0; | 858 | return 0; |
855 | } | 859 | } |
856 | 860 | ||
861 | static int s660_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | ||
862 | { | ||
863 | struct dvb_usb_adapter *d = | ||
864 | (struct dvb_usb_adapter *)(fe->dvb->priv); | ||
865 | struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; | ||
866 | |||
867 | dw210x_set_voltage(fe, voltage); | ||
868 | if (st->old_set_voltage) | ||
869 | st->old_set_voltage(fe, voltage); | ||
870 | |||
871 | return 0; | ||
872 | } | ||
873 | |||
857 | static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon) | 874 | static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon) |
858 | { | 875 | { |
859 | static u8 led_off[] = { 0 }; | 876 | static u8 led_off[] = { 0 }; |
@@ -1105,15 +1122,19 @@ static int stv0288_frontend_attach(struct dvb_usb_adapter *d) | |||
1105 | 1122 | ||
1106 | static int ds3000_frontend_attach(struct dvb_usb_adapter *d) | 1123 | static int ds3000_frontend_attach(struct dvb_usb_adapter *d) |
1107 | { | 1124 | { |
1125 | struct s6x0_state *st = (struct s6x0_state *)d->dev->priv; | ||
1126 | |||
1108 | d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, | 1127 | d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, |
1109 | &d->dev->i2c_adap); | 1128 | &d->dev->i2c_adap); |
1110 | if (d->fe != NULL) { | ||
1111 | d->fe->ops.set_voltage = dw210x_set_voltage; | ||
1112 | info("Attached ds3000+ds2020!\n"); | ||
1113 | return 0; | ||
1114 | } | ||
1115 | 1129 | ||
1116 | return -EIO; | 1130 | if (d->fe == NULL) |
1131 | return -EIO; | ||
1132 | |||
1133 | st->old_set_voltage = d->fe->ops.set_voltage; | ||
1134 | d->fe->ops.set_voltage = s660_set_voltage; | ||
1135 | info("Attached ds3000+ds2020!\n"); | ||
1136 | |||
1137 | return 0; | ||
1117 | } | 1138 | } |
1118 | 1139 | ||
1119 | static int prof_7500_frontend_attach(struct dvb_usb_adapter *d) | 1140 | static int prof_7500_frontend_attach(struct dvb_usb_adapter *d) |
@@ -1669,6 +1690,7 @@ static struct dvb_usb_device_properties dw3101_properties = { | |||
1669 | static struct dvb_usb_device_properties s6x0_properties = { | 1690 | static struct dvb_usb_device_properties s6x0_properties = { |
1670 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 1691 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
1671 | .usb_ctrl = DEVICE_SPECIFIC, | 1692 | .usb_ctrl = DEVICE_SPECIFIC, |
1693 | .size_of_priv = sizeof(struct s6x0_state), | ||
1672 | .firmware = "dvb-usb-s630.fw", | 1694 | .firmware = "dvb-usb-s630.fw", |
1673 | .no_reconnect = 1, | 1695 | .no_reconnect = 1, |
1674 | 1696 | ||