Commit 083a1731 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (11062): au8522: fix register read/write high bits

For the i2c messages to read and write registers, the two high order bits
of the first byte dictates whether it is a read or a write operation.

Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth
<stoth@linuxtv.org> for providing sample hardware, engineering level support,
and testing.
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0c44bf36
...@@ -40,7 +40,7 @@ static int debug; ...@@ -40,7 +40,7 @@ static int debug;
int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
{ {
int ret; int ret;
u8 buf [] = { reg >> 8, reg & 0xff, data }; u8 buf [] = { (reg >> 8) | 0x80, reg & 0xff, data };
struct i2c_msg msg = { .addr = state->config->demod_address, struct i2c_msg msg = { .addr = state->config->demod_address,
.flags = 0, .buf = buf, .len = 3 }; .flags = 0, .buf = buf, .len = 3 };
...@@ -57,7 +57,7 @@ int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) ...@@ -57,7 +57,7 @@ int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
u8 au8522_readreg(struct au8522_state *state, u16 reg) u8 au8522_readreg(struct au8522_state *state, u16 reg)
{ {
int ret; int ret;
u8 b0 [] = { reg >> 8, reg & 0xff }; u8 b0 [] = { (reg >> 8) | 0x40, reg & 0xff };
u8 b1 [] = { 0 }; u8 b1 [] = { 0 };
struct i2c_msg msg [] = { struct i2c_msg msg [] = {
......
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