summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
AgeCommit message (Collapse)Author
2020-12-31ALSA: hda/conexant: add a new hda codec CX11970bo liu
The current kernel does not support the cx11970 codec chip. Add a codec configuration item to kernel. [ Minor coding style fix by tiwai ] Signed-off-by: bo liu <bo.liu@senarytech.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201229035226.62120-1-bo.liu@senarytech.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-09ALSA: Use fallthrough pseudo-keywordGustavo A. R. Silva
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200708203236.GA5112@embeddedor Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-06-18ALSA: hda/conexant: Use the new vmaster mute LED helperTakashi Iwai
Convert the mute LED handling in Conexant codec to the new vmaster mute helper. A point to be cautiously handled is that the value passed to the callback is inverted; the vmaster passes "enabled" (0 = mute), while LED classdev passes "brightness" (1 = mute). Also the assignment of the default vmaster hook is moved at a later point after the mute hook is set up. This assures no nested hook. Finally, since we enable the mute-LED kcontrols always in the helper side, the extra vmaster_mute_enum flag set up is dropped. Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-11-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-06-18ALSA: hda/conexant: Convert to cdev-variant of mic-mute LED controlsTakashi Iwai
This patch converts the remaining user of snd_hda_gen_add_micmute_led() in Conexant codec driver into the new snd_hda_gen_add_micmute_led_cdev(). Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-26Merge branch 'for-linus' into for-nextTakashi Iwai
Resolve conflicts and correct the hex numbers, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-22ALSA: hda - Add docking station support for Lenovo Thinkpad T420sPeter Große
Lenovo Thinkpad T420s uses the same codec as T420, so apply the same quirk to enable audio output on a docking station. Signed-off-by: Peter Große <pegro@friiks.de> Link: https://lore.kernel.org/r/20200122180106.9351-1-pegro@friiks.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-03ALSA: hda - constify and cleanup static NodeID tablesMichał Mirosław
Make hda_nid_t tables static const, as they are not intended to be modified by callees. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/5150c94101c9534f4c8e987324f6912c16d459f6.1578043216.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-11-20ALSA: hda - Add mute led support for HP ProBook 645 G4Kai-Heng Feng
Mic mute led does not work on HP ProBook 645 G4. We can use CXT_FIXUP_MUTE_LED_GPIO fixup to support it. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20191120082035.18937-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-19ALSA: hda - Fixes inverted Conexant GPIO mic mute ledJeronimo Borque
"enabled" parameter historically referred to the device input or output, not to the led indicator. After the changes added with the led helper functions the mic mute led logic refers to the led and not to the mic input which caused led indicator to be negated. Fixing logic in cxt_update_gpio_led and updated cxt_fixup_gpio_mute_hook Also updated debug messages to ease further debugging if necessary. Fixes: 184e302b46c9 ("ALSA: hda/conexant - Use the mic-mute LED helper") Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jeronimo Borque <jeronimo@borque.com.ar> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-14ALSA: hda - Add a generic reboot_notifyHui Wang
Make codec enter D3 before rebooting or poweroff can fix the noise issue on some laptops. And in theory it is harmless for all codecs to enter D3 before rebooting or poweroff, let us add a generic reboot_notify, then realtek and conexant drivers can call this function. Cc: stable@vger.kernel.org Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-14ALSA: hda - Let all conexant codec enter D3 when rebootingHui Wang
We have 3 new lenovo laptops which have conexant codec 0x14f11f86, these 3 laptops also have the noise issue when rebooting, after letting the codec enter D3 before rebooting or poweroff, the noise disappers. Instead of adding a new ID again in the reboot_notify(), let us make this function apply to all conexant codec. In theory make codec enter D3 before rebooting or poweroff is harmless, and I tested this change on a couple of other Lenovo laptops which have different conexant codecs, there is no side effect so far. Cc: stable@vger.kernel.org Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-25ALSA: hda - Add a conexant codec entry to let mute led workHui Wang
This conexant codec isn't in the supported codec list yet, the hda generic driver can drive this codec well, but on a Lenovo machine with mute/mic-mute leds, we need to apply CXT_FIXUP_THINKPAD_ACPI to make the leds work. After adding this codec to the list, the driver patch_conexant.c will apply THINKPAD_ACPI to this machine. Cc: stable@vger.kernel.org Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 32Thomas Gleixner
Based on 1 normalized pattern(s): this driver is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this driver is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 18 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190520170857.186505395@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-13ALSA: hda - add more quirks for HP Z2 G4 and HP Z240Jaroslav Kysela
Apply the HP_MIC_NO_PRESENCE fixups for the more HP Z2 G4 and HP Z240 models. Reported-by: Jeff Burrell <jeff.burrell@hp.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-02-07ALSA: hda - Add quirk for HP EliteBook 840 G5Jurica Vukadin
This enables mute LED support and fixes switching jacks when the laptop is docked. Signed-off-by: Jurica Vukadin <jurica.vukadin@rt-rk.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-01-21ALSA: hda - Add mute LED support for HP ProBook 470 G5Anthony Wong
Support speaker and mic mute LEDs on HP ProBook 470 G5. BugLink: https://bugs.launchpad.net/bugs/1811254 Signed-off-by: Anthony Wong <anthony.wong@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-12-16ALSA: hda: add mute LED support for HP EliteBook 840 G4Mantas Mikulėnas
Tested with 4.19.9. v2: Changed from CXT_FIXUP_MUTE_LED_GPIO to CXT_FIXUP_HP_DOCK because that's what the existing fixups for EliteBooks use. Signed-off-by: Mantas Mikulėnas <grawity@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12ALSA: hda - Add mic quirk for the Lenovo G50-30 (17aa:3905)Jeremy Cline
The Lenovo G50-30, like other G50 models, has a Conexant codec that requires a quirk for its inverted stereo dmic. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1249364 Reported-by: Alexander Ploumistos <alex.ploumistos@gmail.com> Tested-by: Alexander Ploumistos <alex.ploumistos@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jeremy Cline <jcline@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-30ALSA: hda: move hda_codec.h to include/soundPierre-Louis Bossart
As suggested by Takashi, move this header file to make it easier to include from e.g. the Intel Skylake driver in follow-up patches Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-29Merge branch 'for-linus' into topic/virmidiTakashi Iwai
Pull the latest ALSA sequencer fixes for the further development of virmidi. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-28ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecsPark Ju Hyung
On rare occasions, we are still noticing that the internal speaker spitting out spurious noises even after adding the problematic codec to the list. Adding a 10ms artificial delay before rebooting fixes the issue entirely. Patch for Realtek codecs also adds the same amount of delay after entering D3. Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-28ALSA: hda - Turn CX8200 into D3 as well upon rebootPark Ju Hyung
As an equivalent codec with CX20724, CX8200 is also subject to the reboot bug. Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims to this issue, causing extremely loud noises upon reboot. Now that we know that this bug is subject to multiple codecs, fix the comment as well. Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-17Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge for further cleanup / improvements on rawmidi and HD-audio stuff. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-16ALSA: hda: add mute led support for HP ProBook 455 G5Po-Hsu Lin
Audio mute led does not work on HP ProBook 455 G5, this can be fixed by using CXT_FIXUP_MUTE_LED_GPIO to support it. BugLink: https://bugs.launchpad.net/bugs/1781763 Reported-by: James Buren Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-27ALSA: hda - Kill snd_hda_codec_update_cache()Takashi Iwai
snd_hda_codec_update_cache() used to serve for a slightly different purpose from snd_hdac_write_cache(), but now both of them became identical. Let's unify and replace with the latter one consistently. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-25ALSA: hda/conexant - Clean up beep codeTakashi Iwai
Like the previous commit for Realtek codec, the similar cleanup work can be applied to Conexant codec, too. A slight difference is that the call of cx_auto_parse_beep() is moved after snd_hda_gen_parse_auto_config(). It's not strictly needed, but it'd be good to make the creation of such beep mixers at the end, which matches with the former situation. Along with this conversion, cx_auto_build_controls() becomes just calling snd_hda_gen_build_controls(), so it's simply replaced with snd_hda_gen_build_controls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-21ALSA: hda - Sanity check of unexpected cap_sync_hook overrideTakashi Iwai
There are a couple of places setting cap_sync_hook in the codec drivers, and they just overwrite the value. Add a sanity check via WARN_ON() in case if an old non-NULL value is overridden and forgotten. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-21ALSA: hda/conexant - Use the mic-mute LED helperTakashi Iwai
Convert to use the common helper for controlling the mic mute LED for HP laptops, just as we've done for Realtek codecs. This will give the mic mute LED enum as gratis. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-12ALSA: hda: add dock and led support for HP ProBook 640 G4Dennis Wassenberg
This patch adds missing initialisation for HP 2013 UltraSlim Dock Line-In/Out PINs and activates keyboard mute/micmute leds for HP ProBook 640 G4 Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-12ALSA: hda: add dock and led support for HP EliteBook 830 G5Dennis Wassenberg
This patch adds missing initialisation for HP 2013 UltraSlim Dock Line-In/Out PINs and activates keyboard mute/micmute leds for HP EliteBook 830 G5 Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-22ALSA: hda/conexant - Add hp-mic-fix model stringTakashi Iwai
Add "hp-mic-fix" model string for Conexant codecs so that user can test the quirk without recompiling. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-22ALSA: hda/conexant - Add fixup for HP Z2 G4 workstationTakashi Iwai
HP Z2 G4 requires the same workaround as other HP machines that have no mic-pin detection. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-24ALSA: hda - Use a macro for snd_array iteration loopsTakashi Iwai
Introduce a new helper macro, snd_array_for_each(), to iterate for each snd_array element. It slightly improves the readability than lengthy open codes at each place. Along with it, add const prefix to some obvious places. There should be no functional changes by this. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-08ALSA: hda: add dock and led support for HP ProBook 640 G2Dennis Wassenberg
This patch adds missing initialisation for HP 2013 UltraSlim Dock Line-In/Out PINs and activates keyboard mute/micmute leds for HP ProBook 640 G2 Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-08ALSA: hda: add dock and led support for HP EliteBook 820 G3Dennis Wassenberg
This patch adds missing initialisation for HP 2013 UltraSlim Dock Line-In/Out PINs and activates keyboard mute/micmute leds for HP EliteBook 820 G3 Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-22ALSA: hda - Add MIC_NO_PRESENCE fixup for 2 HP machinesHui Wang
There is a headset jack on the front panel, when we plug a headset into it, the headset mic can't trigger unsol events, and read_pin_sense() can't detect its presence too. So add this fixup to fix this issue. Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-23ALSA: hda - Add stereo mic quirk for Lenovo G50-70 (17aa:3978)Takashi Iwai
Lenovo G50-70 (17aa:3978) with Conexant codec chip requires the similar workaround for the inverted stereo dmic like other Lenovo models. Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1020657 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-07-25ALSA: hda - Add mute led support for HP ProBook 440 G4Kai-Heng Feng
Mic mute led does not work on HP ProBook 440 G4. We can use CXT_FIXUP_MUTE_LED_GPIO fixup to support it. BugLink: https://bugs.launchpad.net/bugs/1705586 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: <stable@vger.kernel.org> # v4.12+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-08ALSA: hda - Add mute led support for HP EliteBook 840 G3Florin Tudorache
Signed-off-by: Florin Tudorache <florin_tudorache@live.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-19ALSA: hda - Add HP ZBook 15u G3 Conexant CX20724 GPIO mute ledsJerónimo Borque
The HP ZBook 15u G3 has a Conexant CX20724 with mute led on GPIO1 and mic mute led on GPIO2. Adding CXT_FIXUP_MUTE_LED_GPIO inspired on patch_realtek's one. Signed-off-by: Jerónimo Borque <jeronimo@borque.com.ar> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20ALSA: hda - add support for docking station for HP 840 G3Jaroslav Kysela
This tested patch adds missing initialization for Line-In/Out PINs for the docking station for HP 840 G3. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-12-06ALSA: hda - Gate the mic jack on HP Z1 Gen3 AiOTakashi Iwai
HP Z1 Gen3 AiO with Conexant codec doesn't give an unsolicited event to the headset mic pin upon the jack plugging, it reports only to the headphone pin. It results in the missing mic switching. Let's fix up by simply gating the jack event. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-27ALSA: hda - Add the top speaker pin config for HP Spectre x360Takashi Iwai
HP Spectre x360 with CX20724 codec has two speaker outputs while the BIOS sets up only the bottom one (NID 0x17) and disables the top one (NID 0x1d). This patch adds a fixup simply defining the proper pincfg for NID 0x1d so that the top speaker works as is. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=169071 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-10ALSA: hda - Apply reboot D3 fix for CX20724 codec, tooTakashi Iwai
Just like CX20722, CX7024 codec also requires the power down at reboot in order to reduce the noise at reboot/shutdown. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=113511 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-03Merge branch 'for-linus' into for-nextTakashi Iwai
2015-12-03ALSA: hda - Enable power_save_node for CX20722David Henningsson
I've tested it on one device and it works fine, no clicks. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-01ALSA: hda - Add Conexant CX8200 (14f1:2008) codec entryTakashi Iwai
It's supposed to be equivalent with CX20724. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-01ALSA: hda - Correct codec names for 14f1:50f1 and 14f1:50f3Takashi Iwai
The numbers aren't always linear, just like in the real world. Correct to the right numbers stated in the datasheet (although we can't trust the datasheet as well). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-20ALSA: hda - convert to hda_device_idTakashi Iwai
Finally we have a proper infrastructure to generate the modaliases automatically, let's move to hda_device_id from the legacy hda_codec_preset that contains basically the same information. The patch function hook is stored in driver_data field, which is long, and we need an explicit cast. Other than that, the conversion is mostly straightforward. Each entry is even simplified using a macro, and the lengthy (and error-prone) manual modaliases got removed. As a result, we achieved a quite good diet: 14 files changed, 407 insertions(+), 595 deletions(-) Reviewed-by: Vinod Koul <vinod.koul@intel.com> Tested-by: Subhransu S Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-13ALSA: hda - Fix inverted internal mic on Lenovo G50-80David Henningsson
Add the appropriate quirk to indicate the Lenovo G50-80 has a stereo mic input where one channel has reverse polarity. Alsa-info available at: https://launchpadlibrarian.net/220846272/AlsaInfo.txt Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/bugs/1504778 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>