linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>,
	Henrik Rydberg <rydberg@euromail.se>,
	Mohan Pallaka <mpallaka@codeaurora.org>,
	Kevin McNeely <kev@cypress.com>,
	Shubhrajyoti Datta <omaplinuxkernel@gmail.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v9 1/3] Input: cyttsp - Cypress TTSP capacitive multi-touch screen support
Date: Wed, 18 Jan 2012 09:47:23 -0800	[thread overview]
Message-ID: <20120118174722.GA9022@core.coreip.homeip.net> (raw)
In-Reply-To: <CAAwP0s1VGAe0q5cZ=DVRABP46RpfuJ=+Z-EQaNVZe0xnhDXqLw@mail.gmail.com>

On Wed, Jan 18, 2012 at 11:35:28AM +0100, Javier Martinez Canillas wrote:
> On Wed, Jan 18, 2012 at 10:20 AM, Javier Martinez Canillas
> <martinez.javier@gmail.com> wrote:
> > On Wed, Jan 18, 2012 at 10:12 AM, Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> >> Hi Javier,
> >>
> >> On Sat, Jan 14, 2012 at 03:32:51AM +0100, Javier Martinez Canillas wrote:
> >>> +
> >>> +static int __cyttsp_disable(struct cyttsp *ts)
> >>> +{
> >>> +     u8 sleep_mode = 0;
> >>> +     int retval = 0;
> >>> +
> >>> +     if (ts->pdata->use_sleep && ts->power_state == CY_ACTIVE_STATE) {
> >>> +             sleep_mode = ts->pdata->use_sleep;
> >>> +             retval = ttsp_write_block_data(ts, CY_REG_BASE,
> >>> +                                            sizeof(sleep_mode), &sleep_mode);
> >>> +             if (retval >= 0) {
> >>> +                     ts->power_state = CY_SLEEP_STATE;
> >>> +                     disable_irq(ts->irq);
> >>> +             }
> >>
> >> I thought we agreed that we should put the device to sleep
> >> unconditionally and not have use_sleep option?
> >
> > Yes, we did. Sorry, I've missed that. I'll change it and resend.
> >
> >>
> >> Thanks.
> >>
> >> --
> >> Dmitry
> >> --
> 
> Thanks Dmitry for the review.
> 
> Any more issues you have found? So I can fix all of them for the next
> version of the patch.

I am still not quite happy with the flow of power_on function. Maybe you
should fold cyttsp_bl_app_valid() into it to avoid dealing with negative,
0 and 1 return codes. If you also pull printing of the status out of it
and into cyttsp_open() you'll be able to do early returns and avoid
Fortran-style control flow of gotos.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-01-18 17:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14  2:32 [PATCH v9 1/3] Input: cyttsp - Cypress TTSP capacitive multi-touch screen support Javier Martinez Canillas
2012-01-14  2:32 ` [PATCH v9 2/3] Input: cyttsp - add support for Cypress TTSP touchscreen I2C bus interface Javier Martinez Canillas
2012-01-14  2:32 ` [PATCH v9 3/3] Input: cyttsp - add support for Cypress TTSP touchscreen SPI " Javier Martinez Canillas
2012-01-16 13:14 ` [PATCH v9 1/3] Input: cyttsp - Cypress TTSP capacitive multi-touch screen support Henrik Rydberg
2012-01-16 22:28   ` Javier Martinez Canillas
2012-01-18  7:02   ` Javier Martinez Canillas
2012-01-18  9:12 ` Dmitry Torokhov
2012-01-18  9:20   ` Javier Martinez Canillas
2012-01-18 10:35     ` Javier Martinez Canillas
2012-01-18 17:47       ` Dmitry Torokhov [this message]
2012-01-18 21:35         ` Javier Martinez Canillas

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=20120118174722.GA9022@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=javier@dowhile0.org \
    --cc=kev@cypress.com \
    --cc=linux-input@vger.kernel.org \
    --cc=martinez.javier@gmail.com \
    --cc=mpallaka@codeaurora.org \
    --cc=omaplinuxkernel@gmail.com \
    --cc=rydberg@euromail.se \
    /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).