Skip to contentSkip to conversation

Add LECARC ACPI IDs for DesignWare GPIO, SPI, I2C

PATCH In review thomas 2 participants 7 messages May 14 – May 15

Subsystems (7)
lore
Share & tools
lore
author
#1 lore raw

PATCH 1/3 gpio: dwapb: Add LECARC ACPI ID

In reply to thomas

Add ACPI ID "LECA0001" for LECARC SoCs that use the DesignWare GPIO controller with V1 register offsets.

---
 drivers/gpio/gpio-dwapb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-dwapb.c +1 -0
index 15cebc8b5d66..c1f3d83a67c1 100644
@@ -694,6 +694,7 @@ static const struct acpi_device_id dwapb_acpi_match[] = {
 	{"APMC0D07", GPIO_REG_OFFSET_V1},
 	{"APMC0D81", GPIO_REG_OFFSET_V2},
 	{"FUJI200A", GPIO_REG_OFFSET_V1},
+	{"LECA0001", GPIO_REG_OFFSET_V1},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dwapb_acpi_match);
Signature · 1 line
2.43.0
author
#4 lore raw

PATCH 3/3 i2c: designware: Add LECARC ACPI ID

In reply to thomas

Add ACPI ID "LECA0003" for LECARC SoCs that integrate the DesignWare I2C controller.

Also add corresponding ACPI description in acpi_apd.c.

---
 drivers/acpi/acpi_apd.c                     | 5 +++++
 drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
 2 files changed, 6 insertions(+)
drivers/acpi/acpi_apd.c +5 -0
index 3a80e833215e..ae6a7da56e89 100644
@@ -187,6 +187,10 @@ static const struct apd_device_desc leca_spi_desc = {
 	.fixed_clk_rate = 400000000,
 };
 
+static const struct apd_device_desc leca_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 250000000,
+};
 #endif /* CONFIG_ARM64 */
 
 #endif
@@ -259,6 +263,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
 	{ "LECA0002", APD_ADDR(leca_spi_desc) },
+	{ "LECA0003", APD_ADDR(leca_i2c_desc) },
 #endif
 	{ }
 };
drivers/i2c/busses/i2c-designware-platdrv.c +1 -0
index 3351c4a9ef11..b435b4015f02 100644
@@ -279,6 +279,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "INT3432", 0 },
 	{ "INT3433", 0 },
 	{ "INTC10EF", 0 },
+	{ "LECA0003", 0 },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH 2/3 spi: dw-mmio: Add LECARC ACPI ID and init hook

In reply to thomas

Add ACPI ID "LECA0002" for LECARC SoCs. This ID requires a custom initialization function dw_spi_lecarc_init() that sets dws->dws.ip to DW_HSSI_ID.

Also add corresponding ACPI description in acpi_apd.c.

---
 drivers/acpi/acpi_apd.c   | 7 +++++++
 drivers/spi/spi-dw-mmio.c | 9 +++++++++
 2 files changed, 16 insertions(+)
drivers/acpi/acpi_apd.c +7 -0
index bed0791c17fc..3a80e833215e 100644
@@ -181,6 +181,12 @@ static const struct apd_device_desc hip08_spi_desc = {
 	.setup = acpi_apd_setup,
 	.fixed_clk_rate = 250000000,
 };
+
+static const struct apd_device_desc leca_spi_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 400000000,
+};
+
 #endif /* CONFIG_ARM64 */
 
 #endif
@@ -252,6 +258,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
 	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
+	{ "LECA0002", APD_ADDR(leca_spi_desc) },
 #endif
 	{ }
 };
drivers/spi/spi-dw-mmio.c +9 -0
index 1bfdf24c3227..50b50553b360 100644
@@ -234,6 +234,14 @@ static int dw_spi_intel_init(struct platform_device *pdev,
 	return 0;
 }
 
+static int dw_spi_lecarc_init(struct platform_device *pdev,
+			     struct dw_spi_mmio *dwsmmio)
+{
+	dwsmmio->dws.ip = DW_HSSI_ID;
+
+	return 0;
+}
+
 /*
  * DMA-based mem ops are not configured for this device and are not tested.
  */
