mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Liam Girdwood <lrg@ti.com>, Tony Lindgren <tony@atomide.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	Misael Lopez Cruz <misael.lopez@ti.com>,
	Felipe Balbi <balbi@ti.com>
Subject: [PATCH v3 1/5] MFD: twl6040: Use resource to provide irq number for slaves
Date: Tue, 5 Jul 2011 22:49:32 +0300	[thread overview]
Message-ID: <1309895376-17446-2-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1309895376-17446-1-git-send-email-peter.ujfalusi@ti.com>

Provide the irq number for slaves via resource on the
platform device.
The irq number configuration is done in the twl6040-core
at probe time, so machine drivers do not need to be
modified.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/mfd/twl6040-core.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index cfaedb5..471f489 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -435,6 +435,18 @@ unsigned int twl6040_get_sysclk(struct twl6040 *twl6040)
 }
 EXPORT_SYMBOL(twl6040_get_sysclk);
 
+static struct resource twl6040_vibra_rsrc[] = {
+	{
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
+static struct resource twl6040_codec_rsrc[] = {
+	{
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
 static int __devinit twl6040_probe(struct platform_device *pdev)
 {
 	struct twl4030_audio_data *pdata = pdev->dev.platform_data;
@@ -499,16 +511,29 @@ static int __devinit twl6040_probe(struct platform_device *pdev)
 	twl6040_set_bits(twl6040, TWL6040_REG_ACCCTL, TWL6040_I2CSEL);
 
 	if (pdata->codec) {
+		int irq = twl6040->irq_base + TWL6040_IRQ_PLUG;
+
 		cell = &twl6040->cells[children];
 		cell->name = "twl6040-codec";
+		twl6040_codec_rsrc[0].start = irq;
+		twl6040_codec_rsrc[0].end = irq;
+		cell->resources = twl6040_codec_rsrc;
+		cell->num_resources = ARRAY_SIZE(twl6040_codec_rsrc);
 		cell->platform_data = pdata->codec;
 		cell->pdata_size = sizeof(*pdata->codec);
 		children++;
 	}
 
 	if (pdata->vibra) {
+		int irq = twl6040->irq_base + TWL6040_IRQ_VIB;
+
 		cell = &twl6040->cells[children];
 		cell->name = "twl6040-vibra";
+		twl6040_vibra_rsrc[0].start = irq;
+		twl6040_vibra_rsrc[0].end = irq;
+		cell->resources = twl6040_vibra_rsrc;
+		cell->num_resources = ARRAY_SIZE(twl6040_vibra_rsrc);
+
 		cell->platform_data = pdata->vibra;
 		cell->pdata_size = sizeof(*pdata->vibra);
 		children++;
-- 
1.7.6


  reply	other threads:[~2011-07-05 19:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 19:49 [PATCH v3 0/5] MFD/input/ASoC: twl6040: irq registration changes Peter Ujfalusi
2011-07-05 19:49 ` Peter Ujfalusi [this message]
2011-07-05 22:39   ` [PATCH v3 1/5] MFD: twl6040: Use resource to provide irq number for slaves Felipe Balbi
2011-07-07  9:49   ` Samuel Ortiz
2011-07-05 19:49 ` [PATCH v3 2/5] input: twl6040-vibra: Do not use wrapper for irq request Peter Ujfalusi
2011-07-05 22:40   ` Felipe Balbi
2011-07-06 20:03   ` Dmitry Torokhov
2011-07-05 19:49 ` [PATCH v3 3/5] ASoC: twl6040: " Peter Ujfalusi
2011-07-05 22:41   ` Felipe Balbi
2011-07-05 19:49 ` [PATCH v3 4/5] MFD: twl6040: Demand valid interrupt configuration Peter Ujfalusi
2011-07-05 22:42   ` Felipe Balbi
2011-07-07  9:50   ` Samuel Ortiz
2011-07-05 19:49 ` [PATCH v3 5/5] MFD: twl6040: Remove wrapper for threaded irq request Peter Ujfalusi
2011-07-05 22:42   ` Felipe Balbi
2011-07-07  9:51   ` Samuel Ortiz
2011-07-06 19:45 ` [alsa-devel] [PATCH v3 0/5] MFD/input/ASoC: twl6040: irq registration changes Péter Ujfalusi

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=1309895376-17446-2-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=balbi@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=misael.lopez@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=tony@atomide.com \
    /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

Powered by JetHome