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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [sound/] [ad1848_mixer.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 * sound/ad1848_mixer.h
3
 *
4
 * Definitions for the mixer of AD1848 and compatible codecs.
5
 */
6
 
7
/*
8
 * Copyright (C) by Hannu Savolainen 1993-1996
9
 *
10
 * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
11
 * Version 2 (June 1991). See the "COPYING" file distributed with this software
12
 * for more info.
13
 */
14
 
15
 
16
/*
17
 * The AD1848 codec has generic input lines called Line, Aux1 and Aux2.
18
 * Soundcard manufacturers have connected actual inputs (CD, synth, line,
19
 * etc) to these inputs in different order. Therefore it's difficult
20
 * to assign mixer channels to these inputs correctly. The following
21
 * contains two alternative mappings. The first one is for GUS MAX and
22
 * the second is just a generic one (line1, line2 and line3).
23
 * (Actually this is not a mapping but rather some kind of interleaving
24
 * solution).
25
 */
26
#define MODE1_REC_DEVICES               (SOUND_MASK_LINE3 | SOUND_MASK_MIC | \
27
                                         SOUND_MASK_LINE1|SOUND_MASK_IMIX)
28
 
29
#define MODE1_MIXER_DEVICES             (SOUND_MASK_LINE1 | SOUND_MASK_MIC | \
30
                                         SOUND_MASK_LINE2 | \
31
                                         SOUND_MASK_IGAIN | \
32
                                         SOUND_MASK_PCM | SOUND_MASK_IMIX)
33
 
34
#define MODE2_MIXER_DEVICES             (SOUND_MASK_LINE1 | SOUND_MASK_LINE2 | SOUND_MASK_MIC | \
35
                                         SOUND_MASK_LINE3 | SOUND_MASK_SPEAKER | \
36
                                         SOUND_MASK_IGAIN | \
37
                                         SOUND_MASK_PCM | SOUND_MASK_IMIX)
38
 
39
#define MODE3_MIXER_DEVICES             (MODE2_MIXER_DEVICES | SOUND_MASK_VOLUME)
40
 
41
struct mixer_def {
42
        unsigned int regno: 7;
43
        unsigned int polarity:1;        /* 0=normal, 1=reversed */
44
        unsigned int bitpos:4;
45
        unsigned int nbits:4;
46
};
47
 
48
static char mix_cvt[101] = {
49
        0, 0,3,7,10,13,16,19,21,23,26,28,30,32,34,35,37,39,40,42,
50
        43,45,46,47,49,50,51,52,53,55,56,57,58,59,60,61,62,63,64,65,
51
        65,66,67,68,69,70,70,71,72,73,73,74,75,75,76,77,77,78,79,79,
52
        80,81,81,82,82,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,
53
        91,91,92,92,93,93,94,94,95,95,96,96,96,97,97,98,98,98,99,99,
54
        100
55
};
56
 
57
typedef struct mixer_def mixer_ent;
58
 
59
/*
60
 * Most of the mixer entries work in backwards. Setting the polarity field
61
 * makes them to work correctly.
62
 *
63
 * The channel numbering used by individual soundcards is not fixed. Some
64
 * cards have assigned different meanings for the AUX1, AUX2 and LINE inputs.
65
 * The current version doesn't try to compensate this.
66
 */
67
 
68
#define MIX_ENT(name, reg_l, pola_l, pos_l, len_l, reg_r, pola_r, pos_r, len_r) \
69
        {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r}}
70
 
71
mixer_ent mix_devices[32][2] = {
72
MIX_ENT(SOUND_MIXER_VOLUME,     27, 1, 0, 4,     29, 1, 0, 4),
73
MIX_ENT(SOUND_MIXER_BASS,        0, 0, 0, 0,         0, 0, 0, 0),
74
MIX_ENT(SOUND_MIXER_TREBLE,      0, 0, 0, 0,         0, 0, 0, 0),
75
MIX_ENT(SOUND_MIXER_SYNTH,       4, 1, 0, 5,      5, 1, 0, 5),
76
MIX_ENT(SOUND_MIXER_PCM,         6, 1, 0, 6,      7, 1, 0, 6),
77
MIX_ENT(SOUND_MIXER_SPEAKER,    26, 1, 0, 4,      0, 0, 0, 0),
78
MIX_ENT(SOUND_MIXER_LINE,       18, 1, 0, 5,     19, 1, 0, 5),
79
MIX_ENT(SOUND_MIXER_MIC,         0, 0, 5, 1,       1, 0, 5, 1),
80
MIX_ENT(SOUND_MIXER_CD,          2, 1, 0, 5,      3, 1, 0, 5),
81
MIX_ENT(SOUND_MIXER_IMIX,       13, 1, 2, 6,     0, 0, 0, 0),
82
MIX_ENT(SOUND_MIXER_ALTPCM,      0, 0, 0, 0,         0, 0, 0, 0),
83
MIX_ENT(SOUND_MIXER_RECLEV,      0, 0, 0, 0,         0, 0, 0, 0),
84
MIX_ENT(SOUND_MIXER_IGAIN,       0, 0, 0, 4,        1, 0, 0, 4),
85
MIX_ENT(SOUND_MIXER_OGAIN,       0, 0, 0, 0,         0, 0, 0, 0),
86
MIX_ENT(SOUND_MIXER_LINE1,       2, 1, 0, 5,      3, 1, 0, 5),
87
MIX_ENT(SOUND_MIXER_LINE2,       4, 1, 0, 5,      5, 1, 0, 5),
88
MIX_ENT(SOUND_MIXER_LINE3,      18, 1, 0, 5,     19, 1, 0, 5)
89
};
90
 
91
static unsigned short default_mixer_levels[SOUND_MIXER_NRDEVICES] =
92
{
93
  0x3232,                       /* Master Volume */
94
  0x3232,                       /* Bass */
95
  0x3232,                       /* Treble */
96
  0x4b4b,                       /* FM */
97
  0x3232,                       /* PCM */
98
  0x4b4b,                       /* PC Speaker */
99
  0x2020,                       /* Ext Line */
100
  0x1010,                       /* Mic */
101
  0x4b4b,                       /* CD */
102
  0x0000,                       /* Recording monitor */
103
  0x4b4b,                       /* SB PCM */
104
  0x4b4b,                       /* Recording level */
105
  0x4b4b,                       /* Input gain */
106
  0x4b4b,                       /* Output gain */
107
  0x4040,                       /* Line1 */
108
  0x4040,                       /* Line2 */
109
  0x1515                        /* Line3 (usually line in)*/
110
};
111
 
112
#define LEFT_CHN        0
113
#define RIGHT_CHN       1

powered by: WebSVN 2.1.0

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