Skip to contentSkip to conversation

NET: m_can: split into core library and platform adaptation

PATCH New Felipe Balbi 1 participant 2 messages Sep 9, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 NET: m_can: split into core library and platform adaptation

A future patch will add PCI-based m_can driver. This patch makes that a lot simpler.

---
 drivers/net/can/m_can/Kconfig          |  10 +
 drivers/net/can/m_can/Makefile         |   1 +
 drivers/net/can/m_can/m_can.c          | 707 ++-----------------------
 drivers/net/can/m_can/m_can.h          | 420 +++++++++++++++
 drivers/net/can/m_can/m_can_platform.c | 306 +++++++++++
 5 files changed, 778 insertions(+), 666 deletions(-)
 create mode 100644 drivers/net/can/m_can/m_can.h
 create mode 100644 drivers/net/can/m_can/m_can_platform.c
drivers/net/can/m_can/Kconfig +10 -0
index ec4b2e117f66..fba73338bc38 100644
@@ -4,3 +4,13 @@ config CAN_M_CAN
 	tristate "Bosch M_CAN devices"
 	---help---
 	  Say Y here if you want to support for Bosch M_CAN controller.
+
+if CAN_M_CAN
+
+config CAN_M_CAN_PLATFORM
+	tristate "Generic Platform Bus based M_CAN driver"
+	---help---
+	   Say Y here if you want to support Bosch M_CAN controller connected
+	   to the platform bus.
+
+endif
drivers/net/can/m_can/Makefile +1 -0
index 599ae69cb4a1..ac568be3de98 100644
@@ -4,3 +4,4 @@
 #
 
 obj-$(CONFIG_CAN_M_CAN) += m_can.o
+obj-$(CONFIG_CAN_M_CAN_PLATFORM) += m_can_platform.o
drivers/net/can/m_can/m_can.c +41 -666

853 lines not on this page · raw message

drivers/net/can/m_can/m_can.h new file +420 -0

420 lines not on this page · raw message

drivers/net/can/m_can/m_can_platform.c new file +306 -0

306 lines not on this page · raw message

Signature · 1 line
2.23.0
#1 lore raw

PATCH 2/2 NET: m_can: add PCI glue driver

Some intel platforms support an MCAN controller attached to the PCI bus. This minimal driver adds support for those.

---
 drivers/net/can/m_can/Kconfig     |   7 +
 drivers/net/can/m_can/Makefile    |   1 +
 drivers/net/can/m_can/m_can_pci.c | 222 ++++++++++++++++++++++++++++++
 3 files changed, 230 insertions(+)
 create mode 100644 drivers/net/can/m_can/m_can_pci.c
drivers/net/can/m_can/Kconfig +7 -0
index fba73338bc38..c7fbea72491c 100644
@@ -13,4 +13,11 @@ config CAN_M_CAN_PLATFORM
 	   Say Y here if you want to support Bosch M_CAN controller connected
 	   to the platform bus.
 
+config CAN_M_CAN_PCI
+	tristate "Generic PCI Bus based M_CAN driver"
+	depends on PCI
+	---help---
+	   Say Y here if you want to support Bosch M_CAN controller connected
+	   to the pci bus.
+
 endif
drivers/net/can/m_can/Makefile +1 -0
index ac568be3de98..104de5cb6d79 100644
@@ -5,3 +5,4 @@
 
 obj-$(CONFIG_CAN_M_CAN) += m_can.o
 obj-$(CONFIG_CAN_M_CAN_PLATFORM) += m_can_platform.o
+obj-$(CONFIG_CAN_M_CAN_PCI) += m_can_pci.o
drivers/net/can/m_can/m_can_pci.c new file +222 -0

222 lines not on this page · raw message

Signature · 1 line
2.23.0