From: Wolfram Sang <wsa@the-dreams.de>
To: Antonio Borneo <borneo.antonio@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Jiri Kosina <jkosina@suse.cz>,
linux-input <linux-input@vger.kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH] hid: cp2112: support i2c_transfer() when num > 1
Date: Sun, 15 Mar 2015 15:27:59 +0100 [thread overview]
Message-ID: <20150315142759.GA22313@katana> (raw)
In-Reply-To: <CAAj6DX0cXWHGV-=x0WfoSrXLVTEiNf+Vfj0HDOf4x4NC6Ny=tg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]
> >> 1) in few kernel drivers i2c_transfer() has been used to
> >> simplify the code by replacing a sequence of i2c_master_send()
> >> and i2c_master_recv(), e.g. in i2c-hid.c and iio subsystem.
> >> Those drivers will fail if used with current cp2112 driver.
> >
> > I see two options for those:
> >
> > 1) revert the simplifications and sacrifice a bit of performance
> > to support the widest number of adapters
> > 2) use the quirk infrastructure from above to query the
> > quirks of the adapter to chose between fast or compatible
>
> Could this be an extension of your quirks?
> I mean, moving in i2c-core the switch between fast or compatible?
> The caller should only state if combined transfer is strictly required
> by the device on I2C bus.
I'd first need some arguments that this is not micro-optimization :)
> I have check most of the I2C adapter drivers. At least for the 6
> drivers above, reading the code I don't see anything that implements
> the repeated start. But I do not have the HW to run a test.
> It's definitively possible I misread them.
I can't guarantee this in detail. The qup driver is quite new, so I am
quite sure I asked for that. However, I don't know for the USB drivers,
I have to trust the driver authors. puv3? Predates me, uh, let's not
talk about it... The main thing still stands: If they send stop after
each msg, this is a bug.
> >> To fix 1) and considering 2), rewrite i2c_transfer() in case
> >> of num > 1 as a loop of non-combined i2c transactions.
> >
> > For the above reasons, NAK.
>
> Ok, agree to drop this patch.
Thanks.
> > And why is this driver in hid? This is clearly an I2C master driver?
>
> Actually it should be a MFD, since it implements I2C/SMB master and GPIO.
> It uses HID over USB, that is probably the reason it is here.
Yup, from what I glimpsed, it should really be an MFD driver.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-03-15 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-15 11:43 [PATCH] hid: cp2112: support i2c_transfer() when num > 1 Antonio Borneo
[not found] ` <1426419798-25360-1-git-send-email-borneo.antonio-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-15 12:10 ` Wolfram Sang
2015-03-15 13:23 ` Antonio Borneo
2015-03-15 14:27 ` Wolfram Sang [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=20150315142759.GA22313@katana \
--to=wsa@the-dreams.de \
--cc=benjamin.tissoires@redhat.com \
--cc=borneo.antonio@gmail.com \
--cc=jic23@kernel.org \
--cc=jkosina@suse.cz \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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).