Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170130
b: refs/heads/master
c: 472df3c
h: refs/heads/master
v: v3
  • Loading branch information
Barry Song authored and Mark Brown committed Sep 13, 2009
1 parent 9f31cad commit 2297593
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2312fd8f6b252b7d3c1d74b20c75b7bff98bab65
refs/heads/master: 472df3cbae8da6a949f1392a11958b8d21383735
7 changes: 7 additions & 0 deletions trunk/include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width);

int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
unsigned int tx_num, unsigned int *tx_slot,
unsigned int rx_num, unsigned int *rx_slot);

int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);

/* Digital Audio Interface mute */
Expand Down Expand Up @@ -148,6 +152,9 @@ struct snd_soc_dai_ops {
int (*set_tdm_slot)(struct snd_soc_dai *dai,
unsigned int tx_mask, unsigned int rx_mask,
int slots, int slot_width);
int (*set_channel_map)(struct snd_soc_dai *dai,
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);

/*
Expand Down
24 changes: 24 additions & 0 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,30 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
}
EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot);

/**
* snd_soc_dai_set_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_set_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->ops && dai->ops->set_channel_map)
return dai->ops->set_channel_map(dai, tx_num, tx_slot,
rx_num, rx_slot);
else
return -EINVAL;
}
EXPORT_SYMBOL_GPL(snd_soc_dai_set_channel_map);

/**
* snd_soc_dai_set_tristate - configure DAI system or master clock.
* @dai: DAI
Expand Down

0 comments on commit 2297593

Please sign in to comment.