forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/pci/ice1712/quartet.c
....@@ -1,25 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA driver for ICEnsemble VT1724 (Envy24HT)
34 *
45 * Lowlevel functions for Infrasonic Quartet
56 *
67 * Copyright (c) 2009 Pavel Hofman <pavel.hofman@ivitera.com>
7
- *
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, write to the Free Software
21
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
- *
238 */
249
2510 #include <linux/delay.h>
....@@ -502,9 +487,7 @@
502487
503488 static void proc_init(struct snd_ice1712 *ice)
504489 {
505
- struct snd_info_entry *entry;
506
- if (!snd_card_proc_new(ice->card, "quartet", &entry))
507
- snd_info_set_text_ops(entry, ice, proc_regs_read);
490
+ snd_card_ro_proc_new(ice->card, "quartet", ice, proc_regs_read);
508491 }
509492
510493 static int qtet_mute_get(struct snd_kcontrol *kcontrol,
....@@ -674,7 +657,7 @@
674657 .get_register = get_##xreg,\
675658 .texts = {xtext1, xtext2} }
676659
677
-static struct qtet_kcontrol_private qtet_privates[] = {
660
+static const struct qtet_kcontrol_private qtet_privates[] = {
678661 PRIV_ENUM2(IN12_SEL, CPLD_IN12_SEL, cpld, "An In 1/2", "An In 3/4"),
679662 PRIV_ENUM2(IN34_SEL, CPLD_IN34_SEL, cpld, "An In 3/4", "IEC958 In"),
680663 PRIV_ENUM2(AIN34_SEL, SCR_AIN34_SEL, scr, "Line In 3/4", "Hi-Z"),
....@@ -737,7 +720,7 @@
737720 .put = qtet_sw_put,\
738721 .private_value = xpriv }
739722
740
-static struct snd_kcontrol_new qtet_controls[] = {
723
+static const struct snd_kcontrol_new qtet_controls[] = {
741724 {
742725 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
743726 .name = "Master Playback Switch",
....@@ -774,7 +757,7 @@
774757 QTET_CONTROL("Output 3/4 to Monitor 1/2", sw, OUT34_MON12),
775758 };
776759
777
-static char *slave_vols[] = {
760
+static const char * const follower_vols[] = {
778761 PCM_12_PLAYBACK_VOLUME,
779762 PCM_34_PLAYBACK_VOLUME,
780763 NULL
....@@ -793,13 +776,13 @@
793776 return snd_ctl_find_id(card, &sid);
794777 }
795778
796
-static void add_slaves(struct snd_card *card,
797
- struct snd_kcontrol *master, char * const *list)
779
+static void add_followers(struct snd_card *card,
780
+ struct snd_kcontrol *master, const char * const *list)
798781 {
799782 for (; *list; list++) {
800
- struct snd_kcontrol *slave = ctl_find(card, *list);
801
- if (slave)
802
- snd_ctl_add_slave(master, slave);
783
+ struct snd_kcontrol *follower = ctl_find(card, *list);
784
+ if (follower)
785
+ snd_ctl_add_follower(master, follower);
803786 }
804787 }
805788
....@@ -823,7 +806,7 @@
823806 qtet_master_db_scale);
824807 if (!vmaster)
825808 return -ENOMEM;
826
- add_slaves(ice->card, vmaster, slave_vols);
809
+ add_followers(ice->card, vmaster, follower_vols);
827810 err = snd_ctl_add(ice->card, vmaster);
828811 if (err < 0)
829812 return err;
....@@ -1070,7 +1053,7 @@
10701053 return 0;
10711054 }
10721055
1073
-static unsigned char qtet_eeprom[] = {
1056
+static const unsigned char qtet_eeprom[] = {
10741057 [ICE_EEP2_SYSCONF] = 0x28, /* clock 256(24MHz), mpu401, 1xADC,
10751058 1xDACs, SPDIF in */
10761059 [ICE_EEP2_ACLINK] = 0x80, /* I2S */