diff options
author | Jay Fang <f.fangjian@huawei.com> | 2018-12-02 22:15:50 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-12-04 12:24:57 -0500 |
commit | 32215a6c6beb8dcda4bb0759b04ce3c30927963b (patch) | |
tree | a527ed7de52ea6798c209b2c10dc9595de947a19 | |
parent | 2527704d8411e2b4241916e8b22505cb4519ce08 (diff) |
spi: dw-mmio: add ACPI support
The Hisilicon Hip08 platform, that uses ACPI, has this controller.
Let's add ACPI support for DW SPI MMIO-based host.
The ACPI ID used is "HISI0173" for the Designware SPI controller of
Hisilicon Hip08 platform.
Signed-off-by: Jay Fang <f.fangjian@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-dw-mmio.c | 8 | ||||
-rw-r--r-- | drivers/spi/spi-dw.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 3ffb6a40fe0c..d0dd7814e997 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/of.h> | 20 | #include <linux/of.h> |
21 | #include <linux/of_gpio.h> | 21 | #include <linux/of_gpio.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <linux/acpi.h> | ||
23 | #include <linux/property.h> | 24 | #include <linux/property.h> |
24 | #include <linux/regmap.h> | 25 | #include <linux/regmap.h> |
25 | 26 | ||
@@ -243,12 +244,19 @@ static const struct of_device_id dw_spi_mmio_of_match[] = { | |||
243 | }; | 244 | }; |
244 | MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match); | 245 | MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match); |
245 | 246 | ||
247 | static const struct acpi_device_id dw_spi_mmio_acpi_match[] = { | ||
248 | {"HISI0173", 0}, | ||
249 | {}, | ||
250 | }; | ||
251 | MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match); | ||
252 | |||
246 | static struct platform_driver dw_spi_mmio_driver = { | 253 | static struct platform_driver dw_spi_mmio_driver = { |
247 | .probe = dw_spi_mmio_probe, | 254 | .probe = dw_spi_mmio_probe, |
248 | .remove = dw_spi_mmio_remove, | 255 | .remove = dw_spi_mmio_remove, |
249 | .driver = { | 256 | .driver = { |
250 | .name = DRIVER_NAME, | 257 | .name = DRIVER_NAME, |
251 | .of_match_table = dw_spi_mmio_of_match, | 258 | .of_match_table = dw_spi_mmio_of_match, |
259 | .acpi_match_table = ACPI_PTR(dw_spi_mmio_acpi_match), | ||
252 | }, | 260 | }, |
253 | }; | 261 | }; |
254 | module_platform_driver(dw_spi_mmio_driver); | 262 | module_platform_driver(dw_spi_mmio_driver); |
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index b705f2bdb8b9..2e822a56576a 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c | |||
@@ -507,6 +507,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) | |||
507 | master->handle_err = dw_spi_handle_err; | 507 | master->handle_err = dw_spi_handle_err; |
508 | master->max_speed_hz = dws->max_freq; | 508 | master->max_speed_hz = dws->max_freq; |
509 | master->dev.of_node = dev->of_node; | 509 | master->dev.of_node = dev->of_node; |
510 | master->dev.fwnode = dev->fwnode; | ||
510 | master->flags = SPI_MASTER_GPIO_SS; | 511 | master->flags = SPI_MASTER_GPIO_SS; |
511 | 512 | ||
512 | if (dws->set_cs) | 513 | if (dws->set_cs) |