static void cetus_tf_plug_change(int state) { if(state == CARD_INSERTED) __gpio_as_irq_low_level(MSC1_HOTPLUG_PIN); else __gpio_as_irq_high_level(MSC1_HOTPLUG_PIN); }
static void cetus_sd_plug_change(int state) { if(state == CARD_INSERTED) __gpio_as_irq_high_level(MSC0_HOTPLUG_PIN); /* wait remove */ else __gpio_as_irq_low_level(MSC0_HOTPLUG_PIN); /* wait insert */ }
int oem_gpio_set_irq_type(int gpio, unsigned int type) { if(type == IRQ_TYPE_EDGE_BOTH){ if(read_gpio_pin(gpio)){ type = IRQ_TYPE_EDGE_FALLING; }else{ type = IRQ_TYPE_EDGE_RISING; } } if(type == IRQ_TYPE_LEVEL_MASK){ if(read_gpio_pin(gpio)){ type = IRQ_TYPE_LEVEL_LOW; }else{ type = IRQ_TYPE_LEVEL_HIGH; } } switch(type){ case IRQ_TYPE_EDGE_RISING: __gpio_as_irq_rise_edge(gpio); break; case IRQ_TYPE_EDGE_FALLING: __gpio_as_irq_fall_edge(gpio); break; case IRQ_TYPE_LEVEL_HIGH: __gpio_as_irq_high_level(gpio); break; case IRQ_TYPE_LEVEL_LOW: __gpio_as_irq_low_level(gpio); break; default: return -EINVAL; } return 0; }