]> Git Repo - qemu.git/commitdiff
hw/sensor: add Renesas raa229004 PMBus device
authorTitus Rwantare <[email protected]>
Mon, 7 Mar 2022 20:06:04 +0000 (12:06 -0800)
committerPhilippe Mathieu-Daudé <[email protected]>
Tue, 8 Mar 2022 17:46:48 +0000 (18:46 +0100)
The Renesas RAA229004 is a PMBus Multiphase Voltage Regulator

Signed-off-by: Titus Rwantare <[email protected]>
Reviewed-by: Hao Wu <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Corey Minyard <[email protected]>
Message-Id: <20220307200605.4001451[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
hw/sensor/isl_pmbus_vr.c
include/hw/sensor/isl_pmbus_vr.h
tests/qtest/isl_pmbus_vr-test.c

index f8cc75fc3148540e017cd4c5072decf51e8ca492..53187d619a8a72be13b04934b48913a660c1c00b 100644 (file)
@@ -195,6 +195,15 @@ static void isl69260_class_init(ObjectClass *klass, void *data)
     isl_pmbus_vr_class_init(klass, data, 2);
 }
 
+static void raa229004_class_init(ObjectClass *klass, void *data)
+{
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    dc->desc = "Renesas 229004 Digital Multiphase Voltage Regulator";
+    rc->phases.exit = isl_pmbus_vr_exit_reset;
+    isl_pmbus_vr_class_init(klass, data, 2);
+}
+
 static const TypeInfo isl69260_info = {
     .name = TYPE_ISL69260,
     .parent = TYPE_PMBUS_DEVICE,
@@ -203,9 +212,18 @@ static const TypeInfo isl69260_info = {
     .class_init = isl69260_class_init,
 };
 
+static const TypeInfo raa229004_info = {
+    .name = TYPE_RAA229004,
+    .parent = TYPE_PMBUS_DEVICE,
+    .instance_size = sizeof(ISLState),
+    .instance_init = raa22xx_init,
+    .class_init = raa229004_class_init,
+};
+
 static void isl_pmbus_vr_register_types(void)
 {
     type_register_static(&isl69260_info);
+    type_register_static(&raa229004_info);
 }
 
 type_init(isl_pmbus_vr_register_types)
index 4e12e95efbf9300b8793d898e0266e1f7ee2ae27..233916f70a67c701c7796f36190d7f9aef58d253 100644 (file)
@@ -13,6 +13,7 @@
 #include "qom/object.h"
 
 #define TYPE_ISL69260   "isl69260"
+#define TYPE_RAA229004  "raa229004"
 
 struct ISLState {
     PMBusDevice parent;
index f77732ae964865a9183468b7084244eb029e4ec4..dc0ccae2aa822fb8307b565506256488ba8de23b 100644 (file)
@@ -390,5 +390,13 @@ static void isl_pmbus_vr_register_nodes(void)
     qos_add_test("test_pages_rw", "isl69260", test_pages_rw, NULL);
     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);
+
+    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);
 }
 libqos_init(isl_pmbus_vr_register_nodes);
This page took 0.032363 seconds and 4 git commands to generate.