Lines Matching full:component

51 #define for_each_component(component)			\  argument
52 list_for_each_entry(component, &component_list, list)
133 static void soc_init_component_debugfs(struct snd_soc_component *component) in soc_init_component_debugfs() argument
135 if (!component->card->debugfs_card_root) in soc_init_component_debugfs()
138 if (component->debugfs_prefix) { in soc_init_component_debugfs()
142 component->debugfs_prefix, component->name); in soc_init_component_debugfs()
144 component->debugfs_root = debugfs_create_dir(name, in soc_init_component_debugfs()
145 component->card->debugfs_card_root); in soc_init_component_debugfs()
149 component->debugfs_root = debugfs_create_dir(component->name, in soc_init_component_debugfs()
150 component->card->debugfs_card_root); in soc_init_component_debugfs()
153 snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component), in soc_init_component_debugfs()
154 component->debugfs_root); in soc_init_component_debugfs()
157 static void soc_cleanup_component_debugfs(struct snd_soc_component *component) in soc_cleanup_component_debugfs() argument
159 if (!component->debugfs_root) in soc_cleanup_component_debugfs()
161 debugfs_remove_recursive(component->debugfs_root); in soc_cleanup_component_debugfs()
162 component->debugfs_root = NULL; in soc_cleanup_component_debugfs()
167 struct snd_soc_component *component; in dai_list_show() local
172 for_each_component(component) in dai_list_show()
173 for_each_component_dais(component, dai) in dai_list_show()
184 struct snd_soc_component *component; in component_list_show() local
188 for_each_component(component) in component_list_show()
189 seq_printf(m, "%s\n", component->name); in component_list_show()
232 static inline void soc_init_component_debugfs(struct snd_soc_component *component) { } in soc_init_component_debugfs() argument
233 static inline void soc_cleanup_component_debugfs(struct snd_soc_component *component) { } in soc_cleanup_component_debugfs() argument
293 if (dai->component->name && in snd_soc_is_matching_dai()
294 strcmp(dlc->dai_name, dai->component->name) == 0) in snd_soc_is_matching_dai()
309 if (dai->component->name) in snd_soc_dai_name_get()
310 return dai->component->name; in snd_soc_dai_name_get()
317 struct snd_soc_component *component) in snd_soc_rtd_add_component() argument
324 if (comp == component) in snd_soc_rtd_add_component()
330 rtd->components[rtd->num_components - 1] = component; in snd_soc_rtd_add_component()
338 struct snd_soc_component *component; in snd_soc_rtdcom_lookup() local
347 * snd_soc_rtdcom_lookup() will find component from rtd by using in snd_soc_rtdcom_lookup()
350 * to 1 rtd, this function will return 1st found component. in snd_soc_rtdcom_lookup()
352 for_each_rtd_components(rtd, i, component) { in snd_soc_rtdcom_lookup()
353 const char *component_name = component->driver->name; in snd_soc_rtdcom_lookup()
360 return component; in snd_soc_rtdcom_lookup()
370 struct snd_soc_component *component; in snd_soc_lookup_component_nolocked() local
374 for_each_component(component) { in snd_soc_lookup_component_nolocked()
375 if ((dev == component->dev) && in snd_soc_lookup_component_nolocked()
377 (driver_name == component->driver->name) || in snd_soc_lookup_component_nolocked()
378 (strcmp(component->driver->name, driver_name) == 0))) { in snd_soc_lookup_component_nolocked()
379 found_component = component; in snd_soc_lookup_component_nolocked()
391 struct snd_soc_component *component; in snd_soc_lookup_component() local
394 component = snd_soc_lookup_component_nolocked(dev, driver_name); in snd_soc_lookup_component()
397 return component; in snd_soc_lookup_component()
647 struct snd_soc_component *component; in snd_soc_suspend() local
692 for_each_rtd_components(rtd, i, component) { in snd_soc_suspend()
694 snd_soc_component_get_dapm(component); in snd_soc_suspend()
697 * ignore if component was already suspended in snd_soc_suspend()
699 if (snd_soc_component_is_suspended(component)) in snd_soc_suspend()
703 * If there are paths active then the COMPONENT will be in snd_soc_suspend()
709 * If the COMPONENT is capable of idle in snd_soc_suspend()
715 dev_dbg(component->dev, in snd_soc_suspend()
722 snd_soc_component_suspend(component); in snd_soc_suspend()
723 if (component->regmap) in snd_soc_suspend()
724 regcache_mark_dirty(component->regmap); in snd_soc_suspend()
726 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_suspend()
729 dev_dbg(component->dev, in snd_soc_suspend()
730 "ASoC: COMPONENT is on over suspend\n"); in snd_soc_suspend()
751 struct snd_soc_component *component; in soc_resume_deferred() local
765 for_each_card_components(card, component) { in soc_resume_deferred()
766 if (snd_soc_component_is_suspended(component)) in soc_resume_deferred()
767 snd_soc_component_resume(component); in soc_resume_deferred()
791 struct snd_soc_component *component; in snd_soc_resume() local
798 for_each_card_components(card, component) in snd_soc_resume()
799 if (snd_soc_component_active(component)) in snd_soc_resume()
800 pinctrl_pm_select_default_state(component->dev); in snd_soc_resume()
822 *soc_component_to_node(struct snd_soc_component *component) in soc_component_to_node() argument
826 of_node = component->dev->of_node; in soc_component_to_node()
827 if (!of_node && component->dev->parent) in soc_component_to_node()
828 of_node = component->dev->parent->of_node; in soc_component_to_node()
849 struct snd_soc_component *component) in snd_soc_is_matching_component() argument
859 for_each_component_dais(component, dai) in snd_soc_is_matching_component()
865 component_of_node = soc_component_to_node(component); in snd_soc_is_matching_component()
869 if (dlc->name && strcmp(component->name, dlc->name)) in snd_soc_is_matching_component()
878 struct snd_soc_component *component; in soc_find_component() local
885 * It returns *1st* found component, but some driver in soc_find_component()
888 * CPU component and generic DMAEngine component in soc_find_component()
890 for_each_component(component) in soc_find_component()
891 if (snd_soc_is_matching_component(dlc, component)) in soc_find_component()
892 return component; in soc_find_component()
900 * @dlc: name of the DAI or the DAI driver and optional component info to match
903 * find the DAI of the same name. The component's of_node and name
911 struct snd_soc_component *component; in snd_soc_find_dai() local
917 for_each_component(component) in snd_soc_find_dai()
918 if (snd_soc_is_matching_component(dlc, component)) in snd_soc_find_dai()
919 for_each_component_dais(component, dai) in snd_soc_find_dai()
963 * Defer card registration if codec component is not added to in soc_dai_link_sanity_check()
964 * component list. in soc_dai_link_sanity_check()
984 * Defer card registration if platform component is not added to in soc_dai_link_sanity_check()
985 * component list. in soc_dai_link_sanity_check()
1010 * Defer card registration if Component is not added in soc_dai_link_sanity_check()
1020 dev_err(card->dev, "ASoC: Both Component name/of_node are set for %s\n", link->name); in soc_dai_link_sanity_check()
1024 dev_err(card->dev, "ASoC: Neither Component name/of_node are set for %s\n", link->name); in soc_dai_link_sanity_check()
1028 dev_dbg(card->dev, "ASoC: Component %s not found for link %s\n", dlc->name, link->name); in soc_dai_link_sanity_check()
1036 dev_err(card->dev, "ASoC: Neither DAI/Component name/of_node are set for %s\n", link->name); in soc_dai_link_sanity_check()
1160 * topology component. And machine drivers can still define static
1168 struct snd_soc_component *component; in snd_soc_add_pcm_runtime() local
1200 snd_soc_rtd_add_component(rtd, snd_soc_rtd_to_cpu(rtd, i)->component); in snd_soc_add_pcm_runtime()
1212 snd_soc_rtd_add_component(rtd, snd_soc_rtd_to_codec(rtd, i)->component); in snd_soc_add_pcm_runtime()
1217 for_each_component(component) { in snd_soc_add_pcm_runtime()
1218 if (!snd_soc_is_matching_component(platform, component)) in snd_soc_add_pcm_runtime()
1221 if (snd_soc_component_is_dummy(component) && component->num_dai) in snd_soc_add_pcm_runtime()
1224 snd_soc_rtd_add_component(rtd, component); in snd_soc_add_pcm_runtime()
1460 struct snd_soc_component *component; in soc_init_pcm_runtime() local
1483 for_each_rtd_components(rtd, i, component) { in soc_init_pcm_runtime()
1484 if (!component->driver->use_dai_pcm_id) in soc_init_pcm_runtime()
1488 num += component->driver->be_pcm_base; in soc_init_pcm_runtime()
1519 struct snd_soc_component *component) in soc_set_name_prefix() argument
1521 struct device_node *of_node = soc_component_to_node(component); in soc_set_name_prefix()
1528 if (snd_soc_is_matching_component(&map->dlc, component) && in soc_set_name_prefix()
1530 component->name_prefix = map->name_prefix; in soc_set_name_prefix()
1543 component->name_prefix = str; in soc_set_name_prefix()
1546 static void soc_remove_component(struct snd_soc_component *component, in soc_remove_component() argument
1550 if (!component->card) in soc_remove_component()
1554 snd_soc_component_remove(component); in soc_remove_component()
1556 list_del_init(&component->card_list); in soc_remove_component()
1557 snd_soc_dapm_free(snd_soc_component_get_dapm(component)); in soc_remove_component()
1558 soc_cleanup_component_debugfs(component); in soc_remove_component()
1559 component->card = NULL; in soc_remove_component()
1560 snd_soc_component_module_put_when_remove(component); in soc_remove_component()
1564 struct snd_soc_component *component) in soc_probe_component() argument
1567 snd_soc_component_get_dapm(component); in soc_probe_component()
1572 if (snd_soc_component_is_dummy(component)) in soc_probe_component()
1575 if (component->card) { in soc_probe_component()
1576 if (component->card != card) { in soc_probe_component()
1577 dev_err(component->dev, in soc_probe_component()
1578 "Trying to bind component \"%s\" to card \"%s\" but is already bound to card \"%s\"\n", in soc_probe_component()
1579 component->name, card->name, component->card->name); in soc_probe_component()
1585 ret = snd_soc_component_module_get_when_probe(component); in soc_probe_component()
1589 component->card = card; in soc_probe_component()
1590 soc_set_name_prefix(card, component); in soc_probe_component()
1592 soc_init_component_debugfs(component); in soc_probe_component()
1594 snd_soc_dapm_init(dapm, card, component); in soc_probe_component()
1597 component->driver->dapm_widgets, in soc_probe_component()
1598 component->driver->num_dapm_widgets); in soc_probe_component()
1601 dev_err(component->dev, in soc_probe_component()
1606 for_each_component_dais(component, dai) { in soc_probe_component()
1609 dev_err(component->dev, in soc_probe_component()
1615 ret = snd_soc_component_probe(component); in soc_probe_component()
1622 component->name); in soc_probe_component()
1630 ret = snd_soc_component_init(component); in soc_probe_component()
1634 ret = snd_soc_add_component_controls(component, in soc_probe_component()
1635 component->driver->controls, in soc_probe_component()
1636 component->driver->num_controls); in soc_probe_component()
1641 component->driver->dapm_routes, in soc_probe_component()
1642 component->driver->num_dapm_routes); in soc_probe_component()
1657 list_add(&component->card_list, &card->component_dev_list); in soc_probe_component()
1661 soc_remove_component(component, probed); in soc_probe_component()
1698 struct snd_soc_component *component; in soc_remove_link_components() local
1704 for_each_rtd_components(rtd, i, component) { in soc_remove_link_components()
1705 if (component->driver->remove_order != order) in soc_remove_link_components()
1708 soc_remove_component(component, 1); in soc_remove_link_components()
1716 struct snd_soc_component *component; in soc_probe_link_components() local
1722 for_each_rtd_components(rtd, i, component) { in soc_probe_link_components()
1723 if (component->driver->probe_order != order) in soc_probe_link_components()
1726 ret = soc_probe_component(card, component); in soc_probe_link_components()
1738 struct snd_soc_component *component, *_component; in soc_unbind_aux_dev() local
1740 for_each_card_auxs_safe(card, component, _component) { in soc_unbind_aux_dev()
1742 snd_soc_component_set_aux(component, NULL); in soc_unbind_aux_dev()
1743 list_del(&component->card_aux_list); in soc_unbind_aux_dev()
1749 struct snd_soc_component *component; in soc_bind_aux_dev() local
1755 component = soc_find_component(&aux->dlc); in soc_bind_aux_dev()
1756 if (!component) in soc_bind_aux_dev()
1760 snd_soc_component_set_aux(component, aux); in soc_bind_aux_dev()
1762 list_add(&component->card_aux_list, &card->aux_comp_list); in soc_bind_aux_dev()
1769 struct snd_soc_component *component; in soc_probe_aux_devices() local
1774 for_each_card_auxs(card, component) { in soc_probe_aux_devices()
1775 if (component->driver->probe_order != order) in soc_probe_aux_devices()
1778 ret = soc_probe_component(card, component); in soc_probe_aux_devices()
1959 struct snd_soc_component *component; in soc_check_tplg_fes() local
1964 for_each_component(component) { in soc_check_tplg_fes()
1966 /* does this component override BEs ? */ in soc_check_tplg_fes()
1967 if (!component->driver->ignore_machine) in soc_check_tplg_fes()
1971 if (!strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1974 if (strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1990 /* override platform component */ in soc_check_tplg_fes()
1996 if (component->dev->of_node) in soc_check_tplg_fes()
1997 dai_link->platforms->of_node = component->dev->of_node; in soc_check_tplg_fes()
1999 dai_link->platforms->name = component->name; in soc_check_tplg_fes()
2028 component->driver->be_hw_params_fixup; in soc_check_tplg_fes()
2039 if (component->driver->topology_name_prefix) { in soc_check_tplg_fes()
2043 comp_drv = component->driver; in soc_check_tplg_fes()
2156 struct snd_soc_component *component; in snd_soc_bind_card() local
2223 "ASoC: failed to probe aux component %d\n", ret); in snd_soc_bind_card()
2311 for_each_card_components(card, component) in snd_soc_bind_card()
2312 if (!snd_soc_component_active(component)) in snd_soc_bind_card()
2313 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_bind_card()
2350 struct snd_soc_component *component; in snd_soc_poweroff() local
2364 for_each_card_components(card, component) in snd_soc_poweroff()
2365 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_poweroff()
2454 * snd_soc_add_component_controls - Add an array of controls to a component.
2456 * @component: Component to add controls to
2462 int snd_soc_add_component_controls(struct snd_soc_component *component, in snd_soc_add_component_controls() argument
2465 struct snd_card *card = component->card->snd_card; in snd_soc_add_component_controls()
2467 return snd_soc_add_controls(card, component->dev, controls, in snd_soc_add_component_controls()
2468 num_controls, component->name_prefix, component); in snd_soc_add_component_controls()
2505 struct snd_card *card = dai->component->card->snd_card; in snd_soc_add_dai_controls()
2587 /* I2C component devices are named "bus-addr" */ in fmt_single_name()
2595 /* sanitize component name for DAI link creation */ in fmt_single_name()
2631 * @component: The component the DAIs are registered for
2636 * Topology can use this API to register DAIs when probing a component.
2638 * will be freed in the component cleanup.
2640 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, in snd_soc_register_dai() argument
2644 struct device *dev = component->dev; in snd_soc_register_dai()
2654 * Back in the old days when we still had component-less DAIs, in snd_soc_register_dai()
2655 * instead of having a static name, component-less DAIs would in snd_soc_register_dai()
2659 * component-less anymore. in snd_soc_register_dai()
2669 dai->id = component->num_dai; in snd_soc_register_dai()
2674 dai->component = component; in snd_soc_register_dai()
2679 list_add_tail(&dai->list, &component->dai_list); in snd_soc_register_dai()
2680 component->num_dai++; in snd_soc_register_dai()
2690 * @component: The component for which the DAIs should be unregistered
2692 static void snd_soc_unregister_dais(struct snd_soc_component *component) in snd_soc_unregister_dais() argument
2696 for_each_component_dais_safe(component, dai, _dai) in snd_soc_unregister_dais()
2703 * @component: The component the DAIs are registered for
2707 static int snd_soc_register_dais(struct snd_soc_component *component, in snd_soc_register_dais() argument
2716 dai = snd_soc_register_dai(component, dai_drv + i, count == 1 && in snd_soc_register_dais()
2717 component->driver->legacy_dai_naming); in snd_soc_register_dais()
2727 snd_soc_unregister_dais(component); in snd_soc_register_dais()
2776 static void snd_soc_del_component_unlocked(struct snd_soc_component *component) in snd_soc_del_component_unlocked() argument
2778 struct snd_soc_card *card = component->card; in snd_soc_del_component_unlocked()
2780 snd_soc_unregister_dais(component); in snd_soc_del_component_unlocked()
2785 list_del(&component->list); in snd_soc_del_component_unlocked()
2788 int snd_soc_component_initialize(struct snd_soc_component *component, in snd_soc_component_initialize() argument
2792 INIT_LIST_HEAD(&component->dai_list); in snd_soc_component_initialize()
2793 INIT_LIST_HEAD(&component->dobj_list); in snd_soc_component_initialize()
2794 INIT_LIST_HEAD(&component->card_list); in snd_soc_component_initialize()
2795 INIT_LIST_HEAD(&component->list); in snd_soc_component_initialize()
2796 mutex_init(&component->io_mutex); in snd_soc_component_initialize()
2798 if (!component->name) { in snd_soc_component_initialize()
2799 component->name = fmt_single_name(dev, &component->id); in snd_soc_component_initialize()
2800 if (!component->name) { in snd_soc_component_initialize()
2806 component->dev = dev; in snd_soc_component_initialize()
2807 component->driver = driver; in snd_soc_component_initialize()
2810 if (!component->debugfs_prefix) in snd_soc_component_initialize()
2811 component->debugfs_prefix = driver->debugfs_prefix; in snd_soc_component_initialize()
2818 int snd_soc_add_component(struct snd_soc_component *component, in snd_soc_add_component() argument
2827 if (component->driver->endianness) { in snd_soc_add_component()
2834 ret = snd_soc_register_dais(component, dai_drv, num_dai); in snd_soc_add_component()
2836 dev_err(component->dev, "ASoC: Failed to register DAIs: %d\n", in snd_soc_add_component()
2841 if (!component->driver->write && !component->driver->read) { in snd_soc_add_component()
2842 if (!component->regmap) in snd_soc_add_component()
2843 component->regmap = dev_get_regmap(component->dev, in snd_soc_add_component()
2845 if (component->regmap) in snd_soc_add_component()
2846 snd_soc_component_setup_regmap(component); in snd_soc_add_component()
2850 list_add(&component->list, &component_list); in snd_soc_add_component()
2854 snd_soc_del_component_unlocked(component); in snd_soc_add_component()
2870 struct snd_soc_component *component; in snd_soc_register_component() local
2873 component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); in snd_soc_register_component()
2874 if (!component) in snd_soc_register_component()
2877 ret = snd_soc_component_initialize(component, component_driver, dev); in snd_soc_register_component()
2881 return snd_soc_add_component(component, dai_drv, num_dai); in snd_soc_register_component()
2886 * snd_soc_unregister_component_by_driver - Unregister component using a given driver
2890 * @component_driver: The component driver to unregister
2895 struct snd_soc_component *component; in snd_soc_unregister_component_by_driver() local
2901 component = snd_soc_lookup_component_nolocked(dev, component_driver->name); in snd_soc_unregister_component_by_driver()
2902 if (!component) in snd_soc_unregister_component_by_driver()
2905 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component_by_driver()
2913 * snd_soc_unregister_component - Unregister all related component
2922 struct snd_soc_component *component = snd_soc_lookup_component_nolocked(dev, NULL); in snd_soc_unregister_component() local
2924 if (!component) in snd_soc_unregister_component()
2927 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component()
3468 struct snd_soc_component *component; in snd_soc_get_dai_id() local
3483 component = soc_find_component(&dlc); in snd_soc_get_dai_id()
3484 if (component) in snd_soc_get_dai_id()
3485 ret = snd_soc_component_of_xlate_dai_id(component, ep); in snd_soc_get_dai_id()
3541 * check if another component is provided with the same in snd_soc_get_dlc()
3608 struct snd_soc_component *component; in snd_soc_get_dai_via_args() local
3611 for_each_component(component) { in snd_soc_get_dai_via_args()
3612 for_each_component_dais(component, dai) in snd_soc_get_dai_via_args()
3623 static void __snd_soc_of_put_component(struct snd_soc_dai_link_component *component) in __snd_soc_of_put_component() argument
3625 if (component->of_node) { in __snd_soc_of_put_component()
3626 of_node_put(component->of_node); in __snd_soc_of_put_component()
3627 component->of_node = NULL; in __snd_soc_of_put_component()
3636 struct snd_soc_dai_link_component *component; in __snd_soc_of_get_dai_link_component_alloc() local
3648 component = devm_kcalloc(dev, num, sizeof(*component), GFP_KERNEL); in __snd_soc_of_get_dai_link_component_alloc()
3649 if (!component) in __snd_soc_of_get_dai_link_component_alloc()
3652 *ret_component = component; in __snd_soc_of_get_dai_link_component_alloc()
3666 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_codecs() local
3669 for_each_link_codecs(dai_link, index, component) in snd_soc_of_put_dai_link_codecs()
3670 __snd_soc_of_put_component(component); in snd_soc_of_put_dai_link_codecs()
3692 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_codecs() local
3701 for_each_link_codecs(dai_link, index, component) { in snd_soc_of_get_dai_link_codecs()
3702 ret = snd_soc_of_get_dlc(of_node, NULL, component, index); in snd_soc_of_get_dai_link_codecs()
3723 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_cpus() local
3726 for_each_link_cpus(dai_link, index, component) in snd_soc_of_put_dai_link_cpus()
3727 __snd_soc_of_put_component(component); in snd_soc_of_put_dai_link_cpus()
3746 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_cpus() local
3756 for_each_link_cpus(dai_link, index, component) { in snd_soc_of_get_dai_link_cpus()
3757 ret = snd_soc_of_get_dlc(of_node, NULL, component, index); in snd_soc_of_get_dai_link_cpus()