From 69dd204b6b45987dbf9ce7058cd238d355865281 Mon Sep 17 00:00:00 2001 From: bgardner@wabtec.com Date: Tue, 7 Jun 2005 08:55:38 -0500 Subject: [PATCH] I2C: add new pca9539 driver This is an i2c driver for the Philips PCA9539 (16 bit I/O port). It uses the new i2c-sysfs interfaces. The patch includes documentation. It depends on the patch that renames "i2c-sysfs.h" to "hwmon-sysfs.h" Signed-off-by: Ben Gardner Signed-off-by: Greg Kroah-Hartman --- Documentation/i2c/chips/pca9539 | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/i2c/chips/pca9539 (limited to 'Documentation/i2c/chips') diff --git a/Documentation/i2c/chips/pca9539 b/Documentation/i2c/chips/pca9539 new file mode 100644 index 000000000000..c4fce6a13537 --- /dev/null +++ b/Documentation/i2c/chips/pca9539 @@ -0,0 +1,47 @@ +Kernel driver pca9539 +===================== + +Supported chips: + * Philips PCA9539 + Prefix: 'pca9539' + Addresses scanned: 0x74 - 0x77 + Datasheet: + http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf + +Author: Ben Gardner + + +Description +----------- + +The Philips PCA9539 is a 16 bit low power I/O device. +All 16 lines can be individually configured as an input or output. +The input sense can also be inverted. +The 16 lines are split between two bytes. + + +Sysfs entries +------------- + +Each is a byte that maps to the 8 I/O bits. +A '0' suffix is for bits 0-7, while '1' is for bits 8-15. + +input[01] - read the current value +output[01] - sets the output value +direction[01] - direction of each bit: 1=input, 0=output +invert[01] - toggle the input bit sense + +input reads the actual state of the line and is always available. +The direction defaults to input for all channels. + + +General Remarks +--------------- + +Note that each output, direction, and invert entry controls 8 lines. +You should use the read, modify, write sequence. +For example. to set output bit 0 of 1. + val=$(cat output0) + val=$(( $val | 1 )) + echo $val > output0 + -- cgit v1.2.3-55-g7522