aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 15:06:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 15:06:33 -0400
commitec96e2fe954c23a54bfdf2673437a39e193a1822 (patch)
treee4041c68ef20a3337c56aefc8db785156307edd1 /drivers/char/hw_random
parent8e9815a0f8882aaa68645b001bb7538db8886802 (diff)
parentf949c0edd84101bfd30b3e7389c1a12b067e561d (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (103 commits) ARM: 6141/1: Add audio support part in arch/arm/mach-w90x900 ARM: 5939/1: ARM: Add option CMDLINE_FORCE to force usage of the in-kernel cmdline ARM: 6140/1: silence a bogus sparse warning in unwind.c ARM: mach-at91: duplicated include ARM: arch/arm/nwfpe/fpsr.h: Checkpatch cleanup ARM: arch/arm/mach-shark/pci.c: Checkpatch cleanup ARM: arch/arm/nwfpe/ChangeLog: Checkpatch cleanup ARM: arch/arm/mach-sa1100/leds.c: Checkpatch cleanup ARM: arch/arm/mach-h720x/common.h: Checkpatch cleanup ARM: arch/arm/mach-footbridge/ebsa285-pci.c: Checkpatch cleanup ARM: arch/arm/mach-clps711x/Makefile.boot: Checkpatch cleanup ARM: arch/arm/boot/bootp/bootp.lds: Checkpatch cleanup ARM: SPEAR6xx: remove duplicated #include ARM: s3c6400_defconfig: Add NAND driver ARM: s3c6400_defconfig: enable sound as modules ARM: s3c6400_defconfig: enable power management ARM: s5pv210_defconfig: Update s5pv210_defconfig to v2.6.34 ARM: s5pc110_defconfig: Update s5pc110_defconfig to v2.6.34 ARM: s5p6442_defconfig: Update s5p6442_defconfig to v2.6.34 ARM: s5p6440_defconfig: Update s5p6440_defconfig to v2.6.34 ...
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r--drivers/char/hw_random/nomadik-rng.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c
index a8b4c4010144..a348c7e9aa0b 100644
--- a/drivers/char/hw_random/nomadik-rng.c
+++ b/drivers/char/hw_random/nomadik-rng.c
@@ -15,6 +15,10 @@
15#include <linux/amba/bus.h> 15#include <linux/amba/bus.h>
16#include <linux/hw_random.h> 16#include <linux/hw_random.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/clk.h>
19#include <linux/err.h>
20
21static struct clk *rng_clk;
18 22
19static int nmk_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) 23static int nmk_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
20{ 24{
@@ -40,6 +44,15 @@ static int nmk_rng_probe(struct amba_device *dev, struct amba_id *id)
40 void __iomem *base; 44 void __iomem *base;
41 int ret; 45 int ret;
42 46
47 rng_clk = clk_get(&dev->dev, NULL);
48 if (IS_ERR(rng_clk)) {
49 dev_err(&dev->dev, "could not get rng clock\n");
50 ret = PTR_ERR(rng_clk);
51 return ret;
52 }
53
54 clk_enable(rng_clk);
55
43 ret = amba_request_regions(dev, dev->dev.init_name); 56 ret = amba_request_regions(dev, dev->dev.init_name);
44 if (ret) 57 if (ret)
45 return ret; 58 return ret;
@@ -57,6 +70,8 @@ out_unmap:
57 iounmap(base); 70 iounmap(base);
58out_release: 71out_release:
59 amba_release_regions(dev); 72 amba_release_regions(dev);
73 clk_disable(rng_clk);
74 clk_put(rng_clk);
60 return ret; 75 return ret;
61} 76}
62 77
@@ -66,6 +81,8 @@ static int nmk_rng_remove(struct amba_device *dev)
66 hwrng_unregister(&nmk_rng); 81 hwrng_unregister(&nmk_rng);
67 iounmap(base); 82 iounmap(base);
68 amba_release_regions(dev); 83 amba_release_regions(dev);
84 clk_disable(rng_clk);
85 clk_put(rng_clk);
69 return 0; 86 return 0;
70} 87}
71 88