2012-02-06 08:10:58

by Ashish Jangam

[permalink] [raw]
Subject: Re: [PATCH 07/07] ONKEY: OnKey module for DA9052/53 PMIC v1

On Fri, 2012-02-03 at 19:33 +0530, Ashish Jangam wrote:
> > > 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.
>
> You're once more completely missing my point. You've got a
> conditional which detects if the button is pressed in which you set a
> flag which is checked later to see if you should also schedule the
> work. Since the only thing that ever sets that flag is the button
> being pressed having the flag seems pointless, you may as well just
> schedule the work instead of setting the flag.
Do you meant to have something like below
if(..) {
} else {
ret = ret & DA9052_EVENTB_ENONKEY;
input_report_key(.., ret);
...
schedule_delayed_work(..);
}
/*
if(ret)
schedule_delayed_work(..);
*/
but this turns out to be a for ever loop.


2012-02-06 11:19:08

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 07/07] ONKEY: OnKey module for DA9052/53 PMIC v1

On Mon, Feb 06, 2012 at 01:32:17PM +0530, Ashish Jangam wrote:

> Do you meant to have something like below
> if(..) {
> } else {
> ret = ret & DA9052_EVENTB_ENONKEY;
> input_report_key(.., ret);
> ...
> schedule_delayed_work(..);
> }
> /*
> if(ret)
> schedule_delayed_work(..);
> */
> but this turns out to be a for ever loop.

No, clearly that would be silly.


Attachments:
(No filename) (370.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments