Skip to contentSkip to conversation

mfd: wm5102: Update register patch

PATCH Superseded Charles Keepax 3 participants 8 messages Jan 31, 2014 – Feb 3, 2014

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mfd: wm5102: Update register patch

Update the register patch based on latest evaluation of the device.

---
 drivers/mfd/wm5102-tables.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mfd/wm5102-tables.c +1 -0
index 1e9a4b2..f9b1e96 100644
@@ -73,6 +73,7 @@ static const struct reg_default wm5102_revb_patch[] = {
 	{ 0x171, 0x0000 },
 	{ 0x35E, 0x000C },
 	{ 0x2D4, 0x0000 },
+	{ 0x4DC, 0x0900 },
 	{ 0x80, 0x0000 },
 };
 
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 2/2 ASoC: arizona: Improve ultrasonic frequency response

Evaluation of the device has given some settings to improve the ultrasonic frequency response. This patch allows the user the option of applying those.

---
 include/linux/mfd/arizona/pdata.h |    3 +++
 sound/soc/codecs/arizona.c        |   15 +++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
include/linux/mfd/arizona/pdata.h +3 -0
index 12a5c13..3df0ed5 100644
@@ -177,6 +177,9 @@ struct arizona_pdata {
 	/** Mode for outputs */
 	bool out_mono[ARIZONA_MAX_OUTPUT];
 
+	/** Provide improved ultrasonic frequency response */
+	bool ultrasonic_response;
+
 	/** PDM speaker mute setting */
 	unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
 
sound/soc/codecs/arizona.c +15 -0
index e4295fe..f2e1ffe 100644
@@ -1134,6 +1134,21 @@ static int arizona_hw_params_rate(struct snd_pcm_substream *substream,
 	}
 	sr_val = i;
 
+	switch (priv->arizona->type) {
+	case WM5102:
+		if (priv->arizona->pdata.ultrasonic_response) {
+			snd_soc_write(codec, 0x80, 0x3);
+			if (params_rate(params) >= 176400)
+				snd_soc_write(codec, 0x4dd, 0x1);
+			else
+				snd_soc_write(codec, 0x4dd, 0x0);
+			snd_soc_write(codec, 0x80, 0x0);
+		}
+		break;
+	default:
+		break;
+	}
+
 	switch (dai_priv->clk) {
 	case ARIZONA_CLK_SYSCLK:
 		snd_soc_update_bits(codec, ARIZONA_SAMPLE_RATE_1,
Signature · 1 line
1.7.2.5
maintainer
#2 lore raw

Re: [PATCH 2/2] ASoC: arizona: Improve ultrasonic frequency response

Quoted 3 lines · Charles Keepax

Evaluation of the device has given some settings to improve the ultrasonic frequency response. This patch allows the user the option of applying those.

Why would the user ever not want to do this?

sound/soc/codecs/arizona.c static int arizona_hw_params_rate(struct snd_pcm_substream *substream, · line 1147

Quoted 11 lines
sound/soc/codecs/arizona.c +11 -0
+	switch (priv->arizona->type) {
+	case WM5102:
+		if (priv->arizona->pdata.ultrasonic_response) {
+			snd_soc_write(codec, 0x80, 0x3);
+			if (params_rate(params) >= 176400)
+				snd_soc_write(codec, 0x4dd, 0x1);
+			else
+				snd_soc_write(codec, 0x4dd, 0x0);
+			snd_soc_write(codec, 0x80, 0x0);
+		}
+		break;

The code is only changing the configuration when the user is actually using ultrasonic sample rates so it doesn't seem like it should have a detrimental effect on other configurations.

#3 lore raw

Re: [PATCH 2/2] ASoC: arizona: Improve ultrasonic frequency response

Quoted 7 lines · Mark Brown
Quoted 3 lines · Charles Keepax

Evaluation of the device has given some settings to improve the ultrasonic frequency response. This patch allows the user the option of applying those.

Why would the user ever not want to do this?

Quoted 15 lines

sound/soc/codecs/arizona.c static int arizona_hw_params_rate(struct snd_pcm_substream *substream, · line 1147

Quoted 11 lines
sound/soc/codecs/arizona.c +11 -0
+	switch (priv->arizona->type) {
+	case WM5102:
+		if (priv->arizona->pdata.ultrasonic_response) {
+			snd_soc_write(codec, 0x80, 0x3);
+			if (params_rate(params) >= 176400)
+				snd_soc_write(codec, 0x4dd, 0x1);
+			else
+				snd_soc_write(codec, 0x4dd, 0x0);
+			snd_soc_write(codec, 0x80, 0x0);
+		}
+		break;

The code is only changing the configuration when the user is actually using ultrasonic sample rates so it doesn't seem like it should have a detrimental effect on other configurations.

Apologies I should have included a bit more in the commit message I think, I will fire out a quick respin.

Thanks,
Charles

Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] ASoC: arizona: Improve ultrasonic frequency response

In reply to Charles Keepax
Quoted 7 lines

Evaluation of the device has given some settings to improve the ultrasonic frequency response. This patch allows the user the option of applying those.

---
 include/linux/mfd/arizona/pdata.h |    3 +++

For the MFD change:

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#5 lore raw

Re: [PATCH 2/2] ASoC: arizona: Improve ultrasonic frequency response

Quoted 2 lines · Lee Jones

For the MFD change:

There's no actual dependency between the two patches AFAICT so I expect the register patch can go straight into the MFD tree?

#6 lore raw

Re: [PATCH 2/2] ASoC: arizona: Improve ultrasonic frequency response

Quoted 5 lines
Quoted 2 lines

For the MFD change:

There's no actual dependency between the two patches AFAICT so I expect the register patch can go straight into the MFD tree?

That's fine by me. Are you okay with the patch? Can I apply your Ack?

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#7 lore raw

Re: [PATCH 2/2] ASoC: arizona: Improve ultrasonic frequency response

Quoted 7 lines · Lee Jones
Quoted 5 lines
Quoted 2 lines

For the MFD change:

There's no actual dependency between the two patches AFAICT so I expect the register patch can go straight into the MFD tree?

That's fine by me. Are you okay with the patch? Can I apply your Ack?

It looked fine to me - just undocumented numbers! Feel free to add an ack from me if you like.