qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] misc/pca9552: Fix for pca9552 not getting reset


From: Cédric Le Goater
Subject: Re: [PATCH v3] misc/pca9552: Fix for pca9552 not getting reset
Date: Tue, 10 Oct 2023 21:58:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 10/10/23 21:52, Glenn Miles wrote:
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>
---

It is good practice to include a changelog after '---'


  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);
+}


I don't see any change from v2.

Thanks,

C.

+
  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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]