OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [armnommu/] [drivers/] [sound/] [vidc.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1622 jcastillo
/*
2
 * sound/vidc.c
3
 *
4
 * Detection routine for the VIDC
5
 */
6
/*
7
 * Copyright (C) by Russell King
8
 *
9
 * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
10
 * Version 2 (June 1991). See the "COPYING" file distributed with this software
11
 * for more info.
12
 */
13
#include <linux/config.h>
14
#include <linux/sched.h>
15
#include <linux/mman.h>
16
#include <linux/malloc.h>
17
 
18
#include <asm/io.h>
19
#include <asm/pgtable.h>
20
#include "sound_config.h"
21
 
22
#include "vidc.h"
23
 
24
#if defined(CONFIG_VIDC)
25
 
26
int vidc_busy;
27
 
28
void vidc_update_filler(int format, int channels)
29
{
30
        int filltype;
31
 
32
#define TYPE(fmt,ch) (((fmt)<<2)|((ch)&3))
33
        filltype = TYPE(format,channels);
34
        switch (filltype)
35
        {
36
                default:
37
                case TYPE(AFMT_U8, 1):
38
                        vidc_filler = vidc_fill_1x8_u;
39
                        break;
40
 
41
                case TYPE(AFMT_U8, 2):
42
                        vidc_filler = vidc_fill_2x8_u;
43
                        break;
44
 
45
                case TYPE(AFMT_S8, 1):
46
                        vidc_filler = vidc_fill_1x8_s;
47
                        break;
48
 
49
                case TYPE(AFMT_S8, 2):
50
                        vidc_filler = vidc_fill_2x8_s;
51
                        break;
52
 
53
                case TYPE(AFMT_S16_LE, 1):
54
                        vidc_filler = vidc_fill_1x16_s;
55
                        break;
56
 
57
                case TYPE(AFMT_S16_LE, 2):
58
                        vidc_filler = vidc_fill_2x16_s;
59
                        break;
60
        }
61
}
62
 
63
void
64
attach_vidc (struct address_info *hw_config)
65
{
66
  char name[32];
67
  int i;
68
 
69
  sprintf (name, "VIDCsound: VIDC %d-bit sound", hw_config->card_subtype);
70
  conf_printf (name, hw_config);
71
 
72
  for (i = 0; i < 2; i++) {
73
    dma_buf[i] = get_free_page (GFP_KERNEL);
74
    dma_pbuf[i] = virt_to_phys ((void *)dma_buf[i]);
75
  }
76
 
77
  if (sound_alloc_dma (hw_config->dma, "VIDCsound")) {
78
    printk ("VIDCsound: can't allocate virtual DMA channel\n");
79
    return;
80
  }
81
 
82
  if (snd_set_irq_handler (hw_config->irq, vidc_sound_dma_irq, "VIDCsound", hw_config->osp)) {
83
    printk ("VIDCsound: can't allocate DMA interrupt\n");
84
    return;
85
  }
86
 
87
  vidc_synth_init (hw_config);
88
  vidc_audio_init (hw_config);
89
  vidc_mixer_init (hw_config);
90
}
91
 
92
int
93
probe_vidc (struct address_info *hw_config)
94
{
95
  hw_config->irq = 0x14;
96
  hw_config->dma = DMA_VIRTUAL_SOUND;
97
  hw_config->card_subtype = 16;
98
  return 1;
99
}
100
 
101
void
102
unload_vidc (struct address_info *hw_config)
103
{
104
  snd_release_irq (hw_config->irq);
105
  sound_free_dma (hw_config->dma);
106
}
107
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.