.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * ALSA driver for ICEnsemble VT1724 (Envy24HT) |
---|
3 | 4 | * |
---|
4 | 5 | * Lowlevel functions for Infrasonic Quartet |
---|
5 | 6 | * |
---|
6 | 7 | * 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 | | - * |
---|
23 | 8 | */ |
---|
24 | 9 | |
---|
25 | 10 | #include <linux/delay.h> |
---|
.. | .. |
---|
502 | 487 | |
---|
503 | 488 | static void proc_init(struct snd_ice1712 *ice) |
---|
504 | 489 | { |
---|
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); |
---|
508 | 491 | } |
---|
509 | 492 | |
---|
510 | 493 | static int qtet_mute_get(struct snd_kcontrol *kcontrol, |
---|
.. | .. |
---|
674 | 657 | .get_register = get_##xreg,\ |
---|
675 | 658 | .texts = {xtext1, xtext2} } |
---|
676 | 659 | |
---|
677 | | -static struct qtet_kcontrol_private qtet_privates[] = { |
---|
| 660 | +static const struct qtet_kcontrol_private qtet_privates[] = { |
---|
678 | 661 | PRIV_ENUM2(IN12_SEL, CPLD_IN12_SEL, cpld, "An In 1/2", "An In 3/4"), |
---|
679 | 662 | PRIV_ENUM2(IN34_SEL, CPLD_IN34_SEL, cpld, "An In 3/4", "IEC958 In"), |
---|
680 | 663 | PRIV_ENUM2(AIN34_SEL, SCR_AIN34_SEL, scr, "Line In 3/4", "Hi-Z"), |
---|
.. | .. |
---|
737 | 720 | .put = qtet_sw_put,\ |
---|
738 | 721 | .private_value = xpriv } |
---|
739 | 722 | |
---|
740 | | -static struct snd_kcontrol_new qtet_controls[] = { |
---|
| 723 | +static const struct snd_kcontrol_new qtet_controls[] = { |
---|
741 | 724 | { |
---|
742 | 725 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
743 | 726 | .name = "Master Playback Switch", |
---|
.. | .. |
---|
774 | 757 | QTET_CONTROL("Output 3/4 to Monitor 1/2", sw, OUT34_MON12), |
---|
775 | 758 | }; |
---|
776 | 759 | |
---|
777 | | -static char *slave_vols[] = { |
---|
| 760 | +static const char * const follower_vols[] = { |
---|
778 | 761 | PCM_12_PLAYBACK_VOLUME, |
---|
779 | 762 | PCM_34_PLAYBACK_VOLUME, |
---|
780 | 763 | NULL |
---|
.. | .. |
---|
793 | 776 | return snd_ctl_find_id(card, &sid); |
---|
794 | 777 | } |
---|
795 | 778 | |
---|
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) |
---|
798 | 781 | { |
---|
799 | 782 | 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); |
---|
803 | 786 | } |
---|
804 | 787 | } |
---|
805 | 788 | |
---|
.. | .. |
---|
823 | 806 | qtet_master_db_scale); |
---|
824 | 807 | if (!vmaster) |
---|
825 | 808 | return -ENOMEM; |
---|
826 | | - add_slaves(ice->card, vmaster, slave_vols); |
---|
| 809 | + add_followers(ice->card, vmaster, follower_vols); |
---|
827 | 810 | err = snd_ctl_add(ice->card, vmaster); |
---|
828 | 811 | if (err < 0) |
---|
829 | 812 | return err; |
---|
.. | .. |
---|
1070 | 1053 | return 0; |
---|
1071 | 1054 | } |
---|
1072 | 1055 | |
---|
1073 | | -static unsigned char qtet_eeprom[] = { |
---|
| 1056 | +static const unsigned char qtet_eeprom[] = { |
---|
1074 | 1057 | [ICE_EEP2_SYSCONF] = 0x28, /* clock 256(24MHz), mpu401, 1xADC, |
---|
1075 | 1058 | 1xDACs, SPDIF in */ |
---|
1076 | 1059 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
---|