Commit 9b523124 authored by Mark Brown's avatar Mark Brown

ASoC: wm5100: Set the DAI base address in the DAI drivers

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 62368294
...@@ -1265,29 +1265,12 @@ static const __devinitdata struct reg_default wm5100_reva_patches[] = { ...@@ -1265,29 +1265,12 @@ static const __devinitdata struct reg_default wm5100_reva_patches[] = {
{ WM5100_AUDIO_IF_3_19, 1 }, { WM5100_AUDIO_IF_3_19, 1 },
}; };
static int wm5100_dai_to_base(struct snd_soc_dai *dai)
{
switch (dai->id) {
case 0:
return WM5100_AUDIO_IF_1_1 - 1;
case 1:
return WM5100_AUDIO_IF_2_1 - 1;
case 2:
return WM5100_AUDIO_IF_3_1 - 1;
default:
BUG();
return -EINVAL;
}
}
static int wm5100_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int wm5100_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
int lrclk, bclk, mask, base; int lrclk, bclk, mask, base;
base = wm5100_dai_to_base(dai); base = dai->driver->base;
if (base < 0)
return base;
lrclk = 0; lrclk = 0;
bclk = 0; bclk = 0;
...@@ -1414,9 +1397,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream, ...@@ -1414,9 +1397,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream,
int i, base, bclk, aif_rate, lrclk, wl, fl, sr; int i, base, bclk, aif_rate, lrclk, wl, fl, sr;
int *bclk_rates; int *bclk_rates;
base = wm5100_dai_to_base(dai); base = dai->driver->base;
if (base < 0)
return base;
/* Data sizes if not using TDM */ /* Data sizes if not using TDM */
wl = snd_pcm_format_width(params_format(params)); wl = snd_pcm_format_width(params_format(params));
...@@ -1897,6 +1878,7 @@ static int wm5100_set_fll(struct snd_soc_codec *codec, int fll_id, int source, ...@@ -1897,6 +1878,7 @@ static int wm5100_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
static struct snd_soc_dai_driver wm5100_dai[] = { static struct snd_soc_dai_driver wm5100_dai[] = {
{ {
.name = "wm5100-aif1", .name = "wm5100-aif1",
.base = WM5100_AUDIO_IF_1_1 - 1,
.playback = { .playback = {
.stream_name = "AIF1 Playback", .stream_name = "AIF1 Playback",
.channels_min = 2, .channels_min = 2,
...@@ -1916,6 +1898,7 @@ static struct snd_soc_dai_driver wm5100_dai[] = { ...@@ -1916,6 +1898,7 @@ static struct snd_soc_dai_driver wm5100_dai[] = {
{ {
.name = "wm5100-aif2", .name = "wm5100-aif2",
.id = 1, .id = 1,
.base = WM5100_AUDIO_IF_2_1 - 1,
.playback = { .playback = {
.stream_name = "AIF2 Playback", .stream_name = "AIF2 Playback",
.channels_min = 2, .channels_min = 2,
...@@ -1935,6 +1918,7 @@ static struct snd_soc_dai_driver wm5100_dai[] = { ...@@ -1935,6 +1918,7 @@ static struct snd_soc_dai_driver wm5100_dai[] = {
{ {
.name = "wm5100-aif3", .name = "wm5100-aif3",
.id = 2, .id = 2,
.base = WM5100_AUDIO_IF_3_1 - 1,
.playback = { .playback = {
.stream_name = "AIF3 Playback", .stream_name = "AIF3 Playback",
.channels_min = 2, .channels_min = 2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment