drivers: can: remove CAN_HAS_CANFD Kconfig helper

Remove the CAN_HAS_CANFD Kconfig helper symbol in order to allow enabling
CAN-FD support in the API regardless of driver support.

Change default to CAN-FD support being disabled and have samples and tests
that require CAN-FD support turn it on. This aligns the default
configuration across CAN controller drivers regardless of their
capabilities.

The rationale behind this is that we are starting to see MCUs with multiple
CAN controllers, some CAN-FD compatible, some not (e.g. NXP i.MX RT1060 and
FPGAs). Automatically enabling CAN-FD support based on the presence of a
CAN-FD capable CAN controller leads to different application default
settings based on the CAN controller(s) in use.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-01-24 12:08:06 +01:00 committed by Fabio Baltieri
parent c6db73e93d
commit 55d0ffa874
9 changed files with 3 additions and 15 deletions

View file

@ -55,17 +55,10 @@ config CAN_STATS
help help
Enable CAN controller device statistics. Enable CAN controller device statistics.
config CAN_HAS_CANFD
bool
help
driver supports CAN-FD
config CAN_FD_MODE config CAN_FD_MODE
bool "CAN-FD" bool "CAN-FD"
default y
depends on CAN_HAS_CANFD
help help
Enable CAN-FD compatible API Enable CAN-FD support. Not all CAN controllers support CAN-FD.
config CAN_RX_TIMESTAMP config CAN_RX_TIMESTAMP
bool "Receiving timestamps" bool "Receiving timestamps"

View file

@ -7,6 +7,5 @@ config CAN_FAKE
bool "Fake CAN driver" bool "Fake CAN driver"
default y default y
depends on DT_HAS_ZEPHYR_FAKE_CAN_ENABLED depends on DT_HAS_ZEPHYR_FAKE_CAN_ENABLED
select CAN_HAS_CANFD
help help
Enable support for the FFF-based fake CAN driver. Enable support for the FFF-based fake CAN driver.

View file

@ -7,7 +7,6 @@ config CAN_LOOPBACK
bool "Emulated CAN loopback driver" bool "Emulated CAN loopback driver"
default y default y
depends on DT_HAS_ZEPHYR_CAN_LOOPBACK_ENABLED depends on DT_HAS_ZEPHYR_CAN_LOOPBACK_ENABLED
select CAN_HAS_CANFD
help help
This is an emulated driver that can only loopback messages. This is an emulated driver that can only loopback messages.

View file

@ -5,7 +5,6 @@
config CAN_MCAN config CAN_MCAN
bool bool
select CAN_HAS_CANFD
help help
Enable Bosch m_can driver. Enable Bosch m_can driver.
This driver supports the Bosch m_can IP. This IP is built into the This driver supports the Bosch m_can IP. This IP is built into the

View file

@ -23,7 +23,7 @@ config SAMPLE_CAN_BABBLING_RTR
config SAMPLE_CAN_BABBLING_FD_MODE config SAMPLE_CAN_BABBLING_FD_MODE
bool "Send CAN-FD format frames" bool "Send CAN-FD format frames"
depends on CAN_FD_MODE select CAN_FD_MODE
help help
Babbling node sends CAN-FD format frames. Babbling node sends CAN-FD format frames.

View file

@ -4,7 +4,6 @@ CONFIG_CANOPEN_LOG_LEVEL_DBG=y
CONFIG_GPIO=y CONFIG_GPIO=y
CONFIG_CAN=y CONFIG_CAN=y
CONFIG_CAN_FD_MODE=n
CONFIG_CAN_MAX_FILTER=13 CONFIG_CAN_MAX_FILTER=13
CONFIG_FLASH=y CONFIG_FLASH=y

View file

@ -4,7 +4,6 @@ CONFIG_CANOPEN_LOG_LEVEL_DBG=y
CONFIG_GPIO=y CONFIG_GPIO=y
CONFIG_CAN=y CONFIG_CAN=y
CONFIG_CAN_FD_MODE=n
CONFIG_CAN_MAX_FILTER=13 CONFIG_CAN_MAX_FILTER=13
CONFIG_CANOPEN=y CONFIG_CANOPEN=y

View file

@ -1,5 +1,4 @@
CONFIG_CAN=y CONFIG_CAN=y
CONFIG_CAN_FD_MODE=n
CONFIG_CAN_AUTO_BUS_OFF_RECOVERY=n CONFIG_CAN_AUTO_BUS_OFF_RECOVERY=n
CONFIG_TEST_USERSPACE=y CONFIG_TEST_USERSPACE=y
CONFIG_ZTEST=y CONFIG_ZTEST=y

View file

@ -1,4 +1,5 @@
CONFIG_CAN=y CONFIG_CAN=y
CONFIG_CAN_FD_MODE=y
CONFIG_TEST_USERSPACE=y CONFIG_TEST_USERSPACE=y
CONFIG_ZTEST=y CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_NEW_API=y