aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-sh-hspi.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-10-25 00:53:29 -0400
committerMark Brown <broonie@linaro.org>2013-10-25 04:49:56 -0400
commite5f7825cda366809153701e8bb89123bd973be00 (patch)
tree91616d3f28d4fe886f462d04436ea73c7a322c11 /drivers/spi/spi-sh-hspi.c
parenta29c8ae7187aee902d37d7677255de726614e43e (diff)
spi/hspi: add device tree support
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>
Diffstat (limited to 'drivers/spi/spi-sh-hspi.c')
-rw-r--r--drivers/spi/spi-sh-hspi.c8
1 files changed, 8 insertions, 0 deletions
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)
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 = spi_register_master(master); 309 ret = spi_register_master(master);
@@ -333,12 +334,19 @@ static int hspi_remove(struct platform_device *pdev)
333 return 0; 334 return 0;
334} 335}
335 336
337static struct of_device_id hspi_of_match[] = {
338 { .compatible = "renesas,hspi", },
339 { /* sentinel */ }
340};
341MODULE_DEVICE_TABLE(of, hspi_of_match);
342
336static struct platform_driver hspi_driver = { 343static struct platform_driver hspi_driver = {
337 .probe = hspi_probe, 344 .probe = hspi_probe,
338 .remove = hspi_remove, 345 .remove = hspi_remove,
339 .driver = { 346 .driver = {
340 .name = "sh-hspi", 347 .name = "sh-hspi",
341 .owner = THIS_MODULE, 348 .owner = THIS_MODULE,
349 .of_match_table = hspi_of_match,
342 }, 350 },
343}; 351};
344module_platform_driver(hspi_driver); 352module_platform_driver(hspi_driver);