Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * soc-component.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 2019 Renesas Electronics Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #ifndef __SOC_COMPONENT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #define __SOC_COMPONENT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <sound/soc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * Component probe and remove ordering levels for components with runtime
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * dependencies.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #define SND_SOC_COMP_ORDER_FIRST	-2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define SND_SOC_COMP_ORDER_EARLY	-1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define SND_SOC_COMP_ORDER_NORMAL	 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define SND_SOC_COMP_ORDER_LATE		 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define SND_SOC_COMP_ORDER_LAST		 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define for_each_comp_order(order)		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	for (order  = SND_SOC_COMP_ORDER_FIRST;	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	     order <= SND_SOC_COMP_ORDER_LAST;	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	     order++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) /* component interface */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) struct snd_compress_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	int (*open)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 		    struct snd_compr_stream *stream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	int (*free)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 		    struct snd_compr_stream *stream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	int (*set_params)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 			  struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 			  struct snd_compr_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	int (*get_params)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 			  struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 			  struct snd_codec *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	int (*set_metadata)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 			    struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 			    struct snd_compr_metadata *metadata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	int (*get_metadata)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 			    struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 			    struct snd_compr_metadata *metadata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	int (*trigger)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		       struct snd_compr_stream *stream, int cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	int (*pointer)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		       struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		       struct snd_compr_tstamp *tstamp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	int (*copy)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		    struct snd_compr_stream *stream, char __user *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		    size_t count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	int (*mmap)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		    struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		    struct vm_area_struct *vma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	int (*ack)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		   struct snd_compr_stream *stream, size_t bytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	int (*get_caps)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 			struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 			struct snd_compr_caps *caps);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	int (*get_codec_caps)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 			      struct snd_compr_stream *stream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 			      struct snd_compr_codec_caps *codec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) struct snd_soc_component_driver {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	/* Default control and setup, added after probe() is run */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	const struct snd_kcontrol_new *controls;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	unsigned int num_controls;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	const struct snd_soc_dapm_widget *dapm_widgets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	unsigned int num_dapm_widgets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	const struct snd_soc_dapm_route *dapm_routes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	unsigned int num_dapm_routes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	int (*probe)(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	void (*remove)(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	int (*suspend)(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	int (*resume)(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	unsigned int (*read)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			     unsigned int reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	int (*write)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		     unsigned int reg, unsigned int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	/* pcm creation and destruction */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	int (*pcm_construct)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 			     struct snd_soc_pcm_runtime *rtd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	void (*pcm_destruct)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 			     struct snd_pcm *pcm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	/* component wide operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	int (*set_sysclk)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			  int clk_id, int source, unsigned int freq, int dir);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	int (*set_pll)(struct snd_soc_component *component, int pll_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		       int source, unsigned int freq_in, unsigned int freq_out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	int (*set_jack)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			struct snd_soc_jack *jack,  void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	/* DT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	int (*of_xlate_dai_name)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 				 struct of_phandle_args *args,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 				 const char **dai_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	int (*of_xlate_dai_id)(struct snd_soc_component *comment,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 			       struct device_node *endpoint);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	void (*seq_notifier)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 			     enum snd_soc_dapm_type type, int subseq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	int (*stream_event)(struct snd_soc_component *component, int event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	int (*set_bias_level)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 			      enum snd_soc_bias_level level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	int (*open)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		    struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	int (*close)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		     struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	int (*ioctl)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		     struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		     unsigned int cmd, void *arg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	int (*hw_params)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 			 struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 			 struct snd_pcm_hw_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	int (*hw_free)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		       struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	int (*prepare)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		       struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	int (*trigger)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		       struct snd_pcm_substream *substream, int cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	int (*sync_stop)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			 struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	snd_pcm_uframes_t (*pointer)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 				     struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	int (*get_time_info)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		struct snd_pcm_substream *substream, struct timespec64 *system_ts,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		struct timespec64 *audio_ts,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		struct snd_pcm_audio_tstamp_config *audio_tstamp_config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		struct snd_pcm_audio_tstamp_report *audio_tstamp_report);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	int (*copy_user)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 			 struct snd_pcm_substream *substream, int channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 			 unsigned long pos, void __user *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			 unsigned long bytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	struct page *(*page)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 			     struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 			     unsigned long offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	int (*mmap)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		    struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		    struct vm_area_struct *vma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	int (*ack)(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		   struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	const struct snd_compress_ops *compress_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	/* probe ordering - for components with runtime dependencies */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	int probe_order;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	int remove_order;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	 * signal if the module handling the component should not be removed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	 * if a pcm is open. Setting this would prevent the module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	 * refcount being incremented in probe() but allow it be incremented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	 * when a pcm is opened and decremented when it is closed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	unsigned int module_get_upon_open:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	/* bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	unsigned int idle_bias_on:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	unsigned int suspend_bias_off:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	unsigned int use_pmdown_time:1; /* care pmdown_time at stop */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	unsigned int endianness:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	unsigned int non_legacy_dai_naming:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	/* this component uses topology and ignore machine driver FEs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	const char *ignore_machine;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	const char *topology_name_prefix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	int (*be_hw_params_fixup)(struct snd_soc_pcm_runtime *rtd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 				  struct snd_pcm_hw_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	bool use_dai_pcm_id;	/* use DAI link PCM ID as PCM device number */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	int be_pcm_base;	/* base device ID for all BE PCMs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) struct snd_soc_component {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	int id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	const char *name_prefix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	struct device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	struct snd_soc_card *card;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	unsigned int active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	unsigned int suspended:1; /* is in suspend PM state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	struct list_head card_aux_list; /* for auxiliary bound components */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	struct list_head card_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	const struct snd_soc_component_driver *driver;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	struct list_head dai_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	int num_dai;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	struct regmap *regmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	int val_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	struct mutex io_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	/* attached dynamic objects */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	struct list_head dobj_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	 * DO NOT use any of the fields below in drivers, they are temporary and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	 * are going to be removed again soon. If you use them in driver code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	 * the driver will be marked as BROKEN when these fields are removed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	/* Don't use these, use snd_soc_component_get_dapm() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	struct snd_soc_dapm_context dapm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	/* machine specific init */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	int (*init)(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	/* function mark */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	struct snd_pcm_substream *mark_module;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	struct snd_pcm_substream *mark_open;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	void *mark_pm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) #ifdef CONFIG_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	struct dentry *debugfs_root;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	const char *debugfs_prefix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) #define for_each_component_dais(component, dai)\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	list_for_each_entry(dai, &(component)->dai_list, list)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) #define for_each_component_dais_safe(component, dai, _dai)\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	list_for_each_entry_safe(dai, _dai, &(component)->dai_list, list)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)  * snd_soc_dapm_to_component() - Casts a DAPM context to the component it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)  *  embedded in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)  * @dapm: The DAPM context to cast to the component
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)  * This function must only be used on DAPM contexts that are known to be part of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)  * a component (e.g. in a component driver). Otherwise the behavior is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)  * undefined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) static inline struct snd_soc_component *snd_soc_dapm_to_component(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	struct snd_soc_dapm_context *dapm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	return container_of(dapm, struct snd_soc_component, dapm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)  * snd_soc_component_get_dapm() - Returns the DAPM context associated with a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)  *  component
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)  * @component: The component for which to get the DAPM context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	struct snd_soc_component *component)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	return &component->dapm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)  * snd_soc_component_init_bias_level() - Initialize COMPONENT DAPM bias level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  * @component: The COMPONENT for which to initialize the DAPM bias level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)  * @level: The DAPM level to initialize to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)  * Initializes the COMPONENT DAPM bias level. See snd_soc_dapm_init_bias_level()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) snd_soc_component_init_bias_level(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 				  enum snd_soc_bias_level level)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	snd_soc_dapm_init_bias_level(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 		snd_soc_component_get_dapm(component), level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)  * snd_soc_component_get_bias_level() - Get current COMPONENT DAPM bias level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)  * @component: The COMPONENT for which to get the DAPM bias level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)  * Returns: The current DAPM bias level of the COMPONENT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) static inline enum snd_soc_bias_level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) snd_soc_component_get_bias_level(struct snd_soc_component *component)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	return snd_soc_dapm_get_bias_level(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 		snd_soc_component_get_dapm(component));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)  * snd_soc_component_force_bias_level() - Set the COMPONENT DAPM bias level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)  * @component: The COMPONENT for which to set the level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)  * @level: The level to set to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)  * Forces the COMPONENT bias level to a specific state. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)  * snd_soc_dapm_force_bias_level().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) snd_soc_component_force_bias_level(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 				   enum snd_soc_bias_level level)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 	return snd_soc_dapm_force_bias_level(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 		snd_soc_component_get_dapm(component),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 		level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)  * snd_soc_dapm_kcontrol_component() - Returns the component associated to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)  * kcontrol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)  * @kcontrol: The kcontrol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)  * This function must only be used on DAPM contexts that are known to be part of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)  * a COMPONENT (e.g. in a COMPONENT driver). Otherwise the behavior is undefined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) static inline struct snd_soc_component *snd_soc_dapm_kcontrol_component(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	struct snd_kcontrol *kcontrol)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 	return snd_soc_dapm_to_component(snd_soc_dapm_kcontrol_dapm(kcontrol));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)  * snd_soc_component_cache_sync() - Sync the register cache with the hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)  * @component: COMPONENT to sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)  * Note: This function will call regcache_sync()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) static inline int snd_soc_component_cache_sync(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	struct snd_soc_component *component)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	return regcache_sync(component->regmap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) void snd_soc_component_set_aux(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 			       struct snd_soc_aux_dev *aux);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) int snd_soc_component_init(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) /* component IO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) unsigned int snd_soc_component_read(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 				      unsigned int reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) int snd_soc_component_write(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 			    unsigned int reg, unsigned int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) int snd_soc_component_update_bits(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 				  unsigned int reg, unsigned int mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 				  unsigned int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) int snd_soc_component_update_bits_async(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 					unsigned int reg, unsigned int mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 					unsigned int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) void snd_soc_component_async_complete(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) int snd_soc_component_test_bits(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 				unsigned int reg, unsigned int mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 				unsigned int value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) /* component wide operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) int snd_soc_component_set_sysclk(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 				 int clk_id, int source,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 				 unsigned int freq, int dir);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 			      int source, unsigned int freq_in,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 			      unsigned int freq_out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) int snd_soc_component_set_jack(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 			       struct snd_soc_jack *jack, void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) void snd_soc_component_seq_notifier(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 				    enum snd_soc_dapm_type type, int subseq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) int snd_soc_component_stream_event(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 				   int event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) int snd_soc_component_set_bias_level(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 				     enum snd_soc_bias_level level);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) void snd_soc_component_setup_regmap(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) #ifdef CONFIG_REGMAP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) void snd_soc_component_init_regmap(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 				   struct regmap *regmap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) void snd_soc_component_exit_regmap(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) #define snd_soc_component_module_get_when_probe(component)\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	snd_soc_component_module_get(component, NULL, 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) #define snd_soc_component_module_get_when_open(component, substream)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	snd_soc_component_module_get(component, substream, 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) int snd_soc_component_module_get(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 				 struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 				 int upon_open);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) #define snd_soc_component_module_put_when_remove(component)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 	snd_soc_component_module_put(component, NULL, 0, 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) #define snd_soc_component_module_put_when_close(component, substream, rollback) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	snd_soc_component_module_put(component, substream, 1, rollback)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) void snd_soc_component_module_put(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 				  struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 				  int upon_open, int rollback);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) static inline void snd_soc_component_set_drvdata(struct snd_soc_component *c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 						 void *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	dev_set_drvdata(c->dev, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) static inline void *snd_soc_component_get_drvdata(struct snd_soc_component *c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	return dev_get_drvdata(c->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) static inline unsigned int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) snd_soc_component_active(struct snd_soc_component *component)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	return component->active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) /* component pin */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) int snd_soc_component_enable_pin(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 				 const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) int snd_soc_component_enable_pin_unlocked(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 					  const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) int snd_soc_component_disable_pin(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 				  const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) int snd_soc_component_disable_pin_unlocked(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 					   const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) int snd_soc_component_nc_pin(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 			     const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) int snd_soc_component_nc_pin_unlocked(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 				      const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) int snd_soc_component_get_pin_status(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 				     const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) int snd_soc_component_force_enable_pin(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 				       const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) int snd_soc_component_force_enable_pin_unlocked(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	const char *pin);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) /* component driver ops */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) int snd_soc_component_open(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 			   struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) int snd_soc_component_close(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 			    struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 			    int rollback);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) void snd_soc_component_suspend(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) void snd_soc_component_resume(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) int snd_soc_component_is_suspended(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) int snd_soc_component_probe(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) void snd_soc_component_remove(struct snd_soc_component *component);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 				      struct device_node *ep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 					struct of_phandle_args *args,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 					const char **dai_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 				unsigned int cmd, void *arg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) int snd_soc_pcm_component_sync_stop(struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) int snd_soc_pcm_component_copy_user(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 				    int channel, unsigned long pos,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 				    void __user *buf, unsigned long bytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 					unsigned long offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 			       struct vm_area_struct *vma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) int snd_soc_pcm_component_new(struct snd_soc_pcm_runtime *rtd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) int snd_soc_pcm_component_prepare(struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) int snd_soc_pcm_component_hw_params(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 				    struct snd_pcm_hw_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 				    struct snd_soc_component **last);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 				   struct snd_soc_component *last);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 				  int cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 					 void *stream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 					  void *stream, int rollback);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) #endif /* __SOC_COMPONENT_H */