Skip to contentSkip to conversation

mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs

PATCH Applied Hans de Goede 2 participants 2 messages Oct 14, 2023 – Oct 19, 2023

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

PATCH 1/1 mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs

Commit 9e86b2ad4c11 changed the channel used for HPDET detection (headphones vs lineout detection) from being hardcoded to ARIZONA_ACCDET_MODE_HPL (HP left channel) to it being configurable through arizona_pdata.hpdet_channel the DT/OF parsing added for filling arizona_pdata on devicetree platforms ensures that arizona_pdata.hpdet_channel gets set to ARIZONA_ACCDET_MODE_HPL when not specified in the devicetree-node.

But on ACPI platforms where arizona_pdata is filled by arizona_spi_acpi_probe() arizona_pdata.hpdet_channel was not getting set, causing it to default to 0 aka ARIZONA_ACCDET_MODE_MIC.

This causes headphones to get misdetected as line-out on some models. Fix this by setting hpdet_channel = ARIZONA_ACCDET_MODE_HPL.

Fixes e933836744a2 ("mfd: arizona: Add support for ACPI enumeration of WM5102 connected over SPI")
---
 drivers/mfd/arizona-spi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mfd/arizona-spi.c +3 -0
index 02cf4f3e91d7..de5d894ac04a 100644
@@ -159,6 +159,9 @@ static int arizona_spi_acpi_probe(struct arizona *arizona)
 	arizona->pdata.micd_ranges = arizona_micd_aosp_ranges;
 	arizona->pdata.num_micd_ranges = ARRAY_SIZE(arizona_micd_aosp_ranges);
 
+	/* Use left headphone speaker for HP vs line-out detection */
+	arizona->pdata.hpdet_channel = ARIZONA_ACCDET_MODE_HPL;
+
 	return 0;
 }
 
Signature · 1 line
2.41.0
maintainer Applied
#1 lore raw

Re: (subset) [PATCH] mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs

Quoted 9 lines · Hans de Goede

Commit 9e86b2ad4c11 changed the channel used for HPDET detection (headphones vs lineout detection) from being hardcoded to ARIZONA_ACCDET_MODE_HPL (HP left channel) to it being configurable through arizona_pdata.hpdet_channel the DT/OF parsing added for filling arizona_pdata on devicetree platforms ensures that arizona_pdata.hpdet_channel gets set to ARIZONA_ACCDET_MODE_HPL when not specified in the devicetree-node.

[...]

Applied, thanks!

[1/1] mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs

      commit: 76a2f781da567a0ff7bd064d3ede064b29973b01

--
Lee Jones [李琼斯]