1 /*****************************************************************************
3 * Copyright (C) 2008 Cedric Bregardis <cedric.bregardis@free.fr> and
4 * Jean-Christian Hassler <jhassler@free.fr>
6 * This file is part of the Audiowerk2 ALSA driver
8 * The Audiowerk2 ALSA driver is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2.
12 * The Audiowerk2 ALSA driver is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with the Audiowerk2 ALSA driver; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 *****************************************************************************/
27 #define NB_STREAM_PLAYBACK 2
28 #define NB_STREAM_CAPTURE 1
30 #define NUM_STREAM_PLAYBACK_ANA 0
31 #define NUM_STREAM_PLAYBACK_DIG 1
33 #define NUM_STREAM_CAPTURE_ANA 0
35 typedef void (*snd_aw2_saa7146_it_cb
) (void *);
37 struct snd_aw2_saa7146_cb_param
{
38 snd_aw2_saa7146_it_cb p_it_callback
;
39 void *p_callback_param
;
42 /* definition of the chip-specific record */
44 struct snd_aw2_saa7146
{
45 void __iomem
*base_addr
;
48 extern void snd_aw2_saa7146_setup(struct snd_aw2_saa7146
*chip
,
49 void __iomem
*pci_base_addr
);
50 extern int snd_aw2_saa7146_free(struct snd_aw2_saa7146
*chip
);
52 extern void snd_aw2_saa7146_pcm_init_playback(struct snd_aw2_saa7146
*chip
,
54 unsigned long dma_addr
,
55 unsigned long period_size
,
56 unsigned long buffer_size
);
57 extern void snd_aw2_saa7146_pcm_init_capture(struct snd_aw2_saa7146
*chip
,
59 unsigned long dma_addr
,
60 unsigned long period_size
,
61 unsigned long buffer_size
);
62 extern void snd_aw2_saa7146_define_it_playback_callback(unsigned int
66 void *p_callback_param
);
67 extern void snd_aw2_saa7146_define_it_capture_callback(unsigned int
71 void *p_callback_param
);
72 extern void snd_aw2_saa7146_pcm_trigger_start_capture(struct snd_aw2_saa7146
73 *chip
, int stream_number
);
74 extern void snd_aw2_saa7146_pcm_trigger_stop_capture(struct snd_aw2_saa7146
75 *chip
, int stream_number
);
77 extern void snd_aw2_saa7146_pcm_trigger_start_playback(struct snd_aw2_saa7146
80 extern void snd_aw2_saa7146_pcm_trigger_stop_playback(struct snd_aw2_saa7146
81 *chip
, int stream_number
);
83 extern irqreturn_t
snd_aw2_saa7146_interrupt(int irq
, void *dev_id
);
84 extern unsigned int snd_aw2_saa7146_get_hw_ptr_playback(struct snd_aw2_saa7146
91 extern unsigned int snd_aw2_saa7146_get_hw_ptr_capture(struct snd_aw2_saa7146
99 extern void snd_aw2_saa7146_use_digital_input(struct snd_aw2_saa7146
*chip
,
102 extern int snd_aw2_saa7146_is_using_digital_input(struct snd_aw2_saa7146