From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657662911413751.168520013421; Tue, 12 Jul 2022 14:55:11 -0700 (PDT) Received: from localhost ([::1]:58666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNqY-00034y-B7 for importer@patchew.org; Tue, 12 Jul 2022 17:55:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNoi-00086z-Jc; Tue, 12 Jul 2022 17:53:16 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNoh-0007lj-1O; Tue, 12 Jul 2022 17:53:16 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnC-000Bqt-VW; Tue, 12 Jul 2022 22:51:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3cSlOAz9yROSb3OzCrsjYgKrXrNnfn/ZSTlPCR363Mk=; b=wHRvOOexGdR9BriGYkjF9K5Mox xlygmhiRaueRnMPxly31MjTcF/Qjo0B+e8bx5gTc/bt/4dMXJP/+dUF1lf1CvMN3+spUoJ107KtvE /kxz0st0RDXXHyhApxmCPuFQdpoYJfco9vpqRQTk6kApFDVI2mhO3AywIo2BAJ1OURYxbTxv6TwSm 1gzQuWN8mzU2OxSUtKT+3x4je5joq5DtsrNXciwgpCwwIyYPE8B4dBPkvDSEWdLoZfk6rM2zQjfl9 HTbuXcVHZcA6n8UHw2iWIDR9vv9yP35gMYibwYDfrzD17ehhwlMxQ1Ajc9vNS0c+cM9shIm1YNKqc 1QD52uPnbLel1OOhA7CeJHSQqiQuoIifi42b8jxUsVZcUI0VQbHcAEkORkZV+WBXMnGLI0LjOAOF5 5b4hpU1Q6uypN/CPnw7SUqhtvjuLAqzXx+D99MjAR1KP/igOTTahpJxmcJfLlqw7H+pBh8iOXVGdI diVRkwdYS8KRUH5fceouFg5e0eJbKtUsqYSOP52u/+AyQGaezUtxRWlPyKtogzD4lMXaLpIq7UEbT DOjVo9q1mokWatyq3TSb8GXjDd3FUc+AwbP76rSnJxXJYCq5q1Iz0k/znTeGto3nBmv7HkYZFV3Hj Vx1tta4EPxCIs7frjyNindb+FKXiUy9ufDY4Cuqvg=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:12 +0100 Message-Id: <20220712215251.7944-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 01/40] pl050: move PL050State from pl050.c to new pl050.h header file X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657662913272100001 Content-Type: text/plain; charset="utf-8" This allows the QOM types in pl050.c to be used elsewhere by simply includi= ng pl050.h. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 16 +--------------- include/hw/input/pl050.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 include/hw/input/pl050.h diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 209cc001cf..c7980b6ed7 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -19,26 +19,12 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "hw/input/ps2.h" +#include "hw/input/pl050.h" #include "hw/irq.h" #include "qemu/log.h" #include "qemu/module.h" #include "qom/object.h" =20 -#define TYPE_PL050 "pl050" -OBJECT_DECLARE_SIMPLE_TYPE(PL050State, PL050) - -struct PL050State { - SysBusDevice parent_obj; - - MemoryRegion iomem; - void *dev; - uint32_t cr; - uint32_t clk; - uint32_t last; - int pending; - qemu_irq irq; - bool is_mouse; -}; =20 static const VMStateDescription vmstate_pl050 =3D { .name =3D "pl050", diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h new file mode 100644 index 0000000000..2bbf7a9d50 --- /dev/null +++ b/include/hw/input/pl050.h @@ -0,0 +1,35 @@ +/* + * Arm PrimeCell PL050 Keyboard / Mouse Interface + * + * Copyright (c) 2006-2007 CodeSourcery. + * Written by Paul Brook + * + * This code is licensed under the GPL. + */ + +#ifndef HW_PL050_H +#define HW_PL050_H + +#include "qemu/osdep.h" +#include "hw/sysbus.h" +#include "migration/vmstate.h" +#include "hw/input/ps2.h" +#include "hw/irq.h" + +#define TYPE_PL050 "pl050" +OBJECT_DECLARE_SIMPLE_TYPE(PL050State, PL050) + +struct PL050State { + SysBusDevice parent_obj; + + MemoryRegion iomem; + void *dev; + uint32_t cr; + uint32_t clk; + uint32_t last; + int pending; + qemu_irq irq; + bool is_mouse; +}; + +#endif --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657662950684747.4653865183726; Tue, 12 Jul 2022 14:55:50 -0700 (PDT) Received: from localhost ([::1]:59198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNrB-0003Rh-LK for importer@patchew.org; Tue, 12 Jul 2022 17:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNoj-00088s-Er; Tue, 12 Jul 2022 17:53:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNoi-0007m1-0P; Tue, 12 Jul 2022 17:53:17 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnH-000Bqt-8q; Tue, 12 Jul 2022 22:51:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vhqbmb/OfAp1EbToOlQ9t2ACxijfrv+podwunxLOmZg=; b=aTR5d9bJs4PzzJ4evvv7kU40S+ qeUA3K9cb3OAYCLIrsBhoC54euocZn9Etx4dfGLXclbQ/+NsDpo4aFKEFuyKizct8+Y/oGlQ0YRaL BK8hrfphE+4VX3ZfevG9dJXF+pwH9HHTI93JatKiHYg+WjtVz7wPoJe2M2sNLre7dlelWM6bmNkuR xxAmjSGJDNaq938U0LvhxReWZf6f+5NnNSFQRoKdzrJY5Hm3EUo+kBHEPTS6Z4jqvqCgi6ESKElzC d84zw6WhiMN0TA2sqVNROtCReDTdJpMBq2S1/yswLdhBsKgEhm8AEY/ldsu7x5u3GIDFMDiQtNaOR WRLsJApjoZm2jQ8IAyiipETscXZ6GVuhBnEqOw71Pgrq2joePli64VHFcXUp+ZkYC5NgodYlhogUE 3OUQhz2zpGakuVPYZwPGQmScYrLlmTfhaYkyS7sziFL6eDoYD5ElxKdM8q6RBp6er089MmC6ZAwZx BpoNGZBvvrLPf7WiL8K2nqCvE6xN1cxjN+JD9bOr9WFos6do0vFyeHDmgaGCWz778/rh/b4jH+RNJ ssa0hK08Y/MRGkVpuO5uEkgE8XyOqjPDuQOKLRiUtlUxa535LYer+RgeDUJh+Tb/1II+YLEk5ZbZv gOdtLzFcRBsXuL2PI9TP/S+Vj1lbgxNJxomVuV/+8=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:13 +0100 Message-Id: <20220712215251.7944-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 02/40] pl050: rename pl050_keyboard_init() to pl050_kbd_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657662951444100001 Content-Type: text/plain; charset="utf-8" This is for consistency with all of the other devices that use the PS2 keyb= oard device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index c7980b6ed7..8e32b8ed46 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -166,7 +166,7 @@ static void pl050_realize(DeviceState *dev, Error **err= p) qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); } =20 -static void pl050_keyboard_init(Object *obj) +static void pl050_kbd_init(Object *obj) { PL050State *s =3D PL050(obj); =20 @@ -183,7 +183,7 @@ static void pl050_mouse_init(Object *obj) static const TypeInfo pl050_kbd_info =3D { .name =3D "pl050_keyboard", .parent =3D TYPE_PL050, - .instance_init =3D pl050_keyboard_init, + .instance_init =3D pl050_kbd_init, }; =20 static const TypeInfo pl050_mouse_info =3D { --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663153686254.73130629700927; Tue, 12 Jul 2022 14:59:13 -0700 (PDT) Received: from localhost ([::1]:39568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNuR-000163-Qp for importer@patchew.org; Tue, 12 Jul 2022 17:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNom-0008Gb-NS; Tue, 12 Jul 2022 17:53:20 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:41976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNol-0007mT-5i; Tue, 12 Jul 2022 17:53:20 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnL-000Bqt-7k; Tue, 12 Jul 2022 22:51:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Mb8hBJuEMzvF+Xnm14EqKiinjkKQKTf1lUgasdea4BY=; b=ZXrzfsdNqiHa3JlyOI/sGlT7Q8 9xQl6sEByBq2gm7Wpdy9YcoSlknNF8DC7rtA0uIjBLdoblry4vGrRZvkWfzI3+Nv09RtJOi5pvXZ8 X9dICvwMjUevC63liBl0MN0sqQIcDmf0cJjGc5JljWJTaUfnyBWir48oMfZVvB/K7lavlpJymTFwY qMuu+GSL2vdofEQXNh/AnuFiDegnw0Vnet0kFZJvjcDltfytfYVZUehbuF6Z8C9BA1YWUmNXRR7eJ Wilc26mI9pYurBQe7cpTL0+t9d/SmLjKfbSQUdx94ZR4c8eMdTkXlY9KD8F+eEcOPrrojkm1p6ckn QeuRIoqkEsQ+b0r+Es2qpHynG95CvNLAhZWOMDRIXUZ0s/AudQJR6MWFdUm38UZRWMy11MXBGYtPN mJ1rxC3JhxU0hKK1xNy6QsD3/j79zp7MEl+Ih/IQ+VcAeEd0tHkfJV1Akw2+RMkaj70TfzbsmZ0Wm /hkfJQwbt8f60B5nvInGX7GyuiKMw6d72EQitoq8h0Y7XGWUSU/nM3QYRH9TtV+iQAK/CiIK50CE7 1n0UhBZUzaMcfQHC3W7LuEX16Avt1JxCvE/UFkVQCyPIWz3EgKnrmMzJLyylikj1dKukXOGwZ4vXW 4bi0NYZOS5KnT9lDdEwZvKNIJrdsJvuAyyIOuRSO8=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:14 +0100 Message-Id: <20220712215251.7944-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 03/40] pl050: change PL050State dev pointer from void to PS2State X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663154374100001 Content-Type: text/plain; charset="utf-8" This allows the compiler to enforce that the PS2 device pointer is always of type PS2State. Update the name of the pointer from dev to ps2dev to emphasi= se this type change. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 13 +++++++------ include/hw/input/pl050.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 8e32b8ed46..0d91b0eaea 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -101,7 +101,7 @@ static uint64_t pl050_read(void *opaque, hwaddr offset, } case 2: /* KMIDATA */ if (s->pending) { - s->last =3D ps2_read_data(s->dev); + s->last =3D ps2_read_data(s->ps2dev); } return s->last; case 3: /* KMICLKDIV */ @@ -130,9 +130,9 @@ static void pl050_write(void *opaque, hwaddr offset, /* ??? This should toggle the TX interrupt line. */ /* ??? This means kbd/mouse can block each other. */ if (s->is_mouse) { - ps2_write_mouse(s->dev, value); + ps2_write_mouse(PS2_MOUSE_DEVICE(s->ps2dev), value); } else { - ps2_write_keyboard(s->dev, value); + ps2_write_keyboard(PS2_KBD_DEVICE(s->ps2dev), value); } break; case 3: /* KMICLKDIV */ @@ -158,11 +158,12 @@ static void pl050_realize(DeviceState *dev, Error **e= rrp) sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); if (s->is_mouse) { - s->dev =3D ps2_mouse_init(); + s->ps2dev =3D ps2_mouse_init(); } else { - s->dev =3D ps2_kbd_init(); + s->ps2dev =3D ps2_kbd_init(); } - qdev_connect_gpio_out(DEVICE(s->dev), PS2_DEVICE_IRQ, + + qdev_connect_gpio_out(DEVICE(s->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); } =20 diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index 2bbf7a9d50..c1f6c5a1fb 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -23,7 +23,7 @@ struct PL050State { SysBusDevice parent_obj; =20 MemoryRegion iomem; - void *dev; + PS2State *ps2dev; uint32_t cr; uint32_t clk; uint32_t last; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663140930192.13756604017465; Tue, 12 Jul 2022 14:59:00 -0700 (PDT) Received: from localhost ([::1]:38870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNuF-0000cp-2t for importer@patchew.org; Tue, 12 Jul 2022 17:58:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNot-0008SB-I7; Tue, 12 Jul 2022 17:53:27 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNos-0007oQ-3U; Tue, 12 Jul 2022 17:53:27 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnP-000Bqt-Gx; Tue, 12 Jul 2022 22:51:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uDT2uipZT8z6bkAKveew0pvhFqY6LzU+aWOiOwvHlLw=; b=MbUPoKBjTS6HqTfJcq8pFHI+sf KJbKrM7DpvfPAs41K2pZW1CBMDbl23KjIYna+YzWIhVr1pbq7N30ONraoY3gdTW5pIi4aieQLAXrf 4q/m5OudPLpf8V7/hxODzU9f8f9jdV7h4ub8kumcXbXVvqKczl+OvSfKyH+Lq30OfnMRmG1UlFIxp 8pE0jkGEY17ZPitKSBWgF0PEnRxazi3tSGbpfYAVtbqS9PmsPlUyZP+mIyz/RyXiO6dXLiSM3IBiS 8Tio/0znBaml+n4EHJ4C43Q1zAhOc8XxZm8ySsKWaebvAXMDTJsUQwgZprEJI8fmNMx26mELJpxbe WP/3N2vKwM+12Apf3gKVEe5QAp2sH4F6ZvkhkfsCcfAWLRneS8e+jzNkMVerjgelWZaPAwU4EBJJq YxVKc8Z0ANnxcDn+g+G+p7JVREdnmpRQONLeK+R1nS2ltLDsBjW3wXwqI+2QJsvxXlf0NYm3ZJqgL P4nhA3f4W+SAc6OeQ6XU1SWqNOqg+FT4i31YB8ySi7NRVbWkqhS1XM4XBoUGqR6DoNBO4eQhPLtxK UVIkO6LnRjGBCcil2GcihZzyfmCwMgvKlg7v9xCa1BPxrW48v4tnE5ftEJ2YMfKHzYovPX8uYBnMa l92xeCVR1HimqJyrw/8+DqeJapmfOPMTH2HIDSdGA=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:15 +0100 Message-Id: <20220712215251.7944-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 04/40] pl050: introduce new PL050_KBD_DEVICE QOM type X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663142334100001 Content-Type: text/plain; charset="utf-8" This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 3 ++- include/hw/input/pl050.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 0d91b0eaea..7f4ac99081 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -182,9 +182,10 @@ static void pl050_mouse_init(Object *obj) } =20 static const TypeInfo pl050_kbd_info =3D { - .name =3D "pl050_keyboard", + .name =3D TYPE_PL050_KBD_DEVICE, .parent =3D TYPE_PL050, .instance_init =3D pl050_kbd_init, + .instance_size =3D sizeof(PL050KbdState), }; =20 static const TypeInfo pl050_mouse_info =3D { diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index c1f6c5a1fb..9ce8794bd0 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -32,4 +32,11 @@ struct PL050State { bool is_mouse; }; =20 +#define TYPE_PL050_KBD_DEVICE "pl050_keyboard" +OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVICE) + +struct PL050KbdState { + PL050State parent_obj; +}; + #endif --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663615178169.79904923507195; Tue, 12 Jul 2022 15:06:55 -0700 (PDT) Received: from localhost ([::1]:56074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO1t-0003tG-VY for importer@patchew.org; Tue, 12 Jul 2022 18:06:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNou-0008SX-No; Tue, 12 Jul 2022 17:53:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNos-0007oX-QH; Tue, 12 Jul 2022 17:53:28 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnT-000Bqt-Qa; Tue, 12 Jul 2022 22:52:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/bhnC+2gZ9vyQLezGGYsIGnfmTZfsidizkGybMJ1bFw=; b=ANGU1DOzGqIWfgf2gyZEuvuXGL WOOKlldyRusoRMInLDnW3Rka7cpQCTgSsZtGQFcvu4nvHy4gd2rZF1B3mKs0NNsgQomj+tM2GGyV+ BUgP6xfsAHvhFDb50amArXuN1GSWJG7+hj7WWMUeYV9zxaF4Ivx3qSn0TpOHZEqMqVUQeWykNEg2v X49apw5Rv/j4gBwlXQ7OsVQbBESpj9FyBf9F1Nod2q4/QRfJUo0d3voPVVOnsO7QSehcv3qsx7Zua ZfGbgi5HjK8Cpbty44cPaWsM+0XiqkoEtlMuSYLOib2Q7ChcrGq+DhP6okWqLbQSpeP2XPT+jBTxH IVJh+D9Xv+3/0RBK3V7cRIPrNOGId+syZnICiMHmcYetwPeH8Xn0g7i6mGtGQF0hjMvsxk5Oere+0 GtxJzAbcdoTiwHgUyP/uhSO7+CFKmuhroZRcmFmg8/IVl820IQ+qN4IOpGIDhbNqOuSLBLWGYuWgI W9/NCNE/NSP1cwXX2620v2EOcDgDsPzaUpLVJJPwgthwbuu8rx3gty13rj85hbN++cDXsd0fhF2Nd R3sLZGBQE8d00PaVVwWTf06Jz/lj6TGZpnDJf9jqawr7uRzsvBfcvUG2paw1laZwA6QQlx+q2vfkb Uznl/BPbn2Wr7eEvWU/kb5CICho8de7UhL2okSqE4=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:16 +0100 Message-Id: <20220712215251.7944-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 05/40] pl050: introduce new PL050_MOUSE_DEVICE QOM type X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663616511100001 Content-Type: text/plain; charset="utf-8" This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 3 ++- include/hw/input/pl050.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 7f4ac99081..88459997e0 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -189,9 +189,10 @@ static const TypeInfo pl050_kbd_info =3D { }; =20 static const TypeInfo pl050_mouse_info =3D { - .name =3D "pl050_mouse", + .name =3D TYPE_PL050_MOUSE_DEVICE, .parent =3D TYPE_PL050, .instance_init =3D pl050_mouse_init, + .instance_size =3D sizeof(PL050MouseState), }; =20 static void pl050_init(Object *obj) diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index 9ce8794bd0..bb0e87ff45 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -39,4 +39,11 @@ struct PL050KbdState { PL050State parent_obj; }; =20 +#define TYPE_PL050_MOUSE_DEVICE "pl050_mouse" +OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_DEVICE) + +struct PL050MouseState { + PL050State parent_obj; +}; + #endif --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663235566416.7977065734385; Tue, 12 Jul 2022 15:00:35 -0700 (PDT) Received: from localhost ([::1]:41228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNvi-0002D7-Ml for importer@patchew.org; Tue, 12 Jul 2022 18:00:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNou-0008SY-R7; Tue, 12 Jul 2022 17:53:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNos-0007oa-Vf; Tue, 12 Jul 2022 17:53:28 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnU-000Bqt-8l; Tue, 12 Jul 2022 22:52:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MkygjhFyY6EERcP/oDTHCTHmOjiJJbIR1TiysoqwM1M=; b=ptb7KGo9DBopYZZITj/vpgiRrb yZKMpcBepfeQVVuQzMOnMgZBJQZ4nt0kBt4NfJUZ2lxz5EBnVcIGB/yFJMIbNzNChWTGBX893a+l5 7JKbUqj0R+sdDT345tr/+Fj+mePcbq5xvJHDwriINmjpSqSJ/wjaYfG5L0Ooei8x+7l+BEnb6F8C1 ebprsMMv7Yp7qIxe6ElZgLX4yzJ/tw5DL+JBH7DAKkDfdjB7bGH0xEOint8dpmn4PT8/hSh7/phwc u8R8E0IYBWT9KSy8UPxtKAnbc6CrROtkiD3IeK6/j/gRNtAvjTBgEYxeO8kOm5JAk9WzrtSstJWUI 2Hb+P1gpQguSCC+j0tuNQCAyeVHrkzVOw8yd8/dzXfsFGz6sfk6pqgHrCznOxm1zGmz19I4LQtwiD GYrJ6tfN2DtXX/VChmZ+QcM9O0vXfk4ci+FzKcbBGNei786W/M2iRmWdETco43oMXGvgafW4LV1vo NnciN0vZ/SFGxsWwr3vGhznOfdz+r/V2WNgzaaAbzKKm08UrAB5yliKMuZVgYuXry3IRxsNhB401x raXhxxfTMoOKecARLaFVYaFtj4jEL3b0dtsGag/S7W26VRYFg7GqunfZ9H0q9FlAy7A5w7hi4g9MY jhS3AdiIbio6rlhhzlsNv/ZcC7lh6Xm51i389zf+A=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:17 +0100 Message-Id: <20220712215251.7944-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 06/40] pl050: move logic from pl050_realize() to pl050_init() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663237870100003 Content-Type: text/plain; charset="utf-8" The logic for initialising the register memory region and the sysbus output= IRQ does not depend upon any device properties and so can be moved from pl050_realize() to pl050_init(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 88459997e0..e32d86005a 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -152,11 +152,7 @@ static const MemoryRegionOps pl050_ops =3D { static void pl050_realize(DeviceState *dev, Error **errp) { PL050State *s =3D PL050(dev); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 - memory_region_init_io(&s->iomem, OBJECT(s), &pl050_ops, s, "pl050", 0x= 1000); - sysbus_init_mmio(sbd, &s->iomem); - sysbus_init_irq(sbd, &s->irq); if (s->is_mouse) { s->ps2dev =3D ps2_mouse_init(); } else { @@ -197,6 +193,13 @@ static const TypeInfo pl050_mouse_info =3D { =20 static void pl050_init(Object *obj) { + PL050State *s =3D PL050(obj); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); + + memory_region_init_io(&s->iomem, obj, &pl050_ops, s, "pl050", 0x1000); + sysbus_init_mmio(sbd, &s->iomem); + sysbus_init_irq(sbd, &s->irq); + qdev_init_gpio_in_named(DEVICE(obj), pl050_set_irq, "ps2-input-irq", 1= ); } =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663381487944.0960985695142; Tue, 12 Jul 2022 15:03:01 -0700 (PDT) Received: from localhost ([::1]:47592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNy8-0006Zk-BV for importer@patchew.org; Tue, 12 Jul 2022 18:03:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNou-0008SW-4g; Tue, 12 Jul 2022 17:53:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNos-0007oS-Ld; Tue, 12 Jul 2022 17:53:27 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnU-000Bqt-PL; Tue, 12 Jul 2022 22:52:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HHaw+iLNWt2de+Ka2GYphTR/zspAPxaWo2m+c1mXLJM=; b=JIAlraVNkbsFncObjeYWc9RDS3 YPKdAycEOBGidW0oPNj4/QdcVdcDpjJnyKq83azvXM1uZI4nvxnI2d85rWo83OzrLY8TRbuu/hM8X pSbUYEQeCxQVDO88OATvr5LGMJGbV9Irn9MoCxgQNux7eBP4QG916QVf4bu+Pn+OY/5aZqTXteRf+ fTmR3QeoH/C+eMu2IBhGVea6/podhyMzjggzxT0RTap2vGN9VU1hqgiFqR6+I3675vzaHrj3a7xlX V3SgUCNI6kmkMIK0S1krUMCDdHcVJNkDVdlzDhH59zQ4PaoPRWddpH4vsDDwHCtwG0Zk3rc25ypBt Y0Jx27qPLLJxKXY6w1Yt8OW2FmvyYckGnLqxvnKbG56SOrrHu9D7cuJhpy5MY7HSVgf8vXJ8VJjf1 FERf/R6RTPP2sO7qAV+HHyxarFQ2rM2BKf8HU5PkrvoCIIZi4q2PT99wF+q4m79/mZn1blaEG7a0E ewbe9QIjeCCMPtNeMyeI0of/H9INgUDdEn87DzCgavJawhfGnBL6P2tLEJ7AO0EJRxMBsTwzLDhcr GNNtzSfc7xsEGzi69dzyABQMYTvl0ZHTsXejYLglKIZ2QzoiaFCGyAPi1/XiEFKu3bXhqirvZx7Rr ef4VcyIO5eXkw4FAvv8d3Kuigbq0o5KsJflP+Vymo=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:18 +0100 Message-Id: <20220712215251.7944-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 07/40] pl050: introduce PL050DeviceClass for the PL050 device X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663382849100001 Content-Type: text/plain; charset="utf-8" This will soon be used to store the reference to the PL050 parent device for PL050_KBD_DEVICE and PL050_MOUSE_DEVICE. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 2 ++ include/hw/input/pl050.h | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index e32d86005a..d7796b73a1 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -216,6 +216,8 @@ static const TypeInfo pl050_type_info =3D { .parent =3D TYPE_SYS_BUS_DEVICE, .instance_init =3D pl050_init, .instance_size =3D sizeof(PL050State), + .class_init =3D pl050_class_init, + .class_size =3D sizeof(PL050DeviceClass), .abstract =3D true, .class_init =3D pl050_class_init, }; diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index bb0e87ff45..203f03a194 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -16,8 +16,14 @@ #include "hw/input/ps2.h" #include "hw/irq.h" =20 +struct PL050DeviceClass { + SysBusDeviceClass parent_class; + + DeviceRealize parent_realize; +}; + #define TYPE_PL050 "pl050" -OBJECT_DECLARE_SIMPLE_TYPE(PL050State, PL050) +OBJECT_DECLARE_TYPE(PL050State, PL050DeviceClass, PL050) =20 struct PL050State { SysBusDevice parent_obj; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663868655831.6582785079007; Tue, 12 Jul 2022 15:11:08 -0700 (PDT) Received: from localhost ([::1]:38940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO5y-00035n-GS for importer@patchew.org; Tue, 12 Jul 2022 18:11:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNoz-00005E-PU; Tue, 12 Jul 2022 17:53:34 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNoy-0007pe-7X; Tue, 12 Jul 2022 17:53:33 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnY-000Bqt-RX; Tue, 12 Jul 2022 22:52:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mUV606fwS5srLyJUjJGb13bzZqt7BufSkBqW3GxhArk=; b=J22ZqEukeTceFyQsL1U/ygd83S uAmfu5E1qsoFHbg/aGNg9XZhTbEnBEoO5GYtfOMbo8eTKJN47yEk8TOFAh3PBqAwgkGdk3LeVe7cP Tpv0jM7E+Biu5IYVmQWY0GxvNlc//v6MC5mdO+OHCE9t0x77VmOp40CPpSBKd0PlRYmJUPCZ3RLN7 JFHeEruddoe6G7Fj/NQn2nRkwjum3k5WMaAWoiNqykwqlAlVExYGOaCs0vQ3c8ec0ITo/pwk4mtNO kUe5MKnrnlGE9z3BlFmL9X0itNaYNhGKjiQWNIpaF6aol0T8vztCCFXNrMZ3g5GMCC5ymD1tNczZd /lwJFaaYFPIgkzmjPRGItdedDDDAU0RiK761Q+s7XBvCd1umU1GL+AQrYydahpX9xjpQgvTtWwYZn 36YvCBh6pzBNnrt/sMRpXBeR+h/9bkfa86dLHoLYeNLTGyG32WUFx4DchhZzNUYltBt3K5MC8jsX2 +K+G2DL0BwbFDpcm+VeMJmV3q+YkL8tu4uH+b3ur+Kd3JYFU9LVMmG5ZiVa5zpmnAeBAuPwTvg/Us o+DJI5A9/c+OBQy8pdtO8QWfeFJHlljlrUwwrFxffxqSuRQAGtU5roC883EjctlPPcx0EKhdv3SAj sSoRjDFXb8POpvGl1daCrndNgcx7weJsn4yNS7Bt4=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:19 +0100 Message-Id: <20220712215251.7944-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 08/40] pl050: introduce pl050_kbd_class_init() and pl050_kbd_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663869609100001 Content-Type: text/plain; charset="utf-8" Introduce a new pl050_kbd_class_init() function containing a call to device_class_set_parent_realize() which calls a new pl050_kbd_realize() function to initialise the PS2 keyboard device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index d7796b73a1..24363c007e 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -155,14 +155,21 @@ static void pl050_realize(DeviceState *dev, Error **e= rrp) =20 if (s->is_mouse) { s->ps2dev =3D ps2_mouse_init(); - } else { - s->ps2dev =3D ps2_kbd_init(); } =20 qdev_connect_gpio_out(DEVICE(s->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); } =20 +static void pl050_kbd_realize(DeviceState *dev, Error **errp) +{ + PL050DeviceClass *pdc =3D PL050_GET_CLASS(dev); + PL050State *ps =3D PL050(dev); + + ps->ps2dev =3D ps2_kbd_init(); + pdc->parent_realize(dev, errp); +} + static void pl050_kbd_init(Object *obj) { PL050State *s =3D PL050(obj); @@ -177,11 +184,21 @@ static void pl050_mouse_init(Object *obj) s->is_mouse =3D true; } =20 +static void pl050_kbd_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + PL050DeviceClass *pdc =3D PL050_CLASS(oc); + + device_class_set_parent_realize(dc, pl050_kbd_realize, + &pdc->parent_realize); +} + static const TypeInfo pl050_kbd_info =3D { .name =3D TYPE_PL050_KBD_DEVICE, .parent =3D TYPE_PL050, .instance_init =3D pl050_kbd_init, .instance_size =3D sizeof(PL050KbdState), + .class_init =3D pl050_kbd_class_init, }; =20 static const TypeInfo pl050_mouse_info =3D { --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663459986718.7253486004339; Tue, 12 Jul 2022 15:04:19 -0700 (PDT) Received: from localhost ([::1]:49694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNzP-0007wN-0m for importer@patchew.org; Tue, 12 Jul 2022 18:04:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNp3-00009W-JF; Tue, 12 Jul 2022 17:53:38 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNp1-0007px-VT; Tue, 12 Jul 2022 17:53:37 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnd-000Bqt-4z; Tue, 12 Jul 2022 22:52:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wUk1zNrealyYpxuRQ0CWaiPac3SrxCFs2IC+S6zjZnw=; b=b4kNktV9109dN1iPAHyskoKUK3 9g8prECE2ErjKWvXBPpt3zvklx7nGLau3G+uw4mPsahqDvOuRxT47gCC6ghtUzbc7Hf7wRt+pxqar VHhJxHb5/O/Y8NbPL/ZVF+W1ybqFQxVQJ9j6bdKoyzQZ0RPkWAPwgMhj+nyxNL7BQDyPxjzc/b/b6 8Otv3CAUFj4qXvpQ4Ct6WjXG+0KibBWQrpbtXSiDSI9buqz4w3481eQLQeJ8HW7Sk8lR7ANhHz0YI ZG+rjT8g+G61Ep+S0jvXqDGRBaWjKmav9YgNoCLJ/sk3tfk57EHgUlT1njRqCvv+f5v3OkQWQK6lo RgPp00B8dSbVMnBHxe/Idbl5ay1ip9P0kpCHmbRJ1YPSF0TwLTDgd4EL3V/UJmNxc6MB2UD0GAPnz 5hg79zOgH6Z8Cz5Z0bSaKNchLiVTir8MaY8Ytw/rEg72T+tvOQQLkTXaNmmVwIfdOfuW79YFwnhX6 kdzEhavrXU9gmS1HxZAIfeBYLOMfOIbmNg4S97cEaAS4E9Jih9Xi8z89cdAK6CBeMzcHv/7kfwljK mtGYFELCc/EeA/UUscZKi0CD7nkz/V2yYk/zdRYcstpHdVe76lpaM0wxxXqyA2hMaC96O50p+kJGd SkIbmKelDmZUMw1QdrsGSg+d/k4X7irdSQ6M3l4RE=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:20 +0100 Message-Id: <20220712215251.7944-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 09/40] pl050: introduce pl050_mouse_class_init() and pl050_mouse_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663461306100001 Content-Type: text/plain; charset="utf-8" Introduce a new pl050_mouse_class_init() function containing a call to device_class_set_parent_realize() which calls a new pl050_mouse_realize() function to initialise the PS2 mouse device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 24363c007e..fcc40758a3 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -153,10 +153,6 @@ static void pl050_realize(DeviceState *dev, Error **er= rp) { PL050State *s =3D PL050(dev); =20 - if (s->is_mouse) { - s->ps2dev =3D ps2_mouse_init(); - } - qdev_connect_gpio_out(DEVICE(s->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); } @@ -177,6 +173,15 @@ static void pl050_kbd_init(Object *obj) s->is_mouse =3D false; } =20 +static void pl050_mouse_realize(DeviceState *dev, Error **errp) +{ + PL050DeviceClass *pdc =3D PL050_GET_CLASS(dev); + PL050State *ps =3D PL050(dev); + + ps->ps2dev =3D ps2_mouse_init(); + pdc->parent_realize(dev, errp); +} + static void pl050_mouse_init(Object *obj) { PL050State *s =3D PL050(obj); @@ -201,11 +206,21 @@ static const TypeInfo pl050_kbd_info =3D { .class_init =3D pl050_kbd_class_init, }; =20 +static void pl050_mouse_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + PL050DeviceClass *pdc =3D PL050_CLASS(oc); + + device_class_set_parent_realize(dc, pl050_mouse_realize, + &pdc->parent_realize); +} + static const TypeInfo pl050_mouse_info =3D { .name =3D TYPE_PL050_MOUSE_DEVICE, .parent =3D TYPE_PL050, .instance_init =3D pl050_mouse_init, .instance_size =3D sizeof(PL050MouseState), + .class_init =3D pl050_mouse_class_init, }; =20 static void pl050_init(Object *obj) --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664061320561.7333379525256; Tue, 12 Jul 2022 15:14:21 -0700 (PDT) Received: from localhost ([::1]:48570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO95-0001Sr-Rp for importer@patchew.org; Tue, 12 Jul 2022 18:14:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNp6-0000Au-5j; Tue, 12 Jul 2022 17:53:40 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNp4-0007qY-NB; Tue, 12 Jul 2022 17:53:39 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnh-000Bqt-2Q; Tue, 12 Jul 2022 22:52:16 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JcVLl+rVpXhXb/s1IJ5coMAKF4+1LDw77VNDrbWtlDA=; b=Umv5GFMJrw+wVo1BZKV5Y/0op/ EsYEHDXvD+qUrHzXRuNGpIa0Ie+Q+SZgm9XlS8Ueghad+/d1VFcXIVaYmUdS0rbB0I+tlvDTs/V9x u+0T7rMJ5PA/abkKRdseB711wRbKZxD/KYaIdnh5zv38MMqkocUjphGQ0S56jieDI+97kvbN8KsNA FHXzP/6L/+KGUYvQBPY5VQKkSa1MUaRv53HI5Sm5Ek2BPOBeeBMKjNE00qZRxxi5wYvR1YXsbmNbd Qj1QAMUVvSrFUs6okn/TY2etBo5sczRiuq3NkP4RkkNbiaMjN7hpRNbiI4OCeZMp9z2tXzQP7RBYW dlsVhvKZsSwFwMzw6r46xaGTyrvxRtOJ1Uw1iQ8cFWkkDqGCi5nenheSG+dkTtSNH6GvHuwND7TeP qr4VP/Wy5M7T2BWpwUl3jehwfW8ACl7ORYvCJiDLu+4HgaxXcLODXieJypa3FcwfdKwtPg/12TU6h qLLT7H3Ew6Id+7pEl4mpvXtTMXXyZaU80w1lmZh8gUYXqNQGVDQW1mvPuA3T7HHgwlhKNN9dNevth xJPWRq2H6YVym0YKWkjmqx1u2b/g8sepjV40jrOjBhJXpLiiRIWsvVMLIZHF2tYO+Frbq+6b+egxx hw9xWbjxfem6rwPfj/pCJT8BoJ2FV0Et9K4kmTC3M=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:21 +0100 Message-Id: <20220712215251.7944-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 10/40] pl050: don't use legacy ps2_kbd_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664062337100001 Content-Type: text/plain; charset="utf-8" Instantiate the PS2 keyboard device within PL050KbdState using object_initialize_child() in pl050_kbd_init() and realize it in pl050_kbd_realize() accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 13 ++++++++++--- include/hw/input/pl050.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index fcc40758a3..64b579e877 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -160,17 +160,24 @@ static void pl050_realize(DeviceState *dev, Error **e= rrp) static void pl050_kbd_realize(DeviceState *dev, Error **errp) { PL050DeviceClass *pdc =3D PL050_GET_CLASS(dev); + PL050KbdState *s =3D PL050_KBD_DEVICE(dev); PL050State *ps =3D PL050(dev); =20 - ps->ps2dev =3D ps2_kbd_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->kbd), errp)) { + return; + } + + ps->ps2dev =3D PS2_DEVICE(&s->kbd); pdc->parent_realize(dev, errp); } =20 static void pl050_kbd_init(Object *obj) { - PL050State *s =3D PL050(obj); + PL050KbdState *s =3D PL050_KBD_DEVICE(obj); + PL050State *ps =3D PL050(obj); =20 - s->is_mouse =3D false; + ps->is_mouse =3D false; + object_initialize_child(obj, "kbd", &s->kbd, TYPE_PS2_KBD_DEVICE); } =20 static void pl050_mouse_realize(DeviceState *dev, Error **errp) diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index 203f03a194..28f6216dc3 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -43,6 +43,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVIC= E) =20 struct PL050KbdState { PL050State parent_obj; + + PS2KbdState kbd; }; =20 #define TYPE_PL050_MOUSE_DEVICE "pl050_mouse" --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663173425366.7222432577572; Tue, 12 Jul 2022 14:59:33 -0700 (PDT) Received: from localhost ([::1]:40346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNum-0001dL-E4 for importer@patchew.org; Tue, 12 Jul 2022 17:59:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpA-0000P5-Eu; Tue, 12 Jul 2022 17:53:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNp8-0007qx-Rb; Tue, 12 Jul 2022 17:53:44 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnk-000Bqt-Lx; Tue, 12 Jul 2022 22:52:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9y+Fhp33BhsQPg8m0LLJmcIdzq/PCsnONU1JLPoEowE=; b=n8ctcx873ZmIchiAcvSDnD3+Fo sBieY9E8ShuvznbLMoPggZc7H76MOQomaeIbDn2iLuZr9nN8+DYJPok8S1MPexbUKlpoVp4Q35iZ9 TZr2jxCgVbYGuHiaNbIvJWbCVRLTeKvV+vV4Q/HHSELuhAjLMKHhIfJO5ddUs9IavGEWwBy5zO7xd dRjFeiCEzlU+MzhnGG77jKSCttLVxXNeN8RPlT4viWmgjoDFnJcsf6JMDaAOk9JnNI2FdXJZCq1qw NDLz7Is43WyGqiH7P1xY+5ftCI3Ap2sW3TagZZcn+btqrUwizEleYiJ/ebW+9AZtF16qbYbs3TKY5 4+ClhOIZmYM2Kav0GAgX0Iy3XjRmLK3QyMuA1qo3PsONh8UUmOn2q+jxqDVirdgVVFFKMxj7uMYEl mg2pQrTX5PxemBSJRXP3CFxIxVykjNxacB+S1HUlb8fD1P1jhx/QU8pbL0xEbZSKRkoZrQk3/En8J b9CQ/9wdha6jdHaaNIpKwTIQT43jFvkLys3oQOMOHrQ5tlmD6OzOH4BJ+7NIklomkqqaJK/+eEHaP FxiliJhCqXOqaf/Obc5ufjU/SS5ESqbrM1PH6Xh0oBHvTNu6tGZ0zwel+qJKpHwdvD+mpfbmYtHpO O9MMZcgpCv2bhc6y2SiAyJ8gT9kvjJn7Op8hDsWfg=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:22 +0100 Message-Id: <20220712215251.7944-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 11/40] pl050: don't use legacy ps2_mouse_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663174637100001 Content-Type: text/plain; charset="utf-8" Instantiate the PS2 mouse device within PL050MouseState using object_initialize_child() in pl050_mouse_init() and realize it in pl050_mouse_realize() accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pl050.c | 13 ++++++++++--- include/hw/input/pl050.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/input/pl050.c b/hw/input/pl050.c index 64b579e877..ec5e19285e 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -183,17 +183,24 @@ static void pl050_kbd_init(Object *obj) static void pl050_mouse_realize(DeviceState *dev, Error **errp) { PL050DeviceClass *pdc =3D PL050_GET_CLASS(dev); + PL050MouseState *s =3D PL050_MOUSE_DEVICE(dev); PL050State *ps =3D PL050(dev); =20 - ps->ps2dev =3D ps2_mouse_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mouse), errp)) { + return; + } + + ps->ps2dev =3D PS2_DEVICE(&s->mouse); pdc->parent_realize(dev, errp); } =20 static void pl050_mouse_init(Object *obj) { - PL050State *s =3D PL050(obj); + PL050MouseState *s =3D PL050_MOUSE_DEVICE(obj); + PL050State *ps =3D PL050(obj); =20 - s->is_mouse =3D true; + ps->is_mouse =3D true; + object_initialize_child(obj, "mouse", &s->mouse, TYPE_PS2_MOUSE_DEVICE= ); } =20 static void pl050_kbd_class_init(ObjectClass *oc, void *data) diff --git a/include/hw/input/pl050.h b/include/hw/input/pl050.h index 28f6216dc3..89ec4fafc9 100644 --- a/include/hw/input/pl050.h +++ b/include/hw/input/pl050.h @@ -52,6 +52,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_D= EVICE) =20 struct PL050MouseState { PL050State parent_obj; + + PS2MouseState mouse; }; =20 #endif --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663463252158.00390264331793; Tue, 12 Jul 2022 15:04:23 -0700 (PDT) Received: from localhost ([::1]:49898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNzS-00084J-4a for importer@patchew.org; Tue, 12 Jul 2022 18:04:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpG-0000eA-1f; Tue, 12 Jul 2022 17:53:50 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpD-0007rF-Hu; Tue, 12 Jul 2022 17:53:48 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNno-000Bqt-KO; Tue, 12 Jul 2022 22:52:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ylf5mOMVt6EWrnSvuLiTfCcQfmoY4p/+xw/H0xk9fhk=; b=bSgf6Ku0L1ZqmIvbjbxhBmrSNN rEgSp8AczUhgn3iQw/oAzRWC0C8E/gBTns2JGn+dZ7SvFKDcds77aNzW/EDrKuXJfqrDqJYCNc9l8 Crw77KJFtpPCFuQ3r9c2yoebsaWI6rEfdXlhBmRVvVf+AHz9HYWFUsXO0/4OlqYbPth2rNGXahHdc ccWZ4NMQRBK4c2XwTG/u+YIOMoMBIEldc+ecxIRhPXc1UF/8TBZ1Wp1QX6rZFuuBjb/7eLSedTB6I D5TEOudK66z23inNb+/ZHib2NkbOzxXnahdCC3BJTJ4P4hsGa1rR4hqeiAjpY2mg+18hBm965/bdS oDgUq525DneX3UCGjZMnWz/8TI1fpIcLJpVLqoKwdXVg5fsfdBxnFz0tS7gTIAJOQdLAbXQppMqNT k+ejyvhV3ojtA1xkYoA2QQ1guWNpb6AUv+sztnRfepljcwVAorSBuK8U5+B0wDHvWA+yO8BcjF01F HdZosahTNutgL2ymjnnrZrh2QQhECjnLMskLDs/OqFfT9LNt1KVJUNJvtdZxGWKC+rpUPBZdOts24 0hQVUXoGxlisByFa30SMElJAeoTTGy6OSDre5y0/l3aj0A7Mauj3OFUtKDOASPZLDUmaVWf9YTIPB cvX1tXfo9I5PaRoqQSWkZx7XCaS3Yd4YZSy8+a4/0=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:23 +0100 Message-Id: <20220712215251.7944-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 12/40] lasips2: don't use vmstate_register() in lasips2_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663465286100001 Content-Type: text/plain; charset="utf-8" Since lasips2 is a qdev device then vmstate_ps2_mouse can be registered usi= ng the DeviceClass vmsd field instead. Note that due to the use of the base parameter in the original vmstate_regi= ster() function call, this is actually a migration break for the HPPA B160L machin= e. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 9223cb0af4..d4fa248729 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -272,8 +272,6 @@ static void lasips2_realize(DeviceState *dev, Error **e= rrp) { LASIPS2State *s =3D LASIPS2(dev); =20 - vmstate_register(NULL, s->base, &vmstate_lasips2, s); - s->kbd.dev =3D ps2_kbd_init(); qdev_connect_gpio_out(DEVICE(s->kbd.dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", @@ -319,6 +317,7 @@ static void lasips2_class_init(ObjectClass *klass, void= *data) DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->realize =3D lasips2_realize; + dc->vmsd =3D &vmstate_lasips2; device_class_set_props(dc, lasips2_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663678653990.4929801048426; Tue, 12 Jul 2022 15:07:58 -0700 (PDT) Received: from localhost ([::1]:59842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO2v-0006Wt-Lg for importer@patchew.org; Tue, 12 Jul 2022 18:07:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpK-0000sj-51; Tue, 12 Jul 2022 17:53:54 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42166) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpI-0007rj-GD; Tue, 12 Jul 2022 17:53:53 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnt-000Bqt-0R; Tue, 12 Jul 2022 22:52:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=W6HLJM8fGFCrC12DPqqsd/SWzorPBsUx+TvXB8qW3AQ=; b=1JaI12BUv5e8bWYvgNiupwxsdJ 41Xl5eJiSXZOUy5KMhnPtx8jZcYmvI/FAGWJLM2011IuRtRx5DAGNh05BHtXjm0QN9BFhtwlEgKl2 LEo5RUy4DpqTMh/j/lNqB+lv3CtxRKNvYiXlCk+u+pGKsOyoCDKgMbrYzI8xNaaNBGW8I1fOob4cy 37HpjxwUm1E6vExAl6yrCW9Yw81qNRtzOn2+YGR1EO4Jvwp60BYVAFek2NiW5VP6rW9BifzPP3nh4 eGPsxdyUIPy+wazq2uVjH7+SwwL9EyG9lCDYYbMEIJ3cqpBQftettKPzosH1Pal4wIIkBzVc5tQWM 9GLElKE+2hIXC0bHfGkml3vNTFvJQlJLcYatdYGqKKUv0ZMwSHPdh7h0zxK3/xX9R7Wkt3WtxJ4PT DFce3ZtsCT9gzph0Mi+wnrQ2/xsm3gk2irH5B/mt4Xl3pUxEAXF0NQbk7g947OmsI+EK5MZImoHbe iZkZqjQWTMEZi5Fl+0VnPlsSnCnThgqaKzYGaiNK6cQyJ/X+jAURBqDaIpwoGJaoAvrJjAkUSVlgP DG6O8AaXkaqIJghBNnEtl6DAysFmQSdlNw7ogmzBcwpVkECFO/RU9Y2FhDtC/bqHrVb9bFkjpBS/L uG73Bt/uZtdq7Qb7nb+Pfvpfbej3I9x0/t8XGlg+c=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:24 +0100 Message-Id: <20220712215251.7944-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 13/40] lasips2: remove the qdev base property and the lasips2_properties array X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663680598100001 Content-Type: text/plain; charset="utf-8" The base property was only needed for use by vmstate_register() in order to preserve migration compatibility. Now that the lasips2 migration state is registered through the DeviceClass vmsd field, the base property and also the lasips2_properties array can be removed completely as they are no longer required. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/hppa/machine.c | 3 +-- hw/input/lasips2.c | 9 +-------- include/hw/input/lasips2.h | 3 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 44ecd446c3..6080037cf1 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -280,8 +280,7 @@ static void machine_hppa_init(MachineState *machine) } =20 /* PS/2 Keyboard/Mouse */ - dev =3D DEVICE(lasips2_initfn(LASI_PS2KBD_HPA, - qdev_get_gpio_in(lasi_dev, + dev =3D DEVICE(lasips2_initfn(qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA))); memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA, sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index d4fa248729..40f77baf3e 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -255,12 +255,11 @@ static void lasips2_set_mouse_irq(void *opaque, int n= , int level) lasips2_update_irq(port->parent); } =20 -LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq) +LASIPS2State *lasips2_initfn(qemu_irq irq) { DeviceState *dev; =20 dev =3D qdev_new(TYPE_LASIPS2); - qdev_prop_set_uint64(dev, "base", base); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); @@ -307,18 +306,12 @@ static void lasips2_init(Object *obj) "ps2-mouse-input-irq", 1); } =20 -static Property lasips2_properties[] =3D { - DEFINE_PROP_UINT64("base", LASIPS2State, base, UINT64_MAX), - DEFINE_PROP_END_OF_LIST(), -}; - static void lasips2_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->realize =3D lasips2_realize; dc->vmsd =3D &vmstate_lasips2; - device_class_set_props(dc, lasips2_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } =20 diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 03f0c9e9f9..f051c970f0 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -39,7 +39,6 @@ typedef struct LASIPS2Port { struct LASIPS2State { SysBusDevice parent_obj; =20 - hwaddr base; LASIPS2Port kbd; LASIPS2Port mouse; qemu_irq irq; @@ -48,6 +47,6 @@ struct LASIPS2State { #define TYPE_LASIPS2 "lasips2" OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2State, LASIPS2) =20 -LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq); +LASIPS2State *lasips2_initfn(qemu_irq irq); =20 #endif /* HW_INPUT_LASIPS2_H */ --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165766451067212.68074929340844; Tue, 12 Jul 2022 15:21:50 -0700 (PDT) Received: from localhost ([::1]:39812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOGK-0006rl-QB for importer@patchew.org; Tue, 12 Jul 2022 18:21:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpk-0002DO-47; Tue, 12 Jul 2022 17:54:20 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpi-0007sC-L7; Tue, 12 Jul 2022 17:54:19 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNnw-000Bqt-Uj; Tue, 12 Jul 2022 22:52:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5TC/JZ0XeVhmOyPKf5/Y8r3bSWr1ARm+/kCLXuMQ4xM=; b=PhxGgFBosLMtBotqh5aWrOVyBh LSOBaXkLUqnp2tuPz6ycsLaUvdQUm/cZRTCEIyOkSNvhVtccZW6TjUUhPFWGPILAizlBS4APeZy58 9QoWAgEYA8S8kXFLos8BOXOHzJFJRk6D7RakZuqr9c9PUBh2eHC7vMEQpU9+mjUdJlWAv+YpTsrTH d1fgPfnif+/tU7eXepM5BFNg5iuOqFtr6AY7474FKtTof7+SPCL4O9tq/FKZRW/YCjwelf7dmIXcG BFdg1lDF6dwa7kNDLoMr6Nkhh86Oj0pskeHrUfUEue1IzqBIg1MV6RclXBhaeeZBESDe13vLsg4Bf ykWMAAoO6b404BWNf5KwYol1zFe+sM6125yKRx6q+soXXGZgfFw16AJQvvDEyizsb+nNbLY/lNmRy 0YV5KqKsI4KIHaLJNJos2QfNG5QKBo3KRGa1QKEsp2/ql4CAWJjjenIrjkfj8ejxTa+A+8bHiNjva VbyhZYdAEdYmtmqcEJDVgIRHQphmBgiDEoVCVlByFOGy0Htv86Iw1vcl6ysMPuJ2H/6wyrVb1wLF8 3WSuEhV5RriDAesMc3FaJm2uGgX7ogrwmjPP42wG7hZ5BMdwt7kAdN6AZ3eEjwnnZ2owUC23Xu0oB lIsFrv1Wbs7a5pZUyGARex53ZTwlbf5jq4JkP1n2A=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:25 +0100 Message-Id: <20220712215251.7944-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 14/40] lasips2: remove legacy lasips2_initfn() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664511416100001 Content-Type: text/plain; charset="utf-8" There is only one user of the legacy lasips2_initfn() function which is in machine_hppa_init(), so inline its functionality into machine_hppa_init() a= nd then remove it. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/hppa/machine.c | 6 ++++-- hw/input/lasips2.c | 12 ------------ include/hw/input/lasips2.h | 2 -- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 6080037cf1..e53d5f0fa7 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -280,8 +280,10 @@ static void machine_hppa_init(MachineState *machine) } =20 /* PS/2 Keyboard/Mouse */ - dev =3D DEVICE(lasips2_initfn(qdev_get_gpio_in(lasi_dev, - LASI_IRQ_PS2KBD_HPA))); + dev =3D qdev_new(TYPE_LASIPS2); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, + qdev_get_gpio_in(lasi_dev, LASI_IRQ_PS2KBD_HPA)); memory_region_add_subregion(addr_space, LASI_PS2KBD_HPA, sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 40f77baf3e..48237816a3 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -255,18 +255,6 @@ static void lasips2_set_mouse_irq(void *opaque, int n,= int level) lasips2_update_irq(port->parent); } =20 -LASIPS2State *lasips2_initfn(qemu_irq irq) -{ - DeviceState *dev; - - dev =3D qdev_new(TYPE_LASIPS2); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); - - return LASIPS2(dev); -} - static void lasips2_realize(DeviceState *dev, Error **errp) { LASIPS2State *s =3D LASIPS2(dev); diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index f051c970f0..868c5521d7 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -47,6 +47,4 @@ struct LASIPS2State { #define TYPE_LASIPS2 "lasips2" OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2State, LASIPS2) =20 -LASIPS2State *lasips2_initfn(qemu_irq irq); - #endif /* HW_INPUT_LASIPS2_H */ --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664269589664.74519753089; Tue, 12 Jul 2022 15:17:49 -0700 (PDT) Received: from localhost ([::1]:59300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOCQ-0000hr-VV for importer@patchew.org; Tue, 12 Jul 2022 18:17:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpO-00017B-0T; Tue, 12 Jul 2022 17:53:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpM-0007s5-DZ; Tue, 12 Jul 2022 17:53:57 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNo1-000Bqt-06; Tue, 12 Jul 2022 22:52:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EoJQpRAZrwYF2UxWIqAxBwfJ4r+ZZ+bKqmxVQja80lM=; b=BX0VzOD6YxsJPI4pam1jZvscfP c3gK8LgA3XEjjLNlyWz21U9+uWP32QHLiZ7f0pfXnlppkoVWy9gWdQuAdPOC3SDJYExabmMH30mXX +xx6mteAk2ko2PK8QAzyJDFV2hZ9r2T6jaSAZqhbL/YgqEOYWLCXUhjeo6Dl8WNBfHeiAUl5rETPu rFWyy625H5+30OqXsYBL6TnDJKE35rJerdvCx3P9ZauSZx//J/q3Ei8hWt1pZo2X3FJZ5H/Zq3rW/ 7ANmKmFQmvNkUkwUiGcWy7uJSzQocpdAmuH9PGs4K7tzXWWPlwU1V9WaSWZZw4lIv/q1yG/E5MI7X 1jCJplhynddsWuB06IaZLH4Bir0wtvaCR/jyqbUciy/eCn7d0vyahdibEOk/pM2oFmRAkagYQGsoP 4v0xsZfTZoDsc6Z9oDE2ydzvDbGWwEtnWhOTv0VIIH6oAECeH/IO53G4+lnBXQy8ehIA5FlXvLR9P ZWlE1B2Lsg1MCamLAnF6zCVXoijCGIlc1s5L1uCUIeQDVa5c7VyNxQcxEXUfEp2ufDCtXepPigGip O9Tc0pryVWTcNYMIij8UpP6CVHF8rRidN1JaXrRUFSViEpho9h9hPqfh9reBf0CYCFUsxknxp2PR3 5CABee2SHwxB/P/N1TarbEHEV9G+DPdbHKvBxe2w0=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:26 +0100 Message-Id: <20220712215251.7944-16-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 15/40] lasips2: change LASIPS2State dev pointer from void to PS2State X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664272168100001 Content-Type: text/plain; charset="utf-8" This allows the compiler to enforce that the PS2 device pointer is always of type PS2State. Update the name of the pointer from dev to ps2dev to emphasi= se this type change. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 16 ++++++++-------- include/hw/input/lasips2.h | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 48237816a3..b539c4de7a 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -146,9 +146,9 @@ static void lasips2_reg_write(void *opaque, hwaddr addr= , uint64_t val, } =20 if (port->id) { - ps2_write_mouse(port->dev, val); + ps2_write_mouse(PS2_MOUSE_DEVICE(port->ps2dev), val); } else { - ps2_write_keyboard(port->dev, val); + ps2_write_keyboard(PS2_KBD_DEVICE(port->ps2dev), val); } break; =20 @@ -181,7 +181,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) break; } =20 - ret =3D ps2_read_data(port->dev); + ret =3D ps2_read_data(port->ps2dev); break; =20 case REG_PS2_CONTROL: @@ -206,7 +206,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) ret |=3D LASIPS2_STATUS_RBNE; } } else { - if (!ps2_queue_empty(port->dev)) { + if (!ps2_queue_empty(port->ps2dev)) { ret |=3D LASIPS2_STATUS_RBNE; } } @@ -259,12 +259,12 @@ static void lasips2_realize(DeviceState *dev, Error *= *errp) { LASIPS2State *s =3D LASIPS2(dev); =20 - s->kbd.dev =3D ps2_kbd_init(); - qdev_connect_gpio_out(DEVICE(s->kbd.dev), PS2_DEVICE_IRQ, + s->kbd.ps2dev =3D ps2_kbd_init(); + qdev_connect_gpio_out(DEVICE(s->kbd.ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); - s->mouse.dev =3D ps2_mouse_init(); - qdev_connect_gpio_out(DEVICE(s->mouse.dev), PS2_DEVICE_IRQ, + s->mouse.ps2dev =3D ps2_mouse_init(); + qdev_connect_gpio_out(DEVICE(s->mouse.ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", 0)); } diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 868c5521d7..9746b7a132 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -23,12 +23,13 @@ =20 #include "exec/hwaddr.h" #include "hw/sysbus.h" +#include "hw/input/ps2.h" =20 struct LASIPS2State; typedef struct LASIPS2Port { struct LASIPS2State *parent; MemoryRegion reg; - void *dev; + PS2State *ps2dev; uint8_t id; uint8_t control; uint8_t buf; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663916200209.28556724066368; Tue, 12 Jul 2022 15:11:56 -0700 (PDT) Received: from localhost ([::1]:41736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO6k-00050z-TW for importer@patchew.org; Tue, 12 Jul 2022 18:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpl-0002Gm-EC; Tue, 12 Jul 2022 17:54:21 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpj-0007sI-2Z; Tue, 12 Jul 2022 17:54:21 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNo1-000Bqt-JA; Tue, 12 Jul 2022 22:52:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vYDoaLGOSh9zh6SxbCzMeBkFO57cLarjy2f54HLBIZU=; b=I2BKH6wz+Wa+/rte4WJq+CoZKx HvPSRzNqHajNaUNbGLZfcCTC9nU8gv+OqY5VjTB13tpQQG2hwzmRtBFg8hd/C74Br2+l0cok3oBom qIKwXSKZYDDv0ssnpy17DTcpy/I3ovwfmDFszMnTfqHnkTnnCe8qmj9tldb4D9aBEUH/bkru/gecV 9Xc2tWMQTmG4C+I+3cRAF0UB9qCxStEwtO6kSQKkp2OeG3SSL79XbMWdMC3QsSQn/bJ1K16FFP/xu uMu9m0mGWoLggjlrBQjAVkwDG31xBdu7kJDIhOzW4wx44sY90IEc5CPjesyzPA899YemccmvrrLOy 8/yLb2imTferhFRItuiSPhV8gbv4wDdrJxY3FFEVfv8sZRfhDPGSMRWtb06V+jHAqecphpQA8owxs sYAdY6A1w38iopn+ZDzzhWI9DGffGukJLQlHnpn+bBmq8GyQAIAWAXDHbGixGlMABmG3EtflVaF7Z d3PymSb+sZ02zazI8xorDQtG0s2PvInX0pAQV9eFEtggL/vKJB7vYELagle3qwHmG0T7+h0MS0pBB NeeYNe/gx+v+Mh6pxmsxXzJnpeRCg2e8a+73RczBYwEufQ5u1zXC4qmV3JN0RNyRUs8xncxSN0Rfy eyBSmxGRe1UgIthGWgm0UM7gx5yhJ+5HlSR+WrJoo=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:27 +0100 Message-Id: <20220712215251.7944-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 16/40] lasips2: QOMify LASIPS2Port X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663917645100001 Content-Type: text/plain; charset="utf-8" This becomes an abstract QOM type which will be a parent type for separate keyboard and mouse port types. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 8 ++++++++ include/hw/input/lasips2.h | 14 ++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index b539c4de7a..56bfd759af 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -311,9 +311,17 @@ static const TypeInfo lasips2_info =3D { .class_init =3D lasips2_class_init, }; =20 +static const TypeInfo lasips2_port_info =3D { + .name =3D TYPE_LASIPS2_PORT, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(LASIPS2Port), + .abstract =3D true, +}; + static void lasips2_register_types(void) { type_register_static(&lasips2_info); + type_register_static(&lasips2_port_info); } =20 type_init(lasips2_register_types) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 9746b7a132..f4514081fe 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -25,9 +25,15 @@ #include "hw/sysbus.h" #include "hw/input/ps2.h" =20 -struct LASIPS2State; -typedef struct LASIPS2Port { - struct LASIPS2State *parent; +#define TYPE_LASIPS2_PORT "lasips2-port" +OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2Port, LASIPS2_PORT) + +typedef struct LASIPS2State LASIPS2State; + +struct LASIPS2Port { + DeviceState parent_obj; + + LASIPS2State *parent; MemoryRegion reg; PS2State *ps2dev; uint8_t id; @@ -35,7 +41,7 @@ typedef struct LASIPS2Port { uint8_t buf; bool loopback_rbne; bool irq; -} LASIPS2Port; +}; =20 struct LASIPS2State { SysBusDevice parent_obj; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664685357755.1236024821198; Tue, 12 Jul 2022 15:24:45 -0700 (PDT) Received: from localhost ([::1]:48302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOJA-0004E2-3i for importer@patchew.org; Tue, 12 Jul 2022 18:24:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpn-0002Md-UZ; Tue, 12 Jul 2022 17:54:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpm-0007sQ-Dp; Tue, 12 Jul 2022 17:54:23 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNo5-000Bqt-6E; Tue, 12 Jul 2022 22:52:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X6sC1OZTXLEfI5S5DKqwWLHrN8liDQWvWG/qVo/EOvU=; b=WAoUnpRhlWIe/yYDi2oQ6Z4gws wHr2JqeuvINHn/Z0p2KWlAqHDGNERNEv1NdVhsEO31s6q2y4e+9T48Jz+5NML1Cq8pBOpzeDfALyT jLobucYnJlVSViEfn6iQxz1Yh5kUuj2AWgRbR+t4hIpf7r4LbdVUK25ynqiNlFD6Ge2qJu0u3orh6 qIZwrWDY0ZzmZTi8ltBNxRIUIyJWQhaefLdaSdpJ0Z8ryYsiwVCzK9EFR35VG6sE1D1lWke1U+K5R sXxH3VMtapqguEKAj3aTAdwT41MgZgN7uGfH9N2O2r3Q/+JugnFnfG6HZcIKPVhNkIjTFFzFKXkvU VRBSIiRTKbHDdlW10RPWzzyggx8qK30pjWu/0gh00XzGN3XVFnrxYq/Q9jBAvNAZaGI6f73em7txR nSZmfe9YOizGPXRrgJZ2U/SYCbLuIQC13CpG48YVL+wal/fQwh9XbC0XfImQx+uLMKy6FT25HS3+/ VvAnAnMBqZEhJrAUm2nMa+gIg7TCdozwPdFtL8f/HtiTfrZ/5xkuxDVhzWD+wQRJDAVnRmM4CkZKj FAIPjx2dZ/WaTcZhJgrvK4d1gi7U1kfN7v/Szx2+yXdCOHOEkeKjYW0Y1ABukIXGWsf/zwcF71KhX 2tTL7LUYXm8OWDJksKBz4PDEEXXsJRQn9pXxV7Gno=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:28 +0100 Message-Id: <20220712215251.7944-18-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 17/40] lasips2: introduce new LASIPS2_KBD_PORT QOM type X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664686905100001 Content-Type: text/plain; charset="utf-8" This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 7 +++++++ include/hw/input/lasips2.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 56bfd759af..b043f2e264 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -318,10 +318,17 @@ static const TypeInfo lasips2_port_info =3D { .abstract =3D true, }; =20 +static const TypeInfo lasips2_kbd_port_info =3D { + .name =3D TYPE_LASIPS2_KBD_PORT, + .parent =3D TYPE_LASIPS2_PORT, + .instance_size =3D sizeof(LASIPS2KbdPort), +}; + static void lasips2_register_types(void) { type_register_static(&lasips2_info); type_register_static(&lasips2_port_info); + type_register_static(&lasips2_kbd_port_info); } =20 type_init(lasips2_register_types) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index f4514081fe..504e2c06de 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -43,6 +43,13 @@ struct LASIPS2Port { bool irq; }; =20 +#define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port" +OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2KbdPort, LASIPS2_KBD_PORT) + +struct LASIPS2KbdPort { + LASIPS2Port parent_obj; +}; + struct LASIPS2State { SysBusDevice parent_obj; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664091609635.4159414575919; Tue, 12 Jul 2022 15:14:51 -0700 (PDT) Received: from localhost ([::1]:50128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO9a-0002VL-9a for importer@patchew.org; Tue, 12 Jul 2022 18:14:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpw-0002o6-Ig; Tue, 12 Jul 2022 17:54:32 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpu-0007t1-K9; Tue, 12 Jul 2022 17:54:32 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNo8-000Bqt-Ov; Tue, 12 Jul 2022 22:52:44 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JpYNk7mGRyTYOqvnyZUFnLqaAlX8Z3HAtsEf/JXhtWY=; b=QWjrPcitD3S00Wfk763NiByPbt yyLxVfPvdVgKL7CRdmwEXeDG9Y4nuWjm49wwkAQQOALDBTf4396cg+nCzbAnZfgrg+v+Am8w/SjNA VL5EOM671RG+B/oMVivU/HUgAPq+p6IldW9tvuDHjBrV5sFBJnhOfWAEMgvyr820djsZfFBSAhfh/ WnzaogVXL/b+7b2nTVn37wk9Hx1UGUPp8dkjtGe5OyPdhBZ0r3OiEHRoB8hJybeeUvoKwkHAnhMAY 89rtuJQ4elVfp0eDJPc8JF2K5/Iycncb2uw5PbOl4VXePWXD4ie4Uffuj7vu7O516+oAC6WYZs8Bd wNX1uN5SsMlvJ0v6ZkM1GGbP/DS4pKIpjNNHX7TnN/KIRJDI00HXQ/5W7PnjssQj/1dL7rkIM2nwx Wg/CAKSmOcWfU/yYC59YB9vrDqBuZby50bShKydZ8haf4v3ktBG6Oh7V0t1bPy7VNEwaCj0u4sZ3C GYaW/iAC1dAkIUdm76DBvBggfkAu698Ool4OxC+wwx6Bia4zuANWtHeQpa/C3tDb6dEaKtBB2nzPc 7WxdESpBPMVuD691hCZcbIJaVngujEHb6ygMF5JymvzrslXGdwns7lJ004eJIArjcLO/0o01WlvUx aSOZekD+XkPm+bVYpo1ku1Ij3NpovSnW7CLU8PuNI=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:29 +0100 Message-Id: <20220712215251.7944-19-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 18/40] lasips2: introduce new LASIPS2_MOUSE_PORT QOM type X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664092407100001 Content-Type: text/plain; charset="utf-8" This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 7 +++++++ include/hw/input/lasips2.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index b043f2e264..f70cf893f6 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -324,11 +324,18 @@ static const TypeInfo lasips2_kbd_port_info =3D { .instance_size =3D sizeof(LASIPS2KbdPort), }; =20 +static const TypeInfo lasips2_mouse_port_info =3D { + .name =3D TYPE_LASIPS2_MOUSE_PORT, + .parent =3D TYPE_LASIPS2_PORT, + .instance_size =3D sizeof(LASIPS2MousePort), +}; + static void lasips2_register_types(void) { type_register_static(&lasips2_info); type_register_static(&lasips2_port_info); type_register_static(&lasips2_kbd_port_info); + type_register_static(&lasips2_mouse_port_info); } =20 type_init(lasips2_register_types) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 504e2c06de..aab6a3500c 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -50,6 +50,13 @@ struct LASIPS2KbdPort { LASIPS2Port parent_obj; }; =20 +#define TYPE_LASIPS2_MOUSE_PORT "lasips2-mouse-port" +OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2MousePort, LASIPS2_MOUSE_PORT) + +struct LASIPS2MousePort { + LASIPS2Port parent_obj; +}; + struct LASIPS2State { SysBusDevice parent_obj; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165766495502894.95664863510524; Tue, 12 Jul 2022 15:29:15 -0700 (PDT) Received: from localhost ([::1]:56588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBONV-0001Vv-Ak for importer@patchew.org; Tue, 12 Jul 2022 18:29:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNq1-000386-JO; Tue, 12 Jul 2022 17:54:37 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpx-0007t6-5N; Tue, 12 Jul 2022 17:54:37 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoC-000Bqt-LJ; Tue, 12 Jul 2022 22:52:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7VonB9otHaI0cb+mvGnQodb+2sGUOEDb+7wWM+xUCpg=; b=AFLrJe7e3S+NolAuX4CRnjtV5i 0uGvRzU6PfLW4mxhhjvSen7kQAoIzLsP+nNowUzSbq9TZHCTo9CJe9qt9IP5i+WKl2pTox3CPx4Qu CXLvL4XZdRqhxvHN4quDiziF/Rm7ybasa19vESVc0EiWOkZ5SzP8yzwMfqyqwp9yJjGw8HAsiiBYS vhO5JCS8xPQnCnnlWvuXN56tuUN72uV0D7xG5tlaS2TY/8n/YFeEiZNrmQNhUjKhPsYVVSH9dOa8r pIy0jWac7q36djHwRi8Fu+Ca8V4nZCpWc+yUpciocm/HmF99Ld+IbzVB7shCkaCcfF4nIiFz15uLY NIX6Hkhk9tsk+lGRa8+OHg204WMw0KlyWAfarDOao8XPOFKmZ4+muBCkCoGURFpRZ0TBHvHhgT1qc us2AQNCVpJMvxGqncivnjwCOrTJenpgFZp+JvCYMWFFF0oKMIRqB3QoRrKBtQHctS9NhP2zrRggKH zuSE4da2WYTTjGbVDiBshNNTOyDc1AYgLqlVPNw1t+ujm8Jp0NSeRYT/Prey33fdMQQ55/IyNYVlG WBX8shj+A3DOqd6GbBn/NQ2y5nz9rg7OVm6Wj5N98FFGpBiWsF50hdSmKxMXO4zt0yJs4RsNRLezW jwi0qp8ztWWR6H5DANP4r0aP86JRhI1A9UsOvUwnY=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:30 +0100 Message-Id: <20220712215251.7944-20-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 19/40] lasips2: move keyboard port initialisation to new lasips2_kbd_port_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664956700100001 Content-Type: text/plain; charset="utf-8" Move the initialisation of the keyboard port from lasips2_init() to a new lasips2_kbd_port_init() function which will be invoked using object_initialize_child() during the LASIPS2 device init. Update LASIPS2State so that it now holds the new LASIPS2KbdPort child objec= t and ensure that it is realised in lasips2_realize(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 47 ++++++++++++++++++++++++++------------ include/hw/input/lasips2.h | 2 +- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index f70cf893f6..74427c9990 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -40,9 +40,9 @@ static const VMStateDescription vmstate_lasips2 =3D { .version_id =3D 0, .minimum_version_id =3D 0, .fields =3D (VMStateField[]) { - VMSTATE_UINT8(kbd.control, LASIPS2State), - VMSTATE_UINT8(kbd.id, LASIPS2State), - VMSTATE_BOOL(kbd.irq, LASIPS2State), + VMSTATE_UINT8(kbd_port.parent_obj.control, LASIPS2State), + VMSTATE_UINT8(kbd_port.parent_obj.id, LASIPS2State), + VMSTATE_BOOL(kbd_port.parent_obj.irq, LASIPS2State), VMSTATE_UINT8(mouse.control, LASIPS2State), VMSTATE_UINT8(mouse.id, LASIPS2State), VMSTATE_BOOL(mouse.irq, LASIPS2State), @@ -119,8 +119,8 @@ static const char *lasips2_write_reg_name(uint64_t addr) =20 static void lasips2_update_irq(LASIPS2State *s) { - trace_lasips2_intr(s->kbd.irq | s->mouse.irq); - qemu_set_irq(s->irq, s->kbd.irq | s->mouse.irq); + trace_lasips2_intr(s->kbd_port.parent_obj.irq | s->mouse.irq); + qemu_set_irq(s->irq, s->kbd_port.parent_obj.irq | s->mouse.irq); } =20 static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, @@ -211,7 +211,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) } } =20 - if (port->parent->kbd.irq || port->parent->mouse.irq) { + if (port->parent->kbd_port.parent_obj.irq || port->parent->mouse.i= rq) { ret |=3D LASIPS2_STATUS_CMPINTR; } break; @@ -240,7 +240,7 @@ static const MemoryRegionOps lasips2_reg_ops =3D { static void lasips2_set_kbd_irq(void *opaque, int n, int level) { LASIPS2State *s =3D LASIPS2(opaque); - LASIPS2Port *port =3D &s->kbd; + LASIPS2Port *port =3D LASIPS2_PORT(&s->kbd_port); =20 port->irq =3D level; lasips2_update_irq(port->parent); @@ -258,9 +258,15 @@ static void lasips2_set_mouse_irq(void *opaque, int n,= int level) static void lasips2_realize(DeviceState *dev, Error **errp) { LASIPS2State *s =3D LASIPS2(dev); + LASIPS2Port *lp; =20 - s->kbd.ps2dev =3D ps2_kbd_init(); - qdev_connect_gpio_out(DEVICE(s->kbd.ps2dev), PS2_DEVICE_IRQ, + lp =3D LASIPS2_PORT(&s->kbd_port); + if (!(qdev_realize(DEVICE(lp), NULL, errp))) { + return; + } + + lp->ps2dev =3D ps2_kbd_init(); + qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); s->mouse.ps2dev =3D ps2_mouse_init(); @@ -272,18 +278,19 @@ static void lasips2_realize(DeviceState *dev, Error *= *errp) static void lasips2_init(Object *obj) { LASIPS2State *s =3D LASIPS2(obj); + LASIPS2Port *lp; + + object_initialize_child(obj, "lasips2-kbd-port", &s->kbd_port, + TYPE_LASIPS2_KBD_PORT); =20 - s->kbd.id =3D 0; s->mouse.id =3D 1; - s->kbd.parent =3D s; s->mouse.parent =3D s; =20 - memory_region_init_io(&s->kbd.reg, obj, &lasips2_reg_ops, &s->kbd, - "lasips2-kbd", 0x100); memory_region_init_io(&s->mouse.reg, obj, &lasips2_reg_ops, &s->mouse, "lasips2-mouse", 0x100); =20 - sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->kbd.reg); + lp =3D LASIPS2_PORT(&s->kbd_port); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &lp->reg); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mouse.reg); =20 sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); @@ -318,10 +325,22 @@ static const TypeInfo lasips2_port_info =3D { .abstract =3D true, }; =20 +static void lasips2_kbd_port_init(Object *obj) +{ + LASIPS2KbdPort *s =3D LASIPS2_KBD_PORT(obj); + LASIPS2Port *lp =3D LASIPS2_PORT(obj); + + memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-kb= d", + 0x100); + lp->id =3D 0; + lp->parent =3D container_of(s, LASIPS2State, kbd_port); +} + static const TypeInfo lasips2_kbd_port_info =3D { .name =3D TYPE_LASIPS2_KBD_PORT, .parent =3D TYPE_LASIPS2_PORT, .instance_size =3D sizeof(LASIPS2KbdPort), + .instance_init =3D lasips2_kbd_port_init, }; =20 static const TypeInfo lasips2_mouse_port_info =3D { diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index aab6a3500c..f728f54c78 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -60,7 +60,7 @@ struct LASIPS2MousePort { struct LASIPS2State { SysBusDevice parent_obj; =20 - LASIPS2Port kbd; + LASIPS2KbdPort kbd_port; LASIPS2Port mouse; qemu_irq irq; }; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663717722135.87594382301552; Tue, 12 Jul 2022 15:08:37 -0700 (PDT) Received: from localhost ([::1]:32924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO3Y-0007PP-KW for importer@patchew.org; Tue, 12 Jul 2022 18:08:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNq1-00037M-Dx; Tue, 12 Jul 2022 17:54:37 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42268) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNpy-0007tF-Sz; Tue, 12 Jul 2022 17:54:37 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoH-000Bqt-4s; Tue, 12 Jul 2022 22:52:53 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QaHcGUblxmmANxEdiCNI1P/pRBpq8u4Je9D39gKPaBw=; b=uBlHTrSn9VvOBRDN9ZagPRsEVK 7Wjv3Gxayr+CdTSXlUzyPB7s3orohzDX4cJo4Oick3ATOLCLF5WJQQC7kAGuvuJguJgOWMtTMUBcy wjic3TlPh5JKv20QbW+xlRTFu1VdmBfK4SbTXnSAumkInWsrP/ou7Liz4oBXIXYlK1FKmuV5t3DIb O6RO8032A5tWMrn91Vn4dbC874mOCvSw6VI+0P6JKMZNUd4h+Q7D5u2y+4lJ3VwiUFUj94nLUWmhU P7MYmUfoaM4rKUUmPjInFPaOj+vHDm9X+CGRVWgSzQ/ksPVfoWnJNWsHyK9hfwSg3PEJViTLsh8vj cpHjEkMAvAWEhOcb9y+GF2O3eXSckWCFwzTbHTog+7LKWgW7V9pxVoFyKk89PNlqTpYBhvHdmp/Ui 7WgPfA5EnQh+LrKHCPUBHmVu41wt0JcEI4sfEvqY1gPhzFyi8euGxAloieFzu30NtKtjn80G9cPit baRiCJBZYslbaE3dsj772zuG1/xhgYX25DkexxPe70mySTNJUxlvupQgevYnovM0RMvMPGz04rsG+ zrIcfy8ns/nLsiJKazhtmKUTMqOcVjk2//I0Iuq3SBep+tyEVsrPNFAuxoX9x+3ePMisZJA5PbVYp oeCnkwWO10HFRXy+RaA2XIpOMNW7aPlnCQSE0lq/M=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:31 +0100 Message-Id: <20220712215251.7944-21-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 20/40] lasips2: move mouse port initialisation to new lasips2_mouse_port_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663718825100001 Content-Type: text/plain; charset="utf-8" Move the initialisation of the mouse port from lasips2_init() to a new lasips2_mouse_port_init() function which will be invoked using object_initialize_child() during the LASIPS2 device init. Update LASIPS2State so that it now holds the new LASIPS2MousePort child obj= ect and ensure that it is realised in lasips2_realize(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 52 +++++++++++++++++++++++++------------- include/hw/input/lasips2.h | 2 +- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 74427c9990..9535cab268 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -43,9 +43,9 @@ static const VMStateDescription vmstate_lasips2 =3D { VMSTATE_UINT8(kbd_port.parent_obj.control, LASIPS2State), VMSTATE_UINT8(kbd_port.parent_obj.id, LASIPS2State), VMSTATE_BOOL(kbd_port.parent_obj.irq, LASIPS2State), - VMSTATE_UINT8(mouse.control, LASIPS2State), - VMSTATE_UINT8(mouse.id, LASIPS2State), - VMSTATE_BOOL(mouse.irq, LASIPS2State), + VMSTATE_UINT8(mouse_port.parent_obj.control, LASIPS2State), + VMSTATE_UINT8(mouse_port.parent_obj.id, LASIPS2State), + VMSTATE_BOOL(mouse_port.parent_obj.irq, LASIPS2State), VMSTATE_END_OF_LIST() } }; @@ -119,8 +119,10 @@ static const char *lasips2_write_reg_name(uint64_t add= r) =20 static void lasips2_update_irq(LASIPS2State *s) { - trace_lasips2_intr(s->kbd_port.parent_obj.irq | s->mouse.irq); - qemu_set_irq(s->irq, s->kbd_port.parent_obj.irq | s->mouse.irq); + trace_lasips2_intr(s->kbd_port.parent_obj.irq | + s->mouse_port.parent_obj.irq); + qemu_set_irq(s->irq, s->kbd_port.parent_obj.irq | + s->mouse_port.parent_obj.irq); } =20 static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, @@ -211,8 +213,9 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) } } =20 - if (port->parent->kbd_port.parent_obj.irq || port->parent->mouse.i= rq) { - ret |=3D LASIPS2_STATUS_CMPINTR; + if (port->parent->kbd_port.parent_obj.irq || + port->parent->mouse_port.parent_obj.irq) { + ret |=3D LASIPS2_STATUS_CMPINTR; } break; =20 @@ -249,7 +252,7 @@ static void lasips2_set_kbd_irq(void *opaque, int n, in= t level) static void lasips2_set_mouse_irq(void *opaque, int n, int level) { LASIPS2State *s =3D LASIPS2(opaque); - LASIPS2Port *port =3D &s->mouse; + LASIPS2Port *port =3D LASIPS2_PORT(&s->mouse_port); =20 port->irq =3D level; lasips2_update_irq(port->parent); @@ -269,8 +272,14 @@ static void lasips2_realize(DeviceState *dev, Error **= errp) qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); - s->mouse.ps2dev =3D ps2_mouse_init(); - qdev_connect_gpio_out(DEVICE(s->mouse.ps2dev), PS2_DEVICE_IRQ, + + lp =3D LASIPS2_PORT(&s->mouse_port); + if (!(qdev_realize(DEVICE(lp), NULL, errp))) { + return; + } + + lp->ps2dev =3D ps2_mouse_init(); + qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", 0)); } @@ -282,16 +291,13 @@ static void lasips2_init(Object *obj) =20 object_initialize_child(obj, "lasips2-kbd-port", &s->kbd_port, TYPE_LASIPS2_KBD_PORT); - - s->mouse.id =3D 1; - s->mouse.parent =3D s; - - memory_region_init_io(&s->mouse.reg, obj, &lasips2_reg_ops, &s->mouse, - "lasips2-mouse", 0x100); + object_initialize_child(obj, "lasips2-mouse-port", &s->mouse_port, + TYPE_LASIPS2_MOUSE_PORT); =20 lp =3D LASIPS2_PORT(&s->kbd_port); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &lp->reg); - sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mouse.reg); + lp =3D LASIPS2_PORT(&s->mouse_port); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &lp->reg); =20 sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); =20 @@ -343,10 +349,22 @@ static const TypeInfo lasips2_kbd_port_info =3D { .instance_init =3D lasips2_kbd_port_init, }; =20 +static void lasips2_mouse_port_init(Object *obj) +{ + LASIPS2MousePort *s =3D LASIPS2_MOUSE_PORT(obj); + LASIPS2Port *lp =3D LASIPS2_PORT(obj); + + memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-mo= use", + 0x100); + lp->id =3D 1; + lp->parent =3D container_of(s, LASIPS2State, mouse_port); +} + static const TypeInfo lasips2_mouse_port_info =3D { .name =3D TYPE_LASIPS2_MOUSE_PORT, .parent =3D TYPE_LASIPS2_PORT, .instance_size =3D sizeof(LASIPS2MousePort), + .instance_init =3D lasips2_mouse_port_init, }; =20 static void lasips2_register_types(void) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index f728f54c78..84807bec36 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -61,7 +61,7 @@ struct LASIPS2State { SysBusDevice parent_obj; =20 LASIPS2KbdPort kbd_port; - LASIPS2Port mouse; + LASIPS2MousePort mouse_port; qemu_irq irq; }; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663938603654.8752297233705; Tue, 12 Jul 2022 15:12:18 -0700 (PDT) Received: from localhost ([::1]:42884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO77-0005nY-Gq for importer@patchew.org; Tue, 12 Jul 2022 18:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqA-0003gk-Aw; Tue, 12 Jul 2022 17:54:46 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNq8-0007vC-QC; Tue, 12 Jul 2022 17:54:46 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoL-000Bqt-D8; Tue, 12 Jul 2022 22:52:57 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r2pnpZLiuVfDdUSID++oSoOnSDmULM/mAx/TWvtVan4=; b=E6/h7RrNsPdryMg/QN22mt6p0z 8jf3Coq9L/dzCPfWqQLyZ0am8nzuyPcqVVRo/go4P53ulSiU3mym9BPvgtvZ0LooqHC+LGpTSmYsY reDnJBJ24sSH2ss9nJXMuZTxFM7CUF+7Rhhrf7pCzonQ+iBHfnU5xsDvFeOBV6o/msogW4Q3Li6lH 0+8xTQTyEC6mfRejDnUlGLGwC868djB7s+UME1NM+hX8HrXzf9VBJ1rnT5XpSpjffnHIaNcJ2+r9B pNyLvJfnARmWJ6thcr7/Q9QbfiHVRUKObdFF5nSKyRG2Q51l7/Egk/9W9m492PPj7gZJOtdWB/Bcj Ugdgq1K3SoJMkpnkJZQHkPjyWOYo6LrwKD8+yVNGwTd5Ravnhcow3lmWfZZD5bXFhE11vW5NoF4Kg 7ydU1BsHTLWt+fwWArurpfqiFfG2clTVWEI4Bmu5Oc0Ul/rrYY76hBC21DV7Uoc9BGLyryXdFOgPF cnwGASTFxT69hSsZKpCQXV7wi7G1sULigC+M6gHYDe0cacgnpWIMT7K845qAPCm2dkvKbkEs7k41v SalWy4HHcB/Ug713Cu5RvhZmkZDTMsFILONEFNfAmTx2HQ1i33WrQsxPS+7VtHecidgg1FHEWSz1k Z1zGo+/F+sk9T2X576diYzN6EoNilNdKEnoEiXpA0=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:32 +0100 Message-Id: <20220712215251.7944-22-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 21/40] lasips2: introduce lasips2_kbd_port_class_init() and lasips2_kbd_port_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663939772100001 Content-Type: text/plain; charset="utf-8" Introduce a new lasips2_kbd_port_class_init() function which uses a new lasips2_kbd_port_realize() function to initialise the PS2 keyboard device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 9535cab268..b4fdaed5cb 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -268,7 +268,6 @@ static void lasips2_realize(DeviceState *dev, Error **e= rrp) return; } =20 - lp->ps2dev =3D ps2_kbd_init(); qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); @@ -331,6 +330,13 @@ static const TypeInfo lasips2_port_info =3D { .abstract =3D true, }; =20 +static void lasips2_kbd_port_realize(DeviceState *dev, Error **errp) +{ + LASIPS2Port *lp =3D LASIPS2_PORT(dev); + + lp->ps2dev =3D ps2_kbd_init(); +} + static void lasips2_kbd_port_init(Object *obj) { LASIPS2KbdPort *s =3D LASIPS2_KBD_PORT(obj); @@ -342,11 +348,19 @@ static void lasips2_kbd_port_init(Object *obj) lp->parent =3D container_of(s, LASIPS2State, kbd_port); } =20 +static void lasips2_kbd_port_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->realize =3D lasips2_kbd_port_realize; +} + static const TypeInfo lasips2_kbd_port_info =3D { .name =3D TYPE_LASIPS2_KBD_PORT, .parent =3D TYPE_LASIPS2_PORT, .instance_size =3D sizeof(LASIPS2KbdPort), .instance_init =3D lasips2_kbd_port_init, + .class_init =3D lasips2_kbd_port_class_init, }; =20 static void lasips2_mouse_port_init(Object *obj) --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663529046369.98500177436074; Tue, 12 Jul 2022 15:05:29 -0700 (PDT) Received: from localhost ([::1]:52800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO0V-0001gb-RU for importer@patchew.org; Tue, 12 Jul 2022 18:05:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqB-0003mB-Hx; Tue, 12 Jul 2022 17:54:47 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqA-0007vO-0o; Tue, 12 Jul 2022 17:54:47 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoP-000Bqt-PR; Tue, 12 Jul 2022 22:53:01 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Nv+MjNauFM7d8s3RY2hSbgxq4uIv0MM6IJKLOjx0wjo=; b=DH5E8hhWDqeaLs375zK3f8SVXO 9EhqwJ1B/+C05V4d0Mg5Kd8WbCvrAzdtRCxca/Wym8bJcnU/qvV0vcrfo5oCWloCrK/Dzn7Iahx5p 4ay3GfiwpGJC4MlU7RsrRRgMV3rNOj3tjJeP7nZEweRPgU4WCn4/xGHWL9VcIMXaUWrzfCuT3Fe51 rXLhPPJE+MkcmI0LncMyTvICkqaELnbeIrQUF20Onyc/0KjvNrL71Rt1mQ9UH47+AYUg8PX8SJMnW 94VZhRzoVWAsJlvoS5UJ55Hx+nzh2y1H/eVCJsNzkcqYEQIAo/WTB5Dd9FUjgvMznaex/RCZiyYGo wngvFL/icf5AuENzZFjy2WaQb8x4kG0IsARhjKrm43nyiGOeQbn++tn/5yov507OwKiVk1Z9WeSt3 SWzPKO5sSb6+cKsgWxBh89sYSRNA48Ed/rViIllHISxXGfM+ivWQdexleVMnt2o6FdyDDsibiQzKY f3FOx47t1oKhSmig5hMI00JosMfxlpAduiHAa7SP82DEIUguSNyPg01P9jVniyKIpxpCxJ0kKRprC Ast5zXsyJc3RVy3gpBz3NlMfwVKiyPblm17+qee0el4Kyw3Cfg9+i3/uWoxu/DnpcysfgDs5EZ+p2 mYeDhhJdXXNuRpC2jIw20ONRj5KGOte3NyWa1JNEM=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:33 +0100 Message-Id: <20220712215251.7944-23-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 22/40] lasips2: introduce lasips2_mouse_port_class_init() and lasips2_mouse_port_realize() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663529643100001 Content-Type: text/plain; charset="utf-8" Introduce a new lasips2_mouse_port_class_init() function which uses a new lasips2_mouse_port_realize() function to initialise the PS2 mouse device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index b4fdaed5cb..ce87c66f2a 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -277,7 +277,6 @@ static void lasips2_realize(DeviceState *dev, Error **e= rrp) return; } =20 - lp->ps2dev =3D ps2_mouse_init(); qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", 0)); @@ -363,6 +362,13 @@ static const TypeInfo lasips2_kbd_port_info =3D { .class_init =3D lasips2_kbd_port_class_init, }; =20 +static void lasips2_mouse_port_realize(DeviceState *dev, Error **errp) +{ + LASIPS2Port *lp =3D LASIPS2_PORT(dev); + + lp->ps2dev =3D ps2_mouse_init(); +} + static void lasips2_mouse_port_init(Object *obj) { LASIPS2MousePort *s =3D LASIPS2_MOUSE_PORT(obj); @@ -374,11 +380,19 @@ static void lasips2_mouse_port_init(Object *obj) lp->parent =3D container_of(s, LASIPS2State, mouse_port); } =20 +static void lasips2_mouse_port_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->realize =3D lasips2_mouse_port_realize; +} + static const TypeInfo lasips2_mouse_port_info =3D { .name =3D TYPE_LASIPS2_MOUSE_PORT, .parent =3D TYPE_LASIPS2_PORT, .instance_size =3D sizeof(LASIPS2MousePort), .instance_init =3D lasips2_mouse_port_init, + .class_init =3D lasips2_mouse_port_class_init, }; =20 static void lasips2_register_types(void) --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657663724775143.3082828174862; Tue, 12 Jul 2022 15:08:44 -0700 (PDT) Received: from localhost ([::1]:33282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO3f-0007eR-ND for importer@patchew.org; Tue, 12 Jul 2022 18:08:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqF-0003vx-0q; Tue, 12 Jul 2022 17:54:52 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqD-0007ve-Fb; Tue, 12 Jul 2022 17:54:50 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoT-000Bqt-MV; Tue, 12 Jul 2022 22:53:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bV8HZvGS7FLPLzqx9ZZ9DgxHNxJtQvYshDtDFO2Fj4o=; b=AILTIjSryrsyFGtUNX4AX1ztK0 HjKk1t0ZfZFUjHMlDxHcbm76olJrEp/PY31A+SQYX4secxm9qKkSoQdDdrnkGp41Jch+NiAZSoumu R9qNGicKBIFI5H9abnVBhAh7oVBplph8x+GarkZd9QK3aHb5jVK9V3ltKANNE59n/8EV97zpLOdVL XcZyqrUWXvfIS7VKIKgR692CZ87jVLLiDmkARIA2SFPZdlJxF+EQrkx+q1pcbCmxcujwjOqMroOfL l3ABo/NLB9TJWh1SUEMbekffH6oc5lOULH3CszgIx4sFxeuMtxVb9ibkuZeQ6hsKtCbX+EM4nNuck 574kPvHTBU5Tqyo7qNJfKzHmr2uzSs7po3M4oOSv0GeXWsOI/lx0bKDF1hmjckQX7XqmYWI90807o pppm8imAS62vPmTfdmKDtA1KnAlJ1N7WU4rFeOLXZoTpb4SN+0fagB4PrdRp3pbuUJGiT8761KpG1 UiOLfcw43kF4H3O3FEXRF8t6Ga57qs3gECU76C4MWe/DoNcpM0mNb2bXinQ01mZwBa4roOdhVeqX1 VMOgHp5rc5u4EK6umZuj4CbXy8BHGBe36XJI3IVskv6RGTT3foyo6Fdei6UxIm8MnvYLeneMftQ9x PyrEQb6xl7cyus1iT9mJShdnkrp0Gdwrl9g4f2FRQ=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:34 +0100 Message-Id: <20220712215251.7944-24-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 23/40] lasips2: rename LASIPS2Port irq field to birq X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657663726793100001 Content-Type: text/plain; charset="utf-8" The existing boolean irq field in LASIPS2Port will soon be replaced by a pr= oper qemu_irq, so rename the field to birq to allow the upcoming qemu_irq to use= the irq name. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 24 ++++++++++++------------ include/hw/input/lasips2.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index ce87c66f2a..49e5c90b73 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -42,10 +42,10 @@ static const VMStateDescription vmstate_lasips2 =3D { .fields =3D (VMStateField[]) { VMSTATE_UINT8(kbd_port.parent_obj.control, LASIPS2State), VMSTATE_UINT8(kbd_port.parent_obj.id, LASIPS2State), - VMSTATE_BOOL(kbd_port.parent_obj.irq, LASIPS2State), + VMSTATE_BOOL(kbd_port.parent_obj.birq, LASIPS2State), VMSTATE_UINT8(mouse_port.parent_obj.control, LASIPS2State), VMSTATE_UINT8(mouse_port.parent_obj.id, LASIPS2State), - VMSTATE_BOOL(mouse_port.parent_obj.irq, LASIPS2State), + VMSTATE_BOOL(mouse_port.parent_obj.birq, LASIPS2State), VMSTATE_END_OF_LIST() } }; @@ -119,10 +119,10 @@ static const char *lasips2_write_reg_name(uint64_t ad= dr) =20 static void lasips2_update_irq(LASIPS2State *s) { - trace_lasips2_intr(s->kbd_port.parent_obj.irq | - s->mouse_port.parent_obj.irq); - qemu_set_irq(s->irq, s->kbd_port.parent_obj.irq | - s->mouse_port.parent_obj.irq); + trace_lasips2_intr(s->kbd_port.parent_obj.birq | + s->mouse_port.parent_obj.birq); + qemu_set_irq(s->irq, s->kbd_port.parent_obj.birq | + s->mouse_port.parent_obj.birq); } =20 static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, @@ -141,7 +141,7 @@ static void lasips2_reg_write(void *opaque, hwaddr addr= , uint64_t val, case REG_PS2_XMTDATA: if (port->control & LASIPS2_CONTROL_LOOPBACK) { port->buf =3D val; - port->irq =3D true; + port->birq =3D true; port->loopback_rbne =3D true; lasips2_update_irq(port->parent); break; @@ -176,7 +176,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) =20 case REG_PS2_RCVDATA: if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->irq =3D false; + port->birq =3D false; port->loopback_rbne =3D false; lasips2_update_irq(port->parent); ret =3D port->buf; @@ -213,8 +213,8 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) } } =20 - if (port->parent->kbd_port.parent_obj.irq || - port->parent->mouse_port.parent_obj.irq) { + if (port->parent->kbd_port.parent_obj.birq || + port->parent->mouse_port.parent_obj.birq) { ret |=3D LASIPS2_STATUS_CMPINTR; } break; @@ -245,7 +245,7 @@ static void lasips2_set_kbd_irq(void *opaque, int n, in= t level) LASIPS2State *s =3D LASIPS2(opaque); LASIPS2Port *port =3D LASIPS2_PORT(&s->kbd_port); =20 - port->irq =3D level; + port->birq =3D level; lasips2_update_irq(port->parent); } =20 @@ -254,7 +254,7 @@ static void lasips2_set_mouse_irq(void *opaque, int n, = int level) LASIPS2State *s =3D LASIPS2(opaque); LASIPS2Port *port =3D LASIPS2_PORT(&s->mouse_port); =20 - port->irq =3D level; + port->birq =3D level; lasips2_update_irq(port->parent); } =20 diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 84807bec36..4c4b471737 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -40,7 +40,7 @@ struct LASIPS2Port { uint8_t control; uint8_t buf; bool loopback_rbne; - bool irq; + bool birq; }; =20 #define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port" --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664112273897.1011778730347; Tue, 12 Jul 2022 15:15:12 -0700 (PDT) Received: from localhost ([::1]:51352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO9v-0003LG-1h for importer@patchew.org; Tue, 12 Jul 2022 18:15:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqH-0003xC-NZ; Tue, 12 Jul 2022 17:54:53 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqF-0007vl-EQ; Tue, 12 Jul 2022 17:54:53 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoX-000Bqt-BG; Tue, 12 Jul 2022 22:53:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VP5Fwzm42ZTCNRvG0VaHyDLuRuuzk1FrlrJGokcaSnc=; b=TCZh71vBJh9J4C3YGbT//xrRAQ p5cW/CwlVEWQhBUsjAPBpPqjowf0bxHBjhcoF3hZjUdCsSrot5W/JTOh99ARan0q9m4QomtNbDJDh SQ0jjLrkilkTl4QPmzkKA9eHcaCl86W9d374+LLrizz6NCSzaYg0f8wmEfLSN+PT0LjPQk/28v1FT Gf3kZrbZtgPaBA0uav8AIu7PuHpGrrabnXyJLLeO3H7Hk1la0XzRexhKbDS8lkAY+kVXG4dM6/2S0 te149+h63MDTTqlCNcWObZ4PkM1j820mK1Died2IF1KDSI+rTBwQAPwWJ+rZAQcBVwl6s4HscSPzB XKJiC+HMsbdx4khOfgVtGCNDHslWVdTA5IVXg4e8lMFXDY/U/s6xt1LqFoJm4tinJkdL4nwnHTyZp GQsA3Xrc3BUbe+6zuzXovGayz9ijTP2rj7cq1JMCn2wHT/RMv2P95ErQvdl4su+i9HF15/UD2Tdzh B6RFEsOpxq7y5W5W6sKyVOEfJCqVU0ZuAgfeTRb41HIPhzN4vufjCBQKwz4xR/l6o/M1qdRt/KIB2 LKI5jIE1bKHZEo1WLtdigiTkPRkX5aN0FneUmwaA0byGBvxvbFsE0IrTayGqfRIhP79z2DatAFDFB OYB7sNn++hKlvFcSkCBebW0kuZCrQvhVWsrK1bsxM=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:35 +0100 Message-Id: <20220712215251.7944-25-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664112490100001 Content-Type: text/plain; charset="utf-8" Introduce a new lasips2_port_init() QOM init function for the LASIPS2_PORT = type and use it to initialise a new gpio for use as a port IRQ. Add a new qemu_i= rq representing the gpio as a new irq field within LASIPS2Port. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 8 ++++++++ include/hw/input/lasips2.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 49e5c90b73..6b53153838 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -322,9 +322,17 @@ static const TypeInfo lasips2_info =3D { .class_init =3D lasips2_class_init, }; =20 +static void lasips2_port_init(Object *obj) +{ + LASIPS2Port *s =3D LASIPS2_PORT(obj); + + qdev_init_gpio_out(DEVICE(obj), &s->irq, 1); +} + static const TypeInfo lasips2_port_info =3D { .name =3D TYPE_LASIPS2_PORT, .parent =3D TYPE_DEVICE, + .instance_init =3D lasips2_port_init, .instance_size =3D sizeof(LASIPS2Port), .abstract =3D true, }; diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 4c4b471737..a05f26cbd9 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -41,6 +41,7 @@ struct LASIPS2Port { uint8_t buf; bool loopback_rbne; bool birq; + qemu_irq irq; }; =20 #define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port" --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664297930191.94911847015726; Tue, 12 Jul 2022 15:18:17 -0700 (PDT) Received: from localhost ([::1]:59626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOCu-0000yo-Pt for importer@patchew.org; Tue, 12 Jul 2022 18:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqL-0003zi-9x; Tue, 12 Jul 2022 17:54:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqJ-0007wD-TV; Tue, 12 Jul 2022 17:54:57 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoa-000Bqt-UH; Tue, 12 Jul 2022 22:53:12 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qfdox4qJpMUTcQpbHl7qZW4eWAZxZYenk7ZkJR0Fvk8=; b=f/oV69JKuh9NKSdOB3lQx9YEVk iqcHlySEXB0BfpIWYVPNsXrGmeRFaatSRT1W27RS+iiv2ACXMZzg6zIOOYkxpBMBpd9+CBas9zso1 gWPlHe2QaSud8YeCJPKIWAn3vC+hw2tTB29CM0eVxrJIwFLeWOC8woSwmoz7UjHBaLy2ezsCEH1iU pLaLY6CotDN9WihVZFwGCnOlZNtRQLQZMaBRZD2YcoG/F20JJAjCpbSHjnc32S+JJWc/+Qt/cdZD9 Uq2FJMrUacqO5JQEkdlmtDNlSgihswessHGfWZ0GlJpvCepDBeF14UFaJTB0j80Zj4d+dDiidTkXe b+jwAmtSXjlfCPZzG1rGOSbvXgDxLPbL+3ohdJNFBA12UmJRMSUUYabodLrNv3l0qDyW4vs0hyqZ9 0mls27WAwmVUIkeWgZkkPZyun6LV6gCSa59HPT0IZBsYBf4N8xkiZHMTb/U6nBGwtKwjOhJOFNUwW FV0LIb+QBQx9bHPbzw73Jtu6ds+jQLowDD54v2W+RLPw7UZp7y+VGaEHYACRfKnlMZ3CxlMVy17LH dK1t/lbLusxMqku2oeES+DNpKbbVJX+jgJtPUx0jsu4SHEdkHiOl/lId/mqAkoMf+POXjrEG/+wsO q2+Ubx4MGWNu4jT2bA6MgrCyjbSgoyaGnkAqImOxM=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:36 +0100 Message-Id: <20220712215251.7944-26-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 25/40] lasips2: introduce LASIPS2PortDeviceClass for the LASIPS2_PORT device X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664300150100001 Content-Type: text/plain; charset="utf-8" This will soon be used to store the reference to the LASIPS2_PORT parent de= vice for LASIPS2_KBD_PORT and LASIPS2_MOUSE_PORT. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 2 ++ include/hw/input/lasips2.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 6b53153838..10494a2322 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -334,6 +334,8 @@ static const TypeInfo lasips2_port_info =3D { .parent =3D TYPE_DEVICE, .instance_init =3D lasips2_port_init, .instance_size =3D sizeof(LASIPS2Port), + .class_init =3D lasips2_port_class_init, + .class_size =3D sizeof(LASIPS2PortDeviceClass), .abstract =3D true, }; =20 diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index a05f26cbd9..426aa1371f 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -26,7 +26,11 @@ #include "hw/input/ps2.h" =20 #define TYPE_LASIPS2_PORT "lasips2-port" -OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2Port, LASIPS2_PORT) +OBJECT_DECLARE_TYPE(LASIPS2Port, LASIPS2PortDeviceClass, LASIPS2_PORT) + +struct LASIPS2PortDeviceClass { + DeviceClass parent; +}; =20 typedef struct LASIPS2State LASIPS2State; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657665329883406.8097690451665; Tue, 12 Jul 2022 15:35:29 -0700 (PDT) Received: from localhost ([::1]:38694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOTY-0000LA-EY for importer@patchew.org; Tue, 12 Jul 2022 18:35:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqM-0003zk-5U; Tue, 12 Jul 2022 17:54:58 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqK-0007wH-JC; Tue, 12 Jul 2022 17:54:57 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoe-000Bqt-U5; Tue, 12 Jul 2022 22:53:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BqMr46eJw0iZWi8J7aiZVmBCeQxELdVT3kXSMAyh9z0=; b=Gw96wxaaLCAdxew2RbK+YHihdk ncb9HPa2hLMZmhTDohliYsTirFbdwvtrd6X9dD2mBYuiP1ldtsexOAbNRea0u3qPabB1ZCppCUy8/ jFCwsnHtqSiC8HUf1xoETZn/dM4m95bZEo4P8OfLM8UmrMJ98t5wIURX0Bv1sQYXxaiRULkx7Ihn1 UzTP+Nai8wrhKXIl7Yhl3ArIe8jwFSAdduYDWKo0c/9Ewv+5iWrVZ76sntRCs/sj1ChaVi6hRn2lp XW0z8SH8QRky/7xcb8DXoDuojyaMSC4RkCYGIBDPQVb/oollSQ4twevxc2abN9lpmFaqQU3PbwIYR 3gmCuxndgQVgB/B+RIvCOuh6f02TXlSFBTrrqeMX9A2aUDxOZyrwimM+IWfVJQ78vORfdHr52LXAs HcE1aYgBVImtvkQCTtgsYdTextKdpBHyXQwL6xcXM3koZT2xl8o3cHRw9DN+cGpbdl8CS2hl+L81E twbbVQk/yYNaqeXq/LTLZGXPwUEhjTM7RWnfn5kh7f5+5AsRGjE3/Uskapty5yWamByd/NJ5QJ3sk kBC5gUwWSqBVH3u5YigDbF1V/AhKR4URT4K8edZKVx7haN0ZV+tn60rwLZKRooFsbJ5/yoL5ZP7ci 1Rw/M1+iRLzAtgObnSiQPGiIcZZnkrlK4r7zbUt9E=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:37 +0100 Message-Id: <20220712215251.7944-27-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 26/40] lasips2: add named input gpio to port for downstream PS2 device IRQ X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657665331473100001 Content-Type: text/plain; charset="utf-8" The named input gpio is to be connected to the IRQ output of the downstream PS2 device and used to drive the port IRQ. Initialise the named input gpio in lasips2_port_init() and add new lasips2_port_class_init() and lasips2_port_realize() functions to connect the PS2 device output gpio to the new named input gpio. Note that the reference to lasips2_port_realize() is stored in LASIPS2PortDeviceClass but not yet used. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 32 ++++++++++++++++++++++++++++++-- include/hw/input/lasips2.h | 2 ++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 10494a2322..ec1661a8f1 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -322,11 +322,35 @@ static const TypeInfo lasips2_info =3D { .class_init =3D lasips2_class_init, }; =20 +static void lasips2_port_set_irq(void *opaque, int n, int level) +{ + LASIPS2Port *s =3D LASIPS2_PORT(opaque); + + qemu_set_irq(s->irq, level); +} + +static void lasips2_port_realize(DeviceState *dev, Error **errp) +{ + LASIPS2Port *s =3D LASIPS2_PORT(dev); + + qdev_connect_gpio_out(DEVICE(s->ps2dev), PS2_DEVICE_IRQ, + qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); +} + static void lasips2_port_init(Object *obj) { LASIPS2Port *s =3D LASIPS2_PORT(obj); =20 qdev_init_gpio_out(DEVICE(obj), &s->irq, 1); + qdev_init_gpio_in_named(DEVICE(obj), lasips2_port_set_irq, + "ps2-input-irq", 1); +} + +static void lasips2_port_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->realize =3D lasips2_port_realize; } =20 static const TypeInfo lasips2_port_info =3D { @@ -360,8 +384,10 @@ static void lasips2_kbd_port_init(Object *obj) static void lasips2_kbd_port_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + LASIPS2PortDeviceClass *lpdc =3D LASIPS2_PORT_CLASS(klass); =20 - dc->realize =3D lasips2_kbd_port_realize; + device_class_set_parent_realize(dc, lasips2_kbd_port_realize, + &lpdc->parent_realize); } =20 static const TypeInfo lasips2_kbd_port_info =3D { @@ -393,8 +419,10 @@ static void lasips2_mouse_port_init(Object *obj) static void lasips2_mouse_port_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + LASIPS2PortDeviceClass *lpdc =3D LASIPS2_PORT_CLASS(klass); =20 - dc->realize =3D lasips2_mouse_port_realize; + device_class_set_parent_realize(dc, lasips2_mouse_port_realize, + &lpdc->parent_realize); } =20 static const TypeInfo lasips2_mouse_port_info =3D { diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 426aa1371f..35e0aa26eb 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -30,6 +30,8 @@ OBJECT_DECLARE_TYPE(LASIPS2Port, LASIPS2PortDeviceClass, = LASIPS2_PORT) =20 struct LASIPS2PortDeviceClass { DeviceClass parent; + + DeviceRealize parent_realize; }; =20 typedef struct LASIPS2State LASIPS2State; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664288237479.57542015356285; Tue, 12 Jul 2022 15:18:08 -0700 (PDT) Received: from localhost ([::1]:59536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOCj-0000tq-Fm for importer@patchew.org; Tue, 12 Jul 2022 18:18:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqP-000473-IR; Tue, 12 Jul 2022 17:55:01 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqN-0007wi-Vx; Tue, 12 Jul 2022 17:55:01 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNof-000Bqt-Cj; Tue, 12 Jul 2022 22:53:17 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=N9uCW4I83GuTBM9+Dffp16en7+TzfXrG3yYxyvznf/k=; b=vkkyIdAJwnrq8q3xhjvXgdJ3+b 5JhkXJ09DwBVbGf/IksqbSvC+B4zc5VIoXu4PveRbsnepwSQIWQy+WmY6NcMlhp/WCKAwpUmC/4pT ujiOUSfpdUtoSrOhSwH4HQXPq6M+Zy66pkgotQpA/ywMwng8rd6ukDKpn3OPsBT9x5rQfwEjoqjZ9 9wVBddcrmeGgP4ke/B99vj4SEIgUXmQDlQ6tDgwux7ySLy07qWOWGPfVRklsFfnoXU9baoTDpW+Op VIyPY0Gkgfr/XLGRmDXf+y0/F+utcP9tSEwMAO8fH9Kgcmoogx/fMA5py36ecWOs2HGeN9v8NFzyx esKrRziwVcYsogvY8ZShmlLc3/UScI3WobgM95rAAKGoLd9frwNPOCrnPXfQhB4zDK97L2h4321/F w74WCBPdVVsQ/CqxkwPKGwHc4k0OB8dRcWlwrp96BHoUn8SDXvUzIq/JGsO3lY/Hi5SpiD5EbSxiA UoJ/bwr5iK+cNMp/N9fAW4VDr9XEfPa+wXIIc8vHlb4XKWfJclUCCt+TNH1Ojjh5/0uMjJQAiHUYC 0uvQbX/Kzivw5Pi0n8VV6F/WEEIQHSMhestB5paQOoa/bhVyJy4gyBYlDXj4cl+NdQyAF6lducivh aOYUpEdu+j+4Y8y8mAqkhXQByFEQMU8+8M7D6gmQg=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:38 +0100 Message-Id: <20220712215251.7944-28-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 27/40] lasips2: add named input gpio to handle incoming port IRQs X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664290991100001 Content-Type: text/plain; charset="utf-8" The LASIPS2 device named input gpio is soon to be connected to the port out= put IRQs. Add a new int_status field to LASIPS2State which is a bitmap represen= ting the port input IRQ status which will be enabled in the next patch. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 15 +++++++++++++++ include/hw/input/lasips2.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index ec1661a8f1..013d891af6 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -125,6 +125,19 @@ static void lasips2_update_irq(LASIPS2State *s) s->mouse_port.parent_obj.birq); } =20 +static void lasips2_set_irq(void *opaque, int n, int level) +{ + LASIPS2State *s =3D LASIPS2(opaque); + + if (level) { + s->int_status |=3D BIT(n); + } else { + s->int_status &=3D ~BIT(n); + } + + lasips2_update_irq(s); +} + static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { @@ -303,6 +316,8 @@ static void lasips2_init(Object *obj) "ps2-kbd-input-irq", 1); qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_mouse_irq, "ps2-mouse-input-irq", 1); + qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_irq, + "lasips2-port-input-irq", 2); } =20 static void lasips2_class_init(ObjectClass *klass, void *data) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 35e0aa26eb..b79febf64b 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -69,6 +69,7 @@ struct LASIPS2State { =20 LASIPS2KbdPort kbd_port; LASIPS2MousePort mouse_port; + uint8_t int_status; qemu_irq irq; }; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664493172468.6612141633044; Tue, 12 Jul 2022 15:21:33 -0700 (PDT) Received: from localhost ([::1]:39622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOG4-0006he-3Y for importer@patchew.org; Tue, 12 Jul 2022 18:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqV-0004F5-An; Tue, 12 Jul 2022 17:55:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqS-0007xA-CJ; Tue, 12 Jul 2022 17:55:07 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoj-000Bqt-7Q; Tue, 12 Jul 2022 22:53:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y++dPXdHU1fx9UmmrhbzCoBL15uAK8uWNBcqmziUOLA=; b=AM3RlZReKdCp+EIVMEKgmnydCE 2PvyLvIvT2h9C6L1zmJ+qrRWIWVMpH03GReY2Ire16pt67osDAf5gXK3BxMzapFVJwCXozYsmUzvy a71wKkStH6Wk3sDrhIlFrCbhg8NauSb1bb7v89Igm+rhShBEfaQ0Cp6YcGh9eroOaMygWcltexC44 8K0pwCVtjEuQiVFRCQFqKEpKZQYTXdQNffV/JOeVD/ANm56+YTQBvKJS6w67JX+Jo+zzWR18cjX+S mUfQymMglBf7lNDoHZdHIwzDwxLI32zDTeSRzvnMPEKhV0oo3fU72JPjg5Pfu1RMscRzSy6ZDEC/a veub/QHzijRFuR/AvRc+kWc0ny4X91NZcWygW6LzDhEoh1pWtNLstzN7/uyADNbiD92Dachao/ISm HeokUWFLVrsXcunEEgxvrhWyRfN38qFDiGQzrzwHOGHf4Ej3P2pDI06B6EBBTB2+Ci4hK4oOOuVKe wnINLt2aGeKqkyJ7JAkbEwTCqNmSDlmqqBCFRBhKPuFWg6G+Q5go+GYfW+t5tOjksdCkzLAx2+Yqg ugkgNQXgtA2w/t+kKhKjuQIa2Uji8XOIOrIIVZnvzJ42E79gKIX8KtYsR/D+TDv058FVQUumClIuv CVe63d/0NIPZMIkPzGm4IKqXA8LSFxSESV8sATGto=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:39 +0100 Message-Id: <20220712215251.7944-29-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 28/40] lasips2: switch to using port-based IRQs X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664495497100001 Content-Type: text/plain; charset="utf-8" Now we can implement port-based IRQs by wiring the PS2 device IRQs to the LASI2Port named input gpios rather than directly to the LASIPS2 device, and generate the LASIPS2 output IRQ from the int_status bitmap representing the individual port IRQs instead of the birq boolean. This enables us to remove the separate PS2 keyboard and PS2 mouse named inp= ut gpios from the LASIPS2 device and simplify the register implementation to drive the port IRQ using qemu_set_irq() rather than accessing the LASIPS2 device IRQs directly. As a consequence the IRQ level logic in lasips2_set_i= rq() can also be simplified accordingly. For now this patch ignores adding the int_status bitmap and simply drops the birq boolean from the vmstate_lasips2 VMStateDescription. This is because t= he migration stream is already missing some required LASIPS2 fields, and as th= is series already introduces a migration break for the lasips2 device it is easiest to fix this in a follow-up patch. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 59 ++++++++++++-------------------------- include/hw/input/lasips2.h | 7 ++--- 2 files changed, 20 insertions(+), 46 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 013d891af6..5ceb38c1af 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -42,10 +42,8 @@ static const VMStateDescription vmstate_lasips2 =3D { .fields =3D (VMStateField[]) { VMSTATE_UINT8(kbd_port.parent_obj.control, LASIPS2State), VMSTATE_UINT8(kbd_port.parent_obj.id, LASIPS2State), - VMSTATE_BOOL(kbd_port.parent_obj.birq, LASIPS2State), VMSTATE_UINT8(mouse_port.parent_obj.control, LASIPS2State), VMSTATE_UINT8(mouse_port.parent_obj.id, LASIPS2State), - VMSTATE_BOOL(mouse_port.parent_obj.birq, LASIPS2State), VMSTATE_END_OF_LIST() } }; @@ -119,10 +117,10 @@ static const char *lasips2_write_reg_name(uint64_t ad= dr) =20 static void lasips2_update_irq(LASIPS2State *s) { - trace_lasips2_intr(s->kbd_port.parent_obj.birq | - s->mouse_port.parent_obj.birq); - qemu_set_irq(s->irq, s->kbd_port.parent_obj.birq | - s->mouse_port.parent_obj.birq); + int level =3D s->int_status ? 1 : 0; + + trace_lasips2_intr(level); + qemu_set_irq(s->irq, level); } =20 static void lasips2_set_irq(void *opaque, int n, int level) @@ -154,9 +152,8 @@ static void lasips2_reg_write(void *opaque, hwaddr addr= , uint64_t val, case REG_PS2_XMTDATA: if (port->control & LASIPS2_CONTROL_LOOPBACK) { port->buf =3D val; - port->birq =3D true; port->loopback_rbne =3D true; - lasips2_update_irq(port->parent); + qemu_set_irq(port->irq, 1); break; } =20 @@ -189,9 +186,8 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) =20 case REG_PS2_RCVDATA: if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->birq =3D false; port->loopback_rbne =3D false; - lasips2_update_irq(port->parent); + qemu_set_irq(port->irq, 0); ret =3D port->buf; break; } @@ -226,9 +222,8 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) } } =20 - if (port->parent->kbd_port.parent_obj.birq || - port->parent->mouse_port.parent_obj.birq) { - ret |=3D LASIPS2_STATUS_CMPINTR; + if (port->parent->int_status) { + ret |=3D LASIPS2_STATUS_CMPINTR; } break; =20 @@ -253,24 +248,6 @@ static const MemoryRegionOps lasips2_reg_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static void lasips2_set_kbd_irq(void *opaque, int n, int level) -{ - LASIPS2State *s =3D LASIPS2(opaque); - LASIPS2Port *port =3D LASIPS2_PORT(&s->kbd_port); - - port->birq =3D level; - lasips2_update_irq(port->parent); -} - -static void lasips2_set_mouse_irq(void *opaque, int n, int level) -{ - LASIPS2State *s =3D LASIPS2(opaque); - LASIPS2Port *port =3D LASIPS2_PORT(&s->mouse_port); - - port->birq =3D level; - lasips2_update_irq(port->parent); -} - static void lasips2_realize(DeviceState *dev, Error **errp) { LASIPS2State *s =3D LASIPS2(dev); @@ -281,18 +258,18 @@ static void lasips2_realize(DeviceState *dev, Error *= *errp) return; } =20 - qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, - qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", - 0)); + qdev_connect_gpio_out(DEVICE(lp), 0, + qdev_get_gpio_in_named(dev, "lasips2-port-input-= irq", + lp->id)); =20 lp =3D LASIPS2_PORT(&s->mouse_port); if (!(qdev_realize(DEVICE(lp), NULL, errp))) { return; } =20 - qdev_connect_gpio_out(DEVICE(lp->ps2dev), PS2_DEVICE_IRQ, - qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", - 0)); + qdev_connect_gpio_out(DEVICE(lp), 0, + qdev_get_gpio_in_named(dev, "lasips2-port-input-= irq", + lp->id)); } =20 static void lasips2_init(Object *obj) @@ -312,10 +289,6 @@ static void lasips2_init(Object *obj) =20 sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); =20 - qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_kbd_irq, - "ps2-kbd-input-irq", 1); - qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_mouse_irq, - "ps2-mouse-input-irq", 1); qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_irq, "lasips2-port-input-irq", 2); } @@ -381,8 +354,10 @@ static const TypeInfo lasips2_port_info =3D { static void lasips2_kbd_port_realize(DeviceState *dev, Error **errp) { LASIPS2Port *lp =3D LASIPS2_PORT(dev); + LASIPS2PortDeviceClass *lpdc =3D LASIPS2_PORT_GET_CLASS(lp); =20 lp->ps2dev =3D ps2_kbd_init(); + lpdc->parent_realize(dev, errp); } =20 static void lasips2_kbd_port_init(Object *obj) @@ -416,8 +391,10 @@ static const TypeInfo lasips2_kbd_port_info =3D { static void lasips2_mouse_port_realize(DeviceState *dev, Error **errp) { LASIPS2Port *lp =3D LASIPS2_PORT(dev); + LASIPS2PortDeviceClass *lpdc =3D LASIPS2_PORT_GET_CLASS(lp); =20 lp->ps2dev =3D ps2_mouse_init(); + lpdc->parent_realize(dev, errp); } =20 static void lasips2_mouse_port_init(Object *obj) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index b79febf64b..7199f16622 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -12,10 +12,8 @@ * + sysbus MMIO region 1: MemoryRegion defining the LASI PS2 mouse * registers * + sysbus IRQ 0: LASI PS2 output irq - * + Named GPIO input "ps2-kbd-input-irq": set to 1 if the downstream PS2 - * keyboard device has asserted its irq - * + Named GPIO input "ps2-mouse-input-irq": set to 1 if the downstream PS2 - * mouse device has asserted its irq + * + Named GPIO input "lasips2-port-input-irq[0..1]": set to 1 if the down= stream + * LASIPS2Port has asserted its irq */ =20 #ifndef HW_INPUT_LASIPS2_H @@ -46,7 +44,6 @@ struct LASIPS2Port { uint8_t control; uint8_t buf; bool loopback_rbne; - bool birq; qemu_irq irq; }; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664547081690.7671528174792; Tue, 12 Jul 2022 15:22:27 -0700 (PDT) Received: from localhost ([::1]:42016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOGw-0008RA-0p for importer@patchew.org; Tue, 12 Jul 2022 18:22:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqX-0004MR-Jw; Tue, 12 Jul 2022 17:55:09 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqW-0007xb-10; Tue, 12 Jul 2022 17:55:09 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNon-000Bqt-5p; Tue, 12 Jul 2022 22:53:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iTIHgjHlmwkpWFiraU206yHGQd4ocrUAS/TSRUnAMeM=; b=qg2Fqoo6JATBGCK5Q66/yElTZx r6aA4Q+UQ+ASj01dA8xvrbFtWQ7JzcIZ9xmfzDutdJRS7Tkhm7cluhNolEYL3DZAvdhgcYIL6/H/D iFj8FDYQZaxJ1aNbnWN9Decw3FqoZKsOMgS0vq3S677SCGHg5UFYtyCTJJV8OASHQhjpv477eGpJy hJ5Gq/6QMHGNe92Se+lENikcvUsWfW34l4lfuASxoD/g2IXdWJGT8GotvaiOw0LiRY/EeJNK8wj9/ uZq1EIAs/PRfpkggi/C/pM3TGQ1JDsq1Rf3jlVsOzo2VRIElr6YjxlAzyLbPJ++VJIJzGB0tb6buW wqi4hQ5u99oOXnH3vnx8hN2mjcEgic5QW3KBimEbcRUVWdoZ7Bdl1mF/C2kI9d+/4LYsww48ASBIH MdAG3HW2yjMxYbfGDkm4Vq/iE1G+UCmAkjoC2tEu3cJ6u6tN7ns6rthTCbPBYxoC4HGWwQ7feXw4W a34vNTMNjyeIpo172StI9KMUCVbfrgLbH01ISIhWr5150wa/gJd4Kzxhciw3iziXUCfz3INF9Njva 1ImObwgO7PYfKyWHTPQlBN4CNWWO/AtzxyX65dTRqEcg2D59wBuKNJ2Pi4bob6S3XcNy+g+3+e26n eKVzrUTiVUoWtH6FJ508cEbIZncFXuPKj4NELMa2c=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:40 +0100 Message-Id: <20220712215251.7944-30-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 29/40] lasips2: rename LASIPS2Port parent pointer to lasips2 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664547701100001 Content-Type: text/plain; charset="utf-8" This makes it clearer that the pointer is a reference to the LASIPS2 contai= ner device rather than an implied part of the QOM hierarchy. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 6 +++--- include/hw/input/lasips2.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 5ceb38c1af..0f392e2bee 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -222,7 +222,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) } } =20 - if (port->parent->int_status) { + if (port->lasips2->int_status) { ret |=3D LASIPS2_STATUS_CMPINTR; } break; @@ -368,7 +368,7 @@ static void lasips2_kbd_port_init(Object *obj) memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-kb= d", 0x100); lp->id =3D 0; - lp->parent =3D container_of(s, LASIPS2State, kbd_port); + lp->lasips2 =3D container_of(s, LASIPS2State, kbd_port); } =20 static void lasips2_kbd_port_class_init(ObjectClass *klass, void *data) @@ -405,7 +405,7 @@ static void lasips2_mouse_port_init(Object *obj) memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-mo= use", 0x100); lp->id =3D 1; - lp->parent =3D container_of(s, LASIPS2State, mouse_port); + lp->lasips2 =3D container_of(s, LASIPS2State, mouse_port); } =20 static void lasips2_mouse_port_class_init(ObjectClass *klass, void *data) diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 7199f16622..9fe9e63a66 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -37,7 +37,7 @@ typedef struct LASIPS2State LASIPS2State; struct LASIPS2Port { DeviceState parent_obj; =20 - LASIPS2State *parent; + LASIPS2State *lasips2; MemoryRegion reg; PS2State *ps2dev; uint8_t id; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664706923492.52708015446103; Tue, 12 Jul 2022 15:25:06 -0700 (PDT) Received: from localhost ([::1]:49438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOJU-0004zi-Sw for importer@patchew.org; Tue, 12 Jul 2022 18:25:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqa-0004WS-N3; Tue, 12 Jul 2022 17:55:12 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqZ-0007y1-3s; Tue, 12 Jul 2022 17:55:12 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoq-000Bqt-OP; Tue, 12 Jul 2022 22:53:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4SGkGXr1/y9u8npp54SOz4TilYqVNmQFSGSm53nVSZE=; b=cLaOqiwUGO35GWWIEzP8/kLjP5 jktlckfUppsrPI5wMEyxhFpRKGH7nWu6cOawT50a84T5ZVpia5iYU24f4swmws17WCjQmciuXw/l3 WeMTUohCpLGCR67QdKZMDljlTqw/VFZ1lT3f5xWkc/8NwU0zVpe46a9oXPky/fQHJqJ8BtZsB/Q3V oaGeKP0xQdDG6caxmRH2g4LMhgr7xhh8ar59FUSz7K/ymavadkf6JoRHpxKwEoIX1/P2tQlcnLFY9 POyfrwe608uMtEYEhReRf8mi5bVJ5aXxNaUNNCRkCvdxSh9rmG7+qfeTWHMvCKdF5g3ksfbfnRajM Jb4HEqydHwygczFerTuDL6DdkmXC6Hx+0/n30Uh/79UTjs2q0kGBfh/znoJn7RrkF1fWdQAiaxjU4 jOSLKikdocEHaqsNhphTymhJADNpjr/3TYFN9Jq5W3MP5oHVTFIyEy76++QKxMPuVVBrmX9dQZif6 ijK747UkSmetAjvYVnJ2xfBGbXHz5gUfAFR57CHO9xKq3CGvZhL54AuiS3GeCOwLFGvca8uQXF3vN Hzdpe31rYowr1hFBvuRPN2TBftrpcrodz0XxQ3vjf4M1rHkMqKD+4xsWDPNFp/w0+tJ63m5N/PAOu WIKIRqRiiUtAYLAHOy4USZ4aUoUA4i79exBhNPJV8=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:41 +0100 Message-Id: <20220712215251.7944-31-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 30/40] lasips2: standardise on lp name for LASIPS2Port variables X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664708981100001 Content-Type: text/plain; charset="utf-8" This is shorter to type and keeps the naming convention consistent within t= he LASIPS2 device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 52 +++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 0f392e2bee..09d909c843 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -139,28 +139,28 @@ static void lasips2_set_irq(void *opaque, int n, int = level) static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - LASIPS2Port *port =3D opaque; + LASIPS2Port *lp =3D LASIPS2_PORT(opaque); =20 - trace_lasips2_reg_write(size, port->id, addr, + trace_lasips2_reg_write(size, lp->id, addr, lasips2_write_reg_name(addr), val); =20 switch (addr & 0xc) { case REG_PS2_CONTROL: - port->control =3D val; + lp->control =3D val; break; =20 case REG_PS2_XMTDATA: - if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->buf =3D val; - port->loopback_rbne =3D true; - qemu_set_irq(port->irq, 1); + if (lp->control & LASIPS2_CONTROL_LOOPBACK) { + lp->buf =3D val; + lp->loopback_rbne =3D true; + qemu_set_irq(lp->irq, 1); break; } =20 - if (port->id) { - ps2_write_mouse(PS2_MOUSE_DEVICE(port->ps2dev), val); + if (lp->id) { + ps2_write_mouse(PS2_MOUSE_DEVICE(lp->ps2dev), val); } else { - ps2_write_keyboard(PS2_KBD_DEVICE(port->ps2dev), val); + ps2_write_keyboard(PS2_KBD_DEVICE(lp->ps2dev), val); } break; =20 @@ -176,53 +176,53 @@ static void lasips2_reg_write(void *opaque, hwaddr ad= dr, uint64_t val, =20 static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) { - LASIPS2Port *port =3D opaque; + LASIPS2Port *lp =3D LASIPS2_PORT(opaque); uint64_t ret =3D 0; =20 switch (addr & 0xc) { case REG_PS2_ID: - ret =3D port->id; + ret =3D lp->id; break; =20 case REG_PS2_RCVDATA: - if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->loopback_rbne =3D false; - qemu_set_irq(port->irq, 0); - ret =3D port->buf; + if (lp->control & LASIPS2_CONTROL_LOOPBACK) { + lp->loopback_rbne =3D false; + qemu_set_irq(lp->irq, 0); + ret =3D lp->buf; break; } =20 - ret =3D ps2_read_data(port->ps2dev); + ret =3D ps2_read_data(lp->ps2dev); break; =20 case REG_PS2_CONTROL: - ret =3D port->control; + ret =3D lp->control; break; =20 case REG_PS2_STATUS: ret =3D LASIPS2_STATUS_DATSHD | LASIPS2_STATUS_CLKSHD; =20 - if (port->control & LASIPS2_CONTROL_DIAG) { - if (!(port->control & LASIPS2_CONTROL_DATDIR)) { + if (lp->control & LASIPS2_CONTROL_DIAG) { + if (!(lp->control & LASIPS2_CONTROL_DATDIR)) { ret &=3D ~LASIPS2_STATUS_DATSHD; } =20 - if (!(port->control & LASIPS2_CONTROL_CLKDIR)) { + if (!(lp->control & LASIPS2_CONTROL_CLKDIR)) { ret &=3D ~LASIPS2_STATUS_CLKSHD; } } =20 - if (port->control & LASIPS2_CONTROL_LOOPBACK) { - if (port->loopback_rbne) { + if (lp->control & LASIPS2_CONTROL_LOOPBACK) { + if (lp->loopback_rbne) { ret |=3D LASIPS2_STATUS_RBNE; } } else { - if (!ps2_queue_empty(port->ps2dev)) { + if (!ps2_queue_empty(lp->ps2dev)) { ret |=3D LASIPS2_STATUS_RBNE; } } =20 - if (port->lasips2->int_status) { + if (lp->lasips2->int_status) { ret |=3D LASIPS2_STATUS_CMPINTR; } break; @@ -233,7 +233,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr a= ddr, unsigned size) break; } =20 - trace_lasips2_reg_read(size, port->id, addr, + trace_lasips2_reg_read(size, lp->id, addr, lasips2_read_reg_name(addr), ret); return ret; } --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16576649804711010.2033647297729; Tue, 12 Jul 2022 15:29:40 -0700 (PDT) Received: from localhost ([::1]:57562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBONv-0002B8-G9 for importer@patchew.org; Tue, 12 Jul 2022 18:29:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqg-0004bg-WF; Tue, 12 Jul 2022 17:55:19 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqf-0007yn-LA; Tue, 12 Jul 2022 17:55:18 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNou-000Bqt-DT; Tue, 12 Jul 2022 22:53:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0CoI6KZ6avna/eIj3WpIJ8W6RFVeKBzEJk7ld1BAT6k=; b=os4wykSMQGSNDaRE/+ytqrzqmu hssCc+WUTh0JWkuN2kgNhEEjqDJ16nIpNN8CtGJW5UB7YGWm1aMU7yKZV1pHdNa5svg1iv0maMHHA 5GmgbdDrQwcA02feCLe8hilWUOqoucNxmuU2q/naqlHCHixDr3UfGrBzi/SOPqlNK/3qSG6b8qa/Q 0ZhzBdsXtIJ6rbB42sb31rvy6Fwe7Dms8VF6aUQLmBMUqX3KZ2Ww9vVWgynYsFNJm1hAFUOkm0LuK VKXduqaaqEW1xh9vd0w5aIKUqYghP46rcEA5YhvA24rj3e/QkR6UqcgJwWROApXp3aKbLtcRPXf3v CdZd2CEbNJEtwS9ID9vwytKcQyZk4R21rvyE+ZWvU8B8wrReEuKKQW3Dk4xLfFH9kVIOqTr0F6IRg bRghOL2nFUDQ8E280g6N8UiCrUa5VBqBRanCB/ygnbP1CayiRlWFxEWC7fX/9lcQNrcIJ3iG4yVDI 7jBF8+OREt73aXN1Hw9/TL2fJvmsdLCgWLKUnj/3jrf5JOXQBnVQ1TbiAj2nxaaiHMYALLgkCWx80 7f74GlLN78WtuZg98zwUOXXxi9TWx60SFv/1M4Mwic0BTXQrNBgzINGaSlI8H555p86BJncnhzlhY iy6JMncygjG8E+kskye2WaPaIxoV0+EP9Ouj70Xlw=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:42 +0100 Message-Id: <20220712215251.7944-32-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 31/40] lasips2: switch register memory region to DEVICE_BIG_ENDIAN X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664980680100001 Content-Type: text/plain; charset="utf-8" The LASI device (and so also the LASIPS2 device) are only used for the HPPA B160L machine which is a big endian architecture. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 09d909c843..7bf6077b58 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -245,7 +245,7 @@ static const MemoryRegionOps lasips2_reg_ops =3D { .min_access_size =3D 1, .max_access_size =3D 4, }, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static void lasips2_realize(DeviceState *dev, Error **errp) --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657665661299383.11576554045087; Tue, 12 Jul 2022 15:41:01 -0700 (PDT) Received: from localhost ([::1]:44750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOYt-0004gP-KE for importer@patchew.org; Tue, 12 Jul 2022 18:40:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqg-0004bQ-Mj; Tue, 12 Jul 2022 17:55:18 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqe-0007yX-Qw; Tue, 12 Jul 2022 17:55:18 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNoy-000Bqt-0v; Tue, 12 Jul 2022 22:53:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+jSBSyd4C4ehACelQLdKlML+HIzWsgEtoa7QkB+ZJRM=; b=PR0cxbOKsr0HWNjyQ9dCvlejUN igLGRnzR4rBt3PAp1h+alcB2JTqYSAgjsVjYojYw9E8N015n8JZaqOgElBJo+XCPY/t6brtZdIHJt siu1YSKnnWYRXBnLFfwP7oREN4gqMO6Yof2UOokaUfv+yza3sIAJWSafaxZrdcXSydKSCsk9kL0XJ rW0tTvvPA723P4x0PwiO3AWZ3qTsc/h8unIz1Exw26Lk+/aSJOojgsziSwSnDtTvxl2WssZogpenq Oxf9tCvqMcTpi8oyfmbpl/4QJibXaruCBfzz7IU1K7HnvEdhEK3qV01Z6bV4eXXNo8zTvaTXQmR5m C9FkYDF73edJVYyansdJbrjVq7hONTbLH6ZXa3LO5DOUbIc2Y7QmkoEm9XW/OPOdyra9vBwtwz9kU q9L/2R/0PuyPJ/3UdIWyXTPxZD0KCLLFklAuiUF4CLjAGFgv1aBRhhvxDYhCI+CTjCN7m1dfytFCP RpYmct4IL2gESLtY78wMmk26CC4OMQbmpe1uWt7+dugSuSe57YwRFoUgRTZzw9lkCES4oha3hUVGv QIOyjk6Ok4UuYnAUfMkecOeAMJSnXK7+jBbC8m96NGnOVLQ+ycww0TbVKUJ/PBNyf9lajPlALwcpa QphQxNLlHaD2ozrYtSiGJhk4D7S54HHeSah4SbFR4=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:43 +0100 Message-Id: <20220712215251.7944-33-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 32/40] lasips2: don't use legacy ps2_kbd_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657665663473100001 Content-Type: text/plain; charset="utf-8" Instantiate the PS2 keyboard device within LASIPS2KbdPort using object_initialize_child() in lasips2_kbd_port_init() and realize it in lasips2_kbd_port_realize() accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 10 +++++++++- include/hw/input/lasips2.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 7bf6077b58..4b3264a02d 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -353,10 +353,15 @@ static const TypeInfo lasips2_port_info =3D { =20 static void lasips2_kbd_port_realize(DeviceState *dev, Error **errp) { + LASIPS2KbdPort *s =3D LASIPS2_KBD_PORT(dev); LASIPS2Port *lp =3D LASIPS2_PORT(dev); LASIPS2PortDeviceClass *lpdc =3D LASIPS2_PORT_GET_CLASS(lp); =20 - lp->ps2dev =3D ps2_kbd_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->kbd), errp)) { + return; + } + + lp->ps2dev =3D PS2_DEVICE(&s->kbd); lpdc->parent_realize(dev, errp); } =20 @@ -367,6 +372,9 @@ static void lasips2_kbd_port_init(Object *obj) =20 memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-kb= d", 0x100); + + object_initialize_child(obj, "kbd", &s->kbd, TYPE_PS2_KBD_DEVICE); + lp->id =3D 0; lp->lasips2 =3D container_of(s, LASIPS2State, kbd_port); } diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 9fe9e63a66..4a0ad999d7 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -52,6 +52,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2KbdPort, LASIPS2_KBD_PO= RT) =20 struct LASIPS2KbdPort { LASIPS2Port parent_obj; + + PS2KbdState kbd; }; =20 #define TYPE_LASIPS2_MOUSE_PORT "lasips2-mouse-port" --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165766527329750.06376183827342; Tue, 12 Jul 2022 15:34:33 -0700 (PDT) Received: from localhost ([::1]:37112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOSe-0007e8-9P for importer@patchew.org; Tue, 12 Jul 2022 18:34:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqn-0004m7-BB; Tue, 12 Jul 2022 17:55:28 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNql-0007zW-QG; Tue, 12 Jul 2022 17:55:25 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNp1-000Bqt-VG; Tue, 12 Jul 2022 22:53:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kxbXVuEH93jq29Jn3c7L0UjUkuMdQL6+BFBnI8UISUk=; b=EnsqsHXly40YLV+42Ic4s0pk// 2BkbikfMoOOQ0UYhxY5aeMtrmavKKM+BSGqf/AYcu7AAii0uUgb/1CpTsMD7mWJUtOGZ0BdDcC3I6 L5V2xHDPN7VRD4AK84nZIcU9/dtWzDiiJL+3fDtLmDmAUa89uQIeveSac2Fpscv+TNrJoCFpWPtQ5 gniQpqEL3vr/mNuy/tu1LAQsGGrclyo+nTBNX5KxzUxjNTBbeWyaYPIi+vS/aFL4/I9v+PZ+Vh31J YeWFPAUKm8iAmlM/ylZBDGya+ZU6/hdOzODFquUA1iOpRj5K75SuZ2c8GN2S1XnMy2XuZrhPrKJwc ArCSI1z7TssS3N2Md0VFLp71yqEmrAI9tiR4V50LaolngK+JlW7/Ecq908xFCkLtqPvNxcFR42ebq 8+rpTNAmRvNwisXO7dlCUp8/2e4NPcqCJgVhylFIE0jXnnVH/A3zUS6ojpT9fhkTP9TWCJ3iO0NS2 3uYt4BM8kE2JIbh54+S+OYRA878umjs1RgTznVTntfHIk9qwxM3JOr6p50aNditaLaDP4VmsSlEn9 yaAw00QxLeJJDcM8Y0YvHe1ftBwaHqfcthWt/sDAkpKApx+WyM3ZzgaIO4P6qq11YeUu3uxojN2si rFpJB/10skE4ynE7TLvixjDfErSRmnn6VazYkzP7c=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:44 +0100 Message-Id: <20220712215251.7944-34-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 33/40] lasips2: don't use legacy ps2_mouse_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657665274593100001 Content-Type: text/plain; charset="utf-8" Instantiate the PS2 mouse device within LASIPS2MousePort using object_initialize_child() in lasips2_mouse_port_init() and realize it in lasips2_mouse_port_realize() accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 10 +++++++++- include/hw/input/lasips2.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 4b3264a02d..e602e3c986 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -398,10 +398,15 @@ static const TypeInfo lasips2_kbd_port_info =3D { =20 static void lasips2_mouse_port_realize(DeviceState *dev, Error **errp) { + LASIPS2MousePort *s =3D LASIPS2_MOUSE_PORT(dev); LASIPS2Port *lp =3D LASIPS2_PORT(dev); LASIPS2PortDeviceClass *lpdc =3D LASIPS2_PORT_GET_CLASS(lp); =20 - lp->ps2dev =3D ps2_mouse_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mouse), errp)) { + return; + } + + lp->ps2dev =3D PS2_DEVICE(&s->mouse); lpdc->parent_realize(dev, errp); } =20 @@ -412,6 +417,9 @@ static void lasips2_mouse_port_init(Object *obj) =20 memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-mo= use", 0x100); + + object_initialize_child(obj, "mouse", &s->mouse, TYPE_PS2_MOUSE_DEVICE= ); + lp->id =3D 1; lp->lasips2 =3D container_of(s, LASIPS2State, mouse_port); } diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h index 4a0ad999d7..01911c50f9 100644 --- a/include/hw/input/lasips2.h +++ b/include/hw/input/lasips2.h @@ -61,6 +61,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2MousePort, LASIPS2_MOUS= E_PORT) =20 struct LASIPS2MousePort { LASIPS2Port parent_obj; + + PS2MouseState mouse; }; =20 struct LASIPS2State { --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657665541587771.4020595308895; Tue, 12 Jul 2022 15:39:01 -0700 (PDT) Received: from localhost ([::1]:43370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOWx-0003gu-EA for importer@patchew.org; Tue, 12 Jul 2022 18:38:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqs-0004nO-V5; Tue, 12 Jul 2022 17:55:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqr-0008At-GJ; Tue, 12 Jul 2022 17:55:30 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNp6-000Bqt-8v; Tue, 12 Jul 2022 22:53:43 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OnuiQkD/doPGjmSJoFJNK/BQF0b2VudiyT/o1PVirc8=; b=QqSHCGrZwQRcUKnUWmGxDcrDrz oarMj06URswLWSoLymljotHfikFr+Vy+OaQ8oMpIPfXSBjf2zM+OOutYZbQFzjk/5MVqmBddt7tnT zehyKbmvNM7Nm2xb4vryXUhWhNhmPR0yqhBmHoUbx233MV9AdxmlPkV8r0DCOBBLUKqFUP+PdxqR0 WuIXe0CDlAi0JkspEzOnhVpzs97ztDCw3WXQ0Kh005x/+bvN2DY81J5rcuNTdv6LM8fdsX9hUwGAW lizZCSUFgukUVWnbifuI3+HxsjPYeJ5yGOKrK7FTUGG16yKqmkY3jqCooewr9BIkDZ5V93h9T2tM/ O/Xiv1XJ9/5nwm0Kk1Ew1hz/ETAxuWaNSYTBO2PsyVbFHKHne7KpFSxke8a79I5l8T9xJMirg4bo0 M058RzQk0mytj7iQno2mmBuK/M3RSAehnomP/pVbqaSnfDPk9ngCharSzWOVEdVU8rdDykzeUBqRg kD7sT4JYy5gHlF/o7oJQ+MjW5bJV2P1T5zQFC1Unnkbht0mRCLb+ZNM9HRHavp/IcY9ngBmVWw9A+ w/X1XHaS8FaC6q5/kbi0oDUWajIQGdG65FVUPI9dWp7uy9Ck49DIEMqrr6pj4dmiVO3KvevuGr3Bm e8GrszaLBsZpOoOgvhYIJ/kYmFu3JyCb7PWERjVDM=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:45 +0100 Message-Id: <20220712215251.7944-35-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 34/40] lasips2: update VMStateDescription for LASIPS2 device X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657665542903100001 Content-Type: text/plain; charset="utf-8" Since this series has already introduced a migration break for the HPPA B16= 0L machine, we can use this opportunity to improve the VMStateDescription for the LASIPS2 device. Add the new int_status field to the VMStateDescription and remodel the ports as separate VMSTATE_STRUCT instances representing each LASIPS2Port. Once th= is is done, the migration stream can be updated to include buf and loopback_rb= ne for each port (which is necessary since the values are accessed across sepa= rate IO accesses), and drop the port id as this is hardcoded for each port type. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/lasips2.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index e602e3c986..ea7c07a2ba 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -35,15 +35,28 @@ #include "qapi/error.h" =20 =20 +static const VMStateDescription vmstate_lasips2_port =3D { + .name =3D "lasips2-port", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(control, LASIPS2Port), + VMSTATE_UINT8(buf, LASIPS2Port), + VMSTATE_BOOL(loopback_rbne, LASIPS2Port), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_lasips2 =3D { .name =3D "lasips2", - .version_id =3D 0, - .minimum_version_id =3D 0, + .version_id =3D 1, + .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { - VMSTATE_UINT8(kbd_port.parent_obj.control, LASIPS2State), - VMSTATE_UINT8(kbd_port.parent_obj.id, LASIPS2State), - VMSTATE_UINT8(mouse_port.parent_obj.control, LASIPS2State), - VMSTATE_UINT8(mouse_port.parent_obj.id, LASIPS2State), + VMSTATE_UINT8(int_status, LASIPS2State), + VMSTATE_STRUCT(kbd_port.parent_obj, LASIPS2State, 1, + vmstate_lasips2_port, LASIPS2Port), + VMSTATE_STRUCT(mouse_port.parent_obj, LASIPS2State, 1, + vmstate_lasips2_port, LASIPS2Port), VMSTATE_END_OF_LIST() } }; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664768451653.9875506004477; Tue, 12 Jul 2022 15:26:08 -0700 (PDT) Received: from localhost ([::1]:51756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOKV-0006Yd-FL for importer@patchew.org; Tue, 12 Jul 2022 18:26:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqt-0004nP-1R; Tue, 12 Jul 2022 17:55:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqr-0008Av-IR; Tue, 12 Jul 2022 17:55:30 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNpA-000Bqt-4D; Tue, 12 Jul 2022 22:53:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=i19Au1Xthb6eQNOLGqspmaK5Lua03BoRBL4DB8X5lJY=; b=nzIbsk77+UWL2M0mOP84pSCZvs ZpbsquE5ogQb+yIjdELzp0Kq2YDV98qnLmZjC0yGp7g1QNW0VFBpd89/GIc0dRocFxuK2o8J+FtGd sdYq6FSQxfPehILkfRIfFo2RB1ZuSpuU2HgxQJma/FlzfVLpmw4IF0hDKa2tQ8OUp8OuPqO2VnxEx QKNp2VF+nC0AKAfb57/miwHuovAdBrlvCPXtpkShjiEIvhmwsNLKKvhkFo+mhTTdWeUBcqT9mcynR ydxJhJL2OY3VrH//nnhqyoYDkAhzmHitk4E1lenyfo7rYgI/6siS24+1daMOhuet8wt8sztOEP3iE pH6MILy7YCNbgXYD2n0pmH59SYAc4IuhQPdQdYXV+4T1wTy+1DmL+VXa5Vu3I0MSX/qc+qWqiyi7a gQfV777tj/wBvhJNUkqwSYcZ/V+Y9d0zi3yQTRXX0K010qurFHALJSrS1ntw89ojgvoDd91C6MAjb 7ZbVPeo/nX2enL4eYy/jUZabuvH7YN2/0NCmairqEdX/1Ro/PCqcVBNvgJAPvwOVxYel66nvekUdf KNWeKzcFKDYDvrmJtJ0H9hYBwihfXWjGrcN6mmrsa75J5PCuFBgoKsDummQg7kCBkzj+0EkHYDCPO gW7P16ZNhtjlfp700FDCPT8aQHN1rmGaG+Nb3pZw4=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:46 +0100 Message-Id: <20220712215251.7944-36-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 35/40] pckbd: introduce new vmstate_kbd_mmio VMStateDescription for the I8042_MMIO device X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664769178100001 Content-Type: text/plain; charset="utf-8" This enables us to register the VMStateDescription using the DeviceClass vm= sd property rather than having to call vmstate_register() from i8042_mmio_real= ize(). Note that this is a migration break for the MIPS magnum machine which is th= e only user of the I8042_MMIO device. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pckbd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 9184411c3e..195a64f520 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -699,9 +699,6 @@ static void i8042_mmio_realize(DeviceState *dev, Error = **errp) =20 sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->region); =20 - /* Note we can't use dc->vmsd without breaking migration compatibility= */ - vmstate_register(NULL, 0, &vmstate_kbd, ks); - ks->kbd =3D ps2_kbd_init(); qdev_connect_gpio_out(DEVICE(ks->kbd), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", @@ -732,12 +729,23 @@ static Property i8042_mmio_properties[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 +static const VMStateDescription vmstate_kbd_mmio =3D { + .name =3D "pckbd-mmio", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_STRUCT(kbd, MMIOKBDState, 0, vmstate_kbd, KBDState), + VMSTATE_END_OF_LIST() + } +}; + static void i8042_mmio_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->realize =3D i8042_mmio_realize; dc->reset =3D i8042_mmio_reset; + dc->vmsd =3D &vmstate_kbd_mmio; device_class_set_props(dc, i8042_mmio_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657665176515272.1321900970938; Tue, 12 Jul 2022 15:32:56 -0700 (PDT) Received: from localhost ([::1]:33066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOR4-0004po-NG for importer@patchew.org; Tue, 12 Jul 2022 18:32:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqz-0004pJ-M8; Tue, 12 Jul 2022 17:55:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqv-0008Bq-CG; Tue, 12 Jul 2022 17:55:36 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNpD-000Bqt-OA; Tue, 12 Jul 2022 22:53:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+qv2VAuYpynDUuetTvJGxbtIK+8joHZHB07QUkFtSUc=; b=SUpPyDHqtz0ro16SALZNtTIH1v yOZgRBRmOc/WmH31fIS0GYor9whjqy1N4Ga6g1Np+OVHQdYbcZ6zDVrb8lNbVIy0yGEhqHn0tLFlC aJ1SQoIq0MBmOrLGg5J8/B8uupGB7/71ZGf5HIOsURU5HGUgbrUjWPSxkdubX0qLoj/pEAymNYQ0X DcJwt8djScPsxxwQdxH6idg1NgHUcTse8yiOWe43XybBQ4HvT3mFb96ZisjbMyI81jQpN510NIxsb 76wI23nKkO21syPzh1eLCcFW0bt03o25wCwthyYt3cCbZhEmKXMU5eaoVnfk3yneIwLR5wrcgy4Gw m7OZ+gMp1JULSDDgAGeaYYsjePCW5rBAtMs4xknqO+zrjf/SbovC4PaSTwFI96oxTpkRtwkGVKz5/ IIyJytzGwkSQ33NpoYZu3yHAhjtUV0FN/j9dBWVwoUIBuifLbX45IGTTfhCuJMzEyJp7OBp+4xrNi hUVPA7j/q3nEuM65etEXu0+5Xtnc0thp1Lxkex13OUyqXyfDyMDOatmjDnPVIPSIlJWVsIN5EmwkB /RJI6593GibEVAzrVlpFiNzHdy1Wcu6t+YBzgISA+gh9yzPQzN4WHy8ECpx5g3SKVQUvPI6btLVkB SJNo/V58fPrNw8HOMs0tYkeQyOdDfUg800oIK2iPg=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:47 +0100 Message-Id: <20220712215251.7944-37-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 36/40] pckbd: don't use legacy ps2_kbd_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657665178083100001 Content-Type: text/plain; charset="utf-8" Instantiate the PS2 keyboard device within KBDState using object_initialize_child() in i8042_initfn() and i8042_mmio_init() and reali= ze it in i8042_realizefn() and i8042_mmio_realize() accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pckbd.c | 29 +++++++++++++++++++++-------- include/hw/input/i8042.h | 3 ++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 195a64f520..cb452f2612 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -286,7 +286,7 @@ static void kbd_queue(KBDState *s, int b, int aux) s->pending |=3D aux ? KBD_PENDING_CTRL_AUX : KBD_PENDING_CTRL_KBD; kbd_safe_update_irq(s); } else { - ps2_queue(aux ? s->mouse : s->kbd, b); + ps2_queue(aux ? s->mouse : PS2_DEVICE(&s->ps2kbd), b); } } =20 @@ -408,7 +408,7 @@ static uint64_t kbd_read_data(void *opaque, hwaddr addr, timer_mod(s->throttle_timer, qemu_clock_get_us(QEMU_CLOCK_VIRTUAL) + 1000); } - s->obdata =3D ps2_read_data(s->kbd); + s->obdata =3D ps2_read_data(PS2_DEVICE(&s->ps2kbd)); } else if (s->obsrc & KBD_OBSRC_MOUSE) { s->obdata =3D ps2_read_data(s->mouse); } else if (s->obsrc & KBD_OBSRC_CTRL) { @@ -429,14 +429,15 @@ static void kbd_write_data(void *opaque, hwaddr addr, =20 switch (s->write_cmd) { case 0: - ps2_write_keyboard(s->kbd, val); + ps2_write_keyboard(&s->ps2kbd, val); /* sending data to the keyboard reenables PS/2 communication */ s->mode &=3D ~KBD_MODE_DISABLE_KBD; kbd_safe_update_irq(s); break; case KBD_CCMD_WRITE_MODE: s->mode =3D val; - ps2_keyboard_set_translation(s->kbd, (s->mode & KBD_MODE_KCC) !=3D= 0); + ps2_keyboard_set_translation(&s->ps2kbd, + (s->mode & KBD_MODE_KCC) !=3D 0); /* * a write to the mode byte interrupt enable flags directly updates * the irq lines @@ -699,10 +700,14 @@ static void i8042_mmio_realize(DeviceState *dev, Erro= r **errp) =20 sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->region); =20 - ks->kbd =3D ps2_kbd_init(); - qdev_connect_gpio_out(DEVICE(ks->kbd), PS2_DEVICE_IRQ, + if (!sysbus_realize(SYS_BUS_DEVICE(&ks->ps2kbd), errp)) { + return; + } + + qdev_connect_gpio_out(DEVICE(&ks->ps2kbd), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); + ks->mouse =3D ps2_mouse_init(); qdev_connect_gpio_out(DEVICE(ks->mouse), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", @@ -716,6 +721,8 @@ static void i8042_mmio_init(Object *obj) =20 ks->extended_state =3D true; =20 + object_initialize_child(obj, "ps2kbd", &ks->ps2kbd, TYPE_PS2_KBD_DEVIC= E); + qdev_init_gpio_out(DEVICE(obj), ks->irqs, 2); qdev_init_gpio_in_named(DEVICE(obj), i8042_mmio_set_kbd_irq, "ps2-kbd-input-irq", 1); @@ -851,6 +858,8 @@ static void i8042_initfn(Object *obj) memory_region_init_io(isa_s->io + 1, obj, &i8042_cmd_ops, s, "i8042-cmd", 1); =20 + object_initialize_child(obj, "ps2kbd", &s->ps2kbd, TYPE_PS2_KBD_DEVICE= ); + qdev_init_gpio_out_named(DEVICE(obj), &s->a20_out, I8042_A20_LINE, 1); =20 qdev_init_gpio_out(DEVICE(obj), s->irqs, 2); @@ -884,10 +893,14 @@ static void i8042_realizefn(DeviceState *dev, Error *= *errp) isa_register_ioport(isadev, isa_s->io + 0, 0x60); isa_register_ioport(isadev, isa_s->io + 1, 0x64); =20 - s->kbd =3D ps2_kbd_init(); - qdev_connect_gpio_out(DEVICE(s->kbd), PS2_DEVICE_IRQ, + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ps2kbd), errp)) { + return; + } + + qdev_connect_gpio_out(DEVICE(&s->ps2kbd), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); + s->mouse =3D ps2_mouse_init(); qdev_connect_gpio_out(DEVICE(s->mouse), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index ca933d8e1b..8beb0ac01f 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -10,6 +10,7 @@ =20 #include "hw/isa/isa.h" #include "hw/sysbus.h" +#include "hw/input/ps2.h" #include "qom/object.h" =20 #define I8042_KBD_IRQ 0 @@ -30,7 +31,7 @@ typedef struct KBDState { uint8_t obdata; uint8_t cbdata; uint8_t pending_tmp; - void *kbd; + PS2KbdState ps2kbd; void *mouse; QEMUTimer *throttle_timer; =20 --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657664011180543.3054233813605; Tue, 12 Jul 2022 15:13:31 -0700 (PDT) Received: from localhost ([::1]:45766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBO8I-0007s6-6p for importer@patchew.org; Tue, 12 Jul 2022 18:13:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNr3-0004td-Da; Tue, 12 Jul 2022 17:55:41 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNqz-0008C6-HV; Tue, 12 Jul 2022 17:55:39 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNpH-000Bqt-CN; Tue, 12 Jul 2022 22:53:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I5fm0ZKgqrDzLLOWhbHIgpfeFsWCmLDzBV0AoVbiqAA=; b=W7Rk3bcQPYMcBPpBdat15cDwqe 7WInAeJL3hefxe+d79gJW34MRpdVHglS/2m1czbsgUdA1gxFzgz9RofKyRhQTdbY2RS9pHwflZvN2 yHjE3T6HHTYKEXVSEuQtCm0j7Uo68/EHUMxlHExZKXP6MtF6wbYBoLE7VnVxqXY1cVome0Vn0p0KL AK97PdAfoUYw9Jo20gBd412ZvpDmvsReJ4KBWkAxm11ocA4NxyHK+4hrYIa+hYTmFtj70nIjwUy6t z8zWIXPktWmmOk7Aw5LVUityzx+Yk8f/4Xvbe+f3YxJM+1ZFJ91etkn2xpsHDUPBIw51nhSaygC6e kfowRiO3SwsvHEBaC2GrL8Bux10KI798JXxbf7GA5Ir5d7tikh/DPC1r+HXiAEAMHmR8vIy4Dr7Z6 pfUYShnFkzwXkyO1acPiINlEZlveczI4fe9U/7poGT5H2wdA/tKVnQR2uOIzSy1pAuoOI/jo+UwFx 81OJ/3ZfKI9EOFg1zqym8Cr08JT52NmcMdzzLyebXOZbPITwACRFIDGg7siczscPqk/YP0a5Dv+eX IKrhj0PKMj5rFtyKY55ZqfWiC5XDmnyNCyhvbzzcl/cspQ8T99kd0ebA9zNqrugH1CD9cqwGo57IX 30A64V8gFFhlWPbthXGJwWt7I3vb1rDkRhbgVKmgk=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:48 +0100 Message-Id: <20220712215251.7944-38-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 37/40] ps2: remove unused legacy ps2_kbd_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664012113100001 Content-Type: text/plain; charset="utf-8" Now that the legacy ps2_kbd_init() function is no longer used, it can be co= mpletely removed along with its associated trace-event. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/ps2.c | 13 ------------- hw/input/trace-events | 1 - include/hw/input/ps2.h | 1 - 3 files changed, 15 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 59bac28ac8..5b1728ef02 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -1224,19 +1224,6 @@ static void ps2_kbd_realize(DeviceState *dev, Error = **errp) qemu_input_handler_register(dev, &ps2_keyboard_handler); } =20 -void *ps2_kbd_init(void) -{ - DeviceState *dev; - PS2KbdState *s; - - dev =3D qdev_new(TYPE_PS2_KBD_DEVICE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - s =3D PS2_KBD_DEVICE(dev); - - trace_ps2_kbd_init(s); - return s; -} - static QemuInputHandler ps2_mouse_handler =3D { .name =3D "QEMU PS/2 Mouse", .mask =3D INPUT_EVENT_MASK_BTN | INPUT_EVENT_MASK_REL, diff --git a/hw/input/trace-events b/hw/input/trace-events index e0bfe7f3ee..df998d13eb 100644 --- a/hw/input/trace-events +++ b/hw/input/trace-events @@ -41,7 +41,6 @@ ps2_mouse_fake_event(void *opaque) "%p" ps2_write_mouse(void *opaque, int val) "%p val %d" ps2_kbd_reset(void *opaque) "%p" ps2_mouse_reset(void *opaque) "%p" -ps2_kbd_init(void *s) "%p" ps2_mouse_init(void *s) "%p" =20 # hid.c diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h index a78619d8cb..18fd10cc75 100644 --- a/include/hw/input/ps2.h +++ b/include/hw/input/ps2.h @@ -98,7 +98,6 @@ struct PS2MouseState { OBJECT_DECLARE_SIMPLE_TYPE(PS2MouseState, PS2_MOUSE_DEVICE) =20 /* ps2.c */ -void *ps2_kbd_init(void); void *ps2_mouse_init(void); void ps2_write_mouse(PS2MouseState *s, int val); void ps2_write_keyboard(PS2KbdState *s, int val); --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657665867360220.04776804530957; Tue, 12 Jul 2022 15:44:27 -0700 (PDT) Received: from localhost ([::1]:50310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOcE-0000LA-B0 for importer@patchew.org; Tue, 12 Jul 2022 18:44:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNr5-0004wk-Ci; Tue, 12 Jul 2022 17:55:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNr3-0008FY-AE; Tue, 12 Jul 2022 17:55:43 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNpL-000Bqt-0p; Tue, 12 Jul 2022 22:53:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MxRr1x7sp4HGU5f22Vh/2CbOx09OaRYzGgw12ODP/AM=; b=PMTH7YEbQxFW5A8qqSgn2PyBiS SkpaPcAM0E/PC1NiGxgZf59ovS5BUbroRasFXERWB9UsE8oLwmNGgDgEH0X43Prr+SgGm9oX5Lt2L N5P6lO/exJPpiO2YAH3PV1W5Hzx08/Th80FgbdU82e6PWdoyVpVTsFmRVneZPPfSNZzydMqLrGzzk FUJ6DgXr2eXFLb2OL1/IkeUbUsKOK2ZcledwcTioNlqLG4bLCeTwyjmMQoDWJoG3yONHZ9NjEZd7J fyF/bAGVWHQ6vu+sP2riX2pK/gtwvlWk0gpTSWKrvohBBlbzfELmczqkmLfaA7GYdZKaTAvQuza6U 3jYlt/fIUD0hsqyc5VknIWb/HAAFXfn9kcero5PRl4yGHtU4HwOqcJyipO5mVy+mOA1HTcWvNeomU CGfR31WTqXqkfbJJnUfntI0r+ZSfQPJyBheDNlL2kYdcEThL3MJKYDvT26mhmHRGI14r82/9E6YnI fV/VURIZYjM85z3NlkKcCPNvmcFGCQGTh4Bg/WZLkuY/+AK+J6c26hiTu0g7Z43p7xhS/7ZSpC+Az CM9TS2dZwvrFwQT2wSMhw2ApeUsxmhQqG4eU8SxMiGAnMMyglGqMye7MHy0aoxEjZLb5YomQJgoPi bCbzVT3TuFL1D03siGKkyQ4CoYslgg7WCzjpXPaF8=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:49 +0100 Message-Id: <20220712215251.7944-39-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 38/40] pckbd: don't use legacy ps2_mouse_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657665868933100001 Content-Type: text/plain; charset="utf-8" Instantiate the PS2 mouse device within KBDState using object_initialize_child() in i8042_initfn() and i8042_mmio_init() and reali= ze it in i8042_realizefn() and i8042_mmio_realize() accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pckbd.c | 27 +++++++++++++++++++-------- include/hw/input/i8042.h | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index cb452f2612..0fc1af403e 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -286,7 +286,7 @@ static void kbd_queue(KBDState *s, int b, int aux) s->pending |=3D aux ? KBD_PENDING_CTRL_AUX : KBD_PENDING_CTRL_KBD; kbd_safe_update_irq(s); } else { - ps2_queue(aux ? s->mouse : PS2_DEVICE(&s->ps2kbd), b); + ps2_queue(aux ? PS2_DEVICE(&s->ps2mouse) : PS2_DEVICE(&s->ps2kbd),= b); } } =20 @@ -410,7 +410,7 @@ static uint64_t kbd_read_data(void *opaque, hwaddr addr, } s->obdata =3D ps2_read_data(PS2_DEVICE(&s->ps2kbd)); } else if (s->obsrc & KBD_OBSRC_MOUSE) { - s->obdata =3D ps2_read_data(s->mouse); + s->obdata =3D ps2_read_data(PS2_DEVICE(&s->ps2mouse)); } else if (s->obsrc & KBD_OBSRC_CTRL) { s->obdata =3D kbd_dequeue(s); } @@ -459,7 +459,7 @@ static void kbd_write_data(void *opaque, hwaddr addr, outport_write(s, val); break; case KBD_CCMD_WRITE_MOUSE: - ps2_write_mouse(s->mouse, val); + ps2_write_mouse(&s->ps2mouse, val); /* sending data to the mouse reenables PS/2 communication */ s->mode &=3D ~KBD_MODE_DISABLE_MOUSE; kbd_safe_update_irq(s); @@ -704,12 +704,15 @@ static void i8042_mmio_realize(DeviceState *dev, Erro= r **errp) return; } =20 + if (!sysbus_realize(SYS_BUS_DEVICE(&ks->ps2mouse), errp)) { + return; + } + qdev_connect_gpio_out(DEVICE(&ks->ps2kbd), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); =20 - ks->mouse =3D ps2_mouse_init(); - qdev_connect_gpio_out(DEVICE(ks->mouse), PS2_DEVICE_IRQ, + qdev_connect_gpio_out(DEVICE(&ks->ps2mouse), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", 0)); } @@ -722,6 +725,8 @@ static void i8042_mmio_init(Object *obj) ks->extended_state =3D true; =20 object_initialize_child(obj, "ps2kbd", &ks->ps2kbd, TYPE_PS2_KBD_DEVIC= E); + object_initialize_child(obj, "ps2mouse", &ks->ps2mouse, + TYPE_PS2_MOUSE_DEVICE); =20 qdev_init_gpio_out(DEVICE(obj), ks->irqs, 2); qdev_init_gpio_in_named(DEVICE(obj), i8042_mmio_set_kbd_irq, @@ -785,7 +790,7 @@ void i8042_isa_mouse_fake_event(ISAKBDState *isa) { KBDState *s =3D &isa->kbd; =20 - ps2_mouse_fake_event(s->mouse); + ps2_mouse_fake_event(&s->ps2mouse); } =20 void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out) @@ -859,6 +864,8 @@ static void i8042_initfn(Object *obj) "i8042-cmd", 1); =20 object_initialize_child(obj, "ps2kbd", &s->ps2kbd, TYPE_PS2_KBD_DEVICE= ); + object_initialize_child(obj, "ps2mouse", &s->ps2mouse, + TYPE_PS2_MOUSE_DEVICE); =20 qdev_init_gpio_out_named(DEVICE(obj), &s->a20_out, I8042_A20_LINE, 1); =20 @@ -901,10 +908,14 @@ static void i8042_realizefn(DeviceState *dev, Error *= *errp) qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); =20 - s->mouse =3D ps2_mouse_init(); - qdev_connect_gpio_out(DEVICE(s->mouse), PS2_DEVICE_IRQ, + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ps2mouse), errp)) { + return; + } + + qdev_connect_gpio_out(DEVICE(&s->ps2mouse), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq= ", 0)); + if (isa_s->kbd_throttle && !isa_s->kbd.extended_state) { warn_report(TYPE_I8042 ": can't enable kbd-throttle without" " extended-state, disabling kbd-throttle"); diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index 8beb0ac01f..e199f1ece8 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -32,7 +32,7 @@ typedef struct KBDState { uint8_t cbdata; uint8_t pending_tmp; PS2KbdState ps2kbd; - void *mouse; + PS2MouseState ps2mouse; QEMUTimer *throttle_timer; =20 qemu_irq irqs[2]; --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657666028633927.9899724153004; Tue, 12 Jul 2022 15:47:08 -0700 (PDT) Received: from localhost ([::1]:55744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOep-00043d-KM for importer@patchew.org; Tue, 12 Jul 2022 18:47:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNrB-00051o-2R; Tue, 12 Jul 2022 17:55:49 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNr8-0008Hn-BY; Tue, 12 Jul 2022 17:55:48 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNpP-000Bqt-AX; Tue, 12 Jul 2022 22:54:03 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=twL062T9ok65ODDxZgLpwO6rmQAEkTiVC/BWTXx9GiU=; b=idlixx47hzsGWt0YDeacJDWB44 C12xdrITcZZGz8hgaT+s6tu9+l0IePgc+LwtTVdZ+/dztRRpT3n/ae8H7SmsnXRdXWVfdXYiZKfXO ITWrfm7WcNsyrUgpQVvNEq2Jt2OlcV5n+U4LIIFlqWCzZv5xLtGyKH8HL9RzHa/3NbmDndqpJaEQz WdlJjeu9Ouxlqur6jZUmBryH0/CLaO+vHTJeloGmdc1ILW3uTVAh5947BMKDMrVsCTh2X1RHj9sIs aacatrPvP8Cj409GuBKDntG67pautA6Oaygzgzl8eOOWe+lGTBqRptWlzmy8QirYY2pU4llMzDS4R +JYt822hpwScZqOtGsf6kkGmCMtmqxUNxSuD0p6EFFm4lm9KhJcq5o7DK/noEjG9UaRBwWttAvJpL EyaUh89SqMMUe+tHIIAeQn7FZlHcJKzC9ElZum3cCgBiiIvFqI/DaeJEClNBSdN4/RrhqhU0jjljp /O1b7NJmw2eJ47MIvJ8WIvsk5GmoPwgHcNEaGB0OVnRPynBx0E4Q+ZQFQyGslkQZadQPNFS87kbWw eBfn6nPqtOQi8eivGFv4Ryy6GlZUdmhOERsf7lNKkEWhsCQ4ejAqkRyclIpMBS6wB+AynDsCc++en g80+7IWz3w6S4HJi2U26FEhS3LwfQzJnRWetNpYAQ=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:50 +0100 Message-Id: <20220712215251.7944-40-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 39/40] ps2: remove unused legacy ps2_mouse_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657666029598100001 Content-Type: text/plain; charset="utf-8" Now that the legacy ps2_mouse_init() function is no longer used, it can be = completely removed along with its associated trace-event. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/ps2.c | 13 ------------- hw/input/trace-events | 1 - include/hw/input/ps2.h | 1 - 3 files changed, 15 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 5b1728ef02..05cf7111e3 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -1236,19 +1236,6 @@ static void ps2_mouse_realize(DeviceState *dev, Erro= r **errp) qemu_input_handler_register(dev, &ps2_mouse_handler); } =20 -void *ps2_mouse_init(void) -{ - DeviceState *dev; - PS2MouseState *s; - - dev =3D qdev_new(TYPE_PS2_MOUSE_DEVICE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - s =3D PS2_MOUSE_DEVICE(dev); - - trace_ps2_mouse_init(s); - return s; -} - static void ps2_kbd_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); diff --git a/hw/input/trace-events b/hw/input/trace-events index df998d13eb..29001a827d 100644 --- a/hw/input/trace-events +++ b/hw/input/trace-events @@ -41,7 +41,6 @@ ps2_mouse_fake_event(void *opaque) "%p" ps2_write_mouse(void *opaque, int val) "%p val %d" ps2_kbd_reset(void *opaque) "%p" ps2_mouse_reset(void *opaque) "%p" -ps2_mouse_init(void *s) "%p" =20 # hid.c hid_kbd_queue_full(void) "queue full" diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h index 18fd10cc75..ff777582cd 100644 --- a/include/hw/input/ps2.h +++ b/include/hw/input/ps2.h @@ -98,7 +98,6 @@ struct PS2MouseState { OBJECT_DECLARE_SIMPLE_TYPE(PS2MouseState, PS2_MOUSE_DEVICE) =20 /* ps2.c */ -void *ps2_mouse_init(void); void ps2_write_mouse(PS2MouseState *s, int val); void ps2_write_keyboard(PS2KbdState *s, int val); uint32_t ps2_read_data(PS2State *s); --=20 2.30.2 From nobody Mon Feb 9 23:41:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657666108786144.3884868116204; Tue, 12 Jul 2022 15:48:28 -0700 (PDT) Received: from localhost ([::1]:59054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBOg6-0006RV-Oj for importer@patchew.org; Tue, 12 Jul 2022 18:48:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNrD-00059e-9x; Tue, 12 Jul 2022 17:55:51 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:42632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNrB-0008K8-L9; Tue, 12 Jul 2022 17:55:50 -0400 Received: from [2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576] (helo=kentang.home) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBNpT-000Bqt-Hz; Tue, 12 Jul 2022 22:54:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JQdHmrDfKT0ljofYqV+W36eWkMkJ72kqHZFSOwjBwqM=; b=U/HHEap5SXeZ2fwVyljSDc2KP2 Zo11XUvnOb5wKNIgB7tIYp9fdGs20fAHWCGmYm2sXdRnkvBIXFtbUco7ZUDVGhW8+Oi/LnYjj2U81 olji3rcLBof+Q3clioUq5FLtb3+LEDdffFSGL5+fs4fdxftG+ElmpIRJOMC+Z4w1ZRURIuP0viJej Yan0wSwd0avHxi0KHCrzqEcz1RLZ0AdiYbrK63xK0D8Ec4rTNTgabd1ejLaG2DVUN8NdQOJwFZA9A V3URMgCBiF54SmFv27Zy80jdDVJ9vXYGHtuSGLsVtYOPjjcNJ4ZVR7ZnbLT61PzJYzUVJWbXw0RLv nweFwgMHxks4/+quu8/mNWy+YQlK1UY3ao5H3tDAH5rhVncODWCoDF9oGVFRBmLhgvYCjNkRxknal XHWULI6WP4ChCIoOaKwZGqq6YQSdM1RVbN01o5GjuCnZAV8pKN8nkcPEy0uUrjxTU+TkYd7C7LEBW 14Rv3wJm2Nn63nnTDVjmcNoOyO88OTg2sO5E2w7G/LMG2HuGD5pQArzEO02HQsr2OwWd8pyLtfZFK bv6mwuibMsydHWD6xq3ZHCXK3Mh6YXG4Ocg9UYjuXnMNfsM5g3q+nGLnKRb+AM/U0MYk5kgC7Xmd/ 0C7UTHEgJiHI5vcxUnrE7fbJNCFNQnEUXi+9qBUXM=; From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Tue, 12 Jul 2022 22:52:51 +0100 Message-Id: <20220712215251.7944-41-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> References: <20220712215251.7944-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba5:df00:fd7d:1c3a:1dd0:c576 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 40/40] pckbd: remove legacy i8042_mm_init() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657666109824100001 Content-Type: text/plain; charset="utf-8" This legacy function is only used during the initialisation of the MIPS mag= num machine, so inline its functionality directly into mips_jazz_init() and then remove it. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/pckbd.c | 16 ---------------- hw/mips/jazz.c | 13 ++++++++++--- include/hw/input/i8042.h | 2 -- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 0fc1af403e..b92b63bedc 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -762,22 +762,6 @@ static void i8042_mmio_class_init(ObjectClass *klass, = void *data) set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } =20 -MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, - ram_addr_t size, hwaddr mask) -{ - DeviceState *dev; - - dev =3D qdev_new(TYPE_I8042_MMIO); - qdev_prop_set_uint64(dev, "mask", mask); - qdev_prop_set_uint32(dev, "size", size); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - qdev_connect_gpio_out(dev, I8042_KBD_IRQ, kbd_irq); - qdev_connect_gpio_out(dev, I8042_MOUSE_IRQ, mouse_irq); - - return I8042_MMIO(dev); -} - static const TypeInfo i8042_mmio_info =3D { .name =3D TYPE_I8042_MMIO, .parent =3D TYPE_SYS_BUS_DEVICE, diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 1eb8bd5018..6aefe9a61b 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -361,9 +361,16 @@ static void mips_jazz_init(MachineState *machine, memory_region_add_subregion(address_space, 0x80004000, rtc); =20 /* Keyboard (i8042) */ - i8042 =3D i8042_mm_init(qdev_get_gpio_in(rc4030, 6), - qdev_get_gpio_in(rc4030, 7), - 0x1000, 0x1); + i8042 =3D I8042_MMIO(qdev_new(TYPE_I8042_MMIO)); + qdev_prop_set_uint64(DEVICE(i8042), "mask", 1); + qdev_prop_set_uint32(DEVICE(i8042), "size", 0x1000); + sysbus_realize_and_unref(SYS_BUS_DEVICE(i8042), &error_fatal); + + qdev_connect_gpio_out(DEVICE(i8042), I8042_KBD_IRQ, + qdev_get_gpio_in(rc4030, 6)); + qdev_connect_gpio_out(DEVICE(i8042), I8042_MOUSE_IRQ, + qdev_get_gpio_in(rc4030, 7)); + memory_region_add_subregion(address_space, 0x80005000, sysbus_mmio_get_region(SYS_BUS_DEVICE(i804= 2), 0)); diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index e199f1ece8..9fb3f8d787 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -88,8 +88,6 @@ struct MMIOKBDState { #define I8042_A20_LINE "a20" =20 =20 -MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, - ram_addr_t size, hwaddr mask); void i8042_isa_mouse_fake_event(ISAKBDState *isa); void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); =20 --=20 2.30.2