xref: /freebsd/share/man/man4/pca954x.4 (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd November 13, 2021
28.Dt PCA954X 4
29.Os
30.Sh NAME
31.Nm pca954x
32.Nd driver for PCA9548A I2C switch
33.Sh SYNOPSIS
34To compile this driver into the kernel,
35place the following line in your
36kernel configuration file:
37.Bd -ragged -offset indent
38.Cd "device pca954x"
39.Cd "device iicmux"
40.Cd "device iicbus"
41.Ed
42.Pp
43Alternatively, to load the driver as a
44module at boot time, place the following line in
45.Xr loader.conf 5 :
46.Bd -literal -offset indent
47pca954x_load="YES"
48.Ed
49.Sh DESCRIPTION
50The
51.Nm
52driver supports the PCA9548A I2C bus switch and compatible chips such as
53TCA9548A.
54It automatically connects an upstream I2C bus to one of several downstream
55buses as needed when slave devices on the downstream buses initiate I/O.
56More information on the automatic switching behavior is available in
57.Xr iicmux 4 .
58.Sh FDT CONFIGURATION
59On an
60.Xr FDT 4
61based system, an
62.Nm
63device node is defined as a child node of its upstream I2C bus.
64The children of the
65.Nm
66node are additional I2C buses, which will have their own I2C slave
67devices described in their child nodes.
68.Pp
69The
70.Nm
71driver attaches to nodes where the
72.Va compatible
73property is set to one of
74.Bl -bullet
75.It
76.Qq nxp,pca9548
77.El
78.Pp
79The
80.Nm
81driver supports the following optional properties in addition to the standard
82I2C mux properties:
83.Bl -tag -width i2c-mux-idle-disconnect
84.It Va i2c-mux-idle-disconnect
85if defined, forces the switch to disconnect all children in idle state.
86.El
87.Sh HINTS CONFIGURATION
88On a
89.Xr device.hints 5
90based system, these values are configurable for
91.Nm :
92.Bl -tag -width hint.pca954x.<unit>.chip_type
93.It Va hint.pca954x.<unit>.at
94The upstream
95.Xr iicbus 4
96the
97.Nm
98instance is attached to.
99.It Va hint.pca954x.<unit>.chip_type
100The type of the chip.
101At present, only
102.Qq pca9548
103is supported.
104.El
105.Pp
106When configured via hints, the driver automatically adds an
107.Xr iicbus 4
108instance for every downstream bus supported by the chip.
109There is currently no way to indicate used versus unused channels.
110.Sh SEE ALSO
111.Xr iicbus 4 ,
112.Xr iicmux 4
113.Sh HISTORY
114The
115.Nm
116driver and this manual page was written by
117.An Andriy Gapon Aq Mt avg@FreeBSD.org .
118