xref: /openbmc/linux/drivers/media/usb/dvb-usb/cxusb.h (revision d3964221)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _DVB_USB_CXUSB_H_
3 #define _DVB_USB_CXUSB_H_
4 
5 #define DVB_USB_LOG_PREFIX "cxusb"
6 #include "dvb-usb.h"
7 
8 /* usb commands - some of it are guesses, don't have a reference yet */
9 #define CMD_BLUEBIRD_GPIO_RW 0x05
10 
11 #define CMD_I2C_WRITE     0x08
12 #define CMD_I2C_READ      0x09
13 
14 #define CMD_GPIO_READ     0x0d
15 #define CMD_GPIO_WRITE    0x0e
16 #define     GPIO_TUNER         0x02
17 
18 #define CMD_POWER_OFF     0xdc
19 #define CMD_POWER_ON      0xde
20 
21 #define CMD_STREAMING_ON  0x36
22 #define CMD_STREAMING_OFF 0x37
23 
24 #define CMD_AVER_STREAM_ON  0x18
25 #define CMD_AVER_STREAM_OFF 0x19
26 
27 #define CMD_GET_IR_CODE   0x47
28 
29 #define CMD_ANALOG        0x50
30 #define CMD_DIGITAL       0x51
31 
32 /* Max transfer size done by I2C transfer functions */
33 #define MAX_XFER_SIZE  80
34 
35 struct cxusb_state {
36 	u8 gpio_write_state[3];
37 	struct i2c_client *i2c_client_demod;
38 	struct i2c_client *i2c_client_tuner;
39 
40 	unsigned char data[MAX_XFER_SIZE];
41 
42 	struct mutex stream_mutex;
43 	u8 last_lock;
44 	int (*fe_read_status)(struct dvb_frontend *fe,
45 		enum fe_status *status);
46 };
47 
48 #endif
49