Lines Matching refs:component
52 #define for_each_component(component) \
53 list_for_each_entry(component, &component_list, list)
134 static void soc_init_component_debugfs(struct snd_soc_component *component)
136 if (!component->card->debugfs_card_root)
139 if (component->debugfs_prefix) {
143 component->debugfs_prefix, component->name);
145 component->debugfs_root = debugfs_create_dir(name,
146 component->card->debugfs_card_root);
150 component->debugfs_root = debugfs_create_dir(component->name,
151 component->card->debugfs_card_root);
154 snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component),
155 component->debugfs_root);
158 static void soc_cleanup_component_debugfs(struct snd_soc_component *component)
160 if (!component->debugfs_root)
162 debugfs_remove_recursive(component->debugfs_root);
163 component->debugfs_root = NULL;
168 struct snd_soc_component *component;
173 for_each_component(component)
174 for_each_component_dais(component, dai)
185 struct snd_soc_component *component;
189 for_each_component(component)
190 seq_printf(m, "%s\n", component->name);
234 struct snd_soc_component *component)
239 struct snd_soc_component *component)
262 struct snd_soc_component *component)
269 if (comp == component)
274 rtd->components[rtd->num_components] = component;
283 struct snd_soc_component *component;
292 * snd_soc_rtdcom_lookup() will find component from rtd by using
295 * to 1 rtd, this function will return 1st found component.
297 for_each_rtd_components(rtd, i, component) {
298 const char *component_name = component->driver->name;
305 return component;
315 struct snd_soc_component *component;
319 for_each_component(component) {
320 if ((dev == component->dev) &&
322 (driver_name == component->driver->name) ||
323 (strcmp(component->driver->name, driver_name) == 0))) {
324 found_component = component;
336 struct snd_soc_component *component;
339 component = snd_soc_lookup_component_nolocked(dev, driver_name);
342 return component;
434 struct snd_soc_component *component;
462 sizeof(*component) * (dai_link->num_cpus +
528 struct snd_soc_component *component;
593 for_each_rtd_components(rtd, i, component) {
595 snd_soc_component_get_dapm(component);
598 * ignore if component was already suspended
600 if (snd_soc_component_is_suspended(component))
616 dev_dbg(component->dev,
623 snd_soc_component_suspend(component);
624 if (component->regmap)
625 regcache_mark_dirty(component->regmap);
627 pinctrl_pm_select_sleep_state(component->dev);
630 dev_dbg(component->dev,
653 struct snd_soc_component *component;
668 for_each_card_components(card, component) {
669 if (snd_soc_component_is_suspended(component))
670 snd_soc_component_resume(component);
714 struct snd_soc_component *component;
721 for_each_card_components(card, component)
722 if (snd_soc_component_active(component))
723 pinctrl_pm_select_default_state(component->dev);
747 *soc_component_to_node(struct snd_soc_component *component)
751 of_node = component->dev->of_node;
752 if (!of_node && component->dev->parent)
753 of_node = component->dev->parent->of_node;
760 struct snd_soc_component *component)
767 component_of_node = soc_component_to_node(component);
771 if (dlc->name && strcmp(component->name, dlc->name))
780 struct snd_soc_component *component;
787 * It returns *1st* found component, but some driver
790 * CPU component and generic DMAEngine component
792 for_each_component(component)
793 if (snd_soc_is_matching_component(dlc, component))
794 return component;
802 * @dlc: name of the DAI or the DAI driver and optional component info to match
805 * find the DAI of the same name. The component's of_node and name
813 struct snd_soc_component *component;
819 for_each_component(component) {
820 if (!snd_soc_is_matching_component(dlc, component))
822 for_each_component_dais(component, dai) {
874 * Defer card registration if codec component is not added to
875 * component list.
879 "ASoC: codec component %s not found for link %s\n",
899 * Defer card registration if platform component is not added to
900 * component list.
904 "ASoC: platform component %s not found for link %s\n",
924 * Defer card registration if cpu dai component is not added to
925 * component list.
930 "ASoC: cpu component %s not found for link %s\n",
983 * topology component. And machine drivers can still define static
991 struct snd_soc_component *component;
1023 snd_soc_rtd_add_component(rtd, asoc_rtd_to_cpu(rtd, i)->component);
1035 snd_soc_rtd_add_component(rtd, asoc_rtd_to_codec(rtd, i)->component);
1040 for_each_component(component) {
1041 if (!snd_soc_is_matching_component(platform, component))
1044 snd_soc_rtd_add_component(rtd, component);
1061 struct snd_soc_component *component;
1088 for_each_rtd_components(rtd, i, component) {
1089 if (!component->driver->use_dai_pcm_id)
1093 num += component->driver->be_pcm_base;
1119 struct snd_soc_component *component)
1121 struct device_node *of_node = soc_component_to_node(component);
1128 if (snd_soc_is_matching_component(&map->dlc, component)) {
1129 component->name_prefix = map->name_prefix;
1142 component->name_prefix = str;
1145 static void soc_remove_component(struct snd_soc_component *component,
1149 if (!component->card)
1153 snd_soc_component_remove(component);
1156 snd_soc_component_set_jack(component, NULL, NULL);
1158 list_del_init(&component->card_list);
1159 snd_soc_dapm_free(snd_soc_component_get_dapm(component));
1160 soc_cleanup_component_debugfs(component);
1161 component->card = NULL;
1162 snd_soc_component_module_put_when_remove(component);
1166 struct snd_soc_component *component)
1169 snd_soc_component_get_dapm(component);
1174 if (!strcmp(component->name, "snd-soc-dummy"))
1177 if (component->card) {
1178 if (component->card != card) {
1179 dev_err(component->dev,
1180 "Trying to bind component to card \"%s\" but is already bound to card \"%s\"\n",
1181 card->name, component->card->name);
1187 ret = snd_soc_component_module_get_when_probe(component);
1191 component->card = card;
1192 soc_set_name_prefix(card, component);
1194 soc_init_component_debugfs(component);
1196 snd_soc_dapm_init(dapm, card, component);
1199 component->driver->dapm_widgets,
1200 component->driver->num_dapm_widgets);
1203 dev_err(component->dev,
1208 for_each_component_dais(component, dai) {
1211 dev_err(component->dev,
1217 ret = snd_soc_component_probe(component);
1219 dev_err(component->dev,
1220 "ASoC: failed to probe component %d\n", ret);
1226 component->name);
1234 ret = snd_soc_component_init(component);
1238 ret = snd_soc_add_component_controls(component,
1239 component->driver->controls,
1240 component->driver->num_controls);
1245 component->driver->dapm_routes,
1246 component->driver->num_dapm_routes);
1261 list_add(&component->card_list, &card->component_dev_list);
1265 soc_remove_component(component, probed);
1307 struct snd_soc_component *component;
1313 for_each_rtd_components(rtd, i, component) {
1314 if (component->driver->remove_order != order)
1317 soc_remove_component(component, 1);
1325 struct snd_soc_component *component;
1331 for_each_rtd_components(rtd, i, component) {
1332 if (component->driver->probe_order != order)
1335 ret = soc_probe_component(card, component);
1347 struct snd_soc_component *component, *_component;
1349 for_each_card_auxs_safe(card, component, _component) {
1351 snd_soc_component_set_aux(component, NULL);
1352 list_del(&component->card_aux_list);
1358 struct snd_soc_component *component;
1364 component = soc_find_component(&aux->dlc);
1365 if (!component)
1369 snd_soc_component_set_aux(component, aux);
1371 list_add(&component->card_aux_list, &card->aux_comp_list);
1378 struct snd_soc_component *component;
1383 for_each_card_auxs(card, component) {
1384 if (component->driver->probe_order != order)
1387 ret = soc_probe_component(card, component);
1442 * the component which has non_legacy_dai_naming is Codec
1462 if (cpu_dai->component->driver->non_legacy_dai_naming)
1635 struct snd_soc_component *component;
1640 for_each_component(component) {
1642 /* does this component override BEs ? */
1643 if (!component->driver->ignore_machine)
1647 if (!strcmp(component->driver->ignore_machine,
1650 if (strcmp(component->driver->ignore_machine,
1666 /* override platform component */
1671 dai_link->platforms->name = component->name;
1700 component->driver->be_hw_params_fixup;
1711 if (component->driver->topology_name_prefix) {
1715 comp_drv = component->driver;
1815 struct snd_soc_component *component;
1881 "ASoC: failed to probe aux component %d\n", ret);
1968 for_each_card_components(card, component)
1969 if (!snd_soc_component_active(component))
1970 pinctrl_pm_select_sleep_state(component->dev);
2007 struct snd_soc_component *component;
2021 for_each_card_components(card, component)
2022 pinctrl_pm_select_sleep_state(component->dev);
2112 * snd_soc_add_component_controls - Add an array of controls to a component.
2114 * @component: Component to add controls to
2120 int snd_soc_add_component_controls(struct snd_soc_component *component,
2123 struct snd_card *card = component->card->snd_card;
2125 return snd_soc_add_controls(card, component->dev, controls,
2126 num_controls, component->name_prefix, component);
2163 struct snd_card *card = dai->component->card->snd_card;
2248 /* I2C component devices are named "bus-addr" */
2256 /* sanitize component name for DAI link creation */
2292 * @component: The component the DAIs are registered for
2297 * Topology can use this API to register DAIs when probing a component.
2299 * will be freed in the component cleanup.
2301 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
2305 struct device *dev = component->dev;
2317 * Back in the old days when we still had component-less DAIs,
2318 * instead of having a static name, component-less DAIs would
2322 * component-less anymore.
2332 dai->id = component->num_dai;
2337 dai->component = component;
2342 list_add_tail(&dai->list, &component->dai_list);
2343 component->num_dai++;
2352 * @component: The component for which the DAIs should be unregistered
2354 static void snd_soc_unregister_dais(struct snd_soc_component *component)
2358 for_each_component_dais_safe(component, dai, _dai)
2365 * @component: The component the DAIs are registered for
2369 static int snd_soc_register_dais(struct snd_soc_component *component,
2378 dai = snd_soc_register_dai(component, dai_drv + i, count == 1 &&
2379 !component->driver->non_legacy_dai_naming);
2389 snd_soc_unregister_dais(component);
2438 static void snd_soc_del_component_unlocked(struct snd_soc_component *component)
2440 struct snd_soc_card *card = component->card;
2442 snd_soc_unregister_dais(component);
2447 list_del(&component->list);
2450 int snd_soc_component_initialize(struct snd_soc_component *component,
2454 INIT_LIST_HEAD(&component->dai_list);
2455 INIT_LIST_HEAD(&component->dobj_list);
2456 INIT_LIST_HEAD(&component->card_list);
2457 INIT_LIST_HEAD(&component->list);
2458 mutex_init(&component->io_mutex);
2460 component->name = fmt_single_name(dev, &component->id);
2461 if (!component->name) {
2466 component->dev = dev;
2467 component->driver = driver;
2473 int snd_soc_add_component(struct snd_soc_component *component,
2482 if (component->driver->endianness) {
2489 ret = snd_soc_register_dais(component, dai_drv, num_dai);
2491 dev_err(component->dev, "ASoC: Failed to register DAIs: %d\n",
2496 if (!component->driver->write && !component->driver->read) {
2497 if (!component->regmap)
2498 component->regmap = dev_get_regmap(component->dev,
2500 if (component->regmap)
2501 snd_soc_component_setup_regmap(component);
2505 list_add(&component->list, &component_list);
2509 snd_soc_del_component_unlocked(component);
2525 struct snd_soc_component *component;
2528 component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL);
2529 if (!component)
2532 ret = snd_soc_component_initialize(component, component_driver, dev);
2536 return snd_soc_add_component(component, dai_drv, num_dai);
2541 * snd_soc_unregister_component_by_driver - Unregister component using a given driver
2545 * @component_driver: The component driver to unregister
2550 struct snd_soc_component *component;
2556 component = snd_soc_lookup_component_nolocked(dev, component_driver->name);
2557 if (!component)
2560 snd_soc_del_component_unlocked(component);
2568 * snd_soc_unregister_component - Unregister all related component
2575 struct snd_soc_component *component;
2579 component = snd_soc_lookup_component_nolocked(dev, NULL);
2580 if (!component)
2583 snd_soc_del_component_unlocked(component);
2987 struct snd_soc_component *component;
3001 component = soc_find_component(&dlc);
3002 if (component)
3003 ret = snd_soc_component_of_xlate_dai_id(component, ep);
3063 * check if another component is provided with the same
3104 struct snd_soc_dai_link_component *component;
3107 for_each_link_codecs(dai_link, index, component) {
3108 if (!component->of_node)
3110 of_node_put(component->of_node);
3111 component->of_node = NULL;
3135 struct snd_soc_dai_link_component *component;
3150 component = devm_kcalloc(dev,
3151 num_codecs, sizeof(*component),
3153 if (!component)
3155 dai_link->codecs = component;
3159 for_each_link_codecs(dai_link, index, component) {
3165 component->of_node = args.np;
3166 ret = snd_soc_get_dai_name(&args, &component->dai_name);