@@ -453,6 +461,7 @@ MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match);
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id dw_spi_mmio_acpi_match[] = {
 	{"HISI0173", (kernel_ulong_t)dw_spi_pssi_init},
+	{"LECA0002", (kernel_ulong_t)dw_spi_lecarc_init},
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
Signature · 1 line
2.43.0

thomas

author
#0 lore raw

cover Add LECARC ACPI IDs for DesignWare GPIO, SPI, I2C

This patch series adds ACPI identification for LECARC SoCs that integrate Synopsys DesignWare peripherals.

LECARC platforms use the following ACPI HIDs:
- GPIO: LECA0001 (V1 register offsets)
- SPI: LECA0002 (requires custom init function)
- I2C: LECA0003

The patches are independent but share a common dependency on the ACPI description file (drivers/acpi/acpi_apd.c) for SPI and I2C. To avoid merge conflicts, they are submitted as a single series with the following order:

Patch 1: gpio: dwapb – add LECA0001 to dwapb_acpi_match[]. Patch 2: spi: dw-mmio – add LECA0002 and dw_spi_lecarc_init(),
plus corresponding entry in acpi_apd.c.
Patch 3: i2c: designware – add LECA0003 to dw_i2c_acpi_match[],
plus corresponding entry in acpi_apd.c.

All changes have been tested on LECARC evaluation board with kernel v7.0.0-rc6. No regressions observed on existing hardware.

Please apply.

thomas (3):
gpio: dwapb: Add LECARC ACPI ID
spi: dw-mmio: Add LECARC ACPI ID and init hook
i2c: designware: Add LECARC ACPI ID

 drivers/acpi/acpi_apd.c                     | 12 ++++++++++++
 drivers/gpio/gpio-dwapb.c                   |  1 +
 drivers/i2c/busses/i2c-designware-platdrv.c |  1 +
 drivers/spi/spi-dw-mmio.c                   |  9 +++++++++
 4 files changed, 23 insertions(+)

--
2.43.0

#3 lore raw

Re: [PATCH 2/3] spi: dw-mmio: Add LECARC ACPI ID and init hook

In reply to thomas
Quoted 5 lines · thomas

Add ACPI ID "LECA0002" for LECARC SoCs. This ID requires a custom initialization function dw_spi_lecarc_init() that sets dws->dws.ip to DW_HSSI_ID.

Also add corresponding ACPI description in acpi_apd.c.

...

drivers/acpi/acpi_apd.c static const struct acpi_device_id acpi_apd_device_ids[] = { · line 261

Quoted 4 lines
drivers/acpi/acpi_apd.c +1 -0
 	{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
 	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
+	{ "LECA0002", APD_ADDR(leca_spi_desc) },

Keep them ordered or close enough to be ordered. Id est in this case locate it before NXP.

...

drivers/spi/spi-dw-mmio.c static int dw_spi_intel_init(struct platform_device *pdev, · line 243

Quoted 7 lines
drivers/spi/spi-dw-mmio.c +7 -0
+static int dw_spi_lecarc_init(struct platform_device *pdev,
+			     struct dw_spi_mmio *dwsmmio)
+{
+	dwsmmio->dws.ip = DW_HSSI_ID;
+
+	return 0;
+}

dw_spi_intel_init() is the same, why not reusing it?

Note, if uncomfortable with the name, make a patch to rename it to something like dw_spi_hssi_no_dma_init().

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw
In reply to thomas

On Thu, May 14, 2026 at 10:40:09AM +0800, thomas wrote:

This is a v2 of the series (Mark commented on the wrong one AFAICS), please make sure you do proper versioning and changelog is provided.

Quoted 13 lines

This patch series adds ACPI identification for LECARC SoCs that integrate Synopsys DesignWare peripherals.

LECARC platforms use the following ACPI HIDs:
- GPIO: LECA0001 (V1 register offsets)
- SPI: LECA0002 (requires custom init function)
- I2C: LECA0003

The patches are independent but share a common dependency on the ACPI description file (drivers/acpi/acpi_apd.c) for SPI and I2C. To avoid merge conflicts, they are submitted as a single series with the following order:

Quoted 5 lines

Patch 1: gpio: dwapb – add LECA0001 to dwapb_acpi_match[]. Patch 2: spi: dw-mmio – add LECA0002 and dw_spi_lecarc_init(),
plus corresponding entry in acpi_apd.c.
Patch 3: i2c: designware – add LECA0003 to dw_i2c_acpi_match[],
plus corresponding entry in acpi_apd.c.

You have to fix your SoB. There should be your real name and not an alias.

Quoted 2 lines

All changes have been tested on LECARC evaluation board with kernel v7.0.0-rc6. No regressions observed on existing hardware.

Otherwise I can confirm that LECA is officially registered ACPI vendor ID and the IDs look legit (it's up to the company to map the device ID parts to whatever devices they have properly).

When you address the SoB and other comments, I ack them.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw

Re: [PATCH 3/3] i2c: designware: Add LECARC ACPI ID

In reply to thomas
Quoted 6 lines · thomas

Add ACPI ID "LECA0003" for LECARC SoCs that integrate the DesignWare I2C controller.

Also add corresponding ACPI description in acpi_apd.c.

Fix the name field in SoB, has to be your real name and not an alias.

Code wise, after rebasing on a new version of SPI patch (see comments there), will be perfect.

Signature · 2 lines
With Best Regards,
Andy Shevchenko