Skip to contentSkip to conversation

mfd: wm8994: declare dc servo register for wm8958 as volatile

PATCH Superseded Nikesh Oswal 2 participants 3 messages Aug 13, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: wm8994: declare dc servo register for wm8958 as volatile

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.

---
 drivers/mfd/wm8994-regmap.c          |    1 +
 include/linux/mfd/wm8994/registers.h |    1 +
 2 files changed, 2 insertions(+)
drivers/mfd/wm8994-regmap.c +1 -0
index 2fbce9c..e775565 100644
@@ -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);
include/linux/mfd/wm8994/registers.h +1 -0
index db8cef3..85b4fec 100644
@@ -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
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 15 lines · Nikesh Oswal

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.

---
 drivers/mfd/wm8994-regmap.c          |    1 +
 include/linux/mfd/wm8994/registers.h |    1 +
 2 files changed, 2 insertions(+)
drivers/mfd/wm8994-regmap.c +0 -0
index 2fbce9c..e775565 100644

drivers/mfd/wm8994-regmap.c static bool wm8958_volatile_register(struct device *dev, unsigned int reg) · line 1172

Quoted 4 lines
drivers/mfd/wm8994-regmap.c +1 -0
@@ -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.

Quoted 17 lines
drivers/mfd/wm8994-regmap.c +0 -0
 		return true;
 	default:
 		return wm8994_volatile_register(dev, reg);
include/linux/mfd/wm8994/registers.h +1 -0
index db8cef3..85b4fec 100644
@@ -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
Signature · 1 line
1.7.9.5

Thanks,
Charles

#2 lore raw
Quoted 24 lines · Charles Keepax
Quoted 15 lines · Nikesh Oswal

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.

---
 drivers/mfd/wm8994-regmap.c          |    1 +
 include/linux/mfd/wm8994/registers.h |    1 +
 2 files changed, 2 insertions(+)
drivers/mfd/wm8994-regmap.c +0 -0
index 2fbce9c..e775565 100644

drivers/mfd/wm8994-regmap.c static bool wm8958_volatile_register(struct device *dev, unsigned int reg) · line 1172

Quoted 4 lines
drivers/mfd/wm8994-regmap.c +1 -0
@@ -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.

Quoted 3 lines

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