From: Michael Hunold (LinuxTV.org CVS maintainer) <hunold@linuxtv.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 10/14] update dvb frontend drivers
Date: Wed, 8 Oct 2003 15:28:58 +0200 [thread overview]
Message-ID: <10656197382984@convergence.de> (raw)
In-Reply-To: <106561973797@convergence.de>
- [DVB] add budget driver as possible client of the ves1820 frontend driver
- [DVB] fix wrong include in sp887x.c frontend driver
- [DVB] fix wrong chip description in tda1004xh frontend driver
- [DVB] fixed detection of stv0299 if chip is in standby mode
- [DVB] change some #ifdef to #if, for easier debug enable/disable
- [DVB] ves1820: patch by Peter Bieringer: nicer log output
- [DVB] ves1820: allow PWM (tuner calibaration) value from EEPROM to be overridden on command line (based on patch by Peter Bieringer). New module paramters: "pwm" (max 4 ints, range -1..0xff) and "verbose" (to print AFC value aftger tuning).
diff -uNrwB --new-file xx-linux-2.6.0-test5/drivers/media/dvb/frontends/ves1820.c linux-2.6.0-test5/drivers/media/dvb/frontends/ves1820.c
--- xx-linux-2.6.0-test5/drivers/media/dvb/frontends/ves1820.c 2003-09-10 11:29:20.000000000 +0200
+++ linux-2.6.0-test5/drivers/media/dvb/frontends/ves1820.c 2003-08-25 12:16:12.000000000 +0200
@@ -173,7 +173,8 @@
if (tuner_type == 0xff) /* PLL not reachable over i2c ... */
return 0;
- if (strstr (fe->i2c->adapter->name, "Technotrend"))
+ if (strstr (fe->i2c->adapter->name, "Technotrend") ||
+ strstr (fe->i2c->adapter->name, "TT-Budget"))
ifreq = 35937500;
else
ifreq = 36125000;
diff -uNrwB --new-file -uraN linux-2.6.0-test6/drivers/media/dvb/frontends/sp887x.c linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/sp887x.c
--- linux-2.6.0-test6/drivers/media/dvb/frontends/sp887x.c 2003-10-01 12:25:24.000000000 +0200
+++ linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/sp887x.c 2003-09-16 10:01:00.000000000 +0200
@@ -4,7 +4,7 @@
#include <linux/i2c.h>
#include "dvb_frontend.h"
-#include "dvb_compat.h"
+#include "dvb_functions.h"
#if 0
diff -uNrwB --new-file -uraN linux-2.6.0-test6/drivers/media/dvb/frontends/tda1004x.c linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/tda1004x.c
--- linux-2.6.0-test6/drivers/media/dvb/frontends/tda1004x.c 2003-10-01 12:20:37.000000000 +0200
+++ linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/tda1004x.c 2003-09-10 11:59:54.000000000 +0200
@@ -1,5 +1,5 @@
/*
- Driver for Philips tda1004x OFDM Frontend
+ Driver for Philips tda1004xh OFDM Frontend
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff -uNrwB --new-file -uraN linux-2.6.0-test6/drivers/media/dvb/frontends/stv0299.c linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/stv0299.c
--- linux-2.6.0-test6/drivers/media/dvb/frontends/stv0299.c 2003-10-01 12:20:37.000000000 +0200
+++ linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/stv0299.c 2003-09-29 16:04:08.000000000 +0200
@@ -913,7 +913,10 @@
static int uni0299_attach (struct dvb_i2c_bus *i2c)
{
long tuner_type;
- u8 id = stv0299_readreg (i2c, 0x00);
+ u8 id;
+
+ stv0299_writereg (i2c, 0x02, 0x00); /* standby off */
+ id = stv0299_readreg (i2c, 0x00);
dprintk ("%s: id == 0x%02x\n", __FUNCTION__, id);
diff -uNrwB --new-file -uraN linux-2.6.0-test6/drivers/media/dvb/frontends/mt312.c linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/mt312.c
--- linux-2.6.0-test6/drivers/media/dvb/frontends/mt312.c 2003-10-01 12:20:37.000000000 +0200
+++ linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/mt312.c 2003-09-16 10:01:00.000000000 +0200
@@ -85,7 +85,7 @@
printk(KERN_ERR "%s: ret == %d\n", __FUNCTION__, ret);
return -EREMOTEIO;
}
-#ifdef MT312_DEBUG
+#if MT312_DEBUG
{
int i;
printk(KERN_INFO "R(%d):", reg & 0x7f);
@@ -106,7 +106,7 @@
u8 buf[count + 1];
struct i2c_msg msg;
-#ifdef MT312_DEBUG
+#if MT312_DEBUG
{
int i;
printk(KERN_INFO "W(%d):", reg & 0x7f);
diff -uNrwB --new-file -uraN linux-2.6.0-test6/drivers/media/dvb/frontends/ves1820.c linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/ves1820.c
--- linux-2.6.0-test6/drivers/media/dvb/frontends/ves1820.c 2003-10-01 12:25:36.000000000 +0200
+++ linux-2.6.0-test6-cvs/drivers/media/dvb/frontends/ves1820.c 2003-10-01 13:01:43.000000000 +0200
@@ -36,6 +36,9 @@
#define dprintk(x...)
#endif
+#define MAX_UNITS 4
+static int pwm[MAX_UNITS] = { -1, -1, -1, -1 };
+static int verbose;
/**
* since we need only a few bits to store internal state we don't allocate
@@ -116,9 +119,9 @@
ret = i2c->xfer (i2c, &msg, 1);
if (ret != 1)
- dprintk("%s: writereg error "
+ printk("DVB: VES1820(%d): %s, writereg error "
"(reg == 0x%02x, val == 0x%02x, ret == %i)\n",
- __FUNCTION__, reg, data, ret);
+ fe->i2c->adapter->num, __FUNCTION__, reg, data, ret);
dvb_delay(10);
return (ret != 1) ? -EREMOTEIO : 0;
@@ -138,7 +141,8 @@
ret = i2c->xfer (i2c, msg, 2);
if (ret != 2)
- dprintk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret);
+ printk("DVB: VES1820(%d): %s: readreg error (ret == %i)\n",
+ fe->i2c->adapter->num, __FUNCTION__, ret);
return b1[0];
}
@@ -152,7 +156,8 @@
ret = i2c->xfer (i2c, &msg, 1);
if (ret != 1)
- printk("%s: i/o error (ret == %i)\n", __FUNCTION__, ret);
+ printk("DVB: VES1820(%d): %s: i/o error (ret == %i)\n",
+ i2c->adapter->num, __FUNCTION__, ret);
return (ret != 1) ? -EREMOTEIO : 0;
}
@@ -233,7 +238,7 @@
{
int i;
- dprintk("VES1820: init chip\n");
+ dprintk("DVB: VES1820(%d): init chip\n", fe->i2c->adapter->num);
ves1820_writereg (fe, 0, 0);
@@ -409,10 +414,11 @@
if (sync & 2)
/* AFC only valid when carrier has been recovered */
afc = ves1820_readreg(fe, 0x19);
- printk ("%s: AFC (%d) %dHz\n", __FILE__, afc,
+ if (verbose)
+ printk ("DVB: VES1820(%d): AFC (%d) %dHz\n",
+ fe->i2c->adapter->num, afc,
-((s32)(p->u.qam.symbol_rate >> 3) * afc >> 7));
-
p->inversion = reg0 & 0x20 ? INVERSION_OFF : INVERSION_ON;
p->u.qam.modulation = ((reg0 >> 2) & 7) + QAM_16;
@@ -450,15 +456,14 @@
if (i2c->xfer(i2c, &msg1, 1) == 1) {
type = 0;
- printk ("%s: setup for tuner spXXXX\n", __FILE__);
+ printk ("DVB: VES1820(%d): setup for tuner spXXXX\n", i2c->adapter->num);
} else if (i2c->xfer(i2c, &msg2, 1) == 1) {
type = 1;
- printk ("%s: setup for tuner sp5659c\n", __FILE__);
+ printk ("DVB: VES1820(%d): setup for tuner sp5659c\n", i2c->adapter->num);
} else {
type = -1;
- printk ("%s: unknown PLL, "
- "please report to <linuxdvb@linuxtv.org>!!\n",
- __FILE__);
+ printk ("DVB: VES1820(%d): unknown PLL, "
+ "please report to <linuxdvb@linuxtv.org>!!\n", i2c->adapter->num);
}
return type;
@@ -474,7 +479,7 @@
i2c->xfer (i2c, msg, 2);
- dprintk("VES1820: pwm=%02x\n", pwm);
+ printk("DVB: VES1820(%d): pwm=0x%02x\n", i2c->adapter->num, pwm);
if (pwm == 0xff)
pwm = 0x48;
@@ -514,6 +519,12 @@
if ((tuner_type = probe_tuner(i2c)) < 0)
return -ENODEV;
+ if ((i2c->adapter->num < MAX_UNITS) && pwm[i2c->adapter->num] != -1) {
+ printk("DVB: VES1820(%d): pwm=0x%02x (user specified)\n",
+ i2c->adapter->num, pwm[i2c->adapter->num]);
+ SET_PWM(data, pwm[i2c->adapter->num]);
+ }
+ else
SET_PWM(data, read_pwm(i2c));
SET_REG0(data, ves1820_inittab[0]);
SET_TUNER(data, tuner_type);
@@ -533,6 +544,10 @@
static int __init init_ves1820 (void)
{
+ int i;
+ for (i = 0; i < MAX_UNITS; i++)
+ if (pwm[i] < -1 || pwm[i] > 255)
+ return -EINVAL;
return dvb_register_i2c_device (THIS_MODULE,
ves1820_attach, ves1820_detach);
}
@@ -547,6 +562,11 @@
module_init(init_ves1820);
module_exit(exit_ves1820);
+MODULE_PARM(pwm, "1-" __MODULE_STRING(MAX_UNITS) "i");
+MODULE_PARM_DESC(pwm, "override PWM value stored in EEPROM (tuner calibration)");
+MODULE_PARM(verbose, "i");
+MODULE_PARM_DESC(verbose, "print AFC offset after tuning for debugging the PWM setting");
+
MODULE_DESCRIPTION("VES1820 DVB-C frontend driver");
MODULE_AUTHOR("Ralph Metzler, Holger Waechtler");
MODULE_LICENSE("GPL");
next prev parent reply other threads:[~2003-10-08 13:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-08 13:28 [PATCH 1/14] LinuxTV.org DVB driver update Michael Hunold
2003-10-08 13:28 ` [PATCH 2/14] firmware update for av7110 dvb driver Michael Hunold
2003-10-08 13:28 ` [PATCH 3/14] add new DVB-T frontend driver Michael Hunold
2003-10-08 13:28 ` [PATCH 4/14] video capture updates for saa7146 core Michael Hunold
2003-10-08 13:28 ` [PATCH 5/14] multiple device *read* opens support Michael Hunold
2003-10-08 13:28 ` [PATCH 6/14] update copyright and licensing Michael Hunold
2003-10-08 13:28 ` [PATCH 7/14] usual c99 initializer fixes Michael Hunold
2003-10-08 13:28 ` [PATCH 8/14] various patches for non-av7110 dvb-drivers Michael Hunold
2003-10-08 13:28 ` [PATCH 9/14] various av7110 dvb-driver updates Michael Hunold
2003-10-08 13:28 ` Michael Hunold [this message]
2003-10-08 13:28 ` [PATCH 11/14] Kconfig and Makefile updates, inspired by Adrian Bunk and Roman Zippel Michael Hunold
2003-10-08 13:28 ` [PATCH 12/14] some more av7110 dvb-driver updates Michael Hunold
2003-10-08 13:29 ` [PATCH 13/14] fix v4l1 backward compatibility in saa7146 driver Michael Hunold
2003-10-08 13:29 ` [PATCH 14/14] firmware blob for new DVB-T frontend driver Michael Hunold
2003-10-08 14:45 ` [PATCH 2/14] firmware update for av7110 dvb driver Marcel Holtmann
2003-10-08 15:36 ` Michael Hunold
2003-10-08 15:54 ` Michael Hunold
2003-10-12 21:42 ` Manuel Estrada Sainz
2003-10-11 11:59 ` Jochen Friedrich
2003-10-10 20:15 ` [PATCH 1/14] LinuxTV.org DVB driver update Stephen Hemminger
2003-10-11 8:41 ` Michael Hunold
2003-10-11 17:53 ` David S. Miller
2003-10-12 9:16 ` Geert Uytterhoeven
2003-10-12 11:08 ` Sam Ravnborg
2003-10-12 20:14 ` Michael Hunold
2003-10-13 16:01 ` Stephen Hemminger
2003-10-14 9:59 ` Michael Hunold
2003-10-12 20:10 ` Michael Hunold
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=10656197382984@convergence.de \
--to=hunold@linuxtv.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox