qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Yanan Wang" <wangyanan55@huawei.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	qemu-rust@nongnu.org, "Zhao Liu" <zhao1.liu@intel.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Jason Wang" <jasowang@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-s390x@nongnu.org,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: [PATCH 03/10] hw/input/virtio-input: Remove VirtIOInputHID::wheel_axis field
Date: Fri,  2 May 2025 01:01:21 +0200	[thread overview]
Message-ID: <20250501230129.2596-4-philmd@linaro.org> (raw)
In-Reply-To: <20250501230129.2596-1-philmd@linaro.org>

The VirtIOInputHID::wheel_axis boolean was only set in the
hw_compat_2_10[] array, via the 'wheel-axis=false' property.
We removed all machines using that array, lets remove that
property and all the code around it. There is only one
virtio_input_config[] version for each device, rename it
removing the '_v2' suffix.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/virtio/virtio-input.h |   1 -
 hw/input/virtio-input-hid.c      | 102 ++-----------------------------
 2 files changed, 5 insertions(+), 98 deletions(-)

diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index e097b0b5217..1e94f8a03db 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -89,7 +89,6 @@ struct VirtIOInputHID {
     const QemuInputHandler            *handler;
     QemuInputHandlerState             *hs;
     int                               ledstate;
-    bool                              wheel_axis;
 };
 
 struct VirtIOInputHost {
diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index d986c3c16e3..a89a5b10c63 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -81,7 +81,6 @@ static void virtio_input_extend_config(VirtIOInput *vinput,
 static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src,
                                       InputEvent *evt)
 {
-    VirtIOInputHID *vhid = VIRTIO_INPUT_HID(dev);
     VirtIOInput *vinput = VIRTIO_INPUT(dev);
     virtio_input_event event;
     int qcode;
@@ -109,8 +108,7 @@ static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src,
         break;
     case INPUT_EVENT_KIND_BTN:
         btn = evt->u.btn.data;
-        if (vhid->wheel_axis &&
-            (btn->button == INPUT_BUTTON_WHEEL_UP ||
+        if ((btn->button == INPUT_BUTTON_WHEEL_UP ||
              btn->button == INPUT_BUTTON_WHEEL_DOWN) &&
             btn->down) {
             event.type  = cpu_to_le16(EV_REL);
@@ -328,32 +326,7 @@ static const QemuInputHandler virtio_mouse_handler = {
     .sync  = virtio_input_handle_sync,
 };
 
-static struct virtio_input_config virtio_mouse_config_v1[] = {
-    {
-        .select    = VIRTIO_INPUT_CFG_ID_NAME,
-        .size      = sizeof(VIRTIO_ID_NAME_MOUSE),
-        .u.string  = VIRTIO_ID_NAME_MOUSE,
-    },{
-        .select    = VIRTIO_INPUT_CFG_ID_DEVIDS,
-        .size      = sizeof(struct virtio_input_devids),
-        .u.ids     = {
-            .bustype = const_le16(BUS_VIRTUAL),
-            .vendor  = const_le16(0x0627), /* same we use for usb hid devices */
-            .product = const_le16(0x0002),
-            .version = const_le16(0x0001),
-        },
-    },{
-        .select    = VIRTIO_INPUT_CFG_EV_BITS,
-        .subsel    = EV_REL,
-        .size      = 1,
-        .u.bitmap  = {
-            (1 << REL_X) | (1 << REL_Y),
-        },
-    },
-    { /* end of list */ },
-};
-
-static struct virtio_input_config virtio_mouse_config_v2[] = {
+static struct virtio_input_config virtio_mouse_config[] = {
     {
         .select    = VIRTIO_INPUT_CFG_ID_NAME,
         .size      = sizeof(VIRTIO_ID_NAME_MOUSE),
@@ -379,26 +352,13 @@ static struct virtio_input_config virtio_mouse_config_v2[] = {
     { /* end of list */ },
 };
 
-static const Property virtio_mouse_properties[] = {
-    DEFINE_PROP_BOOL("wheel-axis", VirtIOInputHID, wheel_axis, true),
-};
-
-static void virtio_mouse_class_init(ObjectClass *klass, const void *data)
-{
-    DeviceClass *dc = DEVICE_CLASS(klass);
-
-    device_class_set_props(dc, virtio_mouse_properties);
-}
-
 static void virtio_mouse_init(Object *obj)
 {
     VirtIOInputHID *vhid = VIRTIO_INPUT_HID(obj);
     VirtIOInput *vinput = VIRTIO_INPUT(obj);
 
     vhid->handler = &virtio_mouse_handler;
-    virtio_input_init_config(vinput, vhid->wheel_axis
-                             ? virtio_mouse_config_v2
-                             : virtio_mouse_config_v1);
+    virtio_input_init_config(vinput, virtio_mouse_config);
     virtio_input_extend_config(vinput, keymap_button,
                                ARRAY_SIZE(keymap_button),
                                VIRTIO_INPUT_CFG_EV_BITS, EV_KEY);
@@ -409,7 +369,6 @@ static const TypeInfo virtio_mouse_info = {
     .parent        = TYPE_VIRTIO_INPUT_HID,
     .instance_size = sizeof(VirtIOInputHID),
     .instance_init = virtio_mouse_init,
-    .class_init    = virtio_mouse_class_init,
 };
 
 /* ----------------------------------------------------------------- */
@@ -421,44 +380,7 @@ static const QemuInputHandler virtio_tablet_handler = {
     .sync  = virtio_input_handle_sync,
 };
 
-static struct virtio_input_config virtio_tablet_config_v1[] = {
-    {
-        .select    = VIRTIO_INPUT_CFG_ID_NAME,
-        .size      = sizeof(VIRTIO_ID_NAME_TABLET),
-        .u.string  = VIRTIO_ID_NAME_TABLET,
-    },{
-        .select    = VIRTIO_INPUT_CFG_ID_DEVIDS,
-        .size      = sizeof(struct virtio_input_devids),
-        .u.ids     = {
-            .bustype = const_le16(BUS_VIRTUAL),
-            .vendor  = const_le16(0x0627), /* same we use for usb hid devices */
-            .product = const_le16(0x0003),
-            .version = const_le16(0x0001),
-        },
-    },{
-        .select    = VIRTIO_INPUT_CFG_EV_BITS,
-        .subsel    = EV_ABS,
-        .size      = 1,
-        .u.bitmap  = {
-            (1 << ABS_X) | (1 << ABS_Y),
-        },
-    },{
-        .select    = VIRTIO_INPUT_CFG_ABS_INFO,
-        .subsel    = ABS_X,
-        .size      = sizeof(virtio_input_absinfo),
-        .u.abs.min = const_le32(INPUT_EVENT_ABS_MIN),
-        .u.abs.max = const_le32(INPUT_EVENT_ABS_MAX),
-    },{
-        .select    = VIRTIO_INPUT_CFG_ABS_INFO,
-        .subsel    = ABS_Y,
-        .size      = sizeof(virtio_input_absinfo),
-        .u.abs.min = const_le32(INPUT_EVENT_ABS_MIN),
-        .u.abs.max = const_le32(INPUT_EVENT_ABS_MAX),
-    },
-    { /* end of list */ },
-};
-
-static struct virtio_input_config virtio_tablet_config_v2[] = {
+static struct virtio_input_config virtio_tablet_config[] = {
     {
         .select    = VIRTIO_INPUT_CFG_ID_NAME,
         .size      = sizeof(VIRTIO_ID_NAME_TABLET),
@@ -503,26 +425,13 @@ static struct virtio_input_config virtio_tablet_config_v2[] = {
     { /* end of list */ },
 };
 
-static const Property virtio_tablet_properties[] = {
-    DEFINE_PROP_BOOL("wheel-axis", VirtIOInputHID, wheel_axis, true),
-};
-
-static void virtio_tablet_class_init(ObjectClass *klass, const void *data)
-{
-    DeviceClass *dc = DEVICE_CLASS(klass);
-
-    device_class_set_props(dc, virtio_tablet_properties);
-}
-
 static void virtio_tablet_init(Object *obj)
 {
     VirtIOInputHID *vhid = VIRTIO_INPUT_HID(obj);
     VirtIOInput *vinput = VIRTIO_INPUT(obj);
 
     vhid->handler = &virtio_tablet_handler;
-    virtio_input_init_config(vinput, vhid->wheel_axis
-                             ? virtio_tablet_config_v2
-                             : virtio_tablet_config_v1);
+    virtio_input_init_config(vinput, virtio_tablet_config);
     virtio_input_extend_config(vinput, keymap_button,
                                ARRAY_SIZE(keymap_button),
                                VIRTIO_INPUT_CFG_EV_BITS, EV_KEY);
@@ -533,7 +442,6 @@ static const TypeInfo virtio_tablet_info = {
     .parent        = TYPE_VIRTIO_INPUT_HID,
     .instance_size = sizeof(VirtIOInputHID),
     .instance_init = virtio_tablet_init,
-    .class_init    = virtio_tablet_class_init,
 };
 
 /* ----------------------------------------------------------------- */
-- 
2.47.1



  parent reply	other threads:[~2025-05-01 23:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-01 23:01 [PATCH 00/10] hw/core: Remove hw_compat[] array for 2.10, 2.11 and 2.12 machines Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 01/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.10 and 2.11 machine types Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 02/10] hw/core/machine: Remove hw_compat_2_10[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` Philippe Mathieu-Daudé [this message]
2025-05-01 23:01 ` [PATCH 04/10] hw/core/machine: Remove hw_compat_2_11[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 05/10] hw/timer/hpet: Remove HPETState::hpet_offset_saved field Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 06/10] hw/net/e1000: Remove unused E1000_FLAG_TSO flag Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 07/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 2.12 machine type Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 08/10] hw/core/machine: Remove hw_compat_2_12[] array Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 09/10] hw/audio/hda-codec: Remove HDAAudioState::use_timer field Philippe Mathieu-Daudé
2025-05-01 23:01 ` [PATCH 10/10] hw/display/vga-pci: Do not expose the 'global-vmstate' property Philippe Mathieu-Daudé

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=20250501230129.2596-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).