diff options
Diffstat (limited to 'drivers/media/dvb-frontends/tda10071.c')
-rw-r--r-- | drivers/media/dvb-frontends/tda10071.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index 16a4bc54dbe7..2521f7e23018 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/media/dvb-frontends/tda10071.c | |||
@@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, u8 reg, u8 *val, | |||
30 | u8 buf[len+1]; | 30 | u8 buf[len+1]; |
31 | struct i2c_msg msg[1] = { | 31 | struct i2c_msg msg[1] = { |
32 | { | 32 | { |
33 | .addr = priv->cfg.i2c_address, | 33 | .addr = priv->cfg.demod_i2c_addr, |
34 | .flags = 0, | 34 | .flags = 0, |
35 | .len = sizeof(buf), | 35 | .len = sizeof(buf), |
36 | .buf = buf, | 36 | .buf = buf, |
@@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv *priv, u8 reg, u8 *val, | |||
59 | u8 buf[len]; | 59 | u8 buf[len]; |
60 | struct i2c_msg msg[2] = { | 60 | struct i2c_msg msg[2] = { |
61 | { | 61 | { |
62 | .addr = priv->cfg.i2c_address, | 62 | .addr = priv->cfg.demod_i2c_addr, |
63 | .flags = 0, | 63 | .flags = 0, |
64 | .len = 1, | 64 | .len = 1, |
65 | .buf = ®, | 65 | .buf = ®, |
66 | }, { | 66 | }, { |
67 | .addr = priv->cfg.i2c_address, | 67 | .addr = priv->cfg.demod_i2c_addr, |
68 | .flags = I2C_M_RD, | 68 | .flags = I2C_M_RD, |
69 | .len = sizeof(buf), | 69 | .len = sizeof(buf), |
70 | .buf = buf, | 70 | .buf = buf, |
@@ -1064,7 +1064,7 @@ static int tda10071_init(struct dvb_frontend *fe) | |||
1064 | cmd.args[2] = 0x00; | 1064 | cmd.args[2] = 0x00; |
1065 | cmd.args[3] = 0x00; | 1065 | cmd.args[3] = 0x00; |
1066 | cmd.args[4] = 0x00; | 1066 | cmd.args[4] = 0x00; |
1067 | cmd.args[5] = 0x14; | 1067 | cmd.args[5] = (priv->cfg.tuner_i2c_addr) ? priv->cfg.tuner_i2c_addr : 0x14; |
1068 | cmd.args[6] = 0x00; | 1068 | cmd.args[6] = 0x00; |
1069 | cmd.args[7] = 0x03; | 1069 | cmd.args[7] = 0x03; |
1070 | cmd.args[8] = 0x02; | 1070 | cmd.args[8] = 0x02; |
@@ -1202,6 +1202,20 @@ struct dvb_frontend *tda10071_attach(const struct tda10071_config *config, | |||
1202 | goto error; | 1202 | goto error; |
1203 | } | 1203 | } |
1204 | 1204 | ||
1205 | /* make sure demod i2c address is specified */ | ||
1206 | if (!config->demod_i2c_addr) { | ||
1207 | dev_dbg(&i2c->dev, "%s: invalid demod i2c address!\n", __func__); | ||
1208 | ret = -EINVAL; | ||
1209 | goto error; | ||
1210 | } | ||
1211 | |||
1212 | /* make sure tuner i2c address is specified */ | ||
1213 | if (!config->tuner_i2c_addr) { | ||
1214 | dev_dbg(&i2c->dev, "%s: invalid tuner i2c address!\n", __func__); | ||
1215 | ret = -EINVAL; | ||
1216 | goto error; | ||
1217 | } | ||
1218 | |||
1205 | /* setup the priv */ | 1219 | /* setup the priv */ |
1206 | priv->i2c = i2c; | 1220 | priv->i2c = i2c; |
1207 | memcpy(&priv->cfg, config, sizeof(struct tda10071_config)); | 1221 | memcpy(&priv->cfg, config, sizeof(struct tda10071_config)); |