lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Apr 2016 10:30:03 -0700
From:	Hongzhou Yang <hongzhou.yang@...iatek.com>
To:	Yingjoe Chen <yingjoe.chen@...iatek.com>
CC:	Linus Walleij <linus.walleij@...aro.org>,
	Matthias Brugger <matthias.bgg@...il.com>,
	<linux-gpio@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-mediatek@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <srv_heupstream@...iatek.com>,
	<djkurtz@...omium.org>
Subject: Re: [PATCH v2] pinctrl: mediatek: correct debounce time unit in
 mtk_gpio_set_debounce

On Sat, 2016-04-02 at 14:57 +0800, Yingjoe Chen 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. 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@...iatek.com>

Acked-by: Hongzhou Yang <hongzhou.yang@...iatek.com>

> ---
> This was based on v4.6-rc1
> Change since v1:
> - Improve commit message.
> - Change dbnc_arr name to debounce_time
> ---
>  drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 2bbe6f7..6ab8c3c 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 debounce_time[] = {500, 1000, 16000, 32000, 64000,
> +						128000, 256000};
>  	const struct mtk_desc_pin *pin;
>  	struct irq_data *d;
>  
> @@ -1022,9 +1023,9 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
>  	if (!mtk_eint_can_en_debounce(pctl, eint_num))
>  		return -ENOSYS;
>  
> -	dbnc = ARRAY_SIZE(dbnc_arr);
> -	for (i = 0; i < ARRAY_SIZE(dbnc_arr); i++) {
> -		if (debounce <= dbnc_arr[i]) {
> +	dbnc = ARRAY_SIZE(debounce_time);
> +	for (i = 0; i < ARRAY_SIZE(debounce_time); i++) {
> +		if (debounce <= debounce_time[i]) {
>  			dbnc = i;
>  			break;
>  		}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