Loading asoc/msm-pcm-routing-v2.c +6 −0 Original line number Diff line number Diff line Loading @@ -3033,6 +3033,7 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol, struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; int mux = ucontrol->value.enumerated.item[0]; int lsm_port = AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX; int lsm_port_idx = 0; u8 fe_idx = 0; if (mux >= e->items) { Loading @@ -3042,6 +3043,7 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol, pr_debug("%s: LSM enable %ld\n", __func__, ucontrol->value.integer.value[0]); lsm_port_idx = ucontrol->value.integer.value[0]; switch (ucontrol->value.integer.value[0]) { case 1: lsm_port = AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX; Loading Loading @@ -3098,6 +3100,10 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol, set_lsm_port(lsm_port); msm_routing_get_lsm_fe_idx(kcontrol, &fe_idx); lsm_port_index[fe_idx] = ucontrol->value.integer.value[0]; /* Set the default AFE LSM Port to 0xffff */ if(lsm_port_idx <= 0 || lsm_port_idx >= ARRAY_SIZE(lsm_port_text)) lsm_port = 0xffff; afe_set_lsm_afe_port_id(fe_idx, lsm_port); return 0; } dsp/q6afe.c +35 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #define AFE_CLK_TOKEN 1024 #define SP_V4_NUM_MAX_SPKRS SP_V2_NUM_MAX_SPKRS #define MAX_LSM_SESSIONS 8 struct afe_avcs_payload_port_mapping { u16 port_id; Loading Loading @@ -249,6 +250,7 @@ struct afe_ctl { uint32_t num_spkrs; uint32_t cps_ch_mask; struct afe_cps_hw_intf_cfg *cps_config; int lsm_afe_ports[MAX_LSM_SESSIONS]; }; struct afe_clkinfo_per_port { Loading Loading @@ -303,6 +305,8 @@ bool afe_close_done[2] = {true, true}; #define SIZEOF_CFG_CMD(y) \ (sizeof(struct apr_hdr) + sizeof(u16) + (sizeof(struct y))) static bool q6afe_is_afe_lsm_port(int port_id); static void q6afe_unload_avcs_modules(u16 port_id, int index) { int ret = 0; Loading Loading @@ -3011,7 +3015,7 @@ static int afe_send_port_topology_id(u16 port_id) } ret = afe_get_cal_topology_id(port_id, &topology_id, AFE_TOPOLOGY_CAL); if (ret < 0) { if (ret < 0 && q6afe_is_afe_lsm_port(port_id)) { pr_debug("%s: Check for LSM topology\n", __func__); ret = afe_get_cal_topology_id(port_id, &topology_id, AFE_LSM_TOPOLOGY_CAL); Loading Loading @@ -3384,7 +3388,7 @@ void afe_send_cal(u16 port_id) if (afe_get_port_type(port_id) == MSM_AFE_PORT_TYPE_TX) { afe_send_cal_spkr_prot_tx(port_id); ret = send_afe_cal_type(AFE_COMMON_TX_CAL, port_id); if (ret < 0) if (ret < 0 && q6afe_is_afe_lsm_port(port_id)) send_afe_cal_type(AFE_LSM_TX_CAL, port_id); } else if (afe_get_port_type(port_id) == MSM_AFE_PORT_TYPE_RX) { send_afe_cal_type(AFE_COMMON_RX_CAL, port_id); Loading Loading @@ -10673,6 +10677,8 @@ int __init afe_init(void) init_waitqueue_head(&this_afe.wait_wakeup); init_waitqueue_head(&this_afe.lpass_core_hw_wait); init_waitqueue_head(&this_afe.clk_wait); for (i = 0; i < MAX_LSM_SESSIONS; i++) this_afe.lsm_afe_ports[i] = 0xffff; ret = afe_init_cal_data(); if (ret) pr_err("%s: could not init cal data! %d\n", __func__, ret); Loading Loading @@ -10911,3 +10917,30 @@ void afe_set_cps_config(int src_port, this_afe.cps_config = cps_config; } EXPORT_SYMBOL(afe_set_cps_config); static bool q6afe_is_afe_lsm_port(int port_id) { int i = 0; for (i = 0; i < MAX_LSM_SESSIONS; i++) { if (port_id == this_afe.lsm_afe_ports[i]) return true; } return false; } /** * afe_set_lsm_afe_port_id - * Update LSM AFE port * idx: LSM port index * lsm_port: LSM port id */ void afe_set_lsm_afe_port_id(int idx, int lsm_port) { if (idx < 0 || idx >= MAX_LSM_SESSIONS) { pr_err("%s: %d Invalid lsm port index\n", __func__, idx); return; } this_afe.lsm_afe_ports[idx] = lsm_port; } EXPORT_SYMBOL(afe_set_lsm_afe_port_id); include/dsp/q6afe-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -499,6 +499,7 @@ int afe_get_doa_tracking_mon(u16 port_id, int afe_set_pll_clk_drift(u16 port_id, int32_t set_clk_drift, uint32_t clk_reset); int afe_set_clk_id(u16 port_id, uint32_t clk_id); void afe_set_lsm_afe_port_id(int idx, int lsm_port); enum { AFE_LPASS_CORE_HW_BLOCK_ID_NONE, Loading Loading
asoc/msm-pcm-routing-v2.c +6 −0 Original line number Diff line number Diff line Loading @@ -3033,6 +3033,7 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol, struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; int mux = ucontrol->value.enumerated.item[0]; int lsm_port = AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX; int lsm_port_idx = 0; u8 fe_idx = 0; if (mux >= e->items) { Loading @@ -3042,6 +3043,7 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol, pr_debug("%s: LSM enable %ld\n", __func__, ucontrol->value.integer.value[0]); lsm_port_idx = ucontrol->value.integer.value[0]; switch (ucontrol->value.integer.value[0]) { case 1: lsm_port = AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX; Loading Loading @@ -3098,6 +3100,10 @@ static int msm_routing_lsm_port_put(struct snd_kcontrol *kcontrol, set_lsm_port(lsm_port); msm_routing_get_lsm_fe_idx(kcontrol, &fe_idx); lsm_port_index[fe_idx] = ucontrol->value.integer.value[0]; /* Set the default AFE LSM Port to 0xffff */ if(lsm_port_idx <= 0 || lsm_port_idx >= ARRAY_SIZE(lsm_port_text)) lsm_port = 0xffff; afe_set_lsm_afe_port_id(fe_idx, lsm_port); return 0; }
dsp/q6afe.c +35 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #define AFE_CLK_TOKEN 1024 #define SP_V4_NUM_MAX_SPKRS SP_V2_NUM_MAX_SPKRS #define MAX_LSM_SESSIONS 8 struct afe_avcs_payload_port_mapping { u16 port_id; Loading Loading @@ -249,6 +250,7 @@ struct afe_ctl { uint32_t num_spkrs; uint32_t cps_ch_mask; struct afe_cps_hw_intf_cfg *cps_config; int lsm_afe_ports[MAX_LSM_SESSIONS]; }; struct afe_clkinfo_per_port { Loading Loading @@ -303,6 +305,8 @@ bool afe_close_done[2] = {true, true}; #define SIZEOF_CFG_CMD(y) \ (sizeof(struct apr_hdr) + sizeof(u16) + (sizeof(struct y))) static bool q6afe_is_afe_lsm_port(int port_id); static void q6afe_unload_avcs_modules(u16 port_id, int index) { int ret = 0; Loading Loading @@ -3011,7 +3015,7 @@ static int afe_send_port_topology_id(u16 port_id) } ret = afe_get_cal_topology_id(port_id, &topology_id, AFE_TOPOLOGY_CAL); if (ret < 0) { if (ret < 0 && q6afe_is_afe_lsm_port(port_id)) { pr_debug("%s: Check for LSM topology\n", __func__); ret = afe_get_cal_topology_id(port_id, &topology_id, AFE_LSM_TOPOLOGY_CAL); Loading Loading @@ -3384,7 +3388,7 @@ void afe_send_cal(u16 port_id) if (afe_get_port_type(port_id) == MSM_AFE_PORT_TYPE_TX) { afe_send_cal_spkr_prot_tx(port_id); ret = send_afe_cal_type(AFE_COMMON_TX_CAL, port_id); if (ret < 0) if (ret < 0 && q6afe_is_afe_lsm_port(port_id)) send_afe_cal_type(AFE_LSM_TX_CAL, port_id); } else if (afe_get_port_type(port_id) == MSM_AFE_PORT_TYPE_RX) { send_afe_cal_type(AFE_COMMON_RX_CAL, port_id); Loading Loading @@ -10673,6 +10677,8 @@ int __init afe_init(void) init_waitqueue_head(&this_afe.wait_wakeup); init_waitqueue_head(&this_afe.lpass_core_hw_wait); init_waitqueue_head(&this_afe.clk_wait); for (i = 0; i < MAX_LSM_SESSIONS; i++) this_afe.lsm_afe_ports[i] = 0xffff; ret = afe_init_cal_data(); if (ret) pr_err("%s: could not init cal data! %d\n", __func__, ret); Loading Loading @@ -10911,3 +10917,30 @@ void afe_set_cps_config(int src_port, this_afe.cps_config = cps_config; } EXPORT_SYMBOL(afe_set_cps_config); static bool q6afe_is_afe_lsm_port(int port_id) { int i = 0; for (i = 0; i < MAX_LSM_SESSIONS; i++) { if (port_id == this_afe.lsm_afe_ports[i]) return true; } return false; } /** * afe_set_lsm_afe_port_id - * Update LSM AFE port * idx: LSM port index * lsm_port: LSM port id */ void afe_set_lsm_afe_port_id(int idx, int lsm_port) { if (idx < 0 || idx >= MAX_LSM_SESSIONS) { pr_err("%s: %d Invalid lsm port index\n", __func__, idx); return; } this_afe.lsm_afe_ports[idx] = lsm_port; } EXPORT_SYMBOL(afe_set_lsm_afe_port_id);
include/dsp/q6afe-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -499,6 +499,7 @@ int afe_get_doa_tracking_mon(u16 port_id, int afe_set_pll_clk_drift(u16 port_id, int32_t set_clk_drift, uint32_t clk_reset); int afe_set_clk_id(u16 port_id, uint32_t clk_id); void afe_set_lsm_afe_port_id(int idx, int lsm_port); enum { AFE_LPASS_CORE_HW_BLOCK_ID_NONE, Loading