From nobody Mon Feb 9 23:52:47 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 1658169754837317.78545593732315; Mon, 18 Jul 2022 11:42:34 -0700 (PDT) Received: from localhost ([::1]:49326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVhR-0007Yv-0M for importer@patchew.org; Mon, 18 Jul 2022 14:42:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZ7-0007gn-OA for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:33:57 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZ6-0005Vv-94 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:33:57 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVXk-000B51-Ml; Mon, 18 Jul 2022 19:32:36 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=uo1qvslZwditqqn3T+vuSzu0nc4f10NOivC1+SyNwaI=; b=AP9sMlYYn6PFzUUgJV2h9wyoal V6q5scKJzscHNz3wztNkgMRLliuxqSfv+wdrJ+b1S+S2lNUjT1XdzrdEprw3MxQ8NJ6BeltGEzZZr 4qgFCf/VMQ2SkM/xim+0Q5p3kbaTQbeZWj2Esj7SvHM6boYeAcq5xaE+ifBC0u7Iq8av5j78IlRYQ T3ja9N/BP2S1VdgI01d9gkU/s4gL62nX6b9M+0j7RttziqbBGzsCJpKpzrunShIVodqOic7K61DL6 dBY39huou1qrOllr96thOtUale5yWzL2UJ7pKMMhqkNRaZYzloNUWz1lOtNo6QCJW+RuWF9B8Luh6 MTcIrzbyGXIoSPvNnQx9IfihZL4r94kIxG17nWLZbK7vXcwGPYM0F756bTRIWnI1n5sLhGY8AiMlK lZkPm1J0IyBNio/2qwUGMp82rugBx3co7wDQbLp3BhDnjACu0QByfvcCQvl3I1lcUYLTMbtqIjRWE gIGyBEqlXnriCIQ9Aindq1bY3qs9JGzYXjNFlrd2MbzL7x+1TbQWLUtro1yUzJTISwxB4S1kIyWCF 3IcINpJBobR8mDbNmsCKQZxFJkBEc3//Vtd4yG0cEUIfGZZRvE4nBuBUkDWhTEpxQElckZMV8HUgc 4rMSnPtnqwXSra5Hy9NZZVnISrtG+zVfVTUofTuo0=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:00 +0100 Message-Id: <20220718183339.124253-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658169755868100001 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 Message-Id: <20220712215251.7944-2-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658169496448818.980237329912; Mon, 18 Jul 2022 11:38:16 -0700 (PDT) Received: from localhost ([::1]:42882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVdG-0002iY-Jh for importer@patchew.org; Mon, 18 Jul 2022 14:38:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZB-0007pa-Pl for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:01 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZA-0005WG-9r for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:01 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVXo-000B51-RD; Mon, 18 Jul 2022 19:32: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=dTijwKG5W8z5uCTtDSUU5DZQU2CZ45SFe9y4iXV1cCQ=; b=Ch7L3XRKHzGr2QrwPDlxD/7Drg SqArirdkoFNo+rwMDebNHgB/mCBoVu/5Kcq8smE2y/r1dNBRBoZ59DzjO5iPfXJvtDAuViyOXZcDW kGxwZM1b/1BgkaBoqM/0IPZq0aI6Ei4D87Bwez0X3oLrGCTfNbFzgWxYYMM3FBvN2wZTHetwC7Cnl ebXNq44oEekqAvDxmMUeit6s0hRVAUhP87wrqgR3ZP8rhQygbpVjJBE0RayU2Zia7h7vnmKoCI0xY d/Ge3L2sqn8v9ZPC4WUHF0ry0QgxiqpoPgYsdtQAUaGH3CAGNxgpKm2O3tW3uS3qhHuiF5IS2NJTy bxDFrHJDWJKj6QQKvp+tYqHJ5RmB+aKGWiKNj3mTL7BcvkeM9uYJ0Lqh58DIm/ZIJSBDhniKSbVKK 6blK97PozrU/HVZq18s+QAWUHVfIdyPjfzPm2jgd5ainln8dluKKg512vei8WHro1K6z4jYHbP9E9 KKNQXRPXjxAa+vpUva8F7gBC/6XFZqMBGUC5C7+8z1Y3KvHNn6XPE+515bicZc7sDwt9YZQFOousO aBbg6k+QY2jfYH08+/Ra6rmUxtQBBl5S45DdH12A0C/g5Dfiqz79EsCt3LNS3r0RQ+rHLbtS83zGg W+wwLZrNyNvRrqoPBwXXRgN3PHj5aqT8GKRIh4UBg=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:01 +0100 Message-Id: <20220718183339.124253-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658169498464100001 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 Message-Id: <20220712215251.7944-3-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170158347343.3368366409446; Mon, 18 Jul 2022 11:49:18 -0700 (PDT) Received: from localhost ([::1]:60000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVnw-0006wP-8M for importer@patchew.org; Mon, 18 Jul 2022 14:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZH-0007xG-OL for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:12 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZF-0005Wv-Pk for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:07 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVXs-000B51-Nr; Mon, 18 Jul 2022 19:32:45 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=n2JqZKu5e42y4DYwNVbIWEZty650iAFPFT1H7oR1Erk=; b=YyujgR2rhH5faoYST6iX+BKjlU RdwF5Lz9a+gOx+9ZjnHwQR1SCIsVjDh0b5OMKj78d8LhMa8F/8IhFN8ioiIOXNK8ZZK+sBt5mNrxY ksHUYTwimvWvqPuVGeEAEUwQCdu3JQU2GframaJpJcaMxGdB9c+X1dwA0z4C8m9wY6uzAEmxPKR4P hEccOZVr7sf6k78TutuUitLkmc5j22FJzBChjVsHSJFktru478GYooLjBMaU/bHvh8/rszZQMLaVm dNDoTQGARm0CTw9CPcQQg/NAGtquAK6xWG1Elyg+7sydoCS1WTFIL6qeVouCgZE/yiVJOrFpUA2tS xOz1N17W7EeI/Cx7HNR8aXCj9B3hUpsJobu7TVN7nAoy72T/aE3NCka+zrDOS0sRnPIV0mv9AEzFh YdFroTzVtuoGYHbVRabmqh9konkTJoBoa7LTS4zfQimEZgaSURiRLiuYB3/XQcOtVSxMdrwHm8ZFU tIQWyR0e992ddMvxRTEjTW0TjtxYFnf+nhWrsZPcxHWXcnmwqR8aMXQ1fbpiwViJo6taofq09CEg5 r9huaG918asS5XFT2aW1Dp4fTwQmN6RvNiWEFce6lK/SanL+22C1HpHMbJkiFStNyUHd95fxpeKqm xZ8e5cFrWf52s9t3mQR1hxA8HFTQVTedbbFYnh2JI=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:02 +0100 Message-Id: <20220718183339.124253-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170159944100001 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 Message-Id: <20220712215251.7944-4-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658169576349673.1045132516424; Mon, 18 Jul 2022 11:39:36 -0700 (PDT) Received: from localhost ([::1]:44030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVeY-0003al-Ko for importer@patchew.org; Mon, 18 Jul 2022 14:39:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZM-0007xk-Rz for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:14 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZI-0005XB-BB for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:10 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVXx-000B51-2c; Mon, 18 Jul 2022 19:32: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=Gr7YLlgAy48sbeLbkDWIb/hxbkEXcQZ1G3ofTyo7spo=; b=Nj1WzobHaN3syM9BTvkP8L3OIj Ie9Qth7x9MEL9JaNQhkVhFuu0rspZl3Ep1CeFN8QjdcdL6G0lqJ1Kphg5fBOHorfKZNJpX15NDSmd fGX+VrB5kE9vD7IIvX5q3DO03K5y1dgA4qhn8XEpxCA6jkCICWMKImEM/vFyZBCiSHIiYC3GQBeNN MyvyO4bIHVe68m1+xiB+iHj+4/ZLdJLHuDfWUjsTnNJgK6nGADvLkeNs8pHAwREZQWfmrBB8zM+70 P6NAW6OhQfTWpM1JaC0pcX3HwOQf2OBby6cfsmENAvQkmATcqtRLJHQwMPCyYuQ6IWcNXhBFnjHLR vyQtou6oPApQo9ROP5UQTqMF66UOYtMkHuwdcLEr5YIOEi9fBcgajBNL+rKcVT124Qa/AH0vX3rYC TIx/m7Qg2Khmuhr2NUx2ts8T03bs5VQKIZ6zRVwYeUA6n3NBq9EKLdszYB5+cbSIJVyg8oGeoQwqd ausw0rRNiCquzmhMi+bsJMZLovXoh7oSBrVSNtAz0TryLsqab6SqLdIuTm6wP8e6BMlLOdOpEASdl VJGKOH2CN+w8Vd/gkYMM/zwopC2SRW9ALNxJNz6Uxmc3HPOnmhXHng7Ndy8JuRQvEe9a5zuv/X2/c FEH6AWeM4Vi+R+uvMyL+VL1JM7xYhushLRZPtQAbI=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:03 +0100 Message-Id: <20220718183339.124253-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658169578598100001 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 Message-Id: <20220712215251.7944-5-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170446343366.35395935044085; Mon, 18 Jul 2022 11:54:06 -0700 (PDT) Received: from localhost ([::1]:40434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVsb-0005gU-0N for importer@patchew.org; Mon, 18 Jul 2022 14:54:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZO-0007yH-Th for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:15 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZN-0005XN-BS for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:14 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVY1-000B51-0q; Mon, 18 Jul 2022 19:32: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=rZGj17VptLsZWXeLYxsgFZ/iTorVUhMJW/uL07qu8HE=; b=m3meog/BfGat66EvU44tMCTvqI 9S87E2V93s9N7S72cH//tPTy8Dg1vPalSJbN0Z+Z5FrwCRjP/Jyw5Qof/osqPc+BAGNZaDtk0v6L1 MP+ezOzv7y+FJjN7Th4K6H4nYro1xkVOru2xARV2ngKSbTmgCzLORSISF+NkGbCoehJEUZ9AaMkSs lkYo0yo6f/gLtG3eN1GFLqpr8ZcQOPDr6ShFbS//dct2khrgjGAMhjT254bUOnA5yJFzK2fqR4peD L2XO2VovN7zfoupyoqFcdubwo5qaA1Szyh862tKW4IkbKSbgCLMDElIGXe0nrczN9XZuhZD6AIOBr WDrZ5YH9AKAzMZLj82Sjc31KiU2E6X+urUv2dC1AiiuxacJFtflHIemH+HBgQzVUhTMoaiOV0YAt1 qvY8j7ZmliywjAVPQcW/ja2yt1oDQp24vAnzgPAwMlO1q68xh7Jr8LnFmA6RR7cTH2I1nCaWKVteI Zyyo7D6Q3vgyOZOnEt91Icuatw0I4tK6bZPlQeNkliM5Bp1JwyUOA7AQZJmcKqNo2jva3TtIv3Kzu erBorrdlWdxZth2zd7r2aLimDqubc3l3yPZpnasyc2uSi7I6EB4FLwVFiGQugNCgtyGBYB9HfU0Rs 8y994qYNSKh7ekFsuVG0uMwQFCW+TE89IBPavf35c=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:04 +0100 Message-Id: <20220718183339.124253-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170447737100001 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 Message-Id: <20220712215251.7944-6-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658169874656260.71089407579973; Mon, 18 Jul 2022 11:44:34 -0700 (PDT) Received: from localhost ([::1]:53154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVjN-0001tN-7L for importer@patchew.org; Mon, 18 Jul 2022 14:44:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZS-000801-Ck for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:21 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZQ-0005Xq-TO for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:18 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVY5-000B51-6t; Mon, 18 Jul 2022 19:32: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=/+vzape9gqxwBCbgfkvh0euzQ7m+8MBhxRIU/PDlQRg=; b=WnDSASeZTKRDqPsGlZ92f0Q8n9 vll9JO0CPpkBppxFEa09Np5Ck1N4S0BrYivgL/zyJbN7qevwXhzcxGpyFssIx4T8W8Z+as5523jcq +qtUOJvSTU1NYTKz6d8+NvibgR9BflvjBNUModmzruy4qgNmBv1cWkz1YQY9Str/UkUcnl2rcCb7Z pdXsqkKUmhnQNnQS9RIT9F70unMwRSmTW2BPssOqgfExF5+JkU00e1gJ4CDJQnbJi81l2rJrviuQJ y0cm1V1vexve5iVWjMGfrJG2Npnw707oCCP1AXAXKCenFEqRyrIeySDvYyOIaCYUGvqYmw4yIvuAj agHkQlcUIgTpNyERz1WDEzLcCGgRfZRDMgWh/04WAOGHr9UGTyJ4TRu8uOAygRsVHR8lzfGSoNVvY At2gbUl75TFXGz7em/K+avuwXyqqZAGy8/5lwcriCOhNQAvIp7qGEcyND0BW7M9N3oEjk//Vg6jqH iTt0+VnWrw8po4p9obUNYYOaaBj+Sjhy7W3TRbNv4lJlHKRVh28OVho4Dv9x+l4aUWm/CIE5Fprow jB1h4EbA5C5UGMd9dJuCxaJLvovpcrWBNHQ74oOn/LJY+022cCBlX8pb+ZvU9PnLrP8cYeOEIbFBa vvzPkOaivVDu00+FLI6yMzxd2M1ol657WCkX1mh+M=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:05 +0100 Message-Id: <20220718183339.124253-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658169874942100001 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 Message-Id: <20220712215251.7944-7-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658169808274947.3791834760195; Mon, 18 Jul 2022 11:43:28 -0700 (PDT) Received: from localhost ([::1]:51594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDViJ-0000oY-7a for importer@patchew.org; Mon, 18 Jul 2022 14:43:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZW-000850-1M for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:22 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZU-0005YM-Dx for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:21 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVY9-000B51-DX; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=TBnZrCE9IAzd2j8nmwx0gUDbeneVwSHVs65lfkHzNG8=; b=plh85NjWrg1DTW/BxpgaaxQWEb ToKVn21X58124kIJq1oH9CQTyLszlWUJ+m8LnaCXGU5MR3HEsM759qGR5TurJknfvT6lT9gi2g61F 6aOBKoIsnI/jvCCpO+AfQog6khXlRQVKmejrolJfQGwBR5JWAML10Ayqgj8sTM27IxC8Snxnc3XI1 216z+4HZ6wgfxgoleAX2HjYmrCc5JK4/fXrsUux3tEZCP7YxpCEk7fpaygd5n0WfAUiy858MCynSe +p79ozj28PhSt+EEpev4SmJysmX2H7i3xm2OvknKRucsXP4zIttNjbZg17ubKACWtODgRRGOz7miZ FBbe4X2Mg7BJsDAhqCRxIs0iqhTDc59XKe5sdzGmUllYvwstfAIzW1ptAK4/9jXpTZbWVsvwjeREy xM3xSwTGbqtjeUxcmYsla2KZymx5gH4OiWqUXgKsUmWkHSZkaS4IrMPKsA6I6WXYR/WwXTi0l6oFn adOFWf+yj98izVuMOORL9PMKDpgL890sNkfAs/LKYQNS/4LfzlxOGZGU9bF4XPgDb1QZZXD23UJKL Gu/ay98m6TulOTpnN3fjJXnlnu3SDjROV81g41WoI0wpgTZLYTd3ZCZs8HhUIvu7quAZo0/aueqrq f1Hrdnp/hG4mptKB7tBS9QeTwBX1bmoLBtuBWVM8M=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:06 +0100 Message-Id: <20220718183339.124253-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658169810167100001 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 Message-Id: <20220712215251.7944-8-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170266131849.7881756828434; Mon, 18 Jul 2022 11:51:06 -0700 (PDT) Received: from localhost ([::1]:33628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVph-0008RI-0r for importer@patchew.org; Mon, 18 Jul 2022 14:51:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZZ-00087t-RF for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:25 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZY-0005Yj-7q for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:25 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYD-000B51-4o; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=KOFIGju5rC7Pzd/89v9sbzOoJSlYSgzjJGKsYyKdnKo=; b=dQUdwwkcQGa/OJJWpcVkFGzQXB m1wuX3Bk/46CpHhI4wkZpzY2flLHgq3jhMmGItV3NJRbIw4qsJFaSJ8mNtwB7sk1Ql+DbU+fWcejE P0tKGuPB8oo00l4R/gd4AB8QOufKgcjMDWHiTdTW7rMz+qWT+GHsqvilAGNzCJD69YTQD5i8XEda3 XnQE2UaUN70aHWCWVRYdkV1JbOHHHXUCXTOct+eGP0Hm2YFFrtXgZAEEkf35raFQMKzVa+X2N/DbJ r+UrDQVJ5IjZZGvBnBU+Vwxm8oOAwLzalSKMG+BeNBTtvRa5PbqOxkilTgL1kqdCUhLN3cd62r3Ly A9SG5wqxKDfspMri3Ob+cSwAxTVmAIX50QfcdF9CgwwQLTOb7CFd9X+nTzpSMEHGCTNRXFDiceQGN dTwgcBkHKmVM13Jtj8fTIcOX4A0Ohexm1NaTJphZEhvS6cjTvIV1nMy4E8Bc9jehiDR5pa/Hn9CV7 7ToU2rORap+ie/9lYJJG9N9wz2NmPYnYq7we+C3pUkfGPTcOgVp00AiniVjCz0XOcdmo2K6YIjG8k YhhzWg2J56CTGI9iDA9qeBLRzXJmFkZQovkswHbdV5iv61bsZ3tnKuvskPT0TfUvAKBUfDiz0uM2e Dlv0npL93+L5KBPUsLBLMvLOGIxJpZwSSyiNlTK8Y=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:07 +0100 Message-Id: <20220718183339.124253-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170268158100001 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 Message-Id: <20220712215251.7944-9-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170497130274.7208448321145; Mon, 18 Jul 2022 11:54:57 -0700 (PDT) Received: from localhost ([::1]:42330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVtP-0007EW-4s for importer@patchew.org; Mon, 18 Jul 2022 14:54:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZe-0008Jc-2U for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:30 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZc-0005Z4-EX for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:29 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYH-000B51-2G; Mon, 18 Jul 2022 19:33:09 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=HjXmZwi2YPoZjCnlb40gNszw34DPNKEad7/HYN+GQIQ=; b=hnJjP8hayw1nGhW163WIecPMIe r4Z26yx29c4XKbM78k5NzNXfbRt4XcdbWbHoKieT5FZYnRaiB1+ncXrgPiVhB9CI2MSIo0zYaGXxl OW+jIutchbi69WqptNgGg3qtJW+KThWYFtAyjPtUFEtmbRYnhM8ER2/a3jrws3bZeqXQ38O1QGctj xErqkkYih60FY4gZtpZOgXYC37QP/7gdjQsDuu3e7E3zUBUhV3y7TKXP0th7lmP/sLRIlQYiSWitm Wmx8IhW/sdi0NS/WkgTjjwAMs5VLv3jW5b5gdHJiVk047U9Un70kd0EVtBxAOx1h4GgOjTaNuDMnq Y5dMOYpWqoIj6f5UFPlU4LVuRacerYWgrvskEMp8eYdegJCL6dFfyGkRiUfp8eN9bfxsYNsgRj53D 03gE65U/ALickugZxoKrsd4dJaz7gFCOd4lxqH+uweMLroe4nN7PWKw20makvaM9+3mRRbhpCkjLo Np9WmVq/4EV1W3PmqjV1L8wElYb4Eng+VpbIN62EwtlxCikS2gC9uKbcFA/7tHMr075pesuMKG4HR hy4RYxXPGos4n25NiAbe9axW3n9cI5TF1EEn5Wea5GDLJbK8eB9NmbBRByv9+gu7Jj0HgW7cIV+lb n74fg1XWLUIwt6KbE/j+uhP/R1gwQcxXT87hwnfuk=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:08 +0100 Message-Id: <20220718183339.124253-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170498017100001 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 Message-Id: <20220712215251.7944-10-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170736845813.1174570881736; Mon, 18 Jul 2022 11:58:56 -0700 (PDT) Received: from localhost ([::1]:48852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVxH-0004bQ-NU for importer@patchew.org; Mon, 18 Jul 2022 14:58:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZj-0008W7-0G for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:38 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZg-0005ah-MR for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:33 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYL-000B51-8U; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=tjFhHSw3zB10mQiwL5g5ScMLvNBYRGN1yjFyUwrQztY=; b=osgWpIZoyoDmANi6L3LoODD6oL MhZl/CdsXPSgky2jLl4T5y1fJliNMGtqgJ1qhwbKA2Y/xrKcPe3slQ+eAib982tGljNfEyQItPjUK HV7YMOrSp2qOCdoRu+9Ps/+e7E8KB0bKrRgkYJU8cYcxr6HDYHhs69B7aEeKkxL+p/pZcxiqf9SiH Klz2EbCMtq44PiE1wCNdXGfzAbaCNmxRog461o/p4+G3L5yE4tSK0Ml0zsuvjogu/cRRn9sPWsvN2 2wTR2I90Ac3jvLnLkm4B7pKh0+8RKwCB0UU0Vg7lYu0ApWrPRSngDvLEOoSQA7KaFxkX2P969KNuL ANICAcNrGUNqo8QKzneAuLC2h4RLXbXzSN+z9RqXzPRHxn3aDoG8OnBc0PYiUM/4yPX+M4ZhPWwu4 8c8Dedosp8M79iMUQ66gh8iwVXe9iEz9Jyg9fDZQIBfJpT4wnkb6aCx3KZb69s4XExHewXazcETnV NtdRNkCbuMrwg30GTJTWP4ThKCp7pW/2gi4gw4/j4VRwFDXueXxu6aMbQVwrN3YEjTu92D1AOJkEW 0GFn34XzkQTwa1eB5SskZw5UIpHsKFfewvNeaJ7qbc4IVBlx3NAH1wxuHZCMAGLNgc067NxClFRgW Z987QmthDBv2waOdWM/nu5B2Y7ASORlQ8/rzDR/zc=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:09 +0100 Message-Id: <20220718183339.124253-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170738203100001 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 Message-Id: <20220712215251.7944-11-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170170886886.3620659509935; Mon, 18 Jul 2022 11:49:30 -0700 (PDT) Received: from localhost ([::1]:60958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVo9-0007bH-MD for importer@patchew.org; Mon, 18 Jul 2022 14:49:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZm-00005p-Qx for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:40 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZl-0005b9-4j for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:38 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYP-000B51-FY; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=9a7xSGwHAN3Vts25IJdZBEbXE8c5BX9khQiciiHNtJI=; b=Jx3VVtCq1XN9XbKkI0/XsxSBz7 cxMKmxUs87WnEifgd/k3cL+XzwTD+pJPKBggY2UoBEbyAs/BM0MANepoDgBm116khCTP//mBeuLXk u671mfgYVwdIf1PTO3fOcsrnn9VgZv5lmG3ZSpLt0f8uPwuDkkVVIZ8e2x9pxXcfbp7bNOITlYLvA OwngNt9PbfsnF1MHKsO0MzQhtHJ4cGhhGQ5Zxbj8MjccAHjdBUHXSUIEsAwt0ndm4Mg7KJb8OzsRJ v4CWEnK0Ll5/KNm2lwwRop0g9kvGAUDeZI+gnWTNtZ2nqgXP8w6hSTyXHBSeha/zGzs3AT1Sysc1f sJ5aDq5vXtOyJdDIQn1trBaWCaR1MEqpR91GYFX4YBQrFid8+L02rKTiIsIDt0vTl538Ajqv68ZKz KXvusIgTqouDHDmVXph62fooDN7r2IzhT/0hsoEKv3DwTuWFW8S4vWBoAzybT9wjZig1IXdQvq9lT Y4AvgomhE5e8+4e8XvJfCJwmjTvVXgwUKOVB3ZI3hxg3am95te1BDfpf1buH3QQxE6ASDbEBZJSy2 teE+i+y3r8cEf+PXG5AKFd+iV2Heajwm0ibke138zqpq+I+r0oVCwoz73GJ7NqghwR4Bg0+Yv2UFi XNTx9LQ8FtJ/V1izHHS7jKBi4xLiZRumkHoLrqcWQ=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:10 +0100 Message-Id: <20220718183339.124253-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170171783100001 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 Message-Id: <20220712215251.7944-12-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171090452625.9328973790541; Mon, 18 Jul 2022 12:04:50 -0700 (PDT) Received: from localhost ([::1]:57376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW2x-00031C-Si for importer@patchew.org; Mon, 18 Jul 2022 15:04:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZq-00007z-Rj for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZp-0005bS-By for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:42 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYT-000B51-CF; Mon, 18 Jul 2022 19:33:21 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=Y7dS4l/41bQu4s4Aa0fRuzzEhNMxdlYGsLuwjL0xBiU=; b=N2EeiLJnTJHl+px3j/vYzFjND5 NX6UwCLX5PWN8zIJZvDselzqR1o5VHWPVEcUOTFKh6nlsG39Bn3LON0+dOt1Qngx9Q4rZRaYOUvYA ibxTMQNG+dkRkgb48icd16sAD3rT42RAIKhjz2qdlUG8E+LEoKC1/jt5kWDv4sJp68oHE5s1XfYfj Kp1/kNOUCzBB+chzRn5Q8YErn/LFaxP90ZLuOEnZ5T0f/H0EhK1Tq+z+tHvoWuh+DFGAmMW/0f8f2 ax/3Kewy55LZDa5mUwpeZPteSBJfpJywQPc1tG0OdTxv9B+qCr92koPocdnLSGC+S8GSDdUGIe2tT Od61S/3bNon2WFGIYxgELmzCS9sQiVHV4kXkvuWOz02Ey3CpL8xumKXwvhIM4pCQ0hb6csUvg6h2m 8Apuq0MoCzNQcJk4+ZRKTjjKuLE8AFwKrLHOCkBhUBDoo+dl9KGRDmRWLu0qxra/+QM4ot8DoM+xK 2wRPiBhJ754wW9dzerDP6S2vu9gnO/CU6bYlRRLbC7sY0EZnRDGxQY28++BeiW0MkNylJrgZvI8/d jApICwZYfPT2eT6BEpQIkad7z5hrlB8YrNfjsA6i6/pKcUGdF3PDlVYxQ7y2kuFseGlotKYQ3tfdt YSsLdoJnWc4JWR1n8HFp/tUQ4/MikhhT4izSh7oUA=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:11 +0100 Message-Id: <20220718183339.124253-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171091824100001 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 Message-Id: <20220712215251.7944-13-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170785351293.79214911385725; Mon, 18 Jul 2022 11:59:45 -0700 (PDT) Received: from localhost ([::1]:50794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVy4-0005yQ-37 for importer@patchew.org; Mon, 18 Jul 2022 14:59:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZv-0000Di-A6 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:47 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZs-0005bk-Dc for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:46 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYX-000B51-9T; Mon, 18 Jul 2022 19:33:25 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=3GR/kcoJUD3F8/4XlPxw70KjCiSOtrXwknwgPYyjTXc=; b=Uajkyf6pRXg8QvoNhxpH66lacu +1enzJhzzPVOdcCxlSm2KQ8qJTIuWnjq1wCX2Z0cVRDoUd2EhbA6BTMsVsHi6ihlHGt/56uTkLVmG 18P+M7lfgeG94bI3jJ7Da3eBtblt0JcFlGPcYuHqA/xIJNt59GFSvFaFbUvMmtMel7U8V3Samafes fte4Cok11nyDB1gn/zWyEOSBO9k6NY/+0KExFfHBSsQqaJqFLFMbHSFL4mcaD5H9JurTeUkeLGl7y CB46hgyVe+/TsumaFaf1WWWEMtVZ6GgWTsrTLWst7ItzdUCGjqBYR4GULm2ATB44jVIWnxByCdp/P hhOAotfbpfr50zF7zcr09wx2+hrkcqHfkoXTI3rqQ8tkVObPqSg8xL/LDamodzmUbprWBnWg6DgdC ZMNTiz3G8alontndpVoSBal42CG9wiZeN8OlvYr5kmH2tU8Y/p5IjOXHPs+c4v9T2BRqc/PLZatWF 0lyUleEZSv1FY5cIW3HdacCOYtIWeBdoyAWRSs6fEwc9qgygnsA0OB5FsDXrL4ZY93BI3xJkR6Ni3 vmiCTeC5EuDGuFDv6mXGUiUWnENQBrQrJdV4yIb9JUHz41Ru4uAwcBsFp/CFUagnSVHHvQX41aIAC XGy60LOdx80eKInhZjN4Ha8O0NKb6CGlYxmZujy/0=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:12 +0100 Message-Id: <20220718183339.124253-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170787778100001 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 Message-Id: <20220712215251.7944-14-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171196433231.4337287081206; Mon, 18 Jul 2022 12:06:36 -0700 (PDT) Received: from localhost ([::1]:59470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW4h-0004UQ-BP for importer@patchew.org; Mon, 18 Jul 2022 15:06:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZy-0000LJ-AX for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:50 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVZw-0005c3-KP for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:49 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYb-000B51-7Y; Mon, 18 Jul 2022 19:33:29 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=qxOcmSANThumGj40TwGSkei51BcO8jmxMxw+/VmWAhY=; b=UG9Wo2o6qTpsqvRI+4+NicOMEF 5Bxhg8lThAd6T1n2thZ3BmFHmTbW20IEySNM9sFDKnoI8lGdGN5gNUo8eXWaV5JuOq2bPa10CQ1Rr 4/+XpJZJtoEAYyyGwR418U3pXEQLEIotmFv6OCgGRJNGPHYMYrV1v9+ZeCjSIbSi94mzTWOl7Tz08 NcPhU8kiPoa4vGdoCl+irdq26dWM5xr/zwXwO4etR2GQGZ3sK4lC5I6rtBFyecsz7NJE/o3wLgYen J2IqoN1Qq/rumpu/sSrpWqY0I9c5lHJR+JarxVCu/UqWbT1ufYEADHzKEgUz3XgGXcb5xQAGDzxMR 8cR3NyeOVBncrv/GMS21lG22eHlmIIHzH101XKgqGyw00UGg5BRdaB0HTiXUkBh1fepPsP4aheidN QpYl9XCg5jQRy7Q9mpXzzQ1X7rYrpVxy4KlqjA9wVQHf9JGblCfsK5JibygNKTLHEMyLfVMHTGz8e 94VqtJDYajildD/gTH5ZyfhWGTXGFyIfCa3b5aAyzz7SN3QR6NvRdclVzyowpmgnSV/tU/A+kQeaz ysKXozygfxF36hRpGfZAJh+vGAy6vUr5mqe3yHN1tN/n9FP592IS4w1DOR16qzu0xAyDu90LhoL1i fh2qnWzR4oMzfdlKqJK4NbJJdgsDu6bTnAwRy04ws=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:13 +0100 Message-Id: <20220718183339.124253-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171198228100001 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 Message-Id: <20220712215251.7944-15-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170484456755.6174066244658; Mon, 18 Jul 2022 11:54:44 -0700 (PDT) Received: from localhost ([::1]:41388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVtD-0006WQ-AS for importer@patchew.org; Mon, 18 Jul 2022 14:54:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVa7-0000Uh-34 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:12 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVa1-0005cE-Lq for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:34:58 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYf-000B51-E0; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=G436LThKlKLcqcm30aGWo8tiEAnUiQvcyf3D3183dck=; b=VJ7uugJQ7YIDGkeDwViCtyQii4 xKa5mq8yA4FWItzoEcpxBNfAlpC52GWa/Td6Mogp/NKeHDhuT3rfHmwOYOyc2EFXfrn9Ap6Zginkr VMo18Nskv0SA+ZwpySc0B6Yht/HqWwoX98rDmCwzli9GMbsAe9KR/4ZZnafId1lIr+9IghSa8QPaN BCZHt/RptVh4NYYiCTb7XrhhLVbbsxkdDbJeYFAo6n5keQSaTW/RtbYHiiucFsi99WKXIIzeonD2E TFzM0y3/1hFLpFvlCLGabwabcNbEqhYlskB0SkX2XKf3KvKY922rmrExknhaADw1p3ksS568O8ITf aM1zI5FImOUHRAOF78TshhdYke0Iqg8+HtuuD+YinrqUnts28yIKPQ88GJt1MHEwTfr9c3H0LJ4Hq u6T2N3Hn/46Vs/scjDKJsZ8xBnug1E56oFAar7gh2tiicgz16zbvOhcvPTBDptg1YSB/WqP93tgdU HBeq0BCFlDEthaW6jSTjkpUD1chzSD4Wmd43rcpOMsTk89oFtIdXat7mts5NdaZF14BZ+Deh0Styi gDBSsonIwvbQKmZgVtNyfYTrV6mC3ZEyQqLW6HHDs8f43z7eTCR2BtptOWs2MiB0/VGgrphR2PAQb jvln2m4eCDtnwoThaK3QJWA9R18HCKZYQ0i784qPs=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:14 +0100 Message-Id: <20220718183339.124253-16-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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: 1658170485919100001 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 Message-Id: <20220712215251.7944-16-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171756674198.20902849029744; Mon, 18 Jul 2022 12:15:56 -0700 (PDT) Received: from localhost ([::1]:48400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWDj-0001Ty-K9 for importer@patchew.org; Mon, 18 Jul 2022 15:15:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaH-0000VH-VH for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49120) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaE-0005cO-KX for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:09 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYj-000B51-4G; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=ClIV3xkEDMEKboNN+DKEin93YbYD5VaciVMg7IMxfmk=; b=EIYhXxI7/6wci3M3rS96fJQHQU UoHRt13HHN57WuITCEZWAHmnpr88B3w0rP1M6m5XocErb+aVry+OFY0J7PJr7uGdYxqxqEQRNvSdJ 82S98AvB5803e0YfRYeoUnEDO6oV/RqVYZfQjEXJ5/EYS2byLmyDZg4Kti6kicWjoLaNIpECchpIi J0327TmJmGys63CxzpKwEIHZRm/FmFhkCBgQgVr/bWJGN6F/v9NmVvI23s7F6UBKHWUhuBDwB65ka 7Z64neskxNWdaqBOEEy8MlFlE8ho0QSwNMlxRpb/TyWIDx553/qhtf5mIQux5WXfb5dlMr4/JpXoh t5fIkrbLvcYDhk3whVJxnqJcq4I9+JsPOdDEvjzFKXGd7fwfV5HwcmV2G2UumcagmMf+wAw7DYDFV a8Ig1AkCEOUTJ8bRnBeaXFm44pLhKaCcBBcVFclO7bC+Azymhakj2fzAtSc7Aogi4aHKtR/SE7aEt nKc3oteM1P5xW9EjrgoUH6iPaVgfWZRpLiJxjNkc/CiPpPUj6seFWwcLhxSCD0JMcG1faGt4gifiy yFD6P2J6gT/Lwh4TCkEVWeGH0cY3QCPYCblxAXyeX9NBSPaKiiWl/gK1/fs4Y/e9qpQMcEYLfhkp8 6knhAHQSldJ1BAb4g6Fa8kr4VOv5UD1F8px/2Bwt8=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:15 +0100 Message-Id: <20220718183339.124253-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171758779100001 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 Message-Id: <20220712215251.7944-17-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171431796574.7168696093805; Mon, 18 Jul 2022 12:10:31 -0700 (PDT) Received: from localhost ([::1]:39940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW8T-0003G4-PX for importer@patchew.org; Mon, 18 Jul 2022 15:10:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaJ-0000VO-Pa for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaI-0005cZ-46 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:11 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYn-000B51-90; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=bSBlhvxf82zZFHRdn6wC/5I7zowT7L6pho5M3lDfHQM=; b=SVdlrLMX4bnlrgD5AKs9WCryoF izd3Tg00354RGAtK5tQcu7GKK6J3U7HYSFgwyMfzqDkfZiDCjwNpqT6kKeY0NWkWoTv1oxF16EBY3 RHZMNz/RtTHQ8BMz/2xVuyZxEjhb61yMCHguaUg7IxmVsvLgCvm7sghOdyhdmXO+ZYoR5wdUo0UKt yOt2ARiUsCFrUsbncWYFyjq+WDKi+Frzdu8OMq4Rrtyauqyh1TNnISdQO6WkKD/dxnS+7HOdqAJBl 7WEztW1OhGDCpB0Nq9SbdyZK54UguTYYtrqveVjdbrYjmjzyXPYyBfydkKZMGqFXpjzOB0D73GFf3 JQZptR4MVLp1FFLHY+Pkti3CUXU46zXurpSaKFP/r9sURLsXaNd2N/S689g0Vc0/rhijdT6xgm/RT +nd3L1/uGmclYVWnvcQPgZy1/Qysqf15z0fq9SXIkwmBGrIU6urctJZwpwQ6gbaSkxKX+764R5TBs Rd1s2wj5CT4gG8USTSnnH3teJdNOT902WWBFVuxcnWDJ/eYXbZs2uFncbvUZVKGvLqfkqslWvwyLd RoFu7MQW8smFJdNzkqqUe2HC6wuxjO5hZp6F0yTzMelK6RQAevhBQ7jyIkjR2jcUNjvE7nOM+AdFC nDKIVjBk1Jkt3LZkdBb6FobrqnQJCRuhEEkdQ0d1M=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:16 +0100 Message-Id: <20220718183339.124253-18-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171432930100001 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 Message-Id: <20220712215251.7944-18-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172034414959.0894215024903; Mon, 18 Jul 2022 12:20:34 -0700 (PDT) Received: from localhost ([::1]:56956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWID-0008Rf-30 for importer@patchew.org; Mon, 18 Jul 2022 15:20:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaR-0000j9-U8 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaQ-0005nH-G5 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:19 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYq-000B51-Uj; Mon, 18 Jul 2022 19:33:45 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=BEqno6/eg1pj4ClJT0V1T+CbReX3oI9Z9ZpDBVPcz2U=; b=jrrl0bwkBu4zwPgFYC2xKlQRMI u/cLqQiHjmHLCAz/RZ4ibMjgzPyAZocwUTFp6j7QunwfVYNZYIG4VJZfEx3jH09JjkRMShQvI2wWY m9ixJ5l9vlCZgcBiUMRHB268EIWxZF5iG/HgK5QbC+XTlLiMz54i9bVnMq+OahHMeBfuP2S1e1yMi iBob6LDbOpWf+HEH8WkfsZd58waixMCBoF8Wi/AqZYxVPXHBMfdFyS0DLwFKqHndpvRLjqJTQEsrQ prXaDk92wtw6oYW30twFQ2l+VzzTY9bpvDQjS2JI3sLdiGBtjZdObhsu3C6A8VJoHM1P1tKnmjxOG TnEgp4O7s9ZG8piBj/34TQISpbpWM4gMLfaQjO1w235ZPE4W6VcSpx6SW3cNnOzyMuevff/fRqqJt LyC9VdFjF1mzGVguuUJhNldyL01hFJv8aUKlnxlDqfT9izEyoj8RaquWZoUBFnaLHkFruB0WQvapl MAPPp3RKpOTRyBm/XnYzulDNsPq/AzkJ2oVrlt5tL29Lry81pVLsUg/PDpwA+UyuqGkGZNaOAD5eG aVOoR1odijA92Rn6qAI7biSU6lAyjCTTxYf45gaJPJzAl36seaLfIZsbKzI7tp+8I/6SR52XzzTAi meiZZfwuyoGFdnKETR0lC7AS2JNC/DjpoKodfvNBM=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:17 +0100 Message-Id: <20220718183339.124253-19-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172034897100001 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 Message-Id: <20220712215251.7944-19-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170158976967.1122526726917; Mon, 18 Jul 2022 11:49:18 -0700 (PDT) Received: from localhost ([::1]:60088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVnx-0006zw-UI for importer@patchew.org; Mon, 18 Jul 2022 14:49:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaV-0000jZ-BE for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaQ-0005nV-Rc for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:22 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYv-000B51-90; Mon, 18 Jul 2022 19:33:49 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=fqbW2l6W6RhrinfjZD9GQcMCKG/77bm51JA5jKKJSlk=; b=Exqa+/GPnaYg4ntef8lF5rkfJv QH9RxMHPVwFRAdv+19ayDdEFV5xmv7nwSokfjLDkRVQs63XQ4AVmnNFO9boPKSt0u0iXJfbbG2uKw QEIUvrR8GauhrVbfVnIIAUX6tlVJs+2HxwnY0ccMKEf6KDzPNrdDMPZzOqO+g6+3OLNJGb72Ved4l cmWfBRfjdYq7YI+DW02ozwb34eLKxuZZ7k8lDtLBuYx5rJJprUtd5ck3IBLJcNGXW3iCtKRF9ouCB OxbGpYrELUTOxwPwYdMyaSN/ZK5tUa5eFtZ0v9I7+Hy26tpWA+7/8v0nIwH2q/S9m18p2/AiwJQBg heFSuAYAZ7XoTbvk2A9959CJGL0akAIBJIKIFYX1jlEM0hApkYYAdCaO8wgn7bXq17S7hgRunzEcO Y+gnoB45A9M4Zsix1/9+IEJRs+K6Y4LqOTOV/KTbHJYCn8TIZgluTqPaSCQiq2drQJhJw5q++f0Yu tN2trledoZBZsAwyjMuIWOzGWqlTTzPZ+NV9V0/5jcY5xoRs19kB6Z366fnbWiOHUk+rNRXsZTlVH WgFQRZFN4SSjXHsh42GdpaghRCGWy2GYXxN4scMEnvdxaIbGTN1ccLakBeZfmi0s6xV9+MW6/v1wk sRw8fbMlj9Lb9wZEhjP5qUaT60vx1IZJNhU54tEHc=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:18 +0100 Message-Id: <20220718183339.124253-20-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170159966100003 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 Message-Id: <20220712215251.7944-20-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170776724866.7404040473144; Mon, 18 Jul 2022 11:59:36 -0700 (PDT) Received: from localhost ([::1]:50208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVxv-0005X9-O7 for importer@patchew.org; Mon, 18 Jul 2022 14:59:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaY-0000m0-0I for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:26 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49144) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaV-0005oF-6m for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:24 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVYz-000B51-Jb; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=JHjz4cmqhaUM0L79N6TyiJmCjQuntNgv1DnbRAIwnnM=; b=hm1gPJ+nU8ugoOzIaj60P0jj2I pAaADlxmr7BwG3S/Rp5qoTgbLWo7/0CV6lPnMzUe2KS963nQMGDjm2Lf8jpUgndknNxCTwpSfITJ7 yDFVvdJuGKf2EbIicm4CA99n680bYlw+E6773kEjmrk7RGqZa/w+NKHl3r7ioJwBWIBtUrUCr4k1P BFErcRC7avgRpQZm3m/p731uVCUfegis18RsPuUrjDFRww41T2Bccapzxrb88D0N/+PTwGtORp2Sf oibwBjW8Kf3xxb0k6F6SQWW+XiBtz8BGaFwSO2yE7N1GRZS7FKXHOI/Kh7P+pJExzl8gI/y6IEUTE foOt1GeSkkUprKQkYlR8Z3VfpT6bvylKRyAyorLaoFxgVP/RtzF832N8oa77IcK7moqLgkbLFoDph ts8vslPQBUp66tcT7tpsF/rGE2wSqEc5m1wnsGg4XQkYyrmhpcZRJ0xsyTeX3hZAeAoRVl5D7QxuJ F8oHtK9kYfo4yPco+MIxx/RaYS4GvH4BbojrLkwAxMsq2s+pRodfxsFJrkMed0L3CSGZiJKCZdXEm rfKko5S8LuxFEQ/Qq9PZP189i7ycWHMA12dF8NWdfC3rbRHxZPJji/NLR4U5Ft7q59ndCmMwt/kHH DIXpcyjDz4OMi8vv0dNbC88Snw2EsIcLuiSydwYl0=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:19 +0100 Message-Id: <20220718183339.124253-21-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170777522100001 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 Message-Id: <20220712215251.7944-21-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172354777373.33498591272166; Mon, 18 Jul 2022 12:25:54 -0700 (PDT) Received: from localhost ([::1]:37492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWNN-0007E1-GO for importer@patchew.org; Mon, 18 Jul 2022 15:25:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVac-0000mV-HC for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:30 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaY-0005os-Ma for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:28 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZ3-000B51-9c; Mon, 18 Jul 2022 19:33: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=wpPCvgkjPUAGBHObYnQ+9G3lW7Yc+gdmJLMMZHBdCBQ=; b=enqVS0KB2Q6VMnyZbPG98Cz4nv N8lxZ5a8zfBZt6WW/4TCoNlN6yOXKjeIHDs3nySjjhvk2pNXepvKnoKxTfoKJNFieuFbjgOeX6D1a Fo+YjmLRF1HVBI1raJ+730CGMkmImkIj4Belxe6lUKLY30pvMUBsMmhj6ZdQI0IlCTFSTTNXm63ZA Co8Q1HQ3dOezXREL+GSms5J5rg1ZCAURyKwaQN9ncsPQ4HAexe57jFxYpRzeDZUoUbZEDtjYjKj7O zvUy1WYchETs7YGi3aEPoEEoX+P9gPRNFk2IcIMonakr7iSVd5cHEN+C1RlnCgbqly2hDJz0IGzbc 8MW7PZuuP2RQzXIRbRT1EtCkhN1FTIztsLuM2LB0Jxhl/JLgkgZoETW11ChkYem8XnW/bONZAB3nX NJ/vXU4/1UktH+zUleTDaQ7Dz0MBFGBcQwcwjY35oyx1t8wIi785fv+OEMwLFHrwLutPZhISyC8Sg glT3EqyyCxQ5E/Ta+vR0sHwP5Tbkt3LqavlXyPfJTgqwcwC7rdrb3l/FvTRIxpmoHCi1IO0LZM0mj V16/TWhLGosKj8AYwID1F6gomddkvthXdZ10Bd9rCIw0acI97fBWDW+f2IBaDx84tSN/r4KckTB1+ CcgxZwXBiEfH/5dEZymu0uzATs6wpm6L70JvGqMCw=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:20 +0100 Message-Id: <20220718183339.124253-22-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172355344100001 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 Message-Id: <20220712215251.7944-22-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171179198137.05985436558956; Mon, 18 Jul 2022 12:06:19 -0700 (PDT) Received: from localhost ([::1]:58912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW4P-00047e-Uo for importer@patchew.org; Mon, 18 Jul 2022 15:06:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVae-0000p4-FW for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:34 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVac-0005pE-Ua for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:32 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZ7-000B51-G4; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=JlWvlkX1Ne6yT3ExBKpq3/VcuLkupj1yyMXsauJrXQw=; b=UopQfdqiZJS8hYhL1WSrt8nq42 5wDvTHkCRJXdJpNHSrCe8bJLmp+SbwEGOCF0wnvn23b23tQm3Q1gnuwlTPQ+TIdUcF+AWXkodVHps olVNpE9+MdIFgGKYvpVaFHpZHZf1n7RQLYUntcjA9WQ75QOb+pbMKbKz0IMj9ACMs7L3DalD4lraN 1f17MoLff/h6LWiw7P7LyAfpv3AjkdMdfUYIbM4oWTsxrczBRLTHQ7OiBotdaKa/+IldIUwoGVBdv OJnVpHnIAwZp4hwHENKnERNLgdMzh7BrFMuuvOnc1v3c2P6I/1Vt2K8wHW0W6kPufAEjF2GxJHX4s HOG2nnizcU5v6W8ECpzf15lQvQzIj6tj1E2w/LCDLeuqu3Eg5objHmY3vNC/ZYLpeRO63QtwSUJd+ ml018KmUzB+M4A4bOiafSfu55Bx1uWo2ar2CaJpEqwBMWrNzOpG6oihmVzzgbe9dXFgTAc0mm4y+u VoLMR+URh3NI/HGikB1rxqPqGkZCMx+58VFK705ycQvvtSPCdVyF4oCuk5sI73qq1Ui5p+IzKnUdD xE4floXGfQKoGaP1BQDBYkx8U5pxNufSQ7x3KDTRafZ0ftOUHlzv6G82jZmdgbO18AWNDHkwv2hM2 Zk5KCgGdyLAjJdgbXZv4scIsUNLFZlWtYa+fLswuQ=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:21 +0100 Message-Id: <20220718183339.124253-23-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171180276100001 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 Message-Id: <20220712215251.7944-23-mark.cave-ayland@ilande.co.uk> 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:52:47 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 16581704552461022.6088627503673; Mon, 18 Jul 2022 11:54:15 -0700 (PDT) Received: from localhost ([::1]:40606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVsk-0005rP-0u for importer@patchew.org; Mon, 18 Jul 2022 14:54:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVal-0000rJ-2O for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:39 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49162) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVah-0005pU-N9 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:38 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZB-000B51-Ll; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=LPUw9T0GQY+YP6VXVk8nZ9EF9m1aGFvkXGtGXYL4N5s=; b=s/lz69+ZoRTWuRUK/cKh2YgQZU 8e4mMLyjuPvzZkckewlzMr8mJKi1Ym9/nz3sb3QvU5t3lDsPMC/d8pzTmxMPYoEpR3T4Ykb4E2kBS /eg4yUoGfNjIqgsltAmT4cMfDfbZrxMnXruRQP3gi1EekpFpBnuyMBEoYEC7Bd3kPtAgH3QL0+v1W VYSTnB0bDftV2dVUxGQVP9HFRi9L+9aGosw0kZMZfcqHpCMAu5/ZEg81eX9qfuB0Fv0eFKyFL/udP wtNiZ1FS45AQiIoZVLEty5tqeSQ+iGObqHS9POF4yq3Q9OvU45rJwJmfVZUfDd8G6A8cXvMCvPHPQ DRwvE0eraxJ/2skF1ZB2bsVJPxfz/2FXrm40RpXxIwpUk3iQq0l3w0meqFwhTJSeeRVO1NnYc50aB Z6pI8uSAtXU8LHqfoQsp+R5+4v9jKOSMAwQZudx/npx2cnUH+tBNpWjjQg32/2k7ZgG9B2A+P+yGV CD+0AfOKJ1exJZiRfmQqVqEQVVEeJrE55LbkWGGftNIENNEcfDyeNbnkl5m1S9b9IlZB4tjFFEcQn M7IDZGhj2TZYy9IzIoTnmQhXWcOi0SM6+GM4MVziwYs98hXA5OK9ABQYnZ0v12//xmmqcXgVpdLn1 sPD0CI7rDOw5W7Cd+BJVoZhrHKT8/gwCG8GmW/qBM=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:22 +0100 Message-Id: <20220718183339.124253-24-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170455730100001 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 Message-Id: <20220712215251.7944-24-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171390058366.67096238080364; Mon, 18 Jul 2022 12:09:50 -0700 (PDT) Received: from localhost ([::1]:37574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW7o-000145-PN for importer@patchew.org; Mon, 18 Jul 2022 15:09:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVao-0000uH-64 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:43 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVam-0005ph-9l for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:41 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZF-000B51-Pb; Mon, 18 Jul 2022 19:34:09 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=yB/cwCQMDTXd/QgLpPYRFpnL03O7QfeSgAQu9p0yxwU=; b=y5r/qECaErgEeVTkjNibIckOEM XxrAlQQfs3Z/NTkYPadF7nVNKrcozRIbKMGTVMe1iZosSykPwEpbMSxPuAFr7yTNvvkN6k/GWK9Lw ffNOEfXx2dSYASSozZU5RlJgFEA9mL8g9tzQ0Vl8h4VI7POF8YJbYIwPxGr7POwdU/WoYVvx7eMHb 7NRafeGhQ9G1ouCA694yFBlnz9px2zintZ5RxLYTIjO08i0PfPlI13UvA1CEP3nxUp67CIbnW0qCw CKOiQJO1Act6RRQgZSs3M/Vq7UXeT7Z+ZJ2sd7dKOe22qJepVBlE0QE/FfWV+7TciWISvghmZNyXz AukozEH7jiZNNZiPOkRRGf4oLOFZZf6SZAtOj7nAojkgRX24ovt7K4aD5U4e/CWgl8qd9Lx2i/wJX TmNsN0lXgTVC432gAxYWXlYCL9V6QrOvPoQdG3o395kmTEtkh5TbsnreNUztroHJs6udbX3moYM3G o3LmCfbj7Frau6p1kNGvzWMikGYT7qhWufpeHQHi0/lskmQGiZdQZeA67ux6TUJc15UjM89iem+3E bD9i0KQ/s5IZS+DnzXGCbj2S54iz7o43EfNezgk+/WrK0O5kIWch9vy8JdGZpmJmHWjWk01dy62uA YqYJD1JVVSScI1LCuOJurBOQuJg5VX0rzzAIBaTYU=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:23 +0100 Message-Id: <20220718183339.124253-25-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171392794100001 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 Message-Id: <20220712215251.7944-25-mark.cave-ayland@ilande.co.uk> 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:52:47 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 165817142127158.90651971680438; Mon, 18 Jul 2022 12:10:21 -0700 (PDT) Received: from localhost ([::1]:39272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW8K-0002gv-8Q for importer@patchew.org; Mon, 18 Jul 2022 15:10:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVas-00010G-4f for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:46 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVao-0005pz-4h for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:45 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZJ-000B51-Ft; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=9+FMW7LjstdFdpzp3c7sQ46vC/RqUjVRJirEPrrbirI=; b=Fgbym5JgJCKDfkwtB25MK+44d2 98g4LAMJnvSmgVnTC+uidbhlYRTCDIAoMCmijK2MU15reuefQX/kQ6L8ZShYDlZ0Fq5kGWTIVPWbk 3d8XKJWzheN3uAJV1aSOX4UtKHqM0T14//A2fWeEmE7xY6VV5Mwx02QGqu6RptKtQrXMNvnw3h1hN a+1YFlDo3IY2Gb+UBbgKqBuouH7AlzCKBvD345sOdDBr32/JPqIe5iPeLQkv7wQOEFozWWcJJxb+q 6WHRe7619Qp1SD0bh7N3WvPUZB0JsNb6BfTJaYubftc8GluYiwz2UHNQtk/RSajUy8ESLwb8dpv3D vsPTRCSutM7pNKsPWFMTr9zD+or6bZnxLNICItzu89wFdNdZD0AMAGuNX/Z2DwkDl9hRQ2ok93OpW jWN1YRx+RbEgX1W0mWqg8ckBOYgbYs00ahmuc6dq6AJTR/sB851Ex2ZQ7YmQO661LLFjUfb2bO8p2 o1AQbSSH1qbgiZZy9PsdHX7HDlPzyutU2y9pOC0YNrmwd6cbOJEl+FifFZwnH0l2yEFYp17sBmsPr U/oLIZ3NNQ1+Ty89BeBiLhrJxEeOLAneZ8mbx0LZQcrOxuQW3GPcvGlYS+ldUqAFZ4f+d2etSbMK2 E1aGbm/XE0e7Jk7xDnH/iVjkNlJ+JuHah4Eew2+rY=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:24 +0100 Message-Id: <20220718183339.124253-26-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171422860100001 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 Message-Id: <20220712215251.7944-26-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171675338629.0475861061346; Mon, 18 Jul 2022 12:14:35 -0700 (PDT) Received: from localhost ([::1]:45914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWCQ-00088k-5n for importer@patchew.org; Mon, 18 Jul 2022 15:14:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVau-000176-Ff for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:48 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVas-0005rG-PV for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:48 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZM-000B51-TJ; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=huZr1sJnDYuoWztZNIHakdrI76p37PbbgQNbg4Gs7g4=; b=y16HXv4Gdg0Ja5t1l6ftDQqcX7 B1J9GpENo+9XEiArPae4Xlu8XlqYcf19oEYxokoBRn5g5g/oqoXW/nung+NVhX9cTTUSUaAyRE+8O 56GzLPEPpq3nD1PaSidDwJGS0ddlDkEUo0q/qfTH/6ITEfAEOAuL4IZUHSpxplj3T6BwQ2vzKIT0K TYLhfavrTPFw4Gz9EN/cPZhD0oty7QVd94NTRHv1McUvl+m+hrIqO0VILF8tIAe1rTyR83LbaZdyK Zja9CHFxchTkbtaWm77/xrlkvxVa2IO8WdYZ3GFW2pfvT6/lQRZLBi87ENG2xUZciIHX+ZYN4C1nS 9e7q23CR6WHFHQLAd2IOHIQeoF3QUaKYGaEWTO2TR0YsBNT68KxpGOGO8L9ye/0sgDVsbhH+o7MoY I5VFp75OCSEQmaH4J1bdiW4/B2R6PkSOQOxK18euklaqg0TyntmAVaTBFtT6f075Xo7b0oiSHwICj ClCoC/DeqrQVM+XDWtAq4PzwPoq0hHynCz8oka5f08VztFWRqueNfYqIxBeykf85E/BJQCsFVKF3W ffQn8eSctd/Pqw5lAlZqdIMavWD11PMcLkQ62iuPmURe4qm/9/D174H3FTYTv5oAkjqQWmFOr9Hd5 FQWOcc/XFX7WImGgWRJbkPF2u+DBPbtX1P1VcVeX4=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:25 +0100 Message-Id: <20220718183339.124253-27-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171676311100001 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 Message-Id: <20220712215251.7944-27-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658170822814909.8388866230846; Mon, 18 Jul 2022 12:00:22 -0700 (PDT) Received: from localhost ([::1]:51792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDVye-0006q6-M3 for importer@patchew.org; Mon, 18 Jul 2022 15:00:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVay-0001Hh-3q for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:52 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVaw-0005sa-Ii for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:51 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZR-000B51-5R; Mon, 18 Jul 2022 19:34:21 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=uYuoGHjA1mwY/aokdjYjyt039OvWgWn8a7JQvXi/wYI=; b=jOdpIA1J+y3Rp8zXVRqQha+g8v iREK9jfDR2YkOZLr2Y593HpINL1p9wYfoXWD29fzmsPGihlE+m3FauSRfatxB0TraIphKzGsUn6Dz ETurPyyrTDbDUKLsL3qKLxZYKp5mdrTDahlDxSZGGLbefOwABt6+YOfQGNscy3aOR3bmWbVLH+KLT QeDYK2ZmQrqodfIAyfjqpT8S1eVQ+dZG1wS3Jq7Y1gfLvsz3iUL6vxKObMhBWBsnWPRML4nGitSBQ dJwb/n6f/i8PiG986bPqzLhvtG4WPI6bkq1XWIQJzeQ0ZRjH2Z804cXqTZF2V2PIT4gvRsugKdJa7 JFCdnDw5ZIwdjmHrDf1rbSetAW6e9GvciJ9vVvzJIaVZ5/kS3Cdp8FyIe6OznfXv0VsB+DivVyPfl SAZZkxkI2UM1mKo1Z9kC6cEhlmuYfd7/2wqb+Bh9nKMA36Ogdvne37myIC93XG++kfC7b3bW33Ak5 cwEA96edIXf4yYlQoLr7p2U+nWPVQGGADvFoXExW6/RhrZ78OPrqrQU11CeeoZXWaWnjqa1wTI3zJ 7Sy+aFZFJX6Du3VhOcf1LynZTw2gmFpoTocYhLSDfo5mjrbsJ09TvJtFIOz1frA2AIQ0cfNXWRhtn GUIKLKfCksv0wY8jqfQBuDXd0m7Lt2vwX43bbt6n0=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:26 +0100 Message-Id: <20220718183339.124253-28-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658170823691100001 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 Message-Id: <20220712215251.7944-28-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171250585173.08375367836572; Mon, 18 Jul 2022 12:07:30 -0700 (PDT) Received: from localhost ([::1]:60516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW5Z-0005K6-CY for importer@patchew.org; Mon, 18 Jul 2022 15:07:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVb2-0001Pv-Cx for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:56 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVb0-0005uf-DO for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:35:56 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZV-000B51-BQ; Mon, 18 Jul 2022 19:34:25 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=7G7dZKICQIH6taRIqUme1I6qc6yJyzjkAWbiYrxokqQ=; b=qD50EB6YuwUohQwwB6oRR9F8I+ 2If2TP6wrYvBL/RUJ7L5k1AYmLPE6exrf/ZZGE0xM4KoTDPODi4FX6fwIqJ6DvHw1NTRbG1E99ZH6 PnmV18gIZulsMchxDWVFRg8X5V+1rZmOsq7wWbucdFLM2ywEeTEjozxi0T4zRCHli/bYRpEg2Usfb 8q1sW/Rry9TVrgwi2nyz7rNztqPWwoaK/WdxC77dRxXmHA97DCdYkev395ISJTWvB9dnyteAHAnXD xxRFPXbmjDH4EFmRSQQoCm/lad7MnY5k/9ZNaUU2XEzOnOtsx5jndzR7WQxPH/KVyEsrkQyceu317 yY04CL1hVkh5XTMRAOUTkdvYXYd1F8MeSznMfw2WpQDOcXvEbb5LTtUl9PEze5Objj0fevtB5kku6 6y8sxx9oK1B79SiMkiyqCeGbEz21Is5H2UytUOqaHnUSZQdvw8OrgU8SNWxE3w1PVNrLGDsGXtuSr 6cBidwsijNXIvgowf6BKkPWmeriihleS6gpE/gdsRbX0vgQ372YSUgim9rwip3rviUkj1mcAIsZPn 4DHoZ9/SLnXFPSNTg4Q73eaPnxODjG/afk0s+gB/c1iQGu5PLpkc3TGph7S4AojFA6nib6GnNwxa/ cD5TsEZXmacfXmWzgtGZ5h4yxOryTqhILn4XQW2WU=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:27 +0100 Message-Id: <20220718183339.124253-29-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171252619100001 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 Message-Id: <20220712215251.7944-29-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171745352269.16099113159396; Mon, 18 Jul 2022 12:15:45 -0700 (PDT) Received: from localhost ([::1]:47854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWDY-00017C-6c for importer@patchew.org; Mon, 18 Jul 2022 15:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVb6-0001T3-K7 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:00 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVb4-0005xS-64 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:00 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZZ-000B51-7O; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=b8cBQ0hbxis4dSEdi8mWivZRoMkvBo9m83x7qh5E/9U=; b=OVaKfl/HfnjAUqtYYR5aNkoqEN 41rCFnChYKwf7O9xIWJKVQpQPPrk2otloquQFiUOcqkk0dnr3qR32J1PH8j8K5UNSkcAcb/kB5h48 H35d76ZHyogp3mdP8SsYPr+G3/5rykCy1+AKFPKFUnLoV3+HBF6k0CgmMVomQA7nUdyIXJ3gEWbJI ma3ocSjfkNZMAB+O07+NMYtOFP9cQTt/BIAHqbAyLZAcblc6KLKZzrRLXfUI6VDYuT8cr7xmotfF3 wGAVVLnP7t4v1Eb6At6nq7GgNUkbICzVNE3VkpUuX3h/QP4xgzZDZkrV+AL+Qhpylcelk5A6siH7b IIC44xa9inf6Hdc0RVNjJMwV4jXIUAh5ZEfkdnyv8Kl/5C07mUWUUFMKoIUnuJL9TjrlKopg/Oyxe tXlFWc8LCd8n4TmuEjCbMVUIY7ME8PU1Bcg8xd/a0oQAtg85i1ZaE4OySpBUdrzMLgO0BYgg78wDr I9IQUOYV0hxSHokR44DvY2Zn+gLM5CN+2J5/E2WaAmtlbclTEdPzjvv56gGJzGAaygDzuaF8q26FM xsb4vYKsLnbsMc7/Hn4prjS0X4pSTo0NNkYATxpRY0jQznpkSUJUw1oQt+XgqlfqwNS2md8nPxmKJ it0zyXrbWBtbY0HKZgJtiP5uatzWnk+LFDcvke77o=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:28 +0100 Message-Id: <20220718183339.124253-30-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171746935100001 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 Message-Id: <20220712215251.7944-30-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171949717545.3382984224919; Mon, 18 Jul 2022 12:19:09 -0700 (PDT) Received: from localhost ([::1]:54380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWGq-00069H-MK for importer@patchew.org; Mon, 18 Jul 2022 15:19:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbB-0001WU-9P for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:05 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVb8-0005yD-9L for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:05 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZc-000B51-SI; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=gI7WYMtgMBeE2AGy2fFw/ySzWRXvdrVqmsTeIYJTX0g=; b=0XhymoVUOnnIWy9stQnTEN08M/ uZcTyo0clE1iT+kLwbFVd36Djk/ql7WUdYqJJOieqmy0MfKTRWBx5BF5f2FyoPuOl7J0YTSm/MsvK lJrlr8QQAqfg/jjUR5q3FEoQkunLpj9j5O7pjGawhXz5bSQ3eIR5jSDM1pROg7OcpzvxC6IJA/4o/ D2CNiEaZT/g73tsJ6JnzD5UmRlsxgWCGl6RDfvTQAxnEKGJtdluGT7OZa6b4FDSug8b5lmoxgYzMd q86BaEUgP6ZX3GlYk983++R8mP1zwFSh9C/OsZkBzLsQrdFQwkSP5EDDXgue30rHqXx93YRgsqBtL 6Dyl3fxlLsCSatK1uS9ItFDkjlcnkxL1aPiFowgPZRwVs4N7TS4aklKml8ifMUwnCiD6gpjPP4nYw P+nKwnI8dOHUtRBerxWti6b3itpubnRv9U+OngoFBMQ+pqbUOK8u3430H07bS/Sf+MmsEvxJp/YyI j2SzJMU87WIAAytQthV1TImxdhKy0pBwbA9PgHrsYfEQLHx4SLOAmRewsCEF8fQl4sRyyGlhjnXEK E8UFnywMHNHmzrfVjPoXa/JWDUJoHxran6o6YNShM28V3ikziWrqhpPSuF6mRW8jceWOi+xLNtpu6 dSOAIvc38Hjnqm40XzA0pvjfPNMVAZTrbZZ1Tg5Q0=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:29 +0100 Message-Id: <20220718183339.124253-31-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171950531100001 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 Message-Id: <20220712215251.7944-31-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172702950165.30693158386532; Mon, 18 Jul 2022 12:31:42 -0700 (PDT) Received: from localhost ([::1]:48032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWSz-0006WN-S5 for importer@patchew.org; Mon, 18 Jul 2022 15:31:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbD-0001XE-9f for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbB-0005yX-TN for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:06 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZh-000B51-2q; Mon, 18 Jul 2022 19:34:36 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=grtuJwnLxJ+84zeCdJdWU0gax/R+q11RJLfjkVkXTgI=; b=F+HrOsmConosaq6qEGztGdwR9W c/cyohVMeNWdZ6aYE2Oh8WIARXueEbxzFyXG9CKzOprgrkGoPcus86Fqz5mX1YAee8ByNECvu7163 P6yP27G/Q9KL9X8gjyBaIT2MO/EO71ZllM+yOVe8RqckBybWv3dhjoD0wtDmk7ViujnVm4WgXsLMR 0lXAgwecZjyo5yc1/2vX8j68UBANWZvrwXIsSDvGtCipfdGgOJAeKMCl7sY4St+jYQV7MFlgqnq9p KHfh8AGuK+NgRlW3j3xx/S6/sDdg2eCy841Lmi6orfFu0sJL0R3NKXflhmGyGpHujYNiT83NqFH37 2LmRVYZWwkTxEjiaBPYzIRfccO5OMOa2MATFNmyrOV5zkLZ0vNVqvi0welO7jLJ82UUiOLvoZBMk5 iXIDGYD+LXlkPWl1twOjFyOgzX7nZBWZ/FLdSCwz3g+x7CPHlUdl2MQPIkSTaqfAtR3VhHp/HBRYm BK3Nwty71CsN/9v9R5ec3Q23xbGc99PL3m3UzniTKKR9erOizDdDjaOaOVGWMfTH+e3fEKrxIjAfc qm68UwSSYmg2sBTF9KFv4uFSzzkYk44vcLi7XBs9YwuitIBl9kPKFx+W0PTyj1V88Np26MMv/4wJr uW03VqOgLjYaPszzapX67rW65yFH45Q7GuSAEF/WQ=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:30 +0100 Message-Id: <20220718183339.124253-32-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172705330100001 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 Message-Id: <20220712215251.7944-32-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658173112996748.0289867230639; Mon, 18 Jul 2022 12:38:32 -0700 (PDT) Received: from localhost ([::1]:56476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWZb-0004Io-QK for importer@patchew.org; Mon, 18 Jul 2022 15:38:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbI-0001ZA-7J for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:12 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbF-0005z1-IK for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:11 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZk-000B51-OJ; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=3kG1SY1CDSPQvec7E2a+2BCWWsQarJFWKiv1EmKjpIY=; b=rOtVMw3allV0GXS3xU4k5WODco R1xgUT3MDwoh+3Vhzc6QrjMMJpzY/CXmByXyUUPcKIPfa4l9x6ZsT31EcEHGrMOGm/b/kcMmzI8Ae 9peofpuwDBYj1EKXhAgeEsc1UbQw4NFHrkmo39BULpFmbJFugcXnPhDnK+0Dh2Qr1NDxMjo65vuuE c7HnAD0IhXMLwoLsjZwjg9kV0yLR5dCmE7pm308VN+q3tV1W8I33pq13u64Fb4uHox7hp13cW5ynX j5O+EpHBDeUvoVa+rno4Sfmw5e5RtZC99QkQhDQFPCM7BM3DhbTTMWIoijArqq96p6lhfCvSYMUoA rEnwJeMCGm9ZpJXriySyNAenLlHEdaT8KNska5ZFoleYQL0nA1nm8aYMfPTspQfyohtAxMeT1XTPK tHO5BKZt8R91yW0JP5xxRKIu63DpY4XmKdAMbI2AQ8bR5BGgrhmax1F1k7TvhH1P0vf3GqTfeFWQG 1ZAY1WItBnBpGBWPHisMSnM90UV8ct5q0RinNZo1YLLVCkywK+J1c3/gsF6JWJoF6Rt5dwpZ8o6lh fL0D7/h7cRw6ED9KHiHGXh8HUrDp8mbCexMwSghLTh3auU0SObgqsdeDYs8P6eb3s4XFQI8jtnKS/ oxGUyZreNV7qFktiHWpcy9IF1JpCQSNJCMB6XCp4I=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:31 +0100 Message-Id: <20220718183339.124253-33-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658173113936100001 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 Message-Id: <20220712215251.7944-33-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172073688417.36659174730426; Mon, 18 Jul 2022 12:21:13 -0700 (PDT) Received: from localhost ([::1]:57822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWIq-0000jI-I9 for importer@patchew.org; Mon, 18 Jul 2022 15:21:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbc-0002GQ-BT for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:37 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbK-0005zd-BP for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:31 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZo-000B51-DN; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=ZNpXkDLXb7DbN/EHahUd4QzaCvr3AnH2e8q+s2Ts1EY=; b=qmT7ZBKevzI14yhCqwEYc5gx/X 2jWKphl4FuauccLfxGro3tWv5Jnotk9QTWW2qffmmQ4JRaqOPj5vDtLoMig/c/2Uib8CaUDLyx8nZ ym/T0+m9b111dkIURBME6VzzfbM+79NvBo4fYpFcNmfX0U5Exf/2g/BbepECPTEC4DqXdvPKhsIe+ Kl8IOKDCrn6CtOlqyHYn8oNByKsSeVLeL7cX9yQ5ZOjnkL2vg4RpkPS/S1ZsWj47IwkFyMmvE7TFM wzqIo59BR+C01ePBgb/yDYgX4lgzhRSshOmUlGkFJpbUXUpB4cDMqFyDu1xal/R1ovFfUvqbUyWRP Hp7oOlAH5YIm68ieiwJqZdxPyFAJPmGIoDDODIgVUvRxJ41uTTfmgQN+L0mt+eRVoTYw+pm73frGW tTrDBJu7b2GanS+j+vh8ULh1ftdMccSUS5pofARzE6tYZkn+6NRNzaV9SstDEMOaGvYS72yJAmlv1 GSUKbxdUPNaHY29ezPWnIe9Qy9jDoYV6c8jyG0HKoLDBpqgnCj1W5AKk6ZrRYbrDz9Fh8VHGa18M2 e32ctOK4XmNoa/GQFHdMlifnW39/6ahwT+3wsJU7DzHeaOnlpAJ0o+WIams3QJD57n7ziNRp7/7XO 2D8Lt/uNDVWE2Spx5lFAY9L5iktJBgP8WDkAKy0Tk=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:32 +0100 Message-Id: <20220718183339.124253-34-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172075028100001 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 Message-Id: <20220712215251.7944-34-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658171476530165.82171648644726; Mon, 18 Jul 2022 12:11:16 -0700 (PDT) Received: from localhost ([::1]:40906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDW9C-0004AY-Mo for importer@patchew.org; Mon, 18 Jul 2022 15:11:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbP-0001nd-Og for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:19 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbO-00060E-7K for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:19 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZs-000B51-Ci; Mon, 18 Jul 2022 19:34: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=ePn4fzXW7OKYhatFQ0UMrstwQ+5o/G6uaBddIYnCM88=; b=JqlY+ZWU8DGj8kQ1VWfqHlg9xT gdeDDt5G9hNZSCk1RWB235EvBP9KDRghL4WnP+wT2C/J2WVPgwLnrCBq6aCrlNQiCsuJ/XU6NV9Qn ugu5wwWW9YiiWVzBVj5wMiOZl8eYfvwob7f20eohyPo0H04QX2qMT/vcsmrqjMOGQsRH7JqykpmMx oEktMH0p0sZkzInpkJdDrYKWdQbgb8Td1RhHjpBqsUfo7a7wnSyWBXiAsmyHusypKk6UBQs/SfIPh Ivv6c6orZYeSHLe4D+LUvzKb8dsIWNQ0ITdOBnx2jZEYusRuV1zYalJzROKD8MiMBLKL7+EGL05ow RV/So4Wh1xX1xbUI8FEMENVYeGwpkewuCX1Ry+jTn0Ss0QXV6ZebLZKj9OvpbmCTC6ES/Ax1t8ssL E6Uc5r91lwnfgz5fivn066jvMCxqyltv3CE/nJ1Ds39Ng+Ha1uTsGjSbkzJODKkIaF+ETKkUy4lMD J4DpT1omxIVJ3tpCbaYiyZva9YrXoNW7qML1b2lTKl2YUjhJJwsI0mQK/RCT0E8j38RJyIVFWxawI 5qS1UlzarqHyErMeCVEXSiWKdFortpgPdf0TxqgPbnxbOAnh6ZEi4CBlaituUWxY2LNNs2TVqqkck nIuaOTbFrgx9o4bXebpaQ99msFaYSFt9WEPajI/FQ=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:33 +0100 Message-Id: <20220718183339.124253-35-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171477252100001 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 Message-Id: <20220712215251.7944-35-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658173467889656.4590073926639; Mon, 18 Jul 2022 12:44:27 -0700 (PDT) Received: from localhost ([::1]:36536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWfK-0001ew-IT for importer@patchew.org; Mon, 18 Jul 2022 15:44:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbT-0001xU-FW for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbR-00060d-Vr for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:23 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVZw-000B51-NB; Mon, 18 Jul 2022 19:34:52 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=KhoNyLSXDyPwsqbuQ2Iro7IACVLd5Ou9KUQmbqcY2HU=; b=RdCJLk6ECCdtYPe25ywMlCqutY nwghQTsTzRC29L0XO+x5ZcEHXuR0Qptauk8kiGPA+3kGoVpeCsFs5p6jKBNZevVQc4Gp31zFFWGy2 sfU8jAMeyDkUl3z1c6n/hrofwyeyvyGWkO0H3aNtVjmnqTZ2FenO4/EWkN26nhZJ/nVsILz+b3bwe n3Dat/+Mu8rZ7oXZX1FDCrFjsF1xH8HbXWmLsCoFRuLV3s2DJ64LXSVmhxfbTYPZRkR34jj8esKaX iSMFAiv8oCWvHG/KGwYANAiiBO+kaliGZTdPADK4kMBlGbI8BOu8XxBdC5KfBuk8iy7yTpRw8ngX3 Szr8zO2+nSGrydPO2mFs38MD6fkjWMKWhYcbjQV1PKY/0UNavlo8gDtgL1Pkl+h4rbvU+K+MD37lN bQamb8Q9pgAWWKluDDAvyyy0g9Pp8EYnoz0gyULv7ZHoa9OOrwbe2qMlC3VdqEVlsccbeITXw08tp XcaBrYry8lkN8aSPFU5MRURPZapnhNES6IG9im/PrmYeVXQoGWCgnKNoHj4tq/dg78r/xq3wwK2Ye fkK41qONTNwHEhg6nenqw0wvz4sPlbIRQ7L2dX1hrNsUJweSvquLbTfMbCg3sOA9k0QLtXFmlcBu2 D0jT+JJ4vMikytt2xnplVaPEEIALWLVOitxIZEE1Q=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:34 +0100 Message-Id: <20220718183339.124253-36-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658173469868100001 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 Message-Id: <20220712215251.7944-36-mark.cave-ayland@ilande.co.uk> 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:52:47 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 16581717734135.154448073898493; Mon, 18 Jul 2022 12:16:13 -0700 (PDT) Received: from localhost ([::1]:49320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWDz-0002BQ-FP for importer@patchew.org; Mon, 18 Jul 2022 15:16:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbY-0002A3-Qg for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:28 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbX-000613-5o for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:28 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVa0-000B51-OS; Mon, 18 Jul 2022 19:34:56 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=+/VSmssRaLRMuuF2U2fBpJ0nXCYzfaJ9VTl7bvp+5Mw=; b=MyoIbje3i0nwP9jiQLGNxQ4Y4v rT/4lbMYc6xEX0RGksY7Lv8aoufY/WrAj45M6EYhDfJht0yIw+Z2kbdUakZ8W0DG5XxNFAaeey+LW 2q21JxhLA9ozng6sgeNgekTy+HpCmc49ttSykdEMhfIERNulxcxUKjee1aO47QL1C5V55Yu60JIVW BJtsbimZh5eNTYEsybEP1rfcYHvw4o9uTcA4PcofITe2l6Gw3kjjF9dWZHxFf2ktN59GiD2JE5XPl 9ZM75OL25QpD2Rzv00gbLJpv41jHbgP1T12tt/2fESic+UJGHLD4mmrl/7280+yDA4tYv5Ts4G9a6 E6SahyFyjiVN+MaHghO7ojdCNgdZEei/8t8gq4rQGiob9QE5eJa98yfmcKvS64/ljbqGp6DwVKfFl fzSV0ba7KV1pF8sMmFSPONzVj6okhnxCvjI/Fl6P+Zq3l5JoseKf6wFbhjEzECXnvy6uvPqtqadmV OdWgxxUSC7lEqq+kWXjpxYCuy8Fm2icxIm90g0G4EZST3N59yPetY64w561eEhYNeU+iLnH4KP6Xp Z44KKlwWSoRZCtRf4Rhgea5lHI7fHAt6yhwUgaOplq2Hu549ZgKjpTCWYUZrTiw8KWx5wkVF1iEf6 Xv/hrV9lmk/iGeU/CNBfcpdqdE76E/A0EsZuh0prQ=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:35 +0100 Message-Id: <20220718183339.124253-37-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658171775011100001 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 Message-Id: <20220712215251.7944-37-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172014954424.7869638175962; Mon, 18 Jul 2022 12:20:14 -0700 (PDT) Received: from localhost ([::1]:56318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWHt-0007tv-PT for importer@patchew.org; Mon, 18 Jul 2022 15:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbc-0002GR-BO for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:37 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbZ-00061R-M0 for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:31 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVa4-000B51-Oc; Mon, 18 Jul 2022 19:35: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=je7E/eQ8+348tR9ko6RUd5c6hawStesj8Io8sq4CfeU=; b=VnIB9hsrsJOzfiVDH8icxw4bgD voyzosJblPqriPz+EwMrSaDP5oTVr6InykvMo9IrxeOxgAQNv4PE4O4l0sZfy9AzrXDQ3cSDQaFAN jS+qazEaAWOWQWDGPPsOWaSwhYYRuNdQPFX05esuybbzFHgII4y93aJaxn0TB6BfCdV1RFFzyplO/ LmVmXTg43484buT+6eOsSf6kSCKP7+nXTbrSJH45jaT+1Xu86yEEfu+kUHPPi9DcRUxe7KOBuXVYj jyxZcORzKucY1HFLDj6rVOLeZuRuB6UnyIGxY++MKWv9ZXbHwerVKUVwisMQfmlhw6q8m9ivnnE14 hPXoBEq2d2iI06IBdoj9d3Q68TJeNXKJF+83QkDgTbDNKY1TTmYjhxx5WvHbrd8gWJ2w9p9HNrXBF R47bcDRi9qR+7bKi5Hh5rBmcq6+SFYe8oR5o8SiR90Es5HLo/zVExRGjHj8zek0TlHKVYgFfI4NUs VneiQaueaqNmmwPhNopCeHk1fYRFXVX44PvBfNt5J4YTmkFPFB41jk1VAPEsEJSAokh3YUF5Ts8Jw 63Qag7UUEXgBKOJr0NC2nrQ3MoM689BADLiMTptdWjsHhoXxlSixz7q55LFSAck3cKNA97hS6Z3h5 3Oxjq5y7Slnv4DSDxeiom/r/epE7uYY1+1ansQJyI=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:36 +0100 Message-Id: <20220718183339.124253-38-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172016751100001 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 Message-Id: <20220712215251.7944-38-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658173781427517.6772243381754; Mon, 18 Jul 2022 12:49:41 -0700 (PDT) Received: from localhost ([::1]:43838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWkO-0007JH-1v for importer@patchew.org; Mon, 18 Jul 2022 15:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbe-0002Gh-Qx for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:38 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbd-00061h-6p for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:34 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVa8-000B51-Hl; Mon, 18 Jul 2022 19:35: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=wWrVCNOFCj3/dErf4TYB7hyTaZC5eQh93jFUSAW4qLM=; b=TPB8oP/CuDHB6MCQjkyhdMwi06 2lRJt6Nj+1SvXTpqxwnt2xeBCgoNuuQAJppF5HARWJpEhWgh+rLIPC9dHWhEMYTJVdGbM2by3Lj1S 9YA+njuWMdmfM4sAL5IxxhIdivibAejImZrq5XuqbVE+Q8dYZxKW211qf0HzC5sfN6hqmOrkUiAdp jB7Gvti5aPNGxwl2UXadLZaSdsAoAcg+Xw7nZoey8i5jRBRIzANAqlpGH/W7xH5AQsZ8inusQsnIb lX/HnvCcdK7gTpi3OYjZZZUIBhGIduo5d60A2gw44agY7DeafRQku1lJlkZuDzkM/Jg9C5zGWgyIO BOJiaVjMHcArJWanqVnMS17wVSc1DkEwnCMeVtAEVX9Q0OXS3qKsxVcnGyWghOCOzFRQT7DTjHkx3 rdfwvQNRDwdnG/6UnxyGxhx4m3MQ14h2rUTdNrns2tQVFApXSGhxR99EUFWAy+pBADeyG5f8PXZ4q c4TFiZ8O0+6QWwKzTS4HFvGViaS/snP+L6hp6pXKeo4IfIp8g9BT6cs5Ok3PDwKLS88zk6xj+UMkB enVNKxcUTGOCuWniIOOweXNFoiKcGFt0CPOpd2NZf/6PKf9w9pOXhM6QJeapO4EffD8gIOgQQKIZJ DeiYG90tLsjcnN53cNtQEFV0ucO/dlK4oY9BPLY5s=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:37 +0100 Message-Id: <20220718183339.124253-39-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658173782918100001 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 Message-Id: <20220712215251.7944-39-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172262691840.1982325350864; Mon, 18 Jul 2022 12:24:22 -0700 (PDT) Received: from localhost ([::1]:34872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWLt-0005Kf-Ci for importer@patchew.org; Mon, 18 Jul 2022 15:24:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbk-0002KS-0b for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:40 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbh-000628-9R for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:39 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVaB-000B51-WE; Mon, 18 Jul 2022 19:35: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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=u3cNEbsPRXS9tXtrXVikpiC/SSAdKb6BGhboPI7uAVs=; b=PrAIGRTnlSz7T48E7P55jwf9I5 CwlrFBIVOdwkfio4eM7cumGf4xpGz9EpsE+i3lsVm1P8Fa7jmuj/PlSz8FUYJuSO1xtPrbTnP8uJO Nyy7i5d3zes6Nc8v5hxr6etiNxc7P6f/SjoQ9IN32q524gHMtYH1yoCWOlwAzelDy+kWgccnGNN2q Hxkah4AuzHUMqUSJ3Hcte4QNJLzIK3+t20sh+JQWpddYg+lrgytqFsMlvh+z8j/MvxJAbE2B1xdFp OkKVQBI5v+8lwQfkzCUSkNYnPdUT1c68xsQ+/bzkVzKJCgziYr7qROgonYJfAd5MHGXtQez0x6Fg0 BI/6TDfUDxmcaYt0DowITUgWQj4bXIaxyoveaW5I6+6Zw8wLrDlyQXJI3Er/nDLCjBZh+dWN1dBLb jxfnWS80aWk+gbO/q0+fFnbsEyO2l6UYn6agVd51HRuOr0VwejLEoJc2k+I8jbI4wa0ZKrPbqQJA0 HgTfzQruP+poyHDn3fMEKiqMGl8+yCqUjIoU4XJ5+/GjujDQz0ZAK1YLDAMHXGwJRmjGHg/AjZwZZ OPpvSR6q4Rq1REdTOe02pKr+HeUDk/0eOrqj4758xEImzNC95R82PR3GsXSO6IWhxcdYfpAZNlsqL f4svYeVgNJwQC8NKZIZTrsUciB8OKI6YgEKoxqGS0=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:38 +0100 Message-Id: <20220718183339.124253-40-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172264305100001 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 Message-Id: <20220712215251.7944-40-mark.cave-ayland@ilande.co.uk> 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:52:47 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 1658172598089693.9444514879488; Mon, 18 Jul 2022 12:29:58 -0700 (PDT) Received: from localhost ([::1]:45012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDWRI-0004BF-Q1 for importer@patchew.org; Mon, 18 Jul 2022 15:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbn-0002O3-QW for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:44 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:49264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDVbm-00062U-2y for qemu-devel@nongnu.org; Mon, 18 Jul 2022 14:36:43 -0400 Received: from [2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0] (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 1oDVaG-000B51-4k; Mon, 18 Jul 2022 19:35:11 +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:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc: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=OZ9BtdNlBrsJUplHq8XISjD3aktmtsBHWCy0DKeWwIc=; b=EUZdr841Qx9InWjsDqZ//6KBYW /JkmcOttnJw9Zg5KNOk5A9BwMFH6kI5RjJz+YUSVDEyRv0UHEk2MWUTbpRIvcP8Xd7+33zK/g2EKX 6UvYXdYMuIJNJ68bJsxM2HzD+k99g3ezoiNCcSQzw1cuDMfRSd66yECC+xGVyfBcXt1LySIfO7AYK vxuGUY9/Rz56Fdb9Pvhjp/YRoJVNelnGq1PKWj0rHRehv4Ce+5shhuQVqBwBJC7CIw5qtf92zDpLa NtcIsy4WPXgDgL8YLGocuo/ePUBSW38yqC3z1r/l1hXpL+C8BxRcB8DIlEgzuPdVvIt8Y9aMaSDpO evMtjDj5VYILLx6j3gd9uuFkINJjzvUiztj6sOaJZRDlLCyp2F9PC77JkcJJcwweWa+LshK4l/7NO jJZgEYfhOcjyTUVzAg6i/Esacpdzjygj9MtohBRjvZqzCDmkhUFZfp/gHkLfOigN0yBvNBA55JOqs 6fqAGqOq5RYumAHJAu6nSlVDRtB+JZcli0cDOXi7gkZ/c7Y3NGAPOQQsLePl2ylrjVIZEOsLhwHju dYFyfSoi5u+XtHyLN+t5DmKVU4n2PYh5gWugaBHlcrYYtF+uCRCUXfEygqzHuA+AoNMmEEjJIq7ti EOiFpcDKTGk8m0PDehedliwmwB0c5J+M992tAo9gU=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 18 Jul 2022 19:33:39 +0100 Message-Id: <20220718183339.124253-41-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> References: <20220718183339.124253-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8ba6:5100:d563:eb67:74b1:7b0 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 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: 1658172600077100001 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 Message-Id: <20220712215251.7944-41-mark.cave-ayland@ilande.co.uk> 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