aboutsummaryrefslogtreecommitdiff
path: root/sample.dts
diff options
context:
space:
mode:
Diffstat (limited to 'sample.dts')
-rw-r--r--sample.dts58
1 files changed, 58 insertions, 0 deletions
diff --git a/sample.dts b/sample.dts
new file mode 100644
index 0000000..6111555
--- /dev/null
+++ b/sample.dts
@@ -0,0 +1,58 @@
+/*
+ * The CDS9K currently lives on an SPI bus, and comprises different IP blocks
+ * in different applications. For this reason the top level driver does nothing
+ * more than expose a regmap on top of its parent bus.
+ * As children of this top-level cds9k driver, each copy of each IP block has
+ * an entry in the DT for it, and a separate driver is registered for each
+ *
+ * The sample DTS segment here exposes a CDS9K loaded with at least the
+ * following IP blocks:
+ *
+ * address | IP block | compatible
+ * --------+-------------+---------
+ * 0x4 | Fan control | david,cds9k-fan
+ * 0x6 | LED control | david,cds9k-led
+ * 0x8 | GPIO | david,cds9k-gpio
+ * 0xa | GPIO | david,cds9k-gpio
+ */
+&spi0 {
+ // ...
+ cds9k: cds9k@0 {
+ compatible = "david,cds9k";
+ status = "okay";
+ reg = <0>;
+ spi-max-frequency = <1000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cds9k_fan0: cds9k-fan@4 {
+ compatible = "david,cds9k-fan";
+ status = "okay";
+ reg = <0x4>;
+ };
+ // ...
+ cds9k_led0: cds9k-led@6 {
+ compatible = "david,cds9k-led";
+ status = "okay";
+ reg = <0x6>;
+ color = <LED_COLOR_ID_WHITE>;
+ function = LED_FUNCTION_DEBUG;
+ };
+ // ...
+ cds9k_gpio0: cds9k-gpio@8 {
+ compatible = "david,cds9k-gpio";
+ status = "okay";
+ reg = <0x8>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+ cds9k_gpio1: cds9k-gpio@a {
+ compatible = "david,cds9k-gpio";
+ status = "okay";
+ reg = <0xa>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+ };
+};
+