Skip to contentSkip to conversation

mfd: wm8994: Remove duplicate check for active JACKDET

PATCH In review Mark Brown 2 participants 5 messages Jul 17, 2013

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/2 mfd: wm8994: Remove duplicate check for active JACKDET

From: Mark Brown <[email protected]>

Probably the result of a mismerge or rebase failing to notice that the hunk had already been applied.

---
 drivers/mfd/wm8994-core.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/mfd/wm8994-core.c +0 -14
index 781115e..e8ecb8e 100644
@@ -245,20 +245,6 @@ static int wm8994_suspend(struct device *dev)
 		break;
 	}
 
-	switch (wm8994->type) {
-	case WM1811:
-		ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2);
-		if (ret < 0) {
-			dev_err(dev, "Failed to read jackdet: %d\n", ret);
-		} else if (ret & WM1811_JACKDET_MODE_MASK) {
-			dev_dbg(dev, "CODEC still active, ignoring suspend\n");
-			return 0;
-		}
-		break;
-	default:
-		break;
-	}
-
 	/* Disable LDO pulldowns while the device is suspended if we
 	 * don't know that something will be driving them. */
 	if (!wm8994->ldo_ena_always_driven)
Signature · 1 line
1.8.3.2
author
#1 lore raw

PATCH 2/2 mfd: wm8994: Remove check for active audio in runtime suspend

From: Mark Brown <[email protected]>

Since enabling VMID takes a runtime PM reference there is no need to suppress suspend when doing a runtime suspend. Similarly the digital inputs and outputs are DAPM widgets and therefore the ASoC core will be holding a reference for them.

This used to be required when integration with system suspend was being bodged.

---
 drivers/mfd/wm8994-core.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
drivers/mfd/wm8994-core.c +1 -29
index e8ecb8e..e1c283e 100644
@@ -201,35 +201,7 @@ static int wm8994_suspend(struct device *dev)
 	int ret;
 
 	/* Don't actually go through with the suspend if the CODEC is
-	 * still active (eg, for audio passthrough from CP. */
-	ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1);
-	if (ret < 0) {
-		dev_err(dev, "Failed to read power status: %d\n", ret);
-	} else if (ret & WM8994_VMID_SEL_MASK) {
-		dev_dbg(dev, "CODEC still active, ignoring suspend\n");
-		return 0;
-	}
-
-	ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_4);
-	if (ret < 0) {
-		dev_err(dev, "Failed to read power status: %d\n", ret);
-	} else if (ret & (WM8994_AIF2ADCL_ENA | WM8994_AIF2ADCR_ENA |
-			  WM8994_AIF1ADC2L_ENA | WM8994_AIF1ADC2R_ENA |
-			  WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC1R_ENA)) {
-		dev_dbg(dev, "CODEC still active, ignoring suspend\n");
-		return 0;
-	}
-
-	ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_5);
-	if (ret < 0) {
-		dev_err(dev, "Failed to read power status: %d\n", ret);
-	} else if (ret & (WM8994_AIF2DACL_ENA | WM8994_AIF2DACR_ENA |
-			  WM8994_AIF1DAC2L_ENA | WM8994_AIF1DAC2R_ENA |
-			  WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA)) {
-		dev_dbg(dev, "CODEC still active, ignoring suspend\n");
-		return 0;
-	}
-
+	 * still active for accessory detect. */
 	switch (wm8994->type) {
 	case WM8958:
 	case WM1811:
Signature · 1 line
1.8.3.2
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] mfd: wm8994: Remove check for active audio in runtime suspend

drivers/mfd/wm8994-core.c

Quoted 16 lines · Mark Brown

From: Mark Brown <[email protected]>

Since enabling VMID takes a runtime PM reference there is no need to suppress suspend when doing a runtime suspend. Similarly the digital inputs and outputs are DAPM widgets and therefore the ASoC core will be holding a reference for them.

This used to be required when integration with system suspend was being bodged.

---
 drivers/mfd/wm8994-core.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
drivers/mfd/wm8994-core.c +0 -0

Happy with this. Will apply when I fully understand 1/2.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw
In reply to Mark Brown
Quoted 25 lines · Mark Brown

From: Mark Brown <[email protected]>

Probably the result of a mismerge or rebase failing to notice that the hunk had already been applied.

---
 drivers/mfd/wm8994-core.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/mfd/wm8994-core.c +0 -7
index 781115e..e8ecb8e 100644
@@ -245,20 +245,6 @@ static int wm8994_suspend(struct device *dev)
 		break;
 	}
 
-	switch (wm8994->type) {
-	case WM1811:
-		ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2);
-		if (ret < 0) {
-			dev_err(dev, "Failed to read jackdet: %d\n", ret);
-		} else if (ret & WM1811_JACKDET_MODE_MASK) {
-			dev_dbg(dev, "CODEC still active, ignoring suspend\n");

drivers/mfd/wm8994-core.c static int wm8994_suspend(struct device *dev) · line 250

Quoted 10 lines
drivers/mfd/wm8994-core.c +0 -7
-			return 0;
-		}
-		break;
-	default:
-		break;
-	}
-
 	/* Disable LDO pulldowns while the device is suspended if we
 	 * don't know that something will be driving them. */
 	if (!wm8994->ldo_ena_always_driven)

I don't see the duplicate?

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#4 lore raw
Quoted 1 line · Lee Jones

I don't see the duplicate?

It seems Samuel already applied this but git did the wrong thing during rebase and discarded the subsequent commit which removed the non-duplicate copy rather than the first commit which had been applied. The content of the patches is identical.