Skip to content

Commit b02c85c

Browse files
dtorBartosz Golaszewski
authored andcommitted
gpiolib: of: add quirk for phy reset polarity for Freescale Ethernet
Bindings for Freescale Fast Ethernet Controller use a separate property "phy-reset-active-high" to specify polarity of its phy gpio line. To allow converting the driver to gpiod API we need to add this quirk to gpiolib. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent e3186e3 commit b02c85c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

drivers/gpio/gpiolib-of.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,33 @@ static void of_gpio_flags_quirks(const struct device_node *np,
231231
!strcmp(propname, "snps,reset-gpio") &&
232232
of_property_read_bool(np, "snps,reset-active-low"))
233233
*flags |= OF_GPIO_ACTIVE_LOW;
234+
235+
/*
236+
* Freescale Fast Ethernet Controller uses a separate property to
237+
* describe polarity of the phy reset line.
238+
*/
239+
if (IS_ENABLED(CONFIG_FEC)) {
240+
static const char * const fec_devices[] = {
241+
"fsl,imx25-fec",
242+
"fsl,imx27-fec",
243+
"fsl,imx28-fec",
244+
"fsl,imx6q-fec",
245+
"fsl,mvf600-fec",
246+
"fsl,imx6sx-fec",
247+
"fsl,imx6ul-fec",
248+
"fsl,imx8mq-fec",
249+
"fsl,imx8qm-fec",
250+
"fsl,s32v234-fec",
251+
NULL
252+
};
253+
254+
if (!strcmp(propname, "phy-reset-gpios") &&
255+
of_device_compatible_match(np, fec_devices)) {
256+
bool active_high = of_property_read_bool(np,
257+
"phy-reset-active-high");
258+
of_gpio_quirk_polarity(np, active_high, flags);
259+
}
260+
}
234261
}
235262

236263
/**

0 commit comments

Comments
 (0)