summaryrefslogtreecommitdiff
path: root/sound/pci
AgeCommit message (Collapse)AuthorFilesLines
2023-08-01ALSA: hda/cs35l56: Reject I2C alias addressesRichard Fitzgerald1-5/+8
The ACPI nodes for CS35L56 can contain an extra I2CSerialBusV2 that is not a real device, it is an alias address. This alias address will not be in the cirrus,dev-index array, so reject any instantions with a device address not found in the array. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-10-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Fail if .bin not found and firmware not patchedRichard Fitzgerald1-1/+11
A tuning patch is always needed to enable the ASP audio port. If the BIOS did not patch the firmware, then it is mandatory to have a .bin file. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-9-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Do not download firmware over existing RAM firmwareRichard Fitzgerald1-4/+23
A RAM firmware can only be downloaded if the CS35L56 is currently running from ROM firmware. The driver must not try to overwrite the RAM if the CS35L56 is already running from that RAM. Firmware can be downloaded in these two cases: - The BIOS has already patched the firmware (secured mode). In this case the firmware files will only contain tunings that are safe to overwrite. - The CS35L56 is running the built-in ROM firmware. After a RAM firmware has been downloaded it can only be cleared by hard resetting CS35L56. Some systems only hard-reset during power-on and do not give the driver control of hard reset. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-8-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: cs_dsp_power_down() on cs35l56_hda_fw_load() error pathRichard Fitzgerald1-3/+6
If cs35l56_hda_fw_load() successfully called cs_dsp_power_up() the error path must balance that with a call to cs_dsp_power_down(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-7-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()Richard Fitzgerald1-0/+3
In cs35l56_hda_unbind() cs_dsp_power_down() must be called to cleanup before calling cs_dsp_remove cs_dsp_remove(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-6-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Always power-up and start cs_dspRichard Fitzgerald1-7/+3
Always call cs_dsp_power_up() and cs_dsp_run() in cs35l56_hda_fw_load() even if there aren't any firmware files to download. Also, if there aren't any firmware files to download there is no need to do cs35l56_firmware_shutdown() and cs35l56_system_reset(). If there aren't any firmware files there's no need to write anything to the CS35L56 registers to make it work - it will already be running the ROM firmware. So it's not strictly necessary to start cs_dsp. But it's perfectly ok to call cs_dsp_power_up() and cs_dsp_run() without downloading any firmware. This avoids having to support a state where audio is playing but cs_dsp is not running. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-5-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Call cs_dsp_power_down() before reloading firmwareRichard Fitzgerald1-0/+6
When firmware is reloaded after a system resume cs_dsp_power_down() should be called before calling cs_dsp_power_up(). The fw_patched flag should also be cleared and only set again if the firmware download succeeded. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-4-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Do not mark cache dirty after REINITRichard Fitzgerald1-1/+1
Only call regcache_mark_dirty() in cs35l56_hda_fw_load() if the CS35L56 was SYSTEM_RESET. recache_mark_dirty() changes the behaviour of regcache_sync() to write out cache values that are not the default value, and skip cache values that are the default. AUDIO_REINIT does not reset the registers. regcache_mark_dirty() after AUDIO_REINIT could cause the regcache_sync() to sync registers incorrectly because it will assume that all registers have reset to default. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-3-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-01ALSA: hda/cs35l56: Complete firmware reboot before calling cs_dsp_run()Richard Fitzgerald1-6/+5
Move the call to cs_dsp_run() in cs35l56_hda_fw_load() so that it is after the CS35L56 has been reset/reinit'd and the regmap cache has been synced. cs_dsp_run() syncs up ALSA control cache values with the DSP memory so this must not be done until the firmware has reinitialized. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230731165726.7940-2-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-27ALSA: hda/cs35l56: Do some clean up on probe errorDan Carpenter1-1/+1
Smatch complains that this return should be a goto: sound/pci/hda/cs35l56_hda.c:910 cs35l56_hda_common_probe() warn: missing unwind goto? The goto error disables cansleep so that seems reasonable. Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/465160f4-b7cf-41d5-931e-d6c9e68fa3c7@moroto.mountain Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-25Merge tag 'asoc-v6.6-early' of ↵Takashi Iwai9-12/+1272
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.6 Here's an initial batch of updates for ASoC for this release cycle. We've got a bunch of new drivers in here, a bit of core work from Morimoto-san and quite a lot of janitorial work. There's several updates that pull in changes from other subsystems in order to build on them: - An adaptor to allow use of IIO DACs and ADCs in ASoC which pulls in some IIO changes. - Create a library function for intlog10() and use it in the NAU8825 driver. - Include the ASoC tests, including the topology tests, in the default KUnit full test coverage. This also involves enabling UML builds of ALSA since that's the default KUnit test environment which pulls in the addition of some stubs to the driver. - More factoring out from Morimoto-san. - Convert a lot of drivers to use the more modern maple tree register cache. - Support for AMD machines with MAX98388 and NAU8821, Cirrus Logic CS35L36, Intel AVS machines with ES8336 and RT5663 and NXP i.MX93.
2023-07-24ALSA: hda: cs35l41: Ensure amp is only unmuted during playbackStefan Binding1-2/+20
Currently we only mute after playback has finished, and unmute prior to setting global enable. To prevent any possible pops and clicks, mute at probe, and then only unmute after global enable is set. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-12-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Add device_link between HDA and cs35l41_hdaStefan Binding1-1/+12
To ensure consistency between the HDA core and the CS35L41 HDA driver, add a device_link between them. This ensures that the HDA core will suspend first, and resume second, meaning the amp driver will not miss any events from the playback hook from the HDA core during system suspend and resume. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-11-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Rework System Suspend to ensure correct call separationStefan Binding1-5/+35
In order to correctly pause audio on suspend, amps using external boost require parts of the pause sequence to be called for all amps before moving on to the next steps. For example, as part of pausing the audio, the VSPK GPIO must be disabled, but since this GPIO is controlled by one amp, but controls the boost for all amps, it is required to separate the calls. During playback this is achieved by using the pre and post playback hooks, however during system suspend, this is not possible, so to separate the calls, we use both the .prepare and .suspend calls to pause the audio. Currently, for this reason, we do not restart audio on system resume. However, we can support this by relying on the playback hook to resume playback after system suspend. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-10-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Use pre and post playback hooksStefan Binding1-10/+43
Use new hooks to ensure separation between play/pause actions, as required by external boost. External Boost on CS35L41 requires the amp to go through a particular sequence of steps. One of these steps involes the setting of a GPIO. This GPIO is connected to one or more of the amps, and it may control the boost for all of the amps. To ensure that the GPIO is set when it is safe to do so, and to ensure that boost is ready for the rest of the sequence to be able to continue, we must ensure that the each part of the sequence is executed for each amp before moving on to the next part of the sequence. Some of the Play and Pause actions have moved from Open to Prepare. This is because Open is not guaranteed to be called again on system resume, whereas Prepare should. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-9-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: hda_component: Add pre and post playback hooks to hda_componentStefan Binding2-1/+11
These hooks can be used to add callbacks that would be run before and after the main playback hooks. These hooks would be called for all amps, before moving on to the next hook, i.e. pre_playback_hook would be called for all amps, before the playback_hook is called for all amps, then finally the post_playback_hook is called for all amps. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-8-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Move Play and Pause into separate functionsStefan Binding1-52/+79
This allows play and pause to be called from multiple places, which is necessary for system suspend and resume. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-7-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Ensure we pass up any errors during system suspend.Stefan Binding1-4/+13
There are several steps required to put the system into system suspend. Some of these steps may fail, so the driver should pass up the errors if they occur. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-6-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Ensure we correctly re-sync regmap before system suspending.Stefan Binding1-5/+27
In order to properly system suspend, it is necessary to unload the firmware and ensure the chip is ready for shutdown (if necessary). If the system is currently in runtime suspend, it is necessary to wake up the device, and then make it ready. Currently, the wake does not correctly resync the device, which may mean it cannot suspend correctly. Fix this by performaing a resync. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda: cs35l41: Check mailbox status of pause command after firmware loadStefan Binding1-1/+6
Currently, we do not check the return status of the pause command, immediately after we load firmware. If the pause has failed, the firmware is not running. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: cs35l41: Use mbox command to enable speaker output for external boostStefan Binding1-3/+6
To enable the speaker output in external boost mode, 2 registers must be set, one after another. The longer the time between the writes of the two registers, the more likely, and more loudly a pop may occur. To minimize this, an mbox command can be used to allow the firmware to perform this action, minimizing any delay between write, thus minimizing any pop or click as a result. The old method will remain when running without firmware. Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230721151816.2080453-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-24ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifierSimon Trimmer6-0/+1217
Add a driver for the Cirrus Logic CS35L56 amplifier. This uses the same component binding API as the CS35L41 driver. This is not a standalone HDA device; it provides control of the CS35L56 for systems that use a combination of an HDA codec and CS35L56 amplifiers with audio routed through the HDA codec. The CS35L56 combines a high-performance mono audio amplifier, Class-H tracking inductive boost converter, Halo Core(TM) DSP and a DC-DC boost converter supporting Class-H tracking. Control interfaces are I2C or SPI through the standard Linux I2C or SPI bus framework. Most chip functionality is controlled by on-board ROM firmware that is always running. Firmware patches can be applied by the driver in the form of a .wmfw file (firmware patch) and/or a .bin file (system tuning). Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230721132120.5523-12-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-24ALSA: hda: Fix missing header dependenciesRichard Fitzgerald2-0/+5
Add #includes of dependencies into hda_auto_parser.h and hda_generic.h hda_auto_parser.h uses definitions in hda_local.h. hda_generic.h uses definitions in hda_local.h and hda_auto_parser.h. It also references struct hda_jack_callback, but only as a pointer. This has been forward-declared so hda_jack.h only needs to be included in source that actually uses it. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230721132120.5523-11-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-21ALSA: hda: add HDMI codec ID for Intel LNLKai Vehmanen1-0/+1
Add HDMI codec ID for Intel Lunar Lake platform. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230721135722.31288-3-peter.ujfalusi@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: hda/hdmi: keep codec entries in numerical orderKai Vehmanen1-2/+2
Switch order of Intel MTL and RPL codec entries to keep the codec device id list nicely ordered. Also use the opportunity to fix the naming to the convention used elsewhere in the drivers. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230721135722.31288-2-peter.ujfalusi@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: ice1712: Use the standard snd_ctl_add_followers() helperTakashi Iwai2-28/+6
Instead of open-code, use the new standard helper to manage vmaster stuff for code simplification. Also, handle the errors from the helper more properly instead of silently ignoring. The code changes the call order of snd_ctl_add() of the vmaster object and its followers for avoiding the possible memory leaks at error path. But there should be no difference in the functionality. Link: https://lore.kernel.org/r/20230721071643.3631-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: ca0106: Use the standard snd_ctl_add_followers() helperTakashi Iwai1-13/+6
Instead of open-code, use the new standard helper to manage vmaster stuff for code simplification. Also, handle the errors from the helper more properly instead of silently ignoring. Link: https://lore.kernel.org/r/20230721071643.3631-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: ac97: Use the standard snd_ctl_add_followers() helperTakashi Iwai1-15/+1
Instead of open-code, use the new standard helper to manage vmaster stuff for code simplification. Except for a debug print, there should be no functional change. Link: https://lore.kernel.org/r/20230721071643.3631-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: ac97: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-5/+1
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-12-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: cmipci: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-5/+1
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: via82xx: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-5/+1
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-9-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: maestro3: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-11/+4
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: ice1712: Simplify with snd_ctl_find_id_mixer()Takashi Iwai4-38/+13
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Also, add the missing NULL checks in psc724_set_jack_state() to deal with error cases. Link: https://lore.kernel.org/r/20230720082108.31346-7-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: es1968: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-11/+4
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: emu10k1: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-10/+1
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: cs46xx: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-5/+2
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-21ALSA: ca0106: Simplify with snd_ctl_find_id_mixer()Takashi Iwai1-12/+3
Replace an open code with the new snd_ctl_find_id_mixer(). There is no functional change. Link: https://lore.kernel.org/r/20230720082108.31346-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-20ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptopsVitaly Rodionov1-0/+8
Adding support for new Dell laptops using Cirrus Logic CS35L41 smart amplifiers with Realtek codec. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230720082022.13033-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-20ALSA: hda/realtek: Fix generic fixup definition for cs35l41 ampVitaly Rodionov1-10/+15
Generic fixup for CS35L41 amplifies should not have vendor specific chained fixup. For ThinkPad laptops with led issue, we can just add specific fixup. Fixes: a6ac60b36dade (ALSA: hda/realtek: Fix mute led issue on thinkpad with cs35l41 s-codec) Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230720082022.13033-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-20Merge tag 'tags/ctl-lock-fixes-6.6' into for-nextTakashi Iwai2-7/+0
ALSA: Make control API taking controls_rwsem consistently A few ALSA control API helpers like snd_ctl_rename(), snd_ctl_remove() and snd_ctl_find_*() suppose the callers taking card->controls_rwsem. But it's error-prone and fragile. This patch set tries to change those API functions to take the card->controls>rwsem internally by themselves, so that the drivers don't need to take care of lockings. After applying this patch set, only a couple of places still touch card->controls_rwsem (which are OK-ish as they need for traversing the control linked list). Link: https://lore.kernel.org/r/20230718141304.1032-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-20ALSA: emu10k1: Go back and simplify with snd_ctl_find_id()Takashi Iwai1-4/+1
Now that snd_ctl_find_id() takes the locking itself, we can get rid of the messy locking in the caller side in snd_emu10k1_verify_controls(). Link: https://lore.kernel.org/r/20230718141304.1032-12-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-20ALSA: control: Introduce unlocked version for snd_ctl_find_*() helpersTakashi Iwai1-1/+1
For reducing the unnecessary use of controls_rwsem in the drivers, this patch adds a new variant for snd_ctl_find_*() helpers: snd_ctl_find_id_locked() and snd_ctl_find_numid_locked() look for a kctl element inside the card->controls_rwsem -- that is, doing the very same as what snd_ctl_find_id() and snd_ctl_find_numid() did until now. snd_ctl_find_id() and snd_ctl_find_numid() remain same, i.e. still unlocked version, but they will be switched to locked version once after all callers are replaced. The patch also replaces the calls of snd_ctl_find_id() and snd_ctl_find_numid() in a few places; all of those are places where we know that the functions are called properly with controls_rwsem held. All others are without rwsem (although they should have been). After this patch, we'll turn on the locking in snd_ctl_find_id() and snd_ctl_find_numid() to be more race-free. Link: https://lore.kernel.org/r/20230718141304.1032-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-20ALSA: control: Take controls_rwsem lock in snd_ctl_remove()Takashi Iwai2-4/+0
So far, snd_ctl_remove() requires its caller to take card->controls_rwsem manually before the call for avoiding possible races. However, many callers don't care and miss the locking. Basically it's cumbersome and error-prone to enforce it to each caller. Moreover, card->controls_rwsem is a field that should be used only by internal or proper helpers, and it's not to be touched at random external places. This patch is an attempt to make those calls more consistent: now snd_ctl_remove() takes the card->controls_rwsem internally, just like other API functions for kctls. Since a few callers already take the controls_rwsem locks, the patch removes those locks at the same time, too. Link: https://lore.kernel.org/r/20230718141304.1032-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-19ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxxLuka Guzenko1-0/+21
The HP Laptop 15s-eq2xxx uses ALC236 codec and controls the mute LED using COEF 0x07 index 1. No existing quirk covers this configuration. Adds a new quirk and enables it for the device. Signed-off-by: Luka Guzenko <l.guzenko@web.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20230718161241.393181-1-l.guzenko@web.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-18ALSA: hda/realtek: Add quirk for Clevo NS70AUChristoffer Sandberg1-0/+1
Fixes headset detection on Clevo NS70AU. Co-developed-by: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Christoffer Sandberg <cs@tuxedo.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20230718145722.10592-1-wse@tuxedocomputers.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-18Merge branch 'topic/hda-pci-ids' into for-nextTakashi Iwai1-229/+144
Pull cleanup of HD-audio PCI IDs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-18ALSA: hda: Convert to PCI device IDs definesAmadeusz Sławiński1-210/+140
Use PCI device IDs from pci_ids.h header and while at it to simplify declarations change to using PCI_DEVICE_DATA() macro for Intel IDs and PCI_VDEVICE() for all other that have defined vendor. Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230717114511.484999-11-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-18ALSA: hda: Use global PCI match macroAmadeusz Sławiński1-16/+4
Instead of using local macro to match PCI device, use global one. As Apollolake is Broxton-P successor that made it to the market, be precise and use APL shortcut. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230717114511.484999-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-18ALSA: Remove unused Broxton PCI IDAmadeusz Sławiński1-3/+0
Current code references 0x1a98 which is BXT-M (not -T as it is commented) and it's an RVP, BXT-M B0 to be specific. From what we know no BXT is available on market. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230717114511.484999-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-17ALSA: emu10k1: rework copyright statementsOswald Buddenhagen9-22/+28
- Remove the "log-like" parts, following the same logic as the previous commit - Unify format - Add missing major contributors, including myself - Sort entries in order of first contribution (Creative comes last for optical reasons; they don't appear to have directly contributed anyway) Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Link: https://lore.kernel.org/r/20230715160839.326978-2-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>