aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-09-08 21:07:25 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-23 16:12:54 -0400
commit384df49a6a97d411af33da3237558411789b67c5 (patch)
treee565c96fbe065717b5ca2c1ffcc2506c14957469 /drivers/media
parentd9cb41afbf2aab54133c804009a1b8e76cedaef3 (diff)
[media] rtl28xxu: add support for FCI FC2580 silicon tuner driver
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/dvb-usb-v2/Kconfig1
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c15
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/Kconfig b/drivers/media/usb/dvb-usb-v2/Kconfig
index 329d2221e915..e09930c6b4f9 100644
--- a/drivers/media/usb/dvb-usb-v2/Kconfig
+++ b/drivers/media/usb/dvb-usb-v2/Kconfig
@@ -142,6 +142,7 @@ config DVB_USB_RTL28XXU
142 select MEDIA_TUNER_FC0012 if MEDIA_SUBDRV_AUTOSELECT 142 select MEDIA_TUNER_FC0012 if MEDIA_SUBDRV_AUTOSELECT
143 select MEDIA_TUNER_FC0013 if MEDIA_SUBDRV_AUTOSELECT 143 select MEDIA_TUNER_FC0013 if MEDIA_SUBDRV_AUTOSELECT
144 select MEDIA_TUNER_E4000 if MEDIA_SUBDRV_AUTOSELECT 144 select MEDIA_TUNER_E4000 if MEDIA_SUBDRV_AUTOSELECT
145 select MEDIA_TUNER_FC2580 if MEDIA_SUBDRV_AUTOSELECT
145 help 146 help
146 Say Y here to support the Realtek RTL28xxU DVB USB receiver. 147 Say Y here to support the Realtek RTL28xxU DVB USB receiver.
147 148
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index d0d23f2c1fe7..f195b778794a 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -31,6 +31,7 @@
31#include "fc0012.h" 31#include "fc0012.h"
32#include "fc0013.h" 32#include "fc0013.h"
33#include "e4000.h" 33#include "e4000.h"
34#include "fc2580.h"
34 35
35DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 36DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
36 37
@@ -576,10 +577,11 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
576 ret = rtl28xxu_ctrl_msg(d, &req_fc2580); 577 ret = rtl28xxu_ctrl_msg(d, &req_fc2580);
577 if (ret == 0 && buf[0] == 0x56) { 578 if (ret == 0 && buf[0] == 0x56) {
578 priv->tuner = TUNER_RTL2832_FC2580; 579 priv->tuner = TUNER_RTL2832_FC2580;
579 /* TODO implement tuner */ 580 /* FIXME: do not abuse fc0012 settings */
581 rtl2832_config = &rtl28xxu_rtl2832_fc0012_config;
580 dev_info(&d->udev->dev, "%s: FC2580 tuner found", 582 dev_info(&d->udev->dev, "%s: FC2580 tuner found",
581 KBUILD_MODNAME); 583 KBUILD_MODNAME);
582 goto unsupported; 584 goto found;
583 } 585 }
584 586
585 /* check MT2063 ID register; reg=00 val=9e || 9c */ 587 /* check MT2063 ID register; reg=00 val=9e || 9c */
@@ -753,6 +755,11 @@ static const struct e4000_config rtl2832u_e4000_config = {
753 .clock = 28800000, 755 .clock = 28800000,
754}; 756};
755 757
758static const struct fc2580_config rtl2832u_fc2580_config = {
759 .i2c_addr = 0x56,
760 .clock = 16384000,
761};
762
756static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) 763static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
757{ 764{
758 int ret; 765 int ret;
@@ -785,6 +792,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
785 fe = dvb_attach(e4000_attach, adap->fe[0], &d->i2c_adap, 792 fe = dvb_attach(e4000_attach, adap->fe[0], &d->i2c_adap,
786 &rtl2832u_e4000_config); 793 &rtl2832u_e4000_config);
787 break; 794 break;
795 case TUNER_RTL2832_FC2580:
796 fe = dvb_attach(fc2580_attach, adap->fe[0], &d->i2c_adap,
797 &rtl2832u_fc2580_config);
798 break;
788 default: 799 default:
789 fe = NULL; 800 fe = NULL;
790 dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, 801 dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME,