Commit 88cbdc82 authored by Xu Yiwei's avatar Xu Yiwei Committed by guzitao
Browse files

sw64: match platform device by acpi method

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



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

It support matching platform device by acpi method.

Signed-off-by: default avatarXu Yiwei <xuyiwei@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent f88e42c4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@
		i2c0@0x8031 {
			#address-cells = <2>;
			#size-cells = <2>;
			compatible = "snps,designware-i2c";
			compatible = "sunway,suntai-i2c", "snps,designware-i2c";
			reg = <0x8031 0x0 0x0 0x8000>;
			clock-frequency = <100000>;
			clocks = <&i2cclk>;
@@ -98,7 +98,7 @@
		i2c1@0x8034 {
			#address-cells = <1>;
			#size-cells = <0>;
			compatible = "snps,designware-i2c";
			compatible = "sunway,suntai-i2c", "snps,designware-i2c";
			reg = <0x8034 0x0 0x0 0x8000>;
			clock-frequency = <100000>;
			clocks = <&i2cclk>;
@@ -110,7 +110,7 @@
		i2c2@0x8035 {
			#address-cells = <1>;
			#size-cells = <0>;
			compatible = "snps,designware-i2c";
			compatible = "sunway,suntai-i2c", "snps,designware-i2c";
			reg = <0x8035 0x0 0x0 0x8000>;
			clock-frequency = <100000>;
			clocks = <&i2cclk>;
+2 −2
Original line number Diff line number Diff line
@@ -261,8 +261,8 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
#endif
#ifdef CONFIG_SW64
	{ "HISI02A1", APD_ADDR(sunway_i2c_desc) },
	{ "HISI0173", APD_ADDR(sunway_spi_desc) },
	{ "SUNW0005", APD_ADDR(sunway_i2c_desc) },
	{ "SUNW0008", APD_ADDR(sunway_spi_desc) },
#endif
	{ }
};
+5 −0
Original line number Diff line number Diff line
@@ -648,13 +648,16 @@ static const struct of_device_id sunway_of_match[] = {
};
MODULE_DEVICE_TABLE(of, sunway_of_match);

#ifdef CONFIG_ACPI
static const struct acpi_device_id sunway_acpi_match[] = {
	{"HISI0181", 0},
	{"APMC0D07", 0},
	{"APMC0D81", GPIO_REG_OFFSET_V2},
	{"SUNW0002", 0},
	{ }
};
MODULE_DEVICE_TABLE(acpi, sunway_acpi_match);
#endif

static int sunway_gpio_probe(struct platform_device *pdev)
{
@@ -727,6 +730,8 @@ static int sunway_gpio_probe(struct platform_device *pdev)
	}
	platform_set_drvdata(pdev, gpio);

	def_info(&pdev->dev, "GPIO probe succeed\n");

	return 0;

out_unregister:
+11 −0
Original line number Diff line number Diff line
@@ -184,6 +184,8 @@ static int pvt_vol_plat_probe(struct platform_device *pdev)
		return false;
	}

	dev_info(&pdev->dev, "PVT probe succeed\n");

	return 0;

err:
@@ -199,11 +201,20 @@ static const struct of_device_id pvt_vol_of_match[] = {
MODULE_DEVICE_TABLE(of, pvt_vol_of_match);
#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id pvt_vol_acpi_match[] = {
	{ "SUNW0007", 0 },
	{ },
};
MODULE_DEVICE_TABLE(acpi, pvt_vol_acpi_match);
#endif

static struct platform_driver pvt_vol_driver = {
	.probe = pvt_vol_plat_probe,
	.driver         = {
		.name   = "pvt-sw64",
		.of_match_table = of_match_ptr(pvt_vol_of_match),
		.acpi_match_table = ACPI_PTR(pvt_vol_acpi_match),
	},
};

+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
	{ "HISI02A2", 0 },
	{ "HISI02A3", 0 },
	{ "HYGO0010", ACCESS_INTR_MASK },
	{ "SUNW0005", MODEL_SUNWAY },
	{ }
};
MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
Loading