Skip to content

Commit 85c2c91

Browse files
henrikbrixandersencarlescufi
authored andcommitted
drivers: can: always define CAN-FD syscalls
Always define the CAN-FD related syscalls but only define the syscall implementations when CONFIG_CAN_FD_MODE is enabled. Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent 2f7c01b commit 85c2c91

File tree

1 file changed

+6
-4
lines changed
  • include/zephyr/drivers

1 file changed

+6
-4
lines changed

include/zephyr/drivers/can.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,6 @@ static inline const struct can_timing *z_impl_can_get_timing_max(const struct de
709709
__syscall int can_calc_timing(const struct device *dev, struct can_timing *res,
710710
uint32_t bitrate, uint16_t sample_pnt);
711711

712-
#if defined(CONFIG_CAN_FD_MODE) || defined(__DOXYGEN__)
713-
714712
/**
715713
* @brief Get the minimum supported timing parameter values for the data phase.
716714
*
@@ -726,12 +724,14 @@ __syscall int can_calc_timing(const struct device *dev, struct can_timing *res,
726724
*/
727725
__syscall const struct can_timing *can_get_timing_data_min(const struct device *dev);
728726

727+
#ifdef CONFIG_CAN_FD_MODE
729728
static inline const struct can_timing *z_impl_can_get_timing_data_min(const struct device *dev)
730729
{
731730
const struct can_driver_api *api = (const struct can_driver_api *)dev->api;
732731

733732
return &api->timing_data_min;
734733
}
734+
#endif /* CONFIG_CAN_FD_MODE */
735735

736736
/**
737737
* @brief Get the maximum supported timing parameter values for the data phase.
@@ -748,12 +748,14 @@ static inline const struct can_timing *z_impl_can_get_timing_data_min(const stru
748748
*/
749749
__syscall const struct can_timing *can_get_timing_data_max(const struct device *dev);
750750

751+
#ifdef CONFIG_CAN_FD_MODE
751752
static inline const struct can_timing *z_impl_can_get_timing_data_max(const struct device *dev)
752753
{
753754
const struct can_driver_api *api = (const struct can_driver_api *)dev->api;
754755

755756
return &api->timing_data_max;
756757
}
758+
#endif /* CONFIG_CAN_FD_MODE */
757759

758760
/**
759761
* @brief Calculate timing parameters for the data phase
@@ -795,13 +797,15 @@ __syscall int can_calc_timing_data(const struct device *dev, struct can_timing *
795797
__syscall int can_set_timing_data(const struct device *dev,
796798
const struct can_timing *timing_data);
797799

800+
#ifdef CONFIG_CAN_FD_MODE
798801
static inline int z_impl_can_set_timing_data(const struct device *dev,
799802
const struct can_timing *timing_data)
800803
{
801804
const struct can_driver_api *api = (const struct can_driver_api *)dev->api;
802805

803806
return api->set_timing_data(dev, timing_data);
804807
}
808+
#endif /* CONFIG_CAN_FD_MODE */
805809

806810
/**
807811
* @brief Set the bitrate for the data phase of the CAN-FD controller
@@ -830,8 +834,6 @@ static inline int z_impl_can_set_timing_data(const struct device *dev,
830834
*/
831835
__syscall int can_set_bitrate_data(const struct device *dev, uint32_t bitrate_data);
832836

833-
#endif /* CONFIG_CAN_FD_MODE */
834-
835837
/**
836838
* @brief Fill in the prescaler value for a given bitrate and timing
837839
*

0 commit comments

Comments
 (0)