aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-01-01 16:31:34 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:34 -0500
commit95af8a26cba55222d6a1beda7970431b4fbbbdd6 (patch)
treec5be2b16867025e0f71630961ef17a90afa5293c /drivers/media/dvb/frontends
parent33f25b42753f464c5927e8b828352333780c14bd (diff)
V4L/DVB (6958): tda18271: clean up function tda18271_set_analog_params
make set_analog_params function look consistent with set_params function Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/tda18271-fe.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c
index 739ecfe04381..98ee6b1ff8a0 100644
--- a/drivers/media/dvb/frontends/tda18271-fe.c
+++ b/drivers/media/dvb/frontends/tda18271-fe.c
@@ -662,7 +662,6 @@ static int tda18271_set_params(struct dvb_frontend *fe,
662 struct tda18271_priv *priv = fe->tuner_priv; 662 struct tda18271_priv *priv = fe->tuner_priv;
663 u8 std; 663 u8 std;
664 u32 bw, sgIF = 0; 664 u32 bw, sgIF = 0;
665
666 u32 freq = params->frequency; 665 u32 freq = params->frequency;
667 666
668 priv->mode = TDA18271_DIGITAL; 667 priv->mode = TDA18271_DIGITAL;
@@ -722,54 +721,50 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
722 struct analog_parameters *params) 721 struct analog_parameters *params)
723{ 722{
724 struct tda18271_priv *priv = fe->tuner_priv; 723 struct tda18271_priv *priv = fe->tuner_priv;
725 u8 std;
726 unsigned int sgIF;
727 char *mode; 724 char *mode;
725 u8 std;
726 u32 sgIF, freq = params->frequency * 62500;
728 727
729 priv->mode = TDA18271_ANALOG; 728 priv->mode = TDA18271_ANALOG;
730 729
731 /* see table 22 */ 730 /* see table 22 */
732 if (params->std & V4L2_STD_MN) { 731 if (params->std & V4L2_STD_MN) {
733 std = 0x0d; 732 std = 0x0d;
734 sgIF = 92; 733 sgIF = 5750000;
735 mode = "MN"; 734 mode = "MN";
736 } else if (params->std & V4L2_STD_B) { 735 } else if (params->std & V4L2_STD_B) {
737 std = 0x0e; 736 std = 0x0e;
738 sgIF = 108; 737 sgIF = 6750000;
739 mode = "B"; 738 mode = "B";
740 } else if (params->std & V4L2_STD_GH) { 739 } else if (params->std & V4L2_STD_GH) {
741 std = 0x0f; 740 std = 0x0f;
742 sgIF = 124; 741 sgIF = 7750000;
743 mode = "GH"; 742 mode = "GH";
744 } else if (params->std & V4L2_STD_PAL_I) { 743 } else if (params->std & V4L2_STD_PAL_I) {
745 std = 0x0f; 744 std = 0x0f;
746 sgIF = 124; 745 sgIF = 7750000;
747 mode = "I"; 746 mode = "I";
748 } else if (params->std & V4L2_STD_DK) { 747 } else if (params->std & V4L2_STD_DK) {
749 std = 0x0f; 748 std = 0x0f;
750 sgIF = 124; 749 sgIF = 7750000;
751 mode = "DK"; 750 mode = "DK";
752 } else if (params->std & V4L2_STD_SECAM_L) { 751 } else if (params->std & V4L2_STD_SECAM_L) {
753 std = 0x0f; 752 std = 0x0f;
754 sgIF = 124; 753 sgIF = 7750000;
755 mode = "L"; 754 mode = "L";
756 } else if (params->std & V4L2_STD_SECAM_LC) { 755 } else if (params->std & V4L2_STD_SECAM_LC) {
757 std = 0x0f; 756 std = 0x0f;
758 sgIF = 20; 757 sgIF = 1250000;
759 mode = "LC"; 758 mode = "L'";
760 } else { 759 } else {
761 std = 0x0f; 760 std = 0x0f;
762 sgIF = 124; 761 sgIF = 7750000;
763 mode = "xx"; 762 mode = "xx";
764 } 763 }
765 764
766 if (params->mode == V4L2_TUNER_RADIO)
767 sgIF = 88; /* if frequency is 5.5 MHz */
768
769 tda_dbg("setting tda18271 to system %s\n", mode); 765 tda_dbg("setting tda18271 to system %s\n", mode);
770 766
771 return tda18271_tune(fe, sgIF * 62500, params->frequency * 62500, 767 return tda18271_tune(fe, sgIF, freq, 0, std);
772 0, std);
773} 768}
774 769
775static int tda18271_release(struct dvb_frontend *fe) 770static int tda18271_release(struct dvb_frontend *fe)