.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Tascam US-16x08 ALSA driver |
---|
3 | 4 | * |
---|
4 | 5 | * 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 | | - * |
---|
16 | 6 | */ |
---|
17 | 7 | |
---|
18 | 8 | #include <linux/slab.h> |
---|
.. | .. |
---|
339 | 329 | elem->cached |= 1; |
---|
340 | 330 | elem->cache_val[0] = val; |
---|
341 | 331 | } 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); |
---|
343 | 333 | } |
---|
344 | 334 | |
---|
345 | 335 | return err > 0 ? 1 : 0; |
---|
.. | .. |
---|
770 | 760 | return 1; |
---|
771 | 761 | } |
---|
772 | 762 | |
---|
773 | | -static struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { |
---|
| 763 | +static const struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { |
---|
774 | 764 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
775 | 765 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
776 | 766 | .count = 16, |
---|
.. | .. |
---|
780 | 770 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) |
---|
781 | 771 | }; |
---|
782 | 772 | |
---|
783 | | -static struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { |
---|
| 773 | +static const struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { |
---|
784 | 774 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
785 | 775 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
786 | 776 | .count = 16, |
---|
.. | .. |
---|
790 | 780 | .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133) |
---|
791 | 781 | }; |
---|
792 | 782 | |
---|
793 | | -static struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { |
---|
| 783 | +static const struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { |
---|
794 | 784 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
795 | 785 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
796 | 786 | .count = 16, |
---|
.. | .. |
---|
800 | 790 | .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 255) |
---|
801 | 791 | }; |
---|
802 | 792 | |
---|
803 | | -static struct snd_kcontrol_new snd_us16x08_master_ctl = { |
---|
| 793 | +static const struct snd_kcontrol_new snd_us16x08_master_ctl = { |
---|
804 | 794 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
805 | 795 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
806 | 796 | .count = 1, |
---|
.. | .. |
---|
810 | 800 | .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133) |
---|
811 | 801 | }; |
---|
812 | 802 | |
---|
813 | | -static struct snd_kcontrol_new snd_us16x08_route_ctl = { |
---|
| 803 | +static const struct snd_kcontrol_new snd_us16x08_route_ctl = { |
---|
814 | 804 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
815 | 805 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
816 | 806 | .count = 8, |
---|
.. | .. |
---|
820 | 810 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 9) |
---|
821 | 811 | }; |
---|
822 | 812 | |
---|
823 | | -static struct snd_kcontrol_new snd_us16x08_bus_ctl = { |
---|
| 813 | +static const struct snd_kcontrol_new snd_us16x08_bus_ctl = { |
---|
824 | 814 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
825 | 815 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
826 | 816 | .count = 1, |
---|
.. | .. |
---|
830 | 820 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) |
---|
831 | 821 | }; |
---|
832 | 822 | |
---|
833 | | -static struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { |
---|
| 823 | +static const struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { |
---|
834 | 824 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
835 | 825 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
836 | 826 | .count = 16, |
---|
.. | .. |
---|
840 | 830 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) |
---|
841 | 831 | }; |
---|
842 | 832 | |
---|
843 | | -static struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { |
---|
| 833 | +static const struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { |
---|
844 | 834 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
845 | 835 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
846 | 836 | .count = 16, |
---|
.. | .. |
---|
851 | 841 | 0, 0x20) |
---|
852 | 842 | }; |
---|
853 | 843 | |
---|
854 | | -static struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { |
---|
| 844 | +static const struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { |
---|
855 | 845 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
856 | 846 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
857 | 847 | .count = 16, |
---|
.. | .. |
---|
862 | 852 | sizeof(ratio_map) - 1), /*max*/ |
---|
863 | 853 | }; |
---|
864 | 854 | |
---|
865 | | -static struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { |
---|
| 855 | +static const struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { |
---|
866 | 856 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
867 | 857 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
868 | 858 | .count = 16, |
---|
.. | .. |
---|
872 | 862 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x14) |
---|
873 | 863 | }; |
---|
874 | 864 | |
---|
875 | | -static struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { |
---|
| 865 | +static const struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { |
---|
876 | 866 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
877 | 867 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
878 | 868 | .count = 16, |
---|
.. | .. |
---|
883 | 873 | SND_US16X08_KCSET(SND_US16X08_COMP_ATTACK_BIAS, 1, 0, 0xc6), |
---|
884 | 874 | }; |
---|
885 | 875 | |
---|
886 | | -static struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { |
---|
| 876 | +static const struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { |
---|
887 | 877 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
888 | 878 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
889 | 879 | .count = 16, |
---|
.. | .. |
---|
894 | 884 | SND_US16X08_KCSET(SND_US16X08_COMP_RELEASE_BIAS, 1, 0, 0x63), |
---|
895 | 885 | }; |
---|
896 | 886 | |
---|
897 | | -static struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { |
---|
| 887 | +static const struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { |
---|
898 | 888 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
899 | 889 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
900 | 890 | .count = 16, |
---|
.. | .. |
---|
904 | 894 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 24), |
---|
905 | 895 | }; |
---|
906 | 896 | |
---|
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 = { |
---|
908 | 898 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
909 | 899 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
910 | 900 | .count = 16, |
---|
.. | .. |
---|
914 | 904 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x1F), |
---|
915 | 905 | }; |
---|
916 | 906 | |
---|
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 = { |
---|
918 | 908 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
919 | 909 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
920 | 910 | .count = 16, |
---|
.. | .. |
---|
924 | 914 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x3F) |
---|
925 | 915 | }; |
---|
926 | 916 | |
---|
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 = { |
---|
928 | 918 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
929 | 919 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
930 | 920 | .count = 16, |
---|
.. | .. |
---|
934 | 924 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x06) |
---|
935 | 925 | }; |
---|
936 | 926 | |
---|
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 = { |
---|
938 | 928 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
939 | 929 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
940 | 930 | .count = 16, |
---|
.. | .. |
---|
945 | 935 | SND_US16X08_KCSET(SND_US16X08_EQ_HIGHFREQ_BIAS, 1, 0, 0x1F) |
---|
946 | 936 | }; |
---|
947 | 937 | |
---|
948 | | -static struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { |
---|
| 938 | +static const struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { |
---|
949 | 939 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
950 | 940 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
951 | 941 | .count = 16, |
---|
.. | .. |
---|
955 | 945 | .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) |
---|
956 | 946 | }; |
---|
957 | 947 | |
---|
958 | | -static struct snd_kcontrol_new snd_us16x08_meter_ctl = { |
---|
| 948 | +static const struct snd_kcontrol_new snd_us16x08_meter_ctl = { |
---|
959 | 949 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
960 | 950 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
961 | 951 | .count = 1, |
---|
.. | .. |
---|
1119 | 1109 | .control_id = SND_US16X08_ID_EQLOWFREQ, |
---|
1120 | 1110 | .type = USB_MIXER_U8, |
---|
1121 | 1111 | .num_channels = 16, |
---|
1122 | | - .name = "EQ Low Frequence", |
---|
| 1112 | + .name = "EQ Low Frequency", |
---|
1123 | 1113 | }, |
---|
1124 | 1114 | { /* EQ mid low gain */ |
---|
1125 | 1115 | .kcontrol_new = &snd_us16x08_eq_gain_ctl, |
---|
.. | .. |
---|
1133 | 1123 | .control_id = SND_US16X08_ID_EQLOWMIDFREQ, |
---|
1134 | 1124 | .type = USB_MIXER_U8, |
---|
1135 | 1125 | .num_channels = 16, |
---|
1136 | | - .name = "EQ MidLow Frequence", |
---|
| 1126 | + .name = "EQ MidLow Frequency", |
---|
1137 | 1127 | }, |
---|
1138 | 1128 | { /* EQ mid low Q */ |
---|
1139 | 1129 | .kcontrol_new = &snd_us16x08_eq_mid_width_ctl, |
---|
.. | .. |
---|
1154 | 1144 | .control_id = SND_US16X08_ID_EQHIGHMIDFREQ, |
---|
1155 | 1145 | .type = USB_MIXER_U8, |
---|
1156 | 1146 | .num_channels = 16, |
---|
1157 | | - .name = "EQ MidHigh Frequence", |
---|
| 1147 | + .name = "EQ MidHigh Frequency", |
---|
1158 | 1148 | }, |
---|
1159 | 1149 | { /* EQ mid high Q */ |
---|
1160 | 1150 | .kcontrol_new = &snd_us16x08_eq_mid_width_ctl, |
---|
.. | .. |
---|
1175 | 1165 | .control_id = SND_US16X08_ID_EQHIGHFREQ, |
---|
1176 | 1166 | .type = USB_MIXER_U8, |
---|
1177 | 1167 | .num_channels = 16, |
---|
1178 | | - .name = "EQ High Frequence", |
---|
| 1168 | + .name = "EQ High Frequency", |
---|
1179 | 1169 | }, |
---|
1180 | 1170 | }; |
---|
1181 | 1171 | |
---|