Lines Matching +full:timestamp +full:- +full:prescaler
2 * Copyright (c) 2022-2023 Vestas Wind Systems A/S
5 * SPDX-License-Identifier: Apache-2.0
22 const struct can_mcan_config *config = dev->config; in can_mcan_read_reg()
25 err = config->ops->read_reg(dev, reg, val); in can_mcan_read_reg()
35 const struct can_mcan_config *config = dev->config; in can_mcan_write_reg()
38 err = config->ops->write_reg(dev, reg, val); in can_mcan_write_reg()
48 struct can_mcan_data *data = dev->data; in can_mcan_exit_sleep_mode()
53 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_exit_sleep_mode()
75 if (k_cycle_get_32() - start_time > k_ms_to_cyc_ceil32(CAN_INIT_TIMEOUT_MS)) { in can_mcan_exit_sleep_mode()
82 err = -EAGAIN; in can_mcan_exit_sleep_mode()
94 k_mutex_unlock(&data->lock); in can_mcan_exit_sleep_mode()
101 struct can_mcan_data *data = dev->data; in can_mcan_enter_init_mode()
106 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_enter_init_mode()
128 if (k_uptime_ticks() - start_time > timeout.ticks) { in can_mcan_enter_init_mode()
135 err = -EAGAIN; in can_mcan_enter_init_mode()
146 k_mutex_unlock(&data->lock); in can_mcan_enter_init_mode()
153 struct can_mcan_data *data = dev->data; in can_mcan_leave_init_mode()
158 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_leave_init_mode()
180 if (k_uptime_ticks() - start_time > timeout.ticks) { in can_mcan_leave_init_mode()
181 err = -EAGAIN; in can_mcan_leave_init_mode()
192 k_mutex_unlock(&data->lock); in can_mcan_leave_init_mode()
199 struct can_mcan_data *data = dev->data; in can_mcan_set_timing()
203 if (data->started) { in can_mcan_set_timing()
204 return -EBUSY; in can_mcan_set_timing()
207 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_set_timing()
209 nbtp |= FIELD_PREP(CAN_MCAN_NBTP_NSJW, timing->sjw - 1UL) | in can_mcan_set_timing()
210 FIELD_PREP(CAN_MCAN_NBTP_NTSEG1, timing->phase_seg1 - 1UL) | in can_mcan_set_timing()
211 FIELD_PREP(CAN_MCAN_NBTP_NTSEG2, timing->phase_seg2 - 1UL) | in can_mcan_set_timing()
212 FIELD_PREP(CAN_MCAN_NBTP_NBRP, timing->prescaler - 1UL); in can_mcan_set_timing()
220 k_mutex_unlock(&data->lock); in can_mcan_set_timing()
228 struct can_mcan_data *data = dev->data; in can_mcan_set_timing_data()
232 if (data->started) { in can_mcan_set_timing_data()
233 return -EBUSY; in can_mcan_set_timing_data()
236 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_set_timing_data()
238 dbtp |= FIELD_PREP(CAN_MCAN_DBTP_DSJW, timing_data->sjw - 1UL) | in can_mcan_set_timing_data()
239 FIELD_PREP(CAN_MCAN_DBTP_DTSEG1, timing_data->phase_seg1 - 1UL) | in can_mcan_set_timing_data()
240 FIELD_PREP(CAN_MCAN_DBTP_DTSEG2, timing_data->phase_seg2 - 1UL) | in can_mcan_set_timing_data()
241 FIELD_PREP(CAN_MCAN_DBTP_DBRP, timing_data->prescaler - 1UL); in can_mcan_set_timing_data()
249 k_mutex_unlock(&data->lock); in can_mcan_set_timing_data()
270 const struct can_mcan_config *config = dev->config; in can_mcan_start()
271 struct can_mcan_data *data = dev->data; in can_mcan_start()
274 if (data->started) { in can_mcan_start()
275 return -EALREADY; in can_mcan_start()
278 if (config->phy != NULL) { in can_mcan_start()
279 err = can_transceiver_enable(config->phy); in can_mcan_start()
293 if (config->phy != NULL) { in can_mcan_start()
295 (void)can_transceiver_disable(config->phy); in can_mcan_start()
298 return -EIO; in can_mcan_start()
301 data->started = true; in can_mcan_start()
308 const struct can_mcan_config *config = dev->config; in can_mcan_stop()
309 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_stop()
310 struct can_mcan_data *data = dev->data; in can_mcan_stop()
315 if (!data->started) { in can_mcan_stop()
316 return -EALREADY; in can_mcan_stop()
323 return -EIO; in can_mcan_stop()
326 if (config->phy != NULL) { in can_mcan_stop()
327 err = can_transceiver_disable(config->phy); in can_mcan_stop()
336 data->started = false; in can_mcan_stop()
338 for (tx_idx = 0U; tx_idx < cbs->num_tx; tx_idx++) { in can_mcan_stop()
339 tx_cb = cbs->tx[tx_idx].function; in can_mcan_stop()
342 cbs->tx[tx_idx].function = NULL; in can_mcan_stop()
343 tx_cb(dev, -ENETDOWN, cbs->tx[tx_idx].user_data); in can_mcan_stop()
344 k_sem_give(&data->tx_sem); in can_mcan_stop()
353 struct can_mcan_data *data = dev->data; in can_mcan_set_mode()
361 return -ENOTSUP; in can_mcan_set_mode()
366 return -ENOTSUP; in can_mcan_set_mode()
370 if (data->started) { in can_mcan_set_mode()
371 return -EBUSY; in can_mcan_set_mode()
374 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_set_mode()
404 data->fd = true; in can_mcan_set_mode()
407 data->fd = false; in can_mcan_set_mode()
422 k_mutex_unlock(&data->lock); in can_mcan_set_mode()
429 struct can_mcan_data *data = dev->data; in can_mcan_state_change_handler()
430 const can_state_change_callback_t cb = data->state_change_cb; in can_mcan_state_change_handler()
431 void *cb_data = data->state_change_cb_data; in can_mcan_state_change_handler()
444 const struct can_mcan_config *config = dev->config; in can_mcan_tx_event_handler()
445 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_tx_event_handler()
446 struct can_mcan_data *data = dev->data; in can_mcan_tx_event_handler()
463 config->mram_offsets[CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO] + in can_mcan_tx_event_handler()
480 __ASSERT_NO_MSG(tx_idx <= cbs->num_tx); in can_mcan_tx_event_handler()
481 tx_cb = cbs->tx[tx_idx].function; in can_mcan_tx_event_handler()
482 user_data = cbs->tx[tx_idx].user_data; in can_mcan_tx_event_handler()
483 cbs->tx[tx_idx].function = NULL; in can_mcan_tx_event_handler()
485 k_sem_give(&data->tx_sem); in can_mcan_tx_event_handler()
557 struct can_mcan_data *data = dev->data; in can_mcan_line_0_isr()
583 k_sem_give(&data->tx_sem); in can_mcan_line_0_isr()
612 const struct can_mcan_config *config = dev->config; in can_mcan_get_message()
613 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_get_message()
661 frame.timestamp = hdr.rxts; in can_mcan_get_message()
669 flags = cbs->ext[filt_idx].flags; in can_mcan_get_message()
672 flags = cbs->std[filt_idx].flags; in can_mcan_get_message()
711 filt_idx + cbs->num_std, frame.id); in can_mcan_get_message()
712 __ASSERT_NO_MSG(filt_idx <= cbs->num_ext); in can_mcan_get_message()
713 cb = cbs->ext[filt_idx].function; in can_mcan_get_message()
714 user_data = cbs->ext[filt_idx].user_data; in can_mcan_get_message()
717 __ASSERT_NO_MSG(filt_idx <= cbs->num_std); in can_mcan_get_message()
718 cb = cbs->std[filt_idx].function; in can_mcan_get_message()
719 user_data = cbs->std[filt_idx].user_data; in can_mcan_get_message()
746 const struct can_mcan_config *config = dev->config; in can_mcan_line_1_isr()
765 can_mcan_get_message(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_RX_FIFO0], in can_mcan_line_1_isr()
771 can_mcan_get_message(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_RX_FIFO1], in can_mcan_line_1_isr()
795 struct can_mcan_data *data = dev->data; in can_mcan_get_state()
805 if (!data->started) { in can_mcan_get_state()
824 err_cnt->tx_err_cnt = FIELD_GET(CAN_MCAN_ECR_TEC, reg); in can_mcan_get_state()
825 err_cnt->rx_err_cnt = FIELD_GET(CAN_MCAN_ECR_REC, reg); in can_mcan_get_state()
834 struct can_mcan_data *data = dev->data; in can_mcan_recover()
836 if (!data->started) { in can_mcan_recover()
837 return -ENETDOWN; in can_mcan_recover()
847 const struct can_mcan_config *config = dev->config; in can_mcan_send()
848 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_send()
849 struct can_mcan_data *data = dev->data; in can_mcan_send()
850 size_t data_length = can_dlc_to_bytes(frame->dlc); in can_mcan_send()
852 .rtr = (frame->flags & CAN_FRAME_RTR) != 0U ? 1U : 0U, in can_mcan_send()
853 .xtd = (frame->flags & CAN_FRAME_IDE) != 0U ? 1U : 0U, in can_mcan_send()
855 .dlc = frame->dlc, in can_mcan_send()
857 .fdf = (frame->flags & CAN_FRAME_FDF) != 0U ? 1U : 0U, in can_mcan_send()
858 .brs = (frame->flags & CAN_FRAME_BRS) != 0U ? 1U : 0U, in can_mcan_send()
865 uint32_t put_idx = -1; in can_mcan_send()
869 LOG_DBG("Sending %zu bytes. Id: 0x%x, ID type: %s %s %s %s", data_length, frame->id, in can_mcan_send()
870 (frame->flags & CAN_FRAME_IDE) != 0U ? "extended" : "standard", in can_mcan_send()
871 (frame->flags & CAN_FRAME_RTR) != 0U ? "RTR" : "", in can_mcan_send()
872 (frame->flags & CAN_FRAME_FDF) != 0U ? "FD frame" : "", in can_mcan_send()
873 (frame->flags & CAN_FRAME_BRS) != 0U ? "BRS" : ""); in can_mcan_send()
878 if ((frame->flags & ~(CAN_FRAME_IDE | CAN_FRAME_RTR | CAN_FRAME_FDF | CAN_FRAME_BRS)) != in can_mcan_send()
880 LOG_ERR("unsupported CAN frame flags 0x%02x", frame->flags); in can_mcan_send()
881 return -ENOTSUP; in can_mcan_send()
884 if (!data->fd && ((frame->flags & (CAN_FRAME_FDF | CAN_FRAME_BRS)) != 0U)) { in can_mcan_send()
885 LOG_ERR("CAN-FD format not supported in non-FD mode"); in can_mcan_send()
886 return -ENOTSUP; in can_mcan_send()
889 if ((frame->flags & ~(CAN_FRAME_IDE | CAN_FRAME_RTR)) != 0U) { in can_mcan_send()
890 LOG_ERR("unsupported CAN frame flags 0x%02x", frame->flags); in can_mcan_send()
891 return -ENOTSUP; in can_mcan_send()
895 if (data_length > sizeof(frame->data)) { in can_mcan_send()
897 sizeof(frame->data)); in can_mcan_send()
898 return -EINVAL; in can_mcan_send()
901 if ((frame->flags & CAN_FRAME_FDF) != 0U) { in can_mcan_send()
902 if (frame->dlc > CANFD_MAX_DLC) { in can_mcan_send()
903 LOG_ERR("DLC of %d for CAN-FD format frame", frame->dlc); in can_mcan_send()
904 return -EINVAL; in can_mcan_send()
907 if (frame->dlc > CAN_MAX_DLC) { in can_mcan_send()
908 LOG_ERR("DLC of %d for non-FD format frame", frame->dlc); in can_mcan_send()
909 return -EINVAL; in can_mcan_send()
913 if (!data->started) { in can_mcan_send()
914 return -ENETDOWN; in can_mcan_send()
923 return -ENETUNREACH; in can_mcan_send()
926 err = k_sem_take(&data->tx_sem, timeout); in can_mcan_send()
928 return -EAGAIN; in can_mcan_send()
931 k_mutex_lock(&data->tx_mtx, K_FOREVER); in can_mcan_send()
934 for (int i = 0; i < cbs->num_tx; i++) { in can_mcan_send()
935 if (cbs->tx[i].function == NULL) { in can_mcan_send()
943 if ((frame->flags & CAN_FRAME_IDE) != 0U) { in can_mcan_send()
944 tx_hdr.ext_id = frame->id; in can_mcan_send()
946 tx_hdr.std_id = frame->id & CAN_STD_ID_MASK; in can_mcan_send()
949 err = can_mcan_write_mram(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_TX_BUFFER] + put_idx * in can_mcan_send()
958 if ((frame->flags & CAN_FRAME_RTR) == 0U) { in can_mcan_send()
959 err = can_mcan_write_mram(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_TX_BUFFER] + in can_mcan_send()
962 &frame->data_32, ROUND_UP(data_length, sizeof(uint32_t))); in can_mcan_send()
969 __ASSERT_NO_MSG(put_idx < cbs->num_tx); in can_mcan_send()
970 cbs->tx[put_idx].function = callback; in can_mcan_send()
971 cbs->tx[put_idx].user_data = user_data; in can_mcan_send()
975 cbs->tx[put_idx].function = NULL; in can_mcan_send()
979 k_mutex_unlock(&data->tx_mtx); in can_mcan_send()
983 k_mutex_unlock(&data->tx_mtx); in can_mcan_send()
984 k_sem_give(&data->tx_sem); in can_mcan_send()
991 const struct can_mcan_config *config = dev->config; in can_mcan_get_max_filters()
992 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_get_max_filters()
995 return cbs->num_ext; in can_mcan_get_max_filters()
997 return cbs->num_std; in can_mcan_get_max_filters()
1009 const struct can_mcan_config *config = dev->config; in can_mcan_add_rx_filter_std()
1010 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_add_rx_filter_std()
1011 struct can_mcan_data *data = dev->data; in can_mcan_add_rx_filter_std()
1013 .sfid1 = filter->id, in can_mcan_add_rx_filter_std()
1014 .sfid2 = filter->mask, in can_mcan_add_rx_filter_std()
1017 int filter_id = -ENOSPC; in can_mcan_add_rx_filter_std()
1021 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_add_rx_filter_std()
1023 for (i = 0; i < cbs->num_std; i++) { in can_mcan_add_rx_filter_std()
1024 if (cbs->std[i].function == NULL) { in can_mcan_add_rx_filter_std()
1030 if (filter_id == -ENOSPC) { in can_mcan_add_rx_filter_std()
1032 k_mutex_unlock(&data->lock); in can_mcan_add_rx_filter_std()
1033 return -ENOSPC; in can_mcan_add_rx_filter_std()
1039 err = can_mcan_write_mram(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_STD_FILTER] + in can_mcan_add_rx_filter_std()
1047 k_mutex_unlock(&data->lock); in can_mcan_add_rx_filter_std()
1051 __ASSERT_NO_MSG(filter_id <= cbs->num_std); in can_mcan_add_rx_filter_std()
1052 cbs->std[filter_id].function = callback; in can_mcan_add_rx_filter_std()
1053 cbs->std[filter_id].user_data = user_data; in can_mcan_add_rx_filter_std()
1054 cbs->std[filter_id].flags = filter->flags; in can_mcan_add_rx_filter_std()
1062 const struct can_mcan_config *config = dev->config; in can_mcan_add_rx_filter_ext()
1063 const struct can_mcan_callbacks *cbs = config->callbacks; in can_mcan_add_rx_filter_ext()
1064 struct can_mcan_data *data = dev->data; in can_mcan_add_rx_filter_ext()
1066 .efid2 = filter->mask, in can_mcan_add_rx_filter_ext()
1067 .efid1 = filter->id, in can_mcan_add_rx_filter_ext()
1070 int filter_id = -ENOSPC; in can_mcan_add_rx_filter_ext()
1074 k_mutex_lock(&data->lock, K_FOREVER); in can_mcan_add_rx_filter_ext()
1076 for (i = 0; i < cbs->num_ext; i++) { in can_mcan_add_rx_filter_ext()
1077 if (cbs->ext[i].function == NULL) { in can_mcan_add_rx_filter_ext()
1083 if (filter_id == -ENOSPC) { in can_mcan_add_rx_filter_ext()
1085 k_mutex_unlock(&data->lock); in can_mcan_add_rx_filter_ext()
1086 return -ENOSPC; in can_mcan_add_rx_filter_ext()
1092 err = can_mcan_write_mram(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_EXT_FILTER] + in can_mcan_add_rx_filter_ext()
1100 k_mutex_unlock(&data->lock); in can_mcan_add_rx_filter_ext()
1104 __ASSERT_NO_MSG(filter_id <= cbs->num_ext); in can_mcan_add_rx_filter_ext()
1105 cbs->ext[filter_id].function = callback; in can_mcan_add_rx_filter_ext()
1106 cbs->ext[filter_id].user_data = user_data; in can_mcan_add_rx_filter_ext()
1107 cbs->ext[filter_id].flags = filter->flags; in can_mcan_add_rx_filter_ext()
1115 const struct can_mcan_config *config = dev->config;
1116 const struct can_mcan_callbacks *cbs = config->callbacks;
1120 return -EINVAL;
1124 if ((filter->flags &
1127 if ((filter->flags & ~(CAN_FILTER_IDE | CAN_FILTER_DATA | CAN_FILTER_RTR)) != 0U) {
1129 LOG_ERR("unsupported CAN filter flags 0x%02x", filter->flags);
1130 return -ENOTSUP;
1133 if ((filter->flags & CAN_FILTER_IDE) != 0U) {
1136 filter_id += cbs->num_std;
1147 const struct can_mcan_config *config = dev->config;
1148 const struct can_mcan_callbacks *cbs = config->callbacks;
1149 struct can_mcan_data *data = dev->data;
1152 k_mutex_lock(&data->lock, K_FOREVER);
1154 if (filter_id >= cbs->num_std) {
1155 filter_id -= cbs->num_std;
1156 if (filter_id >= cbs->num_ext) {
1158 k_mutex_unlock(&data->lock);
1162 cbs->ext[filter_id].function = NULL;
1163 cbs->ext[filter_id].user_data = NULL;
1165 err = can_mcan_clear_mram(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_EXT_FILTER] +
1172 cbs->std[filter_id].function = NULL;
1173 cbs->std[filter_id].user_data = NULL;
1175 err = can_mcan_clear_mram(dev, config->mram_offsets[CAN_MCAN_MRAM_CFG_STD_FILTER] +
1183 k_mutex_unlock(&data->lock);
1189 struct can_mcan_data *data = dev->data;
1191 data->state_change_cb = callback;
1192 data->state_change_cb_data = user_data;
1197 const struct can_mcan_config *config = dev->config;
1199 *max_bitrate = config->max_bitrate;
1210 struct can_mcan_data *data = dev->data;
1214 k_mutex_lock(&data->lock, K_FOREVER);
1229 k_mutex_unlock(&data->lock);
1234 const struct can_mcan_config *config = dev->config;
1242 return -EIO;
1248 return -EIO;
1253 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_STD_FILTER];
1255 config->mram_elements[CAN_MCAN_MRAM_CFG_STD_FILTER]);
1261 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_EXT_FILTER];
1263 config->mram_elements[CAN_MCAN_MRAM_CFG_EXT_FILTER]);
1269 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_RX_FIFO0];
1271 config->mram_elements[CAN_MCAN_MRAM_CFG_RX_FIFO0]);
1277 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_RX_FIFO1];
1279 config->mram_elements[CAN_MCAN_MRAM_CFG_RX_FIFO1]);
1285 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_RX_BUFFER];
1292 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO];
1294 config->mram_elements[CAN_MCAN_MRAM_CFG_TX_EVENT_FIFO]);
1300 addr = mram - mrba + config->mram_offsets[CAN_MCAN_MRAM_CFG_TX_BUFFER];
1302 config->mram_elements[CAN_MCAN_MRAM_CFG_TX_BUFFER]) | CAN_MCAN_TXBC_TFQM;
1327 const struct can_mcan_config *config = dev->config;
1328 const struct can_mcan_callbacks *cbs = config->callbacks;
1329 struct can_mcan_data *data = dev->data;
1337 __ASSERT_NO_MSG(config->ops->read_reg != NULL);
1338 __ASSERT_NO_MSG(config->ops->write_reg != NULL);
1339 __ASSERT_NO_MSG(config->ops->read_mram != NULL);
1340 __ASSERT_NO_MSG(config->ops->write_mram != NULL);
1341 __ASSERT_NO_MSG(config->ops->clear_mram != NULL);
1342 __ASSERT_NO_MSG(config->callbacks != NULL);
1344 __ASSERT_NO_MSG(cbs->num_tx <= config->mram_elements[CAN_MCAN_MRAM_CFG_TX_BUFFER]);
1345 __ASSERT_NO_MSG(cbs->num_std <= config->mram_elements[CAN_MCAN_MRAM_CFG_STD_FILTER]);
1346 __ASSERT_NO_MSG(cbs->num_ext <= config->mram_elements[CAN_MCAN_MRAM_CFG_EXT_FILTER]);
1348 k_mutex_init(&data->lock);
1349 k_mutex_init(&data->tx_mtx);
1350 k_sem_init(&data->tx_sem, cbs->num_tx, cbs->num_tx);
1352 if (config->phy != NULL) {
1353 if (!device_is_ready(config->phy)) {
1355 return -ENODEV;
1362 return -EIO;
1368 return -EIO;
1376 return -EIO;
1428 reg |= FIELD_PREP(CAN_MCAN_TDCR_TDCO, config->tx_delay_comp_offset);
1448 if (config->sample_point) {
1449 err = can_calc_timing(dev, &timing, config->bus_speed, config->sample_point);
1450 if (err == -EINVAL) {
1452 return -EIO;
1454 LOG_DBG("Presc: %d, TS1: %d, TS2: %d", timing.prescaler, timing.phase_seg1,
1456 LOG_DBG("Sample-point err : %d", err);
1457 } else if (config->prop_ts1) {
1458 timing.sjw = config->sjw;
1460 timing.phase_seg1 = config->prop_ts1;
1461 timing.phase_seg2 = config->ts2;
1462 err = can_calc_prescaler(dev, &timing, config->bus_speed);
1468 if (config->sample_point_data) {
1469 err = can_calc_timing_data(dev, &timing_data, config->bus_speed_data,
1470 config->sample_point_data);
1471 if (err == -EINVAL) {
1473 return -EIO;
1476 LOG_DBG("Sample-point err data phase: %d", err);
1477 } else if (config->prop_ts1_data) {
1478 timing_data.sjw = config->sjw_data;
1480 timing_data.phase_seg1 = config->prop_ts1_data;
1481 timing_data.phase_seg2 = config->ts2_data;
1482 err = can_calc_prescaler(dev, &timing_data, config->bus_speed_data);
1492 return -ENODEV;
1499 return -ENODEV;
1537 return can_mcan_clear_mram(dev, 0, config->mram_size);