* [PATCH 4/9] spi-orion: add device tree binding
@ 2012-06-10 10:31 Andrew Lunn
[not found] ` <1339324322-29388-5-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Lunn @ 2012-06-10 10:31 UTC (permalink / raw)
To: jason-NLaQJdtUoK4Be96aLqz0jA
Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
machael-QKn5cuLxLXY, Michael Walle, Andrew Lunn
From: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
---
Documentation/devicetree/bindings/spi/spi-orion.txt | 5 +++++
drivers/spi/spi-orion.c | 9 +++++++++
2 files changed, 14 insertions(+)
create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
new file mode 100644
index 0000000..e68597a
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
@@ -0,0 +1,5 @@
+Marvell Orion SPI device
+
+Required properties:
+- compatible : should be "marvell,orion-spi".
+- reg : offset and length of the register set for the device
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 8c3d625..b16db3d 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -17,6 +17,7 @@
#include <linux/io.h>
#include <linux/spi/spi.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/clk.h>
#include <asm/unaligned.h>
@@ -429,6 +430,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
if (orion_spi_reset(spi) < 0)
goto out_rel_mem;
+ master->dev.of_node = pdev->dev.of_node;
status = spi_register_master(master);
if (status < 0)
goto out_rel_mem;
@@ -468,10 +470,17 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
MODULE_ALIAS("platform:" DRIVER_NAME);
+static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
+ { .compatible = "marvell,orion-spi", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
+
static struct platform_driver orion_spi_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(orion_spi_of_match_table),
},
.remove = __exit_p(orion_spi_remove),
};
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4/9] spi-orion: add device tree binding
[not found] ` <1339324322-29388-5-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
@ 2012-06-10 16:51 ` Jason Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Jason Cooper @ 2012-06-10 16:51 UTC (permalink / raw)
To: Andrew Lunn
Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
machael-QKn5cuLxLXY, Michael Walle
On Sun, Jun 10, 2012 at 12:31:56PM +0200, Andrew Lunn wrote:
> From: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
>
> Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
> Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Looks good.
Acked-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
> Documentation/devicetree/bindings/spi/spi-orion.txt | 5 +++++
> drivers/spi/spi-orion.c | 9 +++++++++
> 2 files changed, 14 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
>
> diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
> new file mode 100644
> index 0000000..e68597a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> @@ -0,0 +1,5 @@
> +Marvell Orion SPI device
> +
> +Required properties:
> +- compatible : should be "marvell,orion-spi".
> +- reg : offset and length of the register set for the device
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 8c3d625..b16db3d 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -17,6 +17,7 @@
> #include <linux/io.h>
> #include <linux/spi/spi.h>
> #include <linux/module.h>
> +#include <linux/of.h>
> #include <linux/clk.h>
> #include <asm/unaligned.h>
>
> @@ -429,6 +430,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
> if (orion_spi_reset(spi) < 0)
> goto out_rel_mem;
>
> + master->dev.of_node = pdev->dev.of_node;
> status = spi_register_master(master);
> if (status < 0)
> goto out_rel_mem;
> @@ -468,10 +470,17 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
>
> MODULE_ALIAS("platform:" DRIVER_NAME);
>
> +static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
> + { .compatible = "marvell,orion-spi", },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
> +
> static struct platform_driver orion_spi_driver = {
> .driver = {
> .name = DRIVER_NAME,
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(orion_spi_of_match_table),
> },
> .remove = __exit_p(orion_spi_remove),
> };
> --
> 1.7.10
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-10 16:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-10 10:31 [PATCH 4/9] spi-orion: add device tree binding Andrew Lunn
[not found] ` <1339324322-29388-5-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2012-06-10 16:51 ` Jason Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).