<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
margin:0in;
margin-bottom:.0001pt;
font-size:8.5pt;
font-family:Menlo;
color:black;}
span.s1
{mso-style-name:s1;}
span.s2
{mso-style-name:s2;
color:#CA3323;}
span.s3
{mso-style-name:s3;
color:#39C026;}
span.s4
{mso-style-name:s4;
color:#AAAB25;}
span.s5
{mso-style-name:s5;
color:#DB27DA;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1244798084;
mso-list-type:hybrid;
mso-list-template-ids:151815728 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Ed,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am trying to use x86-power-control and see there are lots of hard coded values which needs to be configurable as per platform.
<o:p></o:p></span></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">Name of GPIO line, this should be configurable and should also support GPIO number if user doesn’t want to define line name in DTS.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">All delay time as it varies for us per platform like powerPulseTimeMs is 1 sec instead of 200 ms and powerPulseTimeMs is 6 sec instead of 15 sec and
these varies for different FB platforms. <o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">GPIO lines to be monitored, not everyone needs SIO_S5 monitoring or NMI_OUT etc.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">Enable/disable passthrough<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Please suggest what is the best way to make these changes. I am ready to work on this to make required change. We can have these config option defined in entity manager or we can accept a new json file for
this configuration.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">One more question on code, I see following code requires powerButtonMask to be set before aquiring GPIO line. Please let me know who sets this powerButtonMask to true. I know this is related to GPIO passthrough
but still couldn’t understand where in code it gets set until someone call set-property of dbus.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="p1"><span class="s1">power_control::powerButtonIface->register_property(</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s2">"ButtonMasked"</span><span class="s1">,
</span><span class="s2">false</span><span class="s1">, [](</span><span class="s3">const</span><span class="s1">
</span><span class="s3">bool</span><span class="s1"> requested, </span><span class="s3">bool</span><span class="s1">& current) {</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">if</span><span class="s1"> (requested)</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">{</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">if</span><span class="s1"> (power_control::powerButtonMask)</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">{</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">return</span><span class="s1">
</span><span class="s2">1</span><span class="s1">;</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">}</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">if</span><span class="s1"> (!power_control::setGPIOOutput(</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span>
<span class="s2">"POWER_OUT"</span><span class="s1">, </span><span class="s2">1</span><span class="s1">, power_control::powerButtonMask))</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">{</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">throw</span><span class="s1"> std::runtime_error(</span><span class="s2">"Failed to request GPIO"</span><span class="s1">);</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">return</span><span class="s1">
</span><span class="s2">0</span><span class="s1">;</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">}</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">std::cerr <<
</span><span class="s2">"Power Button Masked.</span><span class="s5">\n</span><span class="s2">"</span><span class="s1">;</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">}</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">else</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">{</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">if</span><span class="s1"> (!power_control::powerButtonMask)</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">{</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s4">return</span><span class="s1">
</span><span class="s2">1</span><span class="s1">;</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">}</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">std::cerr <<
</span><span class="s2">"Power Button Un-masked</span><span class="s5">\n</span><span class="s2">"</span><span class="s1">;</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">power_control::powerButtonMask.reset();</span><o:p></o:p></p>
<p class="p1"><span class="apple-converted-space"> </span><span class="s1">}</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Vijay<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</body>
</html>