Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1369333 > unrolled thread

[PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce

Started byYingjoe Chen <yingjoe.chen@mediatek.com>
First post2016-04-01 16:00 +0200
Last post2016-04-01 16:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce Yingjoe Chen <yingjoe.chen@mediatek.com> - 2016-04-01 16:00 +0200
    Re: [PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce Daniel Kurtz <djkurtz@chromium.org> - 2016-04-01 16:30 +0200
      Re: [PATCH] pinctrl: mediatek: correct debounce time unit in  mtk_gpio_set_debounce Yingjoe Chen <yingjoe.chen@mediatek.com> - 2016-04-01 16:40 +0200

#1369333 — [PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2016-04-01 16:00 +0200
Subject[PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce
Message-ID<rj7Me-56S-7@gated-at.bofh.it>
The debounce time unit for gpio_chip.set_debounce is us but
mtk_gpio_set_debounce regard it as ms.
Fix this by correct debounce time array dbnc_arr so it can find correct
debounce setting.

Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 2bbe6f7..be72325 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -1004,7 +1004,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
 	struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
 	int eint_num, virq, eint_offset;
 	unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
-	static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256};
+	static const unsigned int dbnc_arr[] = {500, 1000, 16000, 32000, 64000,
+						128000, 256000};
 	const struct mtk_desc_pin *pin;
 	struct irq_data *d;
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1369377

FromDaniel Kurtz <djkurtz@chromium.org>
Date2016-04-01 16:30 +0200
Message-ID<rj8fh-5EH-45@gated-at.bofh.it>
In reply to#1369333
Hi Yingjoe,

On Fri, Apr 1, 2016 at 9:51 PM, Yingjoe Chen <yingjoe.chen@mediatek.com> wrote:
> The debounce time unit for gpio_chip.set_debounce is us but
> mtk_gpio_set_debounce regard it as ms.
> Fix this by correct debounce time array dbnc_arr so it can find correct
> debounce setting.

This patch also changes the first entry to 500 usec.  At least mention why.

>
> Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
> ---
>  drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 2bbe6f7..be72325 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -1004,7 +1004,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
>         struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
>         int eint_num, virq, eint_offset;
>         unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
> -       static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256};
> +       static const unsigned int dbnc_arr[] = {500, 1000, 16000, 32000, 64000,
> +                                               128000, 256000};

While you are at it, can you please rename this to something more
readable than "dbnc"?

-Dan

>         const struct mtk_desc_pin *pin;
>         struct irq_data *d;
>
> --
> 1.9.1
>

[toc] | [prev] | [next] | [standalone]


#1369390 — Re: [PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2016-04-01 16:40 +0200
SubjectRe: [PATCH] pinctrl: mediatek: correct debounce time unit in mtk_gpio_set_debounce
Message-ID<rj8oX-5Jd-27@gated-at.bofh.it>
In reply to#1369377
Daniel,

Thanks for your review.

On Fri, 2016-04-01 at 22:28 +0800, Daniel Kurtz wrote:
> Hi Yingjoe,
> 
> On Fri, Apr 1, 2016 at 9:51 PM, Yingjoe Chen <yingjoe.chen@mediatek.com> wrote:
> > The debounce time unit for gpio_chip.set_debounce is us but
> > mtk_gpio_set_debounce regard it as ms.
> > Fix this by correct debounce time array dbnc_arr so it can find correct
> > debounce setting.
> 
> This patch also changes the first entry to 500 usec.  At least mention why.
> 

OK. Will add this:

Debounce time for first debounce setting is 500us, correct this as well.

While I'm at it, also change the debounce time array name to
"debounce_time" for readability.


> >
> > Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
> > ---
> >  drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > index 2bbe6f7..be72325 100644
> > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> > @@ -1004,7 +1004,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
> >         struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
> >         int eint_num, virq, eint_offset;
> >         unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
> > -       static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256};
> > +       static const unsigned int dbnc_arr[] = {500, 1000, 16000, 32000, 64000,
> > +                                               128000, 256000};
> 
> While you are at it, can you please rename this to something more
> readable than "dbnc"?


Will change to debounce_time.

Joe.C

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web