From: "Uwe Kleine-König" <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
Geert Uytterhoeven
<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Subject: Re: [PATCH v2 2/4] Documentation: i2c: describe the new slave mode
Date: Mon, 23 Mar 2015 09:45:10 +0100 [thread overview]
Message-ID: <20150323084510.GL5664@pengutronix.de> (raw)
In-Reply-To: <1427099199-3628-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Hello Wolfram,
On Mon, Mar 23, 2015 at 09:26:37AM +0100, Wolfram Sang wrote:
> +Developer manual
> +================
> +
> +I2C slave events
> +----------------
> +
> +The bus driver sends an event to the backend using the following function:
> +
> + ret = i2c_slave_event(client, event, &val)
> +
> +'client' describes the i2c slave device. 'event' is one of the special event
> +types described hereafter. 'val' holds an u8 value for the data byte to be
> +read/written and is thus bidirectional. The pointer to val must always be
> +provided even if val is not used for an event, i.e. don't use NULL here. 'ret'
> +is the return value from the backend. Mandatory events must be provided by the
I don't understand why you want to force a valid pointer here. According
to my sense of defensive programming I'd say: If the bus driver doesn't
expect the slave to consume/provide a value, let's pass NULL to notice
the assumption being wrong. The wording is fine, now.
> diff --git a/Documentation/i2c/summary b/Documentation/i2c/summary
> index 13ab076dcd9248..809541ab352f03 100644
> --- a/Documentation/i2c/summary
> +++ b/Documentation/i2c/summary
> @@ -41,7 +41,3 @@ integrated than Algorithm and Adapter.
>
> For a given configuration, you will need a driver for your I2C bus, and
> drivers for your I2C devices (usually one driver for each device).
> -
> -At this time, Linux only operates I2C (or SMBus) in master mode; you can't
> -use these APIs to make a Linux system behave as a slave/device, either to
> -speak a custom protocol or to emulate some other device.
\o/
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
Geert Uytterhoeven
<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Subject: Re: [PATCH v2 2/4] Documentation: i2c: describe the new slave mode
Date: Mon, 23 Mar 2015 08:45:10 +0000 [thread overview]
Message-ID: <20150323084510.GL5664@pengutronix.de> (raw)
In-Reply-To: <1427099199-3628-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Hello Wolfram,
On Mon, Mar 23, 2015 at 09:26:37AM +0100, Wolfram Sang wrote:
> +Developer manual
> +========
> +
> +I2C slave events
> +----------------
> +
> +The bus driver sends an event to the backend using the following function:
> +
> + ret = i2c_slave_event(client, event, &val)
> +
> +'client' describes the i2c slave device. 'event' is one of the special event
> +types described hereafter. 'val' holds an u8 value for the data byte to be
> +read/written and is thus bidirectional. The pointer to val must always be
> +provided even if val is not used for an event, i.e. don't use NULL here. 'ret'
> +is the return value from the backend. Mandatory events must be provided by the
I don't understand why you want to force a valid pointer here. According
to my sense of defensive programming I'd say: If the bus driver doesn't
expect the slave to consume/provide a value, let's pass NULL to notice
the assumption being wrong. The wording is fine, now.
> diff --git a/Documentation/i2c/summary b/Documentation/i2c/summary
> index 13ab076dcd9248..809541ab352f03 100644
> --- a/Documentation/i2c/summary
> +++ b/Documentation/i2c/summary
> @@ -41,7 +41,3 @@ integrated than Algorithm and Adapter.
>
> For a given configuration, you will need a driver for your I2C bus, and
> drivers for your I2C devices (usually one driver for each device).
> -
> -At this time, Linux only operates I2C (or SMBus) in master mode; you can't
> -use these APIs to make a Linux system behave as a slave/device, either to
> -speak a custom protocol or to emulate some other device.
\o/
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2015-03-23 8:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 8:26 [PATCH v2 0/4] i2c: slave: API updates Wolfram Sang
2015-03-23 8:26 ` Wolfram Sang
2015-03-23 8:26 ` [PATCH v2 1/4] i2c: slave: rework the slave API Wolfram Sang
2015-03-23 8:26 ` Wolfram Sang
[not found] ` <1427099199-3628-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-23 8:26 ` [PATCH v2 2/4] Documentation: i2c: describe the new slave mode Wolfram Sang
2015-03-23 8:26 ` Wolfram Sang
[not found] ` <1427099199-3628-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-23 8:45 ` Uwe Kleine-König [this message]
2015-03-23 8:45 ` Uwe Kleine-König
[not found] ` <20150323084510.GL5664-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-23 9:04 ` Wolfram Sang
2015-03-23 9:04 ` Wolfram Sang
2015-04-01 12:17 ` Geert Uytterhoeven
2015-04-01 12:17 ` Geert Uytterhoeven
2015-04-02 3:38 ` Wolfram Sang
2015-04-02 3:38 ` Wolfram Sang
2015-03-23 8:26 ` [PATCH v2 3/4] i2c: slave: add documentation for i2c-slave-eeprom Wolfram Sang
2015-03-23 8:26 ` Wolfram Sang
2015-03-23 8:26 ` [PATCH v2 4/4] i2c: slave-eeprom: add more info when to increase the pointer Wolfram Sang
2015-03-23 8:26 ` Wolfram Sang
[not found] ` <1427099199-3628-5-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-23 8:32 ` Uwe Kleine-König
2015-03-23 8:32 ` Uwe Kleine-König
2015-03-27 8:55 ` [PATCH v2 0/4] i2c: slave: API updates Wolfram Sang
2015-03-27 8:55 ` 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=20150323084510.GL5664@pengutronix.de \
--to=u.kleine-koenig-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.