aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorBarry Song <21cnbao@gmail.com>2009-09-11 13:16:29 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-13 07:37:53 -0400
commit472df3cbae8da6a949f1392a11958b8d21383735 (patch)
tree0e8c33fdf2de2cd970c29e7baf52a70fde005a59 /sound
parent2312fd8f6b252b7d3c1d74b20c75b7bff98bab65 (diff)
ASoC: Provide API for reordering channels
The patch adds an interface to set the relationship between audio channel number and slot number. The interface should be really useful because audio channel n doesn't always use slot n in all platforms. And for some devices, the relationship even can change with sound mode switch in 2.1,3.1,4.1,5.1,6.1,7.1 etc. Signed-off-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c24
1 files changed, 24 insertions, 0 deletions
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,
2253EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); 2253EXPORT_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 */
2267int 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}
2277EXPORT_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