From: Linus Walleij <linus.walleij@linaro.org>
To: Alexandre Courbot <gnurou@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Balaji T K <balajitk@ti.com>,
linux-mmc <linux-mmc@vger.kernel.org>,
Chris Ball <chris@printf.net>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH] mmc: core: Add DT bindings for card detect debounce time
Date: Mon, 7 Jul 2014 17:12:47 +0200 [thread overview]
Message-ID: <CACRpkda7s_AgPx4a6qu2=FGhfoPyJiZBCJDbd9iWL5qE3DPtXQ@mail.gmail.com> (raw)
In-Reply-To: <CAAVeFu+CW0DSbqc6k145APao2r907sAyMw0+W=hQXxO6LoQx-g@mail.gmail.com>
On Sat, Jun 21, 2014 at 9:22 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
>> I have added Linus Walleij and Alexandre Courbot, the maintainers of
>> gpio. Let's see if they can point us in a direction.
>
> I agree it would be nice if the debounce value could be handled by the
> GPIO framework.
I agree too.
> I just wonder what would be the correct way of doing
> it? Contrary to ACTIVE_LOW and other flags which can be specified with
> the GPIO phandle, debounce is a numeric value. Maybe using a different
> property, e.g.:
>
> cd-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
> cd-gpios-debounce = <10>;
>
> When looking up a GPIO through gpiod_get(), the GPIO framework could
> then check for -debounce property and set the debounce time
> accordingly. At first sight I'd say that would work and could be used
> for MMC and all other subsystems that need something similar.
Yes, but we also need to write generic debounce handling into
the gpiolib, so it doesn't matter if the GPIO driver can or cannot
handle this itself. Some hardware has the capability to debounce
lines in *hardware*.
Right now a call to gpiod_set_debounce() will fail unless the
hardware has a debounce option.
What we should really do is make gpiod_set_debounce() always
work, put the debounce value into the gpio_desc, and move some
logic similar to what exists in drivers/input/keyboard/gpio_keys.c
into the gpiolib, then get rid of any local implementations like
in gpio_keys.
Then we can rely on the gpiolib handling this at all times, and also
to get the debounce config from DT.
Dmitry, opinions on this?
Anyone up for implementing the timer in gpiolib and moving the
keyboard driver over to using the gpiolib debounce set?
Yours,
Linus Walleij
next prev parent reply other threads:[~2014-07-07 15:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 15:37 [PATCH] mmc: core: Add DT bindings for card detect debounce time Balaji T K
2014-06-18 13:04 ` Balaji T K
2014-06-18 13:47 ` Ulf Hansson
2014-06-21 7:22 ` Alexandre Courbot
2014-07-07 15:12 ` Linus Walleij [this message]
2014-07-07 16:59 ` Dmitry Torokhov
2014-07-09 12:28 ` Alexandre Courbot
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='CACRpkda7s_AgPx4a6qu2=FGhfoPyJiZBCJDbd9iWL5qE3DPtXQ@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=balajitk@ti.com \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gnurou@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/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).