drivers: can: remove the deprecated can_calc_prescaler() API function

Remove the deprecated can_calc_prescaler() CAN API function.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2024-11-30 19:17:04 +00:00 committed by Benjamin Cabé
parent 424988b908
commit a619fe74a9
2 changed files with 0 additions and 41 deletions

View file

@ -343,24 +343,6 @@ int z_impl_can_calc_timing_data(const struct device *dev, struct can_timing *res
}
#endif /* CONFIG_CAN_FD_MODE */
int can_calc_prescaler(const struct device *dev, struct can_timing *timing,
uint32_t bitrate)
{
uint32_t ts = timing->prop_seg + timing->phase_seg1 + timing->phase_seg2 +
CAN_SYNC_SEG;
uint32_t core_clock;
int ret;
ret = can_get_core_clock(dev, &core_clock);
if (ret != 0) {
return ret;
}
timing->prescaler = core_clock / (bitrate * ts);
return core_clock % (ts * timing->prescaler);
}
static int check_timing_in_range(const struct can_timing *timing,
const struct can_timing *min,
const struct can_timing *max)

View file

@ -1053,29 +1053,6 @@ __syscall int can_set_timing_data(const struct device *dev,
*/
__syscall int can_set_bitrate_data(const struct device *dev, uint32_t bitrate_data);
/**
* @brief Fill in the prescaler value for a given bitrate and timing
*
* Fill the prescaler value in the timing struct. The sjw, prop_seg, phase_seg1
* and phase_seg2 must be given.
*
* The returned bitrate error is remainder of the division of the clock rate by
* the bitrate times the timing segments.
*
* @deprecated This function allows for bitrate errors, but bitrate errors between nodes on the same
* network leads to them drifting apart after the start-of-frame (SOF) synchronization
* has taken place.
*
* @param dev Pointer to the device structure for the driver instance.
* @param timing Result is written into the can_timing struct provided.
* @param bitrate Target bitrate.
*
* @retval 0 or positive bitrate error.
* @retval Negative error code on error.
*/
__deprecated int can_calc_prescaler(const struct device *dev, struct can_timing *timing,
uint32_t bitrate);
/**
* @brief Configure the bus timing of a CAN controller.
*