From 54bd69d6b05133720993cc78bb9817d118e4ecc2 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Fri, 1 Aug 2008 22:42:33 -0400 Subject: au8522: clean up function au8522_set_if From: Michael Krufky re-write this function to make it simpler Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/frontends/au8522.c | 65 +++++++++--------------------- 1 file changed, 19 insertions(+), 46 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/dvb/frontends/au8522.c b/linux/drivers/media/dvb/frontends/au8522.c index d968a1000..71ee03c26 100644 --- a/linux/drivers/media/dvb/frontends/au8522.c +++ b/linux/drivers/media/dvb/frontends/au8522.c @@ -304,67 +304,40 @@ static int au8522_mse2snr_lookup(struct mse2snr_tab *tab, int sz, int mse, return ret; } -/* 3.25 MHz IF Frequency table */ -static struct { - u16 reg; - u16 data; -} if_3_25_mhz_tab[] = { - { 0x80b5, 0x00 }, - { 0x80b6, 0x3d }, - { 0x80b7, 0xa0 }, -}; - -/* 4.00 MHz IF Frequency table */ -static struct { - u16 reg; - u16 data; -} if_4_mhz_tab[] = { - { 0x80b5, 0x00 }, - { 0x80b6, 0x4b }, - { 0x80b7, 0xd9 }, -}; - -/* 6.00 MHz IF Frequency table */ -static struct { - u16 reg; - u16 data; -} if_6_mhz_tab[] = { - { 0x80b5, 0xfb }, - { 0x80b6, 0x8e }, - { 0x80b7, 0x39 }, -}; - static int au8522_set_if(struct dvb_frontend *fe, enum au8522_if_freq if_freq) { struct au8522_state *state = fe->demodulator_priv; - int i; + u8 r0b5, r0b6, r0b7; + char *ifmhz; switch (if_freq) { case AU8522_IF_3_25MHZ: - dprintk("%s() 3.25 MHz\n", __func__); - for (i = 0; i < ARRAY_SIZE(if_3_25_mhz_tab); i++) - au8522_writereg(state, - if_3_25_mhz_tab[i].reg, - if_3_25_mhz_tab[i].data); + ifmhz = "3.25"; + r0b5 = 0x00; + r0b6 = 0x3d; + r0b7 = 0xa0; break; case AU8522_IF_4MHZ: - dprintk("%s() 4.00 MHz\n", __func__); - for (i = 0; i < ARRAY_SIZE(if_4_mhz_tab); i++) - au8522_writereg(state, - if_4_mhz_tab[i].reg, - if_4_mhz_tab[i].data); + ifmhz = "4.00"; + r0b5 = 0x00; + r0b6 = 0x4b; + r0b7 = 0xd9; break; case AU8522_IF_6MHZ: - dprintk("%s() 6.00 MHz\n", __func__); - for (i = 0; i < ARRAY_SIZE(if_6_mhz_tab); i++) - au8522_writereg(state, - if_6_mhz_tab[i].reg, - if_6_mhz_tab[i].data); + ifmhz = "6.00"; + r0b5 = 0xfb; + r0b6 = 0x8e; + r0b7 = 0x39; break; default: dprintk("%s() IF Frequency not supported\n", __func__); return -EINVAL; } + dprintk("%s() %s MHz\n", __func__, ifmhz); + au8522_writereg(state, 0x80b5, r0b5); + au8522_writereg(state, 0x80b6, r0b6); + au8522_writereg(state, 0x80b7, r0b7); + return 0; } -- cgit v1.2.3 From cbe89066e872a56e9fdf460fcf4cfc50d64369c9 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Fri, 1 Aug 2008 22:54:57 -0400 Subject: au8522: remove if frequency settings from vsb/qam modulation tables From: Michael Krufky Since IF frequency is set after the vsb/qam modulation tables are written, remove the redundant register settings from the vsb/qam modulation tables. Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/frontends/au8522.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/dvb/frontends/au8522.c b/linux/drivers/media/dvb/frontends/au8522.c index 71ee03c26..d946c8beb 100644 --- a/linux/drivers/media/dvb/frontends/au8522.c +++ b/linux/drivers/media/dvb/frontends/au8522.c @@ -371,9 +371,6 @@ static struct { { 0x80af, 0x66 }, { 0x821b, 0xcc }, { 0x821d, 0x80 }, - { 0x80b5, 0xfb }, - { 0x80b6, 0x8e }, - { 0x80b7, 0x39 }, { 0x80a4, 0xe8 }, { 0x8231, 0x13 }, }; @@ -387,9 +384,6 @@ static struct { { 0x80a4, 0x00 }, { 0x8081, 0xc4 }, { 0x80a5, 0x40 }, - { 0x80b5, 0xfb }, - { 0x80b6, 0x8e }, - { 0x80b7, 0x39 }, { 0x80aa, 0x77 }, { 0x80ad, 0x77 }, { 0x80a6, 0x67 }, -- cgit v1.2.3 From e0e78e09563f6a4feb5b0a186135bb365bc81ca8 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Fri, 1 Aug 2008 23:19:53 -0400 Subject: au0828: explicitly set 6 MHz IF frequency in hauppauge_hvr950q_config From: Michael Krufky Explicitly set 6 MHz IF frequency for VSB and QAM in hauppauge_hvr950q_config. The default value is 6 MHz, so this patch doesn't change anything -- this only improves code readability and may prevent future bugs. Signed-off-by: Michael Krufky --- linux/drivers/media/video/au0828/au0828-dvb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/au0828/au0828-dvb.c b/linux/drivers/media/video/au0828/au0828-dvb.c index b7b0591ef..1fa77ba11 100644 --- a/linux/drivers/media/video/au0828/au0828-dvb.c +++ b/linux/drivers/media/video/au0828/au0828-dvb.c @@ -40,6 +40,8 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); static struct au8522_config hauppauge_hvr950q_config = { .demod_address = 0x8e >> 1, .status_mode = AU8522_DEMODLOCKING, + .qam_if = AU8522_IF_6MHZ, + .vsb_if = AU8522_IF_6MHZ, }; static struct au8522_config hauppauge_woodbury_config = { -- cgit v1.2.3