Thread (22 messages) 22 messages, 4 authors, 2015-02-17

Re: [PATCH 2/2] HID: i2c-hid: Add support for GPIO interrupts

From: Mark Rutland <mark.rutland@arm.com>
Date: 2015-01-27 15:06:34
Also in: lkml

On Tue, Jan 27, 2015 at 02:41:27PM +0000, Mika Westerberg wrote:
On Tue, Jan 27, 2015 at 02:33:34PM +0000, Mark Rutland wrote:
quoted
Ok, that allays my fear w.r.t. ordering of the resources.

As I see it, the fact that we convert GpioInt entries to GPIOs rather
than irqs when parsing _CRS is the issue here, and to me it makes no
sense that we do so. Were we to treat them as interrupts, the binding is
fine as-is, and we'd do the same thing in DT and ACPI.

The reason GpioInt is separate from GpioIo is that a GpioInt _is_ an
interrupt (which happens to be backed by a GPIO), and is not something
that necessarily makes sense as a GPIO.
I would rather say that GpioInt *is* a GPIO. That can then used as an
interrupt but it should not prevent you from using it as GPIO instead.
For example if you just want to poll that something is 0 or 1. That
should be possible as well and nothing say that you cannot do that for
GpioInt().
From my POV a GpioInt is logically an interrupt, or it would be a
GpioIo. That doesn't necessarily mean it's invalid to try to query its
state as a GPIO, but I do not think that it makes sense to handle it by
default as a GPIO given that it was handed to us as a GpioInt so that it
can be used as an interrupt.

If it's just the case that ACPI and DT differ w.r.t. how this case (an
interrupt line wired to a GPIO) is described, that in itself is fine;
different standards have different models.

However, I do not think we must change the DT binding and violate
established DT practice simply becuase on the ACPI side things are
different (nor would it make sense to do things the other way around).
If the two have different rules, then we should handle those rules
separately rather than trying to force the two together when they
clearly don't fit.

In the driver that can easily be achieved with separate probe paths.
W.R.T. the DT binding, I do not think it makes sense to pretend this
is also an ACPI binding.

Thanks,
Mark.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help