soc.h (409e1a31404082ecb85b54bba920a3dd8077c672) soc.h (22a2fc81658b3eebcfcc110de97bcbd32f5ee301)
1/* SPDX-License-Identifier: GPL-2.0
2 *
3 * linux/sound/soc.h -- ALSA SoC Layer
4 *
5 * Author: Liam Girdwood
6 * Created: Aug 11th 2005
7 * Copyright: Wolfson Microelectronics. PLC.
8 */

--- 457 unchanged lines hidden (view full) ---

466
467struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
468 struct snd_soc_dai_link *dai_link);
469
470bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd);
471void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream);
472void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);
473
1/* SPDX-License-Identifier: GPL-2.0
2 *
3 * linux/sound/soc.h -- ALSA SoC Layer
4 *
5 * Author: Liam Girdwood
6 * Created: Aug 11th 2005
7 * Copyright: Wolfson Microelectronics. PLC.
8 */

--- 457 unchanged lines hidden (view full) ---

466
467struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
468 struct snd_soc_dai_link *dai_link);
469
470bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd);
471void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream);
472void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);
473
474int snd_soc_runtime_calc_hw(struct snd_soc_pcm_runtime *rtd,
475 struct snd_pcm_hardware *hw, int stream);
476
474int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
475 unsigned int dai_fmt);
476
477#ifdef CONFIG_DMI
478int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour);
479#else
480static inline int snd_soc_set_dmi_name(struct snd_soc_card *card,
481 const char *flavour)

--- 368 unchanged lines hidden (view full) ---

850 (i)++)
851
852#define for_each_link_platforms(link, i, platform) \
853 for ((i) = 0; \
854 ((i) < link->num_platforms) && \
855 ((platform) = &link->platforms[i]); \
856 (i)++)
857
477int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,
478 unsigned int dai_fmt);
479
480#ifdef CONFIG_DMI
481int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour);
482#else
483static inline int snd_soc_set_dmi_name(struct snd_soc_card *card,
484 const char *flavour)

--- 368 unchanged lines hidden (view full) ---

853 (i)++)
854
855#define for_each_link_platforms(link, i, platform) \
856 for ((i) = 0; \
857 ((i) < link->num_platforms) && \
858 ((platform) = &link->platforms[i]); \
859 (i)++)
860
861#define for_each_link_cpus(link, i, cpu) \
862 for ((i) = 0; \
863 ((i) < link->num_cpus) && ((cpu) = &link->cpus[i]); \
864 (i)++)
865
858/*
859 * Sample 1 : Single CPU/Codec/Platform
860 *
861 * SND_SOC_DAILINK_DEFS(test,
862 * DAILINK_COMP_ARRAY(COMP_CPU("cpu_dai")),
863 * DAILINK_COMP_ARRAY(COMP_CODEC("codec", "codec_dai")),
864 * DAILINK_COMP_ARRAY(COMP_PLATFORM("platform")));
865 *

--- 187 unchanged lines hidden (view full) ---

1053 int num_dapm_widgets;
1054 const struct snd_soc_dapm_route *dapm_routes;
1055 int num_dapm_routes;
1056 const struct snd_soc_dapm_widget *of_dapm_widgets;
1057 int num_of_dapm_widgets;
1058 const struct snd_soc_dapm_route *of_dapm_routes;
1059 int num_of_dapm_routes;
1060 bool fully_routed;
866/*
867 * Sample 1 : Single CPU/Codec/Platform
868 *
869 * SND_SOC_DAILINK_DEFS(test,
870 * DAILINK_COMP_ARRAY(COMP_CPU("cpu_dai")),
871 * DAILINK_COMP_ARRAY(COMP_CODEC("codec", "codec_dai")),
872 * DAILINK_COMP_ARRAY(COMP_PLATFORM("platform")));
873 *

--- 187 unchanged lines hidden (view full) ---

1061 int num_dapm_widgets;
1062 const struct snd_soc_dapm_route *dapm_routes;
1063 int num_dapm_routes;
1064 const struct snd_soc_dapm_widget *of_dapm_widgets;
1065 int num_of_dapm_widgets;
1066 const struct snd_soc_dapm_route *of_dapm_routes;
1067 int num_of_dapm_routes;
1068 bool fully_routed;
1069 bool disable_route_checks;
1061
1062 /* lists of probed devices belonging to this card */
1063 struct list_head component_dev_list;
1064 struct list_head list;
1065
1066 struct list_head widgets;
1067 struct list_head paths;
1068 struct list_head dapm_list;

--- 35 unchanged lines hidden (view full) ---

1104 list_for_each_entry(component, &card->aux_comp_list, card_aux_list)
1105#define for_each_card_auxs_safe(card, component, _comp) \
1106 list_for_each_entry_safe(component, _comp, \
1107 &card->aux_comp_list, card_aux_list)
1108
1109#define for_each_card_components(card, component) \
1110 list_for_each_entry(component, &(card)->component_dev_list, card_list)
1111
1070
1071 /* lists of probed devices belonging to this card */
1072 struct list_head component_dev_list;
1073 struct list_head list;
1074
1075 struct list_head widgets;
1076 struct list_head paths;
1077 struct list_head dapm_list;

--- 35 unchanged lines hidden (view full) ---

