~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to kernel/drv/oss_audiocs/cs4231_mixer.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Purpose: Definitions for the mixer of cs4231.
 
3
 */
 
4
 
 
5
/*
 
6
 *
 
7
 * This file is part of Open Sound System.
 
8
 *
 
9
 * Copyright (C) 4Front Technologies 1996-2008.
 
10
 *
 
11
 * This this source file is released under GPL v2 license (no other versions).
 
12
 * See the COPYING file included in the main directory of this source
 
13
 * distribution for the license terms and conditions.
 
14
 *
 
15
 */
 
16
 
 
17
#define MODE2_MIXER_DEVICES             (SOUND_MASK_LINE1 | SOUND_MASK_LINE2 | \
 
18
                                         SOUND_MASK_MIC | \
 
19
                                         SOUND_MASK_LINE | SOUND_MASK_SPEAKER | \
 
20
                                         SOUND_MASK_IGAIN | \
 
21
                                         SOUND_MASK_PCM | SOUND_MASK_IMIX)
 
22
 
 
23
#define MODE2_REC_DEVICES               (SOUND_MASK_LINE | SOUND_MASK_MIC | \
 
24
                                         SOUND_MASK_LINE1|SOUND_MASK_IMIX)
 
25
 
 
26
struct mixer_def
 
27
{
 
28
  unsigned int regno;
 
29
  unsigned int polarity;        /* 0=normal, 1=reversed */
 
30
  unsigned int bitpos;
 
31
  unsigned int nbits;
 
32
  unsigned int mutepos;
 
33
};
 
34
 
 
35
typedef struct mixer_def mixer_ent;
 
36
typedef mixer_ent mixer_ents[2];
 
37
 
 
38
/*
 
39
 * Most of the mixer entries work in backwards. Setting the polarity field
 
40
 * makes them to work correctly.
 
41
 *
 
42
 * The channel numbering used by individual soundcards is not fixed. Some
 
43
 * cards have assigned different meanings for the AUX1, AUX2 and LINE inputs.
 
44
 * The current version doesn't try to compensate this.
 
45
 */
 
46
 
 
47
#define MIX_ENT(name, reg_l, pola_l, pos_l, len_l, reg_r, pola_r, pos_r, len_r, mute_bit)       \
 
48
        {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r, mute_bit}}
 
49
 
 
50
static mixer_ents cs4231_mix_devices[32] = {
 
51
  MIX_ENT (SOUND_MIXER_VOLUME, 27, 1, 0, 4, 29, 1, 0, 4, 7),
 
52
  MIX_ENT (SOUND_MIXER_BASS, 0, 0, 0, 0, 0, 0, 0, 0, 8),
 
53
  MIX_ENT (SOUND_MIXER_TREBLE, 0, 0, 0, 0, 0, 0, 0, 0, 8),
 
54
  MIX_ENT (SOUND_MIXER_SYNTH, 4, 1, 0, 5, 5, 1, 0, 5, 7),
 
55
  MIX_ENT (SOUND_MIXER_PCM, 6, 1, 0, 6, 7, 1, 0, 6, 7),
 
56
  MIX_ENT (SOUND_MIXER_SPEAKER, 26, 1, 0, 4, 0, 0, 0, 0, 8),
 
57
  MIX_ENT (SOUND_MIXER_LINE, 18, 1, 0, 5, 19, 1, 0, 5, 7),
 
58
  MIX_ENT (SOUND_MIXER_MIC, 0, 0, 5, 1, 1, 0, 5, 1, 8),
 
59
  MIX_ENT (SOUND_MIXER_CD, 2, 1, 0, 5, 3, 1, 0, 5, 7),
 
60
  MIX_ENT (SOUND_MIXER_IMIX, 13, 1, 2, 6, 0, 0, 0, 0, 8),
 
61
  MIX_ENT (SOUND_MIXER_ALTPCM, 0, 0, 0, 0, 0, 0, 0, 0, 8),
 
62
  MIX_ENT (SOUND_MIXER_RECLEV, 0, 0, 0, 0, 0, 0, 0, 0, 8),
 
63
  MIX_ENT (SOUND_MIXER_IGAIN, 0, 0, 0, 4, 1, 0, 0, 4, 8),
 
64
  MIX_ENT (SOUND_MIXER_OGAIN, 0, 0, 0, 0, 0, 0, 0, 0, 8),
 
65
  MIX_ENT (SOUND_MIXER_LINE1, 2, 1, 0, 5, 3, 1, 0, 5, 7),
 
66
  MIX_ENT (SOUND_MIXER_LINE2, 4, 1, 0, 5, 5, 1, 0, 5, 7),
 
67
  MIX_ENT (SOUND_MIXER_LINE, 18, 1, 0, 5, 19, 1, 0, 5, 7)
 
68
};
 
69
 
 
70
static int default_mixer_levels[32] = {
 
71
  0x3232,                       /* Master Volume */
 
72
  0x3232,                       /* Bass */
 
73
  0x3232,                       /* Treble */
 
74
  0x4b4b,                       /* FM */
 
75
  0x3232,                       /* PCM */
 
76
  0x1515,                       /* PC Speaker */
 
77
  0x2020,                       /* Line in */
 
78
  0x2020,                       /* Mic */
 
79
  0x4b4b,                       /* CD */
 
80
  0x0000,                       /* Recording monitor */
 
81
  0x4b4b,                       /* Second PCM */
 
82
  0x4b4b,                       /* Recording level */
 
83
  0x0000,                       /* Input gain */
 
84
  0x4b4b,                       /* Output gain */
 
85
  0x2020,                       /* Line1 */
 
86
  0x2020,                       /* Line2 */
 
87
  0x1515                        /* Line3 (usually line in) */
 
88
};
 
89
 
 
90
#define LEFT_CHN        0
 
91
#define RIGHT_CHN       1
 
92
 
 
93
/*
 
94
 * Channel enable bits for ioctl(SOUND_MIXER_PRIVATE1)
 
95
 */
 
96
 
 
97
#ifndef AUDIO_SPEAKER
 
98
#define AUDIO_SPEAKER           0x01    /* Enable mono output */
 
99
#define AUDIO_HEADPHONE         0x02    /* Sparc only */
 
100
#define AUDIO_LINE_OUT          0x04    /* Sparc only */
 
101
#endif