Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357077
b: refs/heads/master
c: 41f55d5
h: refs/heads/master
i:
  357075: 1a78ada
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent 79c2d75 commit badada3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb9e31f3928dd9b1ecb66689890d1f5f3d19227c
refs/heads/master: 41f55d57552b7d2236f94fccb5cdd07dbf2e8557
18 changes: 15 additions & 3 deletions trunk/drivers/media/dvb-frontends/tda10071.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static int tda10071_wr_regs(struct tda10071_priv *priv, u8 reg, u8 *val,
u8 buf[len+1];
struct i2c_msg msg[1] = {
{
.addr = priv->cfg.i2c_address,
.addr = priv->cfg.demod_i2c_addr,
.flags = 0,
.len = sizeof(buf),
.buf = buf,
Expand Down Expand Up @@ -59,12 +59,12 @@ static int tda10071_rd_regs(struct tda10071_priv *priv, u8 reg, u8 *val,
u8 buf[len];
struct i2c_msg msg[2] = {
{
.addr = priv->cfg.i2c_address,
.addr = priv->cfg.demod_i2c_addr,
.flags = 0,
.len = 1,
.buf = &reg,
}, {
.addr = priv->cfg.i2c_address,
.addr = priv->cfg.demod_i2c_addr,
.flags = I2C_M_RD,
.len = sizeof(buf),
.buf = buf,
Expand Down Expand Up @@ -1202,6 +1202,18 @@ struct dvb_frontend *tda10071_attach(const struct tda10071_config *config,
goto error;
}

/* make sure demod i2c address is specified */
if (!config->demod_i2c_addr) {
dev_dbg(&i2c->dev, "%s: invalid demod i2c address!\n", __func__);
goto error;
}

/* make sure tuner i2c address is specified */
if (!config->tuner_i2c_addr) {
dev_dbg(&i2c->dev, "%s: invalid tuner i2c address!\n", __func__);
goto error;
}

/* setup the priv */
priv->i2c = i2c;
memcpy(&priv->cfg, config, sizeof(struct tda10071_config));
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb-frontends/tda10071.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ struct tda10071_config {
* Default: none, must set
* Values: 0x55,
*/
u8 i2c_address;
u8 demod_i2c_addr;

/* Tuner I2C address.
* Default: 0x14
* Default: none, must set
* Values: 0x14, 0x54, ...
*/
u8 tuner_i2c_addr;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/pci/cx23885/cx23885-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ static struct mt2063_config terratec_mt2063_config[] = {
};

static const struct tda10071_config hauppauge_tda10071_config = {
.i2c_address = 0x05,
.demod_i2c_addr = 0x05,
.tuner_i2c_addr = 0x54,
.i2c_wr_max = 64,
.ts_mode = TDA10071_TS_SERIAL,
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/media/usb/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ static struct tda18271_config em28xx_cxd2820r_tda18271_config = {
};

static const struct tda10071_config em28xx_tda10071_config = {
.i2c_address = 0x55, /* (0xaa >> 1) */
.demod_i2c_addr = 0x55, /* (0xaa >> 1) */
.tuner_i2c_addr = 0x14,
.i2c_wr_max = 64,
.ts_mode = TDA10071_TS_SERIAL,
.spec_inv = 0,
Expand Down

0 comments on commit badada3

Please sign in to comment.