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

[media] rtl28xxu: use muxed RTL2832 I2C adapters for E4000 and RTL2832_SDR

RTL2832 driver provides muxed I2C adapters for tuner bus I2C gate
control. Pass those adapters to rtl2832_sdr and e4000 modules in order
to get rid of proprietary DVB .i2c_gate_ctrl() callback use.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 3d0a73aa
...@@ -774,6 +774,9 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -774,6 +774,9 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
goto err; goto err;
} }
/* RTL2832 I2C repeater */
priv->demod_i2c_adapter = rtl2832_get_i2c_adapter(adap->fe[0]);
/* set fe callback */ /* set fe callback */
adap->fe[0]->callback = rtl2832u_frontend_callback; adap->fe[0]->callback = rtl2832u_frontend_callback;
...@@ -922,6 +925,8 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -922,6 +925,8 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
break; break;
case TUNER_RTL2832_E4000: { case TUNER_RTL2832_E4000: {
struct v4l2_subdev *sd; struct v4l2_subdev *sd;
struct i2c_adapter *i2c_adap_internal =
rtl2832_get_private_i2c_adapter(adap->fe[0]);
struct e4000_config e4000_config = { struct e4000_config e4000_config = {
.fe = adap->fe[0], .fe = adap->fe[0],
.clock = 28800000, .clock = 28800000,
...@@ -932,7 +937,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -932,7 +937,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
info.platform_data = &e4000_config; info.platform_data = &e4000_config;
request_module(info.type); request_module(info.type);
client = i2c_new_device(&d->i2c_adap, &info); client = i2c_new_device(priv->demod_i2c_adapter, &info);
if (client == NULL || client->dev.driver == NULL) if (client == NULL || client->dev.driver == NULL)
break; break;
...@@ -943,10 +948,11 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -943,10 +948,11 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
priv->client = client; priv->client = client;
sd = i2c_get_clientdata(client); sd = i2c_get_clientdata(client);
i2c_set_adapdata(i2c_adap_internal, d);
/* attach SDR */ /* attach SDR */
dvb_attach(rtl2832_sdr_attach, adap->fe[0], dvb_attach(rtl2832_sdr_attach, adap->fe[0],
&d->i2c_adap, i2c_adap_internal,
&rtl28xxu_rtl2832_e4000_config, sd); &rtl28xxu_rtl2832_e4000_config, sd);
} }
break; break;
......
...@@ -55,6 +55,7 @@ struct rtl28xxu_priv { ...@@ -55,6 +55,7 @@ struct rtl28xxu_priv {
u8 tuner; u8 tuner;
char *tuner_name; char *tuner_name;
u8 page; /* integrated demod active register page */ u8 page; /* integrated demod active register page */
struct i2c_adapter *demod_i2c_adapter;
bool rc_active; bool rc_active;
struct i2c_client *client; struct i2c_client *client;
}; };
......
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