.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * ALSA driver for ICEnsemble VT1724 (Envy24HT) |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Copyright (c) 2007 Julian Scheel <julian@jusst.de> |
---|
8 | 9 | * Copyright (c) 2007 allank |
---|
9 | 10 | * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or modify |
---|
12 | | - * it under the terms of the GNU General Public License as published by |
---|
13 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
14 | | - * (at your option) any later version. |
---|
15 | | - * |
---|
16 | | - * This program is distributed in the hope that it will be useful, |
---|
17 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 | | - * GNU General Public License for more details. |
---|
20 | | - * |
---|
21 | | - * You should have received a copy of the GNU General Public License |
---|
22 | | - * along with this program; if not, write to the Free Software |
---|
23 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
24 | | - * |
---|
25 | 11 | */ |
---|
26 | 12 | |
---|
27 | 13 | |
---|
.. | .. |
---|
298 | 284 | static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); |
---|
299 | 285 | static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); |
---|
300 | 286 | |
---|
301 | | -static struct snd_kcontrol_new prodigy_hd2_controls[] = { |
---|
| 287 | +static const struct snd_kcontrol_new prodigy_hd2_controls[] = { |
---|
302 | 288 | { |
---|
303 | 289 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
304 | 290 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | |
---|
.. | .. |
---|
755 | 741 | * mixers |
---|
756 | 742 | */ |
---|
757 | 743 | |
---|
758 | | -static struct snd_kcontrol_new prodigy_hifi_controls[] = { |
---|
| 744 | +static const struct snd_kcontrol_new prodigy_hifi_controls[] = { |
---|
759 | 745 | { |
---|
760 | 746 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
761 | 747 | .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | |
---|
.. | .. |
---|
904 | 890 | |
---|
905 | 891 | static void wm_proc_init(struct snd_ice1712 *ice) |
---|
906 | 892 | { |
---|
907 | | - struct snd_info_entry *entry; |
---|
908 | | - if (!snd_card_proc_new(ice->card, "wm_codec", &entry)) { |
---|
909 | | - snd_info_set_text_ops(entry, ice, wm_proc_regs_read); |
---|
910 | | - entry->mode |= 0200; |
---|
911 | | - entry->c.text.write = wm_proc_regs_write; |
---|
912 | | - } |
---|
| 893 | + snd_card_rw_proc_new(ice->card, "wm_codec", ice, wm_proc_regs_read, |
---|
| 894 | + wm_proc_regs_write); |
---|
913 | 895 | } |
---|
914 | 896 | |
---|
915 | 897 | static int prodigy_hifi_add_controls(struct snd_ice1712 *ice) |
---|
.. | .. |
---|
948 | 930 | |
---|
949 | 931 | static void wm8766_init(struct snd_ice1712 *ice) |
---|
950 | 932 | { |
---|
951 | | - static unsigned short wm8766_inits[] = { |
---|
| 933 | + static const unsigned short wm8766_inits[] = { |
---|
952 | 934 | WM8766_RESET, 0x0000, |
---|
953 | 935 | WM8766_DAC_CTRL, 0x0120, |
---|
954 | 936 | WM8766_INT_CTRL, 0x0022, /* I2S Normal Mode, 24 bit */ |
---|
.. | .. |
---|
971 | 953 | |
---|
972 | 954 | static void wm8776_init(struct snd_ice1712 *ice) |
---|
973 | 955 | { |
---|
974 | | - static unsigned short wm8776_inits[] = { |
---|
| 956 | + static const unsigned short wm8776_inits[] = { |
---|
975 | 957 | /* These come first to reduce init pop noise */ |
---|
976 | 958 | WM_ADC_MUX, 0x0003, /* ADC mute */ |
---|
977 | 959 | /* 0x00c0 replaced by 0x0003 */ |
---|
.. | .. |
---|
991 | 973 | #ifdef CONFIG_PM_SLEEP |
---|
992 | 974 | static int prodigy_hifi_resume(struct snd_ice1712 *ice) |
---|
993 | 975 | { |
---|
994 | | - static unsigned short wm8776_reinit_registers[] = { |
---|
| 976 | + static const unsigned short wm8776_reinit_registers[] = { |
---|
995 | 977 | WM_MASTER_CTRL, |
---|
996 | 978 | WM_DAC_INT, |
---|
997 | 979 | WM_ADC_INT, |
---|
.. | .. |
---|
1051 | 1033 | */ |
---|
1052 | 1034 | static int prodigy_hifi_init(struct snd_ice1712 *ice) |
---|
1053 | 1035 | { |
---|
1054 | | - static unsigned short wm8776_defaults[] = { |
---|
| 1036 | + static const unsigned short wm8776_defaults[] = { |
---|
1055 | 1037 | WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */ |
---|
1056 | 1038 | WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */ |
---|
1057 | 1039 | WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */ |
---|
.. | .. |
---|
1126 | 1108 | */ |
---|
1127 | 1109 | static void ak4396_init(struct snd_ice1712 *ice) |
---|
1128 | 1110 | { |
---|
1129 | | - static unsigned short ak4396_inits[] = { |
---|
| 1111 | + static const unsigned short ak4396_inits[] = { |
---|
1130 | 1112 | AK4396_CTRL1, 0x87, /* I2S Normal Mode, 24 bit */ |
---|
1131 | 1113 | AK4396_CTRL2, 0x02, |
---|
1132 | 1114 | AK4396_CTRL3, 0x00, |
---|
.. | .. |
---|
1198 | 1180 | } |
---|
1199 | 1181 | |
---|
1200 | 1182 | |
---|
1201 | | -static unsigned char prodigy71hifi_eeprom[] = { |
---|
| 1183 | +static const unsigned char prodigy71hifi_eeprom[] = { |
---|
1202 | 1184 | 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ |
---|
1203 | 1185 | 0x80, /* ACLINK: I2S */ |
---|
1204 | 1186 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ |
---|
.. | .. |
---|
1214 | 1196 | 0x00, /* GPIO_STATE2 */ |
---|
1215 | 1197 | }; |
---|
1216 | 1198 | |
---|
1217 | | -static unsigned char prodigyhd2_eeprom[] = { |
---|
| 1199 | +static const unsigned char prodigyhd2_eeprom[] = { |
---|
1218 | 1200 | 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ |
---|
1219 | 1201 | 0x80, /* ACLINK: I2S */ |
---|
1220 | 1202 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ |
---|
.. | .. |
---|
1230 | 1212 | 0x00, /* GPIO_STATE2 */ |
---|
1231 | 1213 | }; |
---|
1232 | 1214 | |
---|
1233 | | -static unsigned char fortissimo4_eeprom[] = { |
---|
| 1215 | +static const unsigned char fortissimo4_eeprom[] = { |
---|
1234 | 1216 | 0x43, /* SYSCONF: clock 512, ADC, 4DACs */ |
---|
1235 | 1217 | 0x80, /* ACLINK: I2S */ |
---|
1236 | 1218 | 0xfc, /* I2S: vol, 96k, 24bit, 192k */ |
---|