Lines Matching refs: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()
329 rtd->components[rtd->num_components] = component; in snd_soc_rtd_add_component()
338 struct snd_soc_component *component; in snd_soc_rtdcom_lookup() local
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()
497 struct snd_soc_component *component; in soc_new_pcm_runtime() local
525 sizeof(component) * (dai_link->num_cpus + in soc_new_pcm_runtime()
626 struct snd_soc_component *component; in snd_soc_suspend() local
671 for_each_rtd_components(rtd, i, component) { in snd_soc_suspend()
673 snd_soc_component_get_dapm(component); in snd_soc_suspend()
678 if (snd_soc_component_is_suspended(component)) in snd_soc_suspend()
694 dev_dbg(component->dev, in snd_soc_suspend()
701 snd_soc_component_suspend(component); in snd_soc_suspend()
702 if (component->regmap) in snd_soc_suspend()
703 regcache_mark_dirty(component->regmap); in snd_soc_suspend()
705 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_suspend()
708 dev_dbg(component->dev, in snd_soc_suspend()
730 struct snd_soc_component *component; in soc_resume_deferred() local
744 for_each_card_components(card, component) { in soc_resume_deferred()
745 if (snd_soc_component_is_suspended(component)) in soc_resume_deferred()
746 snd_soc_component_resume(component); in soc_resume_deferred()
770 struct snd_soc_component *component; in snd_soc_resume() local
777 for_each_card_components(card, component) in snd_soc_resume()
778 if (snd_soc_component_active(component)) in snd_soc_resume()
779 pinctrl_pm_select_default_state(component->dev); in snd_soc_resume()
801 *soc_component_to_node(struct snd_soc_component *component) in soc_component_to_node() argument
805 of_node = component->dev->of_node; in soc_component_to_node()
806 if (!of_node && component->dev->parent) in soc_component_to_node()
807 of_node = component->dev->parent->of_node; in soc_component_to_node()
827 struct snd_soc_component *component) in snd_soc_is_matching_component() argument
837 for_each_component_dais(component, dai) in snd_soc_is_matching_component()
843 component_of_node = soc_component_to_node(component); in snd_soc_is_matching_component()
847 if (dlc->name && strcmp(component->name, dlc->name)) in snd_soc_is_matching_component()
856 struct snd_soc_component *component; in soc_find_component() local
868 for_each_component(component) in soc_find_component()
869 if (snd_soc_is_matching_component(dlc, component)) in soc_find_component()
870 return component; in soc_find_component()
889 struct snd_soc_component *component; in snd_soc_find_dai() local
895 for_each_component(component) in snd_soc_find_dai()
896 if (snd_soc_is_matching_component(dlc, component)) in snd_soc_find_dai()
897 for_each_component_dais(component, dai) in snd_soc_find_dai()
1055 struct snd_soc_component *component; in snd_soc_add_pcm_runtime() local
1087 snd_soc_rtd_add_component(rtd, asoc_rtd_to_cpu(rtd, i)->component); in snd_soc_add_pcm_runtime()
1099 snd_soc_rtd_add_component(rtd, asoc_rtd_to_codec(rtd, i)->component); in snd_soc_add_pcm_runtime()
1104 for_each_component(component) { in snd_soc_add_pcm_runtime()
1105 if (!snd_soc_is_matching_component(platform, component)) in snd_soc_add_pcm_runtime()
1108 if (snd_soc_component_is_dummy(component) && component->num_dai) in snd_soc_add_pcm_runtime()
1111 snd_soc_rtd_add_component(rtd, component); in snd_soc_add_pcm_runtime()
1342 struct snd_soc_component *component; in soc_init_pcm_runtime() local
1365 for_each_rtd_components(rtd, i, component) { in soc_init_pcm_runtime()
1366 if (!component->driver->use_dai_pcm_id) in soc_init_pcm_runtime()
1370 num += component->driver->be_pcm_base; in soc_init_pcm_runtime()
1401 struct snd_soc_component *component) in soc_set_name_prefix() argument
1403 struct device_node *of_node = soc_component_to_node(component); in soc_set_name_prefix()
1410 if (snd_soc_is_matching_component(&map->dlc, component) && in soc_set_name_prefix()
1412 component->name_prefix = map->name_prefix; in soc_set_name_prefix()
1425 component->name_prefix = str; in soc_set_name_prefix()
1428 static void soc_remove_component(struct snd_soc_component *component, in soc_remove_component() argument
1432 if (!component->card) in soc_remove_component()
1436 snd_soc_component_remove(component); in soc_remove_component()
1438 list_del_init(&component->card_list); in soc_remove_component()
1439 snd_soc_dapm_free(snd_soc_component_get_dapm(component)); in soc_remove_component()
1440 soc_cleanup_component_debugfs(component); in soc_remove_component()
1441 component->card = NULL; in soc_remove_component()
1442 snd_soc_component_module_put_when_remove(component); in soc_remove_component()
1446 struct snd_soc_component *component) in soc_probe_component() argument
1449 snd_soc_component_get_dapm(component); in soc_probe_component()
1454 if (snd_soc_component_is_dummy(component)) in soc_probe_component()
1457 if (component->card) { in soc_probe_component()
1458 if (component->card != card) { in soc_probe_component()
1459 dev_err(component->dev, in soc_probe_component()
1461 component->name, card->name, component->card->name); in soc_probe_component()
1467 ret = snd_soc_component_module_get_when_probe(component); in soc_probe_component()
1471 component->card = card; in soc_probe_component()
1472 soc_set_name_prefix(card, component); in soc_probe_component()
1474 soc_init_component_debugfs(component); in soc_probe_component()
1476 snd_soc_dapm_init(dapm, card, component); in soc_probe_component()
1479 component->driver->dapm_widgets, in soc_probe_component()
1480 component->driver->num_dapm_widgets); in soc_probe_component()
1483 dev_err(component->dev, in soc_probe_component()
1488 for_each_component_dais(component, dai) { in soc_probe_component()
1491 dev_err(component->dev, in soc_probe_component()
1497 ret = snd_soc_component_probe(component); in soc_probe_component()
1504 component->name); in soc_probe_component()
1512 ret = snd_soc_component_init(component); in soc_probe_component()
1516 ret = snd_soc_add_component_controls(component, in soc_probe_component()
1517 component->driver->controls, in soc_probe_component()
1518 component->driver->num_controls); in soc_probe_component()
1523 component->driver->dapm_routes, in soc_probe_component()
1524 component->driver->num_dapm_routes); in soc_probe_component()
1539 list_add(&component->card_list, &card->component_dev_list); in soc_probe_component()
1543 soc_remove_component(component, probed); in soc_probe_component()
1580 struct snd_soc_component *component; in soc_remove_link_components() local
1586 for_each_rtd_components(rtd, i, component) { in soc_remove_link_components()
1587 if (component->driver->remove_order != order) in soc_remove_link_components()
1590 soc_remove_component(component, 1); in soc_remove_link_components()
1598 struct snd_soc_component *component; in soc_probe_link_components() local
1604 for_each_rtd_components(rtd, i, component) { in soc_probe_link_components()
1605 if (component->driver->probe_order != order) in soc_probe_link_components()
1608 ret = soc_probe_component(card, component); in soc_probe_link_components()
1620 struct snd_soc_component *component, *_component; in soc_unbind_aux_dev() local
1622 for_each_card_auxs_safe(card, component, _component) { in soc_unbind_aux_dev()
1624 snd_soc_component_set_aux(component, NULL); in soc_unbind_aux_dev()
1625 list_del(&component->card_aux_list); in soc_unbind_aux_dev()
1631 struct snd_soc_component *component; in soc_bind_aux_dev() local
1637 component = soc_find_component(&aux->dlc); in soc_bind_aux_dev()
1638 if (!component) in soc_bind_aux_dev()
1642 snd_soc_component_set_aux(component, aux); in soc_bind_aux_dev()
1644 list_add(&component->card_aux_list, &card->aux_comp_list); in soc_bind_aux_dev()
1651 struct snd_soc_component *component; in soc_probe_aux_devices() local
1656 for_each_card_auxs(card, component) { in soc_probe_aux_devices()
1657 if (component->driver->probe_order != order) in soc_probe_aux_devices()
1660 ret = soc_probe_component(card, component); in soc_probe_aux_devices()
1841 struct snd_soc_component *component; in soc_check_tplg_fes() local
1846 for_each_component(component) { in soc_check_tplg_fes()
1849 if (!component->driver->ignore_machine) in soc_check_tplg_fes()
1853 if (!strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1856 if (strcmp(component->driver->ignore_machine, in soc_check_tplg_fes()
1878 if (component->dev->of_node) in soc_check_tplg_fes()
1879 dai_link->platforms->of_node = component->dev->of_node; in soc_check_tplg_fes()
1881 dai_link->platforms->name = component->name; in soc_check_tplg_fes()
1910 component->driver->be_hw_params_fixup; in soc_check_tplg_fes()
1921 if (component->driver->topology_name_prefix) { in soc_check_tplg_fes()
1925 comp_drv = component->driver; in soc_check_tplg_fes()
2038 struct snd_soc_component *component; in snd_soc_bind_card() local
2191 for_each_card_components(card, component) in snd_soc_bind_card()
2192 if (!snd_soc_component_active(component)) in snd_soc_bind_card()
2193 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_bind_card()
2230 struct snd_soc_component *component; in snd_soc_poweroff() local
2244 for_each_card_components(card, component) in snd_soc_poweroff()
2245 pinctrl_pm_select_sleep_state(component->dev); in snd_soc_poweroff()
2342 int snd_soc_add_component_controls(struct snd_soc_component *component, in snd_soc_add_component_controls() argument
2345 struct snd_card *card = component->card->snd_card; in snd_soc_add_component_controls()
2347 return snd_soc_add_controls(card, component->dev, controls, in snd_soc_add_component_controls()
2348 num_controls, component->name_prefix, component); in snd_soc_add_component_controls()
2385 struct snd_card *card = dai->component->card->snd_card; in snd_soc_add_dai_controls()
2520 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, in snd_soc_register_dai() argument
2524 struct device *dev = component->dev; in snd_soc_register_dai()
2549 dai->id = component->num_dai; in snd_soc_register_dai()
2554 dai->component = component; in snd_soc_register_dai()
2559 list_add_tail(&dai->list, &component->dai_list); in snd_soc_register_dai()
2560 component->num_dai++; in snd_soc_register_dai()
2572 static void snd_soc_unregister_dais(struct snd_soc_component *component) in snd_soc_unregister_dais() argument
2576 for_each_component_dais_safe(component, dai, _dai) in snd_soc_unregister_dais()
2587 static int snd_soc_register_dais(struct snd_soc_component *component, in snd_soc_register_dais() argument
2596 dai = snd_soc_register_dai(component, dai_drv + i, count == 1 && in snd_soc_register_dais()
2597 component->driver->legacy_dai_naming); in snd_soc_register_dais()
2607 snd_soc_unregister_dais(component); in snd_soc_register_dais()
2656 static void snd_soc_del_component_unlocked(struct snd_soc_component *component) in snd_soc_del_component_unlocked() argument
2658 struct snd_soc_card *card = component->card; in snd_soc_del_component_unlocked()
2660 snd_soc_unregister_dais(component); in snd_soc_del_component_unlocked()
2665 list_del(&component->list); in snd_soc_del_component_unlocked()
2668 int snd_soc_component_initialize(struct snd_soc_component *component, in snd_soc_component_initialize() argument
2672 INIT_LIST_HEAD(&component->dai_list); in snd_soc_component_initialize()
2673 INIT_LIST_HEAD(&component->dobj_list); in snd_soc_component_initialize()
2674 INIT_LIST_HEAD(&component->card_list); in snd_soc_component_initialize()
2675 INIT_LIST_HEAD(&component->list); in snd_soc_component_initialize()
2676 mutex_init(&component->io_mutex); in snd_soc_component_initialize()
2678 component->name = fmt_single_name(dev, &component->id); in snd_soc_component_initialize()
2679 if (!component->name) { in snd_soc_component_initialize()
2684 component->dev = dev; in snd_soc_component_initialize()
2685 component->driver = driver; in snd_soc_component_initialize()
2688 if (!component->debugfs_prefix) in snd_soc_component_initialize()
2689 component->debugfs_prefix = driver->debugfs_prefix; in snd_soc_component_initialize()
2696 int snd_soc_add_component(struct snd_soc_component *component, in snd_soc_add_component() argument
2705 if (component->driver->endianness) { in snd_soc_add_component()
2712 ret = snd_soc_register_dais(component, dai_drv, num_dai); in snd_soc_add_component()
2714 dev_err(component->dev, "ASoC: Failed to register DAIs: %d\n", in snd_soc_add_component()
2719 if (!component->driver->write && !component->driver->read) { in snd_soc_add_component()
2720 if (!component->regmap) in snd_soc_add_component()
2721 component->regmap = dev_get_regmap(component->dev, in snd_soc_add_component()
2723 if (component->regmap) in snd_soc_add_component()
2724 snd_soc_component_setup_regmap(component); in snd_soc_add_component()
2728 list_add(&component->list, &component_list); in snd_soc_add_component()
2732 snd_soc_del_component_unlocked(component); in snd_soc_add_component()
2748 struct snd_soc_component *component; in snd_soc_register_component() local
2751 component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); in snd_soc_register_component()
2752 if (!component) in snd_soc_register_component()
2755 ret = snd_soc_component_initialize(component, component_driver, dev); in snd_soc_register_component()
2759 return snd_soc_add_component(component, dai_drv, num_dai); in snd_soc_register_component()
2773 struct snd_soc_component *component; in snd_soc_unregister_component_by_driver() local
2779 component = snd_soc_lookup_component_nolocked(dev, component_driver->name); in snd_soc_unregister_component_by_driver()
2780 if (!component) in snd_soc_unregister_component_by_driver()
2783 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component_by_driver()
2800 struct snd_soc_component *component = snd_soc_lookup_component_nolocked(dev, NULL); in snd_soc_unregister_component() local
2802 if (!component) in snd_soc_unregister_component()
2805 snd_soc_del_component_unlocked(component); in snd_soc_unregister_component()
3346 struct snd_soc_component *component; in snd_soc_get_dai_id() local
3361 component = soc_find_component(&dlc); in snd_soc_get_dai_id()
3362 if (component) in snd_soc_get_dai_id()
3363 ret = snd_soc_component_of_xlate_dai_id(component, ep); in snd_soc_get_dai_id()
3486 struct snd_soc_component *component; in snd_soc_get_dai_via_args() local
3489 for_each_component(component) { in snd_soc_get_dai_via_args()
3490 for_each_component_dais(component, dai) in snd_soc_get_dai_via_args()
3501 static void __snd_soc_of_put_component(struct snd_soc_dai_link_component *component) in __snd_soc_of_put_component() argument
3503 if (component->of_node) { in __snd_soc_of_put_component()
3504 of_node_put(component->of_node); in __snd_soc_of_put_component()
3505 component->of_node = NULL; in __snd_soc_of_put_component()
3514 struct snd_soc_dai_link_component *component; in __snd_soc_of_get_dai_link_component_alloc() local
3526 component = devm_kcalloc(dev, num, sizeof(*component), GFP_KERNEL); in __snd_soc_of_get_dai_link_component_alloc()
3527 if (!component) in __snd_soc_of_get_dai_link_component_alloc()
3530 *ret_component = component; in __snd_soc_of_get_dai_link_component_alloc()
3544 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_codecs() local
3547 for_each_link_codecs(dai_link, index, component) in snd_soc_of_put_dai_link_codecs()
3548 __snd_soc_of_put_component(component); in snd_soc_of_put_dai_link_codecs()
3570 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_codecs() local
3579 for_each_link_codecs(dai_link, index, component) { in snd_soc_of_get_dai_link_codecs()
3580 ret = snd_soc_of_get_dlc(of_node, NULL, component, index); in snd_soc_of_get_dai_link_codecs()
3601 struct snd_soc_dai_link_component *component; in snd_soc_of_put_dai_link_cpus() local
3604 for_each_link_cpus(dai_link, index, component) in snd_soc_of_put_dai_link_cpus()
3605 __snd_soc_of_put_component(component); in snd_soc_of_put_dai_link_cpus()
3624 struct snd_soc_dai_link_component *component; in snd_soc_of_get_dai_link_cpus() local
3634 for_each_link_cpus(dai_link, index, component) { in snd_soc_of_get_dai_link_cpus()
3635 ret = snd_soc_of_get_dlc(of_node, NULL, component, index); in snd_soc_of_get_dai_link_cpus()