-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add single driver for both lis2dux12 AND lis2duxs12 #80142
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 single driver for both lis2dux12 AND lis2duxs12 #80142
Conversation
|
@jonas-rem as you can see I re-used your work also for the lis2dux12/lis2duxs12 driver. Here the naming is a bit confusing. Would you mind give a quick review to it? Thx |
jonas-rem
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.
The separation via api looks good to me. Few minor points and questions for clarification.
- Add the lis2duxs12 variant to testss/driverss/build_all/sensor/i2C
- The currently used feature- and register-set of both variants is identical. The
svariant supports analog hub and qvar sensing, so this separation allows to implement those features in the future? - I3C would be supported by both devices, I guess it's just ouf-of-scope for this PR?
ok, I will
Yes, that's my idea. Not planned yet though.
Well, I can add a commit in this PR itself. I'm not sure I'm in a position to test it though. Thanks for suggesting it. |
15713e1 to
87d3886
Compare
|
@jonas-rem I think I forgot to add I3C part... I think I would do a separate PR |
@jonas-rem would it be acceptable the PR as it is at the moment? |
There is one open comment, could you have a look at that? Apart from that the PR looks good. #80142 (comment) |
Yes sure. I missed it. |
d87c792 to
1963f79
Compare
1963f79 to
cf1d06d
Compare
|
@jonas-rem Is it fine now Jonas? |
cf1d06d to
75ca45d
Compare
|
@avisconti unfortunately, this needs rebasing |
Prepare the driver to be able to handle other DUX software compatible
devices. Currently the driver handles the st_lis2dux12 compatible only.
Do following major changes:
1. Introduce the lis2dux12_chip_api structure filled with device specific
APIs. At the moment define following callback:
- api_lis2dux12_set_odr_raw()
- api_lis2dux12_set_range()
- api_lis2dux12_sample_fetch_accel()
- api_lis2dux12_sample_fetch_temp()
- api_lis2dux12_handle_interrupt()
- api_lis2dux12_init_interrupt()
2. Prepare specific APIs for st_lis2dux12 device.
3. Make DT instantiation on inst + name basis, and not only by inst. This
commit only use "name = DT_DRV_COMPAT = st_lis2dux12".
Signed-off-by: Armando Visconti <[email protected]>
The LIS2DUXS12 is a smart, digital, 3-axis linear accelerometer whose MEMS and ASIC have been expressly designed to combine the lowest current consumption possible with features such as always-on antialiasing filtering, a finite state machine (FSM) and machine learning core (MLC) with adaptive self-configuration (ASC), and an analog hub / Qvar sensing channel. (https://www.st.com/en/mems-and-sensors/lis2duxs12.html) Signed-off-by: Armando Visconti <[email protected]>
Add 3-axis linear accelerometer LIS2DUXS12. Signed-off-by: Armando Visconti <[email protected]>
Add sample display for lis2duxs12 accel and temp sensors. Signed-off-by: Armando Visconti <[email protected]>
75ca45d to
5bd6586
Compare
Yes, the usual i2c.dtsi file... |
|
Thanks @jonas-rem and @erwango for you review. Unfortunately I had to rebase the work and push it again... |
lis2dux12 and lis2duxs12 are belonging to the same device family and are registers compatible. Hence they can be handled by the same driver. This work is done on the same basis as lps2xdf driver (#65416).
In particular:
Prepare specific APIs for st_lis2dux12 device.
Make DT instantiation on inst + name basis, and not only by inst. This commit only use "name = DT_DRV_COMPAT = st_lis2dux12".