aboutsummaryrefslogtreecommitdiff
path: root/hw/input
AgeCommit message (Collapse)AuthorFilesLines
2022-06-26ps2: remove update_irq() function and update_arg parameterMark Cave-Ayland4-29/+12
Now that all the PS2 devices have been converted to use GPIOs the update_irq() callback function and the update_arg parameter can be removed. This allows these arguments to be completely removed from ps2_kbd_init() and ps2_mouse_init(), along with the transitional logic that was added to ps2_raise_irq() and ps2_lower_irq(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-55-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: switch I8042 device from update_irq() function to PS2 device gpioMark Cave-Ayland1-4/+33
Define a new qdev input gpio for handling incoming PS2 IRQs, and then wire up the PS2 keyboard and mouse devices to use it. At the same time set update_irq() and update_arg to NULL in ps2_kbd_init() and ps2_mouse_init() to ensure that any accidental attempt to use the legacy update_irq() function will cause a NULL pointer dereference. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-53-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: add i8042_reset() function to I8042 deviceMark Cave-Ayland1-1/+9
This means that it is no longer necessary to call qemu_register_reset() manually within i8042_realizefn(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-52-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: switch I8042_MMIO device from update_irq() function to PS2 device gpioMark Cave-Ayland1-6/+32
Define a new qdev input gpio for handling incoming PS2 IRQs, and then wire up the PS2 keyboard and mouse devices to use it. At the same time set update_irq() and update_arg to NULL in ps2_kbd_init() and ps2_mouse_init() to ensure that any accidental attempt to use the legacy update_irq() function will cause a NULL pointer dereference. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-50-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: switch over from update_irq() function to PS2 device gpioMark Cave-Ayland1-4/+25
Add a qdev gpio input in lasips2_init() by taking the existing lasips2_port_set_irq() function, updating it accordingly and then renaming to lasips2_set_irq(). Use these new qdev gpio inputs to wire up the PS2 keyboard and mouse devices. At the same time set update_irq() and update_arg to NULL in ps2_kbd_init() and ps2_mouse_init() to ensure that any accidental attempt to use the legacy update_irq() function will cause a NULL pointer dereference. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-48-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26lasips2: use sysbus IRQ for output IRQMark Cave-Ayland1-4/+5
This enables the IRQ to be wired up using sysbus_connect_irq() in lasips2_initfn(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-47-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26lasips2: implement lasips2_realize()Mark Cave-Ayland1-3/+8
Move ps2_kbd_init() and ps2_mouse_init() from lasips2_initfn() to lasips2_realize. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-46-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: add base propertyMark Cave-Ayland1-1/+16
This is in preparation for handling vmstate_register() within the device. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-45-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26lasips2: move initialisation of PS2 ports from lasi_initfn() to lasi_init()Mark Cave-Ayland1-3/+5
This can be improved once the ps2_kbd_init() and ps2_mouse_init() functions have been removed, but for now move the existing logic from lasi_initfn() to lasi_init(). At the same time explicitly set keyboard port id to 0, even if it isn't technically required. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-44-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: move mapping of LASIPS2 registers to HPPA machineMark Cave-Ayland1-6/+1
Now that the register memory regions are exposed as SysBus memory regions, move the mapping of the LASIPS2 registers from lasips2_initfn() to the HPPA machine (which is its only user). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-43-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: implement lasips2_init() functionMark Cave-Ayland1-4/+14
Move the initialisation of the keyboard and mouse memory regions to lasips2_init() and expose them as SysBus memory regions. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-42-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: rename lasips2_init() to lasips2_initfn() and update it to return ↵Mark Cave-Ayland1-2/+4
the LASIPS2 device When QOMifying a device it is typical to use _init() as the suffix for an instance_init function, however this name is already in use by the legacy LASIPS2 wrapper function. Eventually the wrapper function will be removed, but for now rename it to lasips2_initfn() to avoid a naming collision. At the same time update lasips2_initfn() return the LASIPS2 device so that it can later be accessed using qdev APIs by the HPPA machine. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-41-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: move lasips2 QOM types from lasips2.c to lasips2.hMark Cave-Ayland1-23/+0
This allows the QOM types in lasips2.c to be used elsewhere by simply including lasips2.h. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-40-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: QOMify LASIPS2StateMark Cave-Ayland1-3/+26
Currently lasip2_init() creates a new LASIPS2State directly which is used by the HPPA machine. Introduce a new LASIPS2 QOM type that will soon be used to allow the HPPA machine to be wired up using standard qdev GPIOs. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-39-mark.cave-ayland@ilande.co.uk>
2022-06-26pl050: add QEMU interface commentMark Cave-Ayland1-0/+8
This describes the PL050 device interface implemented within QEMU. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-Id: <20220624134109.881989-38-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26pl050: switch over from update_irq() function to PS2 device gpioMark Cave-Ayland1-3/+11
Add a new pl050_init() function which initialises a qdev input gpio for handling incoming PS2 IRQs, and then wire up the PS2 device to use it. At the same time set update_irq() and update_arg to NULL in ps2_kbd_init() and ps2_mouse_init() to ensure that any accidental attempt to use the legacy update_irq() function will cause a NULL pointer dereference. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-37-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26pckbd: replace irq_kbd and irq_mouse with qemu_irq array in KBDStateMark Cave-Ayland1-6/+6
This allows both IRQs to be declared as a single qdev gpio array. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-36-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: add gpio for output IRQ and optionally use it in ps2_raise_irq() and ↵Mark Cave-Ayland1-2/+19
ps2_lower_irq() Define the gpio for the PS2 output IRQ in ps2_init() and add logic to optionally use it in ps2_raise_irq() and ps2_lower_irq() if the gpio is connected. If the gpio is not connected then call the legacy update_irq() function as before. This allows the incremental conversion of devices from the legacy update_irq() function to use gpios instead. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-35-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: introduce ps2_lower_irq() instead of calling update_irq() directlyMark Cave-Ayland1-2/+7
This consolidates the logic of lowering the PS2 IRQ into one single function. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-34-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: use ps2_raise_irq() instead of calling update_irq() directlyMark Cave-Ayland1-1/+1
This consolidates the logic of raising the PS2 IRQ into one single function. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-33-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: make ps2_raise_irq() function staticMark Cave-Ayland1-1/+1
This function is no longer used outside of ps2.c and so can be declared static. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-32-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: move ps2_kbd_init() and ps2_mouse_init() to i8042_mmio_realize()Mark Cave-Ayland1-3/+3
Move ps2_kbd_init() and ps2_mouse_init() from i8042_mm_init() to i8042_mmio_realize() to further reduce the initialisation logic done in i8042_mm_init(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-31-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: more vmstate_register() from i8042_mm_init() to i8042_mmio_realize()Mark Cave-Ayland1-2/+3
Note in this case it is not possible to register a (new) VMStateDescription in the DeviceClass without breaking migration compatibility for the MIPS magnum machine. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-30-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26pckbd: move mapping of I8042_MMIO registers to MIPS magnum machineMark Cave-Ayland1-4/+1
Now that the register memory region is exposed as a SysBus memory region, move the mapping of the I8042_MMIO registers from i8042_mm_init() to the MIPS magnum machine (which is its only user). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-29-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: alter i8042_mm_init() to return a I8042_MMIO deviceMark Cave-Ayland1-3/+5
This exposes the I8042_MMIO device to the caller to allow the register memory region to be mapped outside of i8042_mm_init(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-28-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: implement i8042_mmio_init() functionMark Cave-Ayland1-2/+9
This enables use to set the required value of extended_state directly during device init rather than in i8042_mm_init(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-27-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26pckbd: implement i8042_mmio_realize() functionMark Cave-Ayland1-1/+13
Move the initialisation of the register memory region to the I8042_MMIO device realize function and expose it using sysbus_init_mmio(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-26-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: add size qdev property to I8042_MMIO deviceMark Cave-Ayland1-0/+2
This will soon be used to set the size of the register memory region using a qdev property. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-25-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: add mask qdev property to I8042_MMIO deviceMark Cave-Ayland1-1/+7
This allows the KBDState mask value to be set using a qdev property rather than directly in i8042_mm_init(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-24-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: implement i8042_mmio_reset() for I8042_MMIO deviceMark Cave-Ayland1-1/+9
This allows the I8042_MMIO reset function to be registered directly within the DeviceClass rather than using qemu_register_reset() directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-23-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2022-06-26pckbd: introduce new I8042_MMIO QOM typeMark Cave-Ayland1-1/+21
Currently i8042_mm_init() creates a new KBDState directly which is used by the MIPS magnum machine. Introduce a new I8042_MMIO QOM type that will soon be used to allow the MIPS magnum machine to be wired up using standard qdev GPIOs. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-22-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: move ISAKBDState from pckbd.c to i8042.hMark Cave-Ayland1-10/+0
This allows the QOM types in pckbd.c to be used elsewhere by simply including i8042.h. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-21-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: move KBDState from pckbd.c to i8042.hMark Cave-Ayland1-24/+0
This allows the QOM types in pckbd.c to be used elsewhere by simply including i8042.h. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-20-mark.cave-ayland@ilande.co.uk>
2022-06-26pckbd: checkpatch fixesMark Cave-Ayland1-53/+97
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-19-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: rename ps2dev_update_irq() to lasips2_port_set_irq()Mark Cave-Ayland1-3/+3
This better reflects that the IRQ input opaque is a LASIPS2Port structure and not a PS2_DEVICE. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-18-mark.cave-ayland@ilande.co.uk>
2022-06-26lasips2: spacing fixesMark Cave-Ayland1-2/+2
This helps improve the readability of lasips2.c. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-17-mark.cave-ayland@ilande.co.uk>
2022-06-26pl050: split pl050_update_irq() into separate pl050_set_irq() and ↵Mark Cave-Ayland1-8/+13
pl050_update_irq() functions This will soon allow pl050_set_irq() to be used as a GPIO input function. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-16-mark.cave-ayland@ilande.co.uk>
2022-06-26pl050: checkpatch fixesMark Cave-Ayland1-6/+13
This patch also includes a couple of minor spacing updates. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-15-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: don't use vmstate_register() in ps2_mouse_init()Mark Cave-Ayland1-1/+1
Since PS2_MOUSE_DEVICE is a qdev device then vmstate_ps2_mouse can be registered using the DeviceClass vmsd field instead. There is no need to use qdev_set_legacy_instance_id() to ensure migration compatibility since the first 2 parameters to vmstate_register() are NULL and 0 respectively. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-14-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: don't use vmstate_register() in ps2_kbd_init()Mark Cave-Ayland1-1/+1
Since PS2_KBD_DEVICE is a qdev device then vmstate_ps2_keyboard can be registered using the DeviceClass vmsd field instead. There is no need to use qdev_set_legacy_instance_id() to ensure migration compatibility since the first 2 parameters to vmstate_register() are NULL and 0 respectively. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-13-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: implement ps2_mouse_realize() and use it to register ps2_mouse_handlerMark Cave-Ayland1-2/+6
Move the registration of ps2_mouse_handler from ps2_mouse_init() to a new ps2_mouse_realize() function. Since the abstract PS2_DEVICE parent class doesn't have a realize() function then it is not necessary to store the reference to it in PS2DeviceClass and use device_class_set_parent_realize(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-12-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: implement ps2_kbd_realize() and use it to register ps2_keyboard_handlerMark Cave-Ayland1-2/+7
Move the registration of ps2_keyboard_handler from ps2_kbd_init() to a new ps2_kbd_realize() function. Since the abstract PS2_DEVICE parent class doesn't have a realize() function then it is not necessary to store the reference to it in PS2DeviceClass and use device_class_set_parent_realize(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-11-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: remove duplicate setting of scancode_set in ps2_kbd_init()Mark Cave-Ayland1-1/+0
The default value for scancode_set is already set in ps2_kbd_reset() so there is no need to duplicate this in ps2_kbd_init(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-10-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: implement ps2_reset() for the PS2_DEVICE QOM type based upon ↵Mark Cave-Ayland1-13/+35
ps2_common_reset() The functionality of ps2_common_reset() can be moved into a new ps2_reset() function for the PS2_DEVICE QOM type. Update PS2DeviceClass to hold a reference to the parent reset function and update the PS2_KBD_DEVICE and PS2_MOUSE_DEVICE types to use device_class_set_parent_reset() accordingly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-9-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: introduce PS2DeviceClassMark Cave-Ayland1-0/+1
This is in preparation for allowing the new PS2_KBD_DEVICE and PS2_MOUSE_DEVICE QOM types to reference the parent PS2_DEVICE device reset() function. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-8-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: improve function prototypes in ps2.c and ps2.hMark Cave-Ayland1-13/+9
With the latest changes it is now possible to improve some of the function prototypes in ps2.c and ps.h to use the appropriate PS2KbdState or PS2MouseState type instead of being a void opaque. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-7-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: move QOM type definitions from ps2.c to ps2.hMark Cave-Ayland1-55/+0
Move the QOM type definitions into the ps2.h header file to allow the new QOM types to be used by other devices. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-6-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: QOMify PS2MouseStateMark Cave-Ayland1-38/+60
Make PS2MouseState into a new PS2_MOUSE_DEVICE QOM type which inherits from the abstract PS2_DEVICE type. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-5-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: QOMify PS2KbdStateMark Cave-Ayland1-39/+65
Make PS2KbdState into a new PS2_KBD_DEVICE QOM type which inherits from the abstract PS2_DEVICE type. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-4-mark.cave-ayland@ilande.co.uk>
2022-06-26ps2: QOMify PS2StateMark Cave-Ayland1-0/+28
Make PS2State a new abstract PS2_DEVICE QOM type to represent the common functionality shared between PS2 keyboard and mouse devices. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-3-mark.cave-ayland@ilande.co.uk>