diff options
-rw-r--r-- | include/sound/soc-dai.h | 7 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 24 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 16963d4d5df2..e0c7fa7b1060 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -114,6 +114,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | |||
114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); | 115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
116 | 116 | ||
117 | int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, | ||
118 | unsigned int tx_num, unsigned int *tx_slot, | ||
119 | unsigned int rx_num, unsigned int *rx_slot); | ||
120 | |||
117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 121 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
118 | 122 | ||
119 | /* Digital Audio Interface mute */ | 123 | /* Digital Audio Interface mute */ |
@@ -148,6 +152,9 @@ struct snd_soc_dai_ops { | |||
148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 152 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
149 | unsigned int tx_mask, unsigned int rx_mask, | 153 | unsigned int tx_mask, unsigned int rx_mask, |
150 | int slots, int slot_width); | 154 | int slots, int slot_width); |
155 | int (*set_channel_map)(struct snd_soc_dai *dai, | ||
156 | unsigned int tx_num, unsigned int *tx_slot, | ||
157 | unsigned int rx_num, unsigned int *rx_slot); | ||
151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 158 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
152 | 159 | ||
153 | /* | 160 | /* |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 05fdc8023da4..f5b356f8acfb 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -2253,6 +2253,30 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | |||
2253 | EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); | 2253 | EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); |
2254 | 2254 | ||
2255 | /** | 2255 | /** |
2256 | * snd_soc_dai_set_channel_map - configure DAI audio channel map | ||
2257 | * @dai: DAI | ||
2258 | * @tx_num: how many TX channels | ||
2259 | * @tx_slot: pointer to an array which imply the TX slot number channel | ||
2260 | * 0~num-1 uses | ||
2261 | * @rx_num: how many RX channels | ||
2262 | * @rx_slot: pointer to an array which imply the RX slot number channel | ||
2263 | * 0~num-1 uses | ||
2264 | * | ||
2265 | * configure the relationship between channel number and TDM slot number. | ||
2266 | */ | ||
2267 | int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, | ||
2268 | unsigned int tx_num, unsigned int *tx_slot, | ||
2269 | unsigned int rx_num, unsigned int *rx_slot) | ||
2270 | { | ||
2271 | if (dai->ops && dai->ops->set_channel_map) | ||
2272 | return dai->ops->set_channel_map(dai, tx_num, tx_slot, | ||
2273 | rx_num, rx_slot); | ||
2274 | else | ||
2275 | return -EINVAL; | ||
2276 | } | ||
2277 | EXPORT_SYMBOL_GPL(snd_soc_dai_set_channel_map); | ||
2278 | |||
2279 | /** | ||
2256 | * snd_soc_dai_set_tristate - configure DAI system or master clock. | 2280 | * snd_soc_dai_set_tristate - configure DAI system or master clock. |
2257 | * @dai: DAI | 2281 | * @dai: DAI |
2258 | * @tristate: tristate enable | 2282 | * @tristate: tristate enable |