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

ad485x upstreaming #2527

Draft
wants to merge 8 commits into
base: staging/linus
Choose a base branch
from
Draft
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
14 changes: 14 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-iio-adc-ad485x
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
What: /sys/bus/iio/devices/iio:deviceX/packet_format_available
KernelVersion:
Contact: [email protected]
Description:
Packet sizes on the CMOS or LVDS conversion data output bus.
Reading this returns the valid values that can be written to the
packet_format.

What: /sys/bus/iio/devices/iio:deviceX/packet_format
KernelVersion:
Contact: [email protected]
Description:
This attribute configures the packet size.
Reading returns the actual size used.
Copy link
Collaborator

Choose a reason for hiding this comment

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

prepare yourself to justify this attribute :)

82 changes: 82 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,ad485x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2022 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad485x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD485X DAS family device driver

maintainers:
- Sergiu Cuciurean <[email protected]>
- Dragos Bogdan <[email protected]>
- Antoniu Miclaus <[email protected]>

description: |
Analog Devices AD485X DAS family

https://www.analog.com/media/en/technical-documentation/data-sheets/ad4858.pdf

properties:
compatible:
enum:
- adi,ad4858
- adi,ad4857
- adi,ad4856
- adi,ad4855
- adi,ad4854
- adi,ad4853
- adi,ad4852
- adi,ad4851
- adi,ad4858i

reg:
maxItems: 1

vcc-supply: true

vdd-supply: true

vddh-supply: true

vio-supply: true

pwms:
maxItems: 1

io-backends:
maxItems: 1

spi-max-frequency:
maximum: 100000000

required:
- compatible
- reg
- vcc-supply
- vdd-supply
- vddh-supply
- vio-supply
- pwms

unevaluatedProperties: false

examples:
- |
spi {
#address-cells = <1>;
#size-cells = <0>;

adc@0{
compatible = "adi,ad4858";
reg = <0>;
spi-max-frequency = <10000000>;
vcc-supply = <&vcc>;
vdd-supply = <&vdd>;
vddh-supply = <&vddh>;
vio-supply = <&vio>;
pwms = <&pwm_gen 0 0>;
io-backends = <&iio_backend>;
};
};
...
120 changes: 120 additions & 0 deletions arch/arm/boot/dts/xilinx/zynq-zed-ad485x.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "zynq-zed.dts"

#include <dt-bindings/interrupt-controller/irq.h>

/ {
clocks {
axi_clk: clock@0 {
compatible = "fixed-clock";
clock-frequency = <100000000>;
clock-output-names = "axi-clk";
#clock-cells = <0>;
};
};

vcc: regulator-vcc {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <7250000>;
regulator-max-microvolt = <7250000>;
regulator-always-on;
};

vdd: regulator-vdd {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
};

vddh: regulator-vddh {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
};

vio: regulator-vio {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};

fpga-axi@0 {
compatible = "simple-bus";
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;

rx_dma: dmac@43e00000 {
compatible = "adi,axi-dmac-1.00.a";
reg = <0x43E00000 0x1000>;
#dma-cells = <1>;
interrupt-parent = <&intc>;
interrupts = <0 54 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 15>;

adi,channels {
#size-cells = <0>;
#address-cells = <1>;

dma_channel: dma-channel@0 {
reg = <0>;
adi,source-bus-width = <128>;
adi,source-bus-type = <2>;
adi,destination-bus-width = <64>;
adi,destination-bus-type = <0>;
};
};
};

ref_clk: clk@0x44000000 {
compatible = "adi,axi-clkgen-2.00.a";
reg = <0x44000000 0x10000>;
#clock-cells = <0>;
clocks = <&clkc 15>, <&clkc 16>;
clock-names = "s_axi_aclk", "clkin1";
clock-output-names = "ref_clk";
};

axi_pwm_gen: pwm@0x43d00000 {
compatible = "adi,axi-pwmgen";
reg = <0x43d00000 0x1000>;
label = "cnv";
#pwm-cells = <2>;
clocks = <&ref_clk>;
};

iio_backend: axi_adc@43c00000 {
compatible = "adi,axi-adc-10.0.a";
reg = <0x43c00000 0x10000>;
dmas = <&rx_dma 0>;
dma-names = "rx";
clocks = <&axi_clk>;
spibus-connected = <&ad485x>;
};
};
};

&spi0 {
status = "okay";

ad485x: adc@0{
compatible = "adi,ad4857";
reg = <0>;
spi-max-frequency = <10000000>;
pwms = <&axi_pwm_gen 0 0>;
pwm-names = "cnv";
vcc-supply = <&vcc>;
vdd-supply = <&vdd>;
vddh-supply = <&vddh>;
vio-supply = <&vio>;
io-backends = <&iio_backend>;
};
};
Loading