diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-03-15 17:17:17 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-03-15 17:17:17 -0400 |
commit | 831bbbeb2b0341a82a464896be49493c104d78f0 (patch) | |
tree | 7b4f593eb1d481a82b59f2c2a804e6c2632b32f0 /drivers/net | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) | |
parent | 924e82dacab9a0b2ea661c57c98112569267f0db (diff) |
Merge tag 'ux500-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/fixes-non-critical
From Linus Walleij <linus.walleij@linaro.org>:
Ux500 Device Tree fixes
All are necessary to make a proper DT boot on the v3.9
series:
- IRQ edges.
- Register defines.
- FSMC clock.
- Ethernet clk fixup (one patch to drivers/net ACKed by
David Miller)
- Proper IOS and regulator voltages for MMCI.
- AB8500 GPIOs restored after they were fixed in the v3.9
merge window from the pinctrl tree.
- There is also a minor cleanup in the platform code, but it
is strongly connected to the other patches.
* tag 'ux500-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
ARM: ux500: allow Snowball access to the AB8500 GPIO pins
ARM: ux500: enable AB8500 GPIO for HREF
ARM: ux500: Remove traces of the ios_handler from platform code
ARM: ux500: Use the GPIO regulator framework for SDI0's 'en' and 'vsel'
ARM: ux500: Setup correct settling time for the MMCI regulator
ARM: ux500: Use the correct name when supplying a GPIO enable pin
ARM: ux500: Specify which IOS regulator to use for MMCI
ARM: ux500: Specify the ux5x0 MMCI regulator's on/off GPIO as high-enable
ARM: ux500: Set correct MMCI regulator voltages in the ux5x0 Device Tree
mmc: mmci: Move ios_handler functionality into the driver
net/smsc911x: Provide common clock functionality
clk: ux500: Provide an alias for the SMSC911x Ethernet chip
clk: ux500: Ensure the FMSC clock is obtainable
ARM: ux500: Provide a means to obtain the SMSC9115 clock when DT is enabled
ARM: ux500: Include the PRCMU's Secure Registers in DB8500's DT
ARM: ux500: Change IRQ from low-to-high edge triggered to high-to-low
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index da5cc9a3b34c..df77df16d991 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 33 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
34 | 34 | ||
35 | #include <linux/crc32.h> | 35 | #include <linux/crc32.h> |
36 | #include <linux/clk.h> | ||
36 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
37 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
38 | #include <linux/etherdevice.h> | 39 | #include <linux/etherdevice.h> |
@@ -144,6 +145,9 @@ struct smsc911x_data { | |||
144 | 145 | ||
145 | /* regulators */ | 146 | /* regulators */ |
146 | struct regulator_bulk_data supplies[SMSC911X_NUM_SUPPLIES]; | 147 | struct regulator_bulk_data supplies[SMSC911X_NUM_SUPPLIES]; |
148 | |||
149 | /* clock */ | ||
150 | struct clk *clk; | ||
147 | }; | 151 | }; |
148 | 152 | ||
149 | /* Easy access to information */ | 153 | /* Easy access to information */ |
@@ -369,7 +373,7 @@ out: | |||
369 | } | 373 | } |
370 | 374 | ||
371 | /* | 375 | /* |
372 | * enable resources, currently just regulators. | 376 | * enable regulator and clock resources. |
373 | */ | 377 | */ |
374 | static int smsc911x_enable_resources(struct platform_device *pdev) | 378 | static int smsc911x_enable_resources(struct platform_device *pdev) |
375 | { | 379 | { |
@@ -382,6 +386,13 @@ static int smsc911x_enable_resources(struct platform_device *pdev) | |||
382 | if (ret) | 386 | if (ret) |
383 | netdev_err(ndev, "failed to enable regulators %d\n", | 387 | netdev_err(ndev, "failed to enable regulators %d\n", |
384 | ret); | 388 | ret); |
389 | |||
390 | if (!IS_ERR(pdata->clk)) { | ||
391 | ret = clk_prepare_enable(pdata->clk); | ||
392 | if (ret < 0) | ||
393 | netdev_err(ndev, "failed to enable clock %d\n", ret); | ||
394 | } | ||
395 | |||
385 | return ret; | 396 | return ret; |
386 | } | 397 | } |
387 | 398 | ||
@@ -396,6 +407,10 @@ static int smsc911x_disable_resources(struct platform_device *pdev) | |||
396 | 407 | ||
397 | ret = regulator_bulk_disable(ARRAY_SIZE(pdata->supplies), | 408 | ret = regulator_bulk_disable(ARRAY_SIZE(pdata->supplies), |
398 | pdata->supplies); | 409 | pdata->supplies); |
410 | |||
411 | if (!IS_ERR(pdata->clk)) | ||
412 | clk_disable_unprepare(pdata->clk); | ||
413 | |||
399 | return ret; | 414 | return ret; |
400 | } | 415 | } |
401 | 416 | ||
@@ -421,6 +436,12 @@ static int smsc911x_request_resources(struct platform_device *pdev) | |||
421 | if (ret) | 436 | if (ret) |
422 | netdev_err(ndev, "couldn't get regulators %d\n", | 437 | netdev_err(ndev, "couldn't get regulators %d\n", |
423 | ret); | 438 | ret); |
439 | |||
440 | /* Request clock */ | ||
441 | pdata->clk = clk_get(&pdev->dev, NULL); | ||
442 | if (IS_ERR(pdata->clk)) | ||
443 | netdev_warn(ndev, "couldn't get clock %li\n", PTR_ERR(pdata->clk)); | ||
444 | |||
424 | return ret; | 445 | return ret; |
425 | } | 446 | } |
426 | 447 | ||
@@ -436,6 +457,12 @@ static void smsc911x_free_resources(struct platform_device *pdev) | |||
436 | /* Free regulators */ | 457 | /* Free regulators */ |
437 | regulator_bulk_free(ARRAY_SIZE(pdata->supplies), | 458 | regulator_bulk_free(ARRAY_SIZE(pdata->supplies), |
438 | pdata->supplies); | 459 | pdata->supplies); |
460 | |||
461 | /* Free clock */ | ||
462 | if (!IS_ERR(pdata->clk)) { | ||
463 | clk_put(pdata->clk); | ||
464 | pdata->clk = NULL; | ||
465 | } | ||
439 | } | 466 | } |
440 | 467 | ||
441 | /* waits for MAC not busy, with timeout. Only called by smsc911x_mac_read | 468 | /* waits for MAC not busy, with timeout. Only called by smsc911x_mac_read |