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