qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v3 9/9] hw/sensor: add Renesas raa228000 device


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 9/9] hw/sensor: add Renesas raa228000 device
Date: Sat, 5 Mar 2022 00:58:41 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

On 2/3/22 02:50, Titus Rwantare wrote:
Signed-off-by: Titus Rwantare <titusr@google.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
---
  hw/sensor/isl_pmbus_vr.c         | 50 ++++++++++++++++++++
  include/hw/sensor/isl_pmbus_vr.h |  1 +
  tests/qtest/isl_pmbus_vr-test.c  | 78 ++++++++++++++++++++++++++++++--
  3 files changed, 126 insertions(+), 3 deletions(-)

diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c
index e260faeac3..df7c003ea6 100644
--- a/hw/sensor/isl_pmbus_vr.c
+++ b/hw/sensor/isl_pmbus_vr.c
@@ -89,6 +89,24 @@ static void isl_pmbus_vr_exit_reset(Object *obj)
      }
  }
+/* The raa228000 uses different direct mode coefficents from most isl devices */
+static void raa228000_exit_reset(Object *obj)
+{
+    isl_pmbus_vr_exit_reset(obj);
+
+    PMBusDevice *pmdev = PMBUS_DEVICE(obj);

Per QEMU CodingStyle, variables are declared first.

+    pmdev->pages[0].read_vout = 0;
+    pmdev->pages[0].read_iout = 0;
+    pmdev->pages[0].read_pout = 0;
+    pmdev->pages[0].read_vin = 0;
+    pmdev->pages[0].read_iin = 0;
+    pmdev->pages[0].read_pin = 0;
+    pmdev->pages[0].read_temperature_1 = 0;
+    pmdev->pages[0].read_temperature_2 = 0;
+    pmdev->pages[0].read_temperature_3 = 0;
+}

  /* test qmp access */
  static void test_tx_rx(void *obj, void *data, QGuestAllocator *alloc)
  {
@@ -384,9 +448,6 @@ static void isl_pmbus_vr_register_nodes(void)
      qos_node_create_driver("isl69260", i2c_device_create);
      qos_node_consumes("isl69260", "i2c-bus", &opts);
- qos_node_create_driver("raa229004", i2c_device_create);
-    qos_node_consumes("raa229004", "i2c-bus", &opts);
-
      qos_add_test("test_defaults", "isl69260", test_defaults, NULL);
      qos_add_test("test_tx_rx", "isl69260", test_tx_rx, NULL);
      qos_add_test("test_rw_regs", "isl69260", test_rw_regs, NULL);
@@ -394,9 +455,20 @@ static void isl_pmbus_vr_register_nodes(void)
      qos_add_test("test_ro_regs", "isl69260", test_ro_regs, NULL);
      qos_add_test("test_ov_faults", "isl69260", test_voltage_faults, NULL);
+ qos_node_create_driver("raa229004", i2c_device_create);
+    qos_node_consumes("raa229004", "i2c-bus", &opts);
+

Squash in previous commit?

      qos_add_test("test_tx_rx", "raa229004", test_tx_rx, NULL);
      qos_add_test("test_rw_regs", "raa229004", test_rw_regs, NULL);
      qos_add_test("test_pages_rw", "raa229004", test_pages_rw, NULL);
      qos_add_test("test_ov_faults", "raa229004", test_voltage_faults, NULL);

Otherwise,
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



reply via email to

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