Lines Matching full:component

3 // soc-component.c
18 static inline int _soc_component_ret(struct snd_soc_component *component, in _soc_component_ret() argument
32 dev_err(component->dev, in _soc_component_ret()
34 func, component->name, ret); in _soc_component_ret()
36 dev_err(component->dev, in _soc_component_ret()
38 func, component->name, reg, ret); in _soc_component_ret()
44 static inline int soc_component_field_shift(struct snd_soc_component *component, in soc_component_field_shift() argument
48 dev_err(component->dev, "ASoC: error field mask is zero for %s\n", in soc_component_field_shift()
49 component->name); in soc_component_field_shift()
60 #define soc_component_mark_push(component, substream, tgt) ((component)->mark_##tgt = substream) argument
61 #define soc_component_mark_pop(component, substream, tgt) ((component)->mark_##tgt = NULL) argument
62 #define soc_component_mark_match(component, substream, tgt) ((component)->mark_##tgt == substream) argument
64 void snd_soc_component_set_aux(struct snd_soc_component *component, in snd_soc_component_set_aux() argument
67 component->init = (aux) ? aux->init : NULL; in snd_soc_component_set_aux()
70 int snd_soc_component_init(struct snd_soc_component *component) in snd_soc_component_init() argument
74 if (component->init) in snd_soc_component_init()
75 ret = component->init(component); in snd_soc_component_init()
77 return soc_component_ret(component, ret); in snd_soc_component_init()
81 * snd_soc_component_set_sysclk - configure COMPONENT system or master clock.
82 * @component: COMPONENT
90 int snd_soc_component_set_sysclk(struct snd_soc_component *component, in snd_soc_component_set_sysclk() argument
96 if (component->driver->set_sysclk) in snd_soc_component_set_sysclk()
97 ret = component->driver->set_sysclk(component, clk_id, source, in snd_soc_component_set_sysclk()
100 return soc_component_ret(component, ret); in snd_soc_component_set_sysclk()
105 * snd_soc_component_set_pll - configure component PLL.
106 * @component: COMPONENT
114 int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, in snd_soc_component_set_pll() argument
120 if (component->driver->set_pll) in snd_soc_component_set_pll()
121 ret = component->driver->set_pll(component, pll_id, source, in snd_soc_component_set_pll()
124 return soc_component_ret(component, ret); in snd_soc_component_set_pll()
128 void snd_soc_component_seq_notifier(struct snd_soc_component *component, in snd_soc_component_seq_notifier() argument
131 if (component->driver->seq_notifier) in snd_soc_component_seq_notifier()
132 component->driver->seq_notifier(component, type, subseq); in snd_soc_component_seq_notifier()
135 int snd_soc_component_stream_event(struct snd_soc_component *component, in snd_soc_component_stream_event() argument
140 if (component->driver->stream_event) in snd_soc_component_stream_event()
141 ret = component->driver->stream_event(component, event); in snd_soc_component_stream_event()
143 return soc_component_ret(component, ret); in snd_soc_component_stream_event()
146 int snd_soc_component_set_bias_level(struct snd_soc_component *component, in snd_soc_component_set_bias_level() argument
151 if (component->driver->set_bias_level) in snd_soc_component_set_bias_level()
152 ret = component->driver->set_bias_level(component, level); in snd_soc_component_set_bias_level()
154 return soc_component_ret(component, ret); in snd_soc_component_set_bias_level()
157 int snd_soc_component_enable_pin(struct snd_soc_component *component, in snd_soc_component_enable_pin() argument
161 snd_soc_component_get_dapm(component); in snd_soc_component_enable_pin()
166 int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component, in snd_soc_component_enable_pin_unlocked() argument
170 snd_soc_component_get_dapm(component); in snd_soc_component_enable_pin_unlocked()
175 int snd_soc_component_disable_pin(struct snd_soc_component *component, in snd_soc_component_disable_pin() argument
179 snd_soc_component_get_dapm(component); in snd_soc_component_disable_pin()
184 int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component, in snd_soc_component_disable_pin_unlocked() argument
188 snd_soc_component_get_dapm(component); in snd_soc_component_disable_pin_unlocked()
193 int snd_soc_component_nc_pin(struct snd_soc_component *component, in snd_soc_component_nc_pin() argument
197 snd_soc_component_get_dapm(component); in snd_soc_component_nc_pin()
202 int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component, in snd_soc_component_nc_pin_unlocked() argument
206 snd_soc_component_get_dapm(component); in snd_soc_component_nc_pin_unlocked()
211 int snd_soc_component_get_pin_status(struct snd_soc_component *component, in snd_soc_component_get_pin_status() argument
215 snd_soc_component_get_dapm(component); in snd_soc_component_get_pin_status()
220 int snd_soc_component_force_enable_pin(struct snd_soc_component *component, in snd_soc_component_force_enable_pin() argument
224 snd_soc_component_get_dapm(component); in snd_soc_component_force_enable_pin()
230 struct snd_soc_component *component, in snd_soc_component_force_enable_pin_unlocked() argument
234 snd_soc_component_get_dapm(component); in snd_soc_component_force_enable_pin_unlocked()
239 static void soc_get_kcontrol_name(struct snd_soc_component *component, in soc_get_kcontrol_name() argument
243 if (component->name_prefix) in soc_get_kcontrol_name()
244 snprintf(buf, size, "%s %s", component->name_prefix, ctl); in soc_get_kcontrol_name()
249 struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component, in snd_soc_component_get_kcontrol() argument
254 soc_get_kcontrol_name(component, name, ARRAY_SIZE(name), ctl); in snd_soc_component_get_kcontrol()
256 return snd_soc_card_get_kcontrol(component->card, name); in snd_soc_component_get_kcontrol()
260 int snd_soc_component_notify_control(struct snd_soc_component *component, in snd_soc_component_notify_control() argument
265 kctl = snd_soc_component_get_kcontrol(component, ctl); in snd_soc_component_notify_control()
267 return soc_component_ret(component, -EINVAL); in snd_soc_component_notify_control()
269 snd_ctl_notify(component->card->snd_card, in snd_soc_component_notify_control()
277 * snd_soc_component_set_jack - configure component jack.
278 * @component: COMPONENTs
284 int snd_soc_component_set_jack(struct snd_soc_component *component, in snd_soc_component_set_jack() argument
289 if (component->driver->set_jack) in snd_soc_component_set_jack()
290 ret = component->driver->set_jack(component, jack, data); in snd_soc_component_set_jack()
292 return soc_component_ret(component, ret); in snd_soc_component_set_jack()
298 * @component: COMPONENTs
300 * Returns the jack type of the component
305 struct snd_soc_component *component) in snd_soc_component_get_jack_type() argument
309 if (component->driver->get_jack_type) in snd_soc_component_get_jack_type()
310 ret = component->driver->get_jack_type(component); in snd_soc_component_get_jack_type()
312 return soc_component_ret(component, ret); in snd_soc_component_get_jack_type()
316 int snd_soc_component_module_get(struct snd_soc_component *component, in snd_soc_component_module_get() argument
321 if (component->driver->module_get_upon_open == !!upon_open && in snd_soc_component_module_get()
322 !try_module_get(component->dev->driver->owner)) in snd_soc_component_module_get()
327 soc_component_mark_push(component, mark, module); in snd_soc_component_module_get()
329 return soc_component_ret(component, ret); in snd_soc_component_module_get()
332 void snd_soc_component_module_put(struct snd_soc_component *component, in snd_soc_component_module_put() argument
335 if (rollback && !soc_component_mark_match(component, mark, module)) in snd_soc_component_module_put()
338 if (component->driver->module_get_upon_open == !!upon_open) in snd_soc_component_module_put()
339 module_put(component->dev->driver->owner); in snd_soc_component_module_put()
342 soc_component_mark_pop(component, mark, module); in snd_soc_component_module_put()
345 int snd_soc_component_open(struct snd_soc_component *component, in snd_soc_component_open() argument
350 if (component->driver->open) in snd_soc_component_open()
351 ret = component->driver->open(component, substream); in snd_soc_component_open()
355 soc_component_mark_push(component, substream, open); in snd_soc_component_open()
357 return soc_component_ret(component, ret); in snd_soc_component_open()
360 int snd_soc_component_close(struct snd_soc_component *component, in snd_soc_component_close() argument
366 if (rollback && !soc_component_mark_match(component, substream, open)) in snd_soc_component_close()
369 if (component->driver->close) in snd_soc_component_close()
370 ret = component->driver->close(component, substream); in snd_soc_component_close()
373 soc_component_mark_pop(component, substream, open); in snd_soc_component_close()
375 return soc_component_ret(component, ret); in snd_soc_component_close()
378 void snd_soc_component_suspend(struct snd_soc_component *component) in snd_soc_component_suspend() argument
380 if (component->driver->suspend) in snd_soc_component_suspend()
381 component->driver->suspend(component); in snd_soc_component_suspend()
382 component->suspended = 1; in snd_soc_component_suspend()
385 void snd_soc_component_resume(struct snd_soc_component *component) in snd_soc_component_resume() argument
387 if (component->driver->resume) in snd_soc_component_resume()
388 component->driver->resume(component); in snd_soc_component_resume()
389 component->suspended = 0; in snd_soc_component_resume()
392 int snd_soc_component_is_suspended(struct snd_soc_component *component) in snd_soc_component_is_suspended() argument
394 return component->suspended; in snd_soc_component_is_suspended()
397 int snd_soc_component_probe(struct snd_soc_component *component) in snd_soc_component_probe() argument
401 if (component->driver->probe) in snd_soc_component_probe()
402 ret = component->driver->probe(component); in snd_soc_component_probe()
404 return soc_component_ret(component, ret); in snd_soc_component_probe()
407 void snd_soc_component_remove(struct snd_soc_component *component) in snd_soc_component_remove() argument
409 if (component->driver->remove) in snd_soc_component_remove()
410 component->driver->remove(component); in snd_soc_component_remove()
413 int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component, in snd_soc_component_of_xlate_dai_id() argument
418 if (component->driver->of_xlate_dai_id) in snd_soc_component_of_xlate_dai_id()
419 ret = component->driver->of_xlate_dai_id(component, ep); in snd_soc_component_of_xlate_dai_id()
421 return soc_component_ret(component, ret); in snd_soc_component_of_xlate_dai_id()
424 int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component, in snd_soc_component_of_xlate_dai_name() argument
428 if (component->driver->of_xlate_dai_name) in snd_soc_component_of_xlate_dai_name()
429 return component->driver->of_xlate_dai_name(component, in snd_soc_component_of_xlate_dai_name()
433 * the error just yet. If a device has more than one component, the in snd_soc_component_of_xlate_dai_name()
439 void snd_soc_component_setup_regmap(struct snd_soc_component *component) in snd_soc_component_setup_regmap() argument
441 int val_bytes = regmap_get_val_bytes(component->regmap); in snd_soc_component_setup_regmap()
445 component->val_bytes = val_bytes; in snd_soc_component_setup_regmap()
452 * component
453 * @component: The component for which to initialize the regmap instance
454 * @regmap: The regmap instance that should be used by the component
457 * associated with the component. Only use this if the regmap instance is not
458 * yet ready when the component is registered. The function must also be called
459 * before the first IO attempt of the component.
461 void snd_soc_component_init_regmap(struct snd_soc_component *component, in snd_soc_component_init_regmap() argument
464 component->regmap = regmap; in snd_soc_component_init_regmap()
465 snd_soc_component_setup_regmap(component); in snd_soc_component_init_regmap()
471 * component
472 * @component: The component for which to de-initialize the regmap instance
474 * Calls regmap_exit() on the regmap instance associated to the component and
475 * removes the regmap instance from the component.
480 void snd_soc_component_exit_regmap(struct snd_soc_component *component) in snd_soc_component_exit_regmap() argument
482 regmap_exit(component->regmap); in snd_soc_component_exit_regmap()
483 component->regmap = NULL; in snd_soc_component_exit_regmap()
489 int snd_soc_component_compr_open(struct snd_soc_component *component, in snd_soc_component_compr_open() argument
494 if (component->driver->compress_ops && in snd_soc_component_compr_open()
495 component->driver->compress_ops->open) in snd_soc_component_compr_open()
496 ret = component->driver->compress_ops->open(component, cstream); in snd_soc_component_compr_open()
500 soc_component_mark_push(component, cstream, compr_open); in snd_soc_component_compr_open()
502 return soc_component_ret(component, ret); in snd_soc_component_compr_open()
506 void snd_soc_component_compr_free(struct snd_soc_component *component, in snd_soc_component_compr_free() argument
510 if (rollback && !soc_component_mark_match(component, cstream, compr_open)) in snd_soc_component_compr_free()
513 if (component->driver->compress_ops && in snd_soc_component_compr_free()
514 component->driver->compress_ops->free) in snd_soc_component_compr_free()
515 component->driver->compress_ops->free(component, cstream); in snd_soc_component_compr_free()
518 soc_component_mark_pop(component, cstream, compr_open); in snd_soc_component_compr_free()
525 struct snd_soc_component *component; in snd_soc_component_compr_trigger() local
528 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_trigger()
529 if (component->driver->compress_ops && in snd_soc_component_compr_trigger()
530 component->driver->compress_ops->trigger) { in snd_soc_component_compr_trigger()
531 ret = component->driver->compress_ops->trigger( in snd_soc_component_compr_trigger()
532 component, cstream, cmd); in snd_soc_component_compr_trigger()
534 return soc_component_ret(component, ret); in snd_soc_component_compr_trigger()
546 struct snd_soc_component *component; in snd_soc_component_compr_set_params() local
549 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_set_params()
550 if (component->driver->compress_ops && in snd_soc_component_compr_set_params()
551 component->driver->compress_ops->set_params) { in snd_soc_component_compr_set_params()
552 ret = component->driver->compress_ops->set_params( in snd_soc_component_compr_set_params()
553 component, cstream, params); in snd_soc_component_compr_set_params()
555 return soc_component_ret(component, ret); in snd_soc_component_compr_set_params()
567 struct snd_soc_component *component; in snd_soc_component_compr_get_params() local
570 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_get_params()
571 if (component->driver->compress_ops && in snd_soc_component_compr_get_params()
572 component->driver->compress_ops->get_params) { in snd_soc_component_compr_get_params()
573 ret = component->driver->compress_ops->get_params( in snd_soc_component_compr_get_params()
574 component, cstream, params); in snd_soc_component_compr_get_params()
575 return soc_component_ret(component, ret); in snd_soc_component_compr_get_params()
587 struct snd_soc_component *component; in snd_soc_component_compr_get_caps() local
592 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_get_caps()
593 if (component->driver->compress_ops && in snd_soc_component_compr_get_caps()
594 component->driver->compress_ops->get_caps) { in snd_soc_component_compr_get_caps()
595 ret = component->driver->compress_ops->get_caps( in snd_soc_component_compr_get_caps()
596 component, cstream, caps); in snd_soc_component_compr_get_caps()
603 return soc_component_ret(component, ret); in snd_soc_component_compr_get_caps()
611 struct snd_soc_component *component; in snd_soc_component_compr_get_codec_caps() local
616 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_get_codec_caps()
617 if (component->driver->compress_ops && in snd_soc_component_compr_get_codec_caps()
618 component->driver->compress_ops->get_codec_caps) { in snd_soc_component_compr_get_codec_caps()
619 ret = component->driver->compress_ops->get_codec_caps( in snd_soc_component_compr_get_codec_caps()
620 component, cstream, codec); in snd_soc_component_compr_get_codec_caps()
627 return soc_component_ret(component, ret); in snd_soc_component_compr_get_codec_caps()
634 struct snd_soc_component *component; in snd_soc_component_compr_ack() local
637 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_ack()
638 if (component->driver->compress_ops && in snd_soc_component_compr_ack()
639 component->driver->compress_ops->ack) { in snd_soc_component_compr_ack()
640 ret = component->driver->compress_ops->ack( in snd_soc_component_compr_ack()
641 component, cstream, bytes); in snd_soc_component_compr_ack()
643 return soc_component_ret(component, ret); in snd_soc_component_compr_ack()
655 struct snd_soc_component *component; in snd_soc_component_compr_pointer() local
658 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_pointer()
659 if (component->driver->compress_ops && in snd_soc_component_compr_pointer()
660 component->driver->compress_ops->pointer) { in snd_soc_component_compr_pointer()
661 ret = component->driver->compress_ops->pointer( in snd_soc_component_compr_pointer()
662 component, cstream, tstamp); in snd_soc_component_compr_pointer()
663 return soc_component_ret(component, ret); in snd_soc_component_compr_pointer()
675 struct snd_soc_component *component; in snd_soc_component_compr_copy() local
680 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_copy()
681 if (component->driver->compress_ops && in snd_soc_component_compr_copy()
682 component->driver->compress_ops->copy) { in snd_soc_component_compr_copy()
683 ret = component->driver->compress_ops->copy( in snd_soc_component_compr_copy()
684 component, cstream, buf, count); in snd_soc_component_compr_copy()
691 return soc_component_ret(component, ret); in snd_soc_component_compr_copy()
699 struct snd_soc_component *component; in snd_soc_component_compr_set_metadata() local
702 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_set_metadata()
703 if (component->driver->compress_ops && in snd_soc_component_compr_set_metadata()
704 component->driver->compress_ops->set_metadata) { in snd_soc_component_compr_set_metadata()
705 ret = component->driver->compress_ops->set_metadata( in snd_soc_component_compr_set_metadata()
706 component, cstream, metadata); in snd_soc_component_compr_set_metadata()
708 return soc_component_ret(component, ret); in snd_soc_component_compr_set_metadata()
720 struct snd_soc_component *component; in snd_soc_component_compr_get_metadata() local
723 for_each_rtd_components(rtd, i, component) { in snd_soc_component_compr_get_metadata()
724 if (component->driver->compress_ops && in snd_soc_component_compr_get_metadata()
725 component->driver->compress_ops->get_metadata) { in snd_soc_component_compr_get_metadata()
726 ret = component->driver->compress_ops->get_metadata( in snd_soc_component_compr_get_metadata()
727 component, cstream, metadata); in snd_soc_component_compr_get_metadata()
728 return soc_component_ret(component, ret); in snd_soc_component_compr_get_metadata()
737 struct snd_soc_component *component, in soc_component_read_no_lock() argument
743 if (component->regmap) in soc_component_read_no_lock()
744 ret = regmap_read(component->regmap, reg, &val); in soc_component_read_no_lock()
745 else if (component->driver->read) { in soc_component_read_no_lock()
747 val = component->driver->read(component, reg); in soc_component_read_no_lock()
753 return soc_component_ret_reg_rw(component, ret, reg); in soc_component_read_no_lock()
760 * @component: Component to read from
765 unsigned int snd_soc_component_read(struct snd_soc_component *component, in snd_soc_component_read() argument
770 mutex_lock(&component->io_mutex); in snd_soc_component_read()
771 val = soc_component_read_no_lock(component, reg); in snd_soc_component_read()
772 mutex_unlock(&component->io_mutex); in snd_soc_component_read()
779 struct snd_soc_component *component, in soc_component_write_no_lock() argument
784 if (component->regmap) in soc_component_write_no_lock()
785 ret = regmap_write(component->regmap, reg, val); in soc_component_write_no_lock()
786 else if (component->driver->write) in soc_component_write_no_lock()
787 ret = component->driver->write(component, reg, val); in soc_component_write_no_lock()
789 return soc_component_ret_reg_rw(component, ret, reg); in soc_component_write_no_lock()
794 * @component: Component to write to
800 int snd_soc_component_write(struct snd_soc_component *component, in snd_soc_component_write() argument
805 mutex_lock(&component->io_mutex); in snd_soc_component_write()
806 ret = soc_component_write_no_lock(component, reg, val); in snd_soc_component_write()
807 mutex_unlock(&component->io_mutex); in snd_soc_component_write()
814 struct snd_soc_component *component, unsigned int reg, in snd_soc_component_update_bits_legacy() argument
820 mutex_lock(&component->io_mutex); in snd_soc_component_update_bits_legacy()
822 old = soc_component_read_no_lock(component, reg); in snd_soc_component_update_bits_legacy()
827 ret = soc_component_write_no_lock(component, reg, new); in snd_soc_component_update_bits_legacy()
829 mutex_unlock(&component->io_mutex); in snd_soc_component_update_bits_legacy()
831 return soc_component_ret_reg_rw(component, ret, reg); in snd_soc_component_update_bits_legacy()
836 * @component: Component to update
845 int snd_soc_component_update_bits(struct snd_soc_component *component, in snd_soc_component_update_bits() argument
851 if (component->regmap) in snd_soc_component_update_bits()
852 ret = regmap_update_bits_check(component->regmap, reg, mask, in snd_soc_component_update_bits()
855 ret = snd_soc_component_update_bits_legacy(component, reg, in snd_soc_component_update_bits()
859 return soc_component_ret_reg_rw(component, ret, reg); in snd_soc_component_update_bits()
867 * @component: Component to update
881 int snd_soc_component_update_bits_async(struct snd_soc_component *component, in snd_soc_component_update_bits_async() argument
887 if (component->regmap) in snd_soc_component_update_bits_async()
888 ret = regmap_update_bits_check_async(component->regmap, reg, in snd_soc_component_update_bits_async()
891 ret = snd_soc_component_update_bits_legacy(component, reg, in snd_soc_component_update_bits_async()
895 return soc_component_ret_reg_rw(component, ret, reg); in snd_soc_component_update_bits_async()
902 * @component: Component to read from
908 unsigned int snd_soc_component_read_field(struct snd_soc_component *component, in snd_soc_component_read_field() argument
913 val = snd_soc_component_read(component, reg); in snd_soc_component_read_field()
915 val = (val & mask) >> soc_component_field_shift(component, mask); in snd_soc_component_read_field()
923 * @component: Component to write to
930 int snd_soc_component_write_field(struct snd_soc_component *component, in snd_soc_component_write_field() argument
935 val = (val << soc_component_field_shift(component, mask)) & mask; in snd_soc_component_write_field()
937 return snd_soc_component_update_bits(component, reg, mask, val); in snd_soc_component_write_field()
943 * @component: Component for which to wait
948 void snd_soc_component_async_complete(struct snd_soc_component *component) in snd_soc_component_async_complete() argument
950 if (component->regmap) in snd_soc_component_async_complete()
951 regmap_async_complete(component->regmap); in snd_soc_component_async_complete()
957 * @component: component
967 int snd_soc_component_test_bits(struct snd_soc_component *component, in snd_soc_component_test_bits() argument
972 old = snd_soc_component_read(component, reg); in snd_soc_component_test_bits()
981 struct snd_soc_component *component; in snd_soc_pcm_component_pointer() local
985 for_each_rtd_components(rtd, i, component) in snd_soc_pcm_component_pointer()
986 if (component->driver->pointer) in snd_soc_pcm_component_pointer()
987 return component->driver->pointer(component, substream); in snd_soc_pcm_component_pointer()
993 struct snd_soc_component *component) in snd_soc_component_is_codec_on_rtd() argument
999 if (dai->component == component) in snd_soc_component_is_codec_on_rtd()
1011 struct snd_soc_component *component; in snd_soc_pcm_component_delay() local
1021 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_delay()
1022 if (!component->driver->delay) in snd_soc_pcm_component_delay()
1025 delay = component->driver->delay(component, substream); in snd_soc_pcm_component_delay()
1027 if (snd_soc_component_is_codec_on_rtd(rtd, component)) in snd_soc_pcm_component_delay()
1038 struct snd_soc_component *component; in snd_soc_pcm_component_ioctl() local
1042 for_each_rtd_components(rtd, i, component) in snd_soc_pcm_component_ioctl()
1043 if (component->driver->ioctl) in snd_soc_pcm_component_ioctl()
1045 component, in snd_soc_pcm_component_ioctl()
1046 component->driver->ioctl(component, in snd_soc_pcm_component_ioctl()
1055 struct snd_soc_component *component; in snd_soc_pcm_component_sync_stop() local
1058 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_sync_stop()
1059 if (component->driver->sync_stop) { in snd_soc_pcm_component_sync_stop()
1060 ret = component->driver->sync_stop(component, in snd_soc_pcm_component_sync_stop()
1063 return soc_component_ret(component, ret); in snd_soc_pcm_component_sync_stop()
1075 struct snd_soc_component *component; in snd_soc_pcm_component_copy() local
1079 for_each_rtd_components(rtd, i, component) in snd_soc_pcm_component_copy()
1080 if (component->driver->copy) in snd_soc_pcm_component_copy()
1081 return soc_component_ret(component, in snd_soc_pcm_component_copy()
1082 component->driver->copy(component, substream, in snd_soc_pcm_component_copy()
1092 struct snd_soc_component *component; in snd_soc_pcm_component_page() local
1097 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_page()
1098 if (component->driver->page) { in snd_soc_pcm_component_page()
1099 page = component->driver->page(component, in snd_soc_pcm_component_page()
1113 struct snd_soc_component *component; in snd_soc_pcm_component_mmap() local
1117 for_each_rtd_components(rtd, i, component) in snd_soc_pcm_component_mmap()
1118 if (component->driver->mmap) in snd_soc_pcm_component_mmap()
1120 component, in snd_soc_pcm_component_mmap()
1121 component->driver->mmap(component, in snd_soc_pcm_component_mmap()
1129 struct snd_soc_component *component; in snd_soc_pcm_component_new() local
1133 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_new()
1134 if (component->driver->pcm_construct) { in snd_soc_pcm_component_new()
1135 ret = component->driver->pcm_construct(component, rtd); in snd_soc_pcm_component_new()
1137 return soc_component_ret(component, ret); in snd_soc_pcm_component_new()
1146 struct snd_soc_component *component; in snd_soc_pcm_component_free() local
1152 for_each_rtd_components(rtd, i, component) in snd_soc_pcm_component_free()
1153 if (component->driver->pcm_destruct) in snd_soc_pcm_component_free()
1154 component->driver->pcm_destruct(component, rtd->pcm); in snd_soc_pcm_component_free()
1160 struct snd_soc_component *component; in snd_soc_pcm_component_prepare() local
1163 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_prepare()
1164 if (component->driver->prepare) { in snd_soc_pcm_component_prepare()
1165 ret = component->driver->prepare(component, substream); in snd_soc_pcm_component_prepare()
1167 return soc_component_ret(component, ret); in snd_soc_pcm_component_prepare()
1178 struct snd_soc_component *component; in snd_soc_pcm_component_hw_params() local
1181 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_hw_params()
1182 if (component->driver->hw_params) { in snd_soc_pcm_component_hw_params()
1183 ret = component->driver->hw_params(component, in snd_soc_pcm_component_hw_params()
1186 return soc_component_ret(component, ret); in snd_soc_pcm_component_hw_params()
1189 soc_component_mark_push(component, substream, hw_params); in snd_soc_pcm_component_hw_params()
1199 struct snd_soc_component *component; in snd_soc_pcm_component_hw_free() local
1202 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_hw_free()
1203 if (rollback && !soc_component_mark_match(component, substream, hw_params)) in snd_soc_pcm_component_hw_free()
1206 if (component->driver->hw_free) { in snd_soc_pcm_component_hw_free()
1207 ret = component->driver->hw_free(component, substream); in snd_soc_pcm_component_hw_free()
1209 soc_component_ret(component, ret); in snd_soc_pcm_component_hw_free()
1213 soc_component_mark_pop(component, substream, hw_params); in snd_soc_pcm_component_hw_free()
1217 static int soc_component_trigger(struct snd_soc_component *component, in soc_component_trigger() argument
1223 if (component->driver->trigger) in soc_component_trigger()
1224 ret = component->driver->trigger(component, substream, cmd); in soc_component_trigger()
1226 return soc_component_ret(component, ret); in soc_component_trigger()
1233 struct snd_soc_component *component; in snd_soc_pcm_component_trigger() local
1240 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_trigger()
1241 ret = soc_component_trigger(component, substream, cmd); in snd_soc_pcm_component_trigger()
1244 soc_component_mark_push(component, substream, trigger); in snd_soc_pcm_component_trigger()
1250 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_trigger()
1251 if (rollback && !soc_component_mark_match(component, substream, trigger)) in snd_soc_pcm_component_trigger()
1254 r = soc_component_trigger(component, substream, cmd); in snd_soc_pcm_component_trigger()
1257 soc_component_mark_pop(component, substream, trigger); in snd_soc_pcm_component_trigger()
1267 struct snd_soc_component *component; in snd_soc_pcm_component_pm_runtime_get() local
1270 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_pm_runtime_get()
1271 int ret = pm_runtime_get_sync(component->dev); in snd_soc_pcm_component_pm_runtime_get()
1273 pm_runtime_put_noidle(component->dev); in snd_soc_pcm_component_pm_runtime_get()
1274 return soc_component_ret(component, ret); in snd_soc_pcm_component_pm_runtime_get()
1277 soc_component_mark_push(component, stream, pm); in snd_soc_pcm_component_pm_runtime_get()
1286 struct snd_soc_component *component; in snd_soc_pcm_component_pm_runtime_put() local
1289 for_each_rtd_components(rtd, i, component) { in snd_soc_pcm_component_pm_runtime_put()
1290 if (rollback && !soc_component_mark_match(component, stream, pm)) in snd_soc_pcm_component_pm_runtime_put()
1293 pm_runtime_mark_last_busy(component->dev); in snd_soc_pcm_component_pm_runtime_put()
1294 pm_runtime_put_autosuspend(component->dev); in snd_soc_pcm_component_pm_runtime_put()
1297 soc_component_mark_pop(component, stream, pm); in snd_soc_pcm_component_pm_runtime_put()
1304 struct snd_soc_component *component; in snd_soc_pcm_component_ack() local
1308 for_each_rtd_components(rtd, i, component) in snd_soc_pcm_component_ack()
1309 if (component->driver->ack) in snd_soc_pcm_component_ack()
1310 return component->driver->ack(component, substream); in snd_soc_pcm_component_ack()