Skip to contentSkip to conversation

ASoC updates

PATCH In review Mark Brown 2 participants 15 messages Nov 25, 2008

Subsystems (8)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover ASoC updates

The following changes since commit 4f904735c809e44c11f57cd4f82446aac1243e0e:
Mark Brown (1):
ALSA: ASoC: Fix typo in snd_soc_card update documentation

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-tiwai

Arun KS (1):
ASoC: Fix TWL4030 Kconfig dependency

Dmitry Baryshkov (1):
ASoC: tosa: move gpio probing to machine callbacks

Jarkko Nikula (2):
ASoC: OMAP: Apply channel constrains to N810 machine driver
ASoC: OMAP: Add support for mono audio links in McBSP DAI

Mark Brown (4):
ASoC: Use supplied DAI for WM9713 rather than substream
ASoC: Remove DAI type information
ASoC: Flag AD1980 as an AC97 interface
ASoC: Lower priority of resume work logging

Misael Lopez Cruz (1):
ASoC: Add support for TI SDP3430

Peter Ujfalusi (4):
ASoC: TWL4030: Disable soft-volume
ASoC: TWL4030: Change the Master volume control to TLV
ASoC: TWL4030: Add CGAIN volume control
ASoC: TWL4030: Add helper function for output gain controls

 include/sound/soc-dai.h            |    2 +-
 include/sound/soc.h                |    8 --
 sound/soc/atmel/atmel_ssc_dai.c    |    3 -
 sound/soc/au1x/psc-ac97.c          |    2 +-
 sound/soc/au1x/psc-i2s.c           |    1 -
 sound/soc/blackfin/bf5xx-ac97.c    |    2 +-
 sound/soc/blackfin/bf5xx-i2s.c     |    1 -
 sound/soc/codecs/ac97.c            |    2 +-
 sound/soc/codecs/ad1980.c          |    1 +
 sound/soc/codecs/pcm3008.c         |    1 -
 sound/soc/codecs/twl4030.c         |  180 +++++++++++++++++++++++++++++++++++-
 sound/soc/codecs/wm9712.c          |    2 +-
 sound/soc/codecs/wm9713.c          |   18 +---
 sound/soc/davinci/davinci-i2s.c    |    1 -
 sound/soc/fsl/mpc5200_psc_i2s.c    |    1 -
 sound/soc/omap/Kconfig             |   11 ++-
 sound/soc/omap/Makefile            |    3 +-
 sound/soc/omap/n810.c              |    4 +
 sound/soc/omap/omap-mcbsp.c        |   24 +++--
 sound/soc/omap/sdp3430.c           |  152 ++++++++++++++++++++++++++++++
 sound/soc/pxa/pxa-ssp.c            |    4 -
 sound/soc/pxa/pxa2xx-ac97.c        |    6 +-
 sound/soc/pxa/pxa2xx-i2s.c         |    1 -
 sound/soc/pxa/tosa.c               |   30 +++++--
 sound/soc/s3c24xx/neo1973_wm8753.c |    1 -
 sound/soc/s3c24xx/s3c2412-i2s.c    |    1 -
 sound/soc/s3c24xx/s3c2443-ac97.c   |    4 +-
 sound/soc/s3c24xx/s3c24xx-i2s.c    |    1 -
 sound/soc/sh/hac.c                 |    4 +-
 sound/soc/sh/ssi.c                 |    2 -
 sound/soc/soc-core.c               |   39 +++------
 31 files changed, 410 insertions(+), 102 deletions(-)
 create mode 100644 sound/soc/omap/sdp3430.c
author
#1 lore raw

PATCH 1/13 ASoC: Use supplied DAI for WM9713 rather than substream

---
 sound/soc/codecs/wm9713.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
sound/soc/codecs/wm9713.c +4 -12
index 7be811a..a502667 100644
@@ -931,9 +931,7 @@ static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream,
 				struct snd_pcm_hw_params *params,
 				struct snd_soc_dai *dai)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_device *socdev = rtd->socdev;
