static int __init str8100_inthandler_init(void) { int ret; if(debug) printk("%s: \n",__FUNCTION__); #if 0 /* * Configure system Xtal clock to be output to CLKOUT pin */ HAL_PWRMGT_CONFIGURE_CLOCK_OUT_PIN(0, 0); #endif // HAL_MISC_ENABLE_ALL_SHARED_GPIO_PINS(); if(gpio){ if(debug) printk("%s: registering int handler for gpio int\n",__FUNCTION__);\ //gpio initialization depend on application #if 0 HAL_MISC_DISABLE_EXT_INT29_PINS(); HAL_MISC_DISABLE_EXT_INT30_PINS(); HAL_PWRMGT_ENABLE_GPIO_CLOCK(); PWRMGT_SOFTWARE_RESET_CONTROL_REG |= (0x1 << PWRMGT_GPIO_SOFTWARE_RESET_BIT_INDEX); PWRMGT_SOFTWARE_RESET_CONTROL_REG &= ~(0x1 << PWRMGT_GPIO_SOFTWARE_RESET_BIT_INDEX); PWRMGT_SOFTWARE_RESET_CONTROL_REG |= (0x1 << PWRMGT_GPIO_SOFTWARE_RESET_BIT_INDEX); HAL_GPIOA_SET_DIRECTION_INPUT(3); HAL_GPIOA_ENABLE_INTERRUPT(3); HAL_GPIOA_DISABLE_INTERRUPT_MASK(3); HAL_GPIOA_SET_INTERRUPT_EDGE_TRIGGER_MODE(3); #endif str8100_set_interrupt_trigger (INTC_GPIO_EXTERNAL_INT_BIT_INDEX,INTC_LEVEL_TRIGGER,INTC_ACTIVE_HIGH); if ((ret=request_irq(INTC_GPIO_EXTERNAL_INT_BIT_INDEX, str8100_gpio_irq_handler, 0, "testing", NULL))){ if(debug) printk("%s: request_irq failed(ret=0x%x)(-EBUSY=0x%x)\n",__FUNCTION__,ret,-EBUSY); return -EBUSY; } } #define register_ext_int(_i){\ if(debug) printk("%s: registering int handler for external int%d\n",__FUNCTION__,_i);\ HAL_MISC_ENABLE_EXT_INT##_i##_PINS();\ str8100_set_interrupt_trigger (INTC_EXT_INT##_i##_BIT_INDEX,INTC_LEVEL_TRIGGER,INTC_ACTIVE_LOW);\ if ((ret=request_irq(INTC_EXT_INT##_i##_BIT_INDEX, str8100_ext_irq_handler, 0, "testing", NULL))){\ if(debug) printk("%s: request_irq %d failed(ret=0x%x)(-EBUSY=0x%x)\n",__FUNCTION__,INTC_EXT_INT##_i##_BIT_INDEX,ret,-EBUSY);\ return -EBUSY;\ }\ } if(ext29) register_ext_int(29); if(ext30) register_ext_int(30); /* HAL_MISC_ENABLE_EXT_INT30_PINS(); str8100_set_interrupt_trigger (INTC_EXT_INT30_BIT_INDEX,INTC_IRQ_INTERRUPT,INTC_LEVEL_TRIGGER,INTC_ACTIVE_LOW); if ((ret=request_irq(INTC_EXT_INT30_BIT_INDEX, str8100_pm_irq_handler, 0, "testing", NULL))){ printk("%s: request_irq failed(ret=0x%x)(-EBUSY=0x%x)\n",__FUNCTION__,ret,-EBUSY); return -EBUSY; } */ return 0; }
static int __init str8100_inthandler_init(void) { int ret; printk("%s: \n",__FUNCTION__); if(mode==0) panic("%s: panic for testing...\n",__FUNCTION__); #define register_ext_int(_i){\ printk("%s: registering int handler for external int%d\n",__FUNCTION__,_i);\ HAL_MISC_ENABLE_EXT_INT##_i##_PINS();\ str8100_set_interrupt_trigger (INTC_EXT_INT##_i##_BIT_INDEX,INTC_LEVEL_TRIGGER,INTC_ACTIVE_LOW);\ if ((ret=request_irq(INTC_EXT_INT##_i##_BIT_INDEX, str8100_ext_irq_handler, 0, "testing", NULL))){\ printk("%s: request_irq %d failed(ret=0x%x)(-EBUSY=0x%x)\n",__FUNCTION__,INTC_EXT_INT##_i##_BIT_INDEX,ret,-EBUSY);\ return -EBUSY;\ }\ } register_ext_int(29); register_ext_int(30); return 0; }