Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 32215a6c authored by Jay Fang's avatar Jay Fang Committed by Mark Brown
Browse files

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: default avatarJay Fang <f.fangjian@huawei.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2527704d
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/of.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/of_gpio.h>
#include <linux/of_platform.h>
#include <linux/of_platform.h>
#include <linux/acpi.h>
#include <linux/property.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/regmap.h>


@@ -243,12 +244,19 @@ static const struct of_device_id dw_spi_mmio_of_match[] = {
};
};
MODULE_DEVICE_TABLE(of, 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 = {
static struct platform_driver dw_spi_mmio_driver = {
	.probe		= dw_spi_mmio_probe,
	.probe		= dw_spi_mmio_probe,
	.remove		= dw_spi_mmio_remove,
	.remove		= dw_spi_mmio_remove,
	.driver		= {
	.driver		= {
		.name	= DRIVER_NAME,
		.name	= DRIVER_NAME,
		.of_match_table = dw_spi_mmio_of_match,
		.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);
module_platform_driver(dw_spi_mmio_driver);
+1 −0
Original line number Original line Diff line number Diff line
@@ -507,6 +507,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
	master->handle_err = dw_spi_handle_err;
	master->handle_err = dw_spi_handle_err;
	master->max_speed_hz = dws->max_freq;
	master->max_speed_hz = dws->max_freq;
	master->dev.of_node = dev->of_node;
	master->dev.of_node = dev->of_node;
	master->dev.fwnode = dev->fwnode;
	master->flags = SPI_MASTER_GPIO_SS;
	master->flags = SPI_MASTER_GPIO_SS;


	if (dws->set_cs)
	if (dws->set_cs)