Patrick Boettcher | fb41f5a | 2005-07-07 17:58:23 -0700 | [diff] [blame] | 1 | /* DVB USB library compliant Linux driver for the WideView/ Yakumo/ Hama/ |
Rasmus Rohde | d3c35ac | 2007-07-21 15:37:35 -0300 | [diff] [blame] | 2 | * Typhoon/ Yuan/ Miglia DVB-T USB2.0 receiver. |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 3 | * |
Patrick Boettcher | 99e44da | 2016-01-24 12:56:58 -0200 | [diff] [blame] | 4 | * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@posteo.de) |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 5 | * |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 6 | * Thanks to Steve Chang from WideView for providing support for the WT-220U. |
| 7 | * |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License as published by the Free |
| 10 | * Software Foundation, version 2. |
| 11 | * |
| 12 | * see Documentation/dvb/README.dvb-usb for more information |
| 13 | */ |
| 14 | #include "dtt200u.h" |
| 15 | |
| 16 | /* debug */ |
| 17 | int dvb_usb_dtt200u_debug; |
| 18 | module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644); |
| 19 | MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS); |
| 20 | |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 21 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
| 22 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 23 | struct dtt200u_state { |
| 24 | unsigned char data[80]; |
| 25 | struct mutex data_mutex; |
| 26 | }; |
| 27 | |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 28 | static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 29 | { |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 30 | struct dtt200u_state *st = d->priv; |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 31 | int ret = 0; |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 32 | |
| 33 | mutex_lock(&st->data_mutex); |
| 34 | |
| 35 | st->data[0] = SET_INIT; |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 36 | |
| 37 | if (onoff) |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 38 | ret = dvb_usb_generic_write(d, st->data, 2); |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 39 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 40 | mutex_unlock(&st->data_mutex); |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 41 | return ret; |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 42 | } |
| 43 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 44 | static int dtt200u_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 45 | { |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 46 | struct dtt200u_state *st = adap->dev->priv; |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 47 | int ret; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 48 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 49 | mutex_lock(&st->data_mutex); |
| 50 | st->data[0] = SET_STREAMING; |
| 51 | st->data[1] = onoff; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 52 | |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 53 | ret = dvb_usb_generic_write(adap->dev, st->data, 2); |
| 54 | if (ret < 0) |
| 55 | goto ret; |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 56 | |
| 57 | if (onoff) |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 58 | goto ret; |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 59 | |
| 60 | st->data[0] = RESET_PID_FILTER; |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 61 | ret = dvb_usb_generic_write(adap->dev, st->data, 1); |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 62 | |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 63 | ret: |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 64 | mutex_unlock(&st->data_mutex); |
| 65 | |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 66 | return ret; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 67 | } |
| 68 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 69 | static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 70 | { |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 71 | struct dtt200u_state *st = adap->dev->priv; |
| 72 | int ret; |
| 73 | |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 74 | pid = onoff ? pid : 0; |
| 75 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 76 | mutex_lock(&st->data_mutex); |
| 77 | st->data[0] = SET_PID_FILTER; |
| 78 | st->data[1] = index; |
| 79 | st->data[2] = pid & 0xff; |
| 80 | st->data[3] = (pid >> 8) & 0x1f; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 81 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 82 | ret = dvb_usb_generic_write(adap->dev, st->data, 4); |
| 83 | mutex_unlock(&st->data_mutex); |
| 84 | |
| 85 | return ret; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 88 | static int dtt200u_rc_query(struct dvb_usb_device *d) |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 89 | { |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 90 | struct dtt200u_state *st = d->priv; |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 91 | u32 scancode; |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 92 | int ret; |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 93 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 94 | mutex_lock(&st->data_mutex); |
| 95 | st->data[0] = GET_RC_CODE; |
| 96 | |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 97 | ret = dvb_usb_generic_rw(d, st->data, 1, st->data, 5, 0); |
| 98 | if (ret < 0) |
| 99 | goto ret; |
| 100 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 101 | if (st->data[0] == 1) { |
Sean Young | 2ceeca0 | 2016-09-21 06:54:19 -0300 | [diff] [blame] | 102 | enum rc_type proto = RC_TYPE_NEC; |
| 103 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 104 | scancode = st->data[1]; |
| 105 | if ((u8) ~st->data[1] != st->data[2]) { |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 106 | /* Extended NEC */ |
| 107 | scancode = scancode << 8; |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 108 | scancode |= st->data[2]; |
Sean Young | 2ceeca0 | 2016-09-21 06:54:19 -0300 | [diff] [blame] | 109 | proto = RC_TYPE_NECX; |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 110 | } |
| 111 | scancode = scancode << 8; |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 112 | scancode |= st->data[3]; |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 113 | |
| 114 | /* Check command checksum is ok */ |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 115 | if ((u8) ~st->data[3] == st->data[4]) |
Sean Young | 2ceeca0 | 2016-09-21 06:54:19 -0300 | [diff] [blame] | 116 | rc_keydown(d->rc_dev, proto, scancode, 0); |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 117 | else |
| 118 | rc_keyup(d->rc_dev); |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 119 | } else if (st->data[0] == 2) { |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 120 | rc_repeat(d->rc_dev); |
| 121 | } else { |
| 122 | rc_keyup(d->rc_dev); |
| 123 | } |
| 124 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 125 | if (st->data[0] != 0) |
| 126 | deb_info("st->data: %*ph\n", 5, st->data); |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 127 | |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 128 | ret: |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 129 | mutex_unlock(&st->data_mutex); |
Mauro Carvalho Chehab | a3f9f07 | 2016-10-07 13:37:50 -0300 | [diff] [blame^] | 130 | return ret; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 131 | } |
| 132 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 133 | static int dtt200u_frontend_attach(struct dvb_usb_adapter *adap) |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 134 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 135 | adap->fe_adap[0].fe = dtt200u_fe_attach(adap->dev); |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 136 | return 0; |
| 137 | } |
| 138 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 139 | static struct dvb_usb_device_properties dtt200u_properties; |
| 140 | static struct dvb_usb_device_properties wt220u_fc_properties; |
| 141 | static struct dvb_usb_device_properties wt220u_properties; |
| 142 | static struct dvb_usb_device_properties wt220u_zl0353_properties; |
Rasmus Rohde | d3c35ac | 2007-07-21 15:37:35 -0300 | [diff] [blame] | 143 | static struct dvb_usb_device_properties wt220u_miglia_properties; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 144 | |
| 145 | static int dtt200u_usb_probe(struct usb_interface *intf, |
| 146 | const struct usb_device_id *id) |
| 147 | { |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 148 | struct dvb_usb_device *d; |
| 149 | struct dtt200u_state *st; |
| 150 | |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 151 | if (0 == dvb_usb_device_init(intf, &dtt200u_properties, |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 152 | THIS_MODULE, &d, adapter_nr) || |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 153 | 0 == dvb_usb_device_init(intf, &wt220u_properties, |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 154 | THIS_MODULE, &d, adapter_nr) || |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 155 | 0 == dvb_usb_device_init(intf, &wt220u_fc_properties, |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 156 | THIS_MODULE, &d, adapter_nr) || |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 157 | 0 == dvb_usb_device_init(intf, &wt220u_zl0353_properties, |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 158 | THIS_MODULE, &d, adapter_nr) || |
Janne Grunau | 78e9200 | 2008-04-09 19:13:13 -0300 | [diff] [blame] | 159 | 0 == dvb_usb_device_init(intf, &wt220u_miglia_properties, |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 160 | THIS_MODULE, &d, adapter_nr)) { |
| 161 | st = d->priv; |
| 162 | mutex_init(&st->data_mutex); |
| 163 | |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 164 | return 0; |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 165 | } |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 166 | |
| 167 | return -ENODEV; |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | static struct usb_device_id dtt200u_usb_table [] = { |
Patrick Boettcher | 62703b9 | 2005-09-09 13:02:46 -0700 | [diff] [blame] | 171 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_COLD) }, |
| 172 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_WARM) }, |
| 173 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_COLD) }, |
| 174 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_WARM) }, |
Patrick Boettcher | d46e645 | 2006-03-28 16:15:05 -0300 | [diff] [blame] | 175 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_COLD) }, |
| 176 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_WARM) }, |
Alexander Tuschen | 19e2257 | 2006-07-16 15:03:17 -0300 | [diff] [blame] | 177 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_FC_COLD) }, |
| 178 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_FC_WARM) }, |
Jochen Issing | ded38d2 | 2006-08-19 16:03:21 -0300 | [diff] [blame] | 179 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZAP250_COLD) }, |
Rasmus Rohde | d3c35ac | 2007-07-21 15:37:35 -0300 | [diff] [blame] | 180 | { USB_DEVICE(USB_VID_MIGLIA, USB_PID_WT220U_ZAP250_COLD) }, |
Patrick Boettcher | 62703b9 | 2005-09-09 13:02:46 -0700 | [diff] [blame] | 181 | { 0 }, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 182 | }; |
| 183 | MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); |
| 184 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 185 | static struct dvb_usb_device_properties dtt200u_properties = { |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 186 | .usb_ctrl = CYPRESS_FX2, |
| 187 | .firmware = "dvb-usb-dtt200u-01.fw", |
| 188 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 189 | .size_of_priv = sizeof(struct dtt200u_state), |
| 190 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 191 | .num_adapters = 1, |
| 192 | .adapter = { |
| 193 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 194 | .num_frontends = 1, |
| 195 | .fe = {{ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 196 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, |
| 197 | .pid_filter_count = 15, |
| 198 | |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 199 | .streaming_ctrl = dtt200u_streaming_ctrl, |
| 200 | .pid_filter = dtt200u_pid_filter, |
| 201 | .frontend_attach = dtt200u_frontend_attach, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 202 | /* parameter for the MPEG2-data transfer */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 203 | .stream = { |
| 204 | .type = USB_BULK, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 205 | .count = 7, |
| 206 | .endpoint = 0x02, |
| 207 | .u = { |
| 208 | .bulk = { |
| 209 | .buffersize = 4096, |
| 210 | } |
| 211 | } |
| 212 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 213 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 214 | } |
| 215 | }, |
| 216 | .power_ctrl = dtt200u_power_ctrl, |
| 217 | |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 218 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 219 | .rc_interval = 300, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 220 | .rc_codes = RC_MAP_DTT200U, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 221 | .rc_query = dtt200u_rc_query, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 222 | .allowed_protos = RC_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 223 | }, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 224 | |
| 225 | .generic_bulk_ctrl_endpoint = 0x01, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 226 | |
| 227 | .num_device_descs = 1, |
| 228 | .devices = { |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 229 | { .name = "WideView/Yuan/Yakumo/Hama/Typhoon DVB-T USB2.0 (WT-200U)", |
Patrick Boettcher | fb41f5a | 2005-07-07 17:58:23 -0700 | [diff] [blame] | 230 | .cold_ids = { &dtt200u_usb_table[0], NULL }, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 231 | .warm_ids = { &dtt200u_usb_table[1], NULL }, |
| 232 | }, |
Al Viro | dad08df | 2006-02-01 06:02:50 -0500 | [diff] [blame] | 233 | { NULL }, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 234 | } |
| 235 | }; |
| 236 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 237 | static struct dvb_usb_device_properties wt220u_properties = { |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 238 | .usb_ctrl = CYPRESS_FX2, |
Patrick Boettcher | 6ce17c5 | 2006-01-09 15:25:45 -0200 | [diff] [blame] | 239 | .firmware = "dvb-usb-wt220u-02.fw", |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 240 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 241 | .size_of_priv = sizeof(struct dtt200u_state), |
| 242 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 243 | .num_adapters = 1, |
| 244 | .adapter = { |
| 245 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 246 | .num_frontends = 1, |
| 247 | .fe = {{ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 248 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, |
| 249 | .pid_filter_count = 15, |
| 250 | |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 251 | .streaming_ctrl = dtt200u_streaming_ctrl, |
| 252 | .pid_filter = dtt200u_pid_filter, |
| 253 | .frontend_attach = dtt200u_frontend_attach, |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 254 | /* parameter for the MPEG2-data transfer */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 255 | .stream = { |
| 256 | .type = USB_BULK, |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 257 | .count = 7, |
| 258 | .endpoint = 0x02, |
| 259 | .u = { |
| 260 | .bulk = { |
| 261 | .buffersize = 4096, |
| 262 | } |
| 263 | } |
| 264 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 265 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 266 | } |
| 267 | }, |
| 268 | .power_ctrl = dtt200u_power_ctrl, |
| 269 | |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 270 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 271 | .rc_interval = 300, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 272 | .rc_codes = RC_MAP_DTT200U, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 273 | .rc_query = dtt200u_rc_query, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 274 | .allowed_protos = RC_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 275 | }, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 276 | |
| 277 | .generic_bulk_ctrl_endpoint = 0x01, |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 278 | |
| 279 | .num_device_descs = 1, |
| 280 | .devices = { |
Patrick Boettcher | 62703b9 | 2005-09-09 13:02:46 -0700 | [diff] [blame] | 281 | { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)", |
Jochen Issing | ded38d2 | 2006-08-19 16:03:21 -0300 | [diff] [blame] | 282 | .cold_ids = { &dtt200u_usb_table[2], &dtt200u_usb_table[8], NULL }, |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 283 | .warm_ids = { &dtt200u_usb_table[3], NULL }, |
| 284 | }, |
Al Viro | dad08df | 2006-02-01 06:02:50 -0500 | [diff] [blame] | 285 | { NULL }, |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 286 | } |
| 287 | }; |
| 288 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 289 | static struct dvb_usb_device_properties wt220u_fc_properties = { |
Alexander Tuschen | 19e2257 | 2006-07-16 15:03:17 -0300 | [diff] [blame] | 290 | .usb_ctrl = CYPRESS_FX2, |
| 291 | .firmware = "dvb-usb-wt220u-fc03.fw", |
| 292 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 293 | .size_of_priv = sizeof(struct dtt200u_state), |
| 294 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 295 | .num_adapters = 1, |
| 296 | .adapter = { |
| 297 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 298 | .num_frontends = 1, |
| 299 | .fe = {{ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 300 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, |
| 301 | .pid_filter_count = 15, |
| 302 | |
Alexander Tuschen | 19e2257 | 2006-07-16 15:03:17 -0300 | [diff] [blame] | 303 | .streaming_ctrl = dtt200u_streaming_ctrl, |
| 304 | .pid_filter = dtt200u_pid_filter, |
| 305 | .frontend_attach = dtt200u_frontend_attach, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 306 | /* parameter for the MPEG2-data transfer */ |
| 307 | .stream = { |
| 308 | .type = USB_BULK, |
| 309 | .count = 7, |
| 310 | .endpoint = 0x06, |
| 311 | .u = { |
| 312 | .bulk = { |
| 313 | .buffersize = 4096, |
| 314 | } |
| 315 | } |
| 316 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 317 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 318 | } |
| 319 | }, |
| 320 | .power_ctrl = dtt200u_power_ctrl, |
Alexander Tuschen | 19e2257 | 2006-07-16 15:03:17 -0300 | [diff] [blame] | 321 | |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 322 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 323 | .rc_interval = 300, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 324 | .rc_codes = RC_MAP_DTT200U, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 325 | .rc_query = dtt200u_rc_query, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 326 | .allowed_protos = RC_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 327 | }, |
Alexander Tuschen | 19e2257 | 2006-07-16 15:03:17 -0300 | [diff] [blame] | 328 | |
| 329 | .generic_bulk_ctrl_endpoint = 0x01, |
| 330 | |
Alexander Tuschen | 19e2257 | 2006-07-16 15:03:17 -0300 | [diff] [blame] | 331 | .num_device_descs = 1, |
| 332 | .devices = { |
| 333 | { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)", |
| 334 | .cold_ids = { &dtt200u_usb_table[6], NULL }, |
| 335 | .warm_ids = { &dtt200u_usb_table[7], NULL }, |
| 336 | }, |
| 337 | { NULL }, |
| 338 | } |
| 339 | }; |
| 340 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 341 | static struct dvb_usb_device_properties wt220u_zl0353_properties = { |
Patrick Boettcher | d46e645 | 2006-03-28 16:15:05 -0300 | [diff] [blame] | 342 | .usb_ctrl = CYPRESS_FX2, |
| 343 | .firmware = "dvb-usb-wt220u-zl0353-01.fw", |
| 344 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 345 | .size_of_priv = sizeof(struct dtt200u_state), |
| 346 | |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 347 | .num_adapters = 1, |
| 348 | .adapter = { |
| 349 | { |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 350 | .num_frontends = 1, |
| 351 | .fe = {{ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 352 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, |
| 353 | .pid_filter_count = 15, |
| 354 | |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 355 | .streaming_ctrl = dtt200u_streaming_ctrl, |
| 356 | .pid_filter = dtt200u_pid_filter, |
| 357 | .frontend_attach = dtt200u_frontend_attach, |
| 358 | /* parameter for the MPEG2-data transfer */ |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 359 | .stream = { |
| 360 | .type = USB_BULK, |
Patrick Boettcher | 01451e7 | 2006-10-13 11:34:46 -0300 | [diff] [blame] | 361 | .count = 7, |
| 362 | .endpoint = 0x02, |
| 363 | .u = { |
| 364 | .bulk = { |
| 365 | .buffersize = 4096, |
| 366 | } |
| 367 | } |
| 368 | }, |
Michael Krufky | 77eed21 | 2011-09-06 09:31:57 -0300 | [diff] [blame] | 369 | }}, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 370 | } |
| 371 | }, |
| 372 | .power_ctrl = dtt200u_power_ctrl, |
| 373 | |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 374 | .rc.core = { |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 375 | .rc_interval = 300, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 376 | .rc_codes = RC_MAP_DTT200U, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 377 | .rc_query = dtt200u_rc_query, |
Jonathan McDowell | a4d020e | 2016-05-20 12:08:35 -0300 | [diff] [blame] | 378 | .allowed_protos = RC_BIT_NEC, |
Mauro Carvalho Chehab | f72a27b | 2010-07-31 18:04:09 -0300 | [diff] [blame] | 379 | }, |
Patrick Boettcher | 4d43e13 | 2006-09-30 06:53:48 -0300 | [diff] [blame] | 380 | |
| 381 | .generic_bulk_ctrl_endpoint = 0x01, |
Patrick Boettcher | d46e645 | 2006-03-28 16:15:05 -0300 | [diff] [blame] | 382 | |
| 383 | .num_device_descs = 1, |
| 384 | .devices = { |
| 385 | { .name = "WideView WT-220U PenType Receiver (based on ZL353)", |
| 386 | .cold_ids = { &dtt200u_usb_table[4], NULL }, |
| 387 | .warm_ids = { &dtt200u_usb_table[5], NULL }, |
| 388 | }, |
| 389 | { NULL }, |
| 390 | } |
| 391 | }; |
| 392 | |
Rasmus Rohde | d3c35ac | 2007-07-21 15:37:35 -0300 | [diff] [blame] | 393 | static struct dvb_usb_device_properties wt220u_miglia_properties = { |
| 394 | .usb_ctrl = CYPRESS_FX2, |
| 395 | .firmware = "dvb-usb-wt220u-miglia-01.fw", |
| 396 | |
Mauro Carvalho Chehab | ab883e2 | 2016-10-07 08:40:43 -0300 | [diff] [blame] | 397 | .size_of_priv = sizeof(struct dtt200u_state), |
| 398 | |
Rasmus Rohde | d3c35ac | 2007-07-21 15:37:35 -0300 | [diff] [blame] | 399 | .num_adapters = 1, |
| 400 | .generic_bulk_ctrl_endpoint = 0x01, |
| 401 | |
| 402 | .num_device_descs = 1, |
| 403 | .devices = { |
| 404 | { .name = "WideView WT-220U PenType Receiver (Miglia)", |
| 405 | .cold_ids = { &dtt200u_usb_table[9], NULL }, |
| 406 | /* This device turns into WT220U_ZL0353_WARM when fw |
| 407 | has been uploaded */ |
| 408 | .warm_ids = { NULL }, |
| 409 | }, |
| 410 | { NULL }, |
| 411 | } |
| 412 | }; |
| 413 | |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 414 | /* usb specific object needed to register this driver with the usb subsystem */ |
| 415 | static struct usb_driver dtt200u_usb_driver = { |
Patrick Boettcher | d590f9c | 2005-07-07 17:58:33 -0700 | [diff] [blame] | 416 | .name = "dvb_usb_dtt200u", |
Patrick Boettcher | 62703b9 | 2005-09-09 13:02:46 -0700 | [diff] [blame] | 417 | .probe = dtt200u_usb_probe, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 418 | .disconnect = dvb_usb_device_exit, |
Patrick Boettcher | 62703b9 | 2005-09-09 13:02:46 -0700 | [diff] [blame] | 419 | .id_table = dtt200u_usb_table, |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 420 | }; |
| 421 | |
Greg Kroah-Hartman | ecb3b2b | 2011-11-18 09:46:12 -0800 | [diff] [blame] | 422 | module_usb_driver(dtt200u_usb_driver); |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 423 | |
Patrick Boettcher | 99e44da | 2016-01-24 12:56:58 -0200 | [diff] [blame] | 424 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>"); |
Rasmus Rohde | d3c35ac | 2007-07-21 15:37:35 -0300 | [diff] [blame] | 425 | MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon/Club3D/Miglia DVB-T USB2.0 devices"); |
Johannes Stezenbach | 776338e | 2005-06-23 22:02:35 -0700 | [diff] [blame] | 426 | MODULE_VERSION("1.0"); |
| 427 | MODULE_LICENSE("GPL"); |