From 75c83870e51e6bc48a83114c64177432d3204b1f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 5 Sep 2014 01:01:31 +0200 Subject: azalia: Shrink boilerplate Change-Id: Ib3e09644c0ee71aacb067adaa85653d151b52078 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/6840 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Edward O'Callaghan --- src/mainboard/kontron/ktqm77/hda_verb.c | 121 +++++++++++++++++++++++++++++++ src/mainboard/kontron/ktqm77/hda_verb.h | 115 ----------------------------- src/mainboard/kontron/ktqm77/mainboard.c | 9 --- 3 files changed, 121 insertions(+), 124 deletions(-) create mode 100644 src/mainboard/kontron/ktqm77/hda_verb.c delete mode 100644 src/mainboard/kontron/ktqm77/hda_verb.h (limited to 'src/mainboard/kontron/ktqm77') diff --git a/src/mainboard/kontron/ktqm77/hda_verb.c b/src/mainboard/kontron/ktqm77/hda_verb.c new file mode 100644 index 0000000000..c957c25fe1 --- /dev/null +++ b/src/mainboard/kontron/ktqm77/hda_verb.c @@ -0,0 +1,121 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012-2013 secunet Security Networks AG + * Copyright (C) 2013 Nico Huber + * + * 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; version 2 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, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x11060397, // Codec Vendor / Device ID: Via VT1708S + 0x11060000, // Subsystem ID + 0x0000000c, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x11060000 */ + AZALIA_SUBVENDOR(0x0, 0x11060000), + + /* Pin Widget Verb Table */ + + /* + * NID 0x19 [Port A (SURR)]: + * Jack Internal Speaker N/A Black + */ + AZALIA_PIN_CFG(0, 0x19, 0x10101112), + + /* + * NID 0x1a [Port B (MIC1/2)]: + * Jack Rear Mic In 1/8" Pink + */ + AZALIA_PIN_CFG(0, 0x1a, 0x01a19036), + + /* + * NID 0x1b [Port C (LINEIN)]: + * Jack Rear Line In 1/8" Blue + */ + AZALIA_PIN_CFG(0, 0x1b, 0x0181303e), + + /* + * NID 0x1c [Port D (Front)]: + * Jack Rear Line Out 1/8" Green + */ + AZALIA_PIN_CFG(0, 0x1c, 0x01014010), + + /* + * NID 0x1d [Port E (Front HP/MIC)]: + * Jack Front HP Out 1/8" Green + */ + AZALIA_PIN_CFG(0, 0x1d, 0x022141f0), + + /* + * NID 0x1e [Port F (Front HP/MIC)]: + * Jack Front Mic In 1/8" Pink + */ + AZALIA_PIN_CFG(0, 0x1e, 0x02a19138), + + /* + * NID 0x1f [CD]: + * Jack Int.(ATAPI) CD ATAPI internal Black + */ + AZALIA_PIN_CFG(0, 0x1f, 0x19331137), + + /* + * NID 0x20 [N/A]: + * Jack Rear S/PDIF Out RCA Unknown + */ + AZALIA_PIN_CFG(0, 0x20, 0x014401f0), + + /* + * NID 0x21 [N/A]: + * None Internal S/PDIF Out Other Digital Unknown + */ + AZALIA_PIN_CFG(0, 0x21, 0x504600f0), + + /* + * NID 0x22 [Port G (C/LFE)]: + * Jack Internal Speaker Unknown Orange + */ + AZALIA_PIN_CFG(0, 0x22, 0x10106111), + + /* + * NID 0x23 [Port H (SSL/SSR)]: + * Jack Internal Speaker Unknown Grey + */ + AZALIA_PIN_CFG(0, 0x23, 0x10102114), + + + /* coreboot specific header */ + 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI + 0x80860101, // Subsystem ID + 0x00000004, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ + AZALIA_SUBVENDOR(0x0, 0x80860101), + + /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x05, 0x58560010), + + /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), + + /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/kontron/ktqm77/hda_verb.h b/src/mainboard/kontron/ktqm77/hda_verb.h deleted file mode 100644 index ccec18c752..0000000000 --- a/src/mainboard/kontron/ktqm77/hda_verb.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2012-2013 secunet Security Networks AG - * Copyright (C) 2013 Nico Huber - * - * 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; version 2 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x11060397, // Codec Vendor / Device ID: Via VT1708S - 0x11060000, // Subsystem ID - 0x0000000c, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x11060000 */ - AZALIA_SUBVENDOR(0x0, 0x11060000), - - /* Pin Widget Verb Table */ - - /* - * NID 0x19 [Port A (SURR)]: - * Jack Internal Speaker N/A Black - */ - AZALIA_PIN_CFG(0, 0x19, 0x10101112), - - /* - * NID 0x1a [Port B (MIC1/2)]: - * Jack Rear Mic In 1/8" Pink - */ - AZALIA_PIN_CFG(0, 0x1a, 0x01a19036), - - /* - * NID 0x1b [Port C (LINEIN)]: - * Jack Rear Line In 1/8" Blue - */ - AZALIA_PIN_CFG(0, 0x1b, 0x0181303e), - - /* - * NID 0x1c [Port D (Front)]: - * Jack Rear Line Out 1/8" Green - */ - AZALIA_PIN_CFG(0, 0x1c, 0x01014010), - - /* - * NID 0x1d [Port E (Front HP/MIC)]: - * Jack Front HP Out 1/8" Green - */ - AZALIA_PIN_CFG(0, 0x1d, 0x022141f0), - - /* - * NID 0x1e [Port F (Front HP/MIC)]: - * Jack Front Mic In 1/8" Pink - */ - AZALIA_PIN_CFG(0, 0x1e, 0x02a19138), - - /* - * NID 0x1f [CD]: - * Jack Int.(ATAPI) CD ATAPI internal Black - */ - AZALIA_PIN_CFG(0, 0x1f, 0x19331137), - - /* - * NID 0x20 [N/A]: - * Jack Rear S/PDIF Out RCA Unknown - */ - AZALIA_PIN_CFG(0, 0x20, 0x014401f0), - - /* - * NID 0x21 [N/A]: - * None Internal S/PDIF Out Other Digital Unknown - */ - AZALIA_PIN_CFG(0, 0x21, 0x504600f0), - - /* - * NID 0x22 [Port G (C/LFE)]: - * Jack Internal Speaker Unknown Orange - */ - AZALIA_PIN_CFG(0, 0x22, 0x10106111), - - /* - * NID 0x23 [Port H (SSL/SSR)]: - * Jack Internal Speaker Unknown Grey - */ - AZALIA_PIN_CFG(0, 0x23, 0x10102114), - - - /* coreboot specific header */ - 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI - 0x80860101, // Subsystem ID - 0x00000004, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ - AZALIA_SUBVENDOR(0x0, 0x80860101), - - /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x05, 0x58560010), - - /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), - - /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) -}; diff --git a/src/mainboard/kontron/ktqm77/mainboard.c b/src/mainboard/kontron/ktqm77/mainboard.c index c09082aa5a..715ec5621c 100644 --- a/src/mainboard/kontron/ktqm77/mainboard.c +++ b/src/mainboard/kontron/ktqm77/mainboard.c @@ -34,8 +34,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -169,13 +167,7 @@ static int int15_handler(void) } #endif -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -186,7 +178,6 @@ static void mainboard_enable(device_t dev) /* Install custom int15 handler for VGA OPROM */ mainboard_interrupt_handlers(0x15, &int15_handler); #endif - verb_setup(); unsigned disable = 0; if ((get_option(&disable, "ethernet1") == CB_SUCCESS) && disable) { -- cgit v1.2.3