Lines Matching full:component
52 #define for_each_component(component) \ argument
53 list_for_each_entry(component, &component_list, list)
134 static void soc_init_component_debugfs(struct snd_soc_component *component) in soc_init_component_debugfs() argument
136 if (!component->card->debugfs_card_root) in soc_init_component_debugfs()
139 if (component->debugfs_prefix) { in soc_init_component_debugfs()
143 component->debugfs_prefix, component->name); in soc_init_component_debugfs()
145 component->debugfs_root = debugfs_create_dir(name, in soc_init_component_debugfs()
146 component->card->debugfs_card_root); in soc_init_component_debugfs()
150 component->debugfs_root = debugfs_create_dir(component->name, in soc_init_component_debugfs()
151 component->card->debugfs_card_root); in soc_init_component_debugfs()
154 snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component), in soc_init_component_debugfs()
155 component->debugfs_root); in soc_init_component_debugfs()
158 static void soc_cleanup_component_debugfs(struct snd_soc_component *component) in soc_cleanup_component_debugfs() argument
160 if (!component->debugfs_root) in soc_cleanup_component_debugfs()
162 debugfs_remove_recursive(component->debugfs_root); in soc_cleanup_component_debugfs()
163 component->debugfs_root = NULL; in soc_cleanup_component_debugfs()
168 struct snd_soc_component *component; in dai_list_show() local
173 for_each_component(component) in dai_list_show()
174 for_each_component_dais(component, dai) in dai_list_show()
185 struct snd_soc_component *component; in component_list_show() local
189 for_each_component(component) in component_list_show()
190 seq_printf(m, "%s\n", component->name); in component_list_show()
233 static inline void soc_init_component_debugfs(struct snd_soc_component *component) { } in soc_init_component_debugfs() argument
234 static inline void soc_cleanup_component_debugfs(struct snd_soc_component *component) { } in soc_cleanup_component_debugfs() argument
294 if (dai->component->name && in snd_soc_is_matching_dai()
295 strcmp(dlc->dai_name, dai->component->name) == 0) in snd_soc_is_matching_dai()
310 if (dai->component->name) in snd_soc_dai_name_get()
311 return dai->component->name; in snd_soc_dai_name_get()
318 struct snd_soc_component *component) in snd_soc_rtd_add_component() argument
325 if (comp == component) in snd_soc_rtd_add_component()
331 rtd->components[rtd->num_components - 1] = component; in snd_soc_rtd_add_component()
339 struct snd_soc_component *component; in snd_soc_rtdcom_lookup() local
348 * snd_soc_rtdcom_lookup() will find component from rtd by using in snd_soc_rtdcom_lookup()
351 * to 1 rtd, this function will return 1st found component. in snd_soc_rtdcom_lookup()
353 for_each_rtd_components(rtd, i, component) { in snd_soc_rtdcom_lookup()
354 const char *component_name = component->driver->name; in snd_soc_rtdcom_lookup()
361 return component; in snd_soc_rtdcom_lookup()
371 struct snd_soc_component *component; in snd_soc_lookup_component_nolocked() local
373 for_each_component(component) { in snd_soc_lookup_component_nolocked()
374 if (dev != component->dev) in snd_soc_lookup_component_nolocked()
378 return component; in snd_soc_lookup_component_nolocked()
380 if (!component->driver->name) in snd_soc_lookup_component_nolocked()
383 if (component->driver->name == driver_name) in snd_soc_lookup_component_nolocked()
384 return component; in snd_soc_lookup_component_nolocked()
386 if (strcmp(component->driver->name, driver_name) == 0) in snd_soc_lookup_component_nolocked()
387 return component; in snd_soc_lookup_component_nolocked()
397 struct snd_soc_component *component; in snd_soc_lookup_component() local
400 component = snd_soc_lookup_component_nolocked(dev, driver_name); in snd_soc_lookup_component()
403 return component; in snd_soc_lookup_component()
653 struct snd_soc_component *component; in snd_soc_suspend() local
698 for_each_rtd_components(rtd, i, component) { in snd_soc_suspend()
700 snd_soc_component_get_dapm(component); in snd_soc_suspend()
703 * ignore if component was already suspended in snd_soc_suspend()
705 if (snd_soc_component_is_suspended(component)) in snd_soc_suspend()
709 * If there are paths active then the COMPONENT will be in snd_soc_suspend()
715 * If the COMPONENT is capable of idle in snd_soc_suspend()
721 dev_dbg(component->dev, in snd_soc_suspend()
728 snd_soc_component_suspend(component); in snd_soc_suspend()
729 if (component->regmap) in snd_soc_suspend()
730 regcache_mark_dirty(component->regmap); in snd_soc_suspend()
732 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_suspend()
735 dev_dbg(component->dev, in snd_soc_suspend()
736 "ASoC: COMPONENT is on over suspend\n"); in snd_soc_suspend()
757 struct snd_soc_component *component; in soc_resume_deferred() local
771 for_each_card_components(card, component) { in soc_resume_deferred()
772 if (snd_soc_component_is_suspended(component)) in soc_resume_deferred()
773 snd_soc_component_resume(component); in soc_resume_deferred()
797 struct snd_soc_component *component; in snd_soc_resume() local
804 for_each_card_components(card, component) in snd_soc_resume()
805 if (snd_soc_component_active(component)) in snd_soc_resume()
806 pinctrl_pm_select_default_state(component->dev); in snd_soc_resume()
828 *soc_component_to_node(struct snd_soc_component *component) in soc_component_to_node() argument
832 of_node = component->dev->of_node; in soc_component_to_node()
833 if (!of_node && component->dev->parent) in soc_component_to_node()
834 of_node = component->dev->parent->of_node; in soc_component_to_node()
855 struct snd_soc_component *component) in snd_soc_is_matching_component() argument
865 for_each_component_dais(component, dai) in snd_soc_is_matching_component()
871 component_of_node = soc_component_to_node(component); in snd_soc_is_matching_component()
875 if (dlc->name && strcmp(component->name, dlc->name)) in snd_soc_is_matching_component()
884 struct snd_soc_component *component; in soc_find_component() local
891 * It returns *1st* found component, but some driver in soc_find_component()
894 * CPU component and generic DMAEngine component in soc_find_component()
896 for_each_component(component) in soc_find_component()
897 if (snd_soc_is_matching_component(dlc, component)) in soc_find_component()
898 return component; in soc_find_component()
906 * @dlc: name of the DAI or the DAI driver and optional component info to match
909 * find the DAI of the same name. The component's of_node and name
917 struct snd_soc_component *component; in snd_soc_find_dai() local
923 for_each_component(component) in snd_soc_find_dai()
924 if (snd_soc_is_matching_component(dlc, component)) in snd_soc_find_dai()
925 for_each_component_dais(component, dai) in snd_soc_find_dai()
969 * Defer card registration if codec component is not added to in soc_dai_link_sanity_check()
970 * component list. in soc_dai_link_sanity_check()
990 * Defer card registration if platform component is not added to in soc_dai_link_sanity_check()
991 * component list. in soc_dai_link_sanity_check()
1016 * Defer card registration if Component is not added in soc_dai_link_sanity_check()
1026 dev_err(card->dev, "ASoC: Both Component name/of_node are set for %s\n", link->name); in soc_dai_link_sanity_check()
1030 dev_err(card->dev, "ASoC: Neither Component name/of_node are set for %s\n", link->name); in soc_dai_link_sanity_check()
1034 dev_dbg(card->dev, "ASoC: Component %s not found for link %s\n", dlc->name, link->name); in soc_dai_link_sanity_check()
1042 dev_err(card->dev, "ASoC: Neither DAI/Component name/of_node are set for %s\n", link->name); in soc_dai_link_sanity_check()
1169 * topology component. And machine drivers can still define static
1177 struct snd_soc_component *component; in snd_soc_add_pcm_runtime() local
1209 snd_soc_rtd_add_component(rtd, snd_soc_rtd_to_cpu(rtd, i)->component); in snd_soc_add_pcm_runtime()
1221 snd_soc_rtd_add_component(rtd, snd_soc_rtd_to_codec(rtd, i)->component); in snd_soc_add_pcm_runtime()
1226 for_each_component(component) { in snd_soc_add_pcm_runtime()
1227 if (!snd_soc_is_matching_component(platform, component)) in snd_soc_add_pcm_runtime()
1230 if (snd_soc_component_is_dummy(component) && component->num_dai) in snd_soc_add_pcm_runtime()
1233 snd_soc_rtd_add_component(rtd, component); in snd_soc_add_pcm_runtime()
1245 * "component" feature. in snd_soc_add_pcm_runtime()
1248 for_each_rtd_components(rtd, i, component) { in snd_soc_add_pcm_runtime()
1249 if (!component->driver->use_dai_pcm_id) in snd_soc_add_pcm_runtime()
1253 id += component->driver->be_pcm_base; in snd_soc_add_pcm_runtime()
1555 struct snd_soc_component *component) in soc_set_name_prefix() argument
1557 struct device_node *of_node = soc_component_to_node(component); in soc_set_name_prefix()
1564 if (snd_soc_is_matching_component(&map->dlc, component) && in soc_set_name_prefix()
1566 component->name_prefix = map->name_prefix; in soc_set_name_prefix()
1579 component->name_prefix = str; in soc_set_name_prefix()
1582 static void soc_remove_component(struct snd_soc_component *component, in soc_remove_component() argument
1586 if (!component->card) in soc_remove_component()
1590 snd_soc_component_remove(component); in soc_remove_component()
1592 list_del_init(&component->card_list); in soc_remove_component()
1593 snd_soc_dapm_free(snd_soc_component_get_dapm(component)); in soc_remove_component()
1594 soc_cleanup_component_debugfs(component); in soc_remove_component()
1595 component->card = NULL; in soc_remove_component()
1596 snd_soc_component_module_put_when_remove(component); in soc_remove_component()
1600 struct snd_soc_component *component) in soc_probe_component() argument
1603 snd_soc_component_get_dapm(component); in soc_probe_component()
1608 if (snd_soc_component_is_dummy(component)) in soc_probe_component()
1611 if (component->card) { in soc_probe_component()
1612 if (component->card != card) { in soc_probe_component()
1613 dev_err(component->dev, in soc_probe_component()
1614 "Trying to bind component \"%s\" to card \"%s\" but is already bound to card \"%s\"\n", in soc_probe_component()
1615 component->name, card->name, component->card->name); in soc_probe_component()
1621 ret = snd_soc_component_module_get_when_probe(component); in soc_probe_component()
1625 component->card = card; in soc_probe_component()
1626 soc_set_name_prefix(card, component); in soc_probe_component()
1628 soc_init_component_debugfs(component); in soc_probe_component()
1630 snd_soc_dapm_init(dapm, card, component); in soc_probe_component()
1633 component->driver->dapm_widgets, in soc_probe_component()
1634 component->driver->num_dapm_widgets); in soc_probe_component()
1637 dev_err(component->dev, in soc_probe_component()
1642 for_each_component_dais(component, dai) { in soc_probe_component()
1645 dev_err(component->dev, in soc_probe_component()
1651 ret = snd_soc_component_probe(component); in soc_probe_component()
1658 component->name); in soc_probe_component()
1666 ret = snd_soc_component_init(component); in soc_probe_component()
1670 ret = snd_soc_add_component_controls(component, in soc_probe_component()
1671 component->driver->controls, in soc_probe_component()
1672 component->driver->num_controls); in soc_probe_component()
1677 component->driver->dapm_routes, in soc_probe_component()
1678 component->driver->num_dapm_routes); in soc_probe_component()
1683 list_add(&component->card_list, &card->component_dev_list); in soc_probe_component()
1687 soc_remove_component(component, probed); in soc_probe_component()
1724 struct snd_soc_component *component; in soc_remove_link_components() local
1730 for_each_rtd_components(rtd, i, component) { in soc_remove_link_components()
1731 if (component->driver->remove_order != order) in soc_remove_link_components()
1734 soc_remove_component(component, 1); in soc_remove_link_components()
1742 struct snd_soc_component *component; in soc_probe_link_components() local
1748 for_each_rtd_components(rtd, i, component) { in soc_probe_link_components()
1749 if (component->driver->probe_order != order) in soc_probe_link_components()
1752 ret = soc_probe_component(card, component); in soc_probe_link_components()
1764 struct snd_soc_component *component, *_component; in soc_unbind_aux_dev() local
1766 for_each_card_auxs_safe(card, component, _component) { in soc_unbind_aux_dev()
1768 snd_soc_component_set_aux(component, NULL); in soc_unbind_aux_dev()
1769 list_del(&component->card_aux_list); in soc_unbind_aux_dev()
1775 struct snd_soc_component *component; in soc_bind_aux_dev() local
1781 component = soc_find_component(&aux->dlc); in soc_bind_aux_dev()
1782 if (!component) in soc_bind_aux_dev()
1786 snd_soc_component_set_aux(component, aux); in soc_bind_aux_dev()
1788 list_add(&component->card_aux_list, &card->aux_comp_list); in soc_bind_aux_dev()
1795 struct snd_soc_component *component; in soc_probe_aux_devices() local
1800 for_each_card_auxs(card, component) { in soc_probe_aux_devices()
1801 if (component->driver->probe_order != order) in soc_probe_aux_devices()
1804 ret = soc_probe_component(card, component); in soc_probe_aux_devices()
1984 struct snd_soc_component *component; in soc_check_tplg_fes() local
1989 for_each_component(component) { in soc_check_tplg_fes()
1991 /* does this component override BEs ? */ in soc_check_tplg_fes()
1992 if (!component->driver->ignore_machine) in soc_check_tplg_fes()
1996 if (!strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1999 if (strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
2015 /* override platform component */ in soc_check_tplg_fes()
2021 if (component->dev->of_node) in soc_check_tplg_fes()
2022 dai_link->platforms->of_node = component->dev->of_node; in soc_check_tplg_fes()
2024 dai_link->platforms->name = component->name; in soc_check_tplg_fes()
2035 component->driver->be_hw_params_fixup; in soc_check_tplg_fes()
2046 if (component->driver->topology_name_prefix) { in soc_check_tplg_fes()
2050 comp_drv = component->driver; in soc_check_tplg_fes()
2158 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()
2301 for_each_card_components(card, component) in snd_soc_bind_card()
2302 if (!snd_soc_component_active(component)) in snd_soc_bind_card()
2303 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_bind_card()
2380 struct snd_soc_component *component; in snd_soc_poweroff() local
2394 for_each_card_components(card, component) in snd_soc_poweroff()
2395 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_poweroff()
2484 * snd_soc_add_component_controls - Add an array of controls to a component.
2486 * @component: Component to add controls to
2492 int snd_soc_add_component_controls(struct snd_soc_component *component, in snd_soc_add_component_controls() argument
2495 struct snd_card *card = component->card->snd_card; in snd_soc_add_component_controls()
2497 return snd_soc_add_controls(card, component->dev, controls, in snd_soc_add_component_controls()
2498 num_controls, component->name_prefix, component); in snd_soc_add_component_controls()
2535 struct snd_card *card = dai->component->card->snd_card; in snd_soc_add_dai_controls()
2635 /* I2C component devices are named "bus-addr" */ in fmt_single_name()
2643 /* sanitize component name for DAI link creation */ in fmt_single_name()
2682 * @component: The component the DAIs are registered for
2687 * Topology can use this API to register DAIs when probing a component.
2689 * will be freed in the component cleanup.
2691 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, in snd_soc_register_dai() argument
2695 struct device *dev = component->dev; in snd_soc_register_dai()
2705 * Back in the old days when we still had component-less DAIs, in snd_soc_register_dai()
2706 * instead of having a static name, component-less DAIs would in snd_soc_register_dai()
2710 * component-less anymore. in snd_soc_register_dai()
2720 dai->id = component->num_dai; in snd_soc_register_dai()
2725 dai->component = component; in snd_soc_register_dai()
2730 list_add_tail(&dai->list, &component->dai_list); in snd_soc_register_dai()
2731 component->num_dai++; in snd_soc_register_dai()
2741 * @component: The component for which the DAIs should be unregistered
2743 static void snd_soc_unregister_dais(struct snd_soc_component *component) in snd_soc_unregister_dais() argument
2747 for_each_component_dais_safe(component, dai, _dai) in snd_soc_unregister_dais()
2754 * @component: The component the DAIs are registered for
2758 static int snd_soc_register_dais(struct snd_soc_component *component, in snd_soc_register_dais() argument
2767 dai = snd_soc_register_dai(component, dai_drv + i, count == 1 && in snd_soc_register_dais()
2768 component->driver->legacy_dai_naming); in snd_soc_register_dais()
2778 snd_soc_unregister_dais(component); in snd_soc_register_dais()
2818 static void snd_soc_del_component_unlocked(struct snd_soc_component *component) in snd_soc_del_component_unlocked() argument
2820 struct snd_soc_card *card = component->card; in snd_soc_del_component_unlocked()
2823 snd_soc_unregister_dais(component); in snd_soc_del_component_unlocked()
2832 list_del(&component->list); in snd_soc_del_component_unlocked()
2835 int snd_soc_component_initialize(struct snd_soc_component *component, in snd_soc_component_initialize() argument
2839 INIT_LIST_HEAD(&component->dai_list); in snd_soc_component_initialize()
2840 INIT_LIST_HEAD(&component->dobj_list); in snd_soc_component_initialize()
2841 INIT_LIST_HEAD(&component->card_list); in snd_soc_component_initialize()
2842 INIT_LIST_HEAD(&component->list); in snd_soc_component_initialize()
2843 mutex_init(&component->io_mutex); in snd_soc_component_initialize()
2845 if (!component->name) { in snd_soc_component_initialize()
2846 component->name = fmt_single_name(dev, NULL); in snd_soc_component_initialize()
2847 if (!component->name) { in snd_soc_component_initialize()
2853 component->dev = dev; in snd_soc_component_initialize()
2854 component->driver = driver; in snd_soc_component_initialize()
2857 if (!component->debugfs_prefix) in snd_soc_component_initialize()
2858 component->debugfs_prefix = driver->debugfs_prefix; in snd_soc_component_initialize()
2865 int snd_soc_add_component(struct snd_soc_component *component, in snd_soc_add_component() argument
2875 if (component->driver->endianness) { in snd_soc_add_component()
2882 ret = snd_soc_register_dais(component, dai_drv, num_dai); in snd_soc_add_component()
2884 dev_err(component->dev, "ASoC: Failed to register DAIs: %d\n", in snd_soc_add_component()
2889 if (!component->driver->write && !component->driver->read) { in snd_soc_add_component()
2890 if (!component->regmap) in snd_soc_add_component()
2891 component->regmap = dev_get_regmap(component->dev, in snd_soc_add_component()
2893 if (component->regmap) in snd_soc_add_component()
2894 snd_soc_component_setup_regmap(component); in snd_soc_add_component()
2898 list_add(&component->list, &component_list); in snd_soc_add_component()
2905 snd_soc_del_component_unlocked(component); in snd_soc_add_component()
2917 struct snd_soc_component *component; in snd_soc_register_component() local
2920 component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); in snd_soc_register_component()
2921 if (!component) in snd_soc_register_component()
2924 ret = snd_soc_component_initialize(component, component_driver, dev); in snd_soc_register_component()
2928 return snd_soc_add_component(component, dai_drv, num_dai); in snd_soc_register_component()
2933 * snd_soc_unregister_component_by_driver - Unregister component using a given driver
2937 * @component_driver: The component driver to unregister
2949 struct snd_soc_component *component = snd_soc_lookup_component_nolocked(dev, driver_name); in snd_soc_unregister_component_by_driver() local
2951 if (!component) in snd_soc_unregister_component_by_driver()
2954 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component_by_driver()
3492 struct snd_soc_component *component; in snd_soc_get_dai_id() local
3507 component = soc_find_component(&dlc); in snd_soc_get_dai_id()
3508 if (component) in snd_soc_get_dai_id()
3509 ret = snd_soc_component_of_xlate_dai_id(component, ep); in snd_soc_get_dai_id()
3565 * check if another component is provided with the same in snd_soc_get_dlc()
3632 struct snd_soc_component *component; in snd_soc_get_dai_via_args() local
3635 for_each_component(component) { in snd_soc_get_dai_via_args()
3636 for_each_component_dais(component, dai) in snd_soc_get_dai_via_args()
3647 static void __snd_soc_of_put_component(struct snd_soc_dai_link_component *component) in __snd_soc_of_put_component() argument
3649 if (component->of_node) { in __snd_soc_of_put_component()
3650 of_node_put(component->of_node); in __snd_soc_of_put_component()
3651 component->of_node = NULL; in __snd_soc_of_put_component()
3660 struct snd_soc_dai_link_component *component; in __snd_soc_of_get_dai_link_component_alloc() local
3672 component = devm_kcalloc(dev, num, sizeof(*component), GFP_KERNEL); in __snd_soc_of_get_dai_link_component_alloc()
3673 if (!component) in __snd_soc_of_get_dai_link_component_alloc()
3676 *ret_component = component; in __snd_soc_of_get_dai_link_component_alloc()
3690 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_codecs() local
3693 for_each_link_codecs(dai_link, index, component) in snd_soc_of_put_dai_link_codecs()
3694 __snd_soc_of_put_component(component); in snd_soc_of_put_dai_link_codecs()
3716 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_codecs() local
3725 for_each_link_codecs(dai_link, index, component) { in snd_soc_of_get_dai_link_codecs()
3726 ret = snd_soc_of_get_dlc(of_node, NULL, component, index); in snd_soc_of_get_dai_link_codecs()
3747 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_cpus() local
3750 for_each_link_cpus(dai_link, index, component) in snd_soc_of_put_dai_link_cpus()
3751 __snd_soc_of_put_component(component); in snd_soc_of_put_dai_link_cpus()
3770 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_cpus() local
3780 for_each_link_cpus(dai_link, index, component) { in snd_soc_of_get_dai_link_cpus()
3781 ret = snd_soc_of_get_dlc(of_node, NULL, component, index); in snd_soc_of_get_dai_link_cpus()