* [PATCH] Signed-off-by: Henry Tsai <nry@google.com>
@ 2025-10-07 20:08 Henry Tsai
0 siblings, 0 replies; only message in thread
From: Henry Tsai @ 2025-10-07 20:08 UTC (permalink / raw)
To: qemu-devel; +Cc: Patrick Leis, Henry Tsai
This commit adds support for the pca9543.
---
This adds pca9543 support to mux.
Signed-off-by: Henry Tsai <nry@google.com>
---
hw/i2c/i2c_mux_pca954x.c | 12 ++++++++++++
include/hw/i2c/i2c_mux_pca954x.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/hw/i2c/i2c_mux_pca954x.c b/hw/i2c/i2c_mux_pca954x.c
index a8ef640cd2575ac627cdc23b1860a8a3fce8a932..05360b2ac4c095309df261094b368a5b7a2a4c26 100644
--- a/hw/i2c/i2c_mux_pca954x.c
+++ b/hw/i2c/i2c_mux_pca954x.c
@@ -30,6 +30,7 @@
#define PCA9548_CHANNEL_COUNT 8
#define PCA9546_CHANNEL_COUNT 4
+#define PCA9543_CHANNEL_COUNT 2
/*
* struct Pca954xState - The pca954x state object.
@@ -172,6 +173,12 @@ I2CBus *pca954x_i2c_get_bus(I2CSlave *mux, uint8_t channel)
return pca954x->bus[channel];
}
+static void pca9543_class_init(ObjectClass *klass, void *data)
+{
+ Pca954xClass *s = PCA954X_CLASS(klass);
+ s->nchans = PCA9543_CHANNEL_COUNT;
+}
+
static void pca9546_class_init(ObjectClass *klass, const void *data)
{
Pca954xClass *s = PCA954X_CLASS(klass);
@@ -245,6 +252,11 @@ static const TypeInfo pca954x_info[] = {
.class_init = pca954x_class_init,
.abstract = true,
},
+ {
+ .name = TYPE_PCA9543,
+ .parent = TYPE_PCA954X,
+ .class_init = pca9543_class_init,
+ },
{
.name = TYPE_PCA9546,
.parent = TYPE_PCA954X,
diff --git a/include/hw/i2c/i2c_mux_pca954x.h b/include/hw/i2c/i2c_mux_pca954x.h
index 3dd25ec98309d3203200933b7b48f8d9b0b6249b..1da5508ed51a878640e50c4941a07315edcbc187 100644
--- a/include/hw/i2c/i2c_mux_pca954x.h
+++ b/include/hw/i2c/i2c_mux_pca954x.h
@@ -3,6 +3,7 @@
#include "hw/i2c/i2c.h"
+#define TYPE_PCA9543 "pca9543"
#define TYPE_PCA9546 "pca9546"
#define TYPE_PCA9548 "pca9548"
---
base-commit: eb7abb4a719f93ddd56571bf91681044b4159399
change-id: 20251007-add-pca9543-support-9f768ffb4df3
Best regards,
--
Henry Tsai <nry@google.com>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-10-08 0:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07 20:08 [PATCH] Signed-off-by: Henry Tsai <nry@google.com> Henry Tsai
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).