Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/include/sound/soc-dapm.h

    r679 r772  
    1717
    1818struct device;
     19struct snd_pcm_substream;
    1920struct snd_soc_pcm_runtime;
    2021struct soc_enum;
     
    4243/* codec domain */
    4344#define SND_SOC_DAPM_VMID(wname) \
    44 {       .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \
     45(struct snd_soc_dapm_widget) { \
     46        .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \
    4547        .num_kcontrols = 0}
    4648
    4749/* platform domain */
    4850#define SND_SOC_DAPM_SIGGEN(wname) \
    49 {       .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \
     51(struct snd_soc_dapm_widget) { \
     52        .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \
    5053        .num_kcontrols = 0, .reg = SND_SOC_NOPM }
    5154#define SND_SOC_DAPM_SINK(wname) \
    52 {       .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \
     55(struct snd_soc_dapm_widget) { \
     56        .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \
    5357        .num_kcontrols = 0, .reg = SND_SOC_NOPM }
    5458#define SND_SOC_DAPM_INPUT(wname) \
    55 {       .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \
     59(struct snd_soc_dapm_widget) { \
     60        .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \
    5661        .num_kcontrols = 0, .reg = SND_SOC_NOPM }
    5762#define SND_SOC_DAPM_OUTPUT(wname) \
    58 {       .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \
     63(struct snd_soc_dapm_widget) { \
     64        .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \
    5965        .num_kcontrols = 0, .reg = SND_SOC_NOPM }
    6066#define SND_SOC_DAPM_MIC(wname, wevent) \
    61 {       .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \
     67(struct snd_soc_dapm_widget) { \
     68        .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \
    6269        .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
    6370        .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
    6471#define SND_SOC_DAPM_HP(wname, wevent) \
    65 {       .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \
     72(struct snd_soc_dapm_widget) { \
     73        .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \
    6674        .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
    6775        .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
    6876#define SND_SOC_DAPM_SPK(wname, wevent) \
    69 {       .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \
     77(struct snd_soc_dapm_widget) { \
     78        .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \
    7079        .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
    7180        .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
    7281#define SND_SOC_DAPM_LINE(wname, wevent) \
    73 {       .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \
     82(struct snd_soc_dapm_widget) { \
     83        .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \
    7484        .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
    7585        .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
     
    8292#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\
    8393         wcontrols, wncontrols) \
    84 {       .id = snd_soc_dapm_pga, .name = wname, \
     94(struct snd_soc_dapm_widget) { \
     95        .id = snd_soc_dapm_pga, .name = wname, \
    8596        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    8697        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
    8798#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
    8899         wcontrols, wncontrols) \
    89 {       .id = snd_soc_dapm_out_drv, .name = wname, \
     100(struct snd_soc_dapm_widget) { \
     101        .id = snd_soc_dapm_out_drv, .name = wname, \
    90102        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    91103        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
    92104#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
    93105         wcontrols, wncontrols)\
    94 {       .id = snd_soc_dapm_mixer, .name = wname, \
     106(struct snd_soc_dapm_widget) { \
     107        .id = snd_soc_dapm_mixer, .name = wname, \
    95108        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    96109        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
    97110#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \
    98111         wcontrols, wncontrols)\
    99 {       .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
     112(struct snd_soc_dapm_widget) { \
     113        .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
    100114        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    101115        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
    102116/* DEPRECATED: use SND_SOC_DAPM_SUPPLY */
    103117#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \
    104 {       .id = snd_soc_dapm_micbias, .name = wname, \
     118(struct snd_soc_dapm_widget) { \
     119        .id = snd_soc_dapm_micbias, .name = wname, \
    105120        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    106121        .kcontrol_news = NULL, .num_kcontrols = 0}
    107122#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \
    108 {       .id = snd_soc_dapm_switch, .name = wname, \
     123(struct snd_soc_dapm_widget) { \
     124        .id = snd_soc_dapm_switch, .name = wname, \
    109125        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    110126        .kcontrol_news = wcontrols, .num_kcontrols = 1}
    111127#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
    112 {       .id = snd_soc_dapm_mux, .name = wname, \
     128(struct snd_soc_dapm_widget) { \
     129        .id = snd_soc_dapm_mux, .name = wname, \
    113130        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    114131        .kcontrol_news = wcontrols, .num_kcontrols = 1}
    115132#define SND_SOC_DAPM_DEMUX(wname, wreg, wshift, winvert, wcontrols) \
    116 {       .id = snd_soc_dapm_demux, .name = wname, \
     133(struct snd_soc_dapm_widget) { \
     134        .id = snd_soc_dapm_demux, .name = wname, \
    117135        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    118136        .kcontrol_news = wcontrols, .num_kcontrols = 1}
     
    121139#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
    122140         wcontrols) \
    123 {       .id = snd_soc_dapm_pga, .name = wname, \
     141(struct snd_soc_dapm_widget) { \
     142        .id = snd_soc_dapm_pga, .name = wname, \
    124143        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    125144        .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
    126145#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
    127146         wcontrols)\
    128 {       .id = snd_soc_dapm_mixer, .name = wname, \
     147(struct snd_soc_dapm_widget) { \
     148        .id = snd_soc_dapm_mixer, .name = wname, \
    129149        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    130150        .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
    131151#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
    132152         wcontrols)\
    133 {       .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
     153(struct snd_soc_dapm_widget) { \
     154        .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
    134155        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    135156        .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
     
    138159#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
    139160        wncontrols, wevent, wflags) \
    140 {       .id = snd_soc_dapm_pga, .name = wname, \
     161(struct snd_soc_dapm_widget) { \
     162        .id = snd_soc_dapm_pga, .name = wname, \
    141163        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    142164        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
     
    144166#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
    145167        wncontrols, wevent, wflags) \
    146 {       .id = snd_soc_dapm_out_drv, .name = wname, \
     168(struct snd_soc_dapm_widget) { \
     169        .id = snd_soc_dapm_out_drv, .name = wname, \
    147170        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    148171        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
     
    150173#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
    151174        wncontrols, wevent, wflags) \
    152 {       .id = snd_soc_dapm_mixer, .name = wname, \
     175(struct snd_soc_dapm_widget) { \
     176        .id = snd_soc_dapm_mixer, .name = wname, \
    153177        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    154178        .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
     
    156180#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \
    157181        wcontrols, wncontrols, wevent, wflags) \
    158 {       .id = snd_soc_dapm_mixer, .name = wname, \
     182(struct snd_soc_dapm_widget) { \
     183        .id = snd_soc_dapm_mixer, .name = wname, \
    159184        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    160185        .kcontrol_news = wcontrols, \
     
    162187#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
    163188        wevent, wflags) \
    164 {       .id = snd_soc_dapm_switch, .name = wname, \
     189(struct snd_soc_dapm_widget) { \
     190        .id = snd_soc_dapm_switch, .name = wname, \
    165191        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    166192        .kcontrol_news = wcontrols, .num_kcontrols = 1, \
     
    168194#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
    169195        wevent, wflags) \
    170 {       .id = snd_soc_dapm_mux, .name = wname, \
     196(struct snd_soc_dapm_widget) { \
     197        .id = snd_soc_dapm_mux, .name = wname, \
    171198        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    172199        .kcontrol_news = wcontrols, .num_kcontrols = 1, \
     
    176203#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
    177204        wevent, wflags) \
    178 {       .id = snd_soc_dapm_pga, .name = wname, \
     205(struct snd_soc_dapm_widget) { \
     206        .id = snd_soc_dapm_pga, .name = wname, \
    179207        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    180208        .event = wevent, .event_flags = wflags, \
     
    182210#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
    183211        wflags) \
    184 {       .id = snd_soc_dapm_supply, .name = wname, \
     212(struct snd_soc_dapm_widget) { \
     213        .id = snd_soc_dapm_supply, .name = wname, \
    185214        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    186215        .event = wevent, .event_flags = wflags, .subseq = wsubseq}
     
    189218#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
    190219        wevent, wflags) \
    191 {       .id = snd_soc_dapm_pga, .name = wname, \
     220(struct snd_soc_dapm_widget) { \
     221        .id = snd_soc_dapm_pga, .name = wname, \
    192222        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    193223        .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
     
    195225#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
    196226        wevent, wflags) \
    197 {       .id = snd_soc_dapm_mixer, .name = wname, \
     227(struct snd_soc_dapm_widget) { \
     228        .id = snd_soc_dapm_mixer, .name = wname, \
    198229        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    199230        .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
     
    201232#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
    202233        wcontrols, wevent, wflags) \
    203 {       .id = snd_soc_dapm_mixer, .name = wname, \
     234(struct snd_soc_dapm_widget) { \
     235        .id = snd_soc_dapm_mixer, .name = wname, \
    204236        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    205237        .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
     
    208240/* events that are pre and post DAPM */
    209241#define SND_SOC_DAPM_PRE(wname, wevent) \
    210 {       .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \
     242(struct snd_soc_dapm_widget) { \
     243        .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \
    211244        .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
    212245        .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}
    213246#define SND_SOC_DAPM_POST(wname, wevent) \
    214 {       .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \
     247(struct snd_soc_dapm_widget) { \
     248        .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \
    215249        .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
    216250        .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
     
    218252/* stream domain */
    219253#define SND_SOC_DAPM_AIF_IN(wname, stname, wchan, wreg, wshift, winvert) \
    220 {       .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
     254(struct snd_soc_dapm_widget) { \
     255        .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
    221256        .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
    222257#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wchan, wreg, wshift, winvert, \
    223258                              wevent, wflags)                           \
    224 {       .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
     259(struct snd_soc_dapm_widget) { \
     260        .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
    225261        .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    226262        .event = wevent, .event_flags = wflags }
    227263#define SND_SOC_DAPM_AIF_OUT(wname, stname, wchan, wreg, wshift, winvert) \
    228 {       .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
     264(struct snd_soc_dapm_widget) { \
     265        .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
    229266        .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
    230267#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wchan, wreg, wshift, winvert, \
    231268                             wevent, wflags)                            \
    232 {       .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
     269(struct snd_soc_dapm_widget) { \
     270        .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
    233271        .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    234272        .event = wevent, .event_flags = wflags }
    235273#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
    236 {       .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
     274(struct snd_soc_dapm_widget) { \
     275        .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
    237276        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) }
    238277#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
    239278                           wevent, wflags)                              \
    240 {       .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
     279(struct snd_soc_dapm_widget) { \
     280        .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
    241281        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    242282        .event = wevent, .event_flags = wflags}
    243283
    244284#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
    245 {       .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
     285(struct snd_soc_dapm_widget) { \
     286        .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
    246287        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
    247288#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
    248289                           wevent, wflags)                              \
    249 {       .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
     290(struct snd_soc_dapm_widget) { \
     291        .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
    250292        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    251293        .event = wevent, .event_flags = wflags}
    252294#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \
    253 {       .id = snd_soc_dapm_clock_supply, .name = wname, \
     295(struct snd_soc_dapm_widget) { \
     296        .id = snd_soc_dapm_clock_supply, .name = wname, \
    254297        .reg = SND_SOC_NOPM, .event = dapm_clock_event, \
    255298        .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD }
     
    257300/* generic widgets */
    258301#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
    259 {       .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \
     302(struct snd_soc_dapm_widget) { \
     303        .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \
    260304        .reg = wreg, .shift = wshift, .mask = wmask, \
    261305        .on_val = won_val, .off_val = woff_val, }
    262306#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
    263 {       .id = snd_soc_dapm_supply, .name = wname, \
     307(struct snd_soc_dapm_widget) { \
     308        .id = snd_soc_dapm_supply, .name = wname, \
    264309        SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
    265310        .event = wevent, .event_flags = wflags}
    266311#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags)        \
    267 {       .id = snd_soc_dapm_regulator_supply, .name = wname, \
     312(struct snd_soc_dapm_widget) { \
     313        .id = snd_soc_dapm_regulator_supply, .name = wname, \
    268314        .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
    269315        .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \
    270316        .on_val = wflags}
    271317#define SND_SOC_DAPM_PINCTRL(wname, active, sleep) \
    272 {       .id = snd_soc_dapm_pinctrl, .name = wname, \
     318(struct snd_soc_dapm_widget) { \
     319        .id = snd_soc_dapm_pinctrl, .name = wname, \
    273320        .priv = (&(struct snd_soc_dapm_pinctrl_priv) \
    274321                { .active_state = active, .sleep_state = sleep,}), \
     
    342389#define SND_SOC_DAPM_STREAM_SUSPEND             0x4
    343390#define SND_SOC_DAPM_STREAM_RESUME              0x8
    344 #define SND_SOC_DAPM_STREAM_PAUSE_PUSH  0x10
     391#define SND_SOC_DAPM_STREAM_PAUSE_PUSH          0x10
    345392#define SND_SOC_DAPM_STREAM_PAUSE_RELEASE       0x20
    346393
    347394/* dapm event types */
    348 #define SND_SOC_DAPM_PRE_PMU    0x1     /* before widget power up */
    349 #define SND_SOC_DAPM_POST_PMU   0x2             /* after widget power up */
    350 #define SND_SOC_DAPM_PRE_PMD    0x4     /* before widget power down */
    351 #define SND_SOC_DAPM_POST_PMD   0x8             /* after widget power down */
    352 #define SND_SOC_DAPM_PRE_REG    0x10    /* before audio path setup */
    353 #define SND_SOC_DAPM_POST_REG   0x20    /* after audio path setup */
    354 #define SND_SOC_DAPM_WILL_PMU   0x40    /* called at start of sequence */
    355 #define SND_SOC_DAPM_WILL_PMD   0x80    /* called at start of sequence */
    356 #define SND_SOC_DAPM_PRE_POST_PMD \
    357                                 (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)
    358 #define SND_SOC_DAPM_PRE_POST_PMU \
    359                                 (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)
     395#define SND_SOC_DAPM_PRE_PMU            0x1     /* before widget power up */
     396#define SND_SOC_DAPM_POST_PMU           0x2     /* after  widget power up */
     397#define SND_SOC_DAPM_PRE_PMD            0x4     /* before widget power down */
     398#define SND_SOC_DAPM_POST_PMD           0x8     /* after  widget power down */
     399#define SND_SOC_DAPM_PRE_REG            0x10    /* before audio path setup */
     400#define SND_SOC_DAPM_POST_REG           0x20    /* after  audio path setup */
     401#define SND_SOC_DAPM_WILL_PMU           0x40    /* called at start of sequence */
     402#define SND_SOC_DAPM_WILL_PMD           0x80    /* called at start of sequence */
     403#define SND_SOC_DAPM_PRE_POST_PMD       (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)
     404#define SND_SOC_DAPM_PRE_POST_PMU       (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)
    360405
    361406/* convenience event type detection */
    362 #define SND_SOC_DAPM_EVENT_ON(e)        \
    363         (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU))
    364 #define SND_SOC_DAPM_EVENT_OFF(e)       \
    365         (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD))
     407#define SND_SOC_DAPM_EVENT_ON(e)        (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU))
     408#define SND_SOC_DAPM_EVENT_OFF(e)       (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD))
    366409
    367410/* regulator widget flags */
    368 #define SND_SOC_DAPM_REGULATOR_BYPASS     0x1     /* bypass when disabled */
     411#define SND_SOC_DAPM_REGULATOR_BYPASS   0x1     /* bypass when disabled */
    369412
    370413struct snd_soc_dapm_widget;
     
    397440};
    398441
    399 int dapm_regulator_event(struct snd_soc_dapm_widget *w,
    400                          struct snd_kcontrol *kcontrol, int event);
    401 int dapm_clock_event(struct snd_soc_dapm_widget *w,
    402                          struct snd_kcontrol *kcontrol, int event);
    403 int dapm_pinctrl_event(struct snd_soc_dapm_widget *w,
    404                          struct snd_kcontrol *kcontrol, int event);
     442int dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event);
     443int dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event);
     444int dapm_pinctrl_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event);
    405445
    406446/* dapm controls */
    407 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
    408         struct snd_ctl_elem_value *ucontrol);
    409 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
    410         struct snd_ctl_elem_value *ucontrol);
     447int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
     448int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
    411449int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
    412450        struct snd_ctl_elem_value *ucontrol);
     
    420458        struct snd_ctl_elem_value *uncontrol);
    421459int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
    422         const struct snd_soc_dapm_widget *widget,
    423         int num);
    424 struct snd_soc_dapm_widget *snd_soc_dapm_new_control(
    425                 struct snd_soc_dapm_context *dapm,
     460        const struct snd_soc_dapm_widget *widget, int num);
     461struct snd_soc_dapm_widget *snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
    426462                const struct snd_soc_dapm_widget *widget);
    427 struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked(
    428                 struct snd_soc_dapm_context *dapm,
     463struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
    429464                const struct snd_soc_dapm_widget *widget);
    430 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
    431                                  struct snd_soc_dai *dai);
     465int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, struct snd_soc_dai *dai);
     466void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w);
    432467int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
    433468void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
    434469
    435470int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream,
    436                             struct snd_pcm_hw_params *params,
    437                             struct snd_soc_dai *dai);
     471                            struct snd_pcm_hw_params *params, struct snd_soc_dai *dai);
     472int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s);
    438473
    439474/* dapm path setup */
     
    441476void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
    442477void snd_soc_dapm_init(struct snd_soc_dapm_context *dapm,
    443                        struct snd_soc_card *card,
    444                        struct snd_soc_component *component);
     478                       struct snd_soc_card *card, struct snd_soc_component *component);
    445479int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
    446480                            const struct snd_soc_dapm_route *route, int num);
     
    450484                             const struct snd_soc_dapm_route *route, int num);
    451485void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w);
    452 void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm);
    453486
    454487/* dapm events */
    455 void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
    456         int event);
     488void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event);
    457489void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream);
    458490void snd_soc_dapm_shutdown(struct snd_soc_card *card);
     
    460492/* external DAPM widget events */
    461493int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm,
    462                 struct snd_kcontrol *kcontrol, int connect,
    463                 struct snd_soc_dapm_update *update);
     494                struct snd_kcontrol *kcontrol, int connect, struct snd_soc_dapm_update *update);
    464495int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm,
    465496                struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e,
     
    468499/* dapm sys fs - used by the core */
    469500extern struct attribute *soc_dapm_dev_attrs[];
    470 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
    471                                 struct dentry *parent);
     501void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, struct dentry *parent);
    472502
    473503/* dapm audio pin control and status */
    474 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm,
    475                             const char *pin);
    476 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
    477                                      const char *pin);
    478 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,
    479                              const char *pin);
    480 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm,
    481                                       const char *pin);
     504int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin);
     505int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin);
     506int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, const char *pin);
     507int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin);
    482508int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin);
    483 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm,
    484                                  const char *pin);
    485 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
    486                                 const char *pin);
     509int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin);
     510int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, const char *pin);
    487511int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm);
    488512int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm);
    489 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
    490                                   const char *pin);
    491 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
    492                                            const char *pin);
    493 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
    494                                 const char *pin);
     513int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin);
     514int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin);
     515int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, const char *pin);
    495516unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol);
    496517
     
    501522int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
    502523        struct snd_soc_dapm_widget_list **list,
    503         bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
    504                                       enum snd_soc_dapm_direction));
     524        bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, enum snd_soc_dapm_direction));
    505525void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list);
    506526
    507 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
    508         struct snd_kcontrol *kcontrol);
    509 
    510 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(
    511                 struct snd_kcontrol *kcontrol);
    512 
    513 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm,
    514         enum snd_soc_bias_level level);
     527struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(struct snd_kcontrol *kcontrol);
     528struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(struct snd_kcontrol *kcontrol);
     529
     530int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level);
    515531
    516532/* dapm widget types */
     
    518534        snd_soc_dapm_input = 0,         /* input pin */
    519535        snd_soc_dapm_output,            /* output pin */
    520         snd_soc_dapm_mux,                       /* selects 1 analog signal from many inputs */
    521         snd_soc_dapm_demux,                     /* connects the input to one of multiple outputs */
    522         snd_soc_dapm_mixer,                     /* mixes several analog signals together */
    523         snd_soc_dapm_mixer_named_ctl,           /* mixer with named controls */
    524         snd_soc_dapm_pga,                       /* programmable gain/attenuation (volume) */
    525         snd_soc_dapm_out_drv,                   /* output driver */
    526         snd_soc_dapm_adc,                       /* analog to digital converter */
    527         snd_soc_dapm_dac,                       /* digital to analog converter */
     536        snd_soc_dapm_mux,               /* selects 1 analog signal from many inputs */
     537        snd_soc_dapm_demux,             /* connects the input to one of multiple outputs */
     538        snd_soc_dapm_mixer,             /* mixes several analog signals together */
     539        snd_soc_dapm_mixer_named_ctl,   /* mixer with named controls */
     540        snd_soc_dapm_pga,               /* programmable gain/attenuation (volume) */
     541        snd_soc_dapm_out_drv,           /* output driver */
     542        snd_soc_dapm_adc,               /* analog to digital converter */
     543        snd_soc_dapm_dac,               /* digital to analog converter */
    528544        snd_soc_dapm_micbias,           /* microphone bias (power) - DEPRECATED: use snd_soc_dapm_supply */
    529         snd_soc_dapm_mic,                       /* microphone */
    530         snd_soc_dapm_hp,                        /* headphones */
    531         snd_soc_dapm_spk,                       /* speaker */
    532         snd_soc_dapm_line,                      /* line input/output */
     545        snd_soc_dapm_mic,               /* microphone */
     546        snd_soc_dapm_hp,                /* headphones */
     547        snd_soc_dapm_spk,               /* speaker */
     548        snd_soc_dapm_line,              /* line input/output */
    533549        snd_soc_dapm_switch,            /* analog switch */
    534         snd_soc_dapm_vmid,                      /* codec bias/vmid - to minimise pops */
    535         snd_soc_dapm_pre,                       /* machine specific pre widget - exec first */
    536         snd_soc_dapm_post,                      /* machine specific post widget - exec last */
     550        snd_soc_dapm_vmid,              /* codec bias/vmid - to minimise pops */
     551        snd_soc_dapm_pre,               /* machine specific pre widget - exec first */
     552        snd_soc_dapm_post,              /* machine specific post widget - exec last */
    537553        snd_soc_dapm_supply,            /* power/clock supply */
    538554        snd_soc_dapm_pinctrl,           /* pinctrl */
     
    559575};
    560576
    561 enum snd_soc_dapm_subclass {
    562         SND_SOC_DAPM_CLASS_INIT         = 0,
    563         SND_SOC_DAPM_CLASS_RUNTIME      = 1,
    564 };
    565 
    566577/*
    567578 * DAPM audio route definition.
     
    600611
    601612        /* status */
    602         u32 connect:1;  /* source and sink widgets are connected */
    603         u32 walking:1;  /* path is in the process of being walked */
    604         u32 weak:1;     /* path ignored for power management */
     613        u32 connect:1;          /* source and sink widgets are connected */
     614        u32 walking:1;          /* path is in the process of being walked */
     615        u32 weak:1;             /* path ignored for power management */
    605616        u32 is_supply:1;        /* At least one of the connected widgets is a supply */
    606617
     
    616627struct snd_soc_dapm_widget {
    617628        enum snd_soc_dapm_type id;
    618         const char *name;               /* widget name */
    619         const char *sname;      /* stream name */
     629        const char *name;                       /* widget name */
     630        const char *sname;                      /* stream name */
    620631        struct list_head list;
    621632        struct snd_soc_dapm_context *dapm;
     
    636647        unsigned char new:1;                    /* cnew complete */
    637648        unsigned char force:1;                  /* force state */
    638         unsigned char ignore_suspend:1;         /* kept enabled over suspend */
     649        unsigned char ignore_suspend:1;         /* kept enabled over suspend */
    639650        unsigned char new_power:1;              /* power from this run */
    640651        unsigned char power_checked:1;          /* power checked this run */
    641652        unsigned char is_supply:1;              /* Widget is a supply type widget */
    642653        unsigned char is_ep:2;                  /* Widget is a endpoint type widget */
     654        unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */
    643655        int subseq;                             /* sort within widget type */
    644656
     
    680692};
    681693
    682 struct snd_soc_dapm_wcache {
    683         struct snd_soc_dapm_widget *widget;
    684 };
    685 
    686694/* DAPM context */
    687695struct snd_soc_dapm_context {
    688696        enum snd_soc_bias_level bias_level;
    689         unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
    690         /* Go to BIAS_OFF in suspend if the DAPM context is idle */
    691         unsigned int suspend_bias_off:1;
    692 
    693         struct device *dev; /* from parent - for debug */
    694         struct snd_soc_component *component; /* parent component */
    695         struct snd_soc_card *card; /* parent card */
     697
     698        /* bit field */
     699        unsigned int idle_bias_off:1;           /* Use BIAS_OFF instead of STANDBY */
     700        unsigned int suspend_bias_off:1;        /* Use BIAS_OFF in suspend if the DAPM is idle */
     701
     702        struct device *dev;                     /* from parent - for debug */
     703        struct snd_soc_component *component;    /* parent component */
     704        struct snd_soc_card *card;              /* parent card */
    696705
    697706        /* used during DAPM updates */
     
    699708        struct list_head list;
    700709
    701         struct snd_soc_dapm_wcache path_sink_cache;
    702         struct snd_soc_dapm_wcache path_source_cache;
     710        struct snd_soc_dapm_widget *wcache_sink;
     711        struct snd_soc_dapm_widget *wcache_source;
    703712
    704713#ifdef CONFIG_DEBUG_FS
     
    767776#define SND_SOC_DAPM_DIR_TO_EP(x) BIT(x)
    768777
    769 #define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN)
    770 #define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT)
     778#define SND_SOC_DAPM_EP_SOURCE  SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN)
     779#define SND_SOC_DAPM_EP_SINK    SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT)
    771780
    772781/**
    773  * snd_soc_dapm_widget_for_each_sink_path - Iterates over all paths in the
     782 * snd_soc_dapm_widget_for_each_path - Iterates over all paths in the
    774783 *   specified direction of a widget
    775784 * @w: The widget
     
    782791
    783792/**
    784  * snd_soc_dapm_widget_for_each_sink_path_safe - Iterates over all paths in the
     793 * snd_soc_dapm_widget_for_each_path_safe - Iterates over all paths in the
    785794 *   specified direction of a widget
    786795 * @w: The widget
     
    790799 * @next_p: Temporary storage for the next path
    791800 *
    792  *  This function works like snd_soc_dapm_widget_for_each_sink_path, expect that
     801 *  This function works like snd_soc_dapm_widget_for_each_path, expect that
    793802 *  it is safe to remove the current path from the list while iterating
    794803 */
Note: See TracChangeset for help on using the changeset viewer.