Lines Matching +full:fe +full:- +full:dai +full:- +full:link
1 /* SPDX-License-Identifier: GPL-2.0
3 * linux/sound/soc.h -- ALSA SoC Layer
215 .mask = xitems ? roundup_pow_of_two(xitems) - 1 : 0}
417 #include <sound/soc-dapm.h>
418 #include <sound/soc-dpcm.h>
419 #include <sound/soc-topology.h>
493 snd_soc_runtime_action(rtd, stream, -1); in snd_soc_runtime_deactivate()
558 int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
612 SND_SOC_TRIGGER_ORDER_DEFAULT = 0, /* Link->Component->DAI DAI->Component->Link */
613 SND_SOC_TRIGGER_ORDER_LDC, /* Link->DAI->Component Component->DAI->Link */
663 /* config - must be set by machine driver */
668 * You MAY specify the link's CPU-side device, either by device name,
670 * the CPU-side DAI is matched using .cpu_dai_name only, which hence
675 * You MAY specify the DAI name of the CPU DAI. If this information is
676 * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node
677 * only, which only works well when that device exposes a single DAI.
683 * You MUST specify the link's codec, either by device name, or by
686 /* You MUST specify the DAI name within the codec */
692 * You MAY specify the link's platform/PCM/DMA driver, either by
693 * device name, or by DT/OF node, but not both. Some forms of link
699 int id; /* optional ID for machine driver link identification */
711 /* codec/machine specific init - e.g. add machine controls */
714 /* codec/machine specific exit - dual of init() */
717 /* optional hw_params re-writing for BE and FE sync */
737 /* For unidirectional dai links */
741 /* Keep DAI active over suspend */
749 /* Do not create a PCM for this DAI link (Backend link) */
752 /* This DAI link can route to other DAI links at runtime (Frontend)*/
759 /* DPCM used FE & BE merged format */
761 /* DPCM used FE & BE merged channel */
763 /* DPCM used FE & BE merged rate */
769 /* Do not create a PCM for this DAI link (Backend link) */
783 snd_soc_link_to_cpu(struct snd_soc_dai_link *link, int n) { in snd_soc_link_to_cpu() argument
784 return &(link)->cpus[n]; in snd_soc_link_to_cpu()
788 snd_soc_link_to_codec(struct snd_soc_dai_link *link, int n) { in snd_soc_link_to_codec() argument
789 return &(link)->codecs[n]; in snd_soc_link_to_codec()
793 snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) { in snd_soc_link_to_platform() argument
794 return &(link)->platforms[n]; in snd_soc_link_to_platform()
797 #define for_each_link_codecs(link, i, codec) \ argument
799 ((i) < link->num_codecs) && \
800 ((codec) = snd_soc_link_to_codec(link, i)); \
803 #define for_each_link_platforms(link, i, platform) \ argument
805 ((i) < link->num_platforms) && \
806 ((platform) = snd_soc_link_to_platform(link, i)); \
809 #define for_each_link_cpus(link, i, cpu) \ argument
811 ((i) < link->num_cpus) && \
812 ((cpu) = snd_soc_link_to_cpu(link, i)); \
823 * struct snd_soc_dai_link link = {
836 * struct snd_soc_dai_link link = {
852 * struct snd_soc_dai_link link = {
861 * struct snd_soc_dai_link link = {
900 #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }
925 * specify multi-codec either by device name, or by
930 /* codec/machine specific init - e.g. add machine controls */
973 * after the codec and DAI's do any PM work. */
988 struct snd_soc_dai_link *link);
990 struct snd_soc_dai_link *link);
994 /* CPU <--> Codec DAI links */
1006 * optional auxiliary devices such as amplifiers or codecs with DAI
1007 * link unused
1017 * Card-specific routes and widgets.
1018 * Note: of_dapm_xxx for Device Tree; Otherwise for driver build-in.
1064 #define for_each_card_prelinks(card, i, link) \ argument
1066 ((i) < (card)->num_links) && ((link) = &(card)->dai_link[i]); \
1070 ((i) < (card)->num_aux_devs) && ((aux) = &(card)->aux_dev[i]); \
1074 list_for_each_entry(rtd, &(card)->rtd_list, list)
1076 list_for_each_entry_safe(rtd, _rtd, &(card)->rtd_list, list)
1079 list_for_each_entry(component, &card->aux_comp_list, card_aux_list)
1082 &card->aux_comp_list, card_aux_list)
1085 list_for_each_entry(component, &(card)->component_dev_list, card_list)
1088 list_for_each_entry(dapm, &card->dapm_list, list)
1091 list_for_each_entry(w, &card->widgets, list)
1093 list_for_each_entry_safe(w, _w, &card->widgets, list)
1098 return card && card->instantiated; in snd_soc_card_is_instantiated()
1101 /* SoC machine DAI configuration, glues a codec and cpu DAI together */
1108 unsigned int c2c_params_select; /* currently selected c2c_param for dai link */
1135 unsigned int num; /* 0-based and monotonic increasing */
1160 #define snd_soc_rtd_to_cpu(rtd, n) (rtd)->dais[n]
1161 #define snd_soc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus]
1167 ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
1169 #define for_each_rtd_cpu_dais(rtd, i, dai) \ argument
1171 ((i) < rtd->dai_link->num_cpus) && ((dai) = snd_soc_rtd_to_cpu(rtd, i)); \
1173 #define for_each_rtd_codec_dais(rtd, i, dai) \ argument
1175 ((i) < rtd->dai_link->num_codecs) && ((dai) = snd_soc_rtd_to_codec(rtd, i)); \
1177 #define for_each_rtd_dais(rtd, i, dai) \ argument
1179 ((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \
1180 ((dai) = (rtd)->dais[i]); \
1242 if (mc->reg == mc->rreg && mc->shift == mc->rshift) in snd_soc_volsw_is_stereo()
1245 * mc->reg == mc->rreg && mc->shift != mc->rshift, or in snd_soc_volsw_is_stereo()
1246 * mc->reg != mc->rreg means that the control is in snd_soc_volsw_is_stereo()
1257 if (!e->values) in snd_soc_enum_val_to_item()
1260 for (i = 0; i < e->items; i++) in snd_soc_enum_val_to_item()
1261 if (val == e->values[i]) in snd_soc_enum_val_to_item()
1270 if (!e->values) in snd_soc_enum_item_to_val()
1273 return e->values[item]; in snd_soc_enum_item_to_val()
1277 * snd_soc_kcontrol_component() - Returns the component that registered the
1318 snd_soc_of_parse_node_prefix(card->dev->of_node, in snd_soc_of_parse_audio_prefix()
1381 void snd_soc_unregister_dai(struct snd_soc_dai *dai);
1388 #include <sound/soc-dai.h>
1404 if (dai_link->num_platforms != 1) in snd_soc_fixup_dai_links_platform_name()
1405 return -EINVAL; in snd_soc_fixup_dai_links_platform_name()
1407 if (!dai_link->platforms) in snd_soc_fixup_dai_links_platform_name()
1408 return -EINVAL; in snd_soc_fixup_dai_links_platform_name()
1410 name = devm_kstrdup(card->dev, platform_name, GFP_KERNEL); in snd_soc_fixup_dai_links_platform_name()
1412 return -ENOMEM; in snd_soc_fixup_dai_links_platform_name()
1415 dai_link->platforms->name = name; in snd_soc_fixup_dai_links_platform_name()
1437 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_ROOT); in _snd_soc_dapm_mutex_lock_root_c()
1442 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in _snd_soc_dapm_mutex_lock_c()
1447 mutex_unlock(&card->dapm_mutex); in _snd_soc_dapm_mutex_unlock_c()
1452 lockdep_assert_held(&card->dapm_mutex); in _snd_soc_dapm_mutex_assert_held_c()
1457 _snd_soc_dapm_mutex_lock_root_c(dapm->card); in _snd_soc_dapm_mutex_lock_root_d()
1462 _snd_soc_dapm_mutex_lock_c(dapm->card); in _snd_soc_dapm_mutex_lock_d()
1467 _snd_soc_dapm_mutex_unlock_c(dapm->card); in _snd_soc_dapm_mutex_unlock_d()
1472 _snd_soc_dapm_mutex_assert_held_c(dapm->card); in _snd_soc_dapm_mutex_assert_held_d()
1493 mutex_lock_nested(&card->pcm_mutex, card->pcm_subclass); in _snd_soc_dpcm_mutex_lock_c()
1498 mutex_unlock(&card->pcm_mutex); in _snd_soc_dpcm_mutex_unlock_c()
1503 lockdep_assert_held(&card->pcm_mutex); in _snd_soc_dpcm_mutex_assert_held_c()
1508 _snd_soc_dpcm_mutex_lock_c(rtd->card); in _snd_soc_dpcm_mutex_lock_r()
1513 _snd_soc_dpcm_mutex_unlock_c(rtd->card); in _snd_soc_dpcm_mutex_unlock_r()
1518 _snd_soc_dpcm_mutex_assert_held_c(rtd->card); in _snd_soc_dpcm_mutex_assert_held_r()
1533 #include <sound/soc-component.h>
1534 #include <sound/soc-card.h>
1535 #include <sound/soc-jack.h>