mirror of https://github.com/xemu-project/xemu.git
hw/i2c/omap_i2c.c: Don't use old_mmio
Don't use old_mmio in the memory region ops struct. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 1505580378-9044-6-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
13dfde3320
commit
28dc207f5f
|
@ -430,19 +430,39 @@ static void omap_i2c_writeb(void *opaque, hwaddr addr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint64_t omap_i2c_readfn(void *opaque, hwaddr addr,
|
||||||
|
unsigned size)
|
||||||
|
{
|
||||||
|
switch (size) {
|
||||||
|
case 2:
|
||||||
|
return omap_i2c_read(opaque, addr);
|
||||||
|
default:
|
||||||
|
return omap_badwidth_read16(opaque, addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void omap_i2c_writefn(void *opaque, hwaddr addr,
|
||||||
|
uint64_t value, unsigned size)
|
||||||
|
{
|
||||||
|
switch (size) {
|
||||||
|
case 1:
|
||||||
|
/* Only the last fifo write can be 8 bit. */
|
||||||
|
omap_i2c_writeb(opaque, addr, value);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
omap_i2c_write(opaque, addr, value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
omap_badwidth_write16(opaque, addr, value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const MemoryRegionOps omap_i2c_ops = {
|
static const MemoryRegionOps omap_i2c_ops = {
|
||||||
.old_mmio = {
|
.read = omap_i2c_readfn,
|
||||||
.read = {
|
.write = omap_i2c_writefn,
|
||||||
omap_badwidth_read16,
|
.valid.min_access_size = 1,
|
||||||
omap_i2c_read,
|
.valid.max_access_size = 4,
|
||||||
omap_badwidth_read16,
|
|
||||||
},
|
|
||||||
.write = {
|
|
||||||
omap_i2c_writeb, /* Only the last fifo write can be 8 bit. */
|
|
||||||
omap_i2c_write,
|
|
||||||
omap_badwidth_write16,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue