Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: unpack snd_soc_component_xxx_bias_level()

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Because struct snd_soc_dapm_context is soc-dapm framework specific, user
driver don't need to access its member directly, we would like to hide
them. struct snd_soc_dapm_context will be removed from header in the
future.

This is prepare patch for it.

+38 -76
-45
include/sound/soc-component.h
··· 287 287 } 288 288 289 289 /** 290 - * snd_soc_component_init_bias_level() - Initialize COMPONENT DAPM bias level 291 - * @component: The COMPONENT for which to initialize the DAPM bias level 292 - * @level: The DAPM level to initialize to 293 - * 294 - * Initializes the COMPONENT DAPM bias level. See snd_soc_dapm_init_bias_level() 295 - */ 296 - static inline void 297 - snd_soc_component_init_bias_level(struct snd_soc_component *component, 298 - enum snd_soc_bias_level level) 299 - { 300 - snd_soc_dapm_init_bias_level( 301 - snd_soc_component_get_dapm(component), level); 302 - } 303 - 304 - /** 305 - * snd_soc_component_get_bias_level() - Get current COMPONENT DAPM bias level 306 - * @component: The COMPONENT for which to get the DAPM bias level 307 - * 308 - * Returns: The current DAPM bias level of the COMPONENT. 309 - */ 310 - static inline enum snd_soc_bias_level 311 - snd_soc_component_get_bias_level(struct snd_soc_component *component) 312 - { 313 - return snd_soc_dapm_get_bias_level( 314 - snd_soc_component_get_dapm(component)); 315 - } 316 - 317 - /** 318 - * snd_soc_component_force_bias_level() - Set the COMPONENT DAPM bias level 319 - * @component: The COMPONENT for which to set the level 320 - * @level: The level to set to 321 - * 322 - * Forces the COMPONENT bias level to a specific state. See 323 - * snd_soc_dapm_force_bias_level(). 324 - */ 325 - static inline int 326 - snd_soc_component_force_bias_level(struct snd_soc_component *component, 327 - enum snd_soc_bias_level level) 328 - { 329 - return snd_soc_dapm_force_bias_level( 330 - snd_soc_component_get_dapm(component), 331 - level); 332 - } 333 - 334 - /** 335 290 * snd_soc_dapm_kcontrol_component() - Returns the component associated to a 336 291 * kcontrol 337 292 * @kcontrol: The kcontrol
+7 -31
include/sound/soc-dapm.h
··· 722 722 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(struct snd_kcontrol *kcontrol); 723 723 724 724 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 725 + enum snd_soc_bias_level snd_soc_dapm_get_bias_level(struct snd_soc_dapm_context *dapm); 726 + void snd_soc_dapm_init_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 727 + 728 + // REMOVE ME !! 729 + #define snd_soc_component_force_bias_level(c, l) snd_soc_dapm_force_bias_level(&(c)->dapm, l) 730 + #define snd_soc_component_get_bias_level(c) snd_soc_dapm_get_bias_level(&(c)->dapm) 731 + #define snd_soc_component_init_bias_level(c, l) snd_soc_dapm_init_bias_level(&(c)->dapm, l) 725 732 726 733 #define for_each_dapm_widgets(list, i, widget) \ 727 734 for ((i) = 0; \ 728 735 (i) < list->num_widgets && (widget = list->widgets[i]); \ 729 736 (i)++) 730 - 731 - /** 732 - * snd_soc_dapm_init_bias_level() - Initialize DAPM bias level 733 - * @dapm: The DAPM context to initialize 734 - * @level: The DAPM level to initialize to 735 - * 736 - * This function only sets the driver internal state of the DAPM level and will 737 - * not modify the state of the device. Hence it should not be used during normal 738 - * operation, but only to synchronize the internal state to the device state. 739 - * E.g. during driver probe to set the DAPM level to the one corresponding with 740 - * the power-on reset state of the device. 741 - * 742 - * To change the DAPM state of the device use snd_soc_dapm_set_bias_level(). 743 - */ 744 - static inline void snd_soc_dapm_init_bias_level( 745 - struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) 746 - { 747 - dapm->bias_level = level; 748 - } 749 - 750 - /** 751 - * snd_soc_dapm_get_bias_level() - Get current DAPM bias level 752 - * @dapm: The context for which to get the bias level 753 - * 754 - * Returns: The current bias level of the passed DAPM context. 755 - */ 756 - static inline enum snd_soc_bias_level snd_soc_dapm_get_bias_level( 757 - struct snd_soc_dapm_context *dapm) 758 - { 759 - return dapm->bias_level; 760 - } 761 737 762 738 /** 763 739 * snd_soc_dapm_widget_for_each_path - Iterates over all paths in the
+31
sound/soc/soc-dapm.c
··· 1000 1000 EXPORT_SYMBOL_GPL(snd_soc_dapm_force_bias_level); 1001 1001 1002 1002 /** 1003 + * snd_soc_dapm_init_bias_level() - Initialize DAPM bias level 1004 + * @dapm: The DAPM context to initialize 1005 + * @level: The DAPM level to initialize to 1006 + * 1007 + * This function only sets the driver internal state of the DAPM level and will 1008 + * not modify the state of the device. Hence it should not be used during normal 1009 + * operation, but only to synchronize the internal state to the device state. 1010 + * E.g. during driver probe to set the DAPM level to the one corresponding with 1011 + * the power-on reset state of the device. 1012 + * 1013 + * To change the DAPM state of the device use snd_soc_dapm_set_bias_level(). 1014 + */ 1015 + void snd_soc_dapm_init_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) 1016 + { 1017 + dapm->bias_level = level; 1018 + } 1019 + EXPORT_SYMBOL_GPL(snd_soc_dapm_init_bias_level); 1020 + 1021 + /** 1003 1022 * snd_soc_dapm_set_bias_level - set the bias level for the system 1004 1023 * @dapm: DAPM context 1005 1024 * @level: level to configure ··· 1055 1036 1056 1037 return ret; 1057 1038 } 1039 + 1040 + /** 1041 + * snd_soc_dapm_get_bias_level() - Get current DAPM bias level 1042 + * @dapm: The context for which to get the bias level 1043 + * 1044 + * Returns: The current bias level of the passed DAPM context. 1045 + */ 1046 + enum snd_soc_bias_level snd_soc_dapm_get_bias_level(struct snd_soc_dapm_context *dapm) 1047 + { 1048 + return dapm->bias_level; 1049 + } 1050 + EXPORT_SYMBOL_GPL(snd_soc_dapm_get_bias_level); 1058 1051 1059 1052 static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, 1060 1053 struct snd_soc_dapm_widget *kcontrolw,