V4L/DVB updates
Subsystems (3)
cover V4L/DVB updates
This patch series is also available under v4l-dvb.git tree at:
kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Linus, please push these from master branch.
It contains the following stuff:
- Remove old MODULE_PARM in media/video/
- bttv semaphore to mutex conversion
- removed uneeded init on structs like static int foo=0
- Include missing MODULE_* macros
- Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected.
- Updated MODULE_AUTHOR
- Redesign tuners struct for maximum flexibility
- Add support for Samsung tuner TCPN 2121P30A
- disable all dvb tuner param_types until we need them
- i2c ids for upd64031a saa717x upd64083 wm8739
- Turn frame locked sound on, basic support for FM radio with TDA8275(a)
- git dvb callbacks fix
- cx88 Kconfig fixes for cx88-alsa
- make some code static
- Fix for lack of analog output on some cx88 boards
- Semaphore to mutex conversion on drivers/media
- Fix compilation with Alpha
- Move tda988x options into tuner_params struct.
- Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.
- Return -EINVAL for unknown commands in msp3400 module.
- fix some sound quality & distortion problems.
- clean up some comments
- tuner_params->tda988x is currently unused, so disable
- Samsung TBMV30111IN has 6 entries
- Added remote control support for pinnacle pctv
Cheers,
Mauro
---
Documentation/video4linux/CARDLIST.tuner | 1 drivers/media/dvb/bt8xx/bt878.c | 2 drivers/media/dvb/dvb-core/dvbdev.c | 22 drivers/media/dvb/dvb-usb/cxusb.c | 2 drivers/media/dvb/frontends/dvb-pll.c | 2 drivers/media/dvb/ttpci/av7110.c | 4 drivers/media/dvb/ttpci/av7110_hw.c | 40 drivers/media/dvb/ttpci/av7110_hw.h | 12 drivers/media/video/Makefile | 3 drivers/media/video/arv.c | 6 drivers/media/video/bt832.c | 2 drivers/media/video/btcx-risc.c | 2 drivers/media/video/bttv-cards.c | 6 drivers/media/video/bttv-driver.c | 87 - drivers/media/video/bttv-i2c.c | 6 drivers/media/video/bttvp.h | 5 drivers/media/video/cx25840/cx25840-core.c | 4 drivers/media/video/cx88/Kconfig | 3 drivers/media/video/cx88/Makefile | 1 drivers/media/video/cx88/cx88-alsa.c | 9 drivers/media/video/cx88/cx88-core.c | 15 drivers/media/video/cx88/cx88-tvaudio.c | 8 drivers/media/video/cx88/cx88-vp3054-i2c.c | 4 drivers/media/video/em28xx/em28xx-input.c | 77 drivers/media/video/em28xx/em28xx-video.c | 7 drivers/media/video/msp3400-driver.c | 14 drivers/media/video/msp3400.h | 8 drivers/media/video/mt20xx.c | 12 drivers/media/video/planb.c | 4 drivers/media/video/saa6588.c | 10 drivers/media/video/saa711x.c | 2 drivers/media/video/saa7134/saa7134-cards.c | 6 drivers/media/video/saa7134/saa7134-core.c | 21 drivers/media/video/saa7134/saa7134-tvaudio.c | 11 drivers/media/video/tda8290.c | 4 drivers/media/video/tea5767.c | 18 drivers/media/video/tuner-core.c | 85 - drivers/media/video/tuner-simple.c | 794 ---------- drivers/media/video/tuner-types.c | 1406 ++++++++++++++++++ drivers/media/video/tveeprom.c | 2 drivers/media/video/tvp5150.c | 2 drivers/media/video/v4l2-common.c | 1 drivers/media/video/videodev.c | 25 include/linux/i2c-id.h | 4 include/media/tuner-types.h | 73 include/media/tuner.h | 10 include/media/v4l2-common.h | 7 47 files changed, 1870 insertions(+), 979 deletions(-)
PATCH 1/25 Remove old MODULE_PARM in media/video/
From: Eric Sesterhenn / snakebyte <[email protected]>
Changes MODULE_PARM usage to module_param
---
drivers/media/video/arv.c | 6 +++--- drivers/media/video/planb.c | 4 ++-- drivers/media/video/saa6588.c | 10 +++++----- drivers/media/video/saa711x.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
drivers/media/video/arv.c +3 -3
@@ -129,9 +129,9 @@ static unsigned char yuv[MAX_AR_FRAME_BYstatic int freq =DEFAULT_FREQ ;/* BCLK: available 50 or 70 (MHz) */ static int vga =0 ;/* default mode(0:QVGA mode, other:VGA mode) */ static int vga_interlace =0 ;/* 0 is normal mode for, else interlace mode */ -MODULE_PARM (freq,"i" ); -MODULE_PARM (vga,"i" ); -MODULE_PARM (vga_interlace,"i" ); +module_param (freq, int,0 ); +module_param (vga, int,0 ); +module_param (vga_interlace, int,0 );static int ar_initialize (struct video_device *dev);
drivers/media/video/planb.c +2 -2
@@ -76,9 +76,9 @@ static volatile struct planb_registers *static int def_norm =PLANB_DEF_NORM ;/* default norm */ static int video_nr =-1 ; -MODULE_PARM (def_norm,"i" ); +module_param (def_norm, int,0 );MODULE_PARM_DESC (def_norm,"Default startup norm (0=PAL, 1=NTSC, 2=SECAM)" ); -MODULE_PARM (video_nr,"i" ); +module_param (video_nr, int,0 );MODULE_LICENSE ("GPL" );
drivers/media/video/saa6588.c +5 -5
@@ -50,15 +50,15 @@ static unsigned int rbds = 0;static unsigned int plvl =0 ;static unsigned int bufblocks =100 ; -MODULE_PARM (debug,"i" ); +module_param (debug, int,0644 );MODULE_PARM_DESC (debug,"enable debug messages" ); -MODULE_PARM (xtal,"i" ); +module_param (xtal, int,0 );MODULE_PARM_DESC (xtal,"select oscillator frequency (0..3), default 0" ); -MODULE_PARM (rbds,"i" ); +module_param (rbds, int,0 );MODULE_PARM_DESC (rbds,"select mode, 0=RDS, 1=RBDS, default 0" ); -MODULE_PARM (plvl,"i" ); +module_param (plvl, int,0 );MODULE_PARM_DESC (plvl,"select pause level (0..3), default 0" ); -MODULE_PARM (bufblocks,"i" ); +module_param (bufblocks, int,0 );MODULE_PARM_DESC (bufblocks,"number of buffered blocks, default 100" );MODULE_DESCRIPTION ("v4l2 driver module for SAA6588 RDS decoder" );
drivers/media/video/saa711x.c +1 -1
@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL");#include <linux/video_decoder.h> static int debug =0 ; -MODULE_PARM (debug,"i" ); +module_param (debug, int,0644 );MODULE_PARM_DESC (debug," Set the default Debug level. Default: 0 (Off) - (0-1)" );
PATCH 2/25 bttv semaphore to mutex conversion
In reply to [email protected]From: Ingo Molnar <[email protected]>
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated automatically via a script as well.
build-tested.
---
drivers/media/video/bttv-driver.c | 60 +++++++++++++++++++------------------ drivers/media/video/bttvp.h | 5 ++- 2 files changed, 33 insertions(+), 32 deletions(-)
drivers/media/video/bttv-driver.c +30 -30
@@ -684,16 +684,16 @@ int check_alloc_btres(struct bttv *btv,return 1 ;/* is it free? */ -down (&btv->reslock); +mutex_lock (&btv->reslock);if (btv->resources & bit) {/* no, someone else uses it */ -up (&btv->reslock); +mutex_unlock (&btv->reslock);return 0 ; }/* it's free, grab it */ fh->resources |= bit; btv->resources |= bit; -up (&btv->reslock); +mutex_unlock (&btv->reslock);return 1 ; }
@@ -716,10 +716,10 @@ void free_btres(struct bttv *btv, struct/* trying to free ressources not allocated by us ... */ printk ("bttv: BUG! (btres)\n" ); } -down (&btv->reslock); +mutex_lock (&btv->reslock); fh->resources &= ~bits; btv->resources &= ~bits; -up (&btv->reslock); +mutex_unlock (&btv->reslock); }/* ----------------------------------------------------------------------- */
@@ -1536,12 +1536,12 @@ static int bttv_common_ioctls(struct bttcase VIDIOCSFREQ : {unsigned long *freq = arg; -down (&btv->lock); +mutex_lock (&btv->lock); btv->freq=*freq;bttv_call_i2c_clients (btv,VIDIOCSFREQ ,freq);if (btv->has_matchbox && btv->radio_user)tea5757_set_freq (btv,*freq); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -1571,10 +1571,10 @@ static int bttv_common_ioctls(struct bttif (v->mode >=BTTV_TVNORMS )return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock);set_tvnorm (btv,v->mode);bttv_call_i2c_clients (btv,cmd,v); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -1611,17 +1611,17 @@ static int bttv_common_ioctls(struct bttif (v->norm >=BTTV_TVNORMS )return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock);if (channel == btv->input && v->norm == btv->tvnorm) {/* nothing to do */ -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; } btv->tvnorm = v->norm;set_input (btv,v->channel); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -1634,14 +1634,14 @@ static int bttv_common_ioctls(struct btt v->flags |=VIDEO_AUDIO_MUTABLE ; v->mode =VIDEO_SOUND_MONO ; -down (&btv->lock); +mutex_lock (&btv->lock);bttv_call_i2c_clients (btv,cmd,v);/* card specific hooks */ if (btv->audio_hook) btv->audio_hook (btv,v,0 ); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }case VIDIOCSAUDIO :
@@ -1652,7 +1652,7 @@ static int bttv_common_ioctls(struct bttif (audio >= bttv_tvcards[btv->c.type].audio_inputs)return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock);audio_mux (btv, (v->flags&VIDEO_AUDIO_MUTE ) ?AUDIO_MUTE :AUDIO_UNMUTE );bttv_call_i2c_clients (btv,cmd,v);
@@ -1660,7 +1660,7 @@ static int bttv_common_ioctls(struct bttif (btv->audio_hook) btv->audio_hook (btv,v,1 ); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -1694,10 +1694,10 @@ static int bttv_common_ioctls(struct bttif (i ==BTTV_TVNORMS )return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock);set_tvnorm (btv,i);i2c_vidiocschan (btv); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }case VIDIOC_QUERYSTD :
@@ -1755,9 +1755,9 @@ static int bttv_common_ioctls(struct bttif (*i > bttv_tvcards[btv->c.type].video_inputs)return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock);set_input (btv,*i); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -1769,7 +1769,7 @@ static int bttv_common_ioctls(struct bttreturn -EINVAL ;if (0 != t->index)return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock);memset (t,0 ,sizeof (*t));strcpy (t->name,"Television" ); t->type =V4L2_TUNER_ANALOG_TV ;
@@ -1804,7 +1804,7 @@ static int bttv_common_ioctls(struct btt } }/* FIXME: fill capability+audmode */ -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }case VIDIOC_S_TUNER :
@@ -1815,7 +1815,7 @@ static int bttv_common_ioctls(struct bttreturn -EINVAL ;if (0 != t->index)return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock); {struct video_audio va;memset (&va,0 ,sizeof (struct video_audio ));
@@ -1832,7 +1832,7 @@ static int bttv_common_ioctls(struct bttif (btv->audio_hook) btv->audio_hook (btv,&va,1 ); } -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -1853,12 +1853,12 @@ static int bttv_common_ioctls(struct bttreturn -EINVAL ;if (unlikely (f->type !=V4L2_TUNER_ANALOG_TV ))return -EINVAL ; -down (&btv->lock); +mutex_lock (&btv->lock); btv->freq = f->frequency;bttv_call_i2c_clients (btv,VIDIOCSFREQ ,&btv->freq);if (btv->has_matchbox && btv->radio_user)tea5757_set_freq (btv,btv->freq); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }case VIDIOC_LOG_STATUS :
@@ -3156,7 +3156,7 @@ static int radio_open(struct inode *inodreturn -ENODEV ;dprintk ("bttv%d: open called (radio)\n" ,btv->c.nr); -down (&btv->lock); +mutex_lock (&btv->lock); btv->radio_user++;
@@ -3165,7 +3165,7 @@ static int radio_open(struct inode *inodbttv_call_i2c_clients (btv,AUDC_SET_RADIO ,&btv->tuner_type);audio_mux (btv,AUDIO_RADIO ); -up (&btv->lock); +mutex_unlock (&btv->lock);return 0 ; }
@@ -3920,8 +3920,8 @@ static int __devinit bttv_probe(struct psprintf (btv->c.name,"bttv%d" ,btv->c.nr);/* initialize structs / fill in defaults */ -init_MUTEX (&btv->lock); -init_MUTEX (&btv->reslock); +mutex_init (&btv->lock); +mutex_init (&btv->reslock);spin_lock_init (&btv->s_lock);spin_lock_init (&btv->gpio_lock);init_waitqueue_head (&btv->gpioq);
drivers/media/video/bttvp.h +3 -2
@@ -35,6 +35,7 @@#include <linux/videodev.h> #include <linux/pci.h> #include <linux/input.h> +#include <linux/mutex.h> #include <asm/scatterlist.h> #include <asm/io.h>
@@ -309,9 +310,9 @@ struct bttv {/* locking */ spinlock_t s_lock; -struct semaphore lock; +struct mutex lock;int resources; -struct semaphore reslock; +struct mutex reslock;#ifdef VIDIOC_G_PRIORITY struct v4l2_prio_state prio;#endif
PATCH 3/25 removed uneeded init on structs like static int foo=0
In reply to [email protected]From: Mauro Carvalho Chehab <[email protected]>
- Static vars are equal to zero by default. Removed unnecessary =0 from them, saving some data space
---
drivers/media/dvb/bt8xx/bt878.c | 2 +- drivers/media/dvb/ttpci/av7110.c | 4 ++-- drivers/media/video/bt832.c | 2 +- drivers/media/video/btcx-risc.c | 2 +- drivers/media/video/bttv-cards.c | 6 +++--- drivers/media/video/bttv-driver.c | 27 +++++++++++++-------------- drivers/media/video/bttv-i2c.c | 6 +++--- drivers/media/video/cx25840/cx25840-core.c | 2 +- drivers/media/video/cx88/cx88-alsa.c | 4 ++-- drivers/media/video/msp3400-driver.c | 10 +++++----- drivers/media/video/saa7134/saa7134-core.c | 2 +- 11 files changed, 33 insertions(+), 34 deletions(-)
drivers/media/dvb/bt8xx/bt878.c +1 -1
@@ -542,7 +542,7 @@ static struct pci_driver bt878_pci_drive .remove = bt878_remove, }; -static int bt878_pci_driver_registered =0 ; +static int bt878_pci_driver_registered;/*******************************/ /* Module management functions */
drivers/media/dvb/ttpci/av7110.c +2 -2
@@ -81,7 +81,7 @@ static int adac = DVB_ADAC_TI;static int hw_sections;static int rgb_on;static int volume =255 ; -static int budgetpatch =0 ; +static int budgetpatch;module_param_named (debug, av7110_debug, int,0644 );MODULE_PARM_DESC (debug,"debug level (bitmask, default 0)" );
@@ -103,7 +103,7 @@ MODULE_PARM_DESC(budgetpatch, "use budgestatic void restart_feeds (struct av7110 *av7110); -static int av7110_num =0 ; +static int av7110_num;#define FE_FUNC_OVERRIDE (fe_func, av7110_copy, av7110_func) \ {\
drivers/media/video/bt832.c +1 -1
@@ -43,7 +43,7 @@ static unsigned short normal_i2c[] = { I I2C_CLIENT_END };I2C_CLIENT_INSMOD ; -int debug =0 ;/* debug output */ +int debug;/* debug output */ module_param (debug, int,0644 );/* ---------------------------------------------------------------------- */
drivers/media/video/btcx-risc.c +1 -1
@@ -37,7 +37,7 @@ MODULE_DESCRIPTION("some code shared byMODULE_AUTHOR ("Gerd Knorr" );MODULE_LICENSE ("GPL" ); -static unsigned int debug =0 ; +static unsigned int debug;module_param (debug, int,0644 );MODULE_PARM_DESC (debug,"debug messages, default is 0 (no)" );
drivers/media/video/bttv-cards.c +3 -3
@@ -92,8 +92,8 @@ static void identify_by_eeprom(struct btstatic int __devinit pvr_boot (struct bttv *btv);/* config variables */ -static unsigned int triton1=0 ; -static unsigned int vsfx=0 ; +static unsigned int triton1; +static unsigned int vsfx;static unsigned int latency =UNSET ;int no_overlay=-1 ;
@@ -106,7 +106,7 @@ static struct bttv *master[BTTV_MAX] =#ifdef MODULE static unsigned int autoload =1 ;#else -static unsigned int autoload =0 ; +static unsigned int autoload;#endif static unsigned int gpiomask =UNSET ;static unsigned int audioall =UNSET ;
drivers/media/video/bttv-driver.c +13 -14
@@ -48,47 +48,46 @@unsigned int bttv_num;/* number of Bt848s in use */ struct bttv bttvs[BTTV_MAX ]; -unsigned int bttv_debug =0 ; +unsigned int bttv_debug;unsigned int bttv_verbose =1 ; -unsigned int bttv_gpio =0 ; +unsigned int bttv_gpio;/* config variables */ #ifdef __BIG_ENDIANstatic unsigned int bigendian=1 ;#else -static unsigned int bigendian=0 ; +static unsigned int bigendian;#endif static unsigned int radio[BTTV_MAX ]; -static unsigned int irq_debug =0 ; +static unsigned int irq_debug;static unsigned int gbuffers =8 ;static unsigned int gbufsize =0x208000 ;static int video_nr =-1 ;static int radio_nr =-1 ;static int vbi_nr =-1 ; -static int debug_latency =0 ; +static int debug_latency; -static unsigned int fdsr =0 ; +static unsigned int fdsr;/* options */ -static unsigned int combfilter =0 ; -static unsigned int lumafilter =0 ; +static unsigned int combfilter; +static unsigned int lumafilter;static unsigned int automute =1 ; -static unsigned int chroma_agc =0 ; +static unsigned int chroma_agc;static unsigned int adc_crush =1 ;static unsigned int whitecrush_upper =0xCF ;static unsigned int whitecrush_lower =0x7F ; -static unsigned int vcr_hack =0 ; -static unsigned int irq_iswitch =0 ; +static unsigned int vcr_hack; +static unsigned int irq_iswitch;static unsigned int uv_ratio =50 ; -static unsigned int full_luma_range =0 ; -static unsigned int coring =0 ; +static unsigned int full_luma_range; +static unsigned int coring;extern int no_overlay;/* API features (turn on/off stuff for testing) */ static unsigned int v4l2 =1 ; -/* insmod args */ module_param (bttv_verbose, int,0644 );module_param (bttv_gpio, int,0644 );
drivers/media/video/bttv-i2c.c +3 -3
@@ -41,9 +41,9 @@ static struct i2c_client bttv_i2c_clientstatic int attach_inform (struct i2c_client *client); -static int i2c_debug =0 ; -static int i2c_hw =0 ; -static int i2c_scan =0 ; +static int i2c_debug; +static int i2c_hw; +static int i2c_scan;module_param (i2c_debug, int,0644 );module_param (i2c_hw, int,0444 );module_param (i2c_scan, int,0444 );
drivers/media/video/cx25840/cx25840-core.c +1 -1
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");static unsigned short normal_i2c[] = {0x88 >>1 ,I2C_CLIENT_END }; -int cx25840_debug =0 ; +int cx25840_debug;module_param_named (debug,cx25840_debug, int,0644 );
drivers/media/video/cx88/cx88-alsa.c +2 -2
@@ -116,7 +116,7 @@ MODULE_LICENSE("GPL");MODULE_SUPPORTED_DEVICE ("{{Conexant,23881}," "{{Conexant,23882}," "{{Conexant,23883}" ); -static unsigned int debug =0 ; +static unsigned int debug;module_param (debug,int,0644 );MODULE_PARM_DESC (debug,"enable debug messages" );
@@ -653,7 +653,7 @@ static void snd_cx88_dev_free(snd_card_t* Alsa Constructor - Component probe */ -static int devno=0 ; +static int devno;static int __devinit snd_cx88_create (snd_card_t *card,struct pci_dev *pci,snd_cx88_card_t **rchip) {
drivers/media/video/msp3400-driver.c +5 -5
@@ -66,12 +66,12 @@ MODULE_LICENSE("GPL");/* module parameters */ static int opmode =OPMODE_AUTO ; -int msp_debug =0 ;/* msp_debug output */ -int msp_once =0 ;/* no continous stereo monitoring */ -int msp_amsound =0 ;/* hard-wire AM sound at 6.5 Hz (france), -the autoscan seems work well only with FM... */ +int msp_debug;/* msp_debug output */ +int msp_once;/* no continous stereo monitoring */ +int msp_amsound;/* hard-wire AM sound at 6.5 Hz (france), +the autoscan seems work well only with FM... */ int msp_standard =1 ;/* Override auto detect of audio msp_standard, if needed. */ -int msp_dolby =0 ; +int msp_dolby;int msp_stereo_thresh =0x190 ;/* a2 threshold for stereo/bilingual (msp34xxg only) 0x00a0-0x03c0 */
drivers/media/video/saa7134/saa7134-core.c +1 -1
@@ -140,7 +140,7 @@ static int pending_call(struct notifier_return NOTIFY_DONE ; } -static int pending_registered=0 ; +static int pending_registered;static struct notifier_block pending_notifier = { .notifier_call = pending_call, };
PATCH 4/25 Include missing MODULE_* macros
In reply to [email protected]From: Mauro Carvalho Chehab <[email protected]>
- Include missing MODULE_* macros.
- Fixed cx88_vp3054_i2c: module license 'unspecified' taints kernel.
---
drivers/media/video/cx88/cx88-vp3054-i2c.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/media/video/cx88/cx88-vp3054-i2c.c +4 -0
@@ -32,6 +32,10 @@#include "cx88-vp3054-i2c.h" +MODULE_DESCRIPTION ("driver for cx2388x VP3054 design" ); +MODULE_AUTHOR ("Chris Pascoe <[email protected]>" ); +MODULE_LICENSE ("GPL" ); +/* ----------------------------------------------------------------------- */ static void vp3054_bit_setscl (void *data,int state)
PATCH 5/25 Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected.
In reply to [email protected]From: Michael Krufky <[email protected]>
- Build cx88-alsa when CONFIG_VIDEO_CX88_ALSA is selected.
---
drivers/media/video/cx88/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/media/video/cx88/Makefile +1 -0
@@ -5,6 +5,7 @@ cx8802-objs := cx88-mpeg.o obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o cx8802.o cx88-blackbird.o obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o cx88-vp3054-i2c.o +obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o EXTRA_CFLAGS += -I$(src)/.. EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
PATCH 6/25 Updated MODULE_AUTHOR
In reply to [email protected]From: Michael Krufky <[email protected]>
- Updated MODULE_AUTHOR
---
drivers/media/dvb/dvb-usb/cxusb.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/dvb/dvb-usb/cxusb.c +2 -0
@@ -691,6 +691,8 @@ module_init (cxusb_module_init);module_exit (cxusb_module_exit);MODULE_AUTHOR ("Patrick Boettcher <[email protected]>" ); +MODULE_AUTHOR ("Michael Krufky <[email protected]>" ); +MODULE_AUTHOR ("Chris Pascoe <[email protected]>" );MODULE_DESCRIPTION ("Driver for Conexant USB2.0 hybrid reference design" );MODULE_VERSION ("1.0-alpha" );MODULE_LICENSE ("GPL" );
PATCH 7/25 Redesign tuners struct for maximum flexibility
In reply to [email protected]From: Michael Krufky <[email protected]>
- Tunertype struct redefined to allow one or more tuner_params structs per tuner definition, one for each video standard.
- Each tuner_params struct has an element containing an arbitrary amount of tuner_ranges.
(this is needed for dvb tuners - to be handled later)
- A tuner_range may be referenced by multiple tuner_params structs. There are many duplicates in here. Reusing tuner_range structs, rather than defining new ones for each tuner, will cut down on memory usage, and is preferred when possible.
- tunertype struct contains an element, has_tda988x.
We must set this for all tunertypes that contain a tda988x chip, and then we can remove this setting from the various card structs.
- Improves tuners array memory usage efficiency.
- Right now, all tuners are using the first tuner_params[] array element for analog mode. In the future, we will be merging similar tuner definitions together, such that each tuner definition will have a tuner_params struct for each available video standard. At that point, the tuner_params[] array element will be chosen based on the video standard in use.
---
drivers/media/video/Makefile | 3 drivers/media/video/tuner-simple.c | 750 +------------------- drivers/media/video/tuner-types.c | 1376 ++++++++++++++++++++++++++++++++++++ include/media/tuner-types.h | 41 + include/media/tuner.h | 1 5 files changed, 1444 insertions(+), 727 deletions(-)
drivers/media/video/Makefile +2 -1
@@ -8,7 +8,8 @@ bttv-objs := bttv-driver.o bttv-cards.o zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o zr36067-objs := zoran_procfs.o zoran_device.o \ zoran_driver.o zoran_card.o -tuner-objs := tuner-core.o tuner-simple.o mt20xx.o tda8290.o tea5767.o +tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ + mt20xx.o tda8290.o tea5767.o msp3400-objs := msp3400-driver.o msp3400-kthreads.o
drivers/media/video/tuner-simple.c +24 -726
803 lines not on this page · raw message
drivers/media/video/tuner-types.c new file +1376 -0
1,376 lines not on this page · raw message
include/media/tuner-types.h new file +41 -0
41 lines not on this page · raw message
include/media/tuner.h +1 -0
@@ -23,6 +23,7 @@#define _TUNER_H#include <linux/videodev2.h> +#include <media/tuner-types.h> #define ADDR_UNSET (255)
PATCH 8/25 Add support for Samsung tuner TCPN 2121P30A
In reply to [email protected]From: Hans Verkuil <[email protected]>
- Add support for Samsung tuner TCPN 2121P30A, used in Hauppauge PVR-500 cards.
---
Documentation/video4linux/CARDLIST.tuner | 1 + drivers/media/video/tuner-types.c | 24 ++++++++++++++++++++++++ drivers/media/video/tveeprom.c | 2 +- include/media/tuner.h | 1 + 4 files changed, 27 insertions(+), 1 deletions(-)
Documentation/video4linux/CARDLIST.tuner +1 -0
@@ -68,3 +68,4 @@ tuner=66 - LG NTSC (TALN mini series) tuner=67 - Philips TD1316 Hybrid Tuner tuner=68 - Philips TUV1236D ATSC/NTSC dual in tuner=69 - Tena TNF 5335 MF +tuner=70 - Samsung TCPN 2121P30A
drivers/media/video/tuner-types.c +24 -0
@@ -1077,6 +1077,24 @@ static struct tuner_params tuner_tnf_533 }, }; +/* 70-79 */ +/* ------------ TUNER_SAMSUNG_TCPN_2121P30A - Samsung NTSC ------------ */ + +static struct tuner_range tuner_samsung_tcpn_2121p30a_ntsc_ranges[] = { + {16 *175.75 /*MHz*/ ,0x01 , }, + {16 *410.25 /*MHz*/ ,0x02 , }, + {16 *999.99 ,0x08 , }, +}; + +static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = { + { + .type =TUNER_PARAM_TYPE_NTSC , + .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges, + .count =ARRAY_SIZE (tuner_samsung_tcpn_2121p30a_ntsc_ranges), + .config =0xce , + }, +}; +/* --------------------------------------------------------------------- */ struct tunertype tuners[] = {
@@ -1371,6 +1389,12 @@ struct tunertype tuners[] = { .name = "Tena TNF 5335 MF", .params = tuner_tnf_5335mf_params, }, + + /* 70-79 */ + [TUNER_SAMSUNG_TCPN_2121P30A] = { /* Samsung NTSC */ + .name = "Samsung TCPN 2121P30A", + .params = tuner_samsung_tcpn_2121p30a_params, + }, };unsigned const int tuner_count =ARRAY_SIZE (tuners);
drivers/media/video/tveeprom.c +1 -1
@@ -190,7 +190,7 @@ hauppauge_tuner[] = { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"}, { TUNER_TCL_2002N, "TCL 2002N 6A"}, { TUNER_PHILIPS_FM1236_MK3, "Philips FQ1236 MK3"}, - { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, + { TUNER_SAMSUNG_TCPN_2121P30A, "Samsung TCPN 2121P30A"}, { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, { TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"}, /* 90-99 */
include/media/tuner.h +1 -0
@@ -115,6 +115,7 @@#define TUNER_PHILIPS_TUV1236D 68/* ATI HDTV Wonder */ #define TUNER_TNF_5335MF 69/* Sabrent Bt848 */ +#define TUNER_SAMSUNG_TCPN_2121P30A 70/* Hauppauge PVR-500MCE NTSC */ /* tv card specific */ #define TDA9887_PRESENT (1<<0)
PATCH 9/25 disable all dvb tuner param_types until we need them
In reply to [email protected]From: Michael Krufky <[email protected]>
- Add param_type dvbs2
- disable all dvb param_types, which will not
be needed until we merge dvb-pll.
---
include/media/tuner-types.h | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
include/media/tuner-types.h +1 -5
@@ -9,11 +9,7 @@ enum param_type {TUNER_PARAM_TYPE_RADIO , \TUNER_PARAM_TYPE_PAL , \TUNER_PARAM_TYPE_SECAM , \ -TUNER_PARAM_TYPE_NTSC , \ -TUNER_PARAM_TYPE_ATSC , \ -TUNER_PARAM_TYPE_DVBT , \ -TUNER_PARAM_TYPE_DVBS , \ -TUNER_PARAM_TYPE_DVBC +TUNER_PARAM_TYPE_NTSC }; struct tuner_range {
PATCH 10/25 i2c ids for upd64031a saa717x upd64083 wm8739
In reply to [email protected]From: Tyler Trafford <[email protected]>
- Add i2c ids for drivers: upd64031a saa717x upd64083 wm8739
---
include/linux/i2c-id.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/i2c-id.h +4 -0
@@ -104,6 +104,10 @@#define I2C_DRIVERID_AKITAIOEXP 74/* IO Expander on Sharp SL-C1000 */ #define I2C_DRIVERID_INFRARED 75/* I2C InfraRed on Video boards */ #define I2C_DRIVERID_TVP5150 76/* TVP5150 video decoder */ +#define I2C_DRIVERID_WM8739 77/* wm8739 audio processor */ +#define I2C_DRIVERID_UPD64083 78/* upd64083 video processor */ +#define I2C_DRIVERID_UPD64031A 79/* upd64031a video processor */ +#define I2C_DRIVERID_SAA717X 80/* saa717x video encoder */ #define I2C_DRIVERID_I2CDEV 900#define I2C_DRIVERID_ARP 902/* SMBus ARP Client */
PATCH 11/25 Turn frame locked sound on, basic support for FM radio with TDA8275(a)
In reply to [email protected]From: Hartmut Hackmann <[email protected]>
- Enabled audio PLL. This is mandatory for NICAM sound
- modify FM IF frequency to 5.5MHz for SAA7133/35 if tuner is tda8290
---
drivers/media/video/saa7134/saa7134-cards.c | 6 ++++++ drivers/media/video/saa7134/saa7134-tvaudio.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
drivers/media/video/saa7134/saa7134-cards.c +6 -0
@@ -2515,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,
@@ -2529,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",
drivers/media/video/saa7134/saa7134-tvaudio.c +8 -3
@@ -180,8 +180,8 @@ static void tvaudio_init(struct saa7134_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 *datdprintk ("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 ;
PATCH 12/25 git dvb callbacks fix
In reply to [email protected]From: Andrew Morton <[email protected]>
- Not sure what went wrong here, but SND_PCI_PM_CALLBACKS got deleted.
---
drivers/media/video/cx88/cx88-alsa.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/media/video/cx88/cx88-alsa.c +0 -1
@@ -805,7 +805,6 @@ static struct pci_driver cx88_audio_pci_ .id_table = cx88_audio_pci_tbl, .probe = cx88_audio_initdev, .remove = cx88_audio_finidev, - SND_PCI_PM_CALLBACKS };/****************************************************************************
PATCH 13/25 cx88 Kconfig fixes for cx88-alsa
In reply to [email protected]From: Mauro Carvalho Chehab <[email protected]>
- Cx88 alsa is experimental.
- Removed need of PCM OSS for an ALSA module.
---
drivers/media/video/cx88/Kconfig | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/media/video/cx88/Kconfig +1 -2
@@ -31,8 +31,7 @@ config VIDEO_CX88_DVB config VIDEO_CX88_ALSA tristate "ALSA DMA audio support" - depends on VIDEO_CX88 && SND - select SND_PCM_OSS + depends on VIDEO_CX88 && SND && EXPERIMENTAL ---help--- This is a video4linux driver for direct (DMA) audio on Conexant 2388x based TV cards.
Re: [PATCH 13/25] cx88 Kconfig fixes for cx88-alsa
Quoted 17 lines · On Mon, Jan 16, 2006 at 07:11:22AM -0200, [email protected] wrote:
From: Mauro Carvalho Chehab <[email protected]>
- Cx88 alsa is experimental.
- Removed need of PCM OSS for an ALSA module.Signed-off-by Mauro Carvalho Chehab <[email protected]>---
drivers/media/video/cx88/Kconfig | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/media/video/cx88/Kconfig +0
-0
drivers/media/video/cx88/Kconfig config VIDEO_CX88_DVB · line 37
Quoted 9 lines
drivers/media/video/cx88/Kconfig +1
-2@@ -31,8 +31,7 @@ config VIDEO_CX88_DVB config VIDEO_CX88_ALSA tristate "ALSA DMA audio support" - depends on VIDEO_CX88 && SND - select SND_PCM_OSS + depends on VIDEO_CX88 && SND && EXPERIMENTAL ---help--- This is a video4linux driver for direct (DMA) audio on Conexant 2388x based TV cards.
This patch introduces a bug.
While select'ing SND_PCM_OSS isn't required, SND_PCM must be select'ed.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedPATCH 14/25 make some code static
In reply to [email protected]From: Adrian Bunk <[email protected]>
- This patch makes some needlessly global code static.
---
drivers/media/video/cx25840/cx25840-core.c | 2 +- drivers/media/video/tvp5150.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/cx25840/cx25840-core.c +1 -1
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");static unsigned short normal_i2c[] = {0x88 >>1 ,I2C_CLIENT_END }; -int cx25840_debug; +static int cx25840_debug;module_param_named (debug,cx25840_debug, int,0644 );
drivers/media/video/tvp5150.c +1 -1
@@ -634,7 +634,7 @@ struct i2c_vbi_ram_value {unsigned char values[26 ]; }; -struct i2c_vbi_ram_value vbi_ram_default[] = +static struct i2c_vbi_ram_value vbi_ram_default[] = { {0x010 ,/* WST SECAM 6 */ {0xaa ,0xaa ,0xff ,0xff ,0xe7 ,0x2e ,0x20 ,0x26 ,0xe6 ,0xb4 ,0x0e ,0x0 ,0x0 ,0x0 ,0x10 ,0x0 }
PATCH 15/25 Fix for lack of analog output on some cx88 boards
In reply to [email protected]From: Panagiotis Christeas <[email protected]>
- Workaround to fix a known regression at cx88-tvaudio.c
- provide a module parameter workaround to always enable analog output.
---
drivers/media/video/cx88/cx88-tvaudio.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/media/video/cx88/cx88-tvaudio.c +7 -1
@@ -60,6 +60,11 @@ static unsigned int audio_debug = 0;module_param (audio_debug, int,0644 );MODULE_PARM_DESC (audio_debug,"enable debug messages [audio]" ); +static unsigned int always_analog =0 ; +module_param (always_analog,int,0644 ); +MODULE_PARM_DESC (always_analog,"force analog audio out" ); + + #define dprintk(fmt, arg...) if (audio_debug) \ printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
@@ -155,7 +160,8 @@ static void set_audio_finish(struct cx88cx_write (AUD_I2SOUTPUTCNTL ,1 );cx_write (AUD_I2SCNTL ,0 );/* cx_write(AUD_APB_IN_RATE_ADJ, 0); */ - }else { + } +if ((always_analog) || (!cx88_boards[core->board].blackbird)) { ctl |=EN_DAC_ENABLE ;cx_write (AUD_CTL , ctl); }
PATCH 16/25 Semaphore to mutex conversion on drivers/media
In reply to [email protected]From: Ingo Molnar <[email protected]>
- Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated automatically via a script as well.
---
drivers/media/dvb/dvb-core/dvbdev.c | 22 +++++++++++----------- drivers/media/video/cx88/cx88-core.c | 15 ++++++++------- drivers/media/video/em28xx/em28xx-video.c | 7 ++++--- drivers/media/video/saa7134/saa7134-core.c | 19 ++++++++++--------- drivers/media/video/videodev.c | 25 ++++++++++++------------- 5 files changed, 45 insertions(+), 43 deletions(-)
drivers/media/dvb/dvb-core/dvbdev.c +11 -11
@@ -33,7 +33,7 @@#include <linux/device.h> #include <linux/fs.h> #include <linux/cdev.h> - +#include <linux/mutex.h> #include "dvbdev.h" static int dvbdev_debug;
@@ -44,7 +44,7 @@ MODULE_PARM_DESC(dvbdev_debug, "Turn on/#define dprintk if (dvbdev_debug) printkstatic LIST_HEAD (dvb_adapter_list); -static DECLARE_MUTEX (dvbdev_register_lock); +static DEFINE_MUTEX (dvbdev_register_lock);static const char *const dnames[] = {"video" ,"audio" ,"sec" ,"frontend" ,"demux" ,"dvr" ,"ca" ,
@@ -202,11 +202,11 @@ int dvb_register_device(struct dvb_adaptstruct dvb_device *dvbdev;int id; -if (down_interruptible (&dvbdev_register_lock)) +if (mutex_lock_interruptible (&dvbdev_register_lock))return -ERESTARTSYS ;if ((id =dvbdev_get_free_id (adap, type)) <0 ) { -up (&dvbdev_register_lock); +mutex_unlock (&dvbdev_register_lock); *pdvbdev =NULL ;printk ("%s: could get find free device id...\n" , __FUNCTION__);return -ENFILE ;
@@ -215,11 +215,11 @@ int dvb_register_device(struct dvb_adapt *pdvbdev = dvbdev =kmalloc (sizeof (struct dvb_device ),GFP_KERNEL );if (!dvbdev) { -up (&dvbdev_register_lock); +mutex_unlock (&dvbdev_register_lock);return -ENOMEM ; } -up (&dvbdev_register_lock); +mutex_unlock (&dvbdev_register_lock);memcpy (dvbdev, template,sizeof (struct dvb_device )); dvbdev->type = type;
@@ -289,11 +289,11 @@ int dvb_register_adapter(struct dvb_adap {int num; -if (down_interruptible (&dvbdev_register_lock)) +if (mutex_lock_interruptible (&dvbdev_register_lock))return -ERESTARTSYS ;if ((num =dvbdev_get_free_adapter_num ()) <0 ) { -up (&dvbdev_register_lock); +mutex_unlock (&dvbdev_register_lock);return -ENFILE ; }
@@ -309,7 +309,7 @@ int dvb_register_adapter(struct dvb_adaplist_add_tail (&adap->list_head, &dvb_adapter_list); -up (&dvbdev_register_lock); +mutex_unlock (&dvbdev_register_lock);return num; }
@@ -320,10 +320,10 @@ int dvb_unregister_adapter(struct dvb_ad {devfs_remove ("dvb/adapter%d" , adap->num); -if (down_interruptible (&dvbdev_register_lock)) +if (mutex_lock_interruptible (&dvbdev_register_lock))return -ERESTARTSYS ;list_del (&adap->list_head); -up (&dvbdev_register_lock); +mutex_unlock (&dvbdev_register_lock);return 0 ; }EXPORT_SYMBOL (dvb_unregister_adapter);
drivers/media/video/cx88/cx88-core.c +8 -7
@@ -32,6 +32,7 @@#include <linux/pci.h> #include <linux/delay.h> #include <linux/videodev2.h> +#include <linux/mutex.h> #include "cx88.h" #include <media/v4l2-common.h>
@@ -75,7 +76,7 @@ MODULE_PARM_DESC(nocomb,"disable comb fistatic unsigned int cx88_devcount;static LIST_HEAD (cx88_devlist); -static DECLARE_MUTEX (devlist); +static DEFINE_MUTEX (devlist);#define NO_SYNC_LINE (-1U)
@@ -1036,7 +1037,7 @@ struct cx88_core* cx88_core_get(struct pstruct list_head *item;int i; -down (&devlist); +mutex_lock (&devlist);list_for_each (item,&cx88_devlist) { core = list_entry(item, struct cx88_core, devlist);if (pci->bus->number != core->pci_bus)
@@ -1047,7 +1048,7 @@ struct cx88_core* cx88_core_get(struct pif (0 !=get_ressources (core,pci)) goto fail_unlock;atomic_inc (&core->refcount); -up (&devlist); +mutex_unlock (&devlist);return core; } core =kzalloc (sizeof (*core),GFP_KERNEL );
@@ -1122,13 +1123,13 @@ struct cx88_core* cx88_core_get(struct pcx88_card_setup (core);cx88_ir_init (core,pci); -up (&devlist); +mutex_unlock (&devlist);return core; fail_free:kfree (core); fail_unlock: -up (&devlist); +mutex_unlock (&devlist);return NULL ; }
@@ -1140,14 +1141,14 @@ void cx88_core_put(struct cx88_core *corif (!atomic_dec_and_test (&core->refcount))return ; -down (&devlist); +mutex_lock (&devlist);cx88_ir_fini (core);if (0 == core->i2c_rc)i2c_bit_del_bus (&core->i2c_adap);list_del (&core->devlist);iounmap (core->lmmio); cx88_devcount--; -up (&devlist); +mutex_unlock (&devlist);kfree (core); }
drivers/media/video/em28xx/em28xx-video.c +4 -3
@@ -29,6 +29,7 @@#include <linux/i2c.h> #include <linux/version.h> #include <linux/video_decoder.h> +#include <linux/mutex.h> #include "em28xx.h" #include <media/tuner.h>
@@ -191,7 +192,7 @@ static struct v4l2_queryctrl saa711x_qctstatic struct usb_driver em28xx_usb_driver; -static DECLARE_MUTEX (em28xx_sysfs_lock); +static DEFINE_MUTEX (em28xx_sysfs_lock);static DECLARE_RWSEM (em28xx_disconnect);/********************* v4l2 interface ******************************************/
@@ -394,7 +395,7 @@ static int em28xx_v4l2_open(struct inode*/ static void em28xx_release_resources (struct em28xx *dev) { -down (&em28xx_sysfs_lock); +mutex_lock (&em28xx_sysfs_lock);em28xx_info ("V4L2 device /dev/video%d deregistered\n" , dev->vdev->minor);
@@ -403,7 +404,7 @@ static void em28xx_release_resources(str/* video_unregister_device(dev->vbi_dev); */ em28xx_i2c_unregister (dev);usb_put_dev (dev->udev); -up (&em28xx_sysfs_lock); +mutex_unlock (&em28xx_sysfs_lock); }/*
drivers/media/video/saa7134/saa7134-core.c +10 -9
@@ -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 deviceMODULE_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;
@@ -969,13 +970,13 @@ static int __devinit saa7134_initdev(strpci_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);
@@ -1031,13 +1032,13 @@ static void __devexit saa7134_finidev(stsaa7134_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);
@@ -1071,13 +1072,13 @@ int saa7134_ts_register(struct saa7134_mstruct 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 ; }
@@ -1086,13 +1087,13 @@ void saa7134_ts_unregister(struct saa713struct 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);
drivers/media/video/videodev.c +12 -13
@@ -29,7 +29,6 @@#include <linux/devfs_fs_kernel.h> #include <asm/uaccess.h> #include <asm/system.h> -#include <asm/semaphore.h> #include <linux/videodev.h>
@@ -83,7 +82,7 @@ static struct class video_class = {*/ static struct video_device *video_device[VIDEO_NUM_DEVICES ]; -static DECLARE_MUTEX (videodev_lock); +static DEFINE_MUTEX (videodev_lock);struct video_device *video_devdata (struct file *file) {
@@ -102,15 +101,15 @@ static int video_open(struct inode *inodif (minor>=VIDEO_NUM_DEVICES )return -ENODEV ; -down (&videodev_lock); +mutex_lock (&videodev_lock); vfl=video_device[minor];if (vfl==NULL ) { -up (&videodev_lock); +mutex_unlock (&videodev_lock);request_module ("char-major-%d-%d" ,VIDEO_MAJOR , minor); -down (&videodev_lock); +mutex_lock (&videodev_lock); vfl=video_device[minor];if (vfl==NULL ) { -up (&videodev_lock); +mutex_unlock (&videodev_lock);return -ENODEV ; } }
@@ -123,7 +122,7 @@ static int video_open(struct inode *inod file->f_op =fops_get (old_fops); }fops_put (old_fops); -up (&videodev_lock); +mutex_unlock (&videodev_lock);return err; }
@@ -304,12 +303,12 @@ int video_register_device(struct video_d }/* pick a minor number */ -down (&videodev_lock); +mutex_lock (&videodev_lock);if (nr >=0 && nr < end-base) {/* use the one the driver asked for */ i = base+nr;if (NULL != video_device[i]) { -up (&videodev_lock); +mutex_unlock (&videodev_lock);return -ENFILE ; } }else {
@@ -318,13 +317,13 @@ int video_register_device(struct video_dif (NULL == video_device[i])break ;if (i == end) { -up (&videodev_lock); +mutex_unlock (&videodev_lock);return -ENFILE ; } } video_device[i]=vfd; vfd->minor=i; -up (&videodev_lock); +mutex_unlock (&videodev_lock);sprintf (vfd->devfs_name,"v4l/%s%d" , name_base, i - base); devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor),
@@ -362,14 +361,14 @@ int video_register_device(struct video_dvoid video_unregister_device (struct video_device *vfd) { -down (&videodev_lock); +mutex_lock (&videodev_lock);if (video_device[vfd->minor]!=vfd)panic ("videodev: bad unregister" );devfs_remove (vfd->devfs_name); video_device[vfd->minor]=NULL ;class_device_unregister (&vfd->class_dev); -up (&videodev_lock); +mutex_unlock (&videodev_lock); }
PATCH 17/25 Fix compilation with Alpha
In reply to [email protected]From: Mauro Carvalho Chehab <[email protected]>
- BOOT_SIZE name is also used at alpha and were breaking compiling with allyesconfig.
- All BOOT_* renamed to AV7110_BOOT* to fix and keep names with the same style.
Thanks to Andrew Morton for pointing this.
---
drivers/media/dvb/ttpci/av7110_hw.c | 40 ++++++++++++++++++----------------- drivers/media/dvb/ttpci/av7110_hw.h | 12 +++++------ 2 files changed, 26 insertions(+), 26 deletions(-)
drivers/media/dvb/ttpci/av7110_hw.c +20 -20
@@ -146,52 +146,52 @@ static int load_dram(struct av7110 *av71 {int i;int blocks, rest; -u32 base, bootblock =BOOT_BLOCK ; +u32 base, bootblock =AV7110_BOOT_BLOCK ;dprintk (4 ,"%p\n" , av7110); - blocks = len /BOOT_MAX_SIZE ; - rest = len %BOOT_MAX_SIZE ; + blocks = len /AV7110_BOOT_MAX_SIZE ; + rest = len %AV7110_BOOT_MAX_SIZE ; base =DRAM_START_CODE ;for (i =0 ; i < blocks; i++) { -if (waitdebi (av7110,BOOT_STATE ,BOOTSTATE_BUFFER_EMPTY ) <0 ) { +if (waitdebi (av7110,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_EMPTY ) <0 ) {printk (KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n" , i);return -ETIMEDOUT ; }dprintk (4 ,"writing DRAM block %d\n" , i);mwdebi (av7110,DEBISWAB , bootblock, - ((char *)data) + i *BOOT_MAX_SIZE ,BOOT_MAX_SIZE ); + ((char *)data) + i *AV7110_BOOT_MAX_SIZE ,AV7110_BOOT_MAX_SIZE ); bootblock ^=0x1400 ; -iwdebi (av7110,DEBISWAB ,BOOT_BASE ,swab32 (base),4 ); -iwdebi (av7110,DEBINOSWAP ,BOOT_SIZE ,BOOT_MAX_SIZE ,2 ); -iwdebi (av7110,DEBINOSWAP ,BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); - base +=BOOT_MAX_SIZE ; +iwdebi (av7110,DEBISWAB ,AV7110_BOOT_BASE ,swab32 (base),4 ); +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_SIZE ,AV7110_BOOT_MAX_SIZE ,2 ); +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); + base +=AV7110_BOOT_MAX_SIZE ; }if (rest >0 ) { -if (waitdebi (av7110,BOOT_STATE ,BOOTSTATE_BUFFER_EMPTY ) <0 ) { +if (waitdebi (av7110,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_EMPTY ) <0 ) {printk (KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n" );return -ETIMEDOUT ; }if (rest >4 )mwdebi (av7110,DEBISWAB , bootblock, - ((char *)data) + i *BOOT_MAX_SIZE , rest); + ((char *)data) + i *AV7110_BOOT_MAX_SIZE , rest);else mwdebi (av7110,DEBISWAB , bootblock, - ((char *)data) + i *BOOT_MAX_SIZE -4 , rest +4 ); + ((char *)data) + i *AV7110_BOOT_MAX_SIZE -4 , rest +4 ); -iwdebi (av7110,DEBISWAB ,BOOT_BASE ,swab32 (base),4 ); -iwdebi (av7110,DEBINOSWAP ,BOOT_SIZE , rest,2 ); -iwdebi (av7110,DEBINOSWAP ,BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); +iwdebi (av7110,DEBISWAB ,AV7110_BOOT_BASE ,swab32 (base),4 ); +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_SIZE , rest,2 ); +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); } -if (waitdebi (av7110,BOOT_STATE ,BOOTSTATE_BUFFER_EMPTY ) <0 ) { +if (waitdebi (av7110,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_EMPTY ) <0 ) {printk (KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n" );return -ETIMEDOUT ; } -iwdebi (av7110,DEBINOSWAP ,BOOT_SIZE ,0 ,2 ); -iwdebi (av7110,DEBINOSWAP ,BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); -if (waitdebi (av7110,BOOT_STATE ,BOOTSTATE_BOOT_COMPLETE ) <0 ) { +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_SIZE ,0 ,2 ); +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); +if (waitdebi (av7110,AV7110_BOOT_STATE ,BOOTSTATE_AV7110_BOOT_COMPLETE ) <0 ) {printk (KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n" );return -ETIMEDOUT ; }
@@ -262,7 +262,7 @@ int av7110_bootarm(struct av7110 *av7110//saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT); mwdebi (av7110,DEBISWAB ,DPRAM_BASE , bootcode,sizeof (bootcode)); -iwdebi (av7110,DEBINOSWAP ,BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 ); +iwdebi (av7110,DEBINOSWAP ,AV7110_BOOT_STATE ,BOOTSTATE_BUFFER_FULL ,2 );if (saa7146_wait_for_debi_done (av7110->dev,1 )) { printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
drivers/media/dvb/ttpci/av7110_hw.h +6 -6
@@ -18,7 +18,7 @@ enum av7110_bootstate {BOOTSTATE_BUFFER_EMPTY =0 ,BOOTSTATE_BUFFER_FULL =1 , - BOOTSTATE_BOOT_COMPLETE = 2 + BOOTSTATE_AV7110_BOOT_COMPLETE = 2 };enum av7110_type_rec_play_format
@@ -295,11 +295,11 @@ enum av7110_command_type {#define DPRAM_BASE 0x4000/* boot protocol area */ -#define BOOT_STATE (DPRAM_BASE + 0x3F8) -#define BOOT_SIZE (DPRAM_BASE + 0x3FA) -#define BOOT_BASE (DPRAM_BASE + 0x3FC) -#define BOOT_BLOCK (DPRAM_BASE + 0x400) -#define BOOT_MAX_SIZE 0xc00 +#define AV7110_BOOT_STATE (DPRAM_BASE + 0x3F8) +#define AV7110_BOOT_SIZE (DPRAM_BASE + 0x3FA) +#define AV7110_BOOT_BASE (DPRAM_BASE + 0x3FC) +#define AV7110_BOOT_BLOCK (DPRAM_BASE + 0x400) +#define AV7110_BOOT_MAX_SIZE 0xc00/* firmware command protocol area */ #define IRQ_STATE (DPRAM_BASE + 0x0F4)
PATCH 18/25 Move tda988x options into tuner_params struct.
In reply to [email protected]From: Michael Krufky <[email protected]>
- Tda988x parameters should be defined per tuner_param_type, for each tuner_params array member.
---
include/media/tuner-types.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/media/tuner-types.h +1 -1
@@ -19,6 +19,7 @@ struct tuner_range {struct tuner_params {enum param_type type; +unsigned int tda988x;unsigned char config;/* to be moved into struct tuner_range for dvb-pll merge */ unsigned int count;
@@ -27,7 +28,6 @@ struct tuner_params {struct tunertype {char *name; -unsigned int has_tda988x:1 ;struct tuner_params *params; };
PATCH 19/25 Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.
In reply to [email protected]From: Hans Verkuil <[email protected]>
- Moved MSP_SET_MATRIX to v4l2-common.h
- Fix typos and integer overflows in tea5767.c
- Split old freq field into a tv_freq and a radio_freq. Prevents that a radio tuner is initialized with a tv frequency or vice versa.
- When switching to radio mode initialize the tuner with the last used radio frequency (this was already done for the TV mode). As a result of these changes the tuner module now remembers the last set radio and TV frequencies, which is what you would expect to happen.
- Move out of range frequencies to the closest valid frequency as per v4l2 API spec.
- Fix incorrect initial radio frequency (multiplier is 16000, not 16)
- Add boundary check for out of range frequencies.
- Use new flag to check if the order of the CB and freq. depends on the last set frequency. That is needed for some tuners or you can get static as a result. The flag is added for those tuners where I know that the datasheet indicates that this is necessary.
- For this new check use the last set div value, not the last frequency as radio frequencies are always much higher due to the 16000 multiplier.
---
drivers/media/video/msp3400.h | 8 --- drivers/media/video/mt20xx.c | 12 +++-- drivers/media/video/tda8290.c | 4 +- drivers/media/video/tea5767.c | 18 ++++---- drivers/media/video/tuner-core.c | 85 ++++++++++++++++++++++-------------- drivers/media/video/tuner-simple.c | 44 ++++++++++--------- drivers/media/video/tuner-types.c | 6 +++ drivers/media/video/v4l2-common.c | 1 include/media/tuner-types.h | 18 ++++++++ include/media/tuner.h | 8 ++- include/media/v4l2-common.h | 7 +++ 11 files changed, 129 insertions(+), 82 deletions(-)
drivers/media/video/msp3400.h +0 -8
@@ -6,14 +6,6 @@/* ---------------------------------------------------------------------- */ -struct msp_matrix { -int input; -int output; -}; - -/* ioctl for MSP_SET_MATRIX will have to be registered */ -#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) -/* This macro is allowed for *constants* only, gcc must calculate it at compile time. Remember -- no floats in kernel mode */ #define MSP_CARRIER (freq) ((int)((float)(freq / 18.432) * (1 << 24)))
drivers/media/video/mt20xx.c +6 -6
@@ -353,8 +353,8 @@ static int mt2032_init(struct i2c_client }while (xok !=1 ); t->xogc=xogc; - t->tv_freq = mt2032_set_tv_freq; - t->radio_freq = mt2032_set_radio_freq; + t->set_tv_freq = mt2032_set_tv_freq; + t->set_radio_freq = mt2032_set_radio_freq;return (1 ); }
@@ -481,8 +481,8 @@ static int mt2050_init(struct i2c_clienti2c_master_recv (c,buf,1 );tuner_dbg ("mt2050: sro is %x\n" ,buf[0 ]); - t->tv_freq = mt2050_set_tv_freq; - t->radio_freq = mt2050_set_radio_freq; + t->set_tv_freq = mt2050_set_tv_freq; + t->set_radio_freq = mt2050_set_radio_freq;return 0 ; }
@@ -494,8 +494,8 @@ int microtune_init(struct i2c_client *c)int company_code;memset (buf,0 ,sizeof (buf)); - t->tv_freq =NULL ; - t->radio_freq =NULL ; + t->set_tv_freq =NULL ; + t->set_radio_freq =NULL ; t->standby =NULL ;if (t->std &V4L2_STD_525_60 ) {tuner_dbg ("pinnacle ntsc\n" );
drivers/media/video/tda8290.c +2 -2
@@ -567,8 +567,8 @@ int tda8290_init(struct i2c_client *c) }tuner_info ("tuner: type set to %s\n" , c->name); - t->tv_freq = set_tv_freq; - t->radio_freq = set_radio_freq; + t->set_tv_freq = set_tv_freq; + t->set_radio_freq = set_radio_freq; t->has_signal = has_signal; t->standby = standby; t->tda827x_lpsel =0 ;
drivers/media/video/tea5767.c +9 -9
@@ -62,7 +62,7 @@ extern int tuner_debug;#define TEA5767_PORT1_HIGH 0x01 -/* Forth register */ +/* Fourth register */ #define TEA5767_PORT2_HIGH 0x80/* Chips stops working. Only I2C bus remains on */ #define TEA5767_STDBY 0x40
@@ -85,7 +85,7 @@ extern int tuner_debug;/* If activate PORT 1 indicates SEARCH or else it is used as PORT1 */ #define TEA5767_SRCH_IND 0x01 -/* Fiveth register */ +/* Fifth register */ /* By activating, it will use Xtal at 13 MHz as reference for divider */ #define TEA5767_PLLREF_ENABLE 0x80
@@ -109,13 +109,13 @@ extern int tuner_debug;#define TEA5767_STEREO_MASK 0x80#define TEA5767_IF_CNTR_MASK 0x7f -/* Four register */ +/* Fourth register */ #define TEA5767_ADC_LEVEL_MASK 0xf0/* should be 0 */ #define TEA5767_CHIP_ID_MASK 0x0f -/* Fiveth register */ +/* Fifth register */ /* Reserved for future extensions */ #define TEA5767_RESERVED_MASK 0xff
@@ -220,19 +220,19 @@ static void set_radio_freq(struct i2c_cltuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n" ); buffer[2 ] |=TEA5767_HIGH_LO_INJECT ; buffer[4 ] |=TEA5767_PLLREF_ENABLE ; - div = (frq *4000 /16 +700000 +225000 +25000 ) /50000 ; + div = (frq * (4000 /16 ) +700000 +225000 +25000 ) /50000 ;break ;case TEA5767_LOW_LO_13MHz:tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n" ); buffer[4 ] |=TEA5767_PLLREF_ENABLE ; - div = (frq *4000 /16 -700000 -225000 +25000 ) /50000 ; + div = (frq * (4000 /16 ) -700000 -225000 +25000 ) /50000 ;break ;case TEA5767_LOW_LO_32768 :tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n" ); buffer[3 ] |=TEA5767_XTAL_32768 ;/* const 700=4000*175 Khz - to adjust freq to right value */ - div = ((frq *4000 /16 -700000 -225000 ) +16384 ) >>15 ; + div = ((frq * (4000 /16 ) -700000 -225000 ) +16384 ) >>15 ;break ;case TEA5767_HIGH_LO_32768 :default :
@@ -350,8 +350,8 @@ int tea5767_tuner_init(struct i2c_clienttuner_info ("type set to %d (%s)\n" , t->type,"Philips TEA5767HN FM Radio" );strlcpy (c->name,"tea5767" ,sizeof (c->name)); - t->tv_freq = set_tv_freq; - t->radio_freq = set_radio_freq; + t->set_tv_freq = set_tv_freq; + t->set_radio_freq = set_radio_freq; t->has_signal = tea5767_signal; t->is_stereo = tea5767_stereo; t->standby = tea5767_standby;
drivers/media/video/tuner-core.c +52 -33
207 lines not on this page · raw message
drivers/media/video/tuner-simple.c +23 -21
96 lines not on this page · raw message
drivers/media/video/tuner-types.c +6 -0
@@ -81,6 +81,7 @@ static struct tuner_params tuner_philips .ranges = tuner_philips_ntsc_ranges, .count = ARRAY_SIZE(tuner_philips_ntsc_ranges), .config = 0x8e, + .cb_first_if_lower_freq = 1, }, };
@@ -98,6 +99,7 @@ static struct tuner_params tuner_philips .ranges = tuner_philips_secam_ranges, .count = ARRAY_SIZE(tuner_philips_secam_ranges), .config = 0x8e, + .cb_first_if_lower_freq = 1, }, };
@@ -115,6 +117,7 @@ static struct tuner_params tuner_philips .ranges = tuner_philips_pal_ranges, .count = ARRAY_SIZE(tuner_philips_pal_ranges), .config = 0x8e, + .cb_first_if_lower_freq = 1, }, };
@@ -596,6 +599,7 @@ static struct tuner_params tuner_fm1216m .ranges = tuner_fm1216me_mk3_pal_ranges, .count = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges), .config = 0x8e, + .cb_first_if_lower_freq = 1, }, };
@@ -670,6 +674,7 @@ static struct tuner_params tuner_fm1236_ .ranges = tuner_fm1236_mk3_ntsc_ranges, .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges), .config = 0x8e, + .cb_first_if_lower_freq = 1, }, };
@@ -784,6 +789,7 @@ static struct tuner_params tuner_tcl_200 .ranges = tuner_tcl_2002n_ntsc_ranges, .count = ARRAY_SIZE(tuner_tcl_2002n_ntsc_ranges), .config = 0x8e, + .cb_first_if_lower_freq = 1, }, };
drivers/media/video/v4l2-common.c +1 -0
@@ -306,6 +306,7 @@ static const char *v4l2_int_ioctls[] = { #endif [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO", [_IOC_NR(AUDC_SET_INPUT)] = "AUDC_SET_INPUT", + [_IOC_NR(MSP_SET_MATRIX)] = "MSP_SET_MATRIX", [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR", [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY",
include/media/tuner-types.h +18 -0
@@ -20,6 +20,24 @@ struct tuner_range {struct tuner_params {enum param_type type;unsigned int tda988x; +/* Many Philips based tuners have a comment like this in their +* datasheet: +* +* For channel selection involving band switching, and to ensure +* smooth tuning to the desired channel without causing +* unnecessary charge pump action, it is recommended to consider +* the difference between wanted channel frequency and the +* current channel frequency. Unnecessary charge pump action +* will result in very low tuning voltage which may drive the +* oscillator to extreme conditions. +* +* Set this flag to 1 if this tuner needs this check. +* +* I tested this for PAL by first setting the TV frequency to +* 203 MHz and then switching to 96.6 MHz FM radio. The result was +* static unless the control byte was sent first. +*/ +unsigned int cb_first_if_lower_freq:1 ;unsigned char config;/* to be moved into struct tuner_range for dvb-pll merge */ unsigned int count;
include/media/tuner.h +5 -3
@@ -179,7 +179,9 @@ struct tuner {unsigned int mode;unsigned int mode_mask;/* Combination of allowable modes */ -unsigned int freq;/* keep track of the current settings */ +unsigned int tv_freq;/* keep track of the current settings */ +unsigned int radio_freq; +u16 last_div;unsigned int audmode;v4l2_std_id std;
@@ -197,8 +199,8 @@ struct tuner {unsigned int sgIF;/* function ptrs */ -void (*tv_freq)(struct i2c_client *c,unsigned int freq); -void (*radio_freq)(struct i2c_client *c,unsigned int freq); +void (*set_tv_freq)(struct i2c_client *c,unsigned int freq); +void (*set_radio_freq)(struct i2c_client *c,unsigned int freq);int (*has_signal)(struct i2c_client *c);int (*is_stereo)(struct i2c_client *c);void (*standby)(struct i2c_client *c);
include/media/v4l2-common.h +7 -0
@@ -120,6 +120,13 @@ enum v4l2_chip_ident {/* select from TV,radio,extern,MUTE */ #define AUDC_SET_INPUT _IOW('d',89,int) +/* msp3400 ioctl: will be removed in the near future */ +struct msp_matrix { +int input; +int output; +}; +#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) +/* tuner ioctls */ /* Sets tuner type and its I2C addr */ #define TUNER_SET_TYPE_ADDR _IOW('d',90,int)
PATCH 20/25 Return -EINVAL for unknown commands in msp3400 module.
In reply to [email protected]From: Hans Verkuil <[email protected]>
- Return -EINVAL for unknown commands.
---
drivers/media/video/msp3400-driver.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/msp3400-driver.c +2 -2
@@ -1031,8 +1031,8 @@ static int msp_command(struct i2c_client }default : -/* nothing */ -break ; +/* unknown */ +return -EINVAL ; }return 0 ; }
PATCH 21/25 fix some sound quality & distortion problems.
In reply to [email protected]From: Ricardo Cerqueira <[email protected]>
- Fix some sound quality & distortion problems.
---
drivers/media/video/cx88/cx88-alsa.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/cx88/cx88-alsa.c +2 -2
@@ -333,10 +333,10 @@ static snd_pcm_hardware_t snd_cx88_digit .channels_min = 1, .channels_max = 2, .buffer_bytes_max = (2*2048), - .period_bytes_min = 256, + .period_bytes_min = 2048, .period_bytes_max = 2048, .periods_min = 2, - .periods_max = 16, + .periods_max = 2, };/*
PATCH 22/25 clean up some comments
In reply to [email protected]From: Michael Krufky <[email protected]>
- clean up some comments
---
include/media/tuner-types.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
include/media/tuner-types.h +2 -1
@@ -31,7 +31,8 @@ struct tuner_params {* will result in very low tuning voltage which may drive the * oscillator to extreme conditions. * -* Set this flag to 1 if this tuner needs this check. +* Set cb_first_if_lower_freq to 1, if this check is +* required for this tuner. * * I tested this for PAL by first setting the TV frequency to * 203 MHz and then switching to 96.6 MHz FM radio. The result was
PATCH 23/25 tuner_params->tda988x is currently unused, so disable
In reply to [email protected]From: Michael Krufky <[email protected]>
- Tuner_params->tda988x is unused right now, so let's disable it for 2.6.16
- This is currently happening at the card level, but the plan is to move this configuration into the tuner_params configuration.
---
include/media/tuner-types.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
include/media/tuner-types.h +1 -2
@@ -19,7 +19,6 @@ struct tuner_range {struct tuner_params {enum param_type type; -unsigned int tda988x;/* Many Philips based tuners have a comment like this in their * datasheet: *
@@ -31,7 +30,7 @@ struct tuner_params {* will result in very low tuning voltage which may drive the * oscillator to extreme conditions. * -* Set cb_first_if_lower_freq to 1, if this check is +* Set cb_first_if_lower_freq to 1, if this check is * required for this tuner. * * I tested this for PAL by first setting the TV frequency to
PATCH 24/25 Samsung TBMV30111IN has 6 entries
In reply to [email protected]From: Michael Krufky <[email protected]>
- Samsung TBMV30111IN has 6 entries
---
drivers/media/dvb/frontends/dvb-pll.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/frontends/dvb-pll.c +1 -1
@@ -333,7 +333,7 @@ struct dvb_pll_desc dvb_pll_tbmv30111in .name = "Samsung TBMV30111IN", .min = 54000000, .max = 860000000, - .count = 4, + .count = 6, .entries = { { 172000000, 44000000, 166666, 0xb4, 0x01 }, { 214000000, 44000000, 166666, 0xb4, 0x02 },
PATCH 25/25 Added remote control support for pinnacle pctv
In reply to [email protected]From: Markus Rechberger <[email protected]>
- Added remote control support for pinnacle pctv
---
drivers/media/video/em28xx/em28xx-input.c | 77 +++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-)
drivers/media/video/em28xx/em28xx-input.c +77 -0
@@ -76,6 +76,58 @@ static IR_KEYTAB_TYPE ir_codes_em_terrat [ 0x40 ] = KEY_ZOOM, }; +static IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE ] = { + [0x3a ] =KEY_KP0 , + [0x31 ] =KEY_KP1 , + [0x32 ] =KEY_KP2 , + [0x33 ] =KEY_KP3 , + [0x34 ] =KEY_KP4 , + [0x35 ] =KEY_KP5 , + [0x36 ] =KEY_KP6 , + [0x37 ] =KEY_KP7 , + [0x38 ] =KEY_KP8 , + [0x39 ] =KEY_KP9 , + + [0x2f ] =KEY_POWER , + + [0x2e ] =KEY_P , + [0x1f ] =KEY_L , + [0x2b ] =KEY_I , + + [0x2d ] =KEY_ZOOM , + [0x1e ] =KEY_ZOOM , + [0x1b ] =KEY_VOLUMEUP , + [0x0f ] =KEY_VOLUMEDOWN , + [0x17 ] =KEY_CHANNELUP , + [0x1c ] =KEY_CHANNELDOWN , + [0x25 ] =KEY_INFO , + + [0x3c ] =KEY_MUTE , + + [0x3d ] =KEY_LEFT , + [0x3b ] =KEY_RIGHT , + + [0x3f ] =KEY_UP , + [0x3e ] =KEY_DOWN , + [0x1a ] =KEY_PAUSE , + + [0x1d ] =KEY_MENU , + [0x19 ] =KEY_PLAY , + [0x16 ] =KEY_REWIND , + [0x13 ] =KEY_FORWARD , + [0x15 ] =KEY_PAUSE , + [0x0e ] =KEY_REWIND , + [0x0d ] =KEY_PLAY , + [0x0b ] =KEY_STOP , + [0x07 ] =KEY_FORWARD , + [0x27 ] =KEY_RECORD , + [0x26 ] =KEY_TUNER , + [0x29 ] =KEY_TEXT , + [0x2a ] =KEY_MEDIA , + [0x18 ] =KEY_EPG , + [0x27 ] =KEY_RECORD , +}; +/* ----------------------------------------------------------------------- */ static int get_key_terratec (struct IR_i2c *ir,u32 *ir_key,u32 *ir_raw)
@@ -138,6 +190,28 @@ static int get_key_em_haup(struct IR_i2creturn 1 ; } +static int get_key_pinnacle_usb (struct IR_i2c *ir,u32 *ir_key,u32 *ir_raw) +{ +unsigned char buf[3 ]; + +/* poll IR chip */ + +if (3 !=i2c_master_recv (&ir->c,buf,3 )) { +dprintk ("read error\n" ); +return -EIO ; + } + +dprintk ("key %02x\n" , buf[2 ]&0x3f ); +if (buf[0 ]!=0x00 ){ +return 0 ; + } + + *ir_key = buf[2 ]&0x3f ; + *ir_raw = buf[2 ]&0x3f ; + +return 1 ; +} +/* ----------------------------------------------------------------------- */ void em28xx_set_ir (struct em28xx * dev,struct IR_i2c *ir) {
@@ -159,6 +233,9 @@ void em28xx_set_ir(struct em28xx * dev,ssnprintf (ir->c.name,sizeof (ir->c.name),"i2c IR (EM28XX Terratec)" );break ;case (EM2820_BOARD_PINNACLE_USB_2 ): + ir->ir_codes = ir_codes_em_pinnacle_usb; + ir->get_key = get_key_pinnacle_usb; +snprintf (ir->c.name,sizeof (ir->c.name),"i2c IR (EM28XX Pinnacle PCTV)" );break ;case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 ): ir->ir_codes = ir_codes_hauppauge_new;
Re: [PATCH 25/25] Added remote control support for pinnacle pctv
[email protected] wrote
Quoted 3 lines
From: Markus Rechberger <[email protected]>
Hi, Markus!
Remote control is not working, sorry :(
# cat /etc/modprobe.d/tv options em28xx tuner=63 ir_debug=1 i2c_scan=1 i2c_debug=1 options tuner secam=d pal=d
# modprobe em28xx # modprobe ir-kbd-i2c # dmesg
tveeprom: module not supported by Novell, setting U taint flag.ir_common: module not supported by Novell, setting U taint flag.
em28xx: module not supported by Novell, setting U taint flag. em28xx v4l2 driver version 0.0.1 loaded
em28xx new video device (2304:0208): interface 0, class 255
em28xx: Alternate settings: 8
em28xx: Alternate setting 0, max size= 0
em28xx: Alternate setting 1, max size= 1024
em28xx: Alternate setting 2, max size= 1448
em28xx: Alternate setting 3, max size= 2048
em28xx: Alternate setting 4, max size= 2304
em28xx: Alternate setting 5, max size= 2580
em28xx: Alternate setting 6, max size= 2892
em28xx: Alternate setting 7, max size= 3072
saa711x: module not supported by Novell, setting U taint flag.
saa711x: Ignoring new-style parameters in presence of obsolete ones
tuner: module not supported by Novell, setting U taint flag.
tda9887: module not supported by Novell, setting U taint flag.attach_inform: saa7113 detected.
tuner 0-0063: chip found @ 0xc6 (em28xx #0)
attach inform: detected I2C address c6
tuner 0-0063: type set to 63 (Philips FMD1216ME MK3 Hybrid Tuner) tda9887 0-0043: chip found @ 0x86 (em28xx #0)
em28xx #0: i2c eeprom 00: 1a eb 67 95 04 23 08 02 10 00 1e 03 98 2a 6a 2e em28xx #0: i2c eeprom 10: 00 00 06 57 6e 00 00 00 8e 00 00 00 07 00 00 00 em28xx #0: i2c eeprom 20: 16 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 10 01 00 00 00 00 00 00 em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 2e 03 50 00 69 00 em28xx #0: i2c eeprom 70: 6e 00 6e 00 61 00 63 00 6c 00 65 00 20 00 53 00 em28xx #0: i2c eeprom 80: 79 00 73 00 74 00 65 00 6d 00 73 00 20 00 47 00 em28xx #0: i2c eeprom 90: 6d 00 62 00 48 00 00 00 2a 03 50 00 43 00 54 00 em28xx #0: i2c eeprom a0: 56 00 20 00 55 00 53 00 42 00 32 00 20 00 50 00 em28xx #0: i2c eeprom b0: 41 00 4c 00 2f 00 53 00 45 00 43 00 41 00 4d 00 em28xx #0: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 0c 22 17 38 02 90 2b 3e EEPROM ID= 0x9567eb1a
Vendor/Product ID= 2304:0208
AC97 audio (5 sample rates)
500mA max power
Table at 0x06, strings=0x2a98, 0x2e6a, 0x0000
em28xx #0: found i2c device @ 0x4a [saa7113h]
em28xx #0: found i2c device @ 0x86 [tda9887]
em28xx #0: found i2c device @ 0x8e [remote IR sensor]
em28xx #0: found i2c device @ 0xa0 [eeprom]
em28xx #0: found i2c device @ 0xc6 [tuner (analog)]
em28xx #0: V4L2 device registered as /dev/video0
em28xx #0: Found Pinnacle PCTV USB 2
usbcore: registered new driver em28xxir_kbd_i2c: module not supported by Novell, setting U taint flag.attach_inform: IR detected ().
ir-kbd-i2c: i2c IR (EM28XX Pinnacle PCTV) detected at i2c-0/0-0047/ir0 [em28xx #0]
i2c IR (EM28XX Pinnacle PCTV)/ir: key 00
i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=1 i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=0 i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
...
...
Quoted 1 line
From
/var/log/messages:
Jan 17 23:51:30 6-199 kernel: i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f Jan 17 23:52:01 6-199 last message repeated 301 times Jan 17 23:53:02 6-199 last message repeated 610 times Jan 17 23:54:03 6-199 last message repeated 609 times Jan 17 23:55:04 6-199 last message repeated 610 times
...
These 'key 3f' are received without touching any bytton on the remote. Pressing any key some times sometimes ( sorry my english :) turn a key UP (3f from your table).
That's all.
Signature · 1 line
Victor Homchenko
Re: [PATCH 25/25] Added remote control support for pinnacle pctv
Hi,
what kernel version do you use?
cat /proc/version
could you try to load the module with i2c_debug=2 and press several buttons. Finally send me the logfile (no need to send it to the list).
Markus
Quoted 110 lines · victorhom
[email protected] wrote
Quoted 3 lines
From: Markus Rechberger <[email protected]>
Hi, Markus!
Remote control is not working, sorry :(
# cat /etc/modprobe.d/tv options em28xx tuner=63 ir_debug=1 i2c_scan=1 i2c_debug=1 options tuner secam=d pal=d# modprobe em28xx # modprobe ir-kbd-i2c # dmesgtveeprom: module not supported by Novell, setting U taint flag.
ir_common: module not supported by Novell, setting U taint flag.
em28xx: module not supported by Novell, setting U taint flag. em28xx v4l2 driver version 0.0.1 loaded
em28xx new video device (2304:0208): interface 0, class 255
em28xx: Alternate settings: 8
em28xx: Alternate setting 0, max size= 0
em28xx: Alternate setting 1, max size= 1024
em28xx: Alternate setting 2, max size= 1448
em28xx: Alternate setting 3, max size= 2048
em28xx: Alternate setting 4, max size= 2304
em28xx: Alternate setting 5, max size= 2580
em28xx: Alternate setting 6, max size= 2892
em28xx: Alternate setting 7, max size= 3072
saa711x: module not supported by Novell, setting U taint flag.
saa711x: Ignoring new-style parameters in presence of obsolete ones
tuner: module not supported by Novell, setting U taint flag.
tda9887: module not supported by Novell, setting U taint flag.attach_inform: saa7113 detected.
tuner 0-0063: chip found @0xc6(em28xx #0)
attach inform: detected I2C address c6
tuner 0-0063: type set to 63 (Philips FMD1216ME MK3 Hybrid Tuner) tda9887 0-0043: chip found @0x86(em28xx #0)
em28xx #0: i2c eeprom 00: 1a eb 67 95 04 23 08 02 10 00 1e 03 98 2a 6a 2e em28xx #0: i2c eeprom 10: 00 00 06 57 6e 00 00 00 8e 00 00 00 07 00 00 00 em28xx #0: i2c eeprom 20: 16 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom 30: 00 00 20 40 20 80 02 20 10 01 00 00 00 00 00 00 em28xx #0: i2c eeprom 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 2e 03 50 00 69 00 em28xx #0: i2c eeprom 70: 6e 00 6e 00 61 00 63 00 6c 00 65 00 20 00 53 00 em28xx #0: i2c eeprom 80: 79 00 73 00 74 00 65 00 6d 00 73 00 20 00 47 00 em28xx #0: i2c eeprom 90: 6d 00 62 00 48 00 00 00 2a 03 50 00 43 00 54 00 em28xx #0: i2c eeprom a0: 56 00 20 00 55 00 53 00 42 00 32 00 20 00 50 00 em28xx #0: i2c eeprom b0: 41 00 4c 00 2f 00 53 00 45 00 43 00 41 00 4d 00 em28xx #0: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 em28xx #0: i2c eeprom f0: 00 00 00 00 00 00 00 00 0c 22 17 38 02 90 2b 3e EEPROM ID=0x9567eb1a
Vendor/Product ID= 2304:0208
AC97 audio (5 sample rates)
500mA max power
Table at0x06, strings=0x2a98,0x2e6a,0x0000
em28xx #0: found i2c device @0x4a[saa7113h]
em28xx #0: found i2c device @0x86[tda9887]
em28xx #0: found i2c device @0x8e[remote IR sensor]
em28xx #0: found i2c device @0xa0[eeprom]
em28xx #0: found i2c device @0xc6[tuner (analog)]
em28xx #0: V4L2 device registered as/dev/video0
em28xx #0: Found Pinnacle PCTV USB 2
usbcore: registered new driver em28xxir_kbd_i2c: module not supported by Novell, setting U taint flag.attach_inform: IR detected ().
ir-kbd-i2c: i2c IR (EM28XX Pinnacle PCTV) detected at i2c-0/0-0047/ir0 [em28xx #0]
i2c IR (EM28XX Pinnacle PCTV)/ir: key 00
i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=1 i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV): unknown key: key=0x00 raw=0x00 down=0 i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f
...
...Quoted 1 line
From
/var/log/messages:Jan 17 23:51:30 6-199 kernel: i2c IR (EM28XX Pinnacle PCTV)/ir: key 3f Jan 17 23:52:01 6-199 last message repeated 301 times Jan 17 23:53:02 6-199 last message repeated 610 times Jan 17 23:54:03 6-199 last message repeated 609 times Jan 17 23:55:04 6-199 last message repeated 610 times...
These 'key 3f' are received without touching any bytton on the remote. Pressing any key some times sometimes ( sorry my english :) turn a key UP (3f from your table).
That's all.
Quoted 8 lines
--
Victor Homchenko--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
--
Markus Rechberger