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
238 .mask = xitems ? roundup_pow_of_two(xitems) - 1 : 0}
440 #include <sound/soc-dapm.h>
441 #include <sound/soc-dpcm.h>
442 #include <sound/soc-topology.h>
516 snd_soc_runtime_action(rtd, stream, -1); in snd_soc_runtime_deactivate()
581 int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
635 SND_SOC_TRIGGER_ORDER_DEFAULT = 0, /* Link->Component->DAI DAI->Component->Link */
636 SND_SOC_TRIGGER_ORDER_LDC, /* Link->DAI->Component Component->DAI->Link */
682 * [dai_link->ch_maps Image sample]
684 *-------------------------
685 * CPU0 <---> Codec0
687 * ch-map[0].cpu = 0 ch-map[0].codec = 0
689 *-------------------------
690 * CPU0 <---> Codec0
691 * CPU1 <---> Codec1
692 * CPU2 <---> Codec2
694 * ch-map[0].cpu = 0 ch-map[0].codec = 0
695 * ch-map[1].cpu = 1 ch-map[1].codec = 1
696 * ch-map[2].cpu = 2 ch-map[2].codec = 2
698 *-------------------------
699 * CPU0 <---> Codec0
700 * CPU1 <-+-> Codec1
701 * CPU2 <-/
703 * ch-map[0].cpu = 0 ch-map[0].codec = 0
704 * ch-map[1].cpu = 1 ch-map[1].codec = 1
705 * ch-map[2].cpu = 2 ch-map[2].codec = 1
707 *-------------------------
708 * CPU0 <---> Codec0
709 * CPU1 <-+-> Codec1
710 * \-> Codec2
712 * ch-map[0].cpu = 0 ch-map[0].codec = 0
713 * ch-map[1].cpu = 1 ch-map[1].codec = 1
714 * ch-map[2].cpu = 1 ch-map[2].codec = 2
724 /* config - must be set by machine driver */
729 * You MAY specify the link's CPU-side device, either by device name,
731 * the CPU-side DAI is matched using .cpu_dai_name only, which hence
736 * You MAY specify the DAI name of the CPU DAI. If this information is
737 * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node
738 * only, which only works well when that device exposes a single DAI.
744 * You MUST specify the link's codec, either by device name, or by
747 /* You MUST specify the DAI name within the codec */
755 * You MAY specify the link's platform/PCM/DMA driver, either by
756 * device name, or by DT/OF node, but not both. Some forms of link
762 int id; /* optional ID for machine driver link identification */
774 /* codec/machine specific init - e.g. add machine controls */
777 /* codec/machine specific exit - dual of init() */
780 /* optional hw_params re-writing for BE and FE sync */
800 /* For unidirectional dai links */
804 /* Keep DAI active over suspend */
812 /* Do not create a PCM for this DAI link (Backend link) */
815 /* This DAI link can route to other DAI links at runtime (Frontend)*/
823 /* DPCM used FE & BE merged format */
825 /* DPCM used FE & BE merged channel */
827 /* DPCM used FE & BE merged rate */
833 /* Do not create a PCM for this DAI link (Backend link) */
841 static inline int snd_soc_link_num_ch_map(const struct snd_soc_dai_link *link) in snd_soc_link_num_ch_map() argument
843 return max(link->num_cpus, link->num_codecs); in snd_soc_link_num_ch_map()
847 snd_soc_link_to_cpu(struct snd_soc_dai_link *link, int n) { in snd_soc_link_to_cpu() argument
848 return &(link)->cpus[n]; in snd_soc_link_to_cpu()
852 snd_soc_link_to_codec(struct snd_soc_dai_link *link, int n) { in snd_soc_link_to_codec() argument
853 return &(link)->codecs[n]; in snd_soc_link_to_codec()
857 snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) { in snd_soc_link_to_platform() argument
858 return &(link)->platforms[n]; in snd_soc_link_to_platform()
861 #define for_each_link_codecs(link, i, codec) \ argument
863 ((i) < link->num_codecs) && \
864 ((codec) = snd_soc_link_to_codec(link, i)); \
867 #define for_each_link_platforms(link, i, platform) \ argument
869 ((i) < link->num_platforms) && \
870 ((platform) = snd_soc_link_to_platform(link, i)); \
873 #define for_each_link_cpus(link, i, cpu) \ argument
875 ((i) < link->num_cpus) && \
876 ((cpu) = snd_soc_link_to_cpu(link, i)); \
879 #define for_each_link_ch_maps(link, i, ch_map) \ argument
881 ((i) < snd_soc_link_num_ch_map(link) && \
882 ((ch_map) = link->ch_maps + i)); \
893 * struct snd_soc_dai_link link = {
906 * struct snd_soc_dai_link link = {
922 * struct snd_soc_dai_link link = {
931 * struct snd_soc_dai_link link = {
988 * specify multi-codec either by device name, or by
993 /* codec/machine specific init - e.g. add machine controls */
1036 * after the codec and DAI's do any PM work. */
1051 struct snd_soc_dai_link *link);
1053 struct snd_soc_dai_link *link);
1057 /* CPU <--> Codec DAI links */
1069 * optional auxiliary devices such as amplifiers or codecs with DAI
1070 * link unused
1080 * Card-specific routes and widgets.
1081 * Note: of_dapm_xxx for Device Tree; Otherwise for driver build-in.
1127 #define for_each_card_prelinks(card, i, link) \ argument
1129 ((i) < (card)->num_links) && ((link) = &(card)->dai_link[i]); \
1133 ((i) < (card)->num_aux_devs) && ((aux) = &(card)->aux_dev[i]); \
1137 list_for_each_entry(rtd, &(card)->rtd_list, list)
1139 list_for_each_entry_safe(rtd, _rtd, &(card)->rtd_list, list)
1142 list_for_each_entry(component, &card->aux_comp_list, card_aux_list)
1145 &card->aux_comp_list, card_aux_list)
1148 list_for_each_entry(component, &(card)->component_dev_list, card_list)
1151 list_for_each_entry(dapm, &card->dapm_list, list)
1154 list_for_each_entry(w, &card->widgets, list)
1156 list_for_each_entry_safe(w, _w, &card->widgets, list)
1161 return card && card->instantiated; in snd_soc_card_is_instantiated()
1164 /* SoC machine DAI configuration, glues a codec and cpu DAI together */
1171 unsigned int c2c_params_select; /* currently selected c2c_param for dai link */
1198 unsigned int num; /* 0-based and monotonic increasing */
1218 #define snd_soc_rtd_to_cpu(rtd, n) (rtd)->dais[n]
1219 #define snd_soc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus]
1229 ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
1231 #define for_each_rtd_cpu_dais(rtd, i, dai) \ argument
1233 ((i) < rtd->dai_link->num_cpus) && ((dai) = snd_soc_rtd_to_cpu(rtd, i)); \
1235 #define for_each_rtd_codec_dais(rtd, i, dai) \ argument
1237 ((i) < rtd->dai_link->num_codecs) && ((dai) = snd_soc_rtd_to_codec(rtd, i)); \
1239 #define for_each_rtd_dais(rtd, i, dai) \ argument
1241 ((i) < (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs) && \
1242 ((dai) = (rtd)->dais[i]); \
1244 #define for_each_rtd_dais_reverse(rtd, i, dai) \ argument
1245 for ((i) = (rtd)->dai_link->num_cpus + (rtd)->dai_link->num_codecs - 1; \
1246 (i) >= 0 && ((dai) = (rtd)->dais[i]); \
1247 (i)--)
1248 #define for_each_rtd_ch_maps(rtd, i, ch_maps) for_each_link_ch_maps(rtd->dai_link, i, ch_maps)
1306 if (mc->reg == mc->rreg && mc->shift == mc->rshift) in snd_soc_volsw_is_stereo()
1309 * mc->reg == mc->rreg && mc->shift != mc->rshift, or in snd_soc_volsw_is_stereo()
1310 * mc->reg != mc->rreg means that the control is in snd_soc_volsw_is_stereo()
1321 if (!e->values) in snd_soc_enum_val_to_item()
1324 for (i = 0; i < e->items; i++) in snd_soc_enum_val_to_item()
1325 if (val == e->values[i]) in snd_soc_enum_val_to_item()
1334 if (!e->values) in snd_soc_enum_item_to_val()
1337 return e->values[item]; in snd_soc_enum_item_to_val()
1341 * snd_soc_kcontrol_component() - Returns the component that registered the
1382 snd_soc_of_parse_node_prefix(card->dev->of_node, in snd_soc_of_parse_audio_prefix()
1445 void snd_soc_unregister_dai(struct snd_soc_dai *dai);
1452 #include <sound/soc-dai.h>
1468 if (dai_link->num_platforms != 1) in snd_soc_fixup_dai_links_platform_name()
1469 return -EINVAL; in snd_soc_fixup_dai_links_platform_name()
1471 if (!dai_link->platforms) in snd_soc_fixup_dai_links_platform_name()
1472 return -EINVAL; in snd_soc_fixup_dai_links_platform_name()
1474 name = devm_kstrdup(card->dev, platform_name, GFP_KERNEL); in snd_soc_fixup_dai_links_platform_name()
1476 return -ENOMEM; in snd_soc_fixup_dai_links_platform_name()
1479 dai_link->platforms->name = name; in snd_soc_fixup_dai_links_platform_name()
1501 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_ROOT); in _snd_soc_dapm_mutex_lock_root_c()
1506 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in _snd_soc_dapm_mutex_lock_c()
1511 mutex_unlock(&card->dapm_mutex); in _snd_soc_dapm_mutex_unlock_c()
1516 lockdep_assert_held(&card->dapm_mutex); in _snd_soc_dapm_mutex_assert_held_c()
1521 _snd_soc_dapm_mutex_lock_root_c(dapm->card); in _snd_soc_dapm_mutex_lock_root_d()
1526 _snd_soc_dapm_mutex_lock_c(dapm->card); in _snd_soc_dapm_mutex_lock_d()
1531 _snd_soc_dapm_mutex_unlock_c(dapm->card); in _snd_soc_dapm_mutex_unlock_d()
1536 _snd_soc_dapm_mutex_assert_held_c(dapm->card); in _snd_soc_dapm_mutex_assert_held_d()
1557 mutex_lock_nested(&card->pcm_mutex, card->pcm_subclass); in _snd_soc_dpcm_mutex_lock_c()
1562 mutex_unlock(&card->pcm_mutex); in _snd_soc_dpcm_mutex_unlock_c()
1567 lockdep_assert_held(&card->pcm_mutex); in _snd_soc_dpcm_mutex_assert_held_c()
1572 _snd_soc_dpcm_mutex_lock_c(rtd->card); in _snd_soc_dpcm_mutex_lock_r()
1577 _snd_soc_dpcm_mutex_unlock_c(rtd->card); in _snd_soc_dpcm_mutex_unlock_r()
1582 _snd_soc_dpcm_mutex_assert_held_c(rtd->card); in _snd_soc_dpcm_mutex_assert_held_r()
1597 #include <sound/soc-component.h>
1598 #include <sound/soc-card.h>
1599 #include <sound/soc-jack.h>