summaryrefslogtreecommitdiffstats
path: root/sound/soc/qcom/qdsp6
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/qcom/qdsp6')
-rw-r--r--sound/soc/qcom/qdsp6/q6adm.c7
-rw-r--r--sound/soc/qcom/qdsp6/q6afe.c8
-rw-r--r--sound/soc/qcom/qdsp6/q6afe.h1
-rw-r--r--sound/soc/qcom/qdsp6/q6asm-dai.c36
-rw-r--r--sound/soc/qcom/qdsp6/q6asm.c6
-rw-r--r--sound/soc/qcom/qdsp6/q6routing.c2
6 files changed, 24 insertions, 36 deletions
diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c
index da242515e146..2f3ea6beb066 100644
--- a/sound/soc/qcom/qdsp6/q6adm.c
+++ b/sound/soc/qcom/qdsp6/q6adm.c
@@ -403,7 +403,7 @@ struct q6copp *q6adm_open(struct device *dev, int port_id, int path, int rate,
spin_lock_irqsave(&adm->copps_list_lock, flags);
copp = q6adm_alloc_copp(adm, port_id);
- if (IS_ERR_OR_NULL(copp)) {
+ if (IS_ERR(copp)) {
spin_unlock_irqrestore(&adm->copps_list_lock, flags);
return ERR_CAST(copp);
}
@@ -419,7 +419,6 @@ struct q6copp *q6adm_open(struct device *dev, int port_id, int path, int rate,
copp->bit_width = bit_width;
copp->app_type = app_type;
-
ret = q6adm_device_open(adm, copp, port_id, path, topology,
channel_mode, bit_width, rate);
if (ret < 0) {
@@ -588,12 +587,12 @@ static int q6adm_probe(struct apr_device *adev)
struct device *dev = &adev->dev;
struct q6adm *adm;
- adm = devm_kzalloc(&adev->dev, sizeof(*adm), GFP_KERNEL);
+ adm = devm_kzalloc(dev, sizeof(*adm), GFP_KERNEL);
if (!adm)
return -ENOMEM;
adm->apr = adev;
- dev_set_drvdata(&adev->dev, adm);
+ dev_set_drvdata(dev, adm);
adm->dev = dev;
q6core_get_svc_api_info(adev->svc_id, &adm->ainfo);
mutex_init(&adm->lock);
diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
index 0ce4eb60f984..e0945f7a58c8 100644
--- a/sound/soc/qcom/qdsp6/q6afe.c
+++ b/sound/soc/qcom/qdsp6/q6afe.c
@@ -800,14 +800,6 @@ int q6afe_get_port_id(int index)
}
EXPORT_SYMBOL_GPL(q6afe_get_port_id);
-int q6afe_is_rx_port(int index)
-{
- if (index < 0 || index >= AFE_PORT_MAX)
- return -EINVAL;
-
- return port_maps[index].is_rx;
-}
-EXPORT_SYMBOL_GPL(q6afe_is_rx_port);
static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
struct q6afe_port *port)
{
diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h
index 1a0f80a14afe..c7ed5422baff 100644
--- a/sound/soc/qcom/qdsp6/q6afe.h
+++ b/sound/soc/qcom/qdsp6/q6afe.h
@@ -198,7 +198,6 @@ int q6afe_port_start(struct q6afe_port *port);
int q6afe_port_stop(struct q6afe_port *port);
void q6afe_port_put(struct q6afe_port *port);
int q6afe_get_port_id(int index);
-int q6afe_is_rx_port(int index);
void q6afe_hdmi_port_prepare(struct q6afe_port *port,
struct q6afe_hdmi_cfg *cfg);
void q6afe_slim_port_prepare(struct q6afe_port *port,
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index aff57052a735..9b7b218f2a20 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -37,9 +37,6 @@
#define COMPR_PLAYBACK_MAX_FRAGMENT_SIZE (128 * 1024)
#define COMPR_PLAYBACK_MIN_NUM_FRAGMENTS (4)
#define COMPR_PLAYBACK_MAX_NUM_FRAGMENTS (16 * 4)
-#define Q6ASM_DAI_TX_RX 0
-#define Q6ASM_DAI_TX 1
-#define Q6ASM_DAI_RX 2
#define ALAC_CH_LAYOUT_MONO ((101 << 16) | 1)
#define ALAC_CH_LAYOUT_STEREO ((101 << 16) | 2)
@@ -215,9 +212,10 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
- struct snd_soc_pcm_runtime *soc_prtd = substream->private_data;
+ struct snd_soc_pcm_runtime *soc_prtd = asoc_substream_to_rtd(substream);
struct q6asm_dai_rtd *prtd = runtime->private_data;
struct q6asm_dai_data *pdata;
+ struct device *dev = component->dev;
int ret, i;
pdata = snd_soc_component_get_drvdata(component);
@@ -225,7 +223,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
return -EINVAL;
if (!prtd || !prtd->audio_client) {
- pr_err("%s: private data null or audio client freed\n",
+ dev_err(dev, "%s: private data null or audio client freed\n",
__func__);
return -EINVAL;
}
@@ -248,7 +246,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
prtd->periods);
if (ret < 0) {
- pr_err("Audio Start: Buffer Allocation failed rc = %d\n",
+ dev_err(dev, "Audio Start: Buffer Allocation failed rc = %d\n",
ret);
return -ENOMEM;
}
@@ -262,7 +260,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
}
if (ret < 0) {
- pr_err("%s: q6asm_open_write failed\n", __func__);
+ dev_err(dev, "%s: q6asm_open_write failed\n", __func__);
q6asm_audio_client_free(prtd->audio_client);
prtd->audio_client = NULL;
return -ENOMEM;
@@ -272,7 +270,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
ret = q6routing_stream_open(soc_prtd->dai_link->id, LEGACY_PCM_MODE,
prtd->session_id, substream->stream);
if (ret) {
- pr_err("%s: stream reg failed ret:%d\n", __func__, ret);
+ dev_err(dev, "%s: stream reg failed ret:%d\n", __func__, ret);
return ret;
}
@@ -292,7 +290,7 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
}
if (ret < 0)
- pr_info("%s: CMD Format block failed\n", __func__);
+ dev_info(dev, "%s: CMD Format block failed\n", __func__);
prtd->state = Q6ASM_STREAM_RUNNING;
@@ -332,7 +330,7 @@ static int q6asm_dai_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
- struct snd_soc_pcm_runtime *soc_prtd = substream->private_data;
+ struct snd_soc_pcm_runtime *soc_prtd = asoc_substream_to_rtd(substream);
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(soc_prtd, 0);
struct q6asm_dai_rtd *prtd;
struct q6asm_dai_data *pdata;
@@ -344,7 +342,7 @@ static int q6asm_dai_open(struct snd_soc_component *component,
pdata = snd_soc_component_get_drvdata(component);
if (!pdata) {
- pr_err("Drv data not found ..\n");
+ dev_err(dev, "Drv data not found ..\n");
return -EINVAL;
}
@@ -357,7 +355,7 @@ static int q6asm_dai_open(struct snd_soc_component *component,
(q6asm_cb)event_handler, prtd, stream_id,
LEGACY_PCM_MODE);
if (IS_ERR(prtd->audio_client)) {
- pr_info("%s: Could not allocate memory\n", __func__);
+ dev_info(dev, "%s: Could not allocate memory\n", __func__);
ret = PTR_ERR(prtd->audio_client);
kfree(prtd);
return ret;
@@ -372,12 +370,12 @@ static int q6asm_dai_open(struct snd_soc_component *component,
SNDRV_PCM_HW_PARAM_RATE,
&constraints_sample_rates);
if (ret < 0)
- pr_info("snd_pcm_hw_constraint_list failed\n");
+ dev_info(dev, "snd_pcm_hw_constraint_list failed\n");
/* Ensure that buffer size is a multiple of period size */
ret = snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0)
- pr_info("snd_pcm_hw_constraint_integer failed\n");
+ dev_info(dev, "snd_pcm_hw_constraint_integer failed\n");
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
ret = snd_pcm_hw_constraint_minmax(runtime,
@@ -385,21 +383,21 @@ static int q6asm_dai_open(struct snd_soc_component *component,
PLAYBACK_MIN_NUM_PERIODS * PLAYBACK_MIN_PERIOD_SIZE,
PLAYBACK_MAX_NUM_PERIODS * PLAYBACK_MAX_PERIOD_SIZE);
if (ret < 0) {
- pr_err("constraint for buffer bytes min max ret = %d\n",
- ret);
+ dev_err(dev, "constraint for buffer bytes min max ret = %d\n",
+ ret);
}
}
ret = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
if (ret < 0) {
- pr_err("constraint for period bytes step ret = %d\n",
+ dev_err(dev, "constraint for period bytes step ret = %d\n",
ret);
}
ret = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32);
if (ret < 0) {
- pr_err("constraint for buffer bytes step ret = %d\n",
+ dev_err(dev, "constraint for buffer bytes step ret = %d\n",
ret);
}
@@ -424,7 +422,7 @@ static int q6asm_dai_close(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
- struct snd_soc_pcm_runtime *soc_prtd = substream->private_data;
+ struct snd_soc_pcm_runtime *soc_prtd = asoc_substream_to_rtd(substream);
struct q6asm_dai_rtd *prtd = runtime->private_data;
if (prtd->audio_client) {
diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c
index ae4b2cabdf2d..755062eadcc8 100644
--- a/sound/soc/qcom/qdsp6/q6asm.c
+++ b/sound/soc/qcom/qdsp6/q6asm.c
@@ -311,7 +311,7 @@ static int q6asm_apr_send_session_pkt(struct q6asm *a, struct audio_client *ac,
5 * HZ);
if (!rc) {
- dev_err(a->dev, "CMD timeout\n");
+ dev_err(a->dev, "CMD %x timeout\n", hdr->opcode);
rc = -ETIMEDOUT;
} else if (ac->result.status > 0) {
dev_err(a->dev, "DSP returned error[%x]\n",
@@ -891,7 +891,7 @@ static int q6asm_ac_send_cmd_sync(struct audio_client *ac, struct apr_pkt *pkt)
rc = wait_event_timeout(ac->cmd_wait,
(ac->result.opcode == hdr->opcode), 5 * HZ);
if (!rc) {
- dev_err(ac->dev, "CMD timeout\n");
+ dev_err(ac->dev, "CMD %x timeout\n", hdr->opcode);
rc = -ETIMEDOUT;
goto err;
}
@@ -912,9 +912,9 @@ err:
/**
* q6asm_open_write() - Open audio client for writing
- *
* @ac: audio client pointer
* @format: audio sample format
+ * @codec_profile: compressed format profile
* @bits_per_sample: bits per sample
*
* Return: Will be an negative value on error or zero on success
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index 46e50612b92c..eaa95b5a7b66 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -924,7 +924,7 @@ static int routing_hw_params(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct msm_routing_data *data = dev_get_drvdata(component->dev);
unsigned int be_id = asoc_rtd_to_cpu(rtd, 0)->id;
struct session_data *session;