tests: drivers: build_all: Add IT8801 mfd drivers test

Add build tests for the IT8801 MFD drivers, including GPIO,
Input and PWM functionalities.

GPIO, Input test: west build -p always -b native_sim
PWM test: west build -p always -b it82xx2_evb

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit is contained in:
Tim Lin 2024-10-08 17:46:05 +08:00 committed by Benjamin Cabé
commit e7b7356dc4
3 changed files with 113 additions and 0 deletions

View file

@ -338,6 +338,53 @@
};
};
it8801_mfd: it8801@38 {
compatible = "ite,it8801-mfd";
reg = <0x38>;
irq-gpios = <&test_gpio 1 0>;
#address-cells = <1>;
#size-cells = <1>;
ioex_it8801_port0: it8801_port@0 {
compatible = "ite,it8801-gpio";
reg = <0x00 1 /* GPIPSR */
0x05 1 /* GPSOVR */
0x0a 8 /* GPCR */
0x32 1 /* GPISR */
0x37 1>; /* GPIER */
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin-mask = <0xdb>;
};
ioex_it8801_port1: it8801_port@1 {
compatible = "ite,it8801-gpio";
reg = <0x01 1 /* GPIPSR */
0x06 1 /* GPSOVR */
0x12 8 /* GPCR */
0x33 1 /* GPISR */
0x38 1>; /* GPIER */
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin-mask = <0x3f>;
};
ioex_it8801_port2: it8801_port@2 {
compatible = "ite,it8801-gpio";
reg = <0x02 1 /* GPIPSR */
0x07 1 /* GPSOVR */
0x1a 8 /* GPCR */
0x34 1 /* GPISR */
0x39 1>; /* GPIER */
gpio-controller;
#gpio-cells = <2>;
ngpios = <8>;
pin-mask = <0x0f>;
};
};
};
nct3807_alert_1 {

View file

@ -268,6 +268,31 @@
irq-gpios = <&test_gpio 0 0>;
rst-gpios = <&test_gpio 1 0>;
};
it8801_mfd: it8801@38 {
compatible = "ite,it8801-mfd";
reg = <0x38>;
irq-gpios = <&test_gpio 1 0>;
#address-cells = <1>;
#size-cells = <1>;
ioex_it8801_kbd: it8801_kbd@40 {
compatible = "ite,it8801-kbd";
reg = <0x40 1
0x41 1
0x42 1
0x43 1>;
mfdctrl = <>;
kso-mapping = <0 1 20 3 4 5 6
17 18 16 15 11 12>;
row-size = <8>;
col-size = <13>;
kscan_input: kscan-input {
compatible = "zephyr,kscan-input";
};
};
};
};
spi@2 {

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2024 ITE Corporation. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ite/it8801-mfd-map.dtsi>
/ {
test {
#address-cells = <1>;
#size-cells = <1>;
test_i2c: i2c@11112222 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "vnd,i2c";
reg = <0x11112222 0x1000>;
status = "okay";
clock-frequency = <100000>;
it8801_mfd: it8801@38 {
compatible = "ite,it8801-mfd";
reg = <0x38>;
#address-cells = <1>;
#size-cells = <1>;
ioex_it8801_pwm: it8801_pwm@90 {
compatible = "ite,it8801-pwm";
mfdctrl = <&pwm7_gp20_default>;
reg = <0x90 1 /* PWMMCR */
0x94 1 /* PWMDCR */
0x96 1 /* PWMPRSL */
0x97 1>; /* PWMPRSM */
channel = <7>;
#pwm-cells = <3>;
};
};
};
};
};