blob: 0f477a357aabb2a3cc01b47303dbc71761c91d94 [file] [log] [blame]
Andrew Wub7bb70d2013-08-12 20:07:47 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 DMP Electronics Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef DEVICE_AZALIA_H
21#define DEVICE_AZALIA_H
22
Vladimir Serbinenko75c83872014-09-05 01:01:31 +020023#include <types.h>
24#include <string.h>
25#include <console/console.h>
26#include <arch/acpi.h>
27#include <arch/io.h>
28#include <arch/interrupt.h>
29#include <build.h>
30
Andrew Wub7bb70d2013-08-12 20:07:47 +080031#include <device/device.h>
32
33void azalia_audio_init(struct device *dev);
34extern struct device_operations default_azalia_audio_ops;
35
Vladimir Serbinenko75c83872014-09-05 01:01:31 +020036extern const u32 cim_verb_data[];
37extern const u32 cim_verb_data_size;
38extern const u32 pc_beep_verbs[];
39extern const u32 pc_beep_verbs_size;
40
41#define AZALIA_ARRAY_SIZES const u32 pc_beep_verbs_size = ARRAY_SIZE(pc_beep_verbs); \
42 const u32 cim_verb_data_size = sizeof(cim_verb_data)
Vladimir Serbinenko6a3a8ce2014-08-17 23:48:42 +020043
Vladimir Serbinenko8f0da582014-09-04 21:34:13 +020044#define AZALIA_PIN_CFG(codec, pin, val) \
45 ((codec) << 28) | ((pin) << 20) | ( 0x71c << 8) | ((val) & 0xff), \
46 ((codec) << 28) | ((pin) << 20) | ( 0x71d << 8) | (((val) >> 8) & 0xff), \
47 ((codec) << 28) | ((pin) << 20) | ( 0x71e << 8) | (((val) >> 16) & 0xff), \
48 ((codec) << 28) | ((pin) << 20) | ( 0x71f << 8) | (((val) >> 24) & 0xff)
49
50#define AZALIA_SUBVENDOR(codec, val) \
51 ((codec) << 28) | (0x01720 << 8) | ((val) & 0xff), \
52 ((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff), \
53 ((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff), \
54 ((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff)
55
Andrew Wub7bb70d2013-08-12 20:07:47 +080056#endif /* DEVICE_AZALIA_H */