2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 05:34:00 +08:00

[media] rtl28xxu: add RTL2832P + R828D support

RTL2832P is version of RTL2832U with extra TS interface.
As for now, we support only integrated RTL2832 demod.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
Antti Palosaari 2013-10-30 00:45:38 -03:00 committed by Mauro Carvalho Chehab
parent a26758edff
commit 8b4cac1a12
2 changed files with 40 additions and 0 deletions

View File

@ -377,6 +377,7 @@ static int rtl2832u_read_config(struct dvb_usb_device *d)
struct rtl28xxu_req req_e4000 = {0x02c8, CMD_I2C_RD, 1, buf}; struct rtl28xxu_req req_e4000 = {0x02c8, CMD_I2C_RD, 1, buf};
struct rtl28xxu_req req_tda18272 = {0x00c0, CMD_I2C_RD, 2, buf}; struct rtl28xxu_req req_tda18272 = {0x00c0, CMD_I2C_RD, 2, buf};
struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 1, buf}; struct rtl28xxu_req req_r820t = {0x0034, CMD_I2C_RD, 1, buf};
struct rtl28xxu_req req_r828d = {0x0074, CMD_I2C_RD, 1, buf};
dev_dbg(&d->udev->dev, "%s:\n", __func__); dev_dbg(&d->udev->dev, "%s:\n", __func__);
@ -489,6 +490,15 @@ static int rtl2832u_read_config(struct dvb_usb_device *d)
goto found; goto found;
} }
/* check R828D ID register; reg=00 val=69 */
ret = rtl28xxu_ctrl_msg(d, &req_r828d);
if (ret == 0 && buf[0] == 0x69) {
priv->tuner = TUNER_RTL2832_R828D;
priv->tuner_name = "R828D";
goto found;
}
found: found:
dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name); dev_dbg(&d->udev->dev, "%s: tuner=%s\n", __func__, priv->tuner_name);
@ -745,6 +755,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
rtl2832_config = &rtl28xxu_rtl2832_e4000_config; rtl2832_config = &rtl28xxu_rtl2832_e4000_config;
break; break;
case TUNER_RTL2832_R820T: case TUNER_RTL2832_R820T:
case TUNER_RTL2832_R828D:
rtl2832_config = &rtl28xxu_rtl2832_r820t_config; rtl2832_config = &rtl28xxu_rtl2832_r820t_config;
break; break;
default: default:
@ -866,6 +877,13 @@ static const struct r820t_config rtl2832u_r820t_config = {
.rafael_chip = CHIP_R820T, .rafael_chip = CHIP_R820T,
}; };
static const struct r820t_config rtl2832u_r828d_config = {
.i2c_addr = 0x3a,
.xtal = 16000000,
.max_i2c_msg_len = 2,
.rafael_chip = CHIP_R828D,
};
static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
{ {
int ret; int ret;
@ -919,6 +937,27 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap, fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap,
&rtl2832u_r820t_config); &rtl2832u_r820t_config);
/* Use tuner to get the signal strength */
adap->fe[0]->ops.read_signal_strength =
adap->fe[0]->ops.tuner_ops.get_rf_strength;
break;
case TUNER_RTL2832_R828D:
/* power off mn88472 demod on GPIO0 */
ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_VAL, 0x00, 0x01);
if (ret)
goto err;
ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_DIR, 0x00, 0x01);
if (ret)
goto err;
ret = rtl28xx_wr_reg_mask(d, SYS_GPIO_OUT_EN, 0x01, 0x01);
if (ret)
goto err;
fe = dvb_attach(r820t_attach, adap->fe[0], &d->i2c_adap,
&rtl2832u_r828d_config);
/* Use tuner to get the signal strength */ /* Use tuner to get the signal strength */
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;

View File

@ -83,6 +83,7 @@ enum rtl28xxu_tuner {
TUNER_RTL2832_TDA18272, TUNER_RTL2832_TDA18272,
TUNER_RTL2832_FC0013, TUNER_RTL2832_FC0013,
TUNER_RTL2832_R820T, TUNER_RTL2832_R820T,
TUNER_RTL2832_R828D,
}; };
struct rtl28xxu_req { struct rtl28xxu_req {