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

arm64: dts: zynqmp-jupiter-sdr: properly use clk-gpio mux #2596

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

Conversation

nunojsa
Copy link
Collaborator

@nunojsa nunojsa commented Sep 16, 2024

In jupiter we have a gpio to toggle between a 38.4 and 30.72MHz reference clock. We had a gpio-hog to default to the 38.4MHz source and then we need to manually change the GPIO value when applying a profile for the other reference. This is far from ideal and more importantly, with commit c2edc62 (" iio: adc: adrv9002: check and allow to change ref_clk"), we now try to change the refclk according with the rate we get from the profile (which makes sense). Therefore, with the current DT, we would fail to load the 30.72MHz reference clock based profile. Hence, let's make use of the clk-gpio driver and define our reference clock to be a clk-gpio mux with two parents for the rates we want. With this, we can change clock sources solely by loading the profile without any other manual step for the GPIO.

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)

In jupiter we have a gpio to toggle between a 38.4 and 30.72MHz reference
clock. We had a gpio-hog to default to the 38.4MHz source and then we
need to manually change the GPIO value when applying a profile for the
other reference. This is far from ideal and more importantly, with commit
c2edc62 ("iio: adc: adrv9002: check and allow to change ref_clk"),
we now try to change the refclk according with the rate we get from the
profile (which makes sense). Therefore, with the current DT, we would fail
to load the 30.72MHz reference clock based profile. Hence, let's make use
of the clk-gpio driver and define our reference clock to be a clk-gpio mux
with two parents for the rates we want. With this, we can change clock
sources solely by loading the profile without any other manual step for
the GPIO.

Signed-off-by: Nuno Sa <[email protected]>
@nunojsa
Copy link
Collaborator Author

nunojsa commented Sep 17, 2024

v2:

  • Make CI happy.

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.

1 participant