aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-25 04:51:28 -0400
committerMark Brown <broonie@linaro.org>2013-10-25 04:51:28 -0400
commitffd6dd3eaa1e6a0d454c08efcc996ea7014aa1d2 (patch)
tree744fe8a02980ed1c40900e26d0b58f3591db27ce
parent6e693ff1e3ab50a8191788f2ae27a2ab890c876b (diff)
parente5f7825cda366809153701e8bb89123bd973be00 (diff)
Merge remote-tracking branch 'spi/topic/hspi' into spi-next
-rw-r--r--Documentation/devicetree/bindings/spi/sh-hspi.txt7
-rw-r--r--drivers/spi/spi-sh-hspi.c10
2 files changed, 16 insertions, 1 deletions
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 @@
1Renesas HSPI.
2
3Required properties:
4- compatible : "renesas,hspi"
5- reg : Offset and length of the register set for the device
6- interrupts : interrupt line used by HSPI
7
diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c
index 7e749a22f51e..292567ab4c6c 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,
137 rate /= 16; 137 rate /= 16;
138 138
139 /* CLKCx calculation */ 139 /* CLKCx calculation */
140 rate /= (((idiv_clk & 0x1F) + 1) * 2) ; 140 rate /= (((idiv_clk & 0x1F) + 1) * 2);
141 141
142 /* save best settings */ 142 /* save best settings */
143 tmp = abs(target_rate - rate); 143 tmp = abs(target_rate - rate);
@@ -303,6 +303,7 @@ static int hspi_probe(struct platform_device *pdev)
303 master->setup = hspi_setup; 303 master->setup = hspi_setup;
304 master->cleanup = hspi_cleanup; 304 master->cleanup = hspi_cleanup;
305 master->mode_bits = SPI_CPOL | SPI_CPHA; 305 master->mode_bits = SPI_CPOL | SPI_CPHA;
306 master->dev.of_node = pdev->dev.of_node;
306 master->auto_runtime_pm = true; 307 master->auto_runtime_pm = true;
307 master->transfer_one_message = hspi_transfer_one_message; 308 master->transfer_one_message = hspi_transfer_one_message;
308 ret = devm_spi_register_master(&pdev->dev, master); 309 ret = devm_spi_register_master(&pdev->dev, master);
@@ -332,12 +333,19 @@ static int hspi_remove(struct platform_device *pdev)
332 return 0; 333 return 0;
333} 334}
334 335
336static struct of_device_id hspi_of_match[] = {
337 { .compatible = "renesas,hspi", },
338 { /* sentinel */ }
339};
340MODULE_DEVICE_TABLE(of, hspi_of_match);
341
335static struct platform_driver hspi_driver = { 342static struct platform_driver hspi_driver = {
336 .probe = hspi_probe, 343 .probe = hspi_probe,
337 .remove = hspi_remove, 344 .remove = hspi_remove,
338 .driver = { 345 .driver = {
339 .name = "sh-hspi", 346 .name = "sh-hspi",
340 .owner = THIS_MODULE, 347 .owner = THIS_MODULE,
348 .of_match_table = hspi_of_match,
341 }, 349 },
342}; 350};
343module_platform_driver(hspi_driver); 351module_platform_driver(hspi_driver);