forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/drivers/opl3/opl3_midi.c
....@@ -1,22 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) by Uros Bizjak <uros@kss-loka.si>
34 *
45 * Midi synth routines for OPL2/OPL3/OPL4 FM
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- *
206 */
217
228 #undef DEBUG_ALLOC
....@@ -37,7 +23,7 @@
3723 * it saves a lot of log() calculations. (Rob Hooft <hooft@chem.ruu.nl>)
3824 */
3925
40
-static char opl3_volume_table[128] =
26
+static const char opl3_volume_table[128] =
4127 {
4228 -63, -48, -40, -35, -32, -29, -27, -26,
4329 -24, -23, -21, -20, -19, -18, -18, -17,
....@@ -83,7 +69,7 @@
8369 /*
8470 * Converts the note frequency to block and fnum values for the FM chip
8571 */
86
-static short opl3_note_table[16] =
72
+static const short opl3_note_table[16] =
8773 {
8874 305, 323, /* for pitch bending, -2 semitones */
8975 343, 363, 385, 408, 432, 458, 485, 514, 544, 577, 611, 647,
....@@ -280,7 +266,7 @@
280266 /* ------------------------------ */
281267
282268
283
-static int snd_opl3_oss_map[MAX_OPL3_VOICES] = {
269
+static const int snd_opl3_oss_map[MAX_OPL3_VOICES] = {
284270 0, 1, 2, 9, 10, 11, 6, 7, 8, 15, 16, 17, 3, 4 ,5, 12, 13, 14
285271 };
286272
....@@ -368,7 +354,7 @@
368354 instr_4op = 1;
369355 break;
370356 }
371
- /* fall through */
357
+ fallthrough;
372358 default:
373359 spin_unlock_irqrestore(&opl3->voice_lock, flags);
374360 return;
....@@ -457,7 +443,7 @@
457443 switch (connection) {
458444 case 0x03:
459445 snd_opl3_calc_volume(&vol_op[2], vel, chan);
460
- /* fallthru */
446
+ fallthrough;
461447 case 0x02:
462448 snd_opl3_calc_volume(&vol_op[0], vel, chan);
463449 break;