All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about shared interrupts in devicetree
@ 2015-04-04 21:40 ` Stefan Wahren
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Wahren @ 2015-04-04 21:40 UTC (permalink / raw)
  To: kernelnewbies, devicetree

Hi,

i'm currently working on drivers (regulator and power switch) for a power
subsystem of a ARM9 processor (Freescale i.MX28). There are interrupts for the
power subsystem which share the same interrupt line. This interrupt line is
needed by both drivers (regulator and power switch).

Now the question what is the right way (tm) to specify the interrupt in the
devicetree and fetch the irq number during driver probe?

Option A (define interrupt in parent node):

  power: power@80044000 {
	compatible = "fsl,imx28-power", "syscon";
	reg = <0x80044000 0x2000>;
	interrupts = <6>;

	reg_vddd: regulator@1 {
		compatible = "fsl,imx28-vddd";
	};

	pswitch: pswitch@5 {
		compatible = "fsl,mxs-pswitch";
		linux,code = <116>;
	};
  }

  int irq = irq_of_parse_and_map(parent, 0);

Option B (define interrupt for each child node):

  power: power@80044000 {
	compatible = "fsl,imx28-power", "syscon";
	reg = <0x80044000 0x2000>;

	reg_vddd: regulator@1 {
		compatible = "fsl,imx28-vddd";
		interrupts = <6>;
	};

	pswitch: pswitch@5 {
		compatible = "fsl,mxs-pswitch";
		linux,code = <116>;
		interrupts = <6>;
	};
  }

  int irq = platform_get_irq(pdev, 0);

Best regards
Stefan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-04-22 18:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-04 21:40 Question about shared interrupts in devicetree Stefan Wahren
2015-04-04 21:40 ` Stefan Wahren
     [not found] ` <2039290448.1160624.1428183613109.JavaMail.open-xchange-h4m1HHXQYNGvCDav5jC2oMgmgJlYmuWJ@public.gmane.org>
2015-04-07 11:29   ` Mark Rutland
2015-04-07 11:29     ` Mark Rutland
2015-04-07 17:06     ` Stefan Wahren
2015-04-07 17:06       ` Stefan Wahren
     [not found]       ` <2146749411.2111.1428426398346.JavaMail.open-xchange-h4m1HHXQYNGvCDav5jC2oMgmgJlYmuWJ@public.gmane.org>
2015-04-08 19:20         ` Geert Uytterhoeven
2015-04-08 19:20           ` Geert Uytterhoeven
     [not found]           ` <CAMuHMdUaQTotvzRiGczyVxfeu34UNLMmwU=aVGTP6rDSHUK45Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-09  7:24             ` Stefan Wahren
2015-04-09  7:24               ` Stefan Wahren
     [not found]               ` <55262935.9080005-eS4NqCHxEME@public.gmane.org>
2015-04-09  7:37                 ` Geert Uytterhoeven
2015-04-09  7:37                   ` Geert Uytterhoeven
     [not found]                   ` <CAMuHMdXpByUO4S_Qdhvbm8PF8hfGTtqr7aA9mmRE5Dk6LrZkJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-09 17:02                     ` Stefan Wahren
2015-04-09 17:02                       ` Stefan Wahren
2015-04-22 18:18     ` Stefan Wahren
2015-04-22 18:18       ` Stefan Wahren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.