[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-next for-1.6 19/29] spitz: QOM'ify SpitzKeyboard
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-next for-1.6 19/29] spitz: QOM'ify SpitzKeyboardState |
Date: |
Wed, 24 Jul 2013 09:48:14 +0200 |
Signed-off-by: Andreas Färber <address@hidden>
---
hw/arm/spitz.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 0bf5c5c..70f23b3 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -215,8 +215,13 @@ static const int spitz_gpiomap[5] = {
SPITZ_GPIO_SWA, SPITZ_GPIO_SWB,
};
+#define TYPE_SPITZ_KEYBOARD "spitz-keyboard"
+#define SPITZ_KEYBOARD(obj) \
+ OBJECT_CHECK(SpitzKeyboardState, (obj), TYPE_SPITZ_KEYBOARD)
+
typedef struct {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
qemu_irq sense[SPITZ_KEY_SENSE_NUM];
qemu_irq gpiomap[5];
int keymap[0x80];
@@ -461,8 +466,8 @@ static void spitz_keyboard_register(PXA2xxState *cpu)
DeviceState *dev;
SpitzKeyboardState *s;
- dev = sysbus_create_simple("spitz-keyboard", -1, NULL);
- s = FROM_SYSBUS(SpitzKeyboardState, SYS_BUS_DEVICE(dev));
+ dev = sysbus_create_simple(TYPE_SPITZ_KEYBOARD, -1, NULL);
+ s = SPITZ_KEYBOARD(dev);
for (i = 0; i < SPITZ_KEY_SENSE_NUM; i ++)
qdev_connect_gpio_out(dev, i, qdev_get_gpio_in(cpu->gpio,
spitz_gpio_key_sense[i]));
@@ -487,11 +492,9 @@ static void spitz_keyboard_register(PXA2xxState *cpu)
static int spitz_keyboard_init(SysBusDevice *dev)
{
- SpitzKeyboardState *s;
+ SpitzKeyboardState *s = SPITZ_KEYBOARD(dev);
int i, j;
- s = FROM_SYSBUS(SpitzKeyboardState, dev);
-
for (i = 0; i < 0x80; i ++)
s->keymap[i] = -1;
for (i = 0; i < SPITZ_KEY_SENSE_NUM + 1; i ++)
@@ -1065,7 +1068,7 @@ static void spitz_keyboard_class_init(ObjectClass *klass,
void *data)
}
static const TypeInfo spitz_keyboard_info = {
- .name = "spitz-keyboard",
+ .name = TYPE_SPITZ_KEYBOARD,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(SpitzKeyboardState),
.class_init = spitz_keyboard_class_init,
--
1.8.1.4
- [Qemu-devel] [PATCH qom-next for-1.6 10/29] musicpal: QOM'ify mv88w8618_flashcfg, (continued)
- [Qemu-devel] [PATCH qom-next for-1.6 10/29] musicpal: QOM'ify mv88w8618_flashcfg, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 12/29] musicpal: QOM'ify musicpal_key_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 11/29] musicpal: QOM'ify musicpal_gpio_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 13/29] pxa2xx: QOM'ify PXA2xxSSPState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 14/29] pxa2xx: QOM'ify PXA2xxRTCState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 15/29] pxa2xx: QOM'ify PXA2xxI2CState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 16/29] pxa2xx_gpio: QOM'ify PXA2xxGPIOInfo, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 18/29] spitz: QOM'ify SLNANDState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 17/29] pxa2xx_pic: QOM'ify PXA2xxPICState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 19/29] spitz: QOM'ify SpitzKeyboardState,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-next for-1.6 20/29] stellaris: QOM'ify gptm_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 22/29] stellaris: QOM'ify stellaris_adc_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 23/29] strongarm: QOM'ify StrongARMPICState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 24/29] strongarm: QOM'ify StrongARMRTCState, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 21/29] stellaris: QOM'ify stellaris_i2c_state, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 25/29] strongarm: QOM'ify StrongARMGPIOInfo, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 26/29] strongarm: QOM'ify StrongARMPPCInfo, Andreas Färber, 2013/07/24
- [Qemu-devel] [PATCH qom-next for-1.6 27/29] strongarm: QOM'ify StrongARMUARTState, Andreas Färber, 2013/07/24