summaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-09-05 01:01:31 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2014-09-13 00:42:14 +0200
commit75c83870e51e6bc48a83114c64177432d3204b1f (patch)
tree98284c8843dc1a27a2df4e46b493386934d51a32 /src/mainboard/lenovo
parenta812643723419f4fe3f079731a9d10d2dc083aae (diff)
downloadcoreboot-75c83870e51e6bc48a83114c64177432d3204b1f.tar.xz
azalia: Shrink boilerplate
Change-Id: Ib3e09644c0ee71aacb067adaa85653d151b52078 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/6840 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/mainboard/lenovo')
-rw-r--r--src/mainboard/lenovo/t520/hda_verb.c (renamed from src/mainboard/lenovo/t520/hda_verb.h)9
-rw-r--r--src/mainboard/lenovo/t520/mainboard.c12
-rw-r--r--src/mainboard/lenovo/t530/hda_verb.c (renamed from src/mainboard/lenovo/t530/hda_verb.h)9
-rw-r--r--src/mainboard/lenovo/t530/mainboard.c12
-rw-r--r--src/mainboard/lenovo/t60/hda_verb.c7
-rw-r--r--src/mainboard/lenovo/x200/hda_verb.c (renamed from src/mainboard/lenovo/x200/hda_verb.h)7
-rw-r--r--src/mainboard/lenovo/x200/mainboard.c11
-rw-r--r--src/mainboard/lenovo/x201/hda_verb.c (renamed from src/mainboard/lenovo/x201/hda_verb.h)8
-rw-r--r--src/mainboard/lenovo/x201/mainboard.c9
-rw-r--r--src/mainboard/lenovo/x220/hda_verb.c (renamed from src/mainboard/lenovo/x220/hda_verb.h)9
-rw-r--r--src/mainboard/lenovo/x220/mainboard.c12
-rw-r--r--src/mainboard/lenovo/x230/hda_verb.c (renamed from src/mainboard/lenovo/x230/hda_verb.h)9
-rw-r--r--src/mainboard/lenovo/x230/mainboard.c12
-rw-r--r--src/mainboard/lenovo/x60/hda_verb.c7
14 files changed, 46 insertions, 87 deletions
diff --git a/src/mainboard/lenovo/t520/hda_verb.h b/src/mainboard/lenovo/t520/hda_verb.c
index 19eac1bd67..dd776fc026 100644
--- a/src/mainboard/lenovo/t520/hda_verb.h
+++ b/src/mainboard/lenovo/t520/hda_verb.c
@@ -25,7 +25,9 @@
*/
-static const u32 mainboard_cim_verb_data[] = {
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
/* coreboot specific header */
0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 - Schematic shows CX20672
0x17aa21cf, // Subsystem ID
@@ -181,9 +183,8 @@ static const u32 mainboard_cim_verb_data[] = {
0x00170500, /* Set power state to D0 */
};
-static const u32 mainboard_pc_beep_verbs[] = {
+const u32 pc_beep_verbs[] = {
0x02177a00, /* Digital PCBEEP Gain: 0h=-9db, 1h=-6db ... 4h=+3db, 5h=+6db */
};
-static const u32 mainboard_pc_beep_verbs_size =
- ARRAY_SIZE(mainboard_pc_beep_verbs);
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/t520/mainboard.c b/src/mainboard/lenovo/t520/mainboard.c
index afa0ecf2f7..387bbe0558 100644
--- a/src/mainboard/lenovo/t520/mainboard.c
+++ b/src/mainboard/lenovo/t520/mainboard.c
@@ -37,8 +37,6 @@
#include <cbfs.h>
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
void mainboard_suspend_resume(void)
{
@@ -46,16 +44,7 @@ void mainboard_suspend_resume(void)
outb(0xcb, 0xb2);
}
-/* Audio Setup */
-static void verb_setup(void)
-{
- cim_verb_data = mainboard_cim_verb_data;
- cim_verb_data_size = sizeof(mainboard_cim_verb_data);
- pc_beep_verbs = mainboard_pc_beep_verbs;
- pc_beep_verbs_size = mainboard_pc_beep_verbs_size;
-
-}
static void mainboard_init(device_t dev)
{
@@ -80,7 +69,6 @@ static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
- verb_setup();
}
void h8_mainboard_init_dock (void)
diff --git a/src/mainboard/lenovo/t530/hda_verb.h b/src/mainboard/lenovo/t530/hda_verb.c
index f04eae7e71..29f8a4522b 100644
--- a/src/mainboard/lenovo/t530/hda_verb.h
+++ b/src/mainboard/lenovo/t530/hda_verb.c
@@ -25,7 +25,9 @@
*/
-static const u32 mainboard_cim_verb_data[] = {
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
/* coreboot specific header */
0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC
0x17aa21fa, // Subsystem ID
@@ -243,9 +245,8 @@ static const u32 mainboard_cim_verb_data[] = {
AZALIA_PIN_CFG(0x3, 0x07, 0x18560030)
};
-static const u32 mainboard_pc_beep_verbs[] = {
+const u32 pc_beep_verbs[] = {
0x02177a00, /* Digital PCBEEP Gain: 0h=-9db, 1h=-6db ... 4h=+3db, 5h=+6db */
};
-static const u32 mainboard_pc_beep_verbs_size =
- ARRAY_SIZE(mainboard_pc_beep_verbs);
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/t530/mainboard.c b/src/mainboard/lenovo/t530/mainboard.c
index e21dc982f0..f8c9daee35 100644
--- a/src/mainboard/lenovo/t530/mainboard.c
+++ b/src/mainboard/lenovo/t530/mainboard.c
@@ -37,8 +37,6 @@
#include <cbfs.h>
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
void mainboard_suspend_resume(void)
{
@@ -46,16 +44,7 @@ void mainboard_suspend_resume(void)
outb(0xcb, 0xb2);
}
-/* Audio Setup */
-static void verb_setup(void)
-{
- cim_verb_data = mainboard_cim_verb_data;
- cim_verb_data_size = sizeof(mainboard_cim_verb_data);
- pc_beep_verbs = mainboard_pc_beep_verbs;
- pc_beep_verbs_size = mainboard_pc_beep_verbs_size;
-
-}
static void mainboard_init(device_t dev)
{
@@ -85,7 +74,6 @@ static void mainboard_enable(device_t dev)
dev->ops->init = mainboard_init;
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
- verb_setup();
}
void h8_mainboard_init_dock (void)
diff --git a/src/mainboard/lenovo/t60/hda_verb.c b/src/mainboard/lenovo/t60/hda_verb.c
new file mode 100644
index 0000000000..072a306131
--- /dev/null
+++ b/src/mainboard/lenovo/t60/hda_verb.c
@@ -0,0 +1,7 @@
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[0] = {};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/x200/hda_verb.h b/src/mainboard/lenovo/x200/hda_verb.c
index 3d922589f8..c1cd5422ee 100644
--- a/src/mainboard/lenovo/x200/hda_verb.h
+++ b/src/mainboard/lenovo/x200/hda_verb.c
@@ -18,7 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-static const u32 mainboard_cim_verb_data[] = {
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
/* coreboot specific header */
0x14f15051, // Conexant CX20561 (Hermosa)
0x17aa20ff, // Subsystem ID
@@ -36,7 +38,7 @@ static const u32 mainboard_cim_verb_data[] = {
AZALIA_PIN_CFG(0, 0x1d, 0x90a601f0)
};
-static const u32 mainboard_pc_beep_verbs[] = {
+const u32 pc_beep_verbs[] = {
0x00170500, /* power up codec */
0x01470500, /* power up speakers */
0x01470100, /* select lout1 (input 0x0) for speakers */
@@ -46,3 +48,4 @@ static const u32 mainboard_pc_beep_verbs[] = {
0x00c3b015, /* set lout1 output volume -15dB */
0x0143b000, /* unmute speakers */
};
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/x200/mainboard.c b/src/mainboard/lenovo/x200/mainboard.c
index 6c13eed84f..37bd152e27 100644
--- a/src/mainboard/lenovo/x200/mainboard.c
+++ b/src/mainboard/lenovo/x200/mainboard.c
@@ -32,23 +32,13 @@
#include <ec/lenovo/pmh7/pmh7.h>
#include <ec/acpi/ec.h>
#include <ec/lenovo/h8/h8.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
#if CONFIG_GENERATE_ACPI_TABLES
#include "cstates.c" /* Include it, as the linker won't find
the overloaded weak function in there. */
#endif
-static void verb_setup(void)
-{
- cim_verb_data = mainboard_cim_verb_data;
- cim_verb_data_size = sizeof(mainboard_cim_verb_data);
- pc_beep_verbs = mainboard_pc_beep_verbs;
- pc_beep_verbs_size = ARRAY_SIZE(mainboard_pc_beep_verbs);
-}
-
const char *smbios_mainboard_bios_version(void)
{
/* Satisfy thinkpad_acpi. */
@@ -68,7 +58,6 @@ static void mainboard_init(device_t dev)
static void mainboard_enable(device_t dev)
{
- verb_setup();
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 2);
dev->ops->init = mainboard_init;
diff --git a/src/mainboard/lenovo/x201/hda_verb.h b/src/mainboard/lenovo/x201/hda_verb.c
index 17069292af..22634f05ff 100644
--- a/src/mainboard/lenovo/x201/hda_verb.h
+++ b/src/mainboard/lenovo/x201/hda_verb.c
@@ -18,7 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-static const u32 mainboard_cim_verb_data[] = {
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
/* coreboot specific header */
0x14F15069, /* Codec Vendor / Device ID: Conexant CX20585 */
0x17AA2155, /* Subsystem ID */
@@ -73,3 +75,7 @@ static const u32 mainboard_cim_verb_data[] = {
/* NID 0x06. */
AZALIA_PIN_CFG(0x3, 0x06, 0x58560030),
};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/x201/mainboard.c b/src/mainboard/lenovo/x201/mainboard.c
index fb8c1d5626..57ef86dd2a 100644
--- a/src/mainboard/lenovo/x201/mainboard.c
+++ b/src/mainboard/lenovo/x201/mainboard.c
@@ -35,11 +35,9 @@
#include <ec/lenovo/h8/h8.h>
#include <northbridge/intel/nehalem/nehalem.h>
#include <southbridge/intel/bd82x6x/pch.h>
-#include <device/azalia_device.h>
#include <pc80/mc146818rtc.h>
#include "dock.h"
-#include "hda_verb.h"
#include <arch/x86/include/arch/acpigen.h>
#include <drivers/intel/gma/int15.h>
#include <arch/interrupt.h>
@@ -71,13 +69,7 @@ const char *smbios_mainboard_bios_version(void)
return "CBET4000 " COREBOOT_VERSION;
}
-/* Audio Setup */
-static void verb_setup(void)
-{
- cim_verb_data = mainboard_cim_verb_data;
- cim_verb_data_size = sizeof(mainboard_cim_verb_data);
-}
static void mainboard_init(device_t dev)
{
@@ -155,7 +147,6 @@ static void mainboard_enable(device_t dev)
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_LFP, 2);
- verb_setup();
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/lenovo/x220/hda_verb.h b/src/mainboard/lenovo/x220/hda_verb.c
index ce980fc2a8..c3d1372da7 100644
--- a/src/mainboard/lenovo/x220/hda_verb.h
+++ b/src/mainboard/lenovo/x220/hda_verb.c
@@ -25,7 +25,9 @@
*/
-static const u32 mainboard_cim_verb_data[] = {
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
/* coreboot specific header */
0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590
0x17aa21db, // Subsystem ID
@@ -205,9 +207,8 @@ static const u32 mainboard_cim_verb_data[] = {
AZALIA_PIN_CFG(0x3, 0x07, 0x18560030)
};
-static const u32 mainboard_pc_beep_verbs[] = {
+const u32 pc_beep_verbs[] = {
0x02177a00, /* Digital PCBEEP Gain: 0h=-9db, 1h=-6db ... 4h=+3db, 5h=+6db */
};
-static const u32 mainboard_pc_beep_verbs_size =
- ARRAY_SIZE(mainboard_pc_beep_verbs);
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/x220/mainboard.c b/src/mainboard/lenovo/x220/mainboard.c
index ffc99bd4eb..87fedfe30a 100644
--- a/src/mainboard/lenovo/x220/mainboard.c
+++ b/src/mainboard/lenovo/x220/mainboard.c
@@ -38,8 +38,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
#include <build.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
void mainboard_suspend_resume(void)
{
@@ -56,16 +54,7 @@ const char *smbios_mainboard_bios_version(void)
return "CBET4000 " COREBOOT_VERSION;
}
-/* Audio Setup */
-static void verb_setup(void)
-{
- cim_verb_data = mainboard_cim_verb_data;
- cim_verb_data_size = sizeof(mainboard_cim_verb_data);
- pc_beep_verbs = mainboard_pc_beep_verbs;
- pc_beep_verbs_size = mainboard_pc_beep_verbs_size;
-
-}
static void mainboard_init(device_t dev)
{
@@ -95,7 +84,6 @@ static void mainboard_enable(device_t dev)
dev->ops->init = mainboard_init;
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
- verb_setup();
}
void h8_mainboard_init_dock (void)
diff --git a/src/mainboard/lenovo/x230/hda_verb.h b/src/mainboard/lenovo/x230/hda_verb.c
index f04eae7e71..29f8a4522b 100644
--- a/src/mainboard/lenovo/x230/hda_verb.h
+++ b/src/mainboard/lenovo/x230/hda_verb.c
@@ -25,7 +25,9 @@
*/
-static const u32 mainboard_cim_verb_data[] = {
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[] = {
/* coreboot specific header */
0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC
0x17aa21fa, // Subsystem ID
@@ -243,9 +245,8 @@ static const u32 mainboard_cim_verb_data[] = {
AZALIA_PIN_CFG(0x3, 0x07, 0x18560030)
};
-static const u32 mainboard_pc_beep_verbs[] = {
+const u32 pc_beep_verbs[] = {
0x02177a00, /* Digital PCBEEP Gain: 0h=-9db, 1h=-6db ... 4h=+3db, 5h=+6db */
};
-static const u32 mainboard_pc_beep_verbs_size =
- ARRAY_SIZE(mainboard_pc_beep_verbs);
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/lenovo/x230/mainboard.c b/src/mainboard/lenovo/x230/mainboard.c
index 5da7480492..7d9c4568e2 100644
--- a/src/mainboard/lenovo/x230/mainboard.c
+++ b/src/mainboard/lenovo/x230/mainboard.c
@@ -38,8 +38,6 @@
#include <pc80/keyboard.h>
#include <ec/lenovo/h8/h8.h>
#include <build.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
void mainboard_suspend_resume(void)
{
@@ -56,16 +54,7 @@ const char *smbios_mainboard_bios_version(void)
return "CBET4000 " COREBOOT_VERSION;
}
-/* Audio Setup */
-static void verb_setup(void)
-{
- cim_verb_data = mainboard_cim_verb_data;
- cim_verb_data_size = sizeof(mainboard_cim_verb_data);
- pc_beep_verbs = mainboard_pc_beep_verbs;
- pc_beep_verbs_size = mainboard_pc_beep_verbs_size;
-
-}
static void mainboard_init(device_t dev)
{
@@ -95,7 +84,6 @@ static void mainboard_enable(device_t dev)
dev->ops->init = mainboard_init;
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
- verb_setup();
}
void h8_mainboard_init_dock (void)
diff --git a/src/mainboard/lenovo/x60/hda_verb.c b/src/mainboard/lenovo/x60/hda_verb.c
new file mode 100644
index 0000000000..072a306131
--- /dev/null
+++ b/src/mainboard/lenovo/x60/hda_verb.c
@@ -0,0 +1,7 @@
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[0] = {};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;