summaryrefslogtreecommitdiff
path: root/sound/pci
AgeCommit message (Collapse)AuthorFilesLines
2023-09-07ALSA: hda/realtek - ALC287 I2S speaker platform supportKailang Yang1-0/+30
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. Tested-by: Mark Pearson <mpearson@lenovo.com> Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.org/r/4e4cfa1b3b4c46838aecafc6e8b6f876@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-04ALSA: hda/cirrus: Fix broken audio on hardware with two CS42L42 codecs.Vitaly Rodionov2-1/+2
Recently in v6.3-rc1 there was a change affecting behaviour of hrtimers (commit 0c52310f260014d95c1310364379772cb74cf82d) and causing few issues on platforms with two CS42L42 codecs. Canonical/Dell has reported an issue with Vostro-3910. We need to increase this value by 15ms. Link: https://bugs.launchpad.net/somerville/+bug/2031060 Fixes: 9fb9fa18fb50 ("ALSA: hda/cirrus: Add extra 10 ms delay to allow PLL settle and lock.") Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230904160033.908135-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-31ALSA: hda/tas2781: Use standard clamp() macroTakashi Iwai1-13/+3
Instead of the home-made clamp() function, use the standard macro(). Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Link: https://lore.kernel.org/r/20230831123620.23064-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-25ALSA: hda: Add missing dependency on CONFIG_EFI for Cirrus/TI sub-codecsTakashi Iwai1-0/+3
The CS35L41 and TAS2781 sub-codecs depend on CONFIG_EFI, as they have the code accessing efi variable directly. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308250621.1lwt7PtZ-lkp@intel.com/ Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Link: https://lore.kernel.org/r/20230825092819.12340-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-25ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxxFabian Vogt1-0/+8
The LED for the mic mute button is controlled by GPIO2. The mute button LED is slightly more complex, it's controlled by two bits in coeff 0x0b. Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de> Link: https://lore.kernel.org/r/2693091.mvXUDI8C0e@fabians-envy Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-25ALSA: hda/tas2781: Switch back to use struct i2c_driver's .probe()Uwe Kleine-König1-1/+1
struct i2c_driver::probe_new is about to go away. Switch the driver to use the probe callback with the same prototype. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Link: https://lore.kernel.org/r/20230824200219.9569-1-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-24ALSA: ac97: Fix possible error value of *rac97Su Hui1-3/+2
Before committing 79597c8bf64c, *rac97 always be NULL if there is an error. When error happens, make sure *rac97 is NULL is safer. For examble, in snd_vortex_mixer(): err = snd_ac97_mixer(pbus, &ac97, &vortex->codec); vortex->isquad = ((vortex->codec == NULL) ? 0 : (vortex->codec->ext_id&0x80)); If error happened but vortex->codec isn't NULL, this may cause some problems. Move the judgement order to be clearer and better. Fixes: 79597c8bf64c ("ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer") Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Su Hui <suhui@nfschina.com> Link: https://lore.kernel.org/r/20230823025212.1000961-1-suhui@nfschina.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-24ALSA: hda/realtek: Add quirk for HP Victus 16-d1xxx to enable mute LEDSungHwan Jung1-0/+22
This quirk enables mute LED on HP Victus 16-d1xxx (8A25) laptops, which use ALC245 codec. Signed-off-by: SungHwan Jung <onenowy@gmail.com> Link: https://lore.kernel.org/r/20230823114051.3921-1-onenowy@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-24ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct ↵Stefan Binding1-0/+32
boost type CS35L41 HDA driver requires ACPI to contain correct _DSD properties to correctly configure the device. Whilst the HP Zbook Fury 17 G9 contains valid _DSD properties, the boost type has been configured incorrectly in the _DSD for this laptop. We can override these properties to fix the boost type. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230823143956.755758-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-24Merge branch 'for-linus' into for-nextTakashi Iwai3-10/+30
Back-merge the 6.5-devel branch for the clean patch application for 6.6 and resolving merge conflicts. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-23ALSA: ymfpci: Fix the missing snd_card_free() call at probe errorTakashi Iwai1-2/+8
Like a few other drivers, YMFPCI driver needs to clean up with snd_card_free() call at an error path of the probe; otherwise the other devres resources are released before the card and it results in the UAF. This patch uses the helper for handling the probe error gracefully. Fixes: f33fc1576757 ("ALSA: ymfpci: Create card with device-managed snd_devm_card_new()") Cc: <stable@vger.kernel.org> Reported-and-tested-by: Takashi Yano <takashi.yano@nifty.ne.jp> Closes: https://lore.kernel.org/r/20230823135846.1812-1-takashi.yano@nifty.ne.jp Link: https://lore.kernel.org/r/20230823161625.5807-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21ALSA: hda/tas2781: Fix PM refcount unbalance at tas2781_hda_bind()Takashi Iwai1-5/+3
The error path of tas2781_hda_bind() needs to release PM refcount as well. Modify the code flow to handle properly. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com Link: https://lore.kernel.org/r/20230820172635.22236-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21ALSA: hda/tas2781: Fix acpi device refcount leak at tas2781_read_acpi()Takashi Iwai1-1/+1
The error path at tas2781_read_acpi() doesn't release the acpi_device adev but releases another device physdev instead. This results in a refcount leak. Fix it by replacing with the right object. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com Link: https://lore.kernel.org/r/20230820172635.22236-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-21ALSA: hda/realtek: Fix spelling mistake "powe" -> "power"Colin Ian King1-1/+1
There is a spelling mistake in a quirk entry. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Fixes: 3babae915f4c ("ALSA: hda/tas2781: Add tas2781 HDA driver") Link: https://lore.kernel.org/r/20230821080003.16678-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: asihpi: Remove unused declarationsYue Haibing2-21/+0
These are not implemented, so can remove them. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20230818124852.51468-1-yuehaibing@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: rme9652: Convert to generic PCM copy opsTakashi Iwai1-40/+6
This patch converts the rme9652 driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants. Note that copy_from/to_iter() returns the copied bytes, hence the error condition is adjusted accordingly. Link: https://lore.kernel.org/r/20230815190136.8987-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: hdsp: Convert to generic PCM copy opsTakashi Iwai1-36/+6
This patch converts the hdsp driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants. Note that copy_from/to_iter() returns the copied bytes, hence the error condition is adjusted accordingly. Link: https://lore.kernel.org/r/20230815190136.8987-13-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: rme96: Convert to generic PCM copy opsTakashi Iwai1-34/+8
This patch converts the rme96 driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants. Link: https://lore.kernel.org/r/20230815190136.8987-12-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: rme32: Convert to generic PCM copy opsTakashi Iwai1-39/+11
This patch converts the rme32 driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants. Link: https://lore.kernel.org/r/20230815190136.8987-11-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: nm256: Convert to generic PCM copy opsTakashi Iwai1-36/+6
This patch converts the nm256 driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants. Link: https://lore.kernel.org/r/20230815190136.8987-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: korg1212: Convert to generic PCM copy opsTakashi Iwai1-38/+12
This patch converts the korg1212 driver code to use the new unified PCM copy callback. The open-coded conditional memory copies are replaced with simpler copy_from/to_iter() calls. Note that copy_from/to_iter() returns the copied bytes, hence the error condition is adjusted accordingly. Link: https://lore.kernel.org/r/20230815190136.8987-9-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: es1938: Convert to generic PCM copy opsTakashi Iwai1-25/+5
This patch converts the es1938 driver code to use the new unified PCM copy callback. It's a straightforward conversion from *_user() to *_iter() variants in most parts. Note that copy_from/to_iter() returns the copied bytes, hence the error condition is adjusted accordingly. Link: https://lore.kernel.org/r/20230815190136.8987-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: hda/tas2781: Add tas2781 HDA driverShenghao Ding3-0/+875
Create tas2781 side codec HDA driver for Lenovo Laptops. The quantity of the speakers has been define in ACPI. All of the tas2781s in the laptop will be aggregated as one audio speaker. The code supports realtek codec as the primary codec. Code offers several controls for digtial/analog gain setting during playback, and other for eq params setting in case of different audio profiles, such as music, voice, movie, etc. [ adjusted patch to be applied to the latest for-next branch -- tiwai ] Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://lore.kernel.org/r/20230818085836.1442-2-shenghao-ding@ti.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: hda/tas2781: Add tas2781 HDA driverShenghao Ding1-3/+85
Integrate tas2781 configs for Lenovo Laptops. All of the tas2781s in the laptop will be aggregated as one audio device. The code support realtek as the primary codec. Rename "struct cs35l41_dev_name" to "struct scodec_dev_name" for all other side codecs instead of the certain one. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://lore.kernel.org/r/20230818085836.1442-1-shenghao-ding@ti.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17ALSA: hwdep: Don't embed deviceTakashi Iwai1-2/+2
Like control and PCM devices, it's better to avoid the embedded struct device for hwdep (although it's more or less well working), too. Change it to allocate via snd_device_alloc(), and free the memory at the common snd_hwdep_free(). Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Tested-by: Curtis Malainey <cujomalainey@chromium.org> Link: https://lore.kernel.org/r/20230816160252.23396-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-17ALSA: hda: cs35l41: change cs35l41_prop_model to staticYang Yingliang1-1/+1
cs35l41_prop_model is only used in cs35l41_hda_property.c now, change it to static. Fixes: ef4ba63f12b0 ("ALSA: hda: cs35l41: Support systems with missing _DSD properties") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20230817014252.1511232-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-16ALSA: hda/realtek - Remodified 3k pull low procedureKailang Yang1-2/+5
Set spec->en_3kpull_low default to true. Then fillback ALC236 and ALC257 to false. Additional note: this addresses a regression caused by the previous fix 69ea4c9d02b7 ("ALSA: hda/realtek - remove 3k pull low procedure"). The previous workaround was applied too widely without necessity, which resulted in the pop noise at PM again. This patch corrects the condition and restores the old behavior for the devices that don't suffer from the original problem. Fixes: 69ea4c9d02b7 ("ALSA: hda/realtek - remove 3k pull low procedure") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217732 Link: https://lore.kernel.org/r/01e212a538fc407ca6edd10b81ff7b05@realtek.com Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-16ALSA: hda: cs35l41: Fix the loop check in cs35l41_add_dsd_propertiesTakashi Iwai1-1/+1
model->hid is a pointer, and should be rather NULL-checked in the loop of cs35l41_prop_model_table. Fixes: ef4ba63f12b0 ("ALSA: hda: cs35l41: Support systems with missing _DSD properties") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308160506.8lCEeFDG-lkp@intel.com/ Link: https://lore.kernel.org/r/20230816063525.23009-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-15ALSA: hda: cs35l41: Support systems with missing _DSD propertiesStefan Binding5-51/+108
Some systems using CS35L41 with HDA were released without some required _DSD properties in ACPI. To support these special cases, add an api to configure the correct properties for systems with this issue. This initial commit moves the no _DSD support for Lenovo Legion Laptops (CLSA0100, CLSA0101) into a new framework which can be extended to support additional laptops in the future. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230815161033.3519-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-11ALSA: hda/cs8409: Support new Dell Dolphin VariantsStefan Binding1-0/+4
Add 4 new Dell Dolphin Systems, same configuration as older systems. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230811123044.1045651-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-10ALSA: hda/realtek: Switch Dell Oasis models to use SPIStefan Binding1-5/+4
All I2C Dell Oasis models using CS35L41 have been changed to use SPI. In addition, System 10280cc5 is no longer required. Fixes: de90f5165b1c ("ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops") Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230809142957.675933-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-10ALSA: hda/realtek: Add quirks for HP G11 LaptopsStefan Binding1-1/+7
These HP G11 laptops use Realtek HDA codec combined with 2xCS35L41 Amplifiers using SPI or I2C with External Boost. Laptop 103c8c26 has been removed as this has been replaced by this new series of laptops. Fixes: 3e10f6ca76c4 ("ALSA: hda/realtek: Add quirk for HP EliteBook G10 laptops") Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230809142957.675933-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-08ALSA: hda/tegra: refactor deprecated strncpyJustin Stitt1-2/+2
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on its destination buffer argument which is _not_ the case for `strncpy`! It should be noted that the current implementation is unlikely to have a bug because `drv_name` is a string literal with a size of 9 while `card->driver` has a size of 16. However, it is probably worthwhile to switch to a more robust and less ambiguous interface. [1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt <justinstitt@google.com> Link: https://lore.kernel.org/r/20230807-sound-pci-hda-v1-1-6d9cdcd085ca@google.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04Merge branch 'topic/intel-hda' into for-nextTakashi Iwai1-0/+2
Pull ArrowLake-S PCI ID addition and config for MTL/LNL Link: https://lore.kernel.org/r/20230802150105.24604-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-04ALSA: hda: add HD Audio PCI ID for Intel Arrow Lake-SKai Vehmanen1-0/+2
Add HD Audio PCI ID for Intel Arrow Lake-S platform. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230802150105.24604-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-02ALSA: hda: cs35l41: Print amp configuration after bindStefan Binding1-0/+7
Print amp configuration information to be able to confirm ACPI _DSD information (and other useful info) for each amp on each system using CS35L41, without having to get the acpidump. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230802121235.467358-1-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
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-27ALSA: hda/realtek: Support ASUS G713PV laptopPavel Asyutchenko1-0/+1
This laptop has CS35L41 amp connected via I2C. With this patch speakers begin to work if the missing _DSD properties are added to ACPI tables. Signed-off-by: Pavel Asyutchenko <svenpavel@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20230726223732.20775-1-svenpavel@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-25ALSA: hda/relatek: Enable Mute LED on HP 250 G8Luka Guzenko1-0/+1
This HP Notebook used ALC236 codec with COEF 0x07 idx 1 controlling the mute LED. Enable already 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/20230725111509.623773-1-l.guzenko@web.de 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>