Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
aeca0fe6
Commit
aeca0fe6
authored
Feb 10, 2014
by
Wolfram Sang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation: i2c: describe devicetree method for instantiating devices
Signed-off-by:
Wolfram Sang
<
wsa@the-dreams.de
>
parent
79970db2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
Documentation/i2c/instantiating-devices
Documentation/i2c/instantiating-devices
+32
-2
No files found.
Documentation/i2c/instantiating-devices
View file @
aeca0fe6
...
@@ -8,8 +8,8 @@ reason, the kernel code must instantiate I2C devices explicitly. There are
...
@@ -8,8 +8,8 @@ reason, the kernel code must instantiate I2C devices explicitly. There are
several ways to achieve this, depending on the context and requirements.
several ways to achieve this, depending on the context and requirements.
Method 1: Declare the I2C devices by bus number
Method 1
a
: Declare the I2C devices by bus number
-----------------------------------------------
-----------------------------------------------
-
This method is appropriate when the I2C bus is a system bus as is the case
This method is appropriate when the I2C bus is a system bus as is the case
for many embedded systems. On such systems, each I2C bus has a number
for many embedded systems. On such systems, each I2C bus has a number
...
@@ -51,6 +51,36 @@ The devices will be automatically unbound and destroyed when the I2C bus
...
@@ -51,6 +51,36 @@ The devices will be automatically unbound and destroyed when the I2C bus
they sit on goes away (if ever.)
they sit on goes away (if ever.)
Method 1b: Declare the I2C devices via devicetree
-------------------------------------------------
This method has the same implications as method 1a. The declaration of I2C
devices is here done via devicetree as subnodes of the master controller.
Example:
i2c1: i2c@400a0000 {
/* ... master properties skipped ... */
clock-frequency = <100000>;
flash@50 {
compatible = "atmel,24c256";
reg = <0x50>;
};
pca9532: gpio@60 {
compatible = "nxp,pca9532";
gpio-controller;
#gpio-cells = <2>;
reg = <0x60>;
};
};
Here, two devices are attached to the bus using a speed of 100kHz. For
additional properties which might be needed to set up the device, please refer
to its devicetree documentation in Documentation/devicetree/bindings/.
Method 2: Instantiate the devices explicitly
Method 2: Instantiate the devices explicitly
--------------------------------------------
--------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment