-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ad514x ops update #2796
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
base: main
Are you sure you want to change the base?
ad514x ops update #2796
Conversation
…exit on ad5141, ad5142 and ad5143 Signed-off-by: Anush Shetty <anush.shetty@analog.com>
…ale command usage Signed-off-by: Anush Shetty <anush.shetty@analog.com>
…5142, and AD5144 Signed-off-by: Anush Shetty <anush.shetty@analog.com>
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.
please add a body to your commits. also have a look at https://analogdevicesinc.github.io/no-OS/contributing.html and follow the 50/72 rule.
|
|
||
| cmd.is_readback = false; | ||
|
|
||
| ret = ad5141_dpot_send_cmd(desc, &cmd); |
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.
return directly.
| cmd.control = 0x9; | ||
| cmd.address = ad5141_dpot_cmd_addr[chn]; | ||
| cmd.data = nEnable; | ||
| if (IsTopScale == true) { |
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.
no brackets if guarding only one expression.
| */ | ||
| int ad5141_dpot_top_bottom_scale_enable(struct dpot_dev *desc, | ||
| enum dpot_chn_type chn, | ||
| bool IsTopScale, |
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.
no camel case, only snake case please. check the entire code for these occurences.
| return ret; | ||
|
|
||
| /* Enter/Exit the top scale or bottom scale (command #12 or command #13) */ | ||
| cmd.control = 0x9; |
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.
what is 0x9?. deserves a macro.
| cmd.control = 0x9; | ||
| cmd.address = ad5142_dpot_cmd_addr[chn]; | ||
| cmd.data = nEnable; | ||
| if (IsTopScale == true) { |
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.
ditto. no brackets.
| cmd.address = ad5142_dpot_cmd_addr[chn]; | ||
| cmd.data = nEnable; | ||
| if (IsTopScale == true) { | ||
| cmd.data |= 0x80; |
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.
magic number. please add suggestive macro.
| cmd.control = 0x9; | ||
| cmd.address = ad5143_dpot_cmd_addr[chn]; | ||
| cmd.data = nEnable; | ||
| if (IsTopScale == true) { |
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.
ditto. drop brackets.
|
|
||
| cmd.is_readback = false; | ||
|
|
||
| ret = ad5143_dpot_send_cmd(desc, &cmd); |
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.
return directly.
| * @param desc - digipot descriptor. | ||
| * @param chn - digipot channel. | ||
| * @param IsTopScale - boolean flag to indicat top scale or bottom scale. | ||
| * @param IsTopScale - boolean flag to indicate top scale or bottom scale. |
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.
this commit should be squashed into the one that is adding the functions.
Pull Request Description
Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.
PR Type
PR Checklist