hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/sound/isa/opti9xx/opti92x-ad1848.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 card-opti92x-ad1848.c - driver for OPTi 82c92x based soundcards.
34 Copyright (C) 1998-2000 by Massimo Piccioni <dafastidio@libero.it>
....@@ -7,19 +8,6 @@
78
89 Thanks to Maria Grazia Pollarini, Salvatore Vassallo.
910
10
- This program is free software; you can redistribute it and/or modify
11
- it under the terms of the GNU General Public License as published by
12
- the Free Software Foundation; either version 2 of the License, or
13
- (at your option) any later version.
14
-
15
- This program is distributed in the hope that it will be useful,
16
- but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- GNU General Public License for more details.
19
-
20
- You should have received a copy of the GNU General Public License
21
- along with this program; if not, write to the Free Software
22
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2311 */
2412
2513
....@@ -175,7 +163,7 @@
175163
176164 #define DEV_NAME KBUILD_MODNAME
177165
178
-static char * snd_opti9xx_names[] = {
166
+static const char * const snd_opti9xx_names[] = {
179167 "unknown",
180168 "82C928", "82C929",
181169 "82C924", "82C925",
....@@ -185,7 +173,7 @@
185173 static int snd_opti9xx_init(struct snd_opti9xx *chip,
186174 unsigned short hardware)
187175 {
188
- static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
176
+ static const int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
189177
190178 chip->hardware = hardware;
191179 strcpy(chip->name, snd_opti9xx_names[hardware]);
....@@ -261,7 +249,7 @@
261249 retval = inb(chip->mc_base + 9);
262250 break;
263251 }
264
- /* Fall through */
252
+ fallthrough;
265253
266254 case OPTi9XX_HW_82C928:
267255 case OPTi9XX_HW_82C929:
....@@ -304,7 +292,7 @@
304292 outb(value, chip->mc_base + 9);
305293 break;
306294 }
307
- /* Fall through */
295
+ fallthrough;
308296
309297 case OPTi9XX_HW_82C928:
310298 case OPTi9XX_HW_82C929:
....@@ -355,7 +343,7 @@
355343 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(4), 0xf0, 0xfc);
356344 /* enable wave audio */
357345 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(6), 0x02, 0x02);
358
- /* Fall through */
346
+ fallthrough;
359347
360348 case OPTi9XX_HW_82C925:
361349 /* enable WSS mode */
....@@ -392,7 +380,9 @@
392380 case OPTi9XX_HW_82C931:
393381 /* disable 3D sound (set GPIO1 as output, low) */
394382 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(20), 0x04, 0x0c);
395
- case OPTi9XX_HW_82C933: /* FALL THROUGH */
383
+ fallthrough;
384
+
385
+ case OPTi9XX_HW_82C933:
396386 /*
397387 * The BTC 1817DW has QS1000 wavetable which is connected
398388 * to the serial digital input of the OPTI931.
....@@ -403,7 +393,9 @@
403393 * or digital input signal.
404394 */
405395 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(26), 0x01, 0x01);
406
- case OPTi9XX_HW_82C930: /* FALL THROUGH */
396
+ fallthrough;
397
+
398
+ case OPTi9XX_HW_82C930:
407399 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(6), 0x02, 0x03);
408400 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(3), 0x00, 0xff);
409401 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(4), 0x10 |
....@@ -563,7 +555,7 @@
563555 static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0);
564556 static const DECLARE_TLV_DB_SCALE(db_scale_4bit_12db_max, -3300, 300, 0);
565557
566
-static struct snd_kcontrol_new snd_opti93x_controls[] = {
558
+static const struct snd_kcontrol_new snd_opti93x_controls[] = {
567559 WSS_DOUBLE("Master Playback Switch", 0,
568560 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),
569561 WSS_DOUBLE_TLV("Master Playback Volume", 0,
....@@ -821,7 +813,7 @@
821813
822814 static int snd_opti9xx_probe(struct snd_card *card)
823815 {
824
- static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
816
+ static const long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
825817 int error;
826818 int xdma2;
827819 struct snd_opti9xx *chip = card->private_data;
....@@ -882,6 +874,7 @@
882874 }
883875 #endif
884876 chip->irq = irq;
877
+ card->sync_irq = chip->irq;
885878 strcpy(card->driver, chip->name);
886879 sprintf(card->shortname, "OPTi %s", card->driver);
887880 #if defined(CS4231) || defined(OPTi93X)
....@@ -970,16 +963,16 @@
970963 {
971964 struct snd_card *card;
972965 int error;
973
- static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1};
966
+ static const long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1};
974967 #ifdef OPTi93X
975
- static int possible_irqs[] = {5, 9, 10, 11, 7, -1};
968
+ static const int possible_irqs[] = {5, 9, 10, 11, 7, -1};
976969 #else
977
- static int possible_irqs[] = {9, 10, 11, 7, -1};
970
+ static const int possible_irqs[] = {9, 10, 11, 7, -1};
978971 #endif /* OPTi93X */
979
- static int possible_mpu_irqs[] = {5, 9, 10, 7, -1};
980
- static int possible_dma1s[] = {3, 1, 0, -1};
972
+ static const int possible_mpu_irqs[] = {5, 9, 10, 7, -1};
973
+ static const int possible_dma1s[] = {3, 1, 0, -1};
981974 #if defined(CS4231) || defined(OPTi93X)
982
- static int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}};
975
+ static const int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}};
983976 #endif /* CS4231 || OPTi93X */
984977
985978 if (mpu_port == SNDRV_AUTO_PORT) {