diff options
author | Aapo Tahkola <aet@rasterburn.org> | 2007-03-05 16:23:19 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:44:35 -0400 |
commit | 26247018be1ca7ca464f5f32e8ca7c897ded5393 (patch) | |
tree | f73212d3525ecf69d36700ffc59e91be11b26de1 /drivers/media/dvb/dvb-usb/m920x.h | |
parent | fee73165ee0ff7cfbffad4233a70f56b821f434e (diff) |
V4L/DVB (5423): M920x: i2c cleanups
- Implement m920x i2c as suggested by Pierre Willenbrock
- remove "magic" hack
- r/w bit is not part of the i2c address
- move hardware remarks to header file
Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/m920x.h')
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/media/dvb/dvb-usb/m920x.h b/drivers/media/dvb/dvb-usb/m920x.h index c354196ffe5d..c5ef592cbfee 100644 --- a/drivers/media/dvb/dvb-usb/m920x.h +++ b/drivers/media/dvb/dvb-usb/m920x.h | |||
@@ -19,17 +19,35 @@ | |||
19 | 19 | ||
20 | #define M9206_MAX_FILTERS 8 | 20 | #define M9206_MAX_FILTERS 8 |
21 | 21 | ||
22 | #define M9206_I2C_TUNER 0 | 22 | /* |
23 | #define M9206_I2C_DEMOD 1 | 23 | sequences found in logs: |
24 | #define M9206_I2C_MAX 2 | 24 | [index value] |
25 | 0x80 write addr | ||
26 | (0x00 out byte)* | ||
27 | 0x40 out byte | ||
28 | |||
29 | 0x80 write addr | ||
30 | (0x00 out byte)* | ||
31 | 0x80 read addr | ||
32 | (0x21 in byte)* | ||
33 | 0x60 in byte | ||
34 | |||
35 | this sequence works: | ||
36 | 0x80 read addr | ||
37 | (0x21 in byte)* | ||
38 | 0x60 in byte | ||
39 | |||
40 | _my guess_: | ||
41 | 0x80: begin i2c transfer using address. value=address<<1|(reading?1:0) | ||
42 | 0x00: write byte | ||
43 | 0x21: read byte, more to follow | ||
44 | 0x40: write last byte of message sequence | ||
45 | 0x60: read last byte of message sequence | ||
46 | */ | ||
25 | 47 | ||
26 | struct m9206_state { | 48 | struct m9206_state { |
27 | u16 filters[M9206_MAX_FILTERS]; | 49 | u16 filters[M9206_MAX_FILTERS]; |
28 | int filtering_enabled; | 50 | int filtering_enabled; |
29 | int rep_count; | 51 | int rep_count; |
30 | struct { | ||
31 | unsigned char addr; | ||
32 | unsigned char magic; | ||
33 | }i2c_r[M9206_I2C_MAX]; | ||
34 | }; | 52 | }; |
35 | #endif | 53 | #endif |