aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2015-04-20 16:39:33 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-11 06:08:32 -0400
commit55881b4fb50976a2956e6de3001bbe0a37e8be9a (patch)
tree7b9b3887c1dae7e3cfae85906a192be8d8ea24b6
parentd029419dc6176ee860ef73baceec92de3efc4704 (diff)
[media] a8293: remove legacy media attach
Remove legacy media attach as all users are on I2C bindings now. 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/a8293.c63
-rw-r--r--drivers/media/dvb-frontends/a8293.h18
2 files changed, 1 insertions, 80 deletions
diff --git a/drivers/media/dvb-frontends/a8293.c b/drivers/media/dvb-frontends/a8293.c
index 97ecbe01034c..522b0d125860 100644
--- a/drivers/media/dvb-frontends/a8293.c
+++ b/drivers/media/dvb-frontends/a8293.c
@@ -18,7 +18,6 @@
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */ 19 */
20 20
21#include "dvb_frontend.h"
22#include "a8293.h" 21#include "a8293.h"
23 22
24struct a8293_priv { 23struct a8293_priv {
@@ -105,68 +104,8 @@ err:
105 return ret; 104 return ret;
106} 105}
107 106
108static void a8293_release_sec(struct dvb_frontend *fe)
109{
110 a8293_set_voltage(fe, SEC_VOLTAGE_OFF);
111
112 kfree(fe->sec_priv);
113 fe->sec_priv = NULL;
114}
115
116struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
117 struct i2c_adapter *i2c, const struct a8293_config *cfg)
118{
119 int ret;
120 struct a8293_priv *priv = NULL;
121 u8 buf[2];
122
123 /* allocate memory for the internal priv */
124 priv = kzalloc(sizeof(struct a8293_priv), GFP_KERNEL);
125 if (priv == NULL) {
126 ret = -ENOMEM;
127 goto err;
128 }
129
130 /* setup the priv */
131 priv->i2c = i2c;
132 priv->i2c_addr = cfg->i2c_addr;
133 fe->sec_priv = priv;
134
135 /* check if the SEC is there */
136 ret = a8293_rd(priv, buf, 2);
137 if (ret)
138 goto err;
139
140 /* ENB=0 */
141 priv->reg[0] = 0x10;
142 ret = a8293_wr(priv, &priv->reg[0], 1);
143 if (ret)
144 goto err;
145
146 /* TMODE=0, TGATE=1 */
147 priv->reg[1] = 0x82;
148 ret = a8293_wr(priv, &priv->reg[1], 1);
149 if (ret)
150 goto err;
151
152 fe->ops.release_sec = a8293_release_sec;
153
154 /* override frontend ops */
155 fe->ops.set_voltage = a8293_set_voltage;
156
157 dev_info(&priv->i2c->dev, "%s: Allegro A8293 SEC attached\n",
158 KBUILD_MODNAME);
159
160 return fe;
161err:
162 dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret);
163 kfree(priv);
164 return NULL;
165}
166EXPORT_SYMBOL(a8293_attach);
167
168static int a8293_probe(struct i2c_client *client, 107static int a8293_probe(struct i2c_client *client,
169 const struct i2c_device_id *id) 108 const struct i2c_device_id *id)
170{ 109{
171 struct a8293_priv *dev; 110 struct a8293_priv *dev;
172 struct a8293_platform_data *pdata = client->dev.platform_data; 111 struct a8293_platform_data *pdata = client->dev.platform_data;
diff --git a/drivers/media/dvb-frontends/a8293.h b/drivers/media/dvb-frontends/a8293.h
index aff36538f582..aa07b68d19e0 100644
--- a/drivers/media/dvb-frontends/a8293.h
+++ b/drivers/media/dvb-frontends/a8293.h
@@ -22,7 +22,6 @@
22#define A8293_H 22#define A8293_H
23 23
24#include "dvb_frontend.h" 24#include "dvb_frontend.h"
25#include <linux/kconfig.h>
26 25
27/* 26/*
28 * I2C address 27 * I2C address
@@ -37,21 +36,4 @@ struct a8293_platform_data {
37 struct dvb_frontend *dvb_frontend; 36 struct dvb_frontend *dvb_frontend;
38}; 37};
39 38
40
41struct a8293_config {
42 u8 i2c_addr;
43};
44
45#if IS_REACHABLE(CONFIG_DVB_A8293)
46extern struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
47 struct i2c_adapter *i2c, const struct a8293_config *cfg);
48#else
49static inline struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
50 struct i2c_adapter *i2c, const struct a8293_config *cfg)
51{
52 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
53 return NULL;
54}
55#endif
56
57#endif /* A8293_H */ 39#endif /* A8293_H */