From: danilokrummrich@dk-develop.de
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
linus.walleij@linaro.org, rdunlap@infradead.org
Subject: Re: [PATCH v3] serio: PS/2 gpio bit banging driver for the serio bus
Date: Tue, 01 Aug 2017 21:23:39 +0200 [thread overview]
Message-ID: <799c588b3be59d13cfaf508440704db9@dk-develop.de> (raw)
In-Reply-To: <20170801190744.GD28401@dtor-ws>
On 2017-08-01 21:07, Dmitry Torokhov wrote:
> On Tue, Aug 01, 2017 at 08:51:40PM +0200, danilokrummrich@dk-develop.de
> wrote:
>> On 2017-08-01 19:32, Dmitry Torokhov wrote:
>> >On Tue, Aug 01, 2017 at 06:26:14AM +0200, Danilo Krummrich wrote:
>> >>+ irq = gpio_to_irq(drvdata->gpio_clk);
>> >>+ if (!irq) {
>> >>+ dev_err(dev, "cannot get irq from gpio %u\n",
>> >>+ drvdata->gpio_clk);
>> >>+ error = -ENXIO;
>> >>+ goto err_free_serio;
>> >>+ }
>> >
>> >
>> >IRQ line does not have to be the same as GPIO pin. Describe it
>> >separately in device properties and just do:
>> >
>> > irq = platform_get_irq(pdev, 0);
>> >
>> >and use it in the request below.
>> >
>> In which constellation can they be different?
>
> IIRC there are controllers that may not let you re-configure GPIO that
> is reserved for interrupt, for output. So you could have a bit of
> hardware logic that splits and isolates GPIO and interrupt line.
>
> Also have the trigger come from the interrupt description as well in
> case you happen to have inverter logic there.
>
Thanks for clarification, didn't knew that. So,I will take this in
advance.
>> >>+
>> >>+ error = devm_request_irq(dev, irq, ps2_gpio_irq, IRQF_NO_THREAD |
>> >>+ IRQF_TRIGGER_FALLING, DRIVER_NAME, drvdata);
>> >
>> >This will not work if GPIO is behind I2C or other slow bus. Is it
>> >essential that there is no scheduling delay here?
>> >
>> Yes it is. You are right, this wouldn't work. Was this the scenario
>> you had in mind while
>> writing the comment above?
>
> No, that was just a general comment about GPIO on slow busses. You
> might
> need to check gpiod_can_sleep() and abort driver load if gpio is
> sleeping.
>
Yes, I will do so.
> Thanks.
next prev parent reply other threads:[~2017-08-01 19:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 4:26 [PATCH v3] serio: PS/2 gpio bit banging driver for the serio bus Danilo Krummrich
2017-08-01 17:32 ` Dmitry Torokhov
2017-08-01 18:51 ` danilokrummrich
2017-08-01 19:07 ` Dmitry Torokhov
2017-08-01 19:23 ` danilokrummrich [this message]
2017-08-03 16:26 ` kbuild test robot
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=799c588b3be59d13cfaf508440704db9@dk-develop.de \
--to=danilokrummrich@dk-develop.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.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