From ec03d5b9f0ec383a962a49558156ddcf4734de59 Mon Sep 17 00:00:00 2001 Message-Id: From: Gerd Hoffmann Date: Mon, 9 Jul 2012 13:20:08 +0200 Subject: [PATCH 1/3] hda: move input widgets from duplex to common RH-Author: Gerd Hoffmann Message-id: <1341840010-30164-2-git-send-email-kraxel@redhat.com> Patchwork-id: 40242 O-Subject: [RHEL-6.4 qemu-kvm PATCH 1/3] hda: move input widgets from duplex to common Bugzilla: 801063 RH-Acked-by: Paolo Bonzini RH-Acked-by: Hans de Goede RH-Acked-by: Laszlo Ersek Preparing for a new user of the input widget definitions. Signed-off-by: Gerd Hoffmann Signed-off-by: malc (cherry picked from commit d0c2bbb9f04925eeda9948586aa382ccf68e26e7) --- hw/hda-audio.c | 100 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 50 insertions(+), 50 deletions(-) Signed-off-by: Michal Novotny --- hw/hda-audio.c | 100 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/hw/hda-audio.c b/hw/hda-audio.c index 3169635..de8aef8 100644 --- a/hw/hda-audio.c +++ b/hw/hda-audio.c @@ -155,6 +155,34 @@ static const desc_param common_params_audio_dac[] = { }, }; +/* common: audio input widget */ +static const desc_param common_params_audio_adc[] = { + { + .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) */ static const desc_param common_params_audio_lineout[] = { { @@ -177,6 +205,24 @@ static const desc_param common_params_audio_lineout[] = { }, }; +/* common: pin widget (line-in) */ +static const desc_param common_params_audio_linein[] = { + { + .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 */ static const desc_param output_params_root[] = { { @@ -287,52 +333,6 @@ static const desc_param duplex_params_root[] = { }, }; -/* duplex: audio input widget */ -static const desc_param duplex_params_audio_adc[] = { - { - .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, - }, -}; - -/* duplex: pin widget (line-in) */ -static const desc_param duplex_params_audio_linein[] = { - { - .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, - }, -}; - /* duplex: audio function */ static const desc_param duplex_params_audio_func[] = { { @@ -401,15 +401,15 @@ static const desc_node duplex_nodes[] = { },{ .nid = 4, .name = "adc", - .params = duplex_params_audio_adc, - .nparams = ARRAY_SIZE(duplex_params_audio_adc), + .params = common_params_audio_adc, + .nparams = ARRAY_SIZE(common_params_audio_adc), .stindex = 1, .conn = (uint32_t[]) { 5 }, },{ .nid = 5, .name = "in", - .params = duplex_params_audio_linein, - .nparams = ARRAY_SIZE(duplex_params_audio_linein), + .params = common_params_audio_linein, + .nparams = ARRAY_SIZE(common_params_audio_linein), .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) | -- 1.7.11.2