qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: richard.henderson@linaro.org, deller@gmx.de, mst@redhat.com,
	pbonzini@redhat.com, peter.maydell@linaro.org,
	hpoussin@reactos.org, aleksandar.rikalo@syrmia.com,
	f4bug@amsat.org, jiaxun.yang@flygoat.com, qemu-arm@nongnu.org,
	qemu-devel@nongnu.org
Subject: [PATCH 15/50] pl050: split pl050_update_irq() into separate pl050_set_irq() and pl050_update_irq() functions
Date: Sun, 22 May 2022 19:18:01 +0100	[thread overview]
Message-ID: <20220522181836.864-16-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20220522181836.864-1-mark.cave-ayland@ilande.co.uk>

This will soon allow pl050_set_irq() to be used as a GPIO input function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/input/pl050.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/hw/input/pl050.c b/hw/input/pl050.c
index 889a0674d3..66f8c20d9f 100644
--- a/hw/input/pl050.c
+++ b/hw/input/pl050.c
@@ -57,15 +57,20 @@ static const unsigned char pl050_id[] = {
     0x50, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1
 };
 
-static void pl050_update(void *opaque, int level)
+static void pl050_update_irq(PL050State *s)
+{
+    int level = (s->pending && (s->cr & 0x10) != 0)
+                 || (s->cr & 0x08) != 0;
+
+    qemu_set_irq(s->irq, level);
+}
+
+static void pl050_set_irq(void *opaque, int level)
 {
     PL050State *s = (PL050State *)opaque;
-    int raise;
 
     s->pending = level;
-    raise = (s->pending && (s->cr & 0x10) != 0)
-            || (s->cr & 0x08) != 0;
-    qemu_set_irq(s->irq, raise);
+    pl050_update_irq(s);
 }
 
 static uint64_t pl050_read(void *opaque, hwaddr offset,
@@ -124,7 +129,7 @@ static void pl050_write(void *opaque, hwaddr offset,
     switch (offset >> 2) {
     case 0: /* KMICR */
         s->cr = value;
-        pl050_update(s, s->pending);
+        pl050_update_irq(s);
         /* ??? Need to implement the enable/disable bit.  */
         break;
     case 2: /* KMIDATA */
@@ -159,9 +164,9 @@ 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(pl050_update, s);
+        s->dev = ps2_mouse_init(pl050_set_irq, s);
     } else {
-        s->dev = ps2_kbd_init(pl050_update, s);
+        s->dev = ps2_kbd_init(pl050_set_irq, s);
     }
 }
 
-- 
2.20.1



  parent reply	other threads:[~2022-05-22 18:44 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 18:17 [PATCH 00/50] PS2 device QOMification - part 1 Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 01/50] ps2: checkpatch fixes Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 02/50] ps2: QOMify PS2State Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 03/50] ps2: QOMify PS2KbdState Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 04/50] ps2: QOMify PS2MouseState Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 05/50] ps2: move QOM type definitions from ps2.c to ps2.h Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 06/50] ps2: improve function prototypes in ps2.c and ps2.h Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 07/50] ps2: introduce PS2DeviceClass Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 08/50] ps2: implement ps2_reset() for the PS2_DEVICE QOM type based upon ps2_common_reset() Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 09/50] ps2: remove duplicate setting of scancode_set in ps2_kbd_init() Mark Cave-Ayland
2022-05-22 22:22   ` Philippe Mathieu-Daudé via
2022-05-24 17:19     ` Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 10/50] ps2: implement ps2_kbd_realize() and use it to register ps2_keyboard_handler Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 11/50] ps2: implement ps2_mouse_realize() and use it to register ps2_mouse_handler Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 12/50] ps2: don't use vmstate_register() in ps2_kbd_init() Mark Cave-Ayland
2022-05-22 18:17 ` [PATCH 13/50] ps2: don't use vmstate_register() in ps2_mouse_init() Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 14/50] pl050: checkpatch fixes Mark Cave-Ayland
2022-05-22 18:18 ` Mark Cave-Ayland [this message]
2022-05-22 18:18 ` [PATCH 16/50] lasips2: spacing fixes Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 17/50] lasips2: rename ps2dev_update_irq() to lasips2_port_set_irq() Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 18/50] pckbd: checkpatch fixes Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 19/50] pckbd: move KBDState from pckbd.c to i8042.h Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 20/50] pckbd: move ISAKBDState " Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 21/50] pckbd: introduce new I8042_MMIO QOM type Mark Cave-Ayland
2022-06-09 10:45   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 22/50] pckbd: implement i8042_mmio_reset() for I8042_MMIO device Mark Cave-Ayland
2022-06-09 10:49   ` Peter Maydell
2022-06-10  6:53     ` Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 23/50] pckbd: add mask qdev property to " Mark Cave-Ayland
2022-06-09 10:49   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 24/50] pckbd: add size " Mark Cave-Ayland
2022-06-09 10:50   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 25/50] pckbd: implement i8042_mmio_realize() function Mark Cave-Ayland
2022-06-09 10:52   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 26/50] pckbd: implement i8042_mmio_init() function Mark Cave-Ayland
2022-06-09 10:53   ` Peter Maydell
2022-06-10  6:57     ` Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 27/50] pckbd: alter i8042_mm_init() to return a I8042_MMIO device Mark Cave-Ayland
2022-06-09 10:58   ` Peter Maydell
2022-06-10  7:04     ` Mark Cave-Ayland
2022-06-24 13:28       ` Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 28/50] pckbd: move mapping of I8042_MMIO registers to MIPS magnum machine Mark Cave-Ayland
2022-06-09 10:59   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 29/50] pckbd: more vmstate_register() from i8042_mm_init() to i8042_mmio_realize() Mark Cave-Ayland
2022-05-23  6:34   ` Hervé Poussineau
2022-05-24 17:24     ` Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 30/50] pckbd: move ps2_kbd_init() and ps2_mouse_init() " Mark Cave-Ayland
2022-06-09 11:00   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 31/50] ps2: make ps2_raise_irq() function static Mark Cave-Ayland
2022-06-09 11:01   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 32/50] ps2: use ps2_raise_irq() instead of calling update_irq() directly Mark Cave-Ayland
2022-06-09 11:01   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 33/50] ps2: introduce ps2_lower_irq() " Mark Cave-Ayland
2022-06-09 11:01   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 34/50] ps2: add gpio for output IRQ and optionally use it in ps2_raise_irq() and ps2_lower_irq() Mark Cave-Ayland
2022-06-09 11:05   ` Peter Maydell
2022-06-10  7:09     ` Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 35/50] pckbd: replace irq_kbd and irq_mouse with qemu_irq array in KBDState Mark Cave-Ayland
2022-06-09 11:06   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 36/50] pl050: switch over from update_irq() function to PS2 device gpio Mark Cave-Ayland
2022-06-09 11:08   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 37/50] lasips2: QOMify LASIPS2State Mark Cave-Ayland
2022-06-09 11:09   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 38/50] lasips2: move lasips2 QOM types from lasips2.c to lasips2.h Mark Cave-Ayland
2022-06-09 11:09   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 39/50] lasips2: rename lasips2_init() to lasips2_initfn() and update it to return the LASIPS2 device Mark Cave-Ayland
2022-06-09 11:10   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 40/50] lasips2: implement lasips2_init() function Mark Cave-Ayland
2022-06-09 11:10   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 41/50] lasips2: move mapping of LASIPS2 registers to HPPA machine Mark Cave-Ayland
2022-06-09 11:11   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 42/50] lasips2: move initialisation of PS2 ports from lasi_initfn() to lasi_init() Mark Cave-Ayland
2022-06-09 11:11   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 43/50] lasips2: add base property Mark Cave-Ayland
2022-06-09 11:16   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 44/50] lasips2: implement lasips2_realize() Mark Cave-Ayland
2022-06-09 11:14   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 45/50] lasips2: use qdev gpio for output IRQ Mark Cave-Ayland
2022-06-09 11:18   ` Peter Maydell
2022-06-10  7:17     ` Mark Cave-Ayland
2022-06-11 15:44       ` Mark Cave-Ayland
2022-06-20 10:17         ` Peter Maydell
2022-06-20 13:22           ` Mark Cave-Ayland
2022-06-20 14:13             ` Peter Maydell
2022-06-24 13:32               ` Mark Cave-Ayland
2022-06-13 13:43   ` Philippe Mathieu-Daudé via
2022-05-22 18:18 ` [PATCH 46/50] lasips2: switch over from update_irq() function to PS2 device gpio Mark Cave-Ayland
2022-06-09 11:21   ` Peter Maydell
2022-06-10  7:19     ` Mark Cave-Ayland
2022-05-22 18:18 ` [PATCH 47/50] pckbd: switch I8042_MMIO device " Mark Cave-Ayland
2022-06-09 12:52   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 48/50] pckbd: add i8042_reset() function to I8042 device Mark Cave-Ayland
2022-06-09 12:50   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 49/50] pckbd: switch I8042 device from update_irq() function to PS2 device gpio Mark Cave-Ayland
2022-06-09 12:52   ` Peter Maydell
2022-05-22 18:18 ` [PATCH 50/50] ps2: remove update_irq() function and update_arg parameter Mark Cave-Ayland
2022-06-09 12:50   ` Peter Maydell
2022-05-22 22:29 ` [PATCH 00/50] PS2 device QOMification - part 1 Philippe Mathieu-Daudé via
2022-05-24 18:25 ` Helge Deller
2022-05-28  6:15   ` Mark Cave-Ayland
2022-06-07 15:54 ` Mark Cave-Ayland
2022-06-10 15:35   ` Philippe Mathieu-Daudé via
2022-06-10 15:43     ` Mark Cave-Ayland
2022-06-11  9:31       ` Philippe Mathieu-Daudé via

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20220522181836.864-16-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=deller@gmx.de \
    --cc=f4bug@amsat.org \
    --cc=hpoussin@reactos.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).