-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add lsm6dso multi-instance and use stmemsc common routines #33530
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
Add lsm6dso multi-instance and use stmemsc common routines #33530
Conversation
|
I have just verified that this works on the nRF5340 with the patch in #19901 manually applied. I'll create a PR with this additional patch once this change has been merged. |
|
@avisconti I'm not well versed in the Zephyr pull request workflow, so I may have missed something, but is there a reason why this PR is currently labelled DNM? |
@richardbarlow |
Create a common properties file that will be included by all bindings (as i2c and spi) handled by lsm6dso driver. Signed-off-by: Armando Visconti <[email protected]>
Take the int-pin information (i.e. what pin between INT1 and INT2 the drdy is attached to) directly from DT. Signed-off-by: Armando Visconti <[email protected]>
Make this driver multi-instance and use the new API.
This commit makes use of some DT macro helpers
In particular:
- get bus devices with DEVICE_DT_GET
- get SPI information with SPI_CONFIG_DT_INST
- get drdy gpios with GPIO_DT_SPEC_GET
Moreover the driver is now using the stmemsc common
routines as requested in issue zephyrproject-rtos#33440 and it avoids
the unnecessary declaration of both ctx_i2c and ctx_spi
in the data structure.
Signed-off-by: Armando Visconti <[email protected]>
415b629 to
dbccc40
Compare
|
Rebased after #33506 was merged. I encorporated all suggestions that have been discussed there in a single commit. I will later create a common PR to align all other drivers to same implementation. |
|
@richardbarlow |
mbolivar-nordic
left a comment
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.
LGTM. I just gave this a quick skim since it's following the lines already discussed in detail in the PR which introduced the stmemsc helpers.
Make this driver multi-instance and use the new API.
This commit makes use of some DT macro helpers
In particular:
- get bus devices with DEVICE_DT_GET
- get SPI information with SPI_CONFIG_DT_INST
- get drdy gpios with GPIO_DT_SPEC_GET
The int-pin information has been moved from Kconfig to DT. All the boards/shield using the lsm6dso driver has been updated accordingly. But I have a doubt on file ./scripts/ci/check_compliance.py which is still including a reference to the non-existent symbol LSM6DSO_INT_PIN. Should I remove it as well?
Moreover the driver is now using the stmemsc common routines as requested in issue #33440.
Please note that the common stmemsc routines introduced in #33506 are not carrying the fix required by Nordic platforms yet. This has to be done as a separate PR later on.