static void omap_lpg_write(void *opaque, target_phys_addr_t addr,

                           uint64_t value, unsigned size)

{

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

    int offset = addr & OMAP_MPUI_REG_MASK;



    if (size != 1) {

        return omap_badwidth_write8(opaque, addr, value);

    }



    switch (offset) {

    case 0x00:	/* LCR */

        if (~value & (1 << 6))					/* LPGRES */

            omap_lpg_reset(s);

        s->control = value & 0xff;

        omap_lpg_update(s);

        return;



    case 0x04:	/* PMR */

        s->power = value & 0x01;

        omap_lpg_update(s);

        return;



    default:

        OMAP_BAD_REG(addr);

        return;

    }

}

static void omap_lpg_write(void *opaque, target_phys_addr_t addr,

                           uint64_t value, unsigned size)

{

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

    int offset = addr & OMAP_MPUI_REG_MASK;



    if (size != 1) {

        return omap_badwidth_write8(opaque, addr, value);

    }



    switch (offset) {

    case 0x00:	

        if (~value & (1 << 6))					

            omap_lpg_reset(s);

        s->control = value & 0xff;

        omap_lpg_update(s);

        return;



    case 0x04:	

        s->power = value & 0x01;

        omap_lpg_update(s);

        return;



    default:

        OMAP_BAD_REG(addr);

        return;

    }

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,

                           uint64_t VAR_2, unsigned VAR_3)

{

    struct omap_lpg_s *VAR_4 = (struct omap_lpg_s *) VAR_0;

    int VAR_5 = VAR_1 & OMAP_MPUI_REG_MASK;



    if (VAR_3 != 1) {

        return omap_badwidth_write8(VAR_0, VAR_1, VAR_2);

    }



    switch (VAR_5) {

    case 0x00:	

        if (~VAR_2 & (1 << 6))					

            omap_lpg_reset(VAR_4);

        VAR_4->control = VAR_2 & 0xff;

        omap_lpg_update(VAR_4);

        return;



    case 0x04:	

        VAR_4->power = VAR_2 & 0x01;

        omap_lpg_update(VAR_4);

        return;



    default:

        OMAP_BAD_REG(VAR_1);

        return;

    }

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,
uint64_t VAR_2, unsigned VAR_3)
{ struct omap_lpg_s *VAR_4 = (struct omap_lpg_s *) VAR_0; int VAR_5 = VAR_1 & OMAP_MPUI_REG_MASK; if (VAR_3 != 1) { return omap_badwidth_write8(VAR_0, VAR_1, VAR_2); } switch (VAR_5) { case 0x00:
if (~VAR_2 & (1 << 6))
omap_lpg_reset(VAR_4); VAR_4->control = VAR_2 & 0xff; omap_lpg_update(VAR_4); return; case 0x04:
VAR_4->power = VAR_2 & 0x01; omap_lpg_update(VAR_4); return; default:
OMAP_BAD_REG(VAR_1); return; } }