-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: sensor: ad2s1210: implementation of driver #88919
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
drivers: sensor: ad2s1210: implementation of driver #88919
Conversation
f618bbe
to
5e3204a
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.
Thank you for opening this PR!
There's comments that are redundant other are fine. See https://kernel.org/doc/html/latest/process/coding-style.html#commenting
8a07504
to
7deabf2
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.
A couple of small nits, but otherwise looks great. Thanks for the PR!
|
||
compatible: "adi,ad2s1210" | ||
|
||
include: spi-device.yaml |
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.
include: spi-device.yaml | |
include: [spi-device.yaml, sensor-device.yaml] |
.have_resolution_pins = (DT_INST_NODE_HAS_PROP(i, resolution_gpios)), \ | ||
}; \ | ||
\ | ||
DEVICE_DT_INST_DEFINE(i, ad2s1210_init, NULL, &ad2s1210_data_##i, &ad2s1210_config_##i, \ |
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.
Use SENSOR_DEVICE_DT_INST_DEFINE
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.
Thanks, I have updated the INST_DEFINE macro
|
||
assigned-resolution-bits: | ||
type: int | ||
default: 16 |
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.
Need to explain in the description why the default value was selected
https://docs.zephyrproject.org/latest/build/dts/bindings-upstream.html#dt-bindings-default-rules
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.
Looking at the datasheet, it seems default at power up (without configuration) is 12-bits so I am changing to 12 bits and adding explanation in description.
7deabf2
to
f4cf010
Compare
Could you update the title of this commit drivers: sensor: ad2s1210: start implementation of driver. Something like |
implement driver for ad2s1210 resolver Signed-off-by: Nathan Olff <[email protected]>
add ad2s1210 to build_all test in spi.dtsi Signed-off-by: Nathan Olff <[email protected]>
f4cf010
to
bdcf517
Compare
|
@jeppenodgaard can you take another look? |
Implement driver for ad2s1210 rotational resolver
Based on datasheet here : https://www.analog.com/media/en/technical-documentation/data-sheets/ad2s1210.pdf