[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.2-163-gd6fb919
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2013-02-15 15:57:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d6fb919014755df4552dea08a22f3c95a6bc4314 (commit)
from eff2f2a1c536cd005381b2e8c0694cef63a1abda (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d6fb919014755df4552dea08a22f3c95a6bc4314
Author: Eric Jarrige <eri...@ar...>
Date: Fri Feb 15 17:01:00 2013 +0100
[LINUX] 2.6.38: wm8960: Fix registers definition, PLL, clocks.. errors; also add audio input feature
-----------------------------------------------------------------------
Summary of changes:
.../428-armadeus-asoc-add_debug_to_wm8960.patch | 127 -----
.../2.6.38/429-armadeus-asoc-wm8960-fixes.patch | 493 ++++++++++++++++++++
...deus-asoc-wm8960-change_channels_min_to_2.patch | 25 -
3 files changed, 493 insertions(+), 152 deletions(-)
delete mode 100644 patches/linux/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch
create mode 100644 patches/linux/2.6.38/429-armadeus-asoc-wm8960-fixes.patch
delete mode 100644 patches/linux/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch
diff --git a/patches/linux/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch b/patches/linux/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch
deleted file mode 100644
index 5bf0cae..0000000
--- a/patches/linux/2.6.38/428-armadeus-asoc-add_debug_to_wm8960.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Index: linux-2.6.38.1/sound/soc/codecs/wm8960.c
-===================================================================
---- linux-2.6.38.1.orig/sound/soc/codecs/wm8960.c 2011-04-06 11:06:59.000000000 +0200
-+++ linux-2.6.38.1/sound/soc/codecs/wm8960.c 2011-04-13 14:48:47.000000000 +0200
-@@ -8,6 +8,8 @@
- * published by the Free Software Foundation.
- */
-
-+#define DEBUG
-+
- #include <linux/module.h>
- #include <linux/moduleparam.h>
- #include <linux/init.h>
-@@ -16,6 +18,9 @@
- #include <linux/i2c.h>
- #include <linux/platform_device.h>
- #include <linux/slab.h>
-+#ifdef DEBUG
-+#include <linux/proc_fs.h>
-+#endif
- #include <sound/core.h>
- #include <sound/pcm.h>
- #include <sound/pcm_params.h>
-@@ -917,12 +922,81 @@
- return 0;
- }
-
-+#ifdef DEBUG
-+
-+static u8 current_reg_addr;
-+
-+static int wm8960_proc_read_register( __attribute__ ((unused)) struct file *file, const char *buf, unsigned long count, void *data)
-+{
-+ int len;
-+ char given_param[16];
-+ u8 reg_addr;
-+ u16 reg_val;
-+ struct snd_soc_codec *codec = data;
-+
-+ if (count <= 0) {
-+ printk("Empty string transmitted !\n");
-+ return 0;
-+ }
-+ if (count > 4) {
-+ len = 4;
-+ printk("Only 4x[0-9] decimal values supported !\n");
-+ } else {
-+ len = count;
-+ }
-+
-+ if (copy_from_user(given_param, buf, len)) {
-+ return -EFAULT;
-+ }
-+
-+ reg_addr = (u8)(simple_strtol(given_param, 0, 16));
-+ current_reg_addr = reg_addr;
-+ reg_val = snd_soc_read(codec, reg_addr);
-+ printk("Read 0x%04x @ 0x%02x\n", reg_val, reg_addr);
-+
-+ return len;
-+}
-+
-+static int wm8960_proc_write_register( __attribute__ ((unused)) struct file *file, const char *buf, unsigned long count, void *data)
-+{
-+ int len, ret;
-+ char given_param[16];
-+ u16 reg_val;
-+ struct snd_soc_codec *codec = data;
-+
-+ if (count <= 0) {
-+ printk("Empty string transmitted !\n");
-+ return 0;
-+ }
-+ if (count > 4) {
-+ len = 4;
-+ printk("Only 4x[0-9] decimal values supported !\n");
-+ } else {
-+ len = count;
-+ }
-+
-+ if (copy_from_user(given_param, buf, len)) {
-+ return -EFAULT;
-+ }
-+
-+ reg_val = (u16)(simple_strtol(given_param, 0, 16));
-+ printk("Writing 0x%04x @ 0x%02x\n", reg_val, current_reg_addr);
-+ snd_soc_write(codec, current_reg_addr, reg_val);
-+ udelay(100);
-+
-+ return len;
-+}
-+#endif /* DEBUG */
-+
- static int wm8960_probe(struct snd_soc_codec *codec)
- {
- struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
- struct wm8960_data *pdata = dev_get_platdata(codec->dev);
- int ret;
- u16 reg;
-+#ifdef DEBUG
-+ struct proc_dir_entry *proc_read, *proc_write;
-+#endif
-
- wm8960->set_bias_level = wm8960_set_bias_level_out3;
- codec->control_data = wm8960->control_data;
-@@ -979,6 +1053,21 @@
- ARRAY_SIZE(wm8960_snd_controls));
- wm8960_add_widgets(codec);
-
-+#ifdef DEBUG
-+ /* create proc files */
-+ proc_read = create_proc_entry("driver/wmread", S_IWUSR | S_IRGRP | S_IROTH, NULL);
-+ proc_write = create_proc_entry("driver/wmwrite", S_IWUSR | S_IRGRP | S_IROTH, NULL);
-+ if ((proc_read == NULL) || (proc_write == NULL)) {
-+ printk(KERN_ERR "wm8960" ": Could not register one /proc file. Terminating\n");
-+ return -ENOMEM;
-+ } else {
-+ proc_read->write_proc = wm8960_proc_read_register;
-+ proc_read->data = codec;
-+ proc_write->write_proc = wm8960_proc_write_register;
-+ proc_write->data = codec;
-+ }
-+#endif
-+
- return 0;
- }
-
diff --git a/patches/linux/2.6.38/429-armadeus-asoc-wm8960-fixes.patch b/patches/linux/2.6.38/429-armadeus-asoc-wm8960-fixes.patch
new file mode 100644
index 0000000..7d2a1f8
--- /dev/null
+++ b/patches/linux/2.6.38/429-armadeus-asoc-wm8960-fixes.patch
@@ -0,0 +1,493 @@
+WM8960: Fix audio
+ - update to driver version present in linux 3.6
+ - add options to support common LRCLK
+ - fix WM8960 registers
+ - rework (add) input audio path
+
+Signed-off-by: Julien Boibessot <jul...@ar...<
+
+Index: linux-2.6.38.8/include/sound/wm8960.h
+===================================================================
+--- linux-2.6.38.8/include/sound/wm8960.h
++++ linux-2.6.38.8/include/sound/wm8960.h
+@@ -19,6 +19,8 @@ struct wm8960_data {
+ bool capless; /* Headphone outputs configured in capless mode */
+
+ int dres; /* Discharge resistance for headphone outputs */
++ bool shared_lrclk; /* DAC and ADC LRCLKs are wired together */
++ bool use_alrcgpio; /* DACLRC frame clock is used for DAC and ADC */
+ };
+
+ #endif
+Index: linux-2.6.38.8/sound/soc/codecs/wm8960.c
+===================================================================
+--- linux-2.6.38.8/sound/soc/codecs/wm8960.c
++++ linux-2.6.38.8/sound/soc/codecs/wm8960.c
+@@ -1,6 +1,9 @@
+ /*
+ * wm8960.c -- WM8960 ALSA SoC Audio driver
+ *
++ * Copyright 2007-11 Wolfson Microelectronics, plc
++ * Copyright (C) 20013 Eric Jarrige <eri...@ar...>
++ *
+ * Author: Liam Girdwood
+ *
+ * This program is free software; you can redistribute it and/or modify
+@@ -14,7 +17,6 @@
+ #include <linux/delay.h>
+ #include <linux/pm.h>
+ #include <linux/i2c.h>
+-#include <linux/platform_device.h>
+ #include <linux/slab.h>
+ #include <sound/core.h>
+ #include <sound/pcm.h>
+@@ -26,8 +28,6 @@
+
+ #include "wm8960.h"
+
+-#define AUDIO_NAME "wm8960"
+-
+ /* R25 - Power 1 */
+ #define WM8960_VMID_MASK 0x180
+ #define WM8960_VREF 0x40
+@@ -72,7 +72,6 @@ static const u16 wm8960_reg[WM8960_CACHE
+
+ struct wm8960_priv {
+ enum snd_soc_control_type control_type;
+- void *control_data;
+ int (*set_bias_level)(struct snd_soc_codec *,
+ enum snd_soc_bias_level level);
+ struct snd_soc_dapm_widget *lout1;
+@@ -166,7 +165,7 @@ SOC_DOUBLE_R_TLV("Capture Volume", WM896
+ SOC_DOUBLE_R("Capture Volume ZC Switch", WM8960_LINVOL, WM8960_RINVOL,
+ 6, 1, 0),
+ SOC_DOUBLE_R("Capture Switch", WM8960_LINVOL, WM8960_RINVOL,
+- 7, 1, 0),
++ 7, 1, 1),
+
+ SOC_DOUBLE_R_TLV("Playback Volume", WM8960_LDAC, WM8960_RDAC,
+ 0, 255, 0, dac_tlv),
+@@ -208,8 +207,8 @@ SOC_SINGLE("ALC Attack", WM8960_ALC3, 0,
+ SOC_SINGLE("Noise Gate Threshold", WM8960_NOISEG, 3, 31, 0),
+ SOC_SINGLE("Noise Gate Switch", WM8960_NOISEG, 0, 1, 0),
+
+-SOC_DOUBLE_R("ADC PCM Capture Volume", WM8960_LINPATH, WM8960_RINPATH,
+- 0, 127, 0),
++SOC_DOUBLE_R("Boost Capture Volume", WM8960_LINPATH, WM8960_RINPATH,
++ 4, 3, 0),
+
+ SOC_SINGLE_TLV("Left Output Mixer Boost Bypass Volume",
+ WM8960_BYPASS1, 4, 7, 1, bypass_tlv),
+@@ -266,7 +265,7 @@ SND_SOC_DAPM_INPUT("RINPUT2"),
+ SND_SOC_DAPM_INPUT("LINPUT3"),
+ SND_SOC_DAPM_INPUT("RINPUT3"),
+
+-SND_SOC_DAPM_MICBIAS("MICB", WM8960_POWER1, 1, 0),
++SND_SOC_DAPM_SUPPLY("MICB", WM8960_POWER1, 1, 0, NULL, 0),
+
+ SND_SOC_DAPM_MIXER("Left Boost Mixer", WM8960_POWER1, 5, 0,
+ wm8960_lin_boost, ARRAY_SIZE(wm8960_lin_boost)),
+@@ -278,8 +277,8 @@ SND_SOC_DAPM_MIXER("Left Input Mixer", W
+ SND_SOC_DAPM_MIXER("Right Input Mixer", WM8960_POWER3, 4, 0,
+ wm8960_rin, ARRAY_SIZE(wm8960_rin)),
+
+-SND_SOC_DAPM_ADC("Left ADC", "Capture", WM8960_POWER2, 3, 0),
+-SND_SOC_DAPM_ADC("Right ADC", "Capture", WM8960_POWER2, 2, 0),
++SND_SOC_DAPM_ADC("Left ADC", "Capture", WM8960_POWER1, 3, 0),
++SND_SOC_DAPM_ADC("Right ADC", "Capture", WM8960_POWER1, 2, 0),
+
+ SND_SOC_DAPM_DAC("Left DAC", "Playback", WM8960_POWER2, 8, 0),
+ SND_SOC_DAPM_DAC("Right DAC", "Playback", WM8960_POWER2, 7, 0),
+@@ -443,6 +442,7 @@ static int wm8960_set_dai_fmt(struct snd
+ iface |= 0x0040;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
++ iface &= ~0x0040;
+ break;
+ default:
+ return -EINVAL;
+@@ -500,7 +500,7 @@ static struct {
+ { 22050, 2 },
+ { 24000, 2 },
+ { 16000, 3 },
+- { 11250, 4 },
++ { 11025, 4 },
+ { 12000, 4 },
+ { 8000, 5 },
+ };
+@@ -509,8 +509,7 @@ static int wm8960_hw_params(struct snd_p
+ struct snd_pcm_hw_params *params,
+ struct snd_soc_dai *dai)
+ {
+- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+- struct snd_soc_codec *codec = rtd->codec;
++ struct snd_soc_codec *codec = dai->codec;
+ struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
+ u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3;
+ int i;
+@@ -547,57 +546,49 @@ static int wm8960_hw_params(struct snd_p
+ static int wm8960_mute(struct snd_soc_dai *dai, int mute)
+ {
+ struct snd_soc_codec *codec = dai->codec;
+- u16 mute_reg = snd_soc_read(codec, WM8960_DACCTL1) & 0xfff7;
+
+ if (mute)
+- snd_soc_write(codec, WM8960_DACCTL1, mute_reg | 0x8);
++ snd_soc_update_bits(codec, WM8960_DACCTL1, 0x8, 0x8);
+ else
+- snd_soc_write(codec, WM8960_DACCTL1, mute_reg);
++ snd_soc_update_bits(codec, WM8960_DACCTL1, 0x8, 0);
+ return 0;
+ }
+
+ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,
+ enum snd_soc_bias_level level)
+ {
+- u16 reg;
+-
+ switch (level) {
+ case SND_SOC_BIAS_ON:
+ break;
+
+ case SND_SOC_BIAS_PREPARE:
+ /* Set VMID to 2x50k */
+- reg = snd_soc_read(codec, WM8960_POWER1);
+- reg &= ~0x180;
+- reg |= 0x80;
+- snd_soc_write(codec, WM8960_POWER1, reg);
++ snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x80);
+ break;
+
+ case SND_SOC_BIAS_STANDBY:
+ if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
++ snd_soc_cache_sync(codec);
++
+ /* Enable anti-pop features */
+ snd_soc_write(codec, WM8960_APOP1,
+ WM8960_POBCTRL | WM8960_SOFT_ST |
+ WM8960_BUFDCOPEN | WM8960_BUFIOEN);
+
+ /* Enable & ramp VMID at 2x50k */
+- reg = snd_soc_read(codec, WM8960_POWER1);
+- reg |= 0x80;
+- snd_soc_write(codec, WM8960_POWER1, reg);
++ snd_soc_update_bits(codec, WM8960_POWER1, 0x80, 0x80);
+ msleep(100);
+
+ /* Enable VREF */
+- snd_soc_write(codec, WM8960_POWER1, reg | WM8960_VREF);
++ snd_soc_update_bits(codec, WM8960_POWER1, WM8960_VREF,
++ WM8960_VREF);
+
+ /* Disable anti-pop features */
+ snd_soc_write(codec, WM8960_APOP1, WM8960_BUFIOEN);
+ }
+
+ /* Set VMID to 2x250k */
+- reg = snd_soc_read(codec, WM8960_POWER1);
+- reg &= ~0x180;
+- reg |= 0x100;
+- snd_soc_write(codec, WM8960_POWER1, reg);
++ snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x100);
+ break;
+
+ case SND_SOC_BIAS_OFF:
+@@ -677,6 +668,9 @@ static int wm8960_set_bias_level_capless
+ WM8960_VREF | WM8960_VMID_MASK, 0);
+ break;
+
++ case SND_SOC_BIAS_OFF:
++ snd_soc_cache_sync(codec);
++ break;
+ default:
+ break;
+ }
+@@ -786,10 +780,8 @@ static int wm8960_set_dai_pll(struct snd
+
+ /* Disable the PLL: even if we are changing the frequency the
+ * PLL needs to be disabled while we do so. */
+- snd_soc_write(codec, WM8960_CLOCK1,
+- snd_soc_read(codec, WM8960_CLOCK1) & ~1);
+- snd_soc_write(codec, WM8960_POWER2,
+- snd_soc_read(codec, WM8960_POWER2) & ~1);
++ snd_soc_update_bits(codec, WM8960_CLOCK1, 0x1, 0);
++ snd_soc_update_bits(codec, WM8960_POWER2, 0x1, 0);
+
+ if (!freq_in || !freq_out)
+ return 0;
+@@ -801,18 +793,16 @@ static int wm8960_set_dai_pll(struct snd
+ if (pll_div.k) {
+ reg |= 0x20;
+
+- snd_soc_write(codec, WM8960_PLL2, (pll_div.k >> 18) & 0x3f);
+- snd_soc_write(codec, WM8960_PLL3, (pll_div.k >> 9) & 0x1ff);
+- snd_soc_write(codec, WM8960_PLL4, pll_div.k & 0x1ff);
++ snd_soc_write(codec, WM8960_PLL2, (pll_div.k >> 16) & 0x0ff);
++ snd_soc_write(codec, WM8960_PLL3, (pll_div.k >> 8) & 0x0ff);
++ snd_soc_write(codec, WM8960_PLL4, pll_div.k & 0x0ff);
+ }
+ snd_soc_write(codec, WM8960_PLL1, reg);
+
+ /* Turn it on */
+- snd_soc_write(codec, WM8960_POWER2,
+- snd_soc_read(codec, WM8960_POWER2) | 1);
++ snd_soc_update_bits(codec, WM8960_POWER2, 0x1, 0x1);
+ msleep(250);
+- snd_soc_write(codec, WM8960_CLOCK1,
+- snd_soc_read(codec, WM8960_CLOCK1) | 1);
++ snd_soc_update_bits(codec, WM8960_CLOCK1, 0x1, 0x1);
+
+ return 0;
+ }
+@@ -833,7 +823,7 @@ static int wm8960_set_dai_clkdiv(struct
+ snd_soc_write(codec, WM8960_CLOCK1, reg | div);
+ break;
+ case WM8960_OPCLKDIV:
+- reg = snd_soc_read(codec, WM8960_PLL1) & 0x03f;
++ reg = snd_soc_read(codec, WM8960_PLL1) & 0x1c0;
+ snd_soc_write(codec, WM8960_PLL1, reg | div);
+ break;
+ case WM8960_DCLKDIV:
+@@ -844,6 +834,14 @@ static int wm8960_set_dai_clkdiv(struct
+ reg = snd_soc_read(codec, WM8960_ADDCTL1) & 0x1fd;
+ snd_soc_write(codec, WM8960_ADDCTL1, reg | div);
+ break;
++ case WM8960_ADCDIV:
++ reg = snd_soc_read(codec, WM8960_CLOCK1) & 0x03F;
++ snd_soc_write(codec, WM8960_CLOCK1, reg | div);
++ break;
++ case WM8960_BCLKDIV:
++ reg = snd_soc_read(codec, WM8960_CLOCK2) & 0x1F0;
++ snd_soc_write(codec, WM8960_CLOCK2, reg | div);
++ break;
+ default:
+ return -EINVAL;
+ }
+@@ -865,7 +863,7 @@ static int wm8960_set_bias_level(struct
+ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
+ SNDRV_PCM_FMTBIT_S24_LE)
+
+-static struct snd_soc_dai_ops wm8960_dai_ops = {
++static const struct snd_soc_dai_ops wm8960_dai_ops = {
+ .hw_params = wm8960_hw_params,
+ .digital_mute = wm8960_mute,
+ .set_fmt = wm8960_set_dai_fmt,
+@@ -877,13 +875,13 @@ static struct snd_soc_dai_driver wm8960_
+ .name = "wm8960-hifi",
+ .playback = {
+ .stream_name = "Playback",
+- .channels_min = 1,
++ .channels_min = 2,
+ .channels_max = 2,
+ .rates = WM8960_RATES,
+ .formats = WM8960_FORMATS,},
+ .capture = {
+ .stream_name = "Capture",
+- .channels_min = 1,
++ .channels_min = 2,
+ .channels_max = 2,
+ .rates = WM8960_RATES,
+ .formats = WM8960_FORMATS,},
+@@ -902,16 +900,6 @@ static int wm8960_suspend(struct snd_soc
+ static int wm8960_resume(struct snd_soc_codec *codec)
+ {
+ struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
+- int i;
+- u8 data[2];
+- u16 *cache = codec->reg_cache;
+-
+- /* Sync reg_cache with the hardware */
+- for (i = 0; i < ARRAY_SIZE(wm8960_reg); i++) {
+- data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001);
+- data[1] = cache[i] & 0x00ff;
+- codec->hw_write(codec->control_data, data, 2);
+- }
+
+ wm8960->set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ return 0;
+@@ -922,10 +910,8 @@ static int wm8960_probe(struct snd_soc_c
+ struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
+ struct wm8960_data *pdata = dev_get_platdata(codec->dev);
+ int ret;
+- u16 reg;
+
+ wm8960->set_bias_level = wm8960_set_bias_level_out3;
+- codec->control_data = wm8960->control_data;
+
+ if (!pdata) {
+ dev_warn(codec->dev, "No platform data supplied\n");
+@@ -951,29 +937,27 @@ static int wm8960_probe(struct snd_soc_c
+ return ret;
+ }
+
++ if (pdata && pdata->shared_lrclk) {
++ snd_soc_update_bits(codec, WM8960_ADDCTL2, 0x4, 0x4);
++ }
++
++ if (pdata && pdata->use_alrcgpio) {
++ snd_soc_update_bits(codec, WM8960_IFACE2, 0x40, 0x40);
++ }
++
+ wm8960->set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+ /* Latch the update bits */
+- reg = snd_soc_read(codec, WM8960_LINVOL);
+- snd_soc_write(codec, WM8960_LINVOL, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_RINVOL);
+- snd_soc_write(codec, WM8960_RINVOL, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_LADC);
+- snd_soc_write(codec, WM8960_LADC, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_RADC);
+- snd_soc_write(codec, WM8960_RADC, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_LDAC);
+- snd_soc_write(codec, WM8960_LDAC, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_RDAC);
+- snd_soc_write(codec, WM8960_RDAC, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_LOUT1);
+- snd_soc_write(codec, WM8960_LOUT1, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_ROUT1);
+- snd_soc_write(codec, WM8960_ROUT1, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_LOUT2);
+- snd_soc_write(codec, WM8960_LOUT2, reg | 0x100);
+- reg = snd_soc_read(codec, WM8960_ROUT2);
+- snd_soc_write(codec, WM8960_ROUT2, reg | 0x100);
++ snd_soc_update_bits(codec, WM8960_LINVOL, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_RINVOL, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_LADC, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_RADC, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_LDAC, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_RDAC, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_LOUT1, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_ROUT1, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_LOUT2, 0x100, 0x100);
++ snd_soc_update_bits(codec, WM8960_ROUT2, 0x100, 0x100);
+
+ snd_soc_add_controls(codec, wm8960_snd_controls,
+ ARRAY_SIZE(wm8960_snd_controls));
+@@ -1002,32 +986,29 @@ static struct snd_soc_codec_driver soc_c
+ .reg_cache_default = wm8960_reg,
+ };
+
+-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
+ const struct i2c_device_id *id)
+ {
+ struct wm8960_priv *wm8960;
+ int ret;
+
+- wm8960 = kzalloc(sizeof(struct wm8960_priv), GFP_KERNEL);
++ wm8960 = devm_kzalloc(&i2c->dev, sizeof(struct wm8960_priv),
++ GFP_KERNEL);
+ if (wm8960 == NULL)
+ return -ENOMEM;
+
+ i2c_set_clientdata(i2c, wm8960);
+ wm8960->control_type = SND_SOC_I2C;
+- wm8960->control_data = i2c;
+
+ ret = snd_soc_register_codec(&i2c->dev,
+ &soc_codec_dev_wm8960, &wm8960_dai, 1);
+- if (ret < 0)
+- kfree(wm8960);
++
+ return ret;
+ }
+
+ static __devexit int wm8960_i2c_remove(struct i2c_client *client)
+ {
+ snd_soc_unregister_codec(&client->dev);
+- kfree(i2c_get_clientdata(client));
+ return 0;
+ }
+
+@@ -1039,34 +1020,29 @@ MODULE_DEVICE_TABLE(i2c, wm8960_i2c_id);
+
+ static struct i2c_driver wm8960_i2c_driver = {
+ .driver = {
+- .name = "wm8960-codec",
++ .name = "wm8960",
+ .owner = THIS_MODULE,
+ },
+ .probe = wm8960_i2c_probe,
+ .remove = __devexit_p(wm8960_i2c_remove),
+ .id_table = wm8960_i2c_id,
+ };
+-#endif
+
+ static int __init wm8960_modinit(void)
+ {
+ int ret = 0;
+-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ ret = i2c_add_driver(&wm8960_i2c_driver);
+ if (ret != 0) {
+ printk(KERN_ERR "Failed to register WM8960 I2C driver: %d\n",
+ ret);
+ }
+-#endif
+ return ret;
+ }
+ module_init(wm8960_modinit);
+
+ static void __exit wm8960_exit(void)
+ {
+-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_del_driver(&wm8960_i2c_driver);
+-#endif
+ }
+ module_exit(wm8960_exit);
+
+Index: linux-2.6.38.8/sound/soc/codecs/wm8960.h
+===================================================================
+--- linux-2.6.38.8/sound/soc/codecs/wm8960.h
++++ linux-2.6.38.8/sound/soc/codecs/wm8960.h
+@@ -76,6 +76,8 @@
+ #define WM8960_OPCLKDIV 2
+ #define WM8960_DCLKDIV 3
+ #define WM8960_TOCLKSEL 4
++#define WM8960_ADCDIV 5
++#define WM8960_BCLKDIV 6
+
+ #define WM8960_SYSCLK_DIV_1 (0 << 1)
+ #define WM8960_SYSCLK_DIV_2 (2 << 1)
+@@ -103,11 +105,34 @@
+ #define WM8960_TOCLK_F19 (0 << 1)
+ #define WM8960_TOCLK_F21 (1 << 1)
+
+-#define WM8960_OPCLK_DIV_1 (0 << 0)
+-#define WM8960_OPCLK_DIV_2 (1 << 0)
+-#define WM8960_OPCLK_DIV_3 (2 << 0)
+-#define WM8960_OPCLK_DIV_4 (3 << 0)
+-#define WM8960_OPCLK_DIV_5_5 (4 << 0)
+-#define WM8960_OPCLK_DIV_6 (5 << 0)
++#define WM8960_OPCLK_DIV_1 (0 << 6)
++#define WM8960_OPCLK_DIV_2 (1 << 6)
++#define WM8960_OPCLK_DIV_3 (2 << 6)
++#define WM8960_OPCLK_DIV_4 (3 << 6)
++#define WM8960_OPCLK_DIV_5_5 (4 << 6)
++#define WM8960_OPCLK_DIV_6 (5 << 6)
++
++#define WM8960_ADC_DIV_1 (0 << 6)
++#define WM8960_ADC_DIV_1_5 (1 << 6)
++#define WM8960_ADC_DIV_2 (2 << 6)
++#define WM8960_ADC_DIV_3 (3 << 6)
++#define WM8960_ADC_DIV_4 (4 << 6)
++#define WM8960_ADC_DIV_5_5 (5 << 6)
++#define WM8960_ADC_DIV_6 (6 << 6)
++
++#define WM8960_BCLK_DIV_1 (0 << 0)
++#define WM8960_BCLK_DIV_1_5 (1 << 0)
++#define WM8960_BCLK_DIV_2 (2 << 0)
++#define WM8960_BCLK_DIV_3 (3 << 0)
++#define WM8960_BCLK_DIV_4 (4 << 0)
++#define WM8960_BCLK_DIV_5_5 (5 << 0)
++#define WM8960_BCLK_DIV_6 (6 << 0)
++#define WM8960_BCLK_DIV_8 (7 << 0)
++#define WM8960_BCLK_DIV_11 (8 << 0)
++#define WM8960_BCLK_DIV_12 (9 << 0)
++#define WM8960_BCLK_DIV_16 (10 << 0)
++#define WM8960_BCLK_DIV_22 (11 << 0)
++#define WM8960_BCLK_DIV_24 (12 << 0)
++#define WM8960_BCLK_DIV_32 (13 << 0)
+
+ #endif
+
diff --git a/patches/linux/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch b/patches/linux/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch
deleted file mode 100644
index 820b984..0000000
--- a/patches/linux/2.6.38/430-armadeus-asoc-wm8960-change_channels_min_to_2.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Otherwise sound is played two times too fast.
-Clean ?
-
-Signed-off-by: Julien Boibessot <jul...@ar...<
-
-Index: linux-2.6.38.1/sound/soc/codecs/wm8960.c
-===================================================================
---- linux-2.6.38.1.orig/sound/soc/codecs/wm8960.c 2011-04-13 14:50:58.000000000 +0200
-+++ linux-2.6.38.1/sound/soc/codecs/wm8960.c 2011-04-13 15:09:57.000000000 +0200
-@@ -882,13 +882,13 @@
- .name = "wm8960-hifi",
- .playback = {
- .stream_name = "Playback",
-- .channels_min = 1,
-+ .channels_min = 2,
- .channels_max = 2,
- .rates = WM8960_RATES,
- .formats = WM8960_FORMATS,},
- .capture = {
- .stream_name = "Capture",
-- .channels_min = 1,
-+ .channels_min = 2,
- .channels_max = 2,
- .rates = WM8960_RATES,
- .formats = WM8960_FORMATS,},
hooks/post-receive
--
armadeus
|