summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorRobert Marklund <robert.marklund@stericsson.com>2011-09-30 10:27:32 +0200
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 08:50:44 +0100
commitb0bb9f80d8a27745de0069bedb7788d74940b072 (patch)
tree8b14a0466337bcf4e36b13710aa84621875fc54a /drivers/net/ethernet
parent5bba4d392ba85907fb41751a9ac0322112dd2c40 (diff)
smsc911x: Add regulator support
Add some regulator support, there can be nessesary to add moreregulators to suite all power save needs. But this is a start. Also add a wait for the chip to be ready after the regulators are enabled, this was a bug in the old implementation. Change-Id: I5ed6732f9f86f0305ac6428bdb984836aac8b1f1 Signed-off-by: Robert Marklund <robert.marklund@stericsson.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 24d2df068d7..bee39c018a5 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -2346,6 +2346,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
unsigned int intcfg = 0;
int res_size, irq_flags;
int retval;
+ int to = 100;
pr_info("Driver version %s\n", SMSC_DRV_VERSION);
@@ -2424,6 +2425,18 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
if (pdata->config.shift)
pdata->ops = &shifted_smsc911x_ops;
+ /* poll the READY bit in PMT_CTRL. Any other access to the device is
+ * forbidden while this bit isn't set. Try for 100ms
+ */
+ while (!(smsc911x_reg_read(pdata, PMT_CTRL) & PMT_CTRL_READY_) && --to)
+ udelay(1000);
+
+ if (to == 0) {
+ pr_err("Device not READY in 100ms aborting\n");
+ goto out_0;
+ }
+
+
retval = smsc911x_init(dev);
if (retval < 0)
goto out_disable_resources;