aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-02-13 13:53:05 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-14 19:26:47 -0400
commitb24c2b4fb126007e36c5a67461527a5bfed33d17 (patch)
treeb8fa6dc7c71105f4f035af009d492712ce1ad014
parent040cf86c8a121905bf201f334a4848f35de29729 (diff)
[media] af9035: use af9033 PID filters
PID filters are property of af9033 demod. Use PID filters from af9033 driver as it provides those now. Allow possible dual mode on USB 1.1 mode too as bandwidth could be just enough when filters are used on both frontends. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c61
1 files changed, 10 insertions, 51 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 1434d379da27..31d09a23c82e 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -945,12 +945,7 @@ static int af9035_frontend_callback(void *adapter_priv, int component,
945static int af9035_get_adapter_count(struct dvb_usb_device *d) 945static int af9035_get_adapter_count(struct dvb_usb_device *d)
946{ 946{
947 struct state *state = d_to_priv(d); 947 struct state *state = d_to_priv(d);
948 948 return state->dual_mode + 1;
949 /* disable 2nd adapter as we don't have PID filters implemented */
950 if (d->udev->speed == USB_SPEED_FULL)
951 return 1;
952 else
953 return state->dual_mode + 1;
954} 949}
955 950
956static int af9035_frontend_attach(struct dvb_usb_adapter *adap) 951static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
@@ -1376,58 +1371,15 @@ static int af9035_get_stream_config(struct dvb_frontend *fe, u8 *ts_type,
1376 return 0; 1371 return 0;
1377} 1372}
1378 1373
1379/*
1380 * FIXME: PID filter is property of demodulator and should be moved to the
1381 * correct driver. Also we support only adapter #0 PID filter and will
1382 * disable adapter #1 if USB1.1 is used.
1383 */
1384static int af9035_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) 1374static int af9035_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
1385{ 1375{
1386 struct dvb_usb_device *d = adap_to_d(adap); 1376 return af9033_pid_filter_ctrl(adap->fe[0], onoff);
1387 int ret;
1388
1389 dev_dbg(&d->udev->dev, "%s: onoff=%d\n", __func__, onoff);
1390
1391 ret = af9035_wr_reg_mask(d, 0x80f993, onoff, 0x01);
1392 if (ret < 0)
1393 goto err;
1394
1395 return 0;
1396
1397err:
1398 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
1399
1400 return ret;
1401} 1377}
1402 1378
1403static int af9035_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, 1379static int af9035_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid,
1404 int onoff) 1380 int onoff)
1405{ 1381{
1406 struct dvb_usb_device *d = adap_to_d(adap); 1382 return af9033_pid_filter(adap->fe[0], index, pid, onoff);
1407 int ret;
1408 u8 wbuf[2] = {(pid >> 0) & 0xff, (pid >> 8) & 0xff};
1409
1410 dev_dbg(&d->udev->dev, "%s: index=%d pid=%04x onoff=%d\n",
1411 __func__, index, pid, onoff);
1412
1413 ret = af9035_wr_regs(d, 0x80f996, wbuf, 2);
1414 if (ret < 0)
1415 goto err;
1416
1417 ret = af9035_wr_reg(d, 0x80f994, onoff);
1418 if (ret < 0)
1419 goto err;
1420
1421 ret = af9035_wr_reg(d, 0x80f995, index);
1422 if (ret < 0)
1423 goto err;
1424
1425 return 0;
1426
1427err:
1428 dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
1429
1430 return ret;
1431} 1383}
1432 1384
1433static int af9035_probe(struct usb_interface *intf, 1385static int af9035_probe(struct usb_interface *intf,
@@ -1501,6 +1453,13 @@ static const struct dvb_usb_device_properties af9035_props = {
1501 1453
1502 .stream = DVB_USB_STREAM_BULK(0x84, 6, 87 * 188), 1454 .stream = DVB_USB_STREAM_BULK(0x84, 6, 87 * 188),
1503 }, { 1455 }, {
1456 .caps = DVB_USB_ADAP_HAS_PID_FILTER |
1457 DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
1458
1459 .pid_filter_count = 32,
1460 .pid_filter_ctrl = af9035_pid_filter_ctrl,
1461 .pid_filter = af9035_pid_filter,
1462
1504 .stream = DVB_USB_STREAM_BULK(0x85, 6, 87 * 188), 1463 .stream = DVB_USB_STREAM_BULK(0x85, 6, 87 * 188),
1505 }, 1464 },
1506 }, 1465 },