All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	qemu-ppc@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
Subject: [PATCH 3/3] hw/input/pckbd: Convert to Resettable interface
Date: Mon, 30 Nov 2026 14:32:54 +0000	[thread overview]
Message-ID: <20261130-input-resettable-v1-3-e5c5893abf4f@gmail.com> (raw)
In-Reply-To: <20261130-input-resettable-v1-0-e5c5893abf4f@gmail.com>

Replace the deprecated device_class_set_legacy_reset() with the
Resettable interface by implementing the hold phase in
i8042_mmio_reset_hold() and i8042_reset_hold().

Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
 hw/input/pckbd.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 0250252..b75845a 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -682,9 +682,9 @@ static void i8042_mmio_set_mouse_irq(void *opaque, int n, int level)
     kbd_update_aux_irq(ks, level);
 }
 
-static void i8042_mmio_reset(DeviceState *dev)
+static void i8042_mmio_reset_hold(Object *obj, ResetType type)
 {
-    MMIOKBDState *s = I8042_MMIO(dev);
+    MMIOKBDState *s = I8042_MMIO(obj);
     KBDState *ks = &s->kbd;
 
     kbd_reset(ks);
@@ -753,9 +753,10 @@ static const VMStateDescription vmstate_kbd_mmio = {
 static void i8042_mmio_class_init(ObjectClass *klass, const void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
     dc->realize = i8042_mmio_realize;
-    device_class_set_legacy_reset(dc, i8042_mmio_reset);
+    rc->phases.hold = i8042_mmio_reset_hold;
     dc->vmsd = &vmstate_kbd_mmio;
     device_class_set_props(dc, i8042_mmio_properties);
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
@@ -824,9 +825,9 @@ static void i8042_set_mouse_irq(void *opaque, int n, int level)
 }
 
 
-static void i8042_reset(DeviceState *dev)
+static void i8042_reset_hold(Object *obj, ResetType type)
 {
-    ISAKBDState *s = I8042(dev);
+    ISAKBDState *s = I8042(obj);
     KBDState *ks = &s->kbd;
 
     kbd_reset(ks);
@@ -944,9 +945,10 @@ static void i8042_class_initfn(ObjectClass *klass, const void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
     AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass);
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
     device_class_set_props(dc, i8042_properties);
-    device_class_set_legacy_reset(dc, i8042_reset);
+    rc->phases.hold = i8042_reset_hold;
     dc->realize = i8042_realizefn;
     dc->vmsd = &vmstate_kbd_isa;
     adevc->build_dev_aml = i8042_build_aml;

-- 
2.53.0



  parent reply	other threads:[~2026-11-30 14:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 14:32 [PATCH 0/3] hw/input: Convert remaining input devices to Resettable interface Oscar Alejandro Sánchez Lucero
2026-11-30 14:32 ` [PATCH 1/3] hw/input/adb-kbd: Convert " Oscar Alejandro Sánchez Lucero
2026-12-01 13:14   ` Bin Meng
2026-11-30 14:32 ` [PATCH 2/3] hw/input/adb-mouse: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:15   ` Bin Meng
2026-11-30 14:32 ` Oscar Alejandro Sánchez Lucero [this message]
2026-12-01 13:15   ` [PATCH 3/3] hw/input/pckbd: " Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130-input-resettable-v1-3-e5c5893abf4f@gmail.com \
    --to=aleszlucero@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.