.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * rt298.c -- RT298 ALSA SoC audio codec driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2015 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> |
---|
.. | .. |
---|
314 | 311 | if (rt298_jack_detect(rt298, &hp, &mic) < 0) |
---|
315 | 312 | return; |
---|
316 | 313 | |
---|
317 | | - if (hp == true) |
---|
| 314 | + if (hp) |
---|
318 | 315 | status |= SND_JACK_HEADPHONE; |
---|
319 | 316 | |
---|
320 | | - if (mic == true) |
---|
| 317 | + if (mic) |
---|
321 | 318 | status |= SND_JACK_MICROPHONE; |
---|
322 | 319 | |
---|
323 | 320 | snd_soc_jack_report(rt298->jack, status, |
---|
.. | .. |
---|
345 | 342 | regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x2); |
---|
346 | 343 | |
---|
347 | 344 | rt298_jack_detect(rt298, &hp, &mic); |
---|
348 | | - if (hp == true) |
---|
| 345 | + if (hp) |
---|
349 | 346 | status |= SND_JACK_HEADPHONE; |
---|
350 | 347 | |
---|
351 | | - if (mic == true) |
---|
| 348 | + if (mic) |
---|
352 | 349 | status |= SND_JACK_MICROPHONE; |
---|
353 | 350 | |
---|
354 | 351 | snd_soc_jack_report(rt298->jack, status, |
---|
.. | .. |
---|
511 | 508 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, nid, 0), |
---|
512 | 509 | 0x7080, 0x7000); |
---|
513 | 510 | /* 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)) { |
---|
515 | 512 | pr_info("NO MCLK\n"); |
---|
516 | 513 | switch (nid) { |
---|
517 | 514 | case RT298_ADC_IN1: |
---|
.. | .. |
---|
989 | 986 | regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x1, 0x1); |
---|
990 | 987 | |
---|
991 | 988 | if (ret == 0) { |
---|
992 | | - if (hp == true) |
---|
| 989 | + if (hp) |
---|
993 | 990 | status |= SND_JACK_HEADPHONE; |
---|
994 | 991 | |
---|
995 | | - if (mic == true) |
---|
| 992 | + if (mic) |
---|
996 | 993 | status |= SND_JACK_MICROPHONE; |
---|
997 | 994 | |
---|
998 | 995 | snd_soc_jack_report(rt298->jack, status, |
---|
.. | .. |
---|
1148 | 1145 | }; |
---|
1149 | 1146 | MODULE_DEVICE_TABLE(i2c, rt298_i2c_id); |
---|
1150 | 1147 | |
---|
| 1148 | +#ifdef CONFIG_ACPI |
---|
1151 | 1149 | static const struct acpi_device_id rt298_acpi_match[] = { |
---|
1152 | 1150 | { "INT343A", 0 }, |
---|
1153 | 1151 | {}, |
---|
1154 | 1152 | }; |
---|
1155 | 1153 | MODULE_DEVICE_TABLE(acpi, rt298_acpi_match); |
---|
| 1154 | +#endif |
---|
1156 | 1155 | |
---|
1157 | 1156 | static const struct dmi_system_id force_combo_jack_table[] = { |
---|
1158 | 1157 | { |
---|
.. | .. |
---|
1169 | 1168 | DMI_MATCH(DMI_PRODUCT_NAME, "Geminilake") |
---|
1170 | 1169 | } |
---|
1171 | 1170 | }, |
---|
| 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 | + }, |
---|
1172 | 1178 | { } |
---|
1173 | 1179 | }; |
---|
1174 | 1180 | |
---|