Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'sound-fix-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"The only slightly large change is the enablement of CIX HD-audio
controller, which took a bit time to be cooked up, while most of other
changes are device-specific small trivial fixes:

- Default disablement of the kconfig for decades old pre-release
alsa-lib PCM API; it's only the default config value change, so it
can't lead to any regressions for the existing setups

- Support for CIX HD-audio controller

- A few ASoC ACP fixes

- Fixes for ASoC cirrus, bcm, wcd, qcom, ak platforms

- Trivial hardening for FireWire and USB-audio

- HD-audio Intel binding fix and quirks"

* tag 'sound-fix-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (30 commits)
ALSA: hda/tas2781: Add new quirk for HP new project
ALSA: hda: cix-ipbloq: Use modern PM ops
ALSA: hda: intel-dsp-config: Prefer legacy driver as fallback
ASoC: amd: acp: update tdm channels for specific DAI
ASoC: cs35l56: Fix incorrect select SND_SOC_CS35L56_CAL_SYSFS_COMMON
ALSA: firewire-motu: add bounds check in put_user loop for DSP events
ASoC: cs35l41: Always return 0 when a subsystem ID is found
ALSA: uapi: Fix typo in asound.h comment
ALSA: Do not build obsolete API
ALSA: hda: add CIX IPBLOQ HDA controller support
ALSA: hda/core: add addr_offset field for bus address translation
ALSA: hda: dt-bindings: add CIX IPBLOQ HDA controller support
ALSA: hda/realtek: Add support for ASUS UM3406GA
ALSA: hda/realtek: Add support for HP Turbine Laptops
ALSA: usb-audio: Initialize status1 to fix uninitialized symbol errors
ALSA: firewire-motu: fix buffer overflow in hwdep read for DSP events
ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi()
ASoC: cros_ec_codec: Remove unnecessary selection of CRYPTO
ASoc: qcom: q6afe: fix bad guard conversion
ASoC: rockchip: Fix Wvoid-pointer-to-enum-cast warning (again)
...

