qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] PCA I2C GPIO expanders
@ 2023-02-08 22:43 Titus Rwantare
  2023-02-08 22:43 ` [PATCH v2 1/4] hw/gpio: add PCA6416 i2c GPIO expander Titus Rwantare
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Titus Rwantare @ 2023-02-08 22:43 UTC (permalink / raw)
  To: philmd, minyard, eddie.dong; +Cc: qemu-arm, qemu-devel, joel, Titus Rwantare

This patch series contains a set of i2c GPIO expanders,
with support for 4, 8, and 16 GPIO connections.

The devices are configured as GPIO *inputs by default, but can have pins
configured to be inputs with qmp commands.

For example, the following snippet in a board file for a system,
configures a 16 bit pca6416 to have pins 8-11 as inputs, then asserts
them.

    dev = DEVICE(i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 3), "pca6416", 0x72));
    object_property_set_uint(OBJECT(dev), "gpio_config", 0x0F00, &error_abort);
    object_property_set_uint(OBJECT(dev), "gpio_input", 0x0F00, &error_abort);

We currently use these to test hardware presence and LEDs in simulation.

Thanks

Since v1:
- addressed comments
- fixed typos in commit messages

Titus Rwantare (4):
  hw/gpio: add PCA6416 i2c GPIO expander
  hw/gpio: add PCA9538 8-bit GPIO expander
  hw/gpio: add PCA9536 i2c gpio expander
  hw/i2c: add canonical path to i2c event traces

 hw/arm/Kconfig                  |   1 +
 hw/gpio/Kconfig                 |   4 +
 hw/gpio/meson.build             |   1 +
 hw/gpio/pca_i2c_gpio.c          | 500 ++++++++++++++++++++++++++++++++
 hw/gpio/trace-events            |   5 +
 hw/i2c/core.c                   |   8 +-
 hw/i2c/trace-events             |   2 +-
 include/hw/gpio/pca_i2c_gpio.h  |  78 +++++
 tests/lcitool/libvirt-ci        |   2 +-
 tests/qtest/meson.build         |   1 +
 tests/qtest/pca_i2c_gpio-test.c | 169 +++++++++++
 11 files changed, 766 insertions(+), 5 deletions(-)
 create mode 100644 hw/gpio/pca_i2c_gpio.c
 create mode 100644 include/hw/gpio/pca_i2c_gpio.h
 create mode 100644 tests/qtest/pca_i2c_gpio-test.c

-- 
2.39.1.581.gbfd45094c4-goog



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-02-09  8:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08 22:43 [PATCH v2 0/4] PCA I2C GPIO expanders Titus Rwantare
2023-02-08 22:43 ` [PATCH v2 1/4] hw/gpio: add PCA6416 i2c GPIO expander Titus Rwantare
2023-02-09  7:44   ` Philippe Mathieu-Daudé
2023-02-08 22:43 ` [PATCH v2 2/4] hw/gpio: add PCA9538 8-bit " Titus Rwantare
2023-02-09  7:57   ` Philippe Mathieu-Daudé
2023-02-08 22:43 ` [PATCH v2 3/4] hw/gpio: add PCA9536 i2c gpio expander Titus Rwantare
2023-02-09  8:00   ` Philippe Mathieu-Daudé
2023-02-08 22:43 ` [PATCH v2 4/4] hw/i2c: add canonical path to i2c event traces Titus Rwantare
2023-02-09  8:01   ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).