All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/9] OMAP4: ASoC: Support for PandaBoard family
@ 2011-12-22 19:34 ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

Hello,

the following series will add ASoC support for PandaBoards.
PandaBoards have different audio routings compared to SDP4430/Blaze boards, but
the differences not that big to justify a new ASoC machine driver.

This series is based on the first three patch from the v1 sereis (those, which
has been applied by Liam).

Changes since v2:
- Remove direct board dependency for the ASoC machine driver (replaced by
  ARCH_OMAP4)
- mach-omap2/board-omap4panda: Generic board revision handling function instead
  of dedicated for audio.
- Macro twl6040_disconnect_pin replaced with a function

Changes since v1:
As suggested by Mark the platform data, machine driver has been converted to
process feature flags instead of Board IDs.
- The ASoC machine driver registers all DAPM widgets. Based on the received
  configuration it will disable the unused paths
- PCM for dmic is only created, if the board has digital mic conencted
- Jack functionality will be only used on boards supporting it
- Sound card name for SDP4430 has net been changed

Regards,
Peter
---
Peter Ujfalusi (9):
  include: platform_data: Platform data header for OMAP4 ASoC audio
  OMAP4: 4430sdp: Register platform device for OMAP4 audio
  ASoC: omap-abe-twl6040: Convert to platform deriver
  ASoC: twl6040: Convert MICBIAS to SUPPLY widget
  ASoC: omap-abe-twl6040: Add complete DAPM routing
  ASoC: omap-abe-twl6040: DAI link selection based on platform data
  ASoC: omap-abe-twl6040: Configure card according to platform data
  OMAP4: omap4panda: Enable audio support
  ASoC: Kconfig: OMAP4: Enable support for PandaBoards

 arch/arm/mach-omap2/board-4430sdp.c            |   27 ++++
 arch/arm/mach-omap2/board-omap4panda.c         |   57 ++++++++-
 include/linux/platform_data/omap-abe-twl6040.h |   48 +++++++
 sound/soc/codecs/twl6040.c                     |   16 +-
 sound/soc/omap/Kconfig                         |    4 +-
 sound/soc/omap/omap-abe-twl6040.c              |  181 ++++++++++++++++--------
 6 files changed, 263 insertions(+), 70 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

-- 
1.7.8.1


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

* [PATCH v3 0/9] OMAP4: ASoC: Support for PandaBoard family
@ 2011-12-22 19:34 ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

the following series will add ASoC support for PandaBoards.
PandaBoards have different audio routings compared to SDP4430/Blaze boards, but
the differences not that big to justify a new ASoC machine driver.

This series is based on the first three patch from the v1 sereis (those, which
has been applied by Liam).

Changes since v2:
- Remove direct board dependency for the ASoC machine driver (replaced by
  ARCH_OMAP4)
- mach-omap2/board-omap4panda: Generic board revision handling function instead
  of dedicated for audio.
- Macro twl6040_disconnect_pin replaced with a function

Changes since v1:
As suggested by Mark the platform data, machine driver has been converted to
process feature flags instead of Board IDs.
- The ASoC machine driver registers all DAPM widgets. Based on the received
  configuration it will disable the unused paths
- PCM for dmic is only created, if the board has digital mic conencted
- Jack functionality will be only used on boards supporting it
- Sound card name for SDP4430 has net been changed

Regards,
Peter
---
Peter Ujfalusi (9):
  include: platform_data: Platform data header for OMAP4 ASoC audio
  OMAP4: 4430sdp: Register platform device for OMAP4 audio
  ASoC: omap-abe-twl6040: Convert to platform deriver
  ASoC: twl6040: Convert MICBIAS to SUPPLY widget
  ASoC: omap-abe-twl6040: Add complete DAPM routing
  ASoC: omap-abe-twl6040: DAI link selection based on platform data
  ASoC: omap-abe-twl6040: Configure card according to platform data
  OMAP4: omap4panda: Enable audio support
  ASoC: Kconfig: OMAP4: Enable support for PandaBoards

 arch/arm/mach-omap2/board-4430sdp.c            |   27 ++++
 arch/arm/mach-omap2/board-omap4panda.c         |   57 ++++++++-
 include/linux/platform_data/omap-abe-twl6040.h |   48 +++++++
 sound/soc/codecs/twl6040.c                     |   16 +-
 sound/soc/omap/Kconfig                         |    4 +-
 sound/soc/omap/omap-abe-twl6040.c              |  181 ++++++++++++++++--------
 6 files changed, 263 insertions(+), 70 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

-- 
1.7.8.1

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

* [PATCH v3 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

Include file to be used with the upcoming ASoC machine driver
for OMAP platform using ABE with twl6040 codec.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 include/linux/platform_data/omap-abe-twl6040.h |   48 ++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644
index 0000000..286f644
--- /dev/null
+++ b/include/linux/platform_data/omap-abe-twl6040.h
@@ -0,0 +1,48 @@
+/**
+ * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _OMAP_ABE_TWL6040_H_
+#define _OMAP_ABE_TWL6040_H_
+
+/* To select if only one channel is connected in a stereo port */
+#define ABE_TWL6040_LEFT	(1 << 0)
+#define ABE_TWL6040_RIGHT	(1 << 1)
+
+struct omap_abe_twl6040_data {
+	char *card_name;
+	/* Feature flags for connected audio pins */
+	u8	has_hs;
+	u8	has_hf;
+	bool	has_ep;
+	u8	has_aux;
+	u8	has_vibra;
+	bool	has_dmic;
+	bool	has_hsmic;
+	bool	has_mainmic;
+	bool	has_submic;
+	u8	has_afm;
+	/* Other features */
+	bool	jack_detection;	/* board can detect jack events */
+};
+
+#endif /* _OMAP_ABE_TWL6040_H_ */
-- 
1.7.8.1


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

* [PATCH v3 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Include file to be used with the upcoming ASoC machine driver
for OMAP platform using ABE with twl6040 codec.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 include/linux/platform_data/omap-abe-twl6040.h |   48 ++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644
index 0000000..286f644
--- /dev/null
+++ b/include/linux/platform_data/omap-abe-twl6040.h
@@ -0,0 +1,48 @@
+/**
+ * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _OMAP_ABE_TWL6040_H_
+#define _OMAP_ABE_TWL6040_H_
+
+/* To select if only one channel is connected in a stereo port */
+#define ABE_TWL6040_LEFT	(1 << 0)
+#define ABE_TWL6040_RIGHT	(1 << 1)
+
+struct omap_abe_twl6040_data {
+	char *card_name;
+	/* Feature flags for connected audio pins */
+	u8	has_hs;
+	u8	has_hf;
+	bool	has_ep;
+	u8	has_aux;
+	u8	has_vibra;
+	bool	has_dmic;
+	bool	has_hsmic;
+	bool	has_mainmic;
+	bool	has_submic;
+	u8	has_afm;
+	/* Other features */
+	bool	jack_detection;	/* board can detect jack events */
+};
+
+#endif /* _OMAP_ABE_TWL6040_H_ */
-- 
1.7.8.1

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

* [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi, Santosh Shilimkar

To avoid breakage in audio support with the coming change
in ASoC machine driver (conversion to platfrom device).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap2/board-4430sdp.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 21b62bd..394cbab 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -41,6 +41,7 @@
 #include <video/omap-panel-nokia-dsi.h>
 #include <video/omap-panel-picodlp.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 
 #include "mux.h"
 #include "hsmmc.h"
@@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
 	.id	= -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+	.card_name = "SDP4430",
+	.has_hs		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	.has_hf		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	.has_ep		= 1,
+	.has_aux	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	.has_vibra	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+	.has_dmic	= 1,
+	.has_hsmic	= 1,
+	.has_mainmic	= 1,
+	.has_submic	= 1,
+	.has_afm	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+	.jack_detection = 1,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+	.name		= "omap-abe-twl6040",
+	.id		= -1,
+	.dev = {
+		.platform_data = &sdp4430_abe_audio_data,
+	},
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
 	&sdp4430_gpio_keys_device,
 	&sdp4430_leds_gpio,
 	&sdp4430_leds_pwm,
 	&sdp4430_vbat,
 	&sdp4430_dmic_codec,
+	&sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.8.1


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

* [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

To avoid breakage in audio support with the coming change
in ASoC machine driver (conversion to platfrom device).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap2/board-4430sdp.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 21b62bd..394cbab 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -41,6 +41,7 @@
 #include <video/omap-panel-nokia-dsi.h>
 #include <video/omap-panel-picodlp.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 
 #include "mux.h"
 #include "hsmmc.h"
@@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
 	.id	= -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+	.card_name = "SDP4430",
+	.has_hs		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	.has_hf		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	.has_ep		= 1,
+	.has_aux	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	.has_vibra	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+	.has_dmic	= 1,
+	.has_hsmic	= 1,
+	.has_mainmic	= 1,
+	.has_submic	= 1,
+	.has_afm	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+	.jack_detection = 1,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+	.name		= "omap-abe-twl6040",
+	.id		= -1,
+	.dev = {
+		.platform_data = &sdp4430_abe_audio_data,
+	},
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
 	&sdp4430_gpio_keys_device,
 	&sdp4430_leds_gpio,
 	&sdp4430_leds_pwm,
 	&sdp4430_vbat,
 	&sdp4430_dmic_codec,
+	&sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.8.1

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

* [PATCH v3 3/9] ASoC: omap-abe-twl6040: Convert to platform deriver
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

Convert the OMAP4 ABE/TWL6040 machine driver to platform
driver.
For the card name use the string provided via platform data.
The card's name for OMAP4 SDP4430 has been changed:
SDP4430 -> OMAP4-SDP4430

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   59 ++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 9c6d97a..4974ea1 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/twl6040.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 #include <linux/module.h>
 
 #include <sound/core.h>
@@ -226,7 +227,6 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
 
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-	.name = "SDP4430",
 	.dai_link = sdp4430_dai,
 	.num_links = ARRAY_SIZE(sdp4430_dai),
 
@@ -236,43 +236,56 @@ static struct snd_soc_card omapabe_card = {
 	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
-static struct platform_device *omapabe_snd_device;
-
-static int __init omapabe_soc_init(void)
+static __devinit int omapabe_probe(struct platform_device *pdev)
 {
+	struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev);
+	struct snd_soc_card *card = &omapabe_card;
 	int ret;
 
-	if (!machine_is_omap_4430sdp())
-		return -ENODEV;
-	printk(KERN_INFO "SDP4430 SoC init\n");
+	card->dev = &pdev->dev;
 
-	omapabe_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!omapabe_snd_device) {
-		printk(KERN_ERR "Platform device allocation failed\n");
-		return -ENOMEM;
+	if (!pdata) {
+		dev_err(&pdev->dev, "Missing pdata\n");
+		return -ENODEV;
 	}
 
-	platform_set_drvdata(omapabe_snd_device, &omapabe_card);
+	if (pdata->card_name) {
+		card->name = pdata->card_name;
+	} else {
+		dev_err(&pdev->dev, "Card name is not provided\n");
+		return -ENODEV;
+	}
 
-	ret = platform_device_add(omapabe_snd_device);
+	ret = snd_soc_register_card(card);
 	if (ret)
-		goto err;
-
-	return 0;
+		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+			ret);
 
-err:
-	printk(KERN_ERR "Unable to add platform device\n");
-	platform_device_put(omapabe_snd_device);
 	return ret;
 }
-module_init(omapabe_soc_init);
 
-static void __exit omapabe_soc_exit(void)
+static int __devexit omapabe_remove(struct platform_device *pdev)
 {
-	platform_device_unregister(omapabe_snd_device);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	snd_soc_unregister_card(card);
+
+	return 0;
 }
-module_exit(omapabe_soc_exit);
+
+static struct platform_driver omapabe_driver = {
+	.driver = {
+		.name = "omap-abe-twl6040",
+		.owner = THIS_MODULE,
+		.pm = &snd_soc_pm_ops,
+	},
+	.probe = omapabe_probe,
+	.remove = __devexit_p(omapabe_remove),
+};
+
+module_platform_driver(omapabe_driver);
 
 MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>");
 MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:omap-abe-twl6040");
-- 
1.7.8.1


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

* [PATCH v3 3/9] ASoC: omap-abe-twl6040: Convert to platform deriver
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Convert the OMAP4 ABE/TWL6040 machine driver to platform
driver.
For the card name use the string provided via platform data.
The card's name for OMAP4 SDP4430 has been changed:
SDP4430 -> OMAP4-SDP4430

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   59 ++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 9c6d97a..4974ea1 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/twl6040.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 #include <linux/module.h>
 
 #include <sound/core.h>
@@ -226,7 +227,6 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
 
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-	.name = "SDP4430",
 	.dai_link = sdp4430_dai,
 	.num_links = ARRAY_SIZE(sdp4430_dai),
 
@@ -236,43 +236,56 @@ static struct snd_soc_card omapabe_card = {
 	.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
-static struct platform_device *omapabe_snd_device;
-
-static int __init omapabe_soc_init(void)
+static __devinit int omapabe_probe(struct platform_device *pdev)
 {
+	struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev);
+	struct snd_soc_card *card = &omapabe_card;
 	int ret;
 
-	if (!machine_is_omap_4430sdp())
-		return -ENODEV;
-	printk(KERN_INFO "SDP4430 SoC init\n");
+	card->dev = &pdev->dev;
 
-	omapabe_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!omapabe_snd_device) {
-		printk(KERN_ERR "Platform device allocation failed\n");
-		return -ENOMEM;
+	if (!pdata) {
+		dev_err(&pdev->dev, "Missing pdata\n");
+		return -ENODEV;
 	}
 
-	platform_set_drvdata(omapabe_snd_device, &omapabe_card);
+	if (pdata->card_name) {
+		card->name = pdata->card_name;
+	} else {
+		dev_err(&pdev->dev, "Card name is not provided\n");
+		return -ENODEV;
+	}
 
-	ret = platform_device_add(omapabe_snd_device);
+	ret = snd_soc_register_card(card);
 	if (ret)
-		goto err;
-
-	return 0;
+		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+			ret);
 
-err:
-	printk(KERN_ERR "Unable to add platform device\n");
-	platform_device_put(omapabe_snd_device);
 	return ret;
 }
-module_init(omapabe_soc_init);
 
-static void __exit omapabe_soc_exit(void)
+static int __devexit omapabe_remove(struct platform_device *pdev)
 {
-	platform_device_unregister(omapabe_snd_device);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	snd_soc_unregister_card(card);
+
+	return 0;
 }
-module_exit(omapabe_soc_exit);
+
+static struct platform_driver omapabe_driver = {
+	.driver = {
+		.name = "omap-abe-twl6040",
+		.owner = THIS_MODULE,
+		.pm = &snd_soc_pm_ops,
+	},
+	.probe = omapabe_probe,
+	.remove = __devexit_p(omapabe_remove),
+};
+
+module_platform_driver(omapabe_driver);
 
 MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>");
 MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:omap-abe-twl6040");
-- 
1.7.8.1

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

* [PATCH v3 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

In order to avoid breakage change the omap-abe-twl6040
machine driver's routing.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/codecs/twl6040.c        |   16 ++++++++--------
 sound/soc/omap/omap-abe-twl6040.c |   14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a4a65dc..2be98e8 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1102,14 +1102,14 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
 			TWL6040_REG_MICRCTL, 2, 0),
 
 	/* Microphone bias */
-	SND_SOC_DAPM_MICBIAS("Headset Mic Bias",
-			TWL6040_REG_AMICBCTL, 0, 0),
-	SND_SOC_DAPM_MICBIAS("Main Mic Bias",
-			TWL6040_REG_AMICBCTL, 4, 0),
-	SND_SOC_DAPM_MICBIAS("Digital Mic1 Bias",
-			TWL6040_REG_DMICBCTL, 0, 0),
-	SND_SOC_DAPM_MICBIAS("Digital Mic2 Bias",
-			TWL6040_REG_DMICBCTL, 4, 0),
+	SND_SOC_DAPM_SUPPLY("Headset Mic Bias",
+			    TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("Main Mic Bias",
+			    TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias",
+			    TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias",
+			    TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
 
 	/* DACs */
 	SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 4974ea1..18a25b0 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -123,17 +123,17 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
 
 static const struct snd_soc_dapm_route audio_map[] = {
 	/* External Mics: MAINMIC, SUBMIC with bias*/
-	{"MAINMIC", NULL, "Main Mic Bias"},
-	{"SUBMIC", NULL, "Main Mic Bias"},
-	{"Main Mic Bias", NULL, "Ext Mic"},
+	{"MAINMIC", NULL, "Ext Mic"},
+	{"SUBMIC", NULL, "Ext Mic"},
+	{"Ext Mic", NULL, "Main Mic Bias"},
 
 	/* External Speakers: HFL, HFR */
 	{"Ext Spk", NULL, "HFL"},
 	{"Ext Spk", NULL, "HFR"},
 
 	/* Headset Mic: HSMIC with bias */
-	{"HSMIC", NULL, "Headset Mic Bias"},
-	{"Headset Mic Bias", NULL, "Headset Mic"},
+	{"HSMIC", NULL, "Headset Mic"},
+	{"Headset Mic", NULL, "Headset Mic Bias"},
 
 	/* Headset Stereophone (Headphone): HSOL, HSOR */
 	{"Headset Stereophone", NULL, "HSOL"},
@@ -182,8 +182,8 @@ static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = {
 };
 
 static const struct snd_soc_dapm_route dmic_audio_map[] = {
-	{"DMic", NULL, "Digital Mic1 Bias"},
-	{"Digital Mic1 Bias", NULL, "Digital Mic"},
+	{"DMic", NULL, "Digital Mic"},
+	{"Digital Mic", NULL, "Digital Mic1 Bias"},
 };
 
 static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.1


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

* [PATCH v3 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

In order to avoid breakage change the omap-abe-twl6040
machine driver's routing.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/codecs/twl6040.c        |   16 ++++++++--------
 sound/soc/omap/omap-abe-twl6040.c |   14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a4a65dc..2be98e8 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1102,14 +1102,14 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
 			TWL6040_REG_MICRCTL, 2, 0),
 
 	/* Microphone bias */
-	SND_SOC_DAPM_MICBIAS("Headset Mic Bias",
-			TWL6040_REG_AMICBCTL, 0, 0),
-	SND_SOC_DAPM_MICBIAS("Main Mic Bias",
-			TWL6040_REG_AMICBCTL, 4, 0),
-	SND_SOC_DAPM_MICBIAS("Digital Mic1 Bias",
-			TWL6040_REG_DMICBCTL, 0, 0),
-	SND_SOC_DAPM_MICBIAS("Digital Mic2 Bias",
-			TWL6040_REG_DMICBCTL, 4, 0),
+	SND_SOC_DAPM_SUPPLY("Headset Mic Bias",
+			    TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("Main Mic Bias",
+			    TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias",
+			    TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
+	SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias",
+			    TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
 
 	/* DACs */
 	SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 4974ea1..18a25b0 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -123,17 +123,17 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
 
 static const struct snd_soc_dapm_route audio_map[] = {
 	/* External Mics: MAINMIC, SUBMIC with bias*/
-	{"MAINMIC", NULL, "Main Mic Bias"},
-	{"SUBMIC", NULL, "Main Mic Bias"},
-	{"Main Mic Bias", NULL, "Ext Mic"},
+	{"MAINMIC", NULL, "Ext Mic"},
+	{"SUBMIC", NULL, "Ext Mic"},
+	{"Ext Mic", NULL, "Main Mic Bias"},
 
 	/* External Speakers: HFL, HFR */
 	{"Ext Spk", NULL, "HFL"},
 	{"Ext Spk", NULL, "HFR"},
 
 	/* Headset Mic: HSMIC with bias */
-	{"HSMIC", NULL, "Headset Mic Bias"},
-	{"Headset Mic Bias", NULL, "Headset Mic"},
+	{"HSMIC", NULL, "Headset Mic"},
+	{"Headset Mic", NULL, "Headset Mic Bias"},
 
 	/* Headset Stereophone (Headphone): HSOL, HSOR */
 	{"Headset Stereophone", NULL, "HSOL"},
@@ -182,8 +182,8 @@ static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = {
 };
 
 static const struct snd_soc_dapm_route dmic_audio_map[] = {
-	{"DMic", NULL, "Digital Mic1 Bias"},
-	{"Digital Mic1 Bias", NULL, "Digital Mic"},
+	{"DMic", NULL, "Digital Mic"},
+	{"Digital Mic", NULL, "Digital Mic1 Bias"},
 };
 
 static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.1

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

* [PATCH v3 5/9] ASoC: omap-abe-twl6040: Add complete DAPM routing
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

SDP4430 is a reference platform, and as such it has all possible
audio routing implemented.
Correct the DAPM routing to be complete.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   46 ++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 18a25b0..cf3cb08 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -113,38 +113,48 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
 
 /* SDP4430 machine DAPM */
 static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
-	SND_SOC_DAPM_MIC("Ext Mic", NULL),
-	SND_SOC_DAPM_SPK("Ext Spk", NULL),
-	SND_SOC_DAPM_MIC("Headset Mic", NULL),
+	/* Outputs */
 	SND_SOC_DAPM_HP("Headset Stereophone", NULL),
 	SND_SOC_DAPM_SPK("Earphone Spk", NULL),
-	SND_SOC_DAPM_INPUT("FM Stereo In"),
+	SND_SOC_DAPM_SPK("Ext Spk", NULL),
+	SND_SOC_DAPM_LINE("Line Out", NULL),
+	SND_SOC_DAPM_SPK("Vibrator", NULL),
+
+	/* Inputs */
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
+	SND_SOC_DAPM_MIC("Main Handset Mic", NULL),
+	SND_SOC_DAPM_MIC("Sub Handset Mic", NULL),
+	SND_SOC_DAPM_LINE("Line In", NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
-	/* External Mics: MAINMIC, SUBMIC with bias*/
-	{"MAINMIC", NULL, "Ext Mic"},
-	{"SUBMIC", NULL, "Ext Mic"},
-	{"Ext Mic", NULL, "Main Mic Bias"},
+	/* Routings for outputs */
+	{"Headset Stereophone", NULL, "HSOL"},
+	{"Headset Stereophone", NULL, "HSOR"},
+
+	{"Earphone Spk", NULL, "EP"},
 
-	/* External Speakers: HFL, HFR */
 	{"Ext Spk", NULL, "HFL"},
 	{"Ext Spk", NULL, "HFR"},
 
-	/* Headset Mic: HSMIC with bias */
+	{"Line Out", NULL, "AUXL"},
+	{"Line Out", NULL, "AUXR"},
+
+	{"Vibrator", NULL, "VIBRAL"},
+	{"Vibrator", NULL, "VIBRAR"},
+
+	/* Routings for inputs */
 	{"HSMIC", NULL, "Headset Mic"},
 	{"Headset Mic", NULL, "Headset Mic Bias"},
 
-	/* Headset Stereophone (Headphone): HSOL, HSOR */
-	{"Headset Stereophone", NULL, "HSOL"},
-	{"Headset Stereophone", NULL, "HSOR"},
+	{"MAINMIC", NULL, "Main Handset Mic"},
+	{"Main Handset Mic", NULL, "Main Mic Bias"},
 
-	/* Earphone speaker */
-	{"Earphone Spk", NULL, "EP"},
+	{"SUBMIC", NULL, "Sub Handset Mic"},
+	{"Sub Handset Mic", NULL, "Main Mic Bias"},
 
-	/* Aux/FM Stereo In: AFML, AFMR */
-	{"AFML", NULL, "FM Stereo In"},
-	{"AFMR", NULL, "FM Stereo In"},
+	{"AFML", NULL, "Line In"},
+	{"AFMR", NULL, "Line In"},
 };
 
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.1


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

* [PATCH v3 5/9] ASoC: omap-abe-twl6040: Add complete DAPM routing
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

SDP4430 is a reference platform, and as such it has all possible
audio routing implemented.
Correct the DAPM routing to be complete.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   46 ++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 18a25b0..cf3cb08 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -113,38 +113,48 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
 
 /* SDP4430 machine DAPM */
 static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
-	SND_SOC_DAPM_MIC("Ext Mic", NULL),
-	SND_SOC_DAPM_SPK("Ext Spk", NULL),
-	SND_SOC_DAPM_MIC("Headset Mic", NULL),
+	/* Outputs */
 	SND_SOC_DAPM_HP("Headset Stereophone", NULL),
 	SND_SOC_DAPM_SPK("Earphone Spk", NULL),
-	SND_SOC_DAPM_INPUT("FM Stereo In"),
+	SND_SOC_DAPM_SPK("Ext Spk", NULL),
+	SND_SOC_DAPM_LINE("Line Out", NULL),
+	SND_SOC_DAPM_SPK("Vibrator", NULL),
+
+	/* Inputs */
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
+	SND_SOC_DAPM_MIC("Main Handset Mic", NULL),
+	SND_SOC_DAPM_MIC("Sub Handset Mic", NULL),
+	SND_SOC_DAPM_LINE("Line In", NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
-	/* External Mics: MAINMIC, SUBMIC with bias*/
-	{"MAINMIC", NULL, "Ext Mic"},
-	{"SUBMIC", NULL, "Ext Mic"},
-	{"Ext Mic", NULL, "Main Mic Bias"},
+	/* Routings for outputs */
+	{"Headset Stereophone", NULL, "HSOL"},
+	{"Headset Stereophone", NULL, "HSOR"},
+
+	{"Earphone Spk", NULL, "EP"},
 
-	/* External Speakers: HFL, HFR */
 	{"Ext Spk", NULL, "HFL"},
 	{"Ext Spk", NULL, "HFR"},
 
-	/* Headset Mic: HSMIC with bias */
+	{"Line Out", NULL, "AUXL"},
+	{"Line Out", NULL, "AUXR"},
+
+	{"Vibrator", NULL, "VIBRAL"},
+	{"Vibrator", NULL, "VIBRAR"},
+
+	/* Routings for inputs */
 	{"HSMIC", NULL, "Headset Mic"},
 	{"Headset Mic", NULL, "Headset Mic Bias"},
 
-	/* Headset Stereophone (Headphone): HSOL, HSOR */
-	{"Headset Stereophone", NULL, "HSOL"},
-	{"Headset Stereophone", NULL, "HSOR"},
+	{"MAINMIC", NULL, "Main Handset Mic"},
+	{"Main Handset Mic", NULL, "Main Mic Bias"},
 
-	/* Earphone speaker */
-	{"Earphone Spk", NULL, "EP"},
+	{"SUBMIC", NULL, "Sub Handset Mic"},
+	{"Sub Handset Mic", NULL, "Main Mic Bias"},
 
-	/* Aux/FM Stereo In: AFML, AFMR */
-	{"AFML", NULL, "FM Stereo In"},
-	{"AFMR", NULL, "FM Stereo In"},
+	{"AFML", NULL, "Line In"},
+	{"AFMR", NULL, "Line In"},
 };
 
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.1

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

* [PATCH v3 6/9] ASoC: omap-abe-twl6040: DAI link selection based on platform data
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

We can have machines without DMIC connected. In this case there is
no need to create amother (unusable) capture PCM on the card.
The existence of the DMIC connection can be checked via
pdata->has_dmic.
Select the correct dai_link structure for the card based on
pdata->has_dmic.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index cf3cb08..9e6e4c2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -212,7 +212,7 @@ static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
 }
 
 /* Digital audio interface glue - connects codec <--> CPU */
-static struct snd_soc_dai_link sdp4430_dai[] = {
+static struct snd_soc_dai_link twl6040_dmic_dai[] = {
 	{
 		.name = "TWL6040",
 		.stream_name = "TWL6040",
@@ -235,11 +235,21 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
 	},
 };
 
+static struct snd_soc_dai_link twl6040_only_dai[] = {
+	{
+		.name = "TWL6040",
+		.stream_name = "TWL6040",
+		.cpu_dai_name = "omap-mcpdm",
+		.codec_dai_name = "twl6040-legacy",
+		.platform_name = "omap-pcm-audio",
+		.codec_name = "twl6040-codec",
+		.init = omapabe_twl6040_init,
+		.ops = &omapabe_ops,
+	},
+};
+
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-	.dai_link = sdp4430_dai,
-	.num_links = ARRAY_SIZE(sdp4430_dai),
-
 	.dapm_widgets = twl6040_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets),
 	.dapm_routes = audio_map,
@@ -266,6 +276,14 @@ static __devinit int omapabe_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	if (pdata->has_dmic) {
+		card->dai_link = twl6040_dmic_dai;
+		card->num_links = ARRAY_SIZE(twl6040_dmic_dai);
+	} else {
+		card->dai_link = twl6040_only_dai;
+		card->num_links = ARRAY_SIZE(twl6040_only_dai);
+	}
+
 	ret = snd_soc_register_card(card);
 	if (ret)
 		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
-- 
1.7.8.1


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

* [PATCH v3 6/9] ASoC: omap-abe-twl6040: DAI link selection based on platform data
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

We can have machines without DMIC connected. In this case there is
no need to create amother (unusable) capture PCM on the card.
The existence of the DMIC connection can be checked via
pdata->has_dmic.
Select the correct dai_link structure for the card based on
pdata->has_dmic.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index cf3cb08..9e6e4c2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -212,7 +212,7 @@ static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
 }
 
 /* Digital audio interface glue - connects codec <--> CPU */
-static struct snd_soc_dai_link sdp4430_dai[] = {
+static struct snd_soc_dai_link twl6040_dmic_dai[] = {
 	{
 		.name = "TWL6040",
 		.stream_name = "TWL6040",
@@ -235,11 +235,21 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
 	},
 };
 
+static struct snd_soc_dai_link twl6040_only_dai[] = {
+	{
+		.name = "TWL6040",
+		.stream_name = "TWL6040",
+		.cpu_dai_name = "omap-mcpdm",
+		.codec_dai_name = "twl6040-legacy",
+		.platform_name = "omap-pcm-audio",
+		.codec_name = "twl6040-codec",
+		.init = omapabe_twl6040_init,
+		.ops = &omapabe_ops,
+	},
+};
+
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-	.dai_link = sdp4430_dai,
-	.num_links = ARRAY_SIZE(sdp4430_dai),
-
 	.dapm_widgets = twl6040_dapm_widgets,
 	.num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets),
 	.dapm_routes = audio_map,
@@ -266,6 +276,14 @@ static __devinit int omapabe_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	if (pdata->has_dmic) {
+		card->dai_link = twl6040_dmic_dai;
+		card->num_links = ARRAY_SIZE(twl6040_dmic_dai);
+	} else {
+		card->dai_link = twl6040_only_dai;
+		card->num_links = ARRAY_SIZE(twl6040_only_dai);
+	}
+
 	ret = snd_soc_register_card(card);
 	if (ret)
 		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
-- 
1.7.8.1

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

* [PATCH v3 7/9] ASoC: omap-abe-twl6040: Configure card according to platform data
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

Disable the not connected pins on the board based on the
received platform data.
DO not register the jack function on boards, which does not have
means to detect it (jack is always connected).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   44 ++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 9e6e4c2..3627bf2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -157,10 +157,32 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"AFMR", NULL, "Line In"},
 };
 
+static inline void twl6040_disconnect_pin(struct snd_soc_dapm_context *dapm,
+					  int connected, char *pin)
+{
+	if (!connected)
+		snd_soc_dapm_disable_pin(dapm, pin);
+}
+
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
-	int ret, hs_trim;
+	struct snd_soc_card *card = codec->card;
+	struct snd_soc_dapm_context *dapm = &codec->dapm;
+	struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev);
+	int hs_trim;
+	int ret = 0;
+
+	/* Disable not connected paths if not used */
+	twl6040_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone");
+	twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk");
+	twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk");
+	twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out");
+	twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vinrator");
+	twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
+	twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic");
+	twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic");
+	twl6040_disconnect_pin(dapm, pdata->has_afm, "Line In");
 
 	/*
 	 * Configure McPDM offset cancellation based on the HSOTRIM value from
@@ -170,19 +192,17 @@ static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	omap_mcpdm_configure_dn_offsets(rtd, TWL6040_HSF_TRIM_LEFT(hs_trim),
 					TWL6040_HSF_TRIM_RIGHT(hs_trim));
 
-	/* Headset jack detection */
-	ret = snd_soc_jack_new(codec, "Headset Jack",
-				SND_JACK_HEADSET, &hs_jack);
-	if (ret)
-		return ret;
-
-	ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
-				hs_jack_pins);
+	/* Headset jack detection only if it is supported */
+	if (pdata->jack_detection) {
+		ret = snd_soc_jack_new(codec, "Headset Jack",
+					SND_JACK_HEADSET, &hs_jack);
+		if (ret)
+			return ret;
 
-	if (machine_is_omap_4430sdp())
+		ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
+					hs_jack_pins);
 		twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET);
-	else
-		snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET);
+	}
 
 	return ret;
 }
-- 
1.7.8.1


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

* [PATCH v3 7/9] ASoC: omap-abe-twl6040: Configure card according to platform data
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Disable the not connected pins on the board based on the
received platform data.
DO not register the jack function on boards, which does not have
means to detect it (jack is always connected).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-abe-twl6040.c |   44 ++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 9e6e4c2..3627bf2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -157,10 +157,32 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"AFMR", NULL, "Line In"},
 };
 
+static inline void twl6040_disconnect_pin(struct snd_soc_dapm_context *dapm,
+					  int connected, char *pin)
+{
+	if (!connected)
+		snd_soc_dapm_disable_pin(dapm, pin);
+}
+
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
-	int ret, hs_trim;
+	struct snd_soc_card *card = codec->card;
+	struct snd_soc_dapm_context *dapm = &codec->dapm;
+	struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev);
+	int hs_trim;
+	int ret = 0;
+
+	/* Disable not connected paths if not used */
+	twl6040_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone");
+	twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk");
+	twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk");
+	twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out");
+	twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vinrator");
+	twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
+	twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic");
+	twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic");
+	twl6040_disconnect_pin(dapm, pdata->has_afm, "Line In");
 
 	/*
 	 * Configure McPDM offset cancellation based on the HSOTRIM value from
@@ -170,19 +192,17 @@ static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	omap_mcpdm_configure_dn_offsets(rtd, TWL6040_HSF_TRIM_LEFT(hs_trim),
 					TWL6040_HSF_TRIM_RIGHT(hs_trim));
 
-	/* Headset jack detection */
-	ret = snd_soc_jack_new(codec, "Headset Jack",
-				SND_JACK_HEADSET, &hs_jack);
-	if (ret)
-		return ret;
-
-	ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
-				hs_jack_pins);
+	/* Headset jack detection only if it is supported */
+	if (pdata->jack_detection) {
+		ret = snd_soc_jack_new(codec, "Headset Jack",
+					SND_JACK_HEADSET, &hs_jack);
+		if (ret)
+			return ret;
 
-	if (machine_is_omap_4430sdp())
+		ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
+					hs_jack_pins);
 		twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET);
