Commit 542f6a52 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] rtl28xxu: add support for Elonics E4000 tuner

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ed85adaa
...@@ -141,6 +141,7 @@ config DVB_USB_RTL28XXU ...@@ -141,6 +141,7 @@ config DVB_USB_RTL28XXU
select MEDIA_TUNER_MXL5005S if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_MXL5005S if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_FC0012 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_FC0012 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_FC0013 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_FC0013 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_E4000 if MEDIA_SUBDRV_AUTOSELECT
help help
Say Y here to support the Realtek RTL28xxU DVB USB receiver. Say Y here to support the Realtek RTL28xxU DVB USB receiver.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "mxl5005s.h" #include "mxl5005s.h"
#include "fc0012.h" #include "fc0012.h"
#include "fc0013.h" #include "fc0013.h"
#include "e4000.h"
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
...@@ -625,10 +626,11 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -625,10 +626,11 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
ret = rtl28xxu_ctrl_msg(d, &req_e4000); ret = rtl28xxu_ctrl_msg(d, &req_e4000);
if (ret == 0 && buf[0] == 0x40) { if (ret == 0 && buf[0] == 0x40) {
priv->tuner = TUNER_RTL2832_E4000; priv->tuner = TUNER_RTL2832_E4000;
/* TODO implement tuner */ /* FIXME: do not abuse fc0012 settings */
rtl2832_config = &rtl28xxu_rtl2832_fc0012_config;
dev_info(&d->udev->dev, "%s: E4000 tuner found", dev_info(&d->udev->dev, "%s: E4000 tuner found",
KBUILD_MODNAME); KBUILD_MODNAME);
goto unsupported; goto found;
} }
/* check TDA18272 ID register; reg=00 val=c760 */ /* check TDA18272 ID register; reg=00 val=c760 */
...@@ -746,6 +748,11 @@ static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -746,6 +748,11 @@ static int rtl2831u_tuner_attach(struct dvb_usb_adapter *adap)
return ret; return ret;
} }
static const struct e4000_config rtl2832u_e4000_config = {
.i2c_addr = 0x64,
.clock = 28800000,
};
static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
{ {
int ret; int ret;
...@@ -774,6 +781,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -774,6 +781,10 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
adap->fe[0]->ops.read_signal_strength = adap->fe[0]->ops.read_signal_strength =
adap->fe[0]->ops.tuner_ops.get_rf_strength; adap->fe[0]->ops.tuner_ops.get_rf_strength;
return 0; return 0;
case TUNER_RTL2832_E4000:
fe = dvb_attach(e4000_attach, adap->fe[0], &d->i2c_adap,
&rtl2832u_e4000_config);
break;
default: default:
fe = NULL; fe = NULL;
dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME, dev_err(&d->udev->dev, "%s: unknown tuner=%d\n", KBUILD_MODNAME,
...@@ -1223,6 +1234,8 @@ static const struct usb_device_id rtl28xxu_id_table[] = { ...@@ -1223,6 +1234,8 @@ static const struct usb_device_id rtl28xxu_id_table[] = {
&rtl2832u_props, "G-Tek Electronics Group Lifeview LV5TDLX DVB-T", NULL) }, &rtl2832u_props, "G-Tek Electronics Group Lifeview LV5TDLX DVB-T", NULL) },
{ DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK, { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_NOXON_DAB_STICK,
&rtl2832u_props, "NOXON DAB/DAB+ USB dongle", NULL) }, &rtl2832u_props, "NOXON DAB/DAB+ USB dongle", NULL) },
{ DVB_USB_DEVICE(USB_VID_REALTEK, 0x2838,
&rtl2832u_props, "Realtek RTL2832U reference design", NULL) },
{ } { }
}; };
MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table); MODULE_DEVICE_TABLE(usb, rtl28xxu_id_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment