| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Universal Interface for Intel High Definition Audio Codec |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * (C) 2006-2009 VIA Technology, Inc. |
|---|
| 7 | 8 | * (C) 2006-2008 Takashi Iwai <tiwai@suse.de> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This driver is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This driver is distributed in the hope that it will be useful, |
|---|
| 15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * You should have received a copy of the GNU General Public License |
|---|
| 20 | | - * along with this program; if not, write to the Free Software |
|---|
| 21 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 22 | 9 | */ |
|---|
| 23 | 10 | |
|---|
| 24 | 11 | /* * * * * * * * * * * * * * Release History * * * * * * * * * * * * * * * * */ |
|---|
| .. | .. |
|---|
| 52 | 39 | #include <linux/module.h> |
|---|
| 53 | 40 | #include <sound/core.h> |
|---|
| 54 | 41 | #include <sound/asoundef.h> |
|---|
| 55 | | -#include "hda_codec.h" |
|---|
| 42 | +#include <sound/hda_codec.h> |
|---|
| 56 | 43 | #include "hda_local.h" |
|---|
| 57 | 44 | #include "hda_auto_parser.h" |
|---|
| 58 | 45 | #include "hda_jack.h" |
|---|
| .. | .. |
|---|
| 410 | 397 | /* some delay here to make jack detection working (bko#98921) */ |
|---|
| 411 | 398 | msleep(10); |
|---|
| 412 | 399 | codec->patch_ops.init(codec); |
|---|
| 413 | | - regcache_sync(codec->core.regmap); |
|---|
| 400 | + snd_hda_regmap_sync(codec); |
|---|
| 414 | 401 | return 0; |
|---|
| 415 | 402 | } |
|---|
| 416 | 403 | #endif |
|---|
| .. | .. |
|---|
| 533 | 520 | if (err < 0) |
|---|
| 534 | 521 | return err; |
|---|
| 535 | 522 | |
|---|
| 536 | | - err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); |
|---|
| 523 | + err = auto_parse_beep(codec); |
|---|
| 537 | 524 | if (err < 0) |
|---|
| 538 | 525 | return err; |
|---|
| 539 | 526 | |
|---|
| 540 | | - err = auto_parse_beep(codec); |
|---|
| 527 | + err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); |
|---|
| 541 | 528 | if (err < 0) |
|---|
| 542 | 529 | return err; |
|---|
| 543 | 530 | |
|---|
| .. | .. |
|---|
| 834 | 821 | return 0; |
|---|
| 835 | 822 | nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn, |
|---|
| 836 | 823 | ARRAY_SIZE(conn) - 1); |
|---|
| 824 | + if (nums < 0) |
|---|
| 825 | + return nums; |
|---|
| 826 | + |
|---|
| 837 | 827 | for (i = 0; i < nums; i++) { |
|---|
| 838 | 828 | if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT) |
|---|
| 839 | 829 | return 0; |
|---|
| .. | .. |
|---|
| 1054 | 1044 | }; |
|---|
| 1055 | 1045 | |
|---|
| 1056 | 1046 | static const struct snd_pci_quirk vt2002p_fixups[] = { |
|---|
| 1047 | + SND_PCI_QUIRK(0x1043, 0x13f7, "Asus B23E", VIA_FIXUP_POWER_SAVE), |
|---|
| 1057 | 1048 | SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75), |
|---|
| 1058 | 1049 | SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), |
|---|
| 1059 | 1050 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", VIA_FIXUP_POWER_SAVE), |
|---|
| .. | .. |
|---|
| 1065 | 1056 | */ |
|---|
| 1066 | 1057 | static void fix_vt1802_connections(struct hda_codec *codec) |
|---|
| 1067 | 1058 | { |
|---|
| 1068 | | - static hda_nid_t conn_24[] = { 0x14, 0x1c }; |
|---|
| 1069 | | - static hda_nid_t conn_33[] = { 0x1c }; |
|---|
| 1059 | + static const hda_nid_t conn_24[] = { 0x14, 0x1c }; |
|---|
| 1060 | + static const hda_nid_t conn_33[] = { 0x1c }; |
|---|
| 1070 | 1061 | |
|---|
| 1071 | 1062 | snd_hda_override_conn_list(codec, 0x24, ARRAY_SIZE(conn_24), conn_24); |
|---|
| 1072 | 1063 | snd_hda_override_conn_list(codec, 0x33, ARRAY_SIZE(conn_33), conn_33); |
|---|