mirror of
https://github.com/joel16/android_kernel_sony_msm8994_rework.git
synced 2024-11-23 11:59:58 +00:00
ASoC: core: Add support for getting TX and RX channels
Based on which codec dai is selected, slimbus channel numbers have to be queried when use case is being enabled. Change adds support to get the channel numbers. Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
This commit is contained in:
parent
38b8d0868a
commit
ee7c814762
@ -121,6 +121,11 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
|
||||
int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
|
||||
int direction);
|
||||
|
||||
int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
|
||||
unsigned int *tx_num, unsigned int *tx_slot,
|
||||
unsigned int *rx_num, unsigned int *rx_slot);
|
||||
|
||||
|
||||
struct snd_soc_dai_ops {
|
||||
/*
|
||||
* DAI clocking configuration, all optional.
|
||||
@ -144,6 +149,10 @@ struct snd_soc_dai_ops {
|
||||
unsigned int tx_num, unsigned int *tx_slot,
|
||||
unsigned int rx_num, unsigned int *rx_slot);
|
||||
int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
|
||||
int (*get_channel_map)(struct snd_soc_dai *dai,
|
||||
unsigned int *tx_num, unsigned int *tx_slot,
|
||||
unsigned int *rx_num, unsigned int *rx_slot);
|
||||
|
||||
|
||||
/*
|
||||
* DAI digital mute - optional.
|
||||
|
@ -4499,6 +4499,29 @@ int snd_soc_info_multi_ext(struct snd_kcontrol *kcontrol,
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_info_multi_ext);
|
||||
/**
|
||||
* snd_soc_dai_get_channel_map - configure DAI audio channel map
|
||||
* @dai: DAI
|
||||
* @tx_num: how many TX channels
|
||||
* @tx_slot: pointer to an array which imply the TX slot number channel
|
||||
* 0~num-1 uses
|
||||
* @rx_num: how many RX channels
|
||||
* @rx_slot: pointer to an array which imply the RX slot number channel
|
||||
* 0~num-1 uses
|
||||
*
|
||||
* configure the relationship between channel number and TDM slot number.
|
||||
*/
|
||||
int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
|
||||
unsigned int *tx_num, unsigned int *tx_slot,
|
||||
unsigned int *rx_num, unsigned int *rx_slot)
|
||||
{
|
||||
if (dai->driver && dai->driver->ops->get_channel_map)
|
||||
return dai->driver->ops->get_channel_map(dai, tx_num, tx_slot,
|
||||
rx_num, rx_slot);
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_dai_get_channel_map);
|
||||
static int __init snd_soc_init(void)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
Loading…
Reference in New Issue
Block a user