order++)
/* component interface */
+struct snd_compress_ops {
+ int (*open)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream);
+ int (*free)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream);
+ int (*set_params)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_compr_params *params);
+ int (*get_params)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_codec *params);
+ int (*set_metadata)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_compr_metadata *metadata);
+ int (*get_metadata)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_compr_metadata *metadata);
+ int (*trigger)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream, int cmd);
+ int (*pointer)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_compr_tstamp *tstamp);
+ int (*copy)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream, char __user *buf,
+ size_t count);
+ int (*mmap)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct vm_area_struct *vma);
+ int (*ack)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream, size_t bytes);
+ int (*get_caps)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_compr_caps *caps);
+ int (*get_codec_caps)(struct snd_soc_component *component,
+ struct snd_compr_stream *stream,
+ struct snd_compr_codec_caps *codec);
+};
+
struct snd_soc_component_driver {
const char *name;
struct snd_pcm_substream *substream,
struct vm_area_struct *vma);
- const struct snd_compr_ops *compr_ops;
+ const struct snd_compr_ops *compr_ops; /* remove me */
+ const struct snd_compress_ops *compress_ops;
/* probe ordering - for components with runtime dependencies */
int probe_order;
struct snd_soc_component *component;
int i, ret;
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->open)
+ continue;
+
+ ret = component->driver->compress_ops->open(component, cstream);
+ if (ret < 0) {
+ dev_err(component->dev,
+ "Compress ASoC: can't open platform %s: %d\n",
+ component->name, ret);
+
+ *last = component;
+ return ret;
+ }
+ }
+
+ /* remvoe me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->open)
struct snd_soc_component *component;
int i;
+ for_each_rtd_components(rtd, i, component) {
+ if (component == last)
+ break;
+
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->free)
+ continue;
+
+ component->driver->compress_ops->free(component, cstream);
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
struct snd_soc_component *component;
int i, ret;
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->trigger)
+ continue;
+
+ ret = component->driver->compress_ops->trigger(
+ component, cstream, cmd);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->trigger)
struct snd_soc_component *component;
int i, ret;
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->set_params)
+ continue;
+
+ ret = component->driver->compress_ops->set_params(
+ component, cstream, params);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->set_params)
goto err;
}
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->get_params)
+ continue;
+
+ ret = component->driver->compress_ops->get_params(
+ component, cstream, params);
+ break;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_params)
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->get_caps)
+ continue;
+
+ ret = component->driver->compress_ops->get_caps(
+ component, cstream, caps);
+ break;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_caps)
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->get_codec_caps)
+ continue;
+
+ ret = component->driver->compress_ops->get_codec_caps(
+ component, cstream, codec);
+ break;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_codec_caps)
goto err;
}
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->ack)
+ continue;
+
+ ret = component->driver->compress_ops->ack(
+ component, cstream, bytes);
+ if (ret < 0)
+ goto err;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->ack)
if (cpu_dai->driver->cops && cpu_dai->driver->cops->pointer)
cpu_dai->driver->cops->pointer(cstream, tstamp, cpu_dai);
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->pointer)
+ continue;
+
+ ret = component->driver->compress_ops->pointer(
+ component, cstream, tstamp);
+ break;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->pointer)
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->copy)
+ continue;
+
+ ret = component->driver->compress_ops->copy(
+ component, cstream, buf, count);
+ break;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->copy)
return ret;
}
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->set_metadata)
+ continue;
+
+ ret = component->driver->compress_ops->set_metadata(
+ component, cstream, metadata);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->set_metadata)
return ret;
}
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->get_metadata)
+ continue;
+
+ return component->driver->compress_ops->get_metadata(
+ component, cstream, metadata);
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->get_metadata)
memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops));
}
+ for_each_rtd_components(rtd, i, component) {
+ if (!component->driver->compress_ops ||
+ !component->driver->compress_ops->copy)
+ continue;
+
+ compr->ops->copy = soc_compr_copy;
+ break;
+ }
+
+ /* remove me */
for_each_rtd_components(rtd, i, component) {
if (!component->driver->compr_ops ||
!component->driver->compr_ops->copy)