Skip to content

Conversation

@Shetty-Anush
Copy link
Contributor

@Shetty-Anush Shetty-Anush commented Oct 23, 2025

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

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have complied with the Submission Checklist
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

…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>
Copy link
Contributor

@amiclaus amiclaus left a 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);
Copy link
Contributor

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) {
Copy link
Contributor

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,
Copy link
Contributor

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;
Copy link
Contributor

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) {
Copy link
Contributor

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;
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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.
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants