162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci * 362306a36Sopenharmony_ci * linux/sound/soc-dapm.h -- ALSA SoC Dynamic Audio Power Management 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Author: Liam Girdwood 662306a36Sopenharmony_ci * Created: Aug 11th 2005 762306a36Sopenharmony_ci * Copyright: Wolfson Microelectronics. PLC. 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef __LINUX_SND_SOC_DAPM_H 1162306a36Sopenharmony_ci#define __LINUX_SND_SOC_DAPM_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <linux/types.h> 1462306a36Sopenharmony_ci#include <sound/control.h> 1562306a36Sopenharmony_ci#include <sound/soc-topology.h> 1662306a36Sopenharmony_ci#include <sound/asoc.h> 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_cistruct device; 1962306a36Sopenharmony_cistruct snd_pcm_substream; 2062306a36Sopenharmony_cistruct snd_soc_pcm_runtime; 2162306a36Sopenharmony_cistruct soc_enum; 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* widget has no PM register bit */ 2462306a36Sopenharmony_ci#define SND_SOC_NOPM -1 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci/* 2762306a36Sopenharmony_ci * SoC dynamic audio power management 2862306a36Sopenharmony_ci * 2962306a36Sopenharmony_ci * We can have up to 4 power domains 3062306a36Sopenharmony_ci * 1. Codec domain - VREF, VMID 3162306a36Sopenharmony_ci * Usually controlled at codec probe/remove, although can be set 3262306a36Sopenharmony_ci * at stream time if power is not needed for sidetone, etc. 3362306a36Sopenharmony_ci * 2. Platform/Machine domain - physically connected inputs and outputs 3462306a36Sopenharmony_ci * Is platform/machine and user action specific, is set in the machine 3562306a36Sopenharmony_ci * driver and by userspace e.g when HP are inserted 3662306a36Sopenharmony_ci * 3. Path domain - Internal codec path mixers 3762306a36Sopenharmony_ci * Are automatically set when mixer and mux settings are 3862306a36Sopenharmony_ci * changed by the user. 3962306a36Sopenharmony_ci * 4. Stream domain - DAC's and ADC's. 4062306a36Sopenharmony_ci * Enabled when stream playback/capture is started. 4162306a36Sopenharmony_ci */ 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci/* codec domain */ 4462306a36Sopenharmony_ci#define SND_SOC_DAPM_VMID(wname) \ 4562306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 4662306a36Sopenharmony_ci .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ 4762306a36Sopenharmony_ci .num_kcontrols = 0} 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci/* platform domain */ 5062306a36Sopenharmony_ci#define SND_SOC_DAPM_SIGGEN(wname) \ 5162306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 5262306a36Sopenharmony_ci .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \ 5362306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM } 5462306a36Sopenharmony_ci#define SND_SOC_DAPM_SINK(wname) \ 5562306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 5662306a36Sopenharmony_ci .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \ 5762306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM } 5862306a36Sopenharmony_ci#define SND_SOC_DAPM_INPUT(wname) \ 5962306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 6062306a36Sopenharmony_ci .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ 6162306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM } 6262306a36Sopenharmony_ci#define SND_SOC_DAPM_OUTPUT(wname) \ 6362306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 6462306a36Sopenharmony_ci .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ 6562306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM } 6662306a36Sopenharmony_ci#define SND_SOC_DAPM_MIC(wname, wevent) \ 6762306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 6862306a36Sopenharmony_ci .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ 6962306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 7062306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 7162306a36Sopenharmony_ci#define SND_SOC_DAPM_HP(wname, wevent) \ 7262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 7362306a36Sopenharmony_ci .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ 7462306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 7562306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 7662306a36Sopenharmony_ci#define SND_SOC_DAPM_SPK(wname, wevent) \ 7762306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 7862306a36Sopenharmony_ci .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ 7962306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 8062306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 8162306a36Sopenharmony_ci#define SND_SOC_DAPM_LINE(wname, wevent) \ 8262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 8362306a36Sopenharmony_ci .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ 8462306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 8562306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci#define SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) \ 8862306a36Sopenharmony_ci .reg = wreg, .mask = 1, .shift = wshift, \ 8962306a36Sopenharmony_ci .on_val = winvert ? 0 : 1, .off_val = winvert ? 1 : 0 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci/* path domain */ 9262306a36Sopenharmony_ci#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 9362306a36Sopenharmony_ci wcontrols, wncontrols) \ 9462306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 9562306a36Sopenharmony_ci .id = snd_soc_dapm_pga, .name = wname, \ 9662306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 9762306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 9862306a36Sopenharmony_ci#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 9962306a36Sopenharmony_ci wcontrols, wncontrols) \ 10062306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 10162306a36Sopenharmony_ci .id = snd_soc_dapm_out_drv, .name = wname, \ 10262306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 10362306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 10462306a36Sopenharmony_ci#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 10562306a36Sopenharmony_ci wcontrols, wncontrols)\ 10662306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 10762306a36Sopenharmony_ci .id = snd_soc_dapm_mixer, .name = wname, \ 10862306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 10962306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 11062306a36Sopenharmony_ci#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 11162306a36Sopenharmony_ci wcontrols, wncontrols)\ 11262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 11362306a36Sopenharmony_ci .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 11462306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 11562306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 11662306a36Sopenharmony_ci/* DEPRECATED: use SND_SOC_DAPM_SUPPLY */ 11762306a36Sopenharmony_ci#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 11862306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 11962306a36Sopenharmony_ci .id = snd_soc_dapm_micbias, .name = wname, \ 12062306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 12162306a36Sopenharmony_ci .kcontrol_news = NULL, .num_kcontrols = 0} 12262306a36Sopenharmony_ci#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 12362306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 12462306a36Sopenharmony_ci .id = snd_soc_dapm_switch, .name = wname, \ 12562306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 12662306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = 1} 12762306a36Sopenharmony_ci#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 12862306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 12962306a36Sopenharmony_ci .id = snd_soc_dapm_mux, .name = wname, \ 13062306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 13162306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = 1} 13262306a36Sopenharmony_ci#define SND_SOC_DAPM_DEMUX(wname, wreg, wshift, winvert, wcontrols) \ 13362306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 13462306a36Sopenharmony_ci .id = snd_soc_dapm_demux, .name = wname, \ 13562306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 13662306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = 1} 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 13962306a36Sopenharmony_ci#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 14062306a36Sopenharmony_ci wcontrols) \ 14162306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 14262306a36Sopenharmony_ci .id = snd_soc_dapm_pga, .name = wname, \ 14362306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 14462306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 14562306a36Sopenharmony_ci#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 14662306a36Sopenharmony_ci wcontrols)\ 14762306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 14862306a36Sopenharmony_ci .id = snd_soc_dapm_mixer, .name = wname, \ 14962306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 15062306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 15162306a36Sopenharmony_ci#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 15262306a36Sopenharmony_ci wcontrols)\ 15362306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 15462306a36Sopenharmony_ci .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 15562306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 15662306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci/* path domain with event - event handler must return 0 for success */ 15962306a36Sopenharmony_ci#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 16062306a36Sopenharmony_ci wncontrols, wevent, wflags) \ 16162306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 16262306a36Sopenharmony_ci .id = snd_soc_dapm_pga, .name = wname, \ 16362306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 16462306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 16562306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 16662306a36Sopenharmony_ci#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 16762306a36Sopenharmony_ci wncontrols, wevent, wflags) \ 16862306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 16962306a36Sopenharmony_ci .id = snd_soc_dapm_out_drv, .name = wname, \ 17062306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 17162306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 17262306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 17362306a36Sopenharmony_ci#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 17462306a36Sopenharmony_ci wncontrols, wevent, wflags) \ 17562306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 17662306a36Sopenharmony_ci .id = snd_soc_dapm_mixer, .name = wname, \ 17762306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 17862306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 17962306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 18062306a36Sopenharmony_ci#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 18162306a36Sopenharmony_ci wcontrols, wncontrols, wevent, wflags) \ 18262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 18362306a36Sopenharmony_ci .id = snd_soc_dapm_mixer, .name = wname, \ 18462306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 18562306a36Sopenharmony_ci .kcontrol_news = wcontrols, \ 18662306a36Sopenharmony_ci .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} 18762306a36Sopenharmony_ci#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 18862306a36Sopenharmony_ci wevent, wflags) \ 18962306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 19062306a36Sopenharmony_ci .id = snd_soc_dapm_switch, .name = wname, \ 19162306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 19262306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 19362306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 19462306a36Sopenharmony_ci#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 19562306a36Sopenharmony_ci wevent, wflags) \ 19662306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 19762306a36Sopenharmony_ci .id = snd_soc_dapm_mux, .name = wname, \ 19862306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 19962306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 20062306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 20162306a36Sopenharmony_ci 20262306a36Sopenharmony_ci/* additional sequencing control within an event type */ 20362306a36Sopenharmony_ci#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 20462306a36Sopenharmony_ci wevent, wflags) \ 20562306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 20662306a36Sopenharmony_ci .id = snd_soc_dapm_pga, .name = wname, \ 20762306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 20862306a36Sopenharmony_ci .event = wevent, .event_flags = wflags, \ 20962306a36Sopenharmony_ci .subseq = wsubseq} 21062306a36Sopenharmony_ci#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ 21162306a36Sopenharmony_ci wflags) \ 21262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 21362306a36Sopenharmony_ci .id = snd_soc_dapm_supply, .name = wname, \ 21462306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 21562306a36Sopenharmony_ci .event = wevent, .event_flags = wflags, .subseq = wsubseq} 21662306a36Sopenharmony_ci 21762306a36Sopenharmony_ci/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 21862306a36Sopenharmony_ci#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 21962306a36Sopenharmony_ci wevent, wflags) \ 22062306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 22162306a36Sopenharmony_ci .id = snd_soc_dapm_pga, .name = wname, \ 22262306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 22362306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 22462306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 22562306a36Sopenharmony_ci#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 22662306a36Sopenharmony_ci wevent, wflags) \ 22762306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 22862306a36Sopenharmony_ci .id = snd_soc_dapm_mixer, .name = wname, \ 22962306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 23062306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 23162306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 23262306a36Sopenharmony_ci#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 23362306a36Sopenharmony_ci wcontrols, wevent, wflags) \ 23462306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 23562306a36Sopenharmony_ci .id = snd_soc_dapm_mixer, .name = wname, \ 23662306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 23762306a36Sopenharmony_ci .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 23862306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci/* events that are pre and post DAPM */ 24162306a36Sopenharmony_ci#define SND_SOC_DAPM_PRE(wname, wevent) \ 24262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 24362306a36Sopenharmony_ci .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ 24462306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 24562306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} 24662306a36Sopenharmony_ci#define SND_SOC_DAPM_POST(wname, wevent) \ 24762306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 24862306a36Sopenharmony_ci .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ 24962306a36Sopenharmony_ci .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 25062306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} 25162306a36Sopenharmony_ci 25262306a36Sopenharmony_ci/* stream domain */ 25362306a36Sopenharmony_ci#define SND_SOC_DAPM_AIF_IN(wname, stname, wchan, wreg, wshift, winvert) \ 25462306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 25562306a36Sopenharmony_ci .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 25662306a36Sopenharmony_ci .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 25762306a36Sopenharmony_ci#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wchan, wreg, wshift, winvert, \ 25862306a36Sopenharmony_ci wevent, wflags) \ 25962306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 26062306a36Sopenharmony_ci .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 26162306a36Sopenharmony_ci .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 26262306a36Sopenharmony_ci .event = wevent, .event_flags = wflags } 26362306a36Sopenharmony_ci#define SND_SOC_DAPM_AIF_OUT(wname, stname, wchan, wreg, wshift, winvert) \ 26462306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 26562306a36Sopenharmony_ci .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 26662306a36Sopenharmony_ci .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 26762306a36Sopenharmony_ci#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wchan, wreg, wshift, winvert, \ 26862306a36Sopenharmony_ci wevent, wflags) \ 26962306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 27062306a36Sopenharmony_ci .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 27162306a36Sopenharmony_ci .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 27262306a36Sopenharmony_ci .event = wevent, .event_flags = wflags } 27362306a36Sopenharmony_ci#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 27462306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 27562306a36Sopenharmony_ci .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 27662306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) } 27762306a36Sopenharmony_ci#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 27862306a36Sopenharmony_ci wevent, wflags) \ 27962306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 28062306a36Sopenharmony_ci .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 28162306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 28262306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 28362306a36Sopenharmony_ci 28462306a36Sopenharmony_ci#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 28562306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 28662306a36Sopenharmony_ci .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 28762306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 28862306a36Sopenharmony_ci#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 28962306a36Sopenharmony_ci wevent, wflags) \ 29062306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 29162306a36Sopenharmony_ci .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 29262306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 29362306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 29462306a36Sopenharmony_ci#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ 29562306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 29662306a36Sopenharmony_ci .id = snd_soc_dapm_clock_supply, .name = wname, \ 29762306a36Sopenharmony_ci .reg = SND_SOC_NOPM, .event = dapm_clock_event, \ 29862306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } 29962306a36Sopenharmony_ci 30062306a36Sopenharmony_ci/* generic widgets */ 30162306a36Sopenharmony_ci#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 30262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 30362306a36Sopenharmony_ci .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ 30462306a36Sopenharmony_ci .reg = wreg, .shift = wshift, .mask = wmask, \ 30562306a36Sopenharmony_ci .on_val = won_val, .off_val = woff_val, } 30662306a36Sopenharmony_ci#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 30762306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 30862306a36Sopenharmony_ci .id = snd_soc_dapm_supply, .name = wname, \ 30962306a36Sopenharmony_ci SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 31062306a36Sopenharmony_ci .event = wevent, .event_flags = wflags} 31162306a36Sopenharmony_ci#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ 31262306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 31362306a36Sopenharmony_ci .id = snd_soc_dapm_regulator_supply, .name = wname, \ 31462306a36Sopenharmony_ci .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 31562306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ 31662306a36Sopenharmony_ci .on_val = wflags} 31762306a36Sopenharmony_ci#define SND_SOC_DAPM_PINCTRL(wname, active, sleep) \ 31862306a36Sopenharmony_ci(struct snd_soc_dapm_widget) { \ 31962306a36Sopenharmony_ci .id = snd_soc_dapm_pinctrl, .name = wname, \ 32062306a36Sopenharmony_ci .priv = (&(struct snd_soc_dapm_pinctrl_priv) \ 32162306a36Sopenharmony_ci { .active_state = active, .sleep_state = sleep,}), \ 32262306a36Sopenharmony_ci .reg = SND_SOC_NOPM, .event = dapm_pinctrl_event, \ 32362306a36Sopenharmony_ci .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } 32462306a36Sopenharmony_ci 32562306a36Sopenharmony_ci 32662306a36Sopenharmony_ci 32762306a36Sopenharmony_ci/* dapm kcontrol types */ 32862306a36Sopenharmony_ci#define SOC_DAPM_DOUBLE(xname, reg, lshift, rshift, max, invert) \ 32962306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 33062306a36Sopenharmony_ci .info = snd_soc_info_volsw, \ 33162306a36Sopenharmony_ci .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 33262306a36Sopenharmony_ci .private_value = SOC_DOUBLE_VALUE(reg, lshift, rshift, max, invert, 0) } 33362306a36Sopenharmony_ci#define SOC_DAPM_DOUBLE_R(xname, lreg, rreg, shift, max, invert) \ 33462306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 33562306a36Sopenharmony_ci .info = snd_soc_info_volsw, \ 33662306a36Sopenharmony_ci .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 33762306a36Sopenharmony_ci .private_value = SOC_DOUBLE_R_VALUE(lreg, rreg, shift, max, invert) } 33862306a36Sopenharmony_ci#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ 33962306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 34062306a36Sopenharmony_ci .info = snd_soc_info_volsw, \ 34162306a36Sopenharmony_ci .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 34262306a36Sopenharmony_ci .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 34362306a36Sopenharmony_ci#define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \ 34462306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 34562306a36Sopenharmony_ci .info = snd_soc_info_volsw, \ 34662306a36Sopenharmony_ci .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 34762306a36Sopenharmony_ci .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } 34862306a36Sopenharmony_ci#define SOC_DAPM_SINGLE_VIRT(xname, max) \ 34962306a36Sopenharmony_ci SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0) 35062306a36Sopenharmony_ci#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 35162306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 35262306a36Sopenharmony_ci .info = snd_soc_info_volsw, \ 35362306a36Sopenharmony_ci .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 35462306a36Sopenharmony_ci .tlv.p = (tlv_array), \ 35562306a36Sopenharmony_ci .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 35662306a36Sopenharmony_ci .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 35762306a36Sopenharmony_ci#define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \ 35862306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 35962306a36Sopenharmony_ci .info = snd_soc_info_volsw, \ 36062306a36Sopenharmony_ci .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 36162306a36Sopenharmony_ci .tlv.p = (tlv_array), \ 36262306a36Sopenharmony_ci .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 36362306a36Sopenharmony_ci .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } 36462306a36Sopenharmony_ci#define SOC_DAPM_SINGLE_TLV_VIRT(xname, max, tlv_array) \ 36562306a36Sopenharmony_ci SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0, tlv_array) 36662306a36Sopenharmony_ci#define SOC_DAPM_ENUM(xname, xenum) \ 36762306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 36862306a36Sopenharmony_ci .info = snd_soc_info_enum_double, \ 36962306a36Sopenharmony_ci .get = snd_soc_dapm_get_enum_double, \ 37062306a36Sopenharmony_ci .put = snd_soc_dapm_put_enum_double, \ 37162306a36Sopenharmony_ci .private_value = (unsigned long)&xenum } 37262306a36Sopenharmony_ci#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \ 37362306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 37462306a36Sopenharmony_ci .info = snd_soc_info_enum_double, \ 37562306a36Sopenharmony_ci .get = xget, \ 37662306a36Sopenharmony_ci .put = xput, \ 37762306a36Sopenharmony_ci .private_value = (unsigned long)&xenum } 37862306a36Sopenharmony_ci#define SOC_DAPM_PIN_SWITCH(xname) \ 37962306a36Sopenharmony_ci{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \ 38062306a36Sopenharmony_ci .info = snd_soc_dapm_info_pin_switch, \ 38162306a36Sopenharmony_ci .get = snd_soc_dapm_get_pin_switch, \ 38262306a36Sopenharmony_ci .put = snd_soc_dapm_put_pin_switch, \ 38362306a36Sopenharmony_ci .private_value = (unsigned long)xname } 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_ci/* dapm stream operations */ 38662306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_NOP 0x0 38762306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_START 0x1 38862306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_STOP 0x2 38962306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_SUSPEND 0x4 39062306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_RESUME 0x8 39162306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_PAUSE_PUSH 0x10 39262306a36Sopenharmony_ci#define SND_SOC_DAPM_STREAM_PAUSE_RELEASE 0x20 39362306a36Sopenharmony_ci 39462306a36Sopenharmony_ci/* dapm event types */ 39562306a36Sopenharmony_ci#define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ 39662306a36Sopenharmony_ci#define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ 39762306a36Sopenharmony_ci#define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ 39862306a36Sopenharmony_ci#define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ 39962306a36Sopenharmony_ci#define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 40062306a36Sopenharmony_ci#define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 40162306a36Sopenharmony_ci#define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */ 40262306a36Sopenharmony_ci#define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ 40362306a36Sopenharmony_ci#define SND_SOC_DAPM_PRE_POST_PMD (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 40462306a36Sopenharmony_ci#define SND_SOC_DAPM_PRE_POST_PMU (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU) 40562306a36Sopenharmony_ci 40662306a36Sopenharmony_ci/* convenience event type detection */ 40762306a36Sopenharmony_ci#define SND_SOC_DAPM_EVENT_ON(e) (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)) 40862306a36Sopenharmony_ci#define SND_SOC_DAPM_EVENT_OFF(e) (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)) 40962306a36Sopenharmony_ci 41062306a36Sopenharmony_ci/* regulator widget flags */ 41162306a36Sopenharmony_ci#define SND_SOC_DAPM_REGULATOR_BYPASS 0x1 /* bypass when disabled */ 41262306a36Sopenharmony_ci 41362306a36Sopenharmony_cistruct snd_soc_dapm_widget; 41462306a36Sopenharmony_cienum snd_soc_dapm_type; 41562306a36Sopenharmony_cistruct snd_soc_dapm_path; 41662306a36Sopenharmony_cistruct snd_soc_dapm_pin; 41762306a36Sopenharmony_cistruct snd_soc_dapm_route; 41862306a36Sopenharmony_cistruct snd_soc_dapm_context; 41962306a36Sopenharmony_cistruct regulator; 42062306a36Sopenharmony_cistruct snd_soc_dapm_widget_list; 42162306a36Sopenharmony_cistruct snd_soc_dapm_update; 42262306a36Sopenharmony_cienum snd_soc_dapm_direction; 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci/* 42562306a36Sopenharmony_ci * Bias levels 42662306a36Sopenharmony_ci * 42762306a36Sopenharmony_ci * @ON: Bias is fully on for audio playback and capture operations. 42862306a36Sopenharmony_ci * @PREPARE: Prepare for audio operations. Called before DAPM switching for 42962306a36Sopenharmony_ci * stream start and stop operations. 43062306a36Sopenharmony_ci * @STANDBY: Low power standby state when no playback/capture operations are 43162306a36Sopenharmony_ci * in progress. NOTE: The transition time between STANDBY and ON 43262306a36Sopenharmony_ci * should be as fast as possible and no longer than 10ms. 43362306a36Sopenharmony_ci * @OFF: Power Off. No restrictions on transition times. 43462306a36Sopenharmony_ci */ 43562306a36Sopenharmony_cienum snd_soc_bias_level { 43662306a36Sopenharmony_ci SND_SOC_BIAS_OFF = 0, 43762306a36Sopenharmony_ci SND_SOC_BIAS_STANDBY = 1, 43862306a36Sopenharmony_ci SND_SOC_BIAS_PREPARE = 2, 43962306a36Sopenharmony_ci SND_SOC_BIAS_ON = 3, 44062306a36Sopenharmony_ci}; 44162306a36Sopenharmony_ci 44262306a36Sopenharmony_ciint dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 44362306a36Sopenharmony_ciint dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 44462306a36Sopenharmony_ciint dapm_pinctrl_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 44562306a36Sopenharmony_ci 44662306a36Sopenharmony_ci/* dapm controls */ 44762306a36Sopenharmony_ciint snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 44862306a36Sopenharmony_ciint snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 44962306a36Sopenharmony_ciint snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, 45062306a36Sopenharmony_ci struct snd_ctl_elem_value *ucontrol); 45162306a36Sopenharmony_ciint snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, 45262306a36Sopenharmony_ci struct snd_ctl_elem_value *ucontrol); 45362306a36Sopenharmony_ciint snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol, 45462306a36Sopenharmony_ci struct snd_ctl_elem_info *uinfo); 45562306a36Sopenharmony_ciint snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, 45662306a36Sopenharmony_ci struct snd_ctl_elem_value *uncontrol); 45762306a36Sopenharmony_ciint snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, 45862306a36Sopenharmony_ci struct snd_ctl_elem_value *uncontrol); 45962306a36Sopenharmony_ciint snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, 46062306a36Sopenharmony_ci const struct snd_soc_dapm_widget *widget, int num); 46162306a36Sopenharmony_cistruct snd_soc_dapm_widget *snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, 46262306a36Sopenharmony_ci const struct snd_soc_dapm_widget *widget); 46362306a36Sopenharmony_cistruct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, 46462306a36Sopenharmony_ci const struct snd_soc_dapm_widget *widget); 46562306a36Sopenharmony_ciint snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, struct snd_soc_dai *dai); 46662306a36Sopenharmony_civoid snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); 46762306a36Sopenharmony_ciint snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 46862306a36Sopenharmony_civoid snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); 46962306a36Sopenharmony_ci 47062306a36Sopenharmony_ciint snd_soc_dapm_update_dai(struct snd_pcm_substream *substream, 47162306a36Sopenharmony_ci struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); 47262306a36Sopenharmony_ciint snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s); 47362306a36Sopenharmony_ci 47462306a36Sopenharmony_ci/* dapm path setup */ 47562306a36Sopenharmony_ciint snd_soc_dapm_new_widgets(struct snd_soc_card *card); 47662306a36Sopenharmony_civoid snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 47762306a36Sopenharmony_civoid snd_soc_dapm_init(struct snd_soc_dapm_context *dapm, 47862306a36Sopenharmony_ci struct snd_soc_card *card, struct snd_soc_component *component); 47962306a36Sopenharmony_ciint snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 48062306a36Sopenharmony_ci const struct snd_soc_dapm_route *route, int num); 48162306a36Sopenharmony_ciint snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm, 48262306a36Sopenharmony_ci const struct snd_soc_dapm_route *route, int num); 48362306a36Sopenharmony_ciint snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, 48462306a36Sopenharmony_ci const struct snd_soc_dapm_route *route, int num); 48562306a36Sopenharmony_civoid snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); 48662306a36Sopenharmony_ci 48762306a36Sopenharmony_ci/* dapm events */ 48862306a36Sopenharmony_civoid snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event); 48962306a36Sopenharmony_civoid snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream); 49062306a36Sopenharmony_civoid snd_soc_dapm_shutdown(struct snd_soc_card *card); 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci/* external DAPM widget events */ 49362306a36Sopenharmony_ciint snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, 49462306a36Sopenharmony_ci struct snd_kcontrol *kcontrol, int connect, struct snd_soc_dapm_update *update); 49562306a36Sopenharmony_ciint snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, 49662306a36Sopenharmony_ci struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e, 49762306a36Sopenharmony_ci struct snd_soc_dapm_update *update); 49862306a36Sopenharmony_ci 49962306a36Sopenharmony_ci/* dapm sys fs - used by the core */ 50062306a36Sopenharmony_ciextern struct attribute *soc_dapm_dev_attrs[]; 50162306a36Sopenharmony_civoid snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, struct dentry *parent); 50262306a36Sopenharmony_ci 50362306a36Sopenharmony_ci/* dapm audio pin control and status */ 50462306a36Sopenharmony_ciint snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 50562306a36Sopenharmony_ciint snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 50662306a36Sopenharmony_ciint snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 50762306a36Sopenharmony_ciint snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 50862306a36Sopenharmony_ciint snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); 50962306a36Sopenharmony_ciint snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 51062306a36Sopenharmony_ciint snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, const char *pin); 51162306a36Sopenharmony_ciint snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); 51262306a36Sopenharmony_ciint snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm); 51362306a36Sopenharmony_ciint snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 51462306a36Sopenharmony_ciint snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 51562306a36Sopenharmony_ciint snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, const char *pin); 51662306a36Sopenharmony_ciunsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); 51762306a36Sopenharmony_ci 51862306a36Sopenharmony_ci/* Mostly internal - should not normally be used */ 51962306a36Sopenharmony_civoid dapm_mark_endpoints_dirty(struct snd_soc_card *card); 52062306a36Sopenharmony_ci 52162306a36Sopenharmony_ci/* dapm path query */ 52262306a36Sopenharmony_ciint snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 52362306a36Sopenharmony_ci struct snd_soc_dapm_widget_list **list, 52462306a36Sopenharmony_ci bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, enum snd_soc_dapm_direction)); 52562306a36Sopenharmony_civoid snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list); 52662306a36Sopenharmony_ci 52762306a36Sopenharmony_cistruct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(struct snd_kcontrol *kcontrol); 52862306a36Sopenharmony_cistruct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(struct snd_kcontrol *kcontrol); 52962306a36Sopenharmony_ci 53062306a36Sopenharmony_ciint snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 53162306a36Sopenharmony_ci 53262306a36Sopenharmony_ci/* dapm widget types */ 53362306a36Sopenharmony_cienum snd_soc_dapm_type { 53462306a36Sopenharmony_ci snd_soc_dapm_input = 0, /* input pin */ 53562306a36Sopenharmony_ci snd_soc_dapm_output, /* output pin */ 53662306a36Sopenharmony_ci snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 53762306a36Sopenharmony_ci snd_soc_dapm_demux, /* connects the input to one of multiple outputs */ 53862306a36Sopenharmony_ci snd_soc_dapm_mixer, /* mixes several analog signals together */ 53962306a36Sopenharmony_ci snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 54062306a36Sopenharmony_ci snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 54162306a36Sopenharmony_ci snd_soc_dapm_out_drv, /* output driver */ 54262306a36Sopenharmony_ci snd_soc_dapm_adc, /* analog to digital converter */ 54362306a36Sopenharmony_ci snd_soc_dapm_dac, /* digital to analog converter */ 54462306a36Sopenharmony_ci snd_soc_dapm_micbias, /* microphone bias (power) - DEPRECATED: use snd_soc_dapm_supply */ 54562306a36Sopenharmony_ci snd_soc_dapm_mic, /* microphone */ 54662306a36Sopenharmony_ci snd_soc_dapm_hp, /* headphones */ 54762306a36Sopenharmony_ci snd_soc_dapm_spk, /* speaker */ 54862306a36Sopenharmony_ci snd_soc_dapm_line, /* line input/output */ 54962306a36Sopenharmony_ci snd_soc_dapm_switch, /* analog switch */ 55062306a36Sopenharmony_ci snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ 55162306a36Sopenharmony_ci snd_soc_dapm_pre, /* machine specific pre widget - exec first */ 55262306a36Sopenharmony_ci snd_soc_dapm_post, /* machine specific post widget - exec last */ 55362306a36Sopenharmony_ci snd_soc_dapm_supply, /* power/clock supply */ 55462306a36Sopenharmony_ci snd_soc_dapm_pinctrl, /* pinctrl */ 55562306a36Sopenharmony_ci snd_soc_dapm_regulator_supply, /* external regulator */ 55662306a36Sopenharmony_ci snd_soc_dapm_clock_supply, /* external clock */ 55762306a36Sopenharmony_ci snd_soc_dapm_aif_in, /* audio interface input */ 55862306a36Sopenharmony_ci snd_soc_dapm_aif_out, /* audio interface output */ 55962306a36Sopenharmony_ci snd_soc_dapm_siggen, /* signal generator */ 56062306a36Sopenharmony_ci snd_soc_dapm_sink, 56162306a36Sopenharmony_ci snd_soc_dapm_dai_in, /* link to DAI structure */ 56262306a36Sopenharmony_ci snd_soc_dapm_dai_out, 56362306a36Sopenharmony_ci snd_soc_dapm_dai_link, /* link between two DAI structures */ 56462306a36Sopenharmony_ci snd_soc_dapm_kcontrol, /* Auto-disabled kcontrol */ 56562306a36Sopenharmony_ci snd_soc_dapm_buffer, /* DSP/CODEC internal buffer */ 56662306a36Sopenharmony_ci snd_soc_dapm_scheduler, /* DSP/CODEC internal scheduler */ 56762306a36Sopenharmony_ci snd_soc_dapm_effect, /* DSP/CODEC effect component */ 56862306a36Sopenharmony_ci snd_soc_dapm_src, /* DSP/CODEC SRC component */ 56962306a36Sopenharmony_ci snd_soc_dapm_asrc, /* DSP/CODEC ASRC component */ 57062306a36Sopenharmony_ci snd_soc_dapm_encoder, /* FW/SW audio encoder component */ 57162306a36Sopenharmony_ci snd_soc_dapm_decoder, /* FW/SW audio decoder component */ 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci /* Don't edit below this line */ 57462306a36Sopenharmony_ci SND_SOC_DAPM_TYPE_COUNT 57562306a36Sopenharmony_ci}; 57662306a36Sopenharmony_ci 57762306a36Sopenharmony_ci/* 57862306a36Sopenharmony_ci * DAPM audio route definition. 57962306a36Sopenharmony_ci * 58062306a36Sopenharmony_ci * Defines an audio route originating at source via control and finishing 58162306a36Sopenharmony_ci * at sink. 58262306a36Sopenharmony_ci */ 58362306a36Sopenharmony_cistruct snd_soc_dapm_route { 58462306a36Sopenharmony_ci const char *sink; 58562306a36Sopenharmony_ci const char *control; 58662306a36Sopenharmony_ci const char *source; 58762306a36Sopenharmony_ci 58862306a36Sopenharmony_ci /* Note: currently only supported for links where source is a supply */ 58962306a36Sopenharmony_ci int (*connected)(struct snd_soc_dapm_widget *source, 59062306a36Sopenharmony_ci struct snd_soc_dapm_widget *sink); 59162306a36Sopenharmony_ci 59262306a36Sopenharmony_ci struct snd_soc_dobj dobj; 59362306a36Sopenharmony_ci}; 59462306a36Sopenharmony_ci 59562306a36Sopenharmony_ci/* dapm audio path between two widgets */ 59662306a36Sopenharmony_cistruct snd_soc_dapm_path { 59762306a36Sopenharmony_ci const char *name; 59862306a36Sopenharmony_ci 59962306a36Sopenharmony_ci /* 60062306a36Sopenharmony_ci * source (input) and sink (output) widgets 60162306a36Sopenharmony_ci * The union is for convience, since it is a lot nicer to type 60262306a36Sopenharmony_ci * p->source, rather than p->node[SND_SOC_DAPM_DIR_IN] 60362306a36Sopenharmony_ci */ 60462306a36Sopenharmony_ci union { 60562306a36Sopenharmony_ci struct { 60662306a36Sopenharmony_ci struct snd_soc_dapm_widget *source; 60762306a36Sopenharmony_ci struct snd_soc_dapm_widget *sink; 60862306a36Sopenharmony_ci }; 60962306a36Sopenharmony_ci struct snd_soc_dapm_widget *node[2]; 61062306a36Sopenharmony_ci }; 61162306a36Sopenharmony_ci 61262306a36Sopenharmony_ci /* status */ 61362306a36Sopenharmony_ci u32 connect:1; /* source and sink widgets are connected */ 61462306a36Sopenharmony_ci u32 walking:1; /* path is in the process of being walked */ 61562306a36Sopenharmony_ci u32 weak:1; /* path ignored for power management */ 61662306a36Sopenharmony_ci u32 is_supply:1; /* At least one of the connected widgets is a supply */ 61762306a36Sopenharmony_ci 61862306a36Sopenharmony_ci int (*connected)(struct snd_soc_dapm_widget *source, 61962306a36Sopenharmony_ci struct snd_soc_dapm_widget *sink); 62062306a36Sopenharmony_ci 62162306a36Sopenharmony_ci struct list_head list_node[2]; 62262306a36Sopenharmony_ci struct list_head list_kcontrol; 62362306a36Sopenharmony_ci struct list_head list; 62462306a36Sopenharmony_ci}; 62562306a36Sopenharmony_ci 62662306a36Sopenharmony_ci/* dapm widget */ 62762306a36Sopenharmony_cistruct snd_soc_dapm_widget { 62862306a36Sopenharmony_ci enum snd_soc_dapm_type id; 62962306a36Sopenharmony_ci const char *name; /* widget name */ 63062306a36Sopenharmony_ci const char *sname; /* stream name */ 63162306a36Sopenharmony_ci struct list_head list; 63262306a36Sopenharmony_ci struct snd_soc_dapm_context *dapm; 63362306a36Sopenharmony_ci 63462306a36Sopenharmony_ci void *priv; /* widget specific data */ 63562306a36Sopenharmony_ci struct regulator *regulator; /* attached regulator */ 63662306a36Sopenharmony_ci struct pinctrl *pinctrl; /* attached pinctrl */ 63762306a36Sopenharmony_ci 63862306a36Sopenharmony_ci /* dapm control */ 63962306a36Sopenharmony_ci int reg; /* negative reg = no direct dapm */ 64062306a36Sopenharmony_ci unsigned char shift; /* bits to shift */ 64162306a36Sopenharmony_ci unsigned int mask; /* non-shifted mask */ 64262306a36Sopenharmony_ci unsigned int on_val; /* on state value */ 64362306a36Sopenharmony_ci unsigned int off_val; /* off state value */ 64462306a36Sopenharmony_ci unsigned char power:1; /* block power status */ 64562306a36Sopenharmony_ci unsigned char active:1; /* active stream on DAC, ADC's */ 64662306a36Sopenharmony_ci unsigned char connected:1; /* connected codec pin */ 64762306a36Sopenharmony_ci unsigned char new:1; /* cnew complete */ 64862306a36Sopenharmony_ci unsigned char force:1; /* force state */ 64962306a36Sopenharmony_ci unsigned char ignore_suspend:1; /* kept enabled over suspend */ 65062306a36Sopenharmony_ci unsigned char new_power:1; /* power from this run */ 65162306a36Sopenharmony_ci unsigned char power_checked:1; /* power checked this run */ 65262306a36Sopenharmony_ci unsigned char is_supply:1; /* Widget is a supply type widget */ 65362306a36Sopenharmony_ci unsigned char is_ep:2; /* Widget is a endpoint type widget */ 65462306a36Sopenharmony_ci unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */ 65562306a36Sopenharmony_ci int subseq; /* sort within widget type */ 65662306a36Sopenharmony_ci 65762306a36Sopenharmony_ci int (*power_check)(struct snd_soc_dapm_widget *w); 65862306a36Sopenharmony_ci 65962306a36Sopenharmony_ci /* external events */ 66062306a36Sopenharmony_ci unsigned short event_flags; /* flags to specify event types */ 66162306a36Sopenharmony_ci int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); 66262306a36Sopenharmony_ci 66362306a36Sopenharmony_ci /* kcontrols that relate to this widget */ 66462306a36Sopenharmony_ci int num_kcontrols; 66562306a36Sopenharmony_ci const struct snd_kcontrol_new *kcontrol_news; 66662306a36Sopenharmony_ci struct snd_kcontrol **kcontrols; 66762306a36Sopenharmony_ci struct snd_soc_dobj dobj; 66862306a36Sopenharmony_ci 66962306a36Sopenharmony_ci /* widget input and output edges */ 67062306a36Sopenharmony_ci struct list_head edges[2]; 67162306a36Sopenharmony_ci 67262306a36Sopenharmony_ci /* used during DAPM updates */ 67362306a36Sopenharmony_ci struct list_head work_list; 67462306a36Sopenharmony_ci struct list_head power_list; 67562306a36Sopenharmony_ci struct list_head dirty; 67662306a36Sopenharmony_ci int endpoints[2]; 67762306a36Sopenharmony_ci 67862306a36Sopenharmony_ci struct clk *clk; 67962306a36Sopenharmony_ci 68062306a36Sopenharmony_ci int channel; 68162306a36Sopenharmony_ci}; 68262306a36Sopenharmony_ci 68362306a36Sopenharmony_cistruct snd_soc_dapm_update { 68462306a36Sopenharmony_ci struct snd_kcontrol *kcontrol; 68562306a36Sopenharmony_ci int reg; 68662306a36Sopenharmony_ci int mask; 68762306a36Sopenharmony_ci int val; 68862306a36Sopenharmony_ci int reg2; 68962306a36Sopenharmony_ci int mask2; 69062306a36Sopenharmony_ci int val2; 69162306a36Sopenharmony_ci bool has_second_set; 69262306a36Sopenharmony_ci}; 69362306a36Sopenharmony_ci 69462306a36Sopenharmony_ci/* DAPM context */ 69562306a36Sopenharmony_cistruct snd_soc_dapm_context { 69662306a36Sopenharmony_ci enum snd_soc_bias_level bias_level; 69762306a36Sopenharmony_ci 69862306a36Sopenharmony_ci /* bit field */ 69962306a36Sopenharmony_ci unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 70062306a36Sopenharmony_ci unsigned int suspend_bias_off:1; /* Use BIAS_OFF in suspend if the DAPM is idle */ 70162306a36Sopenharmony_ci 70262306a36Sopenharmony_ci struct device *dev; /* from parent - for debug */ 70362306a36Sopenharmony_ci struct snd_soc_component *component; /* parent component */ 70462306a36Sopenharmony_ci struct snd_soc_card *card; /* parent card */ 70562306a36Sopenharmony_ci 70662306a36Sopenharmony_ci /* used during DAPM updates */ 70762306a36Sopenharmony_ci enum snd_soc_bias_level target_bias_level; 70862306a36Sopenharmony_ci struct list_head list; 70962306a36Sopenharmony_ci 71062306a36Sopenharmony_ci struct snd_soc_dapm_widget *wcache_sink; 71162306a36Sopenharmony_ci struct snd_soc_dapm_widget *wcache_source; 71262306a36Sopenharmony_ci 71362306a36Sopenharmony_ci#ifdef CONFIG_DEBUG_FS 71462306a36Sopenharmony_ci struct dentry *debugfs_dapm; 71562306a36Sopenharmony_ci#endif 71662306a36Sopenharmony_ci}; 71762306a36Sopenharmony_ci 71862306a36Sopenharmony_ci/* A list of widgets associated with an object, typically a snd_kcontrol */ 71962306a36Sopenharmony_cistruct snd_soc_dapm_widget_list { 72062306a36Sopenharmony_ci int num_widgets; 72162306a36Sopenharmony_ci struct snd_soc_dapm_widget *widgets[]; 72262306a36Sopenharmony_ci}; 72362306a36Sopenharmony_ci 72462306a36Sopenharmony_ci#define for_each_dapm_widgets(list, i, widget) \ 72562306a36Sopenharmony_ci for ((i) = 0; \ 72662306a36Sopenharmony_ci (i) < list->num_widgets && (widget = list->widgets[i]); \ 72762306a36Sopenharmony_ci (i)++) 72862306a36Sopenharmony_ci 72962306a36Sopenharmony_cistruct snd_soc_dapm_stats { 73062306a36Sopenharmony_ci int power_checks; 73162306a36Sopenharmony_ci int path_checks; 73262306a36Sopenharmony_ci int neighbour_checks; 73362306a36Sopenharmony_ci}; 73462306a36Sopenharmony_ci 73562306a36Sopenharmony_cistruct snd_soc_dapm_pinctrl_priv { 73662306a36Sopenharmony_ci const char *active_state; 73762306a36Sopenharmony_ci const char *sleep_state; 73862306a36Sopenharmony_ci}; 73962306a36Sopenharmony_ci 74062306a36Sopenharmony_ci/** 74162306a36Sopenharmony_ci * snd_soc_dapm_init_bias_level() - Initialize DAPM bias level 74262306a36Sopenharmony_ci * @dapm: The DAPM context to initialize 74362306a36Sopenharmony_ci * @level: The DAPM level to initialize to 74462306a36Sopenharmony_ci * 74562306a36Sopenharmony_ci * This function only sets the driver internal state of the DAPM level and will 74662306a36Sopenharmony_ci * not modify the state of the device. Hence it should not be used during normal 74762306a36Sopenharmony_ci * operation, but only to synchronize the internal state to the device state. 74862306a36Sopenharmony_ci * E.g. during driver probe to set the DAPM level to the one corresponding with 74962306a36Sopenharmony_ci * the power-on reset state of the device. 75062306a36Sopenharmony_ci * 75162306a36Sopenharmony_ci * To change the DAPM state of the device use snd_soc_dapm_set_bias_level(). 75262306a36Sopenharmony_ci */ 75362306a36Sopenharmony_cistatic inline void snd_soc_dapm_init_bias_level( 75462306a36Sopenharmony_ci struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) 75562306a36Sopenharmony_ci{ 75662306a36Sopenharmony_ci dapm->bias_level = level; 75762306a36Sopenharmony_ci} 75862306a36Sopenharmony_ci 75962306a36Sopenharmony_ci/** 76062306a36Sopenharmony_ci * snd_soc_dapm_get_bias_level() - Get current DAPM bias level 76162306a36Sopenharmony_ci * @dapm: The context for which to get the bias level 76262306a36Sopenharmony_ci * 76362306a36Sopenharmony_ci * Returns: The current bias level of the passed DAPM context. 76462306a36Sopenharmony_ci */ 76562306a36Sopenharmony_cistatic inline enum snd_soc_bias_level snd_soc_dapm_get_bias_level( 76662306a36Sopenharmony_ci struct snd_soc_dapm_context *dapm) 76762306a36Sopenharmony_ci{ 76862306a36Sopenharmony_ci return dapm->bias_level; 76962306a36Sopenharmony_ci} 77062306a36Sopenharmony_ci 77162306a36Sopenharmony_cienum snd_soc_dapm_direction { 77262306a36Sopenharmony_ci SND_SOC_DAPM_DIR_IN, 77362306a36Sopenharmony_ci SND_SOC_DAPM_DIR_OUT 77462306a36Sopenharmony_ci}; 77562306a36Sopenharmony_ci 77662306a36Sopenharmony_ci#define SND_SOC_DAPM_DIR_TO_EP(x) BIT(x) 77762306a36Sopenharmony_ci 77862306a36Sopenharmony_ci#define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN) 77962306a36Sopenharmony_ci#define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT) 78062306a36Sopenharmony_ci 78162306a36Sopenharmony_ci/** 78262306a36Sopenharmony_ci * snd_soc_dapm_widget_for_each_path - Iterates over all paths in the 78362306a36Sopenharmony_ci * specified direction of a widget 78462306a36Sopenharmony_ci * @w: The widget 78562306a36Sopenharmony_ci * @dir: Whether to iterate over the paths where the specified widget is the 78662306a36Sopenharmony_ci * incoming or outgoing widgets 78762306a36Sopenharmony_ci * @p: The path iterator variable 78862306a36Sopenharmony_ci */ 78962306a36Sopenharmony_ci#define snd_soc_dapm_widget_for_each_path(w, dir, p) \ 79062306a36Sopenharmony_ci list_for_each_entry(p, &w->edges[dir], list_node[dir]) 79162306a36Sopenharmony_ci 79262306a36Sopenharmony_ci/** 79362306a36Sopenharmony_ci * snd_soc_dapm_widget_for_each_path_safe - Iterates over all paths in the 79462306a36Sopenharmony_ci * specified direction of a widget 79562306a36Sopenharmony_ci * @w: The widget 79662306a36Sopenharmony_ci * @dir: Whether to iterate over the paths where the specified widget is the 79762306a36Sopenharmony_ci * incoming or outgoing widgets 79862306a36Sopenharmony_ci * @p: The path iterator variable 79962306a36Sopenharmony_ci * @next_p: Temporary storage for the next path 80062306a36Sopenharmony_ci * 80162306a36Sopenharmony_ci * This function works like snd_soc_dapm_widget_for_each_path, expect that 80262306a36Sopenharmony_ci * it is safe to remove the current path from the list while iterating 80362306a36Sopenharmony_ci */ 80462306a36Sopenharmony_ci#define snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p) \ 80562306a36Sopenharmony_ci list_for_each_entry_safe(p, next_p, &w->edges[dir], list_node[dir]) 80662306a36Sopenharmony_ci 80762306a36Sopenharmony_ci/** 80862306a36Sopenharmony_ci * snd_soc_dapm_widget_for_each_sink_path - Iterates over all paths leaving a 80962306a36Sopenharmony_ci * widget 81062306a36Sopenharmony_ci * @w: The widget 81162306a36Sopenharmony_ci * @p: The path iterator variable 81262306a36Sopenharmony_ci */ 81362306a36Sopenharmony_ci#define snd_soc_dapm_widget_for_each_sink_path(w, p) \ 81462306a36Sopenharmony_ci snd_soc_dapm_widget_for_each_path(w, SND_SOC_DAPM_DIR_IN, p) 81562306a36Sopenharmony_ci 81662306a36Sopenharmony_ci/** 81762306a36Sopenharmony_ci * snd_soc_dapm_widget_for_each_source_path - Iterates over all paths leading to 81862306a36Sopenharmony_ci * a widget 81962306a36Sopenharmony_ci * @w: The widget 82062306a36Sopenharmony_ci * @p: The path iterator variable 82162306a36Sopenharmony_ci */ 82262306a36Sopenharmony_ci#define snd_soc_dapm_widget_for_each_source_path(w, p) \ 82362306a36Sopenharmony_ci snd_soc_dapm_widget_for_each_path(w, SND_SOC_DAPM_DIR_OUT, p) 82462306a36Sopenharmony_ci 82562306a36Sopenharmony_ci#endif 826