Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 4 | * Copyright (C) 2013 Google Inc. |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by 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. |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
Vladimir Serbinenko | 75c8387 | 2014-09-05 01:01:31 +0200 | [diff] [blame] | 16 | #include <device/azalia_device.h> |
| 17 | |
| 18 | const u32 cim_verb_data[] = { |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 19 | /* coreboot specific header */ |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 20 | 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 |
| 21 | 0x10ec0283, // Subsystem ID |
Duncan Laurie | 9dd01eb | 2013-08-28 09:53:57 -0700 | [diff] [blame] | 22 | 0x0000000d, // Number of jacks (NID entries) |
| 23 | |
| 24 | 0x0017ff00, // Function Reset |
| 25 | 0x0017ff00, // Double Function Reset |
| 26 | 0x000F0000, // Pad - get vendor id |
| 27 | 0x000F0002, // Pad - get revision id |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 28 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 29 | /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 30 | AZALIA_SUBVENDOR(0x0, 0x10ec0283), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 31 | |
| 32 | /* Pin Widget Verb Table */ |
| 33 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 34 | /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 35 | AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 36 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 37 | /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 38 | // group 1, front left/right |
| 39 | // no connector, no jack detect |
| 40 | // speaker out, analog |
| 41 | // fixed function, internal |
| 42 | AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 43 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 44 | /* Pin Complex (NID 0x17) */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 45 | AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 46 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 47 | /* Pin Complex (NID 0x18) MIC1 PORTB */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 48 | // group 1, cap 1 |
| 49 | // black, jack detect |
| 50 | // mic in, analog |
| 51 | // connector, left panel |
| 52 | AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 53 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 54 | /* Pin Complex (NID 0x19) MIC2 PORTF */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 55 | AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 56 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 57 | /* Pin Complex (NID 0x1A) LINE1 PORTC */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 58 | AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 59 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 60 | /* Pin Complex (NID 0x1B) LINE2 PORTE */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 61 | AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 62 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 63 | /* Pin Complex (NID 0x1d) PCBeep */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 64 | // eapd low on ex-amp, laptop, custom enable |
| 65 | // mute spkr on hpout |
| 66 | // pcbeep en able, checksum |
| 67 | // no physical, internal |
| 68 | AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 69 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 70 | /* Pin Complex (NID 0x1E) SPDIF-OUT */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 71 | AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 72 | |
Duncan Laurie | 28080e4 | 2013-06-11 08:43:12 -0700 | [diff] [blame] | 73 | /* Pin Complex (NID 0x21) HPOUT PORT-I */ |
Vladimir Serbinenko | 02d674a | 2014-09-04 22:04:11 +0200 | [diff] [blame] | 74 | // group1, |
| 75 | // black, jack detect |
| 76 | // HPOut, 1/8 stereo |
| 77 | // connector, left panel |
| 78 | AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 79 | |
Marc Jones | 4acd8ea | 2013-08-21 05:21:21 -0600 | [diff] [blame] | 80 | /* Undocumented settings from Realtek (needed for beep_gen) */ |
| 81 | /* Widget node 0x20 */ |
| 82 | 0x02050010, |
| 83 | 0x02040c20, |
| 84 | 0x0205001b, |
| 85 | 0x0204081b, |
Duncan Laurie | 5290f71 | 2013-05-22 16:31:09 -0700 | [diff] [blame] | 86 | }; |
Marc Jones | 4acd8ea | 2013-08-21 05:21:21 -0600 | [diff] [blame] | 87 | |
Vladimir Serbinenko | 75c8387 | 2014-09-05 01:01:31 +0200 | [diff] [blame] | 88 | const u32 pc_beep_verbs[] = { |
Marc Jones | 4acd8ea | 2013-08-21 05:21:21 -0600 | [diff] [blame] | 89 | 0x00170500, /* power up everything (codec, dac, adc, mixers) */ |
| 90 | 0x01470740, /* enable speaker out */ |
| 91 | 0x01470c02, /* set speaker EAPD pin */ |
| 92 | 0x0143b01f, /* unmute speaker */ |
| 93 | 0x00c37100, /* unmute mixer nid 0xc input 1 */ |
| 94 | 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ |
| 95 | }; |
| 96 | |
Vladimir Serbinenko | 75c8387 | 2014-09-05 01:01:31 +0200 | [diff] [blame] | 97 | AZALIA_ARRAY_SIZES; |