Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASoC: es83xx: extract codec configuration with _DSM #4049

Closed

Conversation

plbossart
Copy link
Member

Support for ES83xx is a nightmare, with 10 open issues.

Rather than continue the guesswork for every end-user, we need to extract the information required to configure the codec with the _DSM method.

With this draft PR, I can see meaningful values such as

[    4.422688] es8316 i2c-ESSX8336:00: PLATFORM_MAINMIC_TYPE 0xcc
[    4.422739] es8316 i2c-ESSX8336:00: PLATFORM_HPMIC_TYPE 0xbb
[    4.422791] es8316 i2c-ESSX8336:00: PLATFORM_SPK_TYPE 0x2
[    4.422848] es8316 i2c-ESSX8336:00: PLATFORM_HPDET_INV 0x1
[    4.431040] es8316 i2c-ESSX8336:00: PLATFORM_MIC_DE_POP 0x0

and highly suspicious ones:

[    4.430963] es8316 i2c-ESSX8336:00: PLATFORM_PCM_TYPE 0xff

@yangxiaohua2009 can you please review the definitions and specifically the FIXME that don't seem to be documented in the ASL.

@yangxiaohua2009
Copy link

On Linux we have UCM, tplg, pcm_hw_params and dailinks so most definitions are Windows specific.
I only see the MIC type, HPDET_INVERTED flag useful. These two flags can be used as default value for quirk in sof_essx8336.c
Maybe it's better to change sof_essx8336.c only?

@plbossart
Copy link
Member Author

On Linux we have UCM, tplg, pcm_hw_params and dailinks so most definitions are Windows specific.

It's still useful to log the information, e.g. what we get from NHLT is a hack.

I only see the MIC type, HPDET_INVERTED flag useful. These two flags can be used as default value for quirk in sof_essx8336.c
Maybe it's better to change sof_essx8336.c only?

Yes, the idea what to get default values for quirks, but the machine driver should not try to read DSM from another device.

What I am specifically interested in is which GPIOS need to be selected. This is a gray area where we need DMI quirks and if we can have information on which GPIO is used for what that would solve most of the problems.

@plbossart
Copy link
Member Author

@yangxiaohua2009 can you try this branch on your platforms, I can not sure why we see an undocumented value for PCM_TYPE

[ 4.430963] es8316 i2c-ESSX8336:00: PLATFORM_PCM_TYPE 0xff

@plbossart
Copy link
Member Author

@jwrdegoede This PR might be of interest to you as well for the bytcht-8316.c machine driver, I am not sure however if the _DSM works on those older platforms.

@yangxiaohua2009
Copy link

When the windows driver see the PCM_TYPE=0xFF, it set the format to the default value (DSPA 24bit on Windows)
dsm.zip

@yangxiaohua2009
Copy link

When The Windows driver sees two GPIOs in the dsm, it take the first GPIO as Speaker GPIO amd the second as Headphone GPIO.

@jwrdegoede
Copy link

@jwrdegoede This PR might be of interest to you as well for the bytcht-8316.c machine driver, I am not sure however if the _DSM works on those older platforms.

@plbossart thank you, this is definitely interesting. I will try to give this series a try on one or more BYT/CHT devices with an es8316 codec. It might be quite a while before I get around to this though.

@plbossart
Copy link
Member Author

When the windows driver see the PCM_TYPE=0xFF, it set the format to the default value (DSPA 24bit on Windows) dsm.zip

ok, will document this.

@plbossart
Copy link
Member Author

plbossart commented Dec 1, 2022

When The Windows driver sees two GPIOs in the dsm, it take the first GPIO as Speaker GPIO amd the second as Headphone GPIO.

@yangxiaohua2009 what do you mean by 'see two GPIOS'? we have 5 parameters, and the values are not defined

#define CODEC_GPIO0_FUNC_ARG			0x80
#define CODEC_GPIO1_FUNC_ARG			0x81
#define CODEC_GPIO2_FUNC_ARG			0x82
#define CODEC_GPIO3_FUNC_ARG			0x83
#define CODEC_GPIO4_FUNC_ARG			0x84

@yangxiaohua2009
Copy link

For the GPIO please review the pr #4066

@yangxiaohua2009
Copy link

