How to set GPIOs to pre-defined value

Brad Chou chou.brad at gmail.com
Tue May 7 18:52:18 AEST 2019


Hi Samuel,
Thanks for your reply, I am using AST2500.
I tried add gpio-hog settings into my device tree, and yes, the GPIO works as it defined.
But all GPIOs defined by gpio-hog can not be modified in user space by gpioset / gpioget utility.
I need to set all GPIOs to pre-defined state and can change it at run time.
Set GPIOs in Device tree is trying to lock it by a fixed direction and value.

Thanks.

> On May 7, 2019, at 4:16 PM, Samuel Jiang <chyishian.jiang at gmail.com> wrote:
> 
> Hi Brad,
> 
> You could pre-define GPIOs setting on linux kernel device tree when loading kernel.
> I’m not sure which SoC you used. Maybe you could direct apply you wanted on linux/arch/arm/boot/dts folder or custom create once. Hope the information could help you.
> 
> Thanks,
> 
> Samuel Jiang
> On May 7, 2019, 2:47 PM +0800, Brad Chou <chou.brad at gmail.com>, wrote:
>> Hi All,
>> Is there a way to set ALL GPIOs to a pre-defined initial in/out direction and high/low value ?
>> I see there is a gpio_defs.json, but seems only the direction can be set, ie. In or out, not high / low settings.
>> Now, I am using a shell script with gpioset utility to do the job.
>> But I know using shell to do it is a bad idea.
>> Does anyone have better ideas ?
>> 
>> Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190507/ab0c6c7a/attachment-0001.htm>


More information about the openbmc mailing list