From: Jean Delvare <jdelvare@suse.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
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 10:14:05 +0100 [thread overview]
Message-ID: <20170127101405.5dd1a40c@endymion> (raw)
In-Reply-To: <20170126172409.132136-2-andriy.shevchenko@linux.intel.com>
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.
> + break;
That break isn't needed.
> }
>
> if (!ret)
Looks good to me.
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2017-01-27 9:14 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 [this message]
2017-01-27 13:28 ` Andy Shevchenko
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=20170127101405.5dd1a40c@endymion \
--to=jdelvare@suse.de \
--cc=andriy.shevchenko@linux.intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.