&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec>;
phy-mode = "rgmii";
phy-handle = <ðphy1>;
status = "okay";
};
...
pinctrl_fec: fecgrp {
fsl,pins = <
MX8MP_IOMUXC_SAI1_RXD4__ENET1_RGMII_RD0 0x90
MX8MP_IOMUXC_SAI1_RXD5__ENET1_RGMII_RD1 0x90
MX8MP_IOMUXC_SAI1_RXD6__ENET1_RGMII_RD2 0x90
MX8MP_IOMUXC_SAI1_RXD7__ENET1_RGMII_RD3 0x90
MX8MP_IOMUXC_SAI1_TXC__ENET1_RGMII_RXC 0x90
MX8MP_IOMUXC_SAI1_TXFS__ENET1_RGMII_RX_CTL 0x90
MX8MP_IOMUXC_SAI1_TXD0__ENET1_RGMII_TD0 0x00
MX8MP_IOMUXC_SAI1_TXD1__ENET1_RGMII_TD1 0x00
MX8MP_IOMUXC_SAI1_TXD2__ENET1_RGMII_TD2 0x00
MX8MP_IOMUXC_SAI1_TXD3__ENET1_RGMII_TD3 0x00
MX8MP_IOMUXC_SAI1_TXD4__ENET1_RGMII_TX_CTL 0x00
MX8MP_IOMUXC_SAI1_TXD5__ENET1_RGMII_TXC 0x00
>;
};&i2c5{
clock-frequency = <400000>;
pinctrl-names = "default", "gpio", "adc";
pinctrl-0 = <&pinctrl_i2c5>;
pinctrl-1 = <&pinctrl_i2c5_gpio>;
pinctrl-2 = <&pinctrl_adc>;
scl-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;
sda-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>;
status = "okay";
adc@2f {
compatible = "adi,ad7091r5";
reg = <0x2f>;
};
};
...
pinctrl_adc: adcgpiogrp {
fsl,pins = <
MX8MP_IOMUXC_SAI1_TXD1__GPIO4_IO13 0x1c2
MX8MP_IOMUXC_SAI1_RXD5__GPIO4_IO07 0x1c2
>;
};cat /sys/kernel/debug/pinctrl/pinctrl-handles
...
device: 30ad0000.i2c current state: default
state: default
type: MUX_GROUP controller 30330000.pinctrl group: i2c5grp (21) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_DDC_SCL (144)config 000001c2
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_DDC_SDA (145)config 000001c2
state: gpio
type: MUX_GROUP controller 30330000.pinctrl group: i2c5gpiogrp (25) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_DDC_SCL (144)config 000001c2
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_HDMI_DDC_SDA (145)config 000001c2
state: adc
type: MUX_GROUP controller 30330000.pinctrl group: adcgpiogrp (26) function: pinctrl (0)
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_SAI1_TXD1 (95)config 000001c2
type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MP_IOMUXC_SAI1_RXD5 (89)config 000001c2
...Hi @Chavira,
Yes, this solved our problem, we can control GPIO pins with libgpiod library. Thanks a lot!
Regards,
Dragan
Hi @idragan!
I attached two modifications.
with the first one you should be able to use the gpios using the gpio commands (gpioset, gpioget, gpioinfo)
With the second one you should be able to use the gpios usingthe next commands:
$ echo 0 >> /sys/class/leds/
I will wait for your update.
Best Regards!
Chavira
Hi @Chavira,
Thanks for the fast response!
Sure, I'm attaching dts file we're using. As for the pins, yes, we'd like to use SAI1_TXD1, SAI1_RXD5 and SAI1_RXD4 (which is currently not present in this device tree).
Regards,
Dragan
Hi @idragan!
Thank you for contacting NXP Support!
Can you share the device tree of your development board?
The pins that you want to use as a GPIOS are the SAI1_TXD1 and SAI1_RXD5?
Best Regards!
Chavira