Documentation/driver-api/gpio/pca953x.rst

Source file repositories/reference/linux-study-clean/Documentation/driver-api/gpio/pca953x.rst

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/gpio/pca953x.rst
Extension
.rst
Size
25967 bytes
Lines
640
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

============================================
PCA953x I²C GPIO expander compatibility list
============================================

:Author: Levente Révész <levente.revesz@eilabs.com>

I went through all the datasheets and created this note listing
chip functions and register layouts.

Overview of chips
=================

Chips with the basic 4 registers
--------------------------------

These chips have 4 register banks: input, output, invert and direction.
Each of these banks contains (lines/8) registers, one for each GPIO port.

Banks offset is always a power of 2:

- 4 lines  -> bank offset is 1
- 8 lines  -> bank offset is 1
- 16 lines -> bank offset is 2
- 24 lines -> bank offset is 4
- 32 lines -> bank offset is 4
- 40 lines -> bank offset is 8

For example, register layout of GPIO expander with 24 lines:

+------+-----------------+--------+
| addr | function        | bank   |
+======+=================+========+
|  00  | input port0     |        |
+------+-----------------+        |
|  01  | input port1     | bank 0 |
+------+-----------------+        |
|  02  | input port2     |        |
+------+-----------------+--------+
|  03  | n/a             |        |
+------+-----------------+--------+
|  04  | output port0    |        |
+------+-----------------+        |
|  05  | output port1    | bank 1 |
+------+-----------------+        |
|  06  | output port2    |        |
+------+-----------------+--------+
|  07  | n/a             |        |
+------+-----------------+--------+
|  08  | invert port0    |        |
+------+-----------------+        |
|  09  | invert port1    | bank 2 |
+------+-----------------+        |
|  0A  | invert port2    |        |
+------+-----------------+--------+
|  0B  | n/a             |        |
+------+-----------------+--------+
|  0C  | direction port0 |        |
+------+-----------------+        |
|  0D  | direction port1 | bank 3 |
+------+-----------------+        |
|  0E  | direction port2 |        |
+------+-----------------+--------+
|  0F  | n/a             |        |
+------+-----------------+--------+

.. note::
     This is followed by all supported chips, except by pcal6534.

The table below shows the offsets for each of the compatible chips:

Annotation

Implementation Notes