summaryrefslogtreecommitdiffstats
path: root/hw/pxa2xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pxa2xx.c')
-rw-r--r--hw/pxa2xx.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index fbc397f..244c614 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -1235,17 +1235,19 @@ static const VMStateDescription vmstate_pxa2xx_rtc_regs = {
static void pxa2xx_rtc_sysbus_class_init(ObjectClass *klass, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
k->init = pxa2xx_rtc_init;
+ dc->desc = "PXA2xx RTC Controller";
+ dc->vmsd = &vmstate_pxa2xx_rtc_regs;
}
-static DeviceInfo pxa2xx_rtc_sysbus_info = {
- .name = "pxa2xx_rtc",
- .desc = "PXA2xx RTC Controller",
- .size = sizeof(PXA2xxRTCState),
- .vmsd = &vmstate_pxa2xx_rtc_regs,
- .class_init = pxa2xx_rtc_sysbus_class_init,
+static TypeInfo pxa2xx_rtc_sysbus_info = {
+ .name = "pxa2xx_rtc",
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(PXA2xxRTCState),
+ .class_init = pxa2xx_rtc_sysbus_class_init,
};
/* I2C Interface */
@@ -1489,10 +1491,11 @@ static void pxa2xx_i2c_slave_class_init(ObjectClass *klass, void *data)
k->send = pxa2xx_i2c_tx;
}
-static DeviceInfo pxa2xx_i2c_slave_info = {
- .name = "pxa2xx-i2c-slave",
- .size = sizeof(PXA2xxI2CSlaveState),
- .class_init = pxa2xx_i2c_slave_class_init,
+static TypeInfo pxa2xx_i2c_slave_info = {
+ .name = "pxa2xx-i2c-slave",
+ .parent = TYPE_I2C_SLAVE,
+ .instance_size = sizeof(PXA2xxI2CSlaveState),
+ .class_init = pxa2xx_i2c_slave_class_init,
};
PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
@@ -1548,18 +1551,20 @@ static Property pxa2xx_i2c_properties[] = {
static void pxa2xx_i2c_class_init(ObjectClass *klass, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
k->init = pxa2xx_i2c_initfn;
+ dc->desc = "PXA2xx I2C Bus Controller";
+ dc->vmsd = &vmstate_pxa2xx_i2c;
+ dc->props = pxa2xx_i2c_properties;
}
-static DeviceInfo pxa2xx_i2c_info = {
- .name = "pxa2xx_i2c",
- .desc = "PXA2xx I2C Bus Controller",
- .size = sizeof(PXA2xxI2CState),
- .vmsd = &vmstate_pxa2xx_i2c,
- .props = pxa2xx_i2c_properties,
- .class_init = pxa2xx_i2c_class_init,
+static TypeInfo pxa2xx_i2c_info = {
+ .name = "pxa2xx_i2c",
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(PXA2xxI2CState),
+ .class_init = pxa2xx_i2c_class_init,
};
/* PXA Inter-IC Sound Controller */
@@ -2318,18 +2323,19 @@ static void pxa2xx_ssp_class_init(ObjectClass *klass, void *data)
sdc->init = pxa2xx_ssp_init;
}
-static DeviceInfo pxa2xx_ssp_info = {
- .name = "pxa2xx-ssp",
- .size = sizeof(PXA2xxSSPState),
- .class_init = pxa2xx_ssp_class_init,
+static TypeInfo pxa2xx_ssp_info = {
+ .name = "pxa2xx-ssp",
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(PXA2xxSSPState),
+ .class_init = pxa2xx_ssp_class_init,
};
static void pxa2xx_register_devices(void)
{
- i2c_register_slave(&pxa2xx_i2c_slave_info);
- sysbus_qdev_register(&pxa2xx_ssp_info);
- sysbus_register_withprop(&pxa2xx_i2c_info);
- sysbus_register_withprop(&pxa2xx_rtc_sysbus_info);
+ type_register_static(&pxa2xx_i2c_slave_info);
+ type_register_static(&pxa2xx_ssp_info);
+ type_register_static(&pxa2xx_i2c_info);
+ type_register_static(&pxa2xx_rtc_sysbus_info);
}
device_init(pxa2xx_register_devices)
OpenPOWER on IntegriCloud