Exemplo n.º 1
0
int __init pbXX_simple_config_init(void)
{
#if AR7100_JUMPSTART_SWITCH_WORKS
#ifdef CONFIG_CUS100
	u32 mask = 0;
#endif
    int req;

#ifdef CONFIG_CUS100
	mask = ar7100_reg_rd(AR7100_MISC_INT_MASK);
	ar7100_reg_wr(AR7100_MISC_INT_MASK, mask | (1 << 2)); /* Enable GPIO interrupt mask */
    ar7100_gpio_config_int (JUMPSTART_GPIO, INT_TYPE_LEVEL,INT_POL_ACTIVE_HIGH);
	ar7100_gpio_intr_enable(JUMPSTART_GPIO);
	ar7100_gpio_config_input(JUMPSTART_GPIO);
#else
    /* configure GPIO 3 as level triggered interrupt */ 
    ar7100_gpio_config_int (JUMPSTART_GPIO, INT_TYPE_LEVEL,INT_POL_ACTIVE_HIGH);
	printk("%s (%s) JUMPSTART_GPIO: %d\n", __FILE__, __func__, JUMPSTART_GPIO);
#endif

    req = request_irq (AR7100_GPIO_IRQn(JUMPSTART_GPIO), jumpstart_irq, 0,
                       "SW JUMPSTART", NULL);
    if (req != 0) {
        printk (KERN_ERR "unable to request IRQ for SWJUMPSTART GPIO (error %d)\n", req);
    }

    create_simple_config_led_proc_entry ();
#endif // AR7100_JUMPSTART_SWITCH_WORKS
    return 0;
}
Exemplo n.º 2
0
int __init ar7100_factory_reset_init(void)
{
#ifdef CONFIG_CUS100
	u32 mask = 0;
#endif
    int req, ret;
    ret = misc_register(&ar7100fr_miscdev);

    if (ret < 0) {
            printk("*** ar7100 misc_register failed %d *** \n", ret);
            return -1;
    }
#ifdef CONFIG_CUS100
	mask = ar7100_reg_rd(ar7100_MISC_INT_MASK);
	ar7100_reg_wr(ar7100_MISC_INT_MASK, mask | (1 << 2)); /* Enable GPIO interrupt mask */
    ar7100_gpio_config_int (FACTORY_RESET_GPIO, INT_TYPE_LEVEL,INT_POL_ACTIVE_HIGH);
	ar7100_gpio_intr_enable(FACTORY_RESET_GPIO);
	ar7100_gpio_config_input(FACTORY_RESET_GPIO);
#else
	ar7100_gpio_config_int (FACTORY_RESET_GPIO, INT_TYPE_LEVEL,INT_POL_ACTIVE_HIGH);
#endif
	req = request_irq (AR7100_GPIO_IRQn(FACTORY_RESET_GPIO), factory_reset_irq, 0,
                       "FACTORY RESET", NULL);
    if (req != 0) {
        printk (KERN_ERR "unable to request IRQ for FACTORY_RESET GPIO (error %d)\n", req);
        misc_deregister(&ar7100fr_miscdev);
        ar7100_gpio_intr_shutdown(AR7100_GPIO_IRQn(FACTORY_RESET_GPIO));
        return -1;
    }

	init_waitqueue_head(&ar7100_fr_wq);
    return 0;
}
Exemplo n.º 3
0
static void
ar7100_gpio_intr_end(unsigned int irq)
{
	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
		ar7100_gpio_intr_enable(irq);
}
Exemplo n.º 4
0
static unsigned int
ar7100_gpio_intr_startup(unsigned int irq)
{
	ar7100_gpio_intr_enable(irq);
	return 0;
}