summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorManish Dewangan <manish@codeaurora.org>2017-04-17 14:59:23 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-28 02:39:49 -0700
commit761f20e31b2cefd5bcc8efef2a77647ca800a748 (patch)
treeee898702d963e12e5bef470e133270d989a2999b /include
parentc01ba1a5f98de6e2f271cc2e447fe3280920cc16 (diff)
ASoC: msm: qdsp6v2: Add support for DSP clock recovery
ASM driver changes to apply DSP clock recovery. Clients can issue clock recovery command with a positive value to advance the clock or a negative value to delay the clock. CRs-Fixed: 2036899 Change-Id: If2f10368afafe203ebdea219edcc2227cd381801 Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/sound/apr_audio-v2.h23
-rw-r--r--include/sound/q6asm-v2.h8
2 files changed, 31 insertions, 0 deletions
diff --git a/include/sound/apr_audio-v2.h b/include/sound/apr_audio-v2.h
index bcb53faaf678..021b81105c42 100644
--- a/include/sound/apr_audio-v2.h
+++ b/include/sound/apr_audio-v2.h
@@ -10320,10 +10320,33 @@ struct asm_session_mtmx_strtr_param_clk_rec_t {
u32 flags;
} __packed;
+
+/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to
+ * realize smoother adjustment of audio session clock for a specified session.
+ * The desired audio session clock adjustment(in micro seconds) is specified
+ * using the command #ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2.
+ * Delaying/Advancing the session clock would be implemented by inserting
+ * interpolated/dropping audio samples in the playback path respectively.
+ * Also, this parameter has to be configured before the Audio Session is put
+ * to RUN state to avoid cold start latency/glitches in the playback.
+ */
+
+#define ASM_SESSION_MTMX_PARAM_ADJUST_SESSION_TIME_CTL 0x00013217
+
+struct asm_session_mtmx_param_adjust_session_time_ctl_t {
+ /* Specifies whether the module is enabled or not
+ * @values
+ * 0 -- disabled
+ * 1 -- enabled
+ */
+ u32 enable;
+};
+
union asm_session_mtmx_strtr_param_config {
struct asm_session_mtmx_strtr_param_window_v2_t window_param;
struct asm_session_mtmx_strtr_param_render_mode_t render_param;
struct asm_session_mtmx_strtr_param_clk_rec_t clk_rec_param;
+ struct asm_session_mtmx_param_adjust_session_time_ctl_t adj_time_param;
} __packed;
struct asm_mtmx_strtr_params {
diff --git a/include/sound/q6asm-v2.h b/include/sound/q6asm-v2.h
index 41fcdeb50831..b2bb8d493839 100644
--- a/include/sound/q6asm-v2.h
+++ b/include/sound/q6asm-v2.h
@@ -655,6 +655,10 @@ int q6asm_send_mtmx_strtr_render_mode(struct audio_client *ac,
int q6asm_send_mtmx_strtr_clk_rec_mode(struct audio_client *ac,
uint32_t clk_rec_mode);
+/* Enable adjust session clock in DSP */
+int q6asm_send_mtmx_strtr_enable_adjust_session_clock(struct audio_client *ac,
+ bool enable);
+
/* Retrieve the current DSP path delay */
int q6asm_get_path_delay(struct audio_client *ac);
@@ -662,4 +666,8 @@ int q6asm_get_path_delay(struct audio_client *ac);
uint8_t q6asm_get_buf_index_from_token(uint32_t token);
uint8_t q6asm_get_stream_id_from_token(uint32_t token);
+/* Adjust session clock in DSP */
+int q6asm_adjust_session_clock(struct audio_client *ac,
+ uint32_t adjust_time_lsw,
+ uint32_t adjust_time_msw);
#endif /* __Q6_ASM_H__ */