aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2013-08-05 10:47:21 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2013-08-09 02:39:47 -0400
commitc903970ceaaaddb665d356d078372f0985d5948e (patch)
tree5fe7be693c98e0785ee4a470a94909f3cbff6575 /drivers/char/hw_random
parent7256c476f79d2b50a32cecb0330362afd2fa0b50 (diff)
hwrng: omap - Add device tree support
Add Device Tree suport to the omap-rng driver. Currently, only support for OMAP2 and OMAP3 is being added but support for OMAP4 and OMAP5 will be added in a subsequent patch. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r--drivers/char/hw_random/omap-rng.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 5a2ab3b3cd78..3076c9de7a02 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -24,6 +24,9 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/pm_runtime.h> 26#include <linux/pm_runtime.h>
27#include <linux/of.h>
28#include <linux/of_device.h>
29#include <linux/of_address.h>
27 30
28#include <asm/io.h> 31#include <asm/io.h>
29 32
@@ -104,6 +107,14 @@ static struct hwrng omap_rng_ops = {
104 .data_read = omap_rng_data_read, 107 .data_read = omap_rng_data_read,
105}; 108};
106 109
110#if defined(CONFIG_OF)
111static const struct of_device_id omap_rng_of_match[] = {
112 { .compatible = "ti,omap2-rng" },
113 {},
114};
115MODULE_DEVICE_TABLE(of, omap_rng_of_match);
116#endif
117
107static int omap_rng_probe(struct platform_device *pdev) 118static int omap_rng_probe(struct platform_device *pdev)
108{ 119{
109 struct omap_rng_private_data *priv; 120 struct omap_rng_private_data *priv;
@@ -197,6 +208,7 @@ static struct platform_driver omap_rng_driver = {
197 .name = "omap_rng", 208 .name = "omap_rng",
198 .owner = THIS_MODULE, 209 .owner = THIS_MODULE,
199 .pm = OMAP_RNG_PM, 210 .pm = OMAP_RNG_PM,
211 .of_match_table = of_match_ptr(omap_rng_of_match),
200 }, 212 },
201 .probe = omap_rng_probe, 213 .probe = omap_rng_probe,
202 .remove = __exit_p(omap_rng_remove), 214 .remove = __exit_p(omap_rng_remove),