forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/isa/cs423x/cs4236_lib.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
34 * Routines for control of CS4235/4236B/4237B/4238B/4239 chips
....@@ -7,21 +8,6 @@
78 *
89 * Bugs:
910 * -----
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2 of the License, or
14
- * (at your option) any later version.
15
- *
16
- * This program is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU General Public License
22
- * along with this program; if not, write to the Free Software
23
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
- *
2511 */
2612
2713 /*
....@@ -53,7 +39,7 @@
5339 * D7: consumer serial port enable (CS4237B,CS4238B)
5440 * D6: channels status block reset (CS4237B,CS4238B)
5541 * D5: user bit in sub-frame of digital audio data (CS4237B,CS4238B)
56
- * D4: validity bit bit in sub-frame of digital audio data (CS4237B,CS4238B)
42
+ * D4: validity bit in sub-frame of digital audio data (CS4237B,CS4238B)
5743 *
5844 * C5 lower channel status (digital serial data description) (CS4237B,CS4238B)
5945 * D7-D6: first two bits of category code
....@@ -94,7 +80,7 @@
9480 *
9581 */
9682
97
-static unsigned char snd_cs4236_ext_map[18] = {
83
+static const unsigned char snd_cs4236_ext_map[18] = {
9884 /* CS4236_LEFT_LINE */ 0xff,
9985 /* CS4236_RIGHT_LINE */ 0xff,
10086 /* CS4236_LEFT_MIC */ 0xdf,
....@@ -772,7 +758,7 @@
772758 static const DECLARE_TLV_DB_SCALE(db_scale_2bit, -1800, 600, 0);
773759 static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0);
774760
775
-static struct snd_kcontrol_new snd_cs4236_controls[] = {
761
+static const struct snd_kcontrol_new snd_cs4236_controls[] = {
776762
777763 CS4236_DOUBLE("Master Digital Playback Switch", 0,
778764 CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1),
....@@ -867,7 +853,7 @@
867853 static const DECLARE_TLV_DB_SCALE(db_scale_5bit_6db_max, -5600, 200, 0);
868854 static const DECLARE_TLV_DB_SCALE(db_scale_2bit_16db_max, -2400, 800, 0);
869855
870
-static struct snd_kcontrol_new snd_cs4235_controls[] = {
856
+static const struct snd_kcontrol_new snd_cs4235_controls[] = {
871857
872858 WSS_DOUBLE("Master Playback Switch", 0,
873859 CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 7, 7, 1, 1),
....@@ -1000,7 +986,7 @@
1000986 return change;
1001987 }
1002988
1003
-static struct snd_kcontrol_new snd_cs4236_iec958_controls[] = {
989
+static const struct snd_kcontrol_new snd_cs4236_iec958_controls[] = {
1004990 CS4236_IEC958_ENABLE("IEC958 Output Enable", 0),
1005991 CS4236_SINGLEC("IEC958 Output Validity", 0, 4, 4, 1, 0),
1006992 CS4236_SINGLEC("IEC958 Output User", 0, 4, 5, 1, 0),
....@@ -1009,12 +995,12 @@
1009995 CS4236_SINGLEC("IEC958 Output Channel Status High", 0, 6, 0, 255, 0)
1010996 };
1011997
1012
-static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = {
998
+static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = {
1013999 CS4236_SINGLEC("3D Control - Switch", 0, 3, 4, 1, 0),
10141000 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1)
10151001 };
10161002
1017
-static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = {
1003
+static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = {
10181004 CS4236_SINGLEC("3D Control - Switch", 0, 3, 7, 1, 0),
10191005 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1),
10201006 CS4236_SINGLEC("3D Control - Center", 0, 2, 0, 15, 1),
....@@ -1022,7 +1008,7 @@
10221008 CS4236_SINGLEC("3D Control - IEC958", 0, 3, 5, 1, 0)
10231009 };
10241010
1025
-static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = {
1011
+static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = {
10261012 CS4236_SINGLEC("3D Control - Switch", 0, 3, 4, 1, 0),
10271013 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1),
10281014 CS4236_SINGLEC("3D Control - Volume", 0, 2, 0, 15, 1),
....@@ -1034,7 +1020,7 @@
10341020 struct snd_card *card;
10351021 unsigned int idx, count;
10361022 int err;
1037
- struct snd_kcontrol_new *kcontrol;
1023
+ const struct snd_kcontrol_new *kcontrol;
10381024
10391025 if (snd_BUG_ON(!chip || !chip->card))
10401026 return -EINVAL;