All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Liam Girdwood <lrg@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Tony Lindgren <tony@atomide.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>,
	alsa-devel@alsa-project.org, linux-omap@vger.kernel.org
Subject: [PATCH 08/10] OMAP4: omap4panda: Enable audio support
Date: Wed, 14 Dec 2011 11:47:01 +0200	[thread overview]
Message-ID: <1323856022-24053-9-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1323856022-24053-1-git-send-email-peter.ujfalusi@ti.com>

PandaBoard has twl6040 codec for audio.
Register the omap4-abe-twl6040 platform device.
Add platform data to enable the twl6040 codec.
Since there is a difference in audio between  PandaBoard 4430
and PandaBoard ES (4460):
Use different name for the sound card:
"OMAP4-Panda" for PandaBoard 4430
"OMAP4-PandaES" for PandaBoard ES

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

board: audio for panda
---
 arch/arm/mach-omap2/board-omap4panda.c |   48 +++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index a8c2c42..6331626 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -28,6 +28,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 
 #include <mach/hardware.h>
 #include <mach/omap4-common.h>
@@ -90,9 +91,23 @@ static struct platform_device leds_gpio = {
 	},
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+	.card_name = "OMAP4-Panda",
+	.board = OMAP_ABE_TWL6040_PANDA,
+};
+
+static struct platform_device panda_abe_audio = {
+	.name		= "omap-abe-twl6040",
+	.id		= -1,
+	.dev = {
+		.platform_data = &panda_abe_audio_data,
+	},
+};
+
 static struct platform_device *panda_devices[] __initdata = {
 	&leds_gpio,
 	&wl1271_device,
+	&panda_abe_audio,
 };
 
 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
@@ -251,8 +266,25 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
 	return 0;
 }
 
+static struct twl4030_codec_data twl6040_codec = {
+	/* single-step ramp for headset and handsfree */
+	.hs_left_step	= 0x0f,
+	.hs_right_step	= 0x0f,
+	.hf_left_step	= 0x1d,
+	.hf_right_step	= 0x1d,
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+	.codec		= &twl6040_codec,
+	.audpwron_gpio	= 127,
+	.naudint_irq	= OMAP44XX_IRQ_SYS_2N,
+	.irq_base	= TWL6040_CODEC_IRQ_BASE,
+};
+
 /* Panda board uses the common PMIC configuration */
-static struct twl4030_platform_data omap4_panda_twldata;
+static struct twl4030_platform_data omap4_panda_twldata = {
+	.audio		= &twl6040_audio,
+};
 
 /*
  * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -548,6 +580,19 @@ void omap4_panda_display_init(void)
 	omap_display_init(&omap4_panda_dss_data);
 }
 
+static void omap4_panda_audio_init(void)
+{
+	if (cpu_is_omap4430()) {
+		/* PandaBoard 4430 */
+		panda_abe_audio_data.card_name = "OMAP4-Panda";
+		panda_abe_audio_data.board = OMAP_ABE_TWL6040_PANDA;
+	} else {
+		/* PandaBoard ES */
+		panda_abe_audio_data.card_name = "OMAP4-PandaES";
+		panda_abe_audio_data.board = OMAP_ABE_TWL6040_PANDA_ES;
+	}
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
@@ -560,6 +605,7 @@ static void __init omap4_panda_init(void)
 		pr_err("error setting wl12xx data\n");
 
 	omap4_panda_i2c_init();
+	omap4_panda_audio_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
 	platform_device_register(&omap_vwlan_device);
 	board_serial_init();
-- 
1.7.8


  parent reply	other threads:[~2011-12-14  9:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  9:46 [PATCH 00/10] OMAP4: ASoC: Support for PandaBoard family Peter Ujfalusi
2011-12-14  9:46 ` [PATCH 01/10] ASoC: sdp4430: Correct author e-mail address Peter Ujfalusi
2011-12-14 10:06   ` Mark Brown
2011-12-14  9:46 ` [PATCH 02/10] ASoC: OMAP4: Rename the sdp4430 machine driver Peter Ujfalusi
2011-12-14 10:22   ` Mark Brown
2011-12-14  9:46 ` [PATCH 03/10] ASoC: omap-abe-twl6040: Correct internal prefix, Kconfig entry Peter Ujfalusi
2011-12-14 10:23   ` Mark Brown
2011-12-14  9:46 ` [PATCH 04/10] include: platform_data: Platform data header for OMAP4 ASoC audio Peter Ujfalusi
2011-12-14  9:57   ` Mark Brown
2011-12-15 13:02     ` Péter Ujfalusi
2011-12-17  9:36       ` Mark Brown
2011-12-19 14:04         ` Peter Ujfalusi
2011-12-19 19:20           ` Tony Lindgren
2011-12-20  0:47             ` Mark Brown
2011-12-20  0:24           ` Mark Brown
2011-12-14  9:46 ` [PATCH 05/10] OMAP4: 4430sdp: Register platform device for OMAP4 audio Peter Ujfalusi
2011-12-14 18:00   ` Tony Lindgren
2011-12-14  9:46 ` [PATCH 06/10] ASoC: omap-abe-twl6040: Convert to platform deriver Peter Ujfalusi
2011-12-14 10:01   ` Mark Brown
2011-12-14 10:15     ` Péter Ujfalusi
2011-12-14 11:27       ` Mark Brown
2011-12-15  8:17         ` Péter Ujfalusi
2011-12-15 13:01           ` Péter Ujfalusi
2011-12-14  9:47 ` [PATCH 07/10] ASoC: omap-abe-twl6040: Add support for PandaBoard Peter Ujfalusi
2011-12-14  9:47 ` Peter Ujfalusi [this message]
2011-12-14 18:02   ` [PATCH 08/10] OMAP4: omap4panda: Enable audio support Tony Lindgren
2011-12-14  9:47 ` [PATCH 09/10] ASoC: omap-abe-twl6040: Add missing audio route information Peter Ujfalusi
2011-12-14 10:14   ` [alsa-devel] " Mark Brown
2011-12-21 18:26 ` [PATCH 00/10] OMAP4: ASoC: Support for PandaBoard family Liam Girdwood

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=1323856022-24053-9-git-send-email-peter.ujfalusi@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=misael.lopez@ti.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 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.