From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
To: Benjamin Tissoires
<benjamin.tissoires-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
Dmitry Torokhov
<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] i2c: i801: add support of Host Notify
Date: Tue, 7 Jul 2015 23:00:19 +0200 [thread overview]
Message-ID: <20150707230019.5d70c26a@endymion.delvare> (raw)
In-Reply-To: <20150707201638.GK18484-/m+UfqrgI5QNLKR9yMNcA1aTQe2KTcn/@public.gmane.org>
On Tue, 7 Jul 2015 16:16:38 -0400, Benjamin Tissoires wrote:
> On Jul 07 2015 or thereabouts, Jean Delvare wrote:
> > So you use the same driver callback for SMBus Alert and SMBus Host
> > Notify. This makes some sense, but if a given driver supports both, how
> > does it know which event happened? The data is completely different and
> > most probably the action required from the driver as well.
>
> Yeah, this gets messy. I re-used the .alert() callback because of the
> documentation: "Alert callback, for example for the SMBus alert protocol".
> It would seem that the alert is generic and could be re-used. But OTOH,
> it is not prepared to receive anything else than a SMBus Alert.
>
> Given that I had a toggle_host_notify() call, I figured that this was
> not a problem unless you write a driver which implements both (I can not
> find a sane use case for this though).
>
> But now that this call has disappeared, we would need a way to
> differentiate the too of them.
>
> I can see two solutions out of my head right now:
> - add a "protocol" parameter (with an enum) to .alert()
> - add a new callback .host_notify() in struct i2c_driver.
I came to the same conclusion.
> I think I like the second option more given that it will allow to not
> touch the current code in i2c_smbus.
No strong preference so do it the way you prefer.
Thanks,
--
Jean Delvare
SUSE L3 Support
prev parent reply other threads:[~2015-07-07 21:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 18:58 [PATCH 0/2] I2C/SMBus: add support for Host Notify in i2c_i801 Benjamin Tissoires
2015-06-23 18:58 ` [PATCH 1/2] i2c: add SMBus Host Notify support Benjamin Tissoires
[not found] ` <1435085899-11017-2-git-send-email-benjamin.tissoires-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-29 13:00 ` Jean Delvare
[not found] ` <20150629150035.4c027502-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-07-07 14:23 ` Benjamin Tissoires
[not found] ` <20150707142333.GC18484-/m+UfqrgI5QNLKR9yMNcA1aTQe2KTcn/@public.gmane.org>
2015-07-07 17:40 ` Jean Delvare
2015-07-07 19:58 ` Benjamin Tissoires
[not found] ` <1435085899-11017-1-git-send-email-benjamin.tissoires-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-23 18:58 ` [PATCH 2/2] i2c: i801: add support of Host Notify Benjamin Tissoires
[not found] ` <1435085899-11017-3-git-send-email-benjamin.tissoires-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-07 18:11 ` Jean Delvare
2015-07-07 20:16 ` Benjamin Tissoires
[not found] ` <20150707201638.GK18484-/m+UfqrgI5QNLKR9yMNcA1aTQe2KTcn/@public.gmane.org>
2015-07-07 21:00 ` Jean Delvare [this message]
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=20150707230019.5d70c26a@endymion.delvare \
--to=jdelvare-l3a5bk7wagm@public.gmane.org \
--cc=benjamin.tissoires-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox