diff options
author | Andreas Regel <andreas.regel@gmx.de> | 2009-04-07 15:09:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:38 -0400 |
commit | 54d859ec563d2f0cbbc03e45e204325c5f2118bf (patch) | |
tree | e104962e867e5af697d52e2d87e78430e3d89381 /drivers/media/dvb | |
parent | 5657150759ab67292db0333808a069970328663b (diff) |
V4L/DVB (11583): isl6423: Various fixes to use external modulation
Use external modulation
Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/isl6423.c | 35 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-ci.c | 1 |
2 files changed, 26 insertions, 10 deletions
diff --git a/drivers/media/dvb/frontends/isl6423.c b/drivers/media/dvb/frontends/isl6423.c index c1943dcb8db6..dca5bebfeeb5 100644 --- a/drivers/media/dvb/frontends/isl6423.c +++ b/drivers/media/dvb/frontends/isl6423.c | |||
@@ -73,6 +73,7 @@ static int isl6423_write(struct isl6423_dev *isl6423, u8 reg) | |||
73 | 73 | ||
74 | struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = ®, .len = 1 }; | 74 | struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = ®, .len = 1 }; |
75 | 75 | ||
76 | dprintk(FE_DEBUG, 1, "write reg %02X", reg); | ||
76 | err = i2c_transfer(i2c, &msg, 1); | 77 | err = i2c_transfer(i2c, &msg, 1); |
77 | if (err < 0) | 78 | if (err < 0) |
78 | goto exit; | 79 | goto exit; |
@@ -133,6 +134,9 @@ static int isl6423_voltage_boost(struct dvb_frontend *fe, long arg) | |||
133 | if (err < 0) | 134 | if (err < 0) |
134 | goto exit; | 135 | goto exit; |
135 | 136 | ||
137 | isl6423->reg_3 = reg_3; | ||
138 | isl6423->reg_4 = reg_4; | ||
139 | |||
136 | return 0; | 140 | return 0; |
137 | exit: | 141 | exit: |
138 | dprintk(FE_ERROR, 1, "I/O error <%d>", err); | 142 | dprintk(FE_ERROR, 1, "I/O error <%d>", err); |
@@ -144,12 +148,10 @@ static int isl6423_set_voltage(struct dvb_frontend *fe, | |||
144 | enum fe_sec_voltage voltage) | 148 | enum fe_sec_voltage voltage) |
145 | { | 149 | { |
146 | struct isl6423_dev *isl6423 = (struct isl6423_dev *) fe->sec_priv; | 150 | struct isl6423_dev *isl6423 = (struct isl6423_dev *) fe->sec_priv; |
151 | u8 reg_3 = isl6423->reg_3; | ||
147 | u8 reg_4 = isl6423->reg_4; | 152 | u8 reg_4 = isl6423->reg_4; |
148 | int err = 0; | 153 | int err = 0; |
149 | 154 | ||
150 | /* SR4H = 0, SR4M = 1, SR4L = 1 */ | ||
151 | reg_4 = 0x03 << 5; | ||
152 | |||
153 | switch (voltage) { | 155 | switch (voltage) { |
154 | case SEC_VOLTAGE_OFF: | 156 | case SEC_VOLTAGE_OFF: |
155 | /* EN = 0 */ | 157 | /* EN = 0 */ |
@@ -160,6 +162,7 @@ static int isl6423_set_voltage(struct dvb_frontend *fe, | |||
160 | /* EN = 1, VSPEN = 1, VTOP = 0, VBOT = 0 */ | 162 | /* EN = 1, VSPEN = 1, VTOP = 0, VBOT = 0 */ |
161 | reg_4 |= (1 << 4); | 163 | reg_4 |= (1 << 4); |
162 | reg_4 &= ~0x3; | 164 | reg_4 &= ~0x3; |
165 | reg_3 |= (1 << 3); | ||
163 | break; | 166 | break; |
164 | 167 | ||
165 | case SEC_VOLTAGE_18: | 168 | case SEC_VOLTAGE_18: |
@@ -167,15 +170,23 @@ static int isl6423_set_voltage(struct dvb_frontend *fe, | |||
167 | reg_4 |= (1 << 4); | 170 | reg_4 |= (1 << 4); |
168 | reg_4 |= 0x2; | 171 | reg_4 |= 0x2; |
169 | reg_4 &= ~0x1; | 172 | reg_4 &= ~0x1; |
173 | reg_3 |= (1 << 3); | ||
170 | break; | 174 | break; |
171 | 175 | ||
172 | default: | 176 | default: |
173 | break; | 177 | break; |
174 | } | 178 | } |
179 | err = isl6423_write(isl6423, reg_3); | ||
180 | if (err < 0) | ||
181 | goto exit; | ||
182 | |||
175 | err = isl6423_write(isl6423, reg_4); | 183 | err = isl6423_write(isl6423, reg_4); |
176 | if (err < 0) | 184 | if (err < 0) |
177 | goto exit; | 185 | goto exit; |
178 | 186 | ||
187 | isl6423->reg_3 = reg_3; | ||
188 | isl6423->reg_4 = reg_4; | ||
189 | |||
179 | return 0; | 190 | return 0; |
180 | exit: | 191 | exit: |
181 | dprintk(FE_ERROR, 1, "I/O error <%d>", err); | 192 | dprintk(FE_ERROR, 1, "I/O error <%d>", err); |
@@ -189,9 +200,6 @@ static int isl6423_set_current(struct dvb_frontend *fe) | |||
189 | const struct isl6423_config *config = isl6423->config; | 200 | const struct isl6423_config *config = isl6423->config; |
190 | int err = 0; | 201 | int err = 0; |
191 | 202 | ||
192 | /* SR3H = 0, SR3M = 1, SR3L = 0 */ | ||
193 | reg_3 = 0x02 << 5; | ||
194 | |||
195 | switch (config->current_max) { | 203 | switch (config->current_max) { |
196 | case SEC_CURRENT_275m: | 204 | case SEC_CURRENT_275m: |
197 | /* 275mA */ | 205 | /* 275mA */ |
@@ -226,13 +234,13 @@ static int isl6423_set_current(struct dvb_frontend *fe) | |||
226 | 234 | ||
227 | switch (config->curlim) { | 235 | switch (config->curlim) { |
228 | case SEC_CURRENT_LIM_ON: | 236 | case SEC_CURRENT_LIM_ON: |
229 | /* DCL = 1 */ | 237 | /* DCL = 0 */ |
230 | reg_3 |= 0x10; | 238 | reg_3 &= ~0x10; |
231 | break; | 239 | break; |
232 | 240 | ||
233 | case SEC_CURRENT_LIM_OFF: | 241 | case SEC_CURRENT_LIM_OFF: |
234 | /* DCL = 0 */ | 242 | /* DCL = 1 */ |
235 | reg_3 &= ~0x10; | 243 | reg_3 |= 0x10; |
236 | break; | 244 | break; |
237 | } | 245 | } |
238 | 246 | ||
@@ -240,6 +248,8 @@ static int isl6423_set_current(struct dvb_frontend *fe) | |||
240 | if (err < 0) | 248 | if (err < 0) |
241 | goto exit; | 249 | goto exit; |
242 | 250 | ||
251 | isl6423->reg_3 = reg_3; | ||
252 | |||
243 | return 0; | 253 | return 0; |
244 | exit: | 254 | exit: |
245 | dprintk(FE_ERROR, 1, "I/O error <%d>", err); | 255 | dprintk(FE_ERROR, 1, "I/O error <%d>", err); |
@@ -268,6 +278,11 @@ struct dvb_frontend *isl6423_attach(struct dvb_frontend *fe, | |||
268 | isl6423->i2c = i2c; | 278 | isl6423->i2c = i2c; |
269 | fe->sec_priv = isl6423; | 279 | fe->sec_priv = isl6423; |
270 | 280 | ||
281 | /* SR3H = 0, SR3M = 1, SR3L = 0 */ | ||
282 | isl6423->reg_3 = 0x02 << 5; | ||
283 | /* SR4H = 0, SR4M = 1, SR4L = 1 */ | ||
284 | isl6423->reg_4 = 0x03 << 5; | ||
285 | |||
271 | if (isl6423_set_current(fe)) | 286 | if (isl6423_set_current(fe)) |
272 | goto exit; | 287 | goto exit; |
273 | 288 | ||
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index dbdc7953c6a1..e1c83c513f3c 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -1383,6 +1383,7 @@ static struct stv6110x_config tt1600_stv6110x_config = { | |||
1383 | static struct isl6423_config tt1600_isl6423_config = { | 1383 | static struct isl6423_config tt1600_isl6423_config = { |
1384 | .current_max = SEC_CURRENT_515m, | 1384 | .current_max = SEC_CURRENT_515m, |
1385 | .curlim = SEC_CURRENT_LIM_ON, | 1385 | .curlim = SEC_CURRENT_LIM_ON, |
1386 | .mod_extern = 1, | ||
1386 | .addr = 0x08, | 1387 | .addr = 0x08, |
1387 | }; | 1388 | }; |
1388 | 1389 | ||