/*
* TO DECLARE SPEAKER CONTROL LEVEL
* RETURN VALUE = 1, High level enable
*		 0,low level enable
*/
#define  SPK_CTL_IO_LEVEL 0x5B

/* TO DECLARE HEADPHONE SWITCH CONTROL LEVEL
 *	RETURN VALUE = 1, High level enable
 *		       0, low level enable
 */
#define HPSWITCH_CTL_IO_LEVEL 0x4B

Most of the ES83xx codec configuration is exposed in the DSDT table
and accessible via a _DSM method. Start adding basic definitions and
helpers to dump the information.

Co-developed-by: David Yang <[email protected]>
Signed-off-by: David Yang <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Read jack detection information from _DSM and pre-set value. The value
may be overridden with a property set by the machine driver.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
@plbossart
Copy link
Member Author

@yangxiaohua2009 you are going too fast with your changes, I would recommend we first use the two GPIOs assuming the level is active HIGH, and in a second step we invert the logic. It's too confusing otherwise.

@mchehab could you give this PR a try, this removes one of the two quirks for your Huawei device. I think the logic works but as usual I could be wrong.

Read jack detection information from _DSM and pre-set value. The value
may be overridden with a property set by the machine driver.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
There are always two GPIOS used, the first one controls the speaker
and the second one the headset.

This first simplification assumes the GPIOs are active high, in a
future enhancement the level will be adjusted base on _DSM
information.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
@yangxiaohua2009
Copy link

The headphone GPIO is always on now. May be fixed later.

@plbossart
Copy link
Member Author

The headphone GPIO is always on now. May be fixed later.

I don't understand the comment @yangxiaohua2009. Keep in mind I have no background and no test devices... All this work should have been handled by the codec vendor really.

@yangxiaohua2009
Copy link

The headphone GPIO can be always on, because the user can always unplug it. And they won't hear sound from headphone when it unplugged, no matter the headphone GPIO on or not. It's not the case with speaker.

I may submit patches based on this PR

  1. read GPIO high/low level from DSM
  2. revert speaker_en status so that ture means on.
  3. Turn off HP GPIO when stream turned off
  4. remove the redundant line in speaker_power_event which makes gpio level wrong first time the machine startup.

@yangxiaohua2009
Copy link

The GPIO status look like this now right? Future patch may turn off the HP GPIO when stream off, and a headphone_power_event may be needed to turn on the Headphone GPIO next time when stream on and Headphone plugged in.

Speaker GPIO Headphone GPIO
Playing music Speaker on high low
Playing music Headphone on low high
Suspend low high

@plbossart
Copy link
Member Author

@yangxiaohua2009 Can I ask why we care about the GPIO state in suspend? Does this prevent the codec from suspending or does it have a side effect? Usually the GPIO is only set when activating/deactivating a steam, I am not sure what the suspend case is and what should be done on resume.

@@ -143,6 +120,7 @@ static int sof_8336_trigger(struct snd_pcm_substream *substream, int cmd)
if (substream->stream == 0) {
cancel_delayed_work(&priv->pcm_pop_work);
gpiod_set_value_cansleep(priv->gpio_speakers, true);
gpiod_set_value_cansleep(priv->gpio_headphone, false);
}
Copy link

@yangxiaohua2009 yangxiaohua2009 Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning off the headphone GPIO reduces pop/click noise and hum noise. For suspend I mean deactivating a steam. And from here we can see the headphone GPIO is on even if the stream deactivated.

@mchehab
Copy link

mchehab commented Dec 19, 2022

@yangxiaohua2009 you are going too fast with your changes, I would recommend we first use the two GPIOs assuming the level is active HIGH, and in a second step we invert the logic. It's too confusing otherwise.

@mchehab could you give this PR a try, this removes one of the two quirks for your Huawei device. I think the logic works but as usual I could be wrong.

Sorry for taking so long to test it.

With Kernel 6.0.12, without modprobe parameters, this is what it gets::

  • speaker OK (still, sometimes with some low volume clicks from time to time);;
  • headphone is OK (still, with some low volume clicks from time to time);
  • headphone mic works - still with too much clicks.
  • internal mic is not properly detected.

Some logs from Kernel 6.0.12:

