From: Grant Likely <grant.likely@secretlab.ca>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [RFC PATCH] input: Add wiichuck driver
Date: Mon, 16 May 2011 15:01:49 -0600 [thread overview]
Message-ID: <BANLkTikKPZwYWeMGsU+F0TJGa+1TCbp84g@mail.gmail.com> (raw)
In-Reply-To: <20110516194401.GB18110@core.coreip.homeip.net>
On Mon, May 16, 2011 at 1:44 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Mon, May 16, 2011 at 12:31:24PM -0600, Grant Likely wrote:
>> > > + struct i2c_msg data_msg =
>> > > + { .addr = i2c->addr, .flags = I2C_M_RD, .len = 6, .buf = b };
>> > > + int jx, jy, ax, ay, az;
>> > > + bool c, z;
>> > > +
>> > > + switch (wiichuck->state) {
>> > > + case 0:
>> > > + i2c_transfer(i2c->adapter, &cmd_msg, 1);
>> > > + wiichuck->state = 1;
>> >
>> > Do you really need to have a state machine here? Why not do both
>> > transfers in one poll invocation?
>>
>> Mostly because there needs to a gap between setting up the data
>> capture and reading the data back.
>
> How long is the gap? You should be able simply sleep in the poll().
50ms (from what information I've been able to gleen; it might be
faster). Since I'm already polling the controller at 100ms, a 50ms
sleep in the poll routine would pretty much completely consume the
workqueue if 2 or more wii extension devices were attached to the
system. Voluntarily giving it up is the right thing to do.
That said, the problem is moot since I've modified the read state to
setup the next transfer immediately after reading the data. :-)
Revised patch posted shortly...
g.
prev parent reply other threads:[~2011-05-16 21:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 4:29 Grant Likely
2011-05-12 6:24 ` simon
2011-05-15 21:17 ` Grant Likely
2011-05-14 19:17 ` Oliver Neukum
2011-05-14 19:20 ` Grant Likely
2011-05-16 16:44 ` Dmitry Torokhov
2011-05-16 18:31 ` Grant Likely
2011-05-16 19:44 ` Dmitry Torokhov
2011-05-16 21:01 ` Grant Likely [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=BANLkTikKPZwYWeMGsU+F0TJGa+1TCbp84g@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=dmitry.torokhov@gmail.com \
--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
all inboxes | Powered by JetHome®