forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/pci/oxygen/xonar_wm87x6.c
....@@ -1,19 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * card driver for models with WM8776/WM8766 DACs (Xonar DS/HDAV1.3 Slim)
34 *
45 * Copyright (c) Clemens Ladisch <clemens@ladisch.de>
5
- *
6
- *
7
- * This driver is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License, version 2.
9
- *
10
- * This driver is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this driver; if not, see <http://www.gnu.org/licenses/>.
176 */
187
198 /*
....@@ -127,7 +116,8 @@
127116 else
128117 wm8776_write_i2c(chip, reg, value);
129118 if (reg < ARRAY_SIZE(data->wm8776_regs)) {
130
- if (reg >= WM8776_HPLVOL && reg <= WM8776_DACMASTER)
119
+ /* reg >= WM8776_HPLVOL is always true */
120
+ if (reg <= WM8776_DACMASTER)
131121 value &= ~WM8776_UPDATE;
132122 data->wm8776_regs[reg] = value;
133123 }
....@@ -155,7 +145,8 @@
155145 OXYGEN_SPI_CEN_LATCH_CLOCK_LO,
156146 (reg << 9) | value);
157147 if (reg < ARRAY_SIZE(data->wm8766_regs)) {
158
- if ((reg >= WM8766_LDA1 && reg <= WM8766_RDA1) ||
148
+ /* reg >= WM8766_LDA1 is always true */
149
+ if (reg <= WM8766_RDA1 ||
159150 (reg >= WM8766_LDA2 && reg <= WM8766_MASTDA))
160151 value &= ~WM8766_UPDATE;
161152 data->wm8766_regs[reg] = value;