hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/isa/opti9xx/miro.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA soundcard driver for Miro miroSOUND PCM1 pro
34 * miroSOUND PCM12
....@@ -6,20 +7,6 @@
67 * Copyright (C) 2004-2005 Martin Langer <martin-langer@gmx.de>
78 *
89 * Based on OSS ACI and ALSA OPTi9xx drivers
9
- *
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
2310 */
2411
2512 #include <linux/init.h>
....@@ -132,7 +119,7 @@
132119
133120 static struct snd_miro_aci aci_device;
134121
135
-static char * snd_opti9xx_names[] = {
122
+static const char * const snd_opti9xx_names[] = {
136123 "unknown",
137124 "82C928", "82C929",
138125 "82C924", "82C925",
....@@ -176,13 +163,13 @@
176163 switch (timeout-ACI_MINTIME) {
177164 case 0 ... 9:
178165 out /= 10;
179
- /* fall through */
166
+ fallthrough;
180167 case 10 ... 19:
181168 out /= 10;
182
- /* fall through */
169
+ fallthrough;
183170 case 20 ... 30:
184171 out /= 10;
185
- /* fall through */
172
+ fallthrough;
186173 default:
187174 set_current_state(TASK_UNINTERRUPTIBLE);
188175 schedule_timeout(out);
....@@ -590,7 +577,7 @@
590577 return change;
591578 }
592579
593
-static struct snd_kcontrol_new snd_miro_controls[] = {
580
+static const struct snd_kcontrol_new snd_miro_controls[] = {
594581 MIRO_DOUBLE("Master Playback Volume", 0, ACI_GET_MASTER, ACI_SET_MASTER),
595582 MIRO_DOUBLE("Mic Playback Volume", 1, ACI_GET_MIC, ACI_SET_MIC),
596583 MIRO_DOUBLE("Line Playback Volume", 1, ACI_GET_LINE, ACI_SET_LINE),
....@@ -602,7 +589,7 @@
602589
603590 /* Equalizer with seven bands (only PCM20)
604591 from -12dB up to +12dB on each band */
605
-static struct snd_kcontrol_new snd_miro_eq_controls[] = {
592
+static const struct snd_kcontrol_new snd_miro_eq_controls[] = {
606593 MIRO_DOUBLE("Tone Control - 28 Hz", 0, ACI_GET_EQ1, ACI_SET_EQ1),
607594 MIRO_DOUBLE("Tone Control - 160 Hz", 0, ACI_GET_EQ2, ACI_SET_EQ2),
608595 MIRO_DOUBLE("Tone Control - 400 Hz", 0, ACI_GET_EQ3, ACI_SET_EQ3),
....@@ -612,15 +599,15 @@
612599 MIRO_DOUBLE("Tone Control - 16 kHz", 0, ACI_GET_EQ7, ACI_SET_EQ7),
613600 };
614601
615
-static struct snd_kcontrol_new snd_miro_radio_control[] = {
602
+static const struct snd_kcontrol_new snd_miro_radio_control[] = {
616603 MIRO_DOUBLE("Radio Playback Volume", 0, ACI_GET_LINE1, ACI_SET_LINE1),
617604 };
618605
619
-static struct snd_kcontrol_new snd_miro_line_control[] = {
606
+static const struct snd_kcontrol_new snd_miro_line_control[] = {
620607 MIRO_DOUBLE("Line Playback Volume", 2, ACI_GET_LINE1, ACI_SET_LINE1),
621608 };
622609
623
-static struct snd_kcontrol_new snd_miro_preamp_control[] = {
610
+static const struct snd_kcontrol_new snd_miro_preamp_control[] = {
624611 {
625612 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
626613 .name = "Mic Boost",
....@@ -630,7 +617,7 @@
630617 .put = snd_miro_put_preamp,
631618 }};
632619
633
-static struct snd_kcontrol_new snd_miro_amp_control[] = {
620
+static const struct snd_kcontrol_new snd_miro_amp_control[] = {
634621 {
635622 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
636623 .name = "Line Boost",
....@@ -640,7 +627,7 @@
640627 .put = snd_miro_put_amp,
641628 }};
642629
643
-static struct snd_kcontrol_new snd_miro_capture_control[] = {
630
+static const struct snd_kcontrol_new snd_miro_capture_control[] = {
644631 {
645632 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
646633 .name = "PCM Capture Switch",
....@@ -650,7 +637,7 @@
650637 .put = snd_miro_put_capture,
651638 }};
652639
653
-static unsigned char aci_init_values[][2] = {
640
+static const unsigned char aci_init_values[][2] = {
654641 { ACI_SET_MUTE, 0x00 },
655642 { ACI_SET_POWERAMP, 0x00 },
656643 { ACI_SET_PREAMP, 0x00 },
....@@ -777,7 +764,7 @@
777764 static int snd_miro_init(struct snd_miro *chip,
778765 unsigned short hardware)
779766 {
780
- static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
767
+ static const int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
781768
782769 chip->hardware = hardware;
783770 strcpy(chip->name, snd_opti9xx_names[hardware]);
....@@ -837,7 +824,7 @@
837824 retval = inb(chip->mc_base + 9);
838825 break;
839826 }
840
- /* fall through */
827
+ fallthrough;
841828
842829 case OPTi9XX_HW_82C929:
843830 retval = inb(chip->mc_base + reg);
....@@ -867,7 +854,7 @@
867854 outb(value, chip->mc_base + 9);
868855 break;
869856 }
870
- /* fall through */
857
+ fallthrough;
871858
872859 case OPTi9XX_HW_82C929:
873860 outb(value, chip->mc_base + reg);
....@@ -1000,10 +987,7 @@
1000987 static void snd_miro_proc_init(struct snd_card *card,
1001988 struct snd_miro *miro)
1002989 {
1003
- struct snd_info_entry *entry;
1004
-
1005
- if (!snd_card_proc_new(card, "miro", &entry))
1006
- snd_info_set_text_ops(entry, miro, snd_miro_proc_read);
990
+ snd_card_ro_proc_new(card, "miro", miro, snd_miro_proc_read);
1007991 }
1008992
1009993 /*
....@@ -1406,12 +1390,12 @@
14061390
14071391 static int snd_miro_isa_probe(struct device *devptr, unsigned int n)
14081392 {
1409
- static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
1410
- static long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1};
1411
- static int possible_irqs[] = {11, 9, 10, 7, -1};
1412
- static int possible_mpu_irqs[] = {10, 5, 9, 7, -1};
1413
- static int possible_dma1s[] = {3, 1, 0, -1};
1414
- static int possible_dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1},
1393
+ static const long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
1394
+ static const long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1};
1395
+ static const int possible_irqs[] = {11, 9, 10, 7, -1};
1396
+ static const int possible_mpu_irqs[] = {10, 5, 9, 7, -1};
1397
+ static const int possible_dma1s[] = {3, 1, 0, -1};
1398
+ static const int possible_dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1},
14151399 {0, -1} };
14161400
14171401 int error;