git: c81df1c11262 - main - iicbus/mux/pca954x: add support for PCA9546 I2C Switch

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 21 Feb 2024 16:46:46 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=c81df1c112621803abe6a43aa89238c830e86b72

commit c81df1c112621803abe6a43aa89238c830e86b72
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-02-21 09:10:55 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-02-21 16:46:15 +0000

    iicbus/mux/pca954x: add support for PCA9546 I2C Switch
    
    Add support for the 4 channel I2C switch from NXP by adding a new
    description struct and the list entries.  Compared to x=[2345] which
    require code to support the INT, for this one no further changes are
    needed.
    
    Tested on:      WHLE-LS1088A using a SPF+
    MFC after:      1 week
    Reviewed by:    imp
    Differential Revision: https://reviews.freebsd.org/D44009
---
 sys/dev/iicbus/mux/pca954x.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sys/dev/iicbus/mux/pca954x.c b/sys/dev/iicbus/mux/pca954x.c
index aebd55d6c311..befa0db39172 100644
--- a/sys/dev/iicbus/mux/pca954x.c
+++ b/sys/dev/iicbus/mux/pca954x.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
  * Copyright (c) 2020-2021 Andriy Gapon
- * Copyright (c) 2022 Bjoern A. Zeeb
+ * Copyright (c) 2022-2024 Bjoern A. Zeeb
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -69,6 +69,13 @@ static struct pca954x_descr pca9540_descr = {
 	.enable = 0x04,
 };
 
+static struct pca954x_descr pca9546_descr = {
+	.partname = "pca9546",
+	.description = "PCA9546 I2C Switch",
+	.type = PCA954X_SW,
+	.numchannels = 4,
+};
+
 static struct pca954x_descr pca9547_descr = {
 	.partname = "pca9547",
 	.description = "PCA9547 I2C Mux",
@@ -87,6 +94,7 @@ static struct pca954x_descr pca9548_descr = {
 #ifdef FDT
 static struct ofw_compat_data compat_data[] = {
 	{ "nxp,pca9540", (uintptr_t)&pca9540_descr },
+	{ "nxp,pca9546", (uintptr_t)&pca9546_descr },
 	{ "nxp,pca9547", (uintptr_t)&pca9547_descr },
 	{ "nxp,pca9548", (uintptr_t)&pca9548_descr },
 	{ NULL, 0 },
@@ -94,6 +102,7 @@ static struct ofw_compat_data compat_data[] = {
 #else
 static struct pca954x_descr *part_descrs[] = {
 	&pca9540_descr,
+	&pca9546_descr,
 	&pca9547_descr,
 	&pca9548_descr,
 };