summaryrefslogtreecommitdiffstats
path: root/hw/tosa.c
diff options
context:
space:
mode:
authorAnthony Liguori2011-12-05 03:39:20 +0100
committerAnthony Liguori2012-01-27 17:50:47 +0100
commitb5ea932781954355a9880e2744722cd05cc496f9 (patch)
treef47482844578c1dffdae93dc3ec103a101097a71 /hw/tosa.c
parenti2c: rename i2c_slave -> I2CSlave (diff)
downloadqemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.gz
qemu-b5ea932781954355a9880e2744722cd05cc496f9.tar.xz
qemu-b5ea932781954355a9880e2744722cd05cc496f9.zip
i2c: smbus: convert to QEMU Object Model
This converts two types because smbus is implemented as a subclass of i2c. It's extremely difficult to convert these two independently. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/tosa.c')
-rw-r--r--hw/tosa.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/hw/tosa.c b/hw/tosa.c
index 5f4968de24..9f112b1349 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -259,13 +259,20 @@ static void tosapda_machine_init(void)
machine_init(tosapda_machine_init);
-static I2CSlaveInfo tosa_dac_info = {
- .qdev.name = "tosa_dac",
- .qdev.size = sizeof(TosaDACState),
- .init = tosa_dac_init,
- .event = tosa_dac_event,
- .recv = tosa_dac_recv,
- .send = tosa_dac_send
+static void tosa_dac_class_init(ObjectClass *klass, void *data)
+{
+ I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
+
+ k->init = tosa_dac_init;
+ k->event = tosa_dac_event;
+ k->recv = tosa_dac_recv;
+ k->send = tosa_dac_send;
+}
+
+static DeviceInfo tosa_dac_info = {
+ .name = "tosa_dac",
+ .size = sizeof(TosaDACState),
+ .class_init = tosa_dac_class_init,
};
static void tosa_ssp_class_init(ObjectClass *klass, void *data)