aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-02-15 19:17:51 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-02-15 19:17:51 -0500
commit2d0ef4fb34b0462d84a2d87292144b9dad79c8d0 (patch)
tree76e98a2ba1cae8baf1ce8e96f64b16aa98a41f2d /Documentation
parent5a667a0c02f3d24eb82a44074d24524c17e1ad34 (diff)
parentfde1e418ab2c4269035f7f576e678b6ad3117d7d (diff)
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "i2c has a bugfix and documentation improvements for you" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: Documentation: i2c: mention ACPI method for instantiating devices Documentation: i2c: describe devicetree method for instantiating devices i2c: mv64xxx: refactor message start to ensure proper initialization
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/i2c/instantiating-devices41
1 files changed, 39 insertions, 2 deletions
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index c70e7a7638d1..0d85ac1935b7 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -8,8 +8,8 @@ reason, the kernel code must instantiate I2C devices explicitly. There are
8several ways to achieve this, depending on the context and requirements. 8several ways to achieve this, depending on the context and requirements.
9 9
10 10
11Method 1: Declare the I2C devices by bus number 11Method 1a: Declare the I2C devices by bus number
12----------------------------------------------- 12------------------------------------------------
13 13
14This method is appropriate when the I2C bus is a system bus as is the case 14This method is appropriate when the I2C bus is a system bus as is the case
15for many embedded systems. On such systems, each I2C bus has a number 15for many embedded systems. On such systems, each I2C bus has a number
@@ -51,6 +51,43 @@ The devices will be automatically unbound and destroyed when the I2C bus
51they sit on goes away (if ever.) 51they sit on goes away (if ever.)
52 52
53 53
54Method 1b: Declare the I2C devices via devicetree
55-------------------------------------------------
56
57This method has the same implications as method 1a. The declaration of I2C
58devices is here done via devicetree as subnodes of the master controller.
59
60Example:
61
62 i2c1: i2c@400a0000 {
63 /* ... master properties skipped ... */
64 clock-frequency = <100000>;
65
66 flash@50 {
67 compatible = "atmel,24c256";
68 reg = <0x50>;
69 };
70
71 pca9532: gpio@60 {
72 compatible = "nxp,pca9532";
73 gpio-controller;
74 #gpio-cells = <2>;
75 reg = <0x60>;
76 };
77 };
78
79Here, two devices are attached to the bus using a speed of 100kHz. For
80additional properties which might be needed to set up the device, please refer
81to its devicetree documentation in Documentation/devicetree/bindings/.
82
83
84Method 1c: Declare the I2C devices via ACPI
85-------------------------------------------
86
87ACPI can also describe I2C devices. There is special documentation for this
88which is currently located at Documentation/acpi/enumeration.txt.
89
90
54Method 2: Instantiate the devices explicitly 91Method 2: Instantiate the devices explicitly
55-------------------------------------------- 92--------------------------------------------
56 93