-	struct snd_soc_codec *codec = socdev->codec;
+	struct snd_soc_codec *codec = dai->codec;
 	u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xfff3;
 
 	switch (params_format(params)) {
@@ -958,9 +956,7 @@ static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream,
 static void wm9713_voiceshutdown(struct snd_pcm_substream *substream,
 				 struct snd_soc_dai *dai)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_device *socdev = rtd->socdev;
-	struct snd_soc_codec *codec = socdev->codec;
+	struct snd_soc_codec *codec = dai->codec;
 	u16 status;
 
 	/* Gracefully shut down the voice interface. */
@@ -974,10 +970,8 @@ static void wm9713_voiceshutdown(struct snd_pcm_substream *substream,
 static int ac97_hifi_prepare(struct snd_pcm_substream *substream,
 			     struct snd_soc_dai *dai)
 {
+	struct snd_soc_codec *codec = dai->codec;
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_device *socdev = rtd->socdev;
-	struct snd_soc_codec *codec = socdev->codec;
 	int reg;
 	u16 vra;
 
@@ -995,10 +989,8 @@ static int ac97_hifi_prepare(struct snd_pcm_substream *substream,
 static int ac97_aux_prepare(struct snd_pcm_substream *substream,
 			    struct snd_soc_dai *dai)
 {
+	struct snd_soc_codec *codec = dai->codec;
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_device *socdev = rtd->socdev;
-	struct snd_soc_codec *codec = socdev->codec;
 	u16 vra, xsle;
 
 	vra = ac97_read(codec, AC97_EXTENDED_STATUS);
Signature · 1 line
1.5.6.5
author
#2 lore raw

PATCH 2/13 ASoC: TWL4030: Disable soft-volume

From: Peter Ujfalusi <[email protected]>

Keep Soft-volume disabled for now, since if it is enabled the FGAIN volume controls are not working in the current configuration:
CODEC_MODE:OPT_MODE = 1
OPTION:ARXR2_EN = 1
OPTION:ARXL2_EN = 1
OPTION:ARXR1_EN = 0
OPTION:ARXL1_VRX_EN = 0
RX_PATH_SEL:RXL1_SEL = 0x0 (or 0x1) RX_PATH_SEL:RXR1_SEL = 0x0 (or 0x1)

After the patch, FGAIN volume control works.

---
 sound/soc/codecs/twl4030.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/twl4030.c +1 -1
index 3348951..49c7da3 100644
@@ -87,7 +87,7 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
 	0x00, /* REG_ALC_SET1		(0x2C)	*/
 	0x00, /* REG_ALC_SET2		(0x2D)	*/
 	0x00, /* REG_BOOST_CTL		(0x2E)	*/
-	0x01, /* REG_SOFTVOL_CTL	(0x2F)	*/
+	0x00, /* REG_SOFTVOL_CTL	(0x2F)	*/
 	0x00, /* REG_DTMF_FREQSEL	(0x30)	*/
 	0x00, /* REG_DTMF_TONEXT1H	(0x31)	*/
 	0x00, /* REG_DTMF_TONEXT1L	(0x32)	*/
Signature · 1 line
1.5.6.5
author
#3 lore raw

PATCH 3/13 ASoC: TWL4030: Change the Master volume control to TLV

From: Peter Ujfalusi <[email protected]>

TWL4030 FGAIN volume control has a range:
-62 to 0 dB in 1 dB steps, 0 in the FGAIN means mute.

---
 sound/soc/codecs/twl4030.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
sound/soc/codecs/twl4030.c +9 -2
index 49c7da3..498c42f 100644
@@ -33,6 +33,7 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 #include <sound/initval.h>
+#include <sound/tlv.h>
 
 #include "twl4030.h"
 
@@ -189,10 +190,16 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
 
 }
 
+/*
+ * FGAIN volume control:
+ * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
+ */
+static DECLARE_TLV_DB_SCALE(master_tlv, -6300, 100, 1);
+
 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
-	SOC_DOUBLE_R("Master Playback Volume",
+	SOC_DOUBLE_R_TLV("Master Playback Volume",
 		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
-		0, 0x3f, 0),
+		0, 0x3f, 0, master_tlv),
 	SOC_DOUBLE_R("Capture Volume",
 		 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
 		0, 0x1f, 0),
Signature · 1 line
1.5.6.5
author
#4 lore raw

PATCH 4/13 ASoC: TWL4030: Add CGAIN volume control

From: Peter Ujfalusi <[email protected]>

Add CGAIN (Coarse gain control) to TWL4030 codec.
The range of the CGAIN is:
0 dB to 12 dB in 6 dB steps.

---
 sound/soc/codecs/twl4030.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +10 -0
index 498c42f..91effd3 100644
@@ -196,10 +196,20 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
  */
 static DECLARE_TLV_DB_SCALE(master_tlv, -6300, 100, 1);
 
+/*
+ * CGAIN volume control:
+ * 0 dB to 12 dB in 6 dB steps
+ * value 2 and 3 means 12 dB
+ */
+static DECLARE_TLV_DB_SCALE(master_coarse_tlv, 0, 600, 0);
+
 static const struct snd_kcontrol_new twl4030_snd_controls[] = {
 	SOC_DOUBLE_R_TLV("Master Playback Volume",
 		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
 		0, 0x3f, 0, master_tlv),
+	SOC_DOUBLE_R_TLV("Master PCM Playback Volume",
+		 TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+		6, 0x2, 0, master_coarse_tlv),
 	SOC_DOUBLE_R("Capture Volume",
 		 TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
 		0, 0x1f, 0),
Signature · 1 line
1.5.6.5
author
#5 lore raw

PATCH 5/13 ASoC: TWL4030: Add helper function for output gain controls

From: Peter Ujfalusi <[email protected]>

Some of the gain controls in TWL (mostly those which are associated with the outputs) are implemented in an interesting way:
0x0 : Power down (mute)
0x1 : 6dB
0x2 : 0 dB
0x3 : -6 dB
Inverting not going to help with these.
Custom volsw and volsw_2r get/put functions to handle these gains.

---
 sound/soc/codecs/twl4030.c |  157 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 157 insertions(+), 0 deletions(-)
sound/soc/codecs/twl4030.c +157 -0
index 91effd3..4136231 100644
@@ -191,6 +191,163 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
 }
 
 /*
+ * Some of the gain controls in TWL (mostly those which are associated with
+ * the outputs) are implemented in an interesting way:
+ * 0x0 : Power down (mute)
+ * 0x1 : 6dB
+ * 0x2 : 0 dB
+ * 0x3 : -6 dB
+ * Inverting not going to help with these.
+ * Custom volsw and volsw_2r get/put functions to handle these gain bits.
+ */
+#define SOC_DOUBLE_TLV_TWL4030(xname, xreg, shift_left, shift_right, xmax,\
+			       xinvert, tlv_array) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+	.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
+		 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
+	.tlv.p = (tlv_array), \
+	.info = snd_soc_info_volsw, \
+	.get = snd_soc_get_volsw_twl4030, \
+	.put = snd_soc_put_volsw_twl4030, \
+	.private_value = (unsigned long)&(struct soc_mixer_control) \
+		{.reg = xreg, .shift = shift_left, .rshift = shift_right,\
+		 .max = xmax, .invert = xinvert} }
+#define SOC_DOUBLE_R_TLV_TWL4030(xname, reg_left, reg_right, xshift, xmax,\
+				 xinvert, tlv_array) \
+{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
+	.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
+		 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
+	.tlv.p = (tlv_array), \
+	.info = snd_soc_info_volsw_2r, \
+	.get = snd_soc_get_volsw_r2_twl4030,\
+	.put = snd_soc_put_volsw_r2_twl4030, \
+	.private_value = (unsigned long)&(struct soc_mixer_control) \
+		{.reg = reg_left, .rreg = reg_right, .shift = xshift, \
+		.max = xmax, .invert = xinvert} }
+#define SOC_SINGLE_TLV_TWL4030(xname, xreg, xshift, xmax, xinvert, tlv_array) \
+	SOC_DOUBLE_TLV_TWL4030(xname, xreg, xshift, xshift, xmax, \
+			       xinvert, tlv_array)
+
+static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+	unsigned int reg = mc->reg;
+	unsigned int shift = mc->shift;
+	unsigned int rshift = mc->rshift;
+	int max = mc->max;
+	int mask = (1 << fls(max)) - 1;
+
+	ucontrol->value.integer.value[0] =
+		(snd_soc_read(codec, reg) >> shift) & mask;
+	if (ucontrol->value.integer.value[0])
+		ucontrol->value.integer.value[0] =
+			max + 1 - ucontrol->value.integer.value[0];
+
+	if (shift != rshift) {
+		ucontrol->value.integer.value[1] =
+			(snd_soc_read(codec, reg) >> rshift) & mask;
+		if (ucontrol->value.integer.value[1])
+			ucontrol->value.integer.value[1] =
+				max + 1 - ucontrol->value.integer.value[1];
+	}
+
+	return 0;
+}
+
+static int snd_soc_put_volsw_twl4030(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+	unsigned int reg = mc->reg;
+	unsigned int shift = mc->shift;
+	unsigned int rshift = mc->rshift;
+	int max = mc->max;
+	int mask = (1 << fls(max)) - 1;
+	unsigned short val, val2, val_mask;
+
+	val = (ucontrol->value.integer.value[0] & mask);
+
+	val_mask = mask << shift;
+	if (val)
+		val = max + 1 - val;
+	val = val << shift;
+	if (shift != rshift) {
+		val2 = (ucontrol->value.integer.value[1] & mask);
+		val_mask |= mask << rshift;
+		if (val2)
+			val2 = max + 1 - val2;
+		val |= val2 << rshift;
+	}
+	return snd_soc_update_bits(codec, reg, val_mask, val);
+}
+
+static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+	unsigned int reg = mc->reg;
+	unsigned int reg2 = mc->rreg;
+	unsigned int shift = mc->shift;
+	int max = mc->max;
+	int mask = (1<<fls(max))-1;
+
+	ucontrol->value.integer.value[0] =
+		(snd_soc_read(codec, reg) >> shift) & mask;
+	ucontrol->value.integer.value[1] =
+		(snd_soc_read(codec, reg2) >> shift) & mask;
+
+	if (ucontrol->value.integer.value[0])
+		ucontrol->value.integer.value[0] =
+			max + 1 - ucontrol->value.integer.value[0];
+	if (ucontrol->value.integer.value[1])
+		ucontrol->value.integer.value[1] =
+			max + 1 - ucontrol->value.integer.value[1];
+
+	return 0;
+}
+
+static int snd_soc_put_volsw_r2_twl4030(struct snd_kcontrol *kcontrol,
+	struct snd_ctl_elem_value *ucontrol)
+{
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+	unsigned int reg = mc->reg;
+	unsigned int reg2 = mc->rreg;
+	unsigned int shift = mc->shift;
+	int max = mc->max;
+	int mask = (1 << fls(max)) - 1;
+	int err;
+	unsigned short val, val2, val_mask;
+
+	val_mask = mask << shift;
+	val = (ucontrol->value.integer.value[0] & mask);
+	val2 = (ucontrol->value.integer.value[1] & mask);
+
+	if (val)
+		val = max + 1 - val;
+	if (val2)
+		val2 = max + 1 - val2;
+
+	val = val << shift;
+	val2 = val2 << shift;
+
+	err = snd_soc_update_bits(codec, reg, val_mask, val);
+	if (err < 0)
+		return err;
+
+	err = snd_soc_update_bits(codec, reg2, val_mask, val2);
+	return err;
+}
+
+/*
  * FGAIN volume control:
  * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
  */
