Commit graph

14 commits

Author SHA1 Message Date
TOKITA Hiroshi
29fe58f7a4 drivers: gpio: mcp23xxx: Fix to allow the use of multiple models
Compilation will fail if multiple models are used at the same time.
Changing to define different unique names for the symbols
to avoid conflicts.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-16 13:09:38 +01:00
Armin Brauns
ede19a4337 drivers: mcp23xxx: add support for open-drain chip variants
Pin definitions should correctly reflect the actual drive mode of the GPIO
controller, either push-pull or open drain.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-08-09 09:55:30 +02:00
Armin Brauns
054cc09c88 drivers: add bindings for all existing mcp23xxx variants
This allows getting rid of the ngpios property, which is implicit in the
part number. It also prepares for configuring pins as open-drain on
supporting chips in the next commit.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-08-09 09:55:30 +02:00
Armin Brauns
01e8b3445e drivers: gpio: mcp23xxx: add support for reset pin
This allows the device to be reset to a known state before initialization.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-03-20 10:43:12 +01:00
Armin Brauns
0db9785892 drivers: gpio: mcp23xxx: support pin interrupts
No single-edge interrupts for now, since they are not supported in
hardware.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-03-20 10:43:12 +01:00
Armin Brauns
53a3ff0dff drivers: mcp230xx: make config struct const
`struct device::config` is a `const void *`, so this struct does not need
to be mutable.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-11-15 19:10:14 -05:00
Armin Brauns
1cfd54db7e drivers: mcp230xx: fix for multiple instances
Parts of the macro used `inst`, others `n` for the instance number; only
`n` was actually defined (so `inst` expanded to the empty string, causing
name errors with more than one instance).

Unify everything to `inst`.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-11-15 19:10:14 -05:00
Armin Brauns
6468a4458b drivers: mcp230xx: formatting
It's a formatting cleanup. Not much to explain here, but CI requires a body
text.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-11-15 19:10:14 -05:00
Balaji Kulkarni
7f1a5cce12 drivers: gpio: expose gpio_utils.h to external GPIO drivers
Expose "gpio_utils.h" header for external GPIO drivers.

Fixes #48609.

Signed-off-by: Balaji Kulkarni <balaji.kulkarni92@gmail.com>
2022-10-27 15:38:51 +02:00
Gerard Marull-Paretas
fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Ryan McClelland
dacae94761 drivers: avoid i2c_burst_write where possible
i2c_burst_write can have portability issues with certain i2c
peripherals that can fail when this api is called. This fixes the case
where this can be easily replaced with i2c_write in mcp230xx,
pca95xx, stmpe1600, max17055, and tmp112.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2021-12-22 12:14:42 +01:00
Gerard Marull-Paretas
38e827dab1 drivers: gpio: mcp230xx: use instance based macros
Replace usage of DT_DRV_INST(n) with instance based macros where
possible.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-17 17:30:06 +01:00
Peter Johanson
a5ad94f20f driver: gpio: mcp23xxx: Refactor to generic.
Refactor the mcp230xx driver to generically also support
SPI IO expanders, renaming it to mcp23xxx in the process.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2021-12-08 08:55:28 -05:00
Lukas Gehreke
0544f5dbc3 drivers: gpio: Added mcp230xx GPIO driver.
Added driver for the mcp230xx series I2C-based GPIO chips.

Signed-off-by: Lukas Gehreke <lk.gehreke@gmail.com>
2021-11-16 10:13:14 -05:00