1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*****************************************************************************
4 * Copyright (C) 2008 Cedric Bregardis <cedric.bregardis@free.fr> and
5 * Jean-Christian Hassler <jhassler@free.fr>
7 * This file is part of the Audiowerk2 ALSA driver
9 *****************************************************************************/
14 #define NB_STREAM_PLAYBACK 2
15 #define NB_STREAM_CAPTURE 1
17 #define NUM_STREAM_PLAYBACK_ANA 0
18 #define NUM_STREAM_PLAYBACK_DIG 1
20 #define NUM_STREAM_CAPTURE_ANA 0
22 struct snd_pcm_substream
;
23 typedef void (*snd_aw2_saa7146_it_cb
) (struct snd_pcm_substream
*);
25 struct snd_aw2_saa7146_cb_param
{
26 snd_aw2_saa7146_it_cb p_it_callback
;
27 struct snd_pcm_substream
*p_callback_param
;
30 /* definition of the chip-specific record */
32 struct snd_aw2_saa7146
{
33 void __iomem
*base_addr
;
36 extern void snd_aw2_saa7146_setup(struct snd_aw2_saa7146
*chip
,
37 void __iomem
*pci_base_addr
);
38 extern int snd_aw2_saa7146_free(struct snd_aw2_saa7146
*chip
);
40 extern void snd_aw2_saa7146_pcm_init_playback(struct snd_aw2_saa7146
*chip
,
42 unsigned long dma_addr
,
43 unsigned long period_size
,
44 unsigned long buffer_size
);
45 extern void snd_aw2_saa7146_pcm_init_capture(struct snd_aw2_saa7146
*chip
,
47 unsigned long dma_addr
,
48 unsigned long period_size
,
49 unsigned long buffer_size
);
50 extern void snd_aw2_saa7146_define_it_playback_callback(unsigned int
54 void *p_callback_param
);
55 extern void snd_aw2_saa7146_define_it_capture_callback(unsigned int
59 void *p_callback_param
);
60 extern void snd_aw2_saa7146_pcm_trigger_start_capture(struct snd_aw2_saa7146
61 *chip
, int stream_number
);
62 extern void snd_aw2_saa7146_pcm_trigger_stop_capture(struct snd_aw2_saa7146
63 *chip
, int stream_number
);
65 extern void snd_aw2_saa7146_pcm_trigger_start_playback(struct snd_aw2_saa7146
68 extern void snd_aw2_saa7146_pcm_trigger_stop_playback(struct snd_aw2_saa7146
69 *chip
, int stream_number
);
71 extern irqreturn_t
snd_aw2_saa7146_interrupt(int irq
, void *dev_id
);
72 extern unsigned int snd_aw2_saa7146_get_hw_ptr_playback(struct snd_aw2_saa7146
79 extern unsigned int snd_aw2_saa7146_get_hw_ptr_capture(struct snd_aw2_saa7146
87 extern void snd_aw2_saa7146_use_digital_input(struct snd_aw2_saa7146
*chip
,
90 extern int snd_aw2_saa7146_is_using_digital_input(struct snd_aw2_saa7146