From: nickel@altlinux.org To: devel-kernel@lists.altlinux.org Cc: Vasiliy Kovalev <kovalev@altlinux.org> Subject: [d-kernel] [PATCH 2/3] ASoC: Intel: sof_es8336: modify driver source code for v5.15.x Date: Tue, 20 Dec 2022 11:10:50 +0300 Message-ID: <20221220081051.299971-3-nickel@altlinux.org> (raw) In-Reply-To: <20221220081051.299971-1-nickel@altlinux.org> From: Vasiliy Kovalev <kovalev@altlinux.org> - readd dmi match info for following laptops: Aquarius Cmp NS685U R11 CHUWI Innovation And Technology Hi10 X Kraftway ACCORD S15T - add dmi match info for laptop HUAWEI D15 Matebook - in the updated version of the driver, the default GPIO speakers configuration card has been changed. Now there is no need to apply quirks for some laptop models: 3Logic Group Graviton N15i 3Logic Group Graviton N15i-K2 3Logic Group Lime 15.6 DEPO Computers DPC156 ICL Si16 - disable I2S link information from NHLT - rename function snd_soc_card_jack_new_pins -> snd_soc_card_jack_new: there is no need to add the source code for the new function, so we will return the link to the existing one - report the number of DMic's to the UCM: when applying the quirk about the presence of digital microphones in the system, you should also provide their number to the UCM manager for their correct configuration Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> Signed-off-by: Nikolai Kostrigin <nickel@altlinux.org> --- sound/soc/intel/boards/sof_es8336.c | 78 +++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c index 606cc3242a60f..4499f6b191d95 100644 --- a/sound/soc/intel/boards/sof_es8336.c +++ b/sound/soc/intel/boards/sof_es8336.c @@ -261,7 +261,7 @@ static int sof_es8316_init(struct snd_soc_pcm_runtime *runtime) if (ret) return ret; - ret = snd_soc_card_jack_new_pins(card, "Headset", + ret = snd_soc_card_jack_new(card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, &priv->jack, sof_es8316_jack_pins, ARRAY_SIZE(sof_es8316_jack_pins)); @@ -303,6 +303,23 @@ static int sof_es8336_quirk_cb(const struct dmi_system_id *id) * if the topology file is modified as well. */ static const struct dmi_system_id sof_es8336_quirk_table[] = { + { + .callback = sof_es8336_quirk_cb, + .matches = { + /* market name: Aquarius Cmp NS685U R11 */ + DMI_MATCH(DMI_SYS_VENDOR, "Aquarius"), + DMI_MATCH(DMI_PRODUCT_NAME, "NS685U R11"), + }, + .driver_data = (void *)(SOF_ES8336_JD_INVERTED) + }, + { + .callback = sof_es8336_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "CHUWI Innovation And Technology"), + DMI_MATCH(DMI_BOARD_NAME, "Hi10 X"), + }, + .driver_data = (void *)SOF_ES8336_SSP_CODEC(2) + }, { .callback = sof_es8336_quirk_cb, .matches = { @@ -311,6 +328,14 @@ static const struct dmi_system_id sof_es8336_quirk_table[] = { }, .driver_data = (void *)(SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK) }, + { + .callback = sof_es8336_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"), + DMI_MATCH(DMI_BOARD_NAME, "BOD-WXX9-PCB-B4"), + }, + .driver_data = (void *)(SOF_ES8336_ENABLE_DMIC) + }, { .callback = sof_es8336_quirk_cb, .matches = { @@ -320,6 +345,15 @@ static const struct dmi_system_id sof_es8336_quirk_table[] = { .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO | SOC_ES8336_HEADSET_MIC1) }, + { + .callback = sof_es8336_quirk_cb, + .matches = { + /* market name: Kraftway ACCORD S15T */ + DMI_MATCH(DMI_SYS_VENDOR, "Kraftway"), + DMI_MATCH(DMI_BOARD_NAME, "S15T"), + }, + .driver_data = (void *)(SOF_ES8336_JD_INVERTED) + }, {} }; @@ -597,25 +631,25 @@ static int sof_es8336_probe(struct platform_device *pdev) * Because more than one SSP will be enabled for HDMI capture hence wrong codec * SSP will be set. */ - if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER) { - if (!mach->mach_params.i2s_link_mask) { - dev_warn(dev, "No I2S link information provided, using SSP0. This may need to be modified with the quirk module parameter\n"); - } else { - /* - * Set configuration based on platform NHLT. - * In this machine driver, we can only support one SSP for the - * ES8336 link. - * In some cases multiple SSPs can be reported by NHLT, starting MSB-first - * seems to pick the right connection. - */ - unsigned long ssp; - - /* fls returns 1-based results, SSPs indices are 0-based */ - ssp = fls(mach->mach_params.i2s_link_mask) - 1; - - quirk |= ssp; - } - } +// if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER) { +// if (!mach->mach_params.i2s_link_mask) { +// dev_warn(dev, "No I2S link information provided, using SSP0. This may need to be modified with the quirk module parameter\n"); +// } else { +// /* +// * Set configuration based on platform NHLT. +// * In this machine driver, we can only support one SSP for the +// * ES8336 link. +// * In some cases multiple SSPs can be reported by NHLT, starting MSB-first +// * seems to pick the right connection. +// */ +// unsigned long ssp; +// +// /* fls returns 1-based results, SSPs indices are 0-based */ +// ssp = fls(mach->mach_params.i2s_link_mask) - 1; +// +// quirk |= ssp; +// } +// } if (mach->mach_params.dmic_num) quirk |= SOF_ES8336_ENABLE_DMIC; @@ -627,8 +661,10 @@ static int sof_es8336_probe(struct platform_device *pdev) } log_quirks(dev); - if (quirk & SOF_ES8336_ENABLE_DMIC) + if (quirk & SOF_ES8336_ENABLE_DMIC){ dmic_be_num = 2; + mach->mach_params.dmic_num = 2; + } /* compute number of dai links */ sof_es8336_card.num_links = 1 + dmic_be_num + hdmi_num; -- 2.33.5
next prev parent reply other threads:[~2022-12-20 8:10 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-12-20 8:10 [d-kernel] [PATCH 0/3] Backport improved ES8336 codec driver from 6.0 to 5.15 nickel 2022-12-20 8:10 ` [d-kernel] [PATCH 1/3] ASoC: Intel: sof_es8336: copy driver source code from kernel v6.0.9 nickel 2022-12-20 8:10 ` nickel [this message] 2022-12-20 8:10 ` [d-kernel] [PATCH 3/3] ASoC: Intel: sof_es8336: backport Kconfig settings " nickel 2022-12-20 15:14 ` [d-kernel] [PATCH 0/3] Backport improved ES8336 codec driver from 6.0 to 5.15 Vitaly Chikunov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221220081051.299971-3-nickel@altlinux.org \ --to=nickel@altlinux.org \ --cc=devel-kernel@lists.altlinux.org \ --cc=kovalev@altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux kernel packages development This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \ devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com public-inbox-index devel-kernel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git