Merge "asoc: check subsys state in FE instead of q6 state"

Este commit está contenido en:
qctecmdr
2019-09-12 04:02:35 -07:00
cometido por Gerrit - the friendly Code Review server
Se han modificado 4 ficheros con 36 adiciones y 0 borrados

Ver fichero

@@ -1661,6 +1661,7 @@ static int msm_compr_playback_open(struct snd_compr_stream *cstream)
struct snd_soc_component *component = NULL;
struct msm_compr_audio *prtd = NULL;
struct msm_compr_pdata *pdata = NULL;
enum apr_subsys_state subsys_state;
pr_debug("%s\n", __func__);
component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
@@ -1674,6 +1675,13 @@ static int msm_compr_playback_open(struct snd_compr_stream *cstream)
__func__, rtd->dai_link->cpu_dai_name, -EBUSY);
return -EBUSY;
}
subsys_state = apr_get_subsys_state();
if (subsys_state == APR_SUBSYS_DOWN) {
pr_debug("%s: adsp is down\n", __func__);
return -ENETRESET;
}
prtd = kzalloc(sizeof(struct msm_compr_audio), GFP_KERNEL);
if (prtd == NULL) {
pr_err("Failed to allocate memory for msm_compr_audio\n");
@@ -1768,6 +1776,7 @@ static int msm_compr_capture_open(struct snd_compr_stream *cstream)
struct snd_soc_component *component = NULL;
struct msm_compr_audio *prtd;
struct msm_compr_pdata *pdata = NULL;
enum apr_subsys_state subsys_state;
pr_debug("%s\n", __func__);
component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
@@ -1780,6 +1789,12 @@ static int msm_compr_capture_open(struct snd_compr_stream *cstream)
pr_err("%s: pdata is NULL\n", __func__);
return -EINVAL;
}
subsys_state = apr_get_subsys_state();
if (subsys_state == APR_SUBSYS_DOWN) {
pr_debug("%s: adsp is down\n", __func__);
return -ENETRESET;
}
prtd = kzalloc(sizeof(struct msm_compr_audio), GFP_KERNEL);
if (!prtd) {
pr_err("Failed to allocate memory for msm_compr_audio\n");

Ver fichero

@@ -181,7 +181,13 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct msm_audio *prtd;
int ret = 0;
enum apr_subsys_state subsys_state;
subsys_state = apr_get_subsys_state();
if (subsys_state == APR_SUBSYS_DOWN) {
pr_debug("%s: adsp is down\n", __func__);
return -ENETRESET;
}
prtd = kzalloc(sizeof(struct msm_audio), GFP_KERNEL);
if (prtd == NULL)

Ver fichero

@@ -676,6 +676,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
snd_soc_rtdcom_lookup(soc_prtd, DRV_NAME);
struct msm_audio *prtd;
struct msm_plat_data *pdata;
enum apr_subsys_state subsys_state;
int ret = 0;
if (!component) {
@@ -689,6 +690,13 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
pr_err("%s: platform data not populated\n", __func__);
return -EINVAL;
}
subsys_state = apr_get_subsys_state();
if (subsys_state == APR_SUBSYS_DOWN) {
pr_debug("%s: adsp is down\n", __func__);
return -ENETRESET;
}
prtd = kzalloc(sizeof(struct msm_audio), GFP_KERNEL);
if (prtd == NULL)
return -ENOMEM;

Ver fichero

@@ -426,12 +426,19 @@ static int msm_transcode_loopback_set_params(struct snd_compr_stream *cstream,
struct trans_loopback_pdata *pdata;
uint32_t bit_width = 16;
int ret = 0;
enum apr_subsys_state subsys_state;
if (trans == NULL) {
pr_err("%s: Invalid param\n", __func__);
return -EINVAL;
}
subsys_state = apr_get_subsys_state();
if (subsys_state == APR_SUBSYS_DOWN) {
pr_debug("%s: adsp is down\n", __func__);
return -ENETRESET;
}
mutex_lock(&trans->lock);
rtd = snd_pcm_substream_chip(cstream);