[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfZ+-rJFWVpowXyViA99_9tA5VaFLfJGH1WF4W=kQHr8w@mail.gmail.com>
Date: Mon, 26 Oct 2020 17:22:45 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Coiby Xu <coiby.xu@...il.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Hans de Goede <hdegoede@...hat.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] pinctrl: amd: print debounce filter info in debugfs
On Mon, Oct 26, 2020 at 5:16 PM Coiby Xu <coiby.xu@...il.com> wrote:
>
> Print the status of debounce filter as follows,
> $ cat /sys/kernel/debug/gpio
> pin129 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state|
> disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| debouncing filter disabled| 0x50000
> pin130 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state|
> disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| debouncing filter (high) enabled| debouncing timeout is 124800 (us)| 0x503c8
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thanks for an update!
In general looks good, one nit below (sorry, missed it in v1 round)
...
> + char debounce_value[40];
(1)
...
> + if (tmr_large) {
> + if (tmr_out_unit)
> + unit = 62500;
> + else
> + unit = 15600;
Side note: Hmm... Shouldn't be 15625? As 1/4.
> + } else {
> + if (tmr_out_unit)
> + unit = 244;
> + else
> + unit = 61;
...
> + snprintf(debounce_value, 40,
> + "debouncing timeout is %u (us)|", time * unit);
(2)
...
> + snprintf(debounce_value, 40, " ");
(3)
Because of definition (1) can you in (2) and (3) use sizeof() ?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists