diff options
author | Antti Palosaari <crope@iki.fi> | 2014-12-12 22:21:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-03 13:01:25 -0500 |
commit | ac32ee42cc880e62ab6dcb05372767f31ba4a19b (patch) | |
tree | c9c8ca249399a0ddad6b0902c449f4b6b4f19d81 | |
parent | 77a2e76b8505c2ed00db4925c22bfcde2be701a4 (diff) |
[media] rtl2832: remove exported resources
Exported resources are not needed anymore as all users are using
callbacks carried via platform data. Due to that we will remove
those.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832.c | 138 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832.h | 60 |
2 files changed, 0 insertions, 198 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index 8c36a8415c4c..2316a2ad410a 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c | |||
@@ -886,19 +886,6 @@ err: | |||
886 | return ret; | 886 | return ret; |
887 | } | 887 | } |
888 | 888 | ||
889 | static struct dvb_frontend_ops rtl2832_ops; | ||
890 | |||
891 | static void rtl2832_release(struct dvb_frontend *fe) | ||
892 | { | ||
893 | struct rtl2832_priv *priv = fe->demodulator_priv; | ||
894 | |||
895 | dev_dbg(&priv->i2c->dev, "%s:\n", __func__); | ||
896 | cancel_delayed_work_sync(&priv->i2c_gate_work); | ||
897 | i2c_del_mux_adapter(priv->i2c_adapter_tuner); | ||
898 | i2c_del_mux_adapter(priv->i2c_adapter); | ||
899 | kfree(priv); | ||
900 | } | ||
901 | |||
902 | /* | 889 | /* |
903 | * Delay mechanism to avoid unneeded I2C gate open / close. Gate close is | 890 | * Delay mechanism to avoid unneeded I2C gate open / close. Gate close is |
904 | * delayed here a little bit in order to see if there is sequence of I2C | 891 | * delayed here a little bit in order to see if there is sequence of I2C |
@@ -1022,126 +1009,6 @@ static int rtl2832_deselect(struct i2c_adapter *adap, void *mux_priv, | |||
1022 | return 0; | 1009 | return 0; |
1023 | } | 1010 | } |
1024 | 1011 | ||
1025 | int rtl2832_enable_external_ts_if(struct dvb_frontend *fe) | ||
1026 | { | ||
1027 | struct rtl2832_priv *priv = fe->demodulator_priv; | ||
1028 | int ret; | ||
1029 | |||
1030 | dev_dbg(&priv->i2c->dev, "%s: setting PIP mode\n", __func__); | ||
1031 | |||
1032 | ret = rtl2832_wr_regs(priv, 0x0c, 1, "\x5f\xff", 2); | ||
1033 | if (ret) | ||
1034 | goto err; | ||
1035 | |||
1036 | ret = rtl2832_wr_demod_reg(priv, DVBT_PIP_ON, 0x1); | ||
1037 | if (ret) | ||
1038 | goto err; | ||
1039 | |||
1040 | ret = rtl2832_wr_reg(priv, 0xbc, 0, 0x18); | ||
1041 | if (ret) | ||
1042 | goto err; | ||
1043 | |||
1044 | ret = rtl2832_wr_reg(priv, 0x22, 0, 0x01); | ||
1045 | if (ret) | ||
1046 | goto err; | ||
1047 | |||
1048 | ret = rtl2832_wr_reg(priv, 0x26, 0, 0x1f); | ||
1049 | if (ret) | ||
1050 | goto err; | ||
1051 | |||
1052 | ret = rtl2832_wr_reg(priv, 0x27, 0, 0xff); | ||
1053 | if (ret) | ||
1054 | goto err; | ||
1055 | |||
1056 | ret = rtl2832_wr_regs(priv, 0x92, 1, "\x7f\xf7\xff", 3); | ||
1057 | if (ret) | ||
1058 | goto err; | ||
1059 | |||
1060 | /* soft reset */ | ||
1061 | ret = rtl2832_wr_demod_reg(priv, DVBT_SOFT_RST, 0x1); | ||
1062 | if (ret) | ||
1063 | goto err; | ||
1064 | |||
1065 | ret = rtl2832_wr_demod_reg(priv, DVBT_SOFT_RST, 0x0); | ||
1066 | if (ret) | ||
1067 | goto err; | ||
1068 | |||
1069 | return 0; | ||
1070 | err: | ||
1071 | dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); | ||
1072 | return ret; | ||
1073 | |||
1074 | } | ||
1075 | EXPORT_SYMBOL(rtl2832_enable_external_ts_if); | ||
1076 | |||
1077 | struct i2c_adapter *rtl2832_get_i2c_adapter(struct dvb_frontend *fe) | ||
1078 | { | ||
1079 | struct rtl2832_priv *priv = fe->demodulator_priv; | ||
1080 | return priv->i2c_adapter_tuner; | ||
1081 | } | ||
1082 | EXPORT_SYMBOL(rtl2832_get_i2c_adapter); | ||
1083 | |||
1084 | struct i2c_adapter *rtl2832_get_private_i2c_adapter(struct dvb_frontend *fe) | ||
1085 | { | ||
1086 | struct rtl2832_priv *priv = fe->demodulator_priv; | ||
1087 | return priv->i2c_adapter; | ||
1088 | } | ||
1089 | EXPORT_SYMBOL(rtl2832_get_private_i2c_adapter); | ||
1090 | |||
1091 | struct dvb_frontend *rtl2832_attach(const struct rtl2832_config *cfg, | ||
1092 | struct i2c_adapter *i2c) | ||
1093 | { | ||
1094 | struct rtl2832_priv *priv = NULL; | ||
1095 | int ret = 0; | ||
1096 | u8 tmp; | ||
1097 | |||
1098 | dev_dbg(&i2c->dev, "%s:\n", __func__); | ||
1099 | |||
1100 | /* allocate memory for the internal state */ | ||
1101 | priv = kzalloc(sizeof(struct rtl2832_priv), GFP_KERNEL); | ||
1102 | if (priv == NULL) | ||
1103 | goto err; | ||
1104 | |||
1105 | /* setup the priv */ | ||
1106 | priv->i2c = i2c; | ||
1107 | priv->tuner = cfg->tuner; | ||
1108 | memcpy(&priv->cfg, cfg, sizeof(struct rtl2832_config)); | ||
1109 | INIT_DELAYED_WORK(&priv->i2c_gate_work, rtl2832_i2c_gate_work); | ||
1110 | |||
1111 | /* create muxed i2c adapter for demod itself */ | ||
1112 | priv->i2c_adapter = i2c_add_mux_adapter(i2c, &i2c->dev, priv, 0, 0, 0, | ||
1113 | rtl2832_select, NULL); | ||
1114 | if (priv->i2c_adapter == NULL) | ||
1115 | goto err; | ||
1116 | |||
1117 | /* check if the demod is there */ | ||
1118 | ret = rtl2832_rd_reg(priv, 0x00, 0x0, &tmp); | ||
1119 | if (ret) | ||
1120 | goto err; | ||
1121 | |||
1122 | /* create muxed i2c adapter for demod tuner bus */ | ||
1123 | priv->i2c_adapter_tuner = i2c_add_mux_adapter(i2c, &i2c->dev, priv, | ||
1124 | 0, 1, 0, rtl2832_select, rtl2832_deselect); | ||
1125 | if (priv->i2c_adapter_tuner == NULL) | ||
1126 | goto err; | ||
1127 | |||
1128 | /* create dvb_frontend */ | ||
1129 | memcpy(&priv->fe.ops, &rtl2832_ops, sizeof(struct dvb_frontend_ops)); | ||
1130 | priv->fe.demodulator_priv = priv; | ||
1131 | |||
1132 | /* TODO implement sleep mode */ | ||
1133 | priv->sleeping = true; | ||
1134 | |||
1135 | return &priv->fe; | ||
1136 | err: | ||
1137 | dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret); | ||
1138 | if (priv && priv->i2c_adapter) | ||
1139 | i2c_del_mux_adapter(priv->i2c_adapter); | ||
1140 | kfree(priv); | ||
1141 | return NULL; | ||
1142 | } | ||
1143 | EXPORT_SYMBOL(rtl2832_attach); | ||
1144 | |||
1145 | static struct dvb_frontend_ops rtl2832_ops = { | 1012 | static struct dvb_frontend_ops rtl2832_ops = { |
1146 | .delsys = { SYS_DVBT }, | 1013 | .delsys = { SYS_DVBT }, |
1147 | .info = { | 1014 | .info = { |
@@ -1166,8 +1033,6 @@ static struct dvb_frontend_ops rtl2832_ops = { | |||
1166 | FE_CAN_MUTE_TS | 1033 | FE_CAN_MUTE_TS |
1167 | }, | 1034 | }, |
1168 | 1035 | ||
1169 | .release = rtl2832_release, | ||
1170 | |||
1171 | .init = rtl2832_init, | 1036 | .init = rtl2832_init, |
1172 | .sleep = rtl2832_sleep, | 1037 | .sleep = rtl2832_sleep, |
1173 | 1038 | ||
@@ -1307,11 +1172,8 @@ static int rtl2832_probe(struct i2c_client *client, | |||
1307 | 1172 | ||
1308 | /* create dvb_frontend */ | 1173 | /* create dvb_frontend */ |
1309 | memcpy(&priv->fe.ops, &rtl2832_ops, sizeof(struct dvb_frontend_ops)); | 1174 | memcpy(&priv->fe.ops, &rtl2832_ops, sizeof(struct dvb_frontend_ops)); |
1310 | priv->fe.ops.release = NULL; | ||
1311 | priv->fe.demodulator_priv = priv; | 1175 | priv->fe.demodulator_priv = priv; |
1312 | i2c_set_clientdata(client, priv); | 1176 | i2c_set_clientdata(client, priv); |
1313 | if (pdata->dvb_frontend) | ||
1314 | *pdata->dvb_frontend = &priv->fe; | ||
1315 | 1177 | ||
1316 | /* setup callbacks */ | 1178 | /* setup callbacks */ |
1317 | pdata->get_dvb_frontend = rtl2832_get_dvb_frontend; | 1179 | pdata->get_dvb_frontend = rtl2832_get_dvb_frontend; |
diff --git a/drivers/media/dvb-frontends/rtl2832.h b/drivers/media/dvb-frontends/rtl2832.h index dbc4d3ca5d37..983d5a1f3340 100644 --- a/drivers/media/dvb-frontends/rtl2832.h +++ b/drivers/media/dvb-frontends/rtl2832.h | |||
@@ -21,7 +21,6 @@ | |||
21 | #ifndef RTL2832_H | 21 | #ifndef RTL2832_H |
22 | #define RTL2832_H | 22 | #define RTL2832_H |
23 | 23 | ||
24 | #include <linux/kconfig.h> | ||
25 | #include <linux/dvb/frontend.h> | 24 | #include <linux/dvb/frontend.h> |
26 | 25 | ||
27 | struct rtl2832_config { | 26 | struct rtl2832_config { |
@@ -54,12 +53,6 @@ struct rtl2832_platform_data { | |||
54 | const struct rtl2832_config *config; | 53 | const struct rtl2832_config *config; |
55 | 54 | ||
56 | /* | 55 | /* |
57 | * frontend | ||
58 | * returned by driver | ||
59 | */ | ||
60 | struct dvb_frontend **dvb_frontend; | ||
61 | |||
62 | /* | ||
63 | */ | 56 | */ |
64 | struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *); | 57 | struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *); |
65 | struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *); | 58 | struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *); |
@@ -67,57 +60,4 @@ struct rtl2832_platform_data { | |||
67 | int (*enable_slave_ts)(struct i2c_client *); | 60 | int (*enable_slave_ts)(struct i2c_client *); |
68 | }; | 61 | }; |
69 | 62 | ||
70 | #if IS_ENABLED(CONFIG_DVB_RTL2832) | ||
71 | struct dvb_frontend *rtl2832_attach( | ||
72 | const struct rtl2832_config *cfg, | ||
73 | struct i2c_adapter *i2c | ||
74 | ); | ||
75 | |||
76 | extern struct i2c_adapter *rtl2832_get_i2c_adapter( | ||
77 | struct dvb_frontend *fe | ||
78 | ); | ||
79 | |||
80 | extern struct i2c_adapter *rtl2832_get_private_i2c_adapter( | ||
81 | struct dvb_frontend *fe | ||
82 | ); | ||
83 | |||
84 | extern int rtl2832_enable_external_ts_if( | ||
85 | struct dvb_frontend *fe | ||
86 | ); | ||
87 | |||
88 | #else | ||
89 | |||
90 | static inline struct dvb_frontend *rtl2832_attach( | ||
91 | const struct rtl2832_config *config, | ||
92 | struct i2c_adapter *i2c | ||
93 | ) | ||
94 | { | ||
95 | pr_warn("%s: driver disabled by Kconfig\n", __func__); | ||
96 | return NULL; | ||
97 | } | ||
98 | |||
99 | static inline struct i2c_adapter *rtl2832_get_i2c_adapter( | ||
100 | struct dvb_frontend *fe | ||
101 | ) | ||
102 | { | ||
103 | return NULL; | ||
104 | } | ||
105 | |||
106 | static inline struct i2c_adapter *rtl2832_get_private_i2c_adapter( | ||
107 | struct dvb_frontend *fe | ||
108 | ) | ||
109 | { | ||
110 | return NULL; | ||
111 | } | ||
112 | |||
113 | static inline int rtl2832_enable_external_ts_if( | ||
114 | struct dvb_frontend *fe | ||
115 | ) | ||
116 | { | ||
117 | return -ENODEV; | ||
118 | } | ||
119 | |||
120 | #endif | ||
121 | |||
122 | |||
123 | #endif /* RTL2832_H */ | 63 | #endif /* RTL2832_H */ |