static void pxa2xx_pm_write(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

    struct pxa2xx_state_s *s = (struct pxa2xx_state_s *) opaque;

    if (addr > s->pm_base + PCMD31) {

        /* Special case: PWRI2C registers appear in the same range.  */

        pxa2xx_i2c_write(s->i2c[1], addr, value);

        return;

    }

    addr -= s->pm_base;



    switch (addr) {

    case PMCR:

        s->pm_regs[addr >> 2] &= 0x15 & ~(value & 0x2a);

        s->pm_regs[addr >> 2] |= value & 0x15;

        break;



    case PSSR:	/* Read-clean registers */

    case RCSR:

    case PKSR:

        s->pm_regs[addr >> 2] &= ~value;

        break;



    default:	/* Read-write registers */

        if (addr >= PMCR && addr <= PCMD31 && !(addr & 3)) {

            s->pm_regs[addr >> 2] = value;

            break;

        }



        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);

        break;

    }

}

static void pxa2xx_pm_write(void *opaque, target_phys_addr_t addr,

                uint32_t value)

{

    struct pxa2xx_state_s *s = (struct pxa2xx_state_s *) opaque;

    if (addr > s->pm_base + PCMD31) {

        

        pxa2xx_i2c_write(s->i2c[1], addr, value);

        return;

    }

    addr -= s->pm_base;



    switch (addr) {

    case PMCR:

        s->pm_regs[addr >> 2] &= 0x15 & ~(value & 0x2a);

        s->pm_regs[addr >> 2] |= value & 0x15;

        break;



    case PSSR:	

    case RCSR:

    case PKSR:

        s->pm_regs[addr >> 2] &= ~value;

        break;



    default:	

        if (addr >= PMCR && addr <= PCMD31 && !(addr & 3)) {

            s->pm_regs[addr >> 2] = value;

            break;

        }



        printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr);

        break;

    }

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,

                uint32_t VAR_2)

{

    struct pxa2xx_state_s *VAR_3 = (struct pxa2xx_state_s *) VAR_0;

    if (VAR_1 > VAR_3->pm_base + PCMD31) {

        

        pxa2xx_i2c_write(VAR_3->i2c[1], VAR_1, VAR_2);

        return;

    }

    VAR_1 -= VAR_3->pm_base;



    switch (VAR_1) {

    case PMCR:

        VAR_3->pm_regs[VAR_1 >> 2] &= 0x15 & ~(VAR_2 & 0x2a);

        VAR_3->pm_regs[VAR_1 >> 2] |= VAR_2 & 0x15;

        break;



    case PSSR:	

    case RCSR:

    case PKSR:

        VAR_3->pm_regs[VAR_1 >> 2] &= ~VAR_2;

        break;



    default:	

        if (VAR_1 >= PMCR && VAR_1 <= PCMD31 && !(VAR_1 & 3)) {

            VAR_3->pm_regs[VAR_1 >> 2] = VAR_2;

            break;

        }



        printf("%VAR_3: Bad register " REG_FMT "\n", __FUNCTION__, VAR_1);

        break;

    }

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,
uint32_t VAR_2)
{ struct pxa2xx_state_s *VAR_3 = (struct pxa2xx_state_s *) VAR_0; if (VAR_1 > VAR_3->pm_base + PCMD31) { pxa2xx_i2c_write(VAR_3->i2c[1], VAR_1, VAR_2); return; } VAR_1 -= VAR_3->pm_base; switch (VAR_1) { case PMCR:
VAR_3->pm_regs[VAR_1 >> 2] &= 0x15 & ~(VAR_2 & 0x2a); VAR_3->pm_regs[VAR_1 >> 2] |= VAR_2 & 0x15; break; case PSSR:
case RCSR:
case PKSR:
VAR_3->pm_regs[VAR_1 >> 2] &= ~VAR_2; break; default:
if (VAR_1 >= PMCR && VAR_1 <= PCMD31 && !(VAR_1 & 3)) { VAR_3->pm_regs[VAR_1 >> 2] = VAR_2; break; } printf("%VAR_3: Bad register " REG_FMT "\n", __FUNCTION__, VAR_1); break; } }