]> Pileus Git - ~andy/linux/commitdiff
spi/hspi: add device tree support
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 25 Oct 2013 04:53:29 +0000 (21:53 -0700)
committerMark Brown <broonie@linaro.org>
Fri, 25 Oct 2013 08:49:56 +0000 (09:49 +0100)
Support for loading the Renesas HSPI driver via devicetree.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Documentation/devicetree/bindings/spi/sh-hspi.txt [new file with mode: 0644]
drivers/spi/spi-sh-hspi.c

diff --git a/Documentation/devicetree/bindings/spi/sh-hspi.txt b/Documentation/devicetree/bindings/spi/sh-hspi.txt
new file mode 100644 (file)
index 0000000..30b57b1
--- /dev/null
@@ -0,0 +1,7 @@
+Renesas HSPI.
+
+Required properties:
+- compatible :         "renesas,hspi"
+- reg : Offset and length of the register set for the device
+- interrupts : interrupt line used by HSPI
+
index b9e7b5e61528d2100e28628d9575e2af84a1530a..8a147d92f9eb23cea5dbc8bc608c962d3cf419f5 100644 (file)
@@ -303,6 +303,7 @@ static int hspi_probe(struct platform_device *pdev)
        master->setup           = hspi_setup;
        master->cleanup         = hspi_cleanup;
        master->mode_bits       = SPI_CPOL | SPI_CPHA;
+       master->dev.of_node     = pdev->dev.of_node;
        master->auto_runtime_pm = true;
        master->transfer_one_message            = hspi_transfer_one_message;
        ret = spi_register_master(master);
@@ -333,12 +334,19 @@ static int hspi_remove(struct platform_device *pdev)
        return 0;
 }
 
+static struct of_device_id hspi_of_match[] = {
+       { .compatible = "renesas,hspi", },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, hspi_of_match);
+
 static struct platform_driver hspi_driver = {
        .probe = hspi_probe,
        .remove = hspi_remove,
        .driver = {
                .name = "sh-hspi",
                .owner = THIS_MODULE,
+               .of_match_table = hspi_of_match,
        },
 };
 module_platform_driver(hspi_driver);