ASoC: qdsp6v2: Remove Eagle code

Eagle driver is not in use any more.
Remove the code and associated calls
to it.

CRs-Fixed: 1103106
Change-Id: Ice5333861beda9538f0783b70b3267523d16fd2b
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
This commit is contained in:
Alexy Joseph 2017-03-03 18:50:21 -08:00 committed by Divya Narayanan Poojary
parent 3ea12dc1e0
commit 367fab472d
14 changed files with 21 additions and 2620 deletions

View File

@ -17,7 +17,6 @@
#include "q6audio_common.h"
#include "audio_utils_aio.h"
#include <sound/msm-audio-effects-q6-v2.h>
#include <sound/msm-dts-eagle.h>
#define MAX_CHANNELS_SUPPORTED 8
#define WAIT_TIMEDOUT_DURATION_SECS 1
@ -53,31 +52,11 @@ static void audio_effects_init_pp(struct audio_client *ac)
pr_err("%s: audio client null to init pp\n", __func__);
return;
}
switch (ac->topology) {
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER:
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_1);
if (ret < 0)
pr_err("%s: Send SoftVolume1 Param failed ret=%d\n",
__func__, ret);
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_2);
if (ret < 0)
pr_err("%s: Send SoftVolume2 Param failed ret=%d\n",
__func__, ret);
msm_dts_eagle_init_master_module(ac);
break;
default:
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_1);
if (ret < 0)
pr_err("%s: Send SoftVolume Param failed ret=%d\n",
__func__, ret);
break;
}
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_1);
if (ret < 0)
pr_err("%s: Send SoftVolume Param failed ret=%d\n",
__func__, ret);
}
static void audio_effects_deinit_pp(struct audio_client *ac)
@ -86,13 +65,6 @@ static void audio_effects_deinit_pp(struct audio_client *ac)
pr_err("%s: audio client null to deinit pp\n", __func__);
return;
}
switch (ac->topology) {
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER:
msm_dts_eagle_deinit_master_module(ac);
break;
default:
break;
}
}
static void audio_effects_event_handler(uint32_t opcode, uint32_t token,
@ -412,33 +384,6 @@ static long audio_effects_set_pp_param(struct q6audio_effects *effects,
&(effects->audio_effects.topo_switch_vol),
(long *)&values[1], SOFT_VOLUME_INSTANCE_2);
break;
case DTS_EAGLE_MODULE_ENABLE:
pr_debug("%s: DTS_EAGLE_MODULE_ENABLE\n", __func__);
if (msm_audio_effects_is_effmodule_supp_in_top(
effects_module, effects->ac->topology)) {
/*
* HPX->OFF: first disable HPX and then
* enable SA+
* HPX->ON: first disable SA+ and then
* enable HPX
*/
bool hpx_state = (bool)values[1];
if (hpx_state)
msm_audio_effects_enable_extn(effects->ac,
&(effects->audio_effects),
false);
msm_dts_eagle_enable_asm(effects->ac,
hpx_state,
AUDPROC_MODULE_ID_DTS_HPX_PREMIX);
msm_dts_eagle_enable_asm(effects->ac,
hpx_state,
AUDPROC_MODULE_ID_DTS_HPX_POSTMIX);
if (!hpx_state)
msm_audio_effects_enable_extn(effects->ac,
&(effects->audio_effects),
true);
}
break;
default:
pr_err("%s: Invalid effects config module\n", __func__);
rc = -EINVAL;

View File

@ -1,148 +0,0 @@
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only 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.
*/
#ifndef __MSM_DTS_EAGLE_H__
#define __MSM_DTS_EAGLE_H__
#include <linux/compat.h>
#include <sound/soc.h>
#include <sound/devdep_params.h>
#include <sound/q6asm-v2.h>
#ifdef CONFIG_COMPAT
enum {
DTS_EAGLE_IOCTL_GET_CACHE_SIZE32 = _IOR(0xF2, 0, __s32),
DTS_EAGLE_IOCTL_SET_CACHE_SIZE32 = _IOW(0xF2, 1, __s32),
DTS_EAGLE_IOCTL_GET_PARAM32 = _IOR(0xF2, 2, compat_uptr_t),
DTS_EAGLE_IOCTL_SET_PARAM32 = _IOW(0xF2, 3, compat_uptr_t),
DTS_EAGLE_IOCTL_SET_CACHE_BLOCK32 =
_IOW(0xF2, 4, compat_uptr_t),
DTS_EAGLE_IOCTL_SET_ACTIVE_DEVICE32 =
_IOW(0xF2, 5, compat_uptr_t),
DTS_EAGLE_IOCTL_GET_LICENSE32 =
_IOR(0xF2, 6, compat_uptr_t),
DTS_EAGLE_IOCTL_SET_LICENSE32 =
_IOW(0xF2, 7, compat_uptr_t),
DTS_EAGLE_IOCTL_SEND_LICENSE32 = _IOW(0xF2, 8, __s32),
DTS_EAGLE_IOCTL_SET_VOLUME_COMMANDS32 = _IOW(0xF2, 9,
compat_uptr_t),
};
#endif
#ifdef CONFIG_DTS_EAGLE
void msm_dts_ion_memmap(struct param_outband *po_);
int msm_dts_eagle_enable_asm(struct audio_client *ac, u32 enable, int module);
int msm_dts_eagle_enable_adm(int port_id, int copp_idx, u32 enable);
void msm_dts_eagle_add_controls(struct snd_soc_platform *platform);
int msm_dts_eagle_set_stream_gain(struct audio_client *ac,
int lgain, int rgain);
int msm_dts_eagle_handle_asm(struct dts_eagle_param_desc *depd, char *buf,
bool for_pre, bool get, struct audio_client *ac,
struct param_outband *po);
int msm_dts_eagle_handle_adm(struct dts_eagle_param_desc *depd, char *buf,
bool for_pre, bool get);
int msm_dts_eagle_ioctl(unsigned int cmd, unsigned long arg);
int msm_dts_eagle_is_hpx_on(void);
int msm_dts_eagle_init_pre(struct audio_client *ac);
int msm_dts_eagle_deinit_pre(struct audio_client *ac);
int msm_dts_eagle_init_post(int port_id, int copp_id);
int msm_dts_eagle_deinit_post(int port_id, int topology);
int msm_dts_eagle_init_master_module(struct audio_client *ac);
int msm_dts_eagle_deinit_master_module(struct audio_client *ac);
int msm_dts_eagle_pcm_new(struct snd_soc_pcm_runtime *runtime);
void msm_dts_eagle_pcm_free(struct snd_pcm *pcm);
int msm_dts_eagle_compat_ioctl(unsigned int cmd, unsigned long arg);
#else
static inline void msm_dts_ion_memmap(struct param_outband *po_)
{
pr_debug("%s\n", __func__);
}
static inline int msm_dts_eagle_enable_asm(struct audio_client *ac,
u32 enable, int module)
{
return 0;
}
static inline int msm_dts_eagle_enable_adm(int port_id, int copp_idx,
u32 enable)
{
return 0;
}
static inline void msm_dts_eagle_add_controls(struct snd_soc_platform *platform)
{
}
static inline int msm_dts_eagle_set_stream_gain(struct audio_client *ac,
int lgain, int rgain)
{
pr_debug("%s\n", __func__);
return 0;
}
static inline int msm_dts_eagle_handle_asm(struct dts_eagle_param_desc *depd,
char *buf, bool for_pre, bool get,
struct audio_client *ac,
struct param_outband *po)
{
return 0;
}
static inline int msm_dts_eagle_handle_adm(struct dts_eagle_param_desc *depd,
char *buf, bool for_pre, bool get)
{
return 0;
}
static inline int msm_dts_eagle_ioctl(unsigned int cmd, unsigned long arg)
{
return -EPERM;
}
static inline int msm_dts_eagle_is_hpx_on(void)
{
return 0;
}
static inline int msm_dts_eagle_init_pre(struct audio_client *ac)
{
return 0;
}
static inline int msm_dts_eagle_deinit_pre(struct audio_client *ac)
{
return 0;
}
static inline int msm_dts_eagle_init_post(int port_id, int coppid)
{
return 0;
}
static inline int msm_dts_eagle_deinit_post(int port_id, int topology)
{
return 0;
}
static inline int msm_dts_eagle_init_master_module(struct audio_client *ac)
{
return 0;
}
static inline int msm_dts_eagle_deinit_master_module(struct audio_client *ac)
{
return 0;
}
static inline int msm_dts_eagle_pcm_new(struct snd_soc_pcm_runtime *runtime)
{
pr_debug("%s\n", __func__);
return 0;
}
static inline void msm_dts_eagle_pcm_free(struct snd_pcm *pcm)
{
pr_debug("%s\n", __func__);
}
static inline int msm_dts_eagle_compat_ioctl(unsigned int cmd,
unsigned long arg)
{
return 0;
}
#endif
#endif

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -34,7 +34,6 @@ enum {
ADM_AUDVOL_CAL,
ADM_RTAC_INFO_CAL,
ADM_RTAC_APR_CAL,
ADM_DTS_EAGLE,
ADM_SRS_TRUMEDIA,
ADM_MAX_CAL_TYPES
};

View File

@ -9,7 +9,6 @@ snd-soc-qdsp6v2-objs += msm-dai-q6-v2.o msm-pcm-q6-v2.o msm-pcm-routing-v2.o \
obj-$(CONFIG_SND_SOC_QDSP6V2) += snd-soc-qdsp6v2.o msm-pcm-dtmf-v2.o \
msm-dai-stub-v2.o
obj-$(CONFIG_SND_HWDEP) += msm-pcm-routing-devdep.o
obj-$(CONFIG_DTS_EAGLE) += msm-dts-eagle.o
obj-$(CONFIG_DOLBY_DAP) += msm-dolby-dap-config.o
obj-$(CONFIG_DOLBY_DS2) += msm-ds2-dap-config.o
obj-$(CONFIG_DTS_SRS_TM) += msm-dts-srs-tm-config.o

View File

@ -136,8 +136,6 @@ size_t get_cal_info_size(int32_t cal_type)
case ULP_LSM_CAL_TYPE:
size = sizeof(struct audio_cal_info_lsm);
break;
case DTS_EAGLE_CAL_TYPE:
size = 0;
case AUDIO_CORE_METAINFO_CAL_TYPE:
size = sizeof(struct audio_cal_info_metainfo);
break;
@ -263,8 +261,6 @@ size_t get_user_cal_type_size(int32_t cal_type)
case ULP_LSM_CAL_TYPE:
size = sizeof(struct audio_cal_type_lsm);
break;
case DTS_EAGLE_CAL_TYPE:
size = 0;
case AUDIO_CORE_METAINFO_CAL_TYPE:
size = sizeof(struct audio_cal_type_metainfo);
break;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -15,7 +15,6 @@
#include <sound/q6asm-v2.h>
#include <sound/compress_params.h>
#include <sound/msm-audio-effects-q6-v2.h>
#include <sound/msm-dts-eagle.h>
#include <sound/devdep_params.h>
#define MAX_ENABLE_CMD_SIZE 32
@ -49,26 +48,6 @@ bool msm_audio_effects_is_effmodule_supp_in_top(int effect_module,
case EQ_MODULE:
switch (topology) {
case ASM_STREAM_POSTPROC_TOPO_ID_SA_PLUS:
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS:
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER:
return true;
default:
return false;
}
case DTS_EAGLE_MODULE:
switch (topology) {
case ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX:
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS:
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER:
return true;
default:
return false;
}
case SOFT_VOLUME2_MODULE:
case DTS_EAGLE_MODULE_ENABLE:
switch (topology) {
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS:
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER:
return true;
default:
return false;
@ -276,7 +255,7 @@ int msm_audio_effects_virtualizer_handler(struct audio_client *ac,
break;
}
}
if (params_length && !msm_dts_eagle_is_hpx_on() && (rc == 0))
if (params_length && (rc == 0))
q6asm_send_audio_effects_params(ac, params,
params_length);
else
@ -747,7 +726,7 @@ int msm_audio_effects_reverb_handler(struct audio_client *ac,
break;
}
}
if (params_length && !msm_dts_eagle_is_hpx_on() && (rc == 0))
if (params_length && (rc == 0))
q6asm_send_audio_effects_params(ac, params,
params_length);
else
@ -883,7 +862,7 @@ int msm_audio_effects_bass_boost_handler(struct audio_client *ac,
break;
}
}
if (params_length && !msm_dts_eagle_is_hpx_on() && (rc == 0))
if (params_length && (rc == 0))
q6asm_send_audio_effects_params(ac, params,
params_length);
else
@ -1223,7 +1202,7 @@ int msm_audio_effects_popless_eq_handler(struct audio_client *ac,
break;
}
}
if (params_length && !msm_dts_eagle_is_hpx_on() && (rc == 0))
if (params_length && (rc == 0))
q6asm_send_audio_effects_params(ac, params,
params_length);
else

