Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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