forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/rt298.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * rt298.c -- RT298 ALSA SoC audio codec driver
34 *
45 * Copyright 2015 Realtek Semiconductor Corp.
56 * Author: Bard Liao <bardliao@realtek.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/module.h>
....@@ -314,10 +311,10 @@
314311 if (rt298_jack_detect(rt298, &hp, &mic) < 0)
315312 return;
316313
317
- if (hp == true)
314
+ if (hp)
318315 status |= SND_JACK_HEADPHONE;
319316
320
- if (mic == true)
317
+ if (mic)
321318 status |= SND_JACK_MICROPHONE;
322319
323320 snd_soc_jack_report(rt298->jack, status,
....@@ -345,10 +342,10 @@
345342 regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x2);
346343
347344 rt298_jack_detect(rt298, &hp, &mic);
348
- if (hp == true)
345
+ if (hp)
349346 status |= SND_JACK_HEADPHONE;
350347
351
- if (mic == true)
348
+ if (mic)
352349 status |= SND_JACK_MICROPHONE;
353350
354351 snd_soc_jack_report(rt298->jack, status,
....@@ -511,7 +508,7 @@
511508 VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0),
512509 0x7080, 0x7000);
513510 /* If MCLK doesn't exist, reset AD filter */
514
- if (!(snd_soc_component_read32(component, RT298_VAD_CTRL) & 0x200)) {
511
+ if (!(snd_soc_component_read(component, RT298_VAD_CTRL) & 0x200)) {
515512 pr_info("NO MCLK\n");
516513 switch (nid) {
517514 case RT298_ADC_IN1:
....@@ -989,10 +986,10 @@
989986 regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x1, 0x1);
990987
991988 if (ret == 0) {
992
- if (hp == true)
989
+ if (hp)
993990 status |= SND_JACK_HEADPHONE;
994991
995
- if (mic == true)
992
+ if (mic)
996993 status |= SND_JACK_MICROPHONE;
997994
998995 snd_soc_jack_report(rt298->jack, status,
....@@ -1148,11 +1145,13 @@
11481145 };
11491146 MODULE_DEVICE_TABLE(i2c, rt298_i2c_id);
11501147
1148
+#ifdef CONFIG_ACPI
11511149 static const struct acpi_device_id rt298_acpi_match[] = {
11521150 { "INT343A", 0 },
11531151 {},
11541152 };
11551153 MODULE_DEVICE_TABLE(acpi, rt298_acpi_match);
1154
+#endif
11561155
11571156 static const struct dmi_system_id force_combo_jack_table[] = {
11581157 {
....@@ -1169,6 +1168,13 @@
11691168 DMI_MATCH(DMI_PRODUCT_NAME, "Geminilake")
11701169 }
11711170 },
1171
+ {
1172
+ .ident = "Intel Kabylake R RVP",
1173
+ .matches = {
1174
+ DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
1175
+ DMI_MATCH(DMI_PRODUCT_NAME, "Kabylake Client platform")
1176
+ }
1177
+ },
11721178 { }
11731179 };
11741180