File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Documentation/devicetree/bindings/net
drivers/net/ethernet/freescale Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ Optional properties:
12
12
only if property "phy-reset-gpios" is available. Missing the property
13
13
will have the duration be 1 millisecond. Numbers greater than 1000 are
14
14
invalid and 1 millisecond will be used instead.
15
+ - phy-reset-active-low : If present then the reset sequence using the GPIO
16
+ specified in the "phy-reset-gpios" property is reversed (H=reset state,
17
+ L=operation state).
15
18
- phy-supply : regulator that powers the Ethernet PHY.
16
19
- phy-handle : phandle to the PHY device connected to this device.
17
20
- fixed-link : Assume a fixed link. See fixed-link.txt in the same directory.
Original file line number Diff line number Diff line change @@ -3191,6 +3191,7 @@ static int fec_enet_init(struct net_device *ndev)
3191
3191
static void fec_reset_phy (struct platform_device * pdev )
3192
3192
{
3193
3193
int err , phy_reset ;
3194
+ bool active_low = false;
3194
3195
int msec = 1 ;
3195
3196
struct device_node * np = pdev -> dev .of_node ;
3196
3197
@@ -3206,14 +3207,17 @@ static void fec_reset_phy(struct platform_device *pdev)
3206
3207
if (!gpio_is_valid (phy_reset ))
3207
3208
return ;
3208
3209
3210
+ active_low = of_property_read_bool (np , "phy-reset-active-low" );
3211
+
3209
3212
err = devm_gpio_request_one (& pdev -> dev , phy_reset ,
3210
- GPIOF_OUT_INIT_LOW , "phy-reset" );
3213
+ active_low ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW ,
3214
+ "phy-reset" );
3211
3215
if (err ) {
3212
3216
dev_err (& pdev -> dev , "failed to get phy-reset-gpios: %d\n" , err );
3213
3217
return ;
3214
3218
}
3215
3219
msleep (msec );
3216
- gpio_set_value_cansleep (phy_reset , 1 );
3220
+ gpio_set_value_cansleep (phy_reset , ! active_low );
3217
3221
}
3218
3222
#else /* CONFIG_OF */
3219
3223
static void fec_reset_phy (struct platform_device * pdev )
You can’t perform that action at this time.
0 commit comments