[    0.755658] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.755659] software IO TLB: mapped [mem 0x000000008937e000-0x000000008d37e000] (64MB)
[    6.343362] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    6.343588] sof-audio-pci-intel-cnl 0000:00:1f.3: enabling device (0000 -> 0002)
[    6.344190] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    6.344476] sof-audio-pci-intel-cnl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    6.352305] sof-audio-pci-intel-cnl 0000:00:1f.3: use msi interrupt mode
[    6.401470] sof-audio-pci-intel-cnl 0000:00:1f.3: NHLT_DEVICE_I2S detected, ssp_mask 0x1
[    6.401489] sof-audio-pci-intel-cnl 0000:00:1f.3: hda codecs found, mask 4
[    6.462028] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    6.462035] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    6.462047] sof-audio-pci-intel-cnl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[    6.565658] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    6.565664] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    6.574220] sof-essx8336 sof-essx8336: quirk mask 0x1a0
[    6.574223] sof-essx8336 sof-essx8336: quirk SSP0
[    6.574225] sof-essx8336 sof-essx8336: quirk DMIC enabled
[    6.574226] sof-essx8336 sof-essx8336: quirk headphone GPIO enabled
[    6.574226] sof-essx8336 sof-essx8336: quirk headset at mic1 port enabled
[    6.575289] sof-audio-pci-intel-cnl 0000:00:1f.3: Topology: ABI 3:20:1 Kernel ABI 3:23:0
[    6.575445] sof-essx8336 sof-essx8336: ASoC: Parent card not yet available, widget card binding deferred
[    6.598381] es8316 i2c-ESSX8336:00: assuming static mclk
[    6.654551] input: sof-essx8336 Headset as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input30
[    6.654587] input: sof-essx8336 HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input31
[    6.654616] input: sof-essx8336 HDMI/DP,pcm=6 as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input32
[    6.654648] input: sof-essx8336 HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input33

When applying fix/es8336-dsm (merged with Kernel 6.1), the switch controls both headphones and speakers at the same time, so it is a regression on detecting the right GPIOs.

Those are the logs after this series:

[    4.629624] es8316 i2c-ESSX8336:00: HP jack detect inverted 1
[    4.774903] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    4.774980] sof-audio-pci-intel-cnl 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.775155] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.775227] sof-audio-pci-intel-cnl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.781567] sof-audio-pci-intel-cnl 0000:00:1f.3: use msi interrupt mode
[    4.802064] sof-audio-pci-intel-cnl 0000:00:1f.3: NHLT_DEVICE_I2S detected, ssp_mask 0x1
[    4.802068] sof-audio-pci-intel-cnl 0000:00:1f.3: Overriding topology with MCLK mask 0x1 from NHLT
[    4.802069] sof-audio-pci-intel-cnl 0000:00:1f.3: hda codecs found, mask 4
[    4.819462] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    4.819465] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    4.819471] sof-audio-pci-intel-cnl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[    4.925017] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    4.925032] sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    4.935060] sof-essx8336 sof-essx8336: quirk mask 0x120
[    4.935072] sof-essx8336 sof-essx8336: quirk SSP0
[    4.935080] sof-essx8336 sof-essx8336: quirk DMIC enabled
[    4.935086] sof-essx8336 sof-essx8336: quirk headset at mic1 port enabled
[    4.937001] sof-audio-pci-intel-cnl 0000:00:1f.3: Topology: ABI 3:20:1 Kernel ABI 3:23:0
[    4.937547] sof-essx8336 sof-essx8336: ASoC: Parent card not yet available, widget card binding deferred
[    4.967043] es8316 i2c-ESSX8336:00: assuming static mclk
[    5.026272] input: sof-essx8336 Headset as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input30
[    5.026307] input: sof-essx8336 HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input31
[    5.026344] input: sof-essx8336 HDMI/DP,pcm=6 as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input32
[    5.026376] input: sof-essx8336 HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sof-essx8336/sound/card0/input33

Copy link

@mchehab mchehab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch basically breaks headphones on Matebook D15 (dmi product name BOHB-WAX9).

It ends not populating the right values for headphone and speaker GPIOs. It sounds some glue would be needed to properly populate GPIOs on it.

@mchehab
Copy link

mchehab commented Dec 19, 2022

