Lumentum OCM: setup the SPI bus
Too bad that we're going to use the J18 header as well. A possible
alternative could be something like a NOR gate at the CS1 and CS2 pins
which triggers when both of them are at logic zero. That *might* work.
That lovely kernel warning about "spidev" not being a shiny value in DT
is, well, just lovely. Yup, because patching kernel is definitely
something that one just wants to do. Oh well.
Oh, and this requires an out-of-tree patch for that udelay thingy.
Change-Id: If9e444366fb4c4a2fc592ca99e84048a9c501da1
diff --git a/board/czechlight/clearfog/czechlight-clearfog.dts b/board/czechlight/clearfog/czechlight-clearfog.dts
index 490b8c6..296600e 100644
--- a/board/czechlight/clearfog/czechlight-clearfog.dts
+++ b/board/czechlight/clearfog/czechlight-clearfog.dts
@@ -65,7 +65,7 @@
};
&spi1 {
- cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>;
+ cs-gpios = <0>, <&gpio0 22 GPIO_ACTIVE_HIGH>, <0>, <&gpio1 16 GPIO_ACTIVE_HIGH>;
max14830: max14830@2 {
compatible = "maxim,max14830";
@@ -113,8 +113,8 @@
spi-max-frequency = <10000000>;
gpio-line-names =
- "1-A0",
- "1-A1",
+ "OCM-HS_out",
+ "OCM-HS_in",
"1-A2",
"1-A3",
"1-A4",
@@ -150,4 +150,12 @@
"2-B7"
;
};
+
+ spidev@3 {
+ compatible = "spidev";
+ reg = <3>;
+ spi-max-frequency = <12000000>;
+ spi-cpol;
+ linux,spi-wdelay = /bits/ 16 <3>;
+ };
};
diff --git a/board/czechlight/clearfog/linux.fragment b/board/czechlight/clearfog/linux.fragment
index 83cd006..43a563b 100644
--- a/board/czechlight/clearfog/linux.fragment
+++ b/board/czechlight/clearfog/linux.fragment
@@ -20,3 +20,6 @@
# SPI GPIO expander
CONFIG_PINCTRL_MCP23S08=y
+
+# For the Lumentum OCM
+CONFIG_SPI_SPIDEV=y