@@ -31,7 +31,9 @@ Declare the I2C devices via devicetree
31
31
On platforms using devicetree, the declaration of I2C devices is done in
32
32
subnodes of the master controller.
33
33
34
- Example::
34
+ Example:
35
+
36
+ .. code-block :: dts
35
37
36
38
i2c1: i2c@400a0000 {
37
39
/* ... master properties skipped ... */
@@ -71,7 +73,9 @@ code. Instantiating I2C devices via board files is done with an array of
71
73
struct i2c_board_info which is registered by calling
72
74
i2c_register_board_info().
73
75
74
- Example (from omap2 h4)::
76
+ Example (from omap2 h4):
77
+
78
+ .. code-block :: c
75
79
76
80
static struct i2c_board_info h4_i2c_board_info[] __initdata = {
77
81
{
@@ -111,7 +115,9 @@ bus in advance, so the method 1 described above can't be used. Instead,
111
115
you can instantiate your I2C devices explicitly. This is done by filling
112
116
a struct i2c_board_info and calling i2c_new_client_device().
113
117
114
- Example (from the sfe4001 network driver)::
118
+ Example (from the sfe4001 network driver):
119
+
120
+ .. code-block :: c
115
121
116
122
static struct i2c_board_info sfe4001_hwmon_info = {
117
123
I2C_BOARD_INFO("max6647", 0x4e),
@@ -136,7 +142,9 @@ it may have different addresses from one board to the next (manufacturer
136
142
changing its design without notice). In this case, you can call
137
143
i2c_new_scanned_device() instead of i2c_new_client_device().
138
144
139
- Example (from the nxp OHCI driver)::
145
+ Example (from the nxp OHCI driver):
146
+
147
+ .. code-block :: c
140
148
141
149
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
142
150
0 commit comments