All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@nvidia.com>
To: broonie@opensource.wolfsonmicro.com, lrg@slimlogic.co.uk
Cc: linux-tegra@vger.kernel.org, alsa-devel@alsa-project.org,
	Stephen Warren <swarren@nvidia.com>
Subject: [PATCH v3 3/4] ARM: tegra: Platform data fixes for ASoC driver updates
Date: Thu, 20 Jan 2011 13:52:10 -0700	[thread overview]
Message-ID: <1295556731-25165-4-git-send-email-swarren@nvidia.com> (raw)
In-Reply-To: <1295556731-25165-1-git-send-email-swarren@nvidia.com>
In-Reply-To: <1295393859-3396-1-git-send-email-swarren@wwwdotorg.org>

The WM8903 driver now needs platform data in order to correctly expose its
GPIOs through gpiolib.

The top-level ASoC driver now needs a platform device in order to provide
infra-structure to pass in platform data.

The top-level ASoC driver now needs platform data in order to be informed
which GPIO IDs to use.

This is all needed to allow the top-level ASoC driver to configure the
WM8903's GPIO3 as an output GPIO, and enable it as appropriate. This is the
enable signal for the external speaker amplifier chips.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/mach-tegra/board-harmony.c |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/gpio-names.h    |    2 ++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 2696a20..c5a4ae0 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -2,6 +2,7 @@
  * arch/arm/mach-tegra/board-harmony.c
  *
  * Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2011 NVIDIA, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -24,12 +25,15 @@
 #include <linux/i2c.h>
 #include <linux/io.h>
 
+#include <sound/wm8903.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <asm/setup.h>
 
 #include <mach/gpio.h>
+#include <mach/harmony_audio.h>
 #include <mach/i2c.h>
 #include <mach/iomap.h>
 #include <mach/irqs.h>
@@ -53,6 +57,8 @@
 #define ATAG_NVIDIA_PRESERVED_MEM_N	2
 #define ATAG_NVIDIA_FORCE_32		0x7fffffff
 
