aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAlan Tull <r80115@freescale.com>2010-09-23 14:17:22 -0500
committerAlan Tull <r80115@freescale.com>2010-09-25 09:49:18 -0500
commit024958c044435e69aa36b7a95e8a544a366b889c (patch)
treec09491225ed8cbc659934796659a834993c19986 /sound
parent0ddaf3bc72ff1b9540ca47aa030b885107dc52c6 (diff)
ENGR00131832-2 MX25: Upgrade kernel to 2.6.35
This patch contains driver fixes for mx25. Contains all checkpatch and copyright fixes. Signed-off-by: Alan Tull <r80115@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/ak5702.c29
-rw-r--r--sound/soc/codecs/wm8580.c15
-rw-r--r--sound/soc/imx/imx-3stack-ak5702.c6
-rw-r--r--sound/soc/imx/imx-3stack-wm8580.c9
4 files changed, 24 insertions, 35 deletions
diff --git a/sound/soc/codecs/ak5702.c b/sound/soc/codecs/ak5702.c
index f3fdbd0d14e..408f6efc84c 100644
--- a/sound/soc/codecs/ak5702.c
+++ b/sound/soc/codecs/ak5702.c
@@ -62,9 +62,9 @@ static inline unsigned int ak5702_read(struct snd_soc_codec *codec,
u8 data;
data = reg;
- if (codec->hw_write(codec->control_data, &data, 1) != 1)
+ if (i2c_master_send(codec->control_data, &data, 1) != 1)
return -EIO;
- if (codec->hw_read(codec->control_data, &data, 1) != 1)
+ if (i2c_master_recv(codec->control_data, &data, 1) != 1)
return -EIO;
return data;
@@ -95,7 +95,7 @@ static int ak5702_write(struct snd_soc_codec *codec, unsigned int reg,
data[1] = value & 0xff;
ak5702_write_reg_cache(codec, reg, value);
- if (codec->hw_write(codec->control_data, data, 2) == 2)
+ if (i2c_master_send(codec->control_data, data, 2) == 2)
return 0;
else
return -EIO;
@@ -176,7 +176,6 @@ static int ak5702_add_widgets(struct snd_soc_codec *codec)
ARRAY_SIZE(ak5702_dapm_widgets));
snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
- snd_soc_dapm_new_widgets(codec);
return 0;
}
@@ -248,7 +247,8 @@ static int ak5702_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
}
static int ak5702_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
- unsigned int freq_in, unsigned int freq_out)
+ int source, unsigned int freq_in,
+ unsigned int freq_out)
{
struct snd_soc_codec *codec = codec_dai->codec;
u8 reg = 0;
@@ -453,16 +453,8 @@ static int ak5702_probe(struct platform_device *pdev)
ARRAY_SIZE(ak5702_snd_controls));
ak5702_add_widgets(codec);
- ret = snd_soc_init_card(socdev);
- if (ret < 0) {
- printk(KERN_ERR "ak5702: failed to register card\n");
- goto card_err;
- }
-
return ret;
-card_err:
- snd_soc_free_pcms(socdev);
- snd_soc_dapm_free(socdev);
+
pcm_err:
kfree(codec->reg_cache);
return ret;
@@ -492,7 +484,7 @@ static int ak5702_i2c_probe(struct i2c_client *client,
return -ENOMEM;
}
- codec->private_data = ak5702;
+ snd_soc_codec_set_drvdata(codec, ak5702);
mutex_init(&codec->mutex);
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);
@@ -513,9 +505,6 @@ static int ak5702_i2c_probe(struct i2c_client *client,
if (codec->reg_cache == NULL)
return -ENOMEM;
- codec->hw_write = (hw_write_t) i2c_master_send;
- codec->hw_read = (hw_read_t) i2c_master_recv;
-
ak5702_codec = codec;
ak5702_dai.dev = &client->dev;
@@ -537,7 +526,7 @@ static int ak5702_i2c_probe(struct i2c_client *client,
static __devexit int ak5702_i2c_remove(struct i2c_client *client)
{
struct snd_soc_codec *codec = i2c_get_clientdata(client);
- struct ak5702_priv *ak5702 = codec->private_data;
+ struct ak5702_priv *ak5702 = snd_soc_codec_get_drvdata(codec);
snd_soc_unregister_dai(&ak5702_dai);
snd_soc_unregister_codec(codec);
@@ -578,8 +567,6 @@ static int ak5702_remove(struct platform_device *pdev)
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
i2c_del_driver(&ak5702_i2c_driver);
#endif
- kfree(codec->private_data);
- kfree(codec);
return 0;
}
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 8b25c4dd05e..75a92347718 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -686,16 +686,16 @@ static int wm8580_set_paif_dai_sysclk(struct snd_soc_dai *codec_dai,
switch (clk_id) {
case WM8580_BCLK_CLKDIV:
- reg = wm8580_read(codec, WM8580_PAIF1) &
+ reg = snd_soc_read(codec, WM8580_PAIF1) &
~WM8580_AIF_BCLKSEL_MASK;
- wm8580_write(codec, WM8580_PAIF1, reg | freq);
- reg = wm8580_read(codec, WM8580_PAIF2) &
+ snd_soc_write(codec, WM8580_PAIF1, reg | freq);
+ reg = snd_soc_read(codec, WM8580_PAIF2) &
~WM8580_AIF_BCLKSEL_MASK;
- wm8580_write(codec, WM8580_PAIF2, reg | freq);
+ snd_soc_write(codec, WM8580_PAIF2, reg | freq);
break;
case WM8580_LRCLK_CLKDIV:
- reg = wm8580_read(codec, WM8580_PAIF1) & ~0x07;
- wm8580_write(codec, WM8580_PAIF1, reg | freq);
+ reg = snd_soc_read(codec, WM8580_PAIF1) & ~0x07;
+ snd_soc_write(codec, WM8580_PAIF1, reg | freq);
break;
default:
@@ -1057,12 +1057,11 @@ static int __devinit wm8580_spi_probe(struct spi_device *spi)
spi_set_drvdata(spi, wm8580);
codec->hw_write = (hw_write_t) spi_rw;
- codec->hw_read = (hw_read_t) spi_rw;
codec->control_data = spi;
codec->dev = &spi->dev;
- return wm8580_register(wm8580);
+ return wm8580_register(wm8580, SND_SOC_SPI);
}
static int __devinit wm8580_spi_remove(struct spi_device *spi)
diff --git a/sound/soc/imx/imx-3stack-ak5702.c b/sound/soc/imx/imx-3stack-ak5702.c
index eac550fa37e..d90252b729f 100644
--- a/sound/soc/imx/imx-3stack-ak5702.c
+++ b/sound/soc/imx/imx-3stack-ak5702.c
@@ -54,7 +54,7 @@ static void imx_3stack_shutdown(struct snd_pcm_substream *substream)
/* disable the PLL if there are no active Rx channels */
if (!codec_dai->active)
- snd_soc_dai_set_pll(codec_dai, 0, 0, 0);
+ snd_soc_dai_set_pll(codec_dai, 0, 0, 0, 0);
clk_state.lr_clk_active--;
}
@@ -85,7 +85,7 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
snd_soc_dai_set_fmt(cpu_dai, dai_format);
/* set i.MX active slot mask */
- snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffff, 2);
+ snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffff, 0xffffffff, 2, 0);
/* set the ESAI system clock as input */
snd_soc_dai_set_sysclk(cpu_dai, 0, 0, SND_SOC_CLOCK_IN);
@@ -96,7 +96,7 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
snd_soc_dai_set_sysclk(codec_dai, 0, rate, SND_SOC_CLOCK_OUT);
- snd_soc_dai_set_pll(codec_dai, 1, 12000000, 0);
+ snd_soc_dai_set_pll(codec_dai, 1, 0, 12000000, 0);
return 0;
}
diff --git a/sound/soc/imx/imx-3stack-wm8580.c b/sound/soc/imx/imx-3stack-wm8580.c
index 647034d87e1..d2366e9c74a 100644
--- a/sound/soc/imx/imx-3stack-wm8580.c
+++ b/sound/soc/imx/imx-3stack-wm8580.c
@@ -110,7 +110,7 @@ static void imx_3stack_shutdown(struct snd_pcm_substream *substream)
/* disable the PLL if there are no active Tx or Rx channels */
if (!codec_dai->active)
- snd_soc_dai_set_pll(codec_dai, 0, 0, 0);
+ snd_soc_dai_set_pll(codec_dai, 0, 0, 0, 0);
clk_state.lr_clk_active--;
}
@@ -234,7 +234,10 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
snd_soc_dai_set_fmt(cpu_dai, dai_format);
/* set i.MX active slot mask */
- snd_soc_dai_set_tdm_slot(cpu_dai, channel == 1 ? 0x1 : 0x3, 2);
+ snd_soc_dai_set_tdm_slot(cpu_dai,
+ channel == 1 ? 0x1 : 0x3,
+ channel == 1 ? 0x1 : 0x3,
+ 2, 0);
/* set the ESAI system clock as input (unused) */
snd_soc_dai_set_sysclk(cpu_dai, 0, 0, SND_SOC_CLOCK_IN);
@@ -249,7 +252,7 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
snd_soc_dai_set_sysclk(codec_dai, WM8580_LRCLK_CLKDIV, lrclk_ratio,
SND_SOC_CLOCK_OUT);
- snd_soc_dai_set_pll(codec_dai, 1, 12000000, pll_out);
+ snd_soc_dai_set_pll(codec_dai, 1, 0, 12000000, pll_out);
return 0;
}