Skip to content

drivers: sensor: Remove broken reset from apds9306 driver #90382

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

Merged
merged 1 commit into from
May 31, 2025

Conversation

Kampi
Copy link
Contributor

@Kampi Kampi commented May 23, 2025

The reset may cause initialization issues because of a missing ACK from the sensor. The error check for the I2C communication is removed to avoid issues during the initialization.

Closes #89850

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work to just ignore the return value of the I2C transaction?

/* Software reset the sensor. Upon issuing a software
* reset command over the I2C interface, the sensor
* immediately resets and does not send any
* acknowledgment (ACK) of the written byte to the
* master. Therefore, do not check the return code of
* the I2C transaction.
*/
config->ops->byte_write(dev, FXOS8700_REG_CTRLREG2,
FXOS8700_CTRLREG2_RST_MASK);

@Kampi
Copy link
Contributor Author

Kampi commented May 23, 2025

Would it work to just ignore the return value of the I2C transaction?

/* Software reset the sensor. Upon issuing a software
* reset command over the I2C interface, the sensor
* immediately resets and does not send any
* acknowledgment (ACK) of the written byte to the
* master. Therefore, do not check the return code of
* the I2C transaction.
*/
config->ops->byte_write(dev, FXOS8700_REG_CTRLREG2,
FXOS8700_CTRLREG2_RST_MASK);

Good idea. Let me test it.

@Kampi Kampi marked this pull request as draft May 23, 2025 19:23
@Kampi Kampi marked this pull request as ready for review May 26, 2025 20:50
Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good, but the commit message needs to be updated

The reset may cause initialization issues because of a missing
ACK from the sensor. The error check for the I2C communication
is removed to avoid issues during the initialization.

Closes zephyrproject-rtos#89850

Signed-off-by: Daniel Kampert <[email protected]>
Copy link

@nashif nashif merged commit a673871 into zephyrproject-rtos:main May 31, 2025
29 checks passed
@Kampi Kampi deleted the Issue_89850 branch June 5, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

APDS9306-065 reset throws an I2C error
3 participants