summaryrefslogtreecommitdiff
path: root/target/linux/s3c24xx/patches-2.6.24/1137-This-adds-some-debug-messages-to-the-Neo1937-sound-d.patch
blob: 04f03fc738760ba5611abbef13b943ceacdaed79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
From 1796e3d226fd1b119b09130478c781e25b7f5770 Mon Sep 17 00:00:00 2001
From: Tim Niemeyer <reddog@mastersword.de>
Date: Mon, 21 Apr 2008 21:09:37 +0100
Subject: [PATCH] This-adds-some-debug-messages-to-the-Neo1937-sound-d.patch
 Subject: [PATCH] This adds some debug messages to the Neo1937 sound driver.

Signed-off-by: Tim Niemeyer <reddog@mastersword.de>
---
 sound/soc/s3c24xx/Kconfig          |    6 ++++
 sound/soc/s3c24xx/neo1973_wm8753.c |   51 ++++++++++++++++++++++++++++++++++++
 sound/soc/s3c24xx/s3c24xx-i2s.c    |    4 ++-
 sound/soc/s3c24xx/s3c24xx-pcm.c    |    2 +-
 4 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
index 4146ac4..17caf67 100644
--- a/sound/soc/s3c24xx/Kconfig
+++ b/sound/soc/s3c24xx/Kconfig
@@ -25,6 +25,12 @@ config SND_S3C24XX_SOC_NEO1973_WM8753
 	  Say Y if you want to add support for SoC audio on smdk2440
 	  with the WM8753.
 
+config SND_S3C24XX_SOC_NEO1973_WM8753_DEBUG
+	bool "SoC I2S Audio support for NEO1973 - WM8753 debug"
+	depends on SND_S3C24XX_SOC_NEO1973_WM8753
+	help
+	  Enable debugging output for the SoC I2S Audio code.
+
 config SND_S3C24XX_SOC_NEO1973_GTA02_WM8753
 	tristate "SoC I2S Audio support for NEO1973 GTA02 - WM8753"
 	depends on SND_S3C24XX_SOC && MACH_NEO1973_GTA02
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 09641cc..d7e031b 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -44,6 +44,15 @@
 #include "s3c24xx-pcm.h"
 #include "s3c24xx-i2s.h"
 
+/* Debugging stuff */
+#ifdef SND_S3C24XX_SOC_NEO1973_WM8753_DEBUG
+static int debug        = 1;
+#else
+static int debug        = 0;
+#endif
+
+#define dprintk(msg...) if (debug) { printk(KERN_DEBUG "wm8753: " msg); }
+
 /* define the scenarios */
 #define NEO_AUDIO_OFF			0
 #define NEO_GSM_CALL_AUDIO_HANDSET	1
@@ -68,6 +77,8 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
 	int ret = 0;
 	unsigned long iis_clkrate;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	iis_clkrate = s3c24xx_i2s_get_clockrate();
 
 	switch (params_rate(params)) {
@@ -152,6 +163,8 @@ static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	/* disable the PLL */
 	return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, 0, 0);
 }
@@ -173,6 +186,8 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
 	int ret = 0;
 	unsigned long iis_clkrate;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	iis_clkrate = s3c24xx_i2s_get_clockrate();
 
 	if (params_rate(params) != 8000)
@@ -214,6 +229,8 @@ static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	/* disable the PLL */
 	return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, 0, 0);
 }
