Skip to content

Commit

Permalink
ASoC: es8336: don't invert jack detection on Huawei D15
Browse files Browse the repository at this point in the history
Despite what DSM reports, jack detection is not inverted on this
device.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mchehab committed Dec 30, 2023
1 parent b0f5cf2 commit 3ef3117
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/codecs/es8316.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ static void es8316_enable_jack_detect(struct snd_soc_component *component,
if (device_property_read_bool(component->dev,
"everest,jack-detect-inverted"))
es8316->jd_inverted = true;
if (device_property_read_bool(component->dev,
"everest,jack-detect-not-inverted"))
es8316->jd_inverted = false;

mutex_lock(&es8316->lock);

Expand Down
5 changes: 5 additions & 0 deletions sound/soc/intel/boards/sof_es8336.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define SOF_ES8336_OVERRIDE_DSM_LOW_HIGH BIT(9)
#define SOF_ES8336_SPK_EN_LOW BIT(10)
#define SOF_ES8336_HP_EN_LOW BIT(11)
#define SOF_ES8336_JD_NOT_INVERTED BIT(12)

static unsigned long quirk;

Expand Down Expand Up @@ -339,6 +340,7 @@ static const struct dmi_system_id sof_es8336_quirk_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "BOHB-WAX9-PCB-B2"),
},
.driver_data = (void *)(SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK |
SOF_ES8336_JD_NOT_INVERTED |
SOF_ES8336_OVERRIDE_DSM_LOW_HIGH |
SOF_ES8336_HP_EN_LOW)

Expand Down Expand Up @@ -692,6 +694,9 @@ static int sof_es8336_probe(struct platform_device *pdev)

if (quirk & SOF_ES8336_JD_INVERTED)
props[cnt++] = PROPERTY_ENTRY_BOOL("everest,jack-detect-inverted");
else if (quirk & SOF_ES8336_JD_NOT_INVERTED)
props[cnt++] = PROPERTY_ENTRY_BOOL("everest,jack-detect-not-inverted");


if (cnt) {
fwnode = fwnode_create_software_node(props, NULL);
Expand Down

0 comments on commit 3ef3117

Please sign in to comment.