diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/m920x.h')
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.h | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/drivers/media/dvb/dvb-usb/m920x.h b/drivers/media/dvb/dvb-usb/m920x.h index c354196ffe5d..7dd3db65c80e 100644 --- a/drivers/media/dvb/dvb-usb/m920x.h +++ b/drivers/media/dvb/dvb-usb/m920x.h | |||
@@ -19,17 +19,49 @@ | |||
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 | Guess at API of the I2C function: | ||
41 | I2C operation is done one byte at a time with USB control messages. The | ||
42 | index the messages is sent to is made up of a set of flags that control | ||
43 | the I2C bus state: | ||
44 | 0x80: Send START condition. After a START condition, one would normally | ||
45 | always send the 7-bit slave I2C address as the 7 MSB, followed by | ||
46 | the read/write bit as the LSB. | ||
47 | 0x40: Send STOP condition. This should be set on the last byte of an | ||
48 | I2C transaction. | ||
49 | 0x20: Read a byte from the slave. As opposed to writing a byte to the | ||
50 | slave. The slave will normally not produce any data unless you | ||
51 | set the R/W bit to 1 when sending the slave's address after the | ||
52 | START condition. | ||
53 | 0x01: Respond with ACK, as opposed to a NACK. For a multi-byte read, | ||
54 | the master should send an ACK, that is pull SDA low during the 9th | ||
55 | clock cycle, after every byte but the last. This flags only makes | ||
56 | sense when bit 0x20 is set, indicating a read. | ||
57 | |||
58 | What any other bits might mean, or how to get the slave's ACK/NACK | ||
59 | response to a write, is unknown. | ||
60 | */ | ||
25 | 61 | ||
26 | struct m9206_state { | 62 | struct m9206_state { |
27 | u16 filters[M9206_MAX_FILTERS]; | 63 | u16 filters[M9206_MAX_FILTERS]; |
28 | int filtering_enabled; | 64 | int filtering_enabled; |
29 | int rep_count; | 65 | int rep_count; |
30 | struct { | ||
31 | unsigned char addr; | ||
32 | unsigned char magic; | ||
33 | }i2c_r[M9206_I2C_MAX]; | ||
34 | }; | 66 | }; |
35 | #endif | 67 | #endif |