提交 e5f7825c 编写于 作者: K Kuninori Morimoto 提交者: Mark Brown

spi/hspi: add device tree support

Support for loading the Renesas HSPI driver via devicetree.
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 a29c8ae7
Renesas HSPI.
Required properties:
- compatible : "renesas,hspi"
- reg : Offset and length of the register set for the device
- interrupts : interrupt line used by HSPI
...@@ -303,6 +303,7 @@ static int hspi_probe(struct platform_device *pdev) ...@@ -303,6 +303,7 @@ static int hspi_probe(struct platform_device *pdev)
master->setup = hspi_setup; master->setup = hspi_setup;
master->cleanup = hspi_cleanup; master->cleanup = hspi_cleanup;
master->mode_bits = SPI_CPOL | SPI_CPHA; master->mode_bits = SPI_CPOL | SPI_CPHA;
master->dev.of_node = pdev->dev.of_node;
master->auto_runtime_pm = true; master->auto_runtime_pm = true;
master->transfer_one_message = hspi_transfer_one_message; master->transfer_one_message = hspi_transfer_one_message;
ret = spi_register_master(master); ret = spi_register_master(master);
...@@ -333,12 +334,19 @@ static int hspi_remove(struct platform_device *pdev) ...@@ -333,12 +334,19 @@ static int hspi_remove(struct platform_device *pdev)
return 0; 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 = { static struct platform_driver hspi_driver = {
.probe = hspi_probe, .probe = hspi_probe,
.remove = hspi_remove, .remove = hspi_remove,
.driver = { .driver = {
.name = "sh-hspi", .name = "sh-hspi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = hspi_of_match,
}, },
}; };
module_platform_driver(hspi_driver); module_platform_driver(hspi_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册