stellaris_gamepad.c (d762bf97931b58839316b68a570eecc6143c9e3e) | stellaris_gamepad.c (6e782ffd555808378f69dd606641f0c4b5ca6120) |
---|---|
1/* 2 * Gamepad style buttons connected to IRQ/GPIO lines 3 * 4 * Copyright (c) 2007 CodeSourcery. 5 * Written by Paul Brook 6 * 7 * This code is licensed under the GPL. 8 */ --- 49 unchanged lines hidden (view full) --- 58 } 59 60 s->irqs = g_new0(qemu_irq, s->num_buttons); 61 s->pressed = g_new0(uint8_t, s->num_buttons); 62 qdev_init_gpio_out(dev, s->irqs, s->num_buttons); 63 qemu_input_handler_register(dev, &stellaris_gamepad_handler); 64} 65 | 1/* 2 * Gamepad style buttons connected to IRQ/GPIO lines 3 * 4 * Copyright (c) 2007 CodeSourcery. 5 * Written by Paul Brook 6 * 7 * This code is licensed under the GPL. 8 */ --- 49 unchanged lines hidden (view full) --- 58 } 59 60 s->irqs = g_new0(qemu_irq, s->num_buttons); 61 s->pressed = g_new0(uint8_t, s->num_buttons); 62 qdev_init_gpio_out(dev, s->irqs, s->num_buttons); 63 qemu_input_handler_register(dev, &stellaris_gamepad_handler); 64} 65 |
66static void stellaris_gamepad_finalize(Object *obj) 67{ 68 StellarisGamepad *s = STELLARIS_GAMEPAD(obj); 69 70 g_free(s->keycodes); 71} 72 |
|
66static void stellaris_gamepad_reset_enter(Object *obj, ResetType type) 67{ 68 StellarisGamepad *s = STELLARIS_GAMEPAD(obj); 69 70 memset(s->pressed, 0, s->num_buttons * sizeof(uint8_t)); 71} 72 73static Property stellaris_gamepad_properties[] = { --- 13 unchanged lines hidden (view full) --- 87 device_class_set_props(dc, stellaris_gamepad_properties); 88} 89 90static const TypeInfo stellaris_gamepad_info[] = { 91 { 92 .name = TYPE_STELLARIS_GAMEPAD, 93 .parent = TYPE_SYS_BUS_DEVICE, 94 .instance_size = sizeof(StellarisGamepad), | 73static void stellaris_gamepad_reset_enter(Object *obj, ResetType type) 74{ 75 StellarisGamepad *s = STELLARIS_GAMEPAD(obj); 76 77 memset(s->pressed, 0, s->num_buttons * sizeof(uint8_t)); 78} 79 80static Property stellaris_gamepad_properties[] = { --- 13 unchanged lines hidden (view full) --- 94 device_class_set_props(dc, stellaris_gamepad_properties); 95} 96 97static const TypeInfo stellaris_gamepad_info[] = { 98 { 99 .name = TYPE_STELLARIS_GAMEPAD, 100 .parent = TYPE_SYS_BUS_DEVICE, 101 .instance_size = sizeof(StellarisGamepad), |
102 .instance_finalize = stellaris_gamepad_finalize, |
|
95 .class_init = stellaris_gamepad_class_init, 96 }, 97}; 98 99DEFINE_TYPES(stellaris_gamepad_info); | 103 .class_init = stellaris_gamepad_class_init, 104 }, 105}; 106 107DEFINE_TYPES(stellaris_gamepad_info); |