Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 6a5079e8 authored by derfelot's avatar derfelot
Browse files

ASoC: msm: qdsp6v2: Add Sony hweffect, AHC and 24bit COPP

Taken from Sony 47.2.A.10.107 stock kernel
parent 5b1b9a5b
Loading
Loading
Loading
Loading
+109 −2
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*/
/*
 * NOTE: This file has been modified by Sony Mobile Communications Inc.
 * Modifications are Copyright (c) 2014 Sony Mobile Communications Inc,
 * and licensed under the license of the file.
 */


#ifndef _APR_AUDIO_V2_H_
@@ -660,7 +665,7 @@ struct adm_cmd_set_pp_params {
#define ADM_CMD_GET_MTMX_STRTR_DEV_PARAMS_V1	0x00010368
#define ADM_CMDRSP_GET_MTMX_STRTR_DEV_PARAMS_V1	0x00010369

/* Payload of the #define ADM_CMD_SET_MTMX_STRTR_DEV_PARAMS_V1 command.
/* Payload of the #define ADM_CMD_SET_MTMX_STRTR_DEV_PARAMS_V1 command.
 * If the data_payload_addr_lsw and data_payload_addr_msw element
 * are NULL, a series of struct param_hdr_v3 structures immediately
 * follows, whose total size is payload_size bytes.
@@ -790,6 +795,44 @@ struct adm_cmd_rsp_device_open_v5 {
#define ADM_CMD_GET_PP_PARAMS_V5                                0x0001032A
#define ADM_CMD_GET_PP_PARAMS_V6 0x0001035E

/*  Payload an #ADM_CMD_GET_PP_PARAMS_V5 command. */
struct adm_cmd_get_pp_params_v5 {
	struct apr_hdr hdr;
	u32                  data_payload_addr_lsw;
	/* LSW of parameter data payload address.*/

	u32                  data_payload_addr_msw;
	/* MSW of parameter data payload address.*/

	/* If the mem_map_handle is non zero,
	 * on ACK, the ParamData payloads begin at
	 * the address specified (out-of-band).
	 */

	u32                  mem_map_handle;
	/* Memory map handle returned
	 * by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
	 * If the mem_map_handle is 0, it implies that
	 * the ACK's payload will contain the ParamData (in-band).
	 */

	u32                  module_id;
	/* Unique ID of the module. */

	u32                  param_id;
	/* Unique ID of the parameter. */

	u16                  param_max_size;
	/* Maximum data size of the parameter
	 *ID/module ID combination. This
	 * field is a multiple of 4 bytes.
	 */
	u16                  reserved;
	/* Reserved for future enhancements.
	 * This field must be set to zero.
	 */
} __packed;

/*
 * Structure of the ADM Get PP Params command. Parameter header must be
 * packed correctly for either V2 or V3. Use q6core_pack_pp_params to pack the
@@ -930,6 +973,22 @@ struct adm_cmd_set_pp_params_v5 {
	 */
} __packed;

struct adm_param_data_v5 {
	u32                  module_id;
	/* Unique ID of the module. */
	u32                  param_id;
	/* Unique ID of the parameter. */
	u16                  param_size;
	/* Data size of the param_id/module_id combination.
	 * This value is a
	 * multiple of 4 bytes.
	 */
	u16                  reserved;
	/* Reserved for future enhancements.
	 * This field must be set to zero.
	 */
} __packed;

