Commit graph

7 commits

Author SHA1 Message Date
Bartosz Bilas 66f5fce68f drivers: mfd: gpio: adjust init priority
Take into account the SPI bus init priorirty
that can be used for MFD drivers.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2023-10-26 09:50:31 +02:00
Keith Short ea40f3af24 mfd: Add NCT38xx multi-function driver
The Nuvoton NCT38xx is a multi-function device providing a TCPC
controller and a I/O expander (GPIO driver).  Add a multi-function
driver to manage exclusive access to the device.

Tested with "twister -T tests/drivers/build_all/gpio".

Signed-off-by: Keith Short <keithshort@google.com>
2023-09-11 11:00:47 +02:00
Fabio Baltieri 49b8f95513 drivers: gpio: nct38xx: increase default init priority
Increase the default init priority of nct38xx so that they work well
with the default I2C init priority (50).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-24 15:35:37 +02:00
Keith Short ee0c5f9161 tests: drivers: gpio: Add NCT38xx gpio-alert
Add support for the NCT38xx GPIO alert driver in the build all test.

This fixes issue:
https://github.com/zephyrproject-rtos/zephyr/issues/61436

Signed-off-by: Keith Short <keithshort@google.com>
2023-08-15 21:55:31 +00:00
Kumar Gala 957e263120 drivers: gpio: Update drivers to use devicetree Kconfig symbol
Update gpio drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

We remove 'depend on' Kconfig for symbols that would be implied by
the devicetree node existing.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-23 09:26:09 -05:00
Wealian Liao 1a3a7b1d5e driver: gpio: nct38xx: Improve kconfig prompt
As per the guidelines:
https://docs.zephyrproject.org/latest/guides/build/kconfig/tips.html#prompt-strings
This improves the NCT38XX Kconfig prompt string.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-11-23 13:19:21 -05:00
Wealian Liao 5a9bc389f0 driver: gpio: nct38xx: Add NCT38XX gpio driver support
NCT38XX series, which are i2c-based chips, support a different number
of GPIO functionality. For NCT3807, it has 2 GPIO ports on the same i2c
device address. For NCT3808, it has 2 GPIO ports on different i2c
device addresses. This commit adds NCT38XX GPIO driver support &
provides the interrupt handler for the share alert pin.

The following is NCT3807 devicetree node example:
```
&i2c0_0 {
	nct3807_0: nct3807@70 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "nuvoton,nct38xx-gpio";
		reg = <0x70>;
		label = "NCT3807_0";

		gpio@0 {
			compatible = "nuvoton,nct38xx-gpio-port";
			reg = <0x0>;
			label = "NCT3807_0_GPIO0";
			gpio-controller;
			#gpio-cells = <2>;
			ngpios = <8>;
			pin_mask = <0xff>;
			pinmux_mask = <0xf7>;
		};

		gpio@1 {
			compatible = "nuvoton,nct38xx-gpio-port";
			reg = <0x1>;
			label = "NCT3807_0_GPIO1";
			gpio-controller;
			#gpio-cells = <2>;
			ngpios = <8>;
			pin_mask = <0xff>;
		};
	};
};
```

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-11-20 08:00:38 -05:00