Commit a6ab6402 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Herbert Xu

hwrng: mxc-rnga - add driver support on boards with device tree

The driver works well on i.MX31 powered boards with device description
taken from board device tree, the only change to add to the driver is
the missing OF device id, the affected list of included headers and
indentation in platform driver struct are beautified a little.
Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: default avatarKim Phillips <kim.phillips@arm.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 9885b1bd
...@@ -16,16 +16,13 @@ ...@@ -16,16 +16,13 @@
* This driver is based on other RNG drivers. * This driver is based on other RNG drivers.
*/ */
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/err.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/hw_random.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hw_random.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
/* RNGA Registers */ /* RNGA Registers */
#define RNGA_CONTROL 0x00 #define RNGA_CONTROL 0x00
...@@ -197,10 +194,18 @@ static int __exit mxc_rnga_remove(struct platform_device *pdev) ...@@ -197,10 +194,18 @@ static int __exit mxc_rnga_remove(struct platform_device *pdev)
return 0; return 0;
} }
static const struct of_device_id mxc_rnga_of_match[] = {
{ .compatible = "fsl,imx21-rnga", },
{ .compatible = "fsl,imx31-rnga", },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, mxc_rnga_of_match);
static struct platform_driver mxc_rnga_driver = { static struct platform_driver mxc_rnga_driver = {
.driver = { .driver = {
.name = "mxc_rnga", .name = "mxc_rnga",
}, .of_match_table = mxc_rnga_of_match,
},
.remove = __exit_p(mxc_rnga_remove), .remove = __exit_p(mxc_rnga_remove),
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment