Skip to content

Commit 4a4ce82

Browse files
HoratiuVulturkuba-moo
authored andcommitted
net: phy: micrel: Make the GPIO to be non-exclusive
The same GPIO line can be shared by multiple phys for the coma mode pin. If that is the case then, all the other phys that share the same line will failed to be probed because the access to the gpio line is not non-exclusive. Fix this by making access to the gpio line to be nonexclusive using flag GPIOD_FLAGS_BIT_NONEXCLUSIVE. This allows all the other PHYs to be probed. Fixes: 738871b ("net: phy: micrel: add coma mode GPIO") Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Horatiu Vultur <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fce1c23 commit 4a4ce82

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/phy/micrel.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2873,12 +2873,18 @@ static int lan8814_config_init(struct phy_device *phydev)
28732873
return 0;
28742874
}
28752875

2876+
/* It is expected that there will not be any 'lan8814_take_coma_mode'
2877+
* function called in suspend. Because the GPIO line can be shared, so if one of
2878+
* the phys goes back in coma mode, then all the other PHYs will go, which is
2879+
* wrong.
2880+
*/
28762881
static int lan8814_release_coma_mode(struct phy_device *phydev)
28772882
{
28782883
struct gpio_desc *gpiod;
28792884

28802885
gpiod = devm_gpiod_get_optional(&phydev->mdio.dev, "coma-mode",
2881-
GPIOD_OUT_HIGH_OPEN_DRAIN);
2886+
GPIOD_OUT_HIGH_OPEN_DRAIN |
2887+
GPIOD_FLAGS_BIT_NONEXCLUSIVE);
28822888
if (IS_ERR(gpiod))
28832889
return PTR_ERR(gpiod);
28842890

0 commit comments

Comments
 (0)