Project

General

Profile

RE: August DVB-T210 ยป 0002-Geniatech-T220A-support.patch

Geniatech T220A support - Crazy Cat, 2015-05-05 20:08

View differences:

drivers/media/usb/dvb-usb/dw2102.c
2 2
 *	DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
3 3
 *	TeVii S600, S630, S650, S660, S480, S421, S632
4 4
 *	Prof 1100, 7500,
5
 *	Geniatech SU3000, T220,
5
 *	Geniatech SU3000, T220, T220A,
6 6
 *	TechnoTrend S2-4600 Cards
7 7
 * Copyright (C) 2008-2012 Igor M. Liplianin ([email protected])
8 8
 *
......
31 31
#include "stb6100_proc.h"
32 32
#include "m88rs2000.h"
33 33
#include "tda18271.h"
34
#include "tda18273.h"
34 35
#include "cxd2820r.h"
35 36
#include "m88ds3103.h"
36 37
#include "ts2020.h"
......
1453 1454
	return -EIO;
1454 1455
}
1455 1456

  
1457
static int t220a_frontend_attach(struct dvb_usb_adapter *d)
1458
{
1459
	u8 obuf[3] = { 0xe, 0x87, 0 };
1460
	u8 ibuf[] = { 0 };
1461

  
1462
	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1463
		err("command 0x0e transfer failed.");
1464

  
1465
	obuf[0] = 0xe;
1466
	obuf[1] = 0x86;
1467
	obuf[2] = 1;
1468

  
1469
	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1470
		err("command 0x0e transfer failed.");
1471

  
1472
	obuf[0] = 0xe;
1473
	obuf[1] = 0x80;
1474
	obuf[2] = 0;
1475

  
1476
	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1477
		err("command 0x0e transfer failed.");
1478

  
1479
	msleep(50);
1480

  
1481
	obuf[0] = 0xe;
1482
	obuf[1] = 0x80;
1483
	obuf[2] = 1;
1484

  
1485
	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
1486
		err("command 0x0e transfer failed.");
1487

  
1488
	obuf[0] = 0x51;
1489

  
1490
	if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
1491
		err("command 0x51 transfer failed.");
1492

  
1493
	d->fe_adap[0].fe = dvb_attach(cxd2820r_attach, &cxd2820r_config,
1494
					&d->dev->i2c_adap, NULL);
1495
	if (d->fe_adap[0].fe != NULL) {
1496
		if (dvb_attach(tda18273_attach, d->fe_adap[0].fe,
1497
					&d->dev->i2c_adap, 0x60)) {
1498
			info("Attached TDA18273/CXD2820R!\n");
1499
			return 0;
1500
		}
1501
	}
1502

  
1503
	info("Failed to attach TDA18273/CXD2820R!\n");
1504
	return -EIO;
1505
}
1506

  
1456 1507
static int m88rs2000_frontend_attach(struct dvb_usb_adapter *d)
1457 1508
{
1458 1509
	u8 obuf[] = { 0x51 };
......
1656 1707
	TERRATEC_CINERGY_S2_R2,
1657 1708
	GOTVIEW_SAT_HD,
1658 1709
	GENIATECH_T220,
1710
	GENIATECH_T220A,
1659 1711
	TECHNOTREND_S2_4600,
1660 1712
};
1661 1713

  
......
1680 1732
	[TERRATEC_CINERGY_S2_R2] = {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)},
1681 1733
	[GOTVIEW_SAT_HD] = {USB_DEVICE(0x1FE1, USB_PID_GOTVIEW_SAT_HD)},
1682 1734
	[GENIATECH_T220] = {USB_DEVICE(0x1f4d, 0xD220)},
1735
	[GENIATECH_T220A] = {USB_DEVICE(0x0572, 0xC686)},
1683 1736
	[TECHNOTREND_S2_4600] = {USB_DEVICE(USB_VID_TECHNOTREND,
1684 1737
		USB_PID_TECHNOTREND_CONNECT_S2_4600)},
1685 1738
	{ }
......
2159 2212
	}
2160 2213
};
2161 2214

  
2215
static struct dvb_usb_device_properties t220a_properties = {
2216
	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
2217
	.usb_ctrl = DEVICE_SPECIFIC,
2218
	.size_of_priv = sizeof(struct dw2102_state),
2219
	.power_ctrl = su3000_power_ctrl,
2220
	.num_adapters = 1,
2221
	.identify_state	= su3000_identify_state,
2222
	.i2c_algo = &su3000_i2c_algo,
2223

  
2224
	.rc.core = {
2225
		.rc_interval = 150,
2226
		.rc_codes = RC_MAP_SU3000,
2227
		.module_name = "dw2102",
2228
		.allowed_protos   = RC_BIT_RC5,
2229
		.rc_query = su3000_rc_query,
2230
	},
2231

  
2232
	.read_mac_address = su3000_read_mac_address,
2233

  
2234
	.generic_bulk_ctrl_endpoint = 0x01,
2235

  
2236
	.adapter = {
2237
		{
2238
		.num_frontends = 1,
2239
		.fe = { {
2240
			.streaming_ctrl   = su3000_streaming_ctrl,
2241
			.frontend_attach  = t220a_frontend_attach,
2242
			.stream = {
2243
				.type = USB_BULK,
2244
				.count = 8,
2245
				.endpoint = 0x82,
2246
				.u = {
2247
					.bulk = {
2248
						.buffersize = 4096,
2249
					}
2250
				}
2251
			}
2252
		} },
2253
		}
2254
	},
2255
	.num_device_descs = 1,
2256
	.devices = {
2257
		{ "Geniatech T220A DVB-T/T2 USB2.0",
2258
			{ &dw2102_table[GENIATECH_T220A], NULL },
2259
			{ NULL },
2260
		},
2261
	}
2262
};
2263

  
2162 2264
static struct dvb_usb_device_properties tt_s2_4600_properties = {
2163 2265
	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
2164 2266
	.usb_ctrl = DEVICE_SPECIFIC,
......
2283 2385
			 THIS_MODULE, NULL, adapter_nr) ||
2284 2386
	    0 == dvb_usb_device_init(intf, &t220_properties,
2285 2387
			 THIS_MODULE, NULL, adapter_nr) ||
2388
	    0 == dvb_usb_device_init(intf, &t220a_properties,
2389
			 THIS_MODULE, NULL, adapter_nr) ||
2286 2390
	    0 == dvb_usb_device_init(intf, &tt_s2_4600_properties,
2287 2391
			 THIS_MODULE, NULL, adapter_nr))
2288 2392
		return 0;
......
2320 2424
			" DVB-C 3101 USB2.0,"
2321 2425
			" TeVii S600, S630, S650, S660, S480, S421, S632"
2322 2426
			" Prof 1100, 7500 USB2.0,"
2323
			" Geniatech SU3000, T220,"
2427
			" Geniatech SU3000, T220, T220A,"
2324 2428
			" TechnoTrend S2-4600 devices");
2325 2429
MODULE_VERSION("0.1");
2326 2430
MODULE_LICENSE("GPL");
2327
- 
    (1-1/1)