Comments (1)
import dtb
def uart_probe(device_node):
if 'uart' not in device_node.compatible:
return
uart_init(device_node, ...)
def rtx3080ti_probe(device_node):
if 'rtx3080ti' not in device_node.compatible:
return
rtx3080ti_init(device_node, ...)
driver_probe_funcs = [uart_probe, rtx3080ti_probe, ...]
dtb.init()
for f in driver_probe_funcs:
dtb.foreach_node(f)
The above pseudocode is a possible implementation and how to use it.
The device tree module provides a function to walk all device nodes in dtb and call the provided callback functions with the device node.
In the example, because uart is in rpi3's dtb, so it'll be matched when walking the device tree.
After the device node and the driver matches, the driver can use the device node's property for initialization.
On the other hand, rtx3080ti is not in rpi3's dtb so, it's callback function never find matched device node and never get initialized.
You can either parse dtb ahead of time to construct a device tree, or on the fly when someone calls dtb.foreach_node()
.
Finally, if you have any problem with the documentation, please submit issue at documentation's repository
from osc2021.
Related Issues (2)
- Lab 2: Requirement 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osc2021.