-	else
-		snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET);
+	}
 
 	return ret;
 }
-- 
1.7.8.1

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

* [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi, Santosh Shilimkar, David Anders

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>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: David Anders <x0132446@ti.com>
---
 arch/arm/mach-omap2/board-omap4panda.c |   57 +++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index b6f1144..8963dfe 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 <asm/hardware/gic.h>
@@ -90,9 +91,31 @@ static struct platform_device leds_gpio = {
 	},
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+	/* Audio out */
+	.has_hs		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* HandsFree through expasion connector */
+	.has_hf		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
+	.has_aux	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* PandaBoard: FM RX, PandaBoardES: audio in */
+	.has_afm	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* No jack detection. */
+	.jack_detection	= 0,
+};
+
+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 +274,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 +588,20 @@ void omap4_panda_display_init(void)
 	omap_display_init(&omap4_panda_dss_data);
 }
 
+static void omap4_panda_init_rev(void)
+{
+	if (cpu_is_omap4430()) {
+		/* PandaBoard 4430 */
+		/* ASoC audio configuration */
+		panda_abe_audio_data.card_name = "PandaBoard";
+		panda_abe_audio_data.has_hsmic = 1;
+	} else {
+		/* PandaBoard ES */
+		/* ASoC audio configuration */
+		panda_abe_audio_data.card_name = "PandaBoardES";
+	}
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
@@ -559,6 +613,7 @@ static void __init omap4_panda_init(void)
 	if (wl12xx_set_platform_data(&omap_panda_wlan_data))
 		pr_err("error setting wl12xx data\n");
 
+	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
 	platform_device_register(&omap_vwlan_device);
-- 
1.7.8.1


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

* [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

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>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
CC: David Anders <x0132446@ti.com>
---
 arch/arm/mach-omap2/board-omap4panda.c |   57 +++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index b6f1144..8963dfe 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 <asm/hardware/gic.h>
@@ -90,9 +91,31 @@ static struct platform_device leds_gpio = {
 	},
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+	/* Audio out */
+	.has_hs		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* HandsFree through expasion connector */
+	.has_hf		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
+	.has_aux	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* PandaBoard: FM RX, PandaBoardES: audio in */
+	.has_afm	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+	/* No jack detection. */
+	.jack_detection	= 0,
+};
+
+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 +274,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 +588,20 @@ void omap4_panda_display_init(void)
 	omap_display_init(&omap4_panda_dss_data);
 }
 
