mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: <nsekhar@ti.com>, <khilman@deeprootsystems.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <arm@kernel.org>
Subject: [RESEND 3/7] ARM: davinci: devices-da8xx: Clean up and correct the McASP device creation
Date: Thu, 12 Mar 2015 10:06:27 +0200	[thread overview]
Message-ID: <1426147591-31764-4-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1426147591-31764-1-git-send-email-peter.ujfalusi@ti.com>

Both DA830 and DA850 has McASP0 module, so do not restrict the use of
McASP0 for da850 only.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-davinci/devices-da8xx.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index e15e046c5438..fdc3219ba684 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -526,14 +526,25 @@ static struct platform_device da850_mcasp_device = {
 
 void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
 {
-	/* DA830/OMAP-L137 has 3 instances of McASP */
-	if (cpu_is_davinci_da830() && id == 1) {
-		da830_mcasp1_device.dev.platform_data = pdata;
-		platform_device_register(&da830_mcasp1_device);
-	} else if (cpu_is_davinci_da850()) {
-		da850_mcasp_device.dev.platform_data = pdata;
-		platform_device_register(&da850_mcasp_device);
+	struct platform_device *pdev;
+
+	switch (id) {
+	case 0:
+		/* Valid for DA830/OMAP-L137 or DA850/OMAP-L138 */
+		pdev = &da850_mcasp_device;
+		break;
+	case 1:
+		/* Valid for DA830/OMAP-L137 only */
+		if (!cpu_is_davinci_da830())
+			return;
+		pdev = &da830_mcasp1_device;
+		break;
+	default:
+		return;
 	}
+
+	pdev->dev.platform_data = pdata;
+	platform_device_register(pdev);
 }
 
 static struct resource da8xx_pruss_resources[] = {
-- 
2.3.0


  parent reply	other threads:[~2015-03-12  8:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  8:06 [RESEND 0/7] ARM: davinci: McASP related cleanups and fixes Peter Ujfalusi
2015-03-12  8:06 ` [RESEND 1/7] ARM: davinci: devices-da8xx: Add resource name for the McASP DMA request Peter Ujfalusi
2015-03-12  8:06 ` [RESEND 2/7] ARM: davinci: devices-da8xx: Add interrupt resource to McASP structs Peter Ujfalusi
2015-03-12  8:06 ` Peter Ujfalusi [this message]
2015-03-12  8:06 ` [RESEND 4/7] ARM: davinci: devices-da8xx: Add support for McASP2 on da830 Peter Ujfalusi
2015-03-12  8:06 ` [RESEND 5/7] ARM: davinci: dm646x: Clean up the McASP DMA resources Peter Ujfalusi
2015-03-12  8:06 ` [RESEND 6/7] ARM: davinci: irqs: Correct McASP1 TX interrupt definition for DM646x Peter Ujfalusi
2015-03-18 11:58   ` Sekhar Nori
2015-03-12  8:06 ` [RESEND 7/7] ARM: davinci: dm646x: Add interrupt resource for McASPs Peter Ujfalusi
2015-03-12  9:29 ` [RESEND 0/7] ARM: davinci: McASP related cleanups and fixes Sekhar Nori
2015-03-18 11:40   ` Sekhar Nori

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=1426147591-31764-4-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=arm@kernel.org \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsekhar@ti.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

all inboxes | Powered by JetHome®