/*
 * I/O routines
 */  
static void gpio_init_cs8900(void)
{
#ifdef CONFIG_SOC_JZ4740
	__gpio_as_func0(60);             //CS4# 
	__gpio_as_func0(61);             //RD#
	__gpio_as_func0(62);             //WR# 
	__gpio_as_irq_high_level(59);    //irq
	__gpio_disable_pull(59);         //disable pull
	REG_EMC_SMCR4 |= (1 << 6);       //16bit
#elif CONFIG_SOC_JZ4750
	__gpio_as_func0(32*2+23);             //CS3#
	__gpio_as_func0(32*2+25);             //RD# 
	__gpio_as_func0(32*2+26);             //WR# 

#ifdef CONFIG_JZ4750_FUWA
	__gpio_as_irq_high_level(32*4+20);    //irq
	__gpio_disable_pull(32*4+20);         //disable pull
#else
	__gpio_as_irq_high_level(32*2 +6);    //irq
	__gpio_disable_pull(32*2 +6);         //disable pull
#endif

	REG_EMC_SMCR3 |= (1 << 6);            //16bit
#endif
	udelay(1);
}
Exemple #2
0
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 */
}
Exemple #3
0
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);
}
Exemple #4
0
void gpio_init_cs8900(void)
{
	__gpio_as_func0(60);             //cs4 
	__gpio_as_func0(61);             //cs4 
	__gpio_as_func0(62);             //cs4 
	__gpio_as_irq_high_level(59);    //irq
	__gpio_disable_pull(59);         //disable pull
	REG_EMC_SMCR4 |= (1 << 6);       //16bit
}
void gpio_init_cs8900(void)
{
#ifdef CONFIG_JzRISC
	__gpio_as_func0(60);             //cs4 
	__gpio_as_func0(61);             //cs4 
	__gpio_as_func0(62);             //cs4 
	__gpio_as_irq_high_level(59);    //irq
	__gpio_disable_pull(59);         //disable pull
	REG_EMC_SMCR4 |= (1 << 6);       //16bit
#endif /* CONFIG_JzRISC */
}
Exemple #6
0
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;
}