-
Notifications
You must be signed in to change notification settings - Fork 8.1k
driver: i2c: i2c_ll_stm32: add error handling in i2c_stm32_error for I2C target mode #97810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6d4e53f to
4ab03bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add you're S-o-b tag to the commits in additions to @kbidani's one.
| #endif | ||
| goto end; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end sequence must be updated:
end:
+#if defined(CONFIG_I2C_TARGET)
+ if (data->slave_attached && !data->master_active) {
+ return -EIO;
+ }
+#endif
i2c_stm32_disable_transfer_interrupts(dev);
/* Wakeup thread */
k_sem_give(&data->device_sync_sem);
return -EIO;
}(with indentation updates)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
drivers/i2c/i2c_ll_stm32_v2.c
Outdated
| data->current.is_arlo = 1U; | ||
| #if defined(CONFIG_I2C_TARGET) | ||
| if (error_cb != NULL) { | ||
| error_cb(data->slave_cfg, I2C_ERROR_GENERIC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I2C_ERROR_ARBITRATION
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Support I2C target error callback in I2C driver when registered by the bus target consumer. Signed-off-by: Khaoula Bidani <[email protected]> Signed-off-by: Julien Racki <[email protected]>
Allow applications to be notified of target I2C transfer error usingthe recently added target error callback mechanism. Signed-off-by: Khaoula Bidani <[email protected]> Signed-off-by: Julien Racki <[email protected]>
4ab03bc to
d20a3b1
Compare
|
|
@teburd PTAL and advise if ok for V4.3.0 |



Taking over #95984 as mentioned here
Main differences with the first PR are:
i2c_stm32_master_mode_endcalls fromdrivers/i2c/i2c_ll_stm32_v2.cbecause it has been removed with this commit.Fixes #92383