+626 -71
+4 -1
Documentation/devicetree/bindings/sound/cirrus,cs42xx8.yaml
··· 9 9 maintainers: 10 10 - patches@opensource.cirrus.com 11 11 12 + allOf: 13 + - $ref: dai-common.yaml# 14 + 12 15 properties: 13 16 compatible: 14 17 enum: ··· 66 63 - VLC-supply 67 64 - VLS-supply 68 65 69 - additionalProperties: false 66 + unevaluatedProperties: false 70 67 71 68 examples: 72 69 - |
+62
Documentation/devicetree/bindings/sound/cix,sky1-ipbloq-hda.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/sound/cix,sky1-ipbloq-hda.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: CIX IPBLOQ HDA controller 8 + 9 + description: 10 + CIX IPBLOQ High Definition Audio (HDA) Controller 11 + 12 + maintainers: 13 + - Joakim Zhang <joakim.zhang@cixtech.com> 14 + 15 + allOf: 16 + - $ref: sound-card-common.yaml# 17 + 18 + properties: 19 + compatible: 20 + const: cix,sky1-ipbloq-hda 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + clocks: 29 + maxItems: 2 30 + 31 + clock-names: 32 + items: 33 + - const: ipg 34 + - const: per 35 + 36 + resets: 37 + maxItems: 1 38 + 39 + required: 40 + - compatible 41 + - reg 42 + - interrupts 43 + - clocks 44 + - clock-names 45 + - resets 46 + 47 + unevaluatedProperties: false 48 + 49 + examples: 50 + - | 51 + #include<dt-bindings/interrupt-controller/arm-gic.h> 52 + 53 + hda@70c0000 { 54 + compatible = "cix,sky1-ipbloq-hda"; 55 + reg = <0x70c0000 0x10000>; 56 + interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>; 57 + clocks = <&audss_clk 7>, 58 + <&audss_clk 8>; 59 + clock-names = "ipg", "per"; 60 + resets = <&audss_rst 14>; 61 + model = "CIX SKY1 EVB HDA"; 62 + };
-1
arch/arm/configs/am200epdkit_defconfig
··· 68 68 CONFIG_SND=m 69 69 CONFIG_SND_MIXER_OSS=m 70 70 CONFIG_SND_PCM_OSS=m 71 - # CONFIG_SND_SUPPORT_OLD_API is not set 72 71 # CONFIG_SND_VERBOSE_PROCFS is not set 73 72 CONFIG_SND_PXA2XX_AC97=m 74 73 CONFIG_USB_GADGET=y
-1
arch/arm/configs/lpc32xx_defconfig
··· 113 113 # CONFIG_LOGO_LINUX_VGA16 is not set 114 114 CONFIG_SOUND=y 115 115 CONFIG_SND=y 116 - # CONFIG_SND_SUPPORT_OLD_API is not set 117 116 # CONFIG_SND_VERBOSE_PROCFS is not set 118 117 CONFIG_SND_DEBUG=y 119 118 CONFIG_SND_DEBUG_VERBOSE=y
-1
arch/arm/configs/omap1_defconfig
··· 148 148 CONFIG_SND=y 149 149 CONFIG_SND_MIXER_OSS=y 150 150 CONFIG_SND_PCM_OSS=y 151 - # CONFIG_SND_SUPPORT_OLD_API is not set 152 151 # CONFIG_SND_VERBOSE_PROCFS is not set 153 152 CONFIG_SND_DUMMY=y 154 153 CONFIG_SND_USB_AUDIO=y
-1
arch/arm/configs/tegra_defconfig
··· 219 219 CONFIG_LOGO=y 220 220 CONFIG_SOUND=y 221 221 CONFIG_SND=y 222 - # CONFIG_SND_SUPPORT_OLD_API is not set 223 222 # CONFIG_SND_DRIVERS is not set 224 223 CONFIG_SND_HDA_TEGRA=y 225 224 CONFIG_SND_HDA_INPUT_BEEP=y
-1
arch/mips/configs/gcw0_defconfig
··· 79 79 # CONFIG_LOGO_LINUX_VGA16 is not set 80 80 CONFIG_SOUND=y 81 81 CONFIG_SND=y 82 - # CONFIG_SND_SUPPORT_OLD_API is not set 83 82 # CONFIG_SND_PROC_FS is not set 84 83 # CONFIG_SND_DRIVERS is not set 85 84 # CONFIG_SND_SPI is not set
-1
arch/mips/configs/loongson1_defconfig
··· 119 119 CONFIG_LOONGSON1_WDT=y 120 120 CONFIG_SOUND=y 121 121 CONFIG_SND=y 122 - # CONFIG_SND_SUPPORT_OLD_API is not set 123 122 # CONFIG_SND_DRIVERS is not set 124 123 # CONFIG_SND_MIPS is not set 125 124 # CONFIG_SND_USB is not set
-1
arch/mips/configs/qi_lb60_defconfig
··· 81 81 # CONFIG_LOGO_LINUX_CLUT224 is not set 82 82 CONFIG_SOUND=y 83 83 CONFIG_SND=y 84 - # CONFIG_SND_SUPPORT_OLD_API is not set 85 84 # CONFIG_SND_VERBOSE_PROCFS is not set 86 85 # CONFIG_SND_DRIVERS is not set 87 86 # CONFIG_SND_SPI is not set
-1
arch/mips/configs/rbtx49xx_defconfig
··· 53 53 # CONFIG_VGA_ARB is not set 54 54 CONFIG_SOUND=m 55 55 CONFIG_SND=m 56 - # CONFIG_SND_SUPPORT_OLD_API is not set 57 56 # CONFIG_SND_VERBOSE_PROCFS is not set 58 57 # CONFIG_SND_DRIVERS is not set 59 58 # CONFIG_SND_PCI is not set
-1
arch/mips/configs/rs90_defconfig
··· 105 105 CONFIG_SOUND=y 106 106 CONFIG_SND=y 107 107 # CONFIG_SND_PCM_TIMER is not set 108 - # CONFIG_SND_SUPPORT_OLD_API is not set 109 108 # CONFIG_SND_PROC_FS is not set 110 109 # CONFIG_SND_DRIVERS is not set 111 110 # CONFIG_SND_MIPS is not set
-1
arch/powerpc/configs/85xx-hw.config
··· 117 117 CONFIG_SND_POWERPC_SOC=y 118 118 # CONFIG_SND_PPC is not set 119 119 CONFIG_SND_SOC=y 120 - # CONFIG_SND_SUPPORT_OLD_API is not set 121 120 # CONFIG_SND_USB is not set 122 121 CONFIG_SND=y 123 122 CONFIG_SOUND=y
-1
arch/powerpc/configs/86xx-hw.config
··· 80 80 CONFIG_SND_INTEL8X0=y 81 81 CONFIG_SND_MIXER_OSS=y 82 82 CONFIG_SND_PCM_OSS=y 83 - # CONFIG_SND_SUPPORT_OLD_API is not set 84 83 CONFIG_SND=y 85 84 CONFIG_SOUND=y 86 85 CONFIG_ULI526X=y
-1
arch/powerpc/configs/mpc5200_defconfig
··· 75 75 CONFIG_LOGO=y 76 76 CONFIG_SOUND=y 77 77 CONFIG_SND=y 78 - # CONFIG_SND_SUPPORT_OLD_API is not set 79 78 # CONFIG_SND_DRIVERS is not set 80 79 # CONFIG_SND_PCI is not set 81 80 # CONFIG_SND_PPC is not set
-1
arch/powerpc/configs/ppc6xx_defconfig
··· 726 726 CONFIG_SND_MIXER_OSS=m 727 727 CONFIG_SND_PCM_OSS=m 728 728 CONFIG_SND_DYNAMIC_MINORS=y 729 - # CONFIG_SND_SUPPORT_OLD_API is not set 730 729 CONFIG_SND_VERBOSE_PRINTK=y 731 730 CONFIG_SND_DEBUG=y 732 731 CONFIG_SND_DEBUG_VERBOSE=y
-1
arch/sh/configs/edosk7760_defconfig
··· 79 79 CONFIG_FB_SH_MOBILE_LCDC=m 80 80 CONFIG_SOUND=y 81 81 CONFIG_SND=y 82 - # CONFIG_SND_SUPPORT_OLD_API is not set 83 82 # CONFIG_SND_VERBOSE_PROCFS is not set 84 83 CONFIG_SND_VERBOSE_PRINTK=y 85 84 CONFIG_SND_SOC=y
-1
arch/sh/configs/se7724_defconfig
··· 83 83 # CONFIG_LOGO_SUPERH_VGA16 is not set 84 84 CONFIG_SOUND=y 85 85 CONFIG_SND=m 86 - # CONFIG_SND_SUPPORT_OLD_API is not set 87 86 # CONFIG_SND_DRIVERS is not set 88 87 # CONFIG_SND_SPI is not set 89 88 # CONFIG_SND_SUPERH is not set
-1
arch/sh/configs/sh7785lcr_32bit_defconfig
··· 93 93 CONFIG_SND_SEQUENCER_OSS=y 94 94 CONFIG_SND_HRTIMER=y 95 95 CONFIG_SND_DYNAMIC_MINORS=y 96 - # CONFIG_SND_SUPPORT_OLD_API is not set 97 96 # CONFIG_SND_VERBOSE_PROCFS is not set 98 97 CONFIG_SND_VERBOSE_PRINTK=y 99 98 CONFIG_SND_DEBUG=y
+3
include/sound/hdaudio.h
··· 380 380 381 381 /* factor used to derive STRIPE control value */ 382 382 unsigned int sdo_limit; 383 + 384 + /* address offset between host and hadc */ 385 + dma_addr_t addr_offset; 383 386 }; 384 387 385 388 int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
+1 -1
include/uapi/sound/asound.h
··· 60 60 unsigned char db2_sf_ss; /* sample frequency and size */ 61 61 unsigned char db3; /* not used, all zeros */ 62 62 unsigned char db4_ca; /* channel allocation code */ 63 - unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */ 63 + unsigned char db5_dminh_lsv; /* downmix inhibit & level-shift values */ 64 64 }; 65 65 66 66 /****************************************************************************
+1 -1
sound/core/Kconfig
··· 155 155 156 156 config SND_SUPPORT_OLD_API 157 157 bool "Support old ALSA API" 158 - default y 158 + default n 159 159 help 160 160 Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3 161 161 or older).
+4 -3
sound/firewire/motu/motu-hwdep.c
··· 75 75 while (consumed < count && 76 76 snd_motu_register_dsp_message_parser_copy_event(motu, &ev)) { 77 77 ptr = (u32 __user *)(buf + consumed); 78 - if (put_user(ev, ptr)) 78 + if (consumed + sizeof(ev) > count || put_user(ev, ptr)) 79 79 return -EFAULT; 80 80 consumed += sizeof(ev); 81 81 } ··· 83 83 event.motu_register_dsp_change.type = SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE; 84 84 event.motu_register_dsp_change.count = 85 85 (consumed - sizeof(event.motu_register_dsp_change)) / 4; 86 - if (copy_to_user(buf, &event, sizeof(event.motu_register_dsp_change))) 86 + if (copy_to_user(buf, &event, 87 + min_t(long, count, sizeof(event.motu_register_dsp_change)))) 87 88 return -EFAULT; 88 89 89 - count = consumed; 90 + count = min_t(long, count, consumed); 90 91 } else { 91 92 spin_unlock_irq(&motu->lock); 92 93
+4
sound/hda/codecs/realtek/alc269.c
··· 6770 6770 SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2), 6771 6771 SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2), 6772 6772 SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2), 6773 + SND_PCI_QUIRK(0x103c, 0x8e8a, "HP NexusX", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 6774 + SND_PCI_QUIRK(0x103c, 0x8e9d, "HP 17 Turbine OmniBook X UMA", ALC287_FIXUP_CS35L41_I2C_2), 6775 + SND_PCI_QUIRK(0x103c, 0x8e9e, "HP 17 Turbine OmniBook X UMA", ALC287_FIXUP_CS35L41_I2C_2), 6773 6776 SND_PCI_QUIRK(0x103c, 0x8eb6, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO), 6774 6777 SND_PCI_QUIRK(0x103c, 0x8eb7, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO), 6775 6778 SND_PCI_QUIRK(0x103c, 0x8eb8, "HP Abe A6U", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO), ··· 6845 6842 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), 6846 6843 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2), 6847 6844 SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC), 6845 + SND_PCI_QUIRK(0x1043, 0x1584, "ASUS UM3406GA ", ALC287_FIXUP_CS35L41_I2C_2), 6848 6846 SND_PCI_QUIRK(0x1043, 0x1652, "ASUS ROG Zephyrus Do 15 SE", ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK), 6849 6847 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), 6850 6848 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
+2
sound/hda/codecs/side-codecs/cs35l41_hda.c
··· 1901 1901 1902 1902 cs35l41->dacpi = adev; 1903 1903 physdev = get_device(acpi_get_first_physical_node(adev)); 1904 + if (!physdev) 1905 + return -ENODEV; 1904 1906 1905 1907 sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev)); 1906 1908 if (IS_ERR(sub))
+14
sound/hda/controllers/Kconfig
··· 30 30 To compile this driver as a module, choose M here: the module 31 31 will be called snd-hda-tegra. 32 32 33 + config SND_HDA_CIX_IPBLOQ 34 + tristate "CIX IPBLOQ HD Audio" 35 + depends on ARCH_CIX || COMPILE_TEST 36 + select SND_HDA 37 + select SND_HDA_ALIGNED_MMIO 38 + help 39 + Say Y here to support the HDA controller present in CIX SoCs 40 + 41 + This options enables support for the HD Audio controller 42 + present in some CIX SoCs. 43 + 44 + To compile this driver as a module, choose M here: the module 45 + will be called snd-hda-cix-ipbloq. 46 + 33 47 config SND_HDA_ACPI 34 48 tristate "HD Audio ACPI" 35 49 depends on ACPI
+2
sound/hda/controllers/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 snd-hda-intel-y := intel.o 3 3 snd-hda-tegra-y := tegra.o 4 + snd-hda-cix-ipbloq-y := cix-ipbloq.o 4 5 snd-hda-acpi-y := acpi.o 5 6 6 7 subdir-ccflags-y += -I$(src)/../common ··· 11 10 12 11 obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o 13 12 obj-$(CONFIG_SND_HDA_TEGRA) += snd-hda-tegra.o 13 + obj-$(CONFIG_SND_HDA_CIX_IPBLOQ) += snd-hda-cix-ipbloq.o 14 14 obj-$(CONFIG_SND_HDA_ACPI) += snd-hda-acpi.o
+436
sound/hda/controllers/cix-ipbloq.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright 2025 Cix Technology Group Co., Ltd. 3 + 4 + #include <linux/clk.h> 5 + #include <linux/interrupt.h> 6 + #include <linux/io.h> 7 + #include <linux/kernel.h> 8 + #include <linux/module.h> 9 + #include <linux/mutex.h> 10 + #include <linux/of.h> 11 + #include <linux/of_reserved_mem.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/pm_runtime.h> 14 + #include <linux/reset.h> 15 + #include <linux/string.h> 16 + 17 + #include <sound/hda_codec.h> 18 + #include "hda_controller.h" 19 + 20 + #define CIX_IPBLOQ_JACKPOLL_DEFAULT_TIME_MS 1000 21 + #define CIX_IPBLOQ_POWER_SAVE_DEFAULT_TIME_MS 100 22 + 23 + #define CIX_IPBLOQ_SKY1_ADDR_HOST_TO_HDAC_OFFSET (-0x90000000ULL) 24 + 25 + struct cix_ipbloq_hda { 26 + struct azx chip; 27 + struct device *dev; 28 + void __iomem *regs; 29 + 30 + struct reset_control *reset; 31 + struct clk_bulk_data clocks[2]; 32 + unsigned int nclocks; 33 + }; 34 + 35 + static const struct hda_controller_ops cix_ipbloq_hda_ops; 36 + 37 + static int cix_ipbloq_hda_dev_disconnect(struct snd_device *device) 38 + { 39 + struct azx *chip = device->device_data; 40 + 41 + chip->bus.shutdown = 1; 42 + 43 + return 0; 44 + } 45 + 46 + static int cix_ipbloq_hda_dev_free(struct snd_device *device) 47 + { 48 + struct azx *chip = device->device_data; 49 + 50 + if (azx_bus(chip)->chip_init) { 51 + azx_stop_all_streams(chip); 52 + azx_stop_chip(chip); 53 + } 54 + 55 + azx_free_stream_pages(chip); 56 + azx_free_streams(chip); 57 + snd_hdac_bus_exit(azx_bus(chip)); 58 + 59 + return 0; 60 + } 61 + 62 + static int cix_ipbloq_hda_probe_codec(struct cix_ipbloq_hda *hda) 63 + { 64 + struct azx *chip = &hda->chip; 65 + struct hdac_bus *bus = azx_bus(chip); 66 + int err; 67 + 68 + to_hda_bus(bus)->bus_probing = 1; 69 + 70 + /* create codec instances */ 71 + err = azx_probe_codecs(chip, 8); 72 + if (err < 0) { 73 + dev_err(hda->dev, "probe codecs failed: %d\n", err); 74 + return err; 75 + } 76 + 77 + err = azx_codec_configure(chip); 78 + if (err < 0) { 79 + dev_err(hda->dev, "codec configure failed: %d\n", err); 80 + return err; 81 + } 82 + 83 + err = snd_card_register(chip->card); 84 + if (err < 0) { 85 + dev_err(hda->dev, "card register failed: %d\n", err); 86 + return err; 87 + } 88 + 89 + chip->running = 1; 90 + 91 + to_hda_bus(bus)->bus_probing = 0; 92 + 93 + snd_hda_set_power_save(&chip->bus, CIX_IPBLOQ_POWER_SAVE_DEFAULT_TIME_MS); 94 + 95 + return 0; 96 + } 97 + 98 + static int cix_ipbloq_hda_init(struct cix_ipbloq_hda *hda, 99 + struct azx *chip, 100 + struct platform_device *pdev) 101 + { 102 + const char *sname = NULL, *drv_name = "cix-ipbloq-hda"; 103 + struct hdac_bus *bus = azx_bus(chip); 104 + struct snd_card *card = chip->card; 105 + struct resource *res; 106 + unsigned short gcap; 107 + int irq_id, err; 108 + 109 + hda->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 110 + if (IS_ERR(hda->regs)) { 111 + dev_err(hda->dev, "failed to get and ioremap resource\n"); 112 + return PTR_ERR(hda->regs); 113 + } 114 + bus->remap_addr = hda->regs; 115 + bus->addr = res->start; 116 + 117 + irq_id = platform_get_irq(pdev, 0); 118 + if (irq_id < 0) { 119 + dev_err(hda->dev, "failed to get the irq, err = %d\n", irq_id); 120 + return irq_id; 121 + } 122 + 123 + err = devm_request_irq(hda->dev, irq_id, azx_interrupt, 124 + 0, KBUILD_MODNAME, chip); 125 + if (err < 0) 126 + return dev_err_probe(hda->dev, err, 127 + "unable to request IRQ %d : err = %d\n", irq_id, err); 128 + bus->irq = irq_id; 129 + card->sync_irq = bus->irq; 130 + 131 + gcap = azx_readw(chip, GCAP); 132 + chip->capture_streams = (gcap >> 8) & 0x0f; 133 + chip->playback_streams = (gcap >> 12) & 0x0f; 134 + chip->capture_index_offset = 0; 135 + chip->playback_index_offset = chip->capture_streams; 136 + chip->num_streams = chip->playback_streams + chip->capture_streams; 137 + 138 + /* initialize streams */ 139 + err = azx_init_streams(chip); 140 + if (err < 0) { 141 + dev_err(hda->dev, "failed to initialize streams: %d\n", err); 142 + return err; 143 + } 144 + 145 + err = azx_alloc_stream_pages(chip); 146 + if (err < 0) { 147 + dev_err(hda->dev, "failed to allocate stream pages: %d\n", err); 148 + return err; 149 + } 150 + 151 + /* initialize chip */ 152 + azx_init_chip(chip, 1); 153 + 154 + /* codec detection */ 155 + if (!bus->codec_mask) { 156 + dev_err(hda->dev, "no codecs found\n"); 157 + return -ENODEV; 158 + } 159 + dev_dbg(card->dev, "codec detection mask = 0x%lx\n", bus->codec_mask); 160 + 161 + /* driver name */ 162 + strscpy(card->driver, drv_name, sizeof(card->driver)); 163 + 164 + /* shortname for card */ 165 + sname = of_get_property(pdev->dev.of_node, "model", NULL); 166 + if (!sname) 167 + sname = drv_name; 168 + if (strlen(sname) > sizeof(card->shortname)) 169 + dev_dbg(card->dev, "truncating shortname for card\n"); 170 + strscpy(card->shortname, sname, sizeof(card->shortname)); 171 + 172 + /* longname for card */ 173 + snprintf(card->longname, sizeof(card->longname), 174 + "%s at 0x%lx irq %i", 175 + card->shortname, bus->addr, bus->irq); 176 + 177 + return 0; 178 + } 179 + 180 + static int cix_ipbloq_hda_create(struct cix_ipbloq_hda *hda, 181 + struct snd_card *card, 182 + unsigned int driver_caps) 183 + { 184 + static const struct snd_device_ops ops = { 185 + .dev_disconnect = cix_ipbloq_hda_dev_disconnect, 186 + .dev_free = cix_ipbloq_hda_dev_free, 187 + }; 188 + struct azx *chip; 189 + int err; 190 + 191 + chip = &hda->chip; 192 + chip->card = card; 193 + chip->ops = &cix_ipbloq_hda_ops; 194 + chip->driver_caps = driver_caps; 195 + chip->driver_type = driver_caps & 0xff; 196 + chip->dev_index = 0; 197 + chip->single_cmd = 0; 198 + chip->codec_probe_mask = -1; 199 + chip->align_buffer_size = 1; 200 + chip->jackpoll_interval = msecs_to_jiffies(CIX_IPBLOQ_JACKPOLL_DEFAULT_TIME_MS); 201 + mutex_init(&chip->open_mutex); 202 + INIT_LIST_HEAD(&chip->pcm_list); 203 + 204 + /* 205 + * HD-audio controllers appear pretty inaccurate about the update-IRQ timing. 206 + * The IRQ is issued before actually the data is processed. So use stream 207 + * link position by default instead of dma position buffer. 208 + */ 209 + chip->get_position[0] = chip->get_position[1] = azx_get_pos_lpib; 210 + 211 + err = azx_bus_init(chip, NULL); 212 + if (err < 0) { 213 + dev_err(hda->dev, "failed to init bus, err = %d\n", err); 214 + return err; 215 + } 216 + 217 + /* RIRBSTS.RINTFL cannot be cleared, cause interrupt storm */ 218 + chip->bus.core.polling_mode = 1; 219 + chip->bus.core.not_use_interrupts = 1; 220 + 221 + chip->bus.core.aligned_mmio = 1; 222 + chip->bus.core.dma_stop_delay = 100; 223 + chip->bus.core.addr_offset = (dma_addr_t)CIX_IPBLOQ_SKY1_ADDR_HOST_TO_HDAC_OFFSET; 224 + 225 + chip->bus.jackpoll_in_suspend = 1; 226 + 227 + err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 228 + if (err < 0) { 229 + dev_err(card->dev, "failed to create device, err = %d\n", err); 230 + return err; 231 + } 232 + 233 + return 0; 234 + } 235 + 236 + static int cix_ipbloq_hda_probe(struct platform_device *pdev) 237 + { 238 + const unsigned int driver_flags = AZX_DCAPS_PM_RUNTIME; 239 + struct cix_ipbloq_hda *hda; 240 + struct snd_card *card; 241 + struct azx *chip; 242 + int err; 243 + 244 + hda = devm_kzalloc(&pdev->dev, sizeof(*hda), GFP_KERNEL); 245 + if (!hda) 246 + return -ENOMEM; 247 + hda->dev = &pdev->dev; 248 + 249 + hda->reset = devm_reset_control_get(hda->dev, NULL); 250 + if (IS_ERR(hda->reset)) 251 + return dev_err_probe(hda->dev, PTR_ERR(hda->reset), 252 + "failed to get reset, err = %ld\n", PTR_ERR(hda->reset)); 253 + 254 + hda->clocks[hda->nclocks++].id = "ipg"; 255 + hda->clocks[hda->nclocks++].id = "per"; 256 + err = devm_clk_bulk_get(hda->dev, hda->nclocks, hda->clocks); 257 + if (err < 0) 258 + return dev_err_probe(hda->dev, err, "failed to get clk, err = %d\n", err); 259 + 260 + dma_set_mask_and_coherent(hda->dev, DMA_BIT_MASK(32)); 261 + 262 + err = of_reserved_mem_device_init(hda->dev); 263 + if (err < 0 && err != -ENODEV) { 264 + dev_err(hda->dev, 265 + "failed to init reserved mem for DMA, err = %d\n", err); 266 + return err; 267 + } 268 + 269 + err = snd_card_new(hda->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, 270 + THIS_MODULE, 0, &card); 271 + if (err < 0) 272 + return dev_err_probe(hda->dev, err, "failed to crate card, err = %d\n", err); 273 + 274 + err = cix_ipbloq_hda_create(hda, card, driver_flags); 275 + if (err < 0) 276 + goto out_free_card; 277 + 278 + chip = &hda->chip; 279 + card->private_data = chip; 280 + dev_set_drvdata(hda->dev, card); 281 + 282 + pm_runtime_enable(hda->dev); 283 + if (!azx_has_pm_runtime(chip)) 284 + pm_runtime_forbid(hda->dev); 285 + 286 + err = pm_runtime_resume_and_get(hda->dev); 287 + if (err < 0) { 288 + dev_err(hda->dev, "runtime resume and get failed, err = %d\n", err); 289 + goto out_free_device; 290 + } 291 + 292 + err = cix_ipbloq_hda_init(hda, chip, pdev); 293 + if (err < 0) 294 + goto out_free_device; 295 + 296 + err = cix_ipbloq_hda_probe_codec(hda); 297 + if (err < 0) 298 + goto out_free_device; 299 + 300 + pm_runtime_put(hda->dev); 301 + 302 + return 0; 303 + 304 + out_free_device: 305 + snd_device_free(card, chip); 306 + out_free_card: 307 + snd_card_free(card); 308 + 309 + return err; 310 + } 311 + 312 + static void cix_ipbloq_hda_remove(struct platform_device *pdev) 313 + { 314 + struct snd_card *card = dev_get_drvdata(&pdev->dev); 315 + struct azx *chip = card->private_data; 316 + 317 + snd_device_free(card, chip); 318 + snd_card_free(card); 319 + 320 + pm_runtime_disable(&pdev->dev); 321 + } 322 + 323 + static void cix_ipbloq_hda_shutdown(struct platform_device *pdev) 324 + { 325 + struct snd_card *card = dev_get_drvdata(&pdev->dev); 326 + struct azx *chip; 327 + 328 + if (!card) 329 + return; 330 + 331 + chip = card->private_data; 332 + if (chip && chip->running) 333 + azx_stop_chip(chip); 334 + } 335 + 336 + static int cix_ipbloq_hda_suspend(struct device *dev) 337 + { 338 + struct snd_card *card = dev_get_drvdata(dev); 339 + int rc; 340 + 341 + rc = pm_runtime_force_suspend(dev); 342 + if (rc < 0) 343 + return rc; 344 + snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); 345 + 346 + return 0; 347 + } 348 + 349 + static int cix_ipbloq_hda_resume(struct device *dev) 350 + { 351 + struct snd_card *card = dev_get_drvdata(dev); 352 + int rc; 353 + 354 + rc = pm_runtime_force_resume(dev); 355 + if (rc < 0) 356 + return rc; 357 + snd_power_change_state(card, SNDRV_CTL_POWER_D0); 358 + 359 + return 0; 360 + } 361 + 362 + static int cix_ipbloq_hda_runtime_suspend(struct device *dev) 363 + { 364 + struct snd_card *card = dev_get_drvdata(dev); 365 + struct azx *chip = card->private_data; 366 + struct cix_ipbloq_hda *hda = container_of(chip, struct cix_ipbloq_hda, chip); 367 + 368 + if (chip && chip->running) { 369 + azx_stop_chip(chip); 370 + azx_enter_link_reset(chip); 371 + } 372 + 373 + clk_bulk_disable_unprepare(hda->nclocks, hda->clocks); 374 + 375 + return 0; 376 + } 377 + 378 + static int cix_ipbloq_hda_runtime_resume(struct device *dev) 379 + { 380 + struct snd_card *card = dev_get_drvdata(dev); 381 + struct azx *chip = card->private_data; 382 + struct cix_ipbloq_hda *hda = container_of(chip, struct cix_ipbloq_hda, chip); 383 + int rc; 384 + 385 + rc = clk_bulk_prepare_enable(hda->nclocks, hda->clocks); 386 + if (rc) { 387 + dev_err(dev, "failed to enable clk bulk, rc: %d\n", rc); 388 + return rc; 389 + } 390 + 391 + rc = reset_control_assert(hda->reset); 392 + if (rc) { 393 + dev_err(dev, "failed to assert reset, rc: %d\n", rc); 394 + return rc; 395 + } 396 + 397 + rc = reset_control_deassert(hda->reset); 398 + if (rc) { 399 + dev_err(dev, "failed to deassert reset, rc: %d\n", rc); 400 + return rc; 401 + } 402 + 403 + if (chip && chip->running) 404 + azx_init_chip(chip, 1); 405 + 406 + return 0; 407 + } 408 + 409 + static const struct dev_pm_ops cix_ipbloq_hda_pm = { 410 + SYSTEM_SLEEP_PM_OPS(cix_ipbloq_hda_suspend, 411 + cix_ipbloq_hda_resume) 412 + RUNTIME_PM_OPS(cix_ipbloq_hda_runtime_suspend, 413 + cix_ipbloq_hda_runtime_resume, NULL) 414 + }; 415 + 416 + static const struct of_device_id cix_ipbloq_hda_match[] = { 417 + { .compatible = "cix,sky1-ipbloq-hda" }, 418 + { /* sentinel */ }, 419 + }; 420 + MODULE_DEVICE_TABLE(of, cix_ipbloq_hda_match); 421 + 422 + static struct platform_driver cix_ipbloq_hda_driver = { 423 + .driver = { 424 + .name = "cix-ipbloq-hda", 425 + .pm = pm_ptr(&cix_ipbloq_hda_pm), 426 + .of_match_table = cix_ipbloq_hda_match, 427 + }, 428 + .probe = cix_ipbloq_hda_probe, 429 + .remove = cix_ipbloq_hda_remove, 430 + .shutdown = cix_ipbloq_hda_shutdown, 431 + }; 432 + module_platform_driver(cix_ipbloq_hda_driver); 433 + 434 + MODULE_LICENSE("GPL"); 435 + MODULE_DESCRIPTION("CIX IPBLOQ HDA bus driver"); 436 + MODULE_AUTHOR("Joakim Zhang <joakim.zhang@cixtech.com>");
+1
sound/hda/core/bus.c
··· 47 47 INIT_LIST_HEAD(&bus->hlink_list); 48 48 init_waitqueue_head(&bus->rirb_wq); 49 49 bus->irq = -1; 50 + bus->addr_offset = 0; 50 51 51 52 /* 52 53 * Default value of '8' is as per the HD audio specification (Rev 1.0a).
+6 -6
sound/hda/core/controller.c
··· 48 48 /* CORB set up */ 49 49 bus->corb.addr = bus->rb.addr; 50 50 bus->corb.buf = (__le32 *)bus->rb.area; 51 - snd_hdac_chip_writel(bus, CORBLBASE, (u32)bus->corb.addr); 52 - snd_hdac_chip_writel(bus, CORBUBASE, upper_32_bits(bus->corb.addr)); 51 + snd_hdac_chip_writel(bus, CORBLBASE, (u32)(bus->corb.addr + bus->addr_offset)); 52 + snd_hdac_chip_writel(bus, CORBUBASE, upper_32_bits(bus->corb.addr + bus->addr_offset)); 53 53 54 54 /* set the corb size to 256 entries (ULI requires explicitly) */ 55 55 snd_hdac_chip_writeb(bus, CORBSIZE, 0x02); ··· 70 70 bus->rirb.buf = (__le32 *)(bus->rb.area + 2048); 71 71 bus->rirb.wp = bus->rirb.rp = 0; 72 72 memset(bus->rirb.cmds, 0, sizeof(bus->rirb.cmds)); 73 - snd_hdac_chip_writel(bus, RIRBLBASE, (u32)bus->rirb.addr); 74 - snd_hdac_chip_writel(bus, RIRBUBASE, upper_32_bits(bus->rirb.addr)); 73 + snd_hdac_chip_writel(bus, RIRBLBASE, (u32)(bus->rirb.addr + bus->addr_offset)); 74 + snd_hdac_chip_writel(bus, RIRBUBASE, upper_32_bits(bus->rirb.addr + bus->addr_offset)); 75 75 76 76 /* set the rirb size to 256 entries (ULI requires explicitly) */ 77 77 snd_hdac_chip_writeb(bus, RIRBSIZE, 0x02); ··· 625 625 626 626 /* program the position buffer */ 627 627 if (bus->use_posbuf && bus->posbuf.addr) { 628 - snd_hdac_chip_writel(bus, DPLBASE, (u32)bus->posbuf.addr); 629 - snd_hdac_chip_writel(bus, DPUBASE, upper_32_bits(bus->posbuf.addr)); 628 + snd_hdac_chip_writel(bus, DPLBASE, (u32)(bus->posbuf.addr + bus->addr_offset)); 629 + snd_hdac_chip_writel(bus, DPUBASE, upper_32_bits(bus->posbuf.addr + bus->addr_offset)); 630 630 } 631 631 632 632 bus->chip_init = true;
+2 -1
sound/hda/core/intel-dsp-config.c
··· 718 718 /* find the configuration for the specific device */ 719 719 cfg = snd_intel_dsp_find_config(pci, config_table, ARRAY_SIZE(config_table)); 720 720 if (!cfg) 721 - return SND_INTEL_DSP_DRIVER_ANY; 721 + return IS_ENABLED(CONFIG_SND_HDA_INTEL) ? 722 + SND_INTEL_DSP_DRIVER_LEGACY : SND_INTEL_DSP_DRIVER_ANY; 722 723 723 724 if (cfg->flags & FLAG_SOF) { 724 725 if (cfg->flags & FLAG_SOF_ONLY_IF_SOUNDWIRE &&
+5 -5
sound/hda/core/stream.c
··· 288 288 289 289 /* program the BDL address */ 290 290 /* lower BDL address */ 291 - snd_hdac_stream_writel(azx_dev, SD_BDLPL, (u32)azx_dev->bdl.addr); 291 + snd_hdac_stream_writel(azx_dev, SD_BDLPL, (u32)(azx_dev->bdl.addr + bus->addr_offset)); 292 292 /* upper BDL address */ 293 293 snd_hdac_stream_writel(azx_dev, SD_BDLPU, 294 - upper_32_bits(azx_dev->bdl.addr)); 294 + upper_32_bits(azx_dev->bdl.addr + bus->addr_offset)); 295 295 296 296 /* enable the position buffer */ 297 297 if (bus->use_posbuf && bus->posbuf.addr) { 298 298 if (!(snd_hdac_chip_readl(bus, DPLBASE) & AZX_DPLBASE_ENABLE)) 299 299 snd_hdac_chip_writel(bus, DPLBASE, 300 - (u32)bus->posbuf.addr | AZX_DPLBASE_ENABLE); 300 + (u32)(bus->posbuf.addr + bus->addr_offset) | AZX_DPLBASE_ENABLE); 301 301 } 302 302 303 303 /* set the interrupt enable bits in the descriptor control register */ ··· 464 464 465 465 addr = snd_sgbuf_get_addr(dmab, ofs); 466 466 /* program the address field of the BDL entry */ 467 - bdl[0] = cpu_to_le32((u32)addr); 468 - bdl[1] = cpu_to_le32(upper_32_bits(addr)); 467 + bdl[0] = cpu_to_le32((u32)(addr + bus->addr_offset)); 468 + bdl[1] = cpu_to_le32(upper_32_bits(addr + bus->addr_offset)); 469 469 /* program the size field of the BDL entry */ 470 470 chunk = snd_sgbuf_get_chunk_size(dmab, ofs, size); 471 471 /* one BDLE cannot cross 4K boundary on CTHDA chips */
+2
sound/soc/amd/acp/acp-i2s.c
··· 157 157 158 158 spin_lock_irq(&chip->acp_lock); 159 159 list_for_each_entry(stream, &chip->stream_list, list) { 160 + if (dai->id != stream->dai_id) 161 + continue; 160 162 switch (chip->acp_rev) { 161 163 case ACP_RN_PCI_ID: 162 164 case ACP_RMB_PCI_ID:
+24 -6
sound/soc/amd/acp/acp-legacy-common.c
··· 219 219 SP_PB_FIFO_ADDR_OFFSET; 220 220 reg_fifo_addr = ACP_I2S_TX_FIFOADDR(chip); 221 221 reg_fifo_size = ACP_I2S_TX_FIFOSIZE(chip); 222 - phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset; 222 + if (chip->acp_rev >= ACP70_PCI_ID) 223 + phy_addr = ACP7x_I2S_SP_TX_MEM_WINDOW_START; 224 + else 225 + phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset; 223 226 writel(phy_addr, chip->base + ACP_I2S_TX_RINGBUFADDR(chip)); 224 227 } else { 225 228 reg_dma_size = ACP_I2S_RX_DMA_SIZE(chip); ··· 230 227 SP_CAPT_FIFO_ADDR_OFFSET; 231 228 reg_fifo_addr = ACP_I2S_RX_FIFOADDR(chip); 232 229 reg_fifo_size = ACP_I2S_RX_FIFOSIZE(chip); 233 - phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset; 230 + if (chip->acp_rev >= ACP70_PCI_ID) 231 + phy_addr = ACP7x_I2S_SP_RX_MEM_WINDOW_START; 232 + else 233 + phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset; 234 234 writel(phy_addr, chip->base + ACP_I2S_RX_RINGBUFADDR(chip)); 235 235 } 236 236 break; ··· 244 238 BT_PB_FIFO_ADDR_OFFSET; 245 239 reg_fifo_addr = ACP_BT_TX_FIFOADDR(chip); 246 240 reg_fifo_size = ACP_BT_TX_FIFOSIZE(chip); 247 - phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset; 241 + if (chip->acp_rev >= ACP70_PCI_ID) 242 + phy_addr = ACP7x_I2S_BT_TX_MEM_WINDOW_START; 243 + else 244 + phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset; 248 245 writel(phy_addr, chip->base + ACP_BT_TX_RINGBUFADDR(chip)); 249 246 } else { 250 247 reg_dma_size = ACP_BT_RX_DMA_SIZE(chip); ··· 255 246 BT_CAPT_FIFO_ADDR_OFFSET; 256 247 reg_fifo_addr = ACP_BT_RX_FIFOADDR(chip); 257 248 reg_fifo_size = ACP_BT_RX_FIFOSIZE(chip); 258 - phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset; 249 + if (chip->acp_rev >= ACP70_PCI_ID) 250 + phy_addr = ACP7x_I2S_BT_RX_MEM_WINDOW_START; 251 + else 252 + phy_addr = I2S_BT_RX_MEM_WINDOW_START + stream->reg_offset; 259 253 writel(phy_addr, chip->base + ACP_BT_RX_RINGBUFADDR(chip)); 260 254 } 261 255 break; ··· 269 257 HS_PB_FIFO_ADDR_OFFSET; 270 258 reg_fifo_addr = ACP_HS_TX_FIFOADDR; 271 259 reg_fifo_size = ACP_HS_TX_FIFOSIZE; 272 - phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset; 260 + if (chip->acp_rev >= ACP70_PCI_ID) 261 + phy_addr = ACP7x_I2S_HS_TX_MEM_WINDOW_START; 262 + else 263 + phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset; 273 264 writel(phy_addr, chip->base + ACP_HS_TX_RINGBUFADDR); 274 265 } else { 275 266 reg_dma_size = ACP_HS_RX_DMA_SIZE; ··· 280 265 HS_CAPT_FIFO_ADDR_OFFSET; 281 266 reg_fifo_addr = ACP_HS_RX_FIFOADDR; 282 267 reg_fifo_size = ACP_HS_RX_FIFOSIZE; 283 - phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset; 268 + if (chip->acp_rev >= ACP70_PCI_ID) 269 + phy_addr = ACP7x_I2S_HS_RX_MEM_WINDOW_START; 270 + else 271 + phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset; 284 272 writel(phy_addr, chip->base + ACP_HS_RX_RINGBUFADDR); 285 273 } 286 274 break;
+3 -1
sound/soc/bcm/bcm63xx-pcm-whistler.c
··· 358 358 359 359 i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev); 360 360 361 - of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1); 361 + ret = of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1); 362 + if (ret) 363 + return ret; 362 364 363 365 ret = dma_coerce_mask_and_coherent(pcm->card->dev, DMA_BIT_MASK(32)); 364 366 if (ret)
+1 -2
sound/soc/codecs/Kconfig
··· 777 777 config SND_SOC_CROS_EC_CODEC 778 778 tristate "codec driver for ChromeOS EC" 779 779 depends on CROS_EC 780 - select CRYPTO 781 780 select CRYPTO_LIB_SHA256 782 781 help 783 782 If you say yes here you will get support for the ··· 917 918 config SND_SOC_CS35L56_CAL_SET_CTRL 918 919 bool "CS35L56 ALSA control to restore factory calibration" 919 920 default N 920 - select SND_SOC_CS35L56_CAL_SYSFS_COMMON 921 + select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON 921 922 help 922 923 Allow restoring factory calibration data through an ALSA 923 924 control. This is only needed on platforms without UEFI or
+9 -1
sound/soc/codecs/ak4458.c
··· 671 671 regcache_cache_only(ak4458->regmap, false); 672 672 regcache_mark_dirty(ak4458->regmap); 673 673 674 - return regcache_sync(ak4458->regmap); 674 + ret = regcache_sync(ak4458->regmap); 675 + if (ret) 676 + goto err; 677 + 678 + return 0; 679 + err: 680 + regcache_cache_only(ak4458->regmap, true); 681 + regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies); 682 + return ret; 675 683 } 676 684 677 685 static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {
+9 -1
sound/soc/codecs/ak5558.c
··· 372 372 regcache_cache_only(ak5558->regmap, false); 373 373 regcache_mark_dirty(ak5558->regmap); 374 374 375 - return regcache_sync(ak5558->regmap); 375 + ret = regcache_sync(ak5558->regmap); 376 + if (ret) 377 + goto err; 378 + 379 + return 0; 380 + err: 381 + regcache_cache_only(ak5558->regmap, true); 382 + regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), ak5558->supplies); 383 + return ret; 376 384 } 377 385 378 386 static const struct dev_pm_ops ak5558_pm = {
+17 -12
sound/soc/codecs/cs-amp-lib.c
··· 7 7 8 8 #include <asm/byteorder.h> 9 9 #include <kunit/static_stub.h> 10 - #include <linux/cleanup.h> 11 10 #include <linux/debugfs.h> 12 11 #include <linux/dev_printk.h> 13 12 #include <linux/efi.h> ··· 309 310 efi_guid_t **guid, 310 311 u32 *attr) 311 312 { 312 - struct cirrus_amp_efi_data *efi_data __free(kfree) = NULL; 313 + struct cirrus_amp_efi_data *efi_data; 313 314 unsigned long data_size = 0; 315 + u8 *data; 314 316 efi_status_t status; 315 317 int i, ret; 316 318 ··· 339 339 } 340 340 341 341 /* Get variable contents into buffer */ 342 - efi_data = kmalloc(data_size, GFP_KERNEL); 343 - if (!efi_data) 342 + data = kmalloc(data_size, GFP_KERNEL); 343 + if (!data) 344 344 return ERR_PTR(-ENOMEM); 345 345 346 346 status = cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name, 347 347 cs_amp_lib_cal_efivars[i].guid, 348 - attr, &data_size, efi_data); 348 + attr, &data_size, data); 349 349 if (status != EFI_SUCCESS) { 350 350 ret = -EINVAL; 351 351 goto err; 352 352 } 353 353 354 + efi_data = (struct cirrus_amp_efi_data *)data; 354 355 dev_dbg(dev, "Calibration: Size=%d, Amp Count=%d\n", efi_data->size, efi_data->count); 355 356 356 357 if ((efi_data->count > 128) || ··· 365 364 if (efi_data->size == 0) 366 365 efi_data->size = data_size; 367 366 368 - return_ptr(efi_data); 367 + return efi_data; 369 368 370 369 err: 370 + kfree(data); 371 371 dev_err(dev, "Failed to read calibration data from EFI: %d\n", ret); 372 372 373 373 return ERR_PTR(ret); ··· 391 389 static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index, 392 390 struct cirrus_amp_cal_data *out_data) 393 391 { 394 - struct cirrus_amp_efi_data *efi_data __free(kfree) = NULL; 392 + struct cirrus_amp_efi_data *efi_data; 395 393 struct cirrus_amp_cal_data *cal = NULL; 396 - int i; 394 + int i, ret; 397 395 398 396 efi_data = cs_amp_get_cal_efi_buffer(dev, NULL, NULL, NULL); 399 397 if (IS_ERR(efi_data)) ··· 434 432 dev_warn(dev, "Calibration entry %d does not match silicon ID", amp_index); 435 433 } 436 434 437 - if (!cal) { 435 + if (cal) { 436 + memcpy(out_data, cal, sizeof(*out_data)); 437 + ret = 0; 438 + } else { 438 439 dev_warn(dev, "No calibration for silicon ID %#llx\n", target_uid); 439 - return -ENOENT; 440 + ret = -ENOENT; 440 441 } 441 442 442 - memcpy(out_data, cal, sizeof(*out_data)); 443 + kfree(efi_data); 443 444 444 - return 0; 445 + return ret; 445 446 } 446 447 447 448 static int _cs_amp_set_efi_calibration_data(struct device *dev, int amp_index, int num_amps,
+4 -3
sound/soc/codecs/cs35l41.c
··· 1188 1188 } 1189 1189 } 1190 1190 1191 - err: 1192 1191 if (sub) { 1193 1192 cs35l41->dsp.system_name = sub; 1194 1193 dev_info(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name); 1195 - } else 1196 - dev_warn(cs35l41->dev, "Subsystem ID not found\n"); 1194 + return 0; 1195 + } 1197 1196 1197 + err: 1198 + dev_warn(cs35l41->dev, "Subsystem ID not found\n"); 1198 1199 return ret; 1199 1200 } 1200 1201
+2 -2
sound/soc/codecs/nau8325.c
··· 386 386 const struct nau8325_srate_attr **srate_table, 387 387 int *n1_sel, int *mult_sel, int *n2_sel) 388 388 { 389 - int i, j, mclk, mclk_max, ratio, ratio_sel, n2_max; 389 + int i, j, mclk, ratio; 390 + int mclk_max = 0, ratio_sel = 0, n2_max = 0; 390 391 391 392 if (!nau8325->mclk || !nau8325->fs) 392 393 goto proc_err; ··· 409 408 } 410 409 411 410 /* Get MCLK_SRC through 1/N, Multiplier, and then 1/N2. */ 412 - mclk_max = 0; 413 411 for (i = 0; i < ARRAY_SIZE(mclk_n1_div); i++) { 414 412 for (j = 0; j < ARRAY_SIZE(mclk_n3_mult); j++) { 415 413 mclk = nau8325->mclk << mclk_n3_mult[j].param;
+2 -2
sound/soc/codecs/wcd937x.c
··· 2866 2866 dev_err(dev, "Couldn't parse phandle to qcom,rx-device!\n"); 2867 2867 return -ENODEV; 2868 2868 } 2869 - of_node_get(wcd937x->rxnode); 2869 + 2870 2870 component_match_add_release(dev, matchptr, component_release_of, 2871 2871 component_compare_of, wcd937x->rxnode); 2872 2872 ··· 2875 2875 dev_err(dev, "Couldn't parse phandle to qcom,tx-device\n"); 2876 2876 return -ENODEV; 2877 2877 } 2878 - of_node_get(wcd937x->txnode); 2878 + 2879 2879 component_match_add_release(dev, matchptr, component_release_of, 2880 2880 component_compare_of, wcd937x->txnode); 2881 2881
+1 -2
sound/soc/codecs/wcd938x.c
··· 3464 3464 return -ENODEV; 3465 3465 } 3466 3466 3467 - of_node_get(wcd938x->rxnode); 3468 3467 component_match_add_release(dev, matchptr, component_release_of, 3469 3468 component_compare_of, wcd938x->rxnode); 3470 3469 ··· 3472 3473 dev_err(dev, "%s: Tx-device node not defined\n", __func__); 3473 3474 return -ENODEV; 3474 3475 } 3475 - of_node_get(wcd938x->txnode); 3476 + 3476 3477 component_match_add_release(dev, matchptr, component_release_of, 3477 3478 component_compare_of, wcd938x->txnode); 3478 3479 return 0;
+1 -2
sound/soc/codecs/wcd939x.c
··· 3526 3526 return -ENODEV; 3527 3527 } 3528 3528 3529 - of_node_get(wcd939x->rxnode); 3530 3529 component_match_add_release(dev, matchptr, component_release_of, 3531 3530 component_compare_of, wcd939x->rxnode); 3532 3531 ··· 3534 3535 dev_err(dev, "%s: Tx-device node not defined\n", __func__); 3535 3536 return -ENODEV; 3536 3537 } 3537 - of_node_get(wcd939x->txnode); 3538 + 3538 3539 component_match_add_release(dev, matchptr, component_release_of, 3539 3540 component_compare_of, wcd939x->txnode); 3540 3541 return 0;
+2 -2
sound/soc/qcom/qdsp6/q6afe.c
··· 947 947 struct q6afe_port *p; 948 948 struct q6afe_port *ret = NULL; 949 949 950 - guard(spinlock)(&afe->port_list_lock); 950 + guard(spinlock_irqsave)(&afe->port_list_lock); 951 951 list_for_each_entry(p, &afe->port_list, node) 952 952 if (p->token == token) { 953 953 ret = p; ··· 1807 1807 port->cfg_type = cfg_type; 1808 1808 kref_init(&port->refcount); 1809 1809 1810 - guard(spinlock)(&afe->port_list_lock); 1810 + guard(spinlock_irqsave)(&afe->port_list_lock); 1811 1811 list_add_tail(&port->node, &afe->port_list); 1812 1812 1813 1813 return port;
+1 -1
sound/soc/rockchip/rockchip_pdm.c
··· 580 580 if (!pdm) 581 581 return -ENOMEM; 582 582 583 - pdm->version = (enum rk_pdm_version)device_get_match_data(&pdev->dev); 583 + pdm->version = (unsigned long)device_get_match_data(&pdev->dev); 584 584 if (pdm->version == RK_PDM_RK3308) { 585 585 pdm->reset = devm_reset_control_get(&pdev->dev, "pdm-m"); 586 586 if (IS_ERR(pdm->reset))
+1
sound/usb/mixer_quirks.c
··· 2545 2545 struct usb_mixer_elem_list *list = snd_kcontrol_chip(kcontrol); 2546 2546 struct snd_usb_audio *chip = list->mixer->chip; 2547 2547 2548 + *status1 = 0; 2548 2549 CLASS(snd_usb_lock, pm)(chip); 2549 2550 if (pm.err < 0) 2550 2551 return pm.err;