Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 1 | /* |
| 2 | * E3C EC168 DVB USB driver |
| 3 | * |
| 4 | * Copyright (C) 2009 Antti Palosaari <crope@iki.fi> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include "ec168.h" |
| 23 | #include "ec100.h" |
| 24 | #include "mxl5005s.h" |
| 25 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 26 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
| 27 | |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 28 | static int ec168_ctrl_msg(struct dvb_usb_device *d, struct ec168_req *req) |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 29 | { |
| 30 | int ret; |
| 31 | unsigned int pipe; |
| 32 | u8 request, requesttype; |
Florian Mickler | 26b72c6 | 2011-03-20 18:50:48 -0300 | [diff] [blame] | 33 | u8 *buf; |
| 34 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 35 | switch (req->cmd) { |
| 36 | case DOWNLOAD_FIRMWARE: |
| 37 | case GPIO: |
| 38 | case WRITE_I2C: |
| 39 | case STREAMING_CTRL: |
| 40 | requesttype = (USB_TYPE_VENDOR | USB_DIR_OUT); |
| 41 | request = req->cmd; |
| 42 | break; |
| 43 | case READ_I2C: |
| 44 | requesttype = (USB_TYPE_VENDOR | USB_DIR_IN); |
| 45 | request = req->cmd; |
| 46 | break; |
| 47 | case GET_CONFIG: |
| 48 | requesttype = (USB_TYPE_VENDOR | USB_DIR_IN); |
| 49 | request = CONFIG; |
| 50 | break; |
| 51 | case SET_CONFIG: |
| 52 | requesttype = (USB_TYPE_VENDOR | USB_DIR_OUT); |
| 53 | request = CONFIG; |
| 54 | break; |
| 55 | case WRITE_DEMOD: |
| 56 | requesttype = (USB_TYPE_VENDOR | USB_DIR_OUT); |
| 57 | request = DEMOD_RW; |
| 58 | break; |
| 59 | case READ_DEMOD: |
| 60 | requesttype = (USB_TYPE_VENDOR | USB_DIR_IN); |
| 61 | request = DEMOD_RW; |
| 62 | break; |
| 63 | default: |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 64 | pr_err("%s: unknown command=%02x\n", KBUILD_MODNAME, req->cmd); |
| 65 | ret = -EINVAL; |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 66 | goto error; |
| 67 | } |
| 68 | |
Florian Mickler | 26b72c6 | 2011-03-20 18:50:48 -0300 | [diff] [blame] | 69 | buf = kmalloc(req->size, GFP_KERNEL); |
| 70 | if (!buf) { |
| 71 | ret = -ENOMEM; |
| 72 | goto error; |
| 73 | } |
| 74 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 75 | if (requesttype == (USB_TYPE_VENDOR | USB_DIR_OUT)) { |
| 76 | /* write */ |
| 77 | memcpy(buf, req->data, req->size); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 78 | pipe = usb_sndctrlpipe(d->udev, 0); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 79 | } else { |
| 80 | /* read */ |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 81 | pipe = usb_rcvctrlpipe(d->udev, 0); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | msleep(1); /* avoid I2C errors */ |
| 85 | |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 86 | ret = usb_control_msg(d->udev, pipe, request, requesttype, req->value, |
Florian Mickler | 26b72c6 | 2011-03-20 18:50:48 -0300 | [diff] [blame] | 87 | req->index, buf, req->size, EC168_USB_TIMEOUT); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 88 | |
| 89 | ec168_debug_dump(request, requesttype, req->value, req->index, buf, |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 90 | req->size); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 91 | |
| 92 | if (ret < 0) |
Florian Mickler | 26b72c6 | 2011-03-20 18:50:48 -0300 | [diff] [blame] | 93 | goto err_dealloc; |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 94 | else |
| 95 | ret = 0; |
| 96 | |
| 97 | /* read request, copy returned data to return buf */ |
| 98 | if (!ret && requesttype == (USB_TYPE_VENDOR | USB_DIR_IN)) |
| 99 | memcpy(req->data, buf, req->size); |
| 100 | |
Florian Mickler | 26b72c6 | 2011-03-20 18:50:48 -0300 | [diff] [blame] | 101 | kfree(buf); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 102 | return ret; |
Florian Mickler | 26b72c6 | 2011-03-20 18:50:48 -0300 | [diff] [blame] | 103 | |
| 104 | err_dealloc: |
| 105 | kfree(buf); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 106 | error: |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 107 | pr_debug("%s: failed=%d\n", __func__, ret); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 108 | return ret; |
| 109 | } |
| 110 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 111 | /* I2C */ |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 112 | static struct ec100_config ec168_ec100_config; |
| 113 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 114 | static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], |
| 115 | int num) |
| 116 | { |
| 117 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
| 118 | struct ec168_req req; |
| 119 | int i = 0; |
| 120 | int ret; |
| 121 | |
| 122 | if (num > 2) |
| 123 | return -EINVAL; |
| 124 | |
| 125 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) |
| 126 | return -EAGAIN; |
| 127 | |
| 128 | while (i < num) { |
| 129 | if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) { |
| 130 | if (msg[i].addr == ec168_ec100_config.demod_address) { |
| 131 | req.cmd = READ_DEMOD; |
| 132 | req.value = 0; |
| 133 | req.index = 0xff00 + msg[i].buf[0]; /* reg */ |
| 134 | req.size = msg[i+1].len; /* bytes to read */ |
| 135 | req.data = &msg[i+1].buf[0]; |
| 136 | ret = ec168_ctrl_msg(d, &req); |
| 137 | i += 2; |
| 138 | } else { |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 139 | pr_err("%s: I2C read not implemented\n", |
| 140 | KBUILD_MODNAME); |
| 141 | ret = -EOPNOTSUPP; |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 142 | i += 2; |
| 143 | } |
| 144 | } else { |
| 145 | if (msg[i].addr == ec168_ec100_config.demod_address) { |
| 146 | req.cmd = WRITE_DEMOD; |
| 147 | req.value = msg[i].buf[1]; /* val */ |
| 148 | req.index = 0xff00 + msg[i].buf[0]; /* reg */ |
| 149 | req.size = 0; |
| 150 | req.data = NULL; |
| 151 | ret = ec168_ctrl_msg(d, &req); |
| 152 | i += 1; |
| 153 | } else { |
| 154 | req.cmd = WRITE_I2C; |
| 155 | req.value = msg[i].buf[0]; /* val */ |
| 156 | req.index = 0x0100 + msg[i].addr; /* I2C addr */ |
| 157 | req.size = msg[i].len-1; |
| 158 | req.data = &msg[i].buf[1]; |
| 159 | ret = ec168_ctrl_msg(d, &req); |
| 160 | i += 1; |
| 161 | } |
| 162 | } |
| 163 | if (ret) |
| 164 | goto error; |
| 165 | |
| 166 | } |
| 167 | ret = i; |
| 168 | |
| 169 | error: |
| 170 | mutex_unlock(&d->i2c_mutex); |
| 171 | return i; |
| 172 | } |
| 173 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 174 | static u32 ec168_i2c_func(struct i2c_adapter *adapter) |
| 175 | { |
| 176 | return I2C_FUNC_I2C; |
| 177 | } |
| 178 | |
| 179 | static struct i2c_algorithm ec168_i2c_algo = { |
| 180 | .master_xfer = ec168_i2c_xfer, |
| 181 | .functionality = ec168_i2c_func, |
| 182 | }; |
| 183 | |
| 184 | /* Callbacks for DVB USB */ |
Antti Palosaari | a0921af | 2012-06-18 23:42:53 -0300 | [diff] [blame] | 185 | static int ec168_identify_state(struct dvb_usb_device *d, const char **name) |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 186 | { |
| 187 | int ret; |
| 188 | u8 reply; |
| 189 | struct ec168_req req = {GET_CONFIG, 0, 1, sizeof(reply), &reply}; |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 190 | pr_debug("%s:\n", __func__); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 191 | |
| 192 | ret = ec168_ctrl_msg(d, &req); |
| 193 | if (ret) |
| 194 | goto error; |
| 195 | |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 196 | pr_debug("%s: reply=%02x\n", __func__, reply); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 197 | |
| 198 | if (reply == 0x01) |
| 199 | ret = WARM; |
| 200 | else |
| 201 | ret = COLD; |
| 202 | |
| 203 | return ret; |
| 204 | error: |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 205 | pr_debug("%s: failed=%d\n", __func__, ret); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 206 | return ret; |
| 207 | } |
| 208 | |
| 209 | static int ec168_download_firmware(struct dvb_usb_device *d, |
| 210 | const struct firmware *fw) |
| 211 | { |
Antti Palosaari | 77e28ec | 2012-06-12 22:16:12 -0300 | [diff] [blame] | 212 | int ret, len, remaining; |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 213 | struct ec168_req req = {DOWNLOAD_FIRMWARE, 0, 0, 0, NULL}; |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 214 | pr_debug("%s:\n", __func__); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 215 | |
Antti Palosaari | 77e28ec | 2012-06-12 22:16:12 -0300 | [diff] [blame] | 216 | #define LEN_MAX 2048 /* max packet size */ |
| 217 | for (remaining = fw->size; remaining > 0; remaining -= LEN_MAX) { |
| 218 | len = remaining; |
| 219 | if (len > LEN_MAX) |
| 220 | len = LEN_MAX; |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 221 | |
| 222 | req.size = len; |
Antti Palosaari | 77e28ec | 2012-06-12 22:16:12 -0300 | [diff] [blame] | 223 | req.data = (u8 *) &fw->data[fw->size - remaining]; |
| 224 | req.index = fw->size - remaining; |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 225 | |
| 226 | ret = ec168_ctrl_msg(d, &req); |
| 227 | if (ret) { |
Antti Palosaari | 77e28ec | 2012-06-12 22:16:12 -0300 | [diff] [blame] | 228 | pr_err("%s: firmware download failed=%d\n", |
| 229 | KBUILD_MODNAME, ret); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 230 | goto error; |
| 231 | } |
| 232 | } |
Antti Palosaari | 77e28ec | 2012-06-12 22:16:12 -0300 | [diff] [blame] | 233 | |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 234 | req.size = 0; |
| 235 | |
| 236 | /* set "warm"? */ |
| 237 | req.cmd = SET_CONFIG; |
| 238 | req.value = 0; |
| 239 | req.index = 0x0001; |
| 240 | ret = ec168_ctrl_msg(d, &req); |
| 241 | if (ret) |
| 242 | goto error; |
| 243 | |
| 244 | /* really needed - no idea what does */ |
| 245 | req.cmd = GPIO; |
| 246 | req.value = 0; |
| 247 | req.index = 0x0206; |
| 248 | ret = ec168_ctrl_msg(d, &req); |
| 249 | if (ret) |
| 250 | goto error; |
| 251 | |
| 252 | /* activate tuner I2C? */ |
| 253 | req.cmd = WRITE_I2C; |
| 254 | req.value = 0; |
| 255 | req.index = 0x00c6; |
| 256 | ret = ec168_ctrl_msg(d, &req); |
| 257 | if (ret) |
| 258 | goto error; |
| 259 | |
| 260 | return ret; |
| 261 | error: |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 262 | pr_debug("%s: failed=%d\n", __func__, ret); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 263 | return ret; |
| 264 | } |
| 265 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 266 | static struct ec100_config ec168_ec100_config = { |
| 267 | .demod_address = 0xff, /* not real address, demod is integrated */ |
| 268 | }; |
| 269 | |
| 270 | static int ec168_ec100_frontend_attach(struct dvb_usb_adapter *adap) |
| 271 | { |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 272 | pr_debug("%s:\n", __func__); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 273 | adap->fe[0] = dvb_attach(ec100_attach, &ec168_ec100_config, |
Antti Palosaari | 2731d4e | 2012-06-18 19:58:44 -0300 | [diff] [blame] | 274 | &adap_to_d(adap)->i2c_adap); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 275 | if (adap->fe[0] == NULL) |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 276 | return -ENODEV; |
| 277 | |
| 278 | return 0; |
| 279 | } |
| 280 | |
| 281 | static struct mxl5005s_config ec168_mxl5003s_config = { |
| 282 | .i2c_address = 0xc6, |
| 283 | .if_freq = IF_FREQ_4570000HZ, |
| 284 | .xtal_freq = CRYSTAL_FREQ_16000000HZ, |
| 285 | .agc_mode = MXL_SINGLE_AGC, |
| 286 | .tracking_filter = MXL_TF_OFF, |
| 287 | .rssi_enable = MXL_RSSI_ENABLE, |
| 288 | .cap_select = MXL_CAP_SEL_ENABLE, |
| 289 | .div_out = MXL_DIV_OUT_4, |
| 290 | .clock_out = MXL_CLOCK_OUT_DISABLE, |
| 291 | .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM, |
| 292 | .top = MXL5005S_TOP_25P2, |
| 293 | .mod_mode = MXL_DIGITAL_MODE, |
| 294 | .if_mode = MXL_ZERO_IF, |
| 295 | .AgcMasterByte = 0x00, |
| 296 | }; |
| 297 | |
| 298 | static int ec168_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) |
| 299 | { |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 300 | pr_debug("%s:\n", __func__); |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 301 | return dvb_attach(mxl5005s_attach, adap->fe[0], |
Antti Palosaari | 2731d4e | 2012-06-18 19:58:44 -0300 | [diff] [blame] | 302 | &adap_to_d(adap)->i2c_adap, |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 303 | &ec168_mxl5003s_config) == NULL ? -ENODEV : 0; |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 304 | } |
| 305 | |
Antti Palosaari | a13a6e1 | 2012-06-26 00:04:33 -0300 | [diff] [blame^] | 306 | static int ec168_streaming_ctrl(struct dvb_frontend *fe, int onoff) |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 307 | { |
| 308 | struct ec168_req req = {STREAMING_CTRL, 0x7f01, 0x0202, 0, NULL}; |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 309 | pr_debug("%s: onoff=%d\n", __func__, onoff); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 310 | if (onoff) |
| 311 | req.index = 0x0102; |
Antti Palosaari | a13a6e1 | 2012-06-26 00:04:33 -0300 | [diff] [blame^] | 312 | return ec168_ctrl_msg(fe_to_d(fe), &req); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 313 | } |
| 314 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 315 | /* DVB USB Driver stuff */ |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 316 | /* bInterfaceNumber 0 is HID |
| 317 | * bInterfaceNumber 1 is DVB-T */ |
| 318 | static struct dvb_usb_device_properties ec168_props = { |
| 319 | .driver_name = KBUILD_MODNAME, |
| 320 | .owner = THIS_MODULE, |
| 321 | .adapter_nr = adapter_nr, |
| 322 | .bInterfaceNumber = 1, |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 323 | |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 324 | .identify_state = ec168_identify_state, |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 325 | .firmware = "dvb-usb-ec168.fw", |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 326 | .download_firmware = ec168_download_firmware, |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 327 | |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 328 | .i2c_algo = &ec168_i2c_algo, |
| 329 | .frontend_attach = ec168_ec100_frontend_attach, |
| 330 | .tuner_attach = ec168_mxl5003s_tuner_attach, |
| 331 | .streaming_ctrl = ec168_streaming_ctrl, |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 332 | |
| 333 | .num_adapters = 1, |
| 334 | .adapter = { |
| 335 | { |
Antti Palosaari | 2731d4e | 2012-06-18 19:58:44 -0300 | [diff] [blame] | 336 | .stream = DVB_USB_STREAM_BULK(0x82, 6, 32 * 512), |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 337 | } |
| 338 | }, |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 339 | }; |
| 340 | |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 341 | static const struct dvb_usb_driver_info ec168_driver_info = { |
| 342 | .name = "E3C EC168 reference design", |
| 343 | .props = &ec168_props, |
| 344 | }; |
| 345 | |
| 346 | static const struct usb_device_id ec168_id[] = { |
| 347 | { USB_DEVICE(USB_VID_E3C, USB_PID_E3C_EC168), |
| 348 | .driver_info = (kernel_ulong_t) &ec168_driver_info }, |
| 349 | { USB_DEVICE(USB_VID_E3C, USB_PID_E3C_EC168_2), |
| 350 | .driver_info = (kernel_ulong_t) &ec168_driver_info }, |
| 351 | { USB_DEVICE(USB_VID_E3C, USB_PID_E3C_EC168_3), |
| 352 | .driver_info = (kernel_ulong_t) &ec168_driver_info }, |
| 353 | { USB_DEVICE(USB_VID_E3C, USB_PID_E3C_EC168_4), |
| 354 | .driver_info = (kernel_ulong_t) &ec168_driver_info }, |
| 355 | { USB_DEVICE(USB_VID_E3C, USB_PID_E3C_EC168_5), |
| 356 | .driver_info = (kernel_ulong_t) &ec168_driver_info }, |
| 357 | {} |
| 358 | }; |
| 359 | MODULE_DEVICE_TABLE(usb, ec168_id); |
| 360 | |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 361 | static struct usb_driver ec168_driver = { |
Antti Palosaari | 3eee047 | 2012-06-12 16:45:54 -0300 | [diff] [blame] | 362 | .name = KBUILD_MODNAME, |
| 363 | .id_table = ec168_id, |
| 364 | .probe = dvb_usbv2_probe, |
| 365 | .disconnect = dvb_usbv2_disconnect, |
| 366 | .suspend = dvb_usbv2_suspend, |
| 367 | .resume = dvb_usbv2_resume, |
| 368 | .no_dynamic_id = 1, |
| 369 | .soft_unbind = 1, |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 370 | }; |
| 371 | |
Greg Kroah-Hartman | ecb3b2b | 2011-11-18 09:46:12 -0800 | [diff] [blame] | 372 | module_usb_driver(ec168_driver); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 373 | |
| 374 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
Antti Palosaari | ce6ea9a | 2012-06-12 20:40:21 -0300 | [diff] [blame] | 375 | MODULE_DESCRIPTION("E3C EC168 driver"); |
Antti Palosaari | 2bf290b | 2009-11-13 22:38:55 -0300 | [diff] [blame] | 376 | MODULE_LICENSE("GPL"); |