diff options
-rw-r--r-- | drivers/media/dvb/frontends/cx24123.c | 98 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/cx24123.h | 9 |
2 files changed, 86 insertions, 21 deletions
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index cfb7d2edd5a9..3e230fc59cac 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | Copyright (C) 2005 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2005 Steven Toth <stoth@hauppauge.com> |
5 | 5 | ||
6 | Support for KWorld DVB-S 100 by Vadim Catana <skystar@moldova.cc> | ||
7 | |||
6 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 10 | the Free Software Foundation; either version 2 of the License, or |
@@ -573,7 +575,8 @@ static int cx24123_initfe(struct dvb_frontend* fe) | |||
573 | state->config->pll_init(fe); | 575 | state->config->pll_init(fe); |
574 | 576 | ||
575 | /* Configure the LNB for 14V */ | 577 | /* Configure the LNB for 14V */ |
576 | cx24123_writelnbreg(state, 0x0, 0x2a); | 578 | if (state->config->use_isl6421) |
579 | cx24123_writelnbreg(state, 0x0, 0x2a); | ||
577 | 580 | ||
578 | return 0; | 581 | return 0; |
579 | } | 582 | } |
@@ -583,18 +586,49 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage | |||
583 | struct cx24123_state *state = fe->demodulator_priv; | 586 | struct cx24123_state *state = fe->demodulator_priv; |
584 | u8 val; | 587 | u8 val; |
585 | 588 | ||
586 | val = cx24123_readlnbreg(state, 0x0); | 589 | switch (state->config->use_isl6421) { |
587 | 590 | ||
588 | switch (voltage) { | 591 | case 1: |
589 | case SEC_VOLTAGE_13: | 592 | |
590 | return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ | 593 | val = cx24123_readlnbreg(state, 0x0); |
591 | case SEC_VOLTAGE_18: | 594 | |
592 | return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ | 595 | switch (voltage) { |
593 | case SEC_VOLTAGE_OFF: | 596 | case SEC_VOLTAGE_13: |
594 | return cx24123_writelnbreg(state, 0x0, val & 0x30); | 597 | return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ |
595 | default: | 598 | case SEC_VOLTAGE_18: |
596 | return -EINVAL; | 599 | return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ |
597 | }; | 600 | case SEC_VOLTAGE_OFF: |
601 | return cx24123_writelnbreg(state, 0x0, val & 0x30); | ||
602 | default: | ||
603 | return -EINVAL; | ||
604 | }; | ||
605 | |||
606 | case 0: | ||
607 | |||
608 | val = cx24123_readreg(state, 0x29); | ||
609 | |||
610 | switch (voltage) { | ||
611 | case SEC_VOLTAGE_13: | ||
612 | dprintk("%s: setting voltage 13V\n", __FUNCTION__); | ||
613 | if (state->config->enable_lnb_voltage) | ||
614 | state->config->enable_lnb_voltage(fe, 1); | ||
615 | return cx24123_writereg(state, 0x29, val | 0x80); | ||
616 | case SEC_VOLTAGE_18: | ||
617 | dprintk("%s: setting voltage 18V\n", __FUNCTION__); | ||
618 | if (state->config->enable_lnb_voltage) | ||
619 | state->config->enable_lnb_voltage(fe, 1); | ||
620 | return cx24123_writereg(state, 0x29, val & 0x7f); | ||
621 | case SEC_VOLTAGE_OFF: | ||
622 | dprintk("%s: setting voltage off\n", __FUNCTION__); | ||
623 | if (state->config->enable_lnb_voltage) | ||
624 | state->config->enable_lnb_voltage(fe, 0); | ||
625 | return 0; | ||
626 | default: | ||
627 | return -EINVAL; | ||
628 | }; | ||
629 | } | ||
630 | |||
631 | return 0; | ||
598 | } | 632 | } |
599 | 633 | ||
600 | static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, | 634 | static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, |
@@ -729,17 +763,39 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
729 | struct cx24123_state *state = fe->demodulator_priv; | 763 | struct cx24123_state *state = fe->demodulator_priv; |
730 | u8 val; | 764 | u8 val; |
731 | 765 | ||
732 | val = cx24123_readlnbreg(state, 0x0); | 766 | switch (state->config->use_isl6421) { |
767 | case 1: | ||
768 | |||
769 | val = cx24123_readlnbreg(state, 0x0); | ||
733 | 770 | ||
734 | switch (tone) { | 771 | switch (tone) { |
735 | case SEC_TONE_ON: | 772 | case SEC_TONE_ON: |
736 | return cx24123_writelnbreg(state, 0x0, val | 0x10); | 773 | return cx24123_writelnbreg(state, 0x0, val | 0x10); |
737 | case SEC_TONE_OFF: | 774 | case SEC_TONE_OFF: |
738 | return cx24123_writelnbreg(state, 0x0, val & 0x2f); | 775 | return cx24123_writelnbreg(state, 0x0, val & 0x2f); |
739 | default: | 776 | default: |
740 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); | 777 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); |
741 | return -EINVAL; | 778 | return -EINVAL; |
779 | } | ||
780 | |||
781 | case 0: | ||
782 | |||
783 | val = cx24123_readreg(state, 0x29); | ||
784 | |||
785 | switch (tone) { | ||
786 | case SEC_TONE_ON: | ||
787 | dprintk("%s: setting tone on\n", __FUNCTION__); | ||
788 | return cx24123_writereg(state, 0x29, val | 0x10); | ||
789 | case SEC_TONE_OFF: | ||
790 | dprintk("%s: setting tone off\n",__FUNCTION__); | ||
791 | return cx24123_writereg(state, 0x29, val & 0xef); | ||
792 | default: | ||
793 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); | ||
794 | return -EINVAL; | ||
795 | } | ||
742 | } | 796 | } |
797 | |||
798 | return 0; | ||
743 | } | 799 | } |
744 | 800 | ||
745 | static void cx24123_release(struct dvb_frontend* fe) | 801 | static void cx24123_release(struct dvb_frontend* fe) |
diff --git a/drivers/media/dvb/frontends/cx24123.h b/drivers/media/dvb/frontends/cx24123.h index a6b85d517578..0c922b5e9263 100644 --- a/drivers/media/dvb/frontends/cx24123.h +++ b/drivers/media/dvb/frontends/cx24123.h | |||
@@ -28,12 +28,21 @@ struct cx24123_config | |||
28 | /* the demodulator's i2c address */ | 28 | /* the demodulator's i2c address */ |
29 | u8 demod_address; | 29 | u8 demod_address; |
30 | 30 | ||
31 | /* | ||
32 | cards like Hauppauge Nova-S Plus/Nova-SE2 use an Intersil ISL6421 chip | ||
33 | for LNB control, while KWorld DVB-S 100 use the LNBDC and LNBTone bits | ||
34 | from register 0x29 of the CX24123 demodulator | ||
35 | */ | ||
36 | int use_isl6421; | ||
37 | |||
31 | /* PLL maintenance */ | 38 | /* PLL maintenance */ |
32 | int (*pll_init)(struct dvb_frontend* fe); | 39 | int (*pll_init)(struct dvb_frontend* fe); |
33 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); | 40 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); |
34 | 41 | ||
35 | /* Need to set device param for start_dma */ | 42 | /* Need to set device param for start_dma */ |
36 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); | 43 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); |
44 | |||
45 | void (*enable_lnb_voltage)(struct dvb_frontend* fe, int on); | ||
37 | }; | 46 | }; |
38 | 47 | ||
39 | extern struct dvb_frontend* cx24123_attach(const struct cx24123_config* config, | 48 | extern struct dvb_frontend* cx24123_attach(const struct cx24123_config* config, |