diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-03-15 22:17:17 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-03-15 22:17:17 +0100 |
commit | 831bbbeb2b0341a82a464896be49493c104d78f0 (patch) | |
tree | 7b4f593eb1d481a82b59f2c2a804e6c2632b32f0 /drivers | |
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')
-rw-r--r-- | drivers/clk/ux500/u8500_clk.c | 3 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 29 |
3 files changed, 39 insertions, 2 deletions
diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c index 6b889a0e90b3..9d9add1e816d 100644 --- a/drivers/clk/ux500/u8500_clk.c +++ b/drivers/clk/ux500/u8500_clk.c @@ -324,7 +324,8 @@ void u8500_clk_init(void) clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", U8500_CLKRST3_BASE, BIT(0), 0); - clk_register_clkdev(clk, NULL, "fsmc"); + clk_register_clkdev(clk, "fsmc", NULL); + clk_register_clkdev(clk, NULL, "smsc911x"); clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", U8500_CLKRST3_BASE, BIT(1), 0); diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 372e921389c8..375c109607ff 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1141,6 +1141,11 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_OFF: if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); + + if (!IS_ERR(mmc->supply.vqmmc) && + regulator_is_enabled(mmc->supply.vqmmc)) + regulator_disable(mmc->supply.vqmmc); + break; case MMC_POWER_UP: if (!IS_ERR(mmc->supply.vmmc)) @@ -1155,6 +1160,10 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) break; case MMC_POWER_ON: + if (!IS_ERR(mmc->supply.vqmmc) && + !regulator_is_enabled(mmc->supply.vqmmc)) + regulator_enable(mmc->supply.vqmmc); + pwr |= MCI_PWR_ON; break; } 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 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/crc32.h> +#include <linux/clk.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/etherdevice.h> @@ -144,6 +145,9 @@ struct smsc911x_data { /* regulators */ struct regulator_bulk_data supplies[SMSC911X_NUM_SUPPLIES]; + + /* clock */ + struct clk *clk; }; /* Easy access to information */ @@ -369,7 +373,7 @@ out: } /* - * enable resources, currently just regulators. + * enable regulator and clock resources. */ static int smsc911x_enable_resources(struct platform_device *pdev) { @@ -382,6 +386,13 @@ static int smsc911x_enable_resources(struct platform_device *pdev) if (ret) netdev_err(ndev, "failed to enable regulators %d\n", ret); + + if (!IS_ERR(pdata->clk)) { + ret = clk_prepare_enable(pdata->clk); + if (ret < 0) + netdev_err(ndev, "failed to enable clock %d\n", ret); + } + return ret; } @@ -396,6 +407,10 @@ static int smsc911x_disable_resources(struct platform_device *pdev) ret = regulator_bulk_disable(ARRAY_SIZE(pdata->supplies), pdata->supplies); + + if (!IS_ERR(pdata->clk)) + clk_disable_unprepare(pdata->clk); + return ret; } @@ -421,6 +436,12 @@ static int smsc911x_request_resources(struct platform_device *pdev) if (ret) netdev_err(ndev, "couldn't get regulators %d\n", ret); + + /* Request clock */ + pdata->clk = clk_get(&pdev->dev, NULL); + if (IS_ERR(pdata->clk)) + netdev_warn(ndev, "couldn't get clock %li\n", PTR_ERR(pdata->clk)); + return ret; } @@ -436,6 +457,12 @@ static void smsc911x_free_resources(struct platform_device *pdev) /* Free regulators */ regulator_bulk_free(ARRAY_SIZE(pdata->supplies), pdata->supplies); + + /* Free clock */ + if (!IS_ERR(pdata->clk)) { + clk_put(pdata->clk); + pdata->clk = NULL; + } } /* waits for MAC not busy, with timeout. Only called by smsc911x_mac_read |