diff options
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index a8b4b9c8b1d2..a2deeb954c21 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -110,6 +110,14 @@ | |||
110 | .put = snd_soc_put_volsw, \ | 110 | .put = snd_soc_put_volsw, \ |
111 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ | 111 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
112 | max, invert, 0) } | 112 | max, invert, 0) } |
113 | #define SOC_DOUBLE_STS(xname, reg, shift_left, shift_right, max, invert) \ | ||
114 | { \ | ||
115 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
116 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | ||
117 | .access = SNDRV_CTL_ELEM_ACCESS_READ | \ | ||
118 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ | ||
119 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ | ||
120 | max, invert, 0) } | ||
113 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 121 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
114 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 122 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
115 | .info = snd_soc_info_volsw, \ | 123 | .info = snd_soc_info_volsw, \ |
@@ -293,6 +301,9 @@ | |||
293 | {.base = xbase, .num_regs = xregs, \ | 301 | {.base = xbase, .num_regs = xregs, \ |
294 | .mask = xmask }) } | 302 | .mask = xmask }) } |
295 | 303 | ||
304 | /* | ||
305 | * SND_SOC_BYTES_EXT is deprecated, please USE SND_SOC_BYTES_TLV instead | ||
306 | */ | ||
296 | #define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \ | 307 | #define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \ |
297 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 308 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
298 | .info = snd_soc_bytes_info_ext, \ | 309 | .info = snd_soc_bytes_info_ext, \ |
@@ -1037,6 +1048,9 @@ struct snd_soc_dai_link { | |||
1037 | 1048 | ||
1038 | /* pmdown_time is ignored at stop */ | 1049 | /* pmdown_time is ignored at stop */ |
1039 | unsigned int ignore_pmdown_time:1; | 1050 | unsigned int ignore_pmdown_time:1; |
1051 | |||
1052 | struct list_head list; /* DAI link list of the soc card */ | ||
1053 | struct snd_soc_dobj dobj; /* For topology */ | ||
1040 | }; | 1054 | }; |
1041 | 1055 | ||
1042 | struct snd_soc_codec_conf { | 1056 | struct snd_soc_codec_conf { |
@@ -1101,12 +1115,20 @@ struct snd_soc_card { | |||
1101 | struct snd_soc_dapm_context *dapm, | 1115 | struct snd_soc_dapm_context *dapm, |
1102 | enum snd_soc_bias_level level); | 1116 | enum snd_soc_bias_level level); |
1103 | 1117 | ||
1118 | int (*add_dai_link)(struct snd_soc_card *, | ||
1119 | struct snd_soc_dai_link *link); | ||
1120 | void (*remove_dai_link)(struct snd_soc_card *, | ||
1121 | struct snd_soc_dai_link *link); | ||
1122 | |||
1104 | long pmdown_time; | 1123 | long pmdown_time; |
1105 | 1124 | ||
1106 | /* CPU <--> Codec DAI links */ | 1125 | /* CPU <--> Codec DAI links */ |
1107 | struct snd_soc_dai_link *dai_link; | 1126 | struct snd_soc_dai_link *dai_link; /* predefined links only */ |
1108 | int num_links; | 1127 | int num_links; /* predefined links only */ |
1109 | struct snd_soc_pcm_runtime *rtd; | 1128 | struct list_head dai_link_list; /* all links */ |
1129 | int num_dai_links; | ||
1130 | |||
1131 | struct list_head rtd_list; | ||
1110 | int num_rtd; | 1132 | int num_rtd; |
1111 | 1133 | ||
1112 | /* optional codec specific configuration */ | 1134 | /* optional codec specific configuration */ |
@@ -1201,6 +1223,9 @@ struct snd_soc_pcm_runtime { | |||
1201 | struct dentry *debugfs_dpcm_root; | 1223 | struct dentry *debugfs_dpcm_root; |
1202 | struct dentry *debugfs_dpcm_state; | 1224 | struct dentry *debugfs_dpcm_state; |
1203 | #endif | 1225 | #endif |
1226 | |||
1227 | unsigned int num; /* 0-based and monotonic increasing */ | ||
1228 | struct list_head list; /* rtd list of the soc card */ | ||
1204 | }; | 1229 | }; |
1205 | 1230 | ||
1206 | /* mixer control */ | 1231 | /* mixer control */ |
@@ -1225,8 +1250,10 @@ struct soc_bytes_ext { | |||
1225 | struct snd_soc_dobj dobj; | 1250 | struct snd_soc_dobj dobj; |
1226 | 1251 | ||
1227 | /* used for TLV byte control */ | 1252 | /* used for TLV byte control */ |
1228 | int (*get)(unsigned int __user *bytes, unsigned int size); | 1253 | int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes, |
1229 | int (*put)(const unsigned int __user *bytes, unsigned int size); | 1254 | unsigned int size); |
1255 | int (*put)(struct snd_kcontrol *kcontrol, const unsigned int __user *bytes, | ||
1256 | unsigned int size); | ||
1230 | }; | 1257 | }; |
1231 | 1258 | ||
1232 | /* multi register control */ | 1259 | /* multi register control */ |
@@ -1644,6 +1671,11 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev, | |||
1644 | struct device_node *of_node, | 1671 | struct device_node *of_node, |
1645 | struct snd_soc_dai_link *dai_link); | 1672 | struct snd_soc_dai_link *dai_link); |
1646 | 1673 | ||
1674 | int snd_soc_add_dai_link(struct snd_soc_card *card, | ||
1675 | struct snd_soc_dai_link *dai_link); | ||
1676 | void snd_soc_remove_dai_link(struct snd_soc_card *card, | ||
1677 | struct snd_soc_dai_link *dai_link); | ||
1678 | |||
1647 | #include <sound/soc-dai.h> | 1679 | #include <sound/soc-dai.h> |
1648 | 1680 | ||
1649 | #ifdef CONFIG_DEBUG_FS | 1681 | #ifdef CONFIG_DEBUG_FS |