forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/sound/pci/hda/patch_via.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Universal Interface for Intel High Definition Audio Codec
34 *
....@@ -5,20 +6,6 @@
56 *
67 * (C) 2006-2009 VIA Technology, Inc.
78 * (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
229 */
2310
2411 /* * * * * * * * * * * * * * Release History * * * * * * * * * * * * * * * * */
....@@ -52,7 +39,7 @@
5239 #include <linux/module.h>
5340 #include <sound/core.h>
5441 #include <sound/asoundef.h>
55
-#include "hda_codec.h"
42
+#include <sound/hda_codec.h>
5643 #include "hda_local.h"
5744 #include "hda_auto_parser.h"
5845 #include "hda_jack.h"
....@@ -410,7 +397,7 @@
410397 /* some delay here to make jack detection working (bko#98921) */
411398 msleep(10);
412399 codec->patch_ops.init(codec);
413
- regcache_sync(codec->core.regmap);
400
+ snd_hda_regmap_sync(codec);
414401 return 0;
415402 }
416403 #endif
....@@ -533,11 +520,11 @@
533520 if (err < 0)
534521 return err;
535522
536
- err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
523
+ err = auto_parse_beep(codec);
537524 if (err < 0)
538525 return err;
539526
540
- err = auto_parse_beep(codec);
527
+ err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
541528 if (err < 0)
542529 return err;
543530
....@@ -834,6 +821,9 @@
834821 return 0;
835822 nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn,
836823 ARRAY_SIZE(conn) - 1);
824
+ if (nums < 0)
825
+ return nums;
826
+
837827 for (i = 0; i < nums; i++) {
838828 if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT)
839829 return 0;
....@@ -1054,6 +1044,7 @@
10541044 };
10551045
10561046 static const struct snd_pci_quirk vt2002p_fixups[] = {
1047
+ SND_PCI_QUIRK(0x1043, 0x13f7, "Asus B23E", VIA_FIXUP_POWER_SAVE),
10571048 SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75),
10581049 SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST),
10591050 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", VIA_FIXUP_POWER_SAVE),
....@@ -1065,8 +1056,8 @@
10651056 */
10661057 static void fix_vt1802_connections(struct hda_codec *codec)
10671058 {
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 };
10701061
10711062 snd_hda_override_conn_list(codec, 0x24, ARRAY_SIZE(conn_24), conn_24);
10721063 snd_hda_override_conn_list(codec, 0x33, ARRAY_SIZE(conn_33), conn_33);