forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/rt286.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * rt286.c -- RT286 ALSA SoC audio codec driver
34 *
45 * Copyright 2013 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>
....@@ -278,13 +275,13 @@
278275 regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf);
279276 *mic = buf & 0x80000000;
280277 }
281
- if (!*mic) {
278
+
279
+ if (!*hp) {
282280 snd_soc_dapm_disable_pin(dapm, "HV");
283281 snd_soc_dapm_disable_pin(dapm, "VREF");
284
- }
285
- if (!*hp)
286282 snd_soc_dapm_disable_pin(dapm, "LDO1");
287
- snd_soc_dapm_sync(dapm);
283
+ snd_soc_dapm_sync(dapm);
284
+ }
288285
289286 return 0;
290287 }
....@@ -299,10 +296,10 @@
299296
300297 rt286_jack_detect(rt286, &hp, &mic);
301298
302
- if (hp == true)
299
+ if (hp)
303300 status |= SND_JACK_HEADPHONE;
304301
305
- if (mic == true)
302
+ if (mic)
306303 status |= SND_JACK_MICROPHONE;
307304
308305 snd_soc_jack_report(rt286->jack, status,
....@@ -927,10 +924,10 @@
927924 /* Clear IRQ */
928925 regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x1, 0x1);
929926
930
- if (hp == true)
927
+ if (hp)
931928 status |= SND_JACK_HEADPHONE;
932929
933
- if (mic == true)
930
+ if (mic)
934931 status |= SND_JACK_MICROPHONE;
935932
936933 snd_soc_jack_report(rt286->jack, status,
....@@ -1085,11 +1082,13 @@
10851082 };
10861083 MODULE_DEVICE_TABLE(i2c, rt286_i2c_id);
10871084
1085
+#ifdef CONFIG_ACPI
10881086 static const struct acpi_device_id rt286_acpi_match[] = {
10891087 { "INT343A", 0 },
10901088 {},
10911089 };
10921090 MODULE_DEVICE_TABLE(acpi, rt286_acpi_match);
1091
+#endif
10931092
10941093 static const struct dmi_system_id force_combo_jack_table[] = {
10951094 {