alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module
@ 2011-02-23  0:23 Stephen Warren
  2011-02-23  0:23 ` [PATCH 2/2] ASoC: WM8903: Fix double-applied patch Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stephen Warren @ 2011-02-23  0:23 UTC (permalink / raw)
  To: broonie, lrg; +Cc: alsa-devel, Stephen Warren

The utilities will be required by every machine driver. Including the
utility object directly into every machine driver causes a build failure
if the modules are actually built into the kernel, since each will define
the symbols exported by the utility file. Solve this by moving the
utility object into a separate module.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/tegra/Makefile           |    3 ++-
 sound/soc/tegra/tegra_asoc_utils.c |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/sound/soc/tegra/Makefile b/sound/soc/tegra/Makefile
index dfd2ab9..fd183d3 100644
--- a/sound/soc/tegra/Makefile
+++ b/sound/soc/tegra/Makefile
@@ -2,13 +2,14 @@
 snd-soc-tegra-das-objs := tegra_das.o
 snd-soc-tegra-pcm-objs := tegra_pcm.o
 snd-soc-tegra-i2s-objs := tegra_i2s.o
+snd-soc-tegra-utils-objs += tegra_asoc_utils.o
 
+obj-$(CONFIG_SND_TEGRA_SOC) += snd-soc-tegra-utils.o
 obj-$(CONFIG_SND_TEGRA_SOC) += snd-soc-tegra-das.o
 obj-$(CONFIG_SND_TEGRA_SOC) += snd-soc-tegra-pcm.o
 obj-$(CONFIG_SND_TEGRA_SOC_I2S) += snd-soc-tegra-i2s.o
 
 # Tegra machine Support
 snd-soc-tegra-harmony-objs := harmony.o
-snd-soc-tegra-harmony-objs += tegra_asoc_utils.o
 
 obj-$(CONFIG_SND_TEGRA_SOC_HARMONY) += snd-soc-tegra-harmony.o
diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c
index cb4fc13..52f0a3f 100644
--- a/sound/soc/tegra/tegra_asoc_utils.c
+++ b/sound/soc/tegra/tegra_asoc_utils.c
@@ -101,6 +101,7 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(tegra_asoc_utils_set_rate);
 
 int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
 			  struct device *dev)
@@ -139,6 +140,7 @@ err_put_pll_a:
 err:
 	return ret;
 }
+EXPORT_SYMBOL_GPL(tegra_asoc_utils_init);
 
 void tegra_asoc_utils_fini(struct tegra_asoc_utils_data *data)
 {
@@ -146,4 +148,8 @@ void tegra_asoc_utils_fini(struct tegra_asoc_utils_data *data)
 	clk_put(data->clk_pll_a_out0);
 	clk_put(data->clk_pll_a);
 }
+EXPORT_SYMBOL_GPL(tegra_asoc_utils_fini);
 
+MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>");
+MODULE_DESCRIPTION("Tegra ASoC utility code");
+MODULE_LICENSE("GPL");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ASoC: WM8903: Fix double-applied patch
  2011-02-23  0:23 [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Stephen Warren
@ 2011-02-23  0:23 ` Stephen Warren
  2011-02-23  0:43   ` Stephen Warren
  2011-02-23 21:15 ` [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Liam Girdwood
  2011-02-25 11:52 ` Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2011-02-23  0:23 UTC (permalink / raw)
  To: broonie, lrg; +Cc: alsa-devel, Stephen Warren

A patch named "ASoC: Actively manage WM8903 DC servo configuration" was
applied twice, with commit IDs:

1605b831ae71a4008671e43113e1151a669ed0bf
c5b6a9feaeb0fa0e39e3fc10f9bf8cc8de498739

Remove the duplicate code caused by this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/codecs/wm8903.c |   97 ---------------------------------------------
 1 files changed, 0 insertions(+), 97 deletions(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 7ca2593..ae1cadf 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -373,103 +373,6 @@ static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
 	}
 }
 
-static int wm8903_dcs_event(struct snd_soc_dapm_widget *w,
-			    struct snd_kcontrol *kcontrol, int event)
-{
-	struct snd_soc_codec *codec = w->codec;
-	struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
-
-	switch (event) {
-	case SND_SOC_DAPM_POST_PMU:
-		wm8903->dcs_pending |= 1 << w->shift;
-		break;
-	case SND_SOC_DAPM_PRE_PMD:
-		snd_soc_update_bits(codec, WM8903_DC_SERVO_0,
-				    1 << w->shift, 0);
-		break;
-	}
-
-	return 0;
-}
-
-#define WM8903_DCS_MODE_WRITE_STOP 0
-#define WM8903_DCS_MODE_START_STOP 2
-
-static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
-				enum snd_soc_dapm_type event, int subseq)
-{
-	struct snd_soc_codec *codec = container_of(dapm,
-						   struct snd_soc_codec, dapm);
-	struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
-	int dcs_mode = WM8903_DCS_MODE_WRITE_STOP;
-	int i, val;
-
-	/* Complete any pending DC servo starts */
-	if (wm8903->dcs_pending) {
-		dev_dbg(codec->dev, "Starting DC servo for %x\n",
-			wm8903->dcs_pending);
-
-		/* If we've no cached values then we need to do startup */
-		for (i = 0; i < ARRAY_SIZE(wm8903->dcs_cache); i++) {
-			if (!(wm8903->dcs_pending & (1 << i)))
-				continue;
-
-			if (wm8903->dcs_cache[i]) {
-				dev_dbg(codec->dev,
-					"Restore DC servo %d value %x\n",
-					3 - i, wm8903->dcs_cache[i]);
-
-				snd_soc_write(codec, WM8903_DC_SERVO_4 + i,
-					      wm8903->dcs_cache[i] & 0xff);
-			} else {
-				dev_dbg(codec->dev,
-					"Calibrate DC servo %d\n", 3 - i);
-				dcs_mode = WM8903_DCS_MODE_START_STOP;
-			}
-		}
-
-		/* Don't trust the cache for analogue */
-		if (wm8903->class_w_users)
-			dcs_mode = WM8903_DCS_MODE_START_STOP;
-
-		snd_soc_update_bits(codec, WM8903_DC_SERVO_2,
-				    WM8903_DCS_MODE_MASK, dcs_mode);
-
-		snd_soc_update_bits(codec, WM8903_DC_SERVO_0,
-				    WM8903_DCS_ENA_MASK, wm8903->dcs_pending);
-
-		switch (dcs_mode) {
-		case WM8903_DCS_MODE_WRITE_STOP:
-			break;
-
-		case WM8903_DCS_MODE_START_STOP:
-			msleep(270);
-
-			/* Cache the measured offsets for digital */
-			if (wm8903->class_w_users)
-				break;
-
-			for (i = 0; i < ARRAY_SIZE(wm8903->dcs_cache); i++) {
-				if (!(wm8903->dcs_pending & (1 << i)))
-					continue;
-
-				val = snd_soc_read(codec,
-						   WM8903_DC_SERVO_READBACK_1 + i);
-				dev_dbg(codec->dev, "DC servo %d: %x\n",
-					3 - i, val);
-				wm8903->dcs_cache[i] = val;
-			}
-			break;
-
-		default:
-			pr_warn("DCS mode %d delay not set\n", dcs_mode);
-			break;
-		}
-
-		wm8903->dcs_pending = 0;
-	}
-}
-
 /*
  * When used with DAC outputs only the WM8903 charge pump supports
  * operation in class W mode, providing very low power consumption
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] ASoC: WM8903: Fix double-applied patch
  2011-02-23  0:23 ` [PATCH 2/2] ASoC: WM8903: Fix double-applied patch Stephen Warren
@ 2011-02-23  0:43   ` Stephen Warren
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2011-02-23  0:43 UTC (permalink / raw)
  To: Stephen Warren, broonie@opensource.wolfsonmicro.com,
	lrg@slimlogic.co.uk
  Cc: alsa-devel@alsa-project.org

Stephen Warren wrote at Tuesday, February 22, 2011 5:24 PM:
> A patch named "ASoC: Actively manage WM8903 DC servo configuration" was
> applied twice, with commit IDs:
> 
> 1605b831ae71a4008671e43113e1151a669ed0bf
> c5b6a9feaeb0fa0e39e3fc10f9bf8cc8de498739
> 
> Remove the duplicate code caused by this.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Sorry, this is bogus; somehow I applied this patch locally to my
tree; the duplicate is not in the ASoC tree at all, and hence this
patch is not required to fix any problem.

-- 
nvpublic

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module
  2011-02-23  0:23 [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Stephen Warren
  2011-02-23  0:23 ` [PATCH 2/2] ASoC: WM8903: Fix double-applied patch Stephen Warren
@ 2011-02-23 21:15 ` Liam Girdwood
  2011-02-25 11:52 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-02-23 21:15 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, broonie

On Tue, 2011-02-22 at 17:23 -0700, Stephen Warren wrote:
> The utilities will be required by every machine driver. Including the
> utility object directly into every machine driver causes a build failure
> if the modules are actually built into the kernel, since each will define
> the symbols exported by the utility file. Solve this by moving the
> utility object into a separate module.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module
  2011-02-23  0:23 [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Stephen Warren
  2011-02-23  0:23 ` [PATCH 2/2] ASoC: WM8903: Fix double-applied patch Stephen Warren
  2011-02-23 21:15 ` [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Liam Girdwood
@ 2011-02-25 11:52 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-02-25 11:52 UTC (permalink / raw)
  To: Stephen Warren; +Cc: alsa-devel, lrg

On Tue, Feb 22, 2011 at 05:23:56PM -0700, Stephen Warren wrote:
> The utilities will be required by every machine driver. Including the
> utility object directly into every machine driver causes a build failure
> if the modules are actually built into the kernel, since each will define
> the symbols exported by the utility file. Solve this by moving the
> utility object into a separate module.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-25 11:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23  0:23 [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Stephen Warren
2011-02-23  0:23 ` [PATCH 2/2] ASoC: WM8903: Fix double-applied patch Stephen Warren
2011-02-23  0:43   ` Stephen Warren
2011-02-23 21:15 ` [PATCH 1/2] CHROMIUM: ASoC: Tegra: Move utilities to separate module Liam Girdwood
2011-02-25 11:52 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).