hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/sound/usb/mixer_us16x08.c
....@@ -1,18 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Tascam US-16x08 ALSA driver
34 *
45 * Copyright (c) 2016 by Detlef Urban (onkel@paraair.de)
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
- *
166 */
177
188 #include <linux/slab.h>
....@@ -339,7 +329,7 @@
339329 elem->cached |= 1;
340330 elem->cache_val[0] = val;
341331 } else {
342
- usb_audio_dbg(chip, "Failed to set buss param, err:%d\n", err);
332
+ usb_audio_dbg(chip, "Failed to set bus parameter, err:%d\n", err);
343333 }
344334
345335 return err > 0 ? 1 : 0;
....@@ -770,7 +760,7 @@
770760 return 1;
771761 }
772762
773
-static struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = {
763
+static const struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = {
774764 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
775765 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
776766 .count = 16,
....@@ -780,7 +770,7 @@
780770 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1)
781771 };
782772
783
-static struct snd_kcontrol_new snd_us16x08_ch_int_ctl = {
773
+static const struct snd_kcontrol_new snd_us16x08_ch_int_ctl = {
784774 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
785775 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
786776 .count = 16,
....@@ -790,7 +780,7 @@
790780 .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133)
791781 };
792782
793
-static struct snd_kcontrol_new snd_us16x08_pan_int_ctl = {
783
+static const struct snd_kcontrol_new snd_us16x08_pan_int_ctl = {
794784 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
795785 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
796786 .count = 16,
....@@ -800,7 +790,7 @@
800790 .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 255)
801791 };
802792
803
-static struct snd_kcontrol_new snd_us16x08_master_ctl = {
793
+static const struct snd_kcontrol_new snd_us16x08_master_ctl = {
804794 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
805795 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
806796 .count = 1,
....@@ -810,7 +800,7 @@
810800 .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133)
811801 };
812802
813
-static struct snd_kcontrol_new snd_us16x08_route_ctl = {
803
+static const struct snd_kcontrol_new snd_us16x08_route_ctl = {
814804 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
815805 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
816806 .count = 8,
....@@ -820,7 +810,7 @@
820810 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 9)
821811 };
822812
823
-static struct snd_kcontrol_new snd_us16x08_bus_ctl = {
813
+static const struct snd_kcontrol_new snd_us16x08_bus_ctl = {
824814 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
825815 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
826816 .count = 1,
....@@ -830,7 +820,7 @@
830820 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1)
831821 };
832822
833
-static struct snd_kcontrol_new snd_us16x08_compswitch_ctl = {
823
+static const struct snd_kcontrol_new snd_us16x08_compswitch_ctl = {
834824 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
835825 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
836826 .count = 16,
....@@ -840,7 +830,7 @@
840830 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1)
841831 };
842832
843
-static struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = {
833
+static const struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = {
844834 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
845835 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
846836 .count = 16,
....@@ -851,7 +841,7 @@
851841 0, 0x20)
852842 };
853843
854
-static struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = {
844
+static const struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = {
855845 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
856846 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
857847 .count = 16,
....@@ -862,7 +852,7 @@
862852 sizeof(ratio_map) - 1), /*max*/
863853 };
864854
865
-static struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = {
855
+static const struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = {
866856 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
867857 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
868858 .count = 16,
....@@ -872,7 +862,7 @@
872862 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x14)
873863 };
874864
875
-static struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = {
865
+static const struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = {
876866 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
877867 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
878868 .count = 16,
....@@ -883,7 +873,7 @@
883873 SND_US16X08_KCSET(SND_US16X08_COMP_ATTACK_BIAS, 1, 0, 0xc6),
884874 };
885875
886
-static struct snd_kcontrol_new snd_us16x08_comp_release_ctl = {
876
+static const struct snd_kcontrol_new snd_us16x08_comp_release_ctl = {
887877 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
888878 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
889879 .count = 16,
....@@ -894,7 +884,7 @@
894884 SND_US16X08_KCSET(SND_US16X08_COMP_RELEASE_BIAS, 1, 0, 0x63),
895885 };
896886
897
-static struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = {
887
+static const struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = {
898888 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
899889 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
900890 .count = 16,
....@@ -904,7 +894,7 @@
904894 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 24),
905895 };
906896
907
-static struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = {
897
+static const struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = {
908898 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
909899 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
910900 .count = 16,
....@@ -914,7 +904,7 @@
914904 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x1F),
915905 };
916906
917
-static struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = {
907
+static const struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = {
918908 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
919909 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
920910 .count = 16,
....@@ -924,7 +914,7 @@
924914 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x3F)
925915 };
926916
927
-static struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = {
917
+static const struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = {
928918 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
929919 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
930920 .count = 16,
....@@ -934,7 +924,7 @@
934924 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x06)
935925 };
936926
937
-static struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = {
927
+static const struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = {
938928 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
939929 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
940930 .count = 16,
....@@ -945,7 +935,7 @@
945935 SND_US16X08_KCSET(SND_US16X08_EQ_HIGHFREQ_BIAS, 1, 0, 0x1F)
946936 };
947937
948
-static struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = {
938
+static const struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = {
949939 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
950940 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
951941 .count = 16,
....@@ -955,7 +945,7 @@
955945 .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1)
956946 };
957947
958
-static struct snd_kcontrol_new snd_us16x08_meter_ctl = {
948
+static const struct snd_kcontrol_new snd_us16x08_meter_ctl = {
959949 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
960950 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
961951 .count = 1,
....@@ -1119,7 +1109,7 @@
11191109 .control_id = SND_US16X08_ID_EQLOWFREQ,
11201110 .type = USB_MIXER_U8,
11211111 .num_channels = 16,
1122
- .name = "EQ Low Frequence",
1112
+ .name = "EQ Low Frequency",
11231113 },
11241114 { /* EQ mid low gain */
11251115 .kcontrol_new = &snd_us16x08_eq_gain_ctl,
....@@ -1133,7 +1123,7 @@
11331123 .control_id = SND_US16X08_ID_EQLOWMIDFREQ,
11341124 .type = USB_MIXER_U8,
11351125 .num_channels = 16,
1136
- .name = "EQ MidLow Frequence",
1126
+ .name = "EQ MidLow Frequency",
11371127 },
11381128 { /* EQ mid low Q */
11391129 .kcontrol_new = &snd_us16x08_eq_mid_width_ctl,
....@@ -1154,7 +1144,7 @@
11541144 .control_id = SND_US16X08_ID_EQHIGHMIDFREQ,
11551145 .type = USB_MIXER_U8,
11561146 .num_channels = 16,
1157
- .name = "EQ MidHigh Frequence",
1147
+ .name = "EQ MidHigh Frequency",
11581148 },
11591149 { /* EQ mid high Q */
11601150 .kcontrol_new = &snd_us16x08_eq_mid_width_ctl,
....@@ -1175,7 +1165,7 @@
11751165 .control_id = SND_US16X08_ID_EQHIGHFREQ,
11761166 .type = USB_MIXER_U8,
11771167 .num_channels = 16,
1178
- .name = "EQ High Frequence",
1168
+ .name = "EQ High Frequency",
11791169 },
11801170 };
11811171