<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add DTS for PCA9635 LED Driver]]></title><description><![CDATA[<p dir="auto">Hi All,</p>
<p dir="auto">for my custom hardware i need to drive some LED's and since the Software PWM wasn't stable enough I opted for an LED driver. I compiled a custom firmware (24.10) with the leds-pca963x kernel module and I can confirm that it's loaded. I have my PCA9635 connect to I2C on address 0x8 and can see it with i2cdetect.<br />
I try adding the device via sys/class like:</p>
<pre><code>echo pca9635 0x08 &gt; /sys/class/i2c-dev/i2c-0/device/new_device
</code></pre>
<p dir="auto">running desmg afterwards shows that it tried to load the driver:</p>
<pre><code>[  949.521145] leds-pca963x 0-0008: Node (null) must define between 1 and 16 LEDs
[  949.528588] leds-pca963x: probe of 0-0008 failed with error -22
[  949.534638] i2c i2c-0: new_device: Instantiated device pca9635 at 0x08
</code></pre>
<p dir="auto">However it looks like it needs the LED's defined via DTS. I never used that so I forked the onion-dts-overlay and tried to add my own but that didn't work either.</p>
<pre><code>/dts-v1/;
/plugin/;

/ {
    compatible = "onion,omega2";

    fragment@0 {
        target = &lt;&amp;i2c0&gt;;  // adapt to your bus if needed

        __overlay__ {
            pca9635: pca9635@08 {
                compatible = "nxp,pca9635";
                reg = &lt;0x08&gt;;
                #address-cells = &lt;1&gt;;
                #size-cells = &lt;0&gt;;

                led@0 {
                    label = "user:led0";
                    reg = &lt;0&gt;;
                };

                led@1 {
                    label = "user:led1";
                    reg = &lt;1&gt;;
                };
                // Add more as needed
            };
        };
    };
};

</code></pre>
<p dir="auto">I'm not sure where to start. Ideally I'd add everything into one package for the firmware compilation but I'm lost where that should happen.</p>
]]></description><link>http://community.onion.io/topic/5119/add-dts-for-pca9635-led-driver</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 05:15:51 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/5119.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Jun 2025 21:29:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add DTS for PCA9635 LED Driver on Tue, 24 Jun 2025 21:29:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi All,</p>
<p dir="auto">for my custom hardware i need to drive some LED's and since the Software PWM wasn't stable enough I opted for an LED driver. I compiled a custom firmware (24.10) with the leds-pca963x kernel module and I can confirm that it's loaded. I have my PCA9635 connect to I2C on address 0x8 and can see it with i2cdetect.<br />
I try adding the device via sys/class like:</p>
<pre><code>echo pca9635 0x08 &gt; /sys/class/i2c-dev/i2c-0/device/new_device
</code></pre>
<p dir="auto">running desmg afterwards shows that it tried to load the driver:</p>
<pre><code>[  949.521145] leds-pca963x 0-0008: Node (null) must define between 1 and 16 LEDs
[  949.528588] leds-pca963x: probe of 0-0008 failed with error -22
[  949.534638] i2c i2c-0: new_device: Instantiated device pca9635 at 0x08
</code></pre>
<p dir="auto">However it looks like it needs the LED's defined via DTS. I never used that so I forked the onion-dts-overlay and tried to add my own but that didn't work either.</p>
<pre><code>/dts-v1/;
/plugin/;

/ {
    compatible = "onion,omega2";

    fragment@0 {
        target = &lt;&amp;i2c0&gt;;  // adapt to your bus if needed

        __overlay__ {
            pca9635: pca9635@08 {
                compatible = "nxp,pca9635";
                reg = &lt;0x08&gt;;
                #address-cells = &lt;1&gt;;
                #size-cells = &lt;0&gt;;

                led@0 {
                    label = "user:led0";
                    reg = &lt;0&gt;;
                };

                led@1 {
                    label = "user:led1";
                    reg = &lt;1&gt;;
                };
                // Add more as needed
            };
        };
    };
};

</code></pre>
<p dir="auto">I'm not sure where to start. Ideally I'd add everything into one package for the firmware compilation but I'm lost where that should happen.</p>
]]></description><link>http://community.onion.io/post/26373</link><guid isPermaLink="true">http://community.onion.io/post/26373</guid><dc:creator><![CDATA[thomasderbauer]]></dc:creator><pubDate>Tue, 24 Jun 2025 21:29:43 GMT</pubDate></item><item><title><![CDATA[Reply to Add DTS for PCA9635 LED Driver on Thu, 26 Jun 2025 11:35:25 GMT]]></title><description><![CDATA[<p dir="auto">So I figured it out by now. It didn't really work with overlay but using the main .dtsi file worked.<br />
pca9635.dtsi</p>
<pre><code>&amp;i2c {
    pca9635@8 {
        compatible = "nxp,pca9635";
        reg = &lt;0x08&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
        status = "okay";

        led@0 {
            label = "led0";
            reg = &lt;0&gt;;
            default-state = "off";
        };

        led@1 {
            label = "led1";
            reg = &lt;1&gt;;
            default-state = "off";
        };

        led@2 {
            label = "led2";
            reg = &lt;2&gt;;
            default-state = "off";
        };

        led@3 {
            label = "led3";
            reg = &lt;3&gt;;
            default-state = "off";
        };

        led@4 {
            label = "led4";
            reg = &lt;4&gt;;
            default-state = "off";
        };

        led@5 {
            label = "led5";
            reg = &lt;5&gt;;
            default-state = "off";
        };

        led@6 {
            label = "led6";
            reg = &lt;6&gt;;
            default-state = "off";
        };

        led@7 {
            label = "led7";
            reg = &lt;7&gt;;
            default-state = "off";
        };

        led@8 {
            label = "led8";
            reg = &lt;8&gt;;
            default-state = "off";
        };

        led@9 {
            label = "led9";
            reg = &lt;9&gt;;
            default-state = "off";
        };

        led@10 {
            label = "led10";
            reg = &lt;10&gt;;
            default-state = "off";
        };

        led@11 {
            label = "led11";
            reg = &lt;11&gt;;
            default-state = "off";
        };

        led@12 {
            label = "led12";
            reg = &lt;12&gt;;
            default-state = "off";
        };

        led@13 {
            label = "led13";
            reg = &lt;13&gt;;
            default-state = "off";
        };

        led@14 {
            label = "led14";
            reg = &lt;14&gt;;
            default-state = "off";
        };

        led@15 {
            label = "led15";
            reg = &lt;15&gt;;
            default-state = "off";
        };
    };
};

</code></pre>
<p dir="auto">placed in the build folder</p>
<pre><code>/home/thomas/openwrt-wallcontroller/target/linux/ramips/dts
</code></pre>
<p dir="auto">and lastly adding an include to the omega .dtsi</p>
<pre><code>mt7628an_onion_omega2.dtsi
</code></pre>
<pre><code>#include "mt7628an.dtsi"
#include "pca9635.dtsi"
#include &lt;dt-bindings/gpio/gpio.h&gt;
#include &lt;dt-bindings/input/input.h&gt;

</code></pre>
]]></description><link>http://community.onion.io/post/26375</link><guid isPermaLink="true">http://community.onion.io/post/26375</guid><dc:creator><![CDATA[thomasderbauer]]></dc:creator><pubDate>Thu, 26 Jun 2025 11:35:25 GMT</pubDate></item></channel></rss>