diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-26 15:42:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-26 15:42:29 -0400 |
commit | 27953437059c64d14086196eb96f43c78caa9db3 (patch) | |
tree | 0cfd5fb21262a6db3de0c64462847b4c0c43e9df /drivers/mtd | |
parent | 2c757fd5d1a92086f225a75a8fac7cab242d11b0 (diff) | |
parent | 3c0dec5f58b3c7b3627715126d1bf9b030a076f0 (diff) |
Merge tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm-soc clock driver changes from Olof Johansson:
"The new clock subsystem was merged in linux-3.4 without any users,
this now moves the first three platforms over to it: imx, mxs and
spear.
The series also contains the changes for the clock subsystem itself,
since Mike preferred to have it together with the platforms that
require these changes, in order to avoid interdependencies and
conflicts."
Fix up trivial conflicts in arch/arm/mach-kirkwood/common.c (code
removed in one branch, added OF support in another) and
drivers/dma/imx-sdma.c (independent changes next to each other).
* tag 'clock' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate().
clk: Provide dummy clk_unregister()
SPEAr: Update defconfigs
SPEAr: Add SMI NOR partition info in dts files
SPEAr: Switch to common clock framework
SPEAr: Call clk_prepare() before calling clk_enable
SPEAr: clk: Add General Purpose Timer Synthesizer clock
SPEAr: clk: Add Fractional Synthesizer clock
SPEAr: clk: Add Auxiliary Synthesizer clock
SPEAr: clk: Add VCO-PLL Synthesizer clock
SPEAr: Add DT bindings for SPEAr's timer
ARM i.MX: remove now unused clock files
ARM: i.MX6: implement clocks using common clock framework
ARM i.MX35: implement clocks using common clock framework
ARM i.MX5: implement clocks using common clock framework
ARM: Kirkwood: Replace clock gating
ARM: Orion: Audio: Add clk/clkdev support
ARM: Orion: PCIE: Add support for clk
ARM: Orion: XOR: Add support for clk
ARM: Orion: CESA: Add support for clk
...
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 6 | ||||
-rw-r--r-- | drivers/mtd/nand/orion_nand.c | 18 |
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index cc0678a967c1..9e374e9bd296 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -690,7 +690,7 @@ static void mxc_nand_select_chip(struct mtd_info *mtd, int chip) | |||
690 | if (chip == -1) { | 690 | if (chip == -1) { |
691 | /* Disable the NFC clock */ | 691 | /* Disable the NFC clock */ |
692 | if (host->clk_act) { | 692 | if (host->clk_act) { |
693 | clk_disable(host->clk); | 693 | clk_disable_unprepare(host->clk); |
694 | host->clk_act = 0; | 694 | host->clk_act = 0; |
695 | } | 695 | } |
696 | return; | 696 | return; |
@@ -698,7 +698,7 @@ static void mxc_nand_select_chip(struct mtd_info *mtd, int chip) | |||
698 | 698 | ||
699 | if (!host->clk_act) { | 699 | if (!host->clk_act) { |
700 | /* Enable the NFC clock */ | 700 | /* Enable the NFC clock */ |
701 | clk_enable(host->clk); | 701 | clk_prepare_enable(host->clk); |
702 | host->clk_act = 1; | 702 | host->clk_act = 1; |
703 | } | 703 | } |
704 | 704 | ||
@@ -1078,7 +1078,7 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
1078 | goto eclk; | 1078 | goto eclk; |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | clk_enable(host->clk); | 1081 | clk_prepare_enable(host->clk); |
1082 | host->clk_act = 1; | 1082 | host->clk_act = 1; |
1083 | 1083 | ||
1084 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1084 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 0f50ef38b87b..513dc88a05ca 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
18 | #include <linux/mtd/nand.h> | 18 | #include <linux/mtd/nand.h> |
19 | #include <linux/mtd/partitions.h> | 19 | #include <linux/mtd/partitions.h> |
20 | #include <linux/clk.h> | ||
21 | #include <linux/err.h> | ||
20 | #include <asm/io.h> | 22 | #include <asm/io.h> |
21 | #include <asm/sizes.h> | 23 | #include <asm/sizes.h> |
22 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
@@ -79,6 +81,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
79 | struct nand_chip *nc; | 81 | struct nand_chip *nc; |
80 | struct orion_nand_data *board; | 82 | struct orion_nand_data *board; |
81 | struct resource *res; | 83 | struct resource *res; |
84 | struct clk *clk; | ||
82 | void __iomem *io_base; | 85 | void __iomem *io_base; |
83 | int ret = 0; | 86 | int ret = 0; |
84 | u32 val = 0; | 87 | u32 val = 0; |
@@ -155,6 +158,14 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
155 | 158 | ||
156 | platform_set_drvdata(pdev, mtd); | 159 | platform_set_drvdata(pdev, mtd); |
157 | 160 | ||
161 | /* Not all platforms can gate the clock, so it is not | ||
162 | an error if the clock does not exists. */ | ||
163 | clk = clk_get(&pdev->dev, NULL); | ||
164 | if (!IS_ERR(clk)) { | ||
165 | clk_prepare_enable(clk); | ||
166 | clk_put(clk); | ||
167 | } | ||
168 | |||
158 | if (nand_scan(mtd, 1)) { | 169 | if (nand_scan(mtd, 1)) { |
159 | ret = -ENXIO; | 170 | ret = -ENXIO; |
160 | goto no_dev; | 171 | goto no_dev; |
@@ -184,6 +195,7 @@ static int __devexit orion_nand_remove(struct platform_device *pdev) | |||
184 | { | 195 | { |
185 | struct mtd_info *mtd = platform_get_drvdata(pdev); | 196 | struct mtd_info *mtd = platform_get_drvdata(pdev); |
186 | struct nand_chip *nc = mtd->priv; | 197 | struct nand_chip *nc = mtd->priv; |
198 | struct clk *clk; | ||
187 | 199 | ||
188 | nand_release(mtd); | 200 | nand_release(mtd); |
189 | 201 | ||
@@ -191,6 +203,12 @@ static int __devexit orion_nand_remove(struct platform_device *pdev) | |||
191 | 203 | ||
192 | kfree(nc); | 204 | kfree(nc); |
193 | 205 | ||
206 | clk = clk_get(&pdev->dev, NULL); | ||
207 | if (!IS_ERR(clk)) { | ||
208 | clk_disable_unprepare(clk); | ||
209 | clk_put(clk); | ||
210 | } | ||
211 | |||
194 | return 0; | 212 | return 0; |
195 | } | 213 | } |
196 | 214 | ||