How to enable GPIO function in dts file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable GPIO function in dts file

1,084 Views
stevenyu
Contributor III

Hi Support,

We know the upper layer Linux command to export gpio and then we can echo 0/1 to gpio path. 

However, we would like to make MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 to be a GPIO output function.

Should we need to put this define flag to dts file, and would you please advise where should we put it to ?

Because we don't find specific gpio paragraph in dts file, and only see something like below. The  MX6ULL_PAD_SNVS_TAMPER0__GPIO5_IO00 is put to hoggrp and be used by hoggrp for GPIO control. 

We also want to use MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 as GPIO control, and not used by hoggrp, but will be used by upper layer control (e.g. echo 1 > /sys/class/gpio/gpio18/value).

pinctrl_hog_2: hoggrp-2 {
fsl,pins = <
MX6ULL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x80000000
>;
};

Regards,

Steven Yu

Labels (1)
0 Kudos
1 Reply

634 Views
igorpadykov
NXP Employee
NXP Employee

Hi Steven

in general this may depend on used kernel, but in nxp bsps seems

gpio output function (gpio direction) can not be set in dts file.

It also may be posted on kernel mail list

Majordomo Lists at VGER.KERNEL.ORG 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos