public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: wm8994: declare dc servo register for wm8958 as volatile
@ 2014-08-13 10:46 Nikesh Oswal
  2014-08-13 11:13 ` Charles Keepax
  0 siblings, 1 reply; 3+ messages in thread
From: Nikesh Oswal @ 2014-08-13 10:46 UTC (permalink / raw)
  To: broonie, lgirdwood; +Cc: perex, tiwai, alsa-devel, linux-kernel, patches

DC Servo register 57h holds the DC offset value after the hardware has
completed the DC Servo Correction, so declare this register as volatile
because it is changed by the hardware.

Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8994-regmap.c          |    1 +
 include/linux/mfd/wm8994/registers.h |    1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/mfd/wm8994-regmap.c b/drivers/mfd/wm8994-regmap.c
index 2fbce9c..e775565 100644
--- a/drivers/mfd/wm8994-regmap.c
+++ b/drivers/mfd/wm8994-regmap.c
@@ -1169,6 +1169,7 @@ static bool wm8958_volatile_register(struct device *dev, unsigned int reg)
 	case WM8958_FW_MINOR_0:
 	case WM8958_FW_PATCH_1:
 	case WM8958_FW_PATCH_0:
+	case WM8958_DC_SERVO:
 		return true;
 	default:
 		return wm8994_volatile_register(dev, reg);
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index db8cef3..85b4fec 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
@@ -71,6 +71,7 @@
 #define WM8994_DC_SERVO_1                       0x54
 #define WM8994_DC_SERVO_2                       0x55
 #define WM8994_DC_SERVO_4                       0x57
+#define WM8958_DC_SERVO			0x57
 #define WM8994_DC_SERVO_READBACK                0x58
 #define WM8994_DC_SERVO_4E			0x59
 #define WM8994_ANALOGUE_HP_1                    0x60
-- 
1.7.9.5


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

* Re: [PATCH] mfd: wm8994: declare dc servo register for wm8958 as volatile
  2014-08-13 10:46 [PATCH] mfd: wm8994: declare dc servo register for wm8958 as volatile Nikesh Oswal
@ 2014-08-13 11:13 ` Charles Keepax
  2014-08-13 12:32   ` Charles Keepax
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Keepax @ 2014-08-13 11:13 UTC (permalink / raw)
  To: Nikesh Oswal
  Cc: broonie, lgirdwood, tiwai, alsa-devel, patches, linux-kernel,
	perex

On Wed, Aug 13, 2014 at 11:46:25AM +0100, Nikesh Oswal wrote:
> DC Servo register 57h holds the DC offset value after the hardware has
> completed the DC Servo Correction, so declare this register as volatile
> because it is changed by the hardware.
> 
> Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
> ---
>  drivers/mfd/wm8994-regmap.c          |    1 +
>  include/linux/mfd/wm8994/registers.h |    1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/wm8994-regmap.c b/drivers/mfd/wm8994-regmap.c
> index 2fbce9c..e775565 100644
> --- a/drivers/mfd/wm8994-regmap.c
> +++ b/drivers/mfd/wm8994-regmap.c
> @@ -1169,6 +1169,7 @@ static bool wm8958_volatile_register(struct device *dev, unsigned int reg)
>  	case WM8958_FW_MINOR_0:
>  	case WM8958_FW_PATCH_1:
>  	case WM8958_FW_PATCH_0:
> +	case WM8958_DC_SERVO:

I think you can just use the WM8994_DC_SERVO_4 define the
register is called DC Servo (4) in the datasheet.

Also would it be worth adding DC_SERVO_1 and DC_SERVO_READBACK as
they are being treated as volatile on 8994 and look identical in
the datasheet.

>  		return true;
>  	default:
>  		return wm8994_volatile_register(dev, reg);
> diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
> index db8cef3..85b4fec 100644
> --- a/include/linux/mfd/wm8994/registers.h
> +++ b/include/linux/mfd/wm8994/registers.h
> @@ -71,6 +71,7 @@
>  #define WM8994_DC_SERVO_1                       0x54
>  #define WM8994_DC_SERVO_2                       0x55
>  #define WM8994_DC_SERVO_4                       0x57
> +#define WM8958_DC_SERVO			0x57
>  #define WM8994_DC_SERVO_READBACK                0x58
>  #define WM8994_DC_SERVO_4E			0x59
>  #define WM8994_ANALOGUE_HP_1                    0x60
> -- 
> 1.7.9.5

Thanks,
Charles

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

* Re: [PATCH] mfd: wm8994: declare dc servo register for wm8958 as volatile
  2014-08-13 11:13 ` Charles Keepax
@ 2014-08-13 12:32   ` Charles Keepax
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2014-08-13 12:32 UTC (permalink / raw)
  To: Nikesh Oswal
  Cc: alsa-devel, tiwai, patches, linux-kernel, lgirdwood, broonie,
	perex

On Wed, Aug 13, 2014 at 12:13:38PM +0100, Charles Keepax wrote:
> On Wed, Aug 13, 2014 at 11:46:25AM +0100, Nikesh Oswal wrote:
> > DC Servo register 57h holds the DC offset value after the hardware has
> > completed the DC Servo Correction, so declare this register as volatile
> > because it is changed by the hardware.
> > 
> > Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
> > ---
> >  drivers/mfd/wm8994-regmap.c          |    1 +
> >  include/linux/mfd/wm8994/registers.h |    1 +
> >  2 files changed, 2 insertions(+)
> > 
> > diff --git a/drivers/mfd/wm8994-regmap.c b/drivers/mfd/wm8994-regmap.c
> > index 2fbce9c..e775565 100644
> > --- a/drivers/mfd/wm8994-regmap.c
> > +++ b/drivers/mfd/wm8994-regmap.c
> > @@ -1169,6 +1169,7 @@ static bool wm8958_volatile_register(struct device *dev, unsigned int reg)
> >  	case WM8958_FW_MINOR_0:
> >  	case WM8958_FW_PATCH_1:
> >  	case WM8958_FW_PATCH_0:
> > +	case WM8958_DC_SERVO:
> 
> I think you can just use the WM8994_DC_SERVO_4 define the
> register is called DC Servo (4) in the datasheet.
> 
> Also would it be worth adding DC_SERVO_1 and DC_SERVO_READBACK as
> they are being treated as volatile on 8994 and look identical in
> the datasheet.

Sorry missed the call to wm8994_volatile_register ignore this
second comment here.

Thanks,
Charles

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

end of thread, other threads:[~2014-08-13 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-13 10:46 [PATCH] mfd: wm8994: declare dc servo register for wm8958 as volatile Nikesh Oswal
2014-08-13 11:13 ` Charles Keepax
2014-08-13 12:32   ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox