[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 8/9] hw/sensor: add Renesas raa229004 PMBus device
From: |
Titus Rwantare |
Subject: |
[PATCH v3 8/9] hw/sensor: add Renesas raa229004 PMBus device |
Date: |
Tue, 1 Mar 2022 17:50:52 -0800 |
The Renesas RAA229004 is a PMBus Multiphase Voltage Regulator
Signed-off-by: Titus Rwantare <titusr@google.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
---
hw/sensor/isl_pmbus_vr.c | 18 ++++++++++++++++++
include/hw/sensor/isl_pmbus_vr.h | 1 +
tests/qtest/isl_pmbus_vr-test.c | 8 ++++++++
3 files changed, 27 insertions(+)
diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c
index b3d24e40ab..e260faeac3 100644
--- a/hw/sensor/isl_pmbus_vr.c
+++ b/hw/sensor/isl_pmbus_vr.c
@@ -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)
diff --git a/include/hw/sensor/isl_pmbus_vr.h b/include/hw/sensor/isl_pmbus_vr.h
index 4e12e95efb..233916f70a 100644
--- a/include/hw/sensor/isl_pmbus_vr.h
+++ b/include/hw/sensor/isl_pmbus_vr.h
@@ -13,6 +13,7 @@
#include "qom/object.h"
#define TYPE_ISL69260 "isl69260"
+#define TYPE_RAA229004 "raa229004"
struct ISLState {
PMBusDevice parent;
diff --git a/tests/qtest/isl_pmbus_vr-test.c b/tests/qtest/isl_pmbus_vr-test.c
index f77732ae96..a33dfb6135 100644
--- a/tests/qtest/isl_pmbus_vr-test.c
+++ b/tests/qtest/isl_pmbus_vr-test.c
@@ -384,11 +384,19 @@ 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);
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_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);
--
2.35.1.616.g0bdcbb4464-goog
- [PATCH v3 0/9] This patch series contains updates to PMBus in QEMU along with some PMBus device models for Renesas regulators. I have also added myself to MAINTAINERS as this code is in use daily, where I am responsible for it., Titus Rwantare, 2022/03/01
- [PATCH v3 3/9] hw/i2c: pmbus: add PEC unsupported warning, Titus Rwantare, 2022/03/01
- [PATCH v3 6/9] hw/i2c: Added linear mode translation for pmbus devices, Titus Rwantare, 2022/03/01
- [PATCH v3 7/9] hw/sensor: add Intersil ISL69260 device model, Titus Rwantare, 2022/03/01
- [PATCH v3 8/9] hw/sensor: add Renesas raa229004 PMBus device,
Titus Rwantare <=
- [PATCH v3 4/9] hw/i2c: pmbus: refactor uint handling, Titus Rwantare, 2022/03/01
- [PATCH v3 9/9] hw/sensor: add Renesas raa228000 device, Titus Rwantare, 2022/03/01
- [PATCH v3 1/9] hw/i2c: pmbus: add registers, Titus Rwantare, 2022/03/01
- [PATCH v3 2/9] hw/i2c: pmbus: guard against out of range accesses, Titus Rwantare, 2022/03/01