mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
hw/sensor: add Renesas raa228000 device
Signed-off-by: Titus Rwantare <titusr@google.com> Reviewed-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Corey Minyard <cminyard@mvista.com> Message-Id: <20220307200605.4001451-10-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
1c0c52f762
commit
5f14cd7032
3 changed files with 123 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
PMBusDevice *pmdev = PMBUS_DEVICE(obj);
|
||||
|
||||
isl_pmbus_vr_exit_reset(obj);
|
||||
|
||||
pmdev->pages[0].read_iout = 0;
|
||||
pmdev->pages[0].read_pout = 0;
|
||||
pmdev->pages[0].read_vout = 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;
|
||||
}
|
||||
|
||||
static void isl_pmbus_vr_add_props(Object *obj, uint64_t *flags, uint8_t pages)
|
||||
{
|
||||
PMBusDevice *pmdev = PMBUS_DEVICE(obj);
|
||||
|
@ -177,6 +195,20 @@ static void raa22xx_init(Object *obj)
|
|||
isl_pmbus_vr_add_props(obj, flags, ARRAY_SIZE(flags));
|
||||
}
|
||||
|
||||
static void raa228000_init(Object *obj)
|
||||
{
|
||||
PMBusDevice *pmdev = PMBUS_DEVICE(obj);
|
||||
uint64_t flags[1];
|
||||
|
||||
flags[0] = PB_HAS_VIN | PB_HAS_VOUT | PB_HAS_VOUT_MODE |
|
||||
PB_HAS_VOUT_RATING | PB_HAS_VOUT_MARGIN | PB_HAS_IIN |
|
||||
PB_HAS_IOUT | PB_HAS_PIN | PB_HAS_POUT | PB_HAS_TEMPERATURE |
|
||||
PB_HAS_TEMP2 | PB_HAS_TEMP3 | PB_HAS_STATUS_MFR_SPECIFIC;
|
||||
|
||||
pmbus_page_config(pmdev, 0, flags[0]);
|
||||
isl_pmbus_vr_add_props(obj, flags, 1);
|
||||
}
|
||||
|
||||
static void isl_pmbus_vr_class_init(ObjectClass *klass, void *data,
|
||||
uint8_t pages)
|
||||
{
|
||||
|
@ -195,6 +227,15 @@ static void isl69260_class_init(ObjectClass *klass, void *data)
|
|||
isl_pmbus_vr_class_init(klass, data, 2);
|
||||
}
|
||||
|
||||
static void raa228000_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
dc->desc = "Renesas 228000 Digital Multiphase Voltage Regulator";
|
||||
rc->phases.exit = raa228000_exit_reset;
|
||||
isl_pmbus_vr_class_init(klass, data, 1);
|
||||
}
|
||||
|
||||
static void raa229004_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||
|
@ -220,9 +261,18 @@ static const TypeInfo raa229004_info = {
|
|||
.class_init = raa229004_class_init,
|
||||
};
|
||||
|
||||
static const TypeInfo raa228000_info = {
|
||||
.name = TYPE_RAA228000,
|
||||
.parent = TYPE_PMBUS_DEVICE,
|
||||
.instance_size = sizeof(ISLState),
|
||||
.instance_init = raa228000_init,
|
||||
.class_init = raa228000_class_init,
|
||||
};
|
||||
|
||||
static void isl_pmbus_vr_register_types(void)
|
||||
{
|
||||
type_register_static(&isl69260_info);
|
||||
type_register_static(&raa228000_info);
|
||||
type_register_static(&raa229004_info);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue