* [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515
@ 2026-06-16 3:00 guoqi0226
2026-06-16 3:00 ` [PATCH 2/2] can: mcp251xfd: Add ACPI device ID table for MCP251XFD guoqi0226
2026-06-16 7:10 ` [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515 Marc Kleine-Budde
0 siblings, 2 replies; 4+ messages in thread
From: guoqi0226 @ 2026-06-16 3:00 UTC (permalink / raw)
To: Marc Kleine-Budde, Vincent Mailhol, Manivannan Sadhasivam
Cc: Thomas Kopp, linux-can, guoqi0226, cuiguoqi
This patch adds an ACPI match table for the MCP2515 CAN controller,
enabling driver binding on ACPI-enumerated SPI platforms.
Signed-off-by: cuiguoqi <cuiguoqi@kylinos.cn>
Signed-off-by: guoqi0226 <guoqi0226@163.com>
---
drivers/net/can/spi/mcp251x.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 0d0190ae094a..58495d7639b4 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -41,6 +41,7 @@
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/uaccess.h>
+#include <linux/acpi.h>
/* SPI interface instruction set */
#define INSTRUCTION_WRITE 0x02
@@ -1328,6 +1329,15 @@ static const struct spi_device_id mcp251x_id_table[] = {
};
MODULE_DEVICE_TABLE(spi, mcp251x_id_table);
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id mcp251x_acpi_match[] = {
+ { "MCP2515", (kernel_ulong_t)CAN_MCP251X_MCP2515 },
+ { }
+};
+
+MODULE_DEVICE_TABLE(acpi, mcp251x_acpi_match);
+#endif
+
static int mcp251x_can_probe(struct spi_device *spi)
{
struct net_device *net;
@@ -1558,6 +1568,7 @@ static struct spi_driver mcp251x_can_driver = {
.driver = {
.name = DEVICE_NAME,
.of_match_table = mcp251x_of_match,
+ .acpi_match_table = ACPI_PTR(mcp251x_acpi_match),
.pm = &mcp251x_can_pm_ops,
},
.id_table = mcp251x_id_table,
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] can: mcp251xfd: Add ACPI device ID table for MCP251XFD
2026-06-16 3:00 [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515 guoqi0226
@ 2026-06-16 3:00 ` guoqi0226
2026-06-16 3:13 ` sashiko-bot
2026-06-16 7:10 ` [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515 Marc Kleine-Budde
1 sibling, 1 reply; 4+ messages in thread
From: guoqi0226 @ 2026-06-16 3:00 UTC (permalink / raw)
To: Marc Kleine-Budde, Vincent Mailhol, Manivannan Sadhasivam
Cc: Thomas Kopp, linux-can, guoqi0226
This patch adds an ACPI match table for the MCP251XFD CAN controller,
enabling driver binding on ACPI-enumerated SPI platforms.
Signed-off-by: guoqi0226 <guoqi0226@163.com>
---
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 92a86083c896..3fc6e82abe4e 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
+#include <linux/acpi.h>
#include "mcp251xfd.h"
@@ -2212,6 +2213,14 @@ static const struct spi_device_id mcp251xfd_id_table[] = {
};
MODULE_DEVICE_TABLE(spi, mcp251xfd_id_table);
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id mcp251xfd_acpi_match[] = {
+ { "MCP251XFD", (kernel_ulong_t)&mcp251xfd_devtype_data_mcp251xfd},
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, mcp251xfd_acpi_match);
+#endif
+
static int mcp251xfd_probe(struct spi_device *spi)
{
struct net_device *ndev;
@@ -2442,6 +2451,7 @@ static struct spi_driver mcp251xfd_driver = {
.name = DEVICE_NAME,
.pm = &mcp251xfd_pm_ops,
.of_match_table = mcp251xfd_of_match,
+ .acpi_match_table = ACPI_PTR(mcp251xfd_acpi_match),
},
.probe = mcp251xfd_probe,
.remove = mcp251xfd_remove,
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 2/2] can: mcp251xfd: Add ACPI device ID table for MCP251XFD
2026-06-16 3:00 ` [PATCH 2/2] can: mcp251xfd: Add ACPI device ID table for MCP251XFD guoqi0226
@ 2026-06-16 3:13 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-06-16 3:13 UTC (permalink / raw)
To: guoqi0226
Cc: Oleksij Rempel, Vincent Mailhol, Marc Kleine-Budde,
Oliver Hartkopp, linux-can
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The ACPI Hardware ID (HID) 'MCP251XFD' violates the ACPI specification format and length requirements.
--
commit 1d6ad13eeda40da0f75db78e76e1e476fdd6965b
Author: guoqi0226 <guoqi0226@163.com>
can: mcp251xfd: Add ACPI device ID table for MCP251XFD
This patch adds an ACPI match table for the MCP251XFD CAN controller to
enable driver binding on ACPI-enumerated SPI platforms.
> diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
[ ... ]
> @@ -2212,6 +2213,14 @@ static const struct spi_device_id mcp251xfd_id_table[] = {
> };
> MODULE_DEVICE_TABLE(spi, mcp251xfd_id_table);
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id mcp251xfd_acpi_match[] = {
> + { "MCP251XFD", (kernel_ulong_t)&mcp251xfd_devtype_data_mcp251xfd},
[Severity: Low]
Does this ACPI Hardware ID violate the ACPI specification length and format
requirements?
According to the ACPI specification, a valid ACPI HID must be exactly 8
characters long (typically 4 uppercase letters followed by 4 hexadecimal
digits) or a 7-character PNP ID. The string "MCP251XFD" is 9 characters
long and does not end in hex digits.
Could this be avoided by using the generic "PRP0001" HID in the firmware
instead?
By providing the OF compatible string ("microchip,mcp251xfd") via the ACPI
_DSD table, the existing mcp251xfd_of_match table would handle the
enumeration without requiring any ACPI-specific driver changes.
> + { }
> +};
> +MODULE_DEVICE_TABLE(acpi, mcp251xfd_acpi_match);
> +#endif
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260616030019.35845-1-guoqi0226@163.com?part=2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515
2026-06-16 3:00 [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515 guoqi0226
2026-06-16 3:00 ` [PATCH 2/2] can: mcp251xfd: Add ACPI device ID table for MCP251XFD guoqi0226
@ 2026-06-16 7:10 ` Marc Kleine-Budde
1 sibling, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2026-06-16 7:10 UTC (permalink / raw)
To: guoqi0226
Cc: Vincent Mailhol, Manivannan Sadhasivam, Thomas Kopp, linux-can,
cuiguoqi
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]
On 16.06.2026 11:00:18, guoqi0226 wrote:
> This patch adds an ACPI match table for the MCP2515 CAN controller,
> enabling driver binding on ACPI-enumerated SPI platforms.
Thanks for your contribution. Have you successfully tested both drivers
(mcp251x and mcp251xfd) on real hardware with these ACPI bindings?
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-16 7:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 3:00 [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515 guoqi0226
2026-06-16 3:00 ` [PATCH 2/2] can: mcp251xfd: Add ACPI device ID table for MCP251XFD guoqi0226
2026-06-16 3:13 ` sashiko-bot
2026-06-16 7:10 ` [PATCH 1/2] can: mcp251x: Add ACPI device ID table for MCP2515 Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox