Commit graph

8 commits

Author SHA1 Message Date
Keith Short c9f822df27 gpio: nct38xx: Remove reg access wrappers
Remove the register access wrappers used to read/write the NCT38xx
register space.

Signed-off-by: Keith Short <keithshort@google.com>
2023-09-11 11:00:47 +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
Nick Ward 2d65acca3a drivers: gpio: use gpio_is_ready_dt helper function
Update `struct gpio_dt_spec` use with gpio_is_ready_dt()

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-08-28 08:48:35 -05:00
Anas Nashif 49b36ead95 drivers: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04: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
Wealian Liao 7dc9143227 drivers: nct38xx: Drop DRV_CONFIG/DRV_DATA usage
Stop using DRV_CONFIG/DRV_DATA macros and use dev->data and dev->config
instead.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2022-01-28 10:06:05 +01:00
Gerard Marull-Paretas b9d573f622 drivers: gpio: nct38xx_alert: use instance based macros
Replace usage of DT_DRV_INST with instance based macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-17 17:30:06 +01: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