summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-07-28 21:49:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-07-28 21:49:49 -0700
commit177bf8620cf4ed290ee170a6c5966adc0924b336 (patch)
treef7bdb2131bc51d70325c7be38da11a8f8c685733 /sound/soc/soc-core.c
parente30fc090828e5761defe345b7bfb61bfc46be5bd (diff)
parentbca53a176f3d46fdab67f9e2fb1a185e0233d98d (diff)
Merge tag 'sound-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "This includes lots of file shuffling due to HD-audio code reorganization and many trivial changes, but otherwise there shouldn't be much surprise from the functionality POV. The PR includes the PM changes as prerequisite, too. Some highlights below: Core: - Performance optimizations in PCM core code - Refactoring of ASoC Kconfig menus to be hopefully more consistant and easier to navigate. - Refactoring of ASoC DAPM code, mainly hiding functionality that doesn't need to be exposed to drivers HD-audio reorganization: - All code are moved under sound/hda with a bit more understandable tree structure, as well as file renames - The huge Realtek driver code is split to several parts, a common helper module with driver modules per probe entry - HDMI and Cirrus codec drivers also split ASoC: - Further work on the generic handling for SoundWire SDCA devices - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5, various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI TAS5753 HD-audio and USB-audio: - TAS2781 driver cleanup and TAS2770 support - EQ enablement in CA0132 driver - USB audio quirk code cleanups Others: - Cleanups of PM autosuspend call patterns with the update from the PM tree - Lots of strcpy() -> strscpy() conversions for fixed size arrays" * tag 'sound-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (385 commits) ALSA: hda: Add TAS2770 support ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode ASoC: SDCA: Fix implicit cast from le16 ASoC: SDCA: Shrink detected_mode_handler() stack frame ASoC: SDCA: Check devm_mutex_init() return value ASoC: SDCA: add route by the number of input pins in MU entity ALSA: hda/realtek: Add support for ASUS Commercial laptops using CS35L41 HDA ASoC: Intel: sof_rt5682: Add HDMI-In capture with rt5682 support for PTL. ASoC: codec: tlv320aic32x4: Fix reset GPIO check ASoC: dt-bindings: qcom,lpass-va-macro: Define clock-names in top-level ASoC: SDCA: Add hw_params() helper function ASoC: SDCA: Add a helper to get the SoundWire port number ASoC: SDCA: Add helper to add DAI constraints ASoC: soc-dai: Add private data to snd_soc_dai ASoC: SDCA: Move SDCA search functions and export ASoC: SDCA: Remove overly chatty input pin list warning ASoC: SDCA: Allow read-only controls to be deferrable ASoC: SDCA: Update memory allocations to zero initialise ...
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 67bebc339148..37bc5867f81d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -112,7 +112,7 @@ static umode_t soc_dev_attr_is_visible(struct kobject *kobj,
}
static const struct attribute_group soc_dapm_dev_group = {
- .attrs = soc_dapm_dev_attrs,
+ .attrs = snd_soc_dapm_dev_attrs,
.is_visible = soc_dev_attr_is_visible,
};
@@ -681,7 +681,7 @@ int snd_soc_suspend(struct device *dev)
soc_dapm_suspend_resume(card, SND_SOC_DAPM_STREAM_SUSPEND);
/* Recheck all endpoints too, their state is affected by suspend */
- dapm_mark_endpoints_dirty(card);
+ snd_soc_dapm_mark_endpoints_dirty(card);
snd_soc_dapm_sync(&card->dapm);
/* suspend all COMPONENTs */
@@ -778,7 +778,7 @@ static void soc_resume_deferred(struct work_struct *work)
dev_dbg(card->dev, "ASoC: resume work completed\n");
/* Recheck all endpoints too, their state is affected by suspend */
- dapm_mark_endpoints_dirty(card);
+ snd_soc_dapm_mark_endpoints_dirty(card);
snd_soc_dapm_sync(&card->dapm);
/* userspace can access us now we are back as we were before */
@@ -1139,6 +1139,9 @@ sanity_check:
void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *rtd)
{
+ if (!rtd)
+ return;
+
lockdep_assert_held(&client_mutex);
/*
@@ -2286,7 +2289,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card)
}
card->instantiated = 1;
- dapm_mark_endpoints_dirty(card);
+ snd_soc_dapm_mark_endpoints_dirty(card);
snd_soc_dapm_sync(&card->dapm);
/* deactivate pins to sleep state */
@@ -2604,6 +2607,7 @@ static char *fmt_single_name(struct device *dev, int *id)
const char *devname = dev_name(dev);
char *found, *name;
unsigned int id1, id2;
+ int __id;
if (devname == NULL)
return NULL;
@@ -2616,10 +2620,10 @@ static char *fmt_single_name(struct device *dev, int *id)
found = strstr(name, dev->driver->name);
if (found) {
/* get ID */
- if (sscanf(&found[strlen(dev->driver->name)], ".%d", id) == 1) {
+ if (sscanf(&found[strlen(dev->driver->name)], ".%d", &__id) == 1) {
/* discard ID from name if ID == -1 */
- if (*id == -1)
+ if (__id == -1)
found[strlen(dev->driver->name)] = '\0';
}
@@ -2627,16 +2631,19 @@ static char *fmt_single_name(struct device *dev, int *id)
} else if (sscanf(name, "%x-%x", &id1, &id2) == 2) {
/* create unique ID number from I2C addr and bus */
- *id = ((id1 & 0xffff) << 16) + id2;
+ __id = ((id1 & 0xffff) << 16) + id2;
devm_kfree(dev, name);
/* sanitize component name for DAI link creation */
name = devm_kasprintf(dev, GFP_KERNEL, "%s.%s", dev->driver->name, devname);
} else {
- *id = 0;
+ __id = 0;
}
+ if (id)
+ *id = __id;
+
return name;
}
@@ -2831,7 +2838,7 @@ int snd_soc_component_initialize(struct snd_soc_component *component,
mutex_init(&component->io_mutex);
if (!component->name) {
- component->name = fmt_single_name(dev, &component->id);
+ component->name = fmt_single_name(dev, NULL);
if (!component->name) {
dev_err(dev, "ASoC: Failed to allocate name\n");
return -ENOMEM;