How to enable GPIO function in dts file

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to enable GPIO function in dts file

1,273 次查看
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

标签 (1)
0 项奖励
回复
1 回复

823 次查看
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 项奖励
回复