1#ifndef _DVB_USB_M920X_H_ 2#define _DVB_USB_M920X_H_ 3 4#define DVB_USB_LOG_PREFIX "m920x" 5#include "dvb-usb.h" 6 7#define deb(args...) dprintk(dvb_usb_m920x_debug,0x01,args) 8 9#define M9206_CORE 0x22 10#define M9206_RC_STATE 0xff51 11#define M9206_RC_KEY 0xff52 12#define M9206_RC_INIT1 0xff54 13#define M9206_RC_INIT2 0xff55 14#define M9206_FW_GO 0xff69 15 16#define M9206_I2C 0x23 17#define M9206_FILTER 0x25 18#define M9206_FW 0x30 19 20#define M9206_MAX_FILTERS 8 21 22/* 23sequences found in logs: 24[index value] 250x80 write addr 26(0x00 out byte)* 270x40 out byte 28 290x80 write addr 30(0x00 out byte)* 310x80 read addr 32(0x21 in byte)* 330x60 in byte 34 35this sequence works: 360x80 read addr 37(0x21 in byte)* 380x60 in byte 39 40Guess at API of the I2C function: 41I2C operation is done one byte at a time with USB control messages. The 42index the messages is sent to is made up of a set of flags that control 43the I2C bus state: 440x80: 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. 470x40: Send STOP condition. This should be set on the last byte of an 48 I2C transaction. 490x20: 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. 530x01: 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 58What any other bits might mean, or how to get the slave's ACK/NACK 59response to a write, is unknown. 60*/ 61 62struct m920x_state { 63 u16 filters[M9206_MAX_FILTERS]; 64 int filtering_enabled; 65 int rep_count; 66}; 67 68/* Initialisation data for the m920x 69 */ 70 71struct m920x_inits { 72 u16 address; 73 u8 data; 74}; 75 76#endif 77