Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 42655 Details for
Bug 69061
Requesting tuner patch be applied to gentoo-dev-sources-2.6.9
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
i2c-tuner
i2c-tuner (text/plain), 8.15 KB, created by
Miles Lubin
on 2004-10-26 18:28:44 UTC
(
hide
)
Description:
i2c-tuner
Filename:
MIME Type:
Creator:
Miles Lubin
Created:
2004-10-26 18:28:44 UTC
Size:
8.15 KB
patch
obsolete
>31_tuner >Index: linux-2.6.9-rc4/drivers/media/video/tda9887.c >=================================================================== >--- linux-2.6.9-rc4.orig/drivers/media/video/tda9887.c 2004-10-11 13:45:58.000000000 +0200 >+++ linux-2.6.9-rc4/drivers/media/video/tda9887.c 2004-10-12 16:39:44.721214013 +0200 >@@ -6,6 +6,7 @@ > #include <linux/init.h> > #include <linux/errno.h> > #include <linux/slab.h> >+#include <linux/delay.h> > > #include <media/audiochip.h> > #include <media/tuner.h> >@@ -393,7 +394,7 @@ static int tda9887_set_insmod(struct tda > else > buf[1] &= ~cQSS; > } >- >+ > if (adjust >= 0x00 && adjust < 0x20) > buf[2] |= adjust; > return 0; >@@ -513,7 +514,7 @@ static int tda9887_status(struct tda9887 > { > unsigned char buf[1]; > int rc; >- >+ > memset(buf,0,sizeof(buf)); > if (1 != (rc = i2c_master_recv(&t->client,buf,1))) > printk(PREFIX "i2c i/o error: rc == %d (should be 1)\n",rc); >@@ -534,6 +535,11 @@ static int tda9887_configure(struct tda9 > tda9887_set_config(t,buf); > tda9887_set_insmod(t,buf); > >+ if (t->std & V4L2_STD_SECAM_L) { >+ /* secam fixup (FIXME: move this to tvnorms array?) */ >+ buf[1] &= ~cOutputPort2Inactive; >+ } >+ > dprintk(PREFIX "writing: b=0x%02x c=0x%02x e=0x%02x\n", > buf[1],buf[2],buf[3]); > if (debug > 1) >@@ -543,8 +549,7 @@ static int tda9887_configure(struct tda9 > printk(PREFIX "i2c i/o error: rc == %d (should be 4)\n",rc); > > if (debug > 2) { >- set_current_state(TASK_INTERRUPTIBLE); >- schedule_timeout(HZ); >+ msleep(1000); > tda9887_status(t); > } > return 0; >@@ -565,7 +570,7 @@ static int tda9887_attach(struct i2c_ada > return -ENOMEM; > memset(t,0,sizeof(*t)); > t->client = client_template; >- t->std = 0;; >+ t->std = 0; > t->pinnacle_id = UNSET; > i2c_set_clientdata(&t->client, t); > i2c_attach_client(&t->client); >@@ -712,6 +717,22 @@ tda9887_command(struct i2c_client *clien > return 0; > } > >+static int tda9887_suspend(struct device * dev, u32 state, u32 level) >+{ >+ dprintk("tda9887: suspend\n"); >+ return 0; >+} >+ >+static int tda9887_resume(struct device * dev, u32 level) >+{ >+ struct i2c_client *c = container_of(dev, struct i2c_client, dev); >+ struct tda9887 *t = i2c_get_clientdata(c); >+ >+ dprintk("tda9887: resume\n"); >+ tda9887_configure(t); >+ return 0; >+} >+ > /* ----------------------------------------------------------------------- */ > > static struct i2c_driver driver = { >@@ -722,6 +743,10 @@ static struct i2c_driver driver = { > .attach_adapter = tda9887_probe, > .detach_client = tda9887_detach, > .command = tda9887_command, >+ .driver = { >+ .suspend = tda9887_suspend, >+ .resume = tda9887_resume, >+ }, > }; > static struct i2c_client client_template = > { >Index: linux-2.6.9-rc4/drivers/media/video/tuner.c >=================================================================== >--- linux-2.6.9-rc4.orig/drivers/media/video/tuner.c 2004-10-11 13:44:53.000000000 +0200 >+++ linux-2.6.9-rc4/drivers/media/video/tuner.c 2004-10-12 16:39:44.721214013 +0200 >@@ -129,7 +129,8 @@ struct tunertype > unsigned char config; > unsigned short IFPCoff; /* 622.4=16*38.90 MHz PAL, > 732 =16*45.75 NTSCi, >- 940 =58.75 NTSC-Japan */ >+ 940 =16*58.75 NTSC-Japan >+ 704 =16*44 ATSC */ > }; > > /* >@@ -244,10 +245,14 @@ static struct tunertype tuners[] = { > { "Panasonic VP27s/ENGE4324D", Panasonic, NTSC, > 16*160.00,16*454.00,0x01,0x02,0x08,0xce,940}, > { "LG NTSC (TAPE series)", LGINNOTEK, NTSC, >- 16*170.00, 16*450.00, 0x01,0x02,0x04,0x8e,732 }, >+ 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,732 }, > > { "Tenna TNF 8831 BGFF)", Philips, PAL, > 16*161.25,16*463.25,0xa0,0x90,0x30,0x8e,623}, >+ { "Microtune 4042 FI5 ATSC/NTSC dual in", Microtune, NTSC, >+ 16*162.00,16*457.00,0xa2,0x94,0x31,0x8e,732}, >+ { "TCL 2002N", TCL, NTSC, >+ 16*172.00,16*448.00,0x01,0x02,0x08,0x8e,732}, > > }; > #define TUNERS ARRAY_SIZE(tuners) >@@ -550,7 +555,7 @@ static void mt2032_set_tv_freq(struct i2 > // NTSC > from = 40750*1000; > to = 46750*1000; >- if2 = 45750*1000; >+ if2 = 45750*1000; > } else { > // PAL > from = 32900*1000; >@@ -854,7 +859,7 @@ static void default_set_tv_freq(struct i > > } else if (t->std & V4L2_STD_PAL_DK) { > config |= TEMIC_SET_PAL_DK; >- >+ > } else if (t->std & V4L2_STD_SECAM_L) { > config |= TEMIC_SET_PAL_L; > >@@ -882,12 +887,16 @@ static void default_set_tv_freq(struct i > /* 0x02 -> NTSC antenna input 1 */ > /* 0x03 -> NTSC antenna input 2 */ > config &= ~0x03; >- if (t->std & V4L2_STD_ATSC) >+ if (!(t->std & V4L2_STD_ATSC)) > config |= 2; > /* FIXME: input */ > break; >- } > >+ case TUNER_MICROTUNE_4042FI5: >+ /* Set the charge pump for fast tuning */ >+ tun->config |= 0x40; >+ break; >+ } > > /* > * Philips FI1216MK2 remark from specification : >@@ -921,6 +930,37 @@ static void default_set_tv_freq(struct i > if (4 != (rc = i2c_master_send(c,buffer,4))) > printk("tuner: 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 >+ unsigned long timeout = jiffies + msecs_to_jiffies(1); >+ u8 status_byte = 0; >+ >+ /* Wait until the PLL locks */ >+ for (;;) { >+ if (time_after(jiffies,timeout)) >+ return; >+ if (1 != (rc = i2c_master_recv(c,&status_byte,1))) { >+ dprintk("tuner: i2c i/o read error: rc == %d (should be 1)\n",rc); >+ break; >+ } >+ /* bit 6 is PLL locked indicator */ >+ if (status_byte & 0x40) >+ break; >+ udelay(10); >+ } >+ >+ /* Set the charge pump for optimized phase noise figure */ >+ tun->config &= ~0x40; >+ buffer[0] = (div>>8) & 0x7f; >+ buffer[1] = div & 0xff; >+ buffer[2] = tun->config; >+ buffer[3] = config; >+ dprintk("tuner: 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))) >+ dprintk("tuner: i2c i/o error: rc == %d (should be 4)\n",rc); >+ } > } > > static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) >@@ -1121,6 +1161,8 @@ static int tuner_attach(struct i2c_adapt > return 0; > } > >+// #include <linux/pci.h> >+ > static int tuner_probe(struct i2c_adapter *adap) > { > if (0 != addr) { >@@ -1292,6 +1334,24 @@ tuner_command(struct i2c_client *client, > return 0; > } > >+static int tuner_suspend(struct device * dev, u32 state, u32 level) >+{ >+ dprintk("tuner: suspend\n"); >+ /* power down ??? */ >+ return 0; >+} >+ >+static int tuner_resume(struct device * dev, u32 level) >+{ >+ struct i2c_client *c = container_of(dev, struct i2c_client, dev); >+ struct tuner *t = i2c_get_clientdata(c); >+ >+ dprintk("tuner: resume\n"); >+ if (t->freq) >+ set_freq(c,t->freq); >+ return 0; >+} >+ > /* ----------------------------------------------------------------------- */ > > static struct i2c_driver driver = { >@@ -1302,6 +1362,10 @@ static struct i2c_driver driver = { > .attach_adapter = tuner_probe, > .detach_client = tuner_detach, > .command = tuner_command, >+ .driver = { >+ .suspend = tuner_suspend, >+ .resume = tuner_resume, >+ }, > }; > static struct i2c_client client_template = > { >Index: linux-2.6.9-rc4/include/media/tuner.h >=================================================================== >--- linux-2.6.9-rc4.orig/include/media/tuner.h 2004-10-11 13:44:29.000000000 +0200 >+++ linux-2.6.9-rc4/include/media/tuner.h 2004-10-12 16:39:37.963485194 +0200 >@@ -1,3 +1,4 @@ >+ > /* > tuner.h - definition for different tuners > >@@ -69,9 +70,12 @@ > #define TUNER_PHILIPS_ATSC 42 > #define TUNER_PHILIPS_FM1236_MK3 43 > #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ >+/* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ > #define TUNER_MICROTUNE_4049FM5 45 > #define TUNER_LG_NTSC_TAPE 47 > #define TUNER_TNF_8831BGFF 48 >+#define TUNER_MICROTUNE_4042FI5 49 /* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */ >+#define TUNER_TCL_2002N 50 > > #define NOTUNER 0 > #define PAL 1 /* PAL_BG */ >@@ -91,6 +95,7 @@ > #define Microtune 8 > #define HITACHI 9 > #define Panasonic 10 >+#define TCL 11 > > #define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */ > #define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 69061
:
42652
| 42655