1113 list_for_each_entry(component, &card->aux_comp_list, card_aux_list)
1114#define for_each_card_auxs_safe(card, component, _comp) \
1115 list_for_each_entry_safe(component, _comp, \
1116 &card->aux_comp_list, card_aux_list)
1117
1118#define for_each_card_components(card, component) \
1119 list_for_each_entry(component, &(card)->component_dev_list, card_list)
1120
1121#define for_each_card_dapms(card, dapm) \
1122 list_for_each_entry(dapm, &card->dapm_list, list)
1123
1124#define for_each_card_widgets(card, w)\
1125 list_for_each_entry(w, &card->widgets, list)
1126#define for_each_card_widgets_safe(card, w, _w) \
1127 list_for_each_entry_safe(w, _w, &card->widgets, list)
1128
1112/* SoC machine DAI configuration, glues a codec and cpu DAI together */
1113struct snd_soc_pcm_runtime {
1114 struct device *dev;
1115 struct snd_soc_card *card;
1116 struct snd_soc_dai_link *dai_link;
1117 struct snd_pcm_ops ops;
1118
1119 unsigned int params_select; /* currently selected param for dai link */
1120
1121 /* Dynamic PCM BE runtime data */
1122 struct snd_soc_dpcm_runtime dpcm[2];
1123
1124 long pmdown_time;
1125
1126 /* runtime devices */
1127 struct snd_pcm *pcm;
1128 struct snd_compr *compr;
1129 struct snd_soc_dai *codec_dai;
1130 struct snd_soc_dai *cpu_dai;
1129/* SoC machine DAI configuration, glues a codec and cpu DAI together */
1130struct snd_soc_pcm_runtime {
1131 struct device *dev;
1132 struct snd_soc_card *card;
1133 struct snd_soc_dai_link *dai_link;
1134 struct snd_pcm_ops ops;
1135
1136 unsigned int params_select; /* currently selected param for dai link */
1137
1138 /* Dynamic PCM BE runtime data */
1139 struct snd_soc_dpcm_runtime dpcm[2];
1140
1141 long pmdown_time;
1142
1143 /* runtime devices */
1144 struct snd_pcm *pcm;
1145 struct snd_compr *compr;
1146 struct snd_soc_dai *codec_dai;
1147 struct snd_soc_dai *cpu_dai;
1148 struct snd_soc_dai **dais;
1131
1132 struct snd_soc_dai **codec_dais;
1133 unsigned int num_codecs;
1134
1149
1150 struct snd_soc_dai **codec_dais;
1151 unsigned int num_codecs;
1152
1153 struct snd_soc_dai **cpu_dais;
1154 unsigned int num_cpus;
1155
1135 struct delayed_work delayed_work;
1136 void (*close_delayed_work_func)(struct snd_soc_pcm_runtime *rtd);
1137#ifdef CONFIG_DEBUG_FS
1138 struct dentry *debugfs_dpcm_root;
1139#endif
1140
1141 unsigned int num; /* 0-based and monotonic increasing */
1142 struct list_head list; /* rtd list of the soc card */

--- 4 unchanged lines hidden (view full) ---

1147
1148 int num_components;
1149 struct snd_soc_component *components[0]; /* CPU/Codec/Platform */
1150};
1151#define for_each_rtd_components(rtd, i, component) \
1152 for ((i) = 0; \
1153 ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
1154 (i)++)
1156 struct delayed_work delayed_work;
1157 void (*close_delayed_work_func)(struct snd_soc_pcm_runtime *rtd);
1158#ifdef CONFIG_DEBUG_FS
1159 struct dentry *debugfs_dpcm_root;
1160#endif
1161
1162 unsigned int num; /* 0-based and monotonic increasing */
1163 struct list_head list; /* rtd list of the soc card */

--- 4 unchanged lines hidden (view full) ---

1168
1169 int num_components;
1170 struct snd_soc_component *components[0]; /* CPU/Codec/Platform */
1171};
1172#define for_each_rtd_components(rtd, i, component) \
1173 for ((i) = 0; \
1174 ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
1175 (i)++)
1155#define for_each_rtd_codec_dai(rtd, i, dai)\
1156 for ((i) = 0; \
1157 ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
1176#define for_each_rtd_cpu_dais(rtd, i, dai) \
1177 for ((i) = 0; \
1178 ((i) < rtd->num_cpus) && ((dai) = rtd->cpu_dais[i]); \
1158 (i)++)
1179 (i)++)
1159#define for_each_rtd_codec_dai_rollback(rtd, i, dai) \
1180#define for_each_rtd_cpu_dais_rollback(rtd, i, dai) \
1181 for (; (--(i) >= 0) && ((dai) = rtd->cpu_dais[i]);)
1182#define for_each_rtd_codec_dais(rtd, i, dai) \
1183 for ((i) = 0; \
1184 ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
1185 (i)++)
1186#define for_each_rtd_codec_dais_rollback(rtd, i, dai) \
1160 for (; (--(i) >= 0) && ((dai) = rtd->codec_dais[i]);)
1187 for (; (--(i) >= 0) && ((dai) = rtd->codec_dais[i]);)
1188#define for_each_rtd_dais(rtd, i, dai) \
1189 for ((i) = 0; \
1190 ((i) < (rtd)->num_cpus + (rtd)->num_codecs) && \
1191 ((dai) = (rtd)->dais[i]); \
1192 (i)++)
1161
1162void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
1163
1164/* mixer control */
1165struct soc_mixer_control {
1166 int min, max, platform_max;
1167 int reg, rreg;
1168 unsigned int shift, rshift;

--- 233 unchanged lines hidden ---
1193
1194void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
1195
1196/* mixer control */
1197struct soc_mixer_control {
1198 int min, max, platform_max;
1199 int reg, rreg;
1200 unsigned int shift, rshift;

--- 233 unchanged lines hidden ---