Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 1 | /* dvb-usb.h is part of the DVB USB library. |
| 2 | * |
| 3 | * Copyright (C) 2004-6 Patrick Boettcher (patrick.boettcher@desy.de) |
| 4 | * see dvb-usb-init.c for copyright information. |
| 5 | * |
| 6 | * the headerfile, all dvb-usb-drivers have to include. |
| 7 | * |
| 8 | * TODO: clean-up the structures for unused fields and update the comments |
| 9 | */ |
| 10 | #ifndef DVB_USB_H |
| 11 | #define DVB_USB_H |
| 12 | |
| 13 | #include <linux/input.h> |
| 14 | #include <linux/usb.h> |
| 15 | #include <linux/firmware.h> |
| 16 | #include <linux/mutex.h> |
| 17 | #include <media/rc-core.h> |
| 18 | |
| 19 | #include "dvb_frontend.h" |
| 20 | #include "dvb_demux.h" |
| 21 | #include "dvb_net.h" |
| 22 | #include "dmxdev.h" |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 23 | #include "dvb-usb-ids.h" |
| 24 | |
Antti Palosaari | 7dfd124 | 2012-05-24 20:00:28 -0300 | [diff] [blame] | 25 | struct dvb_usb_driver_info { |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 26 | const char *name; |
Antti Palosaari | 6492167 | 2012-05-25 10:19:03 -0300 | [diff] [blame] | 27 | const char *rc_map; |
Antti Palosaari | 7dfd124 | 2012-05-24 20:00:28 -0300 | [diff] [blame] | 28 | const struct dvb_usb_device_properties *props; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 29 | }; |
| 30 | |
Antti Palosaari | 0359b5f | 2012-06-04 20:12:55 -0300 | [diff] [blame] | 31 | #define DVB_USB_DEVICE(vend, prod, props_, name_, rc) \ |
| 32 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \ |
| 33 | .idVendor = (vend), \ |
| 34 | .idProduct = (prod), \ |
Antti Palosaari | acaec14 | 2012-06-12 01:34:22 -0300 | [diff] [blame] | 35 | .driver_info = (kernel_ulong_t) &((const struct dvb_usb_driver_info) { \ |
Antti Palosaari | 0359b5f | 2012-06-04 20:12:55 -0300 | [diff] [blame] | 36 | .props = (props_), \ |
| 37 | .name = (name_), \ |
| 38 | .rc_map = (rc), \ |
| 39 | }) |
| 40 | |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 41 | struct dvb_usb_device; |
| 42 | struct dvb_usb_adapter; |
| 43 | struct usb_data_stream; |
| 44 | |
| 45 | /** |
| 46 | * Properties of USB streaming - TODO this structure should be somewhere else |
| 47 | * describes the kind of USB transfer used for data-streaming. |
| 48 | * (BULK or ISOC) |
| 49 | */ |
| 50 | struct usb_data_stream_properties { |
| 51 | #define USB_BULK 1 |
| 52 | #define USB_ISOC 2 |
| 53 | int type; |
| 54 | int count; |
| 55 | int endpoint; |
| 56 | |
| 57 | union { |
| 58 | struct { |
| 59 | int buffersize; /* per URB */ |
| 60 | } bulk; |
| 61 | struct { |
| 62 | int framesperurb; |
| 63 | int framesize; |
| 64 | int interval; |
| 65 | } isoc; |
| 66 | } u; |
| 67 | }; |
| 68 | |
| 69 | /** |
| 70 | * struct dvb_usb_adapter_properties - properties of a dvb-usb-adapter. |
Antti Palosaari | 4e60d95 | 2012-05-24 14:44:21 -0300 | [diff] [blame] | 71 | * A DVB-USB-Adapter is basically a dvb_adapter which is present on a |
| 72 | * USB-device. |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 73 | * @caps: capabilities of the DVB USB device. |
| 74 | * @pid_filter_count: number of PID filter position in the optional hardware |
| 75 | * PID-filter. |
| 76 | * @num_frontends: number of frontends of the DVB USB adapter. |
| 77 | * @frontend_ctrl: called to power on/off active frontend. |
| 78 | * @streaming_ctrl: called to start and stop the MPEG2-TS streaming of the |
| 79 | * device (not URB submitting/killing). |
| 80 | * @pid_filter_ctrl: called to en/disable the PID filter, if any. |
| 81 | * @pid_filter: called to set/unset a PID for filtering. |
| 82 | * @frontend_attach: called to attach the possible frontends (fill fe-field |
| 83 | * of struct dvb_usb_device). |
| 84 | * @tuner_attach: called to attach the correct tuner and to fill pll_addr, |
| 85 | * pll_desc and pll_init_buf of struct dvb_usb_device). |
| 86 | * @stream: configuration of the USB streaming |
| 87 | */ |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 88 | |
| 89 | #define MAX_NO_OF_FE_PER_ADAP 3 |
| 90 | struct dvb_usb_adapter_properties { |
Antti Palosaari | e46c5b66 | 2012-05-29 18:05:40 -0300 | [diff] [blame] | 91 | #define DVB_USB_ADAP_HAS_PID_FILTER 0x01 |
| 92 | #define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02 |
| 93 | #define DVB_USB_ADAP_NEED_PID_FILTERING 0x04 |
| 94 | #define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08 |
| 95 | #define DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD 0x10 |
| 96 | int caps; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 97 | int size_of_priv; |
| 98 | |
Antti Palosaari | e46c5b66 | 2012-05-29 18:05:40 -0300 | [diff] [blame] | 99 | int pid_filter_count; |
| 100 | int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int); |
| 101 | int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int); |
| 102 | |
Antti Palosaari | 3024985 | 2012-05-29 16:12:17 -0300 | [diff] [blame] | 103 | struct usb_data_stream_properties stream; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | /** |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 107 | * struct dvb_rc properties of remote controller, using rc-core |
| 108 | * @rc_codes: name of rc codes table |
| 109 | * @protocol: type of protocol(s) currently used by the driver |
| 110 | * @allowed_protos: protocol(s) supported by the driver |
| 111 | * @driver_type: Used to point if a device supports raw mode |
| 112 | * @change_protocol: callback to change protocol |
| 113 | * @rc_query: called to query an event event. |
| 114 | * @rc_interval: time in ms between two queries. |
| 115 | * @bulk_mode: device supports bulk mode for RC (disable polling mode) |
| 116 | */ |
Antti Palosaari | 0575289 | 2012-05-26 11:43:24 -0300 | [diff] [blame] | 117 | struct dvb_usb_rc { |
| 118 | char *map_name; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 119 | u64 allowed_protos; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 120 | int (*change_protocol)(struct rc_dev *dev, u64 rc_type); |
Antti Palosaari | 0575289 | 2012-05-26 11:43:24 -0300 | [diff] [blame] | 121 | int (*query) (struct dvb_usb_device *d); |
| 122 | int interval; |
| 123 | const enum rc_driver_type driver_type; |
| 124 | bool bulk_mode; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 125 | }; |
| 126 | |
| 127 | /** |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 128 | * struct dvb_usb_device_properties - properties of a dvb-usb-device |
Antti Palosaari | 654e62d | 2012-05-23 15:03:56 -0300 | [diff] [blame] | 129 | * @owner: owner of the dvb_adapter |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 130 | * @usb_ctrl: which USB device-side controller is in use. Needed for firmware |
| 131 | * download. |
| 132 | * @firmware: name of the firmware file. |
| 133 | * @download_firmware: called to download the firmware when the usb_ctrl is |
| 134 | * DEVICE_SPECIFIC. |
| 135 | * @no_reconnect: device doesn't do a reconnect after downloading the firmware, |
| 136 | * so do the warm initialization right after it |
| 137 | * |
| 138 | * @size_of_priv: how many bytes shall be allocated for the private field |
| 139 | * of struct dvb_usb_device. |
| 140 | * |
| 141 | * @power_ctrl: called to enable/disable power of the device. |
| 142 | * @read_mac_address: called to read the MAC address of the device. |
| 143 | * @identify_state: called to determine the state (cold or warm), when it |
| 144 | * is not distinguishable by the USB IDs. |
Antti Palosaari | dc78693 | 2012-05-23 10:44:15 -0300 | [diff] [blame] | 145 | * @init: called after adapters are created in order to finalize device |
| 146 | * configuration. |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 147 | * |
| 148 | * @rc: remote controller properties |
| 149 | * |
| 150 | * @i2c_algo: i2c_algorithm if the device has I2CoverUSB. |
| 151 | * |
| 152 | * @generic_bulk_ctrl_endpoint: most of the DVB USB devices have a generic |
| 153 | * endpoint which received control messages with bulk transfers. When this |
| 154 | * is non-zero, one can use dvb_usb_generic_rw and dvb_usb_generic_write- |
| 155 | * helper functions. |
| 156 | * |
| 157 | * @generic_bulk_ctrl_endpoint_response: some DVB USB devices use a separate |
| 158 | * endpoint for responses to control messages sent with bulk transfers via |
| 159 | * the generic_bulk_ctrl_endpoint. When this is non-zero, this will be used |
| 160 | * instead of the generic_bulk_ctrl_endpoint when reading usb responses in |
| 161 | * the dvb_usb_generic_rw helper function. |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 162 | */ |
| 163 | #define MAX_NO_OF_ADAPTER_PER_DEVICE 2 |
| 164 | struct dvb_usb_device_properties { |
Antti Palosaari | 0575289 | 2012-05-26 11:43:24 -0300 | [diff] [blame] | 165 | const char *driver_name; |
Antti Palosaari | 654e62d | 2012-05-23 15:03:56 -0300 | [diff] [blame] | 166 | struct module *owner; |
Antti Palosaari | 55b1f70 | 2012-05-23 16:23:44 -0300 | [diff] [blame] | 167 | short *adapter_nr; |
Antti Palosaari | 3676403 | 2012-06-07 17:34:41 -0300 | [diff] [blame] | 168 | u8 bInterfaceNumber; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 169 | |
Antti Palosaari | 005bc3f | 2012-05-25 12:28:43 -0300 | [diff] [blame] | 170 | int size_of_priv; |
| 171 | |
| 172 | const char *firmware; |
| 173 | int (*get_firmware_name) (struct dvb_usb_device *, const char **); |
Antti Palosaari | 496e827 | 2012-05-23 20:45:05 -0300 | [diff] [blame] | 174 | #define RECONNECTS_USB 1 |
Antti Palosaari | 4e60d95 | 2012-05-24 14:44:21 -0300 | [diff] [blame] | 175 | int (*download_firmware) (struct dvb_usb_device *, |
| 176 | const struct firmware *); |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 177 | |
| 178 | int num_adapters; |
Antti Palosaari | 5b85300 | 2012-05-24 21:11:42 -0300 | [diff] [blame] | 179 | int (*get_adapter_count) (struct dvb_usb_device *); |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 180 | struct dvb_usb_adapter_properties adapter[MAX_NO_OF_ADAPTER_PER_DEVICE]; |
| 181 | |
| 182 | int (*power_ctrl) (struct dvb_usb_device *, int); |
Antti Palosaari | 43402bb | 2012-05-24 22:18:37 -0300 | [diff] [blame] | 183 | int (*read_config) (struct dvb_usb_device *d); |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 184 | int (*read_mac_address) (struct dvb_usb_device *, u8 []); |
Antti Palosaari | 2d2b37c7 | 2012-06-12 01:05:20 -0300 | [diff] [blame] | 185 | int (*frontend_attach) (struct dvb_usb_adapter *); |
| 186 | int (*tuner_attach) (struct dvb_usb_adapter *); |
| 187 | int (*frontend_ctrl) (struct dvb_frontend *, int); |
| 188 | int (*streaming_ctrl) (struct dvb_usb_adapter *, int); |
Antti Palosaari | 6dca4ea | 2012-06-15 02:10:50 -0300 | [diff] [blame] | 189 | int (*fe_ioctl_override) (struct dvb_frontend *, |
| 190 | unsigned int, void *, unsigned int); |
Antti Palosaari | 496e827 | 2012-05-23 20:45:05 -0300 | [diff] [blame] | 191 | |
| 192 | #define WARM 0 |
| 193 | #define COLD 1 |
| 194 | int (*identify_state) (struct dvb_usb_device *); |
Antti Palosaari | dc78693 | 2012-05-23 10:44:15 -0300 | [diff] [blame] | 195 | int (*init) (struct dvb_usb_device *); |
Antti Palosaari | 5b6a63c | 2012-06-10 00:46:22 -0300 | [diff] [blame] | 196 | void (*disconnect) (struct dvb_usb_device *); |
Antti Palosaari | 0575289 | 2012-05-26 11:43:24 -0300 | [diff] [blame] | 197 | int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *); |
Antti Palosaari | 39831f0 | 2012-05-28 21:28:01 -0300 | [diff] [blame] | 198 | int (*get_usb_stream_config) (struct dvb_frontend *, |
| 199 | struct usb_data_stream_properties *); |
Antti Palosaari | b6ecf8b | 2012-05-29 12:17:20 -0300 | [diff] [blame] | 200 | int (*get_ts_config) (struct dvb_frontend *, unsigned int *); |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 201 | |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 202 | struct i2c_algorithm *i2c_algo; |
| 203 | |
| 204 | int generic_bulk_ctrl_endpoint; |
| 205 | int generic_bulk_ctrl_endpoint_response; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 206 | }; |
| 207 | |
| 208 | /** |
| 209 | * struct usb_data_stream - generic object of an USB stream |
| 210 | * @buf_num: number of buffer allocated. |
| 211 | * @buf_size: size of each buffer in buf_list. |
| 212 | * @buf_list: array containing all allocate buffers for streaming. |
| 213 | * @dma_addr: list of dma_addr_t for each buffer in buf_list. |
| 214 | * |
| 215 | * @urbs_initialized: number of URBs initialized. |
| 216 | * @urbs_submitted: number of URBs submitted. |
| 217 | */ |
| 218 | #define MAX_NO_URBS_FOR_DATA_STREAM 10 |
| 219 | struct usb_data_stream { |
| 220 | struct usb_device *udev; |
| 221 | struct usb_data_stream_properties props; |
| 222 | |
| 223 | #define USB_STATE_INIT 0x00 |
| 224 | #define USB_STATE_URB_BUF 0x01 |
| 225 | int state; |
| 226 | |
| 227 | void (*complete) (struct usb_data_stream *, u8 *, size_t); |
| 228 | |
| 229 | struct urb *urb_list[MAX_NO_URBS_FOR_DATA_STREAM]; |
| 230 | int buf_num; |
| 231 | unsigned long buf_size; |
| 232 | u8 *buf_list[MAX_NO_URBS_FOR_DATA_STREAM]; |
| 233 | dma_addr_t dma_addr[MAX_NO_URBS_FOR_DATA_STREAM]; |
| 234 | |
| 235 | int urbs_initialized; |
| 236 | int urbs_submitted; |
| 237 | |
| 238 | void *user_priv; |
| 239 | }; |
| 240 | |
| 241 | /** |
| 242 | * struct dvb_usb_adapter - a DVB adapter on a USB device |
| 243 | * @id: index of this adapter (starting with 0). |
| 244 | * |
| 245 | * @feedcount: number of reqested feeds (used for streaming-activation) |
| 246 | * @pid_filtering: is hardware pid_filtering used or not. |
| 247 | * |
| 248 | * @pll_addr: I2C address of the tuner for programming |
| 249 | * @pll_init: array containing the initialization buffer |
| 250 | * @pll_desc: pointer to the appropriate struct dvb_pll_desc |
Antti Palosaari | 4e60d95 | 2012-05-24 14:44:21 -0300 | [diff] [blame] | 251 | * @tuner_pass_ctrl: called to (de)activate tuner passthru of the demod or |
| 252 | * the board |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 253 | * |
| 254 | * @dvb_adap: device's dvb_adapter. |
| 255 | * @dmxdev: device's dmxdev. |
| 256 | * @demux: device's software demuxer. |
| 257 | * @dvb_net: device's dvb_net interfaces. |
| 258 | * @dvb_frontend: device's frontend. |
| 259 | * @max_feed_count: how many feeds can be handled simultaneously by this |
| 260 | * device |
| 261 | * |
| 262 | * @fe_init: rerouted frontend-init (wakeup) function. |
| 263 | * @fe_sleep: rerouted frontend-sleep function. |
| 264 | * |
| 265 | * @stream: the usb data stream. |
| 266 | */ |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 267 | struct dvb_usb_adapter { |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 268 | #define DVB_USB_ADAP_STATE_INIT 0x000 |
| 269 | #define DVB_USB_ADAP_STATE_DVB 0x001 |
| 270 | int state; |
Antti Palosaari | e46c5b66 | 2012-05-29 18:05:40 -0300 | [diff] [blame] | 271 | struct dvb_usb_device *dev; |
Antti Palosaari | f093c38 | 2012-06-12 16:25:01 -0300 | [diff] [blame] | 272 | const struct dvb_usb_adapter_properties *props; |
Antti Palosaari | e46c5b66 | 2012-05-29 18:05:40 -0300 | [diff] [blame] | 273 | struct usb_data_stream stream; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 274 | u8 id; |
| 275 | |
Antti Palosaari | e46c5b66 | 2012-05-29 18:05:40 -0300 | [diff] [blame] | 276 | int pid_filtering; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 277 | int feedcount; |
Antti Palosaari | e46c5b66 | 2012-05-29 18:05:40 -0300 | [diff] [blame] | 278 | int max_feed_count; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 279 | |
| 280 | /* dvb */ |
| 281 | struct dvb_adapter dvb_adap; |
| 282 | struct dmxdev dmxdev; |
| 283 | struct dvb_demux demux; |
| 284 | struct dvb_net dvb_net; |
| 285 | |
Antti Palosaari | 20bb9cc | 2012-05-29 22:20:24 -0300 | [diff] [blame] | 286 | struct dvb_frontend *fe[MAX_NO_OF_FE_PER_ADAP]; |
| 287 | int (*fe_init[MAX_NO_OF_FE_PER_ADAP]) (struct dvb_frontend *); |
| 288 | int (*fe_sleep[MAX_NO_OF_FE_PER_ADAP]) (struct dvb_frontend *); |
| 289 | |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 290 | int active_fe; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 291 | }; |
| 292 | |
| 293 | /** |
| 294 | * struct dvb_usb_device - object of a DVB USB device |
| 295 | * @props: copy of the struct dvb_usb_properties this device belongs to. |
| 296 | * @desc: pointer to the device's struct dvb_usb_device_description. |
| 297 | * @state: initialization and runtime state of the device. |
| 298 | * |
| 299 | * @powered: indicated whether the device is power or not. |
| 300 | * Powered is in/decremented for each call to modify the state. |
| 301 | * @udev: pointer to the device's struct usb_device. |
| 302 | * |
| 303 | * @usb_mutex: semaphore of USB control messages (reading needs two messages) |
| 304 | * @i2c_mutex: semaphore for i2c-transfers |
| 305 | * |
| 306 | * @i2c_adap: device's i2c_adapter if it uses I2CoverUSB |
| 307 | * |
| 308 | * @rc_dev: rc device for the remote control (rc-core mode) |
| 309 | * @input_dev: input device for the remote control (legacy mode) |
| 310 | * @rc_query_work: struct work_struct frequent rc queries |
| 311 | * @last_event: last triggered event |
| 312 | * @last_state: last state (no, pressed, repeat) |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 313 | * @priv: private data of the actual driver (allocate by dvb-usb, size defined |
| 314 | * in size_of_priv of dvb_usb_properties). |
| 315 | */ |
| 316 | struct dvb_usb_device { |
Antti Palosaari | f093c38 | 2012-06-12 16:25:01 -0300 | [diff] [blame] | 317 | const struct dvb_usb_device_properties *props; |
Antti Palosaari | 7dfd124 | 2012-05-24 20:00:28 -0300 | [diff] [blame] | 318 | const char *name; |
Antti Palosaari | 6492167 | 2012-05-25 10:19:03 -0300 | [diff] [blame] | 319 | const char *rc_map; |
Antti Palosaari | 0575289 | 2012-05-26 11:43:24 -0300 | [diff] [blame] | 320 | struct dvb_usb_rc rc; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 321 | struct usb_device *udev; |
Antti Palosaari | 4f208d4 | 2012-06-06 00:05:06 -0300 | [diff] [blame] | 322 | struct work_struct probe_work; |
Antti Palosaari | 3238aaf | 2012-06-09 21:11:28 -0300 | [diff] [blame] | 323 | pid_t work_pid; |
Antti Palosaari | 4f208d4 | 2012-06-06 00:05:06 -0300 | [diff] [blame] | 324 | struct usb_interface *intf; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 325 | int powered; |
| 326 | |
| 327 | /* locking */ |
| 328 | struct mutex usb_mutex; |
| 329 | |
| 330 | /* i2c */ |
| 331 | struct mutex i2c_mutex; |
| 332 | struct i2c_adapter i2c_adap; |
| 333 | |
Antti Palosaari | e80e9af | 2012-06-04 22:18:34 -0300 | [diff] [blame] | 334 | int num_adapters_initialized; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 335 | struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE]; |
| 336 | |
| 337 | /* remote control */ |
| 338 | struct rc_dev *rc_dev; |
| 339 | struct input_dev *input_dev; |
| 340 | char rc_phys[64]; |
| 341 | struct delayed_work rc_query_work; |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 342 | |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 343 | void *priv; |
| 344 | }; |
| 345 | |
Antti Palosaari | 6b8c8c4 | 2012-06-07 16:23:40 -0300 | [diff] [blame] | 346 | extern int dvb_usbv2_probe(struct usb_interface *, |
Antti Palosaari | 55b1f70 | 2012-05-23 16:23:44 -0300 | [diff] [blame] | 347 | const struct usb_device_id *); |
Antti Palosaari | 6b8c8c4 | 2012-06-07 16:23:40 -0300 | [diff] [blame] | 348 | extern void dvb_usbv2_disconnect(struct usb_interface *); |
Antti Palosaari | ef81e9e | 2012-06-11 17:47:04 -0300 | [diff] [blame] | 349 | extern int dvb_usbv2_suspend(struct usb_interface *, pm_message_t); |
| 350 | extern int dvb_usbv2_resume(struct usb_interface *); |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 351 | |
| 352 | /* the generic read/write method for device control */ |
Antti Palosaari | 4e60d95 | 2012-05-24 14:44:21 -0300 | [diff] [blame] | 353 | extern int dvb_usbv2_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16, |
| 354 | int); |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 355 | extern int dvb_usbv2_generic_write(struct dvb_usb_device *, u8 *, u16); |
| 356 | |
Antti Palosaari | c79b339 | 2012-05-23 10:06:09 -0300 | [diff] [blame] | 357 | #endif |