From: Wolfram Sang <wsa@the-dreams.de>
To: Ellen Wang <ellen@cumulusnetworks.com>
Cc: dbarksdale@uplogix.com, jkosina@suse.cz,
linux-input@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v1] HID: bug fixes in hid-cp2112 driver
Date: Wed, 22 Apr 2015 10:03:27 +0200 [thread overview]
Message-ID: <20150422080327.GG1511@katana> (raw)
In-Reply-To: <552F73A8.5060605@cumulusnetworks.com>
[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]
> >Well, at24 detects how many bytes it got and continues from there.
>
> That's true, but instead of returning short, the old
> cp2112_i2c_xfer() fails out (with EIO) when the first USB operation
> doesn't return all the bytes. Look for "short read: %d < %d" in
> the original version. That's just broken.
Yes.
> >This shows the drawback of having I2C master drivers not in the
> >i2c-directory: It easily misses updates to the i2c-core.
> >We now have the i2c-quirk infrastructure (2187f03a9576c4) which this
> >driver should make use of. It can describe this...
> >
> >>+ for (m = msgs; m < msgs + num; m++) {
> >>+ /*
> >>+ * If the top two messages are a write followed by a read,
> >>+ * then we do them together as CP2112_DATA_WRITE_READ_REQUEST.
> >>+ * Otherwise, process one message.
> >>+ */
> >>+
> >
> >and this and the core will check the messages for you. It should
> >simplify your code, too.
>
> I didn't know about that. Cumulus Linux is based on 3.2.something
> (debian wheezy) and i2c-quirk came in after that.
Well, actually, it came with this merge window :)
> I can update the driver to use the quirk mechanism, but I would
> prefer to do that as a separate checkin, so Cumulus can use
> a version of hid-cp2112.c that exists somewhere in mainline
> even if it's not the latest.
Fine with me if you do the i2c-quirk update as a seperate patch.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-04-22 8:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 0:22 [PATCH v1] HID: bug fixes in hid-cp2112 driver Ellen Wang
2015-04-16 7:41 ` Wolfram Sang
2015-04-16 8:32 ` Ellen Wang
2015-04-22 8:03 ` Wolfram Sang [this message]
2015-04-23 21:46 ` Ellen Wang
[not found] ` <5539681B.2030700-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2015-04-23 21:47 ` Jiri Kosina
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=20150422080327.GG1511@katana \
--to=wsa@the-dreams.de \
--cc=dbarksdale@uplogix.com \
--cc=ellen@cumulusnetworks.com \
--cc=jkosina@suse.cz \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-input@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).