summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-simple.c
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2005-02-15 15:59:34 +0000
committerGerd Knorr <devnull@localhost>2005-02-15 15:59:34 +0000
commit7d4651c8e0961354b298165ec03219c02bc7c734 (patch)
treef5288a3b033c9d07e9963080023e045b567aeb6e /linux/drivers/media/video/tuner-simple.c
parentb57159d1bd8754b2845b558cf778e9698bb0fc71 (diff)
downloadmediapointer-dvb-s2-7d4651c8e0961354b298165ec03219c02bc7c734.tar.gz
mediapointer-dvb-s2-7d4651c8e0961354b298165ec03219c02bc7c734.tar.bz2
- merge some patches from mainline.
- tuner kernel message fixups. - misc.
Diffstat (limited to 'linux/drivers/media/video/tuner-simple.c')
-rw-r--r--linux/drivers/media/video/tuner-simple.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index c2a3b6134..0fabdea9d 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -1,5 +1,5 @@
/*
- * $Id: tuner-simple.c,v 1.3 2005/02/10 11:43:41 kraxel Exp $
+ * $Id: tuner-simple.c,v 1.4 2005/02/15 15:59:35 kraxel Exp $
*
* i2c tv tuner chip device driver
* controls all those simple 4-control-bytes style tuners.
@@ -214,11 +214,6 @@ static int tuner_getstatus(struct i2c_client *c)
{
unsigned char byte;
- struct tuner *t = i2c_get_clientdata(c);
-
- if (t->type == TUNER_MT2032)
- return 0;
-
if (1 != i2c_master_recv(c,&byte,1))
return 0;
return byte;
@@ -273,13 +268,13 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
tun = &tuners[t->type];
if (freq < tun->thresh1) {
config = tun->VHF_L;
- printk("tv: VHF lowrange\n");
+ tuner_dbg("tv: VHF lowrange\n");
} else if (freq < tun->thresh2) {
config = tun->VHF_H;
- printk("tv: VHF high range\n");
+ tuner_dbg("tv: VHF high range\n");
} else {
config = tun->UHF;
- printk("tv: UHF range\n");
+ tuner_dbg("tv: UHF range\n");
}
@@ -370,11 +365,11 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
buffer[2] = tun->config;
buffer[3] = config;
}
- printk("tuner: tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
- buffer[0],buffer[1],buffer[2],buffer[3]);
+ tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ buffer[0],buffer[1],buffer[2],buffer[3]);
if (4 != (rc = i2c_master_send(c,buffer,4)))
- printk("tuner: i2c i/o error: rc == %d (should be 4)\n",rc);
+ tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
if (t->type == TUNER_MICROTUNE_4042FI5) {
// FIXME - this may also work for other tuners
@@ -386,7 +381,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
if (time_after(jiffies,timeout))
return;
if (1 != (rc = i2c_master_recv(c,&status_byte,1))) {
- printk("tuner: i2c i/o read error: rc == %d (should be 1)\n",rc);
+ tuner_warn("i2c i/o read error: rc == %d (should be 1)\n",rc);
break;
}
/* bit 6 is PLL locked indicator */
@@ -401,11 +396,11 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
buffer[1] = div & 0xff;
buffer[2] = tun->config;
buffer[3] = config;
- printk("tuner: tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
buffer[0],buffer[1],buffer[2],buffer[3]);
if (4 != (rc = i2c_master_send(c,buffer,4)))
- printk("tuner: i2c i/o error: rc == %d (should be 4)\n",rc);
+ tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
}
}
@@ -441,19 +436,19 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff;
- printk("tuner: radio 0x%02x 0x%02x 0x%02x 0x%02x\n",
+ tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n",
buffer[0],buffer[1],buffer[2],buffer[3]);
if (4 != (rc = i2c_master_send(c,buffer,4)))
- printk("tuner: i2c i/o error: rc == %d (should be 4)\n",rc);
+ tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
}
int default_tuner_init(struct i2c_client *c)
{
struct tuner *t = i2c_get_clientdata(c);
- printk("tuner: type set to %d (%s)\n",
- t->type, tuners[t->type].name);
+ tuner_info("type set to %d (%s)\n",
+ t->type, tuners[t->type].name);
strlcpy(c->name, tuners[t->type].name, sizeof(c->name));
t->tv_freq = default_set_tv_freq;