Commit 54d859ec authored by Andreas Regel's avatar Andreas Regel Committed by Mauro Carvalho Chehab

V4L/DVB (11583): isl6423: Various fixes to use external modulation

Use external modulation
Signed-off-by: default avatarAndreas Regel <andreas.regel@gmx.de>
Signed-off-by: default avatarManu Abraham <manu@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 56571507
...@@ -73,6 +73,7 @@ static int isl6423_write(struct isl6423_dev *isl6423, u8 reg) ...@@ -73,6 +73,7 @@ static int isl6423_write(struct isl6423_dev *isl6423, u8 reg)
struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = &reg, .len = 1 }; struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = &reg, .len = 1 };
dprintk(FE_DEBUG, 1, "write reg %02X", reg);
err = i2c_transfer(i2c, &msg, 1); err = i2c_transfer(i2c, &msg, 1);
if (err < 0) if (err < 0)
goto exit; goto exit;
...@@ -133,6 +134,9 @@ static int isl6423_voltage_boost(struct dvb_frontend *fe, long arg) ...@@ -133,6 +134,9 @@ static int isl6423_voltage_boost(struct dvb_frontend *fe, long arg)
if (err < 0) if (err < 0)
goto exit; goto exit;
isl6423->reg_3 = reg_3;
isl6423->reg_4 = reg_4;
return 0; return 0;
exit: exit:
dprintk(FE_ERROR, 1, "I/O error <%d>", err); dprintk(FE_ERROR, 1, "I/O error <%d>", err);
...@@ -144,12 +148,10 @@ static int isl6423_set_voltage(struct dvb_frontend *fe, ...@@ -144,12 +148,10 @@ static int isl6423_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage) enum fe_sec_voltage voltage)
{ {
struct isl6423_dev *isl6423 = (struct isl6423_dev *) fe->sec_priv; struct isl6423_dev *isl6423 = (struct isl6423_dev *) fe->sec_priv;
u8 reg_3 = isl6423->reg_3;
u8 reg_4 = isl6423->reg_4; u8 reg_4 = isl6423->reg_4;
int err = 0; int err = 0;
/* SR4H = 0, SR4M = 1, SR4L = 1 */
reg_4 = 0x03 << 5;
switch (voltage) { switch (voltage) {
case SEC_VOLTAGE_OFF: case SEC_VOLTAGE_OFF:
/* EN = 0 */ /* EN = 0 */
...@@ -160,6 +162,7 @@ static int isl6423_set_voltage(struct dvb_frontend *fe, ...@@ -160,6 +162,7 @@ static int isl6423_set_voltage(struct dvb_frontend *fe,
/* EN = 1, VSPEN = 1, VTOP = 0, VBOT = 0 */ /* EN = 1, VSPEN = 1, VTOP = 0, VBOT = 0 */
reg_4 |= (1 << 4); reg_4 |= (1 << 4);
reg_4 &= ~0x3; reg_4 &= ~0x3;
reg_3 |= (1 << 3);
break; break;
case SEC_VOLTAGE_18: case SEC_VOLTAGE_18:
...@@ -167,15 +170,23 @@ static int isl6423_set_voltage(struct dvb_frontend *fe, ...@@ -167,15 +170,23 @@ static int isl6423_set_voltage(struct dvb_frontend *fe,
reg_4 |= (1 << 4); reg_4 |= (1 << 4);
reg_4 |= 0x2; reg_4 |= 0x2;
reg_4 &= ~0x1; reg_4 &= ~0x1;
reg_3 |= (1 << 3);
break; break;
default: default:
break; break;
} }
err = isl6423_write(isl6423, reg_3);
if (err < 0)
goto exit;
err = isl6423_write(isl6423, reg_4); err = isl6423_write(isl6423, reg_4);
if (err < 0) if (err < 0)
goto exit; goto exit;
isl6423->reg_3 = reg_3;
isl6423->reg_4 = reg_4;
return 0; return 0;
exit: exit:
dprintk(FE_ERROR, 1, "I/O error <%d>", err); dprintk(FE_ERROR, 1, "I/O error <%d>", err);
...@@ -189,9 +200,6 @@ static int isl6423_set_current(struct dvb_frontend *fe) ...@@ -189,9 +200,6 @@ static int isl6423_set_current(struct dvb_frontend *fe)
const struct isl6423_config *config = isl6423->config; const struct isl6423_config *config = isl6423->config;
int err = 0; int err = 0;
/* SR3H = 0, SR3M = 1, SR3L = 0 */
reg_3 = 0x02 << 5;
switch (config->current_max) { switch (config->current_max) {
case SEC_CURRENT_275m: case SEC_CURRENT_275m:
/* 275mA */ /* 275mA */
...@@ -226,13 +234,13 @@ static int isl6423_set_current(struct dvb_frontend *fe) ...@@ -226,13 +234,13 @@ static int isl6423_set_current(struct dvb_frontend *fe)
switch (config->curlim) { switch (config->curlim) {
case SEC_CURRENT_LIM_ON: case SEC_CURRENT_LIM_ON:
/* DCL = 1 */ /* DCL = 0 */
reg_3 |= 0x10; reg_3 &= ~0x10;
break; break;
case SEC_CURRENT_LIM_OFF: case SEC_CURRENT_LIM_OFF:
/* DCL = 0 */ /* DCL = 1 */
reg_3 &= ~0x10; reg_3 |= 0x10;
break; break;
} }
...@@ -240,6 +248,8 @@ static int isl6423_set_current(struct dvb_frontend *fe) ...@@ -240,6 +248,8 @@ static int isl6423_set_current(struct dvb_frontend *fe)
if (err < 0) if (err < 0)
goto exit; goto exit;
isl6423->reg_3 = reg_3;
return 0; return 0;
exit: exit:
dprintk(FE_ERROR, 1, "I/O error <%d>", err); dprintk(FE_ERROR, 1, "I/O error <%d>", err);
...@@ -268,6 +278,11 @@ struct dvb_frontend *isl6423_attach(struct dvb_frontend *fe, ...@@ -268,6 +278,11 @@ struct dvb_frontend *isl6423_attach(struct dvb_frontend *fe,
isl6423->i2c = i2c; isl6423->i2c = i2c;
fe->sec_priv = isl6423; fe->sec_priv = isl6423;
/* SR3H = 0, SR3M = 1, SR3L = 0 */
isl6423->reg_3 = 0x02 << 5;
/* SR4H = 0, SR4M = 1, SR4L = 1 */
isl6423->reg_4 = 0x03 << 5;
if (isl6423_set_current(fe)) if (isl6423_set_current(fe))
goto exit; goto exit;
......
...@@ -1383,6 +1383,7 @@ static struct stv6110x_config tt1600_stv6110x_config = { ...@@ -1383,6 +1383,7 @@ static struct stv6110x_config tt1600_stv6110x_config = {
static struct isl6423_config tt1600_isl6423_config = { static struct isl6423_config tt1600_isl6423_config = {
.current_max = SEC_CURRENT_515m, .current_max = SEC_CURRENT_515m,
.curlim = SEC_CURRENT_LIM_ON, .curlim = SEC_CURRENT_LIM_ON,
.mod_extern = 1,
.addr = 0x08, .addr = 0x08,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment