<div data-ntes="ntes_mail_body_root" style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div id="spnEditorContent"><p style="margin: 0;">Hi٬</p><p style="margin: 0;"> </p><p style="margin: 0;"> if i add the following code to this function, the gpio outputs a high level</p><p style="margin: 0;"> without this code, it outputs a low level, <br> the function currently drivers the reset GPIO to a low state, failing to account </p><p style="margin: 0;"> for devices requiring an active-high reset.</p><p style="margin: 0;"><br></p><p style="margin: 0;"> i invited our hardware engineer to measure the voltage level on this GPIO pin,</p><p style="margin: 0;"> without adding this code, the voltage at this GPIO pin remains at 0V</p><p style="margin: 0;"><br></p><p style="margin: 0;"> + int current_value;</p><p style="margin: 0;"><br></p><p style="margin: 0;"> + keep_high = device_property_read_bool(priv->device,</p><p style="margin: 0;"> + "snps,reset-keep-high");</p><p style="margin: 0;"> + if (keep_high) {</p><p style="margin: 0;"> + gpiod_set_value_cansleep(reset_gpio, 1);</p><p style="margin: 0;"> + current_value = gpiod_get_value_cansleep(reset_gpio);</p><p style="margin: 0;"> + pr_info("current_value: %d\n", current_value);</p><p style="margin: 0;"> + }<br><br> in the RK3588 system, i am using ,there are many DTS node configured link this:</p><p style="margin: 0;"> snps, reset-gpio = <&gpioX RK_PXX GPIO_ACTIVE_HIGH>; <br> All of them correctly parse the GPIO pin's state are described in the DTS</p><div><br></div><p style="margin: 0;"><br></p><p style="margin: 0;">Thx !</p><p style="margin: 0;">Lizhe</p><p style="margin: 0;"><br></p></div><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><p style="margin: 0;"><br></p><pre><br>At 2025-07-09 22:29:46, "Russell King (Oracle)" <linux@armlinux.org.uk> wrote:
>On Wed, Jul 09, 2025 at 07:42:55PM +0800, lizhe wrote:
>> Hi,
>> i have already declared it in the DTS.
>>
>> &gmac {
>> snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
>> };
>
>Active high means that the reset is in effect when the output is at the
>logic '1' state. So, gpiod_get_value*() will return the same as
>gpiod_get_raw_value*().
>
>Active low means that the reset is in effect when the output is at the
>logic '0' state, and in that case the return value of
>gpiod_get_value*() will return true when the reset is active (at logic
>'0' state) whereas gpiod_get_raw_value*() will return zero.
>
>--
>RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
>FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
</pre></div>