All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros
@ 2010-09-23 18:41 Mark Brown
  2010-09-23 18:41 ` [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mark Brown @ 2010-09-23 18:41 UTC (permalink / raw)
  To: Liam Girdwood, Jassi Brar; +Cc: alsa-devel, patches, Mark Brown

Could use dev_() but we'd have to remember the struct device somewhere
and it wouldn't make the logging clearer.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/s3c24xx/s3c-ac97.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/s3c24xx/s3c-ac97.c b/sound/soc/s3c24xx/s3c-ac97.c
index 26f4ed9..31e2b3d 100644
--- a/sound/soc/s3c24xx/s3c-ac97.c
+++ b/sound/soc/s3c24xx/s3c-ac97.c
@@ -89,7 +89,7 @@ static void s3c_ac97_activate(struct snd_ac97 *ac97)
 	writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
 
 	if (!wait_for_completion_timeout(&s3c_ac97.done, HZ))
-		printk(KERN_ERR "AC97: Unable to activate!");
+		pr_err("AC97: Unable to activate!");
 }
 
 static unsigned short s3c_ac97_read(struct snd_ac97 *ac97,
@@ -115,14 +115,15 @@ static unsigned short s3c_ac97_read(struct snd_ac97 *ac97,
 	writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
 
 	if (!wait_for_completion_timeout(&s3c_ac97.done, HZ))
-		printk(KERN_ERR "AC97: Unable to read!");
+		pr_err("AC97: Unable to read!");
 
 	stat = readl(s3c_ac97.regs + S3C_AC97_STAT);
 	addr = (stat >> 16) & 0x7f;
 	data = (stat & 0xffff);
 
 	if (addr != reg)
-		printk(KERN_ERR "s3c-ac97: req addr = %02x, rep addr = %02x\n", reg, addr);
+		pr_err("s3c-ac97: req addr = %02x, rep addr = %02x\n",
+			reg, addr);
 
 	mutex_unlock(&s3c_ac97.lock);
 
@@ -151,7 +152,7 @@ static void s3c_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
 	writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
 
 	if (!wait_for_completion_timeout(&s3c_ac97.done, HZ))
-		printk(KERN_ERR "AC97: Unable to write!");
+		pr_err("AC97: Unable to write!");
 
 	ac_codec_cmd = readl(s3c_ac97.regs + S3C_AC97_CODEC_CMD);
 	ac_codec_cmd |= S3C_AC97_CODEC_CMD_READ;
@@ -442,7 +443,7 @@ static __devinit int s3c_ac97_probe(struct platform_device *pdev)
 	ret = request_irq(irq_res->start, s3c_ac97_irq,
 					IRQF_DISABLED, "AC97", NULL);
 	if (ret < 0) {
-		printk(KERN_ERR "s3c-ac97: interrupt request failed.\n");
+		dev_err(&pdev->dev, "s3c-ac97: interrupt request failed.\n");
 		goto err4;
 	}
 
-- 
1.7.1

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

* [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets
  2010-09-23 18:41 [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Mark Brown
@ 2010-09-23 18:41 ` Mark Brown
  2010-09-23 23:00   ` Jassi Brar
  2010-09-23 22:59 ` [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Jassi Brar
  2010-09-24  9:32 ` Liam Girdwood
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-09-23 18:41 UTC (permalink / raw)
  To: Liam Girdwood, Jassi Brar; +Cc: alsa-devel, patches, Mark Brown

Helps tracing errors further up the stack.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/s3c24xx/s3c-ac97.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/soc/s3c24xx/s3c-ac97.c b/sound/soc/s3c24xx/s3c-ac97.c
index 31e2b3d..f891eb7 100644
--- a/sound/soc/s3c24xx/s3c-ac97.c
+++ b/sound/soc/s3c24xx/s3c-ac97.c
@@ -163,6 +163,7 @@ static void s3c_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
 
 static void s3c_ac97_cold_reset(struct snd_ac97 *ac97)
 {
+	pr_debug("AC97: Cold reset\n");
 	writel(S3C_AC97_GLBCTRL_COLDRESET,
 			s3c_ac97.regs + S3C_AC97_GLBCTRL);
 	msleep(1);
@@ -179,6 +180,8 @@ static void s3c_ac97_warm_reset(struct snd_ac97 *ac97)
 	if (stat == S3C_AC97_GLBSTAT_MAINSTATE_ACTIVE)
 		return; /* Return if already active */
 
+	pr_debug("AC97: Warm reset\n");
+
 	writel(S3C_AC97_GLBCTRL_WARMRESET, s3c_ac97.regs + S3C_AC97_GLBCTRL);
 	msleep(1);
 
-- 
1.7.1

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

* Re: [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros
  2010-09-23 18:41 [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Mark Brown
  2010-09-23 18:41 ` [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets Mark Brown
@ 2010-09-23 22:59 ` Jassi Brar
  2010-09-24  9:32 ` Liam Girdwood
  2 siblings, 0 replies; 5+ messages in thread
From: Jassi Brar @ 2010-09-23 22:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, patches, Jassi Brar, Liam Girdwood

On Fri, Sep 24, 2010 at 3:41 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> Could use dev_() but we'd have to remember the struct device somewhere
> and it wouldn't make the logging clearer.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/s3c24xx/s3c-ac97.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/sound/soc/s3c24xx/s3c-ac97.c b/sound/soc/s3c24xx/s3c-ac97.c
> index 26f4ed9..31e2b3d 100644
> --- a/sound/soc/s3c24xx/s3c-ac97.c
> +++ b/sound/soc/s3c24xx/s3c-ac97.c
> @@ -89,7 +89,7 @@ static void s3c_ac97_activate(struct snd_ac97 *ac97)
>        writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
>
>        if (!wait_for_completion_timeout(&s3c_ac97.done, HZ))
> -               printk(KERN_ERR "AC97: Unable to activate!");
> +               pr_err("AC97: Unable to activate!");
>  }
>
>  static unsigned short s3c_ac97_read(struct snd_ac97 *ac97,
> @@ -115,14 +115,15 @@ static unsigned short s3c_ac97_read(struct snd_ac97 *ac97,
>        writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
>
>        if (!wait_for_completion_timeout(&s3c_ac97.done, HZ))
> -               printk(KERN_ERR "AC97: Unable to read!");
> +               pr_err("AC97: Unable to read!");
>
>        stat = readl(s3c_ac97.regs + S3C_AC97_STAT);
>        addr = (stat >> 16) & 0x7f;
>        data = (stat & 0xffff);
>
>        if (addr != reg)
> -               printk(KERN_ERR "s3c-ac97: req addr = %02x, rep addr = %02x\n", reg, addr);
> +               pr_err("s3c-ac97: req addr = %02x, rep addr = %02x\n",
> +                       reg, addr);
>
>        mutex_unlock(&s3c_ac97.lock);
>
> @@ -151,7 +152,7 @@ static void s3c_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
>        writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
>
>        if (!wait_for_completion_timeout(&s3c_ac97.done, HZ))
> -               printk(KERN_ERR "AC97: Unable to write!");
> +               pr_err("AC97: Unable to write!");
>
>        ac_codec_cmd = readl(s3c_ac97.regs + S3C_AC97_CODEC_CMD);
>        ac_codec_cmd |= S3C_AC97_CODEC_CMD_READ;
> @@ -442,7 +443,7 @@ static __devinit int s3c_ac97_probe(struct platform_device *pdev)
>        ret = request_irq(irq_res->start, s3c_ac97_irq,
>                                        IRQF_DISABLED, "AC97", NULL);
>        if (ret < 0) {
> -               printk(KERN_ERR "s3c-ac97: interrupt request failed.\n");
> +               dev_err(&pdev->dev, "s3c-ac97: interrupt request failed.\n");
>                goto err4;
>        }

Acked-by: Jassi Brar <jassi.brar@samsung.com>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets
  2010-09-23 18:41 ` [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets Mark Brown
@ 2010-09-23 23:00   ` Jassi Brar
  0 siblings, 0 replies; 5+ messages in thread
From: Jassi Brar @ 2010-09-23 23:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, patches, Jassi Brar, Liam Girdwood

On Fri, Sep 24, 2010 at 3:41 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> Helps tracing errors further up the stack.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/s3c24xx/s3c-ac97.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/s3c24xx/s3c-ac97.c b/sound/soc/s3c24xx/s3c-ac97.c
> index 31e2b3d..f891eb7 100644
> --- a/sound/soc/s3c24xx/s3c-ac97.c
> +++ b/sound/soc/s3c24xx/s3c-ac97.c
> @@ -163,6 +163,7 @@ static void s3c_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
>
>  static void s3c_ac97_cold_reset(struct snd_ac97 *ac97)
>  {
> +       pr_debug("AC97: Cold reset\n");
>        writel(S3C_AC97_GLBCTRL_COLDRESET,
>                        s3c_ac97.regs + S3C_AC97_GLBCTRL);
>        msleep(1);
> @@ -179,6 +180,8 @@ static void s3c_ac97_warm_reset(struct snd_ac97 *ac97)
>        if (stat == S3C_AC97_GLBSTAT_MAINSTATE_ACTIVE)
>                return; /* Return if already active */
>
> +       pr_debug("AC97: Warm reset\n");
> +
>        writel(S3C_AC97_GLBCTRL_WARMRESET, s3c_ac97.regs + S3C_AC97_GLBCTRL);
>        msleep(1);

Acked-by: Jassi Brar <jassi.brar@samsung.com>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros
  2010-09-23 18:41 [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Mark Brown
  2010-09-23 18:41 ` [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets Mark Brown
  2010-09-23 22:59 ` [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Jassi Brar
@ 2010-09-24  9:32 ` Liam Girdwood
  2 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-09-24  9:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, patches, Jassi Brar

On Thu, 2010-09-23 at 19:41 +0100, Mark Brown wrote:
> Could use dev_() but we'd have to remember the struct device somewhere
> and it wouldn't make the logging clearer.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

All

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

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

end of thread, other threads:[~2010-09-24  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23 18:41 [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Mark Brown
2010-09-23 18:41 ` [PATCH 2/2] ASoC: Add debug logging for s3c-ac97 resets Mark Brown
2010-09-23 23:00   ` Jassi Brar
2010-09-23 22:59 ` [PATCH 1/2] ASoC: Convert s3c-ac97 to pr_() macros Jassi Brar
2010-09-24  9:32 ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.