aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorSteven Toth <stoth@linuxtv.org>2008-10-16 19:27:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-17 16:27:48 -0400
commitb7709c0de24d9a05c70e13c939919fe90f09695d (patch)
tree0fc7e0c75e5dde43e24a0aeda85105a6c9c08adb /drivers/media/dvb
parent98c948236923bf30031ab94cf6dba2291d9af72a (diff)
V4L/DVB (9258): s5h1409: Checkpatch compliance
s5h1409: Checkpatch compliance Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/s5h1409.c138
-rw-r--r--drivers/media/dvb/frontends/s5h1409.h15
2 files changed, 78 insertions, 75 deletions
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 7500a1c53e68..cf4d8936bb83 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -30,10 +30,10 @@
30 30
31struct s5h1409_state { 31struct s5h1409_state {
32 32
33 struct i2c_adapter* i2c; 33 struct i2c_adapter *i2c;
34 34
35 /* configuration settings */ 35 /* configuration settings */
36 const struct s5h1409_config* config; 36 const struct s5h1409_config *config;
37 37
38 struct dvb_frontend frontend; 38 struct dvb_frontend frontend;
39 39
@@ -48,6 +48,9 @@ struct s5h1409_state {
48}; 48};
49 49
50static int debug; 50static int debug;
51module_param(debug, int, 0644);
52MODULE_PARM_DESC(debug, "Enable verbose debug messages");
53
51#define dprintk if (debug) printk 54#define dprintk if (debug) printk
52 55
53/* Register values to initialise the demod, this will set VSB by default */ 56/* Register values to initialise the demod, this will set VSB by default */
@@ -299,10 +302,10 @@ static struct qam256_snr_tab {
299}; 302};
300 303
301/* 8 bit registers, 16 bit values */ 304/* 8 bit registers, 16 bit values */
302static int s5h1409_writereg(struct s5h1409_state* state, u8 reg, u16 data) 305static int s5h1409_writereg(struct s5h1409_state *state, u8 reg, u16 data)
303{ 306{
304 int ret; 307 int ret;
305 u8 buf [] = { reg, data >> 8, data & 0xff }; 308 u8 buf[] = { reg, data >> 8, data & 0xff };
306 309
307 struct i2c_msg msg = { .addr = state->config->demod_address, 310 struct i2c_msg msg = { .addr = state->config->demod_address,
308 .flags = 0, .buf = buf, .len = 3 }; 311 .flags = 0, .buf = buf, .len = 3 };
@@ -310,19 +313,19 @@ static int s5h1409_writereg(struct s5h1409_state* state, u8 reg, u16 data)
310 ret = i2c_transfer(state->i2c, &msg, 1); 313 ret = i2c_transfer(state->i2c, &msg, 1);
311 314
312 if (ret != 1) 315 if (ret != 1)
313 printk("%s: writereg error (reg == 0x%02x, val == 0x%04x, " 316 printk(KERN_ERR "%s: error (reg == 0x%02x, val == 0x%04x, "
314 "ret == %i)\n", __func__, reg, data, ret); 317 "ret == %i)\n", __func__, reg, data, ret);
315 318
316 return (ret != 1) ? -1 : 0; 319 return (ret != 1) ? -1 : 0;
317} 320}
318 321
319static u16 s5h1409_readreg(struct s5h1409_state* state, u8 reg) 322static u16 s5h1409_readreg(struct s5h1409_state *state, u8 reg)
320{ 323{
321 int ret; 324 int ret;
322 u8 b0 [] = { reg }; 325 u8 b0[] = { reg };
323 u8 b1 [] = { 0, 0 }; 326 u8 b1[] = { 0, 0 };
324 327
325 struct i2c_msg msg [] = { 328 struct i2c_msg msg[] = {
326 { .addr = state->config->demod_address, .flags = 0, 329 { .addr = state->config->demod_address, .flags = 0,
327 .buf = b0, .len = 1 }, 330 .buf = b0, .len = 1 },
328 { .addr = state->config->demod_address, .flags = I2C_M_RD, 331 { .addr = state->config->demod_address, .flags = I2C_M_RD,
@@ -335,9 +338,9 @@ static u16 s5h1409_readreg(struct s5h1409_state* state, u8 reg)
335 return (b1[0] << 8) | b1[1]; 338 return (b1[0] << 8) | b1[1];
336} 339}
337 340
338static int s5h1409_softreset(struct dvb_frontend* fe) 341static int s5h1409_softreset(struct dvb_frontend *fe)
339{ 342{
340 struct s5h1409_state* state = fe->demodulator_priv; 343 struct s5h1409_state *state = fe->demodulator_priv;
341 344
342 dprintk("%s()\n", __func__); 345 dprintk("%s()\n", __func__);
343 346
@@ -349,11 +352,11 @@ static int s5h1409_softreset(struct dvb_frontend* fe)
349} 352}
350 353
351#define S5H1409_VSB_IF_FREQ 5380 354#define S5H1409_VSB_IF_FREQ 5380
352#define S5H1409_QAM_IF_FREQ state->config->qam_if 355#define S5H1409_QAM_IF_FREQ (state->config->qam_if)
353 356
354static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz) 357static int s5h1409_set_if_freq(struct dvb_frontend *fe, int KHz)
355{ 358{
356 struct s5h1409_state* state = fe->demodulator_priv; 359 struct s5h1409_state *state = fe->demodulator_priv;
357 360
358 dprintk("%s(%d KHz)\n", __func__, KHz); 361 dprintk("%s(%d KHz)\n", __func__, KHz);
359 362
@@ -376,26 +379,26 @@ static int s5h1409_set_if_freq(struct dvb_frontend* fe, int KHz)
376 return 0; 379 return 0;
377} 380}
378 381
379static int s5h1409_set_spectralinversion(struct dvb_frontend* fe, int inverted) 382static int s5h1409_set_spectralinversion(struct dvb_frontend *fe, int inverted)
380{ 383{
381 struct s5h1409_state* state = fe->demodulator_priv; 384 struct s5h1409_state *state = fe->demodulator_priv;
382 385
383 dprintk("%s(%d)\n", __func__, inverted); 386 dprintk("%s(%d)\n", __func__, inverted);
384 387
385 if(inverted == 1) 388 if (inverted == 1)
386 return s5h1409_writereg(state, 0x1b, 0x1101); /* Inverted */ 389 return s5h1409_writereg(state, 0x1b, 0x1101); /* Inverted */
387 else 390 else
388 return s5h1409_writereg(state, 0x1b, 0x0110); /* Normal */ 391 return s5h1409_writereg(state, 0x1b, 0x0110); /* Normal */
389} 392}
390 393
391static int s5h1409_enable_modulation(struct dvb_frontend* fe, 394static int s5h1409_enable_modulation(struct dvb_frontend *fe,
392 fe_modulation_t m) 395 fe_modulation_t m)
393{ 396{
394 struct s5h1409_state* state = fe->demodulator_priv; 397 struct s5h1409_state *state = fe->demodulator_priv;
395 398
396 dprintk("%s(0x%08x)\n", __func__, m); 399 dprintk("%s(0x%08x)\n", __func__, m);
397 400
398 switch(m) { 401 switch (m) {
399 case VSB_8: 402 case VSB_8:
400 dprintk("%s() VSB_8\n", __func__); 403 dprintk("%s() VSB_8\n", __func__);
401 if (state->if_freq != S5H1409_VSB_IF_FREQ) 404 if (state->if_freq != S5H1409_VSB_IF_FREQ)
@@ -422,9 +425,9 @@ static int s5h1409_enable_modulation(struct dvb_frontend* fe,
422 return 0; 425 return 0;
423} 426}
424 427
425static int s5h1409_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) 428static int s5h1409_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
426{ 429{
427 struct s5h1409_state* state = fe->demodulator_priv; 430 struct s5h1409_state *state = fe->demodulator_priv;
428 431
429 dprintk("%s(%d)\n", __func__, enable); 432 dprintk("%s(%d)\n", __func__, enable);
430 433
@@ -434,9 +437,9 @@ static int s5h1409_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
434 return s5h1409_writereg(state, 0xf3, 0); 437 return s5h1409_writereg(state, 0xf3, 0);
435} 438}
436 439
437static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable) 440static int s5h1409_set_gpio(struct dvb_frontend *fe, int enable)
438{ 441{
439 struct s5h1409_state* state = fe->demodulator_priv; 442 struct s5h1409_state *state = fe->demodulator_priv;
440 443
441 dprintk("%s(%d)\n", __func__, enable); 444 dprintk("%s(%d)\n", __func__, enable);
442 445
@@ -448,18 +451,18 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable)
448 s5h1409_readreg(state, 0xe3) & 0xfeff); 451 s5h1409_readreg(state, 0xe3) & 0xfeff);
449} 452}
450 453
451static int s5h1409_sleep(struct dvb_frontend* fe, int enable) 454static int s5h1409_sleep(struct dvb_frontend *fe, int enable)
452{ 455{
453 struct s5h1409_state* state = fe->demodulator_priv; 456 struct s5h1409_state *state = fe->demodulator_priv;
454 457
455 dprintk("%s(%d)\n", __func__, enable); 458 dprintk("%s(%d)\n", __func__, enable);
456 459
457 return s5h1409_writereg(state, 0xf2, enable); 460 return s5h1409_writereg(state, 0xf2, enable);
458} 461}
459 462
460static int s5h1409_register_reset(struct dvb_frontend* fe) 463static int s5h1409_register_reset(struct dvb_frontend *fe)
461{ 464{
462 struct s5h1409_state* state = fe->demodulator_priv; 465 struct s5h1409_state *state = fe->demodulator_priv;
463 466
464 dprintk("%s()\n", __func__); 467 dprintk("%s()\n", __func__);
465 468
@@ -483,7 +486,7 @@ static void s5h1409_set_qam_amhum_mode(struct dvb_frontend *fe)
483 reg &= 0xff; 486 reg &= 0xff;
484 487
485 s5h1409_writereg(state, 0x96, 0x00c); 488 s5h1409_writereg(state, 0x96, 0x00c);
486 if ((reg < 0x38) || (reg > 0x68) ) { 489 if ((reg < 0x38) || (reg > 0x68)) {
487 s5h1409_writereg(state, 0x93, 0x3332); 490 s5h1409_writereg(state, 0x93, 0x3332);
488 s5h1409_writereg(state, 0x9e, 0x2c37); 491 s5h1409_writereg(state, 0x9e, 0x2c37);
489 } else { 492 } else {
@@ -514,7 +517,7 @@ static void s5h1409_set_qam_interleave_mode(struct dvb_frontend *fe)
514 517
515 s5h1409_writereg(state, 0x96, 0x20); 518 s5h1409_writereg(state, 0x96, 0x20);
516 s5h1409_writereg(state, 0xad, 519 s5h1409_writereg(state, 0xad,
517 ( ((reg1 & 0xf000) >> 4) | (reg2 & 0xf0ff)) ); 520 (((reg1 & 0xf000) >> 4) | (reg2 & 0xf0ff)));
518 s5h1409_writereg(state, 0xab, 521 s5h1409_writereg(state, 0xab,
519 s5h1409_readreg(state, 0xab) & 0xeffe); 522 s5h1409_readreg(state, 0xab) & 0xeffe);
520 } 523 }
@@ -529,10 +532,10 @@ static void s5h1409_set_qam_interleave_mode(struct dvb_frontend *fe)
529} 532}
530 533
531/* Talk to the demod, set the FEC, GUARD, QAM settings etc */ 534/* Talk to the demod, set the FEC, GUARD, QAM settings etc */
532static int s5h1409_set_frontend (struct dvb_frontend* fe, 535static int s5h1409_set_frontend(struct dvb_frontend *fe,
533 struct dvb_frontend_parameters *p) 536 struct dvb_frontend_parameters *p)
534{ 537{
535 struct s5h1409_state* state = fe->demodulator_priv; 538 struct s5h1409_state *state = fe->demodulator_priv;
536 539
537 dprintk("%s(frequency=%d)\n", __func__, p->frequency); 540 dprintk("%s(frequency=%d)\n", __func__, p->frequency);
538 541
@@ -546,9 +549,11 @@ static int s5h1409_set_frontend (struct dvb_frontend* fe,
546 msleep(100); 549 msleep(100);
547 550
548 if (fe->ops.tuner_ops.set_params) { 551 if (fe->ops.tuner_ops.set_params) {
549 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); 552 if (fe->ops.i2c_gate_ctrl)
553 fe->ops.i2c_gate_ctrl(fe, 1);
550 fe->ops.tuner_ops.set_params(fe, p); 554 fe->ops.tuner_ops.set_params(fe, p);
551 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); 555 if (fe->ops.i2c_gate_ctrl)
556 fe->ops.i2c_gate_ctrl(fe, 0);
552 } 557 }
553 558
554 /* Optimize the demod for QAM */ 559 /* Optimize the demod for QAM */
@@ -592,17 +597,17 @@ static int s5h1409_set_mpeg_timing(struct dvb_frontend *fe, int mode)
592 597
593/* Reset the demod hardware and reset all of the configuration registers 598/* Reset the demod hardware and reset all of the configuration registers
594 to a default state. */ 599 to a default state. */
595static int s5h1409_init (struct dvb_frontend* fe) 600static int s5h1409_init(struct dvb_frontend *fe)
596{ 601{
597 int i; 602 int i;
598 603
599 struct s5h1409_state* state = fe->demodulator_priv; 604 struct s5h1409_state *state = fe->demodulator_priv;
600 dprintk("%s()\n", __func__); 605 dprintk("%s()\n", __func__);
601 606
602 s5h1409_sleep(fe, 0); 607 s5h1409_sleep(fe, 0);
603 s5h1409_register_reset(fe); 608 s5h1409_register_reset(fe);
604 609
605 for (i=0; i < ARRAY_SIZE(init_tab); i++) 610 for (i = 0; i < ARRAY_SIZE(init_tab); i++)
606 s5h1409_writereg(state, init_tab[i].reg, init_tab[i].data); 611 s5h1409_writereg(state, init_tab[i].reg, init_tab[i].data);
607 612
608 /* The datasheet says that after initialisation, VSB is default */ 613 /* The datasheet says that after initialisation, VSB is default */
@@ -627,9 +632,9 @@ static int s5h1409_init (struct dvb_frontend* fe)
627 return 0; 632 return 0;
628} 633}
629 634
630static int s5h1409_read_status(struct dvb_frontend* fe, fe_status_t* status) 635static int s5h1409_read_status(struct dvb_frontend *fe, fe_status_t *status)
631{ 636{
632 struct s5h1409_state* state = fe->demodulator_priv; 637 struct s5h1409_state *state = fe->demodulator_priv;
633 u16 reg; 638 u16 reg;
634 u32 tuner_status = 0; 639 u32 tuner_status = 0;
635 640
@@ -637,12 +642,12 @@ static int s5h1409_read_status(struct dvb_frontend* fe, fe_status_t* status)
637 642
638 /* Get the demodulator status */ 643 /* Get the demodulator status */
639 reg = s5h1409_readreg(state, 0xf1); 644 reg = s5h1409_readreg(state, 0xf1);
640 if(reg & 0x1000) 645 if (reg & 0x1000)
641 *status |= FE_HAS_VITERBI; 646 *status |= FE_HAS_VITERBI;
642 if(reg & 0x8000) 647 if (reg & 0x8000)
643 *status |= FE_HAS_LOCK | FE_HAS_SYNC; 648 *status |= FE_HAS_LOCK | FE_HAS_SYNC;
644 649
645 switch(state->config->status_mode) { 650 switch (state->config->status_mode) {
646 case S5H1409_DEMODLOCKING: 651 case S5H1409_DEMODLOCKING:
647 if (*status & FE_HAS_VITERBI) 652 if (*status & FE_HAS_VITERBI)
648 *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; 653 *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL;
@@ -668,12 +673,12 @@ static int s5h1409_read_status(struct dvb_frontend* fe, fe_status_t* status)
668 return 0; 673 return 0;
669} 674}
670 675
671static int s5h1409_qam256_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v) 676static int s5h1409_qam256_lookup_snr(struct dvb_frontend *fe, u16 *snr, u16 v)
672{ 677{
673 int i, ret = -EINVAL; 678 int i, ret = -EINVAL;
674 dprintk("%s()\n", __func__); 679 dprintk("%s()\n", __func__);
675 680
676 for (i=0; i < ARRAY_SIZE(qam256_snr_tab); i++) { 681 for (i = 0; i < ARRAY_SIZE(qam256_snr_tab); i++) {
677 if (v < qam256_snr_tab[i].val) { 682 if (v < qam256_snr_tab[i].val) {
678 *snr = qam256_snr_tab[i].data; 683 *snr = qam256_snr_tab[i].data;
679 ret = 0; 684 ret = 0;
@@ -683,12 +688,12 @@ static int s5h1409_qam256_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v)
683 return ret; 688 return ret;
684} 689}
685 690
686static int s5h1409_qam64_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v) 691static int s5h1409_qam64_lookup_snr(struct dvb_frontend *fe, u16 *snr, u16 v)
687{ 692{
688 int i, ret = -EINVAL; 693 int i, ret = -EINVAL;
689 dprintk("%s()\n", __func__); 694 dprintk("%s()\n", __func__);
690 695
691 for (i=0; i < ARRAY_SIZE(qam64_snr_tab); i++) { 696 for (i = 0; i < ARRAY_SIZE(qam64_snr_tab); i++) {
692 if (v < qam64_snr_tab[i].val) { 697 if (v < qam64_snr_tab[i].val) {
693 *snr = qam64_snr_tab[i].data; 698 *snr = qam64_snr_tab[i].data;
694 ret = 0; 699 ret = 0;
@@ -698,12 +703,12 @@ static int s5h1409_qam64_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v)
698 return ret; 703 return ret;
699} 704}
700 705
701static int s5h1409_vsb_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v) 706static int s5h1409_vsb_lookup_snr(struct dvb_frontend *fe, u16 *snr, u16 v)
702{ 707{
703 int i, ret = -EINVAL; 708 int i, ret = -EINVAL;
704 dprintk("%s()\n", __func__); 709 dprintk("%s()\n", __func__);
705 710
706 for (i=0; i < ARRAY_SIZE(vsb_snr_tab); i++) { 711 for (i = 0; i < ARRAY_SIZE(vsb_snr_tab); i++) {
707 if (v > vsb_snr_tab[i].val) { 712 if (v > vsb_snr_tab[i].val) {
708 *snr = vsb_snr_tab[i].data; 713 *snr = vsb_snr_tab[i].data;
709 ret = 0; 714 ret = 0;
@@ -714,13 +719,13 @@ static int s5h1409_vsb_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v)
714 return ret; 719 return ret;
715} 720}
716 721
717static int s5h1409_read_snr(struct dvb_frontend* fe, u16* snr) 722static int s5h1409_read_snr(struct dvb_frontend *fe, u16 *snr)
718{ 723{
719 struct s5h1409_state* state = fe->demodulator_priv; 724 struct s5h1409_state *state = fe->demodulator_priv;
720 u16 reg; 725 u16 reg;
721 dprintk("%s()\n", __func__); 726 dprintk("%s()\n", __func__);
722 727
723 switch(state->current_modulation) { 728 switch (state->current_modulation) {
724 case QAM_64: 729 case QAM_64:
725 reg = s5h1409_readreg(state, 0xf0) & 0xff; 730 reg = s5h1409_readreg(state, 0xf0) & 0xff;
726 return s5h1409_qam64_lookup_snr(fe, snr, reg); 731 return s5h1409_qam64_lookup_snr(fe, snr, reg);
@@ -737,30 +742,30 @@ static int s5h1409_read_snr(struct dvb_frontend* fe, u16* snr)
737 return -EINVAL; 742 return -EINVAL;
738} 743}
739 744
740static int s5h1409_read_signal_strength(struct dvb_frontend* fe, 745static int s5h1409_read_signal_strength(struct dvb_frontend *fe,
741 u16* signal_strength) 746 u16 *signal_strength)
742{ 747{
743 return s5h1409_read_snr(fe, signal_strength); 748 return s5h1409_read_snr(fe, signal_strength);
744} 749}
745 750
746static int s5h1409_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) 751static int s5h1409_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
747{ 752{
748 struct s5h1409_state* state = fe->demodulator_priv; 753 struct s5h1409_state *state = fe->demodulator_priv;
749 754
750 *ucblocks = s5h1409_readreg(state, 0xb5); 755 *ucblocks = s5h1409_readreg(state, 0xb5);
751 756
752 return 0; 757 return 0;
753} 758}
754 759
755static int s5h1409_read_ber(struct dvb_frontend* fe, u32* ber) 760static int s5h1409_read_ber(struct dvb_frontend *fe, u32 *ber)
756{ 761{
757 return s5h1409_read_ucblocks(fe, ber); 762 return s5h1409_read_ucblocks(fe, ber);
758} 763}
759 764
760static int s5h1409_get_frontend(struct dvb_frontend* fe, 765static int s5h1409_get_frontend(struct dvb_frontend *fe,
761 struct dvb_frontend_parameters *p) 766 struct dvb_frontend_parameters *p)
762{ 767{
763 struct s5h1409_state* state = fe->demodulator_priv; 768 struct s5h1409_state *state = fe->demodulator_priv;
764 769
765 p->frequency = state->current_frequency; 770 p->frequency = state->current_frequency;
766 p->u.vsb.modulation = state->current_modulation; 771 p->u.vsb.modulation = state->current_modulation;
@@ -768,25 +773,25 @@ static int s5h1409_get_frontend(struct dvb_frontend* fe,
768 return 0; 773 return 0;
769} 774}
770 775
771static int s5h1409_get_tune_settings(struct dvb_frontend* fe, 776static int s5h1409_get_tune_settings(struct dvb_frontend *fe,
772 struct dvb_frontend_tune_settings *tune) 777 struct dvb_frontend_tune_settings *tune)
773{ 778{
774 tune->min_delay_ms = 1000; 779 tune->min_delay_ms = 1000;
775 return 0; 780 return 0;
776} 781}
777 782
778static void s5h1409_release(struct dvb_frontend* fe) 783static void s5h1409_release(struct dvb_frontend *fe)
779{ 784{
780 struct s5h1409_state* state = fe->demodulator_priv; 785 struct s5h1409_state *state = fe->demodulator_priv;
781 kfree(state); 786 kfree(state);
782} 787}
783 788
784static struct dvb_frontend_ops s5h1409_ops; 789static struct dvb_frontend_ops s5h1409_ops;
785 790
786struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, 791struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config,
787 struct i2c_adapter* i2c) 792 struct i2c_adapter *i2c)
788{ 793{
789 struct s5h1409_state* state = NULL; 794 struct s5h1409_state *state = NULL;
790 u16 reg; 795 u16 reg;
791 796
792 /* allocate memory for the internal state */ 797 /* allocate memory for the internal state */
@@ -825,6 +830,7 @@ error:
825 kfree(state); 830 kfree(state);
826 return NULL; 831 return NULL;
827} 832}
833EXPORT_SYMBOL(s5h1409_attach);
828 834
829static struct dvb_frontend_ops s5h1409_ops = { 835static struct dvb_frontend_ops s5h1409_ops = {
830 836
@@ -850,14 +856,10 @@ static struct dvb_frontend_ops s5h1409_ops = {
850 .release = s5h1409_release, 856 .release = s5h1409_release,
851}; 857};
852 858
853module_param(debug, int, 0644);
854MODULE_PARM_DESC(debug, "Enable verbose debug messages");
855
856MODULE_DESCRIPTION("Samsung S5H1409 QAM-B/ATSC Demodulator driver"); 859MODULE_DESCRIPTION("Samsung S5H1409 QAM-B/ATSC Demodulator driver");
857MODULE_AUTHOR("Steven Toth"); 860MODULE_AUTHOR("Steven Toth");
858MODULE_LICENSE("GPL"); 861MODULE_LICENSE("GPL");
859 862
860EXPORT_SYMBOL(s5h1409_attach);
861 863
862/* 864/*
863 * Local variables: 865 * Local variables:
diff --git a/drivers/media/dvb/frontends/s5h1409.h b/drivers/media/dvb/frontends/s5h1409.h
index d1a1d2eb8e11..070d9743e330 100644
--- a/drivers/media/dvb/frontends/s5h1409.h
+++ b/drivers/media/dvb/frontends/s5h1409.h
@@ -24,8 +24,7 @@
24 24
25#include <linux/dvb/frontend.h> 25#include <linux/dvb/frontend.h>
26 26
27struct s5h1409_config 27struct s5h1409_config {
28{
29 /* the demodulator's i2c address */ 28 /* the demodulator's i2c address */
30 u8 demod_address; 29 u8 demod_address;
31 30
@@ -60,12 +59,14 @@ struct s5h1409_config
60 u16 mpeg_timing; 59 u16 mpeg_timing;
61}; 60};
62 61
63#if defined(CONFIG_DVB_S5H1409) || (defined(CONFIG_DVB_S5H1409_MODULE) && defined(MODULE)) 62#if defined(CONFIG_DVB_S5H1409) || (defined(CONFIG_DVB_S5H1409_MODULE) \
64extern struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, 63 && defined(MODULE))
65 struct i2c_adapter* i2c); 64extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config,
65 struct i2c_adapter *i2c);
66#else 66#else
67static inline struct dvb_frontend* s5h1409_attach(const struct s5h1409_config* config, 67static inline struct dvb_frontend *s5h1409_attach(
68 struct i2c_adapter* i2c) 68 const struct s5h1409_config *config,
69 struct i2c_adapter *i2c)
69{ 70{
70 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); 71 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
71 return NULL; 72 return NULL;