Andrew Wu | b7bb70d | 2013-08-12 20:07:47 +0800 | [diff] [blame] | 1 | /* |
| 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 Serbinenko | 75c8387 | 2014-09-05 01:01:31 +0200 | [diff] [blame] | 23 | #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> |
Vladimir Serbinenko | 75c8387 | 2014-09-05 01:01:31 +0200 | [diff] [blame] | 29 | |
Andrew Wu | b7bb70d | 2013-08-12 20:07:47 +0800 | [diff] [blame] | 30 | #include <device/device.h> |
| 31 | |
| 32 | void azalia_audio_init(struct device *dev); |
| 33 | extern struct device_operations default_azalia_audio_ops; |
| 34 | |
Vladimir Serbinenko | 75c8387 | 2014-09-05 01:01:31 +0200 | [diff] [blame] | 35 | extern const u32 cim_verb_data[]; |
| 36 | extern const u32 cim_verb_data_size; |
| 37 | extern const u32 pc_beep_verbs[]; |
| 38 | extern const u32 pc_beep_verbs_size; |
| 39 | |
| 40 | #define AZALIA_ARRAY_SIZES const u32 pc_beep_verbs_size = ARRAY_SIZE(pc_beep_verbs); \ |
| 41 | const u32 cim_verb_data_size = sizeof(cim_verb_data) |
Vladimir Serbinenko | 6a3a8ce | 2014-08-17 23:48:42 +0200 | [diff] [blame] | 42 | |
Vladimir Serbinenko | 8f0da58 | 2014-09-04 21:34:13 +0200 | [diff] [blame] | 43 | #define AZALIA_PIN_CFG(codec, pin, val) \ |
| 44 | ((codec) << 28) | ((pin) << 20) | ( 0x71c << 8) | ((val) & 0xff), \ |
| 45 | ((codec) << 28) | ((pin) << 20) | ( 0x71d << 8) | (((val) >> 8) & 0xff), \ |
| 46 | ((codec) << 28) | ((pin) << 20) | ( 0x71e << 8) | (((val) >> 16) & 0xff), \ |
| 47 | ((codec) << 28) | ((pin) << 20) | ( 0x71f << 8) | (((val) >> 24) & 0xff) |
| 48 | |
| 49 | #define AZALIA_SUBVENDOR(codec, val) \ |
| 50 | ((codec) << 28) | (0x01720 << 8) | ((val) & 0xff), \ |
| 51 | ((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff), \ |
| 52 | ((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff), \ |
| 53 | ((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff) |
| 54 | |
Andrew Wu | b7bb70d | 2013-08-12 20:07:47 +0800 | [diff] [blame] | 55 | #endif /* DEVICE_AZALIA_H */ |