16
16
#include <sound/asoc.h>
17
17
18
18
struct device ;
19
+ struct regulator ;
20
+ struct soc_enum ;
19
21
struct snd_pcm_substream ;
20
22
struct snd_soc_pcm_runtime ;
21
- struct soc_enum ;
22
23
23
24
/* widget has no PM register bit */
24
25
#define SND_SOC_NOPM -1
@@ -399,17 +400,6 @@ struct soc_enum;
399
400
/* regulator widget flags */
400
401
#define SND_SOC_DAPM_REGULATOR_BYPASS 0x1 /* bypass when disabled */
401
402
402
- struct snd_soc_dapm_widget ;
403
- enum snd_soc_dapm_type ;
404
- struct snd_soc_dapm_path ;
405
- struct snd_soc_dapm_pin ;
406
- struct snd_soc_dapm_route ;
407
- struct snd_soc_dapm_context ;
408
- struct regulator ;
409
- struct snd_soc_dapm_widget_list ;
410
- struct snd_soc_dapm_update ;
411
- enum snd_soc_dapm_direction ;
412
-
413
403
/*
414
404
* Bias levels
415
405
*
@@ -428,104 +418,6 @@ enum snd_soc_bias_level {
428
418
SND_SOC_BIAS_ON = 3 ,
429
419
};
430
420
431
- int dapm_regulator_event (struct snd_soc_dapm_widget * w , struct snd_kcontrol * kcontrol , int event );
432
- int dapm_clock_event (struct snd_soc_dapm_widget * w , struct snd_kcontrol * kcontrol , int event );
433
- int dapm_pinctrl_event (struct snd_soc_dapm_widget * w , struct snd_kcontrol * kcontrol , int event );
434
-
435
- /* dapm controls */
436
- int snd_soc_dapm_put_volsw (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * ucontrol );
437
- int snd_soc_dapm_get_volsw (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * ucontrol );
438
- int snd_soc_dapm_get_enum_double (struct snd_kcontrol * kcontrol ,
439
- struct snd_ctl_elem_value * ucontrol );
440
- int snd_soc_dapm_put_enum_double (struct snd_kcontrol * kcontrol ,
441
- struct snd_ctl_elem_value * ucontrol );
442
- int snd_soc_dapm_info_pin_switch (struct snd_kcontrol * kcontrol ,
443
- struct snd_ctl_elem_info * uinfo );
444
- int snd_soc_dapm_get_pin_switch (struct snd_kcontrol * kcontrol ,
445
- struct snd_ctl_elem_value * uncontrol );
446
- int snd_soc_dapm_put_pin_switch (struct snd_kcontrol * kcontrol ,
447
- struct snd_ctl_elem_value * uncontrol );
448
- int snd_soc_dapm_get_component_pin_switch (struct snd_kcontrol * kcontrol ,
449
- struct snd_ctl_elem_value * uncontrol );
450
- int snd_soc_dapm_put_component_pin_switch (struct snd_kcontrol * kcontrol ,
451
- struct snd_ctl_elem_value * uncontrol );
452
- int snd_soc_dapm_new_controls (struct snd_soc_dapm_context * dapm ,
453
- const struct snd_soc_dapm_widget * widget , unsigned int num );
454
- struct snd_soc_dapm_widget * snd_soc_dapm_new_control (struct snd_soc_dapm_context * dapm ,
455
- const struct snd_soc_dapm_widget * widget );
456
- struct snd_soc_dapm_widget * snd_soc_dapm_new_control_unlocked (struct snd_soc_dapm_context * dapm ,
457
- const struct snd_soc_dapm_widget * widget );
458
- int snd_soc_dapm_new_dai_widgets (struct snd_soc_dapm_context * dapm , struct snd_soc_dai * dai );
459
- void snd_soc_dapm_free_widget (struct snd_soc_dapm_widget * w );
460
- int snd_soc_dapm_link_dai_widgets (struct snd_soc_card * card );
461
- void snd_soc_dapm_connect_dai_link_widgets (struct snd_soc_card * card );
462
-
463
- int snd_soc_dapm_update_dai (struct snd_pcm_substream * substream ,
464
- struct snd_pcm_hw_params * params , struct snd_soc_dai * dai );
465
- int snd_soc_dapm_widget_name_cmp (struct snd_soc_dapm_widget * widget , const char * s );
466
-
467
- /* dapm path setup */
468
- int snd_soc_dapm_new_widgets (struct snd_soc_card * card );
469
- void snd_soc_dapm_free (struct snd_soc_dapm_context * dapm );
470
- void snd_soc_dapm_init (struct snd_soc_dapm_context * dapm ,
471
- struct snd_soc_card * card , struct snd_soc_component * component );
472
- int snd_soc_dapm_add_routes (struct snd_soc_dapm_context * dapm ,
473
- const struct snd_soc_dapm_route * route , int num );
474
- int snd_soc_dapm_del_routes (struct snd_soc_dapm_context * dapm ,
475
- const struct snd_soc_dapm_route * route , int num );
476
- void snd_soc_dapm_free_widget (struct snd_soc_dapm_widget * w );
477
-
478
- /* dapm events */
479
- void snd_soc_dapm_stream_event (struct snd_soc_pcm_runtime * rtd , int stream , int event );
480
- void snd_soc_dapm_stream_stop (struct snd_soc_pcm_runtime * rtd , int stream );
481
- void snd_soc_dapm_shutdown (struct snd_soc_card * card );
482
-
483
- /* external DAPM widget events */
484
- int snd_soc_dapm_mixer_update_power (struct snd_soc_dapm_context * dapm ,
485
- struct snd_kcontrol * kcontrol , int connect , struct snd_soc_dapm_update * update );
486
- int snd_soc_dapm_mux_update_power (struct snd_soc_dapm_context * dapm ,
487
- struct snd_kcontrol * kcontrol , int mux , struct soc_enum * e ,
488
- struct snd_soc_dapm_update * update );
489
-
490
- /* dapm sys fs - used by the core */
491
- extern struct attribute * soc_dapm_dev_attrs [];
492
- void snd_soc_dapm_debugfs_init (struct snd_soc_dapm_context * dapm , struct dentry * parent );
493
-
494
- /* dapm audio pin control and status */
495
- int snd_soc_dapm_enable_pin (struct snd_soc_dapm_context * dapm , const char * pin );
496
- int snd_soc_dapm_enable_pin_unlocked (struct snd_soc_dapm_context * dapm , const char * pin );
497
- int snd_soc_dapm_disable_pin (struct snd_soc_dapm_context * dapm , const char * pin );
498
- int snd_soc_dapm_disable_pin_unlocked (struct snd_soc_dapm_context * dapm , const char * pin );
499
- int snd_soc_dapm_get_pin_status (struct snd_soc_dapm_context * dapm , const char * pin );
500
- int snd_soc_dapm_sync (struct snd_soc_dapm_context * dapm );
501
- int snd_soc_dapm_sync_unlocked (struct snd_soc_dapm_context * dapm );
502
- int snd_soc_dapm_force_enable_pin (struct snd_soc_dapm_context * dapm , const char * pin );
503
- int snd_soc_dapm_force_enable_pin_unlocked (struct snd_soc_dapm_context * dapm , const char * pin );
504
- int snd_soc_dapm_ignore_suspend (struct snd_soc_dapm_context * dapm , const char * pin );
505
- unsigned int dapm_kcontrol_get_value (const struct snd_kcontrol * kcontrol );
506
- void dapm_mark_endpoints_dirty (struct snd_soc_card * card );
507
-
508
- /*
509
- * Marks the specified pin as being not connected, disabling it along
510
- * any parent or child widgets. At present this is identical to
511
- * snd_soc_dapm_disable_pin[_unlocked]() but in future it will be extended to do
512
- * additional things such as disabling controls which only affect
513
- * paths through the pin.
514
- */
515
- #define snd_soc_dapm_nc_pin snd_soc_dapm_disable_pin
516
- #define snd_soc_dapm_nc_pin_unlocked snd_soc_dapm_disable_pin_unlocked
517
-
518
- /* dapm path query */
519
- int snd_soc_dapm_dai_get_connected_widgets (struct snd_soc_dai * dai , int stream ,
520
- struct snd_soc_dapm_widget_list * * list ,
521
- bool (* custom_stop_condition )(struct snd_soc_dapm_widget * , enum snd_soc_dapm_direction ));
522
- void snd_soc_dapm_dai_free_widgets (struct snd_soc_dapm_widget_list * * list );
523
-
524
- struct snd_soc_dapm_context * snd_soc_dapm_kcontrol_dapm (struct snd_kcontrol * kcontrol );
525
- struct snd_soc_dapm_widget * snd_soc_dapm_kcontrol_widget (struct snd_kcontrol * kcontrol );
526
-
527
- int snd_soc_dapm_force_bias_level (struct snd_soc_dapm_context * dapm , enum snd_soc_bias_level level );
528
-
529
421
/* dapm widget types */
530
422
enum snd_soc_dapm_type {
531
423
snd_soc_dapm_input = 0 , /* input pin */
@@ -717,11 +609,6 @@ struct snd_soc_dapm_widget_list {
717
609
struct snd_soc_dapm_widget * widgets [] __counted_by (num_widgets );
718
610
};
719
611
720
- #define for_each_dapm_widgets (list , i , widget ) \
721
- for ((i) = 0; \
722
- (i) < list->num_widgets && (widget = list->widgets[i]); \
723
- (i)++)
724
-
725
612
struct snd_soc_dapm_stats {
726
613
int power_checks ;
727
614
int path_checks ;
@@ -733,6 +620,114 @@ struct snd_soc_dapm_pinctrl_priv {
733
620
const char * sleep_state ;
734
621
};
735
622
623
+ enum snd_soc_dapm_direction {
624
+ SND_SOC_DAPM_DIR_IN ,
625
+ SND_SOC_DAPM_DIR_OUT
626
+ };
627
+
628
+ #define SND_SOC_DAPM_DIR_TO_EP (x ) BIT(x)
629
+
630
+ #define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN)
631
+ #define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT)
632
+
633
+ int dapm_regulator_event (struct snd_soc_dapm_widget * w , struct snd_kcontrol * kcontrol , int event );
634
+ int dapm_clock_event (struct snd_soc_dapm_widget * w , struct snd_kcontrol * kcontrol , int event );
635
+ int dapm_pinctrl_event (struct snd_soc_dapm_widget * w , struct snd_kcontrol * kcontrol , int event );
636
+
637
+ /* dapm controls */
638
+ int snd_soc_dapm_put_volsw (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * ucontrol );
639
+ int snd_soc_dapm_get_volsw (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * ucontrol );
640
+ int snd_soc_dapm_get_enum_double (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * ucontrol );
641
+ int snd_soc_dapm_put_enum_double (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * ucontrol );
642
+ int snd_soc_dapm_info_pin_switch (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_info * uinfo );
643
+ int snd_soc_dapm_get_pin_switch (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * uncontrol );
644
+ int snd_soc_dapm_put_pin_switch (struct snd_kcontrol * kcontrol , struct snd_ctl_elem_value * uncontrol );
645
+ int snd_soc_dapm_get_component_pin_switch (struct snd_kcontrol * kcontrol ,
646
+ struct snd_ctl_elem_value * uncontrol );
647
+ int snd_soc_dapm_put_component_pin_switch (struct snd_kcontrol * kcontrol ,
648
+ struct snd_ctl_elem_value * uncontrol );
649
+ int snd_soc_dapm_new_controls (struct snd_soc_dapm_context * dapm ,
650
+ const struct snd_soc_dapm_widget * widget , unsigned int num );
651
+ struct snd_soc_dapm_widget * snd_soc_dapm_new_control (struct snd_soc_dapm_context * dapm ,
652
+ const struct snd_soc_dapm_widget * widget );
653
+ struct snd_soc_dapm_widget * snd_soc_dapm_new_control_unlocked (struct snd_soc_dapm_context * dapm ,
654
+ const struct snd_soc_dapm_widget * widget );
655
+ int snd_soc_dapm_new_dai_widgets (struct snd_soc_dapm_context * dapm , struct snd_soc_dai * dai );
656
+ void snd_soc_dapm_free_widget (struct snd_soc_dapm_widget * w );
657
+ int snd_soc_dapm_link_dai_widgets (struct snd_soc_card * card );
658
+ void snd_soc_dapm_connect_dai_link_widgets (struct snd_soc_card * card );
659
+
660
+ int snd_soc_dapm_update_dai (struct snd_pcm_substream * substream ,
661
+ struct snd_pcm_hw_params * params , struct snd_soc_dai * dai );
662
+ int snd_soc_dapm_widget_name_cmp (struct snd_soc_dapm_widget * widget , const char * s );
663
+
664
+ /* dapm path setup */
665
+ int snd_soc_dapm_new_widgets (struct snd_soc_card * card );
666
+ void snd_soc_dapm_free (struct snd_soc_dapm_context * dapm );
667
+ void snd_soc_dapm_init (struct snd_soc_dapm_context * dapm ,
668
+ struct snd_soc_card * card , struct snd_soc_component * component );
669
+ int snd_soc_dapm_add_routes (struct snd_soc_dapm_context * dapm ,
670
+ const struct snd_soc_dapm_route * route , int num );
671
+ int snd_soc_dapm_del_routes (struct snd_soc_dapm_context * dapm ,
672
+ const struct snd_soc_dapm_route * route , int num );
673
+ void snd_soc_dapm_free_widget (struct snd_soc_dapm_widget * w );
674
+
675
+ /* dapm events */
676
+ void snd_soc_dapm_stream_event (struct snd_soc_pcm_runtime * rtd , int stream , int event );
677
+ void snd_soc_dapm_stream_stop (struct snd_soc_pcm_runtime * rtd , int stream );
678
+ void snd_soc_dapm_shutdown (struct snd_soc_card * card );
679
+
680
+ /* external DAPM widget events */
681
+ int snd_soc_dapm_mixer_update_power (struct snd_soc_dapm_context * dapm ,
682
+ struct snd_kcontrol * kcontrol , int connect , struct snd_soc_dapm_update * update );
683
+ int snd_soc_dapm_mux_update_power (struct snd_soc_dapm_context * dapm ,
684
+ struct snd_kcontrol * kcontrol , int mux , struct soc_enum * e ,
685
+ struct snd_soc_dapm_update * update );
686
+
687
+ /* dapm sys fs - used by the core */
688
+ extern struct attribute * soc_dapm_dev_attrs [];
689
+ void snd_soc_dapm_debugfs_init (struct snd_soc_dapm_context * dapm , struct dentry * parent );
690
+
691
+ /* dapm audio pin control and status */
692
+ int snd_soc_dapm_enable_pin (struct snd_soc_dapm_context * dapm , const char * pin );
693
+ int snd_soc_dapm_enable_pin_unlocked (struct snd_soc_dapm_context * dapm , const char * pin );
694
+ int snd_soc_dapm_disable_pin (struct snd_soc_dapm_context * dapm , const char * pin );
695
+ int snd_soc_dapm_disable_pin_unlocked (struct snd_soc_dapm_context * dapm , const char * pin );
696
+ int snd_soc_dapm_get_pin_status (struct snd_soc_dapm_context * dapm , const char * pin );
697
+ int snd_soc_dapm_sync (struct snd_soc_dapm_context * dapm );
698
+ int snd_soc_dapm_sync_unlocked (struct snd_soc_dapm_context * dapm );
699
+ int snd_soc_dapm_force_enable_pin (struct snd_soc_dapm_context * dapm , const char * pin );
700
+ int snd_soc_dapm_force_enable_pin_unlocked (struct snd_soc_dapm_context * dapm , const char * pin );
701
+ int snd_soc_dapm_ignore_suspend (struct snd_soc_dapm_context * dapm , const char * pin );
702
+ unsigned int dapm_kcontrol_get_value (const struct snd_kcontrol * kcontrol );
703
+ void dapm_mark_endpoints_dirty (struct snd_soc_card * card );
704
+
705
+ /*
706
+ * Marks the specified pin as being not connected, disabling it along
707
+ * any parent or child widgets. At present this is identical to
708
+ * snd_soc_dapm_disable_pin[_unlocked]() but in future it will be extended to do
709
+ * additional things such as disabling controls which only affect
710
+ * paths through the pin.
711
+ */
712
+ #define snd_soc_dapm_nc_pin snd_soc_dapm_disable_pin
713
+ #define snd_soc_dapm_nc_pin_unlocked snd_soc_dapm_disable_pin_unlocked
714
+
715
+ /* dapm path query */
716
+ int snd_soc_dapm_dai_get_connected_widgets (struct snd_soc_dai * dai , int stream ,
717
+ struct snd_soc_dapm_widget_list * * list ,
718
+ bool (* custom_stop_condition )(struct snd_soc_dapm_widget * , enum snd_soc_dapm_direction ));
719
+ void snd_soc_dapm_dai_free_widgets (struct snd_soc_dapm_widget_list * * list );
720
+
721
+ struct snd_soc_dapm_context * snd_soc_dapm_kcontrol_dapm (struct snd_kcontrol * kcontrol );
722
+ struct snd_soc_dapm_widget * snd_soc_dapm_kcontrol_widget (struct snd_kcontrol * kcontrol );
723
+
724
+ int snd_soc_dapm_force_bias_level (struct snd_soc_dapm_context * dapm , enum snd_soc_bias_level level );
725
+
726
+ #define for_each_dapm_widgets (list , i , widget ) \
727
+ for ((i) = 0; \
728
+ (i) < list->num_widgets && (widget = list->widgets[i]); \
729
+ (i)++)
730
+
736
731
/**
737
732
* snd_soc_dapm_init_bias_level() - Initialize DAPM bias level
738
733
* @dapm: The DAPM context to initialize
@@ -764,16 +759,6 @@ static inline enum snd_soc_bias_level snd_soc_dapm_get_bias_level(
764
759
return dapm -> bias_level ;
765
760
}
766
761
767
- enum snd_soc_dapm_direction {
768
- SND_SOC_DAPM_DIR_IN ,
769
- SND_SOC_DAPM_DIR_OUT
770
- };
771
-
772
- #define SND_SOC_DAPM_DIR_TO_EP (x ) BIT(x)
773
-
774
- #define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN)
775
- #define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT)
776
-
777
762
/**
778
763
* snd_soc_dapm_widget_for_each_path - Iterates over all paths in the
779
764
* specified direction of a widget
0 commit comments