Skip to content

Commit 43310e2

Browse files
lucaceresoliwsakernel
authored andcommitted
docs: i2c: instantiating-devices: add syntax coloring to dts and C blocks
These blocks can be nicely coloured via Sphinx. Signed-off-by: Luca Ceresoli <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 6c12ec2 commit 43310e2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Documentation/i2c/instantiating-devices.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Declare the I2C devices via devicetree
3131
On platforms using devicetree, the declaration of I2C devices is done in
3232
subnodes of the master controller.
3333

34-
Example::
34+
Example:
35+
36+
.. code-block:: dts
3537
3638
i2c1: i2c@400a0000 {
3739
/* ... master properties skipped ... */
@@ -71,7 +73,9 @@ code. Instantiating I2C devices via board files is done with an array of
7173
struct i2c_board_info which is registered by calling
7274
i2c_register_board_info().
7375

74-
Example (from omap2 h4)::
76+
Example (from omap2 h4):
77+
78+
.. code-block:: c
7579
7680
static struct i2c_board_info h4_i2c_board_info[] __initdata = {
7781
{
@@ -111,7 +115,9 @@ bus in advance, so the method 1 described above can't be used. Instead,
111115
you can instantiate your I2C devices explicitly. This is done by filling
112116
a struct i2c_board_info and calling i2c_new_client_device().
113117

114-
Example (from the sfe4001 network driver)::
118+
Example (from the sfe4001 network driver):
119+
120+
.. code-block:: c
115121
116122
static struct i2c_board_info sfe4001_hwmon_info = {
117123
I2C_BOARD_INFO("max6647", 0x4e),
@@ -136,7 +142,9 @@ it may have different addresses from one board to the next (manufacturer
136142
changing its design without notice). In this case, you can call
137143
i2c_new_scanned_device() instead of i2c_new_client_device().
138144

139-
Example (from the nxp OHCI driver)::
145+
Example (from the nxp OHCI driver):
146+
147+
.. code-block:: c
140148
141149
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
142150

0 commit comments

Comments
 (0)