aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorStefan Binding <sbinding@opensource.cirrus.com>2023-07-21 16:18:12 +0100
committerTakashi Iwai <tiwai@suse.de>2023-07-24 11:00:02 +0200
commit4eae4892c5bdef990b4b80997b813e2443d6554c (patch)
tree82797365b26826bc23923e5d553db19693af3cec /sound/pci/hda/patch_realtek.c
parentALSA: hda: cs35l41: Move Play and Pause into separate functions (diff)
downloadwireguard-linux-4eae4892c5bdef990b4b80997b813e2443d6554c.tar.xz
wireguard-linux-4eae4892c5bdef990b4b80997b813e2443d6554c.zip
ALSA: hda: hda_component: Add pre and post playback hooks to hda_component
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>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e2f8b608de82..7d14f9dbe95e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6700,9 +6700,17 @@ static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_
int i;
for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
- if (spec->comps[i].dev)
+ if (spec->comps[i].dev && spec->comps[i].pre_playback_hook)
+ spec->comps[i].pre_playback_hook(spec->comps[i].dev, action);
+ }
+ for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
+ if (spec->comps[i].dev && spec->comps[i].playback_hook)
spec->comps[i].playback_hook(spec->comps[i].dev, action);
}
+ for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
+ if (spec->comps[i].dev && spec->comps[i].post_playback_hook)
+ spec->comps[i].post_playback_hook(spec->comps[i].dev, action);
+ }
}
struct cs35l41_dev_name {