Skip to content
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: dac: ad3530r: Add driver support for Ad3530R #2403

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SaikiranGudla
Copy link
Collaborator

@SaikiranGudla SaikiranGudla commented Dec 19, 2024

Add header and source files for AD3530R driver.

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 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

Add header and source files for AD3530R driver.

Signed-off-by: SGudla <Saikiran.Gudla@analog.com>
@@ -0,0 +1,1093 @@
/**************************************************************************//**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +74 to +77
/******************************************************************************/
/************************ Functions Definitions *******************************/
/******************************************************************************/
/******************************************************************************/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove these comments. They don't add too much and just take screen space.

Comment on lines +69 to +72
.single_instr = 0, // Sets the streaming mode.
.stream_length_keep_value = 1 // Prevents the stream length value from
// automatically resetting to zero.
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the /**/ comment style

Comment on lines +58 to +63
#define AD3530R_DATA_INDEX(x) x ? 1 : 2
#define AD3530R_INSTR_LEN(x) AD3530R_DATA_INDEX(x)
#define AD3530R_ADDR_INDEX(x) x ? 0 : 1
#define AD3530R_BUFF_LEN(x) x ? 2 : 3
#define AD3530R_CRC_BUFF_LEN(x) x ? 3 : 4
#define AD3530R_CRC_INDEX(x) AD3530R_ADDR_INDEX(x) + 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add parentheses around x

AD3530R_REG_ADDR_INTERFACE_CONFIG_A,
AD3530R_MASK_ADDR_ASCENSION,
cfg->addr_asc);
if (NO_OS_IS_ERR_VALUE(ret))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really use NO_OS_IS_ERR_VALUE() for these cases anymore. If your functions only return negative error codes, use this instead:

if (ret)
    return ret;

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