1 From 1796e3d226fd1b119b09130478c781e25b7f5770 Mon Sep 17 00:00:00 2001
2 From: Tim Niemeyer <reddog@mastersword.de>
3 Date: Mon, 21 Apr 2008 21:09:37 +0100
4 Subject: [PATCH] This-adds-some-debug-messages-to-the-Neo1937-sound-d.patch
5 Subject: [PATCH] This adds some debug messages to the Neo1937 sound driver.
7 Signed-off-by: Tim Niemeyer <reddog@mastersword.de>
9 sound/soc/s3c24xx/Kconfig | 6 ++++
10 sound/soc/s3c24xx/neo1973_wm8753.c | 51 ++++++++++++++++++++++++++++++++++++
11 sound/soc/s3c24xx/s3c24xx-i2s.c | 4 ++-
12 sound/soc/s3c24xx/s3c24xx-pcm.c | 2 +-
13 4 files changed, 61 insertions(+), 2 deletions(-)
15 diff --git a/sound/soc/s3c24xx/Kconfig b/sound/soc/s3c24xx/Kconfig
16 index 4146ac4..17caf67 100644
17 --- a/sound/soc/s3c24xx/Kconfig
18 +++ b/sound/soc/s3c24xx/Kconfig
19 @@ -25,6 +25,12 @@ config SND_S3C24XX_SOC_NEO1973_WM8753
20 Say Y if you want to add support for SoC audio on smdk2440
23 +config SND_S3C24XX_SOC_NEO1973_WM8753_DEBUG
24 + bool "SoC I2S Audio support for NEO1973 - WM8753 debug"
25 + depends on SND_S3C24XX_SOC_NEO1973_WM8753
27 + Enable debugging output for the SoC I2S Audio code.
29 config SND_S3C24XX_SOC_NEO1973_GTA02_WM8753
30 tristate "SoC I2S Audio support for NEO1973 GTA02 - WM8753"
31 depends on SND_S3C24XX_SOC && MACH_NEO1973_GTA02
32 diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
33 index 09641cc..d7e031b 100644
34 --- a/sound/soc/s3c24xx/neo1973_wm8753.c
35 +++ b/sound/soc/s3c24xx/neo1973_wm8753.c
37 #include "s3c24xx-pcm.h"
38 #include "s3c24xx-i2s.h"
40 +/* Debugging stuff */
41 +#ifdef SND_S3C24XX_SOC_NEO1973_WM8753_DEBUG
42 +static int debug = 1;
44 +static int debug = 0;
47 +#define dprintk(msg...) if (debug) { printk(KERN_DEBUG "wm8753: " msg); }
49 /* define the scenarios */
50 #define NEO_AUDIO_OFF 0
51 #define NEO_GSM_CALL_AUDIO_HANDSET 1
52 @@ -68,6 +77,8 @@ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
54 unsigned long iis_clkrate;
56 + dprintk("Entered %s\n", __FUNCTION__);
58 iis_clkrate = s3c24xx_i2s_get_clockrate();
60 switch (params_rate(params)) {
61 @@ -152,6 +163,8 @@ static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
62 struct snd_soc_pcm_runtime *rtd = substream->private_data;
63 struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
65 + dprintk("Entered %s\n", __FUNCTION__);
68 return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL1, 0, 0);
70 @@ -173,6 +186,8 @@ static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
72 unsigned long iis_clkrate;
74 + dprintk("Entered %s\n", __FUNCTION__);
76 iis_clkrate = s3c24xx_i2s_get_clockrate();
78 if (params_rate(params) != 8000)
79 @@ -214,6 +229,8 @@ static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
80 struct snd_soc_pcm_runtime *rtd = substream->private_data;
81 struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai;
83 + dprintk("Entered %s\n", __FUNCTION__);
86 return codec_dai->dai_ops.set_pll(codec_dai, WM8753_PLL2, 0, 0);
88 @@ -228,12 +245,16 @@ static int neo1973_scenario = 0;
89 static int neo1973_get_scenario(struct snd_kcontrol *kcontrol,
90 struct snd_ctl_elem_value *ucontrol)
92 + dprintk("Entered %s\n", __FUNCTION__);
94 ucontrol->value.integer.value[0] = neo1973_scenario;
98 static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario)
100 + dprintk("Entered %s\n", __FUNCTION__);
102 switch(neo1973_scenario) {
104 snd_soc_dapm_set_endpoint(codec, "Audio Out", 0);
105 @@ -316,6 +337,8 @@ static int neo1973_set_scenario(struct snd_kcontrol *kcontrol,
107 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
109 + dprintk("Entered %s\n", __FUNCTION__);
111 if (neo1973_scenario == ucontrol->value.integer.value[0])
114 @@ -328,6 +351,8 @@ static u8 lm4857_regs[4] = {0x00, 0x40, 0x80, 0xC0};
116 static void lm4857_write_regs(void)
118 + dprintk("Entered %s\n", __FUNCTION__);
120 if (i2c_master_send(i2c, lm4857_regs, 4) != 4)
121 printk(KERN_ERR "lm4857: i2c write failed\n");
123 @@ -339,6 +364,8 @@ static int lm4857_get_reg(struct snd_kcontrol *kcontrol,
124 int shift = (kcontrol->private_value >> 8) & 0x0F;
125 int mask = (kcontrol->private_value >> 16) & 0xFF;
127 + dprintk("Entered %s\n", __FUNCTION__);
129 ucontrol->value.integer.value[0] = (lm4857_regs[reg] >> shift) & mask;
132 @@ -350,6 +377,8 @@ static int lm4857_set_reg(struct snd_kcontrol *kcontrol,
133 int shift = (kcontrol->private_value >> 8) & 0x0F;
134 int mask = (kcontrol->private_value >> 16) & 0xFF;
136 + dprintk("Entered %s\n", __FUNCTION__);
138 if (((lm4857_regs[reg] >> shift ) & mask) ==
139 ucontrol->value.integer.value[0])
141 @@ -365,6 +394,8 @@ static int lm4857_get_mode(struct snd_kcontrol *kcontrol,
143 u8 value = lm4857_regs[LM4857_CTRL] & 0x0F;
145 + dprintk("Entered %s\n", __FUNCTION__);
150 @@ -377,6 +408,8 @@ static int lm4857_set_mode(struct snd_kcontrol *kcontrol,
152 u8 value = ucontrol->value.integer.value[0];
154 + dprintk("Entered %s\n", __FUNCTION__);
159 @@ -484,6 +517,8 @@ static int neo1973_wm8753_init(struct snd_soc_codec *codec)
163 + dprintk("Entered %s\n", __FUNCTION__);
165 /* set up NC codec pins */
166 snd_soc_dapm_set_endpoint(codec, "LOUT2", 0);
167 snd_soc_dapm_set_endpoint(codec, "ROUT2", 0);
168 @@ -584,6 +619,8 @@ static int lm4857_amp_probe(struct i2c_adapter *adap, int addr, int kind)
172 + dprintk("Entered %s\n", __FUNCTION__);
174 client_template.adapter = adap;
175 client_template.addr = addr;
177 @@ -607,6 +644,8 @@ exit_err:
179 static int lm4857_i2c_detach(struct i2c_client *client)
181 + dprintk("Entered %s\n", __FUNCTION__);
183 i2c_detach_client(client);
186 @@ -614,6 +653,8 @@ static int lm4857_i2c_detach(struct i2c_client *client)
188 static int lm4857_i2c_attach(struct i2c_adapter *adap)
190 + dprintk("Entered %s\n", __FUNCTION__);
192 return i2c_probe(adap, &addr_data, lm4857_amp_probe);
195 @@ -621,6 +662,8 @@ static u8 lm4857_state;
197 static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
199 + dprintk("Entered %s\n", __FUNCTION__);
201 dev_dbg(&dev->dev, "lm4857_suspend\n");
202 lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf;
204 @@ -632,6 +675,8 @@ static int lm4857_suspend(struct i2c_client *dev, pm_message_t state)
206 static int lm4857_resume(struct i2c_client *dev)
208 + dprintk("Entered %s\n", __FUNCTION__);
211 lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f);
213 @@ -641,6 +686,8 @@ static int lm4857_resume(struct i2c_client *dev)
215 static void lm4857_shutdown(struct i2c_client *dev)
217 + dprintk("Entered %s\n", __FUNCTION__);
219 dev_dbg(&dev->dev, "lm4857_shutdown\n");
220 lm4857_regs[LM4857_CTRL] &= 0xf0;
222 @@ -672,6 +719,8 @@ static int __init neo1973_init(void)
226 + dprintk("Entered %s\n", __FUNCTION__);
228 if (!machine_is_neo1973_gta01()) {
230 "Only GTA01 hardware supported by ASoc driver\n");
231 @@ -698,6 +747,8 @@ static int __init neo1973_init(void)
233 static void __exit neo1973_exit(void)
235 + dprintk("Entered %s\n", __FUNCTION__);
237 i2c_del_driver(&lm4857_i2c_driver);
238 platform_device_unregister(neo1973_snd_device);
240 diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
241 index 43fd25a..7b6cca7 100644
242 --- a/sound/soc/s3c24xx/s3c24xx-i2s.c
243 +++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
246 #define S3C24XX_I2S_DEBUG 0
247 #if S3C24XX_I2S_DEBUG
248 -#define DBG(x...) printk(KERN_DEBUG x)
249 +#define DBG(x...) printk(KERN_DEBUG "s3c24xx-i2s: " x)
253 @@ -415,6 +415,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev)
254 int s3c24xx_i2s_suspend(struct platform_device *pdev,
255 struct snd_soc_cpu_dai *cpu_dai)
257 + DBG("Entered %s\n", __FUNCTION__);
258 s3c24xx_i2s.iiscon = readl(s3c24xx_i2s.regs + S3C2410_IISCON);
259 s3c24xx_i2s.iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
260 s3c24xx_i2s.iisfcon = readl(s3c24xx_i2s.regs + S3C2410_IISFCON);
261 @@ -428,6 +429,7 @@ int s3c24xx_i2s_suspend(struct platform_device *pdev,
262 int s3c24xx_i2s_resume(struct platform_device *pdev,
263 struct snd_soc_cpu_dai *cpu_dai)
265 + DBG("Entered %s\n", __FUNCTION__);
266 clk_enable(s3c24xx_i2s.iis_clk);
268 writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
269 diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
270 index e9f3b60..57b0c74 100644
271 --- a/sound/soc/s3c24xx/s3c24xx-pcm.c
272 +++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
275 #define S3C24XX_PCM_DEBUG 0
276 #if S3C24XX_PCM_DEBUG
277 -#define DBG(x...) printk(KERN_DEBUG x)
278 +#define DBG(x...) printk(KERN_DEBUG "s3c24xx-pcm: " x)