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