static void avia_gt_vbi_irq(u16 irq) { u8 tt_error = 0; u8 tt_pts = 0; if (avia_gt_chip(ENX)) { tt_error = enx_reg_s(TSTATUS)->E; tt_pts = enx_reg_s(TSTATUS)->R; } else if (avia_gt_chip(GTX)) { tt_error = gtx_reg_s(TSTATUS)->E; tt_pts = gtx_reg_s(TSTATUS)->R; } avia_gt_reg_set(TSTATUS, E, 0); avia_gt_reg_set(TSTATUS, R, 0); if (tt_error) { printk(KERN_INFO "avia_gt_vbi: error in TS stream\n"); avia_gt_vbi_stop(); avia_gt_vbi_start(); } if (tt_pts) printk(KERN_INFO "avia_gt_vbi: got pts\n"); }
int __init avia_gt_init(void) { struct dbox_info_struct *dbox_info = (struct dbox_info_struct *)NULL; int result = (int)0; printk("avia_gt_core: $Id: avia_gt_core.c,v 1.23 2002/10/05 15:01:12 Jolt Exp $\n"); if (chip_type == -1) { printk("avia_gt_core: autodetecting chip type... "); dbox_get_info_ptr(&dbox_info); if (dbox_info->enxID != -1) { chip_type = AVIA_GT_CHIP_TYPE_ENX; printk("AViA eNX found\n"); } else if (dbox_info->gtxID != -1) { chip_type = AVIA_GT_CHIP_TYPE_GTX; printk("AViA GTX found\n"); } else { printk("no supported chip type found\n"); } } if ((chip_type != AVIA_GT_CHIP_TYPE_ENX) && (chip_type != AVIA_GT_CHIP_TYPE_GTX)) { printk("avia_gt_core: Unsupported chip type (gt_info->chip_type = %d)\n", gt_info->chip_type); return -EIO; } memset(gt_isr_proc_list, 0, sizeof(gt_isr_proc_list)); gt_info = kmalloc(sizeof(gt_info), GFP_KERNEL); if (!gt_info) { printk(KERN_ERR "avia_gt_core: Could not allocate info memory!\n"); avia_gt_exit(); return -1; } gt_info->chip_type = chip_type; init_state = 1; if (avia_gt_chip(ENX)) gt_info->reg_addr = (unsigned char *)ioremap(ENX_REG_BASE, ENX_REG_SIZE); else if (avia_gt_chip(GTX)) gt_info->reg_addr = (unsigned char *)ioremap(GTX_REG_BASE, GTX_REG_SIZE); if (!gt_info->reg_addr) { printk(KERN_ERR "avia_gt_core: Failed to remap register space.\n"); return -1; } init_state = 2; if (avia_gt_chip(ENX)) gt_info->mem_addr = (unsigned char*)ioremap(ENX_MEM_BASE, ENX_MEM_SIZE); else if (avia_gt_chip(GTX)) gt_info->mem_addr = (unsigned char*)ioremap(GTX_MEM_BASE, GTX_MEM_SIZE); if (!gt_info->mem_addr) { printk(KERN_ERR "avia_gt_core: Failed to remap memory space.\n"); avia_gt_exit(); return -1; } init_state = 3; if (avia_gt_chip(ENX)) result = request_8xxirq(ENX_INTERRUPT, avia_gt_irq_handler, 0, "avia_gt", 0); else if (avia_gt_chip(GTX)) result = request_8xxirq(GTX_INTERRUPT, avia_gt_irq_handler, 0, "avia_gt", 0); if (result) { printk(KERN_ERR "avia_gt_core: Could not allocate IRQ!\n"); avia_gt_exit(); return -1; } init_state = 4; if (avia_gt_chip(ENX)) avia_gt_enx_init(); else if (avia_gt_chip(GTX)) avia_gt_gtx_init(); init_state = 5; #if (!defined(MODULE)) || (defined(MODULE) && !defined(STANDALONE)) if (avia_gt_accel_init()) { avia_gt_exit(); return -1; } init_state = 6; if (avia_gt_dmx_init()) { avia_gt_exit(); return -1; } init_state = 7; if (avia_gt_gv_init()) { avia_gt_exit(); return -1; } init_state = 8; if (avia_gt_pcm_init()) { avia_gt_exit(); return -1; } init_state = 9; if (avia_gt_capture_init()) { avia_gt_exit(); return -1; } init_state = 10; if (avia_gt_pig_init()) { avia_gt_exit(); return -1; } init_state = 11; if (avia_gt_ir_init()) { avia_gt_exit(); return -1; } init_state = 12; if (avia_gt_vbi_init()) { avia_gt_exit(); return -1; } avia_gt_vbi_start(); init_state = 13; #endif printk(KERN_NOTICE "avia_gt_core: Loaded AViA eNX/GTX driver\n"); return 0; }