From patchwork Wed Jun 29 12:39:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=hnBgxagN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1Vj5vHDz9s5V for ; Wed, 29 Jun 2022 22:49:00 +1000 (AEST) Received: from localhost ([::1]:39392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6X7o-0006Y9-Cd for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:48:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Wzz-0007YT-KF; Wed, 29 Jun 2022 08:40:51 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Wzx-0004cL-OO; Wed, 29 Jun 2022 08:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=M0Cucao+VAa2+UCW4BUSymuLJoVo8Pwunliy5H4m67w=; b=hnBgxagNmS5OvUsNq/jBzsxY1+ Ljzfrvc3BuwVBw2yMGGunfbr7zB4wg1yevdKJnGIC56M+L8x0jNUjxqflwgmsYKLDP13KJfA1TmB9 Mz4NoS7MX9apX587ksIqz7xZaOQji+v903KHOxZhejOptdpK1J7tTN/mgeALbO9RNGO+iSUHo4eKb 0IdiqoIYYgYVwYNeWvVKKTX5l+lGH7aIXtlwgHKa262pxc/epr/+Rz7yllb7/ttAI5PfOPfQMEu2P sdVzF75JIZInsGJJZuB378wAnUs5eWXp0kz17AgOWIcRpORKk6F9Gzj4uNvVcQaTmvz4Dh2+UOCRs arqiDrpmJdPLqYt5FW4dD9Y+9dI1xjFhXVUDjW6Vx9QzZHsHRa/8P6ZRv5DJh1I5/TBXCRqJRnhhh 6GEFHoumCPu7zYsZw4cc2WlPlngK9ks7Kk1FfF9/j9CTeWZVlpw5bhCwiQq+0+YU01Gfajw8+lkZW ArWRMFhiwJgspGaoU9jsSpiYjSPBOYRC5TGB48bEU82kqWx9X/siNPtbD+GQoB9O6OuN7vvIrjKpt ibcEfopMYvbFb2whJZrMNNNNvddWtdW8F16nsPyqIPsmghE1qC+sz4u43Oc11Awa0KPeZqm6SUXjc I4aI+PISY3D5ASMsyghUxkIAZkVUBQvPzoRd1F6lw=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wya-0002tZ-53; Wed, 29 Jun 2022 13:39:28 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:47 +0100 Message-Id: <20220629124026.1077021-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This allows the QOM types in pl050.c to be used elsewhere by simply including pl050.h. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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" -#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; -}; static const VMStateDescription vmstate_pl050 = { .name = "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 From patchwork Wed Jun 29 12:39:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=x9DxHN/I; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1NQ4Hn8z9s5V for ; Wed, 29 Jun 2022 22:43:34 +1000 (AEST) Received: from localhost ([::1]:33106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6X2a-00019N-8C for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:43:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0B-0007cc-19; Wed, 29 Jun 2022 08:41:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Wzz-0004co-PY; Wed, 29 Jun 2022 08:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XWxdtZa/vHPWbxGBr/IVfvv+ogEgTzFX5DW2i2afdpU=; b=x9DxHN/IUpo3x9S2nAFfU7GVA8 13o4FBa73rMReBEdOs5OGGBO7C49TwRJPqlJzmvP3ZC+RDr7tFexqwh9XOIQRcX6op8HEVsbe6hbG +E7rjGQROaLThkHy6YSxuKn7qbjLSOwk0XrXf9z7QU45DVrLq0Oga8xhtZrjCSEm1rH/43+9+/FsI uKfKl15nDPkk92fF4Q2pnaYEIUbH9mN7gO9QCvy3L3KT4TPp6nOGYExDVrfR/xgMsXX5/5qWiyyoe NBUfXmrcPIxJcJbXNg2Y0IA/3UNFUsaSJSJhm/cxXEq8KQ1ANXu93FKQUnWsiZbOSuqFcj5Cj3MQm pRP24+yZByqWCkwSNK9YUbRfD21PKBv5nSZe7XaNNQIYnnsCKP//aGdv0I6BvbS4prbzUyyH9rRkG WJvwrArHh8K/afNSLUKQCETHHDPEM13SW8R+W7rq8ITgaWkQJZpVZaFciYN2Huz+wZcyxxZ+pF8QD x4b3Y0aejrqdatcx/xK9T8HHTknqT0GWfLZla3MQFe9L3T1mj9vKgzXw8cheJJM9MfLIr33dlLDsi cBYZS5nyqKvAQ5VvRS4rbLWWEYLo/HRzPMaaaNgr/TDNo8jHIeNdjT23rCCuPn7zLcdjrmJHedHjO cR7LP0AmcyXNw7Zmis23/Cx2pZUYVvTh/ztqRm8aQ=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wye-0002tZ-Fs; Wed, 29 Jun 2022 13:39:32 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:48 +0100 Message-Id: <20220629124026.1077021-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is for consistency with all of the other devices that use the PS2 keyboard device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 **errp) qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); } -static void pl050_keyboard_init(Object *obj) +static void pl050_kbd_init(Object *obj) { PL050State *s = PL050(obj); @@ -183,7 +183,7 @@ static void pl050_mouse_init(Object *obj) static const TypeInfo pl050_kbd_info = { .name = "pl050_keyboard", .parent = TYPE_PL050, - .instance_init = pl050_keyboard_init, + .instance_init = pl050_kbd_init, }; static const TypeInfo pl050_mouse_info = { From patchwork Wed Jun 29 12:39:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=KyFrN4a9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1M45nsyz9sGJ for ; Wed, 29 Jun 2022 22:42:24 +1000 (AEST) Received: from localhost ([::1]:58972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6X1S-0007fe-EB for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:42:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X06-0007aV-LH; Wed, 29 Jun 2022 08:40:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X04-0004dK-8W; Wed, 29 Jun 2022 08:40:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/0LdAl3a8XS+g0OH0t5akFaU0tsvy7Ot80OGO9/Qa8g=; b=KyFrN4a9IK+rLvVLde+3MghBV3 rUSvnZNY7gOFMQywmOD/L0G9hH0MN23C7t8JV1N8YP3C3OND0Rx5hRC326Ug/UQcNwAFScL+0jhKg OjS7sH2G2SwY2Wrzj/x5a7HwB7umoLIFUOQervNfV7VG8dGe62F7khl+IId72fKA6Ms6JP7khwRTq j8y9oTOIrdCKNM2G0+Tq4kVSPFmXm78gtvPzHqVTin0fY7fLJUC//MujaPkuvK7GmjxJqwgXVjLck nRwGM+6sBYbn/583YVAGNM2unWdJh0tN+j9yCccF2CAaJD/BYUPz8XlvnJmaho6PqRSeoGtOlJUxV uUs+AX/qk+SCl0Ra18u7ohDNMLeCVZZdkLA5lfBJGJpNV5m98D2xT8Jv9o7ZJHd7El6LfXVIkNS38 XrZurZt0wJccQBYSuAXvU2TzRS0neGDH5yuGp//IOH+mzrvSBgueLWo58M8cG5mg9UABwhTP2VqOx ER28174GdADtoJwbQDeB6sPG2V1VQcDrT41zd8OGtlUkZMVcPsvIEJI5wKuSPU7+B3/I8kCth+7wn 8eawcCcnSxvGkBcqN9JTIlxYGM/XEd0unFIyiOlChjJTz2ovKPfBuA7u747QtiijQTnTcbAkMaQCB G61Ga8zkCcIaQxz5hBWXh67Ctjj1J/tcXFGf7TIjA=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wyi-0002tZ-QF; Wed, 29 Jun 2022 13:39:36 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:49 +0100 Message-Id: <20220629124026.1077021-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 emphasise this type change. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = ps2_read_data(s->dev); + s->last = 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 **errp) sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); if (s->is_mouse) { - s->dev = ps2_mouse_init(); + s->ps2dev = ps2_mouse_init(); } else { - s->dev = ps2_kbd_init(); + s->ps2dev = 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)); } 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; MemoryRegion iomem; - void *dev; + PS2State *ps2dev; uint32_t cr; uint32_t clk; uint32_t last; From patchwork Wed Jun 29 12:39:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=gDQrYJpM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1fY3Pj5z9s5V for ; Wed, 29 Jun 2022 22:55:49 +1000 (AEST) Received: from localhost ([::1]:51948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XER-00076T-At for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:55:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X07-0007ba-RE; Wed, 29 Jun 2022 08:41:00 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X05-0004db-Gw; Wed, 29 Jun 2022 08:40:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oxZ0MAzwBYh2zbYHzTIWktk6Z4pgwqOLXrKUMTvOqOE=; b=gDQrYJpM2nbGfL3kP0+YvdrhWV ZnjWsiABIlS1gR2E78FfXEWBnbnO9bLhc5KmRPwaQLMiuaNWEf3JnL5YkKSjfs6DC315jihQe+j0Z nOktcNUjwj6fUsVO1vcccmEC1YBDJVq36b+0I38H+mqPGNaV+qGmeUvC0kZi2EFHb7iv9XdnVOqID D/T5VzGmN+WA6j9WAVtdMIzOdAXFfCF4yLQpjPaasGAlbPP674A9OK7n95EDUrOmsY22rw9TaUWZT a9SLrNlZqZM6mJNDxJk8rVFCZB7mBOdK2sxbJfznT0+FsP09VtXuhxOL3q9kqoXQ/Ub1eKpppaI02 qoIEW0ELUKCJ79cbKdj+eY3PO0Nw+3cpjQOsd8RTfbmdqdIf39dT1cx/qa6u5vAY7B4fdWv0nFeuI PYBhfWN0mjx9gs+83L0kUC8fZ9C6fIsNwlE/LhETvzMLfCjIJEL7J61zDGiw7H5o/XHnbEzfDb80D ror/olwrfLJ4DjBp8cuixZZI5fHmg6g9sVZEfcAfS3HQIyW8iPbkV03MhlujtIqdGLlkVHT04kr1j /tc4BNvDJlONWYr4J6FmlyhKM3403n/HjFjgAESIiu+Guyc72dMjoijk/q0o4aG3hVEI4MCQAPnBU 9Iln+poQnBrt6mCfV9cEKByo7p38KEbYO404PCJwY=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wyn-0002tZ-5i; Wed, 29 Jun 2022 13:39:37 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:50 +0100 Message-Id: <20220629124026.1077021-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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) } static const TypeInfo pl050_kbd_info = { - .name = "pl050_keyboard", + .name = TYPE_PL050_KBD_DEVICE, .parent = TYPE_PL050, .instance_init = pl050_kbd_init, + .instance_size = sizeof(PL050KbdState), }; static const TypeInfo pl050_mouse_info = { 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; }; +#define TYPE_PL050_KBD_DEVICE "pl050_keyboard" +OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVICE) + +struct PL050KbdState { + PL050State parent_obj; +}; + #endif From patchwork Wed Jun 29 12:39:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650038 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=oIb3NfkM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1ZP6Ymqz9s5V for ; Wed, 29 Jun 2022 22:52:13 +1000 (AEST) Received: from localhost ([::1]:43882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XAx-0001aU-O2 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X05-0007aS-T5; Wed, 29 Jun 2022 08:40:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X04-0004dI-76; Wed, 29 Jun 2022 08:40:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K58nP7E9CBrEEek8QjHRKoTv4vo360i8kURBjo2RHJg=; b=oIb3NfkM/uJEdccOLx61l0FPiG pPMBQTaymJ2PKRSe4wJ8+l7CY6pMxmETFVsohiecNGNs98BiPnrCvOUwdC5BZoVbvCe20LXf0MeZB AhIoGBsCW0qplOy9vbC6BjWLgIoZAuo282mRiZ+WhqIWA6p6QHs4J6F0iGY/AiEi/5GTj/U36nBXy oV8E11KVaiuWoAoNfHgv+8Sbl5M3khIQwfvmvSzz2a2zSS5QENWvrOJ9HVGUOuMFhVFv0DarNjZN9 mVL2ksKNX3MCtLNIVoaZQHRwv74KLEWUCmBUxNjyARagoJQvUq8kPP4WnqnFGlIK4/hGGbzZ7Y0Ig 6hPgoBGoCKkvqjOjyqcYpYF57bX5B6yyVYMJ5E2Lw1yxZU0aAGKe8azxKvEopHFtiY/EK3E870XvO D3xZIZn3EsekWtU+d+Mnxm1RKdt78fZ90qnPM1wF1H2SUShu3enEQB2LWXPw2WBMD04PIuD4HRkc/ GSmeDHJx3INMQY38UDu3sOOtjjXvyGC4kGEfys9VZ1RJOUVVLwt8JkT3BfckZeJFsFEhwXioS0wrg Aosm/Mn8kRhYYrALhvnwI0KioJHhkaoL+i0+zfmrPgeU0Cm8qJxBaYe+1fTyj2zCNDdx3/mfuGLeS daQ8fftHNWubmurKiCkmGuQWL8zC+UO7I2dv9xYq0=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wyn-0002tZ-KB; Wed, 29 Jun 2022 13:39:37 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:51 +0100 Message-Id: <20220629124026.1077021-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { }; static const TypeInfo pl050_mouse_info = { - .name = "pl050_mouse", + .name = TYPE_PL050_MOUSE_DEVICE, .parent = TYPE_PL050, .instance_init = pl050_mouse_init, + .instance_size = sizeof(PL050MouseState), }; 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; }; +#define TYPE_PL050_MOUSE_DEVICE "pl050_mouse" +OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_DEVICE) + +struct PL050MouseState { + PL050State parent_obj; +}; + #endif From patchwork Wed Jun 29 12:39:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=JEUhv7F+; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1fr0tHkz9s5V for ; Wed, 29 Jun 2022 22:56:04 +1000 (AEST) Received: from localhost ([::1]:52482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XEf-0007SJ-Ir for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:56:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X07-0007ac-86; Wed, 29 Jun 2022 08:40:59 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X04-0004dQ-Nh; Wed, 29 Jun 2022 08:40:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dAIx0b4dvbGc+BzOGQjfkHdH1N0oRA7JiPFuOhbR47I=; b=JEUhv7F+py5N2CZWlFz0BlvySv baayFGW3j9OIm4TruFThBc0eIE84qqyj0S89JSDkuv0j9QnpY6YlHEJ1p9kxqSriGRZ8FwyQbd8zy VzNqAzWDbx1bIUBUJuMM0s/4lPyiJqIv1EhQMs60RMQ6ouaL7IuXYCNEEbYQKagBdjTtHDagq7kHr +JOmv/Kha6CVIZFptcRWGYUwjJosbl1VmdFqiM0VM9SLiyVqzIVrq6VTWH2a6DuvV+QKxdjkiC3Cp 37FobzihFGg5A1H86y2Kl/37mBl5geq/U/hQDp/ffRAdfAGFmbaJ/SxgXDh+0X9jv8wQneFsvTpig tomaPaoauZdgLWs9WjxOhsHgTCcdNfm6RG4+V1jbBBDb3AgxyKkKN32PRWezdKa6Ep/fQoMUYxOBe NRtygNt3ubmZAVovxoJwPxnMSmFboj3xjNtzNpxNBnazOdjdLXEitXIDsFrrHdZiF8PplA8KajyH0 gvHPYE1waDN2+FuJuZOZYQsRnoicXdnQFX0SHY6Q8OHghySGZT0aR1yo5Oaylcp22kNJ0ig4Wjg9b tlyJnFoc3LJfSd8Jq1dppIFbKnWoqQydMcq2fZh9fCNmAeqXmHVx7op2NDOBmYy7uzZl3xAAEpCtr PqAusyokSKOhFzf/EOLI9p9/TAlJ9/RJH3hm6jqw4=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wyo-0002tZ-1s; Wed, 29 Jun 2022 13:39:38 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:52 +0100 Message-Id: <20220629124026.1077021-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { static void pl050_realize(DeviceState *dev, Error **errp) { PL050State *s = PL050(dev); - SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - memory_region_init_io(&s->iomem, OBJECT(s), &pl050_ops, s, "pl050", 0x1000); - sysbus_init_mmio(sbd, &s->iomem); - sysbus_init_irq(sbd, &s->irq); if (s->is_mouse) { s->ps2dev = ps2_mouse_init(); } else { @@ -197,6 +193,13 @@ static const TypeInfo pl050_mouse_info = { static void pl050_init(Object *obj) { + PL050State *s = PL050(obj); + SysBusDevice *sbd = 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); } From patchwork Wed Jun 29 12:39:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=Iqmxfgsm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1q45dkJz9sFx for ; Wed, 29 Jun 2022 23:03:12 +1000 (AEST) Received: from localhost ([::1]:33630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XLa-0005lr-Ge for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:03:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X09-0007ca-UY; Wed, 29 Jun 2022 08:41:06 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X08-0004eM-G6; Wed, 29 Jun 2022 08:41:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U6eelMB55dLrnnotyACrYFBOUe+D4MNgeHqjT3Oicw4=; b=IqmxfgsmDp+jBaVAbFVguICodX 5w99smSWLwoWho1kv71LTYAS/twI5o9KV3ZxzaNByZF6G14WH6KTZj+bgrsIFYcMQUQCQAedw5izE x5iTl85Dfxjm4bzRJ03PlVWtIkIZHpgp3lt9lNvgZaws2sK4Muh6hZfs3oh3SPMoHacxy4oxhHKrW D7IAtu4F40NVZgXiClDwNrskRn9bvnSm1JsgIwyMOOId15dyNjhOVD06wbjtZb05aBiAG8PV/Nu9R wKGrVbHIjzX0rs9dV/gxIt/NE0u4v4id5AnJtsQAYPy9ejv41p+OUDmUrz/wFfTZgRTg/xweQoqcl kASGa8SaTxDT2I2PvxRMPquyQ2UuKd1jnyjUQzYehVpesnRG5fDqMuqgTmYK4bZ0wGes50nKJ34mE kuAqnXIGIWklQFomv43YW21q5qNVrDU5qfej9QjLqY4zT7nxw3Tnxe9rbEFC+gsDV5doCNyh02f3U nFB3ZQLz2Xv1k8fWvXm4bvojn8zbBMyiM6Ue6uiQ82JKYCn/1CfBJXYNIEYhlnWv1eF5WaRBrtyhn ZjYD4Hc67J1kycIXj4zl/UQm1xGXMYAJCtF9qS0wBv/k6NmNYTkGg2JcVehguzLVTQklquScWuGgL SAK3xyzKEfYV4KofBkhSvQ7s06306p+UspTeToz4M=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wyo-0002tZ-Gz; Wed, 29 Jun 2022 13:39:42 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:53 +0100 Message-Id: <20220629124026.1077021-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { .parent = TYPE_SYS_BUS_DEVICE, .instance_init = pl050_init, .instance_size = sizeof(PL050State), + .class_init = pl050_class_init, + .class_size = sizeof(PL050DeviceClass), .abstract = true, .class_init = 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" +struct PL050DeviceClass { + SysBusDeviceClass parent_class; + + DeviceRealize parent_realize; +}; + #define TYPE_PL050 "pl050" -OBJECT_DECLARE_SIMPLE_TYPE(PL050State, PL050) +OBJECT_DECLARE_TYPE(PL050State, PL050DeviceClass, PL050) struct PL050State { SysBusDevice parent_obj; From patchwork Wed Jun 29 12:39:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=B5NylDc1; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1Y47281z9s5V for ; Wed, 29 Jun 2022 22:51:04 +1000 (AEST) Received: from localhost ([::1]:41496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6X9q-00086r-PW for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:51:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0E-0007dz-Fb; Wed, 29 Jun 2022 08:41:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0C-0004ev-HM; Wed, 29 Jun 2022 08:41:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UWILSGlR6dlI19vHCngeYgExrt7TVeG6tbsNRBKmHr0=; b=B5NylDc1YaQQXyiOAVuLtVoJTb E0dfGLh7q1LcTR/O0eF6FEgMxjUXXvEhkUFecuN7+O61x+F5xnQc3wzQlGUqJLf8Ne0br1pbOgvR+ +FyKaYKRAHVzWBy3ddUwsTCYA2XJDCiqwCXmQTHMu5KQA0xXu5Ixt0T38WM1fPCCEAtIf+y4GmzaB 9v0to5Y5tONhbA3BqB6e1ahwlOBJD5sqBzESPHQXR8QjPLkX5SiRjKNAJwJKIBo1E87N8M0cw9f6b 33pUxQqeQw0xEDBjeFjS3u6N23k4ZO/0QXFCXAkBzMxxgpN8Wj3/5VGhKo0PFIQwPiGa4AM3mVex+ GmReS6wxVnXr2U59ejeAWGeg6UF7FupCnKjn+NkCpPc6Z3fsIIlzcgPCpRfNRpMQK/Ein1hGoNQ9E mjibdh0KIPpkWbuMT+eJlzJBbx4oclhqKoSfypRAZEzZzv0z3U2qSfCY2BCqOmK+yNA3uExesuuPr MI+2edgdU6hH75dqKnX7cy3S1vLQyRJv/BDv8gGWYWTMi6OnpgoNkReA3OVJdOOoYI74YPHzrUuAa m7HSUF4hEHU/3IK2SN4VtdLp3Aeccv95/f0ThQ/3m0+knTRR250kqu1Pqng01Hbj8RbEsHzh5O6KV eAg420bKVz1E4zOFW+h5oXRzTyM+FR7QQqrbmh7KM=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wys-0002tZ-RK; Wed, 29 Jun 2022 13:39:47 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:54 +0100 Message-Id: <20220629124026.1077021-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 **errp) if (s->is_mouse) { s->ps2dev = ps2_mouse_init(); - } else { - s->ps2dev = ps2_kbd_init(); } qdev_connect_gpio_out(DEVICE(s->ps2dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); } +static void pl050_kbd_realize(DeviceState *dev, Error **errp) +{ + PL050DeviceClass *pdc = PL050_GET_CLASS(dev); + PL050State *ps = PL050(dev); + + ps->ps2dev = ps2_kbd_init(); + pdc->parent_realize(dev, errp); +} + static void pl050_kbd_init(Object *obj) { PL050State *s = PL050(obj); @@ -177,11 +184,21 @@ static void pl050_mouse_init(Object *obj) s->is_mouse = true; } +static void pl050_kbd_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + PL050DeviceClass *pdc = PL050_CLASS(oc); + + device_class_set_parent_realize(dc, pl050_kbd_realize, + &pdc->parent_realize); +} + static const TypeInfo pl050_kbd_info = { .name = TYPE_PL050_KBD_DEVICE, .parent = TYPE_PL050, .instance_init = pl050_kbd_init, .instance_size = sizeof(PL050KbdState), + .class_init = pl050_kbd_class_init, }; static const TypeInfo pl050_mouse_info = { From patchwork Wed Jun 29 12:39:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=poB9uQjm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1fF2JbVz9sGJ for ; Wed, 29 Jun 2022 22:55:31 +1000 (AEST) Received: from localhost ([::1]:51342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XE8-0006hA-Dc for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:55:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0J-0007fP-UN; Wed, 29 Jun 2022 08:41:12 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0I-0004fH-AE; Wed, 29 Jun 2022 08:41:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yz0K/2/6sAI8vUyT+jZ9KZjZnqLO/rs0fjmlxuZVCwk=; b=poB9uQjmxd/YqaOaoPa3oFCzqr LZlE1hegHVmL5f0MN8boUtfknSf2s22DOdIUgQAYR1XA8gIMuahfb0LGHtCUgGG0iAxZoYeeKBL13 /qyRMySJCWXFtOU2T2G8WwcFr0OLVLe4eaS/mghtf7stGkxj0d8FGQbfS4IipWRKjKmjBzzSrCWnG 5YAbVz18SNq2l2Xtw8VlkEAZGrIWY1KtETEth8tJblYzdajayUtDriMaglK07R0Xd60mon1ZGw4xj lI0lG3UuQqf8fh5ASXz/GvwHIGCinByGPZiz0pm0SYnXgzL4pxJLLmb7/f9Y9MjhkEzV6qJGM/EKm l6pPTBp9zH6lKs/zTDOdjN4pZgYMVGiesps8w1IFRYYG3UZtYvmfgUS07SnAKakfY+7mwD4XtjlDS h/FNw6UxcEvBwSlrvk4bNYw07hBVtr2alc2wdc4hp8q4G9z5s2JSKe8WZme5a/qa1moYkTgm/NItK mv+p/IYoyf0IrzSeo4mYVQFA+iBDMegVODPo6ojIOMdAq4hweb6QkYlRIn2Cq8IZ+C434OE65ADAj 03XCCdMZlg3Zr399ndIyxj7u9si09C+LrfLm61AjKHEGcOaX3JfH8yvbTTKWUG3LD6MjXH4ZktMV+ qpZlhvGpgTe2kMnzaUng14TbDwSizIh5v6K9e+MGs=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wyx-0002tZ-Bn; Wed, 29 Jun 2022 13:39:51 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:55 +0100 Message-Id: <20220629124026.1077021-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 **errp) { PL050State *s = PL050(dev); - if (s->is_mouse) { - s->ps2dev = 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 = false; } +static void pl050_mouse_realize(DeviceState *dev, Error **errp) +{ + PL050DeviceClass *pdc = PL050_GET_CLASS(dev); + PL050State *ps = PL050(dev); + + ps->ps2dev = ps2_mouse_init(); + pdc->parent_realize(dev, errp); +} + static void pl050_mouse_init(Object *obj) { PL050State *s = PL050(obj); @@ -201,11 +206,21 @@ static const TypeInfo pl050_kbd_info = { .class_init = pl050_kbd_class_init, }; +static void pl050_mouse_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + PL050DeviceClass *pdc = PL050_CLASS(oc); + + device_class_set_parent_realize(dc, pl050_mouse_realize, + &pdc->parent_realize); +} + static const TypeInfo pl050_mouse_info = { .name = TYPE_PL050_MOUSE_DEVICE, .parent = TYPE_PL050, .instance_init = pl050_mouse_init, .instance_size = sizeof(PL050MouseState), + .class_init = pl050_mouse_class_init, }; static void pl050_init(Object *obj) From patchwork Wed Jun 29 12:39:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=y+nYScIU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1yV6dlwz9sFx for ; Wed, 29 Jun 2022 23:09:38 +1000 (AEST) Received: from localhost ([::1]:46530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XRo-0006n5-LY for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:09:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0h-0008Gm-Ra; Wed, 29 Jun 2022 08:41:35 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0g-0004hd-Bv; Wed, 29 Jun 2022 08:41:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lYrEWN/BLHwdROY2hmdP1qINLeuTOZK6l8P6pnd6VOg=; b=y+nYScIUHHkJeAqTYF8b88Ys+g IviYe1ivuFv4xQ4OXKYHs0+k++FgKwJ1IDa9Fj5CH1ImfJ84/JipQ7xQHfOVz/+5dadEBL+f2ZFAp csv+zBQxbrqCGLrizQaUN570pJMyBFzbnqHerCBsNABeT6NqG7CXbDAiirF046b4R+rypLI38Za5N mSmdCAIRICOstm0oHJx0ozymldIJ4w329LCcwXeOQ/z1aQeVSJ6wVtEeQRvPHY9HjIIER/l8vJdDM cFTIQVXlkDL30GlYCfEBvCuMW1Jhdmtw3nzbfUMFV12v8n2l1ewQ6DLNGRhjFhwp+7mzDEUDvUkz2 P8wUeT/vZvLgswTKDRHlRqNW0zWmAtd4a0ngfOE3VCvBjDr/9s7q3hWENDvI0QZtPiDQcCAHc1F0G wHF0uX2uWrn5lQVG4xQYBQ5Nhx7gu7cFwe/JHG09FnF3L+aB6Wpgwac2t0GTcN/NxUL+UXDtr5KbN x+ftQZIMMaZKZiwdfmLGNvltPfrORYEiygxUwiVrAJ+laK+/Ai1UOsErckxGsWnLvumUGa3VqEnUv qaDRqM/hqD9/g1nDFHPbfJo1XFDoKXEvu+AB87FPp98oPe/HIwPRcAiKQUvUTzRT0wI7hnjQJ/ENB uHTgBFI8A2WJr38AgkQm5ES0a1rIDkEbeBGO/xPzg=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz1-0002tZ-Mf; Wed, 29 Jun 2022 13:39:51 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:56 +0100 Message-Id: <20220629124026.1077021-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 **errp) static void pl050_kbd_realize(DeviceState *dev, Error **errp) { PL050DeviceClass *pdc = PL050_GET_CLASS(dev); + PL050KbdState *s = PL050_KBD_DEVICE(dev); PL050State *ps = PL050(dev); - ps->ps2dev = ps2_kbd_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->kbd), errp)) { + return; + } + + ps->ps2dev = PS2_DEVICE(&s->kbd); pdc->parent_realize(dev, errp); } static void pl050_kbd_init(Object *obj) { - PL050State *s = PL050(obj); + PL050KbdState *s = PL050_KBD_DEVICE(obj); + PL050State *ps = PL050(obj); - s->is_mouse = false; + ps->is_mouse = false; + object_initialize_child(obj, "kbd", &s->kbd, TYPE_PS2_KBD_DEVICE); } 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_DEVICE) struct PL050KbdState { PL050State parent_obj; + + PS2KbdState kbd; }; #define TYPE_PL050_MOUSE_DEVICE "pl050_mouse" From patchwork Wed Jun 29 12:39:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=F+dhJV2y; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1wT2DCFz9sGJ for ; Wed, 29 Jun 2022 23:07:53 +1000 (AEST) Received: from localhost ([::1]:42122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XQ6-0003qJ-RM for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:07:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0L-0007hV-R6; Wed, 29 Jun 2022 08:41:14 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0I-0004fL-Ty; Wed, 29 Jun 2022 08:41:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lB2/N+UWeTMozzLfCLXvZRKYPj8HL2k9kFD1KcW+hj8=; b=F+dhJV2ygjTW0vMwXAAXm4jEkQ o5Bk54uUuBLDrpSUBHh/dPyWxmOp37FlEZiO35Nsp+ove8X+Q2RX9JriOO7QYp3Zim35WuICJ0gLy FSAQ/jFC3WtZ9I1G00ku7N6bLTIlRZ45A19WP+qIKPxPMDKuALt+47zWO23+ixdyyw1fUL9A6E3A0 s2nFldo5195B7AXIgF98m9B5GXzywZLbRgYQkZa3WjBXegDNZC7OqAo6APmYmU4H3vx7OtGR2PFGD 0QT/BsJJzS577HbahEn06/dzZ4EcEoEfRYMSN/mRMrTuaMuoul+z39RHuZKj05CLK57dgkEtxGg9b xgkXxXCrZ9jx4thiANpaggNgN6tITTqB2rIn9Zra2YuQv4ucNucv0Eeo8U4W2RINLtxITNpmL6Oq2 YPVNZHaOq0MJfKL4p/PBqksBhHEBQ61jFBonLhJPjCBoh6n94a6YulhenfrIPBcihNR7JBLfee+ET 3nT1L94GUf0sv9etMM5IPXLAtBrnRi3qKtO4U723KLR8kWhUHW2DbgzVrzIrd5wraA85YrotzfpQg XVKkS+bwNo8mykodZnPj1AScbM84lG0RHzBr89X6z2JNcwwxtXIJU4O2N+ENsZoCGES1pSeHE274p oEoaO/PNfeQm+E7164LAAd/Xp62ObmDuY26z73x3M=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz2-0002tZ-5M; Wed, 29 Jun 2022 13:39:52 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:57 +0100 Message-Id: <20220629124026.1077021-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = PL050_GET_CLASS(dev); + PL050MouseState *s = PL050_MOUSE_DEVICE(dev); PL050State *ps = PL050(dev); - ps->ps2dev = ps2_mouse_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mouse), errp)) { + return; + } + + ps->ps2dev = PS2_DEVICE(&s->mouse); pdc->parent_realize(dev, errp); } static void pl050_mouse_init(Object *obj) { - PL050State *s = PL050(obj); + PL050MouseState *s = PL050_MOUSE_DEVICE(obj); + PL050State *ps = PL050(obj); - s->is_mouse = true; + ps->is_mouse = true; + object_initialize_child(obj, "mouse", &s->mouse, TYPE_PS2_MOUSE_DEVICE); } 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_DEVICE) struct PL050MouseState { PL050State parent_obj; + + PS2MouseState mouse; }; #endif From patchwork Wed Jun 29 12:39:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=sGUg8G6R; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1mK0mXKz9sFx for ; Wed, 29 Jun 2022 23:00:47 +1000 (AEST) Received: from localhost ([::1]:60814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XJD-00052O-Jo for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:00:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0L-0007hS-Qf; Wed, 29 Jun 2022 08:41:14 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:50994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0J-0004fd-D1; Wed, 29 Jun 2022 08:41:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VrrIbZOpvkUUv5LCGpRSGYib3z5cOrpFGnnIw2haosk=; b=sGUg8G6RrthTuwcXYQCV6l6iCh AnueXDyUMM2eNfVIwu8TA0oROzTbqxbNrzRpyUMcdCwi9QU7mdiXyUH6pxkOn4VUC9WntIcQ75hfv eGBZTXPba0lBGFqA1rUwW1RY2JaHC46ORCOceM7FQ/fCDLzphoV5H8gLLw3smZMDxDYhxQxLxljni 1585MNnnK0uIJg1gDvJLJG1ECtPyTf9YyWF3KCe2LmHVLWM/pkxr3E/5nn3iSwQQRnoNnF7LAe0QL kKXADwB8UnCxaDHdy2KfAFIR6D2U6wrzTy1dnfgUX7qPvkXpZC989YrEe/H/dl867sfPW7ikKVBK0 DOLjmTOxTciPBsjZD/0B7ucU6dwswNGeZkYgrGKr8yf/u03OGvk1mZvIatyiqbZkB1juuW00r8AEB 5CCOo8jo7Kl1vqR8JsCfsPCUNl5AqwW0YqunbtiCqmZmm2lxfvdKYKmiZMbai2o42zsRlz0yiGfWT hfiK3Z+Wu30r6Y4idepUdW25mvLfxWUC6Unkt9RkM36TXZYWlznN/M7KrzHn5ULzUe5GMImHk8jUo iXeKhgXqISucuJa6GeHFUCrxKIEn439KUOtg4dFark7B256ZE92ggq0gFxs9kr8o4Uk9PD8+oG+Cy KzVM8tQbp83mPc3n1zazrpL7XSzif39tg4RnJYnTE=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz2-0002tZ-Ke; Wed, 29 Jun 2022 13:39:52 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:58 +0100 Message-Id: <20220629124026.1077021-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since lasips2 is a qdev device then vmstate_ps2_mouse can be registered using the DeviceClass vmsd field instead. Note that due to the use of the base parameter in the original vmstate_register() function call, this is actually a migration break for the HPPA B160L machine. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 **errp) { LASIPS2State *s = LASIPS2(dev); - vmstate_register(NULL, s->base, &vmstate_lasips2, s); - s->kbd.dev = 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 = DEVICE_CLASS(klass); dc->realize = lasips2_realize; + dc->vmsd = &vmstate_lasips2; device_class_set_props(dc, lasips2_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } From patchwork Wed Jun 29 12:39:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=GdV7pzNG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY22M0Yctz9sFx for ; Wed, 29 Jun 2022 23:12:59 +1000 (AEST) Received: from localhost ([::1]:50824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XV2-0001Fu-Uh for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:12:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0f-0008Ch-TA; Wed, 29 Jun 2022 08:41:33 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0e-0004gs-AN; Wed, 29 Jun 2022 08:41:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CuULp0Ox3SZISe1C6XN+EQeaF9mkg7op37LLTDA5O6Y=; b=GdV7pzNGkFRo6G/02ZcVaKiPch xSqC1fJhBufTJ1Ggd9dNVZNhwg9XhP0TBkz8tGPZc4cKREUYeoZrHmGyknd/ocWK0hXRbtcxJVKW1 KSamA/Z7eMEnVT5brojN9G5WV10vSYXjfD5tPTMWM71klyzx+oIbxpyQu1nEbEMZ6Tqd2NExVxbDc rPiyCN79MVdyFaMgAojidLzIyH4bhTVVJlOCATCMjaeBUsXPZinjLWegY4h126ygLWsQIdyv15pfC q1whFc/AiPfz/7vh21+E3dWB+zBPHsRi2Yf8ZUqXfWywlobDRbpO2SuJVKieFtrHOEkdZo3SOlFYi uUgnJP/vfTk9cDdGKhDcmavFsYi9CX5Sp9ssoxlTNx4r8wDZdzOJpoZLBONn2PGs/eqSWkenesvYW TmPGnAG4aLWnY1XUBmDqpDoJPt1sQsSyKO3ueu/T3kQr1aalsfvJY/181G8wZrhbr2GP7nIpFUsFE /q6UeWSKsZOEo/M2XnzMyPpNgMIkNhbwJ5LRP5r8C9eO1VzOo36P11Tye1dVawj0gKyr1Wf8xEx98 GPXyOWDHUuT43uv91kSOgY4ijvpYcruxQmWlHEc5M+AEYhfDN0da2rpQh3bydiexuK021twm7aUgn z1Y7JfMGbqDWq5XAV5i7lGi9ZlG/dyk4lQPN6FtWY=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz3-0002tZ-4P; Wed, 29 Jun 2022 13:39:53 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:39:59 +0100 Message-Id: <20220629124026.1077021-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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) } /* PS/2 Keyboard/Mouse */ - dev = DEVICE(lasips2_initfn(LASI_PS2KBD_HPA, - qdev_get_gpio_in(lasi_dev, + dev = 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); } -LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq) +LASIPS2State *lasips2_initfn(qemu_irq irq) { DeviceState *dev; dev = qdev_new(TYPE_LASIPS2); - qdev_prop_set_uint64(dev, "base", base); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); @@ -307,18 +306,12 @@ static void lasips2_init(Object *obj) "ps2-mouse-input-irq", 1); } -static Property lasips2_properties[] = { - DEFINE_PROP_UINT64("base", LASIPS2State, base, UINT64_MAX), - DEFINE_PROP_END_OF_LIST(), -}; - static void lasips2_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = lasips2_realize; dc->vmsd = &vmstate_lasips2; - device_class_set_props(dc, lasips2_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } 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; - 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) -LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq); +LASIPS2State *lasips2_initfn(qemu_irq irq); #endif /* HW_INPUT_LASIPS2_H */ From patchwork Wed Jun 29 12:40:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=ihLOIMfQ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1YY71Rhz9s5V for ; Wed, 29 Jun 2022 22:51:29 +1000 (AEST) Received: from localhost ([::1]:42420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XAF-0000KW-2y for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:51:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0g-0008Du-90; Wed, 29 Jun 2022 08:41:34 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0e-0004gy-Np; Wed, 29 Jun 2022 08:41:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gxwGWn1Gh4yc+AHQA010niACS5W467m3+48hlQjj5Zk=; b=ihLOIMfQiW1QdsZdvneDbp3HEa QxkEgpVREFArvjjq7XXPIrtNWSwqNgBkoc0aZxD8PxhNXYmVf7TapZdjLBuvTn4ciPcQLeOyfZVOr lIHft0DX7H0y6/PvR7fsNpDzVwjiPamu4k8mOZoQzozSgpIW0BpRdQJNiOWuCrQ5mX/3Zrdngw0F5 ekOtbwa+E78dTGPc0P6VeK4YtELFRpYaZjRBE2r5c2U9c/QmmOjepioROSBB1/UUYpNLpq2+0l6J+ 8AsZ68G/vTN2VrZTWuppGWyP51WTLvxqoMlGmEXN5tYF90fmiaOBgbYPnAvqy7dIkwXBgR2fBnO75 MXIbRzG9EcIhlqdlGriMp0E8c1j5Z6a9x5IDmoAqRqj/6IOMnvToT7rM5LSbm+IHzY/XqbEt+Kicd 6sqBOkTvC/OuRwZ0zlqvkUJfW2RhEjdmhM236mWbRxH1L00zaEbbjuEpsiztmzcV5h5vi6Km/D7L9 wGfyd+OHTP68Eh+IUY5zQlZmfqcofFPGAUEa9RSUFSAmlhMXFIRLlFaXiKGg5DVFkKDf1ekls4nEV Fl8jb2nW0qB87KKJRsm6I7AXXvCWwacodphrdkjhCwncdhN4K7DIIT5bSu5i0uvkfndQtVRUYVkIA M7zjpD2N5qdjJwK9AvCtnd9BhKLrk5j11ufQkdur0=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz3-0002tZ-S0; Wed, 29 Jun 2022 13:39:54 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:00 +0100 Message-Id: <20220629124026.1077021-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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() and then remove it. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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) } /* PS/2 Keyboard/Mouse */ - dev = DEVICE(lasips2_initfn(qdev_get_gpio_in(lasi_dev, - LASI_IRQ_PS2KBD_HPA))); + dev = 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); } -LASIPS2State *lasips2_initfn(qemu_irq irq) -{ - DeviceState *dev; - - dev = 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 = 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) -LASIPS2State *lasips2_initfn(qemu_irq irq); - #endif /* HW_INPUT_LASIPS2_H */ From patchwork Wed Jun 29 12:40:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=HRab6Z9Q; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1ps6mG8z9sFx for ; Wed, 29 Jun 2022 23:03:01 +1000 (AEST) Received: from localhost ([::1]:33258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XLP-0005W8-9I for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:02:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0h-0008G1-IQ; Wed, 29 Jun 2022 08:41:35 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0f-0004h9-VF; Wed, 29 Jun 2022 08:41:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UnDgBCQ1nazf6CWSvGa/E4M/V4s1Kwdeqy2ihWnMyQY=; b=HRab6Z9Q0TFuDBK6glc6OdxHNz YASlTxFnasw7piOSwjE1B6eZo2WlEkAVs0EU87ucv2PRNwEpMuoU/8/CcB4xUlCRMeKuxM4zz1cCh oZkc/w/p2LTZ4DyQ+lA+NczIfns4O7859aBGSaXMqJYeJiQi4Hr7frTGUCRgFf8jKjyrlGpucXR8x 7yLWJ0Gb2y3djXdYwyIN7J8k0omOdDp3vMeRc0RE8dmmiAGaLiXVoo2Yig7mEpHNJ+d4Moi7H8rC5 mo86ugH/0bjDh5eLb8Wn7edc2KlKV6LZ1le8037d4YXJYBm6q4d7vuvctUlFibgoQX+L0GtrO18Md LfsEvyVMAcZlWngIH/0cW7uCBhVXFccGfCcagXIijajvBTuCphsjQetPYBCqx+7TPD5/LqEgtR2dF CAyr5CzQO/csXsTePT/TOfZhPfrqtOgnSIW1IuC/y6RUgw3+LZ43rc6HkgtZiqBMgWl15wYs1VjUs r7FarD9AUACEu4ss7NiphXroImMx9eb8M9plM89ddPLs6LJ2XTnfuXQ8GWhW1+i5Xm/5hXanz0V+7 WEUjYxl5hFvpU8bQVi3aAHBikM0vZSeIZqPNGVyGw/Wpd50NVUYnV2Dwa3OKmVa/TwWKPkx9mEk+7 j/P/GFgoYrIoGY2ZuLnHo/JWN5ZUhQcjrG7cdzq5s=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz4-0002tZ-GJ; Wed, 29 Jun 2022 13:39:54 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:01 +0100 Message-Id: <20220629124026.1077021-16-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 emphasise this type change. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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, } 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; @@ -181,7 +181,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) break; } - ret = ps2_read_data(port->dev); + ret = ps2_read_data(port->ps2dev); break; case REG_PS2_CONTROL: @@ -206,7 +206,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) ret |= LASIPS2_STATUS_RBNE; } } else { - if (!ps2_queue_empty(port->dev)) { + if (!ps2_queue_empty(port->ps2dev)) { ret |= LASIPS2_STATUS_RBNE; } } @@ -259,12 +259,12 @@ static void lasips2_realize(DeviceState *dev, Error **errp) { LASIPS2State *s = LASIPS2(dev); - s->kbd.dev = ps2_kbd_init(); - qdev_connect_gpio_out(DEVICE(s->kbd.dev), PS2_DEVICE_IRQ, + s->kbd.ps2dev = 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 = ps2_mouse_init(); - qdev_connect_gpio_out(DEVICE(s->mouse.dev), PS2_DEVICE_IRQ, + s->mouse.ps2dev = 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 @@ #include "exec/hwaddr.h" #include "hw/sysbus.h" +#include "hw/input/ps2.h" struct LASIPS2State; typedef struct LASIPS2Port { struct LASIPS2State *parent; MemoryRegion reg; - void *dev; + PS2State *ps2dev; uint8_t id; uint8_t control; uint8_t buf; From patchwork Wed Jun 29 12:40:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650065 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=iDl8nyxF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY29J0DrSz9sFx for ; Wed, 29 Jun 2022 23:19:00 +1000 (AEST) Received: from localhost ([::1]:60758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Xar-0008JO-Qx for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:18:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0m-0008MP-Cm; Wed, 29 Jun 2022 08:41:40 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0j-0004i8-NC; Wed, 29 Jun 2022 08:41:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oVPfguTLJfmrthQIahrPikO0rmnSU5aHhqAHxxh2LYk=; b=iDl8nyxFkiGkXpzj5LbsRcSR9Y cXVOLKHpLomyw2F0rcET0Zx8oQzUW/o0Xr/h2h6PO1Iz90yzfdWsmF1qEQ98uxoT0mICMrujmRPSX x6faFYu3hv1qHlqqWh9XjUC6WG5Ho42/Z/8G7plquzj6l57lUkzFbK7hHKpGrcnX5Bwf81yrVbNfm IhLefyuwR+sKFnhmiEO6k/RtsCTXvTQD8Gk3+MYmynnp0T0mZ48dh9/RLUUGN7l+la48X6LcLQ27J ZldoWs1oC3f30lsMkjtUnD+L+H5cLdd3xg6VUvpyuvhTO3yJpWkY/9w0dKq5aA3pCj5kpQ50QNkIi dcwA/UsW/+B6qlUoPIlhuFvm0ADJpCxbKF3Cg9H4CI9L8djTVgciC/662c9wVIk2tTCuBlTHzY/Rp zORNQlEtusWh3WN5tXokzb+8qWGV6Vt4UtZPj6wtigkFV5dWbotIvAtRv4p79XKqBYzqc47qE+GVI ijaUop1K3olzwybESrXL+UPIrqdXwPYHurReMJs29wC4oZREXD3/+lPhj+pu7ELcokRdL6RYXpBP/ wlCTsWoW8Yr3DuZLk+75TBsq0dR9pPRZv7g3DZ2II4FPNL3vNjJPRzrP4hWMFNyF01MtodeIfeFnT sKrtJI8qrl983B3mAyXO9YDrp/mIUOHOm9u6HZC/A=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz5-0002tZ-1o; Wed, 29 Jun 2022 13:39:59 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:02 +0100 Message-Id: <20220629124026.1077021-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { .class_init = lasips2_class_init, }; +static const TypeInfo lasips2_port_info = { + .name = TYPE_LASIPS2_PORT, + .parent = TYPE_DEVICE, + .instance_size = sizeof(LASIPS2Port), + .abstract = true, +}; + static void lasips2_register_types(void) { type_register_static(&lasips2_info); + type_register_static(&lasips2_port_info); } 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" -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; +}; struct LASIPS2State { SysBusDevice parent_obj; From patchwork Wed Jun 29 12:40:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=hIaLW4RX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY26W5Qcsz9sFx for ; Wed, 29 Jun 2022 23:16:35 +1000 (AEST) Received: from localhost ([::1]:56066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XYX-0004wm-1N for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:16:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0m-0008MQ-Cy; Wed, 29 Jun 2022 08:41:40 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0j-0004iA-NM; Wed, 29 Jun 2022 08:41:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DoNOeL8PBXDleC4tnUHr2YHr4mUwvSyUZJ6zT0cVGLk=; b=hIaLW4RXAkAuu/0biEfih/S6M0 /4BhjAo0uIJKlqd3o+CuoqzpF87YL1LJPtRo+7c4AzxwFyrZLtsehQAa2hhF8RLJGFjIBBaAuI2PG kBFjBG17wfN45VgO7jr2zYP06RDwstoCuIE8ZCOQlpRnlgDC7vZinJOHLpAR/JeKMsi7dVxYSLeOu hdB/cQLar+A3Nwj733foWkxRbqPzneFaLUthAallJ7psP532/JLXJ/lTX8REz+BnYoNYhAfo+xYMk eS+TOYCqAr9R7rPNLlGp5wyMcDP5cthG+AFx6Ukw1itV906wRgPsjyxBCzujydt9+jFbrr0WYfN0+ u1NHyIyqgv1u/sPwX9RlJaqlN3EN44mOST5OGA4HAPMJRftGADCwNAxeaS4qdyQMpek7Vx7nipj2n HIl5P48su0G/Zx8v0a/5hCpmxZywQSPJ/haL8Tk35+k2JiwqAadThiXhGgg9BO/yQoTqmEUXaD15J 1OrCRyqEP24POR+d0xFgo+87US261DYcxdQ3UKA9RCPMh+KhvTbbqt36Y+2wySVunT1cPp+szT2It /uUG9n+AHt49RNzsRst0y4y0F8MjYZO87XruU40mL1f7vhgQRWUQB7gppjLzUPC2xdLZmC7cvkm96 xfd2UIKrd4G5q4ogmDvmzAkDg5utQ96Picx4xMQEE=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz9-0002tZ-E3; Wed, 29 Jun 2022 13:39:59 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:03 +0100 Message-Id: <20220629124026.1077021-18-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This will be soon be used to hold the underlying PS2_KBD_DEVICE object. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { .abstract = true, }; +static const TypeInfo lasips2_kbd_port_info = { + .name = TYPE_LASIPS2_KBD_PORT, + .parent = TYPE_LASIPS2_PORT, + .instance_size = 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); } 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; }; +#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; From patchwork Wed Jun 29 12:40:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650042 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=NqayM4Uo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1gQ5c8pz9s5V for ; Wed, 29 Jun 2022 22:56:34 +1000 (AEST) Received: from localhost ([::1]:53516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XFA-0008Bd-GK for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 08:56:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0r-0008Pr-EY; Wed, 29 Jun 2022 08:41:46 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0o-0004iO-T7; Wed, 29 Jun 2022 08:41:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nowFY51tVcYxldI0p/96EqP0og+7QjCadnxYo+SBE00=; b=NqayM4UoHcuLtUH8S2+dpuZYe1 Vs0XJLAalSTXy2mARly0a6LXc5B+coEDUoNUTOLWE4HgkuwWw3XSmO9rWWW4nrEPMiOA42+3ni/Gp TkqvcfocAhZgCnhpLH/xEzu3NEkoNhkPULXpdYv9OSqlMaDa1Z7qvxfSWomoJ3MxvweiZnF0FoeZ6 I8EGTRjVa+vbhbZuIi+S9hFBG/KN/DmcQ4pxR9J7goskgA2ckU0c17YueKzyzOJiVxtInYWXxmrq3 O3t8/w6g2toNGQoXnnwfw+ZtePCqq+aZnVniTDj7/5Aeg7dQkduGj9URhGZEt13k2VLoluhXsVIvA O3x2SsdkQmZaSvsdzSsxP5jbGAZ8t7r8c5e6ZkmCaAW95WFxBsOFjfYLIn8P3VdLKTfvE/XMHQI7l XjeHazVumsVhzchQh5vSDP65Kpo06ydrEcCfWpgwkMZ2ISFfkPgii5J1decQNknvBSLOHg6qasgJe XV8IEPveXYl8xd9u1QAKC4YEI9nzFKHtq5KkHcyHhPyKmcympustscA03Ew16Xx+GlhXuEs3shS8V zZxtHwAMtiH8aB9dUjB6++xW77etDnVfxoAODvpUjXSSP9zGX8D4rwjMvjps1ESHtFAsxADQAlN6S aIiw33kP+JfHwufS/se5MdUMUniqFJLfqnapae0mU=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wz9-0002tZ-SO; Wed, 29 Jun 2022 13:40:04 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:04 +0100 Message-Id: <20220629124026.1077021-19-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This will be soon be used to hold the underlying PS2_MOUSE_DEVICE object. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { .instance_size = sizeof(LASIPS2KbdPort), }; +static const TypeInfo lasips2_mouse_port_info = { + .name = TYPE_LASIPS2_MOUSE_PORT, + .parent = TYPE_LASIPS2_PORT, + .instance_size = 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); } 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; }; +#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; From patchwork Wed Jun 29 12:40:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=od9s2kvf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1qM6c4Mz9sFx for ; Wed, 29 Jun 2022 23:03:27 +1000 (AEST) Received: from localhost ([::1]:33756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XLp-0005qo-No for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:03:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0y-0008UA-Jw; Wed, 29 Jun 2022 08:41:53 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0s-0004iq-Te; Wed, 29 Jun 2022 08:41:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k6ixRlhRQBrdejO76MPeuD87rJK/SJ8x4SSvtVymr1I=; b=od9s2kvfXeqgnnELs7ZujeMxth XB3RKT/iCdOwBYH7ZMsiJ+j2Vnd5sWdZ/JPJsv7CBA9+U71v4MIvRW2V1dFiude2sRuC8UoBSSkHL 1re0RutwYjcAbwddnwXFJEaJmYaqX8ejHftrC9nTVpAtpexZ1lKmdcXSFQQjW1J1FhTXrUBhNbv0A 5jjn3tj/lTLJzRlSCzAU1cPsmKiEtp93t/yklQPnwWCe6myhXPe+mn3x5HS1WT09tY1cb4rIK5SKM xyEEugSHNsLi2pFI2E2aGno5lkYt5Mqxs36R6GRoSEvTK719ik8CfSjpNp924bM3ANSL9Fv5Itn4K 8vsqozRE5qzZ5h6XE1H4/9TmJGRnLBLkh6T4/TqSYVVFLFKjXmHYd9EiAkcVpgOcSmFIlAuTtRO0c aNGrnJgtwfeQrZFXqc8xldyjF2+DK8al5yvikFtydmC41PYNzsPuUi66A+Ep5glXVRb4z7xvydoMo I+97T7HMiTYZIw8nIz0jbanMxm9ix8GbkKi/nR0y47V/RYqo3SdImnHaaPc7jZCoSAiFZ+qpXJHR+ DZQS2CODYbBktj0hZF3o94rCEFa7trNadE1fUYI9Vhkf/sGbHfmo0SbnNYemOoBWW/6dkdDn2m9hp nwz1BShfsiZn1KstI3JticuDGOJ3GqJ4lgjQdf2l0=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6WzE-0002tZ-8s; Wed, 29 Jun 2022 13:40:08 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:05 +0100 Message-Id: <20220629124026.1077021-20-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 object and ensure that it is realised in lasips2_realize(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { .version_id = 0, .minimum_version_id = 0, .fields = (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) 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); } 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 addr, unsigned size) } } - if (port->parent->kbd.irq || port->parent->mouse.irq) { + if (port->parent->kbd_port.parent_obj.irq || port->parent->mouse.irq) { ret |= LASIPS2_STATUS_CMPINTR; } break; @@ -240,7 +240,7 @@ static const MemoryRegionOps lasips2_reg_ops = { static void lasips2_set_kbd_irq(void *opaque, int n, int level) { LASIPS2State *s = LASIPS2(opaque); - LASIPS2Port *port = &s->kbd; + LASIPS2Port *port = LASIPS2_PORT(&s->kbd_port); port->irq = 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 = LASIPS2(dev); + LASIPS2Port *lp; - s->kbd.ps2dev = ps2_kbd_init(); - qdev_connect_gpio_out(DEVICE(s->kbd.ps2dev), PS2_DEVICE_IRQ, + lp = LASIPS2_PORT(&s->kbd_port); + if (!(qdev_realize(DEVICE(lp), NULL, errp))) { + return; + } + + lp->ps2dev = 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 = ps2_mouse_init(); @@ -272,18 +278,19 @@ static void lasips2_realize(DeviceState *dev, Error **errp) static void lasips2_init(Object *obj) { LASIPS2State *s = LASIPS2(obj); + LASIPS2Port *lp; + + object_initialize_child(obj, "lasips2-kbd-port", &s->kbd_port, + TYPE_LASIPS2_KBD_PORT); - s->kbd.id = 0; s->mouse.id = 1; - s->kbd.parent = s; s->mouse.parent = s; - 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); - sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->kbd.reg); + lp = LASIPS2_PORT(&s->kbd_port); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &lp->reg); sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mouse.reg); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); @@ -318,10 +325,22 @@ static const TypeInfo lasips2_port_info = { .abstract = true, }; +static void lasips2_kbd_port_init(Object *obj) +{ + LASIPS2KbdPort *s = LASIPS2_KBD_PORT(obj); + LASIPS2Port *lp = LASIPS2_PORT(obj); + + memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-kbd", + 0x100); + lp->id = 0; + lp->parent = container_of(s, LASIPS2State, kbd_port); +} + static const TypeInfo lasips2_kbd_port_info = { .name = TYPE_LASIPS2_KBD_PORT, .parent = TYPE_LASIPS2_PORT, .instance_size = sizeof(LASIPS2KbdPort), + .instance_init = lasips2_kbd_port_init, }; static const TypeInfo lasips2_mouse_port_info = { 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; - LASIPS2Port kbd; + LASIPS2KbdPort kbd_port; LASIPS2Port mouse; qemu_irq irq; }; From patchwork Wed Jun 29 12:40:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=GGXj7kFP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1wR4Thrz9sFx for ; Wed, 29 Jun 2022 23:07:50 +1000 (AEST) Received: from localhost ([::1]:41760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XQ2-0003bG-Rs for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:07:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0z-0008UB-5X; Wed, 29 Jun 2022 08:41:53 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X0w-0004jI-3L; Wed, 29 Jun 2022 08:41:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XRSrVNbr0bXug1YpgT+KZAeTK2KQK5chXp/YKa2feyg=; b=GGXj7kFP/YDWM9SBMhxSb++JM6 DjFXtE50K5YWyvPFDWRwUF0PIBts3KmoGv8lcrTmpP95iD0CNjEFPX84zBX6xa2mAORhgGttJ+egv F/RUGM3pdcip5XvKRkT706vB230aOSdRkZjjwyHUflsUpDPwHDJ0IiXGBCV4050G2AwNGli27LE20 oT/DRwjgSm25kPGEIzzNxGi5FuldlYujIrMD7F79ht0tYnGa2Fb+/bEi4XhvxgKsKXt28i4jPwSDS 2skHgUNdmTa55zZ4fjlYPPLgaCOr3qZj23Ox4U6fpmTF5epbvqaQZVSYWO5FzrHqbMcQE/tCHN4Kx zvHsrJWU+HfuUko9sJKq2MHr3KeA1TCng7tSN7hfzWhLXuvbRFW1V5z1tdplj7CV2rs3TuKmwRHKT zsNVOw8c52LSifo+ZpuMsVMYdIJra6STC0mLtMDZrgHOzuSprbqDpBp2OfkxIq0zzQPl4HtF7YZVL Pv2QRkxkDEeZpGOf6Cj6hpItCphiyf1XRc9QUqnh6RAVbnAAFVbMs5+C+s0Xv3e/ubJUk1DqrjZv7 hGJtn1G4lxqeeREK8xStnbnf0jG1fRp+G3oHlIi3rX93oVHtdk4iXZCResTGnNBxqx6/N3HcTi3AB pMX13XAarBF0cuUSnh5N4R5FuCmoqIQ3Ena2MLdp4=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6WzI-0002tZ-LV; Wed, 29 Jun 2022 13:40:12 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:06 +0100 Message-Id: <20220629124026.1077021-21-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 object and ensure that it is realised in lasips2_realize(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { 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 addr) 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); } 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 addr, unsigned size) } } - if (port->parent->kbd_port.parent_obj.irq || port->parent->mouse.irq) { - ret |= LASIPS2_STATUS_CMPINTR; + if (port->parent->kbd_port.parent_obj.irq || + port->parent->mouse_port.parent_obj.irq) { + ret |= LASIPS2_STATUS_CMPINTR; } break; @@ -249,7 +252,7 @@ static void lasips2_set_kbd_irq(void *opaque, int n, int level) static void lasips2_set_mouse_irq(void *opaque, int n, int level) { LASIPS2State *s = LASIPS2(opaque); - LASIPS2Port *port = &s->mouse; + LASIPS2Port *port = LASIPS2_PORT(&s->mouse_port); port->irq = 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 = ps2_mouse_init(); - qdev_connect_gpio_out(DEVICE(s->mouse.ps2dev), PS2_DEVICE_IRQ, + + lp = LASIPS2_PORT(&s->mouse_port); + if (!(qdev_realize(DEVICE(lp), NULL, errp))) { + return; + } + + lp->ps2dev = 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) object_initialize_child(obj, "lasips2-kbd-port", &s->kbd_port, TYPE_LASIPS2_KBD_PORT); - - s->mouse.id = 1; - s->mouse.parent = 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); lp = 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 = LASIPS2_PORT(&s->mouse_port); + sysbus_init_mmio(SYS_BUS_DEVICE(obj), &lp->reg); sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); @@ -343,10 +349,22 @@ static const TypeInfo lasips2_kbd_port_info = { .instance_init = lasips2_kbd_port_init, }; +static void lasips2_mouse_port_init(Object *obj) +{ + LASIPS2MousePort *s = LASIPS2_MOUSE_PORT(obj); + LASIPS2Port *lp = LASIPS2_PORT(obj); + + memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-mouse", + 0x100); + lp->id = 1; + lp->parent = container_of(s, LASIPS2State, mouse_port); +} + static const TypeInfo lasips2_mouse_port_info = { .name = TYPE_LASIPS2_MOUSE_PORT, .parent = TYPE_LASIPS2_PORT, .instance_size = sizeof(LASIPS2MousePort), + .instance_init = lasips2_mouse_port_init, }; 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; LASIPS2KbdPort kbd_port; - LASIPS2Port mouse; + LASIPS2MousePort mouse_port; qemu_irq irq; }; From patchwork Wed Jun 29 12:40:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=X/uscyMC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY22J1Gfwz9sFx for ; Wed, 29 Jun 2022 23:12:54 +1000 (AEST) Received: from localhost ([::1]:50546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XUx-000141-HT for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:12:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X13-0000A1-JN; Wed, 29 Jun 2022 08:41:57 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X11-0004jl-Vy; Wed, 29 Jun 2022 08:41:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pXChNeiqlOgeRrdBdv3SwZYw1TaXTqA7Klk5m97k/gE=; b=X/uscyMCibT8HGOIEulPLhcPVi I9HxpNfnA5howu6Dqx29mYPagcDsOV6lvtMxkuJ/cx2WOspmbvcb+kvQF5t/cvzvzjGHpUd1YXIzQ 8/cWGD+xgd4zb4xBpZ7MxCEPNdHuggQ4YwBB+gRi/I77tH6jhPs7yoQyU/8wSz7cKztIucP0Fd7S9 fWshzWavEOLYPjwbcIqyVI6kMFOVW0Tc9L+bv6VT0TsuO4ekHTVaFTRtEaEKV+DorRLF2V7/d1UFM oEbmJhkK3FpFLqGeij6H0KLmq8SKSIKoF3KpdBYGyC33kF/fHeUIUVrQbP1qNAH445TlNF2KArObY uEkf9oLBspEZ6BE5lASTYUznc4yCkrT6tGpUKgbwgovpyZ+q73X+Dg31HbX+KmSACczS9eDgtbuLq GSOplpPc7NVStMOlOH/ykp6R0uD0PzfuX+WOk5eSN4FAylwRifB1KH/ew+5AoOLY9qPwCtz8mE3gR JTxDDsY9/Xxiu5O84nHW6yWX/L5MZMQNLI0iUEo4RpS5LPtpY9MBzyD4pVSwMnpAFH1TbC7erEC4H H/HI56OnOFuzBHXWheISviNut9sweBC2kTs3uqCb961l34u5AfoTgijgPinPJUqrP4FPdQwoj13+I 5Nq70z7QASRMiTRUUWgUfaoXnX6u8m5b9KONcP/aI=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6WzM-0002tZ-MY; Wed, 29 Jun 2022 13:40:16 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:07 +0100 Message-Id: <20220629124026.1077021-22-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 **errp) return; } - lp->ps2dev = 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 = { .abstract = true, }; +static void lasips2_kbd_port_realize(DeviceState *dev, Error **errp) +{ + LASIPS2Port *lp = LASIPS2_PORT(dev); + + lp->ps2dev = ps2_kbd_init(); +} + static void lasips2_kbd_port_init(Object *obj) { LASIPS2KbdPort *s = LASIPS2_KBD_PORT(obj); @@ -342,11 +348,19 @@ static void lasips2_kbd_port_init(Object *obj) lp->parent = container_of(s, LASIPS2State, kbd_port); } +static void lasips2_kbd_port_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = lasips2_kbd_port_realize; +} + static const TypeInfo lasips2_kbd_port_info = { .name = TYPE_LASIPS2_KBD_PORT, .parent = TYPE_LASIPS2_PORT, .instance_size = sizeof(LASIPS2KbdPort), .instance_init = lasips2_kbd_port_init, + .class_init = lasips2_kbd_port_class_init, }; static void lasips2_mouse_port_init(Object *obj) From patchwork Wed Jun 29 12:40:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=ThvUZTUk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2Hp5M24z9sGJ for ; Wed, 29 Jun 2022 23:24:38 +1000 (AEST) Received: from localhost ([::1]:42382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XgK-0006oZ-Dy for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:24:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1A-0000Qv-An; Wed, 29 Jun 2022 08:42:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X18-0004kc-KG; Wed, 29 Jun 2022 08:42:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VbEztOvZKnUh4SGBoT9UTzIiDKN7bLNMRRsKDrU5JdM=; b=ThvUZTUkq0/QYGdfGNzDjcKztH 1bvBsARzHOhs+A5kjhJ46F+eV103DowyZv8qb3Dccfmn7EJDrlKbZNSdn2Jve929eQ3aEXesjYdN3 xLTfgbF7jT7rfl7X+C9zAdI4d57lGK9zhmS3I1UUFxO/tDoPclAJoN4Qkmm7/SXbgZ9LcSWDj3S5m znpPlWCM2RvPDHDkO0bpg+59Uo1GLtD4w03o7QpiZmYRfE7mCBY6tjgcTU63fsuolKUA4n3Tr5Ioa RNEnnQL6zHCgpouZ2gkoLNfQVCbS8RnOx+ogUevBlpe3qn+LtgWJsJ1lCbvDSWTX193eBiELlMP/Y zLnhzgeP1sbc1PKJRRCcKNo47xG5LgFqn4Fw7oJibToZrBthKPh8Ag7EqtX+YZFAWnbXrIHDMX6vf wmjYc7sjMacefbsNcoxbB58Tj79DiWcfVQWPLyYka+Am9iDaXfB4y5NuByX8C0eOlghwYD+aIxuus 2uc02nUGugvoEkYHPFLH+9yGOaKSE+VTxK+tcbCn0x9y3xk0D4Hy7MJ+0ta0unpNZJmJWoqILbmAF 86GR6oFbcxuFHtajfYPFuQuFI1iQbOPlhqbxl5GpN9AD1lMXLYdjOwrxvQmoLrVyVlVn7+jQMdijs 7Y3LYsvE99YL2Qr8u+C393827VuuLDYe0LbR6wbpE=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6WzR-0002tZ-1b; Wed, 29 Jun 2022 13:40:21 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:08 +0100 Message-Id: <20220629124026.1077021-23-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 **errp) return; } - lp->ps2dev = 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 = { .class_init = lasips2_kbd_port_class_init, }; +static void lasips2_mouse_port_realize(DeviceState *dev, Error **errp) +{ + LASIPS2Port *lp = LASIPS2_PORT(dev); + + lp->ps2dev = ps2_mouse_init(); +} + static void lasips2_mouse_port_init(Object *obj) { LASIPS2MousePort *s = LASIPS2_MOUSE_PORT(obj); @@ -374,11 +380,19 @@ static void lasips2_mouse_port_init(Object *obj) lp->parent = container_of(s, LASIPS2State, mouse_port); } +static void lasips2_mouse_port_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = lasips2_mouse_port_realize; +} + static const TypeInfo lasips2_mouse_port_info = { .name = TYPE_LASIPS2_MOUSE_PORT, .parent = TYPE_LASIPS2_PORT, .instance_size = sizeof(LASIPS2MousePort), .instance_init = lasips2_mouse_port_init, + .class_init = lasips2_mouse_port_class_init, }; static void lasips2_register_types(void) From patchwork Wed Jun 29 12:40:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=0bqZz9BV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY1wx6PQfz9sFx for ; Wed, 29 Jun 2022 23:08:17 +1000 (AEST) Received: from localhost ([::1]:42504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XQT-00047B-H2 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:08:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1A-0000R0-Cj; Wed, 29 Jun 2022 08:42:04 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X18-0004kf-K5; Wed, 29 Jun 2022 08:42:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8RqL9lVvM9npMy7dBGL61TkGeCT5O1k5zHiN5ztDO/0=; b=0bqZz9BVfujb2/c1ZJ3hW0M10D SJFZqwkFcL8P/v8gIR0pBzDRABMpYXBiC/s4z8+3nB/i5BvzOGut7ZUb40etZdZNwz83EiAUhTAVk 2C4vQ1dEDY58mZL2lXmqDWpsavbezd2IwxBoBw7rABZxberi5S66NW4NmPNw7xFSMOoEQWnKVmmIq NQjg317qdRPyO+wnvAl5/eWd77kJsI5fv21rBIuIShTPf6eQyWUiegcypOmnAjoNbIBq07AmIGQSZ b2V1oR5bLwYkyyNgB63Ozaje2udIToGidoKv0BQkFHfdTVBWp1u9jjgH8L+GmhTxdl6t0nxMYIbpI UsSIIWgG80Uhcy0DweE2IqzDihKtL3lOElsaz6i14nKVqPmec0ksF+TyDQytma1MWSB0zECp41Fuv awK89Jqa5e+bzt2VsEsaNr4Xz0zzjACYhpvNb8cYonbdQ8p+ir/tnss/Fcg+vC2AQ1t/wlqQcD54b ZAL7xbxkjd5IBja4XIHATrabwZmG1GRsZfUz8necHC2dT32dyoNaNF/6ZFOp/uqxarnrTw4pp/Nhy ybjwNnV0c7cZu3tbuhZ7L2uA3VrG/K6estEhEJLeXrYlmyUa2uKahn8gp3eetN4McGSH9zvDDtwsF YH1AK5fJgprlCC9L1YG2+dvEMg/j/DyoeBWQAoiss=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6WzV-0002tZ-DU; Wed, 29 Jun 2022 13:40:25 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:09 +0100 Message-Id: <20220629124026.1077021-24-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The existing boolean irq field in LASIPS2Port will soon be replaced by a proper 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 Reviewed-by: Peter Maydell --- 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 = { .fields = (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 addr) 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); } 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 = val; - port->irq = true; + port->birq = true; port->loopback_rbne = true; lasips2_update_irq(port->parent); break; @@ -176,7 +176,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) case REG_PS2_RCVDATA: if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->irq = false; + port->birq = false; port->loopback_rbne = false; lasips2_update_irq(port->parent); ret = port->buf; @@ -213,8 +213,8 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) } } - 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 |= LASIPS2_STATUS_CMPINTR; } break; @@ -245,7 +245,7 @@ static void lasips2_set_kbd_irq(void *opaque, int n, int level) LASIPS2State *s = LASIPS2(opaque); LASIPS2Port *port = LASIPS2_PORT(&s->kbd_port); - port->irq = level; + port->birq = level; lasips2_update_irq(port->parent); } @@ -254,7 +254,7 @@ static void lasips2_set_mouse_irq(void *opaque, int n, int level) LASIPS2State *s = LASIPS2(opaque); LASIPS2Port *port = LASIPS2_PORT(&s->mouse_port); - port->irq = level; + port->birq = level; lasips2_update_irq(port->parent); } 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; }; #define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port" From patchwork Wed Jun 29 12:40:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650064 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=pxrK7wSe; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY28w3Q4Fz9sFx for ; Wed, 29 Jun 2022 23:18:39 +1000 (AEST) Received: from localhost ([::1]:59612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XaV-0007Xf-Bz for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:18:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1D-0000YD-DX; Wed, 29 Jun 2022 08:42:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1A-0004km-SO; Wed, 29 Jun 2022 08:42:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zeUe91RzqCtnUmAJKwgek5Z3Zbp3wlvpdy0+5F4vtKI=; b=pxrK7wSePh3XKRChvKSTRhvZdM +AlzyE1MYAZwG13Uoe/Sm0GlUbggfgGPagZQBJl28cmEARxExswTm0Np7KndrgFN6+PcsO+egjK5K eXITSDIdmgUgNB1av1QwYu01fYPUeoxWe2LPqdvROIbBouv9zfMLEzcdaZgLam20OVQXIh4yl8pSr l6MI5YIRg+dDjqQ+8uFd+KbiLlCVoZevw14uew8UyX7H2HEfonZBIi6cNc1lZ9KdG6T4ZxhEtBUQA qDh9y0QfYn+0/f5lmt55+e2yLbcQe2S2dM8ZGmGrl2xqdkttQWMZcUIJ1GUnFAs28R8J8nPr8ex7W 6iBxFYqnLUFjBUTNuVkY/VsjiSIR7eM6IVFDkwO0ou/q6oMlXBFQBB+LPiOcnq3wijX38tWEWLd7Q SGV0B2XJT8ir7T/frTwGuq4U+ZYwBGZDBxkndcWY6JqcoHQHz5GMuI5x8yWf1Lf55pL9f8QhdMFbm XS7R/58fpTnSo5Hp1YHWtnlQqcJMCY7sgKrbFZiAxA+mnnGXyGZRYSwTz+lF+XIzhoScjsNHgaAyY Tyb9VfZb5ZLilc/7X/HByCAi9SkpCdaJK0ZYWDAhweHMkwzWv3RHWF9PjmgUpMM1CKNjAvhmDOmHV RUZNw/4+E5hz4ecuy0+cHdB0fbaodVHOIvYQBVFmI=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6WzZ-0002tZ-RW; Wed, 29 Jun 2022 13:40:26 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:10 +0100 Message-Id: <20220629124026.1077021-25-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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_irq representing the gpio as a new irq field within LASIPS2Port. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { .class_init = lasips2_class_init, }; +static void lasips2_port_init(Object *obj) +{ + LASIPS2Port *s = LASIPS2_PORT(obj); + + qdev_init_gpio_out(DEVICE(obj), &s->irq, 1); +} + static const TypeInfo lasips2_port_info = { .name = TYPE_LASIPS2_PORT, .parent = TYPE_DEVICE, + .instance_init = lasips2_port_init, .instance_size = sizeof(LASIPS2Port), .abstract = 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; }; #define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port" From patchwork Wed Jun 29 12:40:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=IbHGybOu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2HJ5NvHz9sFx for ; Wed, 29 Jun 2022 23:24:11 +1000 (AEST) Received: from localhost ([::1]:41270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Xfq-00061W-Gj for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:24:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1D-0000Wh-0f; Wed, 29 Jun 2022 08:42:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1A-0004ku-Ga; Wed, 29 Jun 2022 08:42:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uo8Rl5ib5SBmy64726XOtXcKaieku521mK0ezQnJnfY=; b=IbHGybOu+wO7F5D9BhtLXtKRUW HhEdtuIhxhKji28R0aiZ14qNraK+EWREM80Cp6/x2h2iwCW3cKxWpvTEmNWGkdVL3LJTqQMtuXfb5 JfBiKpJZfjUdxK0CYaEQeOSErbGNVIeDhiWG/wB3e8uqM+W4Pw27Rb2DnqKdNYVoIAnk1ALCkXWBe 8PTqD5ebuemWVXd+8IdiRXZ/K50wJM7SXXzvP+Zr1nG6iTXvEcIgzrYmFazA6lov9wlRMCbj8klXv 0ymuUbQvUE0nUlUBod3tFXEBbg0C7qRE5TI70FvywWTw2+oyq4axjPfJDZEyEicQVP6qDwS+z7xkw R7IIGKJB/cRQoyc5ub63fPvdyFwibR1S2Dmy9IKVWT5sQuZOt5mWosqVXokXznmmtOJJWhwM+rrbK sZdg8+RP6Wjbume4uHVIL9xiHgqTb8qKTR6/Pgt47jaZrgtchmJO4cAoCoiGmPdacW1e3Df1HPSnm oWrZFBiq4n34zI9bcnWrWz3VeRlTHYOkyyEkb2cAO3ahhuNf5ZFWYIbeeZqowbs8Sndd/HefNrwTX bWmFLLlEVnnL4qjeb7oFJDQywG0WU1ZPp20403FBhf3Etjp+N9mfA/54JhZKO06FaojegUfR7QeMz 6iXVs5l2N6pvOFSj+fy/zypU3k99tE+msYN6ZzCvU=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wza-0002tZ-8M; Wed, 29 Jun 2022 13:40:26 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:11 +0100 Message-Id: <20220629124026.1077021-26-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This will soon be used to store the reference to the LASIPS2_PORT parent device for LASIPS2_KBD_PORT and LASIPS2_MOUSE_PORT. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = { .parent = TYPE_DEVICE, .instance_init = lasips2_port_init, .instance_size = sizeof(LASIPS2Port), + .class_init = lasips2_port_class_init, + .class_size = sizeof(LASIPS2PortDeviceClass), .abstract = true, }; 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" #define TYPE_LASIPS2_PORT "lasips2-port" -OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2Port, LASIPS2_PORT) +OBJECT_DECLARE_TYPE(LASIPS2Port, LASIPS2PortDeviceClass, LASIPS2_PORT) + +struct LASIPS2PortDeviceClass { + DeviceClass parent; +}; typedef struct LASIPS2State LASIPS2State; From patchwork Wed Jun 29 12:40:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=ap8NEtjM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2R40Vffz9sGJ for ; Wed, 29 Jun 2022 23:30:55 +1000 (AEST) Received: from localhost ([::1]:50606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XmO-0004XH-G2 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:30:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1E-0000ca-N3; Wed, 29 Jun 2022 08:42:08 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1D-0004lJ-1d; Wed, 29 Jun 2022 08:42:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bm0AmbIopbDzGsdRpV1cZL58cmfY4WmhYkgYFaqorhE=; b=ap8NEtjMWAv4ZJ/QxK8rSfRgiU lVv6T7fazgUiqQ9Iuti73lzNk85C5mKyvDtyA1hMl/+7M83RlRQBJlTxK/J/tH0Sb06tON+0eGcTS DrtwNPGZuCsispra5z74yJEqUypFIZ6p0ITp8UHg8uzQYwsCHC6E3h/klstpe6y+0cuv5mP2DqJrB WcE8W14PhHjHmrnSfWmIiyZBBajjQ9YQC9gLTjgPkWE6YTchzJbhfqCXzBVhUcOzeAZVgfHVrAqQv 9RmJE+OhiUlaGIC+XpJmom7rXfVdCSqO1RcbUHjvHP2YBDn7j3Q6lSnhqeaDvJwnj8t2Q7FYBPlu+ MKz9rX6XhB++lMlDvnmZ6iFcB6/oByWF6AjQcOkmJhEoHX/xw3eC78kunhK7mmJTPn0b/RvZdssTV XToKYNwuINuiA72x2sKjabljoXA6LpwLLwK1eoD/zUMplVS6ezTx2Lx6E784Y/Vn4KOLH8mUfzyaG m/nmOLwe22U6I4gw29R/UVnkwqdL5GDK2tDJ92mRsIw3mlM+7o/ZcHJTZBairwsztC48nOoOM4sV0 C6OerqlTmRKmoXuf9X8pYVmH2SbIqNU5l6jF3PcCPZ+1jvN8iN6raLAVTLgWOvR5sFLz1Sp0R8gdR GkgJUglbVdToLnDlYzpEhoeDoJCZSYcK33k8z9Z/k=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wza-0002tZ-Q5; Wed, 29 Jun 2022 13:40:27 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:12 +0100 Message-Id: <20220629124026.1077021-27-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { .class_init = lasips2_class_init, }; +static void lasips2_port_set_irq(void *opaque, int n, int level) +{ + LASIPS2Port *s = LASIPS2_PORT(opaque); + + qemu_set_irq(s->irq, level); +} + +static void lasips2_port_realize(DeviceState *dev, Error **errp) +{ + LASIPS2Port *s = 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 = LASIPS2_PORT(obj); 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 = DEVICE_CLASS(klass); + + dc->realize = lasips2_port_realize; } static const TypeInfo lasips2_port_info = { @@ -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 = DEVICE_CLASS(klass); + LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_CLASS(klass); - dc->realize = lasips2_kbd_port_realize; + device_class_set_parent_realize(dc, lasips2_kbd_port_realize, + &lpdc->parent_realize); } static const TypeInfo lasips2_kbd_port_info = { @@ -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 = DEVICE_CLASS(klass); + LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_CLASS(klass); - dc->realize = lasips2_mouse_port_realize; + device_class_set_parent_realize(dc, lasips2_mouse_port_realize, + &lpdc->parent_realize); } static const TypeInfo lasips2_mouse_port_info = { 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) struct LASIPS2PortDeviceClass { DeviceClass parent; + + DeviceRealize parent_realize; }; typedef struct LASIPS2State LASIPS2State; From patchwork Wed Jun 29 12:40:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=1wWkmLZc; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2Hp0wNpz9sFx for ; Wed, 29 Jun 2022 23:24:38 +1000 (AEST) Received: from localhost ([::1]:42266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XgJ-0006jy-Sj for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:24:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1G-0000fq-0e; Wed, 29 Jun 2022 08:42:10 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1E-0004lQ-FL; Wed, 29 Jun 2022 08:42:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0nmOnBynzw7DZuINWBYXE5I8ii2Adx8EQBfqD8pJrDM=; b=1wWkmLZcDuLuolA6BOlTC8kP3l zgbTLFgdX64ShQ7iyY7kkwgz42njL4q6BGok/iSE9Tn5CoWjR/541Y+yQe74LfCaCsKQ1dftU5lkb I9niU/6h9J8cCtD7oDMhBcGWaryyh9yKOekMDUngkJ+QjxGAIOUtrg3gc9q2dpL8+KCaDYya5jefW aGhlDtzNasa4Ky/XWBzvpglMXaLQqMFFqEC0k5yuLIkjKyJOKZBxrnrOIN3Z9ORh5SFEstkobl4q8 91YdlbasntRp3q67U8Rk1aJwVv2ANt5zy/SauMEep4YZ3Psok5c5T2QYbvX2BbI+WlcEa52ZreC7n Y0nVukihcYEeBqiaa0x8Cfn6j/QaN6dG/4EAlYxNZjd7on/4p7qhsl5tsLcCxvCC6gWBtRyejnIVc pQGqGn2bOtZ8HRdYxEZCxI3ms5fAiD0p5+JOp42kwy5DdVpbqj6oIJT6cAA+0IOhhJbrlt+IIz7eI itwcAj817d4tYBLnEgPXcL0g1c31wfJnlgm5YQc52gsi0oB23HEdhxD7th43Cn+AiaQsOspvjEY+4 H0OCaJ9u8jCm/TnMm5jzeVN22kgz77+vv788rKFH+LLe7Piu4XOZ/s0PTc+VTO6v2wbGKVAt8J31H Xb6rw88r+uHVgqrwm0OP8FKQKp1cO5kZWMgiR+0JQ=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzb-0002tZ-Ee; Wed, 29 Jun 2022 13:40:28 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:13 +0100 Message-Id: <20220629124026.1077021-28-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The LASIPS2 device named input gpio is soon to be connected to the port output IRQs. Add a new int_status field to LASIPS2State which is a bitmap representing the port input IRQ status. Signed-off-by: Mark Cave-Ayland --- 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); } +static void lasips2_set_irq(void *opaque, int n, int level) +{ + LASIPS2State *s = LASIPS2(opaque); + + if (level) { + s->int_status |= BIT(n); + } else { + s->int_status &= ~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); } 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 { LASIPS2KbdPort kbd_port; LASIPS2MousePort mouse_port; + uint8_t int_status; qemu_irq irq; }; From patchwork Wed Jun 29 12:40:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650073 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=JdO9OY4t; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2R372V1z9sFx for ; Wed, 29 Jun 2022 23:30:55 +1000 (AEST) Received: from localhost ([::1]:50594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XmN-0004Wv-Mo for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:30:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1G-0000dy-2t; Wed, 29 Jun 2022 08:42:10 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1D-0004lL-3X; Wed, 29 Jun 2022 08:42:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dMG5hdGAWVYBOw8CgNJ9+TA7NMbEsvdQMQzaAWj3YJA=; b=JdO9OY4t1VC9R7mTxK3w7lBzPR VFdGIDG1oqjYUFIRkj/WvDW6uYHXL7JLTCGsWIPlXtWitOHqAEjsu7TZe1kUWiK/+HPLP4P/lJGIF Bwie7yaWv43vONfgFoc6r7nHKst+f8lYwbbbWkKaWMWDh2HhYcsDca9RinrsxvaHq+YVXjmj8eAED 1aCvbvrUPW1m61kJs+aVlLwLHDZT5rX5wcd9ayQ1j0gLxlEyAv5exxhR7tsmmyGvzS3vfikME/vxX jgPVqXlD6vVHfAzgw1Qqs3on1y5PnLQf3z6derR5uhGXE727mKk0GQ/gLzzesP4mPCP/QB4mdN9aZ jVx+S/mhn09whsJYs8+M3u/CsmVVx5M2sAdrFBLsPzFCiithZ9uppNB36s08kAAJ0tkW4WL7xpe0g T2RRU2uuLQt1veESsxp5Z+I9qqOtjZKhE2htMmTFRkBQIJYXPGalfGBJ8NGZOtoINCFJJMfS5grlX pSQaV1NmaiEH633tJp/YMOeru+ZHQ6Q7rbJCvglM4r3/k3gCE+izNkiC6rzVzVA8H5nn0nydkrnJS FJKAgbJwTYsZvFEFc/5cJ6jJ09vt6uZrkxNPKaOS73SCMbJxMcUf8XfVzbFjiCub4pYqA+cEBou/a zemBJkZnZ1bxEFQdj6l3JNfBEHPX2upQQUl+Nd/E4=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzc-0002tZ-6m; Wed, 29 Jun 2022 13:40:28 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:14 +0100 Message-Id: <20220629124026.1077021-29-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 input 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_irq() can also be simplified accordingly. Signed-off-by: Mark Cave-Ayland --- 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 = { .fields = (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 addr) 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 = s->int_status ? 1 : 0; + + trace_lasips2_intr(level); + qemu_set_irq(s->irq, level); } 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 = val; - port->birq = true; port->loopback_rbne = true; - lasips2_update_irq(port->parent); + qemu_set_irq(port->irq, 1); break; } @@ -189,9 +186,8 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) case REG_PS2_RCVDATA: if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->birq = false; port->loopback_rbne = false; - lasips2_update_irq(port->parent); + qemu_set_irq(port->irq, 0); ret = port->buf; break; } @@ -226,9 +222,8 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) } } - if (port->parent->kbd_port.parent_obj.birq || - port->parent->mouse_port.parent_obj.birq) { - ret |= LASIPS2_STATUS_CMPINTR; + if (port->parent->int_status) { + ret |= LASIPS2_STATUS_CMPINTR; } break; @@ -253,24 +248,6 @@ static const MemoryRegionOps lasips2_reg_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void lasips2_set_kbd_irq(void *opaque, int n, int level) -{ - LASIPS2State *s = LASIPS2(opaque); - LASIPS2Port *port = LASIPS2_PORT(&s->kbd_port); - - port->birq = level; - lasips2_update_irq(port->parent); -} - -static void lasips2_set_mouse_irq(void *opaque, int n, int level) -{ - LASIPS2State *s = LASIPS2(opaque); - LASIPS2Port *port = LASIPS2_PORT(&s->mouse_port); - - port->birq = level; - lasips2_update_irq(port->parent); -} - static void lasips2_realize(DeviceState *dev, Error **errp) { LASIPS2State *s = LASIPS2(dev); @@ -281,18 +258,18 @@ static void lasips2_realize(DeviceState *dev, Error **errp) return; } - 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)); lp = LASIPS2_PORT(&s->mouse_port); if (!(qdev_realize(DEVICE(lp), NULL, errp))) { return; } - 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)); } static void lasips2_init(Object *obj) @@ -312,10 +289,6 @@ static void lasips2_init(Object *obj) sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); - 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 = { static void lasips2_kbd_port_realize(DeviceState *dev, Error **errp) { LASIPS2Port *lp = LASIPS2_PORT(dev); + LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_GET_CLASS(lp); lp->ps2dev = ps2_kbd_init(); + lpdc->parent_realize(dev, errp); } static void lasips2_kbd_port_init(Object *obj) @@ -416,8 +391,10 @@ static const TypeInfo lasips2_kbd_port_info = { static void lasips2_mouse_port_realize(DeviceState *dev, Error **errp) { LASIPS2Port *lp = LASIPS2_PORT(dev); + LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_GET_CLASS(lp); lp->ps2dev = ps2_mouse_init(); + lpdc->parent_realize(dev, errp); } 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 downstream + * LASIPS2Port has asserted its irq */ #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; }; From patchwork Wed Jun 29 12:40:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=og3SuMCZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY29h0XF0z9sFx for ; Wed, 29 Jun 2022 23:19:20 +1000 (AEST) Received: from localhost ([::1]:33812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XbB-0000lR-U1 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1K-0000sy-8q; Wed, 29 Jun 2022 08:42:14 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1I-0004mT-Lc; Wed, 29 Jun 2022 08:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=E3I/Oo3kUZprr5MYtmkxHjS3LLSNsTaxvoiNuHLK1k4=; b=og3SuMCZGN3I8UXNIm9XPnNQQ0 JXD7ShTk7eMY6ntXGHGzXWwB5xy1FbnHoZ+M1cWFOJ17mQ6Rnc0evT5AX37Fz66GSOGHBWUjGRHjo PdFHIxayKlIRh7PmAhxs7FrX+H9HziSvjpazlYaIMWXDUCuRGjLhTMb7JoyYGzByAynpY79bbbktx /pHyTQfZHurmaMUMKAHdFxdfG/ZxoMdKbLxBsgOXGhpRZWuFtA0kFshwveuU3YmiEftKtyiV3pT2u owFiny1nWKUt+bHMdT8p96grySmdRv6PNfT8iVUPy1qT1IK2FLdvJxDgNCgujDaOIzVv31nWTZnve Ho5mtNYOUw4Jye/ot/qg4wCsMj16L4NhW1reZp4mG+tHNrC7hp0GfDZKlr4WLCGnzhRjnxvZd1/0b bFnv20YaCI/Hg2UFFo6ImZ/WJzDA+o0djTMoHczV8Z3+EyBE9fuk1Mup/zeEpVEewcFKrUvbReXbI I0uYc0Z21S3KqCe9GGnwk8qIIpyMoQYUNRFWlX8yU/v5jG82rNjqQKu/QptlyL/PSjk89y1p+KDT0 Sni4fpMkGqNNRiUGZjyElauoDSf8PuYYh/hYKBLA/Y/fFbxeqJY6iUfI1hIWIAdnTsGi1p+UqVIwc bj5sLpZ1Ac5+cMdZmA7UloVgVj6LelOYQ83kzLPLo=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzd-0002tZ-2c; Wed, 29 Jun 2022 13:40:33 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:15 +0100 Message-Id: <20220629124026.1077021-30-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This makes it clearer that the pointer is a reference to the LASIPS2 container device rather than an implied part of the QOM hierarchy. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 addr, unsigned size) } } - if (port->parent->int_status) { + if (port->lasips2->int_status) { ret |= 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-kbd", 0x100); lp->id = 0; - lp->parent = container_of(s, LASIPS2State, kbd_port); + lp->lasips2 = container_of(s, LASIPS2State, kbd_port); } 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-mouse", 0x100); lp->id = 1; - lp->parent = container_of(s, LASIPS2State, mouse_port); + lp->lasips2 = container_of(s, LASIPS2State, mouse_port); } 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; - LASIPS2State *parent; + LASIPS2State *lasips2; MemoryRegion reg; PS2State *ps2dev; uint8_t id; From patchwork Wed Jun 29 12:40:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=xV9Lh45e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY24R17Vzz9sFx for ; Wed, 29 Jun 2022 23:14:47 +1000 (AEST) Received: from localhost ([::1]:53584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XWm-0003Fz-R0 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:14:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1J-0000qM-Hs; Wed, 29 Jun 2022 08:42:13 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1H-0004mM-Pv; Wed, 29 Jun 2022 08:42:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Xtix09oQTlnT+Xq/9q3ddElZiyHpC/mB0ICz/S1/1Fc=; b=xV9Lh45ecPNOU5m6Ycktf63XOM FsdJrZ49GrOSu9M4PFBTxx8j5FpIgtzOlBE2ky4uFmWinBA8yxYgfBB3eC3x1PUREG8ADhNy6kvyb t5uJ2H+LExNdbSPAwKSt72urzqzUiTH3cLlRjsVyc+mgXFdJQABeOTDFSXnBSLn9TrSTVt4ilkpQL VNdBvj8woZi5AhagUNNOeL2A/hHCIJ3XEqrAIN4ebuNn3x3svOyVGrmnHScdQSkPPwEizlS8a1uHJ 9Gk0UQIE5jpTe9HY4WvTtbZBzxUGdDo33wE2f/bXk6mDY0Ok31DEyRYZQWxNa6zUY8GXB5hZ7DhJO vMykzTyuxb19YRa+P/SSw+rXeskW6Zgk09ApRneEVHrwtuLboE1P2em4HlfSnyQsSmzB8F2jkpncd NjfZA3L2T16VVhlZbssSyzI6aB2+QMDRHfu1bTLrrBs0vOFFWYqTs9pANCqvb4KSXKdXsP+988kHT LSDTpH6RNN22TCVPR6K5WOF22M45P4tcBxbqEn3cfC+DD/6gAPc34x8Cwwi7j7+L8v/NFhjynwaK1 mTv6Hy956qryW5W1iDmJtgtlGn6LAIXnfxbav3pth5K2dEToU5cZq/E5RyZtWkyTkl88zFsfD/87m 1nN0BA+pWRYr0keIMS72KMiGCSit81yvJomEX/TLA=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzh-0002tZ-EG; Wed, 29 Jun 2022 13:40:33 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:16 +0100 Message-Id: <20220629124026.1077021-31-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This is shorter to type and keeps the naming convention consistent within the LASIPS2 device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 = opaque; + LASIPS2Port *lp = LASIPS2_PORT(opaque); - trace_lasips2_reg_write(size, port->id, addr, + trace_lasips2_reg_write(size, lp->id, addr, lasips2_write_reg_name(addr), val); switch (addr & 0xc) { case REG_PS2_CONTROL: - port->control = val; + lp->control = val; break; case REG_PS2_XMTDATA: - if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->buf = val; - port->loopback_rbne = true; - qemu_set_irq(port->irq, 1); + if (lp->control & LASIPS2_CONTROL_LOOPBACK) { + lp->buf = val; + lp->loopback_rbne = true; + qemu_set_irq(lp->irq, 1); break; } - 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; @@ -176,53 +176,53 @@ static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val, static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) { - LASIPS2Port *port = opaque; + LASIPS2Port *lp = LASIPS2_PORT(opaque); uint64_t ret = 0; switch (addr & 0xc) { case REG_PS2_ID: - ret = port->id; + ret = lp->id; break; case REG_PS2_RCVDATA: - if (port->control & LASIPS2_CONTROL_LOOPBACK) { - port->loopback_rbne = false; - qemu_set_irq(port->irq, 0); - ret = port->buf; + if (lp->control & LASIPS2_CONTROL_LOOPBACK) { + lp->loopback_rbne = false; + qemu_set_irq(lp->irq, 0); + ret = lp->buf; break; } - ret = ps2_read_data(port->ps2dev); + ret = ps2_read_data(lp->ps2dev); break; case REG_PS2_CONTROL: - ret = port->control; + ret = lp->control; break; case REG_PS2_STATUS: ret = LASIPS2_STATUS_DATSHD | LASIPS2_STATUS_CLKSHD; - 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 &= ~LASIPS2_STATUS_DATSHD; } - if (!(port->control & LASIPS2_CONTROL_CLKDIR)) { + if (!(lp->control & LASIPS2_CONTROL_CLKDIR)) { ret &= ~LASIPS2_STATUS_CLKSHD; } } - if (port->control & LASIPS2_CONTROL_LOOPBACK) { - if (port->loopback_rbne) { + if (lp->control & LASIPS2_CONTROL_LOOPBACK) { + if (lp->loopback_rbne) { ret |= LASIPS2_STATUS_RBNE; } } else { - if (!ps2_queue_empty(port->ps2dev)) { + if (!ps2_queue_empty(lp->ps2dev)) { ret |= LASIPS2_STATUS_RBNE; } } - if (port->lasips2->int_status) { + if (lp->lasips2->int_status) { ret |= LASIPS2_STATUS_CMPINTR; } break; @@ -233,7 +233,7 @@ static uint64_t lasips2_reg_read(void *opaque, hwaddr addr, unsigned size) break; } - trace_lasips2_reg_read(size, port->id, addr, + trace_lasips2_reg_read(size, lp->id, addr, lasips2_read_reg_name(addr), ret); return ret; } From patchwork Wed Jun 29 12:40:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650078 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=Sqab7QIP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2WK04h7z9sFk for ; Wed, 29 Jun 2022 23:34:36 +1000 (AEST) Received: from localhost ([::1]:54458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Xpy-0007PO-J4 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:34:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1O-00015c-6O; Wed, 29 Jun 2022 08:42:18 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1M-0004nK-Mx; Wed, 29 Jun 2022 08:42:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FktKrWeYblH+m2tmJ/Ud3sYKQg5y1+6oYN1pBqNHqPw=; b=Sqab7QIPrdIVLqHadRB9H5VmyB ApA1faKWYWcPDmBs08BHeg8gwSifYGJZGXhoQTVXiGZbTNoTpe7wu9c/rXfDOAyzXXz14pjaKNZXe xm5QrS5CkaZ0ofzxvRoyf/JRRQvrYIB1URmy1slxBmVERkQEOCmXDPl1lSeC9Vga+VXfcSLThSeRj OPa1Tfgw3yQNDc19/K4wbCWEis5vfzkV9gwi2pjhul+WEr+dzD0kcmx+fVd/Pe/zjPvvZzScRNdT6 QmLb4/5WvexmZ+FUpZJ7QKhDJB8so73S4gjoD83Lfb1x2E89CBcZ9Rtg0Z+gH6JXroO/Ns2lPnjMI DWDd+/FUBOTAx2MY9KNDOgsJKawgmFb5XjIslYEMURdNENfxP56TCR650MiJj2Yrg1SDMhmj1HLOk mTHo47pG81w/I0LZL/6EQEYBCg9oLHMhzuKzIyXJuoru+vs6PwRGcRLQrudkujSJfbYX7AMioLHHX cnYldjDG+1PavNkwXzGj6iN5KfU/NpqlsJR+sOEihL541y8pjHTdfvnJU7edSUF3NHZxoZP5P9nqT K+7n9SFMrDOQE6woOC71UhOp8tUIfL+VdL8XyTAglwaeSwaC/6ScsYdcEa4XyroxsPxvu4wHnAMtb MtYvcdlnAzEZklxAWP946Y6yy6X0Okc0cZJVTBxr0=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzi-0002tZ-1U; Wed, 29 Jun 2022 13:40:38 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:17 +0100 Message-Id: <20220629124026.1077021-32-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { .min_access_size = 1, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static void lasips2_realize(DeviceState *dev, Error **errp) From patchwork Wed Jun 29 12:40:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=E6Ic/EIo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2dF35L4z9sFk for ; Wed, 29 Jun 2022 23:39:45 +1000 (AEST) Received: from localhost ([::1]:35186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Xux-0005GK-83 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1M-00011r-Us; Wed, 29 Jun 2022 08:42:17 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1L-0004n3-Da; Wed, 29 Jun 2022 08:42:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tAy9NgdA5GPOeHj/u5tB8saemL7EGKA4bnbLFTt3o5g=; b=E6Ic/EIo7bxE2VsBaaefaPY/h9 psVFhr7/B+4NZ0mqMFLW8CCpWJ3gB0ZGqan7vakygxcXgUrWR0WZ/Qty6H9UdqtUc7G+vKjZ9sxYy Gz4SAUGTMFapicdHqU7L8fwDg4XB7lfx5jLlPTxDXHEkK4Wguo8JDI/cyp/7nbOIcwXiBEvdDOKt/ EudtKn+wJ4Eq37qYgjxgkzxrNE49i2S0oiUyvMGFD29owNq517YAfiZFzA0BVl2Y1o6qRMLpSbdX6 8GSbXLOFLXhr00Yc/pqQhi7HUCaoQb9eNWWKyWcmNJyvBKmOHCvnPGcaZV4Jso1dUn0sNzV3++6Vx RT5iAIDaeR7AHXQvPLsM+rPnReY/AmpTq7H3RX5YBYD6YkcXavCARTwXlG6S52PbNFc/8g3Qn58zz ee9KrbJ3f0QN3sTilK9sGxVreYsuBBvXpppBfFG0wPJCqqG1d41dK1BShcAhGWnSOAHn87O29sc2E bWgsbAgUcAk7Y1nl7H4oM/FbmtdmgExMjIvC0iWEpYVxKBUFsWiVj3OltMtAzETG/+g1VqUXwULyK aMNkaZNofM01EAtr5kCbAFDSZDF6zeHYv3yy1wr0i4IwhE1kcrh2nKmm8exqjFrhtfiPwo6hPdhGT 8Mhm2fNk39hF34HplqGnlyWE6HXnhtLsZ6pAmKXR4=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzm-0002tZ-CP; Wed, 29 Jun 2022 13:40:38 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:18 +0100 Message-Id: <20220629124026.1077021-33-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { static void lasips2_kbd_port_realize(DeviceState *dev, Error **errp) { + LASIPS2KbdPort *s = LASIPS2_KBD_PORT(dev); LASIPS2Port *lp = LASIPS2_PORT(dev); LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_GET_CLASS(lp); - lp->ps2dev = ps2_kbd_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->kbd), errp)) { + return; + } + + lp->ps2dev = PS2_DEVICE(&s->kbd); lpdc->parent_realize(dev, errp); } @@ -367,6 +372,9 @@ static void lasips2_kbd_port_init(Object *obj) memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-kbd", 0x100); + + object_initialize_child(obj, "kbd", &s->kbd, TYPE_PS2_KBD_DEVICE); + lp->id = 0; lp->lasips2 = 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_PORT) struct LASIPS2KbdPort { LASIPS2Port parent_obj; + + PS2KbdState kbd; }; #define TYPE_LASIPS2_MOUSE_PORT "lasips2-mouse-port" From patchwork Wed Jun 29 12:40:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=YTVwjrkb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2TC60bnz9sFk for ; Wed, 29 Jun 2022 23:32:47 +1000 (AEST) Received: from localhost ([::1]:51766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XoD-0005NO-61 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:32:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1S-0001JG-UQ; Wed, 29 Jun 2022 08:42:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1R-0005Cx-7X; Wed, 29 Jun 2022 08:42:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pjAcywYgywewWIYav2AWuknwqMDrLcZi9CVuKyqnSlk=; b=YTVwjrkb6+Aosj9ZwHUtGYUmO3 eALO6toTNw6m3r7nknj9KKf1N7oFWzfsM36qC+/wG898wQY3LXmZb5FLV9unOUb8yv3/OEzmsHKe9 hf1PqTp2h0seHx7bWm/gcAaMpEHCQwE89lwnket1+kqlj0ovo16GKhjDxZPclYQTgq/NMW8m5SodN EXRs2CH6hNYybOt4fxyikChw9gzKQoS1FAAJL0ldv4AB0O7Z46bqiw36+Q+HTcN9x9pf0Vp5N/XC3 4g1S0ol1m+U2np4YXnsKxLp5VZPUds1P/0VbqfTB7BYPo68r4569rnKi1HmBb5F+O2OSuNm4WU47f io/xKvJwyZ4NA6cKGNpFP62lrD8+lsABz1304HnCbFt9RlWG+sSh30r7wJtdmQY2fzVswRyxLEw1X 8sX2H1SzywUMV+GFjHtJSDb34YSsoWDJwHRK9ftw+mdmO29LFmiKCsblQQ7mxYhP6Xic7o0YIAYhM tDWMmsmibxBH2VOK/zZ5kzsMt87zfWOtvN9qQgAAOQ2tbFa8+xlLjFolIJk6AI8EnCIGe+z9+AtbQ hqtEjqMbbAN2o3/ukDr/UEzLx37OO8GxoloX+wyKDuNXTT+oA1RxHMEXkeqcX4cPsx7q19On3Y59e W/+5yQHW75gvqBevXBIdda5GIy59KiDCuKFxm9MNs=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzm-0002tZ-RY; Wed, 29 Jun 2022 13:40:39 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:19 +0100 Message-Id: <20220629124026.1077021-34-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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 = { static void lasips2_mouse_port_realize(DeviceState *dev, Error **errp) { + LASIPS2MousePort *s = LASIPS2_MOUSE_PORT(dev); LASIPS2Port *lp = LASIPS2_PORT(dev); LASIPS2PortDeviceClass *lpdc = LASIPS2_PORT_GET_CLASS(lp); - lp->ps2dev = ps2_mouse_init(); + if (!sysbus_realize(SYS_BUS_DEVICE(&s->mouse), errp)) { + return; + } + + lp->ps2dev = PS2_DEVICE(&s->mouse); lpdc->parent_realize(dev, errp); } @@ -412,6 +417,9 @@ static void lasips2_mouse_port_init(Object *obj) memory_region_init_io(&lp->reg, obj, &lasips2_reg_ops, lp, "lasips2-mouse", 0x100); + + object_initialize_child(obj, "mouse", &s->mouse, TYPE_PS2_MOUSE_DEVICE); + lp->id = 1; lp->lasips2 = 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_MOUSE_PORT) struct LASIPS2MousePort { LASIPS2Port parent_obj; + + PS2MouseState mouse; }; struct LASIPS2State { From patchwork Wed Jun 29 12:40:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=JCxIZWck; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2dC0WsWz9sFk for ; Wed, 29 Jun 2022 23:39:43 +1000 (AEST) Received: from localhost ([::1]:35040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Xuu-00059w-MK for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:39:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1T-0001Kd-Ic; Wed, 29 Jun 2022 08:42:23 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1O-0004x7-7L; Wed, 29 Jun 2022 08:42:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IVK5K8+qvTOJcmRDJ+1YSTORZYSgnuabYS7m3S1Ddt0=; b=JCxIZWckRxLc7yBJNGXPm9fFVt NdYTSiYWXymUAMLztKcgOZxGUmmNou4Kj4Csd1CDs3sPaZ4IVrdso8i1Yst1g2ymNFw1rz7WmHoSH Vo32VwHxtiDp+5EyQC6WliSMhmDXN5aI/JlTYqOMKJ9nPiMd2lCc5aMoQ4EbjpPP66+Sxxi72mz7X wEBoYelbAAi1718VUit4fgUWfr3ewMXgutAxxI4dag03XqxvkmhMNtrcIz32bQRPKIZpGAuBxvYjf IwMNZi/6zRfLHqoeXM4GeZTkKso0yp6zPSd8o5fgRwZwJIMJBcOIdOVlENYBMpL8Uh0jDaVs8t4C1 TDFwkxUmYNNiW2Jeed4PPQLwlrPE+dyYivoSirjbcesgz6HRxHzxoC89OvEdXqqx37xJJJeWF33Ay IyxKqaJpzMIuVVlTeQF8WZp8KgYw8WbZVPzO0C0MsfkSUug/K3KMzyChOcKDiSRIAahQHl9GJhwfI +5G14EIi5zsLv7FE+E//T8KzKvUDoelD3JJOwP6R3m6UtZHrmjVU+je4XDyIKv4jhU74clVpa+X/2 6SF2epZNjRbi5SDarL1MWUC30///N4KrOamI9dR3alEbLMmVjQIgo5ZSxbsMHYvL/Rz8GWUSOzU3H RGRILsRJ5+0zfRh9Jhw0rHu1rCYIX9WNbq/a/mseM=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzn-0002tZ-ER; Wed, 29 Jun 2022 13:40:39 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:20 +0100 Message-Id: <20220629124026.1077021-35-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since this series has already introduced a migration break for the HPPA B160L 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. Signed-off-by: Mark Cave-Ayland --- 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" +static const VMStateDescription vmstate_lasips2_port = { + .name = "lasips2-port", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_UINT8(control, LASIPS2Port), + VMSTATE_UINT8(buf, LASIPS2Port), + VMSTATE_BOOL(loopback_rbne, LASIPS2Port), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_lasips2 = { .name = "lasips2", - .version_id = 0, - .minimum_version_id = 0, + .version_id = 1, + .minimum_version_id = 1, .fields = (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() } }; From patchwork Wed Jun 29 12:40:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650070 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=KARgPK8g; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2Jh2Jkzz9sFx for ; Wed, 29 Jun 2022 23:25:24 +1000 (AEST) Received: from localhost ([::1]:43476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Xh3-0007bF-V7 for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1Q-0001CM-DE; Wed, 29 Jun 2022 08:42:20 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1O-0004zt-R3; Wed, 29 Jun 2022 08:42:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vm5CODCEw5+uAgwwl3NwGbM1GURCO6yW/Nt+Bt/RNpY=; b=KARgPK8g0c70S1HoF6MRBEcwa9 9KzQJ9H81sZk0UI/tuVNRpW+JBEPelAe/8ZokquIwoaohl5T3w/agzWvmQrNFM4tcmlOwSvLtGrsp 405SvsZffsz9UZHSZfAtOhk2t5bhPzysp37gYVQxcOOn6lbdHODQlKq5xKz5giYVpryaGcdT1mroi 6GdkMjnQkZos7tKTQLqSzvMPZubEqIvkLbvMGJnU2TiNAj0MNtAcbf6zKJ25YQY8CXZlVYMCX6P/W AYDnryQJN9VRQGkcpEQsl1LDtUOPRbWQMQWh8OcBKYw+ZnPQPoVpJ8X0e+lLGLkkVNscmb6D5Ysfi f9wIYu0b0KeeC8rekKaGnLiMi+BD1of87bEYgL4HP1xETWOUXx/n7OfU5mMQvYEjvHFmRa3MnqET0 wwR++RLztvC18g6BsakUDVNGbKyE6cxdw2lpqYBbFgyz3W/6IF/rl/bDvekWeK/tXsxdTwzSM619H OTcd6CflOjjon4xA6TUytENTY9Tx7yBp3/8VlzAH853O0ELrGmMn5/5dhS3nOnI+ccWKmhI4ocVV3 WZUOS4+zl8sJJ6PfId7EVyWBT6IDkv0LPBFm5GA4moe+ZWo4tbGA164vorsqpy1HVvVHxzgaOTPno JXOrYBSXQ6nBiK64OK9vjKlGB/qRkOE4uSJiJsmqU=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzo-0002tZ-3G; Wed, 29 Jun 2022 13:40:40 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:21 +0100 Message-Id: <20220629124026.1077021-36-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This enables us to register the VMStateDescription using the DeviceClass vmsd property rather than having to call vmstate_register() from i8042_mmio_realize(). Note that this is a migration break for the MIPS jazz machine which is the only user of the I8042_MMIO device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->region); - /* Note we can't use dc->vmsd without breaking migration compatibility */ - vmstate_register(NULL, 0, &vmstate_kbd, ks); - ks->kbd = 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[] = { DEFINE_PROP_END_OF_LIST(), }; +static const VMStateDescription vmstate_kbd_mmio = { + .name = "pckbd-mmio", + .version_id = 1, + .minimum_version_id = 1, + .fields = (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 = DEVICE_CLASS(klass); dc->realize = i8042_mmio_realize; dc->reset = i8042_mmio_reset; + dc->vmsd = &vmstate_kbd_mmio; device_class_set_props(dc, i8042_mmio_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } From patchwork Wed Jun 29 12:40:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=E7vUBjL8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2n94JXFz9sFs for ; Wed, 29 Jun 2022 23:46:36 +1000 (AEST) Received: from localhost ([::1]:47378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Y1Y-0005B1-GO for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:46:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1U-0001M1-E2; Wed, 29 Jun 2022 08:42:24 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1S-0005I7-Ly; Wed, 29 Jun 2022 08:42:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VjyLwG39TG1/DgUH7jKMKI43V5Gw+2OWZceVJ8f48sA=; b=E7vUBjL8jBZjyPrO5Ik0ub7KuY y1p/fPopRn23XTdNd63TPZsHF4n2l7T04PPyE6W//6ZGoW/fcVaqn/KbFq0GXNQULoOz2u9tJtUIF NM0e2TMCJYktEBcs0HD2g1fJM6BZnSdBtNfBSj1PBMqAXa0yuc7B01a4CCt4sH2bq7K6zAvdImPjz iRZjdjV6AgpS/yG10ot08/0u+MJU9NyCJBFicjmzbdLwGgXUU1FyVmd8WlEPlIjulFpJlMtFdd7bE /sDfq1/dcgA0SIeYUEbLKgH9gDjN01QttDrvqz+XHeWn+R8nTX4DBKra8tdBEXPoFx0wJA2Um/AET +Rx4P/zA//kpi0mesXVanvTtVpbutFVUera5S4avYOkf1Bskk/RX4nZ+l6ZH3cGY4gQvZ6h2mpaTZ lrUVZmkm3mj3YlMFtu2HmJ0TbSjNMVohfT3KzksTaqSOQ7kWWplT6AQk0fQTjfkiFjhKBj4z7EmyB 36xoGqc7K+gpLOEPdyOdcO1j+8OpsWO4aPKbQwLzYFTO9vcsmUH8xg1LU+CfwvMQNdWydaWF8Ygtg tNV4eOOFeNDIPj+8EmFqwFiAKPuYcYQPZUODaSgGLZ0lSdX5LUtqHopt8G7TMp0uW9rh3EbuduzME qqQe1XfhtVi57q8XKFGJNI8+PgZqzX57ZgkKfxCR0=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzo-0002tZ-NU; Wed, 29 Jun 2022 13:40:44 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:22 +0100 Message-Id: <20220629124026.1077021-37-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Instantiate the PS2 keyboard device within KBDState using object_initialize_child() in i8042_initfn() and i8042_mmio_init() and realize it in i8042_realizefn() and i8042_mmio_realize() accordingly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 |= 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); } } @@ -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 = ps2_read_data(s->kbd); + s->obdata = ps2_read_data(PS2_DEVICE(&s->ps2kbd)); } else if (s->obsrc & KBD_OBSRC_MOUSE) { s->obdata = 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, 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 &= ~KBD_MODE_DISABLE_KBD; kbd_safe_update_irq(s); break; case KBD_CCMD_WRITE_MODE: s->mode = val; - ps2_keyboard_set_translation(s->kbd, (s->mode & KBD_MODE_KCC) != 0); + ps2_keyboard_set_translation(&s->ps2kbd, + (s->mode & KBD_MODE_KCC) != 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, Error **errp) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->region); - ks->kbd = 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 = 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) ks->extended_state = true; + object_initialize_child(obj, "ps2kbd", &ks->ps2kbd, TYPE_PS2_KBD_DEVICE); + 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); + 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); 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); - s->kbd = 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 = 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 @@ #include "hw/isa/isa.h" #include "hw/sysbus.h" +#include "hw/input/ps2.h" #include "qom/object.h" #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; From patchwork Wed Jun 29 12:40:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=E9rIiBv5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2tj5G03z9sFs for ; Wed, 29 Jun 2022 23:51:25 +1000 (AEST) Received: from localhost ([::1]:55450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Y6F-0002sB-9W for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:51:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1U-0001Ma-Gv; Wed, 29 Jun 2022 08:42:24 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1S-0005IF-UC; Wed, 29 Jun 2022 08:42:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HSKpiIvSIuW6hPkBrgEwAcnGpKHNg9JW0sGOT9eVK/A=; b=E9rIiBv5pcFwsALp801zjVrSDb MOAoa6GU2JV4UUuF5QLV6JjVDAFInEXGx6LGS5j3+9MQE4zWOEo3CEjDwLHX5gPdGGnaFFCzkC5Wq l37HGWVq9PIgvMFcLMvTG64eIgLxTXvRqtUU8RiXoFHzycDjlr9f3aetGDljlY7vm7hvf4S2fqoym t+5OFmMXYJhetb+9N4/cUNcmmFEVVYGXq8snIsqA2H41lRw+kXQ2cwzNgcx7OzSXlKaaDM59991XZ 3tAXSSyw7cTC4FnkjveotnjdnO8MaI8e6s7I9OVBcSw7+I7W+M4/i0nBrnaX0Xvi8ISuUKGb9hTE3 PNmE+oXTDZ9wI+EO2ldLINGCB+LCR2IPcEOhwAmdrDbrD/bb1hF1awphCWZYf6sO403UYOd9TtXpl n91z0d79iV0pXTI+wWaey/y59XZbS/G74bf8aWs/ajwSYuMLg76/vGcB/X4mUiqML/7A8r0x68FPK UC3LTwtnYyFmj0LShfM+2/nE1t7W/Fno9krd8aY6Y7LgSM+SlZVLDXVTebZL95oz/MToTNUWwG6PN 0wrUOJ6cWdAK2HzmYj4Md0AZE1PLIw9NrjT/jiXflntGv2HnLV7/4t+ZL+uNNXS39ok+unX+qJOJf P42zb/fkPT4GSNG4Hn36DXuLbjvTVHl8S2vGLnls4=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzt-0002tZ-1p; Wed, 29 Jun 2022 13:40:45 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:23 +0100 Message-Id: <20220629124026.1077021-38-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that the legacy ps2_kbd_init() function is no longer used, it can be completely removed along with its associated trace-event. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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); } -void *ps2_kbd_init(void) -{ - DeviceState *dev; - PS2KbdState *s; - - dev = qdev_new(TYPE_PS2_KBD_DEVICE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - s = PS2_KBD_DEVICE(dev); - - trace_ps2_kbd_init(s); - return s; -} - static QemuInputHandler ps2_mouse_handler = { .name = "QEMU PS/2 Mouse", .mask = 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" # 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) /* 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); From patchwork Wed Jun 29 12:40:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=PFylWWwO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2cq2twvz9sFk for ; Wed, 29 Jun 2022 23:39:22 +1000 (AEST) Received: from localhost ([::1]:33712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XuX-0004Fu-Vx for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:39:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1Z-0001YL-Dc; Wed, 29 Jun 2022 08:42:29 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1X-0005Rs-NU; Wed, 29 Jun 2022 08:42:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XkVqp2B9+fzLZmAgrlzGVDRYyMDijZTV5Rp4JZw6uAI=; b=PFylWWwOtZd3ehQ8ZfipYQaa4E P87KmDIG4MNA13RbKSjvFBxNqcbsBT1Ebdjg8b40h2vzFyNByXAgaK0CKMaV3B+ij39aNHwBGlFeq MpB+cOifiTD/Lpr8SrYshhucwDlxGlNqjxpL97Lw6l5IXzFqmKKKNmTvGqO66kxbYkv1pawKnIruo 0W9UuXeKWga/vwcHadCSjibbGSQ1rQtUR3xVuSrepDc4vJZBfQFyIVbBmDwY+rcpwLz2v6qxT6WhK S4i8x7Bx6NTd8yGrXUtLikRWCwyIdmo6dYj1ZltKEHq2HPh8LlO2gIGso1K9jkXHgqtKSSPIv+WUp 4PmxhoONjW9mMvpwbbAp1PX0k4JHyNAtwaG7nTKCXNxenAmwpj4Bazw4+go5e6+WTHRHP2zP0xv7a O+IZK4vEI3JE3UMDKpE4aElSEncvYNh1xd5J2Bk6q4RwHOy3Xg3hdJa1b/YTxOzr+ZrSn0N10EPwf zBrD5bufGDSFGtybbSpHOFJOhHX+SN08xd440KWv9E8OrscchGafrEycKYWOQ+T+SD8UckSQ1xeKN Y2URDot2r+stdKK8F3XzKt3skMHt5PHKnpwl3F1DuPU0Pt0Me18hMEhmN2l0IBSqIScE7kdukQ+4/ mtO9QJxRV0J+yw+ni8Zt7AwqxfAgPU3vvoO61rsis=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzt-0002tZ-FN; Wed, 29 Jun 2022 13:40:49 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:24 +0100 Message-Id: <20220629124026.1077021-39-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Instantiate the PS2 mouse device within KBDState using object_initialize_child() in i8042_initfn() and i8042_mmio_init() and realize it in i8042_realizefn() and i8042_mmio_realize() accordingly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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 |= 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); } } @@ -410,7 +410,7 @@ static uint64_t kbd_read_data(void *opaque, hwaddr addr, } s->obdata = ps2_read_data(PS2_DEVICE(&s->ps2kbd)); } else if (s->obsrc & KBD_OBSRC_MOUSE) { - s->obdata = ps2_read_data(s->mouse); + s->obdata = ps2_read_data(PS2_DEVICE(&s->ps2mouse)); } else if (s->obsrc & KBD_OBSRC_CTRL) { s->obdata = 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 &= ~KBD_MODE_DISABLE_MOUSE; kbd_safe_update_irq(s); @@ -704,12 +704,15 @@ static void i8042_mmio_realize(DeviceState *dev, Error **errp) return; } + 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)); - ks->mouse = 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 = true; object_initialize_child(obj, "ps2kbd", &ks->ps2kbd, TYPE_PS2_KBD_DEVICE); + object_initialize_child(obj, "ps2mouse", &ks->ps2mouse, + TYPE_PS2_MOUSE_DEVICE); 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 = &isa->kbd; - ps2_mouse_fake_event(s->mouse); + ps2_mouse_fake_event(&s->ps2mouse); } void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out) @@ -859,6 +864,8 @@ static void i8042_initfn(Object *obj) "i8042-cmd", 1); object_initialize_child(obj, "ps2kbd", &s->ps2kbd, TYPE_PS2_KBD_DEVICE); + object_initialize_child(obj, "ps2mouse", &s->ps2mouse, + TYPE_PS2_MOUSE_DEVICE); qdev_init_gpio_out_named(DEVICE(obj), &s->a20_out, I8042_A20_LINE, 1); @@ -901,10 +908,14 @@ static void i8042_realizefn(DeviceState *dev, Error **errp) qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); - s->mouse = 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; qemu_irq irqs[2]; From patchwork Wed Jun 29 12:40:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=Nh7tqmhk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2cq2txlz9sGJ for ; Wed, 29 Jun 2022 23:39:22 +1000 (AEST) Received: from localhost ([::1]:33804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6XuZ-0004JZ-JJ for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:39:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1e-0001o3-OJ; Wed, 29 Jun 2022 08:42:34 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1d-0005Uv-4Z; Wed, 29 Jun 2022 08:42:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zLObqLwS/7sla7asfLaB79nnQfQa8AjCHf2Xw3jAXWQ=; b=Nh7tqmhkb2uoj8UnogkTAkGfZn QzG+rha1SjDfm31gH8K8MsoBGtQh1m7Vlw30JdQd/PUbTEV+T93vwqhpdVVLvEXfOF0jSDncRiYIQ kA/r3Zdg9ahgZRZJmbRwCCHH/5KMffWBBCx+x6Tmv2p8xmsztxXJlqRtsIFiAk2BLt1eHQhXlzvb0 Qiq7g9K4B4SJkfK7xhpOXujtNuPZaA/cp3dI0hnvBWDElpAkFB7jh/YKmae9HylW0QQWNSv404jc1 1TB0vbyd7jYTmCUv+vd0rW1VBYBs6mM59X90TVZD73HfsNPGrSXk2DqOSolug72wgvUHjats4tb1/ 7eLBFPXtxmlR5yzYusZGq97xcioz/LQEPXHI0d/ZWdaKaT/mFsZkRoQ2MnQkRPzBWHbhjCydbgALH 6z+BZydYwORu9O1pnP3QqV3GDbx5OHwBBu2CukZ2d+3CqmxY0PjAHtGz2aEJ9aRqKXhGWUgFgXRaJ AthFXGEuj8cPMMG9H/7mwZDcuX39dK9wd+YCupO1sfVeKWjSlLHiZR8wiAn/eZC6dYbGk3ss5s9xA u5XVK/j52XBWgdNojo3H2tvDc95yYHZZP7N3tpKubqowQ2PAjk9kI5yDkX67h4ysUpTcVGd4iBjOE R9oLLFB4Oc0/Ay2Kcrg6wwMy6+6MJk0Pjkc5wJHAQ=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6Wzx-0002tZ-Th; Wed, 29 Jun 2022 13:40:54 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:25 +0100 Message-Id: <20220629124026.1077021-40-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Peter Maydell --- 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, Error **errp) qemu_input_handler_register(dev, &ps2_mouse_handler); } -void *ps2_mouse_init(void) -{ - DeviceState *dev; - PS2MouseState *s; - - dev = qdev_new(TYPE_PS2_MOUSE_DEVICE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - s = PS2_MOUSE_DEVICE(dev); - - trace_ps2_mouse_init(s); - return s; -} - static void ps2_kbd_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = 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" # 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) /* 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); From patchwork Wed Jun 29 12:40:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 1650098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=ilande.co.uk header.i=@ilande.co.uk header.a=rsa-sha256 header.s=20220518 header.b=zwfdKV5B; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LY2yS15Qlz9sFs for ; Wed, 29 Jun 2022 23:54:40 +1000 (AEST) Received: from localhost ([::1]:35500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Y9M-0000LI-Po for incoming@patchwork.ozlabs.org; Wed, 29 Jun 2022 09:54:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1i-0001vY-Ul; Wed, 29 Jun 2022 08:42:40 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:51458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6X1h-0005lP-Cd; Wed, 29 Jun 2022 08:42:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Clx57WYUXUjNNQfrKpTM8wNwVS7PvSdLNJ1LxgN4uw0=; b=zwfdKV5BhnKQM/FzFcKBFeIgXe odpOj9guSorEim2wUPHt/G7tbLPrFxI8XB3LCB5dcbS8+4v9pe3M2Dsc85eZailOqUhSQi+CWIq1l dgmHO9J2Vujgav7CxaniFyRpf5No1bhRQ7omAq+cIFuKaMO4POzIo1jsATkus0ZXuPLBpzv9FYEFe JUKvhxSFHjmRjheN2ky6KDsem/V2HyH01OIGN3u3P1w+BNc4uhkbFBJ2/wJTXwPho5+9sO4mSeUp0 Qn46QDWEVnJAWg9MQsoXycbmWgCJaHQko2VFqz+9pCAi/e1EHs+HCSV2y+06vjWJynLUeaOeJmH5Y 87RmpYqwJEDGvZx/cBv4BKPDfvk5XXv3P/jEK59/JZ2ydC6/z8exSvne/fTSpD1BvSUA48OhRvPAf ScgzUu5ZcQ7UpK1GzE0fMZU4r5NtsHIqbdZkLutuyy9F+jZQt5WANg/o0bX8O62BKfuCsTBnXVNej tFtOjZagdib5lPEA7LoiTbp8UWCS5bGzwr73+OEKjlHpBfbywbmAHAo2mZtE5QqLzTDyaiWyCvEok LHz3GXX04W2DXSA1ynk9rv1dRhdidcNCZinoP7VOqkr2gxJ5Eiz3M9Mhv11DcTds61n06+e+kExCM WuBx6x99dRI5j3B09seFOn9aBWAJKSmzkXEfwdDzg=; Received: from [2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab] (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 1o6X02-0002tZ-8s; Wed, 29 Jun 2022 13:40:58 +0100 From: Mark Cave-Ayland To: richard.henderson@linaro.org, deller@gmx.de, svens@stackframe.org, mst@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, hpoussin@reactos.org, aleksandar.rikalo@syrmia.com, f4bug@amsat.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org Date: Wed, 29 Jun 2022 13:40:26 +0100 Message-Id: <20220629124026.1077021-41-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> References: <20220629124026.1077021-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a00:23c4:8ba4:e500:b82f:56f9:46d7:80ab X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This legacy function is only used during the initialisation of the MIPS magnum machine, so inline its functionality directly into mips_jazz_init() and then remove it. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- 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); } -MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, - ram_addr_t size, hwaddr mask) -{ - DeviceState *dev; - - dev = 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 = { .name = TYPE_I8042_MMIO, .parent = 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); /* Keyboard (i8042) */ - i8042 = i8042_mm_init(qdev_get_gpio_in(rc4030, 6), - qdev_get_gpio_in(rc4030, 7), - 0x1000, 0x1); + i8042 = 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(i8042), 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" -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);