From: Jean Delvare <jdelvare@suse.de>
To: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Linux I2C <linux-i2c@vger.kernel.org>,
Lei YU <mine260309@gmail.com>
Subject: Re: [PATCH 2/2] docs: i2c: dev-interface: document the actual implementation
Date: Mon, 3 Feb 2020 14:27:01 +0100 [thread overview]
Message-ID: <20200203142701.5c1db1ba@endymion> (raw)
In-Reply-To: <ffac66db-0b58-b832-f6b5-d1a1da7a1da9@lucaceresoli.net>
Hi Luca, Wolfram,
On Thu, 23 Jan 2020 14:42:33 +0100, Luca Ceresoli wrote:
> On 23/01/20 12:09, Wolfram Sang wrote:
> > On Thu, Jan 23, 2020 at 11:11:37AM +0100, Jean Delvare wrote:
> >> The old i2c-dev API based on inline functions is long gone, we have
> >> libi2c now which implements the same as real functions and comes with
> >> complete API documentation. Update the dev-interface documentation
> >> file accordingly to only mention what can be done without the
> >> library, and redirect the reader to the libi2c manual page for the
> >> rest.
> >>
> >> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> >> Reported-by: Lei YU <mine260309@gmail.com>
> >> Cc: Wolfram Sang <wsa@the-dreams.de>
> >> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> >
> > I wonder if we shouldn't move the 'C library' paragraph before the 'C
> > example'? To make sure people are aware of it (and use it) early before
> > digging into the low-level C code?
>
> I agree, it would be better. For the rest it look good.
Hmmm. It's not like you can do everything with libi2c so you should
always use it. There are several things that can't be done with libi2c
so you will have to do them "manually". Anything that doesn't fit in the
SMBus specification basically. As a matter of fact, i2ctransfer does
not use libi2c.
Also, even when using libi2c, you still need to explicitly open the
device node, set the slave address, and close the device when you are
done (just seeing that's missing from the C example but it should be
added). So the C example is still relevant even if you use libi2c.
So I'm not sure swapping the sections makes that much sense. What would
help on the other hand is to add a pointer to the C library section at
the point of the C example where using the library would simplify the
code. Would that work for you?
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2020-02-03 13:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 9:52 [PATCH 0/2] Move the SMBus API documentation to libi2c Jean Delvare
2020-01-23 10:03 ` [PATCH 1/2] libi2c: Add a manual page to document the API Jean Delvare
2020-01-23 10:17 ` Jean Delvare
2020-01-23 10:11 ` [PATCH 2/2] docs: i2c: dev-interface: document the actual implementation Jean Delvare
2020-01-23 11:09 ` Wolfram Sang
2020-01-23 13:42 ` Luca Ceresoli
2020-02-03 13:27 ` Jean Delvare [this message]
2020-02-03 16:35 ` Luca Ceresoli
2020-02-03 19:43 ` Wolfram Sang
2020-02-04 17:17 ` Jean Delvare
2020-01-29 21:13 ` Wolfram Sang
2020-02-03 12:21 ` Jean Delvare
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=20200203142701.5c1db1ba@endymion \
--to=jdelvare@suse.de \
--cc=linux-i2c@vger.kernel.org \
--cc=luca@lucaceresoli.net \
--cc=mine260309@gmail.com \
--cc=wsa@the-dreams.de \
/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