Skip to content

Add ADF4382 #2387

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

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
141 changes: 141 additions & 0 deletions Documentation/devicetree/bindings/iio/frequency/adi,adf4382.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,adf4382.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ADF4382 Microwave Wideband Synthesizer with Integrated VCO

maintainers:
- Antoniu Miclaus <[email protected]>
- Ciprian Hegbeli <[email protected]>

description: The ADF4382 is a high performance, ultralow jitter, Frac-N PLL with
integrated VCO ideally suited for LO generation for 5G applications
or data converter clock applications.

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

properties:
compatible:
enum:
- adi,adf4382
- adi,adf4382a

reg:
maxItems: 1

spi-max-frequency:
maximum: 75000000

clocks:
description: Clock to provide CLKIN reference clock signal.
maxItems: 1

clock-names:
description:
External clock that provides reference input frequency.
items:
- const: ref_clk

'#clock-cells':
const: 0

clock-output-names:
maxItems: 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Drop maxItems (I think). Ditto for all other places where we don't really have an array. On top of it, make this a proper current property. That means this should be adi,charge-pump-microamp. The translation for proper register values should then be done in the driver. In dts, we should be clear about the properties (when possible).


adi,charge-pump-microamp:
description:
The charge pump current that the external loop filter was designed for.
If this property is not specified, then the charge pump current is set to the
default 11100uA. The valid values are listed below. However, if the set value is
not supported, the driver will look for the closest valid charge pump current.
anyOf:
- enum: [790, 990, 1190, 1380, 1590, 1980, 2390, 2790, 3180, 3970, 4770, 5570, 6330, 7910, 9510, 11100]

adi,ref-divider:
description:
Input divider of the reference frequency, cannot be lower then 1 or
higher then 63.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't think you need formatted text in all the properties. So you can drop the |

allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
- minimum: 1
- maximum: 63
- default: 1
maxItems: 1

adi,ref-doubler-enable:
description:
Enables the doubling of the reference clock.
type: boolean
maxItems: 1

adi,bleed-word:
description:
A small programmable constant charge pump current, known as bleed current,
can be used to optimize the phase noise and fractional spurious signals
in fractional mode.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
- minimum: 0
- maximum: 4095
- default: 0
maxItems: 1

adi,power-up-frequency:
description:
PLL tunes to the set frequency on probe or defaults to 2,305 GHz.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint64
- minimum: 687500000
- maximum: 22000000000
- default: 2305000000
maxItems: 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if the the above two properties belong in dts. The frequency one will be an hard sell upstream since I suppose that is something you can do already at runtime (changing the frequency). So you need to have a very good justification for this.

The adi,bleed-word also seems like something we could/should have at runtime? Or is this word something dependent on the system/design and that we typically just want to program once?


adi,output-power-value:
description:
The output power amplitude level which will be applied for both channels
at startup.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
- minimum: 0
- maximum: 15
- default: 11
maxItems: 1

adi,spi-3wire-enable:
description:
Uses SPI in 3 wire mode, by default is uses 4 wire mode.
type: boolean
maxItems: 1

adi,cmos-3v3:
description:
Sets the SPI logic to 3.3V, by defautl it uses 1,8V.
type: boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

maxItems: 1

required:
- compatible
- reg
- clocks
- clock-names

additionalProperties: false

Copy link
Collaborator

Choose a reason for hiding this comment

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

The driver looks to be a clock provider but I'm not seeing any provider properties in the bindings...

examples:
- |
spi {
#address-cells = <1>;
#size-cells = <0>;
frequency@0 {
compatible = "adi,adf4382";
reg = <0>;
spi-max-frequency = <1000000>;
clocks = <&adf4382_clkin>;
clock-names = "ref_clk";
adi,charge-pump-current = <15>;
adi,ref-divider = <1>;
};
};
...
1 change: 1 addition & 0 deletions drivers/iio/Kconfig.adi
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ config IIO_ALL_ADI_DRIVERS
imply MAX31865
imply MAX11205
imply ADRV9025
imply ADF4382

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

config ADF4382
tristate "Analog Devices ADF4382 Microwave Wideband Synthesizer"
depends on SPI && COMMON_CLK
help
Say yes here to build support for Analog Devices ADF4382 Microwave
Wideband Synthesizer.

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

config ADF5355
tristate "Analog Devices ADF5355/ADF4355 Wideband Synthesizers"
depends on SPI
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/frequency/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ obj-$(CONFIG_ADF4350) += adf4350.o
obj-$(CONFIG_ADF4360) += adf4360.o
obj-$(CONFIG_ADF4371) += adf4371.o
obj-$(CONFIG_ADF4377) += adf4377.o
obj-$(CONFIG_ADF4382) += adf4382.o
obj-$(CONFIG_ADMV1013) += admv1013.o
obj-$(CONFIG_ADMV1014) += admv1014.o
obj-$(CONFIG_ADMV4420) += admv4420.o
Expand Down
Loading