Skip to content

Commit 8a9763a

Browse files
JiafeiPankartben
authored andcommitted
boards: imx8mn_evk_a53: add i2c gpio expander support
Added gpio expander pca6416 support on the board, it use i2c bus to expand IO ports. Added GPIO test case overlay for the board. Signed-off-by: Jiafei Pan <[email protected]>
1 parent 2c2430c commit 8a9763a

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

boards/nxp/imx8mn_evk/imx8mn_evk-pinctrl.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,16 @@
6363
drive-strength = "x6";
6464
};
6565
};
66+
67+
pinmux_i2c3: pinmux_i2c3 {
68+
group0 {
69+
pinmux = <&iomuxc_i2c3_scl_i2c_scl_i2c3_scl>,
70+
<&iomuxc_i2c3_sda_i2c_sda_i2c3_sda>;
71+
bias-pull-up;
72+
input-schmitt-enable;
73+
slew-rate = "slow";
74+
drive-strength = "x4";
75+
input-enable;
76+
};
77+
};
6678
};

boards/nxp/imx8mn_evk/imx8mn_evk_mimx8mn6_a53.dts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/dts-v1/;
88

9+
#include <zephyr/dt-bindings/gpio/gpio.h>
10+
#include <zephyr/dt-bindings/i2c/i2c.h>
911
#include <nxp/nxp_mimx8mn_a53.dtsi>
1012
#include "imx8mn_evk-pinctrl.dtsi"
1113

@@ -67,3 +69,23 @@
6769
pinctrl-names = "default";
6870
status = "okay";
6971
};
72+
73+
&gpio1 {
74+
status = "okay";
75+
};
76+
77+
&i2c3 {
78+
status = "okay";
79+
pinctrl-0 = <&pinmux_i2c3>;
80+
pinctrl-names = "default";
81+
clock-frequency = <I2C_BITRATE_STANDARD>;
82+
83+
gpio_exp1: pca6416@20 {
84+
compatible = "nxp,pca6416";
85+
reg = <0x20>;
86+
gpio-controller;
87+
#gpio-cells = <2>;
88+
interrupt-gpios = <&gpio1 12 (GPIO_ACTIVE_LOW|GPIO_PULL_UP)>;
89+
status = "okay";
90+
};
91+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/{
8+
resources {
9+
compatible = "test-gpio-basic-api";
10+
/*
11+
* Use connector J1003 Pin-12 GPIO.1 which connect to pca6416 P1_2 as input
12+
* GPIO, and connector J1003 Pin-16 GPIO.4 which connect to pca6416 P1_5 as
13+
* output GPIO, connect these two pins with a Dupont Line.
14+
*/
15+
out-gpios = <&gpio_exp1 10 0>;
16+
in-gpios = <&gpio_exp1 13 0>;
17+
};
18+
};

0 commit comments

Comments
 (0)