summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM J Stanway <m.j.stanway@alum.mit.edu>2020-12-17 19:30:19 +0000
committerRobert Nelson <robertcnelson@gmail.com>2020-12-21 10:26:21 -0600
commita33ec6b255ff5e4883984c36de7155e38137c2a1 (patch)
tree4c687f58f8170aca5ab6ec31ad576a94cc6933a3
parent92de6d0f646c5c7e53c4ea8b488d93f47bf62c06 (diff)
add draft dts for LTC2947 on SPI1
- use BB-SPIDEV1-00A0.dts as template - revise according to examples on the [Analog Devices wiki][1] [1]: https://wiki.analog.com/resources/tools-software/linux-drivers/hwmon/ltc2947#example_i2c_spi_device_initialization
-rw-r--r--src/arm/BB-SPI1-LTC2947-00A0.dts99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/arm/BB-SPI1-LTC2947-00A0.dts b/src/arm/BB-SPI1-LTC2947-00A0.dts
new file mode 100644
index 0000000..717a37a
--- /dev/null
+++ b/src/arm/BB-SPI1-LTC2947-00A0.dts
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2020 Otter Works
+ *
+ * LTC2947 on SPI1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/board/am335x-bbw-bbb-base.h>
+#include <dt-bindings/pinctrl/am33xx.h>
+
+/ {
+ compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";
+
+ /* identification */
+ part-number = "BB-SPI1-LTC2947";
+ version = "00A0";
+
+ /* state the resources this cape uses */
+ exclusive-use =
+ /* the pin header uses */
+ "P9.31", /* spi1_sclk */
+ "P9.29", /* spi1_d0 */
+ "P9.30", /* spi1_d1 */
+ "P9.28", /* spi1_cs0 */
+ /* the hardware ip uses */
+ "spi1";
+
+ /*
+ * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
+ */
+ fragment@0 {
+ target-path="/";
+ __overlay__ {
+
+ chosen {
+ overlays {
+ BB-SPI1-LTC2947-00A0 = __TIMESTAMP__;
+ };
+ };
+ };
+ };
+
+ /*
+ * Free up the pins used by the cape from the pinmux helpers.
+ */
+ fragment@1 {
+ target = <&ocp>;
+ __overlay__ {
+ P9_28_pinmux { status = "disabled"; }; /* spi1_cs0 */
+ P9_30_pinmux { status = "disabled"; }; /* spi1_d1 */
+ P9_29_pinmux { status = "disabled"; }; /* spi1_d0 */
+ P9_31_pinmux { status = "disabled"; }; /* spi1_sclk */
+ };
+ };
+
+ fragment@2 {
+ target = <&am33xx_pinmux>;
+ __overlay__ {
+ /* default state has all gpios released and mode set to uart1 */
+ bb_spi1_pins: pinmux_bb_spi1_pins {
+ pinctrl-single,pins = <
+ 0x190 0x33 /* mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | MODE3 */
+ 0x194 0x33 /* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */
+ 0x198 0x13 /* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */
+ 0x19c 0x13 /* mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */
+ >;
+ };
+ };
+ };
+
+ fragment@3 {
+ target = <&spi1>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&bb_spi1_pins>;
+ ti,pio-mode; /* disable dma when used as an overlay, dma gets stuck at 160 bits... */
+
+ ltc2947_spi: ltc2947@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ compatible = "adi,ltc2947";
+
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ };
+ };
+ };
+};