diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2011-07-03 12:56:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:55:43 -0400 |
commit | 9143a437cc2fe329c271115903a3884950aba57d (patch) | |
tree | 3ef124b379b54224ffdeba7f0b529f5d95bf5275 /drivers/media/dvb/ngene | |
parent | 9ca9efb077505b5b717fc15eab33c44d17eb76f7 (diff) |
[media] ngene: Codingstyle fixes
Codingstyle fixes
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/ngene')
-rw-r--r-- | drivers/media/dvb/ngene/ngene-cards.c | 36 | ||||
-rw-r--r-- | drivers/media/dvb/ngene/ngene-core.c | 14 | ||||
-rw-r--r-- | drivers/media/dvb/ngene/ngene-dvb.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/ngene/ngene.h | 2 |
4 files changed, 25 insertions, 31 deletions
diff --git a/drivers/media/dvb/ngene/ngene-cards.c b/drivers/media/dvb/ngene/ngene-cards.c index ca2e146f1b8..0d550a950e5 100644 --- a/drivers/media/dvb/ngene/ngene-cards.c +++ b/drivers/media/dvb/ngene/ngene-cards.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "lnbh24.h" | 40 | #include "lnbh24.h" |
41 | #include "lgdt330x.h" | 41 | #include "lgdt330x.h" |
42 | #include "mt2131.h" | 42 | #include "mt2131.h" |
43 | #include "tda18271c2dd.h" | ||
43 | #include "drxk.h" | 44 | #include "drxk.h" |
44 | 45 | ||
45 | 46 | ||
@@ -99,9 +100,6 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable) | |||
99 | return status; | 100 | return status; |
100 | } | 101 | } |
101 | 102 | ||
102 | struct dvb_frontend *tda18271c2dd_attach(struct dvb_frontend *fe, | ||
103 | struct i2c_adapter *i2c, u8 adr); | ||
104 | |||
105 | static int tuner_attach_tda18271(struct ngene_channel *chan) | 103 | static int tuner_attach_tda18271(struct ngene_channel *chan) |
106 | { | 104 | { |
107 | struct i2c_adapter *i2c; | 105 | struct i2c_adapter *i2c; |
@@ -114,7 +112,7 @@ static int tuner_attach_tda18271(struct ngene_channel *chan) | |||
114 | if (chan->fe->ops.i2c_gate_ctrl) | 112 | if (chan->fe->ops.i2c_gate_ctrl) |
115 | chan->fe->ops.i2c_gate_ctrl(chan->fe, 0); | 113 | chan->fe->ops.i2c_gate_ctrl(chan->fe, 0); |
116 | if (!fe) { | 114 | if (!fe) { |
117 | printk("No TDA18271 found!\n"); | 115 | printk(KERN_ERR "No TDA18271 found!\n"); |
118 | return -ENODEV; | 116 | return -ENODEV; |
119 | } | 117 | } |
120 | 118 | ||
@@ -180,7 +178,7 @@ static void cineS2_tuner_i2c_lock(struct dvb_frontend *fe, int lock) | |||
180 | static int i2c_read(struct i2c_adapter *adapter, u8 adr, u8 *val) | 178 | static int i2c_read(struct i2c_adapter *adapter, u8 adr, u8 *val) |
181 | { | 179 | { |
182 | struct i2c_msg msgs[1] = {{.addr = adr, .flags = I2C_M_RD, | 180 | struct i2c_msg msgs[1] = {{.addr = adr, .flags = I2C_M_RD, |
183 | .buf = val, .len = 1 }}; | 181 | .buf = val, .len = 1 } }; |
184 | return (i2c_transfer(adapter, msgs, 1) == 1) ? 0 : -1; | 182 | return (i2c_transfer(adapter, msgs, 1) == 1) ? 0 : -1; |
185 | } | 183 | } |
186 | 184 | ||
@@ -191,7 +189,7 @@ static int i2c_read_reg16(struct i2c_adapter *adapter, u8 adr, | |||
191 | struct i2c_msg msgs[2] = {{.addr = adr, .flags = 0, | 189 | struct i2c_msg msgs[2] = {{.addr = adr, .flags = 0, |
192 | .buf = msg, .len = 2}, | 190 | .buf = msg, .len = 2}, |
193 | {.addr = adr, .flags = I2C_M_RD, | 191 | {.addr = adr, .flags = I2C_M_RD, |
194 | .buf = val, .len = 1}}; | 192 | .buf = val, .len = 1} }; |
195 | return (i2c_transfer(adapter, msgs, 2) == 2) ? 0 : -1; | 193 | return (i2c_transfer(adapter, msgs, 2) == 2) ? 0 : -1; |
196 | } | 194 | } |
197 | 195 | ||
@@ -209,25 +207,22 @@ static int port_has_drxk(struct i2c_adapter *i2c, int port) | |||
209 | 207 | ||
210 | if (i2c_read(i2c, 0x29+port, &val) < 0) | 208 | if (i2c_read(i2c, 0x29+port, &val) < 0) |
211 | return 0; | 209 | return 0; |
212 | printk("DRXK@%02x\n", 0x29+port); | ||
213 | return 1; | 210 | return 1; |
214 | } | 211 | } |
215 | 212 | ||
216 | static int demod_attach_drxk(struct ngene_channel *chan, | 213 | static int demod_attach_drxk(struct ngene_channel *chan, |
217 | struct i2c_adapter *i2c) | 214 | struct i2c_adapter *i2c) |
218 | { | 215 | { |
219 | struct dvb_frontend *fe; | 216 | chan->fe = dvb_attach(drxk_attach, |
220 | |||
221 | chan->fe = fe = dvb_attach(drxk_attach, | ||
222 | i2c, 0x29 + (chan->number^2), | 217 | i2c, 0x29 + (chan->number^2), |
223 | &chan->fe2); | 218 | &chan->fe2); |
224 | if (!chan->fe) { | 219 | if (!chan->fe) { |
225 | printk("No DRXK found!\n"); | 220 | printk(KERN_ERR "No DRXK found!\n"); |
226 | return -ENODEV; | 221 | return -ENODEV; |
227 | } | 222 | } |
228 | fe->sec_priv = chan; | 223 | chan->fe->sec_priv = chan; |
229 | chan->gate_ctrl = fe->ops.i2c_gate_ctrl; | 224 | chan->gate_ctrl = chan->fe->ops.i2c_gate_ctrl; |
230 | fe->ops.i2c_gate_ctrl = drxk_gate_ctrl; | 225 | chan->fe->ops.i2c_gate_ctrl = drxk_gate_ctrl; |
231 | return 0; | 226 | return 0; |
232 | } | 227 | } |
233 | 228 | ||
@@ -246,19 +241,18 @@ static int cineS2_probe(struct ngene_channel *chan) | |||
246 | i2c = &chan->dev->channel[1].i2c_adapter; | 241 | i2c = &chan->dev->channel[1].i2c_adapter; |
247 | 242 | ||
248 | if (port_has_stv0900(i2c, chan->number)) { | 243 | if (port_has_stv0900(i2c, chan->number)) { |
249 | chan->demod_type=0; | 244 | chan->demod_type = 0; |
250 | fe_conf = chan->dev->card_info->fe_config[chan->number]; | 245 | fe_conf = chan->dev->card_info->fe_config[chan->number]; |
251 | /* demod found, attach it */ | 246 | /* demod found, attach it */ |
252 | rc = demod_attach_stv0900(chan); | 247 | rc = demod_attach_stv0900(chan); |
253 | if (rc < 0 || chan->number < 2) | 248 | if (rc < 0 || chan->number < 2) |
254 | return rc; | 249 | return rc; |
255 | 250 | ||
256 | /* demod #2: reprogram outputs DPN1 & DPN2 */ | 251 | /* demod #2: reprogram outputs DPN1 & DPN2 */ |
257 | i2c_msg.addr = fe_conf->address; | 252 | i2c_msg.addr = fe_conf->address; |
258 | i2c_msg.len = 3; | 253 | i2c_msg.len = 3; |
259 | buf[0] = 0xf1; | 254 | buf[0] = 0xf1; |
260 | switch (chan->number) | 255 | switch (chan->number) { |
261 | { | ||
262 | case 2: | 256 | case 2: |
263 | buf[1] = 0x5c; | 257 | buf[1] = 0x5c; |
264 | buf[2] = 0xc2; | 258 | buf[2] = 0xc2; |
@@ -276,10 +270,10 @@ static int cineS2_probe(struct ngene_channel *chan) | |||
276 | return -EIO; | 270 | return -EIO; |
277 | } | 271 | } |
278 | } else if (port_has_drxk(i2c, chan->number^2)) { | 272 | } else if (port_has_drxk(i2c, chan->number^2)) { |
279 | chan->demod_type=1; | 273 | chan->demod_type = 1; |
280 | demod_attach_drxk(chan, i2c); | 274 | demod_attach_drxk(chan, i2c); |
281 | } else { | 275 | } else { |
282 | printk("No demod found on chan %d\n", chan->number); | 276 | printk(KERN_ERR "No demod found on chan %d\n", chan->number); |
283 | } | 277 | } |
284 | return 0; | 278 | return 0; |
285 | } | 279 | } |
@@ -497,7 +491,7 @@ MODULE_DEVICE_TABLE(pci, ngene_id_tbl); | |||
497 | /****************************************************************************/ | 491 | /****************************************************************************/ |
498 | 492 | ||
499 | static pci_ers_result_t ngene_error_detected(struct pci_dev *dev, | 493 | static pci_ers_result_t ngene_error_detected(struct pci_dev *dev, |
500 | enum pci_channel_state state) | 494 | enum pci_channel_state state) |
501 | { | 495 | { |
502 | printk(KERN_ERR DEVICE_NAME ": PCI error\n"); | 496 | printk(KERN_ERR DEVICE_NAME ": PCI error\n"); |
503 | if (state == pci_channel_io_perm_failure) | 497 | if (state == pci_channel_io_perm_failure) |
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index c59bf5057a4..fa4b3eb92bd 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | #include "ngene.h" | 42 | #include "ngene.h" |
43 | 43 | ||
44 | static int one_adapter = 0; | 44 | static int one_adapter; |
45 | module_param(one_adapter, int, 0444); | 45 | module_param(one_adapter, int, 0444); |
46 | MODULE_PARM_DESC(one_adapter, "Use only one adapter."); | 46 | MODULE_PARM_DESC(one_adapter, "Use only one adapter."); |
47 | 47 | ||
@@ -1443,9 +1443,9 @@ static void release_channel(struct ngene_channel *chan) | |||
1443 | chan->ci_dev = NULL; | 1443 | chan->ci_dev = NULL; |
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | if (chan->fe2) { | 1446 | if (chan->fe2) |
1447 | dvb_unregister_frontend(chan->fe2); | 1447 | dvb_unregister_frontend(chan->fe2); |
1448 | } | 1448 | |
1449 | if (chan->fe) { | 1449 | if (chan->fe) { |
1450 | dvb_unregister_frontend(chan->fe); | 1450 | dvb_unregister_frontend(chan->fe); |
1451 | dvb_frontend_detach(chan->fe); | 1451 | dvb_frontend_detach(chan->fe); |
@@ -1540,10 +1540,10 @@ static int init_channel(struct ngene_channel *chan) | |||
1540 | if (chan->fe2) { | 1540 | if (chan->fe2) { |
1541 | if (dvb_register_frontend(adapter, chan->fe2) < 0) | 1541 | if (dvb_register_frontend(adapter, chan->fe2) < 0) |
1542 | goto err; | 1542 | goto err; |
1543 | chan->fe2->tuner_priv=chan->fe->tuner_priv; | 1543 | chan->fe2->tuner_priv = chan->fe->tuner_priv; |
1544 | memcpy(&chan->fe2->ops.tuner_ops, | 1544 | memcpy(&chan->fe2->ops.tuner_ops, |
1545 | &chan->fe->ops.tuner_ops, | 1545 | &chan->fe->ops.tuner_ops, |
1546 | sizeof(struct dvb_tuner_ops)); | 1546 | sizeof(struct dvb_tuner_ops)); |
1547 | } | 1547 | } |
1548 | 1548 | ||
1549 | if (chan->has_demux) { | 1549 | if (chan->has_demux) { |
diff --git a/drivers/media/dvb/ngene/ngene-dvb.c b/drivers/media/dvb/ngene/ngene-dvb.c index 0b494323316..ba209cb3e0b 100644 --- a/drivers/media/dvb/ngene/ngene-dvb.c +++ b/drivers/media/dvb/ngene/ngene-dvb.c | |||
@@ -133,9 +133,9 @@ void *tsin_exchange(void *priv, void *buf, u32 len, u32 clock, u32 flags) | |||
133 | } | 133 | } |
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | if (chan->users > 0) { | 136 | if (chan->users > 0) |
137 | dvb_dmx_swfilter(&chan->demux, buf, len); | 137 | dvb_dmx_swfilter(&chan->demux, buf, len); |
138 | } | 138 | |
139 | return NULL; | 139 | return NULL; |
140 | } | 140 | } |
141 | 141 | ||
diff --git a/drivers/media/dvb/ngene/ngene.h b/drivers/media/dvb/ngene/ngene.h index e8cd93deba5..90fa136850c 100644 --- a/drivers/media/dvb/ngene/ngene.h +++ b/drivers/media/dvb/ngene/ngene.h | |||
@@ -855,7 +855,7 @@ struct ngene_info { | |||
855 | }; | 855 | }; |
856 | 856 | ||
857 | #ifdef NGENE_V4L | 857 | #ifdef NGENE_V4L |
858 | struct ngene_format{ | 858 | struct ngene_format { |
859 | char *name; | 859 | char *name; |
860 | int fourcc; /* video4linux 2 */ | 860 | int fourcc; /* video4linux 2 */ |
861 | int btformat; /* BT848_COLOR_FMT_* */ | 861 | int btformat; /* BT848_COLOR_FMT_* */ |