Signature · 1 line
1.5.6.5
author
#6 lore raw

PATCH 6/13 ASoC: Remove DAI type information

DAI type information is only ever used within ASoC in order to special case AC97 and for diagnostic purposes. Since modern CPUs and codecs support multi function DAIs which can be configured for several modes it is more trouble than it's worth to maintain anything other than a flag identifying AC97 DAIs so remove the type field and replace it with an ac97_control flag.

---
 include/sound/soc-dai.h            |    2 +-
 include/sound/soc.h                |    8 --------
 sound/soc/atmel/atmel_ssc_dai.c    |    3 ---
 sound/soc/au1x/psc-ac97.c          |    2 +-
 sound/soc/au1x/psc-i2s.c           |    1 -
 sound/soc/blackfin/bf5xx-ac97.c    |    2 +-
 sound/soc/blackfin/bf5xx-i2s.c     |    1 -
 sound/soc/codecs/ac97.c            |    2 +-
 sound/soc/codecs/pcm3008.c         |    1 -
 sound/soc/codecs/wm9712.c          |    2 +-
 sound/soc/codecs/wm9713.c          |    2 +-
 sound/soc/davinci/davinci-i2s.c    |    1 -
 sound/soc/fsl/mpc5200_psc_i2s.c    |    1 -
 sound/soc/omap/omap-mcbsp.c        |    1 -
 sound/soc/pxa/pxa-ssp.c            |    4 ----
 sound/soc/pxa/pxa2xx-ac97.c        |    6 +++---
 sound/soc/pxa/pxa2xx-i2s.c         |    1 -
 sound/soc/s3c24xx/neo1973_wm8753.c |    1 -
 sound/soc/s3c24xx/s3c2412-i2s.c    |    1 -
 sound/soc/s3c24xx/s3c2443-ac97.c   |    4 ++--
 sound/soc/s3c24xx/s3c24xx-i2s.c    |    1 -
 sound/soc/sh/hac.c                 |    4 ++--
 sound/soc/sh/ssi.c                 |    2 --
 sound/soc/soc-core.c               |   31 ++++++++-----------------------
 24 files changed, 21 insertions(+), 63 deletions(-)
