static void pxa2xx_gpio_write(void *opaque, hwaddr offset,

                              uint64_t value, unsigned size)

{

    PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) opaque;

    int bank;

    if (offset >= 0x200)

        return;



    bank = pxa2xx_gpio_regs[offset].bank;

    switch (pxa2xx_gpio_regs[offset].reg) {

    case GPDR:		/* GPIO Pin-Direction registers */

        s->dir[bank] = value;

        pxa2xx_gpio_handler_update(s);

        break;



    case GPSR:		/* GPIO Pin-Output Set registers */

        s->olevel[bank] |= value;

        pxa2xx_gpio_handler_update(s);

        s->gpsr[bank] = value;

        break;



    case GPCR:		/* GPIO Pin-Output Clear registers */

        s->olevel[bank] &= ~value;

        pxa2xx_gpio_handler_update(s);

        break;



    case GRER:		/* GPIO Rising-Edge Detect Enable registers */

        s->rising[bank] = value;

        break;



    case GFER:		/* GPIO Falling-Edge Detect Enable registers */

        s->falling[bank] = value;

        break;



    case GAFR_L:	/* GPIO Alternate Function registers */

        s->gafr[bank * 2] = value;

        break;



    case GAFR_U:	/* GPIO Alternate Function registers */

        s->gafr[bank * 2 + 1] = value;

        break;



    case GEDR:		/* GPIO Edge Detect Status registers */

        s->status[bank] &= ~value;

        pxa2xx_gpio_irq_update(s);

        break;



    default:

        hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset);

    }

}

static void pxa2xx_gpio_write(void *opaque, hwaddr offset,

                              uint64_t value, unsigned size)

{

    PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) opaque;

    int bank;

    if (offset >= 0x200)

        return;



    bank = pxa2xx_gpio_regs[offset].bank;

    switch (pxa2xx_gpio_regs[offset].reg) {

    case GPDR:		

        s->dir[bank] = value;

        pxa2xx_gpio_handler_update(s);

        break;



    case GPSR:		

        s->olevel[bank] |= value;

        pxa2xx_gpio_handler_update(s);

        s->gpsr[bank] = value;

        break;



    case GPCR:		

        s->olevel[bank] &= ~value;

        pxa2xx_gpio_handler_update(s);

        break;



    case GRER:		

        s->rising[bank] = value;

        break;



    case GFER:		

        s->falling[bank] = value;

        break;



    case GAFR_L:	

        s->gafr[bank * 2] = value;

        break;



    case GAFR_U:	

        s->gafr[bank * 2 + 1] = value;

        break;



    case GEDR:		

        s->status[bank] &= ~value;

        pxa2xx_gpio_irq_update(s);

        break;



    default:

        hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset);

    }

}

        s->gpsr[bank] = value;
static void FUNC_0(void *VAR_0, hwaddr VAR_1,

                              uint64_t VAR_2, unsigned VAR_3)

{

    PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) VAR_0;

    int VAR_4;

    if (VAR_1 >= 0x200)

        return;



    VAR_4 = pxa2xx_gpio_regs[VAR_1].VAR_4;

    switch (pxa2xx_gpio_regs[VAR_1].reg) {

    case GPDR:		

        s->dir[VAR_4] = VAR_2;

        pxa2xx_gpio_handler_update(s);

        break;



    case GPSR:		

        s->olevel[VAR_4] |= VAR_2;

        pxa2xx_gpio_handler_update(s);

        s->gpsr[VAR_4] = VAR_2;

        break;



    case GPCR:		

        s->olevel[VAR_4] &= ~VAR_2;

        pxa2xx_gpio_handler_update(s);

        break;



    case GRER:		

        s->rising[VAR_4] = VAR_2;

        break;



    case GFER:		

        s->falling[VAR_4] = VAR_2;

        break;



    case GAFR_L:	

        s->gafr[VAR_4 * 2] = VAR_2;

        break;



    case GAFR_U:	

        s->gafr[VAR_4 * 2 + 1] = VAR_2;

        break;



    case GEDR:		

        s->status[VAR_4] &= ~VAR_2;

        pxa2xx_gpio_irq_update(s);

        break;



    default:

        hw_error("%s: Bad VAR_1 " REG_FMT "\n", __FUNCTION__, VAR_1);

    }

}

static void FUNC_0(void *VAR_0, hwaddr VAR_1,
uint64_t VAR_2, unsigned VAR_3)
{ PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) VAR_0; int VAR_4; if (VAR_1 >= 0x200)
return; VAR_4 = pxa2xx_gpio_regs[VAR_1].VAR_4; switch (pxa2xx_gpio_regs[VAR_1].reg) { case GPDR:
s->dir[VAR_4] = VAR_2; pxa2xx_gpio_handler_update(s); break; case GPSR:
s->olevel[VAR_4] |= VAR_2; pxa2xx_gpio_handler_update(s); s->gpsr[VAR_4] = VAR_2; break; case GPCR:
s->olevel[VAR_4] &= ~VAR_2; pxa2xx_gpio_handler_update(s); break; case GRER:
s->rising[VAR_4] = VAR_2; break; case GFER:
s->falling[VAR_4] = VAR_2; break; case GAFR_L:
s->gafr[VAR_4 * 2] = VAR_2; break; case GAFR_U:
s->gafr[VAR_4 * 2 + 1] = VAR_2; break; case GEDR:
s->status[VAR_4] &= ~VAR_2; pxa2xx_gpio_irq_update(s); break; default:
hw_error("%s: Bad VAR_1 " REG_FMT "\n", __FUNCTION__, VAR_1); } }