[Linux-stm32] [PATCH] net: stmmac: Support gpio high-level reset for devices requiring it

lizhe sensor1010 at 163.com
Wed Jul 9 07:48:25 UTC 2025


Hi, 

after replacing with this function, the function returns 0, meaning the gpio is

still at a low voltage level.

+              int gpio_state = -1;




                if (delays[2])

                        msleep(DIV_ROUND_UP(delays[2], 1000));

+

+               gpio_state = gpiod_get_raw_value_cansleep(reset_gpio);

+               pr_info("gpio_state: %d\n", gpio_state);

+               pr_info("gpio_state: %d\n", gpio_state);







 gpio-111 (                    |snps,reset          ) out lo




[    3.899319] gpio_state: 0

[    3.899324] gpio_state: 0







Thx

Lizhe


At 2025-07-09 12:26:55, "Russell King (Oracle)" <linux at armlinux.org.uk> wrote:
>On Wed, Jul 09, 2025 at 09:57:50AM +0800, lizhe wrote:
>> + gpio_state = gpiod_get_value_can_sleep(reset_gpio);
>
>Use gpiod_get_raw_value_cansleep(). The normal get/set return the
>active/inactive state, whereas the _raw get/set return the physical
>state.
>
>-- 
>RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
>FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20250709/e61c44cd/attachment.html>


More information about the Linux-stm32 mailing list