forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/isa/sb/emu8000.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
34 * and (c) 1999 Steve Ratcliffe <steve@parabola.demon.co.uk>
45 * Copyright (C) 1999-2000 Takashi Iwai <tiwai@suse.de>
56 *
67 * Routines for control of EMU8000 chip
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 as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
218 */
229
2310 #include <linux/wait.h>
....@@ -235,7 +222,7 @@
235222 /*
236223 * initialization arrays; from ADIP
237224 */
238
-static unsigned short init1[128] = {
225
+static const unsigned short init1[128] = {
239226 0x03ff, 0x0030, 0x07ff, 0x0130, 0x0bff, 0x0230, 0x0fff, 0x0330,
240227 0x13ff, 0x0430, 0x17ff, 0x0530, 0x1bff, 0x0630, 0x1fff, 0x0730,
241228 0x23ff, 0x0830, 0x27ff, 0x0930, 0x2bff, 0x0a30, 0x2fff, 0x0b30,
....@@ -257,7 +244,7 @@
257244 0xf3ff, 0x0c30, 0xf7ff, 0x0d30, 0xfbff, 0x0e30, 0xffff, 0x0f30,
258245 };
259246
260
-static unsigned short init2[128] = {
247
+static const unsigned short init2[128] = {
261248 0x03ff, 0x8030, 0x07ff, 0x8130, 0x0bff, 0x8230, 0x0fff, 0x8330,
262249 0x13ff, 0x8430, 0x17ff, 0x8530, 0x1bff, 0x8630, 0x1fff, 0x8730,
263250 0x23ff, 0x8830, 0x27ff, 0x8930, 0x2bff, 0x8a30, 0x2fff, 0x8b30,
....@@ -279,7 +266,7 @@
279266 0xf3ff, 0x8c30, 0xf7ff, 0x8d30, 0xfbff, 0x8e30, 0xffff, 0x8f30,
280267 };
281268
282
-static unsigned short init3[128] = {
269
+static const unsigned short init3[128] = {
283270 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5,
284271 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x8F7C, 0x167E, 0xF254,
285272 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x8BAA, 0x1B6D, 0xF234,
....@@ -301,7 +288,7 @@
301288 0x1342, 0xD36E, 0x3EC7, 0xB3FF, 0x0000, 0x8365, 0x1420, 0x9570,
302289 };
303290
304
-static unsigned short init4[128] = {
291
+static const unsigned short init4[128] = {
305292 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5,
306293 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x0F7C, 0x167E, 0x7254,
307294 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x0BAA, 0x1B6D, 0x7234,
....@@ -328,10 +315,10 @@
328315 * is meant to work
329316 */
330317 static void
331
-send_array(struct snd_emu8000 *emu, unsigned short *data, int size)
318
+send_array(struct snd_emu8000 *emu, const unsigned short *data, int size)
332319 {
333320 int i;
334
- unsigned short *p;
321
+ const unsigned short *p;
335322
336323 p = data;
337324 for (i = 0; i < size; i++, p++)
....@@ -561,7 +548,7 @@
561548 * Bass/Treble Equalizer
562549 *----------------------------------------------------------------*/
563550
564
-static unsigned short bass_parm[12][3] = {
551
+static const unsigned short bass_parm[12][3] = {
565552 {0xD26A, 0xD36A, 0x0000}, /* -12 dB */
566553 {0xD25B, 0xD35B, 0x0000}, /* -8 */
567554 {0xD24C, 0xD34C, 0x0000}, /* -6 */
....@@ -576,7 +563,7 @@
576563 {0xC26A, 0xC36A, 0x0002}, /* +12 dB */
577564 };
578565
579
-static unsigned short treble_parm[12][9] = {
566
+static const unsigned short treble_parm[12][9] = {
580567 {0x821E, 0xC26A, 0x031E, 0xC36A, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, /* -12 dB */
581568 {0x821E, 0xC25B, 0x031E, 0xC35B, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001},
582569 {0x821E, 0xC24C, 0x031E, 0xC34C, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001},
....@@ -868,7 +855,7 @@
868855 return change;
869856 }
870857
871
-static struct snd_kcontrol_new mixer_bass_control =
858
+static const struct snd_kcontrol_new mixer_bass_control =
872859 {
873860 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
874861 .name = "Synth Tone Control - Bass",
....@@ -878,7 +865,7 @@
878865 .private_value = 0,
879866 };
880867
881
-static struct snd_kcontrol_new mixer_treble_control =
868
+static const struct snd_kcontrol_new mixer_treble_control =
882869 {
883870 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
884871 .name = "Synth Tone Control - Treble",
....@@ -935,7 +922,7 @@
935922 return change;
936923 }
937924
938
-static struct snd_kcontrol_new mixer_chorus_mode_control =
925
+static const struct snd_kcontrol_new mixer_chorus_mode_control =
939926 {
940927 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
941928 .name = "Chorus Mode",
....@@ -945,7 +932,7 @@
945932 .private_value = 1,
946933 };
947934
948
-static struct snd_kcontrol_new mixer_reverb_mode_control =
935
+static const struct snd_kcontrol_new mixer_reverb_mode_control =
949936 {
950937 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
951938 .name = "Reverb Mode",
....@@ -997,7 +984,7 @@
997984 return change;
998985 }
999986
1000
-static struct snd_kcontrol_new mixer_fm_chorus_depth_control =
987
+static const struct snd_kcontrol_new mixer_fm_chorus_depth_control =
1001988 {
1002989 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1003990 .name = "FM Chorus Depth",
....@@ -1007,7 +994,7 @@
1007994 .private_value = 1,
1008995 };
1009996
1010
-static struct snd_kcontrol_new mixer_fm_reverb_depth_control =
997
+static const struct snd_kcontrol_new mixer_fm_reverb_depth_control =
1011998 {
1012999 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
10131000 .name = "FM Reverb Depth",
....@@ -1018,7 +1005,7 @@
10181005 };
10191006
10201007
1021
-static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = {
1008
+static const struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = {
10221009 &mixer_bass_control,
10231010 &mixer_treble_control,
10241011 &mixer_chorus_mode_control,
....@@ -1090,7 +1077,7 @@
10901077 struct snd_seq_device *awe;
10911078 struct snd_emu8000 *hw;
10921079 int err;
1093
- static struct snd_device_ops ops = {
1080
+ static const struct snd_device_ops ops = {
10941081 .dev_free = snd_emu8000_dev_free,
10951082 };
10961083