The GPIO status look like this now right? Future patch may turn off the HP GPIO when stream off, and a headphone_power_event may be needed to turn on the Headphone GPIO next time when stream on and Headphone plugged in.

You're basically assuming:

Speaker Headphone Speaker GPIO (gpio 0) Headphone GPIO (gpio1)
Playing music on off high low
Playing music off on low high
Suspend off off low low

However, from some experiments on my Huawei D15, what it has instead is:

Speaker Headphone Speaker GPIO (gpio 1) Headphone GPIO (gpio 0)
Playing music on off high high
Playing music off on low low
Suspend off off low high

So, basically:

  • GPIOs are inverted;
  • headphone GPIO logic is inverted.

{ "headphone-enable-gpios", &enable_gpio0, 1, ACPI_GPIO_QUIRK_ONLY_GPIOIO },
{ }
};

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. For Huawei Matebook D15, the right GPIO table is acpi_enable_both_gpios_rev_order.

static void log_quirks(struct device *dev)
{
dev_info(dev, "quirk mask %#lx\n", quirk);
dev_info(dev, "quirk SSP%ld\n", SOF_ES8336_SSP_CODEC(quirk));
if (quirk & SOF_ES8336_ENABLE_DMIC)
dev_info(dev, "quirk DMIC enabled\n");
if (quirk & SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK)
dev_info(dev, "Speakers GPIO1 quirk enabled\n");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quirk to specify if Speakers is at GPIO 0 or 1 is needed.

@@ -119,8 +97,7 @@ static void pcm_pop_work_events(struct work_struct *work)

gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en);

if (quirk & SOF_ES8336_HEADPHONE_GPIO)
gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);
gpiod_set_value_cansleep(priv->gpio_headphone, !priv->speaker_en);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No (at least on Huawei Matebook D15): there, the headphone GPIO is reversed: true disables, false enables.
So, the right code is, actually:

gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);

as before.

{
.callback = sof_es8336_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"),
DMI_MATCH(DMI_BOARD_NAME, "BOHB-WAX9-PCB-B2"),
},
.driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO |
SOC_ES8336_HEADSET_MIC1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the above, we still need at least one quirk:

  • a quirk to select if GPIO 0 is speaker or microphone;
  • (maybe) a quirk to indicate if true means enabled or disabled for headphone (and maybe another for speaker if needed)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this is the patch I had to apply on the top of yours for headphones to work again:

diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c
index f13e9aa6ae48..8db28bea1ebe 100644
--- a/sound/soc/intel/boards/sof_es8336.c
+++ b/sound/soc/intel/boards/sof_es8336.c
@@ -73,8 +73,8 @@ static const struct acpi_gpio_params enable_gpio0 = { 0, 0, true };
 static const struct acpi_gpio_params enable_gpio1 = { 1, 0, true };
 
 static const struct acpi_gpio_mapping acpi_enable_both_gpios[] = {
-	{ "speakers-enable-gpios", &enable_gpio0, 1, ACPI_GPIO_QUIRK_ONLY_GPIOIO },
-	{ "headphone-enable-gpios", &enable_gpio1, 1, ACPI_GPIO_QUIRK_ONLY_GPIOIO },
+	{ "speakers-enable-gpios", &enable_gpio1, 1, ACPI_GPIO_QUIRK_ONLY_GPIOIO },
+	{ "headphone-enable-gpios", &enable_gpio0, 1, ACPI_GPIO_QUIRK_ONLY_GPIOIO },
 	{ }
 };
 
@@ -96,8 +96,8 @@ static void pcm_pop_work_events(struct work_struct *work)
 		container_of(work, struct sof_es8336_private, pcm_pop_work.work);
 
 	gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en);
-
-	gpiod_set_value_cansleep(priv->gpio_headphone, !priv->speaker_en);
+	/* Headphone logic is inverted: 1 disables it */
+	gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);
 
 }

@plbossart
Copy link
Member Author

Thanks @mchehab for testing, much appreciated.

The headphone mic detection is not part of this branch just yet, I only worked on the jack detection logic.

For the GPIO settings, @yangxiaohua2009 made a point that it's not the GPIO that is inverted but rather the logic level at which the GPIO is active, and we can get that from the _DSM stuff.