include/sound/soc-dai.h +1 -1
index f51cb55..a01a24b 100644
@@ -184,7 +184,7 @@ struct snd_soc_dai {
 	/* DAI description */
 	char *name;
 	unsigned int id;
-	unsigned char type;
+	int ac97_control;
 
 	/* DAI callbacks */
 	int (*probe)(struct platform_device *pdev,
include/sound/soc.h +0 -8
index e4465f7..444f9c2 100644
@@ -143,14 +143,6 @@ enum snd_soc_bias_level {
 	SND_SOC_BIAS_OFF,
 };
 
-/*
- * Digital Audio Interface (DAI) types
- */
-#define SND_SOC_DAI_AC97	0x1
-#define SND_SOC_DAI_I2S		0x2
-#define SND_SOC_DAI_PCM		0x4
-#define SND_SOC_DAI_AC97_BUS	0x8	/* for custom i.e. non ac97_codec.c */
-
 struct snd_soc_device;
 struct snd_soc_pcm_stream;
 struct snd_soc_ops;
sound/soc/atmel/atmel_ssc_dai.c +0 -3
index 916f73b..0bb18df 100644
@@ -702,7 +702,6 @@ static int atmel_ssc_resume(struct platform_device *pdev,
 struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
 	{	.name = "atmel-ssc0",
 		.id = 0,
-		.type = SND_SOC_DAI_PCM,
 		.suspend = atmel_ssc_suspend,
 		.resume = atmel_ssc_resume,
 		.playback = {
@@ -727,7 +726,6 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
 #if NUM_SSC_DEVICES == 3
 	{	.name = "atmel-ssc1",
 		.id = 1,
-		.type = SND_SOC_DAI_PCM,
 		.suspend = atmel_ssc_suspend,
 		.resume = atmel_ssc_resume,
 		.playback = {
@@ -751,7 +749,6 @@ struct snd_soc_dai atmel_ssc_dai[NUM_SSC_DEVICES] = {
 	},
 	{	.name = "atmel-ssc2",
 		.id = 2,
-		.type = SND_SOC_DAI_PCM,
 		.suspend = atmel_ssc_suspend,
 		.resume = atmel_ssc_resume,
 		.playback = {
sound/soc/au1x/psc-ac97.c +1 -1
index ad60a60..a0bcfea 100644
@@ -346,7 +346,7 @@ static int au1xpsc_ac97_resume(struct platform_device *pdev,
 
 struct snd_soc_dai au1xpsc_ac97_dai = {
 	.name			= "au1xpsc_ac97",
-	.type			= SND_SOC_DAI_AC97,
+	.ac97_control		= 1,
 	.probe			= au1xpsc_ac97_probe,
 	.remove			= au1xpsc_ac97_remove,
 	.suspend		= au1xpsc_ac97_suspend,
sound/soc/au1x/psc-i2s.c +0 -1
index 05a5acb..f4217e7 100644
@@ -371,7 +371,6 @@ static int au1xpsc_i2s_resume(struct platform_device *pdev,
 
 struct snd_soc_dai au1xpsc_i2s_dai = {
 	.name			= "au1xpsc_i2s",
-	.type			= SND_SOC_DAI_I2S,
 	.probe			= au1xpsc_i2s_probe,
 	.remove			= au1xpsc_i2s_remove,
 	.suspend		= au1xpsc_i2s_suspend,
sound/soc/blackfin/bf5xx-ac97.c +1 -1
index 5dcd3f6..709bdf0 100644
@@ -409,7 +409,7 @@ static void bf5xx_ac97_remove(struct platform_device *pdev,
 struct snd_soc_dai bfin_ac97_dai = {
 	.name = "bf5xx-ac97",
 	.id = 0,
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.probe = bf5xx_ac97_probe,
 	.remove = bf5xx_ac97_remove,
 	.suspend = bf5xx_ac97_suspend,
sound/soc/blackfin/bf5xx-i2s.c +0 -1
index 4e675b5..6e5036b 100644
@@ -292,7 +292,6 @@ static int bf5xx_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai bf5xx_i2s_dai = {
 	.name = "bf5xx-i2s",
 	.id = 0,
-	.type = SND_SOC_DAI_I2S,
 	.probe = bf5xx_i2s_probe,
 	.remove = bf5xx_i2s_remove,
 	.suspend = bf5xx_i2s_suspend,
sound/soc/codecs/ac97.c +1 -1
index 8a93aff..c4208c8 100644
@@ -43,7 +43,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
 
 struct snd_soc_dai ac97_dai = {
 	.name = "AC97 HiFi",
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.playback = {
 		.stream_name = "AC97 Playback",
 		.channels_min = 1,
sound/soc/codecs/pcm3008.c +0 -1
index 2b26e1d..651a15e 100644
@@ -33,7 +33,6 @@
 
 struct snd_soc_dai pcm3008_dai = {
 	.name = "PCM3008 HiFi",
-	.type = SND_SOC_DAI_I2S,
 	.playback = {
 		.stream_name = "PCM3008 Playback",
 		.channels_min = 1,
sound/soc/codecs/wm9712.c +1 -1
index 6e3e0f3..40f1406 100644
@@ -535,7 +535,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
 struct snd_soc_dai wm9712_dai[] = {
 {
 	.name = "AC97 HiFi",
-	.type = SND_SOC_DAI_AC97_BUS,
+	.ac97_control = 1,
 	.playback = {
 		.stream_name = "HiFi Playback",
 		.channels_min = 1,
sound/soc/codecs/wm9713.c +1 -1
index a502667..9dad0bf 100644
@@ -1024,7 +1024,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream,
 struct snd_soc_dai wm9713_dai[] = {
 {
 	.name = "AC97 HiFi",
-	.type = SND_SOC_DAI_AC97_BUS,
+	.ac97_control = 1,
 	.playback = {
 		.stream_name = "HiFi Playback",
 		.channels_min = 1,
sound/soc/davinci/davinci-i2s.c +0 -1
index 7a17cd0..cf31b3b 100644
@@ -460,7 +460,6 @@ static void davinci_i2s_remove(struct platform_device *pdev,
 struct snd_soc_dai davinci_i2s_dai = {
 	.name = "davinci-i2s",
 	.id = 0,
-	.type = SND_SOC_DAI_I2S,
 	.probe = davinci_i2s_probe,
 	.remove = davinci_i2s_remove,
 	.playback = {
sound/soc/fsl/mpc5200_psc_i2s.c +0 -1
index e2c172f..9ad8f9a 100644
@@ -469,7 +469,6 @@ static int psc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int format)
  * psc_i2s_dai_template: template CPU Digital Audio Interface
  */
 static struct snd_soc_dai psc_i2s_dai_template = {
-	.type = SND_SOC_DAI_I2S,
 	.playback = {
 		.channels_min = 2,
 		.channels_max = 2,
sound/soc/omap/omap-mcbsp.c +0 -1
index 2eeb135..252bc7e 100644
@@ -456,7 +456,6 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 {								\
 	.name = "omap-mcbsp-dai-"#link_id,			\
 	.id = (link_id),					\
-	.type = SND_SOC_DAI_I2S,				\
 	.playback = {						\
 		.channels_min = 2,				\
 		.channels_max = 2,				\
sound/soc/pxa/pxa-ssp.c +0 -4
index d0dd624..402fc5b 100644
@@ -788,7 +788,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
 	{
 		.name = "pxa2xx-ssp1",
 		.id = 0,
-		.type = SND_SOC_DAI_PCM,
 		.probe = pxa_ssp_probe,
 		.remove = pxa_ssp_remove,
 		.suspend = pxa_ssp_suspend,
@@ -820,7 +819,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
 	},
 	{	.name = "pxa2xx-ssp2",
 		.id = 1,
-		.type = SND_SOC_DAI_PCM,
 		.probe = pxa_ssp_probe,
 		.remove = pxa_ssp_remove,
 		.suspend = pxa_ssp_suspend,
@@ -853,7 +851,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
 	{
 		.name = "pxa2xx-ssp3",
 		.id = 2,
-		.type = SND_SOC_DAI_PCM,
 		.probe = pxa_ssp_probe,
 		.remove = pxa_ssp_remove,
 		.suspend = pxa_ssp_suspend,
@@ -886,7 +883,6 @@ struct snd_soc_dai pxa_ssp_dai[] = {
 	{
 		.name = "pxa2xx-ssp4",
 		.id = 3,
-		.type = SND_SOC_DAI_PCM,
 		.probe = pxa_ssp_probe,
 		.remove = pxa_ssp_remove,
 		.suspend = pxa_ssp_suspend,
sound/soc/pxa/pxa2xx-ac97.c +3 -3
index 86667d2..bffbe28 100644
@@ -173,7 +173,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 {
 	.name = "pxa2xx-ac97",
 	.id = 0,
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.probe = pxa2xx_ac97_probe,
 	.remove = pxa2xx_ac97_remove,
 	.suspend = pxa2xx_ac97_suspend,
@@ -196,7 +196,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 {
 	.name = "pxa2xx-ac97-aux",
 	.id = 1,
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.playback = {
 		.stream_name = "AC97 Aux Playback",
 		.channels_min = 1,
@@ -215,7 +215,7 @@ struct snd_soc_dai pxa_ac97_dai[] = {
 {
 	.name = "pxa2xx-ac97-mic",
 	.id = 2,
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.capture = {
 		.stream_name = "AC97 Mic Capture",
 		.channels_min = 1,
sound/soc/pxa/pxa2xx-i2s.c +0 -1
index 9a3e55b..f9a9e2e 100644
@@ -340,7 +340,6 @@ static int pxa2xx_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai pxa_i2s_dai = {
 	.name = "pxa2xx-i2s",
 	.id = 0,
-	.type = SND_SOC_DAI_I2S,
 	.suspend = pxa2xx_i2s_suspend,
 	.resume = pxa2xx_i2s_resume,
 	.playback = {
sound/soc/s3c24xx/neo1973_wm8753.c +0 -1
index 528fc3f..3df2224 100644
@@ -548,7 +548,6 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
 static struct snd_soc_dai bt_dai = {
 	.name = "Bluetooth",
 	.id = 0,
-	.type = SND_SOC_DAI_PCM,
 	.playback = {
 		.channels_min = 1,
 		.channels_max = 1,
sound/soc/s3c24xx/s3c2412-i2s.c +0 -1
index 360cc2a..1c74104 100644
@@ -713,7 +713,6 @@ static int s3c2412_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai s3c2412_i2s_dai = {
 	.name	= "s3c2412-i2s",
 	.id	= 0,
-	.type	= SND_SOC_DAI_I2S,
 	.probe	= s3c2412_i2s_probe,
 	.suspend = s3c2412_i2s_suspend,
 	.resume = s3c2412_i2s_resume,
sound/soc/s3c24xx/s3c2443-ac97.c +2 -2
index 3137782..41bde6a 100644
@@ -358,7 +358,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
 {
 	.name = "s3c2443-ac97",
 	.id = 0,
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.probe = s3c2443_ac97_probe,
 	.remove = s3c2443_ac97_remove,
 	.playback = {
@@ -380,7 +380,7 @@ struct snd_soc_dai s3c2443_ac97_dai[] = {
 {
 	.name = "pxa2xx-ac97-mic",
 	.id = 1,
-	.type = SND_SOC_DAI_AC97,
+	.ac97_control = 1,
 	.capture = {
 		.stream_name = "AC97 Mic Capture",
 		.channels_min = 1,
sound/soc/s3c24xx/s3c24xx-i2s.c +0 -1
index 1bac9dd..8d9135f 100644
@@ -461,7 +461,6 @@ static int s3c24xx_i2s_resume(struct platform_device *pdev,
 struct snd_soc_dai s3c24xx_i2s_dai = {
 	.name = "s3c24xx-i2s",
 	.id = 0,
-	.type = SND_SOC_DAI_I2S,
 	.probe = s3c24xx_i2s_probe,
 	.suspend = s3c24xx_i2s_suspend,
 	.resume = s3c24xx_i2s_resume,
sound/soc/sh/hac.c +2 -2
index 3318071..c435913 100644
@@ -271,7 +271,7 @@ struct snd_soc_dai sh4_hac_dai[] = {
 {
 	.name			= "HAC0",
 	.id			= 0,
-	.type			= SND_SOC_DAI_AC97,
+	.ac97_control		= 1,
 	.playback = {
 		.rates		= AC97_RATES,
 		.formats	= AC97_FMTS,
@@ -291,8 +291,8 @@ struct snd_soc_dai sh4_hac_dai[] = {
 #ifdef CONFIG_CPU_SUBTYPE_SH7760
 {
 	.name			= "HAC1",
+	.ac97_control		= 1,
 	.id			= 1,
-	.type			= SND_SOC_DAI_AC97,
 	.playback = {
 		.rates		= AC97_RATES,
 		.formats	= AC97_FMTS,
sound/soc/sh/ssi.c +0 -2
index 52a2338..fed544a 100644
@@ -340,7 +340,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
 {
 	.name			= "SSI0",
 	.id			= 0,
-	.type			= SND_SOC_DAI_I2S,
 	.playback = {
 		.rates		= SSI_RATES,
 		.formats	= SSI_FMTS,
@@ -367,7 +366,6 @@ struct snd_soc_dai sh4_ssi_dai[] = {
 {
 	.name			= "SSI1",
 	.id			= 1,
-	.type			= SND_SOC_DAI_I2S,
 	.playback = {
 		.rates		= SSI_RATES,
 		.formats	= SSI_FMTS,
sound/soc/soc-core.c +8 -23
index 43f4060..0d47696 100644
@@ -100,20 +100,6 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
 }
 #endif
 
-static inline const char *get_dai_name(int type)
-{
-	switch (type) {
-	case SND_SOC_DAI_AC97_BUS:
-	case SND_SOC_DAI_AC97:
-		return "AC97";
-	case SND_SOC_DAI_I2S:
-		return "I2S";
-	case SND_SOC_DAI_PCM:
-		return "PCM";
-	}
-	return NULL;
-}
-
 /*
  * Called by ALSA when a PCM substream is opened, the runtime->hw record is
  * then initialized and any private data can be allocated. This also calls
@@ -652,7 +638,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
 
 	for (i = 0; i < card->num_links; i++) {
 		struct snd_soc_dai  *cpu_dai = card->dai_link[i].cpu_dai;
-		if (cpu_dai->suspend && cpu_dai->type != SND_SOC_DAI_AC97)
+		if (cpu_dai->suspend && !cpu_dai->ac97_control)
 			cpu_dai->suspend(pdev, cpu_dai);
 		if (platform->suspend)
 			platform->suspend(pdev, cpu_dai);
@@ -678,7 +664,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
 
 	for (i = 0; i < card->num_links; i++) {
 		struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
-		if (cpu_dai->suspend && cpu_dai->type == SND_SOC_DAI_AC97)
+		if (cpu_dai->suspend && cpu_dai->ac97_control)
 			cpu_dai->suspend(pdev, cpu_dai);
 	}
 
@@ -714,7 +700,7 @@ static void soc_resume_deferred(struct work_struct *work)
 
 	for (i = 0; i < card->num_links; i++) {
 		struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
-		if (cpu_dai->resume && cpu_dai->type == SND_SOC_DAI_AC97)
+		if (cpu_dai->resume && cpu_dai->ac97_control)
 			cpu_dai->resume(pdev, cpu_dai);
 	}
 
@@ -741,7 +727,7 @@ static void soc_resume_deferred(struct work_struct *work)
 
 	for (i = 0; i < card->num_links; i++) {
 		struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
-		if (cpu_dai->resume && cpu_dai->type != SND_SOC_DAI_AC97)
+		if (cpu_dai->resume && !cpu_dai->ac97_control)
 			cpu_dai->resume(pdev, cpu_dai);
 		if (platform->resume)
 			platform->resume(pdev, cpu_dai);
@@ -898,8 +884,8 @@ static int soc_new_pcm(struct snd_soc_device *socdev,
 	codec_dai->codec = socdev->codec;
 
 	/* check client and interface hw capabilities */
-	sprintf(new_name, "%s %s-%s-%d", dai_link->stream_name, codec_dai->name,
-		get_dai_name(cpu_dai->type), num);
+	sprintf(new_name, "%s %s-%d", dai_link->stream_name, codec_dai->name,
+		num);
 
 	if (codec_dai->playback.channels_min)
 		playback = 1;
@@ -1270,8 +1256,7 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
 				continue;
 			}
 		}
-		if (card->dai_link[i].codec_dai->type ==
-			SND_SOC_DAI_AC97_BUS)
+		if (card->dai_link[i].codec_dai->ac97_control)
 			ac97 = 1;
 	}
 	snprintf(codec->card->shortname, sizeof(codec->card->shortname),
@@ -1335,7 +1320,7 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev)
 #ifdef CONFIG_SND_SOC_AC97_BUS
 	for (i = 0; i < codec->num_dai; i++) {
 		codec_dai = &codec->dai[i];
-		if (codec_dai->type == SND_SOC_DAI_AC97_BUS && codec->ac97) {
+		if (codec_dai->ac97_control && codec->ac97) {
 			soc_ac97_dev_unregister(codec);
 			goto free_card;
 		}
Signature · 1 line
1.5.6.5
author
#7 lore raw

PATCH 7/13 ASoC: Flag AD1980 as an AC97 interface

Special handling is required for suspend and resume of AC97 codecs due to the control path going over the data bus.

---
 sound/soc/codecs/ad1980.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/soc/codecs/ad1980.c +1 -0
index 1a3ea05..a9a2681 100644
@@ -145,6 +145,7 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
 
 struct snd_soc_dai ad1980_dai = {
 	.name = "AC97",
+	.ac97_control = 1,
 	.playback = {
 		.stream_name = "Playback",
 		.channels_min = 2,
Signature · 1 line
1.5.6.5
author
#8 lore raw

PATCH 8/13 ASoC: Lower priority of resume work logging

Now that the ASoC resume has been punted to a workqueue for a release cycle without attracting bug reports it should be safe to make the log messages associated with it debug level, reducing noise and kernel size in production configurations.

---
 sound/soc/soc-core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/soc-core.c +4 -4
index 0d47696..dbd92e1 100644
@@ -693,7 +693,7 @@ static void soc_resume_deferred(struct work_struct *work)
 	 * so userspace apps are blocked from touching us
 	 */
 
-	dev_info(socdev->dev, "starting resume work\n");
+	dev_dbg(socdev->dev, "starting resume work\n");
 
 	if (card->resume_pre)
 		card->resume_pre(pdev);
@@ -736,7 +736,7 @@ static void soc_resume_deferred(struct work_struct *work)
 	if (card->resume_post)
 		card->resume_post(pdev);
 
-	dev_info(socdev->dev, "resume work completed\n");
+	dev_dbg(socdev->dev, "resume work completed\n");
 
 	/* userspace can access us now we are back as we were before */
 	snd_power_change_state(codec->card, SNDRV_CTL_POWER_D0);
@@ -747,10 +747,10 @@ static int soc_resume(struct platform_device *pdev)
 {
 	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
 
-	dev_info(socdev->dev, "scheduling resume work\n");
+	dev_dbg(socdev->dev, "scheduling resume work\n");
 
 	if (!schedule_work(&socdev->deferred_resume_work))
-		dev_err(socdev->dev, "work item may be lost\n");
+		dev_err(socdev->dev, "resume work item may be lost\n");
 
 	return 0;
 }
Signature · 1 line
1.5.6.5
author
#9 lore raw

PATCH 9/13 ASoC: OMAP: Apply channel constrains to N810 machine driver

From: Jarkko Nikula <[email protected]>

Prepare for upcoming McBSP DAI update adding support for mono links by restricting number of channels to 2 in N810. This is due tlv320aic3x which claims channels_min = 1 and playing pure mono audio over I2S would cause it to be played only from left channel if both cpu and codec DAI's claim to support mono.

---
 sound/soc/omap/n810.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
sound/soc/omap/n810.c +4 -0
index d216b4f..18e2062 100644
@@ -70,9 +70,13 @@ static void n810_ext_control(struct snd_soc_codec *codec)
 
 static int n810_startup(struct snd_pcm_substream *substream)
 {
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_codec *codec = rtd->socdev->codec;
 
+	snd_pcm_hw_constraint_minmax(runtime,
+				     SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
+
 	n810_ext_control(codec);
 	return clk_enable(sys_clkout2);
 }
Signature · 1 line
1.5.6.5
author
#10 lore raw

PATCH 10/13 ASoC: OMAP: Add support for mono audio links in McBSP DAI

From: Jarkko Nikula <[email protected]>

Patch adds support for mono audio links so that McBSP DAI can operate with real mono codecs. In I2S, the signalling remains the same but only first frame (left channel) is transmitting audio data and second frame having null data. In DSP_A, only first frame is transmitted.

---
 sound/soc/omap/omap-mcbsp.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
sound/soc/omap/omap-mcbsp.c +14 -9
index 252bc7e..e8f1314 100644
@@ -203,7 +203,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 	struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
 	struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
 	int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id;
-	int wlen;
+	int wlen, channels;
 	unsigned long port;
 
 	if (cpu_class_is_omap1()) {
@@ -232,12 +232,17 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 		return 0;
 	}
 
-	switch (params_channels(params)) {
+	channels = params_channels(params);
+	switch (channels) {
 	case 2:
-		/* Set 1 word per (McBPSP) frame and use dual-phase frames */
-		regs->rcr2	|= RFRLEN2(1 - 1) | RPHASE;
+		/* Use dual-phase frames */
+		regs->rcr2	|= RPHASE;
+		regs->xcr2	|= XPHASE;
+	case 1:
+		/* Set 1 word per (McBSP) frame */
+		regs->rcr2	|= RFRLEN2(1 - 1);
 		regs->rcr1	|= RFRLEN1(1 - 1);
-		regs->xcr2	|= XFRLEN2(1 - 1) | XPHASE;
+		regs->xcr2	|= XFRLEN2(1 - 1);
 		regs->xcr1	|= XFRLEN1(1 - 1);
 		break;
 	default:
@@ -266,8 +271,8 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 		regs->srgr1	|= FWID(wlen - 1);
 		break;
 	case SND_SOC_DAIFMT_DSP_A:
-		regs->srgr2	|= FPER(wlen * 2 - 1);
-		regs->srgr1	|= FWID(wlen * 2 - 2);
+		regs->srgr2	|= FPER(wlen * channels - 1);
+		regs->srgr1	|= FWID(wlen * channels - 2);
 		break;
 	}
 
@@ -457,13 +462,13 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 	.name = "omap-mcbsp-dai-"#link_id,			\
 	.id = (link_id),					\
 	.playback = {						\
-		.channels_min = 2,				\
+		.channels_min = 1,				\
 		.channels_max = 2,				\
 		.rates = OMAP_MCBSP_RATES,			\
 		.formats = SNDRV_PCM_FMTBIT_S16_LE,		\
 	},							\
 	.capture = {						\
-		.channels_min = 2,				\
+		.channels_min = 1,				\
 		.channels_max = 2,				\
 		.rates = OMAP_MCBSP_RATES,			\
 		.formats = SNDRV_PCM_FMTBIT_S16_LE,		\
Signature · 1 line
1.5.6.5
author
#11 lore raw

PATCH 11/13 ASoC: Fix TWL4030 Kconfig dependency

From: Arun KS <[email protected]>

Fixes Kconfig dependency of TWL4030 audio codec driver with TWL4030 core driver on both overo and omap2evm boards

---
 sound/soc/omap/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/omap/Kconfig +2 -2
index 6c56277..0900437 100644
@@ -24,7 +24,7 @@ config SND_OMAP_SOC_OSK5912
 
 config SND_OMAP_SOC_OVERO
 	tristate "SoC Audio support for Gumstix Overo"
-	depends on SND_OMAP_SOC && MACH_OVERO
+	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OVERO
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TWL4030
 	help
@@ -32,7 +32,7 @@ config SND_OMAP_SOC_OVERO
 
 config SND_OMAP_SOC_OMAP2EVM
 	tristate "SoC Audio support for OMAP2EVM board"
-	depends on SND_OMAP_SOC && MACH_OMAP2EVM
+	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP2EVM
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TWL4030
 	help
Signature · 1 line
1.5.6.5
author
#12 lore raw

PATCH 12/13 ASoC: Add support for TI SDP3430

From: Misael Lopez Cruz <[email protected]>

This patch add ASoC support for TI SDP3430. It's based on Gumstix Overo SoC code by Steve Sakoman.

---
 sound/soc/omap/Kconfig   |    7 ++
 sound/soc/omap/Makefile  |    3 +-
 sound/soc/omap/sdp3430.c |  152 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 161 insertions(+), 1 deletions(-)
 create mode 100644 sound/soc/omap/sdp3430.c
sound/soc/omap/Kconfig +7 -0
index 0900437..1cd0176 100644
@@ -38,5 +38,12 @@ config SND_OMAP_SOC_OMAP2EVM
 	help
 	  Say Y if you want to add support for SoC audio on the omap2evm board.
 
+config SND_OMAP_SOC_SDP3430
+	tristate "SoC Audio support for Texas Instruments SDP3430"
+	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_3430SDP
+	select SND_OMAP_SOC_MCBSP
+	select SND_SOC_TWL4030
+	help
+	  Say Y if you want to add support for SoC audio on Texas Instruments SDP3430.
 
 
sound/soc/omap/Makefile +2 -1
index f5da3cc..29cf3a8 100644
@@ -10,9 +10,10 @@ snd-soc-n810-objs := n810.o
 snd-soc-osk5912-objs := osk5912.o
 snd-soc-overo-objs := overo.o
 snd-soc-omap2evm-objs := omap2evm.o
+snd-soc-sdp3430-objs := sdp3430.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
 obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
 obj-$(CONFIG_MACH_OMAP2EVM) += snd-soc-omap2evm.o
-
+obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
sound/soc/omap/sdp3430.c new file +152 -0

152 lines not on this page · raw message

Signature · 1 line
1.5.6.5
author
#13 lore raw

PATCH 13/13 ASoC: tosa: move gpio probing to machine callbacks

From: Dmitry Baryshkov <[email protected]>

---
 sound/soc/pxa/tosa.c |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)
sound/soc/pxa/tosa.c +22 -8
index 9d9be5a..48242b3 100644
@@ -230,10 +230,32 @@ static struct snd_soc_dai_link tosa_dai[] = {
 },
 };
 
+static int tosa_probe(struct platform_device *dev)
+{
+	int ret;
+
+	ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
+	if (ret)
+		return ret;
+	ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
+	if (ret)
+		gpio_free(TOSA_GPIO_L_MUTE);
+
+	return ret;
+}
+
+static int tosa_remove(struct platform_device *dev)
+{
+	gpio_free(TOSA_GPIO_L_MUTE);
+	return 0;
+}
+
 static struct snd_soc_card tosa = {
 	.name = "Tosa",
 	.dai_link = tosa_dai,
 	.num_links = ARRAY_SIZE(tosa_dai),
+	.probe = tosa_probe,
+	.remove = tosa_remove,
 };
 
 static struct snd_soc_device tosa_snd_devdata = {
@@ -251,11 +273,6 @@ static int __init tosa_init(void)
 	if (!machine_is_tosa())
 		return -ENODEV;
 
-	ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
-	if (ret)
-		return ret;
-	gpio_direction_output(TOSA_GPIO_L_MUTE, 0);
-
 	tosa_snd_device = platform_device_alloc("soc-audio", -1);
 	if (!tosa_snd_device) {
 		ret = -ENOMEM;
@@ -272,15 +289,12 @@ static int __init tosa_init(void)
 	platform_device_put(tosa_snd_device);
 
 err_alloc:
-	gpio_free(TOSA_GPIO_L_MUTE);
-
 	return ret;
 }
 
 static void __exit tosa_exit(void)
 {
 	platform_device_unregister(tosa_snd_device);
-	gpio_free(TOSA_GPIO_L_MUTE);
 }
 
 module_init(tosa_init);
Signature · 1 line
1.5.6.5
#14 lore raw
In reply to Mark Brown

At Tue, 25 Nov 2008 15:43:03 +0000,

Quoted 8 lines · Mark Brown

The following changes since commit 4f904735c809e44c11f57cd4f82446aac1243e0e:
Mark Brown (1):
ALSA: ASoC: Fix typo in snd_soc_card update documentation

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-tiwai

Pulled in, pushed out now.

Thanks.

Takashi