xref: /OK3568_Linux_fs/kernel/include/sound/pxa2xx-lib.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef PXA2XX_LIB_H
3*4882a593Smuzhiyun #define PXA2XX_LIB_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <uapi/sound/asound.h>
6*4882a593Smuzhiyun #include <linux/platform_device.h>
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun /* PCM */
9*4882a593Smuzhiyun struct snd_pcm_substream;
10*4882a593Smuzhiyun struct snd_pcm_hw_params;
11*4882a593Smuzhiyun struct snd_soc_pcm_runtime;
12*4882a593Smuzhiyun struct snd_pcm;
13*4882a593Smuzhiyun struct snd_soc_component;
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun extern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
16*4882a593Smuzhiyun 				struct snd_pcm_hw_params *params);
17*4882a593Smuzhiyun extern int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
18*4882a593Smuzhiyun extern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
19*4882a593Smuzhiyun extern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
20*4882a593Smuzhiyun extern int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
21*4882a593Smuzhiyun extern int pxa2xx_pcm_open(struct snd_pcm_substream *substream);
22*4882a593Smuzhiyun extern int pxa2xx_pcm_close(struct snd_pcm_substream *substream);
23*4882a593Smuzhiyun extern int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
24*4882a593Smuzhiyun 	struct vm_area_struct *vma);
25*4882a593Smuzhiyun extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream);
26*4882a593Smuzhiyun extern void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm);
27*4882a593Smuzhiyun extern void pxa2xx_soc_pcm_free(struct snd_soc_component *component,
28*4882a593Smuzhiyun 				struct snd_pcm *pcm);
29*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
30*4882a593Smuzhiyun 			      struct snd_soc_pcm_runtime *rtd);
31*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
32*4882a593Smuzhiyun 			       struct snd_pcm_substream *substream);
33*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
34*4882a593Smuzhiyun 				struct snd_pcm_substream *substream);
35*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
36*4882a593Smuzhiyun 				    struct snd_pcm_substream *substream,
37*4882a593Smuzhiyun 				    struct snd_pcm_hw_params *params);
38*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_hw_free(struct snd_soc_component *component,
39*4882a593Smuzhiyun 				  struct snd_pcm_substream *substream);
40*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
41*4882a593Smuzhiyun 				  struct snd_pcm_substream *substream);
42*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
43*4882a593Smuzhiyun 				  struct snd_pcm_substream *substream, int cmd);
44*4882a593Smuzhiyun extern snd_pcm_uframes_t
45*4882a593Smuzhiyun pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
46*4882a593Smuzhiyun 		       struct snd_pcm_substream *substream);
47*4882a593Smuzhiyun extern int pxa2xx_soc_pcm_mmap(struct snd_soc_component *component,
48*4882a593Smuzhiyun 			       struct snd_pcm_substream *substream,
49*4882a593Smuzhiyun 			       struct vm_area_struct *vma);
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun /* AC97 */
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun extern int pxa2xx_ac97_read(int slot, unsigned short reg);
54*4882a593Smuzhiyun extern int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val);
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun extern bool pxa2xx_ac97_try_warm_reset(void);
57*4882a593Smuzhiyun extern bool pxa2xx_ac97_try_cold_reset(void);
58*4882a593Smuzhiyun extern void pxa2xx_ac97_finish_reset(void);
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun extern int pxa2xx_ac97_hw_suspend(void);
61*4882a593Smuzhiyun extern int pxa2xx_ac97_hw_resume(void);
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
64*4882a593Smuzhiyun extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun #endif
67