Commit e7cbe528 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-compress: remove snd_compr_ops

snd_compr_ops couldn't care called component,
but now we can care it via snd_compress_ops.
All drivers switched to it.
This patch removes snd_compr_ops.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87lfmqvdig.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 27ecad21
...@@ -146,7 +146,6 @@ struct snd_soc_component_driver { ...@@ -146,7 +146,6 @@ struct snd_soc_component_driver {
struct snd_pcm_substream *substream, struct snd_pcm_substream *substream,
struct vm_area_struct *vma); struct vm_area_struct *vma);
const struct snd_compr_ops *compr_ops; /* remove me */
const struct snd_compress_ops *compress_ops; const struct snd_compress_ops *compress_ops;
/* probe ordering - for components with runtime dependencies */ /* probe ordering - for components with runtime dependencies */
......
...@@ -44,23 +44,6 @@ static int soc_compr_components_open(struct snd_compr_stream *cstream, ...@@ -44,23 +44,6 @@ static int soc_compr_components_open(struct snd_compr_stream *cstream,
} }
} }
/* remvoe me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->open)
continue;
ret = component->driver->compr_ops->open(cstream);
if (ret < 0) {
dev_err(component->dev,
"Compress ASoC: can't open platform %s: %d\n",
component->name, ret);
*last = component;
return ret;
}
}
*last = NULL; *last = NULL;
return 0; return 0;
} }
...@@ -83,18 +66,6 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream, ...@@ -83,18 +66,6 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream,
component->driver->compress_ops->free(component, cstream); component->driver->compress_ops->free(component, cstream);
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
if (!component->driver->compr_ops ||
!component->driver->compr_ops->free)
continue;
component->driver->compr_ops->free(cstream);
}
return 0; return 0;
} }
...@@ -367,17 +338,6 @@ static int soc_compr_components_trigger(struct snd_compr_stream *cstream, ...@@ -367,17 +338,6 @@ static int soc_compr_components_trigger(struct snd_compr_stream *cstream,
return ret; return ret;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->trigger)
continue;
ret = component->driver->compr_ops->trigger(cstream, cmd);
if (ret < 0)
return ret;
}
return 0; return 0;
} }
...@@ -481,17 +441,6 @@ static int soc_compr_components_set_params(struct snd_compr_stream *cstream, ...@@ -481,17 +441,6 @@ static int soc_compr_components_set_params(struct snd_compr_stream *cstream,
return ret; return ret;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->set_params)
continue;
ret = component->driver->compr_ops->set_params(cstream, params);
if (ret < 0)
return ret;
}
return 0; return 0;
} }
...@@ -632,16 +581,6 @@ static int soc_compr_get_params(struct snd_compr_stream *cstream, ...@@ -632,16 +581,6 @@ static int soc_compr_get_params(struct snd_compr_stream *cstream,
break; break;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_params)
continue;
ret = component->driver->compr_ops->get_params(cstream, params);
break;
}
err: err:
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
...@@ -666,16 +605,6 @@ static int soc_compr_get_caps(struct snd_compr_stream *cstream, ...@@ -666,16 +605,6 @@ static int soc_compr_get_caps(struct snd_compr_stream *cstream,
break; break;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_caps)
continue;
ret = component->driver->compr_ops->get_caps(cstream, caps);
break;
}
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
} }
...@@ -699,17 +628,6 @@ static int soc_compr_get_codec_caps(struct snd_compr_stream *cstream, ...@@ -699,17 +628,6 @@ static int soc_compr_get_codec_caps(struct snd_compr_stream *cstream,
break; break;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_codec_caps)
continue;
ret = component->driver->compr_ops->get_codec_caps(cstream,
codec);
break;
}
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
} }
...@@ -740,17 +658,6 @@ static int soc_compr_ack(struct snd_compr_stream *cstream, size_t bytes) ...@@ -740,17 +658,6 @@ static int soc_compr_ack(struct snd_compr_stream *cstream, size_t bytes)
goto err; goto err;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->ack)
continue;
ret = component->driver->compr_ops->ack(cstream, bytes);
if (ret < 0)
goto err;
}
err: err:
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
...@@ -779,16 +686,6 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream, ...@@ -779,16 +686,6 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream,
break; break;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->pointer)
continue;
ret = component->driver->compr_ops->pointer(cstream, tstamp);
break;
}
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
} }
...@@ -812,16 +709,6 @@ static int soc_compr_copy(struct snd_compr_stream *cstream, ...@@ -812,16 +709,6 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
break; break;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->copy)
continue;
ret = component->driver->compr_ops->copy(cstream, buf, count);
break;
}
mutex_unlock(&rtd->card->pcm_mutex); mutex_unlock(&rtd->card->pcm_mutex);
return ret; return ret;
} }
...@@ -851,18 +738,6 @@ static int soc_compr_set_metadata(struct snd_compr_stream *cstream, ...@@ -851,18 +738,6 @@ static int soc_compr_set_metadata(struct snd_compr_stream *cstream,
return ret; return ret;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->set_metadata)
continue;
ret = component->driver->compr_ops->set_metadata(cstream,
metadata);
if (ret < 0)
return ret;
}
return 0; return 0;
} }
...@@ -889,16 +764,6 @@ static int soc_compr_get_metadata(struct snd_compr_stream *cstream, ...@@ -889,16 +764,6 @@ static int soc_compr_get_metadata(struct snd_compr_stream *cstream,
component, cstream, metadata); component, cstream, metadata);
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_metadata)
continue;
return component->driver->compr_ops->get_metadata(cstream,
metadata);
}
return 0; return 0;
} }
...@@ -1029,16 +894,6 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) ...@@ -1029,16 +894,6 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
break; break;
} }
/* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->copy)
continue;
compr->ops->copy = soc_compr_copy;
break;
}
mutex_init(&compr->lock); mutex_init(&compr->lock);
ret = snd_compress_new(rtd->card->snd_card, num, direction, ret = snd_compress_new(rtd->card->snd_card, num, direction,
new_name, compr); new_name, compr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment