From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <Pawel.Moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] HID: i2c-hid: Add support for GPIO interrupts
Date: Tue, 27 Jan 2015 12:16:10 +0200 [thread overview]
Message-ID: <20150127101610.GK1451@lahna.fi.intel.com> (raw)
In-Reply-To: <20150126163929.GL23313@leverpostej>
On Mon, Jan 26, 2015 at 04:39:30PM +0000, 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 experience we have had two kinds of interrupts that the devices
are connected to: pins connected directly to the interrupt controller
(IO-APIC or whatever), and pins connected to the GPIO controller. This
is the later.
Now, the device in question has following resources:
Name (_CRS, ResourceTemplate () {
I2cSerialBus (0x004C, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.PCI0.I2C6",
0x00, ResourceConsumer,,)
GpioInt (Level, ActiveLow, Shared, PullDefault, 0x0000,
"\\_SB.GPO0", 0x00, ResourceConsumer,,)
{
0x004C
}
})
The GpioInt() above refers to GPIO controller ("\_SB.GPO0") and its pin
number 0x4c.
Normally I would do this in the driver regardless of where it is
described (DT, ACPI, whatnot):
desc = gpiod_get(dev, NULL);
gpiod_direction_input(desc);
irq = gpiod_to_irq(desc);
Then the "irq" can be used for request_irq() and friends.
Note how both DT and ACPI cases align just fine.
If the above is not the right way to use GPIOs as interrupt, can you
please tell me how it is done then?
BTW, passing NULL to gpiod_get() implies property named "gpios" in DT
(which is why I added it to the documentation).
next prev parent reply other threads:[~2015-01-27 10:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 14:29 [PATCH 1/2] HID: i2c-hid: The interrupt should be level sensitive Mika Westerberg
2015-01-26 14:29 ` [PATCH 2/2] HID: i2c-hid: Add support for GPIO interrupts Mika Westerberg
2015-01-26 14:37 ` Mark Rutland
2015-01-26 14:47 ` Mika Westerberg
2015-01-26 14:50 ` Mark Rutland
2015-01-26 15:16 ` Mika Westerberg
2015-01-26 16:01 ` Mark Rutland
2015-01-26 16:13 ` Mika Westerberg
2015-01-26 16:39 ` Mark Rutland
2015-01-27 10:16 ` Mika Westerberg [this message]
2015-01-27 10:39 ` Mark Rutland
2015-01-27 10:59 ` Mika Westerberg
2015-01-27 11:14 ` Mark Rutland
2015-01-27 11:30 ` Mika Westerberg
2015-01-27 14:33 ` Mark Rutland
2015-01-27 14:41 ` Mika Westerberg
2015-01-27 15:06 ` Mark Rutland
2015-01-27 15:21 ` Mika Westerberg
2015-01-27 15:57 ` Mark Rutland
2015-01-27 17:10 ` Mika Westerberg
2015-01-29 20:09 ` [PATCH 1/2] HID: i2c-hid: The interrupt should be level sensitive Benjamin Tissoires
2015-02-17 12:24 ` Jiri Kosina
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=20150127101610.GK1451@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=Pawel.Moll@arm.com \
--cc=benjamin.tissoires@redhat.com \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jarkko.nikula@linux.intel.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.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