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

AD2S1210 updates for RPi #2311

Merged
merged 1 commit into from
Nov 2, 2023
Merged
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
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";
};
};