1470d07d4SAndriy Gapon.\" 2*4d846d26SWarner Losh.\" SPDX-License-Identifier: BSD-2-Clause 3470d07d4SAndriy Gapon.\" 4470d07d4SAndriy Gapon.\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org> 5470d07d4SAndriy Gapon.\" 6470d07d4SAndriy Gapon.\" Redistribution and use in source and binary forms, with or without 7470d07d4SAndriy Gapon.\" modification, are permitted provided that the following conditions 8470d07d4SAndriy Gapon.\" are met: 9470d07d4SAndriy Gapon.\" 1. Redistributions of source code must retain the above copyright 10470d07d4SAndriy Gapon.\" notice, this list of conditions and the following disclaimer. 11470d07d4SAndriy Gapon.\" 2. Redistributions in binary form must reproduce the above copyright 12470d07d4SAndriy Gapon.\" notice, this list of conditions and the following disclaimer in the 13470d07d4SAndriy Gapon.\" documentation and/or other materials provided with the distribution. 14470d07d4SAndriy Gapon.\" 15470d07d4SAndriy Gapon.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16470d07d4SAndriy Gapon.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17470d07d4SAndriy Gapon.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18470d07d4SAndriy Gapon.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19470d07d4SAndriy Gapon.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20470d07d4SAndriy Gapon.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21470d07d4SAndriy Gapon.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22470d07d4SAndriy Gapon.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23470d07d4SAndriy Gapon.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24470d07d4SAndriy Gapon.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25470d07d4SAndriy Gapon.\" SUCH DAMAGE. 26470d07d4SAndriy Gapon.\" 27470d07d4SAndriy Gapon.Dd August 12, 2020 28470d07d4SAndriy Gapon.Dt CP2112 4 29470d07d4SAndriy Gapon.Os 30470d07d4SAndriy Gapon.Sh NAME 31470d07d4SAndriy Gapon.Nm cp2112 32470d07d4SAndriy Gapon.Nd driver for a USB GPIO and I2C peripheral device 33470d07d4SAndriy Gapon.Sh SYNOPSIS 34470d07d4SAndriy GaponTo compile this driver into the kernel, 35470d07d4SAndriy Gaponplace the following lines in your 36470d07d4SAndriy Gaponkernel configuration file: 37470d07d4SAndriy Gapon.Bd -ragged -offset indent 38470d07d4SAndriy Gapon.Cd "device cp2112" 39470d07d4SAndriy Gapon.Cd "device usb" 40470d07d4SAndriy Gapon.Cd "device gpio" 41470d07d4SAndriy Gapon.Cd "device iicbus" 42470d07d4SAndriy Gapon.Ed 43470d07d4SAndriy Gapon.Pp 44470d07d4SAndriy GaponAlternatively, to load the driver as a 45470d07d4SAndriy Gaponmodule at boot time, place the following line in 46470d07d4SAndriy Gapon.Xr loader.conf 5 : 47470d07d4SAndriy Gapon.Bd -literal -offset indent 48470d07d4SAndriy Gaponcp2112_load="YES" 49470d07d4SAndriy Gapon.Ed 50470d07d4SAndriy Gapon.Sh DESCRIPTION 51470d07d4SAndriy GaponThe 52470d07d4SAndriy Gapon.Nm 53470d07d4SAndriy Gapondriver provides support for Silicon Labs CP2112 device. 54470d07d4SAndriy GaponThe device has 8 general purpose I/O pins and an I2C controller that supports 55470d07d4SAndriy Gapona subset of the I2C protocol. 56470d07d4SAndriy Gapon.Pp 57470d07d4SAndriy GaponAll pins support both input and output modes. 58470d07d4SAndriy GaponAn output pin can be configured either for open-drain or push-pull operation. 59470d07d4SAndriy GaponPins 0, 1 and 7 support special functions: I2C transmit indication, 60470d07d4SAndriy GaponI2C receive indication and clock output respectively. 61470d07d4SAndriy GaponAt the moment the 62470d07d4SAndriy Gapon.Nm 63470d07d4SAndriy Gapondriver does not provide a way to enable and configure the special functions. 64470d07d4SAndriy Gapon.Pp 65470d07d4SAndriy GaponThe I2C controller supports read transactions with up to 512 bytes of data, 66470d07d4SAndriy Gaponwrite transactions with up to 61 bytes of data and a write followed by 67470d07d4SAndriy Gaponthe repeated start followed by a read transactions where the write can be 68470d07d4SAndriy Gaponup to 16 bytes and the read can be up to 512 bytes. 69470d07d4SAndriy GaponZero length transfers are not supported. 70470d07d4SAndriy GaponThe 71470d07d4SAndriy Gapon.Nm 72470d07d4SAndriy Gapondriver creates a 73470d07d4SAndriy Gapon.Xr gpio 4 74470d07d4SAndriy Gaponand 75470d07d4SAndriy Gapon.Xr iicbus 4 76470d07d4SAndriy Gaponchild buses to expose the respective functions. 77470d07d4SAndriy Gapon.Sh SEE ALSO 78470d07d4SAndriy Gapon.Xr gpio 4 , 79470d07d4SAndriy Gapon.Xr iicbus 4 , 80470d07d4SAndriy Gapon.Xr usb 4 81470d07d4SAndriy Gapon.Sh HISTORY 82470d07d4SAndriy GaponThe 83470d07d4SAndriy Gapon.Nm 84470d07d4SAndriy Gapondriver and this manual page was written by 85470d07d4SAndriy Gapon.An Andriy Gapon Aq Mt avg@FreeBSD.org . 86