+#define GPIO_WM8903(_x_) (TEGRA_MAX_GPIO + 1 + (_x_))
+
 struct tag_tegra {
 	__u32 bootarg_key;
 	__u32 bootarg_len;
@@ -112,9 +118,33 @@ static struct tegra_i2c_platform_data harmony_i2c1_platform_data = {
 	.bus_clk_rate	= { 400000, 0 },
 };
 
+static struct wm8903_platform_data harmony_wm8903_pdata = {
+	.gpio_base = GPIO_WM8903(0),
+	.gpio_cfg = {
+		WM8903_GPIO_NO_CONFIG,
+		WM8903_GPIO_NO_CONFIG,
+		0,
+		WM8903_GPIO_NO_CONFIG,
+		WM8903_GPIO_NO_CONFIG,
+	},
+};
+
 static struct i2c_board_info __initdata harmony_i2c_bus1_board_info[] = {
 	{
 		I2C_BOARD_INFO("wm8903", 0x1a),
+		.platform_data = &harmony_wm8903_pdata,
+	},
+};
+
+static struct harmony_audio_platform_data harmony_audio_pdata = {
+	.gpio_spkr_en = GPIO_WM8903(2),
+};
+
+static struct platform_device harmony_audio_device = {
+	.name   = "tegra-snd-harmony",
+	.id     = 0,
+	.dev    = {
+		.platform_data  = &harmony_audio_pdata,
 	},
 };
 
@@ -127,6 +157,7 @@ static struct platform_device *harmony_devices[] __initdata = {
 	&tegra_i2s_device1,
 	&tegra_das_device,
 	&tegra_pcm_device,
+	&harmony_audio_device,
 };
 
 static void __init tegra_harmony_fixup(struct machine_desc *desc,
diff --git a/arch/arm/mach-tegra/gpio-names.h b/arch/arm/mach-tegra/gpio-names.h
index f28220a..e8b5cf3 100644
--- a/arch/arm/mach-tegra/gpio-names.h
+++ b/arch/arm/mach-tegra/gpio-names.h
@@ -244,4 +244,6 @@
 #define TEGRA_GPIO_PBB6		222
 #define TEGRA_GPIO_PBB7		223
 
+#define TEGRA_MAX_GPIO		TEGRA_GPIO_PBB7
+
 #endif
-- 
1.7.1

  parent reply	other threads:[~2011-01-20 20:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1295393859-3396-1-git-send-email-swarren@wwwdotorg.org>
     [not found] ` <1295393859-3396-2-git-send-email-swarren@wwwdotorg.org>
2011-01-19  0:21   ` [PATCH 1/3] ASoC: WM8903: Add wm8903_set_gpio Mark Brown
2011-01-19  0:25 ` [PATCH 0/3] Tegra: Add internal speaker support Mark Brown
2011-01-19  0:29   ` Stephen Warren
     [not found]     ` <AANLkTi=m585PZum2NQUOqq1PiqP84LuT-qCruzaO7x7t@mail.gmail.com>
2011-01-19 11:30       ` Mark Brown
2011-01-19 12:47 ` Liam Girdwood
2011-01-19 20:50 ` [PATCH v2 0/4] Tegra: Harmony: " Stephen Warren
2011-01-20 10:04   ` Liam Girdwood
2011-01-19 20:50 ` [PATCH v2 1/4] ASoC: WM8903: Expose GPIOs through gpiolib Stephen Warren
2011-01-20 11:53   ` Mark Brown
2011-01-20 17:23     ` Stephen Warren
2011-01-20 20:33       ` Mark Brown
2011-01-19 20:50 ` [PATCH v2 2/4] ARM: tegra: Add Harmony sound platform data type Stephen Warren
2011-01-19 20:50 ` [PATCH v2 3/4] ARM: tegra: Platform data fixes for ASoC driver updates Stephen Warren
2011-01-19 20:50 ` [PATCH v2 4/4] ASoC: tegra: Harmony: Support the internal speaker Stephen Warren
2011-01-20 11:58   ` Mark Brown
2011-01-25 20:29   ` Mark Brown
2011-01-26  3:46     ` Stephen Warren
2011-01-26 11:00       ` Mark Brown
2011-01-20 20:52 ` [PATCH v3 0/4] Tegra: Harmony: Add internal speaker support Stephen Warren
2011-01-20 20:52 ` [PATCH v3 1/4] ASoC: WM8903: Expose GPIOs through gpiolib Stephen Warren
2011-01-21 12:05   ` Mark Brown
2011-01-20 20:52 ` [PATCH v3 2/4] ARM: tegra: Add Harmony sound platform data type Stephen Warren
2011-01-21 18:43   ` Colin Cross
2011-01-21 22:35     ` Stephen Warren
2011-01-21 22:41       ` Colin Cross
2011-01-21 23:41         ` Mark Brown
2011-01-21 23:49           ` Stephen Warren
2011-01-22  5:14             ` Olof Johansson
2011-01-22  5:34               ` Stephen Warren
2011-01-22  5:40                 ` Olof Johansson
2011-01-20 20:52 ` Stephen Warren [this message]
2011-01-20 21:22   ` [PATCH v3 3/4] ARM: tegra: Platform data fixes for ASoC driver updates Mark Brown
2011-01-20 22:15     ` Liam Girdwood
2011-01-21 17:45     ` Stephen Warren
2011-01-21 17:50       ` Mark Brown
2011-01-21 18:06         ` Stephen Warren
2011-01-21 18:11           ` Mark Brown
2011-01-21 18:22             ` Stephen Warren
2011-01-21 18:27               ` Mark Brown
2011-01-21 18:36                 ` Stephen Warren
2011-01-21 18:39                   ` Mark Brown
2011-01-21 18:51                     ` Stephen Warren
2011-01-21 18:57                       ` Mark Brown
2011-01-21 22:41                         ` Stephen Warren
2011-01-20 20:52 ` [PATCH v3 4/4] ASoC: tegra: Harmony: Support the internal speaker Stephen Warren

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=1295556731-25165-4-git-send-email-swarren@nvidia.com \
    --to=swarren@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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 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.