<p>Chris Ching has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23625">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/amd/stoneyridge: Add gpio_interrupt_status<br><br>BUG=b:72838769<br>BRANCH=none<br>TEST=read interrupt and check is cleared on grunt TPM<br><br>Change-Id: I7ed76eaf56338a314a8d0ee6faad1ab8dbf8dfb0<br>Signed-off-by: Chris Ching <chingcodes@chromium.org><br>---<br>M src/soc/amd/stoneyridge/gpio.c<br>M src/soc/amd/stoneyridge/include/soc/gpio.h<br>2 files changed, 20 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/23625/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/amd/stoneyridge/gpio.c b/src/soc/amd/stoneyridge/gpio.c</span><br><span>index ec02c99..d1ffc39 100644</span><br><span>--- a/src/soc/amd/stoneyridge/gpio.c</span><br><span>+++ b/src/soc/amd/stoneyridge/gpio.c</span><br><span>@@ -117,3 +117,19 @@</span><br><span> </span><br><span>         write32((void *)gpio_address, reg | flags);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+int gpio_interrupt_status(gpio_t gpio)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ uint32_t reg;</span><br><span style="color: hsl(120, 100%, 40%);">+ uintptr_t gpio_address = gpio_get_address(gpio);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    reg = read32((void *)gpio_address);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (reg & GPIO_INT_STATUS) {</span><br><span style="color: hsl(120, 100%, 40%);">+              /* Clear the status bit. */</span><br><span style="color: hsl(120, 100%, 40%);">+           write32((void *)gpio_address, reg);</span><br><span style="color: hsl(120, 100%, 40%);">+           return 1;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/soc/amd/stoneyridge/include/soc/gpio.h b/src/soc/amd/stoneyridge/include/soc/gpio.h</span><br><span>index 63f6dfa..8b00976 100644</span><br><span>--- a/src/soc/amd/stoneyridge/include/soc/gpio.h</span><br><span>+++ b/src/soc/amd/stoneyridge/include/soc/gpio.h</span><br><span>@@ -158,5 +158,9 @@</span><br><span> /* Configure the gpio with specific flags. */</span><br><span> void gpio_set_config(gpio_t gpio, uint32_t flags);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Return the interrupt status and clear if set. */</span><br><span style="color: hsl(120, 100%, 40%);">+int gpio_interrupt_status(gpio_t gpio);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #endif /* __ACPI__ */</span><br><span> #endif /* __STONEYRIDGE_GPIO_H__ */</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23625">change 23625</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/23625"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I7ed76eaf56338a314a8d0ee6faad1ab8dbf8dfb0 </div>
<div style="display:none"> Gerrit-Change-Number: 23625 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Chris Ching <chingcodes@chromium.org> </div>