+static void omap4_panda_init_rev(void)
+{
+	if (cpu_is_omap4430()) {
+		/* PandaBoard 4430 */
+		/* ASoC audio configuration */
+		panda_abe_audio_data.card_name = "PandaBoard";
+		panda_abe_audio_data.has_hsmic = 1;
+	} else {
+		/* PandaBoard ES */
+		/* ASoC audio configuration */
+		panda_abe_audio_data.card_name = "PandaBoardES";
+	}
+}
+
 static void __init omap4_panda_init(void)
 {
 	int package = OMAP_PACKAGE_CBS;
@@ -559,6 +613,7 @@ static void __init omap4_panda_init(void)
 	if (wl12xx_set_platform_data(&omap_panda_wlan_data))
 		pr_err("error setting wl12xx data\n");
 
+	omap4_panda_init_rev();
 	omap4_panda_i2c_init();
 	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
 	platform_device_register(&omap_vwlan_device);
-- 
1.7.8.1

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

* [PATCH v3 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards
  2011-12-22 19:34 ` Peter Ujfalusi
@ 2011-12-22 19:34   ` Peter Ujfalusi
  -1 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Tony Lindgren
  Cc: Misael Lopez Cruz, alsa-devel, linux-omap, linux-arm-kernel,
	Peter Ujfalusi

Enable ASoC audio support for OMAP4 based machines with
twl6040 codec via the omap-abe-twl6040 machine driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 98410b8..47b23fe 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -99,7 +99,7 @@ config SND_OMAP_SOC_SDP3430
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
-	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP
+	depends on TWL4030_CORE && SND_OMAP_SOC && ARCH_OMAP4
 	select SND_OMAP_SOC_DMIC
 	select SND_OMAP_SOC_MCPDM
 	select SND_SOC_TWL6040
@@ -108,6 +108,8 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	  Say Y if you want to add support for SoC audio on OMAP boards using
 	  ABE and twl6040 codec. This driver currently supports:
 	  - SDP4430/Blaze boards
+	  - PandaBoard (4430)
+	  - PandaBoardES (4460)
 
 config SND_OMAP_SOC_OMAP4_HDMI
 	tristate "SoC Audio support for Texas Instruments OMAP4 HDMI"
-- 
1.7.8.1


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

* [PATCH v3 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards
@ 2011-12-22 19:34   ` Peter Ujfalusi
  0 siblings, 0 replies; 30+ messages in thread
From: Peter Ujfalusi @ 2011-12-22 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Enable ASoC audio support for OMAP4 based machines with
twl6040 codec via the omap-abe-twl6040 machine driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/Kconfig |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 98410b8..47b23fe 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -99,7 +99,7 @@ config SND_OMAP_SOC_SDP3430
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec"
-	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP
+	depends on TWL4030_CORE && SND_OMAP_SOC && ARCH_OMAP4
 	select SND_OMAP_SOC_DMIC
 	select SND_OMAP_SOC_MCPDM
 	select SND_SOC_TWL6040
@@ -108,6 +108,8 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	  Say Y if you want to add support for SoC audio on OMAP boards using
 	  ABE and twl6040 codec. This driver currently supports:
 	  - SDP4430/Blaze boards
+	  - PandaBoard (4430)
+	  - PandaBoardES (4460)
 
 config SND_OMAP_SOC_OMAP4_HDMI
 	tristate "SoC Audio support for Texas Instruments OMAP4 HDMI"
-- 
1.7.8.1

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

* Re: [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio
  2011-12-22 19:34   ` Peter Ujfalusi
@ 2011-12-22 19:37     ` Tony Lindgren
  -1 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2011-12-22 19:37 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Mark Brown, Misael Lopez Cruz, alsa-devel,
	linux-omap, linux-arm-kernel, Santosh Shilimkar

* Peter Ujfalusi <peter.ujfalusi@ti.com> [111222 11:03]:
> To avoid breakage in audio support with the coming change
> in ASoC machine driver (conversion to platfrom device).
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/mach-omap2/board-4430sdp.c |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> index 21b62bd..394cbab 100644
> --- a/arch/arm/mach-omap2/board-4430sdp.c
> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> @@ -41,6 +41,7 @@
>  #include <video/omap-panel-nokia-dsi.h>
>  #include <video/omap-panel-picodlp.h>
>  #include <linux/wl12xx.h>
> +#include <linux/platform_data/omap-abe-twl6040.h>
>  
>  #include "mux.h"
>  #include "hsmmc.h"
> @@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
>  	.id	= -1,
>  };
>  
> +static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
> +	.card_name = "SDP4430",
> +	.has_hs		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +	.has_hf		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +	.has_ep		= 1,
> +	.has_aux	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +	.has_vibra	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +
> +	.has_dmic	= 1,
> +	.has_hsmic	= 1,
> +	.has_mainmic	= 1,
> +	.has_submic	= 1,
> +	.has_afm	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +
> +	.jack_detection = 1,
> +};
> +
> +static struct platform_device sdp4430_abe_audio = {
> +	.name		= "omap-abe-twl6040",
> +	.id		= -1,
> +	.dev = {
> +		.platform_data = &sdp4430_abe_audio_data,
> +	},
> +};
> +
>  static struct platform_device *sdp4430_devices[] __initdata = {
>  	&sdp4430_gpio_keys_device,
>  	&sdp4430_leds_gpio,
>  	&sdp4430_leds_pwm,
>  	&sdp4430_vbat,
>  	&sdp4430_dmic_codec,
> +	&sdp4430_abe_audio,
>  };
>  
>  static struct omap_musb_board_data musb_board_data = {
> -- 
> 1.7.8.1
> 

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

* [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio
@ 2011-12-22 19:37     ` Tony Lindgren
  0 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2011-12-22 19:37 UTC (permalink / raw)
  To: linux-arm-kernel

* Peter Ujfalusi <peter.ujfalusi@ti.com> [111222 11:03]:
> To avoid breakage in audio support with the coming change
> in ASoC machine driver (conversion to platfrom device).
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/mach-omap2/board-4430sdp.c |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> index 21b62bd..394cbab 100644
> --- a/arch/arm/mach-omap2/board-4430sdp.c
> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> @@ -41,6 +41,7 @@
>  #include <video/omap-panel-nokia-dsi.h>
>  #include <video/omap-panel-picodlp.h>
>  #include <linux/wl12xx.h>
> +#include <linux/platform_data/omap-abe-twl6040.h>
>  
>  #include "mux.h"
>  #include "hsmmc.h"
> @@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
>  	.id	= -1,
>  };
>  
> +static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
> +	.card_name = "SDP4430",
> +	.has_hs		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +	.has_hf		= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +	.has_ep		= 1,
> +	.has_aux	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +	.has_vibra	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +
> +	.has_dmic	= 1,
> +	.has_hsmic	= 1,
> +	.has_mainmic	= 1,
> +	.has_submic	= 1,
> +	.has_afm	= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
> +
> +	.jack_detection = 1,
> +};
> +
> +static struct platform_device sdp4430_abe_audio = {
> +	.name		= "omap-abe-twl6040",
> +	.id		= -1,
> +	.dev = {
> +		.platform_data = &sdp4430_abe_audio_data,
> +	},
> +};
> +
>  static struct platform_device *sdp4430_devices[] __initdata = {
>  	&sdp4430_gpio_keys_device,
>  	&sdp4430_leds_gpio,
>  	&sdp4430_leds_pwm,
>  	&sdp4430_vbat,
>  	&sdp4430_dmic_codec,
> +	&sdp4430_abe_audio,
>  };
>  
>  static struct omap_musb_board_data musb_board_data = {
> -- 
> 1.7.8.1
> 

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

* Re: [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support
  2011-12-22 19:34   ` Peter Ujfalusi
@ 2011-12-22 19:38     ` Tony Lindgren
  -1 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2011-12-22 19:38 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Mark Brown, Misael Lopez Cruz, alsa-devel,
	linux-omap, linux-arm-kernel, Santosh Shilimkar, David Anders

* Peter Ujfalusi <peter.ujfalusi@ti.com> [111222 11:03]:
> 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>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> CC: David Anders <x0132446@ti.com>

Acked-by: Tony Lindgren <tony@atomide.com>

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

* [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support
@ 2011-12-22 19:38     ` Tony Lindgren
  0 siblings, 0 replies; 30+ messages in thread
From: Tony Lindgren @ 2011-12-22 19:38 UTC (permalink / raw)
  To: linux-arm-kernel

* Peter Ujfalusi <peter.ujfalusi@ti.com> [111222 11:03]:
> 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>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> CC: David Anders <x0132446@ti.com>

Acked-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio
  2011-12-22 19:34   ` Peter Ujfalusi
@ 2011-12-23  6:13     ` Shilimkar, Santosh
  -1 siblings, 0 replies; 30+ messages in thread
From: Shilimkar, Santosh @ 2011-12-23  6:13 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Mark Brown, Tony Lindgren, Misael Lopez Cruz,
	alsa-devel, linux-omap, linux-arm-kernel

On Fri, Dec 23, 2011 at 1:04 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> To avoid breakage in audio support with the coming change
> in ASoC machine driver (conversion to platfrom device).
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

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

* [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio
@ 2011-12-23  6:13     ` Shilimkar, Santosh
  0 siblings, 0 replies; 30+ messages in thread
From: Shilimkar, Santosh @ 2011-12-23  6:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 23, 2011 at 1:04 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> To avoid breakage in audio support with the coming change
> in ASoC machine driver (conversion to platfrom device).
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

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

* Re: [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support
  2011-12-22 19:34   ` Peter Ujfalusi
@ 2011-12-23  6:13     ` Shilimkar, Santosh
  -1 siblings, 0 replies; 30+ messages in thread
From: Shilimkar, Santosh @ 2011-12-23  6:13 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Mark Brown, Tony Lindgren, Misael Lopez Cruz,
	alsa-devel, linux-omap, linux-arm-kernel, David Anders

On Fri, Dec 23, 2011 at 1:04 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> 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>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> CC: David Anders <x0132446@ti.com>
> ---
Looks good.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support
@ 2011-12-23  6:13     ` Shilimkar, Santosh
  0 siblings, 0 replies; 30+ messages in thread
From: Shilimkar, Santosh @ 2011-12-23  6:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 23, 2011 at 1:04 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> 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>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> CC: David Anders <x0132446@ti.com>
> ---
Looks good.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

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

* Re: [PATCH v3 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio
  2011-12-22 19:34   ` Peter Ujfalusi
@ 2011-12-23 10:37     ` Mark Brown
  -1 siblings, 0 replies; 30+ messages in thread
From: Mark Brown @ 2011-12-23 10:37 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Liam Girdwood, Tony Lindgren, Misael Lopez Cruz, alsa-devel,
	linux-omap, linux-arm-kernel

On Thu, Dec 22, 2011 at 09:34:26PM +0200, Peter Ujfalusi wrote:

>  include/linux/platform_data/omap-abe-twl6040.h |   48 ++++++++++++++++++++++++

I have to say I'm still really unhappy with the name - it's not like we
should ever be seeing an omap-twl6040 driver but the naming suggests
that there should be.  Bypassing the ABE ought to be a runtime decision
as it's policy and might change with use case.  But anyway:

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* [PATCH v3 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio
@ 2011-12-23 10:37     ` Mark Brown
  0 siblings, 0 replies; 30+ messages in thread
From: Mark Brown @ 2011-12-23 10:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 22, 2011 at 09:34:26PM +0200, Peter Ujfalusi wrote:

>  include/linux/platform_data/omap-abe-twl6040.h |   48 ++++++++++++++++++++++++

I have to say I'm still really unhappy with the name - it's not like we
should ever be seeing an omap-twl6040 driver but the naming suggests
that there should be.  Bypassing the ABE ought to be a runtime decision
as it's policy and might change with use case.  But anyway:

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

end of thread, other threads:[~2011-12-23 10:37 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-22 19:34 [PATCH v3 0/9] OMAP4: ASoC: Support for PandaBoard family Peter Ujfalusi
2011-12-22 19:34 ` Peter Ujfalusi
2011-12-22 19:34 ` [PATCH v3 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-23 10:37   ` Mark Brown
2011-12-23 10:37     ` Mark Brown
2011-12-22 19:34 ` [PATCH v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:37   ` Tony Lindgren
2011-12-22 19:37     ` Tony Lindgren
2011-12-23  6:13   ` Shilimkar, Santosh
2011-12-23  6:13     ` Shilimkar, Santosh
2011-12-22 19:34 ` [PATCH v3 3/9] ASoC: omap-abe-twl6040: Convert to platform deriver Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:34 ` [PATCH v3 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:34 ` [PATCH v3 5/9] ASoC: omap-abe-twl6040: Add complete DAPM routing Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:34 ` [PATCH v3 6/9] ASoC: omap-abe-twl6040: DAI link selection based on platform data Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:34 ` [PATCH v3 7/9] ASoC: omap-abe-twl6040: Configure card according to " Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:34 ` [PATCH v3 8/9] OMAP4: omap4panda: Enable audio support Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi
2011-12-22 19:38   ` Tony Lindgren
2011-12-22 19:38     ` Tony Lindgren
2011-12-23  6:13   ` Shilimkar, Santosh
2011-12-23  6:13     ` Shilimkar, Santosh
2011-12-22 19:34 ` [PATCH v3 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards Peter Ujfalusi
2011-12-22 19:34   ` Peter Ujfalusi

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.