@mchehab
Copy link

mchehab commented Dec 20, 2022

Thanks @mchehab for testing, much appreciated.

The headphone mic detection is not part of this branch just yet, I only worked on the jack detection logic.

Headphone mic is detected correctly.

For the GPIO settings, @yangxiaohua2009 made a point that it's not the GPIO that is inverted but rather the logic level at which the GPIO is active, and we can get that from the _DSM stuff.

I added a debug logic to print the entire _DSM. Those are the results:

[    4.749701] es8316 i2c-ESSX8336:00: PLATFORM_MAINMIC_TYPE_ARG=0xbb
[    4.749720] es8316 i2c-ESSX8336:00: PLATFORM_HPMIC_TYPE_ARG=0xbb
[    4.749736] es8316 i2c-ESSX8336:00: PLATFORM_SPK_TYPE_ARG=0x2
[    4.749756] es8316 i2c-ESSX8336:00: PLATFORM_HPDET_INV_ARG=0x1
[    4.750031] es8316 i2c-ESSX8336:00: PLATFORM_PCM_TYPE_ARG=0xff
[    4.750054] es8316 i2c-ESSX8336:00: PLATFORM_MIC_DE_POP_ARG=0x0
[    4.750361] es8316 i2c-ESSX8336:00: PLATFORM_CODEC_TYPE_ARG=0xff
[    4.750386] es8316 i2c-ESSX8336:00: PLATFORM_BUS_SLOT_ARG=0x0
[    4.750410] es8316 i2c-ESSX8336:00: HP_CODEC_LINEIN_PGA_GAIN_ARG=0x6
[    4.750437] es8316 i2c-ESSX8336:00: MAIN_CODEC_LINEIN_PGA_GAIN_ARG=0x8
[    4.750470] es8316 i2c-ESSX8336:00: HP_CODEC_D2SEPGA_GAIN_ARG=0x1
[    4.750506] es8316 i2c-ESSX8336:00: MAIN_CODEC_D2SEPGA_GAIN_ARG=0x1
[    4.750543] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_VOLUME_ARG=0x0
[    4.750581] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_VOLUME_ARG=0x0
[    4.750622] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_ENABLE_ARG=0x1
[    4.750665] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_ENABLE_ARG=0x1
[    4.750711] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_TARGET_LEVEL_ARG=0xa
[    4.750758] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_TARGET_LEVEL_ARG=0xa
[    4.750807] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_MAXGAIN_ARG=0x12
[    4.750858] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_MAXGAIN_ARG=0x12
[    4.750911] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_MINGAIN_ARG=0x8
[    4.750967] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_MINGAIN_ARG=0x8
[    4.751024] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_HLDTIME_ARG=0x0
[    4.751084] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_HLDTIME_ARG=0x0
[    4.751146] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_DCYTIME_ARG=0x0
[    4.751209] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_DCYTIME_ARG=0x0
[    4.751280] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_ATKTIME_ARG=0x2
[    4.751347] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_ATKTIME_ARG=0x2
[    4.751416] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_NGTYPE_ARG=0x3
[    4.751485] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_NGTYPE_ARG=0x3
[    4.751560] es8316 i2c-ESSX8336:00: HP_CODEC_ADC_ALC_NGTHLD_ARG=0x1
[    4.751635] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_ALC_NGTHLD_ARG=0x1
[    4.751664] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_GUI_STEP_ARG=0x3
[    4.751693] es8316 i2c-ESSX8336:00: MAIN_CODEC_ADC_GUI_GAIN_RANGE_ARG=0x3
[    4.751970] es8316 i2c-ESSX8336:00: HEADPHONE_DUMMY_REMOVE_ENABLE_ARG=0xff
[    4.752055] es8316 i2c-ESSX8336:00: HP_CODEC_DAC_HPMIX_HIGAIN_ARG=0x0
[    4.752138] es8316 i2c-ESSX8336:00: SPK_CODEC_DAC_HPMIX_HIGAIN_ARG=0x0
[    4.752222] es8316 i2c-ESSX8336:00: HP_CODEC_DAC_HPMIX_VOLUME_ARG=0xbb
[    4.752306] es8316 i2c-ESSX8336:00: SPK_CODEC_DAC_HPMIX_VOLUME_ARG=0xbb
[    4.752387] es8316 i2c-ESSX8336:00: HP_CODEC_DAC_HPOUT_VOLUME_ARG=0x0
[    4.752482] es8316 i2c-ESSX8336:00: SPK_CODEC_DAC_HPOUT_VOLUME_ARG=0x0
[    4.752536] es8316 i2c-ESSX8336:00: HP_CODEC_LDAC_VOLUME_ARG=0x0
[    4.752584] es8316 i2c-ESSX8336:00: HP_CODEC_RDAC_VOLUME_ARG=0x0
[    4.752633] es8316 i2c-ESSX8336:00: SPK_CODEC_LDAC_VOLUME_ARG=0x0
[    4.752682] es8316 i2c-ESSX8336:00: SPK_CODEC_RDAC_VOLUME_ARG=0x0
[    4.752736] es8316 i2c-ESSX8336:00: HP_CODEC_DAC_AUTOMUTE_ARG=0x0
[    4.752790] es8316 i2c-ESSX8336:00: SPK_CODEC_DAC_AUTOMUTE_ARG=0x1
[    4.752841] es8316 i2c-ESSX8336:00: HP_CODEC_DAC_MONO_ARG=0x0
[    4.752893] es8316 i2c-ESSX8336:00: SPK_CODEC_DAC_MONO_ARG=0x0
[    4.753113] es8316 i2c-ESSX8336:00: HP_CTL_IO_LEVEL_ARG=0xff
[    4.753221] es8316 i2c-ESSX8336:00: SPK_CTL_IO_LEVEL_ARG=0x1
[    4.753496] es8316 i2c-ESSX8336:00: CODEC_GPIO0_FUNC_ARG=0xff
[    4.753780] es8316 i2c-ESSX8336:00: CODEC_GPIO1_FUNC_ARG=0xff
[    4.754046] es8316 i2c-ESSX8336:00: CODEC_GPIO2_FUNC_ARG=0xff
[    4.754339] es8316 i2c-ESSX8336:00: CODEC_GPIO3_FUNC_ARG=0xff
[    4.754515] es8316 i2c-ESSX8336:00: CODEC_GPIO4_FUNC_ARG=0xff
[    4.754574] es8316 i2c-ESSX8336:00: PLATFORM_MCLK_LRCK_FREQ_ARG=0x20
[    4.754584] es8316 i2c-ESSX8336:00: HP jack detect inverted 1
[    5.206283] es8316 i2c-ESSX8336:00: assuming static mclk

