All pastes #179793 Raw Edit

Someone

public c v1 · immutable
#179793 ·published 2006-09-22 14:46 UTC
rendered paste body
#ifdef  CONFIG_PMstatic irqreturn_tosk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs){        return IRQ_HANDLED;}#endifstatic void __init osk_mistral_init(void){        /* NOTE:  we could actually tell if there's a Mistral board         * attached, e.g. by trying to read something from the ads7846.         * But this arch_init() code is too early for that, since we         * can't talk to the ads or even the i2c eeprom.         */         // omap_cfg_reg(P19_1610_GPIO6);        // BUSY        omap_cfg_reg(P20_1610_GPIO4);   // PENIRQ        set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);        spi_register_board_info(mistral_boardinfo,                        ARRAY_SIZE(mistral_boardinfo));         /* the sideways button (SW1) is for use as a "wakeup" button */        omap_cfg_reg(N15_1610_MPUIO2);        if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {                int ret = 0;                omap_set_gpio_direction(OMAP_MPUIO(2), 1);                set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING);#ifdef  CONFIG_PM                /* share the IRQ in case someone wants to use the                 * button for more than wakeup from system sleep.                 */                ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),                                &osk_mistral_wake_interrupt,                                IRQF_SHARED, "mistral_wakeup",                                &osk_mistral_wake_interrupt);                if (ret != 0) {                        omap_free_gpio(OMAP_MPUIO(2));                        printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",                                ret);                } else                        enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2)));#endif        } else                printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");         platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));}