This is a 12-bit, 8-channel ADC I2C device, which is used on several
OpenBMC platforms.

QOM properties can be used to change input ADC values and external VREF at
run time.

Add it to AST2600-based Anacapa machine, along with some functional tests
that use QOM properties to inject voltage values into analog inputs.

Datasheet: https://www.ti.com/lit/gpn/ADC128D818

Signed-off-by: Emmanuel Blot <[email protected]>
---
Changes in v5:
- Change author/committer/signed-off-by address to circumvent SMTP issues
- Link to v4: 
https://lore.kernel.org/qemu-devel/[email protected]

Changes in v4:
- Better follow QEMU coding style (lowercase hex number, signed integer
  constants, parent object variable name in Device)
- Split adc128d818 test large commit into smaller ones
- Link to v3: 
https://lore.kernel.org/qemu-devel/[email protected]

Changes in v3:
- Update anacapa test image with proper DTB
- Make I2C device in i2c_slave_create_simple a child of the I2C bus
- Simplify tests/functional/arm/test_aspeed_anacapa.py
- Use g_test_message rather than fprintf
- Keep review trailers
- Link to v2: 
https://lore.kernel.org/qemu-devel/[email protected]

Changes in v2:
- Remove clang-format useless comment sections
- Link to v1: 
https://lore.kernel.org/qemu-devel/[email protected]

To: [email protected]
Cc: Paolo Bonzini <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Cc: Fabiano Rosas <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Cédric Le Goater <[email protected]>
Cc: Steven Lee <[email protected]>
Cc: Troy Lee <[email protected]>
Cc: Jamin Lin <[email protected]>
Cc: Kane Chen <[email protected]>
Cc: Andrew Jeffery <[email protected]>
Cc: Joel Stanley <[email protected]>
Cc: [email protected]
Cc: Corey Minyard <[email protected]>

---
Emmanuel Blot (8):
      hw/sensor: adc128d818: add 12-bit 8-channel ADC device
      tests/qtest: adc128d818: add test harness and register access
      tests/qtest: adc128d818: test voltage and temperature conversion
      tests/qtest: adc128d818: test limit interrupts
      tests/qtest: adc128d818: test operating modes and power control
      hw/i2c: parent slaves created with i2c_slave_create_simple
      hw/arm: anacapa: add ADC128D818 devices
      test/functional: anacapa: test ADC128D818

 hw/arm/Kconfig                              |   1 +
 hw/arm/aspeed_ast2600_anacapa.c             |  21 +-
 hw/i2c/core.c                               |   3 +
 hw/sensor/Kconfig                           |   4 +
 hw/sensor/adc128d818.c                      | 696 ++++++++++++++++++++++
 hw/sensor/meson.build                       |   1 +
 hw/sensor/trace-events                      |   8 +
 include/hw/i2c/i2c.h                        |   7 +-
 include/hw/sensor/adc128d818.h              |  14 +
 tests/functional/arm/test_aspeed_anacapa.py |  69 ++-
 tests/qtest/adc128d818-test.c               | 856 ++++++++++++++++++++++++++++
 tests/qtest/meson.build                     |   1 +
 12 files changed, 1669 insertions(+), 12 deletions(-)
---
base-commit: c682d7d73adfddbbcfb2613942d7c96fb43534af
change-id: 20260612-i2c-adc128d818-anacapa-13c63e97fbd0

Best regards,
--  
Emmanuel Blot <[email protected]>


Reply via email to