@@ -228,12 +245,16 @@ static int neo1973_scenario = 0;
 static int neo1973_get_scenario(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	ucontrol->value.integer.value[0] = neo1973_scenario;
 	return 0;
 }
 
 static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	switch(neo1973_scenario) {
 	case NEO_AUDIO_OFF:
 		snd_soc_dapm_set_endpoint(codec, "Audio Out",    0);
@@ -316,6 +337,8 @@ static int neo1973_set_scenario(struct snd_kcontrol *kcontrol,
 {
 	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (neo1973_scenario == ucontrol->value.integer.value[0])
 		return 0;
 
@@ -328,6 +351,8 @@ static u8 lm4857_regs[4] = {0x00, 0x40, 0x80, 0xC0};
 
 static void lm4857_write_regs(void)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (i2c_master_send(i2c, lm4857_regs, 4) != 4)
 		printk(KERN_ERR "lm4857: i2c write failed\n");
 }
@@ -339,6 +364,8 @@ static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
 	int shift = (kcontrol->private_value >> 8) & 0x0F;
 	int mask = (kcontrol->private_value >> 16) & 0xFF;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	ucontrol->value.integer.value[0] = (lm4857_regs[reg] >> shift) & mask;
 	return 0;
 }
@@ -350,6 +377,8 @@ static int lm4857_set_reg(struct snd_kcontrol *kcontrol,
 	int shift = (kcontrol->private_value >> 8) & 0x0F;
 	int mask = (kcontrol->private_value >> 16) & 0xFF;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (((lm4857_regs[reg] >> shift ) & mask) ==
 		ucontrol->value.integer.value[0])
 		return 0;
@@ -365,6 +394,8 @@ static int lm4857_get_mode(struct snd_kcontrol *kcontrol,
 {
 	u8 value = lm4857_regs[LM4857_CTRL] & 0x0F;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (value)
 		value -= 5;
 
@@ -377,6 +408,8 @@ static int lm4857_set_mode(struct snd_kcontrol *kcontrol,
 {
 	u8 value = ucontrol->value.integer.value[0];
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (value)
 		value += 5;
 
@@ -484,6 +517,8 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
 {
 	int i, err;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	/* set up NC codec pins */
 	snd_soc_dapm_set_endpoint(codec, "LOUT2", 0);
 	snd_soc_dapm_set_endpoint(codec, "ROUT2", 0);
@@ -584,6 +619,8 @@ static int lm4857_amp_probe(struct i2c_adapter *adap, int addr, int kind)
 {
 	int ret;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	client_template.adapter = adap;
 	client_template.addr = addr;
 
@@ -607,6 +644,8 @@ exit_err:
 
 static int lm4857_i2c_detach(struct i2c_client *client)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	i2c_detach_client(client);
 	kfree(client);
 	return 0;
@@ -614,6 +653,8 @@ static int lm4857_i2c_detach(struct i2c_client *client)
 
 static int lm4857_i2c_attach(struct i2c_adapter *adap)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	return i2c_probe(adap, &addr_data, lm4857_amp_probe);
 }
 
@@ -621,6 +662,8 @@ static u8 lm4857_state;
 
 static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	dev_dbg(&dev->dev, "lm4857_suspend\n");
 	lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf;
 	if (lm4857_state) {
@@ -632,6 +675,8 @@ static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
 
 static int lm4857_resume(struct i2c_client *dev)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (lm4857_state) {
 		lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f);
 		lm4857_write_regs();
@@ -641,6 +686,8 @@ static int lm4857_resume(struct i2c_client *dev)
 
 static void lm4857_shutdown(struct i2c_client *dev)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	dev_dbg(&dev->dev, "lm4857_shutdown\n");
 	lm4857_regs[LM4857_CTRL] &= 0xf0;
 	lm4857_write_regs();
@@ -672,6 +719,8 @@ static int __init neo1973_init(void)
 {
 	int ret;
 
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	if (!machine_is_neo1973_gta01()) {
 		printk(KERN_INFO
 		       "Only GTA01 hardware supported by ASoc driver\n");
@@ -698,6 +747,8 @@ static int __init neo1973_init(void)
 
 static void __exit neo1973_exit(void)
 {
+	dprintk("Entered %s\n", __FUNCTION__);
+
 	i2c_del_driver(&lm4857_i2c_driver);
 	platform_device_unregister(neo1973_snd_device);
 }
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index 43fd25a..7b6cca7 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -46,7 +46,7 @@
 
 #define S3C24XX_I2S_DEBUG 0
 #if S3C24XX_I2S_DEBUG
-#define DBG(x...) printk(KERN_DEBUG x)
+#define DBG(x...) printk(KERN_DEBUG "s3c24xx-i2s: " x)
 #else
 #define DBG(x...)
 #endif
@@ -415,6 +415,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev)
 int s3c24xx_i2s_suspend(struct platform_device *pdev,
                 struct snd_soc_cpu_dai *cpu_dai)
 {
+	DBG("Entered %s\n", __FUNCTION__);
 	s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
 	s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
 	s3c24xx_i2s.iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
@@ -428,6 +429,7 @@ int s3c24xx_i2s_suspend(struct platform_device *pdev,
 int s3c24xx_i2s_resume(struct platform_device *pdev,
                 struct snd_soc_cpu_dai *cpu_dai)
 {
+	DBG("Entered %s\n", __FUNCTION__);
 	clk_enable(s3c24xx_i2s.iis_clk);
 
         writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index e9f3b60..57b0c74 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -40,7 +40,7 @@
 
 #define S3C24XX_PCM_DEBUG 0
 #if S3C24XX_PCM_DEBUG
-#define DBG(x...) printk(KERN_DEBUG x)
+#define DBG(x...) printk(KERN_DEBUG "s3c24xx-pcm: " x)
 #else
 #define DBG(x...)
 #endif
-- 
1.5.6.5