blob: 6aedf4b14f6f2aeff200cdee57935d957233ba79 [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.
Andrew Wub7bb70d2013-08-12 20:07:47 +080014 */
15
16#ifndef DEVICE_AZALIA_H
17#define DEVICE_AZALIA_H
18
Vladimir Serbinenko75c83872014-09-05 01:01:31 +020019#include <types.h>
20#include <string.h>
21#include <console/console.h>
22#include <arch/acpi.h>
23#include <arch/io.h>
24#include <arch/interrupt.h>
Vladimir Serbinenko75c83872014-09-05 01:01:31 +020025
Andrew Wub7bb70d2013-08-12 20:07:47 +080026#include <device/device.h>
27
28void azalia_audio_init(struct device *dev);
29extern struct device_operations default_azalia_audio_ops;
30
Vladimir Serbinenko75c83872014-09-05 01:01:31 +020031extern const u32 cim_verb_data[];
32extern const u32 cim_verb_data_size;
33extern const u32 pc_beep_verbs[];
34extern const u32 pc_beep_verbs_size;
35
36#define AZALIA_ARRAY_SIZES const u32 pc_beep_verbs_size = ARRAY_SIZE(pc_beep_verbs); \
37 const u32 cim_verb_data_size = sizeof(cim_verb_data)
Vladimir Serbinenko6a3a8ce2014-08-17 23:48:42 +020038
Vladimir Serbinenko8f0da582014-09-04 21:34:13 +020039#define AZALIA_PIN_CFG(codec, pin, val) \
Lee Leahyf00e4462017-03-07 13:17:49 -080040 (((codec) << 28) | ((pin) << 20) | ( 0x71c << 8) | ((val) & 0xff)), \
41 (((codec) << 28) | ((pin) << 20) | ( 0x71d << 8) | (((val) >> 8) & 0xff)), \
42 (((codec) << 28) | ((pin) << 20) | ( 0x71e << 8) | (((val) >> 16) & 0xff)), \
43 (((codec) << 28) | ((pin) << 20) | ( 0x71f << 8) | (((val) >> 24) & 0xff))
Vladimir Serbinenko8f0da582014-09-04 21:34:13 +020044
45#define AZALIA_SUBVENDOR(codec, val) \
Lee Leahyf00e4462017-03-07 13:17:49 -080046 (((codec) << 28) | (0x01720 << 8) | ((val) & 0xff)), \
47 (((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff)), \
48 (((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff)), \
49 (((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff))
Vladimir Serbinenko8f0da582014-09-04 21:34:13 +020050
Andrew Wub7bb70d2013-08-12 20:07:47 +080051#endif /* DEVICE_AZALIA_H */