forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/pci/ice1712/prodigy_hifi.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA driver for ICEnsemble VT1724 (Envy24HT)
34 *
....@@ -7,21 +8,6 @@
78 * Copyright (c) 2007 Julian Scheel <julian@jusst.de>
89 * Copyright (c) 2007 allank
910 * 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
- *
2511 */
2612
2713
....@@ -298,7 +284,7 @@
298284 static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1);
299285 static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);
300286
301
-static struct snd_kcontrol_new prodigy_hd2_controls[] = {
287
+static const struct snd_kcontrol_new prodigy_hd2_controls[] = {
302288 {
303289 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
304290 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
....@@ -755,7 +741,7 @@
755741 * mixers
756742 */
757743
758
-static struct snd_kcontrol_new prodigy_hifi_controls[] = {
744
+static const struct snd_kcontrol_new prodigy_hifi_controls[] = {
759745 {
760746 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
761747 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
....@@ -904,12 +890,8 @@
904890
905891 static void wm_proc_init(struct snd_ice1712 *ice)
906892 {
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);
913895 }
914896
915897 static int prodigy_hifi_add_controls(struct snd_ice1712 *ice)
....@@ -948,7 +930,7 @@
948930
949931 static void wm8766_init(struct snd_ice1712 *ice)
950932 {
951
- static unsigned short wm8766_inits[] = {
933
+ static const unsigned short wm8766_inits[] = {
952934 WM8766_RESET, 0x0000,
953935 WM8766_DAC_CTRL, 0x0120,
954936 WM8766_INT_CTRL, 0x0022, /* I2S Normal Mode, 24 bit */
....@@ -971,7 +953,7 @@
971953
972954 static void wm8776_init(struct snd_ice1712 *ice)
973955 {
974
- static unsigned short wm8776_inits[] = {
956
+ static const unsigned short wm8776_inits[] = {
975957 /* These come first to reduce init pop noise */
976958 WM_ADC_MUX, 0x0003, /* ADC mute */
977959 /* 0x00c0 replaced by 0x0003 */
....@@ -991,7 +973,7 @@
991973 #ifdef CONFIG_PM_SLEEP
992974 static int prodigy_hifi_resume(struct snd_ice1712 *ice)
993975 {
994
- static unsigned short wm8776_reinit_registers[] = {
976
+ static const unsigned short wm8776_reinit_registers[] = {
995977 WM_MASTER_CTRL,
996978 WM_DAC_INT,
997979 WM_ADC_INT,
....@@ -1051,7 +1033,7 @@
10511033 */
10521034 static int prodigy_hifi_init(struct snd_ice1712 *ice)
10531035 {
1054
- static unsigned short wm8776_defaults[] = {
1036
+ static const unsigned short wm8776_defaults[] = {
10551037 WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */
10561038 WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */
10571039 WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */
....@@ -1126,7 +1108,7 @@
11261108 */
11271109 static void ak4396_init(struct snd_ice1712 *ice)
11281110 {
1129
- static unsigned short ak4396_inits[] = {
1111
+ static const unsigned short ak4396_inits[] = {
11301112 AK4396_CTRL1, 0x87, /* I2S Normal Mode, 24 bit */
11311113 AK4396_CTRL2, 0x02,
11321114 AK4396_CTRL3, 0x00,
....@@ -1198,7 +1180,7 @@
11981180 }
11991181
12001182
1201
-static unsigned char prodigy71hifi_eeprom[] = {
1183
+static const unsigned char prodigy71hifi_eeprom[] = {
12021184 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */
12031185 0x80, /* ACLINK: I2S */
12041186 0xfc, /* I2S: vol, 96k, 24bit, 192k */
....@@ -1214,7 +1196,7 @@
12141196 0x00, /* GPIO_STATE2 */
12151197 };
12161198
1217
-static unsigned char prodigyhd2_eeprom[] = {
1199
+static const unsigned char prodigyhd2_eeprom[] = {
12181200 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */
12191201 0x80, /* ACLINK: I2S */
12201202 0xfc, /* I2S: vol, 96k, 24bit, 192k */
....@@ -1230,7 +1212,7 @@
12301212 0x00, /* GPIO_STATE2 */
12311213 };
12321214
1233
-static unsigned char fortissimo4_eeprom[] = {
1215
+static const unsigned char fortissimo4_eeprom[] = {
12341216 0x43, /* SYSCONF: clock 512, ADC, 4DACs */
12351217 0x80, /* ACLINK: I2S */
12361218 0xfc, /* I2S: vol, 96k, 24bit, 192k */