summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorGuEe-GUI <[email protected]>2024-11-01 13:28:45 +0800
committerRbb666 <[email protected]>2024-12-02 21:15:17 +0800
commit7c59bb01edce9413c3d4068f5dcc5a34e13f3187 (patch)
treefd39761935ffbe86b8fccc54b7a378b5b451234a /components
parentaa30e9804ae315777dd9ae2a7254adff36cf6b99 (diff)
[DM/FIXUP] Fixup pin flags get from OFW
Only check HIGH or LOW Signed-off-by: GuEe-GUI <[email protected]>
Diffstat (limited to 'components')
-rw-r--r--components/drivers/pin/dev_pin_ofw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/drivers/pin/dev_pin_ofw.c b/components/drivers/pin/dev_pin_ofw.c
index f9497cf285..b9b2d1d51a 100644
--- a/components/drivers/pin/dev_pin_ofw.c
+++ b/components/drivers/pin/dev_pin_ofw.c
@@ -117,11 +117,11 @@ rt_ssize_t rt_ofw_get_named_pin(struct rt_ofw_node *np, const char *propname, in
if (out_value)
{
- if (flags == (PIN_ACTIVE_HIGH | PIN_PUSH_PULL))
+ if ((flags & 1) == PIN_ACTIVE_HIGH)
{
value = PIN_HIGH;
}
- else if (flags == (PIN_ACTIVE_LOW | PIN_PUSH_PULL))
+ else if ((flags & 1) == PIN_ACTIVE_LOW)
{
value = PIN_LOW;
}