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>
This commit is contained in:
Keith Short 2023-07-19 12:02:34 -06:00 committed by Fabio Baltieri
commit ea40f3af24
14 changed files with 442 additions and 281 deletions

View file

@ -103,63 +103,72 @@
gpio-controller;
};
test_i2c_nct3807: nct3807@72 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nuvoton,nct38xx-gpio";
mfd-nct38xx@72 {
compatible = "nuvoton,nct38xx";
reg = <0x72>;
test_i2c_nct3807: nct3807 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nuvoton,nct38xx-gpio";
gpio@0 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xff>;
pinmux_mask = <0xf7>;
};
gpio@0 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xff>;
pinmux_mask = <0xf7>;
};
gpio@1 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x1>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xff>;
gpio@1 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x1>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xff>;
};
};
};
test_i2c_nct3808_p1: nct3808_0_P1@71 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nuvoton,nct38xx-gpio";
test_i2c_nct3808_p1: mfd-nct38xx@71 {
compatible = "nuvoton,nct38xx";
reg = <0x71>;
nct3808_0_P1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nuvoton,nct38xx-gpio";
gpio@0 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xdc>;
pinmux_mask = <0xff>;
gpio@0 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xdc>;
pinmux_mask = <0xff>;
};
};
};
test_i2c_nct3808_p2: nct3808_0_P2@75 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nuvoton,nct38xx-gpio";
test_i2c_nct3808_p2: mfd-nct38xx@75 {
compatible = "nuvoton,nct38xx";
reg = <0x75>;
nct3808_0_P2 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nuvoton,nct38xx-gpio";
gpio@0 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xdc>;
pinmux_mask = <0xff>;
gpio@0 {
compatible = "nuvoton,nct38xx-gpio-port";
reg = <0x0>;
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin_mask = <0xdc>;
pinmux_mask = <0xff>;
};
};
};