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