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