And the patch itself:

From d7816e16a10b95ab0aa5e1358d2df038a9b02743 Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <[email protected]>
Date: Tue, 20 Dec 2022 02:45:36 -0300
Subject: [PATCH] es83xx-dsm-common: dump debug info

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

diff --git a/sound/soc/codecs/es83xx-dsm-common.c b/sound/soc/codecs/es83xx-dsm-common.c
index e5ab599ac2c6..034cf0564ba6 100644
--- a/sound/soc/codecs/es83xx-dsm-common.c
+++ b/sound/soc/codecs/es83xx-dsm-common.c
@@ -45,11 +45,249 @@ static int es83xx_dsm(struct device *dev, int arg, int *value)
 	return ret;
 }
 
+static int es83xx_dsm_dump(struct device *dev)
+{
+	int value;
+	int ret;
+
+	ret = es83xx_dsm(dev, PLATFORM_MAINMIC_TYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_MAINMIC_TYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_HPMIC_TYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_HPMIC_TYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_SPK_TYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_SPK_TYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_HPDET_INV_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_HPDET_INV_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_PCM_TYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_PCM_TYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_MIC_DE_POP_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_MIC_DE_POP_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_CODEC_TYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_CODEC_TYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_BUS_SLOT_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_BUS_SLOT_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_LINEIN_PGA_GAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_LINEIN_PGA_GAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_LINEIN_PGA_GAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_LINEIN_PGA_GAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_D2SEPGA_GAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_D2SEPGA_GAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_D2SEPGA_GAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_D2SEPGA_GAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_ENABLE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_ENABLE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_ENABLE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_ENABLE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_TARGET_LEVEL_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_TARGET_LEVEL_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_TARGET_LEVEL_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_TARGET_LEVEL_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_MAXGAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_MAXGAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_MAXGAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_MAXGAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_MINGAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_MINGAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_MINGAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_MINGAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_HLDTIME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_HLDTIME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_HLDTIME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_HLDTIME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_DCYTIME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_DCYTIME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_DCYTIME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_DCYTIME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_ATKTIME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_ATKTIME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_ATKTIME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_ATKTIME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_NGTYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_NGTYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_NGTYPE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_NGTYPE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_ADC_ALC_NGTHLD_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_ADC_ALC_NGTHLD_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_ALC_NGTHLD_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_ALC_NGTHLD_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_GUI_STEP_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_GUI_STEP_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, MAIN_CODEC_ADC_GUI_GAIN_RANGE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "MAIN_CODEC_ADC_GUI_GAIN_RANGE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HEADPHONE_DUMMY_REMOVE_ENABLE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HEADPHONE_DUMMY_REMOVE_ENABLE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_DAC_HPMIX_HIGAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_DAC_HPMIX_HIGAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_DAC_HPMIX_HIGAIN_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_DAC_HPMIX_HIGAIN_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_DAC_HPMIX_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_DAC_HPMIX_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_DAC_HPMIX_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_DAC_HPMIX_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_DAC_HPOUT_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_DAC_HPOUT_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_DAC_HPOUT_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_DAC_HPOUT_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_LDAC_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_LDAC_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_RDAC_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_RDAC_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_LDAC_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_LDAC_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_RDAC_VOLUME_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_RDAC_VOLUME_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_DAC_AUTOMUTE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_DAC_AUTOMUTE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_DAC_AUTOMUTE_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_DAC_AUTOMUTE_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CODEC_DAC_MONO_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CODEC_DAC_MONO_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CODEC_DAC_MONO_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CODEC_DAC_MONO_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, HP_CTL_IO_LEVEL_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "HP_CTL_IO_LEVEL_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, SPK_CTL_IO_LEVEL_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "SPK_CTL_IO_LEVEL_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, CODEC_GPIO0_FUNC_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "CODEC_GPIO0_FUNC_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, CODEC_GPIO1_FUNC_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "CODEC_GPIO1_FUNC_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, CODEC_GPIO2_FUNC_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "CODEC_GPIO2_FUNC_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, CODEC_GPIO3_FUNC_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "CODEC_GPIO3_FUNC_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, CODEC_GPIO4_FUNC_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "CODEC_GPIO4_FUNC_ARG=%#x\n", value);
+
+	ret = es83xx_dsm(dev, PLATFORM_MCLK_LRCK_FREQ_ARG, &value);
+	if (ret >= 0)
+		dev_info(dev, "PLATFORM_MCLK_LRCK_FREQ_ARG=%#x\n", value);
+
+	return 0;
+}
+
 int es83xx_dsm_jack_inverted(struct device *dev)
 {
 	int value;
 	int ret;
 
+	es83xx_dsm_dump(dev);
+
 	ret = es83xx_dsm(dev,  PLATFORM_HPDET_INV_ARG, &value);
 	if (ret < 0)
 		return ret;

@mchehab
Copy link

mchehab commented Dec 20, 2022

Looking the most relevant _DSM, we have:

[    4.749701] es8316 i2c-ESSX8336:00: PLATFORM_MAINMIC_TYPE_ARG=0xbb
[    4.749720] es8316 i2c-ESSX8336:00: PLATFORM_HPMIC_TYPE_ARG=0xbb
[    4.749736] es8316 i2c-ESSX8336:00: PLATFORM_SPK_TYPE_ARG=0x2
[    4.749756] es8316 i2c-ESSX8336:00: PLATFORM_HPDET_INV_ARG=0x1
[    4.753113] es8316 i2c-ESSX8336:00: HP_CTL_IO_LEVEL_ARG=0xff
[    4.753221] es8316 i2c-ESSX8336:00: SPK_CTL_IO_LEVEL_ARG=0x1

So:

  • analog main mic
  • analog headset mic
  • stereo speaker
  • inverted jack detection
  • high level enable for speaker
  • assuming that 0xff means default, default level enable for headset (low level enable?)

Yet, I didn't find a _DSM entry there saying what it is connected to GPIO 0 and GPIO 1.

@mchehab
Copy link

mchehab commented Dec 20, 2022

@plbossart , @yangxiaohua2009 I submitted a PR that replaces this one, at:
plbossart#27
Please review. It would be nice if @yangxiaohua2009 and others could also test against other devices. With that, the only quirk needed for Huawei Matebook D15 is the GPIO 0 and 1 detection.

On this device, GPIO 1 is for Speakers, while GPIO 0 is for Microphone.

@yangxiaohua2009
Copy link

@mchehab please make PR based on topic/sof-dev. Also, you don't need a quirk for speaker GPIO1. Speaker GPIO at GPIO1 is the same as speaker/headphone GPIO active low (inverting the high/low level of both GPIOs).

@mchehab
Copy link

mchehab commented Dec 21, 2022

@mchehab please make PR based on topic/sof-dev. Also, you don't need a quirk for speaker GPIO1.

Ok, I'll rebase it.

Speaker GPIO at GPIO1 is the same as speaker/headphone GPIO active low (inverting the high/low level of both GPIOs).

No, it is not the same, as the suspend state should be disabling both speaker and headphones, so basically, one of the GPIOs should be placed in high level and the other one in low level on suspend.

Also, a quirk is still needed, as the _DSM data on this device is:

[    4.753113] es8316 i2c-ESSX8336:00: HP_CTL_IO_LEVEL_ARG=0xff
[    4.753221] es8316 i2c-ESSX8336:00: SPK_CTL_IO_LEVEL_ARG=0x1

(the 0xff code there is returned simply because the _DSM function returns nothing for 0x4b argument)

Now, I don't have the datasheets for em83xx, but based on the definitions at es83xx-dsm-common.h:

/* Speaker and headphone GPIO control */
#define GPIO_CTL_IO_LEVEL_LOW			0x00 /* low level enable */
#define GPIO_CTL_IO_LEVEL_HIGH			0x01 /* high level enable */

So, the information there doesn't seem to be enough to detect that the GPIOs are inverted. Perhaps the GPIO info it is stored somewhere else at _DSM, for an argument currently not documented? FYI, this is the ES8336 entry from ACPI DSDT table: es8336_acpi.txt

@mchehab
Copy link

mchehab commented Dec 21, 2022

@mchehab please make PR based on topic/sof-dev.

Created as a PR against thesofproject/linux, branch topic/sof-dev: #4112

@plbossart
Copy link
Member Author

@mchehab in the past @yangxiaohua2009 mentioned that 0xff means 'default', it's not an error reading invalid bits. If that's correct, we need to know the default for each parameter. @yangxiaohua2009 can you please help and comment on this?

@plbossart
Copy link
Member Author

replaced by PR #4112

@plbossart plbossart closed this Jan 3, 2023
@mchehab
Copy link

mchehab commented Jan 3, 2023

@mchehab in the past @yangxiaohua2009 mentioned that 0xff means 'default', it's not an error reading invalid bits. If that's correct, we need to know the default for each parameter. @yangxiaohua2009 can you please help and comment on this?

the _DSM method from the ACPI clear is:

Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg0 == Buffer (0x10)
                        {
                            /* 0000 */  0x04, 0x0C, 0x80, 0xA9, 0x16, 0xE0, 0x3E, 0x34,  // ......>4
                            /* 0008 */  0x41, 0xF4, 0x6B, 0xCC, 0xE7, 0x0F, 0x43, 0x32   // A.k...C2
                        }))
                {
                    If ((Arg2 == Zero))
                    {
                        Return (0xBB)
                    }
...
                    If ((Arg2 == 0xFE))
                    {
                        ^^^LPCB.EC0.XXJC = One
                        Return (0xAA)
                    }
                }
                Return (0xFF)
            }
        }

So, yeah, 0xff is the default value, but it can also mean an invalid value for arg2 (see https://github.com/thesofproject/linux/files/10277361/es8336_acpi.txt).

@yangxiaohua2009
Copy link

For the gpio, please return 0 (active high) for value 0xff. I tested PR #4112 on my devices and it works fine. The speaker GPIO is turned off when music stopped.

0xff means default value, and it should be the value most device use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants