Merge branch 'for-linus' of git://www.jni.nu/cris
[pandora-kernel.git] / Documentation / i2c / chips / pca9539
1 Kernel driver pca9539
2 =====================
3
4 NOTE: this driver is deprecated and will be dropped soon, use
5 drivers/gpio/pca9539.c instead.
6
7 Supported chips:
8   * Philips PCA9539
9     Prefix: 'pca9539'
10     Addresses scanned: none
11     Datasheet:
12         http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf
13
14 Author: Ben Gardner <bgardner@wabtec.com>
15
16
17 Description
18 -----------
19
20 The Philips PCA9539 is a 16 bit low power I/O device.
21 All 16 lines can be individually configured as an input or output.
22 The input sense can also be inverted.
23 The 16 lines are split between two bytes.
24
25
26 Detection
27 ---------
28
29 The PCA9539 is difficult to detect and not commonly found in PC machines,
30 so you have to pass the I2C bus and address of the installed PCA9539
31 devices explicitly to the driver at load time via the force=... parameter.
32
33
34 Sysfs entries
35 -------------
36
37 Each is a byte that maps to the 8 I/O bits.
38 A '0' suffix is for bits 0-7, while '1' is for bits 8-15.
39
40 input[01]     - read the current value
41 output[01]    - sets the output value
42 direction[01] - direction of each bit: 1=input, 0=output
43 invert[01]    - toggle the input bit sense
44
45 input reads the actual state of the line and is always available.
46 The direction defaults to input for all channels.
47
48
49 General Remarks
50 ---------------
51
52 Note that each output, direction, and invert entry controls 8 lines.
53 You should use the read, modify, write sequence.
54 For example. to set output bit 0 of 1.
55   val=$(cat output0)
56   val=$(( $val | 1 ))
57   echo $val > output0
58