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()
233 struct snd_soc_component *component) in soc_init_component_debugfs() argument
238 struct snd_soc_component *component) in soc_cleanup_component_debugfs() argument
261 struct snd_soc_component *component) in snd_soc_rtd_add_component() argument
268 if (comp == component) in snd_soc_rtd_add_component()
273 rtd->components[rtd->num_components] = component; in snd_soc_rtd_add_component()
282 struct snd_soc_component *component; in snd_soc_rtdcom_lookup() local
291 * snd_soc_rtdcom_lookup() will find component from rtd by using in snd_soc_rtdcom_lookup()
294 * to 1 rtd, this function will return 1st found component. in snd_soc_rtdcom_lookup()
296 for_each_rtd_components(rtd, i, component) { in snd_soc_rtdcom_lookup()
297 const char *component_name = component->driver->name; in snd_soc_rtdcom_lookup()
304 return component; in snd_soc_rtdcom_lookup()
314 struct snd_soc_component *component; in snd_soc_lookup_component_nolocked() local
318 for_each_component(component) { in snd_soc_lookup_component_nolocked()
319 if ((dev == component->dev) && in snd_soc_lookup_component_nolocked()
321 (driver_name == component->driver->name) || in snd_soc_lookup_component_nolocked()
322 (strcmp(component->driver->name, driver_name) == 0))) { in snd_soc_lookup_component_nolocked()
323 found_component = component; in snd_soc_lookup_component_nolocked()
335 struct snd_soc_component *component; in snd_soc_lookup_component() local
338 component = snd_soc_lookup_component_nolocked(dev, driver_name); in snd_soc_lookup_component()
341 return component; in snd_soc_lookup_component()
441 struct snd_soc_component *component; in soc_new_pcm_runtime() local
469 sizeof(*component) * (dai_link->num_cpus + in soc_new_pcm_runtime()
571 struct snd_soc_component *component; in snd_soc_suspend() local
616 for_each_rtd_components(rtd, i, component) { in snd_soc_suspend()
618 snd_soc_component_get_dapm(component); in snd_soc_suspend()
621 * ignore if component was already suspended in snd_soc_suspend()
623 if (snd_soc_component_is_suspended(component)) in snd_soc_suspend()
627 * If there are paths active then the COMPONENT will be in snd_soc_suspend()
633 * If the COMPONENT is capable of idle in snd_soc_suspend()
639 dev_dbg(component->dev, in snd_soc_suspend()
646 snd_soc_component_suspend(component); in snd_soc_suspend()
647 if (component->regmap) in snd_soc_suspend()
648 regcache_mark_dirty(component->regmap); in snd_soc_suspend()
650 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_suspend()
653 dev_dbg(component->dev, in snd_soc_suspend()
654 "ASoC: COMPONENT is on over suspend\n"); in snd_soc_suspend()
675 struct snd_soc_component *component; in soc_resume_deferred() local
689 for_each_card_components(card, component) { in soc_resume_deferred()
690 if (snd_soc_component_is_suspended(component)) in soc_resume_deferred()
691 snd_soc_component_resume(component); in soc_resume_deferred()
715 struct snd_soc_component *component; in snd_soc_resume() local
722 for_each_card_components(card, component) in snd_soc_resume()
723 if (snd_soc_component_active(component)) in snd_soc_resume()
724 pinctrl_pm_select_default_state(component->dev); in snd_soc_resume()
748 *soc_component_to_node(struct snd_soc_component *component) in soc_component_to_node() argument
752 of_node = component->dev->of_node; in soc_component_to_node()
753 if (!of_node && component->dev->parent) in soc_component_to_node()
754 of_node = component->dev->parent->of_node; in soc_component_to_node()
761 struct snd_soc_component *component) in snd_soc_is_matching_component() argument
768 component_of_node = soc_component_to_node(component); in snd_soc_is_matching_component()
772 if (dlc->name && strcmp(component->name, dlc->name)) in snd_soc_is_matching_component()
781 struct snd_soc_component *component; in soc_find_component() local
788 * It returns *1st* found component, but some driver in soc_find_component()
791 * CPU component and generic DMAEngine component in soc_find_component()
793 for_each_component(component) in soc_find_component()
794 if (snd_soc_is_matching_component(dlc, component)) in soc_find_component()
795 return component; in soc_find_component()
803 * @dlc: name of the DAI or the DAI driver and optional component info to match
806 * find the DAI of the same name. The component's of_node and name
814 struct snd_soc_component *component; in snd_soc_find_dai() local
820 for_each_component(component) { in snd_soc_find_dai()
821 if (!snd_soc_is_matching_component(dlc, component)) in snd_soc_find_dai()
823 for_each_component_dais(component, dai) { in snd_soc_find_dai()
875 * Defer card registration if codec component is not added to in soc_dai_link_sanity_check()
876 * component list. in soc_dai_link_sanity_check()
880 "ASoC: codec component %s not found for link %s\n", in soc_dai_link_sanity_check()
900 * Defer card registration if platform component is not added to in soc_dai_link_sanity_check()
901 * component list. in soc_dai_link_sanity_check()
905 "ASoC: platform component %s not found for link %s\n", in soc_dai_link_sanity_check()
925 * Defer card registration if cpu dai component is not added to in soc_dai_link_sanity_check()
926 * component list. in soc_dai_link_sanity_check()
931 "ASoC: cpu component %s not found for link %s\n", in soc_dai_link_sanity_check()
984 * topology component. And machine drivers can still define static
992 struct snd_soc_component *component; in snd_soc_add_pcm_runtime() local
1024 snd_soc_rtd_add_component(rtd, asoc_rtd_to_cpu(rtd, i)->component); in snd_soc_add_pcm_runtime()
1036 snd_soc_rtd_add_component(rtd, asoc_rtd_to_codec(rtd, i)->component); in snd_soc_add_pcm_runtime()
1041 for_each_component(component) { in snd_soc_add_pcm_runtime()
1042 if (!snd_soc_is_matching_component(platform, component)) in snd_soc_add_pcm_runtime()
1045 snd_soc_rtd_add_component(rtd, component); in snd_soc_add_pcm_runtime()
1250 * the component which has non_legacy_dai_naming is Codec in snd_soc_runtime_set_dai_fmt()
1257 if (cpu_dai->component->driver->non_legacy_dai_naming) in snd_soc_runtime_set_dai_fmt()
1274 struct snd_soc_component *component; in soc_init_pcm_runtime() local
1302 for_each_rtd_components(rtd, i, component) { in soc_init_pcm_runtime()
1303 if (!component->driver->use_dai_pcm_id) in soc_init_pcm_runtime()
1307 num += component->driver->be_pcm_base; in soc_init_pcm_runtime()
1329 struct snd_soc_component *component) in soc_set_name_prefix() argument
1331 struct device_node *of_node = soc_component_to_node(component); in soc_set_name_prefix()
1338 if (snd_soc_is_matching_component(&map->dlc, component) && in soc_set_name_prefix()
1340 component->name_prefix = map->name_prefix; in soc_set_name_prefix()
1353 component->name_prefix = str; in soc_set_name_prefix()
1356 static void soc_remove_component(struct snd_soc_component *component, in soc_remove_component() argument
1360 if (!component->card) in soc_remove_component()
1364 snd_soc_component_remove(component); in soc_remove_component()
1367 snd_soc_component_set_jack(component, NULL, NULL); in soc_remove_component()
1369 list_del_init(&component->card_list); in soc_remove_component()
1370 snd_soc_dapm_free(snd_soc_component_get_dapm(component)); in soc_remove_component()
1371 soc_cleanup_component_debugfs(component); in soc_remove_component()
1372 component->card = NULL; in soc_remove_component()
1373 snd_soc_component_module_put_when_remove(component); in soc_remove_component()
1377 struct snd_soc_component *component) in soc_probe_component() argument
1380 snd_soc_component_get_dapm(component); in soc_probe_component()
1385 if (snd_soc_component_is_dummy(component)) in soc_probe_component()
1388 if (component->card) { in soc_probe_component()
1389 if (component->card != card) { in soc_probe_component()
1390 dev_err(component->dev, in soc_probe_component()
1391 "Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n", in soc_probe_component()
1392 card->name, component->card->name); in soc_probe_component()
1398 ret = snd_soc_component_module_get_when_probe(component); in soc_probe_component()
1402 component->card = card; in soc_probe_component()
1403 soc_set_name_prefix(card, component); in soc_probe_component()
1405 soc_init_component_debugfs(component); in soc_probe_component()
1407 snd_soc_dapm_init(dapm, card, component); in soc_probe_component()
1410 component->driver->dapm_widgets, in soc_probe_component()
1411 component->driver->num_dapm_widgets); in soc_probe_component()
1414 dev_err(component->dev, in soc_probe_component()
1419 for_each_component_dais(component, dai) { in soc_probe_component()
1422 dev_err(component->dev, in soc_probe_component()
1428 ret = snd_soc_component_probe(component); in soc_probe_component()
1435 component->name); in soc_probe_component()
1443 ret = snd_soc_component_init(component); in soc_probe_component()
1447 ret = snd_soc_add_component_controls(component, in soc_probe_component()
1448 component->driver->controls, in soc_probe_component()
1449 component->driver->num_controls); in soc_probe_component()
1454 component->driver->dapm_routes, in soc_probe_component()
1455 component->driver->num_dapm_routes); in soc_probe_component()
1470 list_add(&component->card_list, &card->component_dev_list); in soc_probe_component()
1474 soc_remove_component(component, probed); in soc_probe_component()
1516 struct snd_soc_component *component; in soc_remove_link_components() local
1522 for_each_rtd_components(rtd, i, component) { in soc_remove_link_components()
1523 if (component->driver->remove_order != order) in soc_remove_link_components()
1526 soc_remove_component(component, 1); in soc_remove_link_components()
1534 struct snd_soc_component *component; in soc_probe_link_components() local
1540 for_each_rtd_components(rtd, i, component) { in soc_probe_link_components()
1541 if (component->driver->probe_order != order) in soc_probe_link_components()
1544 ret = soc_probe_component(card, component); in soc_probe_link_components()
1556 struct snd_soc_component *component, *_component; in soc_unbind_aux_dev() local
1558 for_each_card_auxs_safe(card, component, _component) { in soc_unbind_aux_dev()
1560 snd_soc_component_set_aux(component, NULL); in soc_unbind_aux_dev()
1561 list_del(&component->card_aux_list); in soc_unbind_aux_dev()
1567 struct snd_soc_component *component; in soc_bind_aux_dev() local
1573 component = soc_find_component(&aux->dlc); in soc_bind_aux_dev()
1574 if (!component) in soc_bind_aux_dev()
1578 snd_soc_component_set_aux(component, aux); in soc_bind_aux_dev()
1580 list_add(&component->card_aux_list, &card->aux_comp_list); in soc_bind_aux_dev()
1587 struct snd_soc_component *component; in soc_probe_aux_devices() local
1592 for_each_card_auxs(card, component) { in soc_probe_aux_devices()
1593 if (component->driver->probe_order != order) in soc_probe_aux_devices()
1596 ret = soc_probe_component(card, component); in soc_probe_aux_devices()
1777 struct snd_soc_component *component; in soc_check_tplg_fes() local
1782 for_each_component(component) { in soc_check_tplg_fes()
1784 /* does this component override BEs ? */ in soc_check_tplg_fes()
1785 if (!component->driver->ignore_machine) in soc_check_tplg_fes()
1789 if (!strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1792 if (strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1808 /* override platform component */ in soc_check_tplg_fes()
1814 if (component->dev->of_node) in soc_check_tplg_fes()
1815 dai_link->platforms->of_node = component->dev->of_node; in soc_check_tplg_fes()
1817 dai_link->platforms->name = component->name; in soc_check_tplg_fes()
1846 component->driver->be_hw_params_fixup; in soc_check_tplg_fes()
1857 if (component->driver->topology_name_prefix) { in soc_check_tplg_fes()
1861 comp_drv = component->driver; in soc_check_tplg_fes()
1961 struct snd_soc_component *component; in snd_soc_bind_card() local
2027 "ASoC: failed to probe aux component %d\n", ret); in snd_soc_bind_card()
2114 for_each_card_components(card, component) in snd_soc_bind_card()
2115 if (!snd_soc_component_active(component)) in snd_soc_bind_card()
2116 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_bind_card()
2153 struct snd_soc_component *component; in snd_soc_poweroff() local
2167 for_each_card_components(card, component) in snd_soc_poweroff()
2168 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_poweroff()
2257 * snd_soc_add_component_controls - Add an array of controls to a component.
2259 * @component: Component to add controls to
2265 int snd_soc_add_component_controls(struct snd_soc_component *component, in snd_soc_add_component_controls() argument
2268 struct snd_card *card = component->card->snd_card; in snd_soc_add_component_controls()
2270 return snd_soc_add_controls(card, component->dev, controls, in snd_soc_add_component_controls()
2271 num_controls, component->name_prefix, component); in snd_soc_add_component_controls()
2308 struct snd_card *card = dai->component->card->snd_card; in snd_soc_add_dai_controls()
2393 /* I2C component devices are named "bus-addr" */ in fmt_single_name()
2401 /* sanitize component name for DAI link creation */ in fmt_single_name()
2437 * @component: The component the DAIs are registered for
2442 * Topology can use this API to register DAIs when probing a component.
2444 * will be freed in the component cleanup.
2446 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, in snd_soc_register_dai() argument
2450 struct device *dev = component->dev; in snd_soc_register_dai()
2462 * Back in the old days when we still had component-less DAIs, in snd_soc_register_dai()
2463 * instead of having a static name, component-less DAIs would in snd_soc_register_dai()
2467 * component-less anymore. in snd_soc_register_dai()
2477 dai->id = component->num_dai; in snd_soc_register_dai()
2482 dai->component = component; in snd_soc_register_dai()
2487 list_add_tail(&dai->list, &component->dai_list); in snd_soc_register_dai()
2488 component->num_dai++; in snd_soc_register_dai()
2497 * @component: The component for which the DAIs should be unregistered
2499 static void snd_soc_unregister_dais(struct snd_soc_component *component) in snd_soc_unregister_dais() argument
2503 for_each_component_dais_safe(component, dai, _dai) in snd_soc_unregister_dais()
2510 * @component: The component the DAIs are registered for
2514 static int snd_soc_register_dais(struct snd_soc_component *component, in snd_soc_register_dais() argument
2523 dai = snd_soc_register_dai(component, dai_drv + i, count == 1 && in snd_soc_register_dais()
2524 !component->driver->non_legacy_dai_naming); in snd_soc_register_dais()
2534 snd_soc_unregister_dais(component); in snd_soc_register_dais()
2583 static void snd_soc_del_component_unlocked(struct snd_soc_component *component) in snd_soc_del_component_unlocked() argument
2585 struct snd_soc_card *card = component->card; in snd_soc_del_component_unlocked()
2587 snd_soc_unregister_dais(component); in snd_soc_del_component_unlocked()
2592 list_del(&component->list); in snd_soc_del_component_unlocked()
2595 int snd_soc_component_initialize(struct snd_soc_component *component, in snd_soc_component_initialize() argument
2599 INIT_LIST_HEAD(&component->dai_list); in snd_soc_component_initialize()
2600 INIT_LIST_HEAD(&component->dobj_list); in snd_soc_component_initialize()
2601 INIT_LIST_HEAD(&component->card_list); in snd_soc_component_initialize()
2602 INIT_LIST_HEAD(&component->list); in snd_soc_component_initialize()
2603 mutex_init(&component->io_mutex); in snd_soc_component_initialize()
2605 component->name = fmt_single_name(dev, &component->id); in snd_soc_component_initialize()
2606 if (!component->name) { in snd_soc_component_initialize()
2611 component->dev = dev; in snd_soc_component_initialize()
2612 component->driver = driver; in snd_soc_component_initialize()
2618 int snd_soc_add_component(struct snd_soc_component *component, in snd_soc_add_component() argument
2627 if (component->driver->endianness) { in snd_soc_add_component()
2634 ret = snd_soc_register_dais(component, dai_drv, num_dai); in snd_soc_add_component()
2636 dev_err(component->dev, "ASoC: Failed to register DAIs: %d\n", in snd_soc_add_component()
2641 if (!component->driver->write && !component->driver->read) { in snd_soc_add_component()
2642 if (!component->regmap) in snd_soc_add_component()
2643 component->regmap = dev_get_regmap(component->dev, in snd_soc_add_component()
2645 if (component->regmap) in snd_soc_add_component()
2646 snd_soc_component_setup_regmap(component); in snd_soc_add_component()
2650 list_add(&component->list, &component_list); in snd_soc_add_component()
2654 snd_soc_del_component_unlocked(component); in snd_soc_add_component()
2670 struct snd_soc_component *component; in snd_soc_register_component() local
2673 component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); in snd_soc_register_component()
2674 if (!component) in snd_soc_register_component()
2677 ret = snd_soc_component_initialize(component, component_driver, dev); in snd_soc_register_component()
2681 return snd_soc_add_component(component, dai_drv, num_dai); in snd_soc_register_component()
2686 * snd_soc_unregister_component_by_driver - Unregister component using a given driver
2690 * @component_driver: The component driver to unregister
2695 struct snd_soc_component *component; in snd_soc_unregister_component_by_driver() local
2701 component = snd_soc_lookup_component_nolocked(dev, component_driver->name); in snd_soc_unregister_component_by_driver()
2702 if (!component) in snd_soc_unregister_component_by_driver()
2705 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component_by_driver()
2713 * snd_soc_unregister_component - Unregister all related component
2722 struct snd_soc_component *component = snd_soc_lookup_component_nolocked(dev, NULL); in snd_soc_unregister_component() local
2724 if (!component) in snd_soc_unregister_component()
2727 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component()
3176 struct snd_soc_component *component; in snd_soc_get_dai_id() local
3190 component = soc_find_component(&dlc); in snd_soc_get_dai_id()
3191 if (component) in snd_soc_get_dai_id()
3192 ret = snd_soc_component_of_xlate_dai_id(component, ep); in snd_soc_get_dai_id()
3251 * check if another component is provided with the same in snd_soc_get_dai_name()
3292 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_codecs() local
3295 for_each_link_codecs(dai_link, index, component) { in snd_soc_of_put_dai_link_codecs()
3296 if (!component->of_node) in snd_soc_of_put_dai_link_codecs()
3298 of_node_put(component->of_node); in snd_soc_of_put_dai_link_codecs()
3299 component->of_node = NULL; in snd_soc_of_put_dai_link_codecs()
3323 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_codecs() local
3338 component = devm_kcalloc(dev, in snd_soc_of_get_dai_link_codecs()
3339 num_codecs, sizeof(*component), in snd_soc_of_get_dai_link_codecs()
3341 if (!component) in snd_soc_of_get_dai_link_codecs()
3343 dai_link->codecs = component; in snd_soc_of_get_dai_link_codecs()
3347 for_each_link_codecs(dai_link, index, component) { in snd_soc_of_get_dai_link_codecs()
3353 component->of_node = args.np; in snd_soc_of_get_dai_link_codecs()
3354 ret = snd_soc_get_dai_name(&args, &component->dai_name); in snd_soc_of_get_dai_link_codecs()