27 #include <linux/pci.h>
41 #define WRITEREG(value, addr) writel((value), chip->base_addr + (addr))
42 #define READREG(addr) readl(chip->base_addr + (addr))
49 static int snd_aw2_saa7146_get_limit(
int size);
90 unsigned int acon1 = 0;
147 for (i = 0; i < 8; ++
i) {
157 unsigned long period_size,
158 unsigned long buffer_size)
160 unsigned long dw_page, dw_limit;
170 dw_page = (0
L << 11);
182 dw_limit = snd_aw2_saa7146_get_limit(period_size);
183 dw_page |= (dw_limit << 4);
185 if (stream_number == 0) {
196 }
else if (stream_number == 1) {
208 "aw2: snd_aw2_saa7146_pcm_init_playback: "
209 "Substream number is not 0 or 1 -> not managed\n");
215 unsigned long period_size,
216 unsigned long buffer_size)
218 unsigned long dw_page, dw_limit;
228 dw_page = (0
L << 11);
240 dw_limit = snd_aw2_saa7146_get_limit(period_size);
241 dw_page |= (dw_limit << 4);
243 if (stream_number == 0) {
255 "aw2: snd_aw2_saa7146_pcm_init_capture: "
256 "Substream number is not 0 -> not managed\n");
268 arr_substream_it_playback_cb[
stream_number].p_callback_param =
269 (
void *)p_callback_param;
281 arr_substream_it_capture_cb[
stream_number].p_callback_param =
282 (
void *)p_callback_param;
289 unsigned int acon1 = 0;
293 if (stream_number == 0) {
300 }
else if (stream_number == 1) {
312 unsigned int acon1 = 0;
314 if (stream_number == 0) {
320 }
else if (stream_number == 1) {
334 if (stream_number == 0)
341 if (stream_number == 0)
363 if (arr_substream_it_playback_cb[1].p_it_callback !=
NULL) {
364 arr_substream_it_playback_cb[1].
365 p_it_callback(arr_substream_it_playback_cb[1].
370 if (arr_substream_it_playback_cb[0].p_it_callback !=
NULL) {
371 arr_substream_it_playback_cb[0].
372 p_it_callback(arr_substream_it_playback_cb[0].
378 if (arr_substream_it_capture_cb[0].p_it_callback !=
NULL) {
379 arr_substream_it_capture_cb[0].
380 p_it_callback(arr_substream_it_capture_cb[0].
390 unsigned int buffer_size)
395 if (stream_number == 0) {
397 ptr = pci_adp - (
long)start_addr;
399 if (ptr == buffer_size)
402 if (stream_number == 1) {
404 ptr = pci_adp - (
size_t) start_addr;
406 if (ptr == buffer_size)
415 unsigned int buffer_size)
419 if (stream_number == 0) {
421 ptr = pci_adp - (
size_t) start_addr;
423 if (ptr == buffer_size)
447 if ((reg_val & 0xFF) == 0x40)
454 static int snd_aw2_saa7146_get_limit(
int size)
458 while (limitsize < size) {