162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef PXA2XX_LIB_H
362306a36Sopenharmony_ci#define PXA2XX_LIB_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <uapi/sound/asound.h>
662306a36Sopenharmony_ci#include <linux/platform_device.h>
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* PCM */
962306a36Sopenharmony_cistruct snd_pcm_substream;
1062306a36Sopenharmony_cistruct snd_pcm_hw_params;
1162306a36Sopenharmony_cistruct snd_soc_pcm_runtime;
1262306a36Sopenharmony_cistruct snd_pcm;
1362306a36Sopenharmony_cistruct snd_soc_component;
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciextern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
1662306a36Sopenharmony_ci				struct snd_pcm_hw_params *params);
1762306a36Sopenharmony_ciextern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
1862306a36Sopenharmony_ciextern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
1962306a36Sopenharmony_ciextern int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
2062306a36Sopenharmony_ciextern int pxa2xx_pcm_open(struct snd_pcm_substream *substream);
2162306a36Sopenharmony_ciextern int pxa2xx_pcm_close(struct snd_pcm_substream *substream);
2262306a36Sopenharmony_ciextern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm);
2362306a36Sopenharmony_ciextern int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
2462306a36Sopenharmony_ci			      struct snd_soc_pcm_runtime *rtd);
2562306a36Sopenharmony_ciextern int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
2662306a36Sopenharmony_ci			       struct snd_pcm_substream *substream);
2762306a36Sopenharmony_ciextern int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
2862306a36Sopenharmony_ci				struct snd_pcm_substream *substream);
2962306a36Sopenharmony_ciextern int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
3062306a36Sopenharmony_ci				    struct snd_pcm_substream *substream,
3162306a36Sopenharmony_ci				    struct snd_pcm_hw_params *params);
3262306a36Sopenharmony_ciextern int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
3362306a36Sopenharmony_ci				  struct snd_pcm_substream *substream);
3462306a36Sopenharmony_ciextern int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
3562306a36Sopenharmony_ci				  struct snd_pcm_substream *substream, int cmd);
3662306a36Sopenharmony_ciextern snd_pcm_uframes_t
3762306a36Sopenharmony_cipxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
3862306a36Sopenharmony_ci		       struct snd_pcm_substream *substream);
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci/* AC97 */
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciextern int pxa2xx_ac97_read(int slot, unsigned short reg);
4362306a36Sopenharmony_ciextern int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val);
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ciextern bool pxa2xx_ac97_try_warm_reset(void);
4662306a36Sopenharmony_ciextern bool pxa2xx_ac97_try_cold_reset(void);
4762306a36Sopenharmony_ciextern void pxa2xx_ac97_finish_reset(void);
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ciextern int pxa2xx_ac97_hw_suspend(void);
5062306a36Sopenharmony_ciextern int pxa2xx_ac97_hw_resume(void);
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ciextern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
5362306a36Sopenharmony_ciextern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/* modem registers, used by touchscreen driver */
5662306a36Sopenharmony_ciu32 pxa2xx_ac97_read_modr(void);
5762306a36Sopenharmony_ciu32 pxa2xx_ac97_read_misr(void);
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#endif
60