AnsweredAssumed Answered

how to pull low the wifi and BT reset pin in yocto

Question asked by Joshua Jhan on Oct 6, 2019
Latest reply on Oct 13, 2019 by Joshua Jhan

device is  i.MX 8M mini

yocto version is imx-4.14.98-2.0.0_ga

 

I try to pull low the wifi and BT reset pin IMX8MM

but I have had no success yet.

 

first, I know the wifi and bt reset pin is gpio2-10 and gpio2-6
so I tried to modify the dts file as below

tmp/work/imx8mmevk-poky-linux/linux-imx/4.14.98-r0/git/arch/arm64/boot/dts/freescale/imx8mm-evk.dts

 

modem_reset: modem-reset {
compatible = "gpio-reset";
reset-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; //modify to GPIO_ACTIVE_HIGH
reset-delay-us = <2000>;
reset-post-delay-ms = <40>;
#reset-cells = <0>;
};

 

ir_recv: ir-receiver {
compatible = "gpio-ir-receiver";
gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ir_recv>;
};

 

regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;

 

reg_sd1_vmmc: sd1_regulator {
compatible = "regulator-fixed";
regulator-name = "WLAN_EN";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio2 10 GPIO_ACTIVE_HIGH>;
off-on-delay = <20000>;
startup-delay-us = <100>;
// enable-active-high; remove the description

};

 

but the wifi reset pin still high

 

root@imx8mmevk:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/30200000.gpio, 30200000.gpio:
gpio-13 ( |gpio-ir-recv ) in hi IRQ
gpio-15 ( |cd ) in lo IRQ

 

gpiochip1: GPIOs 32-63, parent: platform/30210000.gpio, 30210000.gpio:
gpio-38 ( |? ) out lo
gpio-42 ( |WLAN_EN ) out hi
gpio-51 ( |VSD_3V3 ) out hi

 

gpiochip2: GPIOs 64-95, parent: platform/30220000.gpio, 30220000.gpio:
gpio-80 ( |status ) out hi

 

gpiochip3: GPIOs 96-127, parent: platform/30230000.gpio, 30230000.gpio:

 

gpiochip4: GPIOs 128-159, parent: platform/30240000.gpio, 30240000.gpio:
gpio-149 ( |wlf,mute ) out hi

 

gpiochip5: GPIOs 496-511, parent: i2c/2-0020, tca6416, can sleep:
gpio-497 ( |EXT_PWREN ) out hi
gpio-499 ( |ak5558,pdn ) out lo

 

 

and I tried to control the GPIO pin in the system, but will Device or resource busy

 

root@imx8mmevk:~# echo 42 > /sys/class/gpio/export
-sh: echo: write error: Device or resource busy
root@imx8mmevk:~# echo 38 > /sys/class/gpio/export
-sh: echo: write error: Device or resource busy

 

 

so how should I control the wifi and BT reset pin correctly?

 

Thanks

Outcomes