struct audproc_mfc_param_media_fmt {
	uint32_t sampling_rate;
	uint16_t bits_per_sample;
@@ -1199,6 +1258,7 @@ struct adm_session_copp_gain_v7 {

/*  Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/
struct adm_cmd_matrix_mute_v5 {
	struct apr_hdr	hdr;
	u32                  matrix_id;
/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
 * Use the ADM_MATRIX_ID_AUDIO_RX or  ADM_MATRIX_ID_AUDIOX
@@ -4479,6 +4539,8 @@ struct afe_param_id_lpass_core_shared_clk_cfg {
#define VPM_TX_DM_RFECNS_COPP_TOPOLOGY			0x00010F86
#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX		0x10015002
#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_AUDIOSPHERE	0x10028000
#define VOICE_TOPOLOGY_LVVEFQ_TX_SM			0x1000BFF0
#define VOICE_TOPOLOGY_LVVEFQ_TX_DM			0x1000BFF1

/* Memory map regions command payload used by the
 * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
@@ -7988,6 +8050,12 @@ struct asm_stream_cmd_open_read_compressed {
								0x11000000
#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
								0x0001031B
#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_RX_MCH_IIR_COPP_MBDRC_V3 \
								0x11000004
#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_SOMC_HP \
								0x11000006
#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_RX_MCH_FIR_IIR_COPP_MBDRC_V3 \
								0x11000009
#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP  0x00010315
#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
#define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO           0x00010715
@@ -10386,6 +10454,45 @@ struct afe_param_id_clip_bank_sel {
	uint32_t bank_map[AFE_CLIP_MAX_BANKS];
} __packed;

/* SOMC effect start */
/* Module/Parameter IDs */
#define ASM_MODULE_ID_SONYBUNDLE            0x10002010

#define PARAM_ID_SB_COMMON_USER_PARAM       0x10002011
#define PARAM_ID_SB_DYNAMICNORMALIZER_USER_PARAM 0x10002012
#define PARAM_ID_SB_SFORCE_USER_PARAM       0x10002013
#define PARAM_ID_SB_VPT20_USER_PARAM        0x10002014
#define PARAM_ID_SB_CLEARPHASE_HP_USER_PARAM 0x10002015
#define PARAM_ID_SB_CLEARAUDIO_USER_PARAM   0x10002016
#define PARAM_ID_SB_CLEARAUDIO_VOLUME_PARAM 0x10002017
#define PARAM_ID_SB_CLEARPHASE_SP_USER_PARAM 0x10002018
#define PARAM_ID_SB_XLOUD_USER_PARAM        0x10002019

#define PARAM_ID_SB_CLEARPHASE_HP_TUNING    0x1000201A
#define PARAM_ID_SB_SFORCE_TUNING           0x1000201B
#define PARAM_ID_SB_CLEARPHASE_SP_TUNING    0x1000201C
#define PARAM_ID_SB_XLOUD_TUNING            0x1000201D

#define ASM_STREAM_POSTPROC_TOPO_ID_SONY    0x10002101

struct clearphase_hp_tuning_params {
	unsigned char coefs[2064];
} __packed;

struct s_force_tuning_params {
	unsigned char coefs[1016];
} __packed;

struct clearphase_sp_tuning_params {
	unsigned char coefs[2360];
} __packed;

struct xloud_tuning_params {
	unsigned int level;
	unsigned char coefs[512];
} __packed;
/* SOMC effect end */

/* ERROR CODES */
/* Success. The operation completed with no errors. */
#define ADSP_EOK          0x00000000
@@ -10650,7 +10757,7 @@ struct afe_clk_set {
	 * for enable and disable clock.
	 *	"clk_freq_in_hz", "clk_attri", and "clk_root"
	 *	are ignored in disable clock case.
	 *	@values 
	 *	@values
	 *	- 0 -- Disabled
	 *	- 1 -- Enabled  @tablebulletend
	 */
+7 −1
Original line number Diff line number Diff line
/*
 * NOTE: This file has been modified by Sony Mobile Communications Inc.
 * Modifications are Copyright (c) 2015 Sony Mobile Communications Inc,
 * and licensed under the license of the file.
 */
#ifndef __SOUND_JACK_H
#define __SOUND_JACK_H

@@ -64,7 +69,8 @@ enum snd_jack_types {
	SND_JACK_MICROPHONE2    = 0x0200,
	SND_JACK_ANC_HEADPHONE = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
				 SND_JACK_MICROPHONE2,

	SND_JACK_STEREO_MICROPHONE = SND_JACK_MICROPHONE |
				     SND_JACK_MICROPHONE2,
	/* Kept separate from switches to facilitate implementation */
	SND_JACK_BTN_0		= 0x8000,
	SND_JACK_BTN_1		= 0x4000,
+11 −0
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
/*
 * NOTE: This file has been modified by Sony Mobile Communications Inc.
 * Modifications are Copyright (c) 2014 Sony Mobile Communications Inc,
 * and licensed under the license of the file.
 */
#ifndef __Q6_ADM_V2_H__
#define __Q6_ADM_V2_H__

@@ -94,6 +99,9 @@ struct msm_pcm_channel_mixer {
	int override_cfg;
};

int adm_matrix_mute(int port_id, int session_id, uint32_t ramp_duration,
		uint32_t mute_flag_ch1, uint32_t mute_flag_ch2);

int srs_trumedia_open(int port_id, int copp_idx, __s32 srs_tech_id,
		      void *srs_params);

@@ -118,6 +126,9 @@ int adm_send_params_v5(int port_id, int copp_idx, char *params,
int adm_dolby_dap_send_params(int port_id, int copp_idx, char *params,
			      uint32_t params_length);

int adm_ahc_send_params(int port_id, int copp_idx, char *params,
			uint32_t params_length);

int adm_set_pp_params(int port_id, int copp_idx,
		      struct mem_mapping_hdr *mem_hdr, u8 *param_data,
		      u32 params_size);
+9 −0
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
/*
 * NOTE: This file has been modified by Sony Mobile Communications Inc.
 * Modifications are Copyright (c) 2014 Sony Mobile Communications Inc,
 * and licensed under the license of the file.
 */
#ifndef __Q6_ASM_V2_H__
#define __Q6_ASM_V2_H__

@@ -738,4 +743,8 @@ int q6asm_adjust_session_clock(struct audio_client *ac,
		uint32_t adjust_time_lsw,
		uint32_t adjust_time_msw);
int q6asm_get_svc_version(uint32_t service_id);

/* SOMC added: Send tuning parameter for Sony effect*/
int sony_hweffect_send_tuning_params(unsigned int effect_id, void *client);

#endif /* __Q6_ASM_H__ */
+2 −0
Original line number Diff line number Diff line
@@ -19,3 +19,5 @@ header-y += voice_svc.h
header-y += devdep_params.h
header-y += msmcal-hwdep.h
header-y += wcd-dsp-glink.h
header-y += sony-hweffect.h
header-y += sony-hweffect-params.h
Loading