Post Go back to editing

RE: How do I change the frequency of the adf4360-7 from userland without a clock consumer?

We have an application which requires an LO in two different bands. An SPDT is used to switch out the inductors appropriately via GPIO. I built the driver as module and loaded it but there is no obvious way to change the RF out frequency. I found an example in the adi-ad9136-fmc-ebz.dtsi which shows assigned the clock to its self and providing a list of assigned rates. Using that method I am able to get the driver to change the frequency from 0 Hz to e.g 700000000  Hz.

  1. Is there some obvious way to change the frequency? I looked in debugfs and there was nothing.
  2. Is there an IIO clock consumer somewhere? Could not find one.
  3. Is there some other generic clock consumer?

Thanks.

Ed

  • Punctually, to the questions:

    Is there some obvious way to change the frequency? I looked in debugfs and there was nothing.

    nope

    Is there an IIO clock consumer somewhere? Could not find one.

    it's in the m2k branch of our Linux tree: github.com/.../m2k

    Is there some other generic clock consumer?

    this question is a bit confusing to me;

    it doesn't have a single answer

    And now more broadly:

    Generally speaking, the Linux clock framework is typically used by consumer-drivers (drivers that need clocks).

    The clock framework does not provide any userland access, as far as I know.

    But I'll also have to check.

    Specifically for this driver, initially it seems it was put in the "drivers/clk" folder/sub-system/framework.

    It's main use (in our projects) is for the M2k board ( https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/ADALM2000.html )

    The main code is in a separate branch:

    github.com/.../m2k

    We are transitioning it to the master ; which also implies some re-doing some internal reviews, as things changed (since the m2k branch was created).

    This driver could have also been put in drivers/iio, which would have allowed a better userland access.

    Since it's not upstreamed, we could probably do that.

    That would also mean, a bit of re-write to the driver to make it and IIO driver that is also registered with the clock framework.

    We have some other drivers that were started like that (they were made IIO drivers that are also registered with the clock framework).

    Thanks

    Alex

  • I was looking starting with the adf4350 but I'll have a peak at the code you mentioned.