From a29c8ae7187aee902d37d7677255de726614e43e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 14 Oct 2013 10:35:42 +0900 Subject: spi: sh-hspi: Fix checkpatch issue Fix the following checkpatch warning. WARNING: space prohibited before semicolon Signed-off-by: Jingoo Han Signed-off-by: Mark Brown --- drivers/spi/spi-sh-hspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/spi/spi-sh-hspi.c') diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index e488a90a98b8..b9e7b5e61528 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c @@ -137,7 +137,7 @@ static void hspi_hw_setup(struct hspi_priv *hspi, rate /= 16; /* CLKCx calculation */ - rate /= (((idiv_clk & 0x1F) + 1) * 2) ; + rate /= (((idiv_clk & 0x1F) + 1) * 2); /* save best settings */ tmp = abs(target_rate - rate); -- cgit v1.2.3 From e5f7825cda366809153701e8bb89123bd973be00 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 24 Oct 2013 21:53:29 -0700 Subject: spi/hspi: add device tree support Support for loading the Renesas HSPI driver via devicetree. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- Documentation/devicetree/bindings/spi/sh-hspi.txt | 7 +++++++ drivers/spi/spi-sh-hspi.c | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt (limited to '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 index 000000000000..30b57b1c8a13 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/sh-hspi.txt @@ -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 + diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index b9e7b5e61528..8a147d92f9eb 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c @@ -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); -- cgit v1.2.3