diff options
author | Gerd Knorr <devnull@localhost> | 2004-04-21 08:48:39 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2004-04-21 08:48:39 +0000 |
commit | ce363dd37d15127240399cb4ba3fd3a581ef73ee (patch) | |
tree | a1cec1fd0ebc4043050cc82175a5599d051b5681 /linux/drivers/media/video | |
parent | 293b5af7d5f78c01617ad8b2eb83c903b98fed61 (diff) | |
download | mediapointer-dvb-s2-ce363dd37d15127240399cb4ba3fd3a581ef73ee.tar.gz mediapointer-dvb-s2-ce363dd37d15127240399cb4ba3fd3a581ef73ee.tar.bz2 |
- saa7134: new card entry (by m8923014@msg.ndhu.edu.tw).
- ir-kbd-i2c: new remote (also m8923014@msg.ndhu.edu.tw).
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-tvaudio.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/video/ir-kbd-i2c.c | 124 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-cards.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-core.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-input.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/tda9887.c | 10 |
8 files changed, 166 insertions, 34 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c index 3dfb9c9a2..25d83e754 100644 --- a/linux/drivers/media/video/cx88/cx88-tvaudio.c +++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c @@ -48,6 +48,7 @@ #include <linux/interrupt.h> #include <linux/vmalloc.h> #include <linux/init.h> +#include <linux/smp_lock.h> #include "cx88.h" @@ -244,10 +245,17 @@ static void set_audio_standard_BTSC(struct cx8800_dev *dev, unsigned int sap) // dscaler: exactly taken from driver, // dscaler: don't know why to set EN_FMRADIO_EN_RDS - dprintk("%s (status: known-good)\n",__FUNCTION__); - set_audio_start(dev, 0x0001, - EN_FMRADIO_EN_RDS | EN_BTSC_AUTO_STEREO); - set_audio_registers(dev, btsc); + if (sap) { + dprintk("%s SAP (status: unknown)\n",__FUNCTION__); + set_audio_start(dev, 0x0001, + EN_FMRADIO_EN_RDS | EN_BTSC_FORCE_SAP); + set_audio_registers(dev, btsc_sap); + } else { + dprintk("%s (status: known-good)\n",__FUNCTION__); + set_audio_start(dev, 0x0001, + EN_FMRADIO_EN_RDS | EN_BTSC_AUTO_STEREO); + set_audio_registers(dev, btsc); + } set_audio_finish(dev); } diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c index b71f04931..8c734c1ac 100644 --- a/linux/drivers/media/video/ir-kbd-i2c.c +++ b/linux/drivers/media/video/ir-kbd-i2c.c @@ -79,6 +79,55 @@ static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = { [ 20 ] = KEY_KPEQUAL, // SYNC }; +static IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = { + [ 0x3 ] = KEY_POWER, + [ 0x2f ] = KEY_MUTE, + [ 0x10 ] = KEY_BACKSPACE, // Recall + + [ 0x11 ] = KEY_KP0, + [ 0x4 ] = KEY_KP1, + [ 0x5 ] = KEY_KP2, + [ 0x6 ] = KEY_KP3, + [ 0x8 ] = KEY_KP4, + [ 0x9 ] = KEY_KP5, + [ 0xa ] = KEY_KP6, + [ 0xc ] = KEY_KP7, + [ 0xd ] = KEY_KP8, + [ 0xe ] = KEY_KP9, + [ 0x12 ] = KEY_KPDOT, // 100+ + + [ 0x7 ] = KEY_VOLUMEUP, + [ 0xb ] = KEY_VOLUMEDOWN, + [ 0x1a ] = KEY_KPPLUS, + [ 0x18 ] = KEY_KPMINUS, + [ 0x15 ] = KEY_UP, + [ 0x1d ] = KEY_DOWN, + [ 0xf ] = KEY_CHANNELUP, + [ 0x13 ] = KEY_CHANNELDOWN, + [ 0x28 ] = KEY_ZOOM, + + [ 0x1b ] = KEY_VIDEO, // Video source +#if 0 + [ 0x1f ] = KEY_S, // Snapshot +#endif + [ 0x29 ] = KEY_LANGUAGE, // MTS Select + [ 0x19 ] = KEY_SEARCH, // Auto Scan + + [ 0x2b ] = KEY_RECORD, + [ 0x26 ] = KEY_PLAY, + [ 0x25 ] = KEY_PAUSE, // Pause + [ 0x24 ] = KEY_STOP, +#if 0 + [ 0x23 ] = KEY_T, // Time Shift + [ 0x27 ] = KEY_Y, // Time Shift OFF + [ 0x2a ] = KEY_O, // TOP + [ 0x17 ] = KEY_F, // SURF CH +#endif + [ 0x20 ] = KEY_FORWARD, // Forward ? + [ 0x22 ] = KEY_REWIND, // Backward ? + +}; + struct IR; struct IR { struct i2c_client c; @@ -202,11 +251,36 @@ static int get_key_knc1(struct IR *ir, u32 *ir_key, u32 *ir_raw) return 1; } +static int get_key_purpletv(struct IR *ir, u32 *ir_key, u32 *ir_raw) +{ + unsigned char b; + + /* poll IR chip */ + if (1 != i2c_master_recv(&ir->c,&b,1)) { + dprintk(1,"read error\n"); + return -EIO; + } + + /* no button press */ + if (b==0) + return 0; + + /* repeating */ + if (b & 0x80) + return 1; + + /* save some mem space */ + if(b & 0x60) /* 0x6f -> 0x2f 0x40~0x4b->0x20~0x2b */ + b = (b|0x20) & 0x2f; + *ir_key = b; + *ir_raw = b; + return 1; +} /* ----------------------------------------------------------------------- */ static void ir_key_poll(struct IR *ir) { - u32 ir_key, ir_raw; + static u32 ir_key, ir_raw; int rc; dprintk(2,"ir_poll_key\n"); @@ -300,6 +374,12 @@ static int ir_attach(struct i2c_adapter *adap, int addr, ir_type = IR_TYPE_OTHER; ir_codes = ir_codes_empty; break; + case 0x7a: + name = "Purple TV"; + ir->get_key = get_key_purpletv; + ir_type = IR_TYPE_OTHER; + ir_codes = ir_codes_purpletv; + break; default: /* shouldn't happen */ printk(DEVNAME ": Huh? unknown i2c address (0x%02x)?\n",addr); @@ -320,7 +400,8 @@ static int ir_attach(struct i2c_adapter *adap, int addr, ir->input.name = ir->c.name; ir->input.phys = ir->phys; input_register_device(&ir->input); - printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys); + printk(DEVNAME ": %s detected at %s [%s]\n", + ir->input.name,ir->input.phys,adap->name); /* start polling via eventd */ INIT_WORK(&ir->work, ir_work, ir); @@ -361,22 +442,33 @@ static int ir_probe(struct i2c_adapter *adap) That's why we probe 0x1a (~0x34) first. CB */ - static const int probe[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1}; + static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1}; + static const int probe_saa7134[] = { 0x7a, -1}; + const int *probe = NULL; struct i2c_client c; char buf; int i,rc; - if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) { - memset(&c,0,sizeof(c)); - c.adapter = adap; - for (i = 0; -1 != probe[i]; i++) { - c.addr = probe[i]; - rc = i2c_master_recv(&c,&buf,1); - dprintk(1,"probe 0x%02x @ %s: %s\n", - probe[i], adap->name, - (1 == rc) ? "yes" : "no"); - if (1 == rc) { - ir_attach(adap,probe[i],0,0); - break; - } + switch (adap->id) { + case I2C_ALGO_BIT | I2C_HW_B_BT848: + probe = probe_bttv; + break; + case I2C_ALGO_SAA7134: + probe = probe_saa7134; + break; + } + if (NULL == probe) + return 0; + + memset(&c,0,sizeof(c)); + c.adapter = adap; + for (i = 0; -1 != probe[i]; i++) { + c.addr = probe[i]; + rc = i2c_master_recv(&c,&buf,1); + dprintk(1,"probe 0x%02x @ %s: %s\n", + probe[i], adap->name, + (1 == rc) ? "yes" : "no"); + if (1 == rc) { + ir_attach(adap,probe[i],0,0); + break; } } return 0; diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index 726abc175..d3c9e3f79 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -995,6 +995,22 @@ struct saa7134_board saa7134_boards[] = { .amux = LINE1, }, }, + [SAA7133_BOARD_UPMOST_PURPLE_TV] = { + .name = "UPMOST PURPLE TV", + .audio_clock = 0x00187de7, + //.tuner_type = TUNER_PHILIPS_FQ1236_MK3, + .need_tda9887 = 1, + .inputs = {{ + .name = name_tv, + .vmux = 7, + .amux = TV, + .tv = 1, + },{ + .name = name_svideo, + .vmux = 7, + .amux = LINE1, + }}, + }, }; const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); @@ -1184,7 +1200,13 @@ struct pci_device_id saa7134_pci_tbl[] = { .subdevice = 0x4cb5, .driver_data = SAA7134_BOARD_ECS_TVP3XP_4CB5, },{ + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x12ab, + .subdevice = 0x0800, + .driver_data = SAA7133_BOARD_UPMOST_PURPLE_TV, + },{ /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7134, diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 46ddadbc6..1567fc067 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -607,10 +607,18 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) }; if (10 == loop) { print_irqstatus(dev,loop,report,status); - printk(KERN_WARNING "%s/irq: looping -- clearing enable bits\n",dev->name); - /* disable all irqs */ - saa_writel(SAA7134_IRQ1,0); - saa_writel(SAA7134_IRQ2,0); + if (report & SAA7134_IRQ_REPORT_PE) { + /* disable all parity error */ + printk(KERN_WARNING "%s/irq: looping -- " + "clearing PE (parity error!) enable bit\n",dev->name); + saa_clearl(SAA7134_IRQ2,SAA7134_IRQ2_INTE_PE); + } else { + /* disable all irqs */ + printk(KERN_WARNING "%s/irq: looping -- " + "clearing all enable bits\n",dev->name); + saa_writel(SAA7134_IRQ1,0); + saa_writel(SAA7134_IRQ2,0); + } } out: diff --git a/linux/drivers/media/video/saa7134/saa7134-input.c b/linux/drivers/media/video/saa7134/saa7134-input.c index 0ea65cc8b..95a7c5a51 100644 --- a/linux/drivers/media/video/saa7134/saa7134-input.c +++ b/linux/drivers/media/video/saa7134/saa7134-input.c @@ -20,6 +20,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/delay.h> +#include <linux/sched.h> #include <linux/interrupt.h> #include <linux/input.h> diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index f30caa051..024d443d8 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -33,8 +33,8 @@ static unsigned int video_debug = 0; static unsigned int gbuffers = 8; static unsigned int noninterlaced = 0; -static unsigned int gbufsize = 768*576*4; -static unsigned int gbufsize_max = 768*576*4; +static unsigned int gbufsize = 720*576*4; +static unsigned int gbufsize_max = 720*576*4; MODULE_PARM(video_debug,"i"); MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); MODULE_PARM(gbuffers,"i"); @@ -179,9 +179,9 @@ static struct saa7134_tvnorm tvnorms[] = { .vgate_misc = 0x18, .h_start = 0, - .h_stop = 719, + .h_stop = 703, .video_v_start = 22, - .video_v_stop = 22+240, + .video_v_stop = 22+239, .vbi_v_start = 10, /* FIXME */ .vbi_v_stop = 21, /* FIXME */ .src_timing = 1, @@ -1194,7 +1194,7 @@ static int video_open(struct inode *inode, struct file *file) fh->radio = radio; fh->type = type; fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); - fh->width = 768; + fh->width = 720; fh->height = 576; #ifdef VIDIOC_G_PRIORITY v4l2_prio_open(&dev->prio,&fh->prio); diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index f88e56add..e4fa8713b 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -182,6 +182,7 @@ struct saa7134_format { #define SAA7134_BOARD_AVERMEDIA_DVD_EZMAKER 33 #define SAA7134_BOARD_NOVAC_PRIMETV7133 34 #define SAA7134_BOARD_AVERMEDIA_305 35 +#define SAA7133_BOARD_UPMOST_PURPLE_TV 36 #define SAA7134_INPUT_MAX 8 diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index b543de305..4385c2ee2 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -433,19 +433,19 @@ static int tda9887_fixup_std(struct tda9887 *t) case 'B': case 'g': case 'G': - dprintk("insmod fixup: PAL => PAL-BG\n"); + dprintk(PREFIX "insmod fixup: PAL => PAL-BG\n"); t->std = V4L2_STD_PAL_BG; break; case 'i': case 'I': - dprintk("insmod fixup: PAL => PAL-I\n"); + dprintk(PREFIX "insmod fixup: PAL => PAL-I\n"); t->std = V4L2_STD_PAL_I; break; case 'd': case 'D': case 'k': case 'K': - dprintk("insmod fixup: PAL => PAL-DK\n"); + dprintk(PREFIX "insmod fixup: PAL => PAL-DK\n"); t->std = V4L2_STD_PAL_DK; break; } @@ -456,12 +456,12 @@ static int tda9887_fixup_std(struct tda9887 *t) case 'D': case 'k': case 'K': - dprintk("insmod fixup: SECAM => SECAM-DK\n"); + dprintk(PREFIX "insmod fixup: SECAM => SECAM-DK\n"); t->std = V4L2_STD_SECAM_DK; break; case 'l': case 'L': - dprintk("insmod fixup: SECAM => SECAM-L\n"); + dprintk(PREFIX "insmod fixup: SECAM => SECAM-L\n"); t->std = V4L2_STD_SECAM_L; break; } |