<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
<div style="caret-color: rgb(39, 39, 40);">Hi Brad,</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">On May 7, 2019, 4:52 PM +0800, Brad Chou <chou.brad@gmail.com>, wrote:<br />
<blockquote type="cite" class="spark_quote" style="margin: 5px; padding-left: 10px; border-left-width: thin; border-left-style: solid; border-left-color: rgb(26, 188, 156);">Hi Samuel,
<div class="">Thanks for your reply, I am using AST2500.</div>
<div class="">I tried add gpio-hog settings into my device tree, and yes, the GPIO works as it defined.</div>
<div class="">But all GPIOs defined by gpio-hog can not be modified in user space by gpioset / gpioget utility.</div>
<div class="">I need to set all GPIOs to pre-defined state and can change it at run time.</div>
<div class="">Set GPIOs in Device tree is trying to lock it by a fixed direction and value.</div>
<div class=""><br class="" /></div>
<div class="">Thanks.</div>
<div class="">
<div class=""></div>
</div>
</blockquote>
<br />
<div>You could trace the gpioplus library how does it implement control pins, it seems direct modify by gpio chips.<br /></div>
<div dir="auto"><br /></div>
<div dir="auto">
<blockquote type="cite" class="spark_quote" style="caret-color: rgb(39, 39, 40); margin: 5px; padding-left: 10px; border-left-width: thin; border-left-style: solid; border-left-color: rgb(26, 188, 156);">Now, I am using a shell script with gpioset utility to do the job.<br />
But I know using shell to do it is a bad idea.<br />
Does anyone have better ideas ? </blockquote>
<br />
<div><br /></div>
</div>
<div dir="auto">In my situation, I still use shell script export pin which didn't pre-define output high or low and control GPIOs program by c++ at runtime.<br />
But I think the previous shell script also could rewrite to c++.<br /></div>
<div dir="auto"><br /></div>
<div dir="auto"><br /></div>
<div dir="auto">Thanks,</div>
<div dir="auto">Samuel Jiang</div>
<div dir="auto"><br /></div>
<div dir="auto"><br /></div>
<br /></div>
</body>
</html>