提交 45ca2904 编写于 作者: J Jay Fang 提交者: Xie XiuQi

spi: dw-mmio: add ACPI support

mainline inclusion
from linux-next
commit: 32215a6c6beb8dcda4bb0759b04ce3c30927963b
category: feature (SPI ACPI for Hi1620)
bugzilla: 5443
CVE: NA

TPM chip on D06 is SPI based, so we need to add SPI ACPI support
for Hi1620.

Two patches already merged for 4.21, but the core support for spi
has another patchset needs lots of refactor, so just use the patch
from Fang Jian to enable this feature on 4.19

[PATCH 1/4] spi: dw-mmio: add ACPI support
[PATCH 2/4] ACPI / APD: Add clock frequency for Hisilicon Hip08 SPI controller
[PATCH 3/4] spi: add ACPI support for SPI controller chip select lines(cs-gpios)
[PATCH 4/4] hulk_defconfig: ensble SPI designware driver for Hi1620

--------------------------------------------------

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: NJay Fang <f.fangjian@huawei.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 738e06fc
......@@ -20,6 +20,7 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/of_platform.h>
#include <linux/acpi.h>
#include <linux/property.h>
#include <linux/regmap.h>
......@@ -217,12 +218,19 @@ static const struct of_device_id dw_spi_mmio_of_match[] = {
};
MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match);
static const struct acpi_device_id dw_spi_mmio_acpi_match[] = {
{"HISI0173", 0},
{},
};
MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
static struct platform_driver dw_spi_mmio_driver = {
.probe = dw_spi_mmio_probe,
.remove = dw_spi_mmio_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = dw_spi_mmio_of_match,
.acpi_match_table = ACPI_PTR(dw_spi_mmio_acpi_match),
},
};
module_platform_driver(dw_spi_mmio_driver);
......
......@@ -506,6 +506,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
master->handle_err = dw_spi_handle_err;
master->max_speed_hz = dws->max_freq;
master->dev.of_node = dev->of_node;
master->dev.fwnode = dev->fwnode;
master->flags = SPI_MASTER_GPIO_SS;
if (dws->set_cs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册