Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153926
b: refs/heads/master
c: 68191ed
h: refs/heads/master
v: v3
  • Loading branch information
Abylay Ospan authored and Mauro Carvalho Chehab committed Jun 23, 2009
1 parent 4a3ee3c commit 0fe67bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 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: 0cde9b2533d6fe79307173f24209228aaf34bc98
refs/heads/master: 68191edeb50773993f4a05651b0a085bd110fbeb
40 changes: 20 additions & 20 deletions trunk/drivers/media/dvb/frontends/stv0900_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,31 +149,31 @@ void stv0900_write_reg(struct stv0900_internal *i_params, u16 reg_addr,
dprintk(KERN_ERR "%s: i2c error %d\n", __func__, ret);
}

u8 stv0900_read_reg(struct stv0900_internal *i_params, u16 reg_addr)
u8 stv0900_read_reg(struct stv0900_internal *i_params, u16 reg)
{
u8 data[2];
int ret;
struct i2c_msg i2cmsg = {
.addr = i_params->i2c_addr,
.flags = 0,
.len = 2,
.buf = data,
u8 b0[] = { MSB(reg), LSB(reg) };
u8 buf = 0;
struct i2c_msg msg[] = {
{
.addr = i_params->i2c_addr,
.flags = 0,
.buf = b0,
.len = 2,
}, {
.addr = i_params->i2c_addr,
.flags = I2C_M_RD,
.buf = &buf,
.len = 1,
},
};

data[0] = MSB(reg_addr);
data[1] = LSB(reg_addr);

ret = i2c_transfer(i_params->i2c_adap, &i2cmsg, 1);
if (ret != 1)
dprintk(KERN_ERR "%s: i2c error %d\n", __func__, ret);

i2cmsg.flags = I2C_M_RD;
i2cmsg.len = 1;
ret = i2c_transfer(i_params->i2c_adap, &i2cmsg, 1);
if (ret != 1)
dprintk(KERN_ERR "%s: i2c error %d\n", __func__, ret);
ret = i2c_transfer(i_params->i2c_adap, msg, 2);
if (ret != 2)
dprintk(KERN_ERR "%s: i2c error %d, reg[0x%02x]\n",
__func__, ret, reg);

return data[0];
return buf;
}

void extract_mask_pos(u32 label, u8 *mask, u8 *pos)
Expand Down

0 comments on commit 0fe67bc

Please sign in to comment.