LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-14-2024, 04:40 PM   #1
Cranegsh
Member
 
Registered: Jan 2023
Posts: 42

Rep: Reputation: 0
How to export a node label in a device tree overlay


Hello,

I am trying to use __exports__ to export a node label from a device tree overlay so that it can be referred outside of this device tree overlay.

Tried this way:
Code:
        fragment@0 {
                target = <&i2c1>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                        pcf8575c: pcf8575c@20 {
                                pcf8575c;
                                reg = <0x20>;
                                compatible = "ti,pcf8575c";
                                gpio-controller;
                                #gpio-cells = <2>;
                                ngpios = <16>;
                                gpio-base = <200>;
                                label = "pcf8575c";
                        };
                        __exports__ {
                                pcf8575c;
                        }; 
                };
        };
Than the dt overlay failed to be applied.

And tried this way:
Code:
Code: Select all

        fragment@0 {
                target = <&i2c1>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                        pcf8575c: pcf8575c@20 {
                                pcf8575c;
                                reg = <0x20>;
                                compatible = "ti,pcf8575c";
                                gpio-controller;
                                #gpio-cells = <2>;
                                ngpios = <16>;
                                gpio-base = <200>;
                                label = "pcf8575c";
                        };
                };
                __exports__ {
                        pcf8575c;
                }; 
        };
Then it is applied, but seems not working. The GPIO dt overlay which is based on this I2C expander node is still fails to be applied.

So the question is, how to export a label effectively?
I couldn't find anything from googling it. It seems that __exports__ is rarely used. I am wondering if this kind of node that might be referred by other nodes is usually put in device tree, instead of device tree overlay.

Thanks!
Crane
 
Old 08-15-2024, 09:15 AM   #2
Cranegsh
Member
 
Registered: Jan 2023
Posts: 42

Original Poster
Rep: Reputation: 0
Find the answer: the __export__ block needs to be moved one level up.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount -t overlay overlay? gregors Linux - Software 2 06-08-2023 01:39 AM
configure bias-pull-down for GPIO pin via device-tree overlay temoto Linux - Embedded & Single-board computer 2 06-04-2019 02:20 AM
Custom module to add device tree overlay - kernel 4.14-rc4 Carli-K Linux - Kernel 3 05-29-2018 08:40 PM
Live Image mount: union FS overlay vs dmsetup overlay kostya Linux - Software 2 02-16-2012 06:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration