@@ -984,6 +984,11 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
}
break;
+ case PMBUS_IC_DEVICE_ID:
+ pmbus_send(pmdev, pmdev->pages[index].ic_device_id,
+ sizeof(pmdev->pages[index].ic_device_id));
+ break;
+
case PMBUS_CLEAR_FAULTS: /* Send Byte */
case PMBUS_PAGE_PLUS_WRITE: /* Block Write-only */
case PMBUS_STORE_DEFAULT_ALL: /* Send Byte */
@@ -218,6 +218,27 @@ static void isl_pmbus_vr_class_init(ObjectClass *klass, void *data,
k->device_num_pages = pages;
}
+static void isl69259_init(Object *obj)
+{
+ static const uint8_t ic_device_id[] = {0x04, 0x00, 0x81, 0xD2, 0x49};
+ PMBusDevice *pmdev = PMBUS_DEVICE(obj);
+ int i;
+
+ raa22xx_init(obj);
+ for (i = 0; i < pmdev->num_pages; i++) {
+ memcpy(pmdev->pages[i].ic_device_id, ic_device_id, sizeof(ic_device_id));
+ }
+}
+
+static void isl69259_class_init(ObjectClass *klass, void *data)
+{
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ dc->desc = "Renesas ISL69259 Digital Multiphase Voltage Regulator";
+ rc->phases.exit = isl_pmbus_vr_exit_reset;
+ isl_pmbus_vr_class_init(klass, data, 2);
+}
+
static void isl69260_class_init(ObjectClass *klass, void *data)
{
ResettableClass *rc = RESETTABLE_CLASS(klass);
@@ -245,6 +266,14 @@ static void raa229004_class_init(ObjectClass *klass, void *data)
isl_pmbus_vr_class_init(klass, data, 2);
}
+static const TypeInfo isl69259_info = {
+ .name = TYPE_ISL69259,
+ .parent = TYPE_PMBUS_DEVICE,
+ .instance_size = sizeof(ISLState),
+ .instance_init = isl69259_init,
+ .class_init = isl69259_class_init,
+};
+
static const TypeInfo isl69260_info = {
.name = TYPE_ISL69260,
.parent = TYPE_PMBUS_DEVICE,
@@ -271,6 +300,7 @@ static const TypeInfo raa228000_info = {
static void isl_pmbus_vr_register_types(void)
{
+ type_register_static(&isl69259_info);
type_register_static(&isl69260_info);
type_register_static(&raa228000_info);
type_register_static(&raa229004_info);
@@ -407,6 +407,7 @@ typedef struct PMBusPage {
uint16_t mfr_max_temp_1; /* R/W word */
uint16_t mfr_max_temp_2; /* R/W word */
uint16_t mfr_max_temp_3; /* R/W word */
+ uint8_t ic_device_id[16]; /* Read-Only block-read */
} PMBusPage;
/* State */
@@ -12,6 +12,7 @@
#include "hw/i2c/pmbus_device.h"
#include "qom/object.h"
+#define TYPE_ISL69259 "isl69259"
#define TYPE_ISL69260 "isl69260"
#define TYPE_RAA228000 "raa228000"
#define TYPE_RAA229004 "raa229004"
Signed-off-by: Peter Delevoryas <pdel@fb.com> --- hw/i2c/pmbus_device.c | 5 +++++ hw/sensor/isl_pmbus_vr.c | 30 ++++++++++++++++++++++++++++++ include/hw/i2c/pmbus_device.h | 1 + include/hw/sensor/isl_pmbus_vr.h | 1 + 4 files changed, 37 insertions(+)