diff options
| author | Antti Palosaari <crope@iki.fi> | 2014-02-08 02:03:57 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-14 04:35:24 -0400 |
| commit | ae1f8453e828c18cf5291aeab53081dca6906f6e (patch) | |
| tree | ba79e2d8d725d89296c43f2ca5915cf0f1f9758e | |
| parent | 3d0a73aaa95e0bdbf1462779811acbe0af7bb39e (diff) | |
[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: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
| -rw-r--r-- | drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 10 | ||||
| -rw-r--r-- | drivers/media/usb/dvb-usb-v2/rtl28xxu.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c index f51949ed4930..c83c16cece01 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c | |||
| @@ -774,6 +774,9 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap) | |||
| 774 | goto err; | 774 | goto err; |
| 775 | } | 775 | } |
| 776 | 776 | ||
| 777 | /* RTL2832 I2C repeater */ | ||
| 778 | priv->demod_i2c_adapter = rtl2832_get_i2c_adapter(adap->fe[0]); | ||
| 779 | |||
| 777 | /* set fe callback */ | 780 | /* set fe callback */ |
| 778 | adap->fe[0]->callback = rtl2832u_frontend_callback; | 781 | adap->fe[0]->callback = rtl2832u_frontend_callback; |
| 779 | 782 | ||
| @@ -922,6 +925,8 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
| 922 | break; | 925 | break; |
| 923 | case TUNER_RTL2832_E4000: { | 926 | case TUNER_RTL2832_E4000: { |
| 924 | struct v4l2_subdev *sd; | 927 | struct v4l2_subdev *sd; |
| 928 | struct i2c_adapter *i2c_adap_internal = | ||
| 929 | rtl2832_get_private_i2c_adapter(adap->fe[0]); | ||
| 925 | struct e4000_config e4000_config = { | 930 | struct e4000_config e4000_config = { |
| 926 | .fe = adap->fe[0], | 931 | .fe = adap->fe[0], |
| 927 | .clock = 28800000, | 932 | .clock = 28800000, |
| @@ -932,7 +937,7 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
| 932 | info.platform_data = &e4000_config; | 937 | info.platform_data = &e4000_config; |
| 933 | 938 | ||
| 934 | request_module(info.type); | 939 | request_module(info.type); |
| 935 | client = i2c_new_device(&d->i2c_adap, &info); | 940 | client = i2c_new_device(priv->demod_i2c_adapter, &info); |
| 936 | if (client == NULL || client->dev.driver == NULL) | 941 | if (client == NULL || client->dev.driver == NULL) |
| 937 | break; | 942 | break; |
| 938 | 943 | ||
| @@ -943,10 +948,11 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) | |||
| 943 | 948 | ||
| 944 | priv->client = client; | 949 | priv->client = client; |
| 945 | sd = i2c_get_clientdata(client); | 950 | sd = i2c_get_clientdata(client); |
| 951 | i2c_set_adapdata(i2c_adap_internal, d); | ||
| 946 | 952 | ||
| 947 | /* attach SDR */ | 953 | /* attach SDR */ |
| 948 | dvb_attach(rtl2832_sdr_attach, adap->fe[0], | 954 | dvb_attach(rtl2832_sdr_attach, adap->fe[0], |
| 949 | &d->i2c_adap, | 955 | i2c_adap_internal, |
| 950 | &rtl28xxu_rtl2832_e4000_config, sd); | 956 | &rtl28xxu_rtl2832_e4000_config, sd); |
| 951 | } | 957 | } |
| 952 | break; | 958 | break; |
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h index 367aca117d27..a26cab10f382 100644 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.h +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.h | |||
| @@ -55,6 +55,7 @@ struct rtl28xxu_priv { | |||
| 55 | u8 tuner; | 55 | u8 tuner; |
| 56 | char *tuner_name; | 56 | char *tuner_name; |
| 57 | u8 page; /* integrated demod active register page */ | 57 | u8 page; /* integrated demod active register page */ |
| 58 | struct i2c_adapter *demod_i2c_adapter; | ||
| 58 | bool rc_active; | 59 | bool rc_active; |
| 59 | struct i2c_client *client; | 60 | struct i2c_client *client; |
| 60 | }; | 61 | }; |
