summaryrefslogtreecommitdiff
path: root/sound/pci/hda
AgeCommit message (Collapse)AuthorFilesLines
2023-11-10Merge tag 'sound-fix-6.7-rc1' of ↵Linus Torvalds2-7/+41
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of fixes for rc1. The majority of changes are various ASoC driver-specific small fixes and usual HD-audio quirks, while there are a couple of core changes: a fix in ALSA core procfs code to avoid deadlocks at disconnection and an ASoC core fix for DAPM clock widgets" * tag 'sound-fix-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: OSS: dmasound/paula: Convert to platform remove callback returning void ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus ALSA: info: Fix potential deadlock at disconnection ASoC: nau8540: Add self recovery to improve capture quility ALSA: hda/realtek: Add support dual speaker for Dell ALSA: hda: Add ASRock X670E Taichi to denylist ALSA: hda/realtek: Add quirk for ASUS UX7602ZM ASoC: SOF: sof-client: trivial: fix comment typo ASoC: dapm: fix clock get name ASoC: hdmi-codec: register hpd callback on component probe ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages ASoC: da7219: Improve system suspend and resume handling ASoC: codecs: Modify macro value error ASoC: codecs: Modify the wrong judgment of re value ASoC: codecs: Modify the maximum value of calib ASoC: amd: acp: fix for i2s mode register field update ASoC: codecs: aw88399: Fix -Wuninitialized in aw_dev_set_vcalb() ASoC: rt712-sdca: fix speaker route missing issue ASoC: rockchip: Fix unused rockchip_i2s_tdm_match warning for !CONFIG_OF ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings
2023-11-09ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c busVitalii Torshyn1-0/+6
Proposed patch fixes initialization of CSC3551 on the UM5302LA laptop. Patching DSDT table is not required since ASUS did added _DSD entry. Nothing new introduced but reused work started by Stefan B. Currently there is no official firmware available for 10431A83 on cirrus git unfortunately. For testing used 104317f3 (which is also seems on i2c bus): $ cd /lib/firmware/cirrus/ && \ for fw in $(find ./ -name '*104317f3*'); do newfw=$(echo $fw | sed 's/104317f3/10431a83/g'); echo echo "$fw -> $newfw"; ln -s $f $newfw; done With the patch applied to 6.6.0 and obviously symlinks to 104317F3 FW, speakers works and to my susrprise they sound quite good and loud without distortion. Probably confirmation from cirrus team is needed on firmware. Signed-off-by: Vitalii Torshyn <vitaly.torshyn@gmail.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=218119 Link: https://lore.kernel.org/r/CAHiQ-bCMPpCJ8eOYAaVVoqGkFixS1qTgSS4xfbZvL4oZV9LYew@mail.gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-08ALSA: hda/realtek: Add support dual speaker for DellKailang Yang1-7/+33
Dell new platform support dual speaker. But BIOS verb table only show one speaker. It will fill verb table for second speaker. Then bind with CS AMP model. Fixes: de90f5165b1c ("ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops") Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.org/r/4dd390a77bf742b8a518ac2deee00b0f@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-07ALSA: hda: Add ASRock X670E Taichi to denylistAlexander Koskovich1-0/+1
Recent AMD platforms expose an HD-audio bus but without any actual codecs, which is internally tied with a USB-audio device, supposedly. It results in "no codecs" error of HD-audio bus driver, and it's nothing but a waste of resources. snd_hda_intel 0000:59:00.6: no codecs found! Signed-off-by: Alexander Koskovich <akoskovich@pm.me> Link: https://lore.kernel.org/r/20231105152834.5620-1-akoskovich@pm.me Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-07ALSA: hda/realtek: Add quirk for ASUS UX7602ZMAlex Spataru1-0/+1
Enables the SPI-connected CSC35L41 audio amplifier for this laptop model. As of BIOS version 303 it's still necessary to modify the ACPI table to add the related _DSD properties: https://github.com/alex-spataru/asus_zenbook_ux7602zm_sound/ Signed-off-by: Alex Spataru <alex_spataru@outlook.com> Link: https://lore.kernel.org/r/DS7PR07MB7621BB5BB14F5473D181624CE3A4A@DS7PR07MB7621.namprd07.prod.outlook.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-03Merge tag 'sound-6.7-rc1' of ↵Linus Torvalds14-119/+866
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "Most of changes at this time are for ASoC, spread over ASoC core and drivers due to the API prefix standardization. Other than that, there have little change wrt API, rather lots of driver-specific updates and fixes. Some highlight below: ASoC: - Standardization of API prefix - GPIO API usage improvements - Support for HDA patches - Lots of work on SOF, including crash dump support - Fixes for noise when stopping some Sounwire CODECs - Support for AMD platforms with es83xx, AMD ACP 6.3 and 7.0, Awinc AT87390 and AW88399, many Intel platforms, many Mediatek platforms, Qualcomm SM6115 and SC7180 platforms, Richtek RTQ9128 and Texas Instruments TAS575x HD-audio and USB-audio: - Deferred probe support of audio component binding - More fixes and enhancements for Cirrus subcodecs - USB Scarlett2 mixer and McIntosh DSD quirk Others: - More enhancement of snd-aloop driver - Update MAINTAINERS entry for linux-sound mailing list" * tag 'sound-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (485 commits) ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() ALSA: hda: cs35l41: mark cs35l41_verify_id() static ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag ASoC: soc-dai: add flag to mute and unmute stream during trigger ASoC: ams-delta.c: use component after check ASoC: amd: acp: select SND_SOC_AMD_ACP_LEGACY_COMMON for ACP63 ASoC: codecs: aw88399: fix typo in Kconfig select ASoC: amd: acp: add ACPI dependency ASoC: Intel: avs: Add rt5514 machine board ASoC: Intel: avs: Add rt5514 machine board ALSA: scarlett2: Add missing check with firmware version control ALSA: virtio: use ack callback ALSA: scarlett2: Remap Level Meter values ALSA: scarlett2: Allow passing any output to line_out_remap() ALSA: scarlett2: Add support for reading firmware version ALSA: scarlett2: Rename Gen 3 config sets ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 ASoC: cs35l41: Detect CSPL errors when sending CSPL commands ALSA: hda: cs35l41: Check CSPL state after loading firmware ALSA: hda: cs35l41: Do not unload firmware before reset in system suspend ...
2023-11-03Merge tag 'pci-v6.7-changes' of ↵Linus Torvalds1-11/+5
git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Use acpi_evaluate_dsm_typed() instead of open-coding _DSM evaluation to learn device characteristics (Andy Shevchenko) - Tidy multi-function header checks using new PCI_HEADER_TYPE_MASK definition (Ilpo Järvinen) - Simplify config access error checking in various drivers (Ilpo Järvinen) - Use pcie_capability_clear_word() (not pcie_capability_clear_and_set_word()) when only clearing (Ilpo Järvinen) - Add pci_get_base_class() to simplify finding devices using base class only (ignoring subclass and programming interface) (Sui Jingfeng) - Add pci_is_vga(), which includes ancient PCI_CLASS_NOT_DEFINED_VGA devices from before the Class Code was added to PCI (Sui Jingfeng) - Use pci_is_vga() for vgaarb, sysfs "boot_vga", virtio, qxl to include ancient VGA devices (Sui Jingfeng) Resource management: - Make pci_assign_unassigned_resources() non-init because sparc uses it after init (Randy Dunlap) Driver binding: - Retain .remove() and .probe() callbacks (previously __init) because sysfs may cause them to be called later (Uwe Kleine-König) - Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device, so it can be claimed by dwc3 instead (Vicki Pfau) PCI device hotplug: - Add Ampere Altra Attention Indicator extension driver for acpiphp (D Scott Phillips) Power management: - Quirk VideoPropulsion Torrent QN16e with longer delay after reset (Lukas Wunner) - Prevent users from overriding drivers that say we shouldn't use D3cold (Lukas Wunner) - Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 because wakeup interrupts from those states don't work if amd-pmc has put the platform in a hardware sleep state (Mario Limonciello) IOMMU: - Disable ATS for Intel IPU E2000 devices with invalidation message endianness erratum (Bartosz Pawlowski) Error handling: - Factor out interrupt enable/disable into helpers (Kai-Heng Feng) Peer-to-peer DMA: - Fix flexible-array usage in struct pci_p2pdma_pagemap in case we ever use pagemaps with multiple entries (Gustavo A. R. Silva) ASPM: - Revert a change that broke when drivers disabled L1 and users later enabled an L1.x substate via sysfs, and fix a similar issue when users disabled L1 via sysfs (Heiner Kallweit) Endpoint framework: - Fix double free in __pci_epc_create() (Dan Carpenter) - Use IS_ERR_OR_NULL() to simplify endpoint core (Ruan Jinjie) Cadence PCIe controller driver: - Drop unused "is_rc" member (Li Chen) Freescale Layerscape PCIe controller driver: - Enable 64-bit addressing in endpoint mode (Guanhua Gao) Intel VMD host bridge driver: - Fix multi-function header check (Ilpo Järvinen) Microsoft Hyper-V host bridge driver: - Annotate struct hv_dr_state with __counted_by (Kees Cook) NVIDIA Tegra194 PCIe controller driver: - Drop setting of LNKCAP_MLW (max link width) since dw_pcie_setup() already does this via dw_pcie_link_set_max_link_width() (Yoshihiro Shimoda) Qualcomm PCIe controller driver: - Use PCIE_SPEED2MBS_ENC() to simplify encoding of link speed (Manivannan Sadhasivam) - Add a .write_dbi2() callback so DBI2 register writes, e.g., for setting the BAR size, work correctly (Manivannan Sadhasivam) - Enable ASPM for platforms that use 1.9.0 ops, because the PCI core doesn't enable ASPM states that haven't been enabled by the firmware (Manivannan Sadhasivam) Renesas R-Car Gen4 PCIe controller driver: - Add DesignWare core support (set max link width, EDMA_UNROLL flag, .pre_init(), .deinit(), etc) for use by R-Car Gen4 driver (Yoshihiro Shimoda) - Add driver and DT schema for DesignWare-based Renesas R-Car Gen4 controller in both host and endpoint mode (Yoshihiro Shimoda) Xilinx NWL PCIe controller driver: - Update ECAM size to support 256 buses (Thippeswamy Havalige) - Stop setting bridge primary/secondary/subordinate bus numbers, since PCI core does this (Thippeswamy Havalige) Xilinx XDMA controller driver: - Add driver and DT schema for Zynq UltraScale+ MPSoCs devices with Xilinx XDMA Soft IP (Thippeswamy Havalige) Miscellaneous: - Use FIELD_GET()/FIELD_PREP() to simplify and reduce use of _SHIFT macros (Ilpo Järvinen, Bjorn Helgaas) - Remove logic_outb(), _outw(), outl() duplicate declarations (John Sanpe) - Replace unnecessary UTF-8 in Kconfig help text because menuconfig doesn't render it correctly (Liu Song)" * tag 'pci-v6.7-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (102 commits) PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers PCI: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() PCI: endpoint: Fix double free in __pci_epc_create() PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx XDMA PCIe Root Port Bridge PCI: xilinx-cpm: Move IRQ definitions to a common header PCI: xilinx-nwl: Modify ECAM size to enable support for 256 buses PCI: xilinx-nwl: Rename the NWL_ECAM_VALUE_DEFAULT macro dt-bindings: PCI: xilinx-nwl: Modify ECAM size in the DT example PCI: xilinx-nwl: Remove redundant code that sets Type 1 header fields PCI: hotplug: Add Ampere Altra Attention Indicator extension driver PCI/AER: Factor out interrupt toggling into helpers PCI: acpiphp: Allow built-in drivers for Attention Indicators PCI/portdrv: Use FIELD_GET() PCI/VC: Use FIELD_GET() PCI/PTM: Use FIELD_GET() PCI/PME: Use FIELD_GET() PCI/ATS: Use FIELD_GET() PCI/ATS: Show PASID Capability register width in bitmasks PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() ...
2023-10-31ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp()Harshit Mogalapalli1-0/+1
When firmware status is invalid, assign -EINVAL to ret as ret is '0' at that point and returning success is incorrect when firmware status is invalid. Fixes: a51d8ba03a4f ("ALSA: hda: cs35l41: Check CSPL state after loading firmware") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/r/20231030070836.3234385-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-29ALSA: hda: cs35l41: mark cs35l41_verify_id() staticArnd Bergmann1-1/+1
The newly introduced function is global but only called in this one file and has no extern prototype, so it should probably be static: sound/pci/hda/cs35l41_hda.c:733:5: error: no previous prototype for 'cs35l41_verify_id' [-Werror=missing-prototypes] 733 | int cs35l41_verify_id(struct cs35l41_hda *cs35l41, unsigned int *regid, unsigned int *reg_revid) Fixes: 881b7bce0c25 ("ALSA: hda: cs35l41: Run boot process during resume callbacks") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20231027152515.482411-1-arnd@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Check CSPL state after loading firmwareStefan Binding1-0/+18
CSPL firmware should be in RUNNING or PAUSED state after loading. If not, the firmware has not been loaded correctly, and we can unload it and pass the error up. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-8-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Do not unload firmware before reset in system suspendStefan Binding1-29/+4
Given the part is about to reset due to system suspend, and we are already in hibernate, there is no need to wake up the amp, just to get it ready to be reset. We just need to ensure cs_dsp is ready for reset by resetting the states. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-7-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Force a software reset after hardware resetStefan Binding1-0/+5
To ensure the chip has correctly reset during probe and system suspend, we need to force a software reset, in case of systems where the hardware reset is not available. The software reset register was labelled as volatile but not readable, however, it is readable, (just returns 0x0). Adding it to readable registers means it will be correctly treated as volatile, and thus will not be cached. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-6-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Run boot process during resume callbacksStefan Binding1-33/+72
During initial probe, after reset is asserted for the first time, the driver goes through a boot process to ensure the amp is ready to be used. This involves verifying a boot flag, as well as verifying the chip ids. This is necessary since it is possible for the amp to have been fully reset by the system suspend calls. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Assert Reset prior to de-asserting in probe and system ↵Stefan Binding1-0/+2
resume To ensure we are in a known state, exiting from reset at the point of probe or in system resume, assert reset before we de-assert it. Since the BIOS may enter into a pre-boot environment to control the amps (for example for boot beep), we need to ensure we start from a known, reset state prior to probe or system resume. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Assert reset before system suspendStefan Binding1-5/+8
Some system suspend modes may remove power supplies. To ensure we are not running during this time, we should assert reset. Note: since the amps use a shared reset, asserting reset prior to system suspend only works if the amps are suspended in the reverse order to probe. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-26ALSA: hda: cs35l41: Use reset label to get GPIO for HP Zbook Fury 17 G9Stefan Binding1-2/+9
This laptop has an incorrect setting in its _DSD for boost type, but the rest of the _DSD is correct, and we can still use the reset label to obtain the reset gpio. Also fix channel map so that amp 0 is right, and amp 1 is left. Fixes: 581523ee3652 ("ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type") Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231026150558.2105827-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-21Merge tag 'asoc-v6.7' of ↵Takashi Iwai1-11/+12
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.7 This is quite a large set of changes but mostly due to API cleanups and in driver specific ways rather than due to anything subsystem wide. Highlights include: - Standardisation of API prefixes on snd_soc_, removing asoc_. - GPIO API usage improvements. - Support for HDA patches. - Lots of work on SOF, including crash dump support. - Support for AMD platforms with es83xx, Awinc AT87390, many Intel platforms, many Mediatek platforms, Qualcomm SM6115, Richtek RTQ9128 and Texas Instruments TAS575x. [ the merge conflicts around SOF Intel HD-audio and CS35L41 subcodec drivers are resolved here -- tiwai ]
2023-10-19ALSA: hda: i915: Remove extra argument from snd_hdac_i915_initMaarten Lankhorst1-1/+1
Now that all drivers have moved from modprobe loading to handling -EPROBE_DEFER, we can remove the argument again. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20231009115437.99976-14-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-19ALSA: hda: Intel: Move snd_hdac_i915_init to before probe_work.Maarten Lankhorst1-29/+30
Now that we can use -EPROBE_DEFER, it's no longer required to spin off the snd_hdac_i915_init into a workqueue. Use the -EPROBE_DEFER mechanism instead, which must be returned in the probe function. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20231009115437.99976-11-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-19ALSA: hda: i915: Add an allow_modprobe argument to snd_hdac_i915_initMaarten Lankhorst1-1/+1
Xe is a new GPU driver that re-uses the display (and sound) code from i915. It's no longer possible to load i915, as the GPU can be driven by the xe driver instead. The new behavior will return -EPROBE_DEFER, and wait for a compatible driver to be loaded instead of modprobing i915. Converting all drivers at the same time is a lot of work, instead we will convert each user one by one. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20231009115437.99976-8-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-19ALSA: hda: Intel: Fix error handling in azx_probe()Maarten Lankhorst1-0/+1
Add missing pci_set_drv to NULL call on error. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20231009115437.99976-6-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-19Merge branch 'for-linus' into for-nextTakashi Iwai3-49/+130
For applying HD-audio EPROBE_DEFER series cleanly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-17ALSA: hda/realtek - Fixed ASUS platform headset Mic issueKailang Yang1-0/+25
ASUS platform Headset Mic was disable by default. Assigned verb table for Mic pin will enable it. Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/1155d914c20c40569f56d36c79254879@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-17ALSA: hda/realtek: Add quirk for ASUS ROG GU603ZVArtem Borisov1-0/+1
Enables the SPI-connected Cirrus amp and the required pins for headset mic detection. As of BIOS version 313 it is still necessary to modify the ACPI table to add the related _DSD properties: https://gist.github.com/Flex1911/1bce378645fc95a5743671bd5deabfc8 Signed-off-by: Artem Borisov <dedsa2002@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20231014075044.17474-1-dedsa2002@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-17ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq5xxxLuka Guzenko1-0/+1
This HP Laptop uses ALC236 codec with COEF 0x07 controlling the mute LED. Enable existing quirk for this device. Signed-off-by: Luka Guzenko <l.guzenko@web.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20231016221328.1521674-1-l.guzenko@web.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-06ALSA: hda: Add code_loading parameter to stream setupCezary Rojewski1-1/+1
AudioDSP firmware is the one who kicks SDxFIFOS calculation when a stream is decoupled mode. During firmware bring up procedure, there is no firmware running and the code-loading stream is always a decoupled one. So, there is none to trigger the calculation and we end up with false-positive timeout (-110) messages. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20231006102857.749143-4-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-06ALSA: hda: Fix stream fifo_size initializationCezary Rojewski1-1/+1
SDxFIFOS register indicates the fifo size directly. There is no need to modify the value after reading the register. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20231006102857.749143-3-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-06ALSA: hda/realtek: Change model for Intel RVP boardKailang Yang1-2/+2
Intel RVP board (0x12cc) has Headset Mic issue for reboot. If system plugged headset when system reboot the headset Mic was gone. Fixes: 1a93f10c5b12 ("ALSA: hda/realtek: Add "Intel Reference board" and "NUC 13" SSID in the ALC256") Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.org/r/28112f54c0c6496f97ac845645bc0256@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-06ALSA: hda: cs35l41: Cleanup and fix double free in firmware requestStefan Binding1-36/+79
There is an unlikely but possible double free when loading firmware, and a missing free calls if a firmware is successfully requested but the coefficient file request fails, leading to the fallback firmware request occurring without clearing the previously loaded firmware. Fixes: cd40dad2ca91 ("ALSA: hda: cs35l41: Ensure firmware/tuning pairs are always loaded") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202309291331.0JUUQnPT-lkp@intel.com/ Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231003142138.180108-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-30ALSA: hda: cirrus_scodec: fix an error codeDan Carpenter1-2/+2
The "ret" variable is zero but we should return -EINVAL. Fixes: 2144833e7b41 ("ALSA: hda: cirrus_scodec: Add KUnit test") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/5eea7fd5-67c8-4ed4-b5b3-b85dfb7572cc@moroto.mountain Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-29ALSA: hda: Use pci_get_base_class() to reduce duplicated codeSui Jingfeng1-11/+5
Use pci_get_base_class() to reduce duplicated code. No functional change intended. Link: https://lore.kernel.org/r/20230825062714.6325-3-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Fred Oh <fred.oh@linux.intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-09-23ALSA: hda: Annotate struct hda_conn_list with __counted_byKees Cook1-1/+1
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hda_conn_list. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Cezary Rojewski <cezary.rojewski@intel.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20230922175042.work.547-kees@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-22ALSA: hda: cs35l41: Add read-only ALSA control for forced muteStefan Binding1-0/+28
When the CS35L41 amp is requested to mute using the ACPI notification mechanism, userspace is not notified that the amp is muted. To allow userspace to know about the mute, add an ALSA control which tracks the forced mute override. This control does not track the overall mute state of the amp, since the amp is only unmuted during playback anyway, instead it tracks the mute override request from the ACPI notification. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230921162849.1988124-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-22ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDAStefan Binding2-13/+94
Some laptops require a hardware based mute system, where when a hotkey is pressed, it forces the amp to be muted. For CS35L41, when the hotkey is pressed, an acpi notification is sent to the CS35L41 Device Node. The driver needs to handle this notification and call a _DSM function to retrieve the mute state. Since the amp is only muted during playback, the driver will only mute or unmute if playback is occurring, otherwise it will save the mute state for when playback starts. This uses the ACPI Notification mechanism, where a handler has been registered in the component master, which notifies each amp through the component binding. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230921162849.1988124-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-22ALSA: hda/realtek: Support ACPI Notification framework via component bindingStefan Binding1-1/+82
For systems which have support for ACPI notifications, add a mechanism to register a handler for ACPI notifications and then call the acpi_notify api on the bound components. Registering a handler in the Realtek HDA driver, allows a single handler to be registered, which then calls into all the components, rather than attempting to register the same handler multiple times, once for each component. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230921162849.1988124-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-22ALSA: hda: cs35l41: Add notification support into component bindingStefan Binding1-0/+4
Some systems support a notification from ACPI, which can be used for different things. Only one handler can be registered for the acpi notification, but all amps need to receive that notification, we can register a single handler inside the component master, so that it can then notify through the component framework. This is required to support mute notifications from ACPI. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230921162849.1988124-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-21ALSA: hda/realtek - ALC287 merge RTK codec with CS CS35L41 AMPKailang Yang1-8/+15
This is merge model ALC287_FIXUP_THINKPAD_I2S_SPK and ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI. Signed-off-by: Kailang Yang <kailang@realtek.com> Fixes: f7b069cf0881 ("ALSA: hda/realtek: Fix generic fixup definition for cs35l41 amp") Link: https://lore.kernel.org/r/82a45234327c4c50b4988a27e9f64c37@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-20ALSA: hda: cirrus_scodec: Select GPIOLIB for KUnit testRichard Fitzgerald1-0/+1
The KUnit test for cirrus_scodec uses GPIO library functions so select GPIOLIB in Kconfig. This fixes the ld failures on builds that didn't already select GPIOLIB. ld: vmlinux.o: in function `cirrus_scodec_test_gpio_get': sound/pci/hda/cirrus_scodec_test.c:40: undefined reference to `gpiochip_get_data' ld: vmlinux.o: in function `cirrus_scodec_test_gpio_probe': sound/pci/hda/cirrus_scodec_test.c:94: undefined reference to `gpiochip_generic_request' ld: sound/pci/hda/cirrus_scodec_test.c:94: undefined reference to `gpiochip_generic_free' ld: sound/pci/hda/cirrus_scodec_test.c:95: undefined reference to `devm_gpiochip_add_data_with_key' Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202309201646.NnjfKPWk-lkp@intel.com/ Fixes: 2144833e7b41 ("ALSA: hda: cirrus_scodec: Add KUnit test") Link: https://lore.kernel.org/r/20230920090338.29345-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-19ALSA: hda/realtek - ALC287 Realtek I2S speaker platform supportKailang Yang1-0/+4
New platform SSID:0x231f. 0x17 was only speaker pin, DAC assigned will be 0x03. Headphone assigned to 0x02. Playback via headphone will get EQ filter processing. So, it needs to swap DAC. Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/8d63c6e360124e3ea2523753050e6f05@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-19ALSA: hda: cs35l56: Use the new RUNTIME_PM_OPS() macroRichard Fitzgerald1-3/+3
Use RUNTIME_PM_OPS() instead of the old SET_RUNTIME_PM_OPS(). This means we don't need __maybe_unused on the functions. Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230919081153.19793-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-18ALSA: hda: cirrus_scodec: Add KUnit testRichard Fitzgerald4-0/+394
Add a KUnit test for cirrus_scodec_get_speaker_id(). It is impractical to have enough hardware with every possible permutation of speaker id. So use a test harness to test all theoretically supported options. The test harness consists of: - a mock GPIO controller. - a mock struct device to represent the scodec driver - software nodes to provide the fwnode info that would normally come from ACPI. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230918095129.440-3-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-18ALSA: hda: cs35l56: Add support for speaker idRichard Fitzgerald5-1/+106
Add handling of the "spk-id-gpios" _DSD property. If present, the value indicated by the GPIOs is appended to the subsystem-id part of the firmware name to load the appropriate tunings for that speaker. Some manufacturers use multiple sources of speakers, which need different tunings for best performance. On these models the type of speaker fitted is indicated by the values of one or more GPIOs. The number formed by the GPIOs identifies the tuning required. The speaker ID is only used in combination with a _SUB identifier because the value is only meaningful if the exact model is known. The code to get the speaker ID value has been implemented as a new library so that the cs35l41_hda driver can be switched in future to share common code. This library can be extended for other common functionality shared by Cirrus Logic amp drivers. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230918095129.440-2-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-15ALSA: hda: generic: Check potential mixer name string truncationTakashi Iwai1-1/+5
add_control_with_pfx() constructs a mixer name element with the fixed size, and it got compile warnings with -Wformat-truncation. Although the size overflow is very unlikely, let's have a sanity check of the string size and returns the error if it really doesn't fit instead of silent truncation. Link: https://lore.kernel.org/r/20230915082802.28684-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-15ALSA: hda: cs35l56: Fix missing RESET GPIO if _SUB is missingRichard Fitzgerald1-7/+5
In cs35l56_hda_read_acpi() do not return if ACPI _SUB is missing. A missing _SUB means that the driver cannot load a system-specific firmware, because the firmware is identified by the _SUB. But it can fallback to a generic firmware. Unfortunately this was being handled by immediately returning 0, which would skip the remaining ACPI configuration in cs35l56_hda_read_acpi() and so it would not get the RESET GPIO. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Link: https://lore.kernel.org/r/20230914152525.20829-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-15ALSA: hda: Disable power save for solving pop issue on Lenovo ThinkCentre M70qKailang Yang1-0/+1
Lenovo ThinkCentre M70q had boot up pop noise. Disable power save will solve pop issue. Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/315900e2efef42fd9855eacfeb443abd@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-14ALSA: hda: cs35l56: Don't 'return ret' if ret is always zeroRichard Fitzgerald1-1/+1
The final return in cs35l56_hda_posture_get() was returning the value of 'ret', but ret is always zero at this point. So this can be a simple 'return 0'. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230914140852.7112-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-13ALSA: hda/realtek: Splitting the UX3402 into two separate modelsKnyazev Arseniy1-1/+2
UX3402VA and UX3402ZA models require different hex values, so comibining them into one model is incorrect. Fixes: 491a4ccd8a02 ("ALSA: hda/realtek: Add quirk for ASUS Zenbook using CS35L41") Signed-off-by: Knyazev Arseniy <poseaydone@ya.ru> Link: https://lore.kernel.org/r/20230913053343.119798-1-poseaydone@ya.ru Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-13ALSA: hda: cs35l56: Disable low-power hibernation modeRichard Fitzgerald1-1/+0
Do not allow the CS35L56 to be put into its lowest power "hibernation" mode. This only affects I2C because "hibernation" is already disabled on SPI. Recent firmwares need a different wake-up sequence. Until that sequence has been specified, the chip "hibernation" mode must be disabled otherwise it can intermittently fail to wake. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230912132739.3478441-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-12ALSA: hda/realtek - Fixed two speaker platformKailang Yang1-2/+4
If system has two speakers and one connect to 0x14 pin, use this function will disable it. Fixes: e43252db7e20 ("ALSA: hda/realtek - ALC287 I2S speaker platform support") Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.org/r/e3f2aac3fe6a47079d728a6443358cc2@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-12ALSA: hda: cs35l56: Call pm_runtime_dont_use_autosuspend()Richard Fitzgerald1-0/+1
Driver remove() must call pm_runtime_dont_use_autosuspend(). Drivers that call pm_runtime_use_autosuspend() must disable it in driver remove(). Unfortunately until recently this was only mentioned in 1 line in a 900+ line document so most people hadn't noticed this. It has only recently been added to the kerneldoc of pm_runtime_use_autosuspend(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Link: https://lore.kernel.org/r/20230908101223.2656901-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>