.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * rt286.c -- RT286 ALSA SoC audio codec driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2013 Realtek Semiconductor Corp. |
---|
5 | 6 | * 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. |
---|
10 | 7 | */ |
---|
11 | 8 | |
---|
12 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
278 | 275 | regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf); |
---|
279 | 276 | *mic = buf & 0x80000000; |
---|
280 | 277 | } |
---|
281 | | - if (!*mic) { |
---|
| 278 | + |
---|
| 279 | + if (!*hp) { |
---|
282 | 280 | snd_soc_dapm_disable_pin(dapm, "HV"); |
---|
283 | 281 | snd_soc_dapm_disable_pin(dapm, "VREF"); |
---|
284 | | - } |
---|
285 | | - if (!*hp) |
---|
286 | 282 | snd_soc_dapm_disable_pin(dapm, "LDO1"); |
---|
287 | | - snd_soc_dapm_sync(dapm); |
---|
| 283 | + snd_soc_dapm_sync(dapm); |
---|
| 284 | + } |
---|
288 | 285 | |
---|
289 | 286 | return 0; |
---|
290 | 287 | } |
---|
.. | .. |
---|
299 | 296 | |
---|
300 | 297 | rt286_jack_detect(rt286, &hp, &mic); |
---|
301 | 298 | |
---|
302 | | - if (hp == true) |
---|
| 299 | + if (hp) |
---|
303 | 300 | status |= SND_JACK_HEADPHONE; |
---|
304 | 301 | |
---|
305 | | - if (mic == true) |
---|
| 302 | + if (mic) |
---|
306 | 303 | status |= SND_JACK_MICROPHONE; |
---|
307 | 304 | |
---|
308 | 305 | snd_soc_jack_report(rt286->jack, status, |
---|
.. | .. |
---|
927 | 924 | /* Clear IRQ */ |
---|
928 | 925 | regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x1, 0x1); |
---|
929 | 926 | |
---|
930 | | - if (hp == true) |
---|
| 927 | + if (hp) |
---|
931 | 928 | status |= SND_JACK_HEADPHONE; |
---|
932 | 929 | |
---|
933 | | - if (mic == true) |
---|
| 930 | + if (mic) |
---|
934 | 931 | status |= SND_JACK_MICROPHONE; |
---|
935 | 932 | |
---|
936 | 933 | snd_soc_jack_report(rt286->jack, status, |
---|
.. | .. |
---|
1085 | 1082 | }; |
---|
1086 | 1083 | MODULE_DEVICE_TABLE(i2c, rt286_i2c_id); |
---|
1087 | 1084 | |
---|
| 1085 | +#ifdef CONFIG_ACPI |
---|
1088 | 1086 | static const struct acpi_device_id rt286_acpi_match[] = { |
---|
1089 | 1087 | { "INT343A", 0 }, |
---|
1090 | 1088 | {}, |
---|
1091 | 1089 | }; |
---|
1092 | 1090 | MODULE_DEVICE_TABLE(acpi, rt286_acpi_match); |
---|
| 1091 | +#endif |
---|
1093 | 1092 | |
---|
1094 | 1093 | static const struct dmi_system_id force_combo_jack_table[] = { |
---|
1095 | 1094 | { |
---|