.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * rt5640.c -- RT5640/RT5639 ALSA SoC audio codec driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2011 Realtek Semiconductor Corp. |
---|
5 | 6 | * Author: Johnny Hsu <johnnyhsu@realtek.com> |
---|
6 | 7 | * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | 8 | */ |
---|
12 | 9 | |
---|
13 | 10 | #include <linux/module.h> |
---|
.. | .. |
---|
977 | 974 | switch (event) { |
---|
978 | 975 | case SND_SOC_DAPM_POST_PMU: |
---|
979 | 976 | rt5640_pmu_depop(component); |
---|
980 | | - rt5640->hp_mute = 0; |
---|
| 977 | + rt5640->hp_mute = false; |
---|
981 | 978 | break; |
---|
982 | 979 | |
---|
983 | 980 | case SND_SOC_DAPM_PRE_PMD: |
---|
984 | | - rt5640->hp_mute = 1; |
---|
| 981 | + rt5640->hp_mute = true; |
---|
985 | 982 | msleep(70); |
---|
986 | 983 | break; |
---|
987 | 984 | |
---|
.. | .. |
---|
1656 | 1653 | if (component == NULL) |
---|
1657 | 1654 | return -EINVAL; |
---|
1658 | 1655 | |
---|
1659 | | - val = snd_soc_component_read32(component, RT5640_I2S1_SDP); |
---|
| 1656 | + val = snd_soc_component_read(component, RT5640_I2S1_SDP); |
---|
1660 | 1657 | val = (val & RT5640_I2S_IF_MASK) >> RT5640_I2S_IF_SFT; |
---|
1661 | 1658 | switch (dai_id) { |
---|
1662 | 1659 | case RT5640_AIF1: |
---|
.. | .. |
---|
1667 | 1664 | break; |
---|
1668 | 1665 | case RT5640_IF_113: |
---|
1669 | 1666 | ret |= RT5640_U_IF1; |
---|
1670 | | - /* fall through */ |
---|
| 1667 | + fallthrough; |
---|
1671 | 1668 | case RT5640_IF_312: |
---|
1672 | 1669 | case RT5640_IF_213: |
---|
1673 | 1670 | ret |= RT5640_U_IF2; |
---|
.. | .. |
---|
1683 | 1680 | break; |
---|
1684 | 1681 | case RT5640_IF_223: |
---|
1685 | 1682 | ret |= RT5640_U_IF1; |
---|
1686 | | - /* fall through */ |
---|
| 1683 | + fallthrough; |
---|
1687 | 1684 | case RT5640_IF_123: |
---|
1688 | 1685 | case RT5640_IF_321: |
---|
1689 | 1686 | ret |= RT5640_U_IF2; |
---|
.. | .. |
---|
2086 | 2083 | snd_soc_component_update_bits(component, RT5640_ASRC_2, |
---|
2087 | 2084 | asrc2_mask, asrc2_value); |
---|
2088 | 2085 | |
---|
2089 | | - if (snd_soc_component_read32(component, RT5640_ASRC_2)) { |
---|
| 2086 | + if (snd_soc_component_read(component, RT5640_ASRC_2)) { |
---|
2090 | 2087 | rt5640->asrc_en = true; |
---|
2091 | 2088 | snd_soc_component_update_bits(component, RT5640_JD_CTRL, 0x3, 0x3); |
---|
2092 | 2089 | } else { |
---|
.. | .. |
---|
2151 | 2148 | { |
---|
2152 | 2149 | int val; |
---|
2153 | 2150 | |
---|
2154 | | - val = snd_soc_component_read32(component, RT5640_IRQ_CTRL2); |
---|
| 2151 | + val = snd_soc_component_read(component, RT5640_IRQ_CTRL2); |
---|
2155 | 2152 | dev_dbg(component->dev, "irq ctrl2 %#04x\n", val); |
---|
2156 | 2153 | |
---|
2157 | 2154 | return (val & RT5640_MB1_OC_STATUS); |
---|
.. | .. |
---|
2162 | 2159 | struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); |
---|
2163 | 2160 | int val; |
---|
2164 | 2161 | |
---|
2165 | | - val = snd_soc_component_read32(component, RT5640_INT_IRQ_ST); |
---|
| 2162 | + val = snd_soc_component_read(component, RT5640_INT_IRQ_ST); |
---|
2166 | 2163 | dev_dbg(component->dev, "irq status %#04x\n", val); |
---|
2167 | 2164 | |
---|
2168 | 2165 | if (rt5640->jd_inverted) |
---|
.. | .. |
---|
2489 | 2486 | snd_soc_component_update_bits(component, RT5640_MICBIAS, 0x0030, 0x0030); |
---|
2490 | 2487 | snd_soc_component_update_bits(component, RT5640_DSP_PATH2, 0xfc00, 0x0c00); |
---|
2491 | 2488 | |
---|
2492 | | - switch (snd_soc_component_read32(component, RT5640_RESET) & RT5640_ID_MASK) { |
---|
| 2489 | + switch (snd_soc_component_read(component, RT5640_RESET) & RT5640_ID_MASK) { |
---|
2493 | 2490 | case RT5640_ID_5640: |
---|
2494 | 2491 | case RT5640_ID_5642: |
---|
2495 | 2492 | snd_soc_add_component_controls(component, |
---|
.. | .. |
---|
2713 | 2710 | static const struct regmap_config rt5640_regmap = { |
---|
2714 | 2711 | .reg_bits = 8, |
---|
2715 | 2712 | .val_bits = 16, |
---|
2716 | | - .use_single_rw = true, |
---|
| 2713 | + .use_single_read = true, |
---|
| 2714 | + .use_single_write = true, |
---|
2717 | 2715 | |
---|
2718 | 2716 | .max_register = RT5640_VENDOR_ID2 + 1 + (ARRAY_SIZE(rt5640_ranges) * |
---|
2719 | 2717 | RT5640_PR_SPACING), |
---|
.. | .. |
---|
2830 | 2828 | regmap_update_bits(rt5640->regmap, RT5640_DUMMY1, |
---|
2831 | 2829 | RT5640_MCLK_DET, RT5640_MCLK_DET); |
---|
2832 | 2830 | |
---|
2833 | | - rt5640->hp_mute = 1; |
---|
| 2831 | + rt5640->hp_mute = true; |
---|
2834 | 2832 | rt5640->irq = i2c->irq; |
---|
2835 | 2833 | INIT_DELAYED_WORK(&rt5640->bp_work, rt5640_button_press_work); |
---|
2836 | 2834 | INIT_WORK(&rt5640->jack_work, rt5640_jack_work); |
---|