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

Staging/adf4030 support #2651

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions Documentation/devicetree/bindings/iio/frequency/adi,adf4030.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2024 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,adf4030.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices ADF4030 10-Channel Precision Synchronizer IC

maintainers:
- Michael Hennerich <[email protected]>

description: |
Bindings for the Analog Devices ADF4030 10-Channel Precision Synchronizer IC.

The ADF4030 provides for 10 bidirectional synchronized clock (BSYNC) channels and
accepts a reference clock input (REFIN) signal as a frequency reference for
generating an output clock on any BSYNC channels that are configured as an output.
The hallmark feature of the ADF4030 is the ability to time align the clock edges
of any one or more BSYNC channels to <5 ps (at the device pins) with respect to
the BSYNC channel selected as the reference BSYNC channel.

https://www.analog.com/en/products/adf4030.html

properties:
compatible:
enum:
- adi,adf4030

clocks:
maxItems: 1
description: Input reference clock.

clock-names:
items:
- const: refin

adi,vco-frequency-hz:
description: VCO output frequency in Hz.
minimum: 2375000000
maximum: 2625000000

adi,bsync-frequency-hz:
description: Primary BSync output frequency in Hz.
minimum: 650000
maximum: 250000000

adi,bsync-secondary-frequency-hz:
description: Secondary BSync output frequency in Hz.
mhennerich marked this conversation as resolved.
Show resolved Hide resolved
minimum: 650000
maximum: 250000000

adi,bsync-autoalign-reference-channel:
description: Reference channel number for auto alignment.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 26]

adi,bsync-autoalign-iteration-count:
description: Number of iterations for auto alignment.
minimum: 0
maximum: 8

adi,bsync-autoalign-threshold-fs:
description: Threshold for auto alignment in femtoseconds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dunno the three above properties pass the binding check. They have no standard suffix and we're not defining a type for them.

Not sure why it does not fail in the check

$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 88200

clock-output-names:
description: Names of the clock outputs.
minItems: 1
maxItems: 10

'#clock-cells':
const: 1

patternProperties:
"^channel@[0-9]+$":
type: object
description: ADF4030 channel configuration.
properties:
reg:
description: Channel number.
$ref: /schemas/types.yaml#/definitions/uint32
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs some constrains. I guess some of the other properties also need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ACK

minimum: 0
maximum: 9

adi,delay-fs:
description: Delay in femtoseconds.
$ref: /schemas/types.yaml#/definitions/uint32

adi,extended-name:
description: Extended name for the channel.
$ref: /schemas/types.yaml#/definitions/string
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one is questionable..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well it's handy, and avoids possible mix up.


adi,reference-channel-num:
description: Reference channel number.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 26]

adi,output-en:
description: Enable drive/output for the channel.
type: boolean

adi,input-output-reconfig-en:
description: Enable input-output reconfiguration for the channel.
type: boolean

adi,use-secondary-odiv-b-en:
description: Enable use of secondary ODIV B.
type: boolean

auto-align-on-sync-en:
description: Enable auto alignment on sync.
type: boolean

adi,invert-en:
description: Enable inversion for the channel.
type: boolean

adi,ac-coupled-en:
description: Enable AC coupling for the channel.
type: boolean

adi,link-tx-en:
description: Enable link TX for the channel.
type: boolean

adi,link-rx-en:
description: Enable link RX for the channel.
type: boolean

adi,float-tx-en:
description: Enable float TX for the channel.
type: boolean

adi,float-rx-en:
description: Enable float RX for the channel.
type: boolean

adi,rcm:
description: RCM (Common Mode Resistor) value for the channel.
$ref: /schemas/types.yaml#/definitions/uint32
Copy link
Collaborator

Choose a reason for hiding this comment

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

A lot of these properties need a better description. Right now, the description is more or less the same what one can infer from the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You will always need the datasheet to properly set those and the naming follows the datasheet.
But I agree some more text doesn't harm. Will fix.

minimum: 0
maximum: 63

required:
- reg

additionalProperties: false

required:
- compatible
- adi,vco-frequency-hz
- adi,bsync-frequency-hz

additionalProperties: false

examples:
- |
spi {
#address-cells = <1>;
#size-cells = <0>;
adf4030@0 {
#clock-cells = <1>;
compatible = "adi,adf4030";
reg = <0>;

#address-cells = <1>;
#size-cells = <0>;

spi-max-frequency = <1000000>;
clocks = <&ltc6952 5>;
clock-names = "refin";
clock-output-names = "adf4030_bsync_0", "adf4030_bsync_1",
"adf4030_bsync_2", "adf4030_bsync_3", "adf4030_bsync_4",
"adf4030_bsync_5", "adf4030_bsync_6", "adf4030_bsync_7",
"adf4030_bsync_8", "adf4030_bsync_9" ;
label = "adf4030";

adi,vco-frequency-hz = <2500000000>; /* 2.5 GHz */
adi,bsync-frequency-hz = <12500000>; /* 12.5 MHz */
adi,bsync-autoalign-reference-channel = <8>;
adi,bsync-autoalign-iteration-count = <6>;

channel@0 {
reg = <0>;
adi,extended-name = "SYSREF_0";
adi,output-en;
adi,input-output-reconfig-en;
auto-align-on-sync-en;
adi,rcm = <1>;
};
channel@1 {
reg = <1>;
adi,extended-name = "SYSREF_1";
adi,output-en;
adi,input-output-reconfig-en;
auto-align-on-sync-en;
adi,rcm = <1>;
};
channel@4 {
reg = <4>;
adi,extended-name = "FPGA_SYSREF_0";
adi,output-en;
adi,input-output-reconfig-en;
auto-align-on-sync-en;
adi,rcm = <62>;
};
};
};
1 change: 1 addition & 0 deletions drivers/iio/Kconfig.adi
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,5 @@ config IIO_ALL_ADI_DRIVERS
imply LTC2664
imply AD8460
imply MAX77541_ADC
imply ADF4030

11 changes: 11 additions & 0 deletions drivers/iio/frequency/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ config LTC6952
To compile this driver as a module, choose M here: the
module will be called ltc6952.

config ADF4030
tristate "Analog Devices ADF4030 10-Channel Precision Synchronizer"
depends on SPI && COMMON_CLK
help
Say yes here to build support for Analog Devices ADF4030
10-Channel Precision Synchronizer. The driver provides direct access
via sysfs.

To compile this driver as a module, choose M here: the
module will be called adf4030.

endmenu

menu "Direct Digital Synthesis"
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/frequency/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ obj-$(CONFIG_AD9517) += ad9517.o
obj-$(CONFIG_AD9523) += ad9523.o
obj-$(CONFIG_AD9528) += ad9528.o
obj-$(CONFIG_AD9548) += ad9548.o
obj-$(CONFIG_ADF4030) += adf4030.o
obj-$(CONFIG_ADF4159) += adf4159.o
obj-$(CONFIG_ADF4350) += adf4350.o
obj-$(CONFIG_ADF4360) += adf4360.o
Expand Down
Loading
Loading