aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@linuxtv.org>2009-03-11 02:00:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:24 -0400
commit083a17317be27a0f33d999b4360320b322a8b55b (patch)
tree0a6248807c999fb1753f4585bad0f316d517b7a5
parent0c44bf362fc1f0dc927b814184d9b877a2f507cf (diff)
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: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/frontends/au8522_dig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/au8522_dig.c b/drivers/media/dvb/frontends/au8522_dig.c
index 8082547c73e2..17bdbe2c67e6 100644
--- a/drivers/media/dvb/frontends/au8522_dig.c
+++ b/drivers/media/dvb/frontends/au8522_dig.c
@@ -40,7 +40,7 @@ static int debug;
40int au8522_writereg(struct au8522_state *state, u16 reg, u8 data) 40int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
41{ 41{
42 int ret; 42 int ret;
43 u8 buf [] = { reg >> 8, reg & 0xff, data }; 43 u8 buf [] = { (reg >> 8) | 0x80, reg & 0xff, data };
44 44
45 struct i2c_msg msg = { .addr = state->config->demod_address, 45 struct i2c_msg msg = { .addr = state->config->demod_address,
46 .flags = 0, .buf = buf, .len = 3 }; 46 .flags = 0, .buf = buf, .len = 3 };
@@ -57,7 +57,7 @@ int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
57u8 au8522_readreg(struct au8522_state *state, u16 reg) 57u8 au8522_readreg(struct au8522_state *state, u16 reg)
58{ 58{
59 int ret; 59 int ret;
60 u8 b0 [] = { reg >> 8, reg & 0xff }; 60 u8 b0 [] = { (reg >> 8) | 0x40, reg & 0xff };
61 u8 b1 [] = { 0 }; 61 u8 b1 [] = { 0 };
62 62
63 struct i2c_msg msg [] = { 63 struct i2c_msg msg [] = {