Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb

+1860 -969
+1
Documentation/video4linux/CARDLIST.tuner
··· 68 tuner=67 - Philips TD1316 Hybrid Tuner 69 tuner=68 - Philips TUV1236D ATSC/NTSC dual in 70 tuner=69 - Tena TNF 5335 MF
··· 68 tuner=67 - Philips TD1316 Hybrid Tuner 69 tuner=68 - Philips TUV1236D ATSC/NTSC dual in 70 tuner=69 - Tena TNF 5335 MF 71 + tuner=70 - Samsung TCPN 2121P30A
+1 -1
drivers/media/dvb/bt8xx/bt878.c
··· 542 .remove = bt878_remove, 543 }; 544 545 - static int bt878_pci_driver_registered = 0; 546 547 /*******************************/ 548 /* Module management functions */
··· 542 .remove = bt878_remove, 543 }; 544 545 + static int bt878_pci_driver_registered; 546 547 /*******************************/ 548 /* Module management functions */
+11 -11
drivers/media/dvb/dvb-core/dvbdev.c
··· 33 #include <linux/device.h> 34 #include <linux/fs.h> 35 #include <linux/cdev.h> 36 - 37 #include "dvbdev.h" 38 39 static int dvbdev_debug; ··· 44 #define dprintk if (dvbdev_debug) printk 45 46 static LIST_HEAD(dvb_adapter_list); 47 - static DECLARE_MUTEX(dvbdev_register_lock); 48 49 static const char * const dnames[] = { 50 "video", "audio", "sec", "frontend", "demux", "dvr", "ca", ··· 202 struct dvb_device *dvbdev; 203 int id; 204 205 - if (down_interruptible (&dvbdev_register_lock)) 206 return -ERESTARTSYS; 207 208 if ((id = dvbdev_get_free_id (adap, type)) < 0) { 209 - up (&dvbdev_register_lock); 210 *pdvbdev = NULL; 211 printk ("%s: could get find free device id...\n", __FUNCTION__); 212 return -ENFILE; ··· 215 *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL); 216 217 if (!dvbdev) { 218 - up(&dvbdev_register_lock); 219 return -ENOMEM; 220 } 221 222 - up (&dvbdev_register_lock); 223 224 memcpy(dvbdev, template, sizeof(struct dvb_device)); 225 dvbdev->type = type; ··· 289 { 290 int num; 291 292 - if (down_interruptible (&dvbdev_register_lock)) 293 return -ERESTARTSYS; 294 295 if ((num = dvbdev_get_free_adapter_num ()) < 0) { 296 - up (&dvbdev_register_lock); 297 return -ENFILE; 298 } 299 ··· 309 310 list_add_tail (&adap->list_head, &dvb_adapter_list); 311 312 - up (&dvbdev_register_lock); 313 314 return num; 315 } ··· 320 { 321 devfs_remove("dvb/adapter%d", adap->num); 322 323 - if (down_interruptible (&dvbdev_register_lock)) 324 return -ERESTARTSYS; 325 list_del (&adap->list_head); 326 - up (&dvbdev_register_lock); 327 return 0; 328 } 329 EXPORT_SYMBOL(dvb_unregister_adapter);
··· 33 #include <linux/device.h> 34 #include <linux/fs.h> 35 #include <linux/cdev.h> 36 + #include <linux/mutex.h> 37 #include "dvbdev.h" 38 39 static int dvbdev_debug; ··· 44 #define dprintk if (dvbdev_debug) printk 45 46 static LIST_HEAD(dvb_adapter_list); 47 + static DEFINE_MUTEX(dvbdev_register_lock); 48 49 static const char * const dnames[] = { 50 "video", "audio", "sec", "frontend", "demux", "dvr", "ca", ··· 202 struct dvb_device *dvbdev; 203 int id; 204 205 + if (mutex_lock_interruptible(&dvbdev_register_lock)) 206 return -ERESTARTSYS; 207 208 if ((id = dvbdev_get_free_id (adap, type)) < 0) { 209 + mutex_unlock(&dvbdev_register_lock); 210 *pdvbdev = NULL; 211 printk ("%s: could get find free device id...\n", __FUNCTION__); 212 return -ENFILE; ··· 215 *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL); 216 217 if (!dvbdev) { 218 + mutex_unlock(&dvbdev_register_lock); 219 return -ENOMEM; 220 } 221 222 + mutex_unlock(&dvbdev_register_lock); 223 224 memcpy(dvbdev, template, sizeof(struct dvb_device)); 225 dvbdev->type = type; ··· 289 { 290 int num; 291 292 + if (mutex_lock_interruptible(&dvbdev_register_lock)) 293 return -ERESTARTSYS; 294 295 if ((num = dvbdev_get_free_adapter_num ()) < 0) { 296 + mutex_unlock(&dvbdev_register_lock); 297 return -ENFILE; 298 } 299 ··· 309 310 list_add_tail (&adap->list_head, &dvb_adapter_list); 311 312 + mutex_unlock(&dvbdev_register_lock); 313 314 return num; 315 } ··· 320 { 321 devfs_remove("dvb/adapter%d", adap->num); 322 323 + if (mutex_lock_interruptible(&dvbdev_register_lock)) 324 return -ERESTARTSYS; 325 list_del (&adap->list_head); 326 + mutex_unlock(&dvbdev_register_lock); 327 return 0; 328 } 329 EXPORT_SYMBOL(dvb_unregister_adapter);
+2
drivers/media/dvb/dvb-usb/cxusb.c
··· 691 module_exit (cxusb_module_exit); 692 693 MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 694 MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design"); 695 MODULE_VERSION("1.0-alpha"); 696 MODULE_LICENSE("GPL");
··· 691 module_exit (cxusb_module_exit); 692 693 MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); 694 + MODULE_AUTHOR("Michael Krufky <mkrufky@m1k.net>"); 695 + MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); 696 MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design"); 697 MODULE_VERSION("1.0-alpha"); 698 MODULE_LICENSE("GPL");
+1 -1
drivers/media/dvb/frontends/dvb-pll.c
··· 333 .name = "Samsung TBMV30111IN", 334 .min = 54000000, 335 .max = 860000000, 336 - .count = 4, 337 .entries = { 338 { 172000000, 44000000, 166666, 0xb4, 0x01 }, 339 { 214000000, 44000000, 166666, 0xb4, 0x02 },
··· 333 .name = "Samsung TBMV30111IN", 334 .min = 54000000, 335 .max = 860000000, 336 + .count = 6, 337 .entries = { 338 { 172000000, 44000000, 166666, 0xb4, 0x01 }, 339 { 214000000, 44000000, 166666, 0xb4, 0x02 },
+2 -2
drivers/media/dvb/ttpci/av7110.c
··· 81 static int hw_sections; 82 static int rgb_on; 83 static int volume = 255; 84 - static int budgetpatch = 0; 85 86 module_param_named(debug, av7110_debug, int, 0644); 87 MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)"); ··· 103 104 static void restart_feeds(struct av7110 *av7110); 105 106 - static int av7110_num = 0; 107 108 #define FE_FUNC_OVERRIDE(fe_func, av7110_copy, av7110_func) \ 109 {\
··· 81 static int hw_sections; 82 static int rgb_on; 83 static int volume = 255; 84 + static int budgetpatch; 85 86 module_param_named(debug, av7110_debug, int, 0644); 87 MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)"); ··· 103 104 static void restart_feeds(struct av7110 *av7110); 105 106 + static int av7110_num; 107 108 #define FE_FUNC_OVERRIDE(fe_func, av7110_copy, av7110_func) \ 109 {\
+20 -20
drivers/media/dvb/ttpci/av7110_hw.c
··· 146 { 147 int i; 148 int blocks, rest; 149 - u32 base, bootblock = BOOT_BLOCK; 150 151 dprintk(4, "%p\n", av7110); 152 153 - blocks = len / BOOT_MAX_SIZE; 154 - rest = len % BOOT_MAX_SIZE; 155 base = DRAM_START_CODE; 156 157 for (i = 0; i < blocks; i++) { 158 - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 159 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i); 160 return -ETIMEDOUT; 161 } 162 dprintk(4, "writing DRAM block %d\n", i); 163 mwdebi(av7110, DEBISWAB, bootblock, 164 - ((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE); 165 bootblock ^= 0x1400; 166 - iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4); 167 - iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, BOOT_MAX_SIZE, 2); 168 - iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 169 - base += BOOT_MAX_SIZE; 170 } 171 172 if (rest > 0) { 173 - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 174 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n"); 175 return -ETIMEDOUT; 176 } 177 if (rest > 4) 178 mwdebi(av7110, DEBISWAB, bootblock, 179 - ((char*)data) + i * BOOT_MAX_SIZE, rest); 180 else 181 mwdebi(av7110, DEBISWAB, bootblock, 182 - ((char*)data) + i * BOOT_MAX_SIZE - 4, rest + 4); 183 184 - iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4); 185 - iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2); 186 - iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 187 } 188 - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 189 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n"); 190 return -ETIMEDOUT; 191 } 192 - iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2); 193 - iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 194 - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0) { 195 printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n"); 196 return -ETIMEDOUT; 197 } ··· 262 //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT); 263 264 mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode)); 265 - iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 266 267 if (saa7146_wait_for_debi_done(av7110->dev, 1)) { 268 printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
··· 146 { 147 int i; 148 int blocks, rest; 149 + u32 base, bootblock = AV7110_BOOT_BLOCK; 150 151 dprintk(4, "%p\n", av7110); 152 153 + blocks = len / AV7110_BOOT_MAX_SIZE; 154 + rest = len % AV7110_BOOT_MAX_SIZE; 155 base = DRAM_START_CODE; 156 157 for (i = 0; i < blocks; i++) { 158 + if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 159 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i); 160 return -ETIMEDOUT; 161 } 162 dprintk(4, "writing DRAM block %d\n", i); 163 mwdebi(av7110, DEBISWAB, bootblock, 164 + ((char*)data) + i * AV7110_BOOT_MAX_SIZE, AV7110_BOOT_MAX_SIZE); 165 bootblock ^= 0x1400; 166 + iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4); 167 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, AV7110_BOOT_MAX_SIZE, 2); 168 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 169 + base += AV7110_BOOT_MAX_SIZE; 170 } 171 172 if (rest > 0) { 173 + if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 174 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n"); 175 return -ETIMEDOUT; 176 } 177 if (rest > 4) 178 mwdebi(av7110, DEBISWAB, bootblock, 179 + ((char*)data) + i * AV7110_BOOT_MAX_SIZE, rest); 180 else 181 mwdebi(av7110, DEBISWAB, bootblock, 182 + ((char*)data) + i * AV7110_BOOT_MAX_SIZE - 4, rest + 4); 183 184 + iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4); 185 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, rest, 2); 186 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 187 } 188 + if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 189 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n"); 190 return -ETIMEDOUT; 191 } 192 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, 0, 2); 193 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 194 + if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_AV7110_BOOT_COMPLETE) < 0) { 195 printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n"); 196 return -ETIMEDOUT; 197 } ··· 262 //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT); 263 264 mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode)); 265 + iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 266 267 if (saa7146_wait_for_debi_done(av7110->dev, 1)) { 268 printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
+6 -6
drivers/media/dvb/ttpci/av7110_hw.h
··· 18 { 19 BOOTSTATE_BUFFER_EMPTY = 0, 20 BOOTSTATE_BUFFER_FULL = 1, 21 - BOOTSTATE_BOOT_COMPLETE = 2 22 }; 23 24 enum av7110_type_rec_play_format ··· 295 #define DPRAM_BASE 0x4000 296 297 /* boot protocol area */ 298 - #define BOOT_STATE (DPRAM_BASE + 0x3F8) 299 - #define BOOT_SIZE (DPRAM_BASE + 0x3FA) 300 - #define BOOT_BASE (DPRAM_BASE + 0x3FC) 301 - #define BOOT_BLOCK (DPRAM_BASE + 0x400) 302 - #define BOOT_MAX_SIZE 0xc00 303 304 /* firmware command protocol area */ 305 #define IRQ_STATE (DPRAM_BASE + 0x0F4)
··· 18 { 19 BOOTSTATE_BUFFER_EMPTY = 0, 20 BOOTSTATE_BUFFER_FULL = 1, 21 + BOOTSTATE_AV7110_BOOT_COMPLETE = 2 22 }; 23 24 enum av7110_type_rec_play_format ··· 295 #define DPRAM_BASE 0x4000 296 297 /* boot protocol area */ 298 + #define AV7110_BOOT_STATE (DPRAM_BASE + 0x3F8) 299 + #define AV7110_BOOT_SIZE (DPRAM_BASE + 0x3FA) 300 + #define AV7110_BOOT_BASE (DPRAM_BASE + 0x3FC) 301 + #define AV7110_BOOT_BLOCK (DPRAM_BASE + 0x400) 302 + #define AV7110_BOOT_MAX_SIZE 0xc00 303 304 /* firmware command protocol area */ 305 #define IRQ_STATE (DPRAM_BASE + 0x0F4)
+2 -1
drivers/media/video/Makefile
··· 8 zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o 9 zr36067-objs := zoran_procfs.o zoran_device.o \ 10 zoran_driver.o zoran_card.o 11 - tuner-objs := tuner-core.o tuner-simple.o mt20xx.o tda8290.o tea5767.o 12 13 msp3400-objs := msp3400-driver.o msp3400-kthreads.o 14
··· 8 zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o 9 zr36067-objs := zoran_procfs.o zoran_device.o \ 10 zoran_driver.o zoran_card.o 11 + tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ 12 + mt20xx.o tda8290.o tea5767.o 13 14 msp3400-objs := msp3400-driver.o msp3400-kthreads.o 15
+3 -3
drivers/media/video/arv.c
··· 129 static int freq = DEFAULT_FREQ; /* BCLK: available 50 or 70 (MHz) */ 130 static int vga = 0; /* default mode(0:QVGA mode, other:VGA mode) */ 131 static int vga_interlace = 0; /* 0 is normal mode for, else interlace mode */ 132 - MODULE_PARM(freq, "i"); 133 - MODULE_PARM(vga, "i"); 134 - MODULE_PARM(vga_interlace, "i"); 135 136 static int ar_initialize(struct video_device *dev); 137
··· 129 static int freq = DEFAULT_FREQ; /* BCLK: available 50 or 70 (MHz) */ 130 static int vga = 0; /* default mode(0:QVGA mode, other:VGA mode) */ 131 static int vga_interlace = 0; /* 0 is normal mode for, else interlace mode */ 132 + module_param(freq, int, 0); 133 + module_param(vga, int, 0); 134 + module_param(vga_interlace, int, 0); 135 136 static int ar_initialize(struct video_device *dev); 137
+1 -1
drivers/media/video/bt832.c
··· 43 I2C_CLIENT_END }; 44 I2C_CLIENT_INSMOD; 45 46 - int debug = 0; /* debug output */ 47 module_param(debug, int, 0644); 48 49 /* ---------------------------------------------------------------------- */
··· 43 I2C_CLIENT_END }; 44 I2C_CLIENT_INSMOD; 45 46 + int debug; /* debug output */ 47 module_param(debug, int, 0644); 48 49 /* ---------------------------------------------------------------------- */
+1 -1
drivers/media/video/btcx-risc.c
··· 37 MODULE_AUTHOR("Gerd Knorr"); 38 MODULE_LICENSE("GPL"); 39 40 - static unsigned int debug = 0; 41 module_param(debug, int, 0644); 42 MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)"); 43
··· 37 MODULE_AUTHOR("Gerd Knorr"); 38 MODULE_LICENSE("GPL"); 39 40 + static unsigned int debug; 41 module_param(debug, int, 0644); 42 MODULE_PARM_DESC(debug,"debug messages, default is 0 (no)"); 43
+3 -3
drivers/media/video/bttv-cards.c
··· 92 static int __devinit pvr_boot(struct bttv *btv); 93 94 /* config variables */ 95 - static unsigned int triton1=0; 96 - static unsigned int vsfx=0; 97 static unsigned int latency = UNSET; 98 int no_overlay=-1; 99 ··· 106 #ifdef MODULE 107 static unsigned int autoload = 1; 108 #else 109 - static unsigned int autoload = 0; 110 #endif 111 static unsigned int gpiomask = UNSET; 112 static unsigned int audioall = UNSET;
··· 92 static int __devinit pvr_boot(struct bttv *btv); 93 94 /* config variables */ 95 + static unsigned int triton1; 96 + static unsigned int vsfx; 97 static unsigned int latency = UNSET; 98 int no_overlay=-1; 99 ··· 106 #ifdef MODULE 107 static unsigned int autoload = 1; 108 #else 109 + static unsigned int autoload; 110 #endif 111 static unsigned int gpiomask = UNSET; 112 static unsigned int audioall = UNSET;
+43 -44
drivers/media/video/bttv-driver.c
··· 48 unsigned int bttv_num; /* number of Bt848s in use */ 49 struct bttv bttvs[BTTV_MAX]; 50 51 - unsigned int bttv_debug = 0; 52 unsigned int bttv_verbose = 1; 53 - unsigned int bttv_gpio = 0; 54 55 /* config variables */ 56 #ifdef __BIG_ENDIAN 57 static unsigned int bigendian=1; 58 #else 59 - static unsigned int bigendian=0; 60 #endif 61 static unsigned int radio[BTTV_MAX]; 62 - static unsigned int irq_debug = 0; 63 static unsigned int gbuffers = 8; 64 static unsigned int gbufsize = 0x208000; 65 66 static int video_nr = -1; 67 static int radio_nr = -1; 68 static int vbi_nr = -1; 69 - static int debug_latency = 0; 70 71 - static unsigned int fdsr = 0; 72 73 /* options */ 74 - static unsigned int combfilter = 0; 75 - static unsigned int lumafilter = 0; 76 static unsigned int automute = 1; 77 - static unsigned int chroma_agc = 0; 78 static unsigned int adc_crush = 1; 79 static unsigned int whitecrush_upper = 0xCF; 80 static unsigned int whitecrush_lower = 0x7F; 81 - static unsigned int vcr_hack = 0; 82 - static unsigned int irq_iswitch = 0; 83 static unsigned int uv_ratio = 50; 84 - static unsigned int full_luma_range = 0; 85 - static unsigned int coring = 0; 86 extern int no_overlay; 87 88 /* API features (turn on/off stuff for testing) */ 89 static unsigned int v4l2 = 1; 90 - 91 92 /* insmod args */ 93 module_param(bttv_verbose, int, 0644); ··· 684 return 1; 685 686 /* is it free? */ 687 - down(&btv->reslock); 688 if (btv->resources & bit) { 689 /* no, someone else uses it */ 690 - up(&btv->reslock); 691 return 0; 692 } 693 /* it's free, grab it */ 694 fh->resources |= bit; 695 btv->resources |= bit; 696 - up(&btv->reslock); 697 return 1; 698 } 699 ··· 716 /* trying to free ressources not allocated by us ... */ 717 printk("bttv: BUG! (btres)\n"); 718 } 719 - down(&btv->reslock); 720 fh->resources &= ~bits; 721 btv->resources &= ~bits; 722 - up(&btv->reslock); 723 } 724 725 /* ----------------------------------------------------------------------- */ ··· 1536 case VIDIOCSFREQ: 1537 { 1538 unsigned long *freq = arg; 1539 - down(&btv->lock); 1540 btv->freq=*freq; 1541 bttv_call_i2c_clients(btv,VIDIOCSFREQ,freq); 1542 if (btv->has_matchbox && btv->radio_user) 1543 tea5757_set_freq(btv,*freq); 1544 - up(&btv->lock); 1545 return 0; 1546 } 1547 ··· 1571 if (v->mode >= BTTV_TVNORMS) 1572 return -EINVAL; 1573 1574 - down(&btv->lock); 1575 set_tvnorm(btv,v->mode); 1576 bttv_call_i2c_clients(btv,cmd,v); 1577 - up(&btv->lock); 1578 return 0; 1579 } 1580 ··· 1611 if (v->norm >= BTTV_TVNORMS) 1612 return -EINVAL; 1613 1614 - down(&btv->lock); 1615 if (channel == btv->input && 1616 v->norm == btv->tvnorm) { 1617 /* nothing to do */ 1618 - up(&btv->lock); 1619 return 0; 1620 } 1621 1622 btv->tvnorm = v->norm; 1623 set_input(btv,v->channel); 1624 - up(&btv->lock); 1625 return 0; 1626 } 1627 ··· 1634 v->flags |= VIDEO_AUDIO_MUTABLE; 1635 v->mode = VIDEO_SOUND_MONO; 1636 1637 - down(&btv->lock); 1638 bttv_call_i2c_clients(btv,cmd,v); 1639 1640 /* card specific hooks */ 1641 if (btv->audio_hook) 1642 btv->audio_hook(btv,v,0); 1643 1644 - up(&btv->lock); 1645 return 0; 1646 } 1647 case VIDIOCSAUDIO: ··· 1652 if (audio >= bttv_tvcards[btv->c.type].audio_inputs) 1653 return -EINVAL; 1654 1655 - down(&btv->lock); 1656 audio_mux(btv, (v->flags&VIDEO_AUDIO_MUTE) ? AUDIO_MUTE : AUDIO_UNMUTE); 1657 bttv_call_i2c_clients(btv,cmd,v); 1658 ··· 1660 if (btv->audio_hook) 1661 btv->audio_hook(btv,v,1); 1662 1663 - up(&btv->lock); 1664 return 0; 1665 } 1666 ··· 1694 if (i == BTTV_TVNORMS) 1695 return -EINVAL; 1696 1697 - down(&btv->lock); 1698 set_tvnorm(btv,i); 1699 i2c_vidiocschan(btv); 1700 - up(&btv->lock); 1701 return 0; 1702 } 1703 case VIDIOC_QUERYSTD: ··· 1755 1756 if (*i > bttv_tvcards[btv->c.type].video_inputs) 1757 return -EINVAL; 1758 - down(&btv->lock); 1759 set_input(btv,*i); 1760 - up(&btv->lock); 1761 return 0; 1762 } 1763 ··· 1769 return -EINVAL; 1770 if (0 != t->index) 1771 return -EINVAL; 1772 - down(&btv->lock); 1773 memset(t,0,sizeof(*t)); 1774 strcpy(t->name, "Television"); 1775 t->type = V4L2_TUNER_ANALOG_TV; ··· 1804 } 1805 } 1806 /* FIXME: fill capability+audmode */ 1807 - up(&btv->lock); 1808 return 0; 1809 } 1810 case VIDIOC_S_TUNER: ··· 1815 return -EINVAL; 1816 if (0 != t->index) 1817 return -EINVAL; 1818 - down(&btv->lock); 1819 { 1820 struct video_audio va; 1821 memset(&va, 0, sizeof(struct video_audio)); ··· 1832 if (btv->audio_hook) 1833 btv->audio_hook(btv,&va,1); 1834 } 1835 - up(&btv->lock); 1836 return 0; 1837 } 1838 ··· 1853 return -EINVAL; 1854 if (unlikely (f->type != V4L2_TUNER_ANALOG_TV)) 1855 return -EINVAL; 1856 - down(&btv->lock); 1857 btv->freq = f->frequency; 1858 bttv_call_i2c_clients(btv,VIDIOCSFREQ,&btv->freq); 1859 if (btv->has_matchbox && btv->radio_user) 1860 tea5757_set_freq(btv,btv->freq); 1861 - up(&btv->lock); 1862 return 0; 1863 } 1864 case VIDIOC_LOG_STATUS: ··· 3156 return -ENODEV; 3157 3158 dprintk("bttv%d: open called (radio)\n",btv->c.nr); 3159 - down(&btv->lock); 3160 3161 btv->radio_user++; 3162 ··· 3165 bttv_call_i2c_clients(btv,AUDC_SET_RADIO,&btv->tuner_type); 3166 audio_mux(btv,AUDIO_RADIO); 3167 3168 - up(&btv->lock); 3169 return 0; 3170 } 3171 ··· 3920 sprintf(btv->c.name,"bttv%d",btv->c.nr); 3921 3922 /* initialize structs / fill in defaults */ 3923 - init_MUTEX(&btv->lock); 3924 - init_MUTEX(&btv->reslock); 3925 spin_lock_init(&btv->s_lock); 3926 spin_lock_init(&btv->gpio_lock); 3927 init_waitqueue_head(&btv->gpioq);
··· 48 unsigned int bttv_num; /* number of Bt848s in use */ 49 struct bttv bttvs[BTTV_MAX]; 50 51 + unsigned int bttv_debug; 52 unsigned int bttv_verbose = 1; 53 + unsigned int bttv_gpio; 54 55 /* config variables */ 56 #ifdef __BIG_ENDIAN 57 static unsigned int bigendian=1; 58 #else 59 + static unsigned int bigendian; 60 #endif 61 static unsigned int radio[BTTV_MAX]; 62 + static unsigned int irq_debug; 63 static unsigned int gbuffers = 8; 64 static unsigned int gbufsize = 0x208000; 65 66 static int video_nr = -1; 67 static int radio_nr = -1; 68 static int vbi_nr = -1; 69 + static int debug_latency; 70 71 + static unsigned int fdsr; 72 73 /* options */ 74 + static unsigned int combfilter; 75 + static unsigned int lumafilter; 76 static unsigned int automute = 1; 77 + static unsigned int chroma_agc; 78 static unsigned int adc_crush = 1; 79 static unsigned int whitecrush_upper = 0xCF; 80 static unsigned int whitecrush_lower = 0x7F; 81 + static unsigned int vcr_hack; 82 + static unsigned int irq_iswitch; 83 static unsigned int uv_ratio = 50; 84 + static unsigned int full_luma_range; 85 + static unsigned int coring; 86 extern int no_overlay; 87 88 /* API features (turn on/off stuff for testing) */ 89 static unsigned int v4l2 = 1; 90 91 /* insmod args */ 92 module_param(bttv_verbose, int, 0644); ··· 685 return 1; 686 687 /* is it free? */ 688 + mutex_lock(&btv->reslock); 689 if (btv->resources & bit) { 690 /* no, someone else uses it */ 691 + mutex_unlock(&btv->reslock); 692 return 0; 693 } 694 /* it's free, grab it */ 695 fh->resources |= bit; 696 btv->resources |= bit; 697 + mutex_unlock(&btv->reslock); 698 return 1; 699 } 700 ··· 717 /* trying to free ressources not allocated by us ... */ 718 printk("bttv: BUG! (btres)\n"); 719 } 720 + mutex_lock(&btv->reslock); 721 fh->resources &= ~bits; 722 btv->resources &= ~bits; 723 + mutex_unlock(&btv->reslock); 724 } 725 726 /* ----------------------------------------------------------------------- */ ··· 1537 case VIDIOCSFREQ: 1538 { 1539 unsigned long *freq = arg; 1540 + mutex_lock(&btv->lock); 1541 btv->freq=*freq; 1542 bttv_call_i2c_clients(btv,VIDIOCSFREQ,freq); 1543 if (btv->has_matchbox && btv->radio_user) 1544 tea5757_set_freq(btv,*freq); 1545 + mutex_unlock(&btv->lock); 1546 return 0; 1547 } 1548 ··· 1572 if (v->mode >= BTTV_TVNORMS) 1573 return -EINVAL; 1574 1575 + mutex_lock(&btv->lock); 1576 set_tvnorm(btv,v->mode); 1577 bttv_call_i2c_clients(btv,cmd,v); 1578 + mutex_unlock(&btv->lock); 1579 return 0; 1580 } 1581 ··· 1612 if (v->norm >= BTTV_TVNORMS) 1613 return -EINVAL; 1614 1615 + mutex_lock(&btv->lock); 1616 if (channel == btv->input && 1617 v->norm == btv->tvnorm) { 1618 /* nothing to do */ 1619 + mutex_unlock(&btv->lock); 1620 return 0; 1621 } 1622 1623 btv->tvnorm = v->norm; 1624 set_input(btv,v->channel); 1625 + mutex_unlock(&btv->lock); 1626 return 0; 1627 } 1628 ··· 1635 v->flags |= VIDEO_AUDIO_MUTABLE; 1636 v->mode = VIDEO_SOUND_MONO; 1637 1638 + mutex_lock(&btv->lock); 1639 bttv_call_i2c_clients(btv,cmd,v); 1640 1641 /* card specific hooks */ 1642 if (btv->audio_hook) 1643 btv->audio_hook(btv,v,0); 1644 1645 + mutex_unlock(&btv->lock); 1646 return 0; 1647 } 1648 case VIDIOCSAUDIO: ··· 1653 if (audio >= bttv_tvcards[btv->c.type].audio_inputs) 1654 return -EINVAL; 1655 1656 + mutex_lock(&btv->lock); 1657 audio_mux(btv, (v->flags&VIDEO_AUDIO_MUTE) ? AUDIO_MUTE : AUDIO_UNMUTE); 1658 bttv_call_i2c_clients(btv,cmd,v); 1659 ··· 1661 if (btv->audio_hook) 1662 btv->audio_hook(btv,v,1); 1663 1664 + mutex_unlock(&btv->lock); 1665 return 0; 1666 } 1667 ··· 1695 if (i == BTTV_TVNORMS) 1696 return -EINVAL; 1697 1698 + mutex_lock(&btv->lock); 1699 set_tvnorm(btv,i); 1700 i2c_vidiocschan(btv); 1701 + mutex_unlock(&btv->lock); 1702 return 0; 1703 } 1704 case VIDIOC_QUERYSTD: ··· 1756 1757 if (*i > bttv_tvcards[btv->c.type].video_inputs) 1758 return -EINVAL; 1759 + mutex_lock(&btv->lock); 1760 set_input(btv,*i); 1761 + mutex_unlock(&btv->lock); 1762 return 0; 1763 } 1764 ··· 1770 return -EINVAL; 1771 if (0 != t->index) 1772 return -EINVAL; 1773 + mutex_lock(&btv->lock); 1774 memset(t,0,sizeof(*t)); 1775 strcpy(t->name, "Television"); 1776 t->type = V4L2_TUNER_ANALOG_TV; ··· 1805 } 1806 } 1807 /* FIXME: fill capability+audmode */ 1808 + mutex_unlock(&btv->lock); 1809 return 0; 1810 } 1811 case VIDIOC_S_TUNER: ··· 1816 return -EINVAL; 1817 if (0 != t->index) 1818 return -EINVAL; 1819 + mutex_lock(&btv->lock); 1820 { 1821 struct video_audio va; 1822 memset(&va, 0, sizeof(struct video_audio)); ··· 1833 if (btv->audio_hook) 1834 btv->audio_hook(btv,&va,1); 1835 } 1836 + mutex_unlock(&btv->lock); 1837 return 0; 1838 } 1839 ··· 1854 return -EINVAL; 1855 if (unlikely (f->type != V4L2_TUNER_ANALOG_TV)) 1856 return -EINVAL; 1857 + mutex_lock(&btv->lock); 1858 btv->freq = f->frequency; 1859 bttv_call_i2c_clients(btv,VIDIOCSFREQ,&btv->freq); 1860 if (btv->has_matchbox && btv->radio_user) 1861 tea5757_set_freq(btv,btv->freq); 1862 + mutex_unlock(&btv->lock); 1863 return 0; 1864 } 1865 case VIDIOC_LOG_STATUS: ··· 3157 return -ENODEV; 3158 3159 dprintk("bttv%d: open called (radio)\n",btv->c.nr); 3160 + mutex_lock(&btv->lock); 3161 3162 btv->radio_user++; 3163 ··· 3166 bttv_call_i2c_clients(btv,AUDC_SET_RADIO,&btv->tuner_type); 3167 audio_mux(btv,AUDIO_RADIO); 3168 3169 + mutex_unlock(&btv->lock); 3170 return 0; 3171 } 3172 ··· 3921 sprintf(btv->c.name,"bttv%d",btv->c.nr); 3922 3923 /* initialize structs / fill in defaults */ 3924 + mutex_init(&btv->lock); 3925 + mutex_init(&btv->reslock); 3926 spin_lock_init(&btv->s_lock); 3927 spin_lock_init(&btv->gpio_lock); 3928 init_waitqueue_head(&btv->gpioq);
+3 -3
drivers/media/video/bttv-i2c.c
··· 41 42 static int attach_inform(struct i2c_client *client); 43 44 - static int i2c_debug = 0; 45 - static int i2c_hw = 0; 46 - static int i2c_scan = 0; 47 module_param(i2c_debug, int, 0644); 48 module_param(i2c_hw, int, 0444); 49 module_param(i2c_scan, int, 0444);
··· 41 42 static int attach_inform(struct i2c_client *client); 43 44 + static int i2c_debug; 45 + static int i2c_hw; 46 + static int i2c_scan; 47 module_param(i2c_debug, int, 0644); 48 module_param(i2c_hw, int, 0444); 49 module_param(i2c_scan, int, 0444);
+3 -2
drivers/media/video/bttvp.h
··· 35 #include <linux/videodev.h> 36 #include <linux/pci.h> 37 #include <linux/input.h> 38 #include <asm/scatterlist.h> 39 #include <asm/io.h> 40 ··· 310 311 /* locking */ 312 spinlock_t s_lock; 313 - struct semaphore lock; 314 int resources; 315 - struct semaphore reslock; 316 #ifdef VIDIOC_G_PRIORITY 317 struct v4l2_prio_state prio; 318 #endif
··· 35 #include <linux/videodev.h> 36 #include <linux/pci.h> 37 #include <linux/input.h> 38 + #include <linux/mutex.h> 39 #include <asm/scatterlist.h> 40 #include <asm/io.h> 41 ··· 309 310 /* locking */ 311 spinlock_t s_lock; 312 + struct mutex lock; 313 int resources; 314 + struct mutex reslock; 315 #ifdef VIDIOC_G_PRIORITY 316 struct v4l2_prio_state prio; 317 #endif
+1 -1
drivers/media/video/cx25840/cx25840-core.c
··· 43 static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; 44 45 46 - int cx25840_debug = 0; 47 48 module_param_named(debug,cx25840_debug, int, 0644); 49
··· 43 static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; 44 45 46 + static int cx25840_debug; 47 48 module_param_named(debug,cx25840_debug, int, 0644); 49
+1 -2
drivers/media/video/cx88/Kconfig
··· 31 32 config VIDEO_CX88_ALSA 33 tristate "ALSA DMA audio support" 34 - depends on VIDEO_CX88 && SND 35 - select SND_PCM_OSS 36 ---help--- 37 This is a video4linux driver for direct (DMA) audio on 38 Conexant 2388x based TV cards.
··· 31 32 config VIDEO_CX88_ALSA 33 tristate "ALSA DMA audio support" 34 + depends on VIDEO_CX88 && SND && EXPERIMENTAL 35 ---help--- 36 This is a video4linux driver for direct (DMA) audio on 37 Conexant 2388x based TV cards.
+1
drivers/media/video/cx88/Makefile
··· 5 6 obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o cx8802.o cx88-blackbird.o 7 obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o cx88-vp3054-i2c.o 8 9 EXTRA_CFLAGS += -I$(src)/.. 10 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
··· 5 6 obj-$(CONFIG_VIDEO_CX88) += cx88xx.o cx8800.o cx8802.o cx88-blackbird.o 7 obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o cx88-vp3054-i2c.o 8 + obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o 9 10 EXTRA_CFLAGS += -I$(src)/.. 11 EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
+4 -5
drivers/media/video/cx88/cx88-alsa.c
··· 116 MODULE_SUPPORTED_DEVICE("{{Conexant,23881}," 117 "{{Conexant,23882}," 118 "{{Conexant,23883}"); 119 - static unsigned int debug = 0; 120 module_param(debug,int,0644); 121 MODULE_PARM_DESC(debug,"enable debug messages"); 122 ··· 333 .channels_min = 1, 334 .channels_max = 2, 335 .buffer_bytes_max = (2*2048), 336 - .period_bytes_min = 256, 337 .period_bytes_max = 2048, 338 .periods_min = 2, 339 - .periods_max = 16, 340 }; 341 342 /* ··· 653 * Alsa Constructor - Component probe 654 */ 655 656 - static int devno=0; 657 static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci, 658 snd_cx88_card_t **rchip) 659 { ··· 805 .id_table = cx88_audio_pci_tbl, 806 .probe = cx88_audio_initdev, 807 .remove = cx88_audio_finidev, 808 - SND_PCI_PM_CALLBACKS 809 }; 810 811 /****************************************************************************
··· 116 MODULE_SUPPORTED_DEVICE("{{Conexant,23881}," 117 "{{Conexant,23882}," 118 "{{Conexant,23883}"); 119 + static unsigned int debug; 120 module_param(debug,int,0644); 121 MODULE_PARM_DESC(debug,"enable debug messages"); 122 ··· 333 .channels_min = 1, 334 .channels_max = 2, 335 .buffer_bytes_max = (2*2048), 336 + .period_bytes_min = 2048, 337 .period_bytes_max = 2048, 338 .periods_min = 2, 339 + .periods_max = 2, 340 }; 341 342 /* ··· 653 * Alsa Constructor - Component probe 654 */ 655 656 + static int devno; 657 static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci, 658 snd_cx88_card_t **rchip) 659 { ··· 805 .id_table = cx88_audio_pci_tbl, 806 .probe = cx88_audio_initdev, 807 .remove = cx88_audio_finidev, 808 }; 809 810 /****************************************************************************
+8 -7
drivers/media/video/cx88/cx88-core.c
··· 32 #include <linux/pci.h> 33 #include <linux/delay.h> 34 #include <linux/videodev2.h> 35 36 #include "cx88.h" 37 #include <media/v4l2-common.h> ··· 76 77 static unsigned int cx88_devcount; 78 static LIST_HEAD(cx88_devlist); 79 - static DECLARE_MUTEX(devlist); 80 81 #define NO_SYNC_LINE (-1U) 82 ··· 1037 struct list_head *item; 1038 int i; 1039 1040 - down(&devlist); 1041 list_for_each(item,&cx88_devlist) { 1042 core = list_entry(item, struct cx88_core, devlist); 1043 if (pci->bus->number != core->pci_bus) ··· 1048 if (0 != get_ressources(core,pci)) 1049 goto fail_unlock; 1050 atomic_inc(&core->refcount); 1051 - up(&devlist); 1052 return core; 1053 } 1054 core = kzalloc(sizeof(*core),GFP_KERNEL); ··· 1123 cx88_card_setup(core); 1124 cx88_ir_init(core,pci); 1125 1126 - up(&devlist); 1127 return core; 1128 1129 fail_free: 1130 kfree(core); 1131 fail_unlock: 1132 - up(&devlist); 1133 return NULL; 1134 } 1135 ··· 1141 if (!atomic_dec_and_test(&core->refcount)) 1142 return; 1143 1144 - down(&devlist); 1145 cx88_ir_fini(core); 1146 if (0 == core->i2c_rc) 1147 i2c_bit_del_bus(&core->i2c_adap); 1148 list_del(&core->devlist); 1149 iounmap(core->lmmio); 1150 cx88_devcount--; 1151 - up(&devlist); 1152 kfree(core); 1153 } 1154
··· 32 #include <linux/pci.h> 33 #include <linux/delay.h> 34 #include <linux/videodev2.h> 35 + #include <linux/mutex.h> 36 37 #include "cx88.h" 38 #include <media/v4l2-common.h> ··· 75 76 static unsigned int cx88_devcount; 77 static LIST_HEAD(cx88_devlist); 78 + static DEFINE_MUTEX(devlist); 79 80 #define NO_SYNC_LINE (-1U) 81 ··· 1036 struct list_head *item; 1037 int i; 1038 1039 + mutex_lock(&devlist); 1040 list_for_each(item,&cx88_devlist) { 1041 core = list_entry(item, struct cx88_core, devlist); 1042 if (pci->bus->number != core->pci_bus) ··· 1047 if (0 != get_ressources(core,pci)) 1048 goto fail_unlock; 1049 atomic_inc(&core->refcount); 1050 + mutex_unlock(&devlist); 1051 return core; 1052 } 1053 core = kzalloc(sizeof(*core),GFP_KERNEL); ··· 1122 cx88_card_setup(core); 1123 cx88_ir_init(core,pci); 1124 1125 + mutex_unlock(&devlist); 1126 return core; 1127 1128 fail_free: 1129 kfree(core); 1130 fail_unlock: 1131 + mutex_unlock(&devlist); 1132 return NULL; 1133 } 1134 ··· 1140 if (!atomic_dec_and_test(&core->refcount)) 1141 return; 1142 1143 + mutex_lock(&devlist); 1144 cx88_ir_fini(core); 1145 if (0 == core->i2c_rc) 1146 i2c_bit_del_bus(&core->i2c_adap); 1147 list_del(&core->devlist); 1148 iounmap(core->lmmio); 1149 cx88_devcount--; 1150 + mutex_unlock(&devlist); 1151 kfree(core); 1152 } 1153
+7 -1
drivers/media/video/cx88/cx88-tvaudio.c
··· 60 module_param(audio_debug, int, 0644); 61 MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]"); 62 63 #define dprintk(fmt, arg...) if (audio_debug) \ 64 printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) 65 ··· 160 cx_write(AUD_I2SOUTPUTCNTL, 1); 161 cx_write(AUD_I2SCNTL, 0); 162 /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */ 163 - } else { 164 ctl |= EN_DAC_ENABLE; 165 cx_write(AUD_CTL, ctl); 166 }
··· 60 module_param(audio_debug, int, 0644); 61 MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]"); 62 63 + static unsigned int always_analog = 0; 64 + module_param(always_analog,int,0644); 65 + MODULE_PARM_DESC(always_analog,"force analog audio out"); 66 + 67 + 68 #define dprintk(fmt, arg...) if (audio_debug) \ 69 printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) 70 ··· 155 cx_write(AUD_I2SOUTPUTCNTL, 1); 156 cx_write(AUD_I2SCNTL, 0); 157 /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */ 158 + } 159 + if ((always_analog) || (!cx88_boards[core->board].blackbird)) { 160 ctl |= EN_DAC_ENABLE; 161 cx_write(AUD_CTL, ctl); 162 }
+4
drivers/media/video/cx88/cx88-vp3054-i2c.c
··· 32 #include "cx88-vp3054-i2c.h" 33 34 35 /* ----------------------------------------------------------------------- */ 36 37 static void vp3054_bit_setscl(void *data, int state)
··· 32 #include "cx88-vp3054-i2c.h" 33 34 35 + MODULE_DESCRIPTION("driver for cx2388x VP3054 design"); 36 + MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); 37 + MODULE_LICENSE("GPL"); 38 + 39 /* ----------------------------------------------------------------------- */ 40 41 static void vp3054_bit_setscl(void *data, int state)
+77
drivers/media/video/em28xx/em28xx-input.c
··· 76 [ 0x40 ] = KEY_ZOOM, 77 }; 78 79 /* ----------------------------------------------------------------------- */ 80 81 static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) ··· 190 return 1; 191 } 192 193 /* ----------------------------------------------------------------------- */ 194 void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir) 195 { ··· 233 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Terratec)"); 234 break; 235 case (EM2820_BOARD_PINNACLE_USB_2): 236 break; 237 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): 238 ir->ir_codes = ir_codes_hauppauge_new;
··· 76 [ 0x40 ] = KEY_ZOOM, 77 }; 78 79 + static IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE] = { 80 + [ 0x3a ] = KEY_KP0, 81 + [ 0x31 ] = KEY_KP1, 82 + [ 0x32 ] = KEY_KP2, 83 + [ 0x33 ] = KEY_KP3, 84 + [ 0x34 ] = KEY_KP4, 85 + [ 0x35 ] = KEY_KP5, 86 + [ 0x36 ] = KEY_KP6, 87 + [ 0x37 ] = KEY_KP7, 88 + [ 0x38 ] = KEY_KP8, 89 + [ 0x39 ] = KEY_KP9, 90 + 91 + [ 0x2f ] = KEY_POWER, 92 + 93 + [ 0x2e ] = KEY_P, 94 + [ 0x1f ] = KEY_L, 95 + [ 0x2b ] = KEY_I, 96 + 97 + [ 0x2d ] = KEY_ZOOM, 98 + [ 0x1e ] = KEY_ZOOM, 99 + [ 0x1b ] = KEY_VOLUMEUP, 100 + [ 0x0f ] = KEY_VOLUMEDOWN, 101 + [ 0x17 ] = KEY_CHANNELUP, 102 + [ 0x1c ] = KEY_CHANNELDOWN, 103 + [ 0x25 ] = KEY_INFO, 104 + 105 + [ 0x3c ] = KEY_MUTE, 106 + 107 + [ 0x3d ] = KEY_LEFT, 108 + [ 0x3b ] = KEY_RIGHT, 109 + 110 + [ 0x3f ] = KEY_UP, 111 + [ 0x3e ] = KEY_DOWN, 112 + [ 0x1a ] = KEY_PAUSE, 113 + 114 + [ 0x1d ] = KEY_MENU, 115 + [ 0x19 ] = KEY_PLAY, 116 + [ 0x16 ] = KEY_REWIND, 117 + [ 0x13 ] = KEY_FORWARD, 118 + [ 0x15 ] = KEY_PAUSE, 119 + [ 0x0e ] = KEY_REWIND, 120 + [ 0x0d ] = KEY_PLAY, 121 + [ 0x0b ] = KEY_STOP, 122 + [ 0x07 ] = KEY_FORWARD, 123 + [ 0x27 ] = KEY_RECORD, 124 + [ 0x26 ] = KEY_TUNER, 125 + [ 0x29 ] = KEY_TEXT, 126 + [ 0x2a ] = KEY_MEDIA, 127 + [ 0x18 ] = KEY_EPG, 128 + [ 0x27 ] = KEY_RECORD, 129 + }; 130 + 131 /* ----------------------------------------------------------------------- */ 132 133 static int get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) ··· 138 return 1; 139 } 140 141 + static int get_key_pinnacle_usb(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) 142 + { 143 + unsigned char buf[3]; 144 + 145 + /* poll IR chip */ 146 + 147 + if (3 != i2c_master_recv(&ir->c,buf,3)) { 148 + dprintk("read error\n"); 149 + return -EIO; 150 + } 151 + 152 + dprintk("key %02x\n", buf[2]&0x3f); 153 + if (buf[0]!=0x00){ 154 + return 0; 155 + } 156 + 157 + *ir_key = buf[2]&0x3f; 158 + *ir_raw = buf[2]&0x3f; 159 + 160 + return 1; 161 + } 162 + 163 /* ----------------------------------------------------------------------- */ 164 void em28xx_set_ir(struct em28xx * dev,struct IR_i2c *ir) 165 { ··· 159 snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Terratec)"); 160 break; 161 case (EM2820_BOARD_PINNACLE_USB_2): 162 + ir->ir_codes = ir_codes_em_pinnacle_usb; 163 + ir->get_key = get_key_pinnacle_usb; 164 + snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM28XX Pinnacle PCTV)"); 165 break; 166 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2): 167 ir->ir_codes = ir_codes_hauppauge_new;
+4 -3
drivers/media/video/em28xx/em28xx-video.c
··· 29 #include <linux/i2c.h> 30 #include <linux/version.h> 31 #include <linux/video_decoder.h> 32 33 #include "em28xx.h" 34 #include <media/tuner.h> ··· 192 193 static struct usb_driver em28xx_usb_driver; 194 195 - static DECLARE_MUTEX(em28xx_sysfs_lock); 196 static DECLARE_RWSEM(em28xx_disconnect); 197 198 /********************* v4l2 interface ******************************************/ ··· 395 */ 396 static void em28xx_release_resources(struct em28xx *dev) 397 { 398 - down(&em28xx_sysfs_lock); 399 400 em28xx_info("V4L2 device /dev/video%d deregistered\n", 401 dev->vdev->minor); ··· 404 /* video_unregister_device(dev->vbi_dev); */ 405 em28xx_i2c_unregister(dev); 406 usb_put_dev(dev->udev); 407 - up(&em28xx_sysfs_lock); 408 } 409 410 /*
··· 29 #include <linux/i2c.h> 30 #include <linux/version.h> 31 #include <linux/video_decoder.h> 32 + #include <linux/mutex.h> 33 34 #include "em28xx.h" 35 #include <media/tuner.h> ··· 191 192 static struct usb_driver em28xx_usb_driver; 193 194 + static DEFINE_MUTEX(em28xx_sysfs_lock); 195 static DECLARE_RWSEM(em28xx_disconnect); 196 197 /********************* v4l2 interface ******************************************/ ··· 394 */ 395 static void em28xx_release_resources(struct em28xx *dev) 396 { 397 + mutex_lock(&em28xx_sysfs_lock); 398 399 em28xx_info("V4L2 device /dev/video%d deregistered\n", 400 dev->vdev->minor); ··· 403 /* video_unregister_device(dev->vbi_dev); */ 404 em28xx_i2c_unregister(dev); 405 usb_put_dev(dev->udev); 406 + mutex_unlock(&em28xx_sysfs_lock); 407 } 408 409 /*
+7 -7
drivers/media/video/msp3400-driver.c
··· 66 67 /* module parameters */ 68 static int opmode = OPMODE_AUTO; 69 - int msp_debug = 0; /* msp_debug output */ 70 - int msp_once = 0; /* no continous stereo monitoring */ 71 - int msp_amsound = 0; /* hard-wire AM sound at 6.5 Hz (france), 72 - the autoscan seems work well only with FM... */ 73 int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */ 74 - int msp_dolby = 0; 75 76 int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual 77 (msp34xxg only) 0x00a0-0x03c0 */ ··· 1031 } 1032 1033 default: 1034 - /* nothing */ 1035 - break; 1036 } 1037 return 0; 1038 }
··· 66 67 /* module parameters */ 68 static int opmode = OPMODE_AUTO; 69 + int msp_debug; /* msp_debug output */ 70 + int msp_once; /* no continous stereo monitoring */ 71 + int msp_amsound; /* hard-wire AM sound at 6.5 Hz (france), 72 + the autoscan seems work well only with FM... */ 73 int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */ 74 + int msp_dolby; 75 76 int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual 77 (msp34xxg only) 0x00a0-0x03c0 */ ··· 1031 } 1032 1033 default: 1034 + /* unknown */ 1035 + return -EINVAL; 1036 } 1037 return 0; 1038 }
-8
drivers/media/video/msp3400.h
··· 6 7 /* ---------------------------------------------------------------------- */ 8 9 - struct msp_matrix { 10 - int input; 11 - int output; 12 - }; 13 - 14 - /* ioctl for MSP_SET_MATRIX will have to be registered */ 15 - #define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) 16 - 17 /* This macro is allowed for *constants* only, gcc must calculate it 18 at compile time. Remember -- no floats in kernel mode */ 19 #define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24)))
··· 6 7 /* ---------------------------------------------------------------------- */ 8 9 /* This macro is allowed for *constants* only, gcc must calculate it 10 at compile time. Remember -- no floats in kernel mode */ 11 #define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24)))
+6 -6
drivers/media/video/mt20xx.c
··· 353 } while (xok != 1 ); 354 t->xogc=xogc; 355 356 - t->tv_freq = mt2032_set_tv_freq; 357 - t->radio_freq = mt2032_set_radio_freq; 358 return(1); 359 } 360 ··· 481 i2c_master_recv(c,buf,1); 482 483 tuner_dbg("mt2050: sro is %x\n",buf[0]); 484 - t->tv_freq = mt2050_set_tv_freq; 485 - t->radio_freq = mt2050_set_radio_freq; 486 return 0; 487 } 488 ··· 494 int company_code; 495 496 memset(buf,0,sizeof(buf)); 497 - t->tv_freq = NULL; 498 - t->radio_freq = NULL; 499 t->standby = NULL; 500 if (t->std & V4L2_STD_525_60) { 501 tuner_dbg("pinnacle ntsc\n");
··· 353 } while (xok != 1 ); 354 t->xogc=xogc; 355 356 + t->set_tv_freq = mt2032_set_tv_freq; 357 + t->set_radio_freq = mt2032_set_radio_freq; 358 return(1); 359 } 360 ··· 481 i2c_master_recv(c,buf,1); 482 483 tuner_dbg("mt2050: sro is %x\n",buf[0]); 484 + t->set_tv_freq = mt2050_set_tv_freq; 485 + t->set_radio_freq = mt2050_set_radio_freq; 486 return 0; 487 } 488 ··· 494 int company_code; 495 496 memset(buf,0,sizeof(buf)); 497 + t->set_tv_freq = NULL; 498 + t->set_radio_freq = NULL; 499 t->standby = NULL; 500 if (t->std & V4L2_STD_525_60) { 501 tuner_dbg("pinnacle ntsc\n");
+2 -2
drivers/media/video/planb.c
··· 76 static int def_norm = PLANB_DEF_NORM; /* default norm */ 77 static int video_nr = -1; 78 79 - MODULE_PARM(def_norm, "i"); 80 MODULE_PARM_DESC(def_norm, "Default startup norm (0=PAL, 1=NTSC, 2=SECAM)"); 81 - MODULE_PARM(video_nr,"i"); 82 MODULE_LICENSE("GPL"); 83 84
··· 76 static int def_norm = PLANB_DEF_NORM; /* default norm */ 77 static int video_nr = -1; 78 79 + module_param(def_norm, int, 0); 80 MODULE_PARM_DESC(def_norm, "Default startup norm (0=PAL, 1=NTSC, 2=SECAM)"); 81 + module_param(video_nr, int, 0); 82 MODULE_LICENSE("GPL"); 83 84
+5 -5
drivers/media/video/saa6588.c
··· 50 static unsigned int plvl = 0; 51 static unsigned int bufblocks = 100; 52 53 - MODULE_PARM(debug, "i"); 54 MODULE_PARM_DESC(debug, "enable debug messages"); 55 - MODULE_PARM(xtal, "i"); 56 MODULE_PARM_DESC(xtal, "select oscillator frequency (0..3), default 0"); 57 - MODULE_PARM(rbds, "i"); 58 MODULE_PARM_DESC(rbds, "select mode, 0=RDS, 1=RBDS, default 0"); 59 - MODULE_PARM(plvl, "i"); 60 MODULE_PARM_DESC(plvl, "select pause level (0..3), default 0"); 61 - MODULE_PARM(bufblocks, "i"); 62 MODULE_PARM_DESC(bufblocks, "number of buffered blocks, default 100"); 63 64 MODULE_DESCRIPTION("v4l2 driver module for SAA6588 RDS decoder");
··· 50 static unsigned int plvl = 0; 51 static unsigned int bufblocks = 100; 52 53 + module_param(debug, int, 0644); 54 MODULE_PARM_DESC(debug, "enable debug messages"); 55 + module_param(xtal, int, 0); 56 MODULE_PARM_DESC(xtal, "select oscillator frequency (0..3), default 0"); 57 + module_param(rbds, int, 0); 58 MODULE_PARM_DESC(rbds, "select mode, 0=RDS, 1=RBDS, default 0"); 59 + module_param(plvl, int, 0); 60 MODULE_PARM_DESC(plvl, "select pause level (0..3), default 0"); 61 + module_param(bufblocks, int, 0); 62 MODULE_PARM_DESC(bufblocks, "number of buffered blocks, default 100"); 63 64 MODULE_DESCRIPTION("v4l2 driver module for SAA6588 RDS decoder");
+1 -1
drivers/media/video/saa711x.c
··· 52 #include <linux/video_decoder.h> 53 54 static int debug = 0; 55 - MODULE_PARM(debug, "i"); 56 MODULE_PARM_DESC(debug, " Set the default Debug level. Default: 0 (Off) - (0-1)"); 57 58
··· 52 #include <linux/video_decoder.h> 53 54 static int debug = 0; 55 + module_param(debug, int, 0644); 56 MODULE_PARM_DESC(debug, " Set the default Debug level. Default: 0 (Off) - (0-1)"); 57 58
+6
drivers/media/video/saa7134/saa7134-cards.c
··· 2515 .tuner_addr = ADDR_UNSET, 2516 .radio_addr = ADDR_UNSET, 2517 .mpeg = SAA7134_MPEG_DVB, 2518 .inputs = {{ 2519 .name = name_tv, 2520 .vmux = 1, ··· 2530 .vmux = 8, 2531 .amux = LINE1, 2532 }}, 2533 }, 2534 [SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = { 2535 .name = "MSI TV@Anywhere plus",
··· 2515 .tuner_addr = ADDR_UNSET, 2516 .radio_addr = ADDR_UNSET, 2517 .mpeg = SAA7134_MPEG_DVB, 2518 + .gpiomask = 1 << 21, 2519 .inputs = {{ 2520 .name = name_tv, 2521 .vmux = 1, ··· 2529 .vmux = 8, 2530 .amux = LINE1, 2531 }}, 2532 + .radio = { 2533 + .name = name_radio, 2534 + .amux = TV, 2535 + .gpio = 0x0200000, 2536 + }, 2537 }, 2538 [SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = { 2539 .name = "MSI TV@Anywhere plus",
+11 -10
drivers/media/video/saa7134/saa7134-core.c
··· 31 #include <linux/sound.h> 32 #include <linux/interrupt.h> 33 #include <linux/delay.h> 34 35 #include "saa7134-reg.h" 36 #include "saa7134.h" ··· 85 MODULE_PARM_DESC(tuner, "tuner type"); 86 MODULE_PARM_DESC(card, "card type"); 87 88 - static DECLARE_MUTEX(devlist_lock); 89 LIST_HEAD(saa7134_devlist); 90 static LIST_HEAD(mops_list); 91 static unsigned int saa7134_devcount; ··· 141 return NOTIFY_DONE; 142 } 143 144 - static int pending_registered=0; 145 static struct notifier_block pending_notifier = { 146 .notifier_call = pending_call, 147 }; ··· 970 pci_set_drvdata(pci_dev,dev); 971 saa7134_devcount++; 972 973 - down(&devlist_lock); 974 list_for_each(item,&mops_list) { 975 mops = list_entry(item, struct saa7134_mpeg_ops, next); 976 mpeg_ops_attach(mops, dev); 977 } 978 list_add_tail(&dev->devlist,&saa7134_devlist); 979 - up(&devlist_lock); 980 981 /* check for signal */ 982 saa7134_irq_video_intl(dev); ··· 1032 saa7134_hwfini(dev); 1033 1034 /* unregister */ 1035 - down(&devlist_lock); 1036 list_del(&dev->devlist); 1037 list_for_each(item,&mops_list) { 1038 mops = list_entry(item, struct saa7134_mpeg_ops, next); 1039 mpeg_ops_detach(mops, dev); 1040 } 1041 - up(&devlist_lock); 1042 saa7134_devcount--; 1043 1044 saa7134_i2c_unregister(dev); ··· 1072 struct list_head *item; 1073 struct saa7134_dev *dev; 1074 1075 - down(&devlist_lock); 1076 list_for_each(item,&saa7134_devlist) { 1077 dev = list_entry(item, struct saa7134_dev, devlist); 1078 mpeg_ops_attach(ops, dev); 1079 } 1080 list_add_tail(&ops->next,&mops_list); 1081 - up(&devlist_lock); 1082 return 0; 1083 } 1084 ··· 1087 struct list_head *item; 1088 struct saa7134_dev *dev; 1089 1090 - down(&devlist_lock); 1091 list_del(&ops->next); 1092 list_for_each(item,&saa7134_devlist) { 1093 dev = list_entry(item, struct saa7134_dev, devlist); 1094 mpeg_ops_detach(ops, dev); 1095 } 1096 - up(&devlist_lock); 1097 } 1098 1099 EXPORT_SYMBOL(saa7134_ts_register);
··· 31 #include <linux/sound.h> 32 #include <linux/interrupt.h> 33 #include <linux/delay.h> 34 + #include <linux/mutex.h> 35 36 #include "saa7134-reg.h" 37 #include "saa7134.h" ··· 84 MODULE_PARM_DESC(tuner, "tuner type"); 85 MODULE_PARM_DESC(card, "card type"); 86 87 + static DEFINE_MUTEX(devlist_lock); 88 LIST_HEAD(saa7134_devlist); 89 static LIST_HEAD(mops_list); 90 static unsigned int saa7134_devcount; ··· 140 return NOTIFY_DONE; 141 } 142 143 + static int pending_registered; 144 static struct notifier_block pending_notifier = { 145 .notifier_call = pending_call, 146 }; ··· 969 pci_set_drvdata(pci_dev,dev); 970 saa7134_devcount++; 971 972 + mutex_lock(&devlist_lock); 973 list_for_each(item,&mops_list) { 974 mops = list_entry(item, struct saa7134_mpeg_ops, next); 975 mpeg_ops_attach(mops, dev); 976 } 977 list_add_tail(&dev->devlist,&saa7134_devlist); 978 + mutex_unlock(&devlist_lock); 979 980 /* check for signal */ 981 saa7134_irq_video_intl(dev); ··· 1031 saa7134_hwfini(dev); 1032 1033 /* unregister */ 1034 + mutex_lock(&devlist_lock); 1035 list_del(&dev->devlist); 1036 list_for_each(item,&mops_list) { 1037 mops = list_entry(item, struct saa7134_mpeg_ops, next); 1038 mpeg_ops_detach(mops, dev); 1039 } 1040 + mutex_unlock(&devlist_lock); 1041 saa7134_devcount--; 1042 1043 saa7134_i2c_unregister(dev); ··· 1071 struct list_head *item; 1072 struct saa7134_dev *dev; 1073 1074 + mutex_lock(&devlist_lock); 1075 list_for_each(item,&saa7134_devlist) { 1076 dev = list_entry(item, struct saa7134_dev, devlist); 1077 mpeg_ops_attach(ops, dev); 1078 } 1079 list_add_tail(&ops->next,&mops_list); 1080 + mutex_unlock(&devlist_lock); 1081 return 0; 1082 } 1083 ··· 1086 struct list_head *item; 1087 struct saa7134_dev *dev; 1088 1089 + mutex_lock(&devlist_lock); 1090 list_del(&ops->next); 1091 list_for_each(item,&saa7134_devlist) { 1092 dev = list_entry(item, struct saa7134_dev, devlist); 1093 mpeg_ops_detach(ops, dev); 1094 } 1095 + mutex_unlock(&devlist_lock); 1096 } 1097 1098 EXPORT_SYMBOL(saa7134_ts_register);
+8 -3
drivers/media/video/saa7134/saa7134-tvaudio.c
··· 180 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff); 181 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff); 182 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff); 183 - // frame locked audio was reported not to be reliable 184 - saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x02); 185 186 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14); 187 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50); ··· 809 dprintk("ddep override: %s\n",stdres[audio_ddep]); 810 } else if (&card(dev).radio == dev->input) { 811 dprintk("FM Radio\n"); 812 - norms = (0x0f << 2) | 0x01; 813 } else { 814 /* (let chip) scan for sound carrier */ 815 norms = 0;
··· 180 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff); 181 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff); 182 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff); 183 + /* frame locked audio is mandatory for NICAM */ 184 + saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x01); 185 186 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14); 187 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50); ··· 809 dprintk("ddep override: %s\n",stdres[audio_ddep]); 810 } else if (&card(dev).radio == dev->input) { 811 dprintk("FM Radio\n"); 812 + if (dev->tuner_type == TUNER_PHILIPS_TDA8290) { 813 + norms = (0x11 << 2) | 0x01; 814 + saa_dsp_writel(dev, 0x42c >> 2, 0x729555); 815 + } else { 816 + norms = (0x0f << 2) | 0x01; 817 + } 818 } else { 819 /* (let chip) scan for sound carrier */ 820 norms = 0;
+2 -2
drivers/media/video/tda8290.c
··· 567 } 568 tuner_info("tuner: type set to %s\n", c->name); 569 570 - t->tv_freq = set_tv_freq; 571 - t->radio_freq = set_radio_freq; 572 t->has_signal = has_signal; 573 t->standby = standby; 574 t->tda827x_lpsel = 0;
··· 567 } 568 tuner_info("tuner: type set to %s\n", c->name); 569 570 + t->set_tv_freq = set_tv_freq; 571 + t->set_radio_freq = set_radio_freq; 572 t->has_signal = has_signal; 573 t->standby = standby; 574 t->tda827x_lpsel = 0;
+9 -9
drivers/media/video/tea5767.c
··· 62 63 #define TEA5767_PORT1_HIGH 0x01 64 65 - /* Forth register */ 66 #define TEA5767_PORT2_HIGH 0x80 67 /* Chips stops working. Only I2C bus remains on */ 68 #define TEA5767_STDBY 0x40 ··· 85 /* If activate PORT 1 indicates SEARCH or else it is used as PORT1 */ 86 #define TEA5767_SRCH_IND 0x01 87 88 - /* Fiveth register */ 89 90 /* By activating, it will use Xtal at 13 MHz as reference for divider */ 91 #define TEA5767_PLLREF_ENABLE 0x80 ··· 109 #define TEA5767_STEREO_MASK 0x80 110 #define TEA5767_IF_CNTR_MASK 0x7f 111 112 - /* Four register */ 113 #define TEA5767_ADC_LEVEL_MASK 0xf0 114 115 /* should be 0 */ 116 #define TEA5767_CHIP_ID_MASK 0x0f 117 118 - /* Fiveth register */ 119 /* Reserved for future extensions */ 120 #define TEA5767_RESERVED_MASK 0xff 121 ··· 220 tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); 221 buffer[2] |= TEA5767_HIGH_LO_INJECT; 222 buffer[4] |= TEA5767_PLLREF_ENABLE; 223 - div = (frq * 4000 / 16 + 700000 + 225000 + 25000) / 50000; 224 break; 225 case TEA5767_LOW_LO_13MHz: 226 tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); 227 228 buffer[4] |= TEA5767_PLLREF_ENABLE; 229 - div = (frq * 4000 / 16 - 700000 - 225000 + 25000) / 50000; 230 break; 231 case TEA5767_LOW_LO_32768: 232 tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); 233 buffer[3] |= TEA5767_XTAL_32768; 234 /* const 700=4000*175 Khz - to adjust freq to right value */ 235 - div = ((frq * 4000 / 16 - 700000 - 225000) + 16384) >> 15; 236 break; 237 case TEA5767_HIGH_LO_32768: 238 default: ··· 350 tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); 351 strlcpy(c->name, "tea5767", sizeof(c->name)); 352 353 - t->tv_freq = set_tv_freq; 354 - t->radio_freq = set_radio_freq; 355 t->has_signal = tea5767_signal; 356 t->is_stereo = tea5767_stereo; 357 t->standby = tea5767_standby;
··· 62 63 #define TEA5767_PORT1_HIGH 0x01 64 65 + /* Fourth register */ 66 #define TEA5767_PORT2_HIGH 0x80 67 /* Chips stops working. Only I2C bus remains on */ 68 #define TEA5767_STDBY 0x40 ··· 85 /* If activate PORT 1 indicates SEARCH or else it is used as PORT1 */ 86 #define TEA5767_SRCH_IND 0x01 87 88 + /* Fifth register */ 89 90 /* By activating, it will use Xtal at 13 MHz as reference for divider */ 91 #define TEA5767_PLLREF_ENABLE 0x80 ··· 109 #define TEA5767_STEREO_MASK 0x80 110 #define TEA5767_IF_CNTR_MASK 0x7f 111 112 + /* Fourth register */ 113 #define TEA5767_ADC_LEVEL_MASK 0xf0 114 115 /* should be 0 */ 116 #define TEA5767_CHIP_ID_MASK 0x0f 117 118 + /* Fifth register */ 119 /* Reserved for future extensions */ 120 #define TEA5767_RESERVED_MASK 0xff 121 ··· 220 tuner_dbg ("TEA5767 radio HIGH LO inject xtal @ 13 MHz\n"); 221 buffer[2] |= TEA5767_HIGH_LO_INJECT; 222 buffer[4] |= TEA5767_PLLREF_ENABLE; 223 + div = (frq * (4000 / 16) + 700000 + 225000 + 25000) / 50000; 224 break; 225 case TEA5767_LOW_LO_13MHz: 226 tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 13 MHz\n"); 227 228 buffer[4] |= TEA5767_PLLREF_ENABLE; 229 + div = (frq * (4000 / 16) - 700000 - 225000 + 25000) / 50000; 230 break; 231 case TEA5767_LOW_LO_32768: 232 tuner_dbg ("TEA5767 radio LOW LO inject xtal @ 32,768 MHz\n"); 233 buffer[3] |= TEA5767_XTAL_32768; 234 /* const 700=4000*175 Khz - to adjust freq to right value */ 235 + div = ((frq * (4000 / 16) - 700000 - 225000) + 16384) >> 15; 236 break; 237 case TEA5767_HIGH_LO_32768: 238 default: ··· 350 tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); 351 strlcpy(c->name, "tea5767", sizeof(c->name)); 352 353 + t->set_tv_freq = set_tv_freq; 354 + t->set_radio_freq = set_radio_freq; 355 t->has_signal = tea5767_signal; 356 t->is_stereo = tea5767_stereo; 357 t->standby = tea5767_standby;
+52 -33
drivers/media/video/tuner-core.c
··· 82 tuner_warn ("tuner type not set\n"); 83 return; 84 } 85 - if (NULL == t->tv_freq) { 86 tuner_warn ("Tuner has no way to set tv freq\n"); 87 return; 88 } ··· 90 tuner_dbg ("TV freq (%d.%02d) out of range (%d-%d)\n", 91 freq / 16, freq % 16 * 100 / 16, tv_range[0], 92 tv_range[1]); 93 } 94 - t->tv_freq(c, freq); 95 } 96 97 static void set_radio_freq(struct i2c_client *c, unsigned int freq) ··· 108 tuner_warn ("tuner type not set\n"); 109 return; 110 } 111 - if (NULL == t->radio_freq) { 112 tuner_warn ("tuner has no way to set radio frequency\n"); 113 return; 114 } 115 - if (freq <= radio_range[0] * 16000 || freq >= radio_range[1] * 16000) { 116 tuner_dbg ("radio freq (%d.%02d) out of range (%d-%d)\n", 117 freq / 16000, freq % 16000 * 100 / 16000, 118 radio_range[0], radio_range[1]); 119 } 120 121 - t->radio_freq(c, freq); 122 - return; 123 } 124 125 static void set_freq(struct i2c_client *c, unsigned long freq) ··· 136 tuner_dbg("radio freq set to %lu.%02lu\n", 137 freq / 16000, freq % 16000 * 100 / 16000); 138 set_radio_freq(c, freq); 139 break; 140 case V4L2_TUNER_ANALOG_TV: 141 case V4L2_TUNER_DIGITAL_TV: 142 tuner_dbg("tv freq set to %lu.%02lu\n", 143 freq / 16, freq % 16 * 100 / 16); 144 set_tv_freq(c, freq); 145 break; 146 } 147 - t->freq = freq; 148 } 149 150 static void set_type(struct i2c_client *c, unsigned int type, ··· 224 if (t->mode_mask == T_UNINITIALIZED) 225 t->mode_mask = new_mode_mask; 226 227 - set_freq(c, t->freq); 228 tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", 229 c->adapter->name, c->driver->driver.name, c->addr << 1, type, 230 t->mode_mask); ··· 389 default: p = "undefined"; break; 390 } 391 if (t->mode == V4L2_TUNER_RADIO) { 392 - freq = t->freq / 16000; 393 - freq_fraction = (t->freq % 16000) * 100 / 16000; 394 } else { 395 - freq = t->freq / 16; 396 - freq_fraction = (t->freq % 16) * 100 / 16; 397 } 398 tuner_info("Tuner mode: %s\n", p); 399 tuner_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); ··· 468 t->type = TUNER_TEA5767; 469 t->mode_mask = T_RADIO; 470 t->mode = T_STANDBY; 471 - t->freq = 87.5 * 16; /* Sets freq to FM range */ 472 default_mode_mask &= ~T_RADIO; 473 474 goto register_client; ··· 481 if (default_mode_mask != T_UNINITIALIZED) { 482 tuner_dbg ("Setting mode_mask to 0x%02x\n", default_mode_mask); 483 t->mode_mask = default_mode_mask; 484 - t->freq = 400 * 16; /* Sets freq to VHF High */ 485 default_mode_mask = T_UNINITIALIZED; 486 } 487 ··· 578 set_addr(client, (struct tuner_setup *)arg); 579 break; 580 case AUDC_SET_RADIO: 581 - set_mode(client,t,V4L2_TUNER_RADIO, "AUDC_SET_RADIO"); 582 break; 583 case TUNER_SET_STANDBY: 584 - { 585 - if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL) 586 - return 0; 587 - if (t->standby) 588 - t->standby (client); 589 - break; 590 - } 591 case VIDIOCSAUDIO: 592 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) 593 return 0; ··· 598 599 /* Should be implemented, since bttv calls it */ 600 tuner_dbg("VIDIOCSAUDIO not implemented.\n"); 601 - 602 break; 603 /* --- v4l ioctls --- */ 604 /* take care: bttv does userspace copying, we'll get a ··· 623 if (vc->norm < ARRAY_SIZE(map)) 624 t->std = map[vc->norm]; 625 tuner_fixup_std(t); 626 - if (t->freq) 627 - set_tv_freq(client, t->freq); 628 return 0; 629 } 630 case VIDIOCSFREQ: ··· 698 699 t->std = *id; 700 tuner_fixup_std(t); 701 - if (t->freq) 702 - set_freq(client, t->freq); 703 break; 704 } 705 case VIDIOC_S_FREQUENCY: 706 { 707 struct v4l2_frequency *f = arg; 708 709 - t->freq = f->frequency; 710 switch_v4l2(); 711 if (V4L2_TUNER_RADIO == f->type && 712 V4L2_TUNER_RADIO != t->mode) { ··· 713 == EINVAL) 714 return 0; 715 } 716 - set_freq(client,t->freq); 717 718 break; 719 } ··· 725 return 0; 726 switch_v4l2(); 727 f->type = t->mode; 728 - f->frequency = t->freq; 729 break; 730 } 731 case VIDIOC_G_TUNER: ··· 777 778 if (V4L2_TUNER_RADIO == t->mode) { 779 t->audmode = tuner->audmode; 780 - set_radio_freq(client, t->freq); 781 } 782 break; 783 } ··· 805 struct tuner *t = i2c_get_clientdata (c); 806 807 tuner_dbg ("resume\n"); 808 - if (t->freq) 809 - set_freq(c, t->freq); 810 return 0; 811 } 812
··· 82 tuner_warn ("tuner type not set\n"); 83 return; 84 } 85 + if (NULL == t->set_tv_freq) { 86 tuner_warn ("Tuner has no way to set tv freq\n"); 87 return; 88 } ··· 90 tuner_dbg ("TV freq (%d.%02d) out of range (%d-%d)\n", 91 freq / 16, freq % 16 * 100 / 16, tv_range[0], 92 tv_range[1]); 93 + /* V4L2 spec: if the freq is not possible then the closest 94 + possible value should be selected */ 95 + if (freq < tv_range[0] * 16) 96 + freq = tv_range[0] * 16; 97 + else 98 + freq = tv_range[1] * 16; 99 } 100 + t->set_tv_freq(c, freq); 101 } 102 103 static void set_radio_freq(struct i2c_client *c, unsigned int freq) ··· 102 tuner_warn ("tuner type not set\n"); 103 return; 104 } 105 + if (NULL == t->set_radio_freq) { 106 tuner_warn ("tuner has no way to set radio frequency\n"); 107 return; 108 } 109 + if (freq < radio_range[0] * 16000 || freq > radio_range[1] * 16000) { 110 tuner_dbg ("radio freq (%d.%02d) out of range (%d-%d)\n", 111 freq / 16000, freq % 16000 * 100 / 16000, 112 radio_range[0], radio_range[1]); 113 + /* V4L2 spec: if the freq is not possible then the closest 114 + possible value should be selected */ 115 + if (freq < radio_range[0] * 16000) 116 + freq = radio_range[0] * 16000; 117 + else 118 + freq = radio_range[1] * 16000; 119 } 120 121 + t->set_radio_freq(c, freq); 122 } 123 124 static void set_freq(struct i2c_client *c, unsigned long freq) ··· 125 tuner_dbg("radio freq set to %lu.%02lu\n", 126 freq / 16000, freq % 16000 * 100 / 16000); 127 set_radio_freq(c, freq); 128 + t->radio_freq = freq; 129 break; 130 case V4L2_TUNER_ANALOG_TV: 131 case V4L2_TUNER_DIGITAL_TV: 132 tuner_dbg("tv freq set to %lu.%02lu\n", 133 freq / 16, freq % 16 * 100 / 16); 134 set_tv_freq(c, freq); 135 + t->tv_freq = freq; 136 break; 137 } 138 } 139 140 static void set_type(struct i2c_client *c, unsigned int type, ··· 212 if (t->mode_mask == T_UNINITIALIZED) 213 t->mode_mask = new_mode_mask; 214 215 + set_freq(c, (V4L2_TUNER_RADIO == t->mode) ? t->radio_freq : t->tv_freq); 216 tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", 217 c->adapter->name, c->driver->driver.name, c->addr << 1, type, 218 t->mode_mask); ··· 377 default: p = "undefined"; break; 378 } 379 if (t->mode == V4L2_TUNER_RADIO) { 380 + freq = t->radio_freq / 16000; 381 + freq_fraction = (t->radio_freq % 16000) * 100 / 16000; 382 } else { 383 + freq = t->tv_freq / 16; 384 + freq_fraction = (t->tv_freq % 16) * 100 / 16; 385 } 386 tuner_info("Tuner mode: %s\n", p); 387 tuner_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); ··· 456 t->type = TUNER_TEA5767; 457 t->mode_mask = T_RADIO; 458 t->mode = T_STANDBY; 459 + t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */ 460 default_mode_mask &= ~T_RADIO; 461 462 goto register_client; ··· 469 if (default_mode_mask != T_UNINITIALIZED) { 470 tuner_dbg ("Setting mode_mask to 0x%02x\n", default_mode_mask); 471 t->mode_mask = default_mode_mask; 472 + t->tv_freq = 400 * 16; /* Sets freq to VHF High */ 473 + t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */ 474 default_mode_mask = T_UNINITIALIZED; 475 } 476 ··· 565 set_addr(client, (struct tuner_setup *)arg); 566 break; 567 case AUDC_SET_RADIO: 568 + if (set_mode(client, t, V4L2_TUNER_RADIO, "AUDC_SET_RADIO") 569 + == EINVAL) 570 + return 0; 571 + if (t->radio_freq) 572 + set_freq(client, t->radio_freq); 573 break; 574 case TUNER_SET_STANDBY: 575 + if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL) 576 + return 0; 577 + if (t->standby) 578 + t->standby (client); 579 + break; 580 case VIDIOCSAUDIO: 581 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) 582 return 0; ··· 583 584 /* Should be implemented, since bttv calls it */ 585 tuner_dbg("VIDIOCSAUDIO not implemented.\n"); 586 break; 587 /* --- v4l ioctls --- */ 588 /* take care: bttv does userspace copying, we'll get a ··· 609 if (vc->norm < ARRAY_SIZE(map)) 610 t->std = map[vc->norm]; 611 tuner_fixup_std(t); 612 + if (t->tv_freq) 613 + set_tv_freq(client, t->tv_freq); 614 return 0; 615 } 616 case VIDIOCSFREQ: ··· 684 685 t->std = *id; 686 tuner_fixup_std(t); 687 + if (t->tv_freq) 688 + set_freq(client, t->tv_freq); 689 break; 690 } 691 case VIDIOC_S_FREQUENCY: 692 { 693 struct v4l2_frequency *f = arg; 694 695 switch_v4l2(); 696 if (V4L2_TUNER_RADIO == f->type && 697 V4L2_TUNER_RADIO != t->mode) { ··· 700 == EINVAL) 701 return 0; 702 } 703 + set_freq(client,f->frequency); 704 705 break; 706 } ··· 712 return 0; 713 switch_v4l2(); 714 f->type = t->mode; 715 + f->frequency = (V4L2_TUNER_RADIO == t->mode) ? 716 + t->radio_freq : t->tv_freq; 717 break; 718 } 719 case VIDIOC_G_TUNER: ··· 763 764 if (V4L2_TUNER_RADIO == t->mode) { 765 t->audmode = tuner->audmode; 766 + set_radio_freq(client, t->radio_freq); 767 } 768 break; 769 } ··· 791 struct tuner *t = i2c_get_clientdata (c); 792 793 tuner_dbg ("resume\n"); 794 + if (V4L2_TUNER_RADIO == t->mode) { 795 + if (t->radio_freq) 796 + set_freq(c, t->radio_freq); 797 + } else { 798 + if (t->tv_freq) 799 + set_freq(c, t->tv_freq); 800 + } 801 return 0; 802 } 803
+47 -747
drivers/media/video/tuner-simple.c
··· 79 #define TUNER_PLL_LOCKED 0x40 80 #define TUNER_STEREO_MK3 0x04 81 82 - #define TUNER_MAX_RANGES 3 83 - 84 - /* ---------------------------------------------------------------------- */ 85 - 86 - struct tunertype 87 - { 88 - char *name; 89 - 90 - int count; 91 - struct { 92 - unsigned short thresh; 93 - unsigned char cb; 94 - } ranges[TUNER_MAX_RANGES]; 95 - unsigned char config; 96 - }; 97 - 98 - /* 99 - * The floats in the tuner struct are computed at compile time 100 - * by gcc and cast back to integers. Thus we don't violate the 101 - * "no float in kernel" rule. 102 */ 103 - static struct tunertype tuners[] = { 104 - /* 0-9 */ 105 - [TUNER_TEMIC_PAL] = { /* TEMIC PAL */ 106 - .name = "Temic PAL (4002 FH5)", 107 - .count = 3, 108 - .ranges = { 109 - { 16 * 140.25 /*MHz*/, 0x02, }, 110 - { 16 * 463.25 /*MHz*/, 0x04, }, 111 - { 16 * 999.99 , 0x01, }, 112 - }, 113 - .config = 0x8e, 114 - }, 115 - [TUNER_PHILIPS_PAL_I] = { /* Philips PAL_I */ 116 - .name = "Philips PAL_I (FI1246 and compatibles)", 117 - .count = 3, 118 - .ranges = { 119 - { 16 * 140.25 /*MHz*/, 0xa0, }, 120 - { 16 * 463.25 /*MHz*/, 0x90, }, 121 - { 16 * 999.99 , 0x30, }, 122 - }, 123 - .config = 0x8e, 124 - }, 125 - [TUNER_PHILIPS_NTSC] = { /* Philips NTSC */ 126 - .name = "Philips NTSC (FI1236,FM1236 and compatibles)", 127 - .count = 3, 128 - .ranges = { 129 - { 16 * 157.25 /*MHz*/, 0xa0, }, 130 - { 16 * 451.25 /*MHz*/, 0x90, }, 131 - { 16 * 999.99 , 0x30, }, 132 - }, 133 - .config = 0x8e, 134 - }, 135 - [TUNER_PHILIPS_SECAM] = { /* Philips SECAM */ 136 - .name = "Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)", 137 - .count = 3, 138 - .ranges = { 139 - { 16 * 168.25 /*MHz*/, 0xa7, }, 140 - { 16 * 447.25 /*MHz*/, 0x97, }, 141 - { 16 * 999.99 , 0x37, }, 142 - }, 143 - .config = 0x8e, 144 - }, 145 - [TUNER_ABSENT] = { /* Tuner Absent */ 146 - .name = "NoTuner", 147 - .count = 1, 148 - .ranges = { 149 - { 0, 0x00, }, 150 - }, 151 - .config = 0x00, 152 - }, 153 - [TUNER_PHILIPS_PAL] = { /* Philips PAL */ 154 - .name = "Philips PAL_BG (FI1216 and compatibles)", 155 - .count = 3, 156 - .ranges = { 157 - { 16 * 168.25 /*MHz*/, 0xa0, }, 158 - { 16 * 447.25 /*MHz*/, 0x90, }, 159 - { 16 * 999.99 , 0x30, }, 160 - }, 161 - .config = 0x8e, 162 - }, 163 - [TUNER_TEMIC_NTSC] = { /* TEMIC NTSC */ 164 - .name = "Temic NTSC (4032 FY5)", 165 - .count = 3, 166 - .ranges = { 167 - { 16 * 157.25 /*MHz*/, 0x02, }, 168 - { 16 * 463.25 /*MHz*/, 0x04, }, 169 - { 16 * 999.99 , 0x01, }, 170 - }, 171 - .config = 0x8e, 172 - }, 173 - [TUNER_TEMIC_PAL_I] = { /* TEMIC PAL_I */ 174 - .name = "Temic PAL_I (4062 FY5)", 175 - .count = 3, 176 - .ranges = { 177 - { 16 * 170.00 /*MHz*/, 0x02, }, 178 - { 16 * 450.00 /*MHz*/, 0x04, }, 179 - { 16 * 999.99 , 0x01, }, 180 - }, 181 - .config = 0x8e, 182 - }, 183 - [TUNER_TEMIC_4036FY5_NTSC] = { /* TEMIC NTSC */ 184 - .name = "Temic NTSC (4036 FY5)", 185 - .count = 3, 186 - .ranges = { 187 - { 16 * 157.25 /*MHz*/, 0xa0, }, 188 - { 16 * 463.25 /*MHz*/, 0x90, }, 189 - { 16 * 999.99 , 0x30, }, 190 - }, 191 - .config = 0x8e, 192 - }, 193 - [TUNER_ALPS_TSBH1_NTSC] = { /* TEMIC NTSC */ 194 - .name = "Alps HSBH1", 195 - .count = 3, 196 - .ranges = { 197 - { 16 * 137.25 /*MHz*/, 0x01, }, 198 - { 16 * 385.25 /*MHz*/, 0x02, }, 199 - { 16 * 999.99 , 0x08, }, 200 - }, 201 - .config = 0x8e, 202 - }, 203 - 204 - /* 10-19 */ 205 - [TUNER_ALPS_TSBE1_PAL] = { /* TEMIC PAL */ 206 - .name = "Alps TSBE1", 207 - .count = 3, 208 - .ranges = { 209 - { 16 * 137.25 /*MHz*/, 0x01, }, 210 - { 16 * 385.25 /*MHz*/, 0x02, }, 211 - { 16 * 999.99 , 0x08, }, 212 - }, 213 - .config = 0x8e, 214 - }, 215 - [TUNER_ALPS_TSBB5_PAL_I] = { /* Alps PAL_I */ 216 - .name = "Alps TSBB5", 217 - .count = 3, 218 - .ranges = { 219 - { 16 * 133.25 /*MHz*/, 0x01, }, 220 - { 16 * 351.25 /*MHz*/, 0x02, }, 221 - { 16 * 999.99 , 0x08, }, 222 - }, 223 - .config = 0x8e, 224 - }, 225 - [TUNER_ALPS_TSBE5_PAL] = { /* Alps PAL */ 226 - .name = "Alps TSBE5", 227 - .count = 3, 228 - .ranges = { 229 - { 16 * 133.25 /*MHz*/, 0x01, }, 230 - { 16 * 351.25 /*MHz*/, 0x02, }, 231 - { 16 * 999.99 , 0x08, }, 232 - }, 233 - .config = 0x8e, 234 - }, 235 - [TUNER_ALPS_TSBC5_PAL] = { /* Alps PAL */ 236 - .name = "Alps TSBC5", 237 - .count = 3, 238 - .ranges = { 239 - { 16 * 133.25 /*MHz*/, 0x01, }, 240 - { 16 * 351.25 /*MHz*/, 0x02, }, 241 - { 16 * 999.99 , 0x08, }, 242 - }, 243 - .config = 0x8e, 244 - }, 245 - [TUNER_TEMIC_4006FH5_PAL] = { /* TEMIC PAL */ 246 - .name = "Temic PAL_BG (4006FH5)", 247 - .count = 3, 248 - .ranges = { 249 - { 16 * 170.00 /*MHz*/, 0xa0, }, 250 - { 16 * 450.00 /*MHz*/, 0x90, }, 251 - { 16 * 999.99 , 0x30, }, 252 - }, 253 - .config = 0x8e, 254 - }, 255 - [TUNER_ALPS_TSHC6_NTSC] = { /* Alps NTSC */ 256 - .name = "Alps TSCH6", 257 - .count = 3, 258 - .ranges = { 259 - { 16 * 137.25 /*MHz*/, 0x14, }, 260 - { 16 * 385.25 /*MHz*/, 0x12, }, 261 - { 16 * 999.99 , 0x11, }, 262 - }, 263 - .config = 0x8e, 264 - }, 265 - [TUNER_TEMIC_PAL_DK] = { /* TEMIC PAL */ 266 - .name = "Temic PAL_DK (4016 FY5)", 267 - .count = 3, 268 - .ranges = { 269 - { 16 * 168.25 /*MHz*/, 0xa0, }, 270 - { 16 * 456.25 /*MHz*/, 0x90, }, 271 - { 16 * 999.99 , 0x30, }, 272 - }, 273 - .config = 0x8e, 274 - }, 275 - [TUNER_PHILIPS_NTSC_M] = { /* Philips NTSC */ 276 - .name = "Philips NTSC_M (MK2)", 277 - .count = 3, 278 - .ranges = { 279 - { 16 * 160.00 /*MHz*/, 0xa0, }, 280 - { 16 * 454.00 /*MHz*/, 0x90, }, 281 - { 16 * 999.99 , 0x30, }, 282 - }, 283 - .config = 0x8e, 284 - }, 285 - [TUNER_TEMIC_4066FY5_PAL_I] = { /* TEMIC PAL_I */ 286 - .name = "Temic PAL_I (4066 FY5)", 287 - .count = 3, 288 - .ranges = { 289 - { 16 * 169.00 /*MHz*/, 0xa0, }, 290 - { 16 * 454.00 /*MHz*/, 0x90, }, 291 - { 16 * 999.99 , 0x30, }, 292 - }, 293 - .config = 0x8e, 294 - }, 295 - [TUNER_TEMIC_4006FN5_MULTI_PAL] = { /* TEMIC PAL */ 296 - .name = "Temic PAL* auto (4006 FN5)", 297 - .count = 3, 298 - .ranges = { 299 - { 16 * 169.00 /*MHz*/, 0xa0, }, 300 - { 16 * 454.00 /*MHz*/, 0x90, }, 301 - { 16 * 999.99 , 0x30, }, 302 - }, 303 - .config = 0x8e, 304 - }, 305 - 306 - /* 20-29 */ 307 - [TUNER_TEMIC_4009FR5_PAL] = { /* TEMIC PAL */ 308 - .name = "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", 309 - .count = 3, 310 - .ranges = { 311 - { 16 * 141.00 /*MHz*/, 0xa0, }, 312 - { 16 * 464.00 /*MHz*/, 0x90, }, 313 - { 16 * 999.99 , 0x30, }, 314 - }, 315 - .config = 0x8e, 316 - }, 317 - [TUNER_TEMIC_4039FR5_NTSC] = { /* TEMIC NTSC */ 318 - .name = "Temic NTSC (4039 FR5)", 319 - .count = 3, 320 - .ranges = { 321 - { 16 * 158.00 /*MHz*/, 0xa0, }, 322 - { 16 * 453.00 /*MHz*/, 0x90, }, 323 - { 16 * 999.99 , 0x30, }, 324 - }, 325 - .config = 0x8e, 326 - }, 327 - [TUNER_TEMIC_4046FM5] = { /* TEMIC PAL */ 328 - .name = "Temic PAL/SECAM multi (4046 FM5)", 329 - .count = 3, 330 - .ranges = { 331 - { 16 * 169.00 /*MHz*/, 0xa0, }, 332 - { 16 * 454.00 /*MHz*/, 0x90, }, 333 - { 16 * 999.99 , 0x30, }, 334 - }, 335 - .config = 0x8e, 336 - }, 337 - [TUNER_PHILIPS_PAL_DK] = { /* Philips PAL */ 338 - .name = "Philips PAL_DK (FI1256 and compatibles)", 339 - .count = 3, 340 - .ranges = { 341 - { 16 * 170.00 /*MHz*/, 0xa0, }, 342 - { 16 * 450.00 /*MHz*/, 0x90, }, 343 - { 16 * 999.99 , 0x30, }, 344 - }, 345 - .config = 0x8e, 346 - }, 347 - [TUNER_PHILIPS_FQ1216ME] = { /* Philips PAL */ 348 - .name = "Philips PAL/SECAM multi (FQ1216ME)", 349 - .count = 3, 350 - .ranges = { 351 - { 16 * 170.00 /*MHz*/, 0xa0, }, 352 - { 16 * 450.00 /*MHz*/, 0x90, }, 353 - { 16 * 999.99 , 0x30, }, 354 - }, 355 - .config = 0x8e, 356 - }, 357 - [TUNER_LG_PAL_I_FM] = { /* LGINNOTEK PAL_I */ 358 - .name = "LG PAL_I+FM (TAPC-I001D)", 359 - .count = 3, 360 - .ranges = { 361 - { 16 * 170.00 /*MHz*/, 0xa0, }, 362 - { 16 * 450.00 /*MHz*/, 0x90, }, 363 - { 16 * 999.99 , 0x30, }, 364 - }, 365 - .config = 0x8e, 366 - }, 367 - [TUNER_LG_PAL_I] = { /* LGINNOTEK PAL_I */ 368 - .name = "LG PAL_I (TAPC-I701D)", 369 - .count = 3, 370 - .ranges = { 371 - { 16 * 170.00 /*MHz*/, 0xa0, }, 372 - { 16 * 450.00 /*MHz*/, 0x90, }, 373 - { 16 * 999.99 , 0x30, }, 374 - }, 375 - .config = 0x8e, 376 - }, 377 - [TUNER_LG_NTSC_FM] = { /* LGINNOTEK NTSC */ 378 - .name = "LG NTSC+FM (TPI8NSR01F)", 379 - .count = 3, 380 - .ranges = { 381 - { 16 * 210.00 /*MHz*/, 0xa0, }, 382 - { 16 * 497.00 /*MHz*/, 0x90, }, 383 - { 16 * 999.99 , 0x30, }, 384 - }, 385 - .config = 0x8e, 386 - }, 387 - [TUNER_LG_PAL_FM] = { /* LGINNOTEK PAL */ 388 - .name = "LG PAL_BG+FM (TPI8PSB01D)", 389 - .count = 3, 390 - .ranges = { 391 - { 16 * 170.00 /*MHz*/, 0xa0, }, 392 - { 16 * 450.00 /*MHz*/, 0x90, }, 393 - { 16 * 999.99 , 0x30, }, 394 - }, 395 - .config = 0x8e, 396 - }, 397 - [TUNER_LG_PAL] = { /* LGINNOTEK PAL */ 398 - .name = "LG PAL_BG (TPI8PSB11D)", 399 - .count = 3, 400 - .ranges = { 401 - { 16 * 170.00 /*MHz*/, 0xa0, }, 402 - { 16 * 450.00 /*MHz*/, 0x90, }, 403 - { 16 * 999.99 , 0x30, }, 404 - }, 405 - .config = 0x8e, 406 - }, 407 - 408 - /* 30-39 */ 409 - [TUNER_TEMIC_4009FN5_MULTI_PAL_FM] = { /* TEMIC PAL */ 410 - .name = "Temic PAL* auto + FM (4009 FN5)", 411 - .count = 3, 412 - .ranges = { 413 - { 16 * 141.00 /*MHz*/, 0xa0, }, 414 - { 16 * 464.00 /*MHz*/, 0x90, }, 415 - { 16 * 999.99 , 0x30, }, 416 - }, 417 - .config = 0x8e, 418 - }, 419 - [TUNER_SHARP_2U5JF5540_NTSC] = { /* SHARP NTSC */ 420 - .name = "SHARP NTSC_JP (2U5JF5540)", 421 - .count = 3, 422 - .ranges = { 423 - { 16 * 137.25 /*MHz*/, 0x01, }, 424 - { 16 * 317.25 /*MHz*/, 0x02, }, 425 - { 16 * 999.99 , 0x08, }, 426 - }, 427 - .config = 0x8e, 428 - }, 429 - [TUNER_Samsung_PAL_TCPM9091PD27] = { /* Samsung PAL */ 430 - .name = "Samsung PAL TCPM9091PD27", 431 - .count = 3, 432 - .ranges = { 433 - { 16 * 169 /*MHz*/, 0xa0, }, 434 - { 16 * 464 /*MHz*/, 0x90, }, 435 - { 16 * 999.99 , 0x30, }, 436 - }, 437 - .config = 0x8e, 438 - }, 439 - [TUNER_MT2032] = { /* Microtune PAL|NTSC */ 440 - .name = "MT20xx universal", 441 - /* see mt20xx.c for details */ }, 442 - [TUNER_TEMIC_4106FH5] = { /* TEMIC PAL */ 443 - .name = "Temic PAL_BG (4106 FH5)", 444 - .count = 3, 445 - .ranges = { 446 - { 16 * 141.00 /*MHz*/, 0xa0, }, 447 - { 16 * 464.00 /*MHz*/, 0x90, }, 448 - { 16 * 999.99 , 0x30, }, 449 - }, 450 - .config = 0x8e, 451 - }, 452 - [TUNER_TEMIC_4012FY5] = { /* TEMIC PAL */ 453 - .name = "Temic PAL_DK/SECAM_L (4012 FY5)", 454 - .count = 3, 455 - .ranges = { 456 - { 16 * 140.25 /*MHz*/, 0x02, }, 457 - { 16 * 463.25 /*MHz*/, 0x04, }, 458 - { 16 * 999.99 , 0x01, }, 459 - }, 460 - .config = 0x8e, 461 - }, 462 - [TUNER_TEMIC_4136FY5] = { /* TEMIC NTSC */ 463 - .name = "Temic NTSC (4136 FY5)", 464 - .count = 3, 465 - .ranges = { 466 - { 16 * 158.00 /*MHz*/, 0xa0, }, 467 - { 16 * 453.00 /*MHz*/, 0x90, }, 468 - { 16 * 999.99 , 0x30, }, 469 - }, 470 - .config = 0x8e, 471 - }, 472 - [TUNER_LG_PAL_NEW_TAPC] = { /* LGINNOTEK PAL */ 473 - .name = "LG PAL (newer TAPC series)", 474 - .count = 3, 475 - .ranges = { 476 - { 16 * 170.00 /*MHz*/, 0x01, }, 477 - { 16 * 450.00 /*MHz*/, 0x02, }, 478 - { 16 * 999.99 , 0x08, }, 479 - }, 480 - .config = 0x8e, 481 - }, 482 - [TUNER_PHILIPS_FM1216ME_MK3] = { /* Philips PAL */ 483 - .name = "Philips PAL/SECAM multi (FM1216ME MK3)", 484 - .count = 3, 485 - .ranges = { 486 - { 16 * 158.00 /*MHz*/, 0x01, }, 487 - { 16 * 442.00 /*MHz*/, 0x02, }, 488 - { 16 * 999.99 , 0x04, }, 489 - }, 490 - .config = 0x8e, 491 - }, 492 - [TUNER_LG_NTSC_NEW_TAPC] = { /* LGINNOTEK NTSC */ 493 - .name = "LG NTSC (newer TAPC series)", 494 - .count = 3, 495 - .ranges = { 496 - { 16 * 170.00 /*MHz*/, 0x01, }, 497 - { 16 * 450.00 /*MHz*/, 0x02, }, 498 - { 16 * 999.99 , 0x08, }, 499 - }, 500 - .config = 0x8e, 501 - }, 502 - 503 - /* 40-49 */ 504 - [TUNER_HITACHI_NTSC] = { /* HITACHI NTSC */ 505 - .name = "HITACHI V7-J180AT", 506 - .count = 3, 507 - .ranges = { 508 - { 16 * 170.00 /*MHz*/, 0x01, }, 509 - { 16 * 450.00 /*MHz*/, 0x02, }, 510 - { 16 * 999.99 , 0x08, }, 511 - }, 512 - .config = 0x8e, 513 - }, 514 - [TUNER_PHILIPS_PAL_MK] = { /* Philips PAL */ 515 - .name = "Philips PAL_MK (FI1216 MK)", 516 - .count = 3, 517 - .ranges = { 518 - { 16 * 140.25 /*MHz*/, 0x01, }, 519 - { 16 * 463.25 /*MHz*/, 0xc2, }, 520 - { 16 * 999.99 , 0xcf, }, 521 - }, 522 - .config = 0x8e, 523 - }, 524 - [TUNER_PHILIPS_ATSC] = { /* Philips ATSC */ 525 - .name = "Philips 1236D ATSC/NTSC dual in", 526 - .count = 3, 527 - .ranges = { 528 - { 16 * 157.25 /*MHz*/, 0xa0, }, 529 - { 16 * 454.00 /*MHz*/, 0x90, }, 530 - { 16 * 999.99 , 0x30, }, 531 - }, 532 - .config = 0x8e, 533 - }, 534 - [TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */ 535 - .name = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", 536 - .count = 3, 537 - .ranges = { 538 - { 16 * 160.00 /*MHz*/, 0x01, }, 539 - { 16 * 442.00 /*MHz*/, 0x02, }, 540 - { 16 * 999.99 , 0x04, }, 541 - }, 542 - .config = 0x8e, 543 - }, 544 - [TUNER_PHILIPS_4IN1] = { /* Philips NTSC */ 545 - .name = "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", 546 - .count = 3, 547 - .ranges = { 548 - { 16 * 160.00 /*MHz*/, 0x01, }, 549 - { 16 * 442.00 /*MHz*/, 0x02, }, 550 - { 16 * 999.99 , 0x04, }, 551 - }, 552 - .config = 0x8e, 553 - }, 554 - [TUNER_MICROTUNE_4049FM5] = { /* Microtune PAL */ 555 - .name = "Microtune 4049 FM5", 556 - .count = 3, 557 - .ranges = { 558 - { 16 * 141.00 /*MHz*/, 0xa0, }, 559 - { 16 * 464.00 /*MHz*/, 0x90, }, 560 - { 16 * 999.99 , 0x30, }, 561 - }, 562 - .config = 0x8e, 563 - }, 564 - [TUNER_PANASONIC_VP27] = { /* Panasonic NTSC */ 565 - .name = "Panasonic VP27s/ENGE4324D", 566 - .count = 3, 567 - .ranges = { 568 - { 16 * 160.00 /*MHz*/, 0x01, }, 569 - { 16 * 454.00 /*MHz*/, 0x02, }, 570 - { 16 * 999.99 , 0x08, }, 571 - }, 572 - .config = 0xce, 573 - }, 574 - [TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */ 575 - .name = "LG NTSC (TAPE series)", 576 - .count = 3, 577 - .ranges = { 578 - { 16 * 160.00 /*MHz*/, 0x01, }, 579 - { 16 * 442.00 /*MHz*/, 0x02, }, 580 - { 16 * 999.99 , 0x04, }, 581 - }, 582 - .config = 0x8e, 583 - }, 584 - [TUNER_TNF_8831BGFF] = { /* Philips PAL */ 585 - .name = "Tenna TNF 8831 BGFF)", 586 - .count = 3, 587 - .ranges = { 588 - { 16 * 161.25 /*MHz*/, 0xa0, }, 589 - { 16 * 463.25 /*MHz*/, 0x90, }, 590 - { 16 * 999.99 , 0x30, }, 591 - }, 592 - .config = 0x8e, 593 - }, 594 - [TUNER_MICROTUNE_4042FI5] = { /* Microtune NTSC */ 595 - .name = "Microtune 4042 FI5 ATSC/NTSC dual in", 596 - .count = 3, 597 - .ranges = { 598 - { 16 * 162.00 /*MHz*/, 0xa2, }, 599 - { 16 * 457.00 /*MHz*/, 0x94, }, 600 - { 16 * 999.99 , 0x31, }, 601 - }, 602 - .config = 0x8e, 603 - }, 604 - 605 - /* 50-59 */ 606 - [TUNER_TCL_2002N] = { /* TCL NTSC */ 607 - .name = "TCL 2002N", 608 - .count = 3, 609 - .ranges = { 610 - { 16 * 172.00 /*MHz*/, 0x01, }, 611 - { 16 * 448.00 /*MHz*/, 0x02, }, 612 - { 16 * 999.99 , 0x08, }, 613 - }, 614 - .config = 0x8e, 615 - }, 616 - [TUNER_PHILIPS_FM1256_IH3] = { /* Philips PAL */ 617 - .name = "Philips PAL/SECAM_D (FM 1256 I-H3)", 618 - .count = 3, 619 - .ranges = { 620 - { 16 * 160.00 /*MHz*/, 0x01, }, 621 - { 16 * 442.00 /*MHz*/, 0x02, }, 622 - { 16 * 999.99 , 0x04, }, 623 - }, 624 - .config = 0x8e, 625 - }, 626 - [TUNER_THOMSON_DTT7610] = { /* THOMSON ATSC */ 627 - .name = "Thomson DTT 7610 (ATSC/NTSC)", 628 - .count = 3, 629 - .ranges = { 630 - { 16 * 157.25 /*MHz*/, 0x39, }, 631 - { 16 * 454.00 /*MHz*/, 0x3a, }, 632 - { 16 * 999.99 , 0x3c, }, 633 - }, 634 - .config = 0x8e, 635 - }, 636 - [TUNER_PHILIPS_FQ1286] = { /* Philips NTSC */ 637 - .name = "Philips FQ1286", 638 - .count = 3, 639 - .ranges = { 640 - { 16 * 160.00 /*MHz*/, 0x41, }, 641 - { 16 * 454.00 /*MHz*/, 0x42, }, 642 - { 16 * 999.99 , 0x04, }, 643 - }, 644 - .config = 0x8e, 645 - }, 646 - [TUNER_PHILIPS_TDA8290] = { /* Philips PAL|NTSC */ 647 - .name = "tda8290+75", 648 - /* see tda8290.c for details */ }, 649 - [TUNER_TCL_2002MB] = { /* TCL PAL */ 650 - .name = "TCL 2002MB", 651 - .count = 3, 652 - .ranges = { 653 - { 16 * 170.00 /*MHz*/, 0x01, }, 654 - { 16 * 450.00 /*MHz*/, 0x02, }, 655 - { 16 * 999.99 , 0x08, }, 656 - }, 657 - .config = 0xce, 658 - }, 659 - [TUNER_PHILIPS_FQ1216AME_MK4] = { /* Philips PAL */ 660 - .name = "Philips PAL/SECAM multi (FQ1216AME MK4)", 661 - .count = 3, 662 - .ranges = { 663 - { 16 * 160.00 /*MHz*/, 0x01, }, 664 - { 16 * 442.00 /*MHz*/, 0x02, }, 665 - { 16 * 999.99 , 0x04, }, 666 - }, 667 - .config = 0xce, 668 - }, 669 - [TUNER_PHILIPS_FQ1236A_MK4] = { /* Philips NTSC */ 670 - .name = "Philips FQ1236A MK4", 671 - .count = 3, 672 - .ranges = { 673 - { 16 * 160.00 /*MHz*/, 0x01, }, 674 - { 16 * 442.00 /*MHz*/, 0x02, }, 675 - { 16 * 999.99 , 0x04, }, 676 - }, 677 - .config = 0x8e, 678 - }, 679 - [TUNER_YMEC_TVF_8531MF] = { /* Philips NTSC */ 680 - .name = "Ymec TVision TVF-8531MF/8831MF/8731MF", 681 - .count = 3, 682 - .ranges = { 683 - { 16 * 160.00 /*MHz*/, 0xa0, }, 684 - { 16 * 454.00 /*MHz*/, 0x90, }, 685 - { 16 * 999.99 , 0x30, }, 686 - }, 687 - .config = 0x8e, 688 - }, 689 - [TUNER_YMEC_TVF_5533MF] = { /* Philips NTSC */ 690 - .name = "Ymec TVision TVF-5533MF", 691 - .count = 3, 692 - .ranges = { 693 - { 16 * 160.00 /*MHz*/, 0x01, }, 694 - { 16 * 454.00 /*MHz*/, 0x02, }, 695 - { 16 * 999.99 , 0x04, }, 696 - }, 697 - .config = 0x8e, 698 - }, 699 - 700 - /* 60-69 */ 701 - [TUNER_THOMSON_DTT761X] = { /* THOMSON ATSC */ 702 - /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ 703 - .name = "Thomson DTT 761X (ATSC/NTSC)", 704 - .count = 3, 705 - .ranges = { 706 - { 16 * 145.25 /*MHz*/, 0x39, }, 707 - { 16 * 415.25 /*MHz*/, 0x3a, }, 708 - { 16 * 999.99 , 0x3c, }, 709 - }, 710 - .config = 0x8e, 711 - }, 712 - [TUNER_TENA_9533_DI] = { /* Philips PAL */ 713 - .name = "Tena TNF9533-D/IF/TNF9533-B/DF", 714 - .count = 3, 715 - .ranges = { 716 - { 16 * 160.25 /*MHz*/, 0x01, }, 717 - { 16 * 464.25 /*MHz*/, 0x02, }, 718 - { 16 * 999.99 , 0x04, }, 719 - }, 720 - .config = 0x8e, 721 - }, 722 - [TUNER_TEA5767] = { /* Philips RADIO */ 723 - .name = "Philips TEA5767HN FM Radio", 724 - /* see tea5767.c for details */}, 725 - [TUNER_PHILIPS_FMD1216ME_MK3] = { /* Philips PAL */ 726 - .name = "Philips FMD1216ME MK3 Hybrid Tuner", 727 - .count = 3, 728 - .ranges = { 729 - { 16 * 160.00 /*MHz*/, 0x51, }, 730 - { 16 * 442.00 /*MHz*/, 0x52, }, 731 - { 16 * 999.99 , 0x54, }, 732 - }, 733 - .config = 0x86, 734 - }, 735 - [TUNER_LG_TDVS_H062F] = { /* LGINNOTEK ATSC */ 736 - .name = "LG TDVS-H062F/TUA6034", 737 - .count = 3, 738 - .ranges = { 739 - { 16 * 160.00 /*MHz*/, 0x01 }, 740 - { 16 * 455.00 /*MHz*/, 0x02 }, 741 - { 16 * 999.99 , 0x04 }, 742 - }, 743 - .config = 0x8e, 744 - }, 745 - [TUNER_YMEC_TVF66T5_B_DFF] = { /* Philips PAL */ 746 - .name = "Ymec TVF66T5-B/DFF", 747 - .count = 3, 748 - .ranges = { 749 - { 16 * 160.25 /*MHz*/, 0x01, }, 750 - { 16 * 464.25 /*MHz*/, 0x02, }, 751 - { 16 * 999.99 , 0x08, }, 752 - }, 753 - .config = 0x8e, 754 - }, 755 - [TUNER_LG_NTSC_TALN_MINI] = { /* LGINNOTEK NTSC */ 756 - .name = "LG NTSC (TALN mini series)", 757 - .count = 3, 758 - .ranges = { 759 - { 16 * 137.25 /*MHz*/, 0x01, }, 760 - { 16 * 373.25 /*MHz*/, 0x02, }, 761 - { 16 * 999.99 , 0x08, }, 762 - }, 763 - .config = 0x8e, 764 - }, 765 - [TUNER_PHILIPS_TD1316] = { /* Philips PAL */ 766 - .name = "Philips TD1316 Hybrid Tuner", 767 - .count = 3, 768 - .ranges = { 769 - { 16 * 160.00 /*MHz*/, 0xa1, }, 770 - { 16 * 442.00 /*MHz*/, 0xa2, }, 771 - { 16 * 999.99 , 0xa4, }, 772 - }, 773 - .config = 0xc8, 774 - }, 775 - [TUNER_PHILIPS_TUV1236D] = { /* Philips ATSC */ 776 - .name = "Philips TUV1236D ATSC/NTSC dual in", 777 - .count = 3, 778 - .ranges = { 779 - { 16 * 157.25 /*MHz*/, 0x01, }, 780 - { 16 * 454.00 /*MHz*/, 0x02, }, 781 - { 16 * 999.99 , 0x04, }, 782 - }, 783 - .config = 0xce, 784 - }, 785 - [TUNER_TNF_5335MF] = { /* Philips NTSC */ 786 - .name = "Tena TNF 5335 MF", 787 - .count = 3, 788 - .ranges = { 789 - { 16 * 157.25 /*MHz*/, 0x01, }, 790 - { 16 * 454.00 /*MHz*/, 0x02, }, 791 - { 16 * 999.99 , 0x04, }, 792 - }, 793 - .config = 0x8e, 794 - }, 795 - }; 796 - 797 - unsigned const int tuner_count = ARRAY_SIZE(tuners); 798 799 /* ---------------------------------------------------------------------- */ 800 ··· 136 u8 config, tuneraddr; 137 u16 div; 138 struct tunertype *tun; 139 - unsigned char buffer[4]; 140 - int rc, IFPCoff, i; 141 142 tun = &tuners[t->type]; 143 - for (i = 0; i < tun->count; i++) { 144 - if (freq > tun->ranges[i].thresh) 145 continue; 146 break; 147 } 148 - config = tun->ranges[i].cb; 149 /* i == 0 -> VHF_LO */ 150 /* i == 1 -> VHF_HI */ 151 /* i == 2 -> UHF */ ··· 215 216 case TUNER_MICROTUNE_4042FI5: 217 /* Set the charge pump for fast tuning */ 218 - tun->config |= TUNER_CHARGE_PUMP; 219 break; 220 221 case TUNER_PHILIPS_TUV1236D: ··· 243 /* FIXME: input */ 244 break; 245 } 246 - 247 - /* 248 - * Philips FI1216MK2 remark from specification : 249 - * for channel selection involving band switching, and to ensure 250 - * smooth tuning to the desired channel without causing 251 - * unnecessary charge pump action, it is recommended to consider 252 - * the difference between wanted channel frequency and the 253 - * current channel frequency. Unnecessary charge pump action 254 - * will result in very low tuning voltage which may drive the 255 - * oscillator to extreme conditions. 256 - * 257 - * Progfou: specification says to send config data before 258 - * frequency in case (wanted frequency < current frequency). 259 - */ 260 261 /* IFPCoff = Video Intermediate Frequency - Vif: 262 940 =16*58.75 NTSC/J (Japan) ··· 275 offset / 16, offset % 16 * 100 / 16, 276 div); 277 278 - if (t->type == TUNER_PHILIPS_SECAM && freq < t->freq) { 279 - buffer[0] = tun->config; 280 buffer[1] = config; 281 buffer[2] = (div>>8) & 0x7f; 282 buffer[3] = div & 0xff; 283 } else { 284 buffer[0] = (div>>8) & 0x7f; 285 buffer[1] = div & 0xff; 286 - buffer[2] = tun->config; 287 buffer[3] = config; 288 } 289 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 290 buffer[0],buffer[1],buffer[2],buffer[3]); 291 ··· 312 } 313 314 /* Set the charge pump for optimized phase noise figure */ 315 - tun->config &= ~TUNER_CHARGE_PUMP; 316 buffer[0] = (div>>8) & 0x7f; 317 buffer[1] = div & 0xff; 318 - buffer[2] = tun->config; 319 buffer[3] = config; 320 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 321 buffer[0],buffer[1],buffer[2],buffer[3]); ··· 329 { 330 struct tunertype *tun; 331 struct tuner *t = i2c_get_clientdata(c); 332 - unsigned char buffer[4]; 333 - unsigned div; 334 - int rc; 335 336 tun = &tuners[t->type]; 337 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ 338 - buffer[2] = (tun->config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ 339 340 switch (t->type) { 341 case TUNER_TENA_9533_DI: ··· 366 } 367 buffer[0] = (div>>8) & 0x7f; 368 buffer[1] = div & 0xff; 369 370 tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n", 371 buffer[0],buffer[1],buffer[2],buffer[3]); 372 373 if (4 != (rc = i2c_master_send(c,buffer,4))) 374 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); ··· 392 t->type, tuners[t->type].name); 393 strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); 394 395 - t->tv_freq = default_set_tv_freq; 396 - t->radio_freq = default_set_radio_freq; 397 t->has_signal = tuner_signal; 398 - t->is_stereo = tuner_stereo; 399 t->standby = NULL; 400 401 return 0;
··· 79 #define TUNER_PLL_LOCKED 0x40 80 #define TUNER_STEREO_MK3 0x04 81 82 + #define TUNER_PARAM_ANALOG 0 /* to be removed */ 83 + /* FIXME: 84 + * Right now, all tuners are using the first tuner_params[] array element 85 + * for analog mode. In the future, we will be merging similar tuner 86 + * definitions together, such that each tuner definition will have a 87 + * tuner_params struct for each available video standard. At that point, 88 + * TUNER_PARAM_ANALOG will be removed, and the tuner_params[] array 89 + * element will be chosen based on the video standard in use. 90 + * 91 */ 92 93 /* ---------------------------------------------------------------------- */ 94 ··· 842 u8 config, tuneraddr; 843 u16 div; 844 struct tunertype *tun; 845 + u8 buffer[4]; 846 + int rc, IFPCoff, i, j; 847 848 tun = &tuners[t->type]; 849 + j = TUNER_PARAM_ANALOG; 850 + 851 + for (i = 0; i < tun->params[j].count; i++) { 852 + if (freq > tun->params[j].ranges[i].limit) 853 continue; 854 break; 855 } 856 + if (i == tun->params[j].count) { 857 + tuner_dbg("TV frequency out of range (%d > %d)", 858 + freq, tun->params[j].ranges[i - 1].limit); 859 + freq = tun->params[j].ranges[--i].limit; 860 + } 861 + config = tun->params[j].ranges[i].cb; 862 /* i == 0 -> VHF_LO */ 863 /* i == 1 -> VHF_HI */ 864 /* i == 2 -> UHF */ ··· 914 915 case TUNER_MICROTUNE_4042FI5: 916 /* Set the charge pump for fast tuning */ 917 + tun->params[j].config |= TUNER_CHARGE_PUMP; 918 break; 919 920 case TUNER_PHILIPS_TUV1236D: ··· 942 /* FIXME: input */ 943 break; 944 } 945 946 /* IFPCoff = Video Intermediate Frequency - Vif: 947 940 =16*58.75 NTSC/J (Japan) ··· 988 offset / 16, offset % 16 * 100 / 16, 989 div); 990 991 + if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { 992 + buffer[0] = tun->params[j].config; 993 buffer[1] = config; 994 buffer[2] = (div>>8) & 0x7f; 995 buffer[3] = div & 0xff; 996 } else { 997 buffer[0] = (div>>8) & 0x7f; 998 buffer[1] = div & 0xff; 999 + buffer[2] = tun->params[j].config; 1000 buffer[3] = config; 1001 } 1002 + t->last_div = div; 1003 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 1004 buffer[0],buffer[1],buffer[2],buffer[3]); 1005 ··· 1024 } 1025 1026 /* Set the charge pump for optimized phase noise figure */ 1027 + tun->params[j].config &= ~TUNER_CHARGE_PUMP; 1028 buffer[0] = (div>>8) & 0x7f; 1029 buffer[1] = div & 0xff; 1030 + buffer[2] = tun->params[j].config; 1031 buffer[3] = config; 1032 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 1033 buffer[0],buffer[1],buffer[2],buffer[3]); ··· 1041 { 1042 struct tunertype *tun; 1043 struct tuner *t = i2c_get_clientdata(c); 1044 + u8 buffer[4]; 1045 + u16 div; 1046 + int rc, j; 1047 1048 tun = &tuners[t->type]; 1049 + j = TUNER_PARAM_ANALOG; 1050 + 1051 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ 1052 + buffer[2] = (tun->params[j].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ 1053 1054 switch (t->type) { 1055 case TUNER_TENA_9533_DI: ··· 1076 } 1077 buffer[0] = (div>>8) & 0x7f; 1078 buffer[1] = div & 0xff; 1079 + if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { 1080 + buffer[0] = buffer[2]; 1081 + buffer[1] = buffer[3]; 1082 + buffer[2] = (div>>8) & 0x7f; 1083 + buffer[3] = div & 0xff; 1084 + } else { 1085 + buffer[0] = (div>>8) & 0x7f; 1086 + buffer[1] = div & 0xff; 1087 + } 1088 1089 tuner_dbg("radio 0x%02x 0x%02x 0x%02x 0x%02x\n", 1090 buffer[0],buffer[1],buffer[2],buffer[3]); 1091 + t->last_div = div; 1092 1093 if (4 != (rc = i2c_master_send(c,buffer,4))) 1094 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); ··· 1092 t->type, tuners[t->type].name); 1093 strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); 1094 1095 + t->set_tv_freq = default_set_tv_freq; 1096 + t->set_radio_freq = default_set_radio_freq; 1097 t->has_signal = tuner_signal; 1098 + t->is_stereo = tuner_stereo; 1099 t->standby = NULL; 1100 1101 return 0;
+1406
drivers/media/video/tuner-types.c
···
··· 1 + /* 2 + * 3 + * i2c tv tuner chip device type database. 4 + * 5 + */ 6 + 7 + #include <linux/i2c.h> 8 + #include <media/tuner.h> 9 + #include <media/tuner-types.h> 10 + 11 + /* ---------------------------------------------------------------------- */ 12 + 13 + /* 14 + * The floats in the tuner struct are computed at compile time 15 + * by gcc and cast back to integers. Thus we don't violate the 16 + * "no float in kernel" rule. 17 + * 18 + * A tuner_range may be referenced by multiple tuner_params structs. 19 + * There are many duplicates in here. Reusing tuner_range structs, 20 + * rather than defining new ones for each tuner, will cut down on 21 + * memory usage, and is preferred when possible. 22 + * 23 + * Each tuner_params array may contain one or more elements, one 24 + * for each video standard. 25 + * 26 + * FIXME: Some tuner_range definitions are duplicated, and 27 + * should be eliminated. 28 + * 29 + * FIXME: tunertype struct contains an element, has_tda988x. 30 + * We must set this for all tunertypes that contain a tda988x 31 + * chip, and then we can remove this setting from the various 32 + * card structs. 33 + */ 34 + 35 + /* 0-9 */ 36 + /* ------------ TUNER_TEMIC_PAL - TEMIC PAL ------------ */ 37 + 38 + static struct tuner_range tuner_temic_pal_ranges[] = { 39 + { 16 * 140.25 /*MHz*/, 0x02, }, 40 + { 16 * 463.25 /*MHz*/, 0x04, }, 41 + { 16 * 999.99 , 0x01, }, 42 + }; 43 + 44 + static struct tuner_params tuner_temic_pal_params[] = { 45 + { 46 + .type = TUNER_PARAM_TYPE_PAL, 47 + .ranges = tuner_temic_pal_ranges, 48 + .count = ARRAY_SIZE(tuner_temic_pal_ranges), 49 + .config = 0x8e, 50 + }, 51 + }; 52 + 53 + /* ------------ TUNER_PHILIPS_PAL_I - Philips PAL_I ------------ */ 54 + 55 + static struct tuner_range tuner_philips_pal_i_ranges[] = { 56 + { 16 * 140.25 /*MHz*/, 0xa0, }, 57 + { 16 * 463.25 /*MHz*/, 0x90, }, 58 + { 16 * 999.99 , 0x30, }, 59 + }; 60 + 61 + static struct tuner_params tuner_philips_pal_i_params[] = { 62 + { 63 + .type = TUNER_PARAM_TYPE_PAL, 64 + .ranges = tuner_philips_pal_i_ranges, 65 + .count = ARRAY_SIZE(tuner_philips_pal_i_ranges), 66 + .config = 0x8e, 67 + }, 68 + }; 69 + 70 + /* ------------ TUNER_PHILIPS_NTSC - Philips NTSC ------------ */ 71 + 72 + static struct tuner_range tuner_philips_ntsc_ranges[] = { 73 + { 16 * 157.25 /*MHz*/, 0xa0, }, 74 + { 16 * 451.25 /*MHz*/, 0x90, }, 75 + { 16 * 999.99 , 0x30, }, 76 + }; 77 + 78 + static struct tuner_params tuner_philips_ntsc_params[] = { 79 + { 80 + .type = TUNER_PARAM_TYPE_NTSC, 81 + .ranges = tuner_philips_ntsc_ranges, 82 + .count = ARRAY_SIZE(tuner_philips_ntsc_ranges), 83 + .config = 0x8e, 84 + .cb_first_if_lower_freq = 1, 85 + }, 86 + }; 87 + 88 + /* ------------ TUNER_PHILIPS_SECAM - Philips SECAM ------------ */ 89 + 90 + static struct tuner_range tuner_philips_secam_ranges[] = { 91 + { 16 * 168.25 /*MHz*/, 0xa7, }, 92 + { 16 * 447.25 /*MHz*/, 0x97, }, 93 + { 16 * 999.99 , 0x37, }, 94 + }; 95 + 96 + static struct tuner_params tuner_philips_secam_params[] = { 97 + { 98 + .type = TUNER_PARAM_TYPE_SECAM, 99 + .ranges = tuner_philips_secam_ranges, 100 + .count = ARRAY_SIZE(tuner_philips_secam_ranges), 101 + .config = 0x8e, 102 + .cb_first_if_lower_freq = 1, 103 + }, 104 + }; 105 + 106 + /* ------------ TUNER_PHILIPS_PAL - Philips PAL ------------ */ 107 + 108 + static struct tuner_range tuner_philips_pal_ranges[] = { 109 + { 16 * 168.25 /*MHz*/, 0xa0, }, 110 + { 16 * 447.25 /*MHz*/, 0x90, }, 111 + { 16 * 999.99 , 0x30, }, 112 + }; 113 + 114 + static struct tuner_params tuner_philips_pal_params[] = { 115 + { 116 + .type = TUNER_PARAM_TYPE_PAL, 117 + .ranges = tuner_philips_pal_ranges, 118 + .count = ARRAY_SIZE(tuner_philips_pal_ranges), 119 + .config = 0x8e, 120 + .cb_first_if_lower_freq = 1, 121 + }, 122 + }; 123 + 124 + /* ------------ TUNER_TEMIC_NTSC - TEMIC NTSC ------------ */ 125 + 126 + static struct tuner_range tuner_temic_ntsc_ranges[] = { 127 + { 16 * 157.25 /*MHz*/, 0x02, }, 128 + { 16 * 463.25 /*MHz*/, 0x04, }, 129 + { 16 * 999.99 , 0x01, }, 130 + }; 131 + 132 + static struct tuner_params tuner_temic_ntsc_params[] = { 133 + { 134 + .type = TUNER_PARAM_TYPE_NTSC, 135 + .ranges = tuner_temic_ntsc_ranges, 136 + .count = ARRAY_SIZE(tuner_temic_ntsc_ranges), 137 + .config = 0x8e, 138 + }, 139 + }; 140 + 141 + /* ------------ TUNER_TEMIC_PAL_I - TEMIC PAL_I ------------ */ 142 + 143 + static struct tuner_range tuner_temic_pal_i_ranges[] = { 144 + { 16 * 170.00 /*MHz*/, 0x02, }, 145 + { 16 * 450.00 /*MHz*/, 0x04, }, 146 + { 16 * 999.99 , 0x01, }, 147 + }; 148 + 149 + static struct tuner_params tuner_temic_pal_i_params[] = { 150 + { 151 + .type = TUNER_PARAM_TYPE_PAL, 152 + .ranges = tuner_temic_pal_i_ranges, 153 + .count = ARRAY_SIZE(tuner_temic_pal_i_ranges), 154 + .config = 0x8e, 155 + }, 156 + }; 157 + 158 + /* ------------ TUNER_TEMIC_4036FY5_NTSC - TEMIC NTSC ------------ */ 159 + 160 + static struct tuner_range tuner_temic_4036fy5_ntsc_ranges[] = { 161 + { 16 * 157.25 /*MHz*/, 0xa0, }, 162 + { 16 * 463.25 /*MHz*/, 0x90, }, 163 + { 16 * 999.99 , 0x30, }, 164 + }; 165 + 166 + static struct tuner_params tuner_temic_4036fy5_ntsc_params[] = { 167 + { 168 + .type = TUNER_PARAM_TYPE_NTSC, 169 + .ranges = tuner_temic_4036fy5_ntsc_ranges, 170 + .count = ARRAY_SIZE(tuner_temic_4036fy5_ntsc_ranges), 171 + .config = 0x8e, 172 + }, 173 + }; 174 + 175 + /* ------------ TUNER_ALPS_TSBH1_NTSC - TEMIC NTSC ------------ */ 176 + 177 + static struct tuner_range tuner_alps_tsb_1_ranges[] = { 178 + { 16 * 137.25 /*MHz*/, 0x01, }, 179 + { 16 * 385.25 /*MHz*/, 0x02, }, 180 + { 16 * 999.99 , 0x08, }, 181 + }; 182 + 183 + static struct tuner_params tuner_alps_tsbh1_ntsc_params[] = { 184 + { 185 + .type = TUNER_PARAM_TYPE_NTSC, 186 + .ranges = tuner_alps_tsb_1_ranges, 187 + .count = ARRAY_SIZE(tuner_alps_tsb_1_ranges), 188 + .config = 0x8e, 189 + }, 190 + }; 191 + 192 + /* 10-19 */ 193 + /* ------------ TUNER_ALPS_TSBE1_PAL - TEMIC PAL ------------ */ 194 + 195 + static struct tuner_params tuner_alps_tsb_1_params[] = { 196 + { 197 + .type = TUNER_PARAM_TYPE_PAL, 198 + .ranges = tuner_alps_tsb_1_ranges, 199 + .count = ARRAY_SIZE(tuner_alps_tsb_1_ranges), 200 + .config = 0x8e, 201 + }, 202 + }; 203 + 204 + /* ------------ TUNER_ALPS_TSBB5_PAL_I - Alps PAL_I ------------ */ 205 + 206 + static struct tuner_range tuner_alps_tsb_5_pal_ranges[] = { 207 + { 16 * 133.25 /*MHz*/, 0x01, }, 208 + { 16 * 351.25 /*MHz*/, 0x02, }, 209 + { 16 * 999.99 , 0x08, }, 210 + }; 211 + 212 + static struct tuner_params tuner_alps_tsbb5_params[] = { 213 + { 214 + .type = TUNER_PARAM_TYPE_PAL, 215 + .ranges = tuner_alps_tsb_5_pal_ranges, 216 + .count = ARRAY_SIZE(tuner_alps_tsb_5_pal_ranges), 217 + .config = 0x8e, 218 + }, 219 + }; 220 + 221 + /* ------------ TUNER_ALPS_TSBE5_PAL - Alps PAL ------------ */ 222 + 223 + static struct tuner_params tuner_alps_tsbe5_params[] = { 224 + { 225 + .type = TUNER_PARAM_TYPE_PAL, 226 + .ranges = tuner_alps_tsb_5_pal_ranges, 227 + .count = ARRAY_SIZE(tuner_alps_tsb_5_pal_ranges), 228 + .config = 0x8e, 229 + }, 230 + }; 231 + 232 + /* ------------ TUNER_ALPS_TSBC5_PAL - Alps PAL ------------ */ 233 + 234 + static struct tuner_params tuner_alps_tsbc5_params[] = { 235 + { 236 + .type = TUNER_PARAM_TYPE_PAL, 237 + .ranges = tuner_alps_tsb_5_pal_ranges, 238 + .count = ARRAY_SIZE(tuner_alps_tsb_5_pal_ranges), 239 + .config = 0x8e, 240 + }, 241 + }; 242 + 243 + /* ------------ TUNER_TEMIC_4006FH5_PAL - TEMIC PAL ------------ */ 244 + 245 + static struct tuner_range tuner_temic_4006fh5_pal_ranges[] = { 246 + { 16 * 170.00 /*MHz*/, 0xa0, }, 247 + { 16 * 450.00 /*MHz*/, 0x90, }, 248 + { 16 * 999.99 , 0x30, }, 249 + }; 250 + 251 + static struct tuner_params tuner_temic_4006fh5_params[] = { 252 + { 253 + .type = TUNER_PARAM_TYPE_PAL, 254 + .ranges = tuner_temic_4006fh5_pal_ranges, 255 + .count = ARRAY_SIZE(tuner_temic_4006fh5_pal_ranges), 256 + .config = 0x8e, 257 + }, 258 + }; 259 + 260 + /* ------------ TUNER_ALPS_TSHC6_NTSC - Alps NTSC ------------ */ 261 + 262 + static struct tuner_range tuner_alps_tshc6_ntsc_ranges[] = { 263 + { 16 * 137.25 /*MHz*/, 0x14, }, 264 + { 16 * 385.25 /*MHz*/, 0x12, }, 265 + { 16 * 999.99 , 0x11, }, 266 + }; 267 + 268 + static struct tuner_params tuner_alps_tshc6_params[] = { 269 + { 270 + .type = TUNER_PARAM_TYPE_NTSC, 271 + .ranges = tuner_alps_tshc6_ntsc_ranges, 272 + .count = ARRAY_SIZE(tuner_alps_tshc6_ntsc_ranges), 273 + .config = 0x8e, 274 + }, 275 + }; 276 + 277 + /* ------------ TUNER_TEMIC_PAL_DK - TEMIC PAL ------------ */ 278 + 279 + static struct tuner_range tuner_temic_pal_dk_ranges[] = { 280 + { 16 * 168.25 /*MHz*/, 0xa0, }, 281 + { 16 * 456.25 /*MHz*/, 0x90, }, 282 + { 16 * 999.99 , 0x30, }, 283 + }; 284 + 285 + static struct tuner_params tuner_temic_pal_dk_params[] = { 286 + { 287 + .type = TUNER_PARAM_TYPE_PAL, 288 + .ranges = tuner_temic_pal_dk_ranges, 289 + .count = ARRAY_SIZE(tuner_temic_pal_dk_ranges), 290 + .config = 0x8e, 291 + }, 292 + }; 293 + 294 + /* ------------ TUNER_PHILIPS_NTSC_M - Philips NTSC ------------ */ 295 + 296 + static struct tuner_range tuner_philips_ntsc_m_ranges[] = { 297 + { 16 * 160.00 /*MHz*/, 0xa0, }, 298 + { 16 * 454.00 /*MHz*/, 0x90, }, 299 + { 16 * 999.99 , 0x30, }, 300 + }; 301 + 302 + static struct tuner_params tuner_philips_ntsc_m_params[] = { 303 + { 304 + .type = TUNER_PARAM_TYPE_NTSC, 305 + .ranges = tuner_philips_ntsc_m_ranges, 306 + .count = ARRAY_SIZE(tuner_philips_ntsc_m_ranges), 307 + .config = 0x8e, 308 + }, 309 + }; 310 + 311 + /* ------------ TUNER_TEMIC_4066FY5_PAL_I - TEMIC PAL_I ------------ */ 312 + 313 + static struct tuner_range tuner_temic_40x6f_5_pal_ranges[] = { 314 + { 16 * 169.00 /*MHz*/, 0xa0, }, 315 + { 16 * 454.00 /*MHz*/, 0x90, }, 316 + { 16 * 999.99 , 0x30, }, 317 + }; 318 + 319 + static struct tuner_params tuner_temic_4066fy5_pal_i_params[] = { 320 + { 321 + .type = TUNER_PARAM_TYPE_PAL, 322 + .ranges = tuner_temic_40x6f_5_pal_ranges, 323 + .count = ARRAY_SIZE(tuner_temic_40x6f_5_pal_ranges), 324 + .config = 0x8e, 325 + }, 326 + }; 327 + 328 + /* ------------ TUNER_TEMIC_4006FN5_MULTI_PAL - TEMIC PAL ------------ */ 329 + 330 + static struct tuner_params tuner_temic_4006fn5_multi_params[] = { 331 + { 332 + .type = TUNER_PARAM_TYPE_PAL, 333 + .ranges = tuner_temic_40x6f_5_pal_ranges, 334 + .count = ARRAY_SIZE(tuner_temic_40x6f_5_pal_ranges), 335 + .config = 0x8e, 336 + }, 337 + }; 338 + 339 + /* 20-29 */ 340 + /* ------------ TUNER_TEMIC_4009FR5_PAL - TEMIC PAL ------------ */ 341 + 342 + static struct tuner_range tuner_temic_4009f_5_pal_ranges[] = { 343 + { 16 * 141.00 /*MHz*/, 0xa0, }, 344 + { 16 * 464.00 /*MHz*/, 0x90, }, 345 + { 16 * 999.99 , 0x30, }, 346 + }; 347 + 348 + static struct tuner_params tuner_temic_4009f_5_params[] = { 349 + { 350 + .type = TUNER_PARAM_TYPE_PAL, 351 + .ranges = tuner_temic_4009f_5_pal_ranges, 352 + .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), 353 + .config = 0x8e, 354 + }, 355 + }; 356 + 357 + /* ------------ TUNER_TEMIC_4039FR5_NTSC - TEMIC NTSC ------------ */ 358 + 359 + static struct tuner_range tuner_temic_4039fr5_ntsc_ranges[] = { 360 + { 16 * 158.00 /*MHz*/, 0xa0, }, 361 + { 16 * 453.00 /*MHz*/, 0x90, }, 362 + { 16 * 999.99 , 0x30, }, 363 + }; 364 + 365 + static struct tuner_params tuner_temic_4039fr5_params[] = { 366 + { 367 + .type = TUNER_PARAM_TYPE_NTSC, 368 + .ranges = tuner_temic_4039fr5_ntsc_ranges, 369 + .count = ARRAY_SIZE(tuner_temic_4039fr5_ntsc_ranges), 370 + .config = 0x8e, 371 + }, 372 + }; 373 + 374 + /* ------------ TUNER_TEMIC_4046FM5 - TEMIC PAL ------------ */ 375 + 376 + static struct tuner_range tuner_temic_4046fm5_pal_ranges[] = { 377 + { 16 * 169.00 /*MHz*/, 0xa0, }, 378 + { 16 * 454.00 /*MHz*/, 0x90, }, 379 + { 16 * 999.99 , 0x30, }, 380 + }; 381 + 382 + static struct tuner_params tuner_temic_4046fm5_params[] = { 383 + { 384 + .type = TUNER_PARAM_TYPE_PAL, 385 + .ranges = tuner_temic_4046fm5_pal_ranges, 386 + .count = ARRAY_SIZE(tuner_temic_4046fm5_pal_ranges), 387 + .config = 0x8e, 388 + }, 389 + }; 390 + 391 + /* ------------ TUNER_PHILIPS_PAL_DK - Philips PAL ------------ */ 392 + 393 + static struct tuner_range tuner_lg_pal_ranges[] = { 394 + { 16 * 170.00 /*MHz*/, 0xa0, }, 395 + { 16 * 450.00 /*MHz*/, 0x90, }, 396 + { 16 * 999.99 , 0x30, }, 397 + }; 398 + 399 + static struct tuner_params tuner_philips_pal_dk_params[] = { 400 + { 401 + .type = TUNER_PARAM_TYPE_PAL, 402 + .ranges = tuner_lg_pal_ranges, 403 + .count = ARRAY_SIZE(tuner_lg_pal_ranges), 404 + .config = 0x8e, 405 + }, 406 + }; 407 + 408 + /* ------------ TUNER_PHILIPS_FQ1216ME - Philips PAL ------------ */ 409 + 410 + static struct tuner_params tuner_philips_fq1216me_params[] = { 411 + { 412 + .type = TUNER_PARAM_TYPE_PAL, 413 + .ranges = tuner_lg_pal_ranges, 414 + .count = ARRAY_SIZE(tuner_lg_pal_ranges), 415 + .config = 0x8e, 416 + }, 417 + }; 418 + 419 + /* ------------ TUNER_LG_PAL_I_FM - LGINNOTEK PAL_I ------------ */ 420 + 421 + static struct tuner_params tuner_lg_pal_i_fm_params[] = { 422 + { 423 + .type = TUNER_PARAM_TYPE_PAL, 424 + .ranges = tuner_lg_pal_ranges, 425 + .count = ARRAY_SIZE(tuner_lg_pal_ranges), 426 + .config = 0x8e, 427 + }, 428 + }; 429 + 430 + /* ------------ TUNER_LG_PAL_I - LGINNOTEK PAL_I ------------ */ 431 + 432 + static struct tuner_params tuner_lg_pal_i_params[] = { 433 + { 434 + .type = TUNER_PARAM_TYPE_PAL, 435 + .ranges = tuner_lg_pal_ranges, 436 + .count = ARRAY_SIZE(tuner_lg_pal_ranges), 437 + .config = 0x8e, 438 + }, 439 + }; 440 + 441 + /* ------------ TUNER_LG_NTSC_FM - LGINNOTEK NTSC ------------ */ 442 + 443 + static struct tuner_range tuner_lg_ntsc_fm_ranges[] = { 444 + { 16 * 210.00 /*MHz*/, 0xa0, }, 445 + { 16 * 497.00 /*MHz*/, 0x90, }, 446 + { 16 * 999.99 , 0x30, }, 447 + }; 448 + 449 + static struct tuner_params tuner_lg_ntsc_fm_params[] = { 450 + { 451 + .type = TUNER_PARAM_TYPE_NTSC, 452 + .ranges = tuner_lg_ntsc_fm_ranges, 453 + .count = ARRAY_SIZE(tuner_lg_ntsc_fm_ranges), 454 + .config = 0x8e, 455 + }, 456 + }; 457 + 458 + /* ------------ TUNER_LG_PAL_FM - LGINNOTEK PAL ------------ */ 459 + 460 + static struct tuner_params tuner_lg_pal_fm_params[] = { 461 + { 462 + .type = TUNER_PARAM_TYPE_PAL, 463 + .ranges = tuner_lg_pal_ranges, 464 + .count = ARRAY_SIZE(tuner_lg_pal_ranges), 465 + .config = 0x8e, 466 + }, 467 + }; 468 + 469 + /* ------------ TUNER_LG_PAL - LGINNOTEK PAL ------------ */ 470 + 471 + static struct tuner_params tuner_lg_pal_params[] = { 472 + { 473 + .type = TUNER_PARAM_TYPE_PAL, 474 + .ranges = tuner_lg_pal_ranges, 475 + .count = ARRAY_SIZE(tuner_lg_pal_ranges), 476 + .config = 0x8e, 477 + }, 478 + }; 479 + 480 + /* 30-39 */ 481 + /* ------------ TUNER_TEMIC_4009FN5_MULTI_PAL_FM - TEMIC PAL ------------ */ 482 + 483 + static struct tuner_params tuner_temic_4009_fn5_multi_pal_fm_params[] = { 484 + { 485 + .type = TUNER_PARAM_TYPE_PAL, 486 + .ranges = tuner_temic_4009f_5_pal_ranges, 487 + .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), 488 + .config = 0x8e, 489 + }, 490 + }; 491 + 492 + /* ------------ TUNER_SHARP_2U5JF5540_NTSC - SHARP NTSC ------------ */ 493 + 494 + static struct tuner_range tuner_sharp_2u5jf5540_ntsc_ranges[] = { 495 + { 16 * 137.25 /*MHz*/, 0x01, }, 496 + { 16 * 317.25 /*MHz*/, 0x02, }, 497 + { 16 * 999.99 , 0x08, }, 498 + }; 499 + 500 + static struct tuner_params tuner_sharp_2u5jf5540_params[] = { 501 + { 502 + .type = TUNER_PARAM_TYPE_NTSC, 503 + .ranges = tuner_sharp_2u5jf5540_ntsc_ranges, 504 + .count = ARRAY_SIZE(tuner_sharp_2u5jf5540_ntsc_ranges), 505 + .config = 0x8e, 506 + }, 507 + }; 508 + 509 + /* ------------ TUNER_Samsung_PAL_TCPM9091PD27 - Samsung PAL ------------ */ 510 + 511 + static struct tuner_range tuner_samsung_pal_tcpm9091pd27_ranges[] = { 512 + { 16 * 169 /*MHz*/, 0xa0, }, 513 + { 16 * 464 /*MHz*/, 0x90, }, 514 + { 16 * 999.99 , 0x30, }, 515 + }; 516 + 517 + static struct tuner_params tuner_samsung_pal_tcpm9091pd27_params[] = { 518 + { 519 + .type = TUNER_PARAM_TYPE_PAL, 520 + .ranges = tuner_samsung_pal_tcpm9091pd27_ranges, 521 + .count = ARRAY_SIZE(tuner_samsung_pal_tcpm9091pd27_ranges), 522 + .config = 0x8e, 523 + }, 524 + }; 525 + 526 + /* ------------ TUNER_TEMIC_4106FH5 - TEMIC PAL ------------ */ 527 + 528 + static struct tuner_params tuner_temic_4106fh5_params[] = { 529 + { 530 + .type = TUNER_PARAM_TYPE_PAL, 531 + .ranges = tuner_temic_4009f_5_pal_ranges, 532 + .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), 533 + .config = 0x8e, 534 + }, 535 + }; 536 + 537 + /* ------------ TUNER_TEMIC_4012FY5 - TEMIC PAL ------------ */ 538 + 539 + static struct tuner_range tuner_temic_4012fy5_pal_ranges[] = { 540 + { 16 * 140.25 /*MHz*/, 0x02, }, 541 + { 16 * 463.25 /*MHz*/, 0x04, }, 542 + { 16 * 999.99 , 0x01, }, 543 + }; 544 + 545 + static struct tuner_params tuner_temic_4012fy5_params[] = { 546 + { 547 + .type = TUNER_PARAM_TYPE_PAL, 548 + .ranges = tuner_temic_4012fy5_pal_ranges, 549 + .count = ARRAY_SIZE(tuner_temic_4012fy5_pal_ranges), 550 + .config = 0x8e, 551 + }, 552 + }; 553 + 554 + /* ------------ TUNER_TEMIC_4136FY5 - TEMIC NTSC ------------ */ 555 + 556 + static struct tuner_range tuner_temic_4136_fy5_ntsc_ranges[] = { 557 + { 16 * 158.00 /*MHz*/, 0xa0, }, 558 + { 16 * 453.00 /*MHz*/, 0x90, }, 559 + { 16 * 999.99 , 0x30, }, 560 + }; 561 + 562 + static struct tuner_params tuner_temic_4136_fy5_params[] = { 563 + { 564 + .type = TUNER_PARAM_TYPE_NTSC, 565 + .ranges = tuner_temic_4136_fy5_ntsc_ranges, 566 + .count = ARRAY_SIZE(tuner_temic_4136_fy5_ntsc_ranges), 567 + .config = 0x8e, 568 + }, 569 + }; 570 + 571 + /* ------------ TUNER_LG_PAL_NEW_TAPC - LGINNOTEK PAL ------------ */ 572 + 573 + static struct tuner_range tuner_lg_new_tapc_ranges[] = { 574 + { 16 * 170.00 /*MHz*/, 0x01, }, 575 + { 16 * 450.00 /*MHz*/, 0x02, }, 576 + { 16 * 999.99 , 0x08, }, 577 + }; 578 + 579 + static struct tuner_params tuner_lg_pal_new_tapc_params[] = { 580 + { 581 + .type = TUNER_PARAM_TYPE_PAL, 582 + .ranges = tuner_lg_new_tapc_ranges, 583 + .count = ARRAY_SIZE(tuner_lg_new_tapc_ranges), 584 + .config = 0x8e, 585 + }, 586 + }; 587 + 588 + /* ------------ TUNER_PHILIPS_FM1216ME_MK3 - Philips PAL ------------ */ 589 + 590 + static struct tuner_range tuner_fm1216me_mk3_pal_ranges[] = { 591 + { 16 * 158.00 /*MHz*/, 0x01, }, 592 + { 16 * 442.00 /*MHz*/, 0x02, }, 593 + { 16 * 999.99 , 0x04, }, 594 + }; 595 + 596 + static struct tuner_params tuner_fm1216me_mk3_params[] = { 597 + { 598 + .type = TUNER_PARAM_TYPE_PAL, 599 + .ranges = tuner_fm1216me_mk3_pal_ranges, 600 + .count = ARRAY_SIZE(tuner_fm1216me_mk3_pal_ranges), 601 + .config = 0x8e, 602 + .cb_first_if_lower_freq = 1, 603 + }, 604 + }; 605 + 606 + /* ------------ TUNER_LG_NTSC_NEW_TAPC - LGINNOTEK NTSC ------------ */ 607 + 608 + static struct tuner_params tuner_lg_ntsc_new_tapc_params[] = { 609 + { 610 + .type = TUNER_PARAM_TYPE_NTSC, 611 + .ranges = tuner_lg_new_tapc_ranges, 612 + .count = ARRAY_SIZE(tuner_lg_new_tapc_ranges), 613 + .config = 0x8e, 614 + }, 615 + }; 616 + 617 + /* 40-49 */ 618 + /* ------------ TUNER_HITACHI_NTSC - HITACHI NTSC ------------ */ 619 + 620 + static struct tuner_params tuner_hitachi_ntsc_params[] = { 621 + { 622 + .type = TUNER_PARAM_TYPE_NTSC, 623 + .ranges = tuner_lg_new_tapc_ranges, 624 + .count = ARRAY_SIZE(tuner_lg_new_tapc_ranges), 625 + .config = 0x8e, 626 + }, 627 + }; 628 + 629 + /* ------------ TUNER_PHILIPS_PAL_MK - Philips PAL ------------ */ 630 + 631 + static struct tuner_range tuner_philips_pal_mk_pal_ranges[] = { 632 + { 16 * 140.25 /*MHz*/, 0x01, }, 633 + { 16 * 463.25 /*MHz*/, 0xc2, }, 634 + { 16 * 999.99 , 0xcf, }, 635 + }; 636 + 637 + static struct tuner_params tuner_philips_pal_mk_params[] = { 638 + { 639 + .type = TUNER_PARAM_TYPE_PAL, 640 + .ranges = tuner_philips_pal_mk_pal_ranges, 641 + .count = ARRAY_SIZE(tuner_philips_pal_mk_pal_ranges), 642 + .config = 0x8e, 643 + }, 644 + }; 645 + 646 + /* ------------ TUNER_PHILIPS_ATSC - Philips ATSC ------------ */ 647 + 648 + static struct tuner_range tuner_philips_atsc_ranges[] = { 649 + { 16 * 157.25 /*MHz*/, 0xa0, }, 650 + { 16 * 454.00 /*MHz*/, 0x90, }, 651 + { 16 * 999.99 , 0x30, }, 652 + }; 653 + 654 + static struct tuner_params tuner_philips_atsc_params[] = { 655 + { 656 + .type = TUNER_PARAM_TYPE_NTSC, 657 + .ranges = tuner_philips_atsc_ranges, 658 + .count = ARRAY_SIZE(tuner_philips_atsc_ranges), 659 + .config = 0x8e, 660 + }, 661 + }; 662 + 663 + /* ------------ TUNER_PHILIPS_FM1236_MK3 - Philips NTSC ------------ */ 664 + 665 + static struct tuner_range tuner_fm1236_mk3_ntsc_ranges[] = { 666 + { 16 * 160.00 /*MHz*/, 0x01, }, 667 + { 16 * 442.00 /*MHz*/, 0x02, }, 668 + { 16 * 999.99 , 0x04, }, 669 + }; 670 + 671 + static struct tuner_params tuner_fm1236_mk3_params[] = { 672 + { 673 + .type = TUNER_PARAM_TYPE_NTSC, 674 + .ranges = tuner_fm1236_mk3_ntsc_ranges, 675 + .count = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges), 676 + .config = 0x8e, 677 + .cb_first_if_lower_freq = 1, 678 + }, 679 + }; 680 + 681 + /* ------------ TUNER_PHILIPS_4IN1 - Philips NTSC ------------ */ 682 + 683 + static struct tuner_range tuner_philips_4in1_ntsc_ranges[] = { 684 + { 16 * 160.00 /*MHz*/, 0x01, }, 685 + { 16 * 442.00 /*MHz*/, 0x02, }, 686 + { 16 * 999.99 , 0x04, }, 687 + }; 688 + 689 + static struct tuner_params tuner_philips_4in1_params[] = { 690 + { 691 + .type = TUNER_PARAM_TYPE_NTSC, 692 + .ranges = tuner_philips_4in1_ntsc_ranges, 693 + .count = ARRAY_SIZE(tuner_philips_4in1_ntsc_ranges), 694 + .config = 0x8e, 695 + }, 696 + }; 697 + 698 + /* ------------ TUNER_MICROTUNE_4049FM5 - Microtune PAL ------------ */ 699 + 700 + static struct tuner_params tuner_microtune_4049_fm5_params[] = { 701 + { 702 + .type = TUNER_PARAM_TYPE_PAL, 703 + .ranges = tuner_temic_4009f_5_pal_ranges, 704 + .count = ARRAY_SIZE(tuner_temic_4009f_5_pal_ranges), 705 + .config = 0x8e, 706 + }, 707 + }; 708 + 709 + /* ------------ TUNER_PANASONIC_VP27 - Panasonic NTSC ------------ */ 710 + 711 + static struct tuner_range tuner_panasonic_vp27_ntsc_ranges[] = { 712 + { 16 * 160.00 /*MHz*/, 0x01, }, 713 + { 16 * 454.00 /*MHz*/, 0x02, }, 714 + { 16 * 999.99 , 0x08, }, 715 + }; 716 + 717 + static struct tuner_params tuner_panasonic_vp27_params[] = { 718 + { 719 + .type = TUNER_PARAM_TYPE_NTSC, 720 + .ranges = tuner_panasonic_vp27_ntsc_ranges, 721 + .count = ARRAY_SIZE(tuner_panasonic_vp27_ntsc_ranges), 722 + .config = 0xce, 723 + }, 724 + }; 725 + 726 + /* ------------ TUNER_LG_NTSC_TAPE - LGINNOTEK NTSC ------------ */ 727 + 728 + static struct tuner_range tuner_lg_ntsc_tape_ranges[] = { 729 + { 16 * 160.00 /*MHz*/, 0x01, }, 730 + { 16 * 442.00 /*MHz*/, 0x02, }, 731 + { 16 * 999.99 , 0x04, }, 732 + }; 733 + 734 + static struct tuner_params tuner_lg_ntsc_tape_params[] = { 735 + { 736 + .type = TUNER_PARAM_TYPE_NTSC, 737 + .ranges = tuner_lg_ntsc_tape_ranges, 738 + .count = ARRAY_SIZE(tuner_lg_ntsc_tape_ranges), 739 + .config = 0x8e, 740 + }, 741 + }; 742 + 743 + /* ------------ TUNER_TNF_8831BGFF - Philips PAL ------------ */ 744 + 745 + static struct tuner_range tuner_tnf_8831bgff_pal_ranges[] = { 746 + { 16 * 161.25 /*MHz*/, 0xa0, }, 747 + { 16 * 463.25 /*MHz*/, 0x90, }, 748 + { 16 * 999.99 , 0x30, }, 749 + }; 750 + 751 + static struct tuner_params tuner_tnf_8831bgff_params[] = { 752 + { 753 + .type = TUNER_PARAM_TYPE_PAL, 754 + .ranges = tuner_tnf_8831bgff_pal_ranges, 755 + .count = ARRAY_SIZE(tuner_tnf_8831bgff_pal_ranges), 756 + .config = 0x8e, 757 + }, 758 + }; 759 + 760 + /* ------------ TUNER_MICROTUNE_4042FI5 - Microtune NTSC ------------ */ 761 + 762 + static struct tuner_range tuner_microtune_4042fi5_ntsc_ranges[] = { 763 + { 16 * 162.00 /*MHz*/, 0xa2, }, 764 + { 16 * 457.00 /*MHz*/, 0x94, }, 765 + { 16 * 999.99 , 0x31, }, 766 + }; 767 + 768 + static struct tuner_params tuner_microtune_4042fi5_params[] = { 769 + { 770 + .type = TUNER_PARAM_TYPE_NTSC, 771 + .ranges = tuner_microtune_4042fi5_ntsc_ranges, 772 + .count = ARRAY_SIZE(tuner_microtune_4042fi5_ntsc_ranges), 773 + .config = 0x8e, 774 + }, 775 + }; 776 + 777 + /* 50-59 */ 778 + /* ------------ TUNER_TCL_2002N - TCL NTSC ------------ */ 779 + 780 + static struct tuner_range tuner_tcl_2002n_ntsc_ranges[] = { 781 + { 16 * 172.00 /*MHz*/, 0x01, }, 782 + { 16 * 448.00 /*MHz*/, 0x02, }, 783 + { 16 * 999.99 , 0x08, }, 784 + }; 785 + 786 + static struct tuner_params tuner_tcl_2002n_params[] = { 787 + { 788 + .type = TUNER_PARAM_TYPE_NTSC, 789 + .ranges = tuner_tcl_2002n_ntsc_ranges, 790 + .count = ARRAY_SIZE(tuner_tcl_2002n_ntsc_ranges), 791 + .config = 0x8e, 792 + .cb_first_if_lower_freq = 1, 793 + }, 794 + }; 795 + 796 + /* ------------ TUNER_PHILIPS_FM1256_IH3 - Philips PAL ------------ */ 797 + 798 + static struct tuner_range tuner_philips_fm1256_ih3_pal_ranges[] = { 799 + { 16 * 160.00 /*MHz*/, 0x01, }, 800 + { 16 * 442.00 /*MHz*/, 0x02, }, 801 + { 16 * 999.99 , 0x04, }, 802 + }; 803 + 804 + static struct tuner_params tuner_philips_fm1256_ih3_params[] = { 805 + { 806 + .type = TUNER_PARAM_TYPE_PAL, 807 + .ranges = tuner_philips_fm1256_ih3_pal_ranges, 808 + .count = ARRAY_SIZE(tuner_philips_fm1256_ih3_pal_ranges), 809 + .config = 0x8e, 810 + }, 811 + }; 812 + 813 + /* ------------ TUNER_THOMSON_DTT7610 - THOMSON ATSC ------------ */ 814 + 815 + static struct tuner_range tuner_thomson_dtt7610_ntsc_ranges[] = { 816 + { 16 * 157.25 /*MHz*/, 0x39, }, 817 + { 16 * 454.00 /*MHz*/, 0x3a, }, 818 + { 16 * 999.99 , 0x3c, }, 819 + }; 820 + 821 + static struct tuner_params tuner_thomson_dtt7610_params[] = { 822 + { 823 + .type = TUNER_PARAM_TYPE_NTSC, 824 + .ranges = tuner_thomson_dtt7610_ntsc_ranges, 825 + .count = ARRAY_SIZE(tuner_thomson_dtt7610_ntsc_ranges), 826 + .config = 0x8e, 827 + }, 828 + }; 829 + 830 + /* ------------ TUNER_PHILIPS_FQ1286 - Philips NTSC ------------ */ 831 + 832 + static struct tuner_range tuner_philips_fq1286_ntsc_ranges[] = { 833 + { 16 * 160.00 /*MHz*/, 0x41, }, 834 + { 16 * 454.00 /*MHz*/, 0x42, }, 835 + { 16 * 999.99 , 0x04, }, 836 + }; 837 + 838 + static struct tuner_params tuner_philips_fq1286_params[] = { 839 + { 840 + .type = TUNER_PARAM_TYPE_NTSC, 841 + .ranges = tuner_philips_fq1286_ntsc_ranges, 842 + .count = ARRAY_SIZE(tuner_philips_fq1286_ntsc_ranges), 843 + .config = 0x8e, 844 + }, 845 + }; 846 + 847 + /* ------------ TUNER_TCL_2002MB - TCL PAL ------------ */ 848 + 849 + static struct tuner_range tuner_tcl_2002mb_pal_ranges[] = { 850 + { 16 * 170.00 /*MHz*/, 0x01, }, 851 + { 16 * 450.00 /*MHz*/, 0x02, }, 852 + { 16 * 999.99 , 0x08, }, 853 + }; 854 + 855 + static struct tuner_params tuner_tcl_2002mb_params[] = { 856 + { 857 + .type = TUNER_PARAM_TYPE_PAL, 858 + .ranges = tuner_tcl_2002mb_pal_ranges, 859 + .count = ARRAY_SIZE(tuner_tcl_2002mb_pal_ranges), 860 + .config = 0xce, 861 + }, 862 + }; 863 + 864 + /* ------------ TUNER_PHILIPS_FQ1216AME_MK4 - Philips PAL ------------ */ 865 + 866 + static struct tuner_range tuner_philips_fq12_6a___mk4_ranges[] = { 867 + { 16 * 160.00 /*MHz*/, 0x01, }, 868 + { 16 * 442.00 /*MHz*/, 0x02, }, 869 + { 16 * 999.99 , 0x04, }, 870 + }; 871 + 872 + static struct tuner_params tuner_philips_fq1216ame_mk4_params[] = { 873 + { 874 + .type = TUNER_PARAM_TYPE_PAL, 875 + .ranges = tuner_philips_fq12_6a___mk4_ranges, 876 + .count = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_ranges), 877 + .config = 0xce, 878 + }, 879 + }; 880 + 881 + /* ------------ TUNER_PHILIPS_FQ1236A_MK4 - Philips NTSC ------------ */ 882 + 883 + static struct tuner_params tuner_philips_fq1236a_mk4_params[] = { 884 + { 885 + .type = TUNER_PARAM_TYPE_NTSC, 886 + .ranges = tuner_philips_fq12_6a___mk4_ranges, 887 + .count = ARRAY_SIZE(tuner_philips_fq12_6a___mk4_ranges), 888 + .config = 0x8e, 889 + }, 890 + }; 891 + 892 + /* ------------ TUNER_YMEC_TVF_8531MF - Philips NTSC ------------ */ 893 + 894 + static struct tuner_range tuner_ymec_tvf_8531mf_ntsc_ranges[] = { 895 + { 16 * 160.00 /*MHz*/, 0xa0, }, 896 + { 16 * 454.00 /*MHz*/, 0x90, }, 897 + { 16 * 999.99 , 0x30, }, 898 + }; 899 + 900 + static struct tuner_params tuner_ymec_tvf_8531mf_params[] = { 901 + { 902 + .type = TUNER_PARAM_TYPE_NTSC, 903 + .ranges = tuner_ymec_tvf_8531mf_ntsc_ranges, 904 + .count = ARRAY_SIZE(tuner_ymec_tvf_8531mf_ntsc_ranges), 905 + .config = 0x8e, 906 + }, 907 + }; 908 + 909 + /* ------------ TUNER_YMEC_TVF_5533MF - Philips NTSC ------------ */ 910 + 911 + static struct tuner_range tuner_ymec_tvf_5533mf_ntsc_ranges[] = { 912 + { 16 * 160.00 /*MHz*/, 0x01, }, 913 + { 16 * 454.00 /*MHz*/, 0x02, }, 914 + { 16 * 999.99 , 0x04, }, 915 + }; 916 + 917 + static struct tuner_params tuner_ymec_tvf_5533mf_params[] = { 918 + { 919 + .type = TUNER_PARAM_TYPE_NTSC, 920 + .ranges = tuner_ymec_tvf_5533mf_ntsc_ranges, 921 + .count = ARRAY_SIZE(tuner_ymec_tvf_5533mf_ntsc_ranges), 922 + .config = 0x8e, 923 + }, 924 + }; 925 + 926 + /* 60-69 */ 927 + /* ------------ TUNER_THOMSON_DTT761X - THOMSON ATSC ------------ */ 928 + /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ 929 + 930 + static struct tuner_range tuner_thomson_dtt761x_ntsc_ranges[] = { 931 + { 16 * 145.25 /*MHz*/, 0x39, }, 932 + { 16 * 415.25 /*MHz*/, 0x3a, }, 933 + { 16 * 999.99 , 0x3c, }, 934 + }; 935 + 936 + 937 + static struct tuner_params tuner_thomson_dtt761x_params[] = { 938 + { 939 + .type = TUNER_PARAM_TYPE_NTSC, 940 + .ranges = tuner_thomson_dtt761x_ntsc_ranges, 941 + .count = ARRAY_SIZE(tuner_thomson_dtt761x_ntsc_ranges), 942 + .config = 0x8e, 943 + }, 944 + }; 945 + 946 + /* ------------ TUNER_TENA_9533_DI - Philips PAL ------------ */ 947 + 948 + static struct tuner_range tuner_tuner_tena_9533_di_pal_ranges[] = { 949 + { 16 * 160.25 /*MHz*/, 0x01, }, 950 + { 16 * 464.25 /*MHz*/, 0x02, }, 951 + { 16 * 999.99 , 0x04, }, 952 + }; 953 + 954 + static struct tuner_params tuner_tena_9533_di_params[] = { 955 + { 956 + .type = TUNER_PARAM_TYPE_PAL, 957 + .ranges = tuner_tuner_tena_9533_di_pal_ranges, 958 + .count = ARRAY_SIZE(tuner_tuner_tena_9533_di_pal_ranges), 959 + .config = 0x8e, 960 + }, 961 + }; 962 + 963 + /* ------------ TUNER_PHILIPS_FMD1216ME_MK3 - Philips PAL ------------ */ 964 + 965 + static struct tuner_range tuner_philips_fmd1216me_mk3_pal_ranges[] = { 966 + { 16 * 160.00 /*MHz*/, 0x51, }, 967 + { 16 * 442.00 /*MHz*/, 0x52, }, 968 + { 16 * 999.99 , 0x54, }, 969 + }; 970 + 971 + 972 + static struct tuner_params tuner_tuner_philips_fmd1216me_mk3_params[] = { 973 + { 974 + .type = TUNER_PARAM_TYPE_PAL, 975 + .ranges = tuner_philips_fmd1216me_mk3_pal_ranges, 976 + .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges), 977 + .config = 0x86, 978 + }, 979 + }; 980 + 981 + 982 + /* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ 983 + 984 + static struct tuner_range tuner_tua6034_ntsc_ranges[] = { 985 + { 16 * 160.00 /*MHz*/, 0x01 }, 986 + { 16 * 455.00 /*MHz*/, 0x02 }, 987 + { 16 * 999.99 , 0x04 }, 988 + }; 989 + 990 + 991 + static struct tuner_params tuner_tua6034_params[] = { 992 + { 993 + .type = TUNER_PARAM_TYPE_NTSC, 994 + .ranges = tuner_tua6034_ntsc_ranges, 995 + .count = ARRAY_SIZE(tuner_tua6034_ntsc_ranges), 996 + .config = 0x8e, 997 + }, 998 + }; 999 + 1000 + /* ------------ TUNER_YMEC_TVF66T5_B_DFF - Philips PAL ------------ */ 1001 + 1002 + static struct tuner_range tuner_ymec_tvf66t5_b_dff_pal_ranges[] = { 1003 + { 16 * 160.25 /*MHz*/, 0x01, }, 1004 + { 16 * 464.25 /*MHz*/, 0x02, }, 1005 + { 16 * 999.99 , 0x08, }, 1006 + }; 1007 + 1008 + static struct tuner_params tuner_ymec_tvf66t5_b_dff_params[] = { 1009 + { 1010 + .type = TUNER_PARAM_TYPE_PAL, 1011 + .ranges = tuner_ymec_tvf66t5_b_dff_pal_ranges, 1012 + .count = ARRAY_SIZE(tuner_ymec_tvf66t5_b_dff_pal_ranges), 1013 + .config = 0x8e, 1014 + }, 1015 + }; 1016 + 1017 + /* ------------ TUNER_LG_NTSC_TALN_MINI - LGINNOTEK NTSC ------------ */ 1018 + 1019 + static struct tuner_range tuner_lg_taln_mini_ntsc_ranges[] = { 1020 + { 16 * 137.25 /*MHz*/, 0x01, }, 1021 + { 16 * 373.25 /*MHz*/, 0x02, }, 1022 + { 16 * 999.99 , 0x08, }, 1023 + }; 1024 + 1025 + static struct tuner_params tuner_lg_taln_mini_params[] = { 1026 + { 1027 + .type = TUNER_PARAM_TYPE_NTSC, 1028 + .ranges = tuner_lg_taln_mini_ntsc_ranges, 1029 + .count = ARRAY_SIZE(tuner_lg_taln_mini_ntsc_ranges), 1030 + .config = 0x8e, 1031 + }, 1032 + }; 1033 + 1034 + /* ------------ TUNER_PHILIPS_TD1316 - Philips PAL ------------ */ 1035 + 1036 + static struct tuner_range tuner_philips_td1316_pal_ranges[] = { 1037 + { 16 * 160.00 /*MHz*/, 0xa1, }, 1038 + { 16 * 442.00 /*MHz*/, 0xa2, }, 1039 + { 16 * 999.99 , 0xa4, }, 1040 + }; 1041 + 1042 + static struct tuner_params tuner_philips_td1316_params[] = { 1043 + { 1044 + .type = TUNER_PARAM_TYPE_PAL, 1045 + .ranges = tuner_philips_td1316_pal_ranges, 1046 + .count = ARRAY_SIZE(tuner_philips_td1316_pal_ranges), 1047 + .config = 0xc8, 1048 + }, 1049 + }; 1050 + 1051 + /* ------------ TUNER_PHILIPS_TUV1236D - Philips ATSC ------------ */ 1052 + 1053 + static struct tuner_range tuner_tuv1236d_ntsc_ranges[] = { 1054 + { 16 * 157.25 /*MHz*/, 0x01, }, 1055 + { 16 * 454.00 /*MHz*/, 0x02, }, 1056 + { 16 * 999.99 , 0x04, }, 1057 + }; 1058 + 1059 + 1060 + static struct tuner_params tuner_tuner_tuv1236d_params[] = { 1061 + { 1062 + .type = TUNER_PARAM_TYPE_NTSC, 1063 + .ranges = tuner_tuv1236d_ntsc_ranges, 1064 + .count = ARRAY_SIZE(tuner_tuv1236d_ntsc_ranges), 1065 + .config = 0xce, 1066 + }, 1067 + }; 1068 + 1069 + /* ------------ TUNER_TNF_5335MF - Philips NTSC ------------ */ 1070 + 1071 + static struct tuner_range tuner_tnf_5335mf_ntsc_ranges[] = { 1072 + { 16 * 157.25 /*MHz*/, 0x01, }, 1073 + { 16 * 454.00 /*MHz*/, 0x02, }, 1074 + { 16 * 999.99 , 0x04, }, 1075 + }; 1076 + 1077 + static struct tuner_params tuner_tnf_5335mf_params[] = { 1078 + { 1079 + .type = TUNER_PARAM_TYPE_NTSC, 1080 + .ranges = tuner_tnf_5335mf_ntsc_ranges, 1081 + .count = ARRAY_SIZE(tuner_tnf_5335mf_ntsc_ranges), 1082 + .config = 0x8e, 1083 + }, 1084 + }; 1085 + 1086 + /* 70-79 */ 1087 + /* ------------ TUNER_SAMSUNG_TCPN_2121P30A - Samsung NTSC ------------ */ 1088 + 1089 + static struct tuner_range tuner_samsung_tcpn_2121p30a_ntsc_ranges[] = { 1090 + { 16 * 175.75 /*MHz*/, 0x01, }, 1091 + { 16 * 410.25 /*MHz*/, 0x02, }, 1092 + { 16 * 999.99 , 0x08, }, 1093 + }; 1094 + 1095 + static struct tuner_params tuner_samsung_tcpn_2121p30a_params[] = { 1096 + { 1097 + .type = TUNER_PARAM_TYPE_NTSC, 1098 + .ranges = tuner_samsung_tcpn_2121p30a_ntsc_ranges, 1099 + .count = ARRAY_SIZE(tuner_samsung_tcpn_2121p30a_ntsc_ranges), 1100 + .config = 0xce, 1101 + }, 1102 + }; 1103 + 1104 + /* --------------------------------------------------------------------- */ 1105 + 1106 + struct tunertype tuners[] = { 1107 + /* 0-9 */ 1108 + [TUNER_TEMIC_PAL] = { /* TEMIC PAL */ 1109 + .name = "Temic PAL (4002 FH5)", 1110 + .params = tuner_temic_pal_params, 1111 + }, 1112 + [TUNER_PHILIPS_PAL_I] = { /* Philips PAL_I */ 1113 + .name = "Philips PAL_I (FI1246 and compatibles)", 1114 + .params = tuner_philips_pal_i_params, 1115 + }, 1116 + [TUNER_PHILIPS_NTSC] = { /* Philips NTSC */ 1117 + .name = "Philips NTSC (FI1236,FM1236 and compatibles)", 1118 + .params = tuner_philips_ntsc_params, 1119 + }, 1120 + [TUNER_PHILIPS_SECAM] = { /* Philips SECAM */ 1121 + .name = "Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)", 1122 + .params = tuner_philips_secam_params, 1123 + }, 1124 + [TUNER_ABSENT] = { /* Tuner Absent */ 1125 + .name = "NoTuner", 1126 + }, 1127 + [TUNER_PHILIPS_PAL] = { /* Philips PAL */ 1128 + .name = "Philips PAL_BG (FI1216 and compatibles)", 1129 + .params = tuner_philips_pal_params, 1130 + }, 1131 + [TUNER_TEMIC_NTSC] = { /* TEMIC NTSC */ 1132 + .name = "Temic NTSC (4032 FY5)", 1133 + .params = tuner_temic_ntsc_params, 1134 + }, 1135 + [TUNER_TEMIC_PAL_I] = { /* TEMIC PAL_I */ 1136 + .name = "Temic PAL_I (4062 FY5)", 1137 + .params = tuner_temic_pal_i_params, 1138 + }, 1139 + [TUNER_TEMIC_4036FY5_NTSC] = { /* TEMIC NTSC */ 1140 + .name = "Temic NTSC (4036 FY5)", 1141 + .params = tuner_temic_4036fy5_ntsc_params, 1142 + }, 1143 + [TUNER_ALPS_TSBH1_NTSC] = { /* TEMIC NTSC */ 1144 + .name = "Alps HSBH1", 1145 + .params = tuner_alps_tsbh1_ntsc_params, 1146 + }, 1147 + 1148 + /* 10-19 */ 1149 + [TUNER_ALPS_TSBE1_PAL] = { /* TEMIC PAL */ 1150 + .name = "Alps TSBE1", 1151 + .params = tuner_alps_tsb_1_params, 1152 + }, 1153 + [TUNER_ALPS_TSBB5_PAL_I] = { /* Alps PAL_I */ 1154 + .name = "Alps TSBB5", 1155 + .params = tuner_alps_tsbb5_params, 1156 + }, 1157 + [TUNER_ALPS_TSBE5_PAL] = { /* Alps PAL */ 1158 + .name = "Alps TSBE5", 1159 + .params = tuner_alps_tsbe5_params, 1160 + }, 1161 + [TUNER_ALPS_TSBC5_PAL] = { /* Alps PAL */ 1162 + .name = "Alps TSBC5", 1163 + .params = tuner_alps_tsbc5_params, 1164 + }, 1165 + [TUNER_TEMIC_4006FH5_PAL] = { /* TEMIC PAL */ 1166 + .name = "Temic PAL_BG (4006FH5)", 1167 + .params = tuner_temic_4006fh5_params, 1168 + }, 1169 + [TUNER_ALPS_TSHC6_NTSC] = { /* Alps NTSC */ 1170 + .name = "Alps TSCH6", 1171 + .params = tuner_alps_tshc6_params, 1172 + }, 1173 + [TUNER_TEMIC_PAL_DK] = { /* TEMIC PAL */ 1174 + .name = "Temic PAL_DK (4016 FY5)", 1175 + .params = tuner_temic_pal_dk_params, 1176 + }, 1177 + [TUNER_PHILIPS_NTSC_M] = { /* Philips NTSC */ 1178 + .name = "Philips NTSC_M (MK2)", 1179 + .params = tuner_philips_ntsc_m_params, 1180 + }, 1181 + [TUNER_TEMIC_4066FY5_PAL_I] = { /* TEMIC PAL_I */ 1182 + .name = "Temic PAL_I (4066 FY5)", 1183 + .params = tuner_temic_4066fy5_pal_i_params, 1184 + }, 1185 + [TUNER_TEMIC_4006FN5_MULTI_PAL] = { /* TEMIC PAL */ 1186 + .name = "Temic PAL* auto (4006 FN5)", 1187 + .params = tuner_temic_4006fn5_multi_params, 1188 + }, 1189 + 1190 + /* 20-29 */ 1191 + [TUNER_TEMIC_4009FR5_PAL] = { /* TEMIC PAL */ 1192 + .name = "Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)", 1193 + .params = tuner_temic_4009f_5_params, 1194 + }, 1195 + [TUNER_TEMIC_4039FR5_NTSC] = { /* TEMIC NTSC */ 1196 + .name = "Temic NTSC (4039 FR5)", 1197 + .params = tuner_temic_4039fr5_params, 1198 + }, 1199 + [TUNER_TEMIC_4046FM5] = { /* TEMIC PAL */ 1200 + .name = "Temic PAL/SECAM multi (4046 FM5)", 1201 + .params = tuner_temic_4046fm5_params, 1202 + }, 1203 + [TUNER_PHILIPS_PAL_DK] = { /* Philips PAL */ 1204 + .name = "Philips PAL_DK (FI1256 and compatibles)", 1205 + .params = tuner_philips_pal_dk_params, 1206 + }, 1207 + [TUNER_PHILIPS_FQ1216ME] = { /* Philips PAL */ 1208 + .name = "Philips PAL/SECAM multi (FQ1216ME)", 1209 + .params = tuner_philips_fq1216me_params, 1210 + }, 1211 + [TUNER_LG_PAL_I_FM] = { /* LGINNOTEK PAL_I */ 1212 + .name = "LG PAL_I+FM (TAPC-I001D)", 1213 + .params = tuner_lg_pal_i_fm_params, 1214 + }, 1215 + [TUNER_LG_PAL_I] = { /* LGINNOTEK PAL_I */ 1216 + .name = "LG PAL_I (TAPC-I701D)", 1217 + .params = tuner_lg_pal_i_params, 1218 + }, 1219 + [TUNER_LG_NTSC_FM] = { /* LGINNOTEK NTSC */ 1220 + .name = "LG NTSC+FM (TPI8NSR01F)", 1221 + .params = tuner_lg_ntsc_fm_params, 1222 + }, 1223 + [TUNER_LG_PAL_FM] = { /* LGINNOTEK PAL */ 1224 + .name = "LG PAL_BG+FM (TPI8PSB01D)", 1225 + .params = tuner_lg_pal_fm_params, 1226 + }, 1227 + [TUNER_LG_PAL] = { /* LGINNOTEK PAL */ 1228 + .name = "LG PAL_BG (TPI8PSB11D)", 1229 + .params = tuner_lg_pal_params, 1230 + }, 1231 + 1232 + /* 30-39 */ 1233 + [TUNER_TEMIC_4009FN5_MULTI_PAL_FM] = { /* TEMIC PAL */ 1234 + .name = "Temic PAL* auto + FM (4009 FN5)", 1235 + .params = tuner_temic_4009_fn5_multi_pal_fm_params, 1236 + }, 1237 + [TUNER_SHARP_2U5JF5540_NTSC] = { /* SHARP NTSC */ 1238 + .name = "SHARP NTSC_JP (2U5JF5540)", 1239 + .params = tuner_sharp_2u5jf5540_params, 1240 + }, 1241 + [TUNER_Samsung_PAL_TCPM9091PD27] = { /* Samsung PAL */ 1242 + .name = "Samsung PAL TCPM9091PD27", 1243 + .params = tuner_samsung_pal_tcpm9091pd27_params, 1244 + }, 1245 + [TUNER_MT2032] = { /* Microtune PAL|NTSC */ 1246 + .name = "MT20xx universal", 1247 + /* see mt20xx.c for details */ }, 1248 + [TUNER_TEMIC_4106FH5] = { /* TEMIC PAL */ 1249 + .name = "Temic PAL_BG (4106 FH5)", 1250 + .params = tuner_temic_4106fh5_params, 1251 + }, 1252 + [TUNER_TEMIC_4012FY5] = { /* TEMIC PAL */ 1253 + .name = "Temic PAL_DK/SECAM_L (4012 FY5)", 1254 + .params = tuner_temic_4012fy5_params, 1255 + }, 1256 + [TUNER_TEMIC_4136FY5] = { /* TEMIC NTSC */ 1257 + .name = "Temic NTSC (4136 FY5)", 1258 + .params = tuner_temic_4136_fy5_params, 1259 + }, 1260 + [TUNER_LG_PAL_NEW_TAPC] = { /* LGINNOTEK PAL */ 1261 + .name = "LG PAL (newer TAPC series)", 1262 + .params = tuner_lg_pal_new_tapc_params, 1263 + }, 1264 + [TUNER_PHILIPS_FM1216ME_MK3] = { /* Philips PAL */ 1265 + .name = "Philips PAL/SECAM multi (FM1216ME MK3)", 1266 + .params = tuner_fm1216me_mk3_params, 1267 + }, 1268 + [TUNER_LG_NTSC_NEW_TAPC] = { /* LGINNOTEK NTSC */ 1269 + .name = "LG NTSC (newer TAPC series)", 1270 + .params = tuner_lg_ntsc_new_tapc_params, 1271 + }, 1272 + 1273 + /* 40-49 */ 1274 + [TUNER_HITACHI_NTSC] = { /* HITACHI NTSC */ 1275 + .name = "HITACHI V7-J180AT", 1276 + .params = tuner_hitachi_ntsc_params, 1277 + }, 1278 + [TUNER_PHILIPS_PAL_MK] = { /* Philips PAL */ 1279 + .name = "Philips PAL_MK (FI1216 MK)", 1280 + .params = tuner_philips_pal_mk_params, 1281 + }, 1282 + [TUNER_PHILIPS_ATSC] = { /* Philips ATSC */ 1283 + .name = "Philips 1236D ATSC/NTSC dual in", 1284 + .params = tuner_philips_atsc_params, 1285 + }, 1286 + [TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */ 1287 + .name = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", 1288 + .params = tuner_fm1236_mk3_params, 1289 + }, 1290 + [TUNER_PHILIPS_4IN1] = { /* Philips NTSC */ 1291 + .name = "Philips 4 in 1 (ATI TV Wonder Pro/Conexant)", 1292 + .params = tuner_philips_4in1_params, 1293 + }, 1294 + [TUNER_MICROTUNE_4049FM5] = { /* Microtune PAL */ 1295 + .name = "Microtune 4049 FM5", 1296 + .params = tuner_microtune_4049_fm5_params, 1297 + }, 1298 + [TUNER_PANASONIC_VP27] = { /* Panasonic NTSC */ 1299 + .name = "Panasonic VP27s/ENGE4324D", 1300 + .params = tuner_panasonic_vp27_params, 1301 + }, 1302 + [TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */ 1303 + .name = "LG NTSC (TAPE series)", 1304 + .params = tuner_lg_ntsc_tape_params, 1305 + }, 1306 + [TUNER_TNF_8831BGFF] = { /* Philips PAL */ 1307 + .name = "Tenna TNF 8831 BGFF)", 1308 + .params = tuner_tnf_8831bgff_params, 1309 + }, 1310 + [TUNER_MICROTUNE_4042FI5] = { /* Microtune NTSC */ 1311 + .name = "Microtune 4042 FI5 ATSC/NTSC dual in", 1312 + .params = tuner_microtune_4042fi5_params, 1313 + }, 1314 + 1315 + /* 50-59 */ 1316 + [TUNER_TCL_2002N] = { /* TCL NTSC */ 1317 + .name = "TCL 2002N", 1318 + .params = tuner_tcl_2002n_params, 1319 + }, 1320 + [TUNER_PHILIPS_FM1256_IH3] = { /* Philips PAL */ 1321 + .name = "Philips PAL/SECAM_D (FM 1256 I-H3)", 1322 + .params = tuner_philips_fm1256_ih3_params, 1323 + }, 1324 + [TUNER_THOMSON_DTT7610] = { /* THOMSON ATSC */ 1325 + .name = "Thomson DTT 7610 (ATSC/NTSC)", 1326 + .params = tuner_thomson_dtt7610_params, 1327 + }, 1328 + [TUNER_PHILIPS_FQ1286] = { /* Philips NTSC */ 1329 + .name = "Philips FQ1286", 1330 + .params = tuner_philips_fq1286_params, 1331 + }, 1332 + [TUNER_PHILIPS_TDA8290] = { /* Philips PAL|NTSC */ 1333 + .name = "tda8290+75", 1334 + /* see tda8290.c for details */ }, 1335 + [TUNER_TCL_2002MB] = { /* TCL PAL */ 1336 + .name = "TCL 2002MB", 1337 + .params = tuner_tcl_2002mb_params, 1338 + }, 1339 + [TUNER_PHILIPS_FQ1216AME_MK4] = { /* Philips PAL */ 1340 + .name = "Philips PAL/SECAM multi (FQ1216AME MK4)", 1341 + .params = tuner_philips_fq1216ame_mk4_params, 1342 + }, 1343 + [TUNER_PHILIPS_FQ1236A_MK4] = { /* Philips NTSC */ 1344 + .name = "Philips FQ1236A MK4", 1345 + .params = tuner_philips_fq1236a_mk4_params, 1346 + }, 1347 + [TUNER_YMEC_TVF_8531MF] = { /* Philips NTSC */ 1348 + .name = "Ymec TVision TVF-8531MF/8831MF/8731MF", 1349 + .params = tuner_ymec_tvf_8531mf_params, 1350 + }, 1351 + [TUNER_YMEC_TVF_5533MF] = { /* Philips NTSC */ 1352 + .name = "Ymec TVision TVF-5533MF", 1353 + .params = tuner_ymec_tvf_5533mf_params, 1354 + }, 1355 + 1356 + /* 60-69 */ 1357 + [TUNER_THOMSON_DTT761X] = { /* THOMSON ATSC */ 1358 + /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ 1359 + .name = "Thomson DTT 761X (ATSC/NTSC)", 1360 + .params = tuner_thomson_dtt761x_params, 1361 + }, 1362 + [TUNER_TENA_9533_DI] = { /* Philips PAL */ 1363 + .name = "Tena TNF9533-D/IF/TNF9533-B/DF", 1364 + .params = tuner_tena_9533_di_params, 1365 + }, 1366 + [TUNER_TEA5767] = { /* Philips RADIO */ 1367 + .name = "Philips TEA5767HN FM Radio", 1368 + /* see tea5767.c for details */ 1369 + }, 1370 + [TUNER_PHILIPS_FMD1216ME_MK3] = { /* Philips PAL */ 1371 + .name = "Philips FMD1216ME MK3 Hybrid Tuner", 1372 + .params = tuner_tuner_philips_fmd1216me_mk3_params, 1373 + }, 1374 + [TUNER_LG_TDVS_H062F] = { /* LGINNOTEK ATSC */ 1375 + .name = "LG TDVS-H062F/TUA6034", 1376 + .params = tuner_tua6034_params, 1377 + }, 1378 + [TUNER_YMEC_TVF66T5_B_DFF] = { /* Philips PAL */ 1379 + .name = "Ymec TVF66T5-B/DFF", 1380 + .params = tuner_ymec_tvf66t5_b_dff_params, 1381 + }, 1382 + [TUNER_LG_NTSC_TALN_MINI] = { /* LGINNOTEK NTSC */ 1383 + .name = "LG NTSC (TALN mini series)", 1384 + .params = tuner_lg_taln_mini_params, 1385 + }, 1386 + [TUNER_PHILIPS_TD1316] = { /* Philips PAL */ 1387 + .name = "Philips TD1316 Hybrid Tuner", 1388 + .params = tuner_philips_td1316_params, 1389 + }, 1390 + [TUNER_PHILIPS_TUV1236D] = { /* Philips ATSC */ 1391 + .name = "Philips TUV1236D ATSC/NTSC dual in", 1392 + .params = tuner_tuner_tuv1236d_params, 1393 + }, 1394 + [TUNER_TNF_5335MF] = { /* Philips NTSC */ 1395 + .name = "Tena TNF 5335 MF", 1396 + .params = tuner_tnf_5335mf_params, 1397 + }, 1398 + 1399 + /* 70-79 */ 1400 + [TUNER_SAMSUNG_TCPN_2121P30A] = { /* Samsung NTSC */ 1401 + .name = "Samsung TCPN 2121P30A", 1402 + .params = tuner_samsung_tcpn_2121p30a_params, 1403 + }, 1404 + }; 1405 + 1406 + unsigned const int tuner_count = ARRAY_SIZE(tuners);
+1 -1
drivers/media/video/tveeprom.c
··· 190 { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"}, 191 { TUNER_TCL_2002N, "TCL 2002N 6A"}, 192 { TUNER_PHILIPS_FM1236_MK3, "Philips FQ1236 MK3"}, 193 - { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, 194 { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, 195 { TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"}, 196 /* 90-99 */
··· 190 { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"}, 191 { TUNER_TCL_2002N, "TCL 2002N 6A"}, 192 { TUNER_PHILIPS_FM1236_MK3, "Philips FQ1236 MK3"}, 193 + { TUNER_SAMSUNG_TCPN_2121P30A, "Samsung TCPN 2121P30A"}, 194 { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, 195 { TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"}, 196 /* 90-99 */
+1 -1
drivers/media/video/tvp5150.c
··· 634 unsigned char values[26]; 635 }; 636 637 - struct i2c_vbi_ram_value vbi_ram_default[] = 638 { 639 {0x010, /* WST SECAM 6 */ 640 { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 }
··· 634 unsigned char values[26]; 635 }; 636 637 + static struct i2c_vbi_ram_value vbi_ram_default[] = 638 { 639 {0x010, /* WST SECAM 6 */ 640 { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 }
+1
drivers/media/video/v4l2-common.c
··· 306 #endif 307 [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO", 308 [_IOC_NR(AUDC_SET_INPUT)] = "AUDC_SET_INPUT", 309 310 [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR", 311 [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY",
··· 306 #endif 307 [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO", 308 [_IOC_NR(AUDC_SET_INPUT)] = "AUDC_SET_INPUT", 309 + [_IOC_NR(MSP_SET_MATRIX)] = "MSP_SET_MATRIX", 310 311 [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR", 312 [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY",
+12 -13
drivers/media/video/videodev.c
··· 29 #include <linux/devfs_fs_kernel.h> 30 #include <asm/uaccess.h> 31 #include <asm/system.h> 32 - #include <asm/semaphore.h> 33 34 #include <linux/videodev.h> 35 ··· 82 */ 83 84 static struct video_device *video_device[VIDEO_NUM_DEVICES]; 85 - static DECLARE_MUTEX(videodev_lock); 86 87 struct video_device* video_devdata(struct file *file) 88 { ··· 101 102 if(minor>=VIDEO_NUM_DEVICES) 103 return -ENODEV; 104 - down(&videodev_lock); 105 vfl=video_device[minor]; 106 if(vfl==NULL) { 107 - up(&videodev_lock); 108 request_module("char-major-%d-%d", VIDEO_MAJOR, minor); 109 - down(&videodev_lock); 110 vfl=video_device[minor]; 111 if (vfl==NULL) { 112 - up(&videodev_lock); 113 return -ENODEV; 114 } 115 } ··· 122 file->f_op = fops_get(old_fops); 123 } 124 fops_put(old_fops); 125 - up(&videodev_lock); 126 return err; 127 } 128 ··· 303 } 304 305 /* pick a minor number */ 306 - down(&videodev_lock); 307 if (nr >= 0 && nr < end-base) { 308 /* use the one the driver asked for */ 309 i = base+nr; 310 if (NULL != video_device[i]) { 311 - up(&videodev_lock); 312 return -ENFILE; 313 } 314 } else { ··· 317 if (NULL == video_device[i]) 318 break; 319 if (i == end) { 320 - up(&videodev_lock); 321 return -ENFILE; 322 } 323 } 324 video_device[i]=vfd; 325 vfd->minor=i; 326 - up(&videodev_lock); 327 328 sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); 329 devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor), ··· 361 362 void video_unregister_device(struct video_device *vfd) 363 { 364 - down(&videodev_lock); 365 if(video_device[vfd->minor]!=vfd) 366 panic("videodev: bad unregister"); 367 368 devfs_remove(vfd->devfs_name); 369 video_device[vfd->minor]=NULL; 370 class_device_unregister(&vfd->class_dev); 371 - up(&videodev_lock); 372 } 373 374
··· 29 #include <linux/devfs_fs_kernel.h> 30 #include <asm/uaccess.h> 31 #include <asm/system.h> 32 33 #include <linux/videodev.h> 34 ··· 83 */ 84 85 static struct video_device *video_device[VIDEO_NUM_DEVICES]; 86 + static DEFINE_MUTEX(videodev_lock); 87 88 struct video_device* video_devdata(struct file *file) 89 { ··· 102 103 if(minor>=VIDEO_NUM_DEVICES) 104 return -ENODEV; 105 + mutex_lock(&videodev_lock); 106 vfl=video_device[minor]; 107 if(vfl==NULL) { 108 + mutex_unlock(&videodev_lock); 109 request_module("char-major-%d-%d", VIDEO_MAJOR, minor); 110 + mutex_lock(&videodev_lock); 111 vfl=video_device[minor]; 112 if (vfl==NULL) { 113 + mutex_unlock(&videodev_lock); 114 return -ENODEV; 115 } 116 } ··· 123 file->f_op = fops_get(old_fops); 124 } 125 fops_put(old_fops); 126 + mutex_unlock(&videodev_lock); 127 return err; 128 } 129 ··· 304 } 305 306 /* pick a minor number */ 307 + mutex_lock(&videodev_lock); 308 if (nr >= 0 && nr < end-base) { 309 /* use the one the driver asked for */ 310 i = base+nr; 311 if (NULL != video_device[i]) { 312 + mutex_unlock(&videodev_lock); 313 return -ENFILE; 314 } 315 } else { ··· 318 if (NULL == video_device[i]) 319 break; 320 if (i == end) { 321 + mutex_unlock(&videodev_lock); 322 return -ENFILE; 323 } 324 } 325 video_device[i]=vfd; 326 vfd->minor=i; 327 + mutex_unlock(&videodev_lock); 328 329 sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); 330 devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor), ··· 362 363 void video_unregister_device(struct video_device *vfd) 364 { 365 + mutex_lock(&videodev_lock); 366 if(video_device[vfd->minor]!=vfd) 367 panic("videodev: bad unregister"); 368 369 devfs_remove(vfd->devfs_name); 370 video_device[vfd->minor]=NULL; 371 class_device_unregister(&vfd->class_dev); 372 + mutex_unlock(&videodev_lock); 373 } 374 375
+4
include/linux/i2c-id.h
··· 104 #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ 105 #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ 106 #define I2C_DRIVERID_TVP5150 76 /* TVP5150 video decoder */ 107 108 #define I2C_DRIVERID_I2CDEV 900 109 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
··· 104 #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ 105 #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ 106 #define I2C_DRIVERID_TVP5150 76 /* TVP5150 video decoder */ 107 + #define I2C_DRIVERID_WM8739 77 /* wm8739 audio processor */ 108 + #define I2C_DRIVERID_UPD64083 78 /* upd64083 video processor */ 109 + #define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */ 110 + #define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */ 111 112 #define I2C_DRIVERID_I2CDEV 900 113 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
+55
include/media/tuner-types.h
···
··· 1 + /* 2 + * descriptions for simple tuners. 3 + */ 4 + 5 + #ifndef __TUNER_TYPES_H__ 6 + #define __TUNER_TYPES_H__ 7 + 8 + enum param_type { 9 + TUNER_PARAM_TYPE_RADIO, \ 10 + TUNER_PARAM_TYPE_PAL, \ 11 + TUNER_PARAM_TYPE_SECAM, \ 12 + TUNER_PARAM_TYPE_NTSC 13 + }; 14 + 15 + struct tuner_range { 16 + unsigned short limit; 17 + unsigned char cb; 18 + }; 19 + 20 + struct tuner_params { 21 + enum param_type type; 22 + /* Many Philips based tuners have a comment like this in their 23 + * datasheet: 24 + * 25 + * For channel selection involving band switching, and to ensure 26 + * smooth tuning to the desired channel without causing 27 + * unnecessary charge pump action, it is recommended to consider 28 + * the difference between wanted channel frequency and the 29 + * current channel frequency. Unnecessary charge pump action 30 + * will result in very low tuning voltage which may drive the 31 + * oscillator to extreme conditions. 32 + * 33 + * Set cb_first_if_lower_freq to 1, if this check is 34 + * required for this tuner. 35 + * 36 + * I tested this for PAL by first setting the TV frequency to 37 + * 203 MHz and then switching to 96.6 MHz FM radio. The result was 38 + * static unless the control byte was sent first. 39 + */ 40 + unsigned int cb_first_if_lower_freq:1; 41 + unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */ 42 + 43 + unsigned int count; 44 + struct tuner_range *ranges; 45 + }; 46 + 47 + struct tunertype { 48 + char *name; 49 + struct tuner_params *params; 50 + }; 51 + 52 + extern struct tunertype tuners[]; 53 + extern unsigned const int tuner_count; 54 + 55 + #endif
+7 -3
include/media/tuner.h
··· 23 #define _TUNER_H 24 25 #include <linux/videodev2.h> 26 27 #define ADDR_UNSET (255) 28 ··· 115 116 #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ 117 #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ 118 119 /* tv card specific */ 120 #define TDA9887_PRESENT (1<<0) ··· 179 unsigned int mode; 180 unsigned int mode_mask; /* Combination of allowable modes */ 181 182 - unsigned int freq; /* keep track of the current settings */ 183 unsigned int audmode; 184 v4l2_std_id std; 185 ··· 199 unsigned int sgIF; 200 201 /* function ptrs */ 202 - void (*tv_freq)(struct i2c_client *c, unsigned int freq); 203 - void (*radio_freq)(struct i2c_client *c, unsigned int freq); 204 int (*has_signal)(struct i2c_client *c); 205 int (*is_stereo)(struct i2c_client *c); 206 void (*standby)(struct i2c_client *c);
··· 23 #define _TUNER_H 24 25 #include <linux/videodev2.h> 26 + #include <media/tuner-types.h> 27 28 #define ADDR_UNSET (255) 29 ··· 114 115 #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ 116 #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ 117 + #define TUNER_SAMSUNG_TCPN_2121P30A 70 /* Hauppauge PVR-500MCE NTSC */ 118 119 /* tv card specific */ 120 #define TDA9887_PRESENT (1<<0) ··· 177 unsigned int mode; 178 unsigned int mode_mask; /* Combination of allowable modes */ 179 180 + unsigned int tv_freq; /* keep track of the current settings */ 181 + unsigned int radio_freq; 182 + u16 last_div; 183 unsigned int audmode; 184 v4l2_std_id std; 185 ··· 195 unsigned int sgIF; 196 197 /* function ptrs */ 198 + void (*set_tv_freq)(struct i2c_client *c, unsigned int freq); 199 + void (*set_radio_freq)(struct i2c_client *c, unsigned int freq); 200 int (*has_signal)(struct i2c_client *c); 201 int (*is_stereo)(struct i2c_client *c); 202 void (*standby)(struct i2c_client *c);
+7
include/media/v4l2-common.h
··· 120 /* select from TV,radio,extern,MUTE */ 121 #define AUDC_SET_INPUT _IOW('d',89,int) 122 123 /* tuner ioctls */ 124 /* Sets tuner type and its I2C addr */ 125 #define TUNER_SET_TYPE_ADDR _IOW('d',90,int)
··· 120 /* select from TV,radio,extern,MUTE */ 121 #define AUDC_SET_INPUT _IOW('d',89,int) 122 123 + /* msp3400 ioctl: will be removed in the near future */ 124 + struct msp_matrix { 125 + int input; 126 + int output; 127 + }; 128 + #define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) 129 + 130 /* tuner ioctls */ 131 /* Sets tuner type and its I2C addr */ 132 #define TUNER_SET_TYPE_ADDR _IOW('d',90,int)