summaryrefslogtreecommitdiff
path: root/peripheral/alsa/config_wm8960.h
blob: c51c9bf71cd30be8aadbadf44f5a267ae3c0fb2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* Copyright (C) 2015 Freescale Semiconductor, Inc. */

#ifndef ANDROID_INCLUDE_IMX_CONFIG_WM8960_H
#define ANDROID_INCLUDE_IMX_CONFIG_WM8960_H

#include "audio_hardware.h"


#define MIXER_WM8960_SPEAKER_VOLUME                 "Speaker Playback Volume"
#define MIXER_WM8960_HEADPHONE_VOLUME               "Headphone Playback Volume"
#define MIXER_WM8960_PLAYBACK_VOLUME                "Playback Volume"

#define MIXER_WM8960_LEFT_OUTPUT_SWITCH             "Left Output Mixer PCM Playback Switch"
#define MIXER_WM8960_RIGHT_OUTPUT_SWITCH            "Right Output Mixer PCM Playback Switch"

#define MIXER_WM8960_CAPTURE_SWITCH                 "Capture Switch"
#define MIXER_WM8960_CAPTURE_VOLUME                 "Capture Volume"

#define MIXER_WM8960_ALC_FUNCTION                   "ALC Function"
#define MIXER_WM8960_LEFT_INPUT_SWITCH              "Left Input Mixer Boost Switch"
#define MIXER_WM8960_ADC_PCM_CAPTURE_VOLUME         "ADC PCM Capture Volume"

#ifdef __BRILLO__
#define MIXER_WM8960_LEFT_INPUT1_SWITCH             "Left Boost Mixer LINPUT1 Switch"
#define MIXER_WM8960_LEFT_INPUT2_SWITCH             "Left Boost Mixer LINPUT2 Switch"
#define MIXER_WM8960_LEFT_INPUT3_SWITCH             "Left Boost Mixer LINPUT3 Switch"
#define MIXER_WM8960_RIGHT_INPUT_SWITCH             "Right Input Mixer Boost Switch"
#define MIXER_WM8960_RIGHT_INPUT1_SWITCH            "Right Boost Mixer LINPUT1 Switch"
#define MIXER_WM8960_RIGHT_INPUT2_SWITCH            "Right Boost Mixer LINPUT2 Switch"
#endif

static struct route_setting speaker_output_wm8960[] = {
    {
        .ctl_name = MIXER_WM8960_LEFT_OUTPUT_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_RIGHT_OUTPUT_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_PLAYBACK_VOLUME,
        .intval = 230,
    },
    {
        .ctl_name = MIXER_WM8960_SPEAKER_VOLUME,
        .intval = 120,
    },
    {
        .ctl_name = MIXER_WM8960_HEADPHONE_VOLUME,
        .intval = 120,
    },
    {
        .ctl_name = NULL,
    },
};

static struct route_setting mm_main_mic_input_wm8960[] = {
    {
        .ctl_name = MIXER_WM8960_ALC_FUNCTION,
        .intval = 3,
    },
    {
        .ctl_name = MIXER_WM8960_LEFT_INPUT_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_ADC_PCM_CAPTURE_VOLUME,
        .intval = 230,
    },
    {
        .ctl_name = MIXER_WM8960_CAPTURE_VOLUME,
        .intval = 60,
    },
#ifdef __BRILLO__
    {
        .ctl_name = MIXER_WM8960_LEFT_INPUT1_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_LEFT_INPUT2_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_LEFT_INPUT3_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_RIGHT_INPUT_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_RIGHT_INPUT1_SWITCH,
        .intval = 1,
    },
    {
        .ctl_name = MIXER_WM8960_RIGHT_INPUT2_SWITCH,
        .intval = 1,
    },
#endif
    {
        .ctl_name = NULL,
    },
};

/* ALSA cards for IMX, these must be defined according different board / kernel config*/
static struct audio_card  wm8960_card = {
    .name = "wm8960-audio",
    .driver_name = "wm8960-audio",
    .supported_out_devices = (AUDIO_DEVICE_OUT_EARPIECE |
            AUDIO_DEVICE_OUT_SPEAKER |
            AUDIO_DEVICE_OUT_WIRED_HEADSET |
            AUDIO_DEVICE_OUT_WIRED_HEADPHONE |
            AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET |
            AUDIO_DEVICE_OUT_ALL_SCO |
            AUDIO_DEVICE_OUT_DEFAULT ),
    .supported_in_devices = (
            AUDIO_DEVICE_IN_COMMUNICATION |
            AUDIO_DEVICE_IN_AMBIENT |
            AUDIO_DEVICE_IN_BUILTIN_MIC |
            AUDIO_DEVICE_IN_WIRED_HEADSET |
            AUDIO_DEVICE_IN_BACK_MIC |
            AUDIO_DEVICE_IN_ALL_SCO |
            AUDIO_DEVICE_IN_DEFAULT),
    .defaults            = NULL,
    .bt_output           = NULL,
    .speaker_output      = speaker_output_wm8960,
    .hs_output           = NULL,
    .earpiece_output     = NULL,
    .vx_hs_mic_input     = NULL,
    .mm_main_mic_input   = mm_main_mic_input_wm8960,
    .vx_main_mic_input   = NULL,
    .mm_hs_mic_input     = NULL,
    .vx_bt_mic_input     = NULL,
    .mm_bt_mic_input     = NULL,
    .card                = 0,
    .out_rate            = 0,
    .out_channels        = 0,
    .out_format          = 0,
    .in_rate             = 0,
    .in_channels         = 0,
    .in_format           = 0,
};

#endif  /* ANDROID_INCLUDE_IMX_CONFIG_WM8960_H */