source:
patches/linux-2.6.10-cx88-update.patch@
b15e4602
Last change on this file since b15e4602 was 617118d, checked in by , 19 years ago | |
---|---|
|
|
File size: 41.8 KB |
-
drivers/media/video/cx88/cx88-cards.c
Subject: [patch] cx88 update FIXME: description Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
old new 1 1 /* 2 * $Id: cx88-cards.c,v 1. 47 2004/11/03 09:04:50 kraxel Exp $2 * $Id: cx88-cards.c,v 1.53 2004/12/14 15:33:30 kraxel Exp $ 3 3 * 4 4 * device driver for Conexant 2388x based TV cards 5 5 * card-specific stuff. … … 32 32 33 33 #include "cx88.h" 34 34 #ifdef WITH_DVB 35 #include "cx22702.h" 35 # include "dvb-pll.h" 36 # include "cx22702.h" 36 37 #endif 37 38 38 39 /* ------------------------------------------------------------------ */ … … struct cx88_board cx88_boards[] = { 91 92 }, 92 93 [CX88_BOARD_PIXELVIEW] = { 93 94 .name = "PixelView", 94 .tuner_type = UNSET,95 .tuner_type = 5, 95 96 .input = {{ 96 97 .type = CX88_VMUX_TELEVISION, 97 98 .vmux = 0, … … struct cx88_board cx88_boards[] = { 223 224 }, 224 225 }, 225 226 [CX88_BOARD_LEADTEK_PVR2000] = { 227 // gpio values for PAL version from regspy by DScaler 226 228 .name = "Leadtek PVR 2000", 227 229 .tuner_type = 38, 230 .tda9887_conf = TDA9887_PRESENT, 228 231 .input = {{ 229 232 .type = CX88_VMUX_TELEVISION, 230 233 .vmux = 0, 234 .gpio0 = 0x0000bde6, 231 235 },{ 232 236 .type = CX88_VMUX_COMPOSITE1, 233 237 .vmux = 1, 238 .gpio0 = 0x0000bde6, 234 239 },{ 235 240 .type = CX88_VMUX_SVIDEO, 236 241 .vmux = 2, 242 .gpio0 = 0x0000bde6, 237 243 }}, 238 244 .radio = { 239 245 .type = CX88_RADIO, 246 .gpio0 = 0x0000bd62, 240 247 }, 241 248 .blackbird = 1, 242 249 }, … … struct cx88_board cx88_boards[] = { 452 459 }}, 453 460 .dvb = 1, 454 461 }, 462 [CX88_BOARD_DNTV_LIVE_DVB_T] = { 463 .name = "digitalnow DNTV Live! DVB-T", 464 .tuner_type = TUNER_ABSENT, 465 .input = {{ 466 .type = CX88_VMUX_COMPOSITE1, 467 .vmux = 1, 468 .gpio0 = 0x00000700, 469 .gpio2 = 0x00000101, 470 },{ 471 .type = CX88_VMUX_SVIDEO, 472 .vmux = 2, 473 .gpio0 = 0x00000700, 474 .gpio2 = 0x00000101, 475 }}, 476 .dvb = 1, 477 }, 455 478 }; 456 479 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 457 480 … … struct cx88_subid cx88_subids[] = { 543 566 .subvendor = 0x18AC, 544 567 .subdevice = 0xDB10, 545 568 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS, 569 },{ 570 .subvendor = 0x1554, 571 .subdevice = 0x4811, 572 .card = CX88_BOARD_PIXELVIEW, 573 },{ 574 .subvendor = 0x7063, 575 .subdevice = 0x3000, /* HD-3000 card */ 576 .card = CX88_BOARD_PCHDTV_HD3000, 577 },{ 578 .subvendor = 0x17DE, 579 .subdevice = 0xA8A6, 580 .card = CX88_BOARD_DNTV_LIVE_DVB_T, 546 581 } 547 582 }; 548 583 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); … … static struct { 632 667 { TUNER_LG_PAL_FM, "LG TPI8PSB01D"}, 633 668 { TUNER_LG_PAL, "LG TPI8PSB11D"}, 634 669 { TUNER_LG_PAL_I_FM, "LG TAPC-I001D"}, 635 { TUNER_LG_PAL_I, "LG TAPC-I701D"} 670 { TUNER_LG_PAL_I, "LG TAPC-I701D"}, 671 { TUNER_THOMSON_DTT7610, "DTT-7610"} 636 672 }; 637 673 638 674 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) 639 675 { 676 #if 0 640 677 unsigned int blk2,tuner,radio,model; 641 678 642 679 if (eeprom_data[0] != 0x84 || eeprom_data[2] != 0) { … … static void hauppauge_eeprom(struct cx88 663 700 core->name, model, (tuner < ARRAY_SIZE(hauppauge_tuner) 664 701 ? hauppauge_tuner[tuner].name : "?"), 665 702 core->tuner_type, radio ? "yes" : "no"); 703 #else 704 struct tveeprom tv; 705 706 tveeprom_hauppauge_analog(&tv, eeprom_data); 707 core->tuner_type = tv.tuner_type; 708 core->has_radio = tv.has_radio; 709 #endif 666 710 } 667 711 668 712 #ifdef WITH_DVB … … static int hauppauge_eeprom_dvb(struct c 670 714 { 671 715 int model; 672 716 int tuner; 673 char *tname;674 717 675 718 /* Make sure we support the board model */ 676 719 model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c]; … … static int hauppauge_eeprom_dvb(struct c 689 732 /* Make sure we support the tuner */ 690 733 tuner = ee[0x2d]; 691 734 switch(tuner) { 692 case 0x4B: 693 tname = "Thomson DTT 7595"; 694 core->pll_type = PLLTYPE_DTT7595; 695 break; 696 case 0x4C: 697 tname = "Thomson DTT 7592"; 698 core->pll_type = PLLTYPE_DTT7592; 735 case 0x4B: /* ddt 7595 */ 736 case 0x4C: /* dtt 7592 */ 737 core->pll_desc = &dvb_pll_thomson_dtt759x; 699 738 break; 700 739 default: 701 740 printk("%s: error: unknown hauppauge tuner 0x%02x\n", 702 741 core->name, tuner); 703 742 return -ENODEV; 704 743 } 705 printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%s (%d)\n", 706 core->name, model, tname, tuner); 744 printk(KERN_INFO "%s: hauppauge eeprom: model=%d, tuner=%d (%s)\n", 745 core->name, model, tuner, 746 core->pll_desc ? core->pll_desc->name : "UNKNOWN"); 707 747 708 core->pll_addr = 0x61;748 core->pll_addr = 0x61; 709 749 core->demod_addr = 0x43; 710 750 } 711 751 #endif … … static void gdi_eeprom(struct cx88_core 763 803 764 804 /* ----------------------------------------------------------------------- */ 765 805 766 static int767 i2c_eeprom(struct i2c_client *c, unsigned char *eedata, int len)768 {769 unsigned char buf;770 int err;771 772 c->addr = 0xa0 >> 1;773 buf = 0;774 if (1 != (err = i2c_master_send(c,&buf,1))) {775 printk(KERN_INFO "cx88: Huh, no eeprom present (err=%d)?\n",776 err);777 return -1;778 }779 if (len != (err = i2c_master_recv(c,eedata,len))) {780 printk(KERN_WARNING "cx88: i2c eeprom read error (err=%d)\n",781 err);782 return -1;783 }784 #if 0785 for (i = 0; i < len; i++) {786 if (0 == (i % 16))787 printk(KERN_INFO "cx88 ee: %02x:",i);788 printk(" %02x",eedata[i]);789 if (15 == (i % 16))790 printk("\n");791 }792 #endif793 return 0;794 }795 796 806 void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) 797 807 { 798 808 int i; … … void cx88_card_setup(struct cx88_core *c 823 833 { 824 834 static u8 eeprom[128]; 825 835 836 if (0 == core->i2c_rc) { 837 core->i2c_client.addr = 0xa0 >> 1; 838 tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom)); 839 } 840 826 841 switch (core->board) { 827 842 case CX88_BOARD_HAUPPAUGE: 828 843 if (0 == core->i2c_rc) 829 i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); 830 hauppauge_eeprom(core,eeprom+8); 844 hauppauge_eeprom(core,eeprom+8); 831 845 break; 832 846 case CX88_BOARD_GDI: 833 847 if (0 == core->i2c_rc) 834 i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); 835 gdi_eeprom(core,eeprom); 848 gdi_eeprom(core,eeprom); 836 849 break; 837 850 case CX88_BOARD_WINFAST2000XP: 838 851 if (0 == core->i2c_rc) 839 i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); 840 leadtek_eeprom(core,eeprom); 852 leadtek_eeprom(core,eeprom); 853 break; 854 #ifdef WITH_DVB 855 case CX88_BOARD_HAUPPAUGE_DVB_T1: 856 if (0 == core->i2c_rc) 857 hauppauge_eeprom_dvb(core,eeprom); 858 break; 859 case CX88_BOARD_CONEXANT_DVB_T1: 860 core->pll_desc = &dvb_pll_thomson_dtt7579; 861 core->pll_addr = 0x60; 862 core->demod_addr = 0x43; 841 863 break; 842 864 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 843 865 /* Tuner reset is hooked to the tuner out of reset */ … … void cx88_card_setup(struct cx88_core *c 845 867 cx_clear(MO_GP0_IO, 0x00000001); 846 868 msleep(1); 847 869 cx_set(MO_GP0_IO, 0x00000101); 870 core->pll_addr = 0x61; 871 core->pll_desc = &dvb_pll_lg_z201; 848 872 break; 849 #ifdef WITH_DVB 850 case CX88_BOARD_HAUPPAUGE_DVB_T1: 851 if (0 == core->i2c_rc) 852 i2c_eeprom(&core->i2c_client,eeprom,sizeof(eeprom)); 853 hauppauge_eeprom_dvb(core,eeprom); 873 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 874 core->pll_addr = 0x60; 875 core->pll_desc = &dvb_pll_thomson_dtt7579; 854 876 break; 855 case CX88_BOARD_CONEXANT_DVB_T1: 856 core->pll_type = PLLTYPE_DTT7579; 857 core->pll_addr = 0x60; 858 core->demod_addr = 0x43; 877 case CX88_BOARD_DNTV_LIVE_DVB_T: 878 cx_set(MO_GP0_IO, 0x00000707); 879 cx_set(MO_GP2_IO, 0x00000101); 880 cx_clear(MO_GP2_IO, 0x00000001); 881 msleep(1); 882 cx_clear(MO_GP0_IO, 0x00000007); 883 cx_set(MO_GP2_IO, 0x00000101); 884 core->pll_addr = 0x61; 885 core->pll_desc = &dvb_pll_unknown_1; 859 886 break; 860 887 #endif 861 888 } -
drivers/media/video/cx88/cx88-core.c
old new 1 1 /* 2 * $Id: cx88-core.c,v 1. 15 2004/10/25 11:26:36kraxel Exp $2 * $Id: cx88-core.c,v 1.21 2004/12/10 12:33:39 kraxel Exp $ 3 3 * 4 4 * device driver for Conexant 2388x based TV cards 5 5 * driver core … … 24 24 #include <linux/init.h> 25 25 #include <linux/list.h> 26 26 #include <linux/module.h> 27 #include <linux/moduleparam.h> 27 28 #include <linux/kernel.h> 28 29 #include <linux/slab.h> 29 30 #include <linux/kmod.h> … … static unsigned int nicam = 0; 62 63 module_param(nicam,int,0644); 63 64 MODULE_PARM_DESC(nicam,"tv audio is nicam"); 64 65 66 static unsigned int nocomb = 0; 67 module_param(nocomb,int,0644); 68 MODULE_PARM_DESC(nicam,"disable comb filter"); 69 65 70 #define dprintk(level,fmt, arg...) if (core_debug >= level) \ 66 71 printk(KERN_DEBUG "%s: " fmt, core->name , ## arg) 67 72 … … int cx88_risc_decode(u32 risc) 462 467 return incr[risc >> 28] ? incr[risc >> 28] : 1; 463 468 } 464 469 470 #if 0 /* currently unused, but useful for debugging */ 465 471 void cx88_risc_disasm(struct cx88_core *core, 466 472 struct btcx_riscmem *risc) 467 473 { … … void cx88_risc_disasm(struct cx88_core * 479 485 break; 480 486 } 481 487 } 488 #endif 482 489 483 490 void cx88_sram_channel_dump(struct cx88_core *core, 484 491 struct sram_channel *ch) … … void cx88_print_irqbits(char *name, char 579 586 580 587 /* ------------------------------------------------------------------ */ 581 588 582 void cx88_irq(struct cx88_core *core, u32 status, u32 mask)589 int cx88_core_irq(struct cx88_core *core, u32 status) 583 590 { 584 cx88_print_irqbits(core->name, "irq pci", 585 cx88_pci_irqs, status, mask); 591 int handled = 0; 592 593 if (status & (1<<18)) { 594 cx88_ir_irq(core); 595 handled++; 596 } 597 if (!handled) 598 cx88_print_irqbits(core->name, "irq pci", 599 cx88_pci_irqs, status, 600 core->pci_irqmask); 601 return handled; 586 602 } 587 603 588 604 void cx88_wakeup(struct cx88_core *core, … … int cx88_set_scale(struct cx88_core *cor 800 816 value |= (1 << 0); // 3-tap interpolation 801 817 if (width < 193) 802 818 value |= (1 << 1); // 5-tap interpolation 819 if (nocomb) 820 value |= (3 << 5); // disable comb filter 803 821 804 822 cx_write(MO_FILTER_EVEN, value); 805 823 cx_write(MO_FILTER_ODD, value); … … int cx88_set_tvnorm(struct cx88_core *co 969 987 cx_write(MO_VBI_PACKET, ((1 << 11) | /* (norm_vdelay(norm) << 11) | */ 970 988 norm_vbipack(norm))); 971 989 990 // this is needed as well to set all tvnorm parameter 991 cx88_set_scale(core, 320, 240, V4L2_FIELD_INTERLACED); 992 972 993 // audio 973 994 set_tvaudio(core); 974 995 … … struct cx88_core* cx88_core_get(struct p 1105 1126 goto fail_unlock; 1106 1127 1107 1128 memset(core,0,sizeof(*core)); 1129 atomic_inc(&core->refcount); 1108 1130 core->pci_bus = pci->bus->number; 1109 1131 core->pci_slot = PCI_SLOT(pci->devfn); 1110 atomic_inc(&core->refcount);1132 core->pci_irqmask = 0x00fc00; 1111 1133 1112 1134 core->nr = cx88_devcount++; 1113 1135 sprintf(core->name,"cx88[%d]",core->nr); … … struct cx88_core* cx88_core_get(struct p 1150 1172 cx88_reset(core); 1151 1173 cx88_i2c_init(core,pci); 1152 1174 cx88_card_setup(core); 1175 cx88_ir_init(core,pci); 1176 cx_write(MO_PCI_INTMSK, core->pci_irqmask); 1153 1177 1154 1178 up(&devlist); 1155 1179 return core; … … void cx88_core_put(struct cx88_core *cor 1170 1194 return; 1171 1195 1172 1196 down(&devlist); 1197 cx88_ir_fini(core); 1173 1198 if (0 == core->i2c_rc) 1174 1199 i2c_bit_del_bus(&core->i2c_adap); 1175 1200 list_del(&core->devlist); … … EXPORT_SYMBOL(cx88_vid_irqs); 1187 1212 EXPORT_SYMBOL(cx88_mpeg_irqs); 1188 1213 EXPORT_SYMBOL(cx88_print_irqbits); 1189 1214 1190 EXPORT_SYMBOL(cx88_ irq);1215 EXPORT_SYMBOL(cx88_core_irq); 1191 1216 EXPORT_SYMBOL(cx88_wakeup); 1192 1217 EXPORT_SYMBOL(cx88_reset); 1193 1218 EXPORT_SYMBOL(cx88_shutdown); … … EXPORT_SYMBOL(cx88_risc_databuffer); 1197 1222 EXPORT_SYMBOL(cx88_risc_stopper); 1198 1223 EXPORT_SYMBOL(cx88_free_buffer); 1199 1224 1200 EXPORT_SYMBOL(cx88_risc_disasm);1201 1202 1225 EXPORT_SYMBOL(cx88_sram_channels); 1203 1226 EXPORT_SYMBOL(cx88_sram_channel_setup); 1204 1227 EXPORT_SYMBOL(cx88_sram_channel_dump); -
drivers/media/video/cx88/cx88-blackbird.c
old new 1 1 /* 2 * $Id: cx88-blackbird.c,v 1. 17 2004/11/07 13:17:15kraxel Exp $2 * $Id: cx88-blackbird.c,v 1.23 2004/12/10 12:33:39 kraxel Exp $ 3 3 * 4 4 * Support for a cx23416 mpeg encoder via cx2388x host port. 5 5 * "blackbird" reference design. … … 25 25 */ 26 26 27 27 #include <linux/module.h> 28 #include <linux/moduleparam.h> 28 29 #include <linux/init.h> 29 30 #include <linux/fs.h> 30 31 #include <linux/delay.h> … … static int register_write(struct cx88_co 207 208 cx_read(P1_RADDR0); 208 209 209 210 return wait_ready_gpio0_bit1(core,1); 210 #if 0211 udelay(1000); /* without this, things don't go right (subsequent memory_write()'s don't get through */212 /* ? would this be safe here? set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1); */213 #endif214 211 } 215 212 216 213 … … static int blackbird_api_cmd(struct cx88 283 280 timeout = jiffies + msecs_to_jiffies(10); 284 281 for (;;) { 285 282 memory_read(dev->core, dev->mailbox, &flag); 286 if (0 == (flag & 4))283 if (0 != (flag & 4)) 287 284 break; 288 285 if (time_after(jiffies,timeout)) { 289 286 dprintk(0, "ERROR: API Mailbox timeout\n"); … … static int blackbird_find_mailbox(struct 324 321 signaturecnt = 0; 325 322 if (4 == signaturecnt) { 326 323 dprintk(1, "Mailbox signature found\n"); 327 return i ;324 return i+1; 328 325 } 329 326 } 330 327 dprintk(0, "Mailbox signature values not found!\n"); … … static void blackbird_codec_settings(str 427 424 blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAMERATE, 1, 0, 0); 428 425 429 426 /* assign frame size */ 430 blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_SIZE, 2, 0, 480, 720); 427 blackbird_api_cmd(dev, IVTV_API_ASSIGN_FRAME_SIZE, 2, 0, 428 dev->height, dev->width); 431 429 432 430 /* assign aspect ratio */ 433 431 blackbird_api_cmd(dev, IVTV_API_ASSIGN_ASPECT_RATIO, 1, 0, 2); … … static int mpeg_do_ioctl(struct inode *i 629 627 630 628 memset(f,0,sizeof(*f)); 631 629 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 632 f->fmt.pix.width = 720;633 f->fmt.pix.height = 576;630 f->fmt.pix.width = dev->width; 631 f->fmt.pix.height = dev->height; 634 632 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 635 633 f->fmt.pix.sizeimage = 1024 * 512 /* FIXME: BUFFER_SIZE */; 636 634 } … … static int mpeg_open(struct inode *inode 694 692 file->private_data = fh; 695 693 fh->dev = dev; 696 694 695 /* FIXME: locking against other video device */ 696 cx88_set_scale(dev->core, dev->width, dev->height, 697 V4L2_FIELD_INTERLACED); 698 697 699 videobuf_queue_init(&fh->mpegq, &blackbird_qops, 698 700 dev->pci, &dev->slock, 699 701 V4L2_BUF_TYPE_VIDEO_CAPTURE, … … static int mpeg_release(struct inode *in 715 717 if (fh->mpegq.reading) 716 718 videobuf_read_stop(&fh->mpegq); 717 719 720 videobuf_mmap_free(&fh->mpegq); 718 721 file->private_data = NULL; 719 722 kfree(fh); 720 723 return 0; … … static int __devinit blackbird_probe(str 821 824 memset(dev,0,sizeof(*dev)); 822 825 dev->pci = pci_dev; 823 826 dev->core = core; 827 dev->width = 720; 828 dev->height = 480; 824 829 825 830 err = cx8802_init_common(dev); 826 831 if (0 != err) -
drivers/media/video/Kconfig
old new config VIDEO_CX88 309 309 select VIDEO_BTCX 310 310 select VIDEO_BUF 311 311 select VIDEO_TUNER 312 select VIDEO_TVEEPROM 312 313 ---help--- 313 314 This is a video4linux driver for Conexant 2388x based 314 315 TV cards. … … config VIDEO_CX88 318 319 319 320 config VIDEO_CX88_DVB 320 321 tristate "DVB Support for cx2388x based TV cards" 321 depends on VIDEO_CX88 && DVB_CORE && BROKEN322 depends on VIDEO_CX88 && DVB_CORE 322 323 select VIDEO_BUF_DVB 323 324 ---help--- 324 325 This adds support for DVB cards based on the -
drivers/media/video/cx88/cx88-video.c
old new 1 1 /* 2 * $Id: cx88-video.c,v 1. 46 2004/11/07 14:44:59 kraxel Exp $2 * $Id: cx88-video.c,v 1.50 2004/12/10 12:33:39 kraxel Exp $ 3 3 * 4 4 * device driver for Conexant 2388x based TV cards 5 5 * video4linux video interface … … 24 24 #include <linux/init.h> 25 25 #include <linux/list.h> 26 26 #include <linux/module.h> 27 #include <linux/moduleparam.h> 27 28 #include <linux/kmod.h> 28 29 #include <linux/kernel.h> 29 30 #include <linux/slab.h> … … static int start_video_dma(struct cx8800 428 429 q->count = 1; 429 430 430 431 /* enable irqs */ 431 cx_set(MO_PCI_INTMSK, 0x00fc01);432 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x01); 432 433 cx_set(MO_VID_INTMSK, 0x0f0011); 433 434 434 435 /* enable capture */ … … static int video_open(struct inode *inod 1002 1003 } 1003 1004 1004 1005 static ssize_t 1005 video_read(struct file *file, char __user*data, size_t count, loff_t *ppos)1006 video_read(struct file *file, char *data, size_t count, loff_t *ppos) 1006 1007 { 1007 1008 struct cx8800_fh *fh = file->private_data; 1008 1009 … … static int video_release(struct inode *i 1083 1084 res_free(dev,fh,RESOURCE_VBI); 1084 1085 } 1085 1086 1087 videobuf_mmap_free(&fh->vidq); 1088 videobuf_mmap_free(&fh->vbiq); 1086 1089 file->private_data = NULL; 1087 1090 kfree(fh); 1088 1091 return 0; … … static irqreturn_t cx8800_irq(int irq, v 1880 1883 { 1881 1884 struct cx8800_dev *dev = dev_id; 1882 1885 struct cx88_core *core = dev->core; 1883 u32 status , mask;1886 u32 status; 1884 1887 int loop, handled = 0; 1885 1888 1886 1889 for (loop = 0; loop < 10; loop++) { 1887 status = cx_read(MO_PCI_INTSTAT) & (~0x1f | 0x01); 1888 mask = cx_read(MO_PCI_INTMSK); 1889 if (0 == (status & mask)) 1890 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x01); 1891 if (0 == status) 1890 1892 goto out; 1891 1893 cx_write(MO_PCI_INTSTAT, status); 1892 1894 handled = 1; 1893 1895 1894 if (status & mask & ~0x1f)1895 cx88_ irq(core,status,mask);1896 if (status & core->pci_irqmask) 1897 cx88_core_irq(core,status); 1896 1898 if (status & 0x01) 1897 1899 cx8800_vid_irq(dev); 1898 1900 }; -
drivers/media/video/cx88/cx88-mpeg.c
old new 1 1 /* 2 * $Id: cx88-mpeg.c,v 1.1 4 2004/10/25 11:26:36kraxel Exp $2 * $Id: cx88-mpeg.c,v 1.16 2004/12/10 12:33:39 kraxel Exp $ 3 3 * 4 4 * Support for the mpeg transport stream transfers 5 5 * PCI function #2 of the cx2388x. … … 24 24 */ 25 25 26 26 #include <linux/module.h> 27 #include <linux/moduleparam.h> 27 28 #include <linux/init.h> 28 29 #include <linux/device.h> 29 30 #include <linux/interrupt.h> … … static int cx8802_start_dma(struct cx880 93 94 q->count = 1; 94 95 95 96 /* enable irqs */ 96 cx_set(MO_PCI_INTMSK, 0x00fc04);97 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04); 97 98 cx_write(MO_TS_INTMSK, 0x1f0011); 98 99 99 100 /* start dma */ … … static irqreturn_t cx8802_irq(int irq, v 292 293 { 293 294 struct cx8802_dev *dev = dev_id; 294 295 struct cx88_core *core = dev->core; 295 u32 status , mask;296 u32 status; 296 297 int loop, handled = 0; 297 298 298 299 for (loop = 0; loop < 10; loop++) { 299 status = cx_read(MO_PCI_INTSTAT) & (~0x1f | 0x04); 300 mask = cx_read(MO_PCI_INTMSK); 301 if (0 == (status & mask)) 300 status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04); 301 if (0 == status) 302 302 goto out; 303 303 handled = 1; 304 304 cx_write(MO_PCI_INTSTAT, status); 305 305 306 if (status & mask & ~0x1f)307 cx88_ irq(core,status,mask);306 if (status & core->pci_irqmask) 307 cx88_core_irq(core,status); 308 308 if (status & 0x04) 309 309 cx8802_mpeg_irq(dev); 310 310 }; -
drivers/media/video/cx88/cx88-tvaudio.c
old new 1 1 /* 2 $Id: cx88-tvaudio.c,v 1.2 4 2004/10/25 11:51:00kraxel Exp $2 $Id: cx88-tvaudio.c,v 1.26 2004/12/10 12:33:39 kraxel Exp $ 3 3 4 4 cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver 5 5 … … 37 37 */ 38 38 39 39 #include <linux/module.h> 40 #include <linux/moduleparam.h> 40 41 #include <linux/errno.h> 41 42 #include <linux/kernel.h> 42 43 #include <linux/slab.h> -
drivers/media/video/cx88/cx88-dvb.c
old new 1 1 /* 2 * $Id: cx88-dvb.c,v 1. 19 2004/11/07 14:44:59kraxel Exp $2 * $Id: cx88-dvb.c,v 1.21 2004/12/09 12:51:35 kraxel Exp $ 3 3 * 4 4 * device driver for Conexant 2388x based TV cards 5 5 * MPEG Transport Stream (DVB) routines … … 31 31 #include <linux/suspend.h> 32 32 33 33 #include "cx88.h" 34 #include "dvb-pll.h" 34 35 #include "cx22702.h" 35 36 #include "mt352.h" 36 37 #include "mt352_priv.h" /* FIXME */ … … static int dvico_fusionhdtv_demod_init(s 110 111 return 0; 111 112 } 112 113 113 #define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */ 114 115 static int lg_z201_pll_set(struct dvb_frontend* fe, 116 struct dvb_frontend_parameters* params, u8* pllbuf) 114 static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe) 117 115 { 118 u32 div; 119 unsigned char cp = 0; 120 unsigned char bs = 0; 121 122 div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; 123 124 if (params->frequency < 542000000) cp = 0xbc; 125 else if (params->frequency < 830000000) cp = 0xf4; 126 else cp = 0xfc; 127 128 if (params->frequency == 0) bs = 0x03; 129 else if (params->frequency < 157500000) bs = 0x01; 130 else if (params->frequency < 443250000) bs = 0x02; 131 else bs = 0x04; 132 133 pllbuf[0] = 0xC2; /* Note: non-linux standard PLL I2C address */ 134 pllbuf[1] = div >> 8; 135 pllbuf[2] = div & 0xff; 136 pllbuf[3] = cp; 137 pllbuf[4] = bs; 116 static u8 clock_config [] = { 0x89, 0x38, 0x39 }; 117 static u8 reset [] = { 0x50, 0x80 }; 118 static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 }; 119 static u8 agc_cfg [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF, 120 0x00, 0xFF, 0x00, 0x40, 0x40 }; 121 static u8 dntv_extra[] = { 0xB5, 0x7A }; 122 static u8 capt_range_cfg[] = { 0x75, 0x32 }; 123 124 mt352_write(fe, clock_config, sizeof(clock_config)); 125 udelay(2000); 126 mt352_write(fe, reset, sizeof(reset)); 127 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); 128 129 mt352_write(fe, agc_cfg, sizeof(agc_cfg)); 130 udelay(2000); 131 mt352_write(fe, dntv_extra, sizeof(dntv_extra)); 132 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); 138 133 139 134 return 0; 140 135 } 141 136 142 static int thomson_dtt7579_pll_set(struct dvb_frontend* fe, 143 struct dvb_frontend_parameters* params, 144 u8* pllbuf) 145 { 146 u32 div; 147 unsigned char cp = 0; 148 unsigned char bs = 0; 149 150 div = (((params->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; 151 152 if (params->frequency < 542000000) cp = 0xb4; 153 else if (params->frequency < 771000000) cp = 0xbc; 154 else cp = 0xf4; 155 156 if (params->frequency == 0) bs = 0x03; 157 else if (params->frequency < 443250000) bs = 0x02; 158 else bs = 0x08; 159 160 pllbuf[0] = 0xc0; // Note: non-linux standard PLL i2c address 161 pllbuf[1] = div >> 8; 162 pllbuf[2] = div & 0xff; 163 pllbuf[3] = cp; 164 pllbuf[4] = bs; 165 137 static int mt352_pll_set(struct dvb_frontend* fe, 138 struct dvb_frontend_parameters* params, 139 u8* pllbuf) 140 { 141 struct cx8802_dev *dev= fe->dvb->priv; 142 143 pllbuf[0] = dev->core->pll_addr << 1; 144 dvb_pll_configure(dev->core->pll_desc, pllbuf+1, 145 params->frequency, 146 params->u.ofdm.bandwidth); 166 147 return 0; 167 148 } 168 149 169 st ruct mt352_config dvico_fusionhdtv_dvbt1= {150 static struct mt352_config dvico_fusionhdtv = { 170 151 .demod_address = 0x0F, 171 152 .demod_init = dvico_fusionhdtv_demod_init, 172 .pll_set = lg_z201_pll_set,153 .pll_set = mt352_pll_set, 173 154 }; 174 155 175 st ruct mt352_config dvico_fusionhdtv_dvbt_plus= {176 .demod_address = 0x0 F,177 .demod_init = d vico_fusionhdtv_demod_init,178 .pll_set = thomson_dtt7579_pll_set,156 static struct mt352_config dntv_live_dvbt_config = { 157 .demod_address = 0x0f, 158 .demod_init = dntv_live_dvbt_demod_init, 159 .pll_set = mt352_pll_set, 179 160 }; 180 161 181 162 static int dvb_register(struct cx8802_dev *dev) … … static int dvb_register(struct cx8802_de 189 170 case CX88_BOARD_CONEXANT_DVB_T1: 190 171 dev->dvb.frontend = cx22702_create(&dev->core->i2c_adap, 191 172 dev->core->pll_addr, 192 dev->core->pll_ type,173 dev->core->pll_desc, 193 174 dev->core->demod_addr); 194 175 break; 195 176 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 196 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv_dvbt1, 177 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: 178 dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, 197 179 &dev->core->i2c_adap); 198 if (dev->dvb.frontend) {199 dev->dvb.frontend->ops->info.frequency_min = 174000000;200 dev->dvb.frontend->ops->info.frequency_max = 862000000;201 }202 180 break; 203 case CX88_BOARD_D VICO_FUSIONHDTV_DVB_T_PLUS:204 dev->dvb.frontend = mt352_attach(&d vico_fusionhdtv_dvbt_plus,181 case CX88_BOARD_DNTV_LIVE_DVB_T: 182 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config, 205 183 &dev->core->i2c_adap); 206 if (dev->dvb.frontend) {207 dev->dvb.frontend->ops->info.frequency_min = 174000000;208 dev->dvb.frontend->ops->info.frequency_max = 862000000;209 }210 184 break; 211 185 default: 212 186 printk("%s: FIXME: frontend handling not here yet ...\n", 213 187 dev->core->name); 214 188 break; 215 189 } 216 if (NULL == dev->dvb.frontend) 190 if (NULL == dev->dvb.frontend) { 191 printk("%s: frontend initialization failed\n",dev->core->name); 217 192 return -1; 193 } 194 195 if (dev->core->pll_desc) { 196 dev->dvb.frontend->ops->info.frequency_min = dev->core->pll_desc->min; 197 dev->dvb.frontend->ops->info.frequency_max = dev->core->pll_desc->max; 198 } 218 199 219 200 /* Copy the board name into the DVB structure */ 220 201 strlcpy(dev->dvb.frontend->ops->info.name, … … static int dvb_register(struct cx8802_de 222 203 sizeof(dev->dvb.frontend->ops->info.name)); 223 204 224 205 /* register everything */ 225 return videobuf_dvb_register(&dev->dvb );206 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev); 226 207 } 227 208 228 209 /* ----------------------------------------------------------- */ -
new file linux-2004-12-16/drivers/media/video/cx88/cx88-input.c
- + 1 /* 2 * $Id: cx88-input.c,v 1.3 2004/12/10 12:33:39 kraxel Exp $ 3 * 4 * Device driver for GPIO attached remote control interfaces 5 * on Conexant 2388x based TV/DVB cards. 6 * 7 * Copyright (c) 2003 Pavel Machek 8 * Copyright (c) 2004 Gerd Knorr 9 * Copyright (c) 2004 Chris Pascoe 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 */ 25 26 #include <linux/init.h> 27 #include <linux/delay.h> 28 #include <linux/input.h> 29 #include <linux/pci.h> 30 #include <linux/module.h> 31 #include <linux/moduleparam.h> 32 33 #include <media/ir-common.h> 34 35 #include "cx88.h" 36 37 /* ---------------------------------------------------------------------- */ 38 39 /* DigitalNow DNTV Live DVB-T Remote */ 40 static IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE] = { 41 [ 0x00 ] = KEY_ESC, // 'go up a level?' 42 [ 0x01 ] = KEY_KP1, // '1' 43 [ 0x02 ] = KEY_KP2, // '2' 44 [ 0x03 ] = KEY_KP3, // '3' 45 [ 0x04 ] = KEY_KP4, // '4' 46 [ 0x05 ] = KEY_KP5, // '5' 47 [ 0x06 ] = KEY_KP6, // '6' 48 [ 0x07 ] = KEY_KP7, // '7' 49 [ 0x08 ] = KEY_KP8, // '8' 50 [ 0x09 ] = KEY_KP9, // '9' 51 [ 0x0a ] = KEY_KP0, // '0' 52 [ 0x0b ] = KEY_TUNER, // 'tv/fm' 53 [ 0x0c ] = KEY_SEARCH, // 'scan' 54 [ 0x0d ] = KEY_STOP, // 'stop' 55 [ 0x0e ] = KEY_PAUSE, // 'pause' 56 [ 0x0f ] = KEY_LIST, // 'source' 57 58 [ 0x10 ] = KEY_MUTE, // 'mute' 59 [ 0x11 ] = KEY_REWIND, // 'backward <<' 60 [ 0x12 ] = KEY_POWER, // 'power' 61 [ 0x13 ] = KEY_S, // 'snap' 62 [ 0x14 ] = KEY_AUDIO, // 'stereo' 63 [ 0x15 ] = KEY_CLEAR, // 'reset' 64 [ 0x16 ] = KEY_PLAY, // 'play' 65 [ 0x17 ] = KEY_ENTER, // 'enter' 66 [ 0x18 ] = KEY_ZOOM, // 'full screen' 67 [ 0x19 ] = KEY_FASTFORWARD, // 'forward >>' 68 [ 0x1a ] = KEY_CHANNELUP, // 'channel +' 69 [ 0x1b ] = KEY_VOLUMEUP, // 'volume +' 70 [ 0x1c ] = KEY_INFO, // 'preview' 71 [ 0x1d ] = KEY_RECORD, // 'record' 72 [ 0x1e ] = KEY_CHANNELDOWN, // 'channel -' 73 [ 0x1f ] = KEY_VOLUMEDOWN, // 'volume -' 74 }; 75 76 /* ---------------------------------------------------------------------- */ 77 78 struct cx88_IR { 79 struct cx88_core *core; 80 struct input_dev input; 81 struct ir_input_state ir; 82 char name[32]; 83 char phys[32]; 84 85 /* sample from gpio pin 16 */ 86 int sampling; 87 u32 samples[16]; 88 int scount; 89 unsigned long release; 90 91 /* poll external decoder */ 92 int polling; 93 struct work_struct work; 94 struct timer_list timer; 95 u32 gpio_addr; 96 u32 last_gpio; 97 u32 mask_keycode; 98 u32 mask_keydown; 99 u32 mask_keyup; 100 }; 101 102 static int ir_debug = 0; 103 module_param(ir_debug, int, 0644); /* debug level [IR] */ 104 MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); 105 106 #define ir_dprintk(fmt, arg...) if (ir_debug) \ 107 printk(KERN_DEBUG "%s IR: " fmt , ir->core->name, ## arg) 108 109 /* ---------------------------------------------------------------------- */ 110 111 static void cx88_ir_handle_key(struct cx88_IR *ir) 112 { 113 struct cx88_core *core = ir->core; 114 u32 gpio, data; 115 116 /* read gpio value */ 117 gpio = cx_read(ir->gpio_addr); 118 if (ir->polling) { 119 if (ir->last_gpio == gpio) 120 return; 121 ir->last_gpio = gpio; 122 } 123 124 /* extract data */ 125 data = ir_extract_bits(gpio, ir->mask_keycode); 126 ir_dprintk("irq gpio=0x%x code=%d | %s%s%s\n", 127 gpio, data, 128 ir->polling ? "poll" : "irq", 129 (gpio & ir->mask_keydown) ? " down" : "", 130 (gpio & ir->mask_keyup) ? " up" : ""); 131 132 if (ir->mask_keydown) { 133 /* bit set on keydown */ 134 if (gpio & ir->mask_keydown) { 135 ir_input_keydown(&ir->input,&ir->ir,data,data); 136 } else { 137 ir_input_nokey(&ir->input,&ir->ir); 138 } 139 140 } else if (ir->mask_keyup) { 141 /* bit cleared on keydown */ 142 if (0 == (gpio & ir->mask_keyup)) { 143 ir_input_keydown(&ir->input,&ir->ir,data,data); 144 } else { 145 ir_input_nokey(&ir->input,&ir->ir); 146 } 147 148 } else { 149 /* can't disturgissh keydown/up :-/ */ 150 ir_input_keydown(&ir->input,&ir->ir,data,data); 151 ir_input_nokey(&ir->input,&ir->ir); 152 } 153 } 154 155 static void ir_timer(unsigned long data) 156 { 157 struct cx88_IR *ir = (struct cx88_IR*)data; 158 159 schedule_work(&ir->work); 160 } 161 162 static void cx88_ir_work(void *data) 163 { 164 struct cx88_IR *ir = data; 165 unsigned long timeout; 166 167 cx88_ir_handle_key(ir); 168 timeout = jiffies + (ir->polling * HZ / 1000); 169 mod_timer(&ir->timer, timeout); 170 } 171 172 /* ---------------------------------------------------------------------- */ 173 174 int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) 175 { 176 struct cx88_IR *ir; 177 IR_KEYTAB_TYPE *ir_codes = NULL; 178 int ir_type = IR_TYPE_OTHER; 179 180 ir = kmalloc(sizeof(*ir),GFP_KERNEL); 181 if (NULL == ir) 182 return -ENOMEM; 183 memset(ir,0,sizeof(*ir)); 184 185 /* detect & configure */ 186 switch (core->board) { 187 case CX88_BOARD_DNTV_LIVE_DVB_T: 188 ir_codes = ir_codes_dntv_live_dvb_t; 189 ir->gpio_addr = MO_GP1_IO; 190 ir->mask_keycode = 0x1f; 191 ir->mask_keyup = 0x60; 192 ir->polling = 50; // ms 193 break; 194 case CX88_BOARD_HAUPPAUGE: 195 case CX88_BOARD_HAUPPAUGE_DVB_T1: 196 ir_codes = ir_codes_rc5_tv; 197 ir_type = IR_TYPE_RC5; 198 ir->sampling = 1; 199 break; 200 } 201 if (NULL == ir_codes) { 202 kfree(ir); 203 return -ENODEV; 204 } 205 206 /* init input device */ 207 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", 208 cx88_boards[core->board].name); 209 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", 210 pci_name(pci)); 211 212 ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes); 213 ir->input.name = ir->name; 214 ir->input.phys = ir->phys; 215 ir->input.id.bustype = BUS_PCI; 216 ir->input.id.version = 1; 217 if (pci->subsystem_vendor) { 218 ir->input.id.vendor = pci->subsystem_vendor; 219 ir->input.id.product = pci->subsystem_device; 220 } else { 221 ir->input.id.vendor = pci->vendor; 222 ir->input.id.product = pci->device; 223 } 224 225 /* record handles to ourself */ 226 ir->core = core; 227 core->ir = ir; 228 229 if (ir->polling) { 230 INIT_WORK(&ir->work, cx88_ir_work, ir); 231 init_timer(&ir->timer); 232 ir->timer.function = ir_timer; 233 ir->timer.data = (unsigned long)ir; 234 schedule_work(&ir->work); 235 } 236 if (ir->sampling) { 237 core->pci_irqmask |= (1<<18); // IR_SMP_INT 238 cx_write(MO_DDS_IO, 0xa80a80); // 4 kHz sample rate 239 cx_write(MO_DDSCFG_IO, 0x5); // enable 240 } 241 242 /* all done */ 243 input_register_device(&ir->input); 244 printk("%s: registered IR remote control\n", core->name); 245 246 return 0; 247 } 248 249 int cx88_ir_fini(struct cx88_core *core) 250 { 251 struct cx88_IR *ir = core->ir; 252 253 /* skip detach on non attached boards */ 254 if (NULL == ir) 255 return 0; 256 257 if (ir->polling) { 258 del_timer(&ir->timer); 259 flush_scheduled_work(); 260 } 261 262 input_unregister_device(&ir->input); 263 kfree(ir); 264 265 /* done */ 266 core->ir = NULL; 267 return 0; 268 } 269 270 /* ---------------------------------------------------------------------- */ 271 272 static int inline getbit(u32 *samples, int bit) 273 { 274 return (samples[bit/32] & (1 << (31-(bit%32)))) ? 1 : 0; 275 } 276 277 static int dump_samples(u32 *samples, int count) 278 { 279 int i, bit, start; 280 281 printk(KERN_DEBUG "ir samples @ 4kHz: "); 282 start = 0; 283 for (i = 0; i < count * 32; i++) { 284 bit = getbit(samples,i); 285 if (bit) 286 start = 1; 287 if (0 == start) 288 continue; 289 printk("%s", bit ? "#" : "_"); 290 } 291 printk("\n"); 292 } 293 294 static int ir_decode_biphase(u32 *samples, int count, int low, int high) 295 { 296 int i,last,bit,len,flips; 297 u32 value; 298 299 /* find start bit (1) */ 300 for (i = 0; i < 32; i++) { 301 bit = getbit(samples,i); 302 if (bit) 303 break; 304 } 305 306 /* go decoding */ 307 len = 0; 308 flips = 0; 309 value = 1; 310 for (; i < count * 32; i++) { 311 if (len > high) 312 break; 313 if (flips > 1) 314 break; 315 last = bit; 316 bit = getbit(samples,i); 317 if (last == bit) { 318 len++; 319 continue; 320 } 321 if (len < low) { 322 len++; 323 flips++; 324 continue; 325 } 326 value <<= 1; 327 value |= bit; 328 flips = 0; 329 len = 1; 330 } 331 return value; 332 } 333 334 void cx88_ir_irq(struct cx88_core *core) 335 { 336 struct cx88_IR *ir = core->ir; 337 u32 samples,rc5; 338 int i; 339 340 if (NULL == ir) 341 return; 342 if (!ir->sampling) 343 return; 344 345 samples = cx_read(MO_SAMPLE_IO); 346 if (0 != samples && 0xffffffff != samples) { 347 /* record sample data */ 348 if (ir->scount < ARRAY_SIZE(ir->samples)) 349 ir->samples[ir->scount++] = samples; 350 return; 351 } 352 if (!ir->scount) { 353 /* nothing to sample */ 354 if (ir->ir.keypressed && time_after(jiffies,ir->release)) 355 ir_input_nokey(&ir->input,&ir->ir); 356 return; 357 } 358 359 /* have a complete sample */ 360 if (ir->scount < ARRAY_SIZE(ir->samples)) 361 ir->samples[ir->scount++] = samples; 362 for (i = 0; i < ir->scount; i++) 363 ir->samples[i] = ~ir->samples[i]; 364 if (ir_debug) 365 dump_samples(ir->samples,ir->scount); 366 367 /* decode it */ 368 switch (core->board) { 369 case CX88_BOARD_HAUPPAUGE: 370 case CX88_BOARD_HAUPPAUGE_DVB_T1: 371 rc5 = ir_decode_biphase(ir->samples,ir->scount,5,7); 372 ir_dprintk("biphase decoded: %x\n",rc5); 373 if ((rc5 & 0xfffff000) != 0x3000) 374 break; 375 ir_input_keydown(&ir->input, &ir->ir, rc5 & 0x3f, rc5); 376 ir->release = jiffies + msecs_to_jiffies(120); 377 break; 378 } 379 380 ir->scount = 0; 381 return; 382 } 383 384 /* ---------------------------------------------------------------------- */ 385 386 MODULE_AUTHOR("Gerd Knorr, Pavel Machek, Chris Pascoe"); 387 MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls"); 388 MODULE_LICENSE("GPL"); 389 390 /* 391 * Local variables: 392 * c-basic-offset: 8 393 * End: 394 */ -
drivers/media/video/cx88/cx88-vbi.c
old new 1 1 /* 2 * $Id: cx88-vbi.c,v 1.1 4 2004/11/07 13:17:15kraxel Exp $2 * $Id: cx88-vbi.c,v 1.16 2004/12/10 12:33:39 kraxel Exp $ 3 3 */ 4 4 #include <linux/kernel.h> 5 5 #include <linux/module.h> 6 #include <linux/moduleparam.h> 6 7 #include <linux/init.h> 7 8 #include <linux/slab.h> 8 9 … … int cx8800_start_vbi_dma(struct cx8800_d 64 65 q->count = 1; 65 66 66 67 /* enable irqs */ 67 cx_set(MO_PCI_INTMSK, 0x00fc01);68 cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x01); 68 69 cx_set(MO_VID_INTMSK, 0x0f0088); 69 70 70 71 /* enable capture */ -
drivers/media/video/cx88/cx88.h
old new 1 1 /* 2 * $Id: cx88.h,v 1.4 0 2004/11/03 09:04:51kraxel Exp $2 * $Id: cx88.h,v 1.47 2004/12/14 15:33:30 kraxel Exp $ 3 3 * 4 4 * v4l2 device driver for cx2388x based TV cards 5 5 * … … 27 27 #include <linux/kdev_t.h> 28 28 29 29 #include <media/tuner.h> 30 #include <media/tveeprom.h> 30 31 #include <media/audiochip.h> 31 32 #include <media/video-buf.h> 32 33 #include <media/video-buf-dvb.h> … … extern struct sram_channel cx88_sram_cha 156 157 #define CX88_BOARD_CONEXANT_DVB_T1 19 157 158 #define CX88_BOARD_PROVIDEO_PV259 20 158 159 #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS 21 160 #define CX88_BOARD_PCHDTV_HD3000 22 161 #define CX88_BOARD_DNTV_LIVE_DVB_T 23 159 162 160 163 enum cx88_itype { 161 164 CX88_VMUX_COMPOSITE1 = 1, … … struct cx88_core { 238 241 u32 __iomem *lmmio; 239 242 u8 __iomem *bmmio; 240 243 u32 shadow[SHADOW_MAX]; 244 int pci_irqmask; 241 245 242 246 /* i2c i/o */ 243 247 struct i2c_adapter i2c_adap; … … struct cx88_core { 252 256 unsigned int has_radio; 253 257 254 258 /* config info -- dvb */ 255 unsigned int pll_type;259 struct dvb_pll_desc *pll_desc; 256 260 unsigned int pll_addr; 257 261 unsigned int demod_addr; 258 262 … … struct cx88_core { 262 266 u32 tvaudio; 263 267 u32 input; 264 268 u32 astat; 269 270 /* IR remote control state */ 271 struct cx88_IR *ir; 265 272 }; 266 273 267 274 struct cx8800_dev; … … struct cx8802_dev { 371 378 struct list_head devlist; 372 379 struct video_device *mpeg_dev; 373 380 u32 mailbox; 381 int width; 382 int height; 374 383 375 384 /* for dvb only */ 376 385 struct videobuf_dvb dvb; … … extern void cx88_print_irqbits(char *nam 411 420 u32 bits, u32 mask); 412 421 extern void cx88_print_ioctl(char *name, unsigned int cmd); 413 422 414 extern void cx88_irq(struct cx88_core *core, u32 status, u32 mask);423 extern int cx88_core_irq(struct cx88_core *core, u32 status); 415 424 extern void cx88_wakeup(struct cx88_core *core, 416 425 struct cx88_dmaqueue *q, u32 count); 417 426 extern void cx88_shutdown(struct cx88_core *core); … … void cx88_set_stereo(struct cx88_core *c 508 517 int cx88_audio_thread(void *data); 509 518 510 519 /* ----------------------------------------------------------- */ 520 /* cx88-input.c */ 521 522 int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci); 523 int cx88_ir_fini(struct cx88_core *core); 524 void cx88_ir_irq(struct cx88_core *core); 525 526 /* ----------------------------------------------------------- */ 511 527 /* cx88-mpeg.c */ 512 528 513 529 int cx8802_buf_prepare(struct cx8802_dev *dev, struct cx88_buffer *buf); -
drivers/media/video/cx88/Makefile
old new 1 cx88xx-objs := cx88-cards.o cx88-core.o cx88-i2c.o cx88-tvaudio.o 1 cx88xx-objs := cx88-cards.o cx88-core.o cx88-i2c.o cx88-tvaudio.o \ 2 cx88-input.o 2 3 cx8800-objs := cx88-video.o cx88-vbi.o 3 4 cx8802-objs := cx88-mpeg.o 4 5 -
drivers/media/video/cx88/cx88-i2c.c
old new 1 1 /* 2 $Id: cx88-i2c.c,v 1.1 8 2004/10/13 10:39:00kraxel Exp $2 $Id: cx88-i2c.c,v 1.19 2004/12/10 12:33:39 kraxel Exp $ 3 3 4 4 cx88-i2c.c -- all the i2c code is here 5 5 … … 25 25 */ 26 26 27 27 #include <linux/module.h> 28 #include <linux/moduleparam.h> 28 29 #include <linux/init.h> 29 30 30 31 #include <asm/io.h>
Note:
See TracBrowser
for help on using the repository browser.