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

2015-01-27 Thread Mika Westerberg
On Tue, Jan 27, 2015 at 03:57:47PM +, Mark Rutland wrote: > On Tue, Jan 27, 2015 at 03:21:27PM +, Mika Westerberg wrote: > > On Tue, Jan 27, 2015 at 03:06:06PM +, Mark Rutland wrote: > > > On Tue, Jan 27, 2015 at 02:41:27PM +, Mika Westerberg wrote: > > > > On Tue, Jan 27, 2015 at 0

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

2015-01-27 Thread Mark Rutland
On Tue, Jan 27, 2015 at 03:21:27PM +, Mika Westerberg wrote: > On Tue, Jan 27, 2015 at 03:06:06PM +, Mark Rutland wrote: > > On Tue, Jan 27, 2015 at 02:41:27PM +, Mika Westerberg wrote: > > > On Tue, Jan 27, 2015 at 02:33:34PM +, Mark Rutland wrote: > > > > Ok, that allays my fear w

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

2015-01-27 Thread Mika Westerberg
On Tue, Jan 27, 2015 at 03:06:06PM +, Mark Rutland wrote: > On Tue, Jan 27, 2015 at 02:41:27PM +, Mika Westerberg wrote: > > On Tue, Jan 27, 2015 at 02:33:34PM +, Mark Rutland wrote: > > > Ok, that allays my fear w.r.t. ordering of the resources. > > > > > > As I see it, the fact that

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

2015-01-27 Thread Mark Rutland
On Tue, Jan 27, 2015 at 02:41:27PM +, Mika Westerberg wrote: > On Tue, Jan 27, 2015 at 02:33:34PM +, Mark Rutland wrote: > > 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 _C

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

2015-01-27 Thread Mika Westerberg
On Tue, Jan 27, 2015 at 02:33:34PM +, Mark Rutland wrote: > 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

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

2015-01-27 Thread Mark Rutland
On Tue, Jan 27, 2015 at 11:30:41AM +, Mika Westerberg wrote: > On Tue, Jan 27, 2015 at 11:14:58AM +, Mark Rutland wrote: > > On Tue, Jan 27, 2015 at 10:59:31AM +, Mika Westerberg wrote: > > > On Tue, Jan 27, 2015 at 10:39:25AM +, Mark Rutland wrote: > > > > > If the above is not the

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

2015-01-27 Thread Mika Westerberg
On Tue, Jan 27, 2015 at 11:14:58AM +, Mark Rutland wrote: > On Tue, Jan 27, 2015 at 10:59:31AM +, Mika Westerberg wrote: > > On Tue, Jan 27, 2015 at 10:39:25AM +, Mark Rutland wrote: > > > > If the above is not the right way to use GPIOs as interrupt, can you > > > > please tell me how

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

2015-01-27 Thread Mark Rutland
On Tue, Jan 27, 2015 at 10:59:31AM +, Mika Westerberg wrote: > On Tue, Jan 27, 2015 at 10:39:25AM +, Mark Rutland wrote: > > > If the above is not the right way to use GPIOs as interrupt, can you > > > please tell me how it is done then? > > > > > > So lets say we have a device which gene

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

2015-01-27 Thread Mika Westerberg
On Tue, Jan 27, 2015 at 10:39:25AM +, Mark Rutland wrote: > > If the above is not the right way to use GPIOs as interrupt, can you > > please tell me how it is done then? > > > So lets say we have a device which generates an interrupt: > > device@f00 { > compatible = "som

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

2015-01-27 Thread Mark Rutland
On Tue, Jan 27, 2015 at 10:16:10AM +, Mika Westerberg wrote: > On Mon, Jan 26, 2015 at 04:39:30PM +, Mark Rutland wrote: > > What I don't follow is why GpioInt seems to be translated as a GPIO > > rather than as an interrupt which happens to be backed by a GPIO. Were > > it not for that, th

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

2015-01-27 Thread Mika Westerberg
On Mon, Jan 26, 2015 at 04:39:30PM +, Mark Rutland wrote: > What I don't follow is why GpioInt seems to be translated as a GPIO > rather than as an interrupt which happens to be backed by a GPIO. Were > it not for that, the DT and ACPI cases would align better. Because it *is* a GPIO. In my e

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

2015-01-26 Thread Mark Rutland
On Mon, Jan 26, 2015 at 04:13:56PM +, Mika Westerberg wrote: > On Mon, Jan 26, 2015 at 04:01:20PM +, Mark Rutland wrote: > > On Mon, Jan 26, 2015 at 03:16:37PM +, Mika Westerberg wrote: > > > On Mon, Jan 26, 2015 at 02:50:01PM +, Mark Rutland wrote: > > > > On Mon, Jan 26, 2015 at 0

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

2015-01-26 Thread Mika Westerberg
On Mon, Jan 26, 2015 at 04:01:20PM +, Mark Rutland wrote: > On Mon, Jan 26, 2015 at 03:16:37PM +, Mika Westerberg wrote: > > On Mon, Jan 26, 2015 at 02:50:01PM +, Mark Rutland wrote: > > > On Mon, Jan 26, 2015 at 02:47:29PM +, Mika Westerberg wrote: > > > > On Mon, Jan 26, 2015 at 0

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

2015-01-26 Thread Mark Rutland
On Mon, Jan 26, 2015 at 03:16:37PM +, Mika Westerberg wrote: > On Mon, Jan 26, 2015 at 02:50:01PM +, Mark Rutland wrote: > > On Mon, Jan 26, 2015 at 02:47:29PM +, Mika Westerberg wrote: > > > On Mon, Jan 26, 2015 at 02:37:24PM +, Mark Rutland wrote: > > > > On Mon, Jan 26, 2015 at 0

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

2015-01-26 Thread Mika Westerberg
On Mon, Jan 26, 2015 at 02:50:01PM +, Mark Rutland wrote: > On Mon, Jan 26, 2015 at 02:47:29PM +, Mika Westerberg wrote: > > On Mon, Jan 26, 2015 at 02:37:24PM +, Mark Rutland wrote: > > > On Mon, Jan 26, 2015 at 02:29:33PM +, Mika Westerberg wrote: > > > > The HID over I2C specific

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

2015-01-26 Thread Mark Rutland
On Mon, Jan 26, 2015 at 02:47:29PM +, Mika Westerberg wrote: > On Mon, Jan 26, 2015 at 02:37:24PM +, Mark Rutland wrote: > > On Mon, Jan 26, 2015 at 02:29:33PM +, Mika Westerberg wrote: > > > The HID over I2C specification allows to have the interrupt for a HID > > > device to be GPIO i

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

2015-01-26 Thread Mika Westerberg
On Mon, Jan 26, 2015 at 02:37:24PM +, Mark Rutland wrote: > On Mon, Jan 26, 2015 at 02:29:33PM +, Mika Westerberg wrote: > > The HID over I2C specification allows to have the interrupt for a HID > > device to be GPIO instead of directly connected to the IO-APIC. > > > > Add support for thi

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

2015-01-26 Thread Mark Rutland
On Mon, Jan 26, 2015 at 02:29:33PM +, Mika Westerberg wrote: > The HID over I2C specification allows to have the interrupt for a HID > device to be GPIO instead of directly connected to the IO-APIC. > > Add support for this so that when the driver does not find proper interrupt > number from t

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

2015-01-26 Thread Mika Westerberg
The HID over I2C specification allows to have the interrupt for a HID device to be GPIO instead of directly connected to the IO-APIC. Add support for this so that when the driver does not find proper interrupt number from the I2C client structure we check if the device has property named "gpios".