From: Ashish Jangam <ashish.jangam@kpitcummins.com>
To: <broonie@opensource.wolfsonmicro.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 07/07] ONKEY: OnKey module for DA9052/53 PMIC v1
Date: Fri, 3 Feb 2012 18:54:06 +0530 [thread overview]
Message-ID: <1328275446.19234.127.camel@dhruva> (raw)
In-Reply-To: <C3AE124F08223B42BC95AEB82F0F6CED1FDDA575@KCHJEXMB02.kpit.com>
On Fri, 2012-02-03 at 17:28 +0530, Ashish Jangam wrote:
>
> On Wed, Feb 01, 2012 at 01:58:55PM +0530, Ashish Jangam wrote:
> > On Wed, 2012-02-01 at 13:30 +0530, Ashish Jangam wrote:
>
> > > > + ret = da9052_reg_read(onkey->da9052, DA9052_EVENT_B_REG);
> > > > + if (ret < 0) {
> > > > + dev_err(onkey->da9052->dev,
> > > > + "da9052_onkey_report_event da9052_reg_read error %d\n",
> > > > + ret);
> > > > + ret = 1;
> > > > + } else {
> > > > + ret = ret & DA9052_EVENTB_ENONKEY;
> > > > + input_report_key(onkey->input, KEY_POWER, ret);
> > > > + input_sync(onkey->input);
> > > > + }
>
> > > > + if (ret)
> > > > + schedule_delayed_work(&onkey->work, msecs_to_jiffies(50));
>
> > > Why not just schedule the work directly? The use of ret took a bit
> > > of thinking about to follow.
>
> > schedule_dealyed_work simulates the release of the onkey button since
> > event for release is not generated and ret & DA9052_EVENTB_ENONKEY is
> > used to determine the release
>
> That doesn't seem to address the concern. You're setting ret in exactly one place
> and scheduling the work in exactly one place, why are these two things split?
schedule_delayed_work() is conditional because it should get invoke when onkey button is
pressed and not when released. For this reason onkey event is first queried and work is
scheduled only when event is present. Now when work is scheduled, onkey event gets
queried and in absence of the onkey event work will not get schedule again. By this logic I'm able
to simulated the release of the onkey button.
next parent reply other threads:[~2012-02-03 13:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <C3AE124F08223B42BC95AEB82F0F6CED1FDDA575@KCHJEXMB02.kpit.com>
2012-02-03 13:24 ` Ashish Jangam [this message]
2012-02-03 13:52 ` [PATCH 07/07] ONKEY: OnKey module for DA9052/53 PMIC v1 Mark Brown
[not found] <C3AE124F08223B42BC95AEB82F0F6CED1FDDA5AA@KCHJEXMB02.kpit.com>
2012-02-06 8:02 ` Ashish Jangam
2012-02-06 11:19 ` Mark Brown
[not found] <C3AE124F08223B42BC95AEB82F0F6CED1FDDA3ED@KCHJEXMB02.kpit.com>
2012-02-01 8:28 ` Ashish Jangam
2012-02-01 9:50 ` Mark Brown
2012-01-17 13:29 Ashish Jangam
2012-01-17 19:55 ` Mark Brown
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=1328275446.19234.127.camel@dhruva \
--to=ashish.jangam@kpitcummins.com \
--cc=broonie@opensource.wolfsonmicro.com \
--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