Linux CAN drivers development
 help / color / mirror / Atom feed
* [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

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