/* Give reset command to the CAN controller using SPI interface. */
int32_t can_ctrl_ecc_set(struct can_ctrl_dev *dev, bool enable)
/* Give reset command to the CAN controller using SPI interface. */
int32_t can_ctrl_ecc_set(struct can_ctrl_dev *dev, bool enable)
{
	int32_t ret;
	uint32_t temp;
	ret = can_ctrl_sfr_word_read(dev, CAN_CTRL_REG_ECCCON, &temp);
	if(ret != 0)
		return ret;
	temp &= ~ECCCON_ECCEN_MODE(WORD_MASK);
	temp |= ECCCON_ECCEN_MODE(enable);
	return can_ctrl_sfr_word_write(dev, CAN_CTRL_REG_ECCCON, temp);
}