[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 52/60] hw/i2c: pmbus: add VCAP register
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 52/60] hw/i2c: pmbus: add VCAP register |
Date: |
Mon, 6 Nov 2023 12:03:24 +0100 |
From: Titus Rwantare <titusr@google.com>
VCAP is a register for devices with energy storage capacitors.
Reviewed-by: Benjamin Streb <bstreb@google.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Titus Rwantare <titusr@google.com>
Message-ID: <20231023-staging-pmbus-v3-v4-4-07a8cb7cd20a@google.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/i2c/pmbus_device.h | 1 +
hw/i2c/pmbus_device.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h
index ad431bdc7c..f195c11384 100644
--- a/include/hw/i2c/pmbus_device.h
+++ b/include/hw/i2c/pmbus_device.h
@@ -243,6 +243,7 @@ OBJECT_DECLARE_TYPE(PMBusDevice, PMBusDeviceClass,
#define PB_HAS_VIN_RATING BIT_ULL(13)
#define PB_HAS_VOUT_RATING BIT_ULL(14)
#define PB_HAS_VOUT_MODE BIT_ULL(15)
+#define PB_HAS_VCAP BIT_ULL(16)
#define PB_HAS_IOUT BIT_ULL(21)
#define PB_HAS_IIN BIT_ULL(22)
#define PB_HAS_IOUT_RATING BIT_ULL(23)
diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c
index c1d8c93056..3bce39e84e 100644
--- a/hw/i2c/pmbus_device.c
+++ b/hw/i2c/pmbus_device.c
@@ -906,6 +906,14 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
}
break;
+ case PMBUS_READ_VCAP: /* Read-Only word */
+ if (pmdev->pages[index].page_flags & PB_HAS_VCAP) {
+ pmbus_send16(pmdev, pmdev->pages[index].read_vcap);
+ } else {
+ goto passthough;
+ }
+ break;
+
case PMBUS_READ_VOUT: /* Read-Only word */
if (pmdev->pages[index].page_flags & PB_HAS_VOUT) {
pmbus_send16(pmdev, pmdev->pages[index].read_vout);
--
2.41.0
- [PULL 42/60] hw/isa/i82378: Propagate error if PC_SPEAKER device creation failed, (continued)
- [PULL 42/60] hw/isa/i82378: Propagate error if PC_SPEAKER device creation failed, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 43/60] hw/i386: Fix comment style in topology.h, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 44/60] tests/unit: Rename test-x86-cpuid.c to test-x86-topo.c, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 45/60] system/cpus: Fix CPUState.nr_cores' calculation, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 46/60] hw/cpu: Update the comments of nr_cores and nr_dies, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 47/60] hw/ide: reset: cancel async DMA operation before resetting state, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 48/60] tests/qtest: ahci-test: add test exposing reset issue with pending callback, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 49/60] hw/i2c: pmbus add support for block receive, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 50/60] hw/i2c: pmbus: add vout mode bitfields, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 51/60] hw/i2c: pmbus: add fan support, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 52/60] hw/i2c: pmbus: add VCAP register,
Philippe Mathieu-Daudé <=
- [PULL 53/60] hw/sensor: add ADM1266 device model, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 54/60] tests/qtest: add tests for ADM1266, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 59/60] MAINTAINERS: update libvirt devel mailing list address, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 55/60] hw/i2c: pmbus: immediately clear faults on request, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 56/60] hw/i2c: pmbus: reset page register for out of range reads, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 57/60] MAINTAINERS: Add include/hw/timer/tmu012.h to the SH4 R2D section, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 58/60] MAINTAINERS: Add the CAN documentation file to the CAN section, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 60/60] ui/sdl2: use correct key names in win title on mac, Philippe Mathieu-Daudé, 2023/11/06
- Re: [PULL 00/60] Misc HW/UI patches for 2023-11-06, Stefan Hajnoczi, 2023/11/06