From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH v1 1/3] pinctrl: baytrail: Rectify debounce support (part 2)
Date: Fri, 27 Jan 2017 15:28:26 +0200 [thread overview]
Message-ID: <1485523706.2133.357.camel@linux.intel.com> (raw)
In-Reply-To: <20170127101405.5dd1a40c@endymion>
On Fri, 2017-01-27 at 10:14 +0100, Jean Delvare wrote:
> Hi Andy,
>
> On Thu, 26 Jan 2017 19:24:07 +0200, Andy Shevchenko wrote:
> > The commit 04ff5a095d66 ("pinctrl: baytrail: Rectify debounce
> > support")
> > almost fixes the logic of debuonce but missed couple of things, i.e.
> > typo in mask when disabling debounce and lack of enabling it back.
> >
> > This patch addresses above issues.
> >
> > Reported-by: Jean Delvare <jdelvare@suse.de>
> > Fixes: 04ff5a095d66 ("pinctrl: baytrail: Rectify debounce support")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > drivers/pinctrl/intel/pinctrl-baytrail.c | 12 ++++++++----
> > 1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c
> > b/drivers/pinctrl/intel/pinctrl-baytrail.c
> > index e696a01365cb..958db4f5ee9b 100644
> > --- a/drivers/pinctrl/intel/pinctrl-baytrail.c
> > +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
> > @@ -1243,10 +1243,12 @@ static int byt_pin_config_set(struct
> > pinctrl_dev *pctl_dev,
> > debounce = readl(db_reg);
> > debounce &= ~BYT_DEBOUNCE_PULSE_MASK;
> >
> > + if (arg)
> > + conf |= BYT_DEBOUNCE_EN;
> > + else
> > + conf &= ~BYT_DEBOUNCE_EN;
> > +
> > switch (arg) {
> > - case 0:
> > - conf &= BYT_DEBOUNCE_EN;
> > - break;
> > case 375:
> > debounce |=
> > BYT_DEBOUNCE_PULSE_375US;
> > break;
> > @@ -1269,7 +1271,9 @@ static int byt_pin_config_set(struct
> > pinctrl_dev *pctl_dev,
> > debounce |=
> > BYT_DEBOUNCE_PULSE_24MS;
> > break;
> > default:
> > - ret = -EINVAL;
> > + if (arg)
> > + ret = -EINVAL;
>
> Or you could keep the case 0: above. Makes the patch even smaller.
I would keep the way I put it here.
>
> > + break;
>
> That break isn't needed.
Same explanation as in patch 2.
>
> > }
> >
> > if (!ret)
>
> Looks good to me.
>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
Thanks!
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2017-01-27 13:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 17:24 [PATCH v1 0/3] pinctrl: baytrail: Fix debounce feature Andy Shevchenko
2017-01-26 17:24 ` [PATCH v1 1/3] pinctrl: baytrail: Rectify debounce support (part 2) Andy Shevchenko
2017-01-27 9:14 ` Jean Delvare
2017-01-27 13:28 ` Andy Shevchenko [this message]
2017-01-27 9:34 ` Mika Westerberg
2017-01-30 14:47 ` Linus Walleij
2017-01-26 17:24 ` [PATCH v1 2/3] pinctrl: baytrail: Debounce register is one per community Andy Shevchenko
2017-01-27 9:21 ` Jean Delvare
2017-01-27 13:27 ` Andy Shevchenko
2017-01-27 14:06 ` Jean Delvare
2017-01-27 9:35 ` Mika Westerberg
2017-01-30 14:49 ` Linus Walleij
2017-01-26 17:24 ` [PATCH v1 3/3] pinctrl: baytrail: Add debounce to debug output Andy Shevchenko
2017-01-27 9:40 ` Mika Westerberg
2017-01-27 10:07 ` Jean Delvare
2017-01-30 14:51 ` Linus Walleij
2017-01-30 15:13 ` Andy Shevchenko
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=1485523706.2133.357.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=jdelvare@suse.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/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).