diff options
author | Kamlakant Patel <kamlakant.patel@broadcom.com> | 2016-08-09 10:05:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-08-09 10:25:43 -0400 |
commit | 097d06192caf6db29ff6b8a9117cfaf7a514821f (patch) | |
tree | 622f4a2cccd51bd554a2222609c4fd4664807230 | |
parent | 29b4817d4018df78086157ea3a55c1d9424a7cfc (diff) |
spi: xlp: Add ACPI support for Vulcan SPI controller
Add ACPI support for SPI controller on Broadcom Vulcan ARM64.
Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-xlp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/spi/spi-xlp.c b/drivers/spi/spi-xlp.c index 8f04feca6ee3..4071a729eb2f 100644 --- a/drivers/spi/spi-xlp.c +++ b/drivers/spi/spi-xlp.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
13 | */ | 13 | */ |
14 | #include <linux/acpi.h> | ||
14 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
16 | #include <linux/module.h> | 17 | #include <linux/module.h> |
@@ -405,8 +406,9 @@ static int xlp_spi_probe(struct platform_device *pdev) | |||
405 | clk = devm_clk_get(&pdev->dev, NULL); | 406 | clk = devm_clk_get(&pdev->dev, NULL); |
406 | if (IS_ERR(clk)) { | 407 | if (IS_ERR(clk)) { |
407 | dev_err(&pdev->dev, "could not get spi clock\n"); | 408 | dev_err(&pdev->dev, "could not get spi clock\n"); |
408 | return -ENODEV; | 409 | return PTR_ERR(clk); |
409 | } | 410 | } |
411 | |||
410 | xspi->spi_clk = clk_get_rate(clk); | 412 | xspi->spi_clk = clk_get_rate(clk); |
411 | 413 | ||
412 | master = spi_alloc_master(&pdev->dev, 0); | 414 | master = spi_alloc_master(&pdev->dev, 0); |
@@ -437,6 +439,14 @@ static int xlp_spi_probe(struct platform_device *pdev) | |||
437 | return 0; | 439 | return 0; |
438 | } | 440 | } |
439 | 441 | ||
442 | #ifdef CONFIG_ACPI | ||
443 | static const struct acpi_device_id xlp_spi_acpi_match[] = { | ||
444 | { "BRCM900D", 0 }, | ||
445 | { }, | ||
446 | }; | ||
447 | MODULE_DEVICE_TABLE(acpi, xlp_spi_acpi_match); | ||
448 | #endif | ||
449 | |||
440 | static const struct of_device_id xlp_spi_dt_id[] = { | 450 | static const struct of_device_id xlp_spi_dt_id[] = { |
441 | { .compatible = "netlogic,xlp832-spi" }, | 451 | { .compatible = "netlogic,xlp832-spi" }, |
442 | { }, | 452 | { }, |
@@ -447,6 +457,7 @@ static struct platform_driver xlp_spi_driver = { | |||
447 | .driver = { | 457 | .driver = { |
448 | .name = "xlp-spi", | 458 | .name = "xlp-spi", |
449 | .of_match_table = xlp_spi_dt_id, | 459 | .of_match_table = xlp_spi_dt_id, |
460 | .acpi_match_table = ACPI_PTR(xlp_spi_acpi_match), | ||
450 | }, | 461 | }, |
451 | }; | 462 | }; |
452 | module_platform_driver(xlp_spi_driver); | 463 | module_platform_driver(xlp_spi_driver); |