Loading sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +23 −8 Original line number Diff line number Diff line Loading @@ -1213,7 +1213,9 @@ static int msm_routing_ec_ref_rx_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { pr_debug("%s: ec_ref_rx = %d", __func__, msm_route_ec_ref_rx); mutex_lock(&routing_lock); ucontrol->value.integer.value[0] = msm_route_ec_ref_rx; mutex_unlock(&routing_lock); return 0; } Loading @@ -1221,34 +1223,45 @@ static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int ec_ref_port_id; struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); struct snd_soc_dapm_widget *widget = wlist->widgets[0]; int mux = ucontrol->value.enumerated.item[0]; struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; mutex_lock(&routing_lock); switch (ucontrol->value.integer.value[0]) { case 0: msm_route_ec_ref_rx = 0; ec_ref_port_id = SLIMBUS_0_RX; ec_ref_port_id = AFE_PORT_INVALID; break; case 1: msm_route_ec_ref_rx = 1; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_RX; ec_ref_port_id = SLIMBUS_0_RX; break; case 2: msm_route_ec_ref_rx = 2; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_TX; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_RX; break; case 3: msm_route_ec_ref_rx = 3; ec_ref_port_id = AFE_PORT_ID_SECONDARY_MI2S_TX; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_TX; break; case 4: msm_route_ec_ref_rx = 4; ec_ref_port_id = AFE_PORT_ID_TERTIARY_MI2S_TX; ec_ref_port_id = AFE_PORT_ID_SECONDARY_MI2S_TX; break; case 5: msm_route_ec_ref_rx = 5; ec_ref_port_id = AFE_PORT_ID_TERTIARY_MI2S_TX; break; case 6: msm_route_ec_ref_rx = 6; ec_ref_port_id = AFE_PORT_ID_QUATERNARY_MI2S_TX; break; default: msm_route_ec_ref_rx = 6; /* NONE */ msm_route_ec_ref_rx = 0; /* NONE */ pr_err("%s EC ref rx %ld not valid\n", __func__, ucontrol->value.integer.value[0]); ec_ref_port_id = AFE_PORT_INVALID; break; } Loading @@ -1256,11 +1269,13 @@ static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol, pr_debug("%s: msm_route_ec_ref_rx = %d\n", __func__, msm_route_ec_ref_rx); mutex_unlock(&routing_lock); snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e); return 0; } static const char *const ec_ref_rx[] = { "SLIM_RX", "I2S_RX", "PRI_MI2S_TX", "SEC_MI2S_TX", "TERT_MI2S_TX", "QUAT_MI2S_TX", "PROXY_RX", "NONE"}; static const char *const ec_ref_rx[] = { "None", "SLIM_RX", "I2S_RX", "PRI_MI2S_TX", "SEC_MI2S_TX", "TERT_MI2S_TX", "QUAT_MI2S_TX", "PROXY_RX"}; static const struct soc_enum msm_route_ec_ref_rx_enum[] = { SOC_ENUM_SINGLE_EXT(8, ec_ref_rx), }; Loading Loading
sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +23 −8 Original line number Diff line number Diff line Loading @@ -1213,7 +1213,9 @@ static int msm_routing_ec_ref_rx_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { pr_debug("%s: ec_ref_rx = %d", __func__, msm_route_ec_ref_rx); mutex_lock(&routing_lock); ucontrol->value.integer.value[0] = msm_route_ec_ref_rx; mutex_unlock(&routing_lock); return 0; } Loading @@ -1221,34 +1223,45 @@ static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int ec_ref_port_id; struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); struct snd_soc_dapm_widget *widget = wlist->widgets[0]; int mux = ucontrol->value.enumerated.item[0]; struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; mutex_lock(&routing_lock); switch (ucontrol->value.integer.value[0]) { case 0: msm_route_ec_ref_rx = 0; ec_ref_port_id = SLIMBUS_0_RX; ec_ref_port_id = AFE_PORT_INVALID; break; case 1: msm_route_ec_ref_rx = 1; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_RX; ec_ref_port_id = SLIMBUS_0_RX; break; case 2: msm_route_ec_ref_rx = 2; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_TX; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_RX; break; case 3: msm_route_ec_ref_rx = 3; ec_ref_port_id = AFE_PORT_ID_SECONDARY_MI2S_TX; ec_ref_port_id = AFE_PORT_ID_PRIMARY_MI2S_TX; break; case 4: msm_route_ec_ref_rx = 4; ec_ref_port_id = AFE_PORT_ID_TERTIARY_MI2S_TX; ec_ref_port_id = AFE_PORT_ID_SECONDARY_MI2S_TX; break; case 5: msm_route_ec_ref_rx = 5; ec_ref_port_id = AFE_PORT_ID_TERTIARY_MI2S_TX; break; case 6: msm_route_ec_ref_rx = 6; ec_ref_port_id = AFE_PORT_ID_QUATERNARY_MI2S_TX; break; default: msm_route_ec_ref_rx = 6; /* NONE */ msm_route_ec_ref_rx = 0; /* NONE */ pr_err("%s EC ref rx %ld not valid\n", __func__, ucontrol->value.integer.value[0]); ec_ref_port_id = AFE_PORT_INVALID; break; } Loading @@ -1256,11 +1269,13 @@ static int msm_routing_ec_ref_rx_put(struct snd_kcontrol *kcontrol, pr_debug("%s: msm_route_ec_ref_rx = %d\n", __func__, msm_route_ec_ref_rx); mutex_unlock(&routing_lock); snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e); return 0; } static const char *const ec_ref_rx[] = { "SLIM_RX", "I2S_RX", "PRI_MI2S_TX", "SEC_MI2S_TX", "TERT_MI2S_TX", "QUAT_MI2S_TX", "PROXY_RX", "NONE"}; static const char *const ec_ref_rx[] = { "None", "SLIM_RX", "I2S_RX", "PRI_MI2S_TX", "SEC_MI2S_TX", "TERT_MI2S_TX", "QUAT_MI2S_TX", "PROXY_RX"}; static const struct soc_enum msm_route_ec_ref_rx_enum[] = { SOC_ENUM_SINGLE_EXT(8, ec_ref_rx), }; Loading