Skip to content

Commit

Permalink
arm: dts: add overlay for AD2S1210 resolver
Browse files Browse the repository at this point in the history
This adds a device tree overlay for the AD2S1210 resolver to digital
converter.

Signed-off-by: David Lechner <[email protected]>
  • Loading branch information
dlech authored and nunojsa committed Nov 2, 2023
1 parent 6ec3ddc commit ff14a76
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += overlay_map.dtb hat_map.dtb
dtbo-$(CONFIG_ARCH_BCM2835) += \
act-led.dtbo \
adafruit-st7735r.dtbo \
ad2s1210.dtbo \
adafruit18.dtbo \
adau1977-adc.dtbo \
adau7002-simple.dtbo \
Expand Down
104 changes: 104 additions & 0 deletions arch/arm/boot/dts/overlays/ad2s1210-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* Generic Device Tree overlay for the AD2S1210 resolver to digital converter
*
*/

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
compatible = "brcm,bcm2835";

fragment@0 {
target-path = "/";
__overlay__ {
ad2s1210_clock: ad2s1210-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <8192000>;
};
};
};

fragment@1 {
target = <&spidev0>;
__overlay__ {
status = "disabled";
};
};

fragment@2 {
target = <&gpio>;
__overlay__ {
ad2s1210_resolution_pins: ad2s1210_resolution_pins {
brcm,pins = <23 22>;
brcm,function = <1>; /* out */
};
ad2s1210_sample_pins: ad2s1210_sample_pins {
brcm,pins = <18>;
brcm,function = <1>; /* out */
};
};
};

fragment@3 {
target = <&gpio>;

__overlay__ {
ad2s1210_mode_pins: ad2s1210_mode_pins {
brcm,pins = <25 24>;
brcm,function = <1>; /* out */
};
};
};

fragment@4 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

ad2s1210: ad2s1210@0 {
compatible = "adi,ad2s1210";
reg = <0>;
pinctrl-names = "default";
spi-max-frequency = <20000000>;
spi-cpha;
clocks = <&ad2s1210_clock>;
sample-gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
resolution-gpios = <&gpio 23 0>, <&gpio 22 0>;
assigned-resolution-bits = <16>;
};
};
};

fragment@5 {
target = <&ad2s1210>;
__overlay__ {
pinctrl-0 = <&ad2s1210_resolution_pins>,
<&ad2s1210_mode_pins>,
<&ad2s1210_sample_pins>;
mode-gpios = <&gpio 25 0>, <&gpio 24 0>;
};
};

fragment@6 {
target = <&ad2s1210>;
__dormant__ {
pinctrl-0 = <&ad2s1210_resolution_pins>,
<&ad2s1210_sample_pins>;
adi,fixed-mode = "config";
};
};

__overrides__ {
cs = <&ad2s1210>,"reg:0";
speed = <&ad2s1210>,"spi-max-frequency:0";
resolution = <&ad2s1210>,"assigned-resolution-bits:0";
fixed-mode = <0>,"-3-5+6";
};
};

0 comments on commit ff14a76

Please sign in to comment.