diff options
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_vp2033.c')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_vp2033.c | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/drivers/media/dvb/mantis/mantis_vp2033.c b/drivers/media/dvb/mantis/mantis_vp2033.c index 877329175d0f..cef108c5ffc7 100644 --- a/drivers/media/dvb/mantis/mantis_vp2033.c +++ b/drivers/media/dvb/mantis/mantis_vp2033.c | |||
@@ -31,6 +31,8 @@ | |||
31 | 31 | ||
32 | #include "tda1002x.h" | 32 | #include "tda1002x.h" |
33 | #include "mantis_common.h" | 33 | #include "mantis_common.h" |
34 | #include "mantis_ioc.h" | ||
35 | #include "mantis_dvb.h" | ||
34 | #include "mantis_vp2033.h" | 36 | #include "mantis_vp2033.h" |
35 | 37 | ||
36 | #define MANTIS_MODEL_NAME "VP-2033" | 38 | #define MANTIS_MODEL_NAME "VP-2033" |
@@ -123,32 +125,46 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend * | |||
123 | { | 125 | { |
124 | struct i2c_adapter *adapter = &mantis->adapter; | 126 | struct i2c_adapter *adapter = &mantis->adapter; |
125 | 127 | ||
126 | dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); | 128 | int err = 0; |
127 | fe = tda10021_attach(&vp2033_tda1002x_cu1216_config, | ||
128 | adapter, | ||
129 | read_pwm(mantis)); | ||
130 | 129 | ||
131 | if (fe) { | 130 | err = mantis_frontend_power(mantis, POWER_ON); |
132 | dprintk(MANTIS_ERROR, 1, | 131 | if (err == 0) { |
133 | "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", | 132 | mantis_frontend_soft_reset(mantis); |
134 | vp2033_tda1002x_cu1216_config.demod_address); | 133 | msleep(250); |
135 | } else { | 134 | |
136 | fe = tda10023_attach(&vp2033_tda10023_cu1216_config, | 135 | dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); |
136 | fe = tda10021_attach(&vp2033_tda1002x_cu1216_config, | ||
137 | adapter, | 137 | adapter, |
138 | read_pwm(mantis)); | 138 | read_pwm(mantis)); |
139 | 139 | ||
140 | if (fe) { | 140 | if (fe) { |
141 | dprintk(MANTIS_ERROR, 1, | 141 | dprintk(MANTIS_ERROR, 1, |
142 | "found Philips CU1216 DVB-C frontend (TDA10023) @ 0x%02x", | 142 | "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", |
143 | vp2033_tda1002x_cu1216_config.demod_address); | 143 | vp2033_tda1002x_cu1216_config.demod_address); |
144 | } else { | ||
145 | fe = tda10023_attach(&vp2033_tda10023_cu1216_config, | ||
146 | adapter, | ||
147 | read_pwm(mantis)); | ||
148 | |||
149 | if (fe) { | ||
150 | dprintk(MANTIS_ERROR, 1, | ||
151 | "found Philips CU1216 DVB-C frontend (TDA10023) @ 0x%02x", | ||
152 | vp2033_tda1002x_cu1216_config.demod_address); | ||
153 | } | ||
144 | } | 154 | } |
145 | } | ||
146 | 155 | ||
147 | if (fe) { | 156 | if (fe) { |
148 | fe->ops.tuner_ops.set_params = tda1002x_cu1216_tuner_set; | 157 | fe->ops.tuner_ops.set_params = tda1002x_cu1216_tuner_set; |
149 | dprintk(MANTIS_ERROR, 1, "Mantis DVB-C Philips CU1216 frontend attach success"); | 158 | dprintk(MANTIS_ERROR, 1, "Mantis DVB-C Philips CU1216 frontend attach success"); |
159 | } else { | ||
160 | return -1; | ||
161 | } | ||
150 | } else { | 162 | } else { |
151 | return -1; | 163 | dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", |
164 | adapter->name, | ||
165 | err); | ||
166 | |||
167 | return -EIO; | ||
152 | } | 168 | } |
153 | 169 | ||
154 | mantis->fe = fe; | 170 | mantis->fe = fe; |
@@ -167,4 +183,6 @@ struct mantis_hwconfig vp2033_config = { | |||
167 | .bytes = 0, | 183 | .bytes = 0, |
168 | 184 | ||
169 | .frontend_init = vp2033_frontend_init, | 185 | .frontend_init = vp2033_frontend_init, |
186 | .power = GPIF_A12, | ||
187 | .reset = GPIF_A13, | ||
170 | }; | 188 | }; |