diff options
author | Andrew de Quincey <adq_dvb@lidskialf.net> | 2006-08-08 08:10:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 10:53:23 -0400 |
commit | 13fef9335f4fe2a73e1733f8807e69711736faef (patch) | |
tree | 499ccb23b708e265517388cfce80d4b25a2e315d /drivers/media/dvb/frontends/isl6421.c | |
parent | 94cbae5a1a1537ef5a402199f597e84dc5dd92cb (diff) |
V4L/DVB (4383): Convert SEC drivers to new frontend API
Convert SEC drivers to new frontend API
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/isl6421.c')
-rw-r--r-- | drivers/media/dvb/frontends/isl6421.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/media/dvb/frontends/isl6421.c b/drivers/media/dvb/frontends/isl6421.c index 58c34db31071..0fc18f5a7167 100644 --- a/drivers/media/dvb/frontends/isl6421.c +++ b/drivers/media/dvb/frontends/isl6421.c | |||
@@ -42,12 +42,11 @@ struct isl6421 { | |||
42 | u8 override_and; | 42 | u8 override_and; |
43 | struct i2c_adapter *i2c; | 43 | struct i2c_adapter *i2c; |
44 | u8 i2c_addr; | 44 | u8 i2c_addr; |
45 | void (*release_chain)(struct dvb_frontend* fe); | ||
46 | }; | 45 | }; |
47 | 46 | ||
48 | static int isl6421_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | 47 | static int isl6421_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) |
49 | { | 48 | { |
50 | struct isl6421 *isl6421 = (struct isl6421 *) fe->misc_priv; | 49 | struct isl6421 *isl6421 = (struct isl6421 *) fe->sec_priv; |
51 | struct i2c_msg msg = { .addr = isl6421->i2c_addr, .flags = 0, | 50 | struct i2c_msg msg = { .addr = isl6421->i2c_addr, .flags = 0, |
52 | .buf = &isl6421->config, | 51 | .buf = &isl6421->config, |
53 | .len = sizeof(isl6421->config) }; | 52 | .len = sizeof(isl6421->config) }; |
@@ -75,7 +74,7 @@ static int isl6421_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage | |||
75 | 74 | ||
76 | static int isl6421_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) | 75 | static int isl6421_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) |
77 | { | 76 | { |
78 | struct isl6421 *isl6421 = (struct isl6421 *) fe->misc_priv; | 77 | struct isl6421 *isl6421 = (struct isl6421 *) fe->sec_priv; |
79 | struct i2c_msg msg = { .addr = isl6421->i2c_addr, .flags = 0, | 78 | struct i2c_msg msg = { .addr = isl6421->i2c_addr, .flags = 0, |
80 | .buf = &isl6421->config, | 79 | .buf = &isl6421->config, |
81 | .len = sizeof(isl6421->config) }; | 80 | .len = sizeof(isl6421->config) }; |
@@ -93,31 +92,26 @@ static int isl6421_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) | |||
93 | 92 | ||
94 | static void isl6421_release(struct dvb_frontend *fe) | 93 | static void isl6421_release(struct dvb_frontend *fe) |
95 | { | 94 | { |
96 | struct isl6421 *isl6421 = (struct isl6421 *) fe->misc_priv; | ||
97 | |||
98 | /* power off */ | 95 | /* power off */ |
99 | isl6421_set_voltage(fe, SEC_VOLTAGE_OFF); | 96 | isl6421_set_voltage(fe, SEC_VOLTAGE_OFF); |
100 | 97 | ||
101 | /* free data & call next release routine */ | 98 | /* free */ |
102 | fe->ops.release = isl6421->release_chain; | 99 | kfree(fe->sec_priv); |
103 | kfree(fe->misc_priv); | 100 | fe->sec_priv = NULL; |
104 | fe->misc_priv = NULL; | ||
105 | if (fe->ops.release) | ||
106 | fe->ops.release(fe); | ||
107 | } | 101 | } |
108 | 102 | ||
109 | int isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, | 103 | struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, |
110 | u8 override_set, u8 override_clear) | 104 | u8 override_set, u8 override_clear) |
111 | { | 105 | { |
112 | struct isl6421 *isl6421 = kmalloc(sizeof(struct isl6421), GFP_KERNEL); | 106 | struct isl6421 *isl6421 = kmalloc(sizeof(struct isl6421), GFP_KERNEL); |
113 | if (!isl6421) | 107 | if (!isl6421) |
114 | return -ENOMEM; | 108 | return NULL; |
115 | 109 | ||
116 | /* default configuration */ | 110 | /* default configuration */ |
117 | isl6421->config = ISL6421_ISEL1; | 111 | isl6421->config = ISL6421_ISEL1; |
118 | isl6421->i2c = i2c; | 112 | isl6421->i2c = i2c; |
119 | isl6421->i2c_addr = i2c_addr; | 113 | isl6421->i2c_addr = i2c_addr; |
120 | fe->misc_priv = isl6421; | 114 | fe->sec_priv = isl6421; |
121 | 115 | ||
122 | /* bits which should be forced to '1' */ | 116 | /* bits which should be forced to '1' */ |
123 | isl6421->override_or = override_set; | 117 | isl6421->override_or = override_set; |
@@ -128,19 +122,17 @@ int isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr | |||
128 | /* detect if it is present or not */ | 122 | /* detect if it is present or not */ |
129 | if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) { | 123 | if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) { |
130 | kfree(isl6421); | 124 | kfree(isl6421); |
131 | fe->misc_priv = NULL; | 125 | return NULL; |
132 | return -EIO; | ||
133 | } | 126 | } |
134 | 127 | ||
135 | /* install release callback */ | 128 | /* install release callback */ |
136 | isl6421->release_chain = fe->ops.release; | ||
137 | fe->ops.release = isl6421_release; | 129 | fe->ops.release = isl6421_release; |
138 | 130 | ||
139 | /* override frontend ops */ | 131 | /* override frontend ops */ |
140 | fe->ops.set_voltage = isl6421_set_voltage; | 132 | fe->ops.set_voltage = isl6421_set_voltage; |
141 | fe->ops.enable_high_lnb_voltage = isl6421_enable_high_lnb_voltage; | 133 | fe->ops.enable_high_lnb_voltage = isl6421_enable_high_lnb_voltage; |
142 | 134 | ||
143 | return 0; | 135 | return fe; |
144 | } | 136 | } |
145 | EXPORT_SYMBOL(isl6421_attach); | 137 | EXPORT_SYMBOL(isl6421_attach); |
146 | 138 | ||