--- a/arch/arm/mach-msm/qdsp6v2/rtac.c
+++ b/arch/arm/mach-msm/qdsp6v2/rtac.c
@@ -442,7 +442,9 @@ u32 send_adm_apr(void *buf, u32 opcode)
}
- if (payload_size > MAX_PAYLOAD_SIZE) {
+ if ((payload_size < 0) ||
+ (payload_size > MAX_PAYLOAD_SIZE)) {
+
pr_err("%s: Invalid payload size = %d\n",
__func__, payload_size);
goto done;
@@ -612,7 +614,9 @@ u32 send_rtac_asm_apr(void *buf, u32 opc
goto done;
}
- if (payload_size > MAX_PAYLOAD_SIZE) {
+ if ((payload_size < 0) ||
+ (payload_size > MAX_PAYLOAD_SIZE)) {
+
pr_err("%s: Invalid payload size = %d\n",
__func__, payload_size);
goto done;
@@ -719,7 +723,7 @@ void rtac_set_voice_handle(u32 mode, voi
bool rtac_make_voice_callback(u32 mode, uint32_t *payload, u32 payload_size)
{
if ((atomic_read(&rtac_voice_apr_data[mode].cmd_state) != 1) ||
- (mode >= RTAC_VOICE_MODES))
+ (mode < 0) || (mode >= RTAC_VOICE_MODES))
return false;
pr_debug("%s\n", __func__);
@@ -778,7 +782,9 @@ u32 send_voice_apr(u32 mode, void *buf,
goto done;
}
- if (payload_size > MAX_PAYLOAD_SIZE) {
+ if ((payload_size < 0) ||
+ (payload_size > MAX_PAYLOAD_SIZE)) {
+
pr_err("%s: Invalid payload size = %d\n",
__func__, payload_size);
goto done;
--- a/sound/soc/msm/msm-pcm-routing.h
+++ b/sound/soc/msm/msm-pcm-routing.h
@@ -81,6 +81,10 @@ enum {
MSM_BACKEND_DAI_MAX,
};
+struct msm_pcm_routing_ops {
+ int (*get_q6_effect) (void);
+};
+
/* dai_id: front-end ID,
* dspst_id: DSP audio stream ID
* stream_type: playback or capture
@@ -89,7 +93,13 @@ void msm_pcm_routing_reg_phy_stream(int
int stream_type);
void msm_pcm_routing_dereg_phy_stream(int fedai_id, int stream_type);
+int msm_pcm_routing_get_port(struct snd_pcm_substream *substream);
+
int lpa_set_volume(unsigned volume);
+int compr_set_volume(unsigned volume);
+
int msm_routing_check_backend_enabled(int fedai_id);
+
+void htc_8960_register_pcm_routing_ops(struct msm_pcm_routing_ops *ops);
#endif /*_MSM_PCM_H*/
--- a/sound/soc/msm/msm-pcm-voip.c
+++ b/sound/soc/msm/msm-pcm-voip.c
@@ -31,7 +31,7 @@
#include "qdsp6/q6voice.h"
#define VOIP_MIN_Q_LEN 2
-#define VOIP_MAX_Q_LEN 4
+#define VOIP_MAX_Q_LEN 10
#define VOIP_MAX_VOC_PKT_SIZE 640
#define VOIP_MIN_VOC_PKT_SIZE 320
--- a/sound/soc/msm/qdsp6/q6adm.c
+++ b/sound/soc/msm/qdsp6/q6adm.c
@@ -138,6 +138,72 @@ static int32_t adm_callback(struct apr_c
return 0;
}
+int q6adm_enable_effect(int port_id, uint32_t module_id, uint32_t param_id,
+ uint32_t payload_size, void *payload)
+{
+ void *q6_cmd = NULL;
+ void *data = NULL;
+ struct asm_pp_params_command *cmd = NULL;
+ int ret = 0, sz = 0;
+
+ pr_info("%s: param_id 0x%x, payload size %d\n",
+ __func__, param_id, payload_size);
+ sz = sizeof(struct asm_pp_params_command) + payload_size;
+ q6_cmd = kzalloc(sz, GFP_KERNEL);
+ if (q6_cmd == NULL) {
+ pr_err("%s[%d]: Mem alloc failed\n",
+ __func__, port_id);
+ return -ENOMEM;
+ }
+
+ cmd = (struct asm_pp_params_command *)q6_cmd;
+ cmd->payload = NULL;
+ cmd->payload_size = sizeof(struct asm_pp_param_data_hdr) + payload_size;
+
+ cmd->params.module_id = module_id;
+ cmd->params.param_id = param_id;
+ cmd->params.param_size = payload_size;
+ cmd->params.reserved = 0;
+
+ cmd->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
+ APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER);
+ cmd->hdr.pkt_size = sz;
+ cmd->hdr.src_svc = APR_SVC_ADM;
+ cmd->hdr.src_domain = APR_DOMAIN_APPS;
+ cmd->hdr.src_port = port_id;
+ cmd->hdr.dest_svc = APR_SVC_ADM;
+ cmd->hdr.dest_domain = APR_DOMAIN_ADSP;
+ cmd->hdr.dest_port = atomic_read(&this_adm.copp_id[port_id]);
+ cmd->hdr.token = port_id;
+ cmd->hdr.opcode = ADM_CMD_SET_PARAMS;
+
+ data = (u8 *)(q6_cmd + sizeof(struct asm_pp_params_command));
+ memcpy(data, payload, payload_size);
+
+ ret = apr_send_pkt(this_adm.apr, (uint32_t *)q6_cmd);
+ if (ret < 0) {
+ pr_err("%s: ADM enable for port %d failed\n",
+ __func__, port_id);
+ ret = -EINVAL;
+ goto fail_cmd;
+ }
+ ret = wait_event_timeout(this_adm.wait,
+ atomic_read(&this_adm.copp_stat[port_id]),
+ msecs_to_jiffies(TIMEOUT_MS));
+ if (!ret) {
+ pr_err("%s: ADM open failed for port %d\n",
+ __func__, port_id);
+ ret = -EINVAL;
+ goto fail_cmd;
+ }
+ ret = 0;
+
+fail_cmd:
+ kfree(q6_cmd);
+ pr_info("%s: return %d\n", __func__, ret);
+ return ret;
+}
+
static int send_adm_cal_block(int port_id, struct acdb_cal_block *aud_cal)
{
s32 result = 0;
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -792,6 +792,7 @@ int soc_pcm_close(struct snd_pcm_substre
if (platform->driver->ops && platform->driver->ops->close)
platform->driver->ops->close(substream);
cpu_dai->runtime = NULL;
+ printk(KERN_INFO "[AUD] soc_pcm_close(), set runtume null\n");
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
/* start delayed pop wq here for playback streams */
@@ -1221,6 +1222,11 @@ int snd_soc_suspend(struct device *dev)
/* close any waiting streams and save state */
for (i = 0; i < card->num_rtd; i++) {
+ /* do not flush delayed work to trigger DAPM when DAi is ignore_suspend */
+ if (card->rtd[i].dai_link->ignore_suspend ||
+ card->rtd[i].dai_link->no_pcm)
+ continue;
+
flush_delayed_work_sync(&card->rtd[i].delayed_work);
card->rtd[i].codec->dapm.suspend_bias_level = card->rtd[i].codec->dapm.bias_level;
}
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -70,6 +70,7 @@ static int dapm_up_seq[] = {
[snd_soc_dapm_mixer] = 7,
[snd_soc_dapm_mixer_named_ctl] = 7,
[snd_soc_dapm_pga] = 8,
+ [snd_soc_dapm_adc] = 9,
[snd_soc_dapm_out_drv] = 10,
[snd_soc_dapm_hp] = 10,
[snd_soc_dapm_spk] = 10,