summaryrefslogtreecommitdiff
path: root/src/mainboard/samsung
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/samsung
parenta812643723419f4fe3f079731a9d10d2dc083aae (diff)
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/samsung')
-rw-r--r--src/mainboard/samsung/lumpy/hda_verb.c (renamed from src/mainboard/samsung/lumpy/hda_verb.h)9
-rw-r--r--src/mainboard/samsung/lumpy/mainboard.c11
-rw-r--r--src/mainboard/samsung/stumpy/hda_verb.c (renamed from src/mainboard/samsung/stumpy/hda_verb.h)9
-rw-r--r--src/mainboard/samsung/stumpy/mainboard.c11
4 files changed, 10 insertions, 30 deletions
diff --git a/src/mainboard/samsung/lumpy/hda_verb.h b/src/mainboard/samsung/lumpy/hda_verb.c
index 4806b75f5b..7ee254b10c 100644
--- a/src/mainboard/samsung/lumpy/hda_verb.h
+++ b/src/mainboard/samsung/lumpy/hda_verb.c
@@ -17,7 +17,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 */
0x10134210, // Codec Vendor / Device ID: Realtek ALC262
0x144db082, // Subsystem ID
@@ -49,12 +51,11 @@ static const u32 mainboard_cim_verb_data[] = {
AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0)
};
-static const u32 mainboard_pc_beep_verbs[] = {
+const u32 pc_beep_verbs[] = {
0x00170500, /* power up codec */
0x00270500, /* power up DAC */
0x00670500, /* power up speaker */
0x00670740, /* enable speaker output */
0x0023B04B, /* set DAC gain */
};
-static const u32 mainboard_pc_beep_verbs_size =
- ARRAY_SIZE(mainboard_pc_beep_verbs);
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/samsung/lumpy/mainboard.c b/src/mainboard/samsung/lumpy/mainboard.c
index 803761c60a..3bdd4d9815 100644
--- a/src/mainboard/samsung/lumpy/mainboard.c
+++ b/src/mainboard/samsung/lumpy/mainboard.c
@@ -35,8 +35,6 @@
#include "onboard.h"
#include <southbridge/intel/bd82x6x/pch.h>
#include <smbios.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
void mainboard_suspend_resume(void)
{
@@ -48,15 +46,7 @@ void mainboard_suspend_resume(void)
send_ec_command(EC_ACPI_ENABLE);
}
-/* 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)
{
@@ -116,7 +106,6 @@ static void mainboard_enable(device_t dev)
dev->ops->init = mainboard_init;
dev->ops->get_smbios_data = lumpy_onboard_smbios_data;
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
- verb_setup();
}
struct chip_operations mainboard_ops = {
diff --git a/src/mainboard/samsung/stumpy/hda_verb.h b/src/mainboard/samsung/stumpy/hda_verb.c
index 3992eeec04..1949aaa0f5 100644
--- a/src/mainboard/samsung/stumpy/hda_verb.h
+++ b/src/mainboard/samsung/stumpy/hda_verb.c
@@ -17,7 +17,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 */
0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210
0x10134210, // Subsystem ID
@@ -64,12 +66,11 @@ 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[] = {
0x00170500, /* power up codec */
0x00270500, /* power up DAC */
0x00670500, /* power up speaker */
0x00670740, /* enable speaker output */
0x0023B04B, /* set DAC gain */
};
-static const u32 mainboard_pc_beep_verbs_size =
- ARRAY_SIZE(mainboard_pc_beep_verbs);
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/samsung/stumpy/mainboard.c b/src/mainboard/samsung/stumpy/mainboard.c
index d61b808794..347ce8a910 100644
--- a/src/mainboard/samsung/stumpy/mainboard.c
+++ b/src/mainboard/samsung/stumpy/mainboard.c
@@ -32,8 +32,6 @@
#include <arch/interrupt.h>
#include <boot/coreboot_tables.h>
#include <southbridge/intel/bd82x6x/pch.h>
-#include <device/azalia_device.h>
-#include "hda_verb.h"
void mainboard_suspend_resume(void)
{
@@ -41,15 +39,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;
-}
// mainboard_enable is executed as first thing after
// enumerate_buses().
@@ -57,7 +47,6 @@ static void verb_setup(void)
static void mainboard_enable(device_t dev)
{
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
- verb_setup();
}
struct chip_operations mainboard_ops = {