Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314684
b: refs/heads/master
c: a3caad0
h: refs/heads/master
v: v3
  • Loading branch information
Shawn Guo authored and David S. Miller committed Jun 28, 2012
1 parent 899805a commit ec3d94d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c9040af264de8a425b0efabfcc18a6ce47d0f21f
refs/heads/master: a3caad0a160c03b7238a2518fa89abda78adef1e
4 changes: 4 additions & 0 deletions trunk/Documentation/devicetree/bindings/net/fsl-fec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Required properties:
Optional properties:
- local-mac-address : 6 bytes, mac address
- phy-reset-gpios : Should specify the gpio for phy reset
- phy-reset-duration : Reset duration in milliseconds. Should present
only if property "phy-reset-gpios" is available. Missing the property
will have the duration be 1 millisecond. Numbers greater than 1000 are
invalid and 1 millisecond will be used instead.

Example:

Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1507,19 +1507,25 @@ static int __devinit fec_get_phy_mode_dt(struct platform_device *pdev)
static void __devinit fec_reset_phy(struct platform_device *pdev)
{
int err, phy_reset;
int msec = 1;
struct device_node *np = pdev->dev.of_node;

if (!np)
return;

of_property_read_u32(np, "phy-reset-duration", &msec);
/* A sane reset duration should not be longer than 1s */
if (msec > 1000)
msec = 1;

phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
err = devm_gpio_request_one(&pdev->dev, phy_reset,
GPIOF_OUT_INIT_LOW, "phy-reset");
if (err) {
pr_debug("FEC: failed to get gpio phy-reset: %d\n", err);
return;
}
msleep(1);
msleep(msec);
gpio_set_value(phy_reset, 1);
}
#else /* CONFIG_OF */
Expand Down

0 comments on commit ec3d94d

Please sign in to comment.