On Fri, Aug 16, 2024 at 06:20:34PM +0800, Zhang Yi wrote:
+#if IS_ENABLED(CONFIG_SND_SOC_MT8188_MT6359)
- const int hs_keys[] = {
SND_JACK_BTN_0, SND_JACK_BTN_2, SND_JACK_BTN_3
- };
+#else
- const int hs_keys[] = {
SND_JACK_BTN_0, SND_JACK_BTN_1, SND_JACK_BTN_2
- };
+#endif
The support for this device was added in e794a894427b1d ("ASoC: mediatek: mt8188-mt6359: add es8326 support") which was added in v6.8 so this would also be a potential issue in mainline, given that this is likely only used by Chromebooks and didn't make it to a LTS yet we could possibly give it a go but we might have to revert.
Because this change is to adapt mt8188-mt6359.On mt8188-mt6359, SND_JACK_BTN_2 corresponds to KEY_VOLUMEUP and SND_JACK_BTN_3 corresponds to KEY_VOLUMEDOWN. So we modified the es8326 driver to adapt the mt8188-mt6359. The changes we are making will not affect the application on all platforms.
If you feel that this approach may still be risky, we can solve this issue by modifying the button about ES8326 in the machine driver of the mt8188
Yes, doing things in the machine driver would be much better. Since that machine driver supports a bunch of machines it should probably still be runtime detected even there.