forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/pci/ice1712/ews.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA driver for ICEnsemble ICE1712 (Envy24)
34 *
....@@ -5,21 +6,6 @@
56 *
67 * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
78 * 2002 Takashi Iwai <tiwai@suse.de>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, write to the Free Software
21
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
- *
239 */
2410
2511 #include <linux/delay.h>
....@@ -611,7 +597,7 @@
611597 return val != nval;
612598 }
613599
614
-static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = {
600
+static const struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = {
615601 {
616602 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
617603 .name = "Input Sensitivity Switch",
....@@ -806,7 +792,7 @@
806792 .private_value = xshift | (xinvert << 8),\
807793 }
808794
809
-static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = {
795
+static const struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = {
810796 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */
811797 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0),
812798 EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0),
....@@ -826,7 +812,12 @@
826812
827813 snd_i2c_lock(ice->i2c);
828814 byte = reg;
829
- snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1);
815
+ if (snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) {
816
+ snd_i2c_unlock(ice->i2c);
817
+ dev_err(ice->card->dev, "cannot send pca\n");
818
+ return -EIO;
819
+ }
820
+
830821 byte = 0;
831822 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) {
832823 snd_i2c_unlock(ice->i2c);
....@@ -937,7 +928,7 @@
937928 .private_value = xshift | (xinvert << 8),\
938929 }
939930
940
-static struct snd_kcontrol_new snd_ice1712_6fire_controls[] = {
931
+static const struct snd_kcontrol_new snd_ice1712_6fire_controls[] = {
941932 {
942933 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
943934 .name = "Analog Input Select",