From: luca.ceresoli@bootlin.com
To: linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org
Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>,
Wolfram Sang <wsa@kernel.org>, Peter Rosin <peda@axentia.se>,
linux-kernel@vger.kernel.org
Subject: [PATCH 5/9] docs: i2c: instantiating-devices: add syntax coloring to dts and C blocks
Date: Mon, 8 Aug 2022 16:17:04 +0200 [thread overview]
Message-ID: <20220808141708.1021103-6-luca.ceresoli@bootlin.com> (raw)
In-Reply-To: <20220808141708.1021103-1-luca.ceresoli@bootlin.com>
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
These blocks can be nicely coloured via Sphinx.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Documentation/i2c/instantiating-devices.rst | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/Documentation/i2c/instantiating-devices.rst b/Documentation/i2c/instantiating-devices.rst
index 890c9360ce19..3ea056a95812 100644
--- a/Documentation/i2c/instantiating-devices.rst
+++ b/Documentation/i2c/instantiating-devices.rst
@@ -31,7 +31,9 @@ Declare the I2C devices via devicetree
On platforms using devicetree, the declaration of I2C devices is done in
subnodes of the master controller.
-Example::
+Example:
+
+.. code-block:: dts
i2c1: i2c@400a0000 {
/* ... master properties skipped ... */
@@ -71,7 +73,9 @@ code. Instantiating I2C devices via board files is done with an array of
struct i2c_board_info which is registered by calling
i2c_register_board_info().
-Example (from omap2 h4)::
+Example (from omap2 h4):
+
+.. code-block:: c
static struct i2c_board_info h4_i2c_board_info[] __initdata = {
{
@@ -111,7 +115,9 @@ bus in advance, so the method 1 described above can't be used. Instead,
you can instantiate your I2C devices explicitly. This is done by filling
a struct i2c_board_info and calling i2c_new_client_device().
-Example (from the sfe4001 network driver)::
+Example (from the sfe4001 network driver):
+
+.. code-block:: c
static struct i2c_board_info sfe4001_hwmon_info = {
I2C_BOARD_INFO("max6647", 0x4e),
@@ -136,7 +142,9 @@ it may have different addresses from one board to the next (manufacturer
changing its design without notice). In this case, you can call
i2c_new_scanned_device() instead of i2c_new_client_device().
-Example (from the nxp OHCI driver)::
+Example (from the nxp OHCI driver):
+
+.. code-block:: c
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
--
2.34.1
next prev parent reply other threads:[~2022-08-08 14:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-08 14:16 [PATCH 0/9] docs: i2c: rework I2C documentation, part II luca.ceresoli
2022-08-08 14:17 ` [PATCH 1/9] docs: i2c: i2c-protocol: update introductory paragraph luca.ceresoli
2022-08-11 21:03 ` Wolfram Sang
2022-08-08 14:17 ` [PATCH 2/9] docs: i2c: i2c-protocol,smbus-protocol: remove nonsense words luca.ceresoli
2022-08-11 21:03 ` Wolfram Sang
2022-08-08 14:17 ` [PATCH 3/9] docs: i2c: i2c-protocol: remove unused legend items luca.ceresoli
2022-08-11 21:05 ` Wolfram Sang
2022-08-08 14:17 ` [PATCH 4/9] docs: i2c: smbus-protocol: improve DataLow/DataHigh definition luca.ceresoli
2022-08-09 1:55 ` Bagas Sanjaya
2022-08-11 21:05 ` Wolfram Sang
2022-08-08 14:17 ` luca.ceresoli [this message]
2022-08-11 21:07 ` [PATCH 5/9] docs: i2c: instantiating-devices: add syntax coloring to dts and C blocks Wolfram Sang
2022-08-08 14:17 ` [PATCH 6/9] docs: i2c: i2c-topology: fix incorrect heading luca.ceresoli
2022-08-11 21:09 ` Wolfram Sang
2022-08-08 14:17 ` [PATCH 7/9] docs: i2c: i2c-topology: reorder sections more logically luca.ceresoli
2022-08-09 2:08 ` Bagas Sanjaya
2022-08-09 7:06 ` Luca Ceresoli
2022-08-11 21:09 ` Wolfram Sang
2022-08-08 14:17 ` [PATCH 8/9] docs: i2c: i2c-sysfs: improve wording luca.ceresoli
2022-08-11 21:13 ` Wolfram Sang
2022-08-11 21:23 ` Wolfram Sang
2022-08-12 7:13 ` Luca Ceresoli
2022-08-08 14:17 ` [PATCH 9/9] docs: i2c: i2c-sysfs: fix hyperlinks luca.ceresoli
2022-08-11 21:21 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220808141708.1021103-6-luca.ceresoli@bootlin.com \
--to=luca.ceresoli@bootlin.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).