diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-03 04:14:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:44:01 -0400 |
commit | 84b5dbf39ed2f51224841bbbf08439158d69d427 (patch) | |
tree | b24963462dc1ad93860645d8729d1ddfc6ce526e /drivers/media/video/cx231xx/cx231xx-dvb.c | |
parent | e0d3bafd02586cfde286c320f56906fd9fa8d256 (diff) |
V4L/DVB (10955): cx231xx: CodingStyle automatic fixes with Lindent
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-dvb.c')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-dvb.c | 264 |
1 files changed, 129 insertions, 135 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-dvb.c b/drivers/media/video/cx231xx/cx231xx-dvb.c index 46bdcecb4055..85bee8c35e0e 100644 --- a/drivers/media/video/cx231xx/cx231xx-dvb.c +++ b/drivers/media/video/cx231xx/cx231xx-dvb.c | |||
@@ -2,7 +2,7 @@ | |||
2 | DVB device driver for cx231xx | 2 | DVB device driver for cx231xx |
3 | 3 | ||
4 | Copyright (C) 2008 <srinivasa.deevi at conexant dot com> | 4 | Copyright (C) 2008 <srinivasa.deevi at conexant dot com> |
5 | Based on em28xx driver | 5 | Based on em28xx driver |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
@@ -29,7 +29,6 @@ | |||
29 | #include "xc5000.h" | 29 | #include "xc5000.h" |
30 | #include "dvb_dummy_fe.h" | 30 | #include "dvb_dummy_fe.h" |
31 | 31 | ||
32 | |||
33 | MODULE_DESCRIPTION("driver for cx231xx based DVB cards"); | 32 | MODULE_DESCRIPTION("driver for cx231xx based DVB cards"); |
34 | MODULE_AUTHOR("Srinivasa Deevi <srinivasa.deevi@conexant.com>"); | 33 | MODULE_AUTHOR("Srinivasa Deevi <srinivasa.deevi@conexant.com>"); |
35 | MODULE_LICENSE("GPL"); | 34 | MODULE_LICENSE("GPL"); |
@@ -50,24 +49,22 @@ if (debug >= level) \ | |||
50 | #define CX231XX_DVB_MAX_PACKETS 64 | 49 | #define CX231XX_DVB_MAX_PACKETS 64 |
51 | 50 | ||
52 | struct cx231xx_dvb { | 51 | struct cx231xx_dvb { |
53 | struct dvb_frontend *frontend; | 52 | struct dvb_frontend *frontend; |
54 | 53 | ||
55 | /* feed count management */ | 54 | /* feed count management */ |
56 | struct mutex lock; | 55 | struct mutex lock; |
57 | int nfeeds; | 56 | int nfeeds; |
58 | 57 | ||
59 | /* general boilerplate stuff */ | 58 | /* general boilerplate stuff */ |
60 | struct dvb_adapter adapter; | 59 | struct dvb_adapter adapter; |
61 | struct dvb_demux demux; | 60 | struct dvb_demux demux; |
62 | struct dmxdev dmxdev; | 61 | struct dmxdev dmxdev; |
63 | struct dmx_frontend fe_hw; | 62 | struct dmx_frontend fe_hw; |
64 | struct dmx_frontend fe_mem; | 63 | struct dmx_frontend fe_mem; |
65 | struct dvb_net net; | 64 | struct dvb_net net; |
66 | }; | 65 | }; |
67 | 66 | ||
68 | 67 | static inline void print_err_status(struct cx231xx *dev, int packet, int status) | |
69 | static inline void print_err_status(struct cx231xx *dev, | ||
70 | int packet, int status) | ||
71 | { | 68 | { |
72 | char *errmsg = "Unknown"; | 69 | char *errmsg = "Unknown"; |
73 | 70 | ||
@@ -149,8 +146,8 @@ static int start_streaming(struct cx231xx_dvb *dvb) | |||
149 | return rc; | 146 | return rc; |
150 | 147 | ||
151 | return cx231xx_init_isoc(dev, CX231XX_DVB_MAX_PACKETS, | 148 | return cx231xx_init_isoc(dev, CX231XX_DVB_MAX_PACKETS, |
152 | CX231XX_DVB_NUM_BUFS, CX231XX_DVB_MAX_PACKETSIZE, | 149 | CX231XX_DVB_NUM_BUFS, |
153 | dvb_isoc_copy); | 150 | CX231XX_DVB_MAX_PACKETSIZE, dvb_isoc_copy); |
154 | } | 151 | } |
155 | 152 | ||
156 | static int stop_streaming(struct cx231xx_dvb *dvb) | 153 | static int stop_streaming(struct cx231xx_dvb *dvb) |
@@ -166,7 +163,7 @@ static int stop_streaming(struct cx231xx_dvb *dvb) | |||
166 | 163 | ||
167 | static int start_feed(struct dvb_demux_feed *feed) | 164 | static int start_feed(struct dvb_demux_feed *feed) |
168 | { | 165 | { |
169 | struct dvb_demux *demux = feed->demux; | 166 | struct dvb_demux *demux = feed->demux; |
170 | struct cx231xx_dvb *dvb = demux->priv; | 167 | struct cx231xx_dvb *dvb = demux->priv; |
171 | int rc, ret; | 168 | int rc, ret; |
172 | 169 | ||
@@ -189,7 +186,7 @@ static int start_feed(struct dvb_demux_feed *feed) | |||
189 | 186 | ||
190 | static int stop_feed(struct dvb_demux_feed *feed) | 187 | static int stop_feed(struct dvb_demux_feed *feed) |
191 | { | 188 | { |
192 | struct dvb_demux *demux = feed->demux; | 189 | struct dvb_demux *demux = feed->demux; |
193 | struct cx231xx_dvb *dvb = demux->priv; | 190 | struct cx231xx_dvb *dvb = demux->priv; |
194 | int err = 0; | 191 | int err = 0; |
195 | 192 | ||
@@ -203,8 +200,6 @@ static int stop_feed(struct dvb_demux_feed *feed) | |||
203 | return err; | 200 | return err; |
204 | } | 201 | } |
205 | 202 | ||
206 | |||
207 | |||
208 | /* ------------------------------------------------------------------ */ | 203 | /* ------------------------------------------------------------------ */ |
209 | static int cx231xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire) | 204 | static int cx231xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire) |
210 | { | 205 | { |
@@ -218,13 +213,11 @@ static int cx231xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire) | |||
218 | 213 | ||
219 | /* ------------------------------------------------------------------ */ | 214 | /* ------------------------------------------------------------------ */ |
220 | 215 | ||
221 | |||
222 | static struct xc5000_config cnxt_rde250_tunerconfig = { | 216 | static struct xc5000_config cnxt_rde250_tunerconfig = { |
223 | .i2c_address = 0x61, | 217 | .i2c_address = 0x61, |
224 | .if_khz = 5380, | 218 | .if_khz = 5380, |
225 | }; | 219 | }; |
226 | 220 | ||
227 | |||
228 | /* ------------------------------------------------------------------ */ | 221 | /* ------------------------------------------------------------------ */ |
229 | #if 0 | 222 | #if 0 |
230 | static int attach_xc5000(u8 addr, struct cx231xx *dev) | 223 | static int attach_xc5000(u8 addr, struct cx231xx *dev) |
@@ -234,13 +227,12 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev) | |||
234 | struct xc5000_config cfg; | 227 | struct xc5000_config cfg; |
235 | 228 | ||
236 | memset(&cfg, 0, sizeof(cfg)); | 229 | memset(&cfg, 0, sizeof(cfg)); |
237 | cfg.i2c_adap = &dev->i2c_bus[1].i2c_adap; | 230 | cfg.i2c_adap = &dev->i2c_bus[1].i2c_adap; |
238 | cfg.i2c_addr = addr; | 231 | cfg.i2c_addr = addr; |
239 | 232 | ||
240 | if (!dev->dvb->frontend) { | 233 | if (!dev->dvb->frontend) { |
241 | printk(KERN_ERR "%s/2: dvb frontend not attached. " | 234 | printk(KERN_ERR "%s/2: dvb frontend not attached. " |
242 | "Can't attach xc5000\n", | 235 | "Can't attach xc5000\n", dev->name); |
243 | dev->name); | ||
244 | return -EINVAL; | 236 | return -EINVAL; |
245 | } | 237 | } |
246 | 238 | ||
@@ -258,65 +250,65 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev) | |||
258 | } | 250 | } |
259 | #endif | 251 | #endif |
260 | 252 | ||
261 | int cx231xx_set_analog_freq(struct cx231xx *dev, u32 freq ) | 253 | int cx231xx_set_analog_freq(struct cx231xx *dev, u32 freq) |
262 | { | 254 | { |
263 | int status = 0; | 255 | int status = 0; |
264 | 256 | ||
265 | if( (dev->dvb != NULL) && (dev->dvb->frontend != NULL) ){ | 257 | if ((dev->dvb != NULL) && (dev->dvb->frontend != NULL)) { |
266 | 258 | ||
267 | struct dvb_tuner_ops *dops = &dev->dvb->frontend->ops.tuner_ops; | 259 | struct dvb_tuner_ops *dops = &dev->dvb->frontend->ops.tuner_ops; |
268 | 260 | ||
269 | if(dops->set_analog_params != NULL) { | 261 | if (dops->set_analog_params != NULL) { |
270 | struct analog_parameters params; | 262 | struct analog_parameters params; |
271 | 263 | ||
272 | params.frequency = freq; | 264 | params.frequency = freq; |
273 | params.std = dev->norm; | 265 | params.std = dev->norm; |
274 | params.mode = 0 ; /* 0- Air; 1 - cable */ | 266 | params.mode = 0; /* 0- Air; 1 - cable */ |
275 | /*params.audmode = ; */ | 267 | /*params.audmode = ; */ |
276 | |||
277 | /* Set the analog parameters to set the frequency */ | ||
278 | cx231xx_info("Setting Frequency for XC5000\n"); | ||
279 | dops->set_analog_params(dev->dvb->frontend, ¶ms); | ||
280 | } | ||
281 | 268 | ||
269 | /* Set the analog parameters to set the frequency */ | ||
270 | cx231xx_info("Setting Frequency for XC5000\n"); | ||
271 | dops->set_analog_params(dev->dvb->frontend, ¶ms); | ||
282 | } | 272 | } |
283 | 273 | ||
274 | } | ||
275 | |||
284 | return status; | 276 | return status; |
285 | } | 277 | } |
286 | 278 | ||
287 | int cx231xx_reset_analog_tuner(struct cx231xx *dev) | 279 | int cx231xx_reset_analog_tuner(struct cx231xx *dev) |
288 | { | 280 | { |
289 | int status = 0; | 281 | int status = 0; |
290 | 282 | ||
291 | if( (dev->dvb != NULL) && (dev->dvb->frontend != NULL) ){ | 283 | if ((dev->dvb != NULL) && (dev->dvb->frontend != NULL)) { |
292 | 284 | ||
293 | struct dvb_tuner_ops *dops = &dev->dvb->frontend->ops.tuner_ops; | 285 | struct dvb_tuner_ops *dops = &dev->dvb->frontend->ops.tuner_ops; |
294 | 286 | ||
295 | if(dops->init != NULL && !dev->xc_fw_load_done) { | 287 | if (dops->init != NULL && !dev->xc_fw_load_done) { |
296 | 288 | ||
297 | cx231xx_info("Reloading firmware for XC5000\n"); | 289 | cx231xx_info("Reloading firmware for XC5000\n"); |
298 | status = dops->init(dev->dvb->frontend); | 290 | status = dops->init(dev->dvb->frontend); |
299 | if(status == 0 ) { | 291 | if (status == 0) { |
300 | dev->xc_fw_load_done = 1; | 292 | dev->xc_fw_load_done = 1; |
301 | cx231xx_info("XC5000 firmware download completed\n"); | 293 | cx231xx_info |
302 | } else { | 294 | ("XC5000 firmware download completed\n"); |
303 | dev->xc_fw_load_done = 0; | 295 | } else { |
304 | cx231xx_info("XC5000 firmware download failed !!!\n"); | 296 | dev->xc_fw_load_done = 0; |
305 | } | 297 | cx231xx_info |
298 | ("XC5000 firmware download failed !!!\n"); | ||
306 | } | 299 | } |
307 | |||
308 | } | 300 | } |
309 | 301 | ||
302 | } | ||
303 | |||
310 | return status; | 304 | return status; |
311 | } | 305 | } |
312 | 306 | ||
313 | |||
314 | /* ------------------------------------------------------------------ */ | 307 | /* ------------------------------------------------------------------ */ |
315 | 308 | ||
316 | static int register_dvb(struct cx231xx_dvb *dvb, | 309 | static int register_dvb(struct cx231xx_dvb *dvb, |
317 | struct module *module, | 310 | struct module *module, |
318 | struct cx231xx *dev, | 311 | struct cx231xx *dev, struct device *device) |
319 | struct device *device) | ||
320 | { | 312 | { |
321 | int result; | 313 | int result; |
322 | 314 | ||
@@ -326,7 +318,8 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
326 | result = dvb_register_adapter(&dvb->adapter, dev->name, module, device, | 318 | result = dvb_register_adapter(&dvb->adapter, dev->name, module, device, |
327 | adapter_nr); | 319 | adapter_nr); |
328 | if (result < 0) { | 320 | if (result < 0) { |
329 | printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n", | 321 | printk(KERN_WARNING |
322 | "%s: dvb_register_adapter failed (errno = %d)\n", | ||
330 | dev->name, result); | 323 | dev->name, result); |
331 | goto fail_adapter; | 324 | goto fail_adapter; |
332 | } | 325 | } |
@@ -339,20 +332,21 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
339 | /* register frontend */ | 332 | /* register frontend */ |
340 | result = dvb_register_frontend(&dvb->adapter, dvb->frontend); | 333 | result = dvb_register_frontend(&dvb->adapter, dvb->frontend); |
341 | if (result < 0) { | 334 | if (result < 0) { |
342 | printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n", | 335 | printk(KERN_WARNING |
336 | "%s: dvb_register_frontend failed (errno = %d)\n", | ||
343 | dev->name, result); | 337 | dev->name, result); |
344 | goto fail_frontend; | 338 | goto fail_frontend; |
345 | } | 339 | } |
346 | 340 | ||
347 | /* register demux stuff */ | 341 | /* register demux stuff */ |
348 | dvb->demux.dmx.capabilities = | 342 | dvb->demux.dmx.capabilities = |
349 | DMX_TS_FILTERING | DMX_SECTION_FILTERING | | 343 | DMX_TS_FILTERING | DMX_SECTION_FILTERING | |
350 | DMX_MEMORY_BASED_FILTERING; | 344 | DMX_MEMORY_BASED_FILTERING; |
351 | dvb->demux.priv = dvb; | 345 | dvb->demux.priv = dvb; |
352 | dvb->demux.filternum = 256; | 346 | dvb->demux.filternum = 256; |
353 | dvb->demux.feednum = 256; | 347 | dvb->demux.feednum = 256; |
354 | dvb->demux.start_feed = start_feed; | 348 | dvb->demux.start_feed = start_feed; |
355 | dvb->demux.stop_feed = stop_feed; | 349 | dvb->demux.stop_feed = stop_feed; |
356 | 350 | ||
357 | result = dvb_dmx_init(&dvb->demux); | 351 | result = dvb_dmx_init(&dvb->demux); |
358 | if (result < 0) { | 352 | if (result < 0) { |
@@ -361,8 +355,8 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
361 | goto fail_dmx; | 355 | goto fail_dmx; |
362 | } | 356 | } |
363 | 357 | ||
364 | dvb->dmxdev.filternum = 256; | 358 | dvb->dmxdev.filternum = 256; |
365 | dvb->dmxdev.demux = &dvb->demux.dmx; | 359 | dvb->dmxdev.demux = &dvb->demux.dmx; |
366 | dvb->dmxdev.capabilities = 0; | 360 | dvb->dmxdev.capabilities = 0; |
367 | result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); | 361 | result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); |
368 | if (result < 0) { | 362 | if (result < 0) { |
@@ -374,7 +368,8 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
374 | dvb->fe_hw.source = DMX_FRONTEND_0; | 368 | dvb->fe_hw.source = DMX_FRONTEND_0; |
375 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); | 369 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); |
376 | if (result < 0) { | 370 | if (result < 0) { |
377 | printk(KERN_WARNING "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", | 371 | printk(KERN_WARNING |
372 | "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", | ||
378 | dev->name, result); | 373 | dev->name, result); |
379 | goto fail_fe_hw; | 374 | goto fail_fe_hw; |
380 | } | 375 | } |
@@ -382,15 +377,17 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
382 | dvb->fe_mem.source = DMX_MEMORY_FE; | 377 | dvb->fe_mem.source = DMX_MEMORY_FE; |
383 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); | 378 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); |
384 | if (result < 0) { | 379 | if (result < 0) { |
385 | printk(KERN_WARNING "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", | 380 | printk(KERN_WARNING |
381 | "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", | ||
386 | dev->name, result); | 382 | dev->name, result); |
387 | goto fail_fe_mem; | 383 | goto fail_fe_mem; |
388 | } | 384 | } |
389 | 385 | ||
390 | result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); | 386 | result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); |
391 | if (result < 0) { | 387 | if (result < 0) { |
392 | printk(KERN_WARNING "%s: connect_frontend failed (errno = %d)\n", | 388 | printk(KERN_WARNING |
393 | dev->name, result); | 389 | "%s: connect_frontend failed (errno = %d)\n", dev->name, |
390 | result); | ||
394 | goto fail_fe_conn; | 391 | goto fail_fe_conn; |
395 | } | 392 | } |
396 | 393 | ||
@@ -398,20 +395,20 @@ static int register_dvb(struct cx231xx_dvb *dvb, | |||
398 | dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx); | 395 | dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx); |
399 | return 0; | 396 | return 0; |
400 | 397 | ||
401 | fail_fe_conn: | 398 | fail_fe_conn: |
402 | dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem); | 399 | dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem); |
403 | fail_fe_mem: | 400 | fail_fe_mem: |
404 | dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw); | 401 | dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw); |
405 | fail_fe_hw: | 402 | fail_fe_hw: |
406 | dvb_dmxdev_release(&dvb->dmxdev); | 403 | dvb_dmxdev_release(&dvb->dmxdev); |
407 | fail_dmxdev: | 404 | fail_dmxdev: |
408 | dvb_dmx_release(&dvb->demux); | 405 | dvb_dmx_release(&dvb->demux); |
409 | fail_dmx: | 406 | fail_dmx: |
410 | dvb_unregister_frontend(dvb->frontend); | 407 | dvb_unregister_frontend(dvb->frontend); |
411 | fail_frontend: | 408 | fail_frontend: |
412 | dvb_frontend_detach(dvb->frontend); | 409 | dvb_frontend_detach(dvb->frontend); |
413 | dvb_unregister_adapter(&dvb->adapter); | 410 | dvb_unregister_adapter(&dvb->adapter); |
414 | fail_adapter: | 411 | fail_adapter: |
415 | return result; | 412 | return result; |
416 | } | 413 | } |
417 | 414 | ||
@@ -427,7 +424,6 @@ static void unregister_dvb(struct cx231xx_dvb *dvb) | |||
427 | dvb_unregister_adapter(&dvb->adapter); | 424 | dvb_unregister_adapter(&dvb->adapter); |
428 | } | 425 | } |
429 | 426 | ||
430 | |||
431 | static int dvb_init(struct cx231xx *dev) | 427 | static int dvb_init(struct cx231xx *dev) |
432 | { | 428 | { |
433 | int result = 0; | 429 | int result = 0; |
@@ -446,71 +442,70 @@ static int dvb_init(struct cx231xx *dev) | |||
446 | } | 442 | } |
447 | dev->dvb = dvb; | 443 | dev->dvb = dvb; |
448 | dev->cx231xx_set_analog_freq = cx231xx_set_analog_freq; | 444 | dev->cx231xx_set_analog_freq = cx231xx_set_analog_freq; |
449 | dev->cx231xx_reset_analog_tuner = cx231xx_reset_analog_tuner; | 445 | dev->cx231xx_reset_analog_tuner = cx231xx_reset_analog_tuner; |
450 | 446 | ||
451 | cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); | 447 | cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); |
452 | /* init frontend */ | 448 | /* init frontend */ |
453 | switch (dev->model) { | 449 | switch (dev->model) { |
454 | case CX231XX_BOARD_CNXT_RDE_250: | 450 | case CX231XX_BOARD_CNXT_RDE_250: |
455 | 451 | ||
456 | /* dev->dvb->frontend = dvb_attach(s5h1411_attach, | 452 | /* dev->dvb->frontend = dvb_attach(s5h1411_attach, |
457 | &dvico_s5h1411_config, | 453 | &dvico_s5h1411_config, |
458 | &dev->i2c_bus[1].i2c_adap);*/ | 454 | &dev->i2c_bus[1].i2c_adap); */ |
459 | dev->dvb->frontend = dvb_attach(dvb_dummy_fe_ofdm_attach); | 455 | dev->dvb->frontend = dvb_attach(dvb_dummy_fe_ofdm_attach); |
460 | 456 | ||
461 | if(dev->dvb->frontend == NULL) { | 457 | if (dev->dvb->frontend == NULL) { |
462 | printk(DRIVER_NAME ": Failed to attach dummy front end\n"); | 458 | printk(DRIVER_NAME |
463 | result = -EINVAL; | 459 | ": Failed to attach dummy front end\n"); |
464 | goto out_free; | 460 | result = -EINVAL; |
465 | } | 461 | goto out_free; |
466 | 462 | } | |
467 | /* define general-purpose callback pointer */ | 463 | |
468 | dvb->frontend->callback = cx231xx_tuner_callback; | 464 | /* define general-purpose callback pointer */ |
469 | 465 | dvb->frontend->callback = cx231xx_tuner_callback; | |
470 | if(dvb_attach(xc5000_attach, dev->dvb->frontend, | 466 | |
471 | &dev->i2c_bus[1].i2c_adap, | 467 | if (dvb_attach(xc5000_attach, dev->dvb->frontend, |
472 | &cnxt_rde250_tunerconfig) < 0) { | 468 | &dev->i2c_bus[1].i2c_adap, |
473 | result = -EINVAL; | 469 | &cnxt_rde250_tunerconfig) < 0) { |
474 | goto out_free; | 470 | result = -EINVAL; |
475 | } | 471 | goto out_free; |
476 | 472 | } | |
477 | break; | 473 | |
478 | case CX231XX_BOARD_CNXT_RDU_250: | 474 | break; |
479 | 475 | case CX231XX_BOARD_CNXT_RDU_250: | |
480 | dev->dvb->frontend = dvb_attach(dvb_dummy_fe_ofdm_attach); | 476 | |
481 | 477 | dev->dvb->frontend = dvb_attach(dvb_dummy_fe_ofdm_attach); | |
482 | if(dev->dvb->frontend == NULL) { | 478 | |
483 | printk(DRIVER_NAME ": Failed to attach dummy front end\n"); | 479 | if (dev->dvb->frontend == NULL) { |
484 | result = -EINVAL; | 480 | printk(DRIVER_NAME |
485 | goto out_free; | 481 | ": Failed to attach dummy front end\n"); |
486 | } | 482 | result = -EINVAL; |
487 | 483 | goto out_free; | |
488 | /* define general-purpose callback pointer */ | 484 | } |
489 | dvb->frontend->callback = cx231xx_tuner_callback; | 485 | |
490 | 486 | /* define general-purpose callback pointer */ | |
491 | if(dvb_attach(xc5000_attach, dev->dvb->frontend, | 487 | dvb->frontend->callback = cx231xx_tuner_callback; |
492 | &dev->i2c_bus[1].i2c_adap, | 488 | |
493 | &cnxt_rde250_tunerconfig) < 0) { | 489 | if (dvb_attach(xc5000_attach, dev->dvb->frontend, |
494 | result = -EINVAL; | 490 | &dev->i2c_bus[1].i2c_adap, |
495 | goto out_free; | 491 | &cnxt_rde250_tunerconfig) < 0) { |
496 | } | 492 | result = -EINVAL; |
497 | break; | 493 | goto out_free; |
494 | } | ||
495 | break; | ||
498 | 496 | ||
499 | default: | 497 | default: |
500 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card" | 498 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card" |
501 | " isn't supported yet\n", | 499 | " isn't supported yet\n", dev->name); |
502 | dev->name); | ||
503 | break; | 500 | break; |
504 | } | 501 | } |
505 | if (NULL == dvb->frontend) { | 502 | if (NULL == dvb->frontend) { |
506 | printk(KERN_ERR | 503 | printk(KERN_ERR |
507 | "%s/2: frontend initialization failed\n", | 504 | "%s/2: frontend initialization failed\n", dev->name); |
508 | dev->name); | ||
509 | result = -EINVAL; | 505 | result = -EINVAL; |
510 | goto out_free; | 506 | goto out_free; |
511 | } | 507 | } |
512 | 508 | ||
513 | |||
514 | /* register everything */ | 509 | /* register everything */ |
515 | result = register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev); | 510 | result = register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev); |
516 | 511 | ||
@@ -521,7 +516,7 @@ static int dvb_init(struct cx231xx *dev) | |||
521 | printk(KERN_INFO "Successfully loaded cx231xx-dvb\n"); | 516 | printk(KERN_INFO "Successfully loaded cx231xx-dvb\n"); |
522 | return 0; | 517 | return 0; |
523 | 518 | ||
524 | out_free: | 519 | out_free: |
525 | cx231xx_set_mode(dev, CX231XX_SUSPEND); | 520 | cx231xx_set_mode(dev, CX231XX_SUSPEND); |
526 | kfree(dvb); | 521 | kfree(dvb); |
527 | dev->dvb = NULL; | 522 | dev->dvb = NULL; |
@@ -544,7 +539,7 @@ static int dvb_fini(struct cx231xx *dev) | |||
544 | } | 539 | } |
545 | 540 | ||
546 | static struct cx231xx_ops dvb_ops = { | 541 | static struct cx231xx_ops dvb_ops = { |
547 | .id = CX231XX_DVB, | 542 | .id = CX231XX_DVB, |
548 | .name = "Cx231xx dvb Extension", | 543 | .name = "Cx231xx dvb Extension", |
549 | .init = dvb_init, | 544 | .init = dvb_init, |
550 | .fini = dvb_fini, | 545 | .fini = dvb_fini, |
@@ -562,4 +557,3 @@ static void __exit cx231xx_dvb_unregister(void) | |||
562 | 557 | ||
563 | module_init(cx231xx_dvb_register); | 558 | module_init(cx231xx_dvb_register); |
564 | module_exit(cx231xx_dvb_unregister); | 559 | module_exit(cx231xx_dvb_unregister); |
565 | |||