Lines Matching refs:core

53 #define info_printk(core, fmt, arg...) \  argument
54 printk(KERN_INFO "%s: " fmt, core->name , ## arg)
56 #define warn_printk(core, fmt, arg...) \ argument
57 printk(KERN_WARNING "%s: " fmt, core->name , ## arg)
59 #define err_printk(core, fmt, arg...) \ argument
60 printk(KERN_ERR "%s: " fmt, core->name , ## arg)
64 printk(KERN_DEBUG "%s: " fmt, core->name , ## arg); \
2827 static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data) in leadtek_eeprom() argument
2832 warn_printk(core, "Leadtek eeprom invalid.\n"); in leadtek_eeprom()
2843 core->board.tuner_type = TUNER_PHILIPS_FM1236_MK3; in leadtek_eeprom()
2846 core->board.tuner_type = TUNER_PHILIPS_FM1216ME_MK3; in leadtek_eeprom()
2850 info_printk(core, "Leadtek Winfast 2000XP Expert config: " in leadtek_eeprom()
2852 core->board.tuner_type, eeprom_data[0]); in leadtek_eeprom()
2855 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) in hauppauge_eeprom() argument
2859 tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data); in hauppauge_eeprom()
2860 core->board.tuner_type = tv.tuner_type; in hauppauge_eeprom()
2861 core->tuner_formats = tv.tuner_formats; in hauppauge_eeprom()
2862 core->board.radio.type = tv.has_radio ? CX88_RADIO : 0; in hauppauge_eeprom()
2863 core->model = tv.model; in hauppauge_eeprom()
2908 warn_printk(core, "warning: unknown hauppauge model #%d\n", in hauppauge_eeprom()
2913 info_printk(core, "hauppauge eeprom: model=%d\n", tv.model); in hauppauge_eeprom()
2954 static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) in gdi_eeprom() argument
2959 info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown"); in gdi_eeprom()
2962 core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id; in gdi_eeprom()
2963 core->board.radio.type = gdi_tuner[eeprom_data[0x0d]].fm ? in gdi_eeprom()
2969 static int cx88_dvico_xc2028_callback(struct cx88_core *core, in cx88_dvico_xc2028_callback() argument
2974 switch (core->boardnr) { in cx88_dvico_xc2028_callback()
3001 static int cx88_xc3028_geniatech_tuner_callback(struct cx88_core *core, in cx88_xc3028_geniatech_tuner_callback() argument
3006 switch (INPUT(core->input).type) { in cx88_xc3028_geniatech_tuner_callback()
3028 static int cx88_xc3028_winfast1800h_callback(struct cx88_core *core, in cx88_xc3028_winfast1800h_callback() argument
3045 static int cx88_xc4000_winfast2000h_plus_callback(struct cx88_core *core, in cx88_xc4000_winfast2000h_plus_callback() argument
3064 static int cx88_pv_8000gt_callback(struct cx88_core *core, in cx88_pv_8000gt_callback() argument
3085 static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core) in dvico_fusionhdtv_hybrid_init() argument
3108 err = i2c_transfer(&core->i2c_adap, &msg, 1); in dvico_fusionhdtv_hybrid_init()
3110 warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d " in dvico_fusionhdtv_hybrid_init()
3117 static int cx88_xc2028_tuner_callback(struct cx88_core *core, in cx88_xc2028_tuner_callback() argument
3121 switch (core->boardnr) { in cx88_xc2028_tuner_callback()
3125 return cx88_xc3028_geniatech_tuner_callback(core, in cx88_xc2028_tuner_callback()
3129 return cx88_pv_8000gt_callback(core, command, arg); in cx88_xc2028_tuner_callback()
3132 return cx88_dvico_xc2028_callback(core, command, arg); in cx88_xc2028_tuner_callback()
3135 return cx88_xc3028_winfast1800h_callback(core, command, arg); in cx88_xc2028_tuner_callback()
3140 switch (INPUT(core->input).type) { in cx88_xc2028_tuner_callback()
3164 static int cx88_xc4000_tuner_callback(struct cx88_core *core, in cx88_xc4000_tuner_callback() argument
3168 switch (core->boardnr) { in cx88_xc4000_tuner_callback()
3173 return cx88_xc4000_winfast2000h_plus_callback(core, in cx88_xc4000_tuner_callback()
3184 static int cx88_xc5000_tuner_callback(struct cx88_core *core, in cx88_xc5000_tuner_callback() argument
3187 switch (core->boardnr) { in cx88_xc5000_tuner_callback()
3230 struct cx88_core *core; in cx88_tuner_callback() local
3237 core = i2c_algo->data; in cx88_tuner_callback()
3239 if (!core) { in cx88_tuner_callback()
3247 switch (core->board.tuner_type) { in cx88_tuner_callback()
3250 return cx88_xc2028_tuner_callback(core, command, arg); in cx88_tuner_callback()
3253 return cx88_xc4000_tuner_callback(core, command, arg); in cx88_tuner_callback()
3256 return cx88_xc5000_tuner_callback(core, command, arg); in cx88_tuner_callback()
3258 err_printk(core, "Error: Calling callback for tuner %d\n", in cx88_tuner_callback()
3259 core->board.tuner_type); in cx88_tuner_callback()
3266 static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) in cx88_card_list() argument
3278 core->name,core->name,core->name,core->name,core->name); in cx88_card_list()
3285 core->name,core->name,core->name,core->name); in cx88_card_list()
3287 err_printk(core, "Here is a list of valid choices for the card=<n> " in cx88_card_list()
3291 core->name, i, cx88_boards[i].name); in cx88_card_list()
3294 static void cx88_card_setup_pre_i2c(struct cx88_core *core) in cx88_card_setup_pre_i2c() argument
3296 switch (core->boardnr) { in cx88_card_setup_pre_i2c()
3332 cx_write(MO_GP0_IO, core->board.input[0].gpio0); in cx88_card_setup_pre_i2c()
3342 cx88_xc3028_winfast1800h_callback(core, XC2028_TUNER_RESET, 0); in cx88_card_setup_pre_i2c()
3349 cx88_xc4000_winfast2000h_plus_callback(core, in cx88_card_setup_pre_i2c()
3365 void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl) in cx88_setup_xc3028() argument
3372 switch (core->boardnr) { in cx88_setup_xc3028()
3375 if (core->i2c_algo.udelay < 16) in cx88_setup_xc3028()
3376 core->i2c_algo.udelay = 16; in cx88_setup_xc3028()
3413 static void cx88_card_setup(struct cx88_core *core) in cx88_card_setup() argument
3421 if (0 == core->i2c_rc) { in cx88_card_setup()
3422 core->i2c_client.addr = 0xa0 >> 1; in cx88_card_setup()
3423 tveeprom_read(&core->i2c_client, eeprom, sizeof(eeprom)); in cx88_card_setup()
3426 switch (core->boardnr) { in cx88_card_setup()
3429 if (0 == core->i2c_rc) in cx88_card_setup()
3430 hauppauge_eeprom(core, eeprom+8); in cx88_card_setup()
3433 if (0 == core->i2c_rc) in cx88_card_setup()
3434 gdi_eeprom(core, eeprom); in cx88_card_setup()
3439 if (0 == core->i2c_rc) in cx88_card_setup()
3440 leadtek_eeprom(core, eeprom); in cx88_card_setup()
3452 if (0 == core->i2c_rc) in cx88_card_setup()
3453 hauppauge_eeprom(core, eeprom); in cx88_card_setup()
3481 if (0 == core->i2c_rc && in cx88_card_setup()
3482 core->boardnr == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID) in cx88_card_setup()
3483 dvico_fusionhdtv_hybrid_init(core); in cx88_card_setup()
3498 if (0 == core->i2c_rc) { in cx88_card_setup()
3508 core->i2c_client.addr = 0x0a; in cx88_card_setup()
3511 if (2 != i2c_master_send(&core->i2c_client, in cx88_card_setup()
3513 warn_printk(core, "Unable to enable " in cx88_card_setup()
3532 call_all(core, tuner, s_config, &tea5767_cfg); in cx88_card_setup()
3558 if ((core->board.radio_type != UNSET)) { in cx88_card_setup()
3560 tun_setup.type = core->board.radio_type; in cx88_card_setup()
3561 tun_setup.addr = core->board.radio_addr; in cx88_card_setup()
3563 call_all(core, tuner, s_type_addr, &tun_setup); in cx88_card_setup()
3567 if (core->board.tuner_type != UNSET) { in cx88_card_setup()
3569 tun_setup.type = core->board.tuner_type; in cx88_card_setup()
3570 tun_setup.addr = core->board.tuner_addr; in cx88_card_setup()
3573 call_all(core, tuner, s_type_addr, &tun_setup); in cx88_card_setup()
3576 if (core->board.tda9887_conf) { in cx88_card_setup()
3580 tda9887_cfg.priv = &core->board.tda9887_conf; in cx88_card_setup()
3582 call_all(core, tuner, s_config, &tda9887_cfg); in cx88_card_setup()
3585 if (core->board.tuner_type == TUNER_XC2028) { in cx88_card_setup()
3590 cx88_setup_xc3028(core, &ctl); in cx88_card_setup()
3598 call_all(core, tuner, s_config, &xc2028_cfg); in cx88_card_setup()
3600 call_all(core, core, s_power, 0); in cx88_card_setup()
3658 int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci) in cx88_get_resources() argument
3662 core->name)) in cx88_get_resources()
3666 core->name, PCI_FUNC(pci->devfn), in cx88_get_resources()
3676 struct cx88_core *core; in cx88_core_create() local
3679 core = kzalloc(sizeof(*core), GFP_KERNEL); in cx88_core_create()
3680 if (core == NULL) in cx88_core_create()
3683 atomic_inc(&core->refcount); in cx88_core_create()
3684 core->pci_bus = pci->bus->number; in cx88_core_create()
3685 core->pci_slot = PCI_SLOT(pci->devfn); in cx88_core_create()
3686 core->pci_irqmask = PCI_INT_RISC_RD_BERRINT | PCI_INT_RISC_WR_BERRINT | in cx88_core_create()
3689 mutex_init(&core->lock); in cx88_core_create()
3691 core->nr = nr; in cx88_core_create()
3692 sprintf(core->name, "cx88[%d]", core->nr); in cx88_core_create()
3694 core->tvnorm = V4L2_STD_NTSC_M; in cx88_core_create()
3695 core->width = 320; in cx88_core_create()
3696 core->height = 240; in cx88_core_create()
3697 core->field = V4L2_FIELD_INTERLACED; in cx88_core_create()
3699 strcpy(core->v4l2_dev.name, core->name); in cx88_core_create()
3700 if (v4l2_device_register(NULL, &core->v4l2_dev)) { in cx88_core_create()
3701 kfree(core); in cx88_core_create()
3705 if (v4l2_ctrl_handler_init(&core->video_hdl, 13)) { in cx88_core_create()
3706 v4l2_device_unregister(&core->v4l2_dev); in cx88_core_create()
3707 kfree(core); in cx88_core_create()
3711 if (v4l2_ctrl_handler_init(&core->audio_hdl, 13)) { in cx88_core_create()
3712 v4l2_ctrl_handler_free(&core->video_hdl); in cx88_core_create()
3713 v4l2_device_unregister(&core->v4l2_dev); in cx88_core_create()
3714 kfree(core); in cx88_core_create()
3718 if (0 != cx88_get_resources(core, pci)) { in cx88_core_create()
3719 v4l2_ctrl_handler_free(&core->video_hdl); in cx88_core_create()
3720 v4l2_ctrl_handler_free(&core->audio_hdl); in cx88_core_create()
3721 v4l2_device_unregister(&core->v4l2_dev); in cx88_core_create()
3722 kfree(core); in cx88_core_create()
3727 cx88_pci_quirks(core->name, pci); in cx88_core_create()
3728 core->lmmio = ioremap(pci_resource_start(pci, 0), in cx88_core_create()
3730 core->bmmio = (u8 __iomem *)core->lmmio; in cx88_core_create()
3732 if (core->lmmio == NULL) { in cx88_core_create()
3735 v4l2_ctrl_handler_free(&core->video_hdl); in cx88_core_create()
3736 v4l2_ctrl_handler_free(&core->audio_hdl); in cx88_core_create()
3737 v4l2_device_unregister(&core->v4l2_dev); in cx88_core_create()
3738 kfree(core); in cx88_core_create()
3743 core->boardnr = UNSET; in cx88_core_create()
3744 if (card[core->nr] < ARRAY_SIZE(cx88_boards)) in cx88_core_create()
3745 core->boardnr = card[core->nr]; in cx88_core_create()
3746 for (i = 0; UNSET == core->boardnr && i < ARRAY_SIZE(cx88_subids); i++) in cx88_core_create()
3749 core->boardnr = cx88_subids[i].card; in cx88_core_create()
3750 if (UNSET == core->boardnr) { in cx88_core_create()
3751 core->boardnr = CX88_BOARD_UNKNOWN; in cx88_core_create()
3752 cx88_card_list(core, pci); in cx88_core_create()
3755 core->board = cx88_boards[core->boardnr]; in cx88_core_create()
3757 if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB)) in cx88_core_create()
3758 core->board.num_frontends = 1; in cx88_core_create()
3760 info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n", in cx88_core_create()
3761 pci->subsystem_vendor, pci->subsystem_device, core->board.name, in cx88_core_create()
3762 core->boardnr, card[core->nr] == core->boardnr ? in cx88_core_create()
3764 core->board.num_frontends); in cx88_core_create()
3766 if (tuner[core->nr] != UNSET) in cx88_core_create()
3767 core->board.tuner_type = tuner[core->nr]; in cx88_core_create()
3768 if (radio[core->nr] != UNSET) in cx88_core_create()
3769 core->board.radio_type = radio[core->nr]; in cx88_core_create()
3772 core->board.tuner_type, core->board.radio_type); in cx88_core_create()
3775 cx88_reset(core); in cx88_core_create()
3776 cx88_card_setup_pre_i2c(core); in cx88_core_create()
3777 cx88_i2c_init(core, pci); in cx88_core_create()
3780 if (UNSET != core->board.tuner_type) { in cx88_core_create()
3790 int has_demod = (core->board.tda9887_conf & TDA9887_PRESENT); in cx88_core_create()
3797 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, in cx88_core_create()
3800 v4l2_i2c_new_subdev(&core->v4l2_dev, in cx88_core_create()
3801 &core->i2c_adap, "tuner", in cx88_core_create()
3803 if (core->board.tuner_addr == ADDR_UNSET) { in cx88_core_create()
3804 v4l2_i2c_new_subdev(&core->v4l2_dev, in cx88_core_create()
3805 &core->i2c_adap, "tuner", in cx88_core_create()
3808 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, in cx88_core_create()
3809 "tuner", core->board.tuner_addr, NULL); in cx88_core_create()
3813 cx88_card_setup(core); in cx88_core_create()
3815 cx88_i2c_init_ir(core); in cx88_core_create()
3816 cx88_ir_init(core, pci); in cx88_core_create()
3819 return core; in cx88_core_create()