xref: /freebsd/share/man/man4/ltc430x.4 (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1.\"-
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2019 Ian Lepore <ian@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 September 2, 2020
28.Dt LTC430X 4
29.Os
30.Sh NAME
31.Nm ltc430x
32.Nd driver for LTC4305 and LTC4306 I2C mux chips
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 ltc430x"
39.Ed
40.Pp
41Alternatively, to load the driver as a
42module at boot time, place the following line in
43.Xr loader.conf 5 :
44.Bd -literal -offset indent
45ltc430x_load="YES"
46.Ed
47.Sh DESCRIPTION
48The
49.Nm
50driver supports the LTC4305 and LTC4306 I2C bus multiplexer (mux) chips.
51It automatically connects an upstream I2C bus to one of several downstream
52buses as needed when slave devices on the downstream buses initiate I/O.
53More information on the automatic switching behavior is available in
54.Xr iicmux 4 .
55.Sh FDT CONFIGURATION
56On an
57.Xr fdt 4
58based system, an
59.Nm
60device node is defined as a child node of its upstream i2c bus.
61The children of the
62.Nm
63node are additional i2c buses, which will have their own i2c slave
64devices described in their child nodes.
65.Pp
66The
67.Nm
68driver conforms to the standard
69.Bk -words
70.Li i2c/i2c-mux-ltc4306.txt
71.Ek
72bindings document, except that the following optional properties
73are not currently supported and will be ignored if present:
74.Bl -bullet -compact -inset -offset indent
75.It
76enable-gpios
77.It
78gpio-controller
79.It
80#gpio-cells
81.It
82ltc,downstream-accelerators-enable
83.It
84ltc,upstream-accelerators-enable
85.El
86.Pp
87In addition, the following additional property is supported:
88.Bl -tag -offset indent -width indent
89.It Va freebsd,ctlreg2
90A value to store into the chip's control register 2 during initialization.
91Consult the chip datasheet for the meaning of the various bits in
92the register.
93.El
94.Sh HINTS CONFIGURATION
95On a
96.Xr device.hints 5
97based system, the following hints are required:
98.Bl -tag -offset indent -width indent
99.It Va hint.ltc430x.<unit>.at
100The upstream
101.Xr iicbus 4
102the
103.Nm
104instance is attached to.
105.It Va hint.ltc430x.<unit>.addr
106The slave address of the
107.Nm
108instance on the upstream bus.
109.It Va hint.ltc430x.<unit>.chip_type
110The type of chip the driver is controlling.
111Valid values are
112.Dq ltc4305
113and
114.Dq ltc4306 .
115.El
116.Pp
117The following hints are optional:
118.Bl -tag -offset indent -width indent
119.It Va hint.ltc430x.<unit>.ctlreg2
120A value to store into the chip's control register 2 during initialization.
121Consult the chip datasheet for the meaning of the various bits in
122the register.
123This hint is optional; when missing, the driver does not update control
124register 2.
125.It Va hint.ltc430x.<unit>.idle_disconnect
126Whether to disconnect all downstream busses from the upstream bus when idle.
127If set to zero, the most recently used downstream bus is left connected to
128the upstream bus after IO completes.
129Any non-zero value causes all downstream busses to be disconnected when idle.
130This hint is optional; when missing, the driver behaves as if it were zero.
131.El
132.Pp
133When configured via hints, the driver automatically adds an iicbus
134instance for every downstream bus supported by the chip.
135There is currently no way to indicate used versus unused downstream channels.
136.Sh SEE ALSO
137.Xr iicbus 4 ,
138.Xr iicmux 4
139.Sh HISTORY
140The
141.Nm
142driver first appeared in
143.Fx 13.0 .
144