From: Michael Krufky <mkrufky@m1k.net>
To: Andrew Morton <akpm@osdl.org>
Cc: Johannes Stezenbach <js@linuxtv.org>,
Mac Michaels <wmichaels1@earthlink.net>,
LinuxDVB Mailing List <linux-dvb@linuxtv.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] DVB: LGDT3302 QAM256 initialization fix
Date: Mon, 11 Jul 2005 21:37:05 -0400 [thread overview]
Message-ID: <42D31EC1.9090102@m1k.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 465 bytes --]
- Initialize all non mutually exclusive variables
without regard to the mode selected.
- Do a software reset each time the parameters are
set, regardless of whether anything changes.
This may allow an application to recover from a
hung condition.
- Improved error reporting.
- Removed $Id:$
Signed-off-by: Mac Michaels <wmichaels1@earthlink.net <mailto:wmichaels1@earthlink.net>>
Signed-off-by: Michael Krufky <mkrufky@m1k.net <mailto:mkrufky@m1k.net>>
[-- Attachment #2: dvb-lgdt3302-initialization-fix.patch --]
[-- Type: text/plain, Size: 3877 bytes --]
linux/drivers/media/dvb/frontends/lgdt3302.c | 63 +++++++++----------
1 files changed, 30 insertions(+), 33 deletions(-)
diff -u linux-2.6.13/drivers/media/dvb/frontends/lgdt3302.c linux/drivers/media/dvb/frontends/lgdt3302.c
--- linux-2.6.13/drivers/media/dvb/frontends/lgdt3302.c 2005-07-07 08:19:00.000000000 +0000
+++ linux/drivers/media/dvb/frontends/lgdt3302.c 2005-07-11 21:25:53.000000000 +0000
@@ -1,6 +1,4 @@
/*
- * $Id: lgdt3302.c,v 1.5 2005/07/07 03:47:15 mkrufky Exp $
- *
* Support for LGDT3302 (DViCO FustionHDTV 3 Gold) - VSB/QAM
*
* Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
@@ -83,7 +81,10 @@
if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
printk(KERN_WARNING "lgdt3302: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err);
- return -EREMOTEIO;
+ if (err < 0)
+ return err;
+ else
+ return -EREMOTEIO;
}
} else {
u8 tmp[] = { buf[0], buf[1] };
@@ -96,7 +97,10 @@
tmp[1] = buf[i];
if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
printk(KERN_WARNING "lgdt3302: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err);
- return -EREMOTEIO;
+ if (err < 0)
+ return err;
+ else
+ return -EREMOTEIO;
}
tmp[0]++;
}
@@ -266,36 +270,30 @@
i2c_writebytes(state, state->config->demod_address,
demux_ctrl_cfg, sizeof(demux_ctrl_cfg));
- if (param->u.vsb.modulation == VSB_8) {
- /* Initialization for VSB modes only */
- /* Change the value of NCOCTFV[25:0]of carrier
- recovery center frequency register for VSB */
- i2c_writebytes(state, state->config->demod_address,
+ /* Change the value of NCOCTFV[25:0] of carrier
+ recovery center frequency register */
+ i2c_writebytes(state, state->config->demod_address,
vsb_freq_cfg, sizeof(vsb_freq_cfg));
- } else {
- /* Initialization for QAM modes only */
- /* Set the value of 'INLVTHD' register 0x2a/0x2c
- to value from 'IFACC' register 0x39/0x3b -1 */
- int value;
- i2c_selectreadbytes(state, AGC_RFIF_ACC0,
- &agc_delay_cfg[1], 3);
- value = ((agc_delay_cfg[1] & 0x0f) << 8) | agc_delay_cfg[3];
- value = value -1;
- dprintk("%s IFACC -1 = 0x%03x\n", __FUNCTION__, value);
- agc_delay_cfg[1] = (value >> 8) & 0x0f;
- agc_delay_cfg[2] = 0x00;
- agc_delay_cfg[3] = value & 0xff;
- i2c_writebytes(state, state->config->demod_address,
- agc_delay_cfg, sizeof(agc_delay_cfg));
-
- /* Change the value of IAGCBW[15:8]
- of inner AGC loop filter bandwith */
- i2c_writebytes(state, state->config->demod_address,
- agc_loop_cfg, sizeof(agc_loop_cfg));
- }
+ /* Set the value of 'INLVTHD' register 0x2a/0x2c
+ to value from 'IFACC' register 0x39/0x3b -1 */
+ int value;
+ i2c_selectreadbytes(state, AGC_RFIF_ACC0,
+ &agc_delay_cfg[1], 3);
+ value = ((agc_delay_cfg[1] & 0x0f) << 8) | agc_delay_cfg[3];
+ value = value -1;
+ dprintk("%s IFACC -1 = 0x%03x\n", __FUNCTION__, value);
+ agc_delay_cfg[1] = (value >> 8) & 0x0f;
+ agc_delay_cfg[2] = 0x00;
+ agc_delay_cfg[3] = value & 0xff;
+ i2c_writebytes(state, state->config->demod_address,
+ agc_delay_cfg, sizeof(agc_delay_cfg));
+
+ /* Change the value of IAGCBW[15:8]
+ of inner AGC loop filter bandwith */
+ i2c_writebytes(state, state->config->demod_address,
+ agc_loop_cfg, sizeof(agc_loop_cfg));
state->config->set_ts_params(fe, 0);
- lgdt3302_SwReset(state);
state->current_modulation = param->u.vsb.modulation;
}
@@ -311,11 +309,10 @@
i2c_readbytes(state, state->config->pll_address, buf, 1);
dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[0]);
- lgdt3302_SwReset(state);
-
/* Update current frequency */
state->current_frequency = param->frequency;
}
+ lgdt3302_SwReset(state);
return 0;
}
next reply other threads:[~2005-07-12 1:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-12 1:37 Michael Krufky [this message]
2005-07-12 10:21 ` [PATCH] DVB: LGDT3302 QAM256 initialization fix Johannes Stezenbach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42D31EC1.9090102@m1k.net \
--to=mkrufky@m1k.net \
--cc=akpm@osdl.org \
--cc=js@linuxtv.org \
--cc=linux-dvb@linuxtv.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wmichaels1@earthlink.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.