diff options
author | Robert Marklund <robert.marklund@stericsson.com> | 2011-09-30 10:27:32 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:00:58 +0200 |
commit | be7e60d38ef00f59500266b41ff3e61626274626 (patch) | |
tree | 1508a262bc406c8d16adf2530398edd04482da76 /drivers/net/ethernet/smsc/smsc911x.c | |
parent | 086d306e1f3574d055df43de7384189ef31f03e6 (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/smsc/smsc911x.c')
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index cd3defb11ff..dbeb806f123 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c @@ -2343,6 +2343,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); @@ -2419,6 +2420,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; |