hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/sound/pci/emu10k1/emumixer.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 * Takashi Iwai <tiwai@suse.de>
....@@ -13,21 +14,6 @@
1314 *
1415 * TODO:
1516 * --
16
- *
17
- * This program is free software; you can redistribute it and/or modify
18
- * it under the terms of the GNU General Public License as published by
19
- * the Free Software Foundation; either version 2 of the License, or
20
- * (at your option) any later version.
21
- *
22
- * This program is distributed in the hope that it will be useful,
23
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- * GNU General Public License for more details.
26
- *
27
- * You should have received a copy of the GNU General Public License
28
- * along with this program; if not, write to the Free Software
29
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30
- *
3117 */
3218
3319 #include <linux/time.h>
....@@ -197,7 +183,7 @@
197183 /*
198184 * List of data sources available for each destination
199185 */
200
-static unsigned int emu1010_src_regs[] = {
186
+static const unsigned int emu1010_src_regs[] = {
201187 EMU_SRC_SILENCE,/* 0 */
202188 EMU_SRC_DOCK_MIC_A1, /* 1 */
203189 EMU_SRC_DOCK_MIC_B1, /* 2 */
....@@ -254,7 +240,7 @@
254240 };
255241
256242 /* 1616(m) cardbus */
257
-static unsigned int emu1616_src_regs[] = {
243
+static const unsigned int emu1616_src_regs[] = {
258244 EMU_SRC_SILENCE,
259245 EMU_SRC_DOCK_MIC_A1,
260246 EMU_SRC_DOCK_MIC_B1,
....@@ -310,7 +296,7 @@
310296 * Data destinations - physical EMU outputs.
311297 * Each destination has an enum mixer control to choose a data source
312298 */
313
-static unsigned int emu1010_output_dst[] = {
299
+static const unsigned int emu1010_output_dst[] = {
314300 EMU_DST_DOCK_DAC1_LEFT1, /* 0 */
315301 EMU_DST_DOCK_DAC1_RIGHT1, /* 1 */
316302 EMU_DST_DOCK_DAC2_LEFT1, /* 2 */
....@@ -338,7 +324,7 @@
338324 };
339325
340326 /* 1616(m) cardbus */
341
-static unsigned int emu1616_output_dst[] = {
327
+static const unsigned int emu1616_output_dst[] = {
342328 EMU_DST_DOCK_DAC1_LEFT1,
343329 EMU_DST_DOCK_DAC1_RIGHT1,
344330 EMU_DST_DOCK_DAC2_LEFT1,
....@@ -364,7 +350,7 @@
364350 * capture (EMU32 + I2S links)
365351 * Each destination has an enum mixer control to choose a data source
366352 */
367
-static unsigned int emu1010_input_dst[] = {
353
+static const unsigned int emu1010_input_dst[] = {
368354 EMU_DST_ALICE2_EMU32_0,
369355 EMU_DST_ALICE2_EMU32_1,
370356 EMU_DST_ALICE2_EMU32_2,
....@@ -498,7 +484,7 @@
498484 .private_value = chid \
499485 }
500486
501
-static struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = {
487
+static const struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = {
502488 EMU1010_SOURCE_OUTPUT("Dock DAC1 Left Playback Enum", 0),
503489 EMU1010_SOURCE_OUTPUT("Dock DAC1 Right Playback Enum", 1),
504490 EMU1010_SOURCE_OUTPUT("Dock DAC2 Left Playback Enum", 2),
....@@ -527,7 +513,7 @@
527513
528514
529515 /* 1616(m) cardbus */
530
-static struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = {
516
+static const struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = {
531517 EMU1010_SOURCE_OUTPUT("Dock DAC1 Left Playback Enum", 0),
532518 EMU1010_SOURCE_OUTPUT("Dock DAC1 Right Playback Enum", 1),
533519 EMU1010_SOURCE_OUTPUT("Dock DAC2 Left Playback Enum", 2),
....@@ -559,7 +545,7 @@
559545 .private_value = chid \
560546 }
561547
562
-static struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = {
548
+static const struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = {
563549 EMU1010_SOURCE_INPUT("DSP 0 Capture Enum", 0),
564550 EMU1010_SOURCE_INPUT("DSP 1 Capture Enum", 1),
565551 EMU1010_SOURCE_INPUT("DSP 2 Capture Enum", 2),
....@@ -627,7 +613,7 @@
627613 .private_value = chid \
628614 }
629615
630
-static struct snd_kcontrol_new snd_emu1010_adc_pads[] = {
616
+static const struct snd_kcontrol_new snd_emu1010_adc_pads[] = {
631617 EMU1010_ADC_PADS("ADC1 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD1),
632618 EMU1010_ADC_PADS("ADC2 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD2),
633619 EMU1010_ADC_PADS("ADC3 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD3),
....@@ -675,7 +661,7 @@
675661 .private_value = chid \
676662 }
677663
678
-static struct snd_kcontrol_new snd_emu1010_dac_pads[] = {
664
+static const struct snd_kcontrol_new snd_emu1010_dac_pads[] = {
679665 EMU1010_DAC_PADS("DAC1 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD1),
680666 EMU1010_DAC_PADS("DAC2 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD2),
681667 EMU1010_DAC_PADS("DAC3 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD3),
....@@ -1065,7 +1051,7 @@
10651051 }
10661052
10671053
1068
-static struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = {
1054
+static const struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = {
10691055 I2C_VOLUME("Mic Capture Volume", 0),
10701056 I2C_VOLUME("Line Capture Volume", 0)
10711057 };
....@@ -1139,7 +1125,7 @@
11391125 return change;
11401126 }
11411127
1142
-static struct snd_kcontrol_new snd_audigy_spdif_output_rate =
1128
+static const struct snd_kcontrol_new snd_audigy_spdif_output_rate =
11431129 {
11441130 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
11451131 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
....@@ -1792,8 +1778,8 @@
17921778 int err, pcm;
17931779 struct snd_kcontrol *kctl;
17941780 struct snd_card *card = emu->card;
1795
- char **c;
1796
- static char *emu10k1_remove_ctls[] = {
1781
+ const char * const *c;
1782
+ static const char * const emu10k1_remove_ctls[] = {
17971783 /* no AC97 mono, surround, center/lfe */
17981784 "Master Mono Playback Switch",
17991785 "Master Mono Playback Volume",
....@@ -1807,13 +1793,13 @@
18071793 "LFE Playback Volume",
18081794 NULL
18091795 };
1810
- static char *emu10k1_rename_ctls[] = {
1796
+ static const char * const emu10k1_rename_ctls[] = {
18111797 "Surround Digital Playback Volume", "Surround Playback Volume",
18121798 "Center Digital Playback Volume", "Center Playback Volume",
18131799 "LFE Digital Playback Volume", "LFE Playback Volume",
18141800 NULL
18151801 };
1816
- static char *audigy_remove_ctls[] = {
1802
+ static const char * const audigy_remove_ctls[] = {
18171803 /* Master/PCM controls on ac97 of Audigy has no effect */
18181804 /* On the Audigy2 the AC97 playback is piped into
18191805 * the Philips ADC for 24bit capture */
....@@ -1840,7 +1826,7 @@
18401826 "External Amplifier",
18411827 NULL
18421828 };
1843
- static char *audigy_rename_ctls[] = {
1829
+ static const char * const audigy_rename_ctls[] = {
18441830 /* use conventional names */
18451831 "Wave Playback Volume", "PCM Playback Volume",
18461832 /* "Wave Capture Volume", "PCM Capture Volume", */
....@@ -1850,7 +1836,7 @@
18501836 "Master Mono Playback Volume", "Phone Output Playback Volume",
18511837 NULL
18521838 };
1853
- static char *audigy_rename_ctls_i2c_adc[] = {
1839
+ static const char * const audigy_rename_ctls_i2c_adc[] = {
18541840 //"Analog Mix Capture Volume","OLD Analog Mix Capture Volume",
18551841 "Line Capture Volume", "Analog Mix Capture Volume",
18561842 "Wave Playback Volume", "OLD PCM Playback Volume",
....@@ -1859,7 +1845,7 @@
18591845 "CD Capture Volume", "IEC958 Optical Capture Volume",
18601846 NULL
18611847 };
1862
- static char *audigy_remove_ctls_i2c_adc[] = {
1848
+ static const char * const audigy_remove_ctls_i2c_adc[] = {
18631849 /* On the Audigy2 ZS Notebook
18641850 * Capture via WM8775 */
18651851 "Mic Capture Volume",
....@@ -1868,7 +1854,7 @@
18681854 "IEC958 Optical Capture Volume",
18691855 NULL
18701856 };
1871
- static char *audigy_remove_ctls_1361t_adc[] = {
1857
+ static const char * const audigy_remove_ctls_1361t_adc[] = {
18721858 /* On the Audigy2 the AC97 playback is piped into
18731859 * the Philips ADC for 24bit capture */
18741860 "PCM Playback Switch",
....@@ -1886,7 +1872,7 @@
18861872 "Line2 Capture Volume",
18871873 NULL
18881874 };
1889
- static char *audigy_rename_ctls_1361t_adc[] = {
1875
+ static const char * const audigy_rename_ctls_1361t_adc[] = {
18901876 "Master Playback Switch", "Master Capture Switch",
18911877 "Master Playback Volume", "Master Capture Volume",
18921878 "Wave Master Playback Volume", "Master Playback Volume",
....@@ -1912,7 +1898,7 @@
19121898 if (emu->card_capabilities->ac97_chip) {
19131899 struct snd_ac97_bus *pbus;
19141900 struct snd_ac97_template ac97;
1915
- static struct snd_ac97_bus_ops ops = {
1901
+ static const struct snd_ac97_bus_ops ops = {
19161902 .write = snd_emu10k1_ac97_write,
19171903 .read = snd_emu10k1_ac97_read,
19181904 };