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: misc: adi-axi-tdd: Fix reg values in ms #2603

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

Conversation

podgori
Copy link
Contributor

@podgori podgori commented Sep 30, 2024

PR Description

Fixed the computed values in [ms] for the following TDDN registers: STARTUP_DELAY, FRAME_LENGTH, SYNC_PERIOD (renamed from SYNC_COUNTER in the hdl documentation).

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly (if there is the case)

Copy link
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor stuff

#define ADI_REG_TDD_SYNC_COUNTER_LOW 0x0058
#define ADI_REG_TDD_SYNC_COUNTER_HIGH 0x005c
#define ADI_REG_TDD_SYNC_PERIOD_LOW 0x0058
#define ADI_REG_TDD_SYNC_PERIOD_HIGH 0x005c
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why changing the name? If it makes more sense to have the new name please mention it in the commit message to avoid comments like this. Typically commits are small and address only one issue. Hence, if you#re doing some additional thing (even if small like this) please mention it. A couple of issues with your commit:

  1. Run git log --no-merges --oneline drivers/misc to see the used commit title in that dir. It seems to be a bit random but I would say the most used would be just misc: adi-axi-tdd: .... That said, what you have seems to be acceptable so up to you;
  2. You should describe and explain what you're fixing in the commit message. It helps in understanding what was the issue in the code (other than having to understand by looking at the code);
  3. You could also add a Fixes: tag. Not that important for ADI tree but it's a matter of keeping the same "routines" as upstream so it's easier then to send patches upstream.

@@ -233,6 +233,7 @@ static ssize_t adi_axi_tdd_show(struct device *dev,
ret = regmap_read(st->regs, ADI_REG_TDD_STARTUP_DELAY, &data);
if (ret)
return ret;
if (data > 0) data = data + 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please do:

if (data)
    data++;

Same for the other places

The raw register values of STARTUP_DELAY, FRAME_LENGTH and SYNC_PERIOD
are expressed in clock cycles-1. In order to achieve a desired length,
their actual value must be length-1.

The 'SYNC_COUNTER' registers were renamed to 'SYNC_PERIOD' for a
better understanding of the functionality.

Fixes: 4519bcc ("drivers: misc: adi-axi-tdd: Add TDD engine")
Signed-off-by: Ionut Podgoreanu <ionut.podgoreanu@analog.com>
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