ASoC: msm7x27A: Added support for ALSA driver
ALSA driver from legacy are enabled to work on 7x27A
and 7x27A.
CRs-Fixed: 299738
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Conflicts:
arch/arm/mach-msm/board-msm7x27a.c
diff --git a/sound/soc/msm/Kconfig b/sound/soc/msm/Kconfig
index 485d3db5..dd96d65 100644
--- a/sound/soc/msm/Kconfig
+++ b/sound/soc/msm/Kconfig
@@ -9,7 +9,7 @@
config SND_MSM_SOC
tristate "SoC Audio for the MSM series chips"
- depends on ARCH_MSM_ARM11 && SND_SOC && MSM_ADSP
+ depends on ARCH_MSM7X27
select SND_MSM_DAI_SOC
select SND_MSM_SOC_MSM7K
default n
diff --git a/sound/soc/msm/msm-dai.c b/sound/soc/msm/msm-dai.c
index 6ebee51..61e4675 100644
--- a/sound/soc/msm/msm-dai.c
+++ b/sound/soc/msm/msm-dai.c
@@ -2,7 +2,7 @@
*
* Copyright (C) 2008 Google, Inc.
* Copyright (C) 2008 HTC Corporation
- * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
*
* Derived from msm-pcm.c and msm7201.c.
*
@@ -30,11 +30,7 @@
#include <sound/pcm.h>
#include <sound/initval.h>
#include <sound/soc.h>
-#ifdef CONFIG_ARCH_MSM_ARM11
#include "msm-pcm.h"
-#else
-#include "qsd-pcm.h"
-#endif
static struct snd_soc_dai_driver msm_pcm_codec_dais[] = {
{
diff --git a/sound/soc/msm/msm7201.c b/sound/soc/msm/msm7201.c
index 061529a..9e041c7 100644
--- a/sound/soc/msm/msm7201.c
+++ b/sound/soc/msm/msm7201.c
@@ -1,6 +1,6 @@
/* linux/sound/soc/msm/msm7201.c
*
- * Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008-2009, 2011 Code Aurora Forum. All rights reserved.
*
* All source code in this file is licensed under the following license except
* where indicated.
@@ -44,6 +44,7 @@
struct msm_snd_rpc_ids {
unsigned long prog;
unsigned long vers;
+ unsigned long vers2;
unsigned long rpc_set_snd_device;
int device;
};
@@ -92,7 +93,7 @@
struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
- uinfo->count = 1; /* Device */
+ uinfo->count = 3; /* Device */
/*
* The number of devices supported is 26 (0 to 25)
@@ -113,6 +114,7 @@
{
snd_rpc_ids.prog = 0x30000002;
snd_rpc_ids.vers = 0x00020001;
+ snd_rpc_ids.vers2 = 0x00030001;
/*
* The magic number 2 corresponds to the rpc call
* index for snd_set_device
@@ -138,8 +140,16 @@
snd_ep = msm_rpc_connect_compatible(snd_rpc_ids.prog,
snd_rpc_ids.vers, 0);
if (IS_ERR(snd_ep)) {
- printk(KERN_ERR "%s: failed (compatible VERS = %ld)\n",
+ printk(KERN_DEBUG "%s failed (compatible VERS = %ld) \
+ trying again with another API\n",
__func__, snd_rpc_ids.vers);
+ snd_ep =
+ msm_rpc_connect_compatible(snd_rpc_ids.prog,
+ snd_rpc_ids.vers2, 0);
+ }
+ if (IS_ERR(snd_ep)) {
+ printk(KERN_ERR "%s: failed (compatible VERS = %ld)\n",
+ __func__, snd_rpc_ids.vers2);
snd_ep = NULL;
return -EAGAIN;
}
@@ -187,8 +197,10 @@
req.hdr.rpc_vers = 2;
req.rpc_snd_device = cpu_to_be32(snd_rpc_ids.device);
- req.snd_mute_ear_mute = cpu_to_be32(1);
- req.snd_mute_mic_mute = cpu_to_be32(0);
+ req.snd_mute_ear_mute =
+ cpu_to_be32((int)ucontrol->value.integer.value[1]);
+ req.snd_mute_mic_mute =
+ cpu_to_be32((int)ucontrol->value.integer.value[2]);
req.callback_ptr = -1;
req.client_data = cpu_to_be32(0);