16354154eSAndriy Gapon.\" 2*4d846d26SWarner Losh.\" SPDX-License-Identifier: BSD-2-Clause 36354154eSAndriy Gapon.\" 46354154eSAndriy Gapon.\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org> 56354154eSAndriy Gapon.\" 66354154eSAndriy Gapon.\" Redistribution and use in source and binary forms, with or without 76354154eSAndriy Gapon.\" modification, are permitted provided that the following conditions 86354154eSAndriy Gapon.\" are met: 96354154eSAndriy Gapon.\" 1. Redistributions of source code must retain the above copyright 106354154eSAndriy Gapon.\" notice, this list of conditions and the following disclaimer. 116354154eSAndriy Gapon.\" 2. Redistributions in binary form must reproduce the above copyright 126354154eSAndriy Gapon.\" notice, this list of conditions and the following disclaimer in the 136354154eSAndriy Gapon.\" documentation and/or other materials provided with the distribution. 146354154eSAndriy Gapon.\" 156354154eSAndriy Gapon.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 166354154eSAndriy Gapon.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 176354154eSAndriy Gapon.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 186354154eSAndriy Gapon.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 196354154eSAndriy Gapon.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 206354154eSAndriy Gapon.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 216354154eSAndriy Gapon.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 226354154eSAndriy Gapon.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 236354154eSAndriy Gapon.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 246354154eSAndriy Gapon.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 256354154eSAndriy Gapon.\" SUCH DAMAGE. 266354154eSAndriy Gapon.\" 276354154eSAndriy Gapon.Dd November 6, 2021 286354154eSAndriy Gapon.Dt PCF8574 4 296354154eSAndriy Gapon.Os 306354154eSAndriy Gapon.Sh NAME 316354154eSAndriy Gapon.Nm pcf8574 326354154eSAndriy Gapon.Nd driver for the PCF8574 8-bit I2C IO expander 336354154eSAndriy Gapon.Sh SYNOPSIS 346354154eSAndriy GaponTo compile this driver into the kernel, 356354154eSAndriy Gaponplace the following lines in your 366354154eSAndriy Gaponkernel configuration file: 376354154eSAndriy Gapon.Bd -ragged -offset indent 386354154eSAndriy Gapon.Cd "device pcf8574" 396354154eSAndriy Gapon.Cd "device gpio" 406354154eSAndriy Gapon.Cd "device iicbus" 416354154eSAndriy Gapon.Ed 426354154eSAndriy Gapon.Pp 436354154eSAndriy GaponAlternatively, to load the driver as a 446354154eSAndriy Gaponmodule at boot time, place the following line in 456354154eSAndriy Gapon.Xr loader.conf 5 : 466354154eSAndriy Gapon.Bd -literal -offset indent 476354154eSAndriy Gaponpcf8574_load="YES" 486354154eSAndriy Gapon.Ed 496354154eSAndriy Gapon.Sh DESCRIPTION 506354154eSAndriy GaponThe 516354154eSAndriy Gapon.Nm 526354154eSAndriy Gapondriver provides 536354154eSAndriy Gapon.Xr gpiobus 4 546354154eSAndriy Gaponcontrol over 8 GPIO pins. 556354154eSAndriy GaponThe pins are quasi-bidirectional. 566354154eSAndriy GaponOnly low output can be actively driven. 576354154eSAndriy GaponHigh output is equivalent to input. 586354154eSAndriy Gapon.Pp 596354154eSAndriy GaponOn an 606354154eSAndriy Gapon.Xr FDT 4 616354154eSAndriy Gaponbased system the following properties must be set: 626354154eSAndriy Gapon.Bl -tag -width "compatible" 636354154eSAndriy Gapon.It Va compatible 646354154eSAndriy GaponMust be set to "nxp,pcf8574". 656354154eSAndriy Gapon.It Va reg 666354154eSAndriy GaponThe I2C address of 676354154eSAndriy Gapon.Nm . 686354154eSAndriy Gapon.El 696354154eSAndriy Gapon.Pp 706354154eSAndriy GaponThe DTS part for a 716354154eSAndriy Gapon.Nm 726354154eSAndriy Gapondevice usually looks like: 736354154eSAndriy Gapon.Bd -literal 746354154eSAndriy Gapon/ { 756354154eSAndriy Gapon 766354154eSAndriy Gapon ... 776354154eSAndriy Gapon pcf8574@27 { 786354154eSAndriy Gapon compatible = "nxp,pcf8574"; 796354154eSAndriy Gapon reg = <0x27>; 806354154eSAndriy Gapon }; 816354154eSAndriy Gapon}; 826354154eSAndriy Gapon.Ed 836354154eSAndriy Gapon.Sh SEE ALSO 846354154eSAndriy Gapon.Xr fdt 4 , 856354154eSAndriy Gapon.Xr gpiobus 4 , 866354154eSAndriy Gapon.Xr iicbus 4 876354154eSAndriy Gapon.Sh HISTORY 886354154eSAndriy GaponThe 896354154eSAndriy Gapon.Nm 906354154eSAndriy Gapondriver and this manual page was written by 916354154eSAndriy Gapon.An Andriy Gapon Aq Mt avg@FreeBSD.org . 926354154eSAndriy Gapon.Sh BUGS 936354154eSAndriy GaponThe 946354154eSAndriy Gapon.Nm 956354154eSAndriy Gapondriver does not support the input change interrupt 966354154eSAndriy Gaponthat the hardware provides. 97