Skip to contentSkip to conversation

ASoC: da7219: AB Silicon related updates and small fixes.

PATCH In review Adam Thomson 3 participants 18 messages Dec 22, 2015 – Dec 23, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ASoC: da7219: AB Silicon related updates and small fixes.

This is a small collection of updates & fixes, put together for ease.

For changes relating to AB silicon, previous silicon revision is obsolete and was unavailable outside of Dialog, so does not require driver support in the future.

Changes are based on v4.4-rc6 kernel.

Adam Thomson (6):
ASoC: da7219: Disable regulators on probe() failure
ASoC: da7219: Fix Sidetone to work regardless of DAI capture
ASoC: da7219: Update REFERENCES reg default, in-line with HW
ASoC: da7219: Remove internal LDO features of codec
ASoC: da7219: Add support for 1.6V micbias level
ASoC: da7219: Remove support for 32KHz PLL mode

 Documentation/devicetree/bindings/sound/da7219.txt |  8 +-
 include/sound/da7219.h                             | 14 +---
 sound/soc/codecs/da7219.c                          | 87 +++++++---------------
 sound/soc/codecs/da7219.h                          |  9 ---
 4 files changed, 32 insertions(+), 86 deletions(-)

--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

PATCH 1/6 ASoC: da7219: Disable regulators on probe() failure

If codec probe() function fails after supplies have been enabled it should really tidy up and disable them again. This patch updates the probe function to do just that.

---
 sound/soc/codecs/da7219.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
sound/soc/codecs/da7219.c +15 -4
index f238c1e..0ba714c 100644
@@ -1662,10 +1662,12 @@ static int da7219_probe(struct snd_soc_codec *codec)
 	/* Check if MCLK provided */
 	da7219->mclk = devm_clk_get(codec->dev, "mclk");
 	if (IS_ERR(da7219->mclk)) {
-		if (PTR_ERR(da7219->mclk) != -ENOENT)
-			return PTR_ERR(da7219->mclk);
-		else
+		if (PTR_ERR(da7219->mclk) != -ENOENT) {
+			ret = PTR_ERR(da7219->mclk);
+			goto err_disable_reg;
+		} else {
 			da7219->mclk = NULL;
+		}
 	}
 
 	/* Default PC counter to free-running */
@@ -1693,7 +1695,16 @@ static int da7219_probe(struct snd_soc_codec *codec)
 	snd_soc_write(codec, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
 
 	/* Initialise AAD block */
-	return da7219_aad_init(codec);
+	ret = da7219_aad_init(codec);
+	if (ret)
+		goto err_disable_reg;
+
+	return 0;
+
+err_disable_reg:
+	regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
+
+	return ret;
 }
 
 static int da7219_remove(struct snd_soc_codec *codec)
Signature · 1 line
1.9.3
maintainer
#2 lore raw

Applied "ASoC: da7219: Disable regulators on probe() failure" to the asoc tree

The patch

ASoC: da7219: Disable regulators on probe() failure

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 9069bf9bc839d97e07fe17c336eab095c1065cec Mon Sep 17 00:00:00 2001

From: Adam Thomson <[email protected]>
Date: Tue, 22 Dec 2015 18:27:51 +0000
Subject: [PATCH] ASoC: da7219: Disable regulators on probe() failure

If codec probe() function fails after supplies have been enabled it should really tidy up and disable them again. This patch updates the probe function to do just that.

---
 sound/soc/codecs/da7219.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
sound/soc/codecs/da7219.c +15 -4
index 319e794d27f6..9136a8b6f593 100644
@@ -1663,10 +1663,12 @@ static int da7219_probe(struct snd_soc_codec *codec)
 	/* Check if MCLK provided */
 	da7219->mclk = devm_clk_get(codec->dev, "mclk");
 	if (IS_ERR(da7219->mclk)) {
-		if (PTR_ERR(da7219->mclk) != -ENOENT)
-			return PTR_ERR(da7219->mclk);
-		else
+		if (PTR_ERR(da7219->mclk) != -ENOENT) {
+			ret = PTR_ERR(da7219->mclk);
+			goto err_disable_reg;
+		} else {
 			da7219->mclk = NULL;
+		}
 	}
 
 	/* Default PC counter to free-running */
@@ -1694,7 +1696,16 @@ static int da7219_probe(struct snd_soc_codec *codec)
 	snd_soc_write(codec, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
 
 	/* Initialise AAD block */
-	return da7219_aad_init(codec);
+	ret = da7219_aad_init(codec);
+	if (ret)
+		goto err_disable_reg;
+
+	return 0;
+
+err_disable_reg:
+	regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
+
+	return ret;
 }
 
 static int da7219_remove(struct snd_soc_codec *codec)
Signature · 1 line
2.6.2
#3 lore raw

PATCH 2/6 ASoC: da7219: Fix Sidetone to work regardless of DAI capture

In reply to Adam Thomson

Previously Sidetone would operate only when capture to DAI was in progress, due to DAPM path configuration. There is no reason why this should not operate without DAI capture, so this patch updates the DAPM path accordingly.

---
 sound/soc/codecs/da7219.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/da7219.c +2 -1
index 0ba714c..253d8e7 100644
@@ -968,10 +968,11 @@ static const struct snd_soc_dapm_route da7219_audio_map[] = {
 	{"Mixin PGA", NULL, "Mic PGA"},
 	{"ADC", NULL, "Mixin PGA"},
 
-	{"Sidetone Filter", NULL, "ADC"},
 	{"Mixer In", NULL, "Mixer In Supply"},
 	{"Mixer In", "Mic Switch", "ADC"},
 
+	{"Sidetone Filter", NULL, "Mixer In"},
+
 	{"Tone Generator", NULL, "TONE"},
 
 	DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"),
Signature · 1 line
1.9.3
maintainer
#4 lore raw

Applied "ASoC: da7219: Fix Sidetone to work regardless of DAI capture" to the asoc tree

The patch

ASoC: da7219: Fix Sidetone to work regardless of DAI capture

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From fdd50a8086422caa456b5f8abb631dda6c551744 Mon Sep 17 00:00:00 2001

From: Adam Thomson <[email protected]>
Date: Tue, 22 Dec 2015 18:27:52 +0000
Subject: [PATCH] ASoC: da7219: Fix Sidetone to work regardless of DAI capture

Previously Sidetone would operate only when capture to DAI was in progress, due to DAPM path configuration. There is no reason why this should not operate without DAI capture, so this patch updates the DAPM path accordingly.

---
 sound/soc/codecs/da7219.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/da7219.c +2 -1
index e36a7b79b494..319e794d27f6 100644
@@ -968,10 +968,11 @@ static const struct snd_soc_dapm_route da7219_audio_map[] = {
 	{"Mixin PGA", NULL, "Mic PGA"},
 	{"ADC", NULL, "Mixin PGA"},
 
-	{"Sidetone Filter", NULL, "ADC"},
 	{"Mixer In", NULL, "Mixer In Supply"},
 	{"Mixer In", "Mic Switch", "ADC"},
 
+	{"Sidetone Filter", NULL, "Mixer In"},
+
 	{"Tone Generator", NULL, "TONE"},
 
 	DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"),
Signature · 1 line
2.6.2
#5 lore raw

PATCH 3/6 ASoC: da7219: Update REFERENCES reg default, in-line with HW

In reply to Adam Thomson

In current AB silicon, BIAS_EN field is enabled by default in the REFERENCES register, so the regmap default value should reflect this.

---
 sound/soc/codecs/da7219.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/da7219.c +1 -1
index 253d8e7..3502c13 100644
@@ -1788,7 +1788,7 @@ static struct reg_default da7219_reg_defaults[] = {
 	{ DA7219_DIG_ROUTING_DAC, 0x32 },
 	{ DA7219_DAI_OFFSET_LOWER, 0x00 },
 	{ DA7219_DAI_OFFSET_UPPER, 0x00 },
-	{ DA7219_REFERENCES, 0x00 },
+	{ DA7219_REFERENCES, 0x08 },
 	{ DA7219_MIXIN_L_SELECT, 0x00 },
 	{ DA7219_MIXIN_L_GAIN, 0x03 },
 	{ DA7219_ADC_L_GAIN, 0x6F },
Signature · 1 line
1.9.3
maintainer
#6 lore raw

Re: [PATCH 3/6] ASoC: da7219: Update REFERENCES reg default, in-line with HW

Quoted 3 lines · Adam Thomson

In current AB silicon, BIAS_EN field is enabled by default in the REFERENCES register, so the regmap default value should reflect this.

This is the sort of thing where a register patch would normally be used
- if you put in a register patch for the older silicon then the driver can correct for the register default automatically.

#7 lore raw

RE: [PATCH 3/6] ASoC: da7219: Update REFERENCES reg default, in-line with HW

T24gRGVjZW1iZXIgMjMsIDIwMTUgMDA6MTAsIE1hcmsgQnJvd24gd3JvdGU6DQoNCj4gT24gVHVl LCBEZWMgMjIsIDIwMTUgYXQgMDY6Mjc6NTNQTSArMDAwMCwgQWRhbSBUaG9tc29uIHdyb3RlOg0K PiA+IEluIGN1cnJlbnQgQUIgc2lsaWNvbiwgQklBU19FTiBmaWVsZCBpcyBlbmFibGVkIGJ5IGRl ZmF1bHQgaW4gdGhlDQo+ID4gUkVGRVJFTkNFUyByZWdpc3Rlciwgc28gdGhlIHJlZ21hcCBkZWZh dWx0IHZhbHVlIHNob3VsZCByZWZsZWN0DQo+ID4gdGhpcy4NCj4gDQo+IFRoaXMgaXMgdGhlIHNv cnQgb2YgdGhpbmcgd2hlcmUgYSByZWdpc3RlciBwYXRjaCB3b3VsZCBub3JtYWxseSBiZSB1c2Vk DQo+IC0gaWYgeW91IHB1dCBpbiBhIHJlZ2lzdGVyIHBhdGNoIGZvciB0aGUgb2xkZXIgc2lsaWNv biB0aGVuIHRoZSBkcml2ZXINCj4gY2FuIGNvcnJlY3QgZm9yIHRoZSByZWdpc3RlciBkZWZhdWx0 IGF1dG9tYXRpY2FsbHkuDQoNClRoYW5rcy4gWWVzLCBhbSBhd2FyZSBvZiB0aGF0LiBXZXJlIHRo ZSBvbGRlciBzaWxpY29uIHN0aWxsIGluIHVzZSB0aGVuIEknZCBoYXZlDQp0YWtlbiB0aGF0IHJv dXRlLCBidXQgZGlkbid0IHNlZW0gbmVjZXNzYXJ5IGluIHRoaXMgaW5zdGFuY2UuDQo= --
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#8 lore raw

Re: [PATCH 3/6] ASoC: da7219: Update REFERENCES reg default, in-line with HW

Quoted 8 lines · Opensource [Adam Thomson]
Quoted 3 lines · Mark Brown

This is the sort of thing where a register patch would normally be used
- if you put in a register patch for the older silicon then the driver can correct for the register default automatically.

Thanks. Yes, am aware of that. Were the older silicon still in use then I'd have taken that route, but didn't seem necessary in this instance.

It costs you nothing to do it properly and you might be surprised how often older silicon turns up somewhere.

maintainer
#9 lore raw

Applied "ASoC: da7219: Update REFERENCES reg default, in-line with HW" to the asoc tree

In reply to Adam Thomson

The patch

ASoC: da7219: Update REFERENCES reg default, in-line with HW

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 9ff099790412cb46536efba02039b36d81300976 Mon Sep 17 00:00:00 2001

From: Adam Thomson <[email protected]>
Date: Tue, 22 Dec 2015 18:27:53 +0000
Subject: [PATCH] ASoC: da7219: Update REFERENCES reg default, in-line with HW

In current AB silicon, BIAS_EN field is enabled by default in the REFERENCES register, so the regmap default value should reflect this.

---
 sound/soc/codecs/da7219.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/da7219.c +1 -1
index 9136a8b6f593..0a177ae8e0c3 100644
@@ -1788,7 +1788,7 @@ static struct reg_default da7219_reg_defaults[] = {
 	{ DA7219_DIG_ROUTING_DAC, 0x32 },
 	{ DA7219_DAI_OFFSET_LOWER, 0x00 },
 	{ DA7219_DAI_OFFSET_UPPER, 0x00 },
-	{ DA7219_REFERENCES, 0x00 },
+	{ DA7219_REFERENCES, 0x08 },
 	{ DA7219_MIXIN_L_SELECT, 0x00 },
 	{ DA7219_MIXIN_L_GAIN, 0x03 },
 	{ DA7219_ADC_L_GAIN, 0x6F },
Signature · 1 line
2.6.2
#10 lore raw

PATCH 4/6 ASoC: da7219: Remove internal LDO features of codec

In reply to Adam Thomson

In AB silicon, the internal LDO is not supported so remove DT and driver references to this (digital voltage direct from 'VDD' supply)

---
 Documentation/devicetree/bindings/sound/da7219.txt |  6 ++-
 include/sound/da7219.h                             | 11 -----
 sound/soc/codecs/da7219.c                          | 50 +---------------------
 sound/soc/codecs/da7219.h                          |  7 ---
 4 files changed, 6 insertions(+), 68 deletions(-)
Documentation/devicetree/bindings/sound/da7219.txt +4 -2
index 1b70309..062a2a0 100644
@@ -28,13 +28,15 @@ Optional properties:
 - clocks : phandle and clock specifier for codec MCLK.
 - clock-names : Clock name string for 'clocks' attribute, should be "mclk".
 
-- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
-	[<1050>, <1100>, <1200>, <1400>]
 - dlg,micbias-lvl : Voltage (mV) for Mic Bias
 	[<1800>, <2000>, <2200>, <2400>, <2600>]
 - dlg,mic-amp-in-sel : Mic input source type
 	["diff", "se_p", "se_n"]
 
+Deprecated properties:
+- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
+  (LDO unavailable in production HW so property no longer required).
+
 ======
 
 Child node - 'da7219_aad':
include/sound/da7219.h +0 -11
index 3f39e13..307198b 100644
@@ -14,14 +14,6 @@
 #ifndef __DA7219_PDATA_H
 #define __DA7219_PDATA_H
 
-/* LDO */
-enum da7219_ldo_lvl_sel {
-	DA7219_LDO_LVL_SEL_1_05V = 0,
-	DA7219_LDO_LVL_SEL_1_10V,
-	DA7219_LDO_LVL_SEL_1_20V,
-	DA7219_LDO_LVL_SEL_1_40V,
-};
-
 /* Mic Bias */
 enum da7219_micbias_voltage {
 	DA7219_MICBIAS_1_8V = 1,
@@ -41,9 +33,6 @@ enum da7219_mic_amp_in_sel {
 struct da7219_aad_pdata;
 
 struct da7219_pdata {
-	/* Internal LDO */
-	enum da7219_ldo_lvl_sel ldo_lvl_sel;
-
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
sound/soc/codecs/da7219.c +2 -48

85 lines not on this page · raw message

sound/soc/codecs/da7219.h +0 -7
index b514268..2b3f447 100644
@@ -85,7 +85,6 @@
 #define DA7219_CHIP_ID1			0x81
 #define DA7219_CHIP_ID2			0x82
 #define DA7219_CHIP_REVISION		0x83
-#define DA7219_LDO_CTRL			0x90
 #define DA7219_IO_CTRL			0x91
 #define DA7219_GAIN_RAMP_CTRL		0x92
 #define DA7219_PC_COUNT			0x94
@@ -569,12 +568,6 @@
 #define DA7219_CHIP_MAJOR_SHIFT	4
 #define DA7219_CHIP_MAJOR_MASK	(0xF << 4)
 
-/* DA7219_LDO_CTRL = 0x90 */
-#define DA7219_LDO_LEVEL_SELECT_SHIFT	4
-#define DA7219_LDO_LEVEL_SELECT_MASK	(0x3 << 4)
-#define DA7219_LDO_EN_SHIFT		7
-#define DA7219_LDO_EN_MASK		(0x1 << 7)
-
 /* DA7219_IO_CTRL = 0x91 */
 #define DA7219_IO_VOLTAGE_LEVEL_SHIFT		0
 #define DA7219_IO_VOLTAGE_LEVEL_MASK		(0x1 << 0)
Signature · 1 line
1.9.3
maintainer Acked-by on v1 4/6
#11 lore raw

Re: [PATCH 4/6] ASoC: da7219: Remove internal LDO features of codec

Quoted 7 lines · Adam Thomson

In AB silicon, the internal LDO is not supported so remove DT and driver references to this (digital voltage direct from 'VDD' supply)

---
 Documentation/devicetree/bindings/sound/da7219.txt |  6 ++-

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#12 lore raw

Applied "ASoC: da7219: Remove internal LDO features of codec" to the asoc tree

In reply to Adam Thomson

The patch

ASoC: da7219: Remove internal LDO features of codec

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From d8ef140dccc1645aa37a140ed7585458294210b8 Mon Sep 17 00:00:00 2001

From: Adam Thomson <[email protected]>
Date: Tue, 22 Dec 2015 18:27:54 +0000
Subject: [PATCH] ASoC: da7219: Remove internal LDO features of codec

In AB silicon, the internal LDO is not supported so remove DT and driver references to this (digital voltage direct from 'VDD' supply)

---
 Documentation/devicetree/bindings/sound/da7219.txt |  6 ++-
 include/sound/da7219.h                             | 11 -----
 sound/soc/codecs/da7219.c                          | 50 +---------------------
 sound/soc/codecs/da7219.h                          |  7 ---
 4 files changed, 6 insertions(+), 68 deletions(-)
Documentation/devicetree/bindings/sound/da7219.txt +4 -2
index 1b7030911a3b..062a2a08250e 100644
@@ -28,13 +28,15 @@ Optional properties:
 - clocks : phandle and clock specifier for codec MCLK.
 - clock-names : Clock name string for 'clocks' attribute, should be "mclk".
 
-- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
-	[<1050>, <1100>, <1200>, <1400>]
 - dlg,micbias-lvl : Voltage (mV) for Mic Bias
 	[<1800>, <2000>, <2200>, <2400>, <2600>]
 - dlg,mic-amp-in-sel : Mic input source type
 	["diff", "se_p", "se_n"]
 
+Deprecated properties:
+- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
+  (LDO unavailable in production HW so property no longer required).
+
 ======
 
 Child node - 'da7219_aad':
include/sound/da7219.h +0 -11
index 3f39e135312d..307198b469bc 100644
@@ -14,14 +14,6 @@
 #ifndef __DA7219_PDATA_H
 #define __DA7219_PDATA_H
 
-/* LDO */
-enum da7219_ldo_lvl_sel {
-	DA7219_LDO_LVL_SEL_1_05V = 0,
-	DA7219_LDO_LVL_SEL_1_10V,
-	DA7219_LDO_LVL_SEL_1_20V,
-	DA7219_LDO_LVL_SEL_1_40V,
-};
-
 /* Mic Bias */
 enum da7219_micbias_voltage {
 	DA7219_MICBIAS_1_8V = 1,
@@ -41,9 +33,6 @@ enum da7219_mic_amp_in_sel {
 struct da7219_aad_pdata;
 
 struct da7219_pdata {
-	/* Internal LDO */
-	enum da7219_ldo_lvl_sel ldo_lvl_sel;
-
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
sound/soc/codecs/da7219.c +2 -48

85 lines not on this page · raw message

sound/soc/codecs/da7219.h +0 -7
index b514268c6c56..2b3f4471a17f 100644
@@ -85,7 +85,6 @@
 #define DA7219_CHIP_ID1			0x81
 #define DA7219_CHIP_ID2			0x82
 #define DA7219_CHIP_REVISION		0x83
-#define DA7219_LDO_CTRL			0x90
 #define DA7219_IO_CTRL			0x91
 #define DA7219_GAIN_RAMP_CTRL		0x92
 #define DA7219_PC_COUNT			0x94
@@ -569,12 +568,6 @@
 #define DA7219_CHIP_MAJOR_SHIFT	4
 #define DA7219_CHIP_MAJOR_MASK	(0xF << 4)
 
-/* DA7219_LDO_CTRL = 0x90 */
-#define DA7219_LDO_LEVEL_SELECT_SHIFT	4
-#define DA7219_LDO_LEVEL_SELECT_MASK	(0x3 << 4)
-#define DA7219_LDO_EN_SHIFT		7
-#define DA7219_LDO_EN_MASK		(0x1 << 7)
-
 /* DA7219_IO_CTRL = 0x91 */
 #define DA7219_IO_VOLTAGE_LEVEL_SHIFT		0
 #define DA7219_IO_VOLTAGE_LEVEL_MASK		(0x1 << 0)
Signature · 1 line
2.6.2
#13 lore raw

PATCH 5/6 ASoC: da7219: Add support for 1.6V micbias level

In reply to Adam Thomson

HW can provide 1.6V micbias level as well the existing levels already provided in the driver. This patch adds support for 1.6V to the DT binding.

---
 Documentation/devicetree/bindings/sound/da7219.txt | 2 +-
 include/sound/da7219.h                             | 3 ++-
 sound/soc/codecs/da7219.c                          | 3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/sound/da7219.txt +1 -1
index 062a2a0..cf61681 100644
@@ -29,7 +29,7 @@ Optional properties:
 - clock-names : Clock name string for 'clocks' attribute, should be "mclk".
 
 - dlg,micbias-lvl : Voltage (mV) for Mic Bias
-	[<1800>, <2000>, <2200>, <2400>, <2600>]
+	[<1600>, <1800>, <2000>, <2200>, <2400>, <2600>]
 - dlg,mic-amp-in-sel : Mic input source type
 	["diff", "se_p", "se_n"]
 
include/sound/da7219.h +2 -1
index 307198b..02876ac 100644
@@ -16,7 +16,8 @@
 
 /* Mic Bias */
 enum da7219_micbias_voltage {
-	DA7219_MICBIAS_1_8V = 1,
+	DA7219_MICBIAS_1_6V = 0,
+	DA7219_MICBIAS_1_8V,
 	DA7219_MICBIAS_2_0V,
 	DA7219_MICBIAS_2_2V,
 	DA7219_MICBIAS_2_4V,
sound/soc/codecs/da7219.c +3 -0
index 5daeec8..c019fef 100644
@@ -1410,6 +1410,8 @@ static enum da7219_micbias_voltage
 	da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val)
 {
 	switch (val) {
+	case 1600:
+		return DA7219_MICBIAS_1_6V;
 	case 1800:
 		return DA7219_MICBIAS_1_8V;
 	case 2000:
@@ -1571,6 +1573,7 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec)
 
 		/* Mic Bias voltages */
 		switch (pdata->micbias_lvl) {
+		case DA7219_MICBIAS_1_6V:
 		case DA7219_MICBIAS_1_8V:
 		case DA7219_MICBIAS_2_0V:
 		case DA7219_MICBIAS_2_2V:
Signature · 1 line
1.9.3
maintainer Acked-by on v1 5/6
#14 lore raw

Re: [PATCH 5/6] ASoC: da7219: Add support for 1.6V micbias level

Quoted 7 lines · Adam Thomson

HW can provide 1.6V micbias level as well the existing levels already provided in the driver. This patch adds support for 1.6V to the DT binding.

---
 Documentation/devicetree/bindings/sound/da7219.txt | 2 +-
maintainer
#15 lore raw

Applied "ASoC: da7219: Add support for 1.6V micbias level" to the asoc tree

In reply to Adam Thomson

The patch

ASoC: da7219: Add support for 1.6V micbias level

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 0aed64c1766d354c819a13a57d8673adaf2266eb Mon Sep 17 00:00:00 2001

From: Adam Thomson <[email protected]>
Date: Tue, 22 Dec 2015 18:27:55 +0000
Subject: [PATCH] ASoC: da7219: Add support for 1.6V micbias level

HW can provide 1.6V micbias level as well the existing levels already provided in the driver. This patch adds support for 1.6V to the DT binding.

---
 Documentation/devicetree/bindings/sound/da7219.txt | 2 +-
 include/sound/da7219.h                             | 3 ++-
 sound/soc/codecs/da7219.c                          | 3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/sound/da7219.txt +1 -1
index 062a2a08250e..cf61681826b6 100644
@@ -29,7 +29,7 @@ Optional properties:
 - clock-names : Clock name string for 'clocks' attribute, should be "mclk".
 
 - dlg,micbias-lvl : Voltage (mV) for Mic Bias
-	[<1800>, <2000>, <2200>, <2400>, <2600>]
+	[<1600>, <1800>, <2000>, <2200>, <2400>, <2600>]
 - dlg,mic-amp-in-sel : Mic input source type
 	["diff", "se_p", "se_n"]
 
include/sound/da7219.h +2 -1
index 307198b469bc..02876acdc840 100644
@@ -16,7 +16,8 @@
 
 /* Mic Bias */
 enum da7219_micbias_voltage {
-	DA7219_MICBIAS_1_8V = 1,
+	DA7219_MICBIAS_1_6V = 0,
+	DA7219_MICBIAS_1_8V,
 	DA7219_MICBIAS_2_0V,
 	DA7219_MICBIAS_2_2V,
 	DA7219_MICBIAS_2_4V,
sound/soc/codecs/da7219.c +3 -0
index 2630c503e3df..371768092e17 100644
@@ -1410,6 +1410,8 @@ static enum da7219_micbias_voltage
 	da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val)
 {
 	switch (val) {
+	case 1600:
+		return DA7219_MICBIAS_1_6V;
 	case 1800:
 		return DA7219_MICBIAS_1_8V;
 	case 2000:
@@ -1571,6 +1573,7 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec)
 
 		/* Mic Bias voltages */
 		switch (pdata->micbias_lvl) {
+		case DA7219_MICBIAS_1_6V:
 		case DA7219_MICBIAS_1_8V:
 		case DA7219_MICBIAS_2_0V:
 		case DA7219_MICBIAS_2_2V:
Signature · 1 line
2.6.2
#16 lore raw

PATCH 6/6 ASoC: da7219: Remove support for 32KHz PLL mode

In reply to Adam Thomson

PLL mode based on 32KHz master clock not supported in AB silicon so remove support from the driver.

---
 sound/soc/codecs/da7219.c | 10 ++--------
 sound/soc/codecs/da7219.h |  2 --
 2 files changed, 2 insertions(+), 10 deletions(-)
sound/soc/codecs/da7219.c +2 -8
index c019fef..82a7236 100644
@@ -1074,11 +1074,8 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
 	u32 freq_ref;
 	u64 frac_div;
 
-	/* Verify 32KHz, 2MHz - 54MHz MCLK provided, and set input divider */
-	if (da7219->mclk_rate == 32768) {
-		indiv_bits = DA7219_PLL_INDIV_2_5_MHZ;
-		indiv = DA7219_PLL_INDIV_2_5_MHZ_VAL;
-	} else if (da7219->mclk_rate < 2000000) {
+	/* Verify 2MHz - 54MHz MCLK provided, and set input divider */
+	if (da7219->mclk_rate < 2000000) {
 		dev_err(codec->dev, "PLL input clock %d below valid range\n",
 			da7219->mclk_rate);
 		return -EINVAL;
@@ -1119,9 +1116,6 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
 	case DA7219_SYSCLK_PLL_SRM:
 		pll_ctrl |= DA7219_PLL_MODE_SRM;
 		break;
-	case DA7219_SYSCLK_PLL_32KHZ:
-		pll_ctrl |= DA7219_PLL_MODE_32KHZ;
-		break;
 	default:
 		dev_err(codec->dev, "Invalid PLL config\n");
 		return -EINVAL;
sound/soc/codecs/da7219.h +0 -2
index 2b3f447..5a787e7 100644
@@ -206,7 +206,6 @@
 #define DA7219_PLL_MODE_BYPASS		(0x0 << 6)
 #define DA7219_PLL_MODE_NORMAL		(0x1 << 6)
 #define DA7219_PLL_MODE_SRM		(0x2 << 6)
-#define DA7219_PLL_MODE_32KHZ		(0x3 << 6)
 
 /* DA7219_PLL_FRAC_TOP = 0x22 */
 #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT	0
@@ -780,7 +779,6 @@ enum da7219_sys_clk {
 	DA7219_SYSCLK_MCLK = 0,
 	DA7219_SYSCLK_PLL,
 	DA7219_SYSCLK_PLL_SRM,
-	DA7219_SYSCLK_PLL_32KHZ
 };
 
 /* Regulators */
Signature · 1 line
1.9.3
maintainer
#17 lore raw

Applied "ASoC: da7219: Remove support for 32KHz PLL mode" to the asoc tree

The patch

ASoC: da7219: Remove support for 32KHz PLL mode

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 501f72e9c5205b9d70d5d61e9b186ae7ba873f73 Mon Sep 17 00:00:00 2001

From: Adam Thomson <[email protected]>
Date: Tue, 22 Dec 2015 18:27:56 +0000
Subject: [PATCH] ASoC: da7219: Remove support for 32KHz PLL mode

PLL mode based on 32KHz master clock not supported in AB silicon so remove support from the driver.

---
 sound/soc/codecs/da7219.c | 10 ++--------
 sound/soc/codecs/da7219.h |  2 --
 2 files changed, 2 insertions(+), 10 deletions(-)
sound/soc/codecs/da7219.c +2 -8
index 371768092e17..c6d3b32bb4ae 100644
@@ -1074,11 +1074,8 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
 	u32 freq_ref;
 	u64 frac_div;
 
-	/* Verify 32KHz, 2MHz - 54MHz MCLK provided, and set input divider */
-	if (da7219->mclk_rate == 32768) {
-		indiv_bits = DA7219_PLL_INDIV_2_5_MHZ;
-		indiv = DA7219_PLL_INDIV_2_5_MHZ_VAL;
-	} else if (da7219->mclk_rate < 2000000) {
+	/* Verify 2MHz - 54MHz MCLK provided, and set input divider */
+	if (da7219->mclk_rate < 2000000) {
 		dev_err(codec->dev, "PLL input clock %d below valid range\n",
 			da7219->mclk_rate);
 		return -EINVAL;
@@ -1119,9 +1116,6 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
 	case DA7219_SYSCLK_PLL_SRM:
 		pll_ctrl |= DA7219_PLL_MODE_SRM;
 		break;
-	case DA7219_SYSCLK_PLL_32KHZ:
-		pll_ctrl |= DA7219_PLL_MODE_32KHZ;
-		break;
 	default:
 		dev_err(codec->dev, "Invalid PLL config\n");
 		return -EINVAL;
sound/soc/codecs/da7219.h +0 -2
index 2b3f4471a17f..5a787e738084 100644
@@ -206,7 +206,6 @@
 #define DA7219_PLL_MODE_BYPASS		(0x0 << 6)
 #define DA7219_PLL_MODE_NORMAL		(0x1 << 6)
 #define DA7219_PLL_MODE_SRM		(0x2 << 6)
-#define DA7219_PLL_MODE_32KHZ		(0x3 << 6)
 
 /* DA7219_PLL_FRAC_TOP = 0x22 */
 #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT	0
@@ -780,7 +779,6 @@ enum da7219_sys_clk {
 	DA7219_SYSCLK_MCLK = 0,
 	DA7219_SYSCLK_PLL,
 	DA7219_SYSCLK_PLL_SRM,
-	DA7219_SYSCLK_PLL_32KHZ
 };
 
 /* Regulators */
Signature · 1 line
2.6.2