Changeset 695 for GPL/trunk/alsa-kernel/include/sound/soc.h
- Timestamp:
- Aug 21, 2021, 3:35:34 AM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-next merged: 691-694
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/include/sound/soc.h
r679 r695 491 491 const struct snd_pcm_hardware *hw); 492 492 493 /* Jack reporting */494 void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);495 int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,496 struct snd_soc_jack_pin *pins);497 void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,498 struct notifier_block *nb);499 void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,500 struct notifier_block *nb);501 int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,502 struct snd_soc_jack_zone *zones);503 int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);504 #ifdef CONFIG_GPIOLIB505 int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,506 struct snd_soc_jack_gpio *gpios);507 int snd_soc_jack_add_gpiods(struct device *gpiod_dev,508 struct snd_soc_jack *jack,509 int count, struct snd_soc_jack_gpio *gpios);510 void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,511 struct snd_soc_jack_gpio *gpios);512 #else513 static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,514 struct snd_soc_jack_gpio *gpios)515 {516 return 0;517 }518 519 static inline int snd_soc_jack_add_gpiods(struct device *gpiod_dev,520 struct snd_soc_jack *jack,521 int count,522 struct snd_soc_jack_gpio *gpios)523 {524 return 0;525 }526 527 static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,528 struct snd_soc_jack_gpio *gpios)529 {530 }531 #endif532 533 493 struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component); 534 494 struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component, … … 617 577 struct snd_ctl_elem_value *ucontrol); 618 578 619 /**620 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection621 *622 * @pin: name of the pin to update623 * @mask: bits to check for in reported jack status624 * @invert: if non-zero then pin is enabled when status is not reported625 * @list: internal list entry626 */627 struct snd_soc_jack_pin {628 struct list_head list;629 const char *pin;630 int mask;631 bool invert;632 };633 634 /**635 * struct snd_soc_jack_zone - Describes voltage zones of jack detection636 *637 * @min_mv: start voltage in mv638 * @max_mv: end voltage in mv639 * @jack_type: type of jack that is expected for this voltage640 * @debounce_time: debounce_time for jack, codec driver should wait for this641 * duration before reading the adc for voltages642 * @list: internal list entry643 */644 struct snd_soc_jack_zone {645 unsigned int min_mv;646 unsigned int max_mv;647 unsigned int jack_type;648 unsigned int debounce_time;649 struct list_head list;650 };651 652 /**653 * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection654 *655 * @gpio: legacy gpio number656 * @idx: gpio descriptor index within the function of the GPIO657 * consumer device658 * @gpiod_dev: GPIO consumer device659 * @name: gpio name. Also as connection ID for the GPIO consumer660 * device function name lookup661 * @report: value to report when jack detected662 * @invert: report presence in low state663 * @debounce_time: debounce time in ms664 * @wake: enable as wake source665 * @jack_status_check: callback function which overrides the detection666 * to provide more complex checks (eg, reading an667 * ADC).668 */669 struct snd_soc_jack_gpio {670 unsigned int gpio;671 unsigned int idx;672 struct device *gpiod_dev;673 const char *name;674 int report;675 int invert;676 int debounce_time;677 bool wake;678 679 /* private: */680 struct snd_soc_jack *jack;681 struct delayed_work work;682 struct notifier_block pm_notifier;683 struct gpio_desc *desc;684 685 void *data;686 /* public: */687 int (*jack_status_check)(void *data);688 };689 690 struct snd_soc_jack {691 struct mutex mutex;692 struct snd_jack *jack;693 struct snd_soc_card *card;694 struct list_head pins;695 int status;696 struct blocking_notifier_head notifier;697 struct list_head jack_zones;698 };699 700 579 /* SoC PCM stream information */ 701 580 struct snd_soc_pcm_stream { … … 807 686 808 687 /* Symmetry requirements */ 809 unsigned int symmetric_rate s:1;688 unsigned int symmetric_rate:1; 810 689 unsigned int symmetric_channels:1; 811 unsigned int symmetric_sample bits:1;690 unsigned int symmetric_sample_bits:1; 812 691 813 692 /* Do not create a PCM for this DAI link (Backend link) */ … … 834 713 unsigned int ignore:1; 835 714 715 /* This flag will reorder stop sequence. By enabling this flag 716 * DMA controller stop sequence will be invoked first followed by 717 * CPU DAI driver stop sequence 718 */ 719 unsigned int stop_dma_first:1; 720 836 721 #ifdef CONFIG_SND_SOC_TOPOLOGY 837 722 struct snd_soc_dobj dobj; /* For topology */ 838 723 #endif 839 724 }; 725 726 static inline struct snd_soc_dai_link_component* 727 asoc_link_to_cpu(struct snd_soc_dai_link *link, int n) { 728 return &(link)->cpus[n]; 729 } 730 731 static inline struct snd_soc_dai_link_component* 732 asoc_link_to_codec(struct snd_soc_dai_link *link, int n) { 733 return &(link)->codecs[n]; 734 } 735 736 static inline struct snd_soc_dai_link_component* 737 asoc_link_to_platform(struct snd_soc_dai_link *link, int n) { 738 return &(link)->platforms[n]; 739 } 740 840 741 #define for_each_link_codecs(link, i, codec) \ 841 742 for ((i) = 0; \ 842 ((i) < link->num_codecs) && ((codec) = &link->codecs[i]); \ 743 ((i) < link->num_codecs) && \ 744 ((codec) = asoc_link_to_codec(link, i)); \ 843 745 (i)++) 844 746 … … 846 748 for ((i) = 0; \ 847 749 ((i) < link->num_platforms) && \ 848 ((platform) = &link->platforms[i]);\750 ((platform) = asoc_link_to_platform(link, i)); \ 849 751 (i)++) 850 752 851 753 #define for_each_link_cpus(link, i, cpu) \ 852 754 for ((i) = 0; \ 853 ((i) < link->num_cpus) && ((cpu) = &link->cpus[i]); \ 755 ((i) < link->num_cpus) && \ 756 ((cpu) = asoc_link_to_cpu(link, i)); \ 854 757 (i)++) 855 758 … … 1085 988 unsigned int disable_route_checks:1; 1086 989 unsigned int probed:1; 990 unsigned int component_chaining:1; 1087 991 1088 992 void *drvdata; … … 1162 1066 /* function mark */ 1163 1067 struct snd_pcm_substream *mark_startup; 1068 struct snd_pcm_substream *mark_hw_params; 1069 struct snd_pcm_substream *mark_trigger; 1070 struct snd_compr_stream *mark_compr_startup; 1164 1071 1165 1072 /* bit field */ … … 1184 1091 ((i) < rtd->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \ 1185 1092 (i)++) 1186 #define for_each_rtd_cpu_dais_rollback(rtd, i, dai) \1187 for (; (--(i) >= 0) && ((dai) = asoc_rtd_to_cpu(rtd, i));)1188 1093 #define for_each_rtd_codec_dais(rtd, i, dai) \ 1189 1094 for ((i) = 0; \ 1190 1095 ((i) < rtd->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \ 1191 1096 (i)++) 1192 #define for_each_rtd_codec_dais_rollback(rtd, i, dai) \1193 for (; (--(i) >= 0) && ((dai) = asoc_rtd_to_codec(rtd, i));)1194 1097 #define for_each_rtd_dais(rtd, i, dai) \ 1195 1098 for ((i) = 0; \ … … 1197 1100 ((dai) = (rtd)->dais[i]); \ 1198 1101 (i)++) 1199 #define for_each_rtd_dais_rollback(rtd, i, dai) \1200 for (; (--(i) >= 0) && ((dai) = (rtd)->dais[i]);)1201 1102 1202 1103 void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd); … … 1343 1244 struct device_node **framemaster); 1344 1245 int snd_soc_get_dai_id(struct device_node *ep); 1345 int snd_soc_get_dai_name( struct of_phandle_args *args,1246 int snd_soc_get_dai_name(const struct of_phandle_args *args, 1346 1247 const char **dai_name); 1347 1248 int snd_soc_of_get_dai_name(struct device_node *of_node, … … 1386 1287 /* set platform name for each dailink */ 1387 1288 for_each_card_prelinks(card, i, dai_link) { 1289 /* only single platform is supported for now */ 1290 if (dai_link->num_platforms != 1) 1291 return -EINVAL; 1292 1293 if (!dai_link->platforms) 1294 return -EINVAL; 1295 1388 1296 name = devm_kstrdup(card->dev, platform_name, GFP_KERNEL); 1389 1297 if (!name) 1390 1298 return -ENOMEM; 1391 1299 1392 if (!dai_link->platforms)1393 return -EINVAL;1394 1395 1300 /* only single platform is supported for now */ 1396 1301 dai_link->platforms->name = name; … … 1419 1324 #include <sound/soc-component.h> 1420 1325 #include <sound/soc-card.h> 1326 #include <sound/soc-jack.h> 1421 1327 1422 1328 #endif
Note:
See TracChangeset
for help on using the changeset viewer.