Skip to content

Commit abaee76

Browse files
drivers: can: mcux: flexcan: use proper namespace for Kconfig symbols
Use proper namespace for the MCUX FlexCAN Kconfig symbols, renaming CONFIG_CAN_MAX_FILTER to CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS and CONFIG_CAN_MAX_MB to CONFIG_CAN_MCUX_FLEXCAN_MAX_MB. This prevents Kconfig symbol clashes between different CAN controller drivers. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
1 parent 32b05d7 commit abaee76

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

boards/nxp/mr_canhubk3/doc/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ flexcan5 | PTC11 | PTC11_CAN0_RX P22/P23
143143
and support maximum 32 message buffers for concurrent active instances with 8 bytes
144144
payload. We need to pay attention to configuration options:
145145

146-
1. :kconfig:option:`CONFIG_CAN_MAX_MB` must be less or equal than the
146+
1. :kconfig:option:`CONFIG_CAN_MCUX_FLEXCAN_MAX_MB` must be less or equal than the
147147
maximum number of message buffers that is according to the table below.
148148

149-
2. :kconfig:option:`CONFIG_CAN_MAX_FILTER` must be less or equal than
150-
:kconfig:option:`CONFIG_CAN_MAX_MB`.
149+
2. :kconfig:option:`CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS` must be less or equal than
150+
:kconfig:option:`CONFIG_CAN_MCUX_FLEXCAN_MAX_MB`.
151151

152152
=============== ========== ================ ================
153153
Devicetree node Payload Hardware support Software support

drivers/can/Kconfig.mcux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ config CAN_MCUX_FLEXCAN_WAIT_TIMEOUT
2828
Maximum number of wait loop iterations for the MCUX FlexCAN HAL when entering/leaving
2929
freeze mode.
3030

31-
config CAN_MAX_MB
31+
config CAN_MCUX_FLEXCAN_MAX_MB
3232
int "Maximum number of message buffers for concurrent active instances"
3333
default 16
3434
depends on SOC_SERIES_S32K3 || SOC_SERIES_S32K1 || SOC_SERIES_S32ZE
@@ -39,7 +39,7 @@ config CAN_MAX_MB
3939
help
4040
Defines maximum number of message buffers for concurrent active instances.
4141

42-
config CAN_MAX_FILTER
42+
config CAN_MCUX_FLEXCAN_MAX_FILTERS
4343
int "Maximum number of concurrent active RX filters"
4444
default 5
4545
range 1 15 if SOC_SERIES_KINETIS_KE1XF || SOC_SERIES_KINETIS_K6X

drivers/can/can_mcux_flexcan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ LOG_MODULE_REGISTER(can_mcux_flexcan, CONFIG_CAN_LOG_LEVEL);
3434
#endif
3535

3636
/* The maximum number of message buffers for concurrent active instances */
37-
#ifdef CONFIG_CAN_MAX_MB
38-
#define MCUX_FLEXCAN_MAX_MB CONFIG_CAN_MAX_MB
37+
#ifdef CONFIG_CAN_MCUX_FLEXCAN_MAX_MB
38+
#define MCUX_FLEXCAN_MAX_MB CONFIG_CAN_MCUX_FLEXCAN_MAX_MB
3939
#else
4040
#define MCUX_FLEXCAN_MAX_MB FSL_FEATURE_FLEXCAN_HAS_MESSAGE_BUFFER_MAX_NUMBERn(0)
4141
#endif
@@ -44,7 +44,7 @@ LOG_MODULE_REGISTER(can_mcux_flexcan, CONFIG_CAN_LOG_LEVEL);
4444
* RX message buffers (filters) will take up the first N message
4545
* buffers. The rest are available for TX use.
4646
*/
47-
#define MCUX_FLEXCAN_MAX_RX (CONFIG_CAN_MAX_FILTER + RX_START_IDX)
47+
#define MCUX_FLEXCAN_MAX_RX (CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS + RX_START_IDX)
4848
#define MCUX_FLEXCAN_MAX_TX (MCUX_FLEXCAN_MAX_MB - MCUX_FLEXCAN_MAX_RX)
4949

5050
/*
@@ -144,7 +144,7 @@ static int mcux_flexcan_get_max_filters(const struct device *dev, bool ide)
144144
{
145145
ARG_UNUSED(ide);
146146

147-
return CONFIG_CAN_MAX_FILTER;
147+
return CONFIG_CAN_MCUX_FLEXCAN_MAX_FILTERS;
148148
}
149149

150150
static int mcux_flexcan_set_timing(const struct device *dev,

0 commit comments

Comments
 (0)