View File

@ -43,8 +43,6 @@
#include <sound/compress_offload.h>
#include <sound/compress_driver.h>
#include <sound/msm-audio-effects-q6-v2.h>
#include <sound/msm-dts-eagle.h>
#include "msm-pcm-routing-v2.h"
#include "audio_ocmem.h"
@ -83,15 +81,6 @@ const DECLARE_TLV_DB_LINEAR(msm_compr_vol_gain, 0,
#define MAX_NUMBER_OF_STREAMS 2
/*
* Max size for getting DTS EAGLE Param through kcontrol
* Safe for both 32 and 64 bit platforms
* 64 = size of kcontrol value array on 64 bit platform
* 4 = size of parameters Eagle expects before cast to 64 bits
* 40 = size of dts_eagle_param_desc + module_id cast to 64 bits
*/
#define DTS_EAGLE_MAX_PARAM_SIZE_FOR_ALSA ((64 * 4) - 40)
struct msm_compr_gapless_state {
bool set_next_stream_id;
int32_t stream_opened[MAX_NUMBER_OF_STREAMS];
@ -310,11 +299,6 @@ static int msm_compr_set_volume(struct snd_compr_stream *cstream,
if (rc < 0)
pr_err("%s: Send vol gain command failed rc=%d\n",
__func__, rc);
else
if (msm_dts_eagle_set_stream_gain(prtd->audio_client,
volume_l, volume_r))
pr_debug("%s: DTS_EAGLE send stream gain failed\n",
__func__);
return rc;
}
@ -925,26 +909,6 @@ static int msm_compr_init_pp_params(struct snd_compr_stream *cstream,
};
switch (ac->topology) {
case ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS: /* HPX + SA+ topology */
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_1);
if (ret < 0)
pr_err("%s: Send SoftVolume Param failed ret=%d\n",
__func__, ret);
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_2);
if (ret < 0)
pr_err("%s: Send SoftVolume2 Param failed ret=%d\n",
__func__, ret);
/*
* HPX module init is trigerred from HAL using ioctl
* DTS_EAGLE_MODULE_ENABLE when stream starts
*/
break;
case ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX: /* HPX topology */
break;
default:
ret = q6asm_set_softvolume_v2(ac, &softvol,
SOFT_VOLUME_INSTANCE_1);
@ -2443,23 +2407,6 @@ static int msm_compr_audio_effects_config_put(struct snd_kcontrol *kcontrol,
&(audio_effects->equalizer),
values);
break;
case DTS_EAGLE_MODULE:
pr_debug("%s: DTS_EAGLE_MODULE\n", __func__);
if (!msm_audio_effects_is_effmodule_supp_in_top(effects_module,
prtd->audio_client->topology))
return 0;
msm_dts_eagle_handle_asm(NULL, (void *)values, true,
false, prtd->audio_client, NULL);
break;
case DTS_EAGLE_MODULE_ENABLE:
pr_debug("%s: DTS_EAGLE_MODULE_ENABLE\n", __func__);
if (msm_audio_effects_is_effmodule_supp_in_top(effects_module,
prtd->audio_client->topology))
msm_dts_eagle_enable_asm(prtd->audio_client,
(bool)values[0],
AUDPROC_MODULE_ID_DTS_HPX_PREMIX);
break;
case SOFT_VOLUME_MODULE:
pr_debug("%s: SOFT_VOLUME_MODULE\n", __func__);
break;
@ -2488,7 +2435,6 @@ static int msm_compr_audio_effects_config_get(struct snd_kcontrol *kcontrol,
struct msm_compr_audio_effects *audio_effects = NULL;
struct snd_compr_stream *cstream = NULL;
struct msm_compr_audio *prtd = NULL;
long *values = &(ucontrol->value.integer.value[0]);
pr_debug("%s\n", __func__);
if (fe_id >= MSM_FRONTEND_DAI_MAX) {
@ -2508,28 +2454,6 @@ static int msm_compr_audio_effects_config_get(struct snd_kcontrol *kcontrol,
return -EINVAL;
}
switch (audio_effects->query.mod_id) {
case DTS_EAGLE_MODULE:
pr_debug("%s: DTS_EAGLE_MODULE handling queued get\n",
__func__);
values[0] = (long)audio_effects->query.mod_id;
values[1] = (long)audio_effects->query.parm_id;
values[2] = (long)audio_effects->query.size;
values[3] = (long)audio_effects->query.offset;
values[4] = (long)audio_effects->query.device;
if (values[2] > DTS_EAGLE_MAX_PARAM_SIZE_FOR_ALSA) {
pr_err("%s: DTS_EAGLE_MODULE parameter's requested size (%li) too large (max size is %i)\n",
__func__, values[2],
DTS_EAGLE_MAX_PARAM_SIZE_FOR_ALSA);
return -EINVAL;
}
msm_dts_eagle_handle_asm(NULL, (void *)&values[1],
true, true, prtd->audio_client, NULL);
break;
default:
pr_err("%s: Invalid effects config module\n", __func__);
return -EINVAL;
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
/* Copyright (c) 2012-2014, 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 2016-2017, The Linux Foundation. All
* rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -19,7 +20,6 @@
#include <sound/control.h>
#include <sound/q6adm-v2.h>
#include <sound/asound.h>
#include <sound/msm-dts-eagle.h>
#include "msm-dts-srs-tm-config.h"
#include "msm-pcm-routing-v2.h"

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014, 2017 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -14,8 +14,6 @@
#include <linux/module.h>
#include <sound/hwdep.h>
#include <sound/devdep_params.h>
#include <sound/msm-dts-eagle.h>
#include "msm-pcm-routing-devdep.h"
#include "msm-ds2-dap-config.h"
@ -53,23 +51,6 @@ static int msm_pcm_routing_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
case SNDRV_DEVDEP_DAP_IOCTL_GET_VISUALIZER:
ret = msm_ds2_dap_ioctl(hw, file, cmd, argp);
break;
case DTS_EAGLE_IOCTL_GET_CACHE_SIZE:
case DTS_EAGLE_IOCTL_SET_CACHE_SIZE:
case DTS_EAGLE_IOCTL_GET_PARAM:
case DTS_EAGLE_IOCTL_SET_PARAM:
case DTS_EAGLE_IOCTL_SET_CACHE_BLOCK:
case DTS_EAGLE_IOCTL_SET_ACTIVE_DEVICE:
case DTS_EAGLE_IOCTL_GET_LICENSE:
case DTS_EAGLE_IOCTL_SET_LICENSE:
case DTS_EAGLE_IOCTL_SEND_LICENSE:
case DTS_EAGLE_IOCTL_SET_VOLUME_COMMANDS:
ret = msm_dts_eagle_ioctl(cmd, arg);
if (ret == -EPERM) {
pr_err("%s called with invalid control 0x%X\n",
__func__, cmd);
ret = -EINVAL;
}
break;
default:
pr_err("%s called with invalid control 0x%X\n", __func__, cmd);
ret = -EINVAL;
@ -81,7 +62,6 @@ static int msm_pcm_routing_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
void msm_pcm_routing_hwdep_free(struct snd_pcm *pcm)
{
pr_debug("%s\n", __func__);
msm_dts_eagle_pcm_free(pcm);
}
#ifdef CONFIG_COMPAT
@ -105,23 +85,6 @@ static int msm_pcm_routing_hwdep_compat_ioctl(struct snd_hwdep *hw,
case SNDRV_DEVDEP_DAP_IOCTL_GET_VISUALIZER32:
ret = msm_ds2_dap_compat_ioctl(hw, file, cmd, argp);
break;
case DTS_EAGLE_IOCTL_GET_CACHE_SIZE32:
case DTS_EAGLE_IOCTL_SET_CACHE_SIZE32:
case DTS_EAGLE_IOCTL_GET_PARAM32:
case DTS_EAGLE_IOCTL_SET_PARAM32:
case DTS_EAGLE_IOCTL_SET_CACHE_BLOCK32:
case DTS_EAGLE_IOCTL_SET_ACTIVE_DEVICE32:
case DTS_EAGLE_IOCTL_GET_LICENSE32:
case DTS_EAGLE_IOCTL_SET_LICENSE32:
case DTS_EAGLE_IOCTL_SEND_LICENSE32:
case DTS_EAGLE_IOCTL_SET_VOLUME_COMMANDS32:
ret = msm_dts_eagle_compat_ioctl(cmd, arg);
if (ret == -EPERM) {
pr_err("%s called with invalid control 0x%X\n",
__func__, cmd);
ret = -EINVAL;
}
break;
default:
pr_err("%s called with invalid control 0x%X\n", __func__, cmd);
ret = -EINVAL;
@ -167,7 +130,7 @@ int msm_pcm_routing_hwdep_new(struct snd_soc_pcm_runtime *runtime,
#ifdef CONFIG_COMPAT
hwdep->ops.ioctl_compat = msm_pcm_routing_hwdep_compat_ioctl;
#endif
return msm_dts_eagle_pcm_new(runtime);
return rc;
}
#endif

View File

@ -33,7 +33,6 @@
#include <sound/pcm_params.h>
#include <sound/q6core.h>
#include <sound/audio_cal_utils.h>
#include <sound/msm-dts-eagle.h>
#include <sound/audio_effects.h>
#include <sound/hwdep.h>
@ -155,10 +154,6 @@ static void msm_pcm_routing_cfg_pp(int port_id, int copp_idx, int topology,
__func__, topology, port_id, rc);
}
break;
case ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX:
pr_debug("%s: DTS_EAGLE_COPP_TOPOLOGY_ID\n", __func__);
msm_dts_eagle_init_post(port_id, copp_idx);
break;
case ADM_CMD_COPP_OPEN_TOPOLOGY_ID_AUDIOSPHERE:
pr_debug("%s: TOPOLOGY_ID_AUDIOSPHERE\n", __func__);
msm_qti_pp_asphere_init(port_id, copp_idx);
@ -190,10 +185,6 @@ static void msm_pcm_routing_deinit_pp(int port_id, int topology)
msm_dolby_dap_deinit(port_id);
}
break;
case ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX:
pr_debug("%s: DTS_EAGLE_COPP_TOPOLOGY_ID\n", __func__);
msm_dts_eagle_deinit_post(port_id, topology);
break;
case ADM_CMD_COPP_OPEN_TOPOLOGY_ID_AUDIOSPHERE:
pr_debug("%s: TOPOLOGY_ID_AUDIOSPHERE\n", __func__);
msm_qti_pp_asphere_deinit(port_id);
@ -6621,8 +6612,6 @@ static int msm_routing_probe(struct snd_soc_platform *platform)
device_pp_params_mixer_controls,
ARRAY_SIZE(device_pp_params_mixer_controls));
msm_dts_eagle_add_controls(platform);
snd_soc_add_platform_controls(platform, msm_source_tracking_controls,
ARRAY_SIZE(msm_source_tracking_controls));

View File

@ -24,7 +24,6 @@
#include <sound/q6afe-v2.h>
#include <sound/audio_cal_utils.h>
#include <sound/asound.h>
#include <sound/msm-dts-eagle.h>
#include "msm-dts-srs-tm-config.h"
#include <sound/adsp_err.h>
@ -250,222 +249,6 @@ static int adm_get_next_available_copp(int port_idx)
return idx;
}
int adm_dts_eagle_set(int port_id, int copp_idx, int param_id,
void *data, uint32_t size)
{
struct adm_cmd_set_pp_params_v5 admp;
int p_idx, ret = 0, *ob_params;
pr_debug("DTS_EAGLE_ADM: %s - port id %i, copp idx %i, param id 0x%X size %u\n",
__func__, port_id, copp_idx, param_id, size);
port_id = afe_convert_virtual_to_portid(port_id);
p_idx = adm_validate_and_get_port_index(port_id);
pr_debug("DTS_EAGLE_ADM: %s - after lookup, port id %i, port idx %i\n",
__func__, port_id, p_idx);
if (p_idx < 0) {
pr_err("DTS_EAGLE_ADM: %s: invalid port index 0x%x, port id 0x%x\n",
__func__, p_idx, port_id);
return -EINVAL;
}
if (copp_idx < 0 || copp_idx >= MAX_COPPS_PER_PORT) {
pr_err("DTS_EAGLE_ADM: %s: Invalid copp_idx: %d\n", __func__,
copp_idx);
return -EINVAL;
}
ob_params = (int *)this_adm.outband_memmap.kvaddr;
if (ob_params == NULL) {
pr_err("DTS_EAGLE_ADM: %s - NULL memmap. Non Eagle topology selected?\n",
__func__);
ret = -EINVAL;
goto fail_cmd;
}
/* check for integer overflow */
if (size > (UINT_MAX - APR_CMD_OB_HDR_SZ))
ret = -EINVAL;
if ((ret < 0) ||
(size + APR_CMD_OB_HDR_SZ > this_adm.outband_memmap.size)) {
pr_err("DTS_EAGLE_ADM - %s: ion alloc of size %zu too small for size requested %u\n",
__func__, this_adm.outband_memmap.size,
size + APR_CMD_OB_HDR_SZ);
ret = -EINVAL;
goto fail_cmd;
}
*ob_params++ = AUDPROC_MODULE_ID_DTS_HPX_POSTMIX;
*ob_params++ = param_id;
*ob_params++ = size;
memcpy(ob_params, data, size);
admp.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER);
admp.hdr.pkt_size = sizeof(admp);
admp.hdr.src_svc = APR_SVC_ADM;
admp.hdr.src_domain = APR_DOMAIN_APPS;
admp.hdr.src_port = port_id;
admp.hdr.dest_svc = APR_SVC_ADM;
admp.hdr.dest_domain = APR_DOMAIN_ADSP;
admp.hdr.dest_port = atomic_read(&this_adm.copp.id[p_idx][copp_idx]);
admp.hdr.token = p_idx << 16 | copp_idx;
admp.hdr.opcode = ADM_CMD_SET_PP_PARAMS_V5;
admp.payload_addr_lsw = lower_32_bits(this_adm.outband_memmap.paddr);
admp.payload_addr_msw = populate_upper_32_bits(
this_adm.outband_memmap.paddr);
admp.mem_map_handle = atomic_read(&this_adm.mem_map_handles[
ADM_DTS_EAGLE]);
admp.payload_size = size + sizeof(struct adm_param_data_v5);
pr_debug("DTS_EAGLE_ADM: %s - Command was sent now check Q6 - port id = %d, size %d, module id %x, param id %x.\n",
__func__, admp.hdr.dest_port,
admp.payload_size, AUDPROC_MODULE_ID_DTS_HPX_POSTMIX,
param_id);
atomic_set(&this_adm.copp.stat[p_idx][copp_idx], 0);
atomic_set(&this_adm.copp.cmd_err_code[p_idx][copp_idx], 0);
ret = apr_send_pkt(this_adm.apr, (uint32_t *)&admp);
if (ret < 0) {
pr_err("DTS_EAGLE_ADM: %s - ADM enable for port %d failed\n",
__func__, port_id);
ret = -EINVAL;
goto fail_cmd;
}
ret = wait_event_timeout(this_adm.copp.wait[p_idx][copp_idx],
atomic_read(&this_adm.copp.stat[p_idx][copp_idx]),
msecs_to_jiffies(TIMEOUT_MS));
if (!ret) {
pr_err("DTS_EAGLE_ADM: %s - set params timed out port = %d\n",
__func__, port_id);
ret = -EINVAL;
} else if (atomic_read(&this_adm.copp.cmd_err_code
[p_idx][copp_idx]) > 0) {
pr_err("%s: DSP returned error[%s]\n",
__func__, adsp_err_get_err_str(
atomic_read(&this_adm.copp.cmd_err_code
[p_idx][copp_idx])));
ret = adsp_err_get_lnx_err_code(
atomic_read(&this_adm.copp.cmd_err_code
[p_idx][copp_idx]));
} else {
ret = 0;
}
fail_cmd:
return ret;
}
int adm_dts_eagle_get(int port_id, int copp_idx, int param_id,
void *data, uint32_t size)
{
struct adm_cmd_get_pp_params_v5 admp;
int p_idx, ret = 0, *ob_params;
uint32_t orig_size = size;
pr_debug("DTS_EAGLE_ADM: %s - port id %i, copp idx %i, param id 0x%X\n",
__func__, port_id, copp_idx, param_id);
port_id = afe_convert_virtual_to_portid(port_id);
p_idx = adm_validate_and_get_port_index(port_id);
if (p_idx < 0) {
pr_err("DTS_EAGLE_ADM: %s - invalid port index %i, port id %i, copp idx %i\n",
__func__, p_idx, port_id, copp_idx);
return -EINVAL;
}
if (copp_idx < 0 || copp_idx >= MAX_COPPS_PER_PORT) {
pr_err("DTS_EAGLE_ADM: %s: Invalid copp_idx: %d\n", __func__,
copp_idx);
return -EINVAL;
}
if ((size == 0) || !data) {
pr_err("DTS_EAGLE_ADM: %s - invalid size %u or pointer %pK.\n",
__func__, size, data);
return -EINVAL;
}
size = (size+3) & 0xFFFFFFFC;
ob_params = (int *)(this_adm.outband_memmap.kvaddr);
if (ob_params == NULL) {
pr_err("DTS_EAGLE_ADM: %s - NULL memmap. Non Eagle topology selected?",
__func__);
ret = -EINVAL;
goto fail_cmd;
}
/* check for integer overflow */
if (size > (UINT_MAX - APR_CMD_OB_HDR_SZ))
ret = -EINVAL;
if ((ret < 0) ||
(size + APR_CMD_OB_HDR_SZ > this_adm.outband_memmap.size)) {
pr_err("DTS_EAGLE_ADM - %s: ion alloc of size %zu too small for size requested %u\n",
__func__, this_adm.outband_memmap.size,
size + APR_CMD_OB_HDR_SZ);
ret = -EINVAL;
goto fail_cmd;
}
*ob_params++ = AUDPROC_MODULE_ID_DTS_HPX_POSTMIX;
*ob_params++ = param_id;
*ob_params++ = size;
admp.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER);
admp.hdr.pkt_size = sizeof(admp);
admp.hdr.src_svc = APR_SVC_ADM;
admp.hdr.src_domain = APR_DOMAIN_APPS;
admp.hdr.src_port = port_id;
admp.hdr.dest_svc = APR_SVC_ADM;
admp.hdr.dest_domain = APR_DOMAIN_ADSP;
admp.hdr.dest_port = atomic_read(&this_adm.copp.id[p_idx][copp_idx]);
admp.hdr.token = p_idx << 16 | copp_idx;
admp.hdr.opcode = ADM_CMD_GET_PP_PARAMS_V5;
admp.data_payload_addr_lsw =
lower_32_bits(this_adm.outband_memmap.paddr);
admp.data_payload_addr_msw =
populate_upper_32_bits(
this_adm.outband_memmap.paddr);
admp.mem_map_handle = atomic_read(&this_adm.mem_map_handles[
ADM_DTS_EAGLE]);
admp.module_id = AUDPROC_MODULE_ID_DTS_HPX_POSTMIX;
admp.param_id = param_id;
admp.param_max_size = size + sizeof(struct adm_param_data_v5);
admp.reserved = 0;
atomic_set(&this_adm.copp.stat[p_idx][copp_idx], 0);
atomic_set(&this_adm.copp.cmd_err_code[p_idx][copp_idx], 0);
ret = apr_send_pkt(this_adm.apr, (uint32_t *)&admp);
if (ret < 0) {
pr_err("DTS_EAGLE_ADM: %s - Failed to get EAGLE Params on port %d\n",
__func__, port_id);
ret = -EINVAL;
goto fail_cmd;
}
ret = wait_event_timeout(this_adm.copp.wait[p_idx][copp_idx],
atomic_read(&this_adm.copp.stat[p_idx][copp_idx]),
msecs_to_jiffies(TIMEOUT_MS));
if (!ret) {
pr_err("DTS_EAGLE_ADM: %s - EAGLE get params timed out port = %d\n",
__func__, port_id);
ret = -EINVAL;
goto fail_cmd;
} else if (atomic_read(&this_adm.copp.cmd_err_code
[p_idx][copp_idx]) > 0) {
pr_err("%s: DSP returned error[%s]\n",
__func__, adsp_err_get_err_str(
atomic_read(&this_adm.copp.cmd_err_code
[p_idx][copp_idx])));
ret = adsp_err_get_lnx_err_code(
atomic_read(&this_adm.copp.cmd_err_code
[p_idx][copp_idx]));
goto fail_cmd;
}
memcpy(data, ob_params, orig_size);
ret = 0;
fail_cmd:
return ret;
}
int srs_trumedia_open(int port_id, int copp_idx, __s32 srs_tech_id,
void *srs_params)
{
@ -2265,13 +2048,6 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
__func__, port_id, path, rate, channel_mode, perf_mode,
topology);
/* For DTS EAGLE only, force 24 bit */
if ((topology == ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX) &&
(perf_mode == LEGACY_PCM_MODE)) {
bit_width = 24;
pr_debug("%s: Force open adm in 24-bit for DTS HPX topology 0x%x\n",
__func__, topology);
}
port_id = q6audio_convert_virtual_to_portid(port_id);
port_idx = adm_validate_and_get_port_index(port_id);
if (port_idx < 0) {
@ -2298,8 +2074,7 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
flags = ADM_LOW_LATENCY_DEVICE_SESSION;
if ((topology == DOLBY_ADM_COPP_TOPOLOGY_ID) ||
(topology == DS2_ADM_COPP_TOPOLOGY_ID) ||
(topology == SRS_TRUMEDIA_TOPOLOGY_ID) ||
(topology == ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX))
(topology == SRS_TRUMEDIA_TOPOLOGY_ID))
topology = DEFAULT_COPP_TOPOLOGY;
} else {
if (path == ADM_PATH_COMPRESSED_RX)
@ -2367,20 +2142,6 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
(uint32_t)this_adm.outband_memmap.size);
}
}
if ((topology == ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX) &&
(perf_mode == LEGACY_PCM_MODE)) {
int res = 0;
atomic_set(&this_adm.mem_map_index, ADM_DTS_EAGLE);
msm_dts_ion_memmap(&this_adm.outband_memmap);
res = adm_memory_map_regions(
&this_adm.outband_memmap.paddr,
0,
(uint32_t *)&this_adm.outband_memmap.size,
1);
if (res < 0)
pr_err("%s: DTS_EAGLE mmap did not work!",
__func__);
}
open.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
APR_HDR_LEN(APR_HDR_SIZE),
APR_PKT_VER);
@ -2660,21 +2421,6 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
}
}
if ((perf_mode == LEGACY_PCM_MODE) &&
(this_adm.outband_memmap.paddr != 0) &&
(atomic_read(
&this_adm.copp.topology[port_idx][copp_idx]) ==
ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX)) {
atomic_set(&this_adm.mem_map_index, ADM_DTS_EAGLE);
ret = adm_memory_unmap_regions();
if (ret < 0) {
pr_err("%s: adm mem unmmap err %d",
__func__, ret);
} else {
atomic_set(&this_adm.mem_map_handles
[ADM_DTS_EAGLE], 0);
}
}
if ((afe_get_port_type(port_id) == MSM_AFE_PORT_TYPE_TX) &&
(this_adm.sourceTrackingData.memmap.paddr != 0)) {
@ -3061,10 +2807,6 @@ static int adm_init_cal_data(void)
{NULL, NULL, NULL, NULL, NULL, NULL} },
{NULL, NULL, cal_utils_match_buf_num} },
{{DTS_EAGLE_CAL_TYPE,
{NULL, NULL, NULL, NULL, NULL, NULL} },
{NULL, NULL, cal_utils_match_buf_num} },
{{SRS_TRUMEDIA_CAL_TYPE,
{NULL, NULL, NULL, NULL, NULL, NULL} },
{NULL, NULL, cal_utils_match_buf_num} }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
@ -41,8 +41,8 @@
#include <sound/q6core.h>
#include <sound/q6audio-v2.h>
#include <sound/audio_cal_utils.h>
#include <sound/msm-dts-eagle.h>
#include <sound/adsp_err.h>
#include <sound/compress_params.h>
#define TRUE 0x01
#define FALSE 0x00
@ -2147,9 +2147,6 @@ static int __q6asm_open_read(struct audio_client *ac,
open.src_endpointype = ASM_END_POINT_DEVICE_MATRIX;
open.preprocopo_id = q6asm_get_asm_topology();
if ((open.preprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX) ||
(open.preprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS))
open.preprocopo_id = ASM_STREAM_POSTPROCOPO_ID_NONE;
open.bits_per_sample = bits_per_sample;
open.mode_flags = 0x0;
@ -2387,16 +2384,9 @@ static int __q6asm_open_write(struct audio_client *ac, uint32_t format,
open.bits_per_sample = bits_per_sample;
open.postprocopo_id = q6asm_get_asm_topology();
if ((ac->perf_mode != LEGACY_PCM_MODE) &&
((open.postprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX) ||
(open.postprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS)))
if (ac->perf_mode != LEGACY_PCM_MODE)
open.postprocopo_id = ASM_STREAM_POSTPROCOPO_ID_NONE;
/* For DTS EAGLE only, force 24 bit */
if ((open.postprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX) ||
(open.postprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS))
open.bits_per_sample = 24;
pr_debug("%s: perf_mode %d asm_topology 0x%x bps %d\n", __func__,
ac->perf_mode, open.postprocopo_id, open.bits_per_sample);
@ -2596,10 +2586,6 @@ static int __q6asm_open_read_write(struct audio_client *ac, uint32_t rd_format,
topology : open.postprocopo_id;
ac->topology = open.postprocopo_id;
/* For DTS EAGLE only, force 24 bit */
if ((open.postprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX) ||
(open.postprocopo_id == ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER))
open.bits_per_sample = 24;
switch (wr_format) {
case FORMAT_LINEAR_PCM:
@ -5499,215 +5485,6 @@ fail_cmd:
return rc;
}
int q6asm_dts_eagle_set(struct audio_client *ac, int param_id, uint32_t size,
void *data, struct param_outband *po, int m_id)
{
int rc = 0, *ob_params = NULL;
uint32_t sz = sizeof(struct asm_dts_eagle_param) + (po ? 0 : size);
struct asm_dts_eagle_param *ad;
if (!ac || ac->apr == NULL || (size == 0) || !data) {
pr_err("DTS_EAGLE_ASM - %s: APR handle NULL, invalid size %u or pointer %pK.\n",
__func__, size, data);
return -EINVAL;
}
ad = kzalloc(sz, GFP_KERNEL);
if (!ad) {
pr_err("DTS_EAGLE_ASM - %s: error allocating mem of size %u\n",
__func__, sz);
return -ENOMEM;
}
pr_debug("DTS_EAGLE_ASM - %s: ac %pK param_id 0x%x size %u data %pK m_id 0x%x\n",
__func__, ac, param_id, size, data, m_id);
q6asm_add_hdr_async(ac, &ad->hdr, sz, 1);
ad->hdr.opcode = ASM_STREAM_CMD_SET_PP_PARAMS_V2;
ad->param.data_payload_addr_lsw = 0;
ad->param.data_payload_addr_msw = 0;
ad->param.mem_map_handle = 0;
ad->param.data_payload_size = size +
sizeof(struct asm_stream_param_data_v2);
ad->data.module_id = m_id;
ad->data.param_id = param_id;
ad->data.param_size = size;
ad->data.reserved = 0;
atomic_set(&ac->cmd_state, 1);
if (po) {
struct list_head *ptr, *next;
struct asm_buffer_node *node;
pr_debug("DTS_EAGLE_ASM - %s: using out of band memory (virtual %pK, physical %pK)\n",
__func__, po->kvaddr, &po->paddr);
ad->param.data_payload_addr_lsw = lower_32_bits(po->paddr);
ad->param.data_payload_addr_msw = populate_upper_32_bits(
po->paddr);
list_for_each_safe(ptr, next, &ac->port[IN].mem_map_handle) {
node = list_entry(ptr, struct asm_buffer_node, list);
if (node->buf_phys_addr == po->paddr) {
ad->param.mem_map_handle = node->mmap_hdl;
break;
}
}
if (ad->param.mem_map_handle == 0) {
pr_err("DTS_EAGLE_ASM - %s: mem map handle not found\n",
__func__);
rc = -EINVAL;
goto fail_cmd;
}
/* check for integer overflow */
if (size > (UINT_MAX - APR_CMD_OB_HDR_SZ))
rc = -EINVAL;
if ((rc < 0) || (size + APR_CMD_OB_HDR_SZ > po->size)) {
pr_err("DTS_EAGLE_ASM - %s: ion alloc of size %zu too small for size requested %u\n",
__func__, po->size, size + APR_CMD_OB_HDR_SZ);
rc = -EINVAL;
goto fail_cmd;
}
ob_params = (int *)po->kvaddr;
*ob_params++ = m_id;
*ob_params++ = param_id;
*ob_params++ = size;
memcpy(ob_params, data, size);
} else {
pr_debug("DTS_EAGLE_ASM - %s: using in band\n", __func__);
memcpy(((char *)ad) + sizeof(struct asm_dts_eagle_param),
data, size);
}
rc = apr_send_pkt(ac->apr, (uint32_t *)ad);
if (rc < 0) {
pr_err("DTS_EAGLE_ASM - %s: set-params send failed paramid[0x%x]\n",
__func__, ad->data.param_id);
rc = -EINVAL;
goto fail_cmd;
}
rc = wait_event_timeout(ac->cmd_wait,
(atomic_read(&ac->cmd_state) <= 0), 1*HZ);
if (!rc) {
pr_err("DTS_EAGLE_ASM - %s: timeout, set-params paramid[0x%x]\n",
__func__, ad->data.param_id);
rc = -EINVAL;
goto fail_cmd;
}
rc = 0;
fail_cmd:
kfree(ad);
return rc;
}
int q6asm_dts_eagle_get(struct audio_client *ac, int param_id, uint32_t size,
void *data, struct param_outband *po, int m_id)
{
struct asm_dts_eagle_param_get *ad;
int rc = 0, *ob_params = NULL;
uint32_t sz = sizeof(struct asm_dts_eagle_param) + APR_CMD_GET_HDR_SZ +
(po ? 0 : size);
if (!ac || ac->apr == NULL || (size == 0) || !data) {
pr_err("DTS_EAGLE_ASM - %s: APR handle NULL, invalid size %u or pointer %pK\n",
__func__, size, data);
return -EINVAL;
}
ad = kzalloc(sz, GFP_KERNEL);
if (!ad) {
pr_err("DTS_EAGLE_ASM - %s: error allocating memory of size %u\n",
__func__, sz);
return -ENOMEM;
}
pr_debug("DTS_EAGLE_ASM - %s: ac %pK param_id 0x%x size %u data %pK m_id 0x%x\n",
__func__, ac, param_id, size, data, m_id);
q6asm_add_hdr(ac, &ad->hdr, sz, TRUE);
ad->hdr.opcode = ASM_STREAM_CMD_GET_PP_PARAMS_V2;
ad->param.data_payload_addr_lsw = 0;
ad->param.data_payload_addr_msw = 0;
ad->param.mem_map_handle = 0;
ad->param.module_id = m_id;
ad->param.param_id = param_id;
ad->param.param_max_size = size + APR_CMD_GET_HDR_SZ;
ad->param.reserved = 0;
atomic_set(&ac->cmd_state, 1);
generic_get_data = kzalloc(size + sizeof(struct generic_get_data_),
GFP_KERNEL);
if (!generic_get_data) {
pr_err("DTS_EAGLE_ASM - %s: error allocating mem of size %u\n",
__func__, size);
rc = -ENOMEM;
goto fail_cmd;
}
if (po) {
struct list_head *ptr, *next;
struct asm_buffer_node *node;
pr_debug("DTS_EAGLE_ASM - %s: using out of band memory (virtual %pK, physical %pK)\n",
__func__, po->kvaddr, &po->paddr);
ad->param.data_payload_addr_lsw = lower_32_bits(po->paddr);
ad->param.data_payload_addr_msw = populate_upper_32_bits(
po->paddr);
list_for_each_safe(ptr, next, &ac->port[IN].mem_map_handle) {
node = list_entry(ptr, struct asm_buffer_node, list);
if (node->buf_phys_addr == po->paddr) {
ad->param.mem_map_handle = node->mmap_hdl;
break;
}
}
if (ad->param.mem_map_handle == 0) {
pr_err("DTS_EAGLE_ASM - %s: mem map handle not found\n",
__func__);
rc = -EINVAL;
goto fail_cmd;
}
/* check for integer overflow */
if (size > (UINT_MAX - APR_CMD_OB_HDR_SZ))
rc = -EINVAL;
if ((rc < 0) || (size + APR_CMD_OB_HDR_SZ > po->size)) {
pr_err("DTS_EAGLE_ASM - %s: ion alloc of size %zu too small for size requested %u\n",
__func__, po->size, size + APR_CMD_OB_HDR_SZ);
rc = -EINVAL;
goto fail_cmd;
}
ob_params = (int *)po->kvaddr;
*ob_params++ = m_id;
*ob_params++ = param_id;
*ob_params++ = size;
generic_get_data->is_inband = 0;
} else {
pr_debug("DTS_EAGLE_ASM - %s: using in band\n", __func__);
generic_get_data->is_inband = 1;
}
rc = apr_send_pkt(ac->apr, (uint32_t *)ad);
if (rc < 0) {
pr_err("DTS_EAGLE_ASM - %s: Commmand 0x%x failed\n", __func__,
ad->hdr.opcode);
goto fail_cmd;
}
rc = wait_event_timeout(ac->cmd_wait,
(atomic_read(&ac->cmd_state) <= 0), 1*HZ);
if (!rc) {
pr_err("DTS_EAGLE_ASM - %s: timeout in get\n",
__func__);
rc = -EINVAL;
goto fail_cmd;
}
if (generic_get_data->valid) {
rc = 0;
memcpy(data, po ? ob_params : generic_get_data->ints, size);
} else {
rc = -EINVAL;
pr_err("DTS_EAGLE_ASM - %s: EAGLE get params problem getting data - check callback error value\n",
__func__);
}
fail_cmd:
kfree(ad);
kfree(generic_get_data);
generic_get_data = NULL;
return rc;
}
static int __q6asm_set_volume(struct audio_client *ac, int volume, int instance)
{
struct asm_volume_ctrl_master_gain vol;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -187,7 +187,7 @@ static int32_t aprv2_core_fn_q(struct apr_client_data *data, void *priv)
generic_get_data->valid = 1;
generic_get_data->size_in_ints =
data->payload_size/sizeof(int);
pr_debug("DTS_EAGLE_CORE callback size = %i\n",
pr_debug("callback size = %i\n",
data->payload_size);
memcpy(generic_get_data->ints, data->payload,
data->payload_size);
@ -420,115 +420,6 @@ fail_cmd:
return ret;
}
int core_dts_eagle_set(int size, char *data)
{
struct adsp_dts_eagle *payload = NULL;
int rc = 0, size_aligned4byte;
pr_debug("DTS_EAGLE_CORE - %s\n", __func__);
if (size <= 0 || !data) {
pr_err("DTS_EAGLE_CORE - %s: invalid size %i or pointer %pK.\n",
__func__, size, data);
return -EINVAL;
}
size_aligned4byte = (size+3) & 0xFFFFFFFC;
ocm_core_open();
if (q6core_lcl.core_handle_q) {
payload = kzalloc(sizeof(struct adsp_dts_eagle) +
size_aligned4byte, GFP_KERNEL);
if (!payload) {
pr_err("DTS_EAGLE_CORE - %s: out of memory (aligned size %i).\n",
__func__, size_aligned4byte);
return -ENOMEM;
}
payload->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_EVENT,
APR_HDR_LEN(APR_HDR_SIZE),
APR_PKT_VER);
payload->hdr.pkt_size = sizeof(struct adsp_dts_eagle) +
size_aligned4byte;
payload->hdr.src_port = 0;
payload->hdr.dest_port = 0;
payload->hdr.token = 0;
payload->hdr.opcode = ADSP_CMD_SET_DTS_EAGLE_DATA_ID;
payload->id = DTS_EAGLE_LICENSE_ID;
payload->overwrite = 1;
payload->size = size;
memcpy(payload->data, data, size);
rc = apr_send_pkt(q6core_lcl.core_handle_q,
(uint32_t *)payload);
if (rc < 0) {
pr_err("DTS_EAGLE_CORE - %s: failed op[0x%x]rc[%d]\n",
__func__, payload->hdr.opcode, rc);
}
kfree(payload);
}
return rc;
}
int core_dts_eagle_get(int id, int size, char *data)
{
struct apr_hdr ah;
int rc = 0;
pr_debug("DTS_EAGLE_CORE - %s\n", __func__);
if (size <= 0 || !data) {
pr_err("DTS_EAGLE_CORE - %s: invalid size %i or pointer %pK.\n",
__func__, size, data);
return -EINVAL;
}
ocm_core_open();
if (q6core_lcl.core_handle_q) {
ah.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_EVENT,
APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER);
ah.pkt_size = sizeof(struct apr_hdr);
ah.src_port = 0;
ah.dest_port = 0;
ah.token = 0;
ah.opcode = id;
q6core_lcl.bus_bw_resp_received = 0;
generic_get_data = kzalloc(sizeof(struct generic_get_data_)
+ size, GFP_KERNEL);
if (!generic_get_data) {
pr_err("DTS_EAGLE_CORE - %s: error allocating memory of size %i\n",
__func__, size);
return -ENOMEM;
}
rc = apr_send_pkt(q6core_lcl.core_handle_q,
(uint32_t *)&ah);
if (rc < 0) {
pr_err("DTS_EAGLE_CORE - %s: failed op[0x%x]rc[%d]\n",
__func__, ah.opcode, rc);
goto fail_cmd_2;
}
rc = wait_event_timeout(q6core_lcl.bus_bw_req_wait,
(q6core_lcl.bus_bw_resp_received == 1),
msecs_to_jiffies(TIMEOUT_MS));
if (!rc) {
pr_err("DTS_EAGLE_CORE - %s: EAGLE get params timed out\n",
__func__);
rc = -EINVAL;
goto fail_cmd_2;
}
if (generic_get_data->valid) {
rc = 0;
memcpy(data, generic_get_data->ints, size);
} else {
rc = -EINVAL;
pr_err("DTS_EAGLE_CORE - %s: EAGLE get params problem getting data - check callback error value\n",
__func__);
}
}
fail_cmd_2:
kfree(generic_get_data);
generic_get_data = NULL;
return rc;
}
uint32_t core_set_dolby_manufacturer_id(int manufacturer_id)
{
struct adsp_dolby_manufacturer_id payload;