Skip to contentSkip to conversation

mfd: wm5102: Mark register 0x19 readable

PATCH In review Mark Brown 4 participants 7 messages Mar 10, 2014

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 mfd: wm5102: Mark register 0x19 readable

From: Mark Brown <[email protected]>

During init the core checks if the wm5102 has finished starting by reading register 0x19 and looking at the value. This read always fails since this is not a readable register, mark it as being one.

---
 drivers/mfd/wm5102-tables.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/wm5102-tables.c +1 -0
index f4668d39e542..07f024fd4ded 100644
@@ -1016,6 +1016,7 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
 	case ARIZONA_WRITE_SEQUENCER_CTRL_0:
 	case ARIZONA_WRITE_SEQUENCER_CTRL_1:
 	case ARIZONA_WRITE_SEQUENCER_CTRL_2:
+	case 0x19:
 	case ARIZONA_WRITE_SEQUENCER_PROM:
 	case ARIZONA_TONE_GENERATOR_1:
 	case ARIZONA_TONE_GENERATOR_2:
Signature · 1 line
1.9.0
#1 lore raw
Quoted 16 lines

From: Mark Brown <[email protected]>

During init the core checks if the wm5102 has finished starting by reading register 0x19 and looking at the value. This read always fails since this is not a readable register, mark it as being one.

---
 drivers/mfd/wm5102-tables.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/wm5102-tables.c +0 -0
index f4668d39e542..07f024fd4ded 100644

drivers/mfd/wm5102-tables.c static bool wm5102_readable_register(struct device *dev, unsigned int reg) · line 1019

Quoted 4 lines
drivers/mfd/wm5102-tables.c +1 -0
@@ -1016,6 +1016,7 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
 	case ARIZONA_WRITE_SEQUENCER_CTRL_0:
 	case ARIZONA_WRITE_SEQUENCER_CTRL_1:
 	case ARIZONA_WRITE_SEQUENCER_CTRL_2:
+	case 0x19:

Can we have a #define for these please?

Quoted 3 lines
drivers/mfd/wm5102-tables.c +0 -0
 	case ARIZONA_WRITE_SEQUENCER_PROM:
 	case ARIZONA_TONE_GENERATOR_1:
 	case ARIZONA_TONE_GENERATOR_2:
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#2 lore raw
Quoted 1 line · Lee Jones

Can we have a #define for these please?

It'd be nice but you'd need to ask the Wolfson guys to tell us what it's called, all the information I have is the read in the driver source. Meanwile we've got a bug.

#3 lore raw
Quoted 7 lines · Mark Brown
Quoted 1 line · Lee Jones

Can we have a #define for these please?

It'd be nice but you'd need to ask the Wolfson guys to tell us what it's called, all the information I have is the read in the driver source. Meanwile we've got a bug.

WRITE_SEQUENCER_CTRL_3, seems we should add that in since it is required for that 5102 boot stuff. Slightly confused as to how that ever worked without the register being readable, but guess it has been a while since I have fired up 5102 on mainline.

Thanks,
Charles

author
#4 lore raw
Quoted 10 lines · Charles Keepax
Quoted 3 lines · Mark Brown

It'd be nice but you'd need to ask the Wolfson guys to tell us what it's called, all the information I have is the read in the driver source. Meanwile we've got a bug.

WRITE_SEQUENCER_CTRL_3, seems we should add that in since it is required for that 5102 boot stuff. Slightly confused as to how that ever worked without the register being readable, but guess it has been a while since I have fired up 5102 on mainline.

It just prints an error message, it doesn't actually care if the read failed and will fall through to polling for boot completion.

#5 lore raw
In reply to Charles Keepax
Quoted 5 lines · Charles Keepax
Quoted 4 lines · Mark Brown
Quoted 1 line · Lee Jones

Can we have a #define for these please?

Quoted 9 lines
Quoted 3 lines

It'd be nice but you'd need to ask the Wolfson guys to tell us what it's called, all the information I have is the read in the driver source. Meanwile we've got a bug.

WRITE_SEQUENCER_CTRL_3, seems we should add that in since it is required for that 5102 boot stuff. Slightly confused as to how that ever worked without the register being readable, but guess it has been a while since I have fired up 5102 on mainline.

Presumably this change triggered it:

http://git.kernel.org/cgit/linux/kernel/git/broonie/regmap.git/commit/?h=topic/core&id=d4807ad2c4c0e17b6f00e3be9492c81de0804f40

author
#6 lore raw
Quoted 10 lines · Lars-Peter Clausen
Quoted 4 lines · Charles Keepax

WRITE_SEQUENCER_CTRL_3, seems we should add that in since it is required for that 5102 boot stuff. Slightly confused as to how that ever worked without the register being readable, but guess it has been a while since I have fired up 5102 on mainline.

Presumably this change triggered it:

http://git.kernel.org/cgit/linux/kernel/git/broonie/regmap.git/commit/?h=topic/core&id=d4807ad2c4c0e17b6f00e3be9492c81de0804f40

Indeed. Now that I think about it there's another bug lying underneath too - the register isn't marked as volatile so it'll only actually be being read on first read. For some reason that check is only done on probe so it's got no impact but it seems it's asking for future breakage.