diff options
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r-- | drivers/media/video/saa7134/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa6752hs.c | 16 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 2 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 91 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-core.c | 158 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 1 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 3 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-i2c.c | 7 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 39 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-oss.c | 40 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-tvaudio.c | 11 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 10 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 10 |
13 files changed, 248 insertions, 142 deletions
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig index 8a5c3e71b37..86671a43e76 100644 --- a/drivers/media/video/saa7134/Kconfig +++ b/drivers/media/video/saa7134/Kconfig @@ -15,7 +15,7 @@ config VIDEO_SAA7134 config VIDEO_SAA7134_ALSA tristate "Philips SAA7134 DMA audio support" depends on VIDEO_SAA7134 && SND - select SND_PCM_OSS + select SND_PCM ---help--- This is a video4linux driver for direct (DMA) audio in Philips SAA713x based TV cards using ALSA diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index a61d24f588f..0e0ba50946e 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -9,7 +9,8 @@ #include <linux/poll.h> #include <linux/i2c.h> #include <linux/types.h> -#include <linux/videodev.h> +#include <linux/videodev2.h> +#include <media/v4l2-common.h> #include <linux/init.h> #include <linux/crc32.h> @@ -509,11 +510,9 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) { struct saa6752hs_state *h; - printk("saa6752hs: chip found @ 0x%x\n", addr<<1); - if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL))) + if (NULL == (h = kzalloc(sizeof(*h), GFP_KERNEL))) return -ENOMEM; - memset(h,0,sizeof(*h)); h->client = client_template; h->params = param_defaults; h->client.adapter = adap; @@ -525,6 +524,8 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, int kind) i2c_set_clientdata(&h->client, h); i2c_attach_client(&h->client); + v4l_info(&h->client,"saa6752hs: chip found @ 0x%x\n", addr<<1); + return 0; } @@ -597,10 +598,10 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c saa6752hs MPEG encoder", + .driver = { + .name = "saa6752hs", + }, .id = I2C_DRIVERID_SAA6752HS, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa6752hs_probe, .detach_client = saa6752hs_detach, .command = saa6752hs_command, @@ -609,7 +610,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "saa6752hs", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index ade05f75fdb..a7a6ab9298a 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c @@ -20,13 +20,13 @@ * */ -#include <sound/driver.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/time.h> #include <linux/wait.h> #include <linux/moduleparam.h> #include <linux/module.h> +#include <sound/driver.h> #include <sound/core.h> #include <sound/control.h> #include <sound/pcm.h> diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 672fb205959..c64718aec9c 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -25,6 +25,7 @@ #include "saa7134-reg.h" #include "saa7134.h" +#include <media/v4l2-common.h> /* commly used strings */ static char name_mute[] = "mute"; @@ -1665,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER, + .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_tv, @@ -2514,6 +2515,7 @@ struct saa7134_board saa7134_boards[] = { .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .mpeg = SAA7134_MPEG_DVB, + .gpiomask = 1 << 21, .inputs = {{ .name = name_tv, .vmux = 1, @@ -2528,6 +2530,11 @@ struct saa7134_board saa7134_boards[] = { .vmux = 8, .amux = LINE1, }}, + .radio = { + .name = name_radio, + .amux = TV, + .gpio = 0x0200000, + }, }, [SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = { .name = "MSI TV@Anywhere plus", @@ -2555,6 +2562,69 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE1, }, }, + [SAA7134_BOARD_CINERGY250PCI] = { + /* remote-control does not work. The signal about a + key press comes in via gpio, but the key code + doesn't. Neither does it have an i2c remote control + interface. */ + .name = "Terratec Cinergy 250 PCI TV", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_PHILIPS_TDA8290, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .gpiomask = 0x80200000, + .inputs = {{ + .name = name_tv, + .vmux = 1, + .amux = TV, + .tv = 1, + },{ + .name = name_svideo, /* NOT tested */ + .vmux = 8, + .amux = LINE1, + }}, + .radio = { + .name = name_radio, + .amux = LINE1, + .gpio = 0x0200000, + }, + }, + [SAA7134_BOARD_FLYDVB_TRIO] = { + /* LifeView LR319 FlyDVB Trio */ + /* Peter Missel <peter.missel@onlinehome.de> */ + .name = "LifeView FlyDVB Trio", + .audio_clock = 0x00200000, + .tuner_type = TUNER_PHILIPS_TDA8290, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .gpiomask = 0x00200000, + .inputs = {{ + .name = name_tv, /* Analog broadcast/cable TV */ + .vmux = 1, + .amux = TV, + .gpio = 0x200000, /* GPIO21=High for TV input */ + .tv = 1, + },{ + .name = name_svideo, /* S-Video signal on S-Video input */ + .vmux = 8, + .amux = LINE2, + },{ + .name = name_comp1, /* Composite signal on S-Video input */ + .vmux = 0, + .amux = LINE2, + },{ + .name = name_comp2, /* Composite input */ + .vmux = 3, + .amux = LINE2, + }}, + .radio = { + .name = name_radio, + .amux = TV, + .gpio = 0x000000, /* GPIO21=Low for FM radio antenna */ + }, + }, }; const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); @@ -2895,6 +2965,12 @@ struct pci_device_id saa7134_pci_tbl[] = { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7133, .subvendor = 0x1421, + .subdevice = 0x0351, /* PCI version, new revision */ + .driver_data = SAA7134_BOARD_ADS_INSTANT_TV, + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x1421, .subdevice = 0x0370, /* cardbus version */ .driver_data = SAA7134_BOARD_ADS_INSTANT_TV, },{ @@ -3002,6 +3078,18 @@ struct pci_device_id saa7134_pci_tbl[] = { .subdevice = 0x6231, .driver_data = SAA7134_BOARD_MSI_TVATANYWHERE_PLUS, },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x153b, + .subdevice = 0x1160, + .driver_data = SAA7134_BOARD_CINERGY250PCI, + },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, /* SAA 7131E */ + .subvendor = 0x5168, + .subdevice = 0x0319, + .driver_data = SAA7134_BOARD_FLYDVB_TRIO, + },{ /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, @@ -3090,6 +3178,7 @@ int saa7134_board_init1(struct saa7134_dev *dev) case SAA7134_BOARD_AVERMEDIA_GO_007_FM: /* case SAA7134_BOARD_SABRENT_SBTTVFM: */ /* not finished yet */ case SAA7134_BOARD_VIDEOMATE_TV_PVR: + case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS: case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII: case SAA7134_BOARD_VIDEOMATE_DVBT_300: case SAA7134_BOARD_VIDEOMATE_DVBT_200: diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 23d8747338e..028904bd94a 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c @@ -31,6 +31,7 @@ #include <linux/sound.h> #include <linux/interrupt.h> #include <linux/delay.h> +#include <linux/mutex.h> #include "saa7134-reg.h" #include "saa7134.h" @@ -84,7 +85,7 @@ MODULE_PARM_DESC(radio_nr, "radio device number"); MODULE_PARM_DESC(tuner, "tuner type"); MODULE_PARM_DESC(card, "card type"); -static DECLARE_MUTEX(devlist_lock); +static DEFINE_MUTEX(devlist_lock); LIST_HEAD(saa7134_devlist); static LIST_HEAD(mops_list); static unsigned int saa7134_devcount; @@ -95,77 +96,6 @@ int (*dmasound_exit)(struct saa7134_dev *dev); #define dprintk(fmt, arg...) if (core_debug) \ printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg) -/* ------------------------------------------------------------------ */ -/* debug help functions */ - -static const char *v4l1_ioctls[] = { - "0", "GCAP", "GCHAN", "SCHAN", "GTUNER", "STUNER", "GPICT", "SPICT", - "CCAPTURE", "GWIN", "SWIN", "GFBUF", "SFBUF", "KEY", "GFREQ", - "SFREQ", "GAUDIO", "SAUDIO", "SYNC", "MCAPTURE", "GMBUF", "GUNIT", - "GCAPTURE", "SCAPTURE", "SPLAYMODE", "SWRITEMODE", "GPLAYINFO", - "SMICROCODE", "GVBIFMT", "SVBIFMT" }; -#define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls) - -static const char *v4l2_ioctls[] = { - "QUERYCAP", "1", "ENUM_PIXFMT", "ENUM_FBUFFMT", "G_FMT", "S_FMT", - "G_COMP", "S_COMP", "REQBUFS", "QUERYBUF", "G_FBUF", "S_FBUF", - "G_WIN", "S_WIN", "PREVIEW", "QBUF", "16", "DQBUF", "STREAMON", - "STREAMOFF", "G_PERF", "G_PARM", "S_PARM", "G_STD", "S_STD", - "ENUMSTD", "ENUMINPUT", "G_CTRL", "S_CTRL", "G_TUNER", "S_TUNER", - "G_FREQ", "S_FREQ", "G_AUDIO", "S_AUDIO", "35", "QUERYCTRL", - "QUERYMENU", "G_INPUT", "S_INPUT", "ENUMCVT", "41", "42", "43", - "44", "45", "G_OUTPUT", "S_OUTPUT", "ENUMOUTPUT", "G_AUDOUT", - "S_AUDOUT", "ENUMFX", "G_EFFECT", "S_EFFECT", "G_MODULATOR", - "S_MODULATOR" -}; -#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) - -static const char *osspcm_ioctls[] = { - "RESET", "SYNC", "SPEED", "STEREO", "GETBLKSIZE", "SETFMT", - "CHANNELS", "?", "POST", "SUBDIVIDE", "SETFRAGMENT", "GETFMTS", - "GETOSPACE", "GETISPACE", "NONBLOCK", "GETCAPS", "GET/SETTRIGGER", - "GETIPTR", "GETOPTR", "MAPINBUF", "MAPOUTBUF", "SETSYNCRO", - "SETDUPLEX", "GETODELAY" -}; -#define OSSPCM_IOCTLS ARRAY_SIZE(v4l2_ioctls) - -void saa7134_print_ioctl(char *name, unsigned int cmd) -{ - char *dir; - - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: dir = "--"; break; - case _IOC_READ: dir = "r-"; break; - case _IOC_WRITE: dir = "-w"; break; - case _IOC_READ | _IOC_WRITE: dir = "rw"; break; - default: dir = "??"; break; - } - switch (_IOC_TYPE(cmd)) { - case 'v': - printk(KERN_DEBUG "%s: ioctl 0x%08x (v4l1, %s, VIDIOC%s)\n", - name, cmd, dir, (_IOC_NR(cmd) < V4L1_IOCTLS) ? - v4l1_ioctls[_IOC_NR(cmd)] : "???"); - break; - case 'V': - printk(KERN_DEBUG "%s: ioctl 0x%08x (v4l2, %s, VIDIOC_%s)\n", - name, cmd, dir, (_IOC_NR(cmd) < V4L2_IOCTLS) ? - v4l2_ioctls[_IOC_NR(cmd)] : "???"); - break; - case 'P': - printk(KERN_DEBUG "%s: ioctl 0x%08x (oss dsp, %s, SNDCTL_DSP_%s)\n", - name, cmd, dir, (_IOC_NR(cmd) < OSSPCM_IOCTLS) ? - osspcm_ioctls[_IOC_NR(cmd)] : "???"); - break; - case 'M': - printk(KERN_DEBUG "%s: ioctl 0x%08x (oss mixer, %s, #%d)\n", - name, cmd, dir, _IOC_NR(cmd)); - break; - default: - printk(KERN_DEBUG "%s: ioctl 0x%08x (???, %s, #%d)\n", - name, cmd, dir, _IOC_NR(cmd)); - } -} - void saa7134_track_gpio(struct saa7134_dev *dev, char *msg) { unsigned long mode,status; @@ -610,11 +540,38 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) card_has_mpeg(dev)) saa7134_irq_ts_done(dev,status); - if ((report & (SAA7134_IRQ_REPORT_GPIO16 | - SAA7134_IRQ_REPORT_GPIO18)) && - dev->remote) - saa7134_input_irq(dev); + if (report & SAA7134_IRQ_REPORT_GPIO16) { + switch (dev->has_remote) { + case SAA7134_REMOTE_GPIO: + if (dev->remote->mask_keydown & 0x10000) { + saa7134_input_irq(dev); + } + break; + + case SAA7134_REMOTE_I2C: + break; /* FIXME: invoke I2C get_key() */ + default: /* GPIO16 not used by IR remote */ + break; + } + } + + if (report & SAA7134_IRQ_REPORT_GPIO18) { + switch (dev->has_remote) { + case SAA7134_REMOTE_GPIO: + if ((dev->remote->mask_keydown & 0x40000) || + (dev->remote->mask_keyup & 0x40000)) { + saa7134_input_irq(dev); + } + break; + + case SAA7134_REMOTE_I2C: + break; /* FIXME: invoke I2C get_key() */ + + default: /* GPIO18 not used by IR remote */ + break; + } + } } if (10 == loop) { @@ -624,13 +581,16 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) printk(KERN_WARNING "%s/irq: looping -- " "clearing PE (parity error!) enable bit\n",dev->name); saa_clearl(SAA7134_IRQ2,SAA7134_IRQ2_INTE_PE); - } else if (report & (SAA7134_IRQ_REPORT_GPIO16 | - SAA7134_IRQ_REPORT_GPIO18)) { - /* disable gpio IRQs */ + } else if (report & SAA7134_IRQ_REPORT_GPIO16) { + /* disable gpio16 IRQ */ printk(KERN_WARNING "%s/irq: looping -- " - "clearing GPIO enable bits\n",dev->name); - saa_clearl(SAA7134_IRQ2, (SAA7134_IRQ2_INTE_GPIO16 | - SAA7134_IRQ2_INTE_GPIO18)); + "clearing GPIO16 enable bit\n",dev->name); + saa_clearl(SAA7134_IRQ2, SAA7134_IRQ2_INTE_GPIO16); + } else if (report & SAA7134_IRQ_REPORT_GPIO18) { + /* disable gpio18 IRQs */ + printk(KERN_WARNING "%s/irq: looping -- " + "clearing GPIO18 enable bit\n",dev->name); + saa_clearl(SAA7134_IRQ2, SAA7134_IRQ2_INTE_GPIO18); } else { /* disable all irqs */ printk(KERN_WARNING "%s/irq: looping -- " @@ -711,10 +671,14 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) SAA7134_IRQ2_INTE_PE | SAA7134_IRQ2_INTE_AR; - if (dev->has_remote == SAA7134_REMOTE_GPIO) - irq2_mask |= (SAA7134_IRQ2_INTE_GPIO18 | - SAA7134_IRQ2_INTE_GPIO18A | - SAA7134_IRQ2_INTE_GPIO16 ); + if (dev->has_remote == SAA7134_REMOTE_GPIO) { + if (dev->remote->mask_keydown & 0x10000) + irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; + else if (dev->remote->mask_keydown & 0x40000) + irq2_mask |= SAA7134_IRQ2_INTE_GPIO18; + else if (dev->remote->mask_keyup & 0x40000) + irq2_mask |= SAA7134_IRQ2_INTE_GPIO18A; + } saa_writel(SAA7134_IRQ1, 0); saa_writel(SAA7134_IRQ2, irq2_mask); @@ -840,10 +804,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, struct saa7134_mpeg_ops *mops; int err; - dev = kmalloc(sizeof(*dev),GFP_KERNEL); + dev = kzalloc(sizeof(*dev),GFP_KERNEL); if (NULL == dev) return -ENOMEM; - memset(dev,0,sizeof(*dev)); /* pci init */ dev->pci = pci_dev; @@ -1007,13 +970,13 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, pci_set_drvdata(pci_dev,dev); saa7134_devcount++; - down(&devlist_lock); + mutex_lock(&devlist_lock); list_for_each(item,&mops_list) { mops = list_entry(item, struct saa7134_mpeg_ops, next); mpeg_ops_attach(mops, dev); } list_add_tail(&dev->devlist,&saa7134_devlist); - up(&devlist_lock); + mutex_unlock(&devlist_lock); /* check for signal */ saa7134_irq_video_intl(dev); @@ -1069,13 +1032,13 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev) saa7134_hwfini(dev); /* unregister */ - down(&devlist_lock); + mutex_lock(&devlist_lock); list_del(&dev->devlist); list_for_each(item,&mops_list) { mops = list_entry(item, struct saa7134_mpeg_ops, next); mpeg_ops_detach(mops, dev); } - up(&devlist_lock); + mutex_unlock(&devlist_lock); saa7134_devcount--; saa7134_i2c_unregister(dev); @@ -1109,13 +1072,13 @@ int saa7134_ts_register(struct saa7134_mpeg_ops *ops) struct list_head *item; struct saa7134_dev *dev; - down(&devlist_lock); + mutex_lock(&devlist_lock); list_for_each(item,&saa7134_devlist) { dev = list_entry(item, struct saa7134_dev, devlist); mpeg_ops_attach(ops, dev); } list_add_tail(&ops->next,&mops_list); - up(&devlist_lock); + mutex_unlock(&devlist_lock); return 0; } @@ -1124,13 +1087,13 @@ void saa7134_ts_unregister(struct saa7134_mpeg_ops *ops) struct list_head *item; struct saa7134_dev *dev; - down(&devlist_lock); + mutex_lock(&devlist_lock); list_del(&ops->next); list_for_each(item,&saa7134_devlist) { dev = list_entry(item, struct saa7134_dev, devlist); mpeg_ops_detach(ops, dev); } - up(&devlist_lock); + mutex_unlock(&devlist_lock); } EXPORT_SYMBOL(saa7134_ts_register); @@ -1156,7 +1119,7 @@ static int saa7134_init(void) printk(KERN_INFO "saa7130/34: snapshot date %04d-%02d-%02d\n", SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100); #endif - return pci_module_init(&saa7134_pci_driver); + return pci_register_driver(&saa7134_pci_driver); } static void saa7134_fini(void) @@ -1173,7 +1136,6 @@ module_exit(saa7134_fini); /* ----------------------------------------------------------- */ -EXPORT_SYMBOL(saa7134_print_ioctl); EXPORT_SYMBOL(saa7134_i2c_call_clients); EXPORT_SYMBOL(saa7134_devlist); EXPORT_SYMBOL(saa7134_boards); diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index e016480c346..399f9952596 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c @@ -31,6 +31,7 @@ #include "saa7134-reg.h" #include "saa7134.h" +#include <media/v4l2-common.h> #ifdef HAVE_MT352 # include "mt352.h" diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 575f3e835f9..bd4c389d4c3 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c @@ -29,6 +29,7 @@ #include "saa7134.h" #include <media/saa6752hs.h> +#include <media/v4l2-common.h> /* ------------------------------------------------------------------ */ @@ -163,7 +164,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, struct saa7134_dev *dev = file->private_data; if (debug > 1) - saa7134_print_ioctl(dev->name,cmd); + v4l_print_ioctl(dev->name,cmd); switch (cmd) { case VIDIOC_QUERYCAP: { diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c index df9dd36721e..6162550c413 100644 --- a/drivers/media/video/saa7134/saa7134-i2c.c +++ b/drivers/media/video/saa7134/saa7134-i2c.c @@ -30,6 +30,7 @@ #include "saa7134-reg.h" #include "saa7134.h" +#include <media/v4l2-common.h> /* ----------------------------------------------------------- */ @@ -333,7 +334,7 @@ static int attach_inform(struct i2c_client *client) struct tuner_setup tun_setup; d1printk( "%s i2c attach [addr=0x%x,client=%s]\n", - client->driver->name, client->addr, client->name); + client->driver->driver.name, client->addr, client->name); /* Am I an i2c remote control? */ @@ -343,7 +344,7 @@ static int attach_inform(struct i2c_client *client) { struct IR_i2c *ir = i2c_get_clientdata(client); d1printk("%s i2c IR detected (%s).\n", - client->driver->name,ir->phys); + client->driver->driver.name, ir->phys); saa7134_set_i2c_ir(dev,ir); break; } @@ -390,9 +391,7 @@ static struct i2c_algorithm saa7134_algo = { static struct i2c_adapter saa7134_adap_template = { .owner = THIS_MODULE, -#ifdef I2C_CLASS_TV_ANALOG .class = I2C_CLASS_TV_ANALOG, -#endif .name = "saa7134", .id = I2C_HW_SAA7134, .algo = &saa7134_algo, diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index ab75ca5ac35..82d28cbf289 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c @@ -56,23 +56,23 @@ static IR_KEYTAB_TYPE flyvideo_codes[IR_KEYTAB_SIZE] = { [ 12 ] = KEY_KP8, [ 13 ] = KEY_KP9, - [ 14 ] = KEY_TUNER, // Air/Cable + [ 14 ] = KEY_MODE, // Air/Cable [ 17 ] = KEY_VIDEO, // Video [ 21 ] = KEY_AUDIO, // Audio - [ 0 ] = KEY_POWER, // Pover + [ 0 ] = KEY_POWER, // Power + [ 24 ] = KEY_TUNER, // AV Source [ 2 ] = KEY_ZOOM, // Fullscreen + [ 26 ] = KEY_LANGUAGE, // Stereo [ 27 ] = KEY_MUTE, // Mute - [ 20 ] = KEY_VOLUMEUP, - [ 23 ] = KEY_VOLUMEDOWN, + [ 20 ] = KEY_VOLUMEUP, // Volume + + [ 23 ] = KEY_VOLUMEDOWN, // Volume - [ 18 ] = KEY_CHANNELUP, // Channel + [ 19 ] = KEY_CHANNELDOWN, // Channel - - [ 6 ] = KEY_AGAIN, // Recal - [ 16 ] = KEY_KPENTER, // Enter - - [ 26 ] = KEY_F22, // Stereo - [ 24 ] = KEY_EDIT, // AV Source + [ 6 ] = KEY_AGAIN, // Recall + [ 16 ] = KEY_ENTER, // Enter }; + static IR_KEYTAB_TYPE cinergy_codes[IR_KEYTAB_SIZE] = { [ 0 ] = KEY_KP0, [ 1 ] = KEY_KP1, @@ -543,12 +543,22 @@ static int build_key(struct saa7134_dev *dev) dprintk("build_key gpio=0x%x mask=0x%x data=%d\n", gpio, ir->mask_keycode, data); - if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || - (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { - ir_input_keydown(ir->dev, &ir->ir, data, data); - } else { - ir_input_nokey(ir->dev, &ir->ir); + if (ir->polling) { + if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || + (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { + ir_input_keydown(ir->dev, &ir->ir, data, data); + } else { + ir_input_nokey(ir->dev, &ir->ir); + } + } + else { /* IRQ driven mode - handle key press and release in one go */ + if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || + (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { + ir_input_keydown(ir->dev, &ir->ir, data, data); + ir_input_nokey(ir->dev, &ir->ir); + } } + return 0; } @@ -686,6 +696,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) polling = 50; // ms break; case SAA7134_BOARD_VIDEOMATE_TV_PVR: + case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS: case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII: ir_codes = videomate_tv_pvr_codes; mask_keycode = 0x00003F; diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c index 8badd2a9cb2..7448e386a80 100644 --- a/drivers/media/video/saa7134/saa7134-oss.c +++ b/drivers/media/video/saa7134/saa7134-oss.c @@ -373,6 +373,42 @@ static ssize_t dsp_write(struct file *file, const char __user *buffer, return -EINVAL; } +static const char *osspcm_ioctls[] = { + "RESET", "SYNC", "SPEED", "STEREO", "GETBLKSIZE", "SETFMT", + "CHANNELS", "?", "POST", "SUBDIVIDE", "SETFRAGMENT", "GETFMTS", + "GETOSPACE", "GETISPACE", "NONBLOCK", "GETCAPS", "GET/SETTRIGGER", + "GETIPTR", "GETOPTR", "MAPINBUF", "MAPOUTBUF", "SETSYNCRO", + "SETDUPLEX", "GETODELAY" +}; +#define OSSPCM_IOCTLS ARRAY_SIZE(osspcm_ioctls) + +static void saa7134_oss_print_ioctl(char *name, unsigned int cmd) +{ + char *dir; + + switch (_IOC_DIR(cmd)) { + case _IOC_NONE: dir = "--"; break; + case _IOC_READ: dir = "r-"; break; + case _IOC_WRITE: dir = "-w"; break; + case _IOC_READ | _IOC_WRITE: dir = "rw"; break; + default: dir = "??"; break; + } + switch (_IOC_TYPE(cmd)) { + case 'P': + printk(KERN_DEBUG "%s: ioctl 0x%08x (oss dsp, %s, SNDCTL_DSP_%s)\n", + name, cmd, dir, (_IOC_NR(cmd) < OSSPCM_IOCTLS) ? + osspcm_ioctls[_IOC_NR(cmd)] : "???"); + break; + case 'M': + printk(KERN_DEBUG "%s: ioctl 0x%08x (oss mixer, %s, #%d)\n", + name, cmd, dir, _IOC_NR(cmd)); + break; + default: + printk(KERN_DEBUG "%s: ioctl 0x%08x (???, %s, #%d)\n", + name, cmd, dir, _IOC_NR(cmd)); + } +} + static int dsp_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -382,7 +418,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file, int val = 0; if (debug > 1) - saa7134_print_ioctl(dev->name,cmd); + saa7134_oss_print_ioctl(dev->name,cmd); switch (cmd) { case OSS_GETVERSION: return put_user(SOUND_VERSION, p); @@ -678,7 +714,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, int __user *p = argp; if (debug > 1) - saa7134_print_ioctl(dev->name,cmd); + saa7134_oss_print_ioctl(dev->name,cmd); switch (cmd) { case OSS_GETVERSION: return put_user(SOUND_VERSION, p); diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c index 93268427750..afa4dcb3f96 100644 --- a/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -180,8 +180,8 @@ static void tvaudio_init(struct saa7134_dev *dev) saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff); saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff); saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff); - // frame locked audio was reported not to be reliable - saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x02); + /* frame locked audio is mandatory for NICAM */ + saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x01); saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14); saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50); @@ -809,7 +809,12 @@ static int tvaudio_thread_ddep(void *data) dprintk("ddep override: %s\n",stdres[audio_ddep]); } else if (&card(dev).radio == dev->input) { dprintk("FM Radio\n"); - norms = (0x0f << 2) | 0x01; + if (dev->tuner_type == TUNER_PHILIPS_TDA8290) { + norms = (0x11 << 2) | 0x01; + saa_dsp_writel(dev, 0x42c >> 2, 0x729555); + } else { + norms = (0x0f << 2) | 0x01; + } } else { /* (let chip) scan for sound carrier */ norms = 0; diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 45c852df13e..e97426bc85d 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c @@ -29,6 +29,7 @@ #include "saa7134-reg.h" #include "saa7134.h" +#include <media/v4l2-common.h> /* Include V4L1 specific functions. Should be removed soon */ #include <linux/videodev.h> @@ -1263,10 +1264,9 @@ static int video_open(struct inode *inode, struct file *file) v4l2_type_names[type]); /* allocate + initialize per filehandle data */ - fh = kmalloc(sizeof(*fh),GFP_KERNEL); + fh = kzalloc(sizeof(*fh),GFP_KERNEL); if (NULL == fh) return -ENOMEM; - memset(fh,0,sizeof(*fh)); file->private_data = fh; fh->dev = dev; fh->radio = radio; @@ -1689,7 +1689,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, int err; if (video_debug > 1) - saa7134_print_ioctl(dev->name,cmd); + v4l_print_ioctl(dev->name,cmd); switch (cmd) { case VIDIOC_S_CTRL: @@ -2142,7 +2142,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, struct saa7134_dev *dev = fh->dev; if (video_debug > 1) - saa7134_print_ioctl(dev->name,cmd); + v4l_print_ioctl(dev->name,cmd); switch (cmd) { case VIDIOC_QUERYCAP: { @@ -2262,6 +2262,7 @@ static struct file_operations video_fops = .poll = video_poll, .mmap = video_mmap, .ioctl = video_ioctl, + .compat_ioctl = v4l_compat_ioctl32, .llseek = no_llseek, }; @@ -2271,6 +2272,7 @@ static struct file_operations radio_fops = .open = video_open, .release = video_release, .ioctl = radio_ioctl, + .compat_ioctl = v4l_compat_ioctl32, .llseek = no_llseek, }; diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index add49db1ad4..e70eae8d29b 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h @@ -37,6 +37,9 @@ #include <media/ir-common.h> #include <media/ir-kbd-i2c.h> #include <media/video-buf.h> +#include <sound/driver.h> +#include <sound/core.h> +#include <sound/pcm.h> #include <media/video-buf-dvb.h> #ifndef TRUE @@ -47,10 +50,6 @@ #endif #define UNSET (-1U) -#include <sound/driver.h> -#include <sound/core.h> -#include <sound/pcm.h> - /* ----------------------------------------------------------- */ /* enums */ @@ -209,6 +208,8 @@ struct saa7134_format { #define SAA7134_BOARD_ASUSTEK_DIGIMATRIX_TV 80 #define SAA7134_BOARD_PHILIPS_TIGER 81 #define SAA7134_BOARD_MSI_TVATANYWHERE_PLUS 82 +#define SAA7134_BOARD_CINERGY250PCI 83 +#define SAA7134_BOARD_FLYDVB_TRIO 84 #define SAA7134_MAXBOARDS 8 #define SAA7134_INPUT_MAX 8 @@ -546,7 +547,6 @@ struct saa7134_dev { extern struct list_head saa7134_devlist; -void saa7134_print_ioctl(char *name, unsigned int cmd); void saa7134_track_gpio(struct saa7134_dev *dev, char *msg); #define SAA7134_PGTABLE_SIZE 4096 |