qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] misc/pca9552: Fix for pca9552 not getting reset
@ 2023-10-10 19:52 Glenn Miles
  2023-10-10 19:58 ` Cédric Le Goater
  2023-10-10 20:31 ` Mark Cave-Ayland
  0 siblings, 2 replies; 7+ messages in thread
From: Glenn Miles @ 2023-10-10 19:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Glenn Miles, qemu-arm, clg, clegoate, andrew, joel

Testing of the pca9552 device on the powernv platform
showed that the reset method was not being called when
an instance of the device was realized.  This was causing
the INPUT0/INPUT1 POR values to be incorrect.

Fixed by overriding the parent pca955x_realize method with a
new pca9552_realize method which first calls
the parent pca955x_realize method followed by the
pca9552_reset function.

Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
---
 hw/misc/pca9552.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c
index fff19e369a..4e183cc554 100644
--- a/hw/misc/pca9552.c
+++ b/hw/misc/pca9552.c
@@ -384,6 +384,12 @@ static void pca955x_realize(DeviceState *dev, Error **errp)
     qdev_init_gpio_out(dev, s->gpio, k->pin_count);
 }
 
+static void pca9552_realize(DeviceState *dev, Error **errp)
+{
+    pca955x_realize(dev, errp);
+    pca9552_reset(dev);
+}
+
 static Property pca955x_properties[] = {
     DEFINE_PROP_STRING("description", PCA955xState, description),
     DEFINE_PROP_END_OF_LIST(),
@@ -417,6 +423,7 @@ static void pca9552_class_init(ObjectClass *oc, void *data)
     PCA955xClass *pc = PCA955X_CLASS(oc);
 
     dc->reset = pca9552_reset;
+    dc->realize = pca9552_realize;
     dc->vmsd = &pca9552_vmstate;
     pc->max_reg = PCA9552_LS3;
     pc->pin_count = 16;
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-10-19 17:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-10 19:52 [PATCH v3] misc/pca9552: Fix for pca9552 not getting reset Glenn Miles
2023-10-10 19:58 ` Cédric Le Goater
2023-10-10 20:29   ` Miles Glenn
2023-10-10 20:31 ` Mark Cave-Ayland
2023-10-10 20:35   ` Miles Glenn
2023-10-10 20:41     ` Cédric Le Goater
2023-10-19 17:32       ` Miles Glenn

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).