2013-09-07 04:53:58 +00:00
|
|
|
/*
|
|
|
|
* Common code to disable/enable mixer emulation at run time
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* Written by Bandan Das <bsd@redhat.com>
|
|
|
|
* with important bits picked up from hda-codec.c
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 or
|
|
|
|
* (at your option) version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* HDA codec descriptions
|
|
|
|
*/
|
|
|
|
|
2013-09-07 04:53:59 +00:00
|
|
|
#ifdef HDA_MIXER
|
2013-09-07 04:53:58 +00:00
|
|
|
#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x12)
|
|
|
|
#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x22)
|
|
|
|
#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x32)
|
|
|
|
#define QEMU_HDA_AMP_CAPS \
|
|
|
|
(AC_AMPCAP_MUTE | \
|
|
|
|
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT) | \
|
|
|
|
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) | \
|
|
|
|
(3 << AC_AMPCAP_STEP_SIZE_SHIFT))
|
|
|
|
#else
|
|
|
|
#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x11)
|
|
|
|
#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x21)
|
|
|
|
#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x31)
|
|
|
|
#define QEMU_HDA_AMP_CAPS QEMU_HDA_AMP_NONE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* common: audio output widget */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(common_params_audio_dac_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_AUDIO_WIDGET_CAP,
|
|
|
|
.val = ((AC_WID_AUD_OUT << AC_WCAP_TYPE_SHIFT) |
|
|
|
|
AC_WCAP_FORMAT_OVRD |
|
|
|
|
AC_WCAP_AMP_OVRD |
|
|
|
|
AC_WCAP_OUT_AMP |
|
|
|
|
AC_WCAP_STEREO),
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PCM,
|
|
|
|
.val = QEMU_HDA_PCM_FORMATS,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_STREAM,
|
|
|
|
.val = AC_SUPFMT_PCM,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_CAPS,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* common: audio input widget */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(common_params_audio_adc_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_AUDIO_WIDGET_CAP,
|
|
|
|
.val = ((AC_WID_AUD_IN << AC_WCAP_TYPE_SHIFT) |
|
|
|
|
AC_WCAP_CONN_LIST |
|
|
|
|
AC_WCAP_FORMAT_OVRD |
|
|
|
|
AC_WCAP_AMP_OVRD |
|
|
|
|
AC_WCAP_IN_AMP |
|
|
|
|
AC_WCAP_STEREO),
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_CONNLIST_LEN,
|
|
|
|
.val = 1,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PCM,
|
|
|
|
.val = QEMU_HDA_PCM_FORMATS,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_STREAM,
|
|
|
|
.val = AC_SUPFMT_PCM,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_CAPS,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* common: pin widget (line-out) */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(common_params_audio_lineout_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_AUDIO_WIDGET_CAP,
|
|
|
|
.val = ((AC_WID_PIN << AC_WCAP_TYPE_SHIFT) |
|
|
|
|
AC_WCAP_CONN_LIST |
|
|
|
|
AC_WCAP_STEREO),
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PIN_CAP,
|
|
|
|
.val = AC_PINCAP_OUT,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_CONNLIST_LEN,
|
|
|
|
.val = 1,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* common: pin widget (line-in) */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(common_params_audio_linein_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_AUDIO_WIDGET_CAP,
|
|
|
|
.val = ((AC_WID_PIN << AC_WCAP_TYPE_SHIFT) |
|
|
|
|
AC_WCAP_STEREO),
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PIN_CAP,
|
|
|
|
.val = AC_PINCAP_IN,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* output: root node */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(output_params_root_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_VENDOR_ID,
|
|
|
|
.val = QEMU_HDA_ID_OUTPUT,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_SUBSYSTEM_ID,
|
|
|
|
.val = QEMU_HDA_ID_OUTPUT,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_REV_ID,
|
|
|
|
.val = 0x00100101,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_NODE_COUNT,
|
|
|
|
.val = 0x00010001,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* output: audio function */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(output_params_audio_func_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_FUNCTION_TYPE,
|
|
|
|
.val = AC_GRP_AUDIO_FUNCTION,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_SUBSYSTEM_ID,
|
|
|
|
.val = QEMU_HDA_ID_OUTPUT,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_NODE_COUNT,
|
|
|
|
.val = 0x00020002,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PCM,
|
|
|
|
.val = QEMU_HDA_PCM_FORMATS,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_STREAM,
|
|
|
|
.val = AC_SUPFMT_PCM,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_GPIO_CAP,
|
|
|
|
.val = 0,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AUDIO_FG_CAP,
|
|
|
|
.val = 0x00000808,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_POWER_STATE,
|
|
|
|
.val = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* output: nodes */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_node glue(output_nodes_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.nid = AC_NODE_ROOT,
|
|
|
|
.name = "root",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(output_params_root_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(output_params_root_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
},{
|
|
|
|
.nid = 1,
|
|
|
|
.name = "func",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(output_params_audio_func_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(output_params_audio_func_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
},{
|
|
|
|
.nid = 2,
|
|
|
|
.name = "dac",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_dac_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_dac_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.stindex = 0,
|
|
|
|
},{
|
|
|
|
.nid = 3,
|
|
|
|
.name = "out",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_lineout_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
|
|
|
|
(AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
|
|
|
|
(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
|
|
|
|
(AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
|
|
|
|
0x10),
|
|
|
|
.pinctl = AC_PINCTL_OUT_EN,
|
|
|
|
.conn = (uint32_t[]) { 2 },
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* output: codec */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_codec glue(output_, PARAM) = {
|
2013-09-07 04:53:58 +00:00
|
|
|
.name = "output",
|
|
|
|
.iid = QEMU_HDA_ID_OUTPUT,
|
2013-09-07 04:53:59 +00:00
|
|
|
.nodes = glue(output_nodes_, PARAM),
|
|
|
|
.nnodes = ARRAY_SIZE(glue(output_nodes_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* duplex: root node */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(duplex_params_root_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_VENDOR_ID,
|
|
|
|
.val = QEMU_HDA_ID_DUPLEX,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_SUBSYSTEM_ID,
|
|
|
|
.val = QEMU_HDA_ID_DUPLEX,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_REV_ID,
|
|
|
|
.val = 0x00100101,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_NODE_COUNT,
|
|
|
|
.val = 0x00010001,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* duplex: audio function */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(duplex_params_audio_func_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_FUNCTION_TYPE,
|
|
|
|
.val = AC_GRP_AUDIO_FUNCTION,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_SUBSYSTEM_ID,
|
|
|
|
.val = QEMU_HDA_ID_DUPLEX,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_NODE_COUNT,
|
|
|
|
.val = 0x00020004,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PCM,
|
|
|
|
.val = QEMU_HDA_PCM_FORMATS,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_STREAM,
|
|
|
|
.val = AC_SUPFMT_PCM,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_GPIO_CAP,
|
|
|
|
.val = 0,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AUDIO_FG_CAP,
|
|
|
|
.val = 0x00000808,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_POWER_STATE,
|
|
|
|
.val = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* duplex: nodes */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_node glue(duplex_nodes_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.nid = AC_NODE_ROOT,
|
|
|
|
.name = "root",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(duplex_params_root_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(duplex_params_root_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
},{
|
|
|
|
.nid = 1,
|
|
|
|
.name = "func",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(duplex_params_audio_func_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(duplex_params_audio_func_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
},{
|
|
|
|
.nid = 2,
|
|
|
|
.name = "dac",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_dac_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_dac_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.stindex = 0,
|
|
|
|
},{
|
|
|
|
.nid = 3,
|
|
|
|
.name = "out",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_lineout_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
|
|
|
|
(AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
|
|
|
|
(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
|
|
|
|
(AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
|
|
|
|
0x10),
|
|
|
|
.pinctl = AC_PINCTL_OUT_EN,
|
|
|
|
.conn = (uint32_t[]) { 2 },
|
|
|
|
},{
|
|
|
|
.nid = 4,
|
|
|
|
.name = "adc",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_adc_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_adc_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.stindex = 1,
|
|
|
|
.conn = (uint32_t[]) { 5 },
|
|
|
|
},{
|
|
|
|
.nid = 5,
|
|
|
|
.name = "in",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_linein_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_linein_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
|
|
|
|
(AC_JACK_LINE_IN << AC_DEFCFG_DEVICE_SHIFT) |
|
|
|
|
(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
|
|
|
|
(AC_JACK_COLOR_RED << AC_DEFCFG_COLOR_SHIFT) |
|
|
|
|
0x20),
|
|
|
|
.pinctl = AC_PINCTL_IN_EN,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* duplex: codec */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_codec glue(duplex_, PARAM) = {
|
2013-09-07 04:53:58 +00:00
|
|
|
.name = "duplex",
|
|
|
|
.iid = QEMU_HDA_ID_DUPLEX,
|
2013-09-07 04:53:59 +00:00
|
|
|
.nodes = glue(duplex_nodes_, PARAM),
|
|
|
|
.nnodes = ARRAY_SIZE(glue(duplex_nodes_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* micro: root node */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(micro_params_root_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_VENDOR_ID,
|
|
|
|
.val = QEMU_HDA_ID_MICRO,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_SUBSYSTEM_ID,
|
|
|
|
.val = QEMU_HDA_ID_MICRO,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_REV_ID,
|
|
|
|
.val = 0x00100101,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_NODE_COUNT,
|
|
|
|
.val = 0x00010001,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* micro: audio function */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_param glue(micro_params_audio_func_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.id = AC_PAR_FUNCTION_TYPE,
|
|
|
|
.val = AC_GRP_AUDIO_FUNCTION,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_SUBSYSTEM_ID,
|
|
|
|
.val = QEMU_HDA_ID_MICRO,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_NODE_COUNT,
|
|
|
|
.val = 0x00020004,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_PCM,
|
|
|
|
.val = QEMU_HDA_PCM_FORMATS,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_STREAM,
|
|
|
|
.val = AC_SUPFMT_PCM,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_IN_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AMP_OUT_CAP,
|
|
|
|
.val = QEMU_HDA_AMP_NONE,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_GPIO_CAP,
|
|
|
|
.val = 0,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_AUDIO_FG_CAP,
|
|
|
|
.val = 0x00000808,
|
|
|
|
},{
|
|
|
|
.id = AC_PAR_POWER_STATE,
|
|
|
|
.val = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* micro: nodes */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_node glue(micro_nodes_, PARAM)[] = {
|
2013-09-07 04:53:58 +00:00
|
|
|
{
|
|
|
|
.nid = AC_NODE_ROOT,
|
|
|
|
.name = "root",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(micro_params_root_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(micro_params_root_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
},{
|
|
|
|
.nid = 1,
|
|
|
|
.name = "func",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(micro_params_audio_func_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(micro_params_audio_func_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
},{
|
|
|
|
.nid = 2,
|
|
|
|
.name = "dac",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_dac_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_dac_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.stindex = 0,
|
|
|
|
},{
|
|
|
|
.nid = 3,
|
|
|
|
.name = "out",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_lineout_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
|
|
|
|
(AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT) |
|
|
|
|
(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
|
|
|
|
(AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
|
|
|
|
0x10),
|
|
|
|
.pinctl = AC_PINCTL_OUT_EN,
|
|
|
|
.conn = (uint32_t[]) { 2 },
|
|
|
|
},{
|
|
|
|
.nid = 4,
|
|
|
|
.name = "adc",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_adc_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_adc_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.stindex = 1,
|
|
|
|
.conn = (uint32_t[]) { 5 },
|
|
|
|
},{
|
|
|
|
.nid = 5,
|
|
|
|
.name = "in",
|
2013-09-07 04:53:59 +00:00
|
|
|
.params = glue(common_params_audio_linein_, PARAM),
|
|
|
|
.nparams = ARRAY_SIZE(glue(common_params_audio_linein_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
.config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
|
|
|
|
(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT) |
|
|
|
|
(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
|
|
|
|
(AC_JACK_COLOR_RED << AC_DEFCFG_COLOR_SHIFT) |
|
|
|
|
0x20),
|
|
|
|
.pinctl = AC_PINCTL_IN_EN,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* micro: codec */
|
2013-09-07 04:53:59 +00:00
|
|
|
static const desc_codec glue(micro_, PARAM) = {
|
2013-09-07 04:53:58 +00:00
|
|
|
.name = "micro",
|
|
|
|
.iid = QEMU_HDA_ID_MICRO,
|
2013-09-07 04:53:59 +00:00
|
|
|
.nodes = glue(micro_nodes_, PARAM),
|
|
|
|
.nnodes = ARRAY_SIZE(glue(micro_nodes_, PARAM)),
|
2013-09-07 04:53:58 +00:00
|
|
|
};
|
2013-09-07 04:53:59 +00:00
|
|
|
|
|
|
|
#undef PARAM
|
|
|
|
#undef HDA_MIXER
|
|
|
|
#undef QEMU_HDA_ID_OUTPUT
|
|
|
|
#undef QEMU_HDA_ID_DUPLEX
|
|
|
|
#undef QEMU_HDA_ID_MICRO
|
|
|
|
#undef QEMU_HDA_AMP_CAPS
|