linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using a GPIO as an interrupt line
@ 2019-11-19  9:28 Marc Gonzalez
  2019-11-19  9:57 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 11+ messages in thread
From: Marc Gonzalez @ 2019-11-19  9:28 UTC (permalink / raw)
  To: GPIO, MSM, Linux ARM; +Cc: Linus Walleij, Marc Zyngier

Hello,

The board I'm working on provides a TCA9539 I/O expander.
Or, as the datasheet(*) calls it, a "Low Voltage 16-Bit I2C and
SMBus Low-Power I/O Expander with Interrupt Output, Reset Pin,
and Configuration Registers"

(*) http://www.ti.com/lit/ds/symlink/tca9539.pdf

The binding is documented in Documentation/devicetree/bindings/gpio/gpio-pca953x.txt

I have some doubts about the interrupt output, described as:

Optional properties:
 - interrupts: interrupt specifier for the device's interrupt output.

In my board's DT, the I/O expander is described as:

	exp1: gpio@74 {
		compatible = "ti,tca9539";
		reg = <0x74>;
		gpio-controller;
		#gpio-cells = <2>;
		reset-gpios = <&tlmm 96 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&top_exp_rst>;
		interrupt-parent = <&tlmm>;
		interrupts = <42 IRQ_TYPE_LEVEL_HIGH>;
	};


("tlmm" is a pinctrl for qualcomm SoCs.)

The problem with this DT node is that nowhere have I specified that
the interrupt output is itself a GPIO line... I see other drivers
calling gpiod_to_irq() to handle this kind of setup. I assume this
function marks the GPIO as "used for interrupt, no longer available
as software-controlled GPIO"?

The tlmm node has the following properties:

	tlmm: pinctrl@03400000 {
		compatible = "qcom,msm8998-pinctrl";
		reg = <0x03400000 0xc00000>;
		interrupts = <0 208 0>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;

Does gpio-controller and/or interrupt-controller mean something
is automagically happening when exp1's interrupts = <42 IRQ_TYPE_LEVEL_HIGH>
prop is being processed?

Or maybe I just have no idea what gpiod_to_irq() is used for?

I'd appreciate any help clearing my confusion.

Regards.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-11-19 19:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-19  9:28 Using a GPIO as an interrupt line Marc Gonzalez
2019-11-19  9:57 ` Russell King - ARM Linux admin
2019-11-19 10:46   ` Marc Gonzalez
2019-11-19 10:56     ` Uwe Kleine-König
2019-11-19 11:00       ` Russell King - ARM Linux admin
2019-11-19 11:03         ` Uwe Kleine-König
2019-11-19 10:58     ` Russell King - ARM Linux admin
2019-11-19 11:46       ` Marc Gonzalez
2019-11-19 19:19         ` Bjorn Andersson
2019-11-19 19:23           ` Jeffrey Hugo
2019-11-19 19:35             ` Bjorn Andersson

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).