Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: dvb-usb-cxusb: Geniatech T230C support

This reverts commit f8585ce655e9cdeabc38e8e2580b05735110e4a5.

The T230C is handled by the dvb-usb-v2/dvbsky.c driver, which should
be preferred over a dvb-usb (v1) driver.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Evgeny Plehov and committed by
Mauro Carvalho Chehab
c20ffbfe 19fbf1ba

+1 -138
+1 -138
drivers/media/usb/dvb-usb/cxusb.c
··· 1243 1243 return 0; 1244 1244 } 1245 1245 1246 - static int cxusb_mygica_t230c_frontend_attach(struct dvb_usb_adapter *adap) 1247 - { 1248 - struct dvb_usb_device *d = adap->dev; 1249 - struct cxusb_state *st = d->priv; 1250 - struct i2c_adapter *adapter; 1251 - struct i2c_client *client_demod; 1252 - struct i2c_client *client_tuner; 1253 - struct i2c_board_info info; 1254 - struct si2168_config si2168_config; 1255 - struct si2157_config si2157_config; 1256 - 1257 - /* Select required USB configuration */ 1258 - if (usb_set_interface(d->udev, 0, 0) < 0) 1259 - err("set interface failed"); 1260 - 1261 - /* Unblock all USB pipes */ 1262 - usb_clear_halt(d->udev, 1263 - usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); 1264 - usb_clear_halt(d->udev, 1265 - usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint)); 1266 - usb_clear_halt(d->udev, 1267 - usb_rcvbulkpipe(d->udev, d->props.adapter[0].fe[0].stream.endpoint)); 1268 - 1269 - /* attach frontend */ 1270 - memset(&si2168_config, 0, sizeof(si2168_config)); 1271 - si2168_config.i2c_adapter = &adapter; 1272 - si2168_config.fe = &adap->fe_adap[0].fe; 1273 - si2168_config.ts_mode = SI2168_TS_PARALLEL; 1274 - si2168_config.ts_clock_inv = 1; 1275 - memset(&info, 0, sizeof(struct i2c_board_info)); 1276 - strlcpy(info.type, "si2168", I2C_NAME_SIZE); 1277 - info.addr = 0x64; 1278 - info.platform_data = &si2168_config; 1279 - request_module(info.type); 1280 - client_demod = i2c_new_device(&d->i2c_adap, &info); 1281 - if (client_demod == NULL || client_demod->dev.driver == NULL) 1282 - return -ENODEV; 1283 - 1284 - if (!try_module_get(client_demod->dev.driver->owner)) { 1285 - i2c_unregister_device(client_demod); 1286 - return -ENODEV; 1287 - } 1288 - 1289 - /* attach tuner */ 1290 - memset(&si2157_config, 0, sizeof(si2157_config)); 1291 - si2157_config.fe = adap->fe_adap[0].fe; 1292 - memset(&info, 0, sizeof(struct i2c_board_info)); 1293 - strlcpy(info.type, "si2141", I2C_NAME_SIZE); 1294 - info.addr = 0x60; 1295 - info.platform_data = &si2157_config; 1296 - request_module("si2157"); 1297 - client_tuner = i2c_new_device(adapter, &info); 1298 - if (client_tuner == NULL || client_tuner->dev.driver == NULL) { 1299 - module_put(client_demod->dev.driver->owner); 1300 - i2c_unregister_device(client_demod); 1301 - return -ENODEV; 1302 - } 1303 - if (!try_module_get(client_tuner->dev.driver->owner)) { 1304 - i2c_unregister_device(client_tuner); 1305 - module_put(client_demod->dev.driver->owner); 1306 - i2c_unregister_device(client_demod); 1307 - return -ENODEV; 1308 - } 1309 - 1310 - st->i2c_client_demod = client_demod; 1311 - st->i2c_client_tuner = client_tuner; 1312 - 1313 - /* hook fe: need to resync the slave fifo when signal locks. */ 1314 - mutex_init(&st->stream_mutex); 1315 - st->last_lock = 0; 1316 - st->fe_read_status = adap->fe_adap[0].fe->ops.read_status; 1317 - adap->fe_adap[0].fe->ops.read_status = cxusb_read_status; 1318 - 1319 - return 0; 1320 - } 1321 - 1322 1246 /* 1323 1247 * DViCO has shipped two devices with the same USB ID, but only one of them 1324 1248 * needs a firmware download. Check the device class details to see if they ··· 1325 1401 static struct dvb_usb_device_properties cxusb_d680_dmb_properties; 1326 1402 static struct dvb_usb_device_properties cxusb_mygica_d689_properties; 1327 1403 static struct dvb_usb_device_properties cxusb_mygica_t230_properties; 1328 - static struct dvb_usb_device_properties cxusb_mygica_t230c_properties; 1329 1404 1330 1405 static int cxusb_probe(struct usb_interface *intf, 1331 1406 const struct usb_device_id *id) ··· 1356 1433 0 == dvb_usb_device_init(intf, &cxusb_mygica_d689_properties, 1357 1434 THIS_MODULE, NULL, adapter_nr) || 1358 1435 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, 1359 - THIS_MODULE, NULL, adapter_nr) || 1360 - 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230c_properties, 1361 1436 THIS_MODULE, NULL, adapter_nr) || 1362 1437 0) 1363 1438 return 0; ··· 1408 1487 CONEXANT_D680_DMB, 1409 1488 MYGICA_D689, 1410 1489 MYGICA_T230, 1411 - MYGICA_T230C, 1412 1490 NR__cxusb_table_index 1413 1491 }; 1414 1492 ··· 1474 1554 }, 1475 1555 [MYGICA_T230] = { 1476 1556 USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230) 1477 - }, 1478 - [MYGICA_T230C] = { 1479 - USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230+1) 1480 1557 }, 1481 1558 {} /* Terminating entry */ 1482 1559 }; ··· 2169 2252 2170 2253 .rc.core = { 2171 2254 .rc_interval = 100, 2172 - .rc_codes = RC_MAP_TOTAL_MEDIA_IN_HAND_02, 2255 + .rc_codes = RC_MAP_D680_DMB, 2173 2256 .module_name = KBUILD_MODNAME, 2174 2257 .rc_query = cxusb_d680_dmb_rc_query, 2175 2258 .allowed_protos = RC_PROTO_BIT_UNKNOWN, ··· 2181 2264 "Mygica T230 DVB-T/T2/C", 2182 2265 { NULL }, 2183 2266 { &cxusb_table[MYGICA_T230], NULL }, 2184 - }, 2185 - } 2186 - }; 2187 - 2188 - static struct dvb_usb_device_properties cxusb_mygica_t230c_properties = { 2189 - .caps = DVB_USB_IS_AN_I2C_ADAPTER, 2190 - 2191 - .usb_ctrl = CYPRESS_FX2, 2192 - 2193 - .size_of_priv = sizeof(struct cxusb_state), 2194 - 2195 - .num_adapters = 1, 2196 - .adapter = { 2197 - { 2198 - .num_frontends = 1, 2199 - .fe = {{ 2200 - .streaming_ctrl = cxusb_streaming_ctrl, 2201 - .frontend_attach = cxusb_mygica_t230c_frontend_attach, 2202 - 2203 - /* parameter for the MPEG2-data transfer */ 2204 - .stream = { 2205 - .type = USB_BULK, 2206 - .count = 5, 2207 - .endpoint = 0x02, 2208 - .u = { 2209 - .bulk = { 2210 - .buffersize = 8192, 2211 - } 2212 - } 2213 - }, 2214 - } }, 2215 - }, 2216 - }, 2217 - 2218 - .power_ctrl = cxusb_d680_dmb_power_ctrl, 2219 - 2220 - .i2c_algo = &cxusb_i2c_algo, 2221 - 2222 - .generic_bulk_ctrl_endpoint = 0x01, 2223 - 2224 - .rc.core = { 2225 - .rc_interval = 100, 2226 - .rc_codes = RC_MAP_TOTAL_MEDIA_IN_HAND_02, 2227 - .module_name = KBUILD_MODNAME, 2228 - .rc_query = cxusb_d680_dmb_rc_query, 2229 - .allowed_protos = RC_PROTO_BIT_UNKNOWN, 2230 - }, 2231 - 2232 - .num_device_descs = 1, 2233 - .devices = { 2234 - { 2235 - "Mygica T230C DVB-T/T2/C", 2236 - { NULL }, 2237 - { &cxusb_table[MYGICA_T230C], NULL }, 2238 2267 }, 2239 2268 } 2240 2269 };