2013-08-12 14:07:47 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 DMP Electronics Inc.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DEVICE_AZALIA_H
|
|
|
|
#define DEVICE_AZALIA_H
|
|
|
|
|
2014-09-05 01:01:31 +02:00
|
|
|
#include <types.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <console/console.h>
|
|
|
|
#include <arch/acpi.h>
|
|
|
|
#include <arch/io.h>
|
|
|
|
#include <arch/interrupt.h>
|
|
|
|
|
2013-08-12 14:07:47 +02:00
|
|
|
#include <device/device.h>
|
|
|
|
|
|
|
|
void azalia_audio_init(struct device *dev);
|
|
|
|
extern struct device_operations default_azalia_audio_ops;
|
|
|
|
|
2014-09-05 01:01:31 +02:00
|
|
|
extern const u32 cim_verb_data[];
|
|
|
|
extern const u32 cim_verb_data_size;
|
|
|
|
extern const u32 pc_beep_verbs[];
|
|
|
|
extern const u32 pc_beep_verbs_size;
|
|
|
|
|
2017-03-08 02:45:12 +01:00
|
|
|
#define AZALIA_ARRAY_SIZES const u32 pc_beep_verbs_size = \
|
|
|
|
ARRAY_SIZE(pc_beep_verbs); \
|
2014-09-05 01:01:31 +02:00
|
|
|
const u32 cim_verb_data_size = sizeof(cim_verb_data)
|
2014-08-17 23:48:42 +02:00
|
|
|
|
2017-03-08 02:45:12 +01:00
|
|
|
#define AZALIA_PIN_CFG(codec, pin, val) \
|
|
|
|
(((codec) << 28) | ((pin) << 20) | (0x71c << 8) \
|
|
|
|
| ((val) & 0xff)), \
|
|
|
|
(((codec) << 28) | ((pin) << 20) | (0x71d << 8) \
|
|
|
|
| (((val) >> 8) & 0xff)), \
|
|
|
|
(((codec) << 28) | ((pin) << 20) | (0x71e << 8) \
|
|
|
|
| (((val) >> 16) & 0xff)), \
|
|
|
|
(((codec) << 28) | ((pin) << 20) | (0x71f << 8) \
|
|
|
|
| (((val) >> 24) & 0xff))
|
2014-09-04 21:34:13 +02:00
|
|
|
|
|
|
|
#define AZALIA_SUBVENDOR(codec, val) \
|
src/include: Add parenthesis around macros
Fix the following error found by checkpatch.pl:
ERROR: Macros with complex values should be enclosed in parentheses
False positives are detected for attribute macros. An example is:
ERROR: Macros with complex values should be enclosed in parentheses
+#define BOOT_STATE_INIT_ATTR __attribute__ ((used, section
(".bs_init")))
False positive also generated for macros for linker script files. An
example is:
ERROR: Macros with complex values should be enclosed in parentheses
+#define CBFS_CACHE(addr, size) \
+ REGION(cbfs_cache, addr, size, 4) \
+ ALIAS_REGION(cbfs_cache, preram_cbfs_cache) \
+ ALIAS_REGION(cbfs_cache, postram_cbfs_cache)
False positives generated for assembly code macros. An example is:
ERROR: Macros with complex values should be enclosed in parentheses
+#define DECLARE_OPTIONAL_REGION(name) asm (".weak _" #name ", _e" #name
)
False positive detected when macro includes multiple comma separated
values. The following code is from src/include/device/azalia_device.h:
#define AZALIA_SUBVENDOR(codec, val) \
(((codec) << 28) | (0x01720 << 8) | ((val) & 0xff)), \
(((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff)), \
(((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff)), \
(((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff))
TEST=Build and run on Galileo Gen2
Change-Id: I6e3b6950738e6906851a172ba3a22e3d5af1e35d
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18649
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-03-07 22:17:49 +01:00
|
|
|
(((codec) << 28) | (0x01720 << 8) | ((val) & 0xff)), \
|
|
|
|
(((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff)), \
|
|
|
|
(((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff)), \
|
|
|
|
(((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff))
|
2014-09-04 21:34:13 +02:00
|
|
|
|
2013-08-12 14:07:47 +02:00
|
|
|
#endif /* DEVICE_AZALIA_H */
|