.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * ALSA driver for ICEnsemble VT1724 (Envy24HT) |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz> |
---|
7 | 8 | * 2008 Pavel Hofman <dustin@seznam.cz> |
---|
8 | | - * |
---|
9 | | - * |
---|
10 | | - * This program is free software; you can redistribute it and/or modify |
---|
11 | | - * it under the terms of the GNU General Public License as published by |
---|
12 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
13 | | - * (at your option) any later version. |
---|
14 | | - * |
---|
15 | | - * This program is distributed in the hope that it will be useful, |
---|
16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | | - * GNU General Public License for more details. |
---|
19 | | - * |
---|
20 | | - * You should have received a copy of the GNU General Public License |
---|
21 | | - * along with this program; if not, write to the Free Software |
---|
22 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
23 | | - * |
---|
24 | 9 | */ |
---|
25 | 10 | |
---|
26 | 11 | #include <linux/delay.h> |
---|
.. | .. |
---|
358 | 343 | return 0; |
---|
359 | 344 | } |
---|
360 | 345 | |
---|
361 | | -static struct snd_kcontrol_new juli_mute_controls[] = { |
---|
| 346 | +static const struct snd_kcontrol_new juli_mute_controls[] = { |
---|
362 | 347 | { |
---|
363 | 348 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
364 | 349 | .name = "Master Playback Switch", |
---|
.. | .. |
---|
412 | 397 | }, |
---|
413 | 398 | }; |
---|
414 | 399 | |
---|
415 | | -static char *slave_vols[] = { |
---|
| 400 | +static const char * const follower_vols[] = { |
---|
416 | 401 | PCM_VOLUME, |
---|
417 | 402 | MONITOR_AN_IN_VOLUME, |
---|
418 | 403 | MONITOR_DIG_IN_VOLUME, |
---|
.. | .. |
---|
433 | 418 | return snd_ctl_find_id(card, &sid); |
---|
434 | 419 | } |
---|
435 | 420 | |
---|
436 | | -static void add_slaves(struct snd_card *card, |
---|
437 | | - struct snd_kcontrol *master, |
---|
438 | | - char * const *list) |
---|
| 421 | +static void add_followers(struct snd_card *card, |
---|
| 422 | + struct snd_kcontrol *master, |
---|
| 423 | + const char * const *list) |
---|
439 | 424 | { |
---|
440 | 425 | for (; *list; list++) { |
---|
441 | | - struct snd_kcontrol *slave = ctl_find(card, *list); |
---|
442 | | - /* dev_dbg(card->dev, "add_slaves - %s\n", *list); */ |
---|
443 | | - if (slave) { |
---|
444 | | - /* dev_dbg(card->dev, "slave %s found\n", *list); */ |
---|
445 | | - snd_ctl_add_slave(master, slave); |
---|
| 426 | + struct snd_kcontrol *follower = ctl_find(card, *list); |
---|
| 427 | + /* dev_dbg(card->dev, "add_followers - %s\n", *list); */ |
---|
| 428 | + if (follower) { |
---|
| 429 | + /* dev_dbg(card->dev, "follower %s found\n", *list); */ |
---|
| 430 | + snd_ctl_add_follower(master, follower); |
---|
446 | 431 | } |
---|
447 | 432 | } |
---|
448 | 433 | } |
---|
.. | .. |
---|
469 | 454 | juli_master_db_scale); |
---|
470 | 455 | if (!vmaster) |
---|
471 | 456 | return -ENOMEM; |
---|
472 | | - add_slaves(ice->card, vmaster, slave_vols); |
---|
| 457 | + add_followers(ice->card, vmaster, follower_vols); |
---|
473 | 458 | err = snd_ctl_add(ice->card, vmaster); |
---|
474 | 459 | if (err < 0) |
---|
475 | 460 | return err; |
---|
.. | .. |
---|
666 | 651 | * hence the driver needs to sets up it properly. |
---|
667 | 652 | */ |
---|
668 | 653 | |
---|
669 | | -static unsigned char juli_eeprom[] = { |
---|
| 654 | +static const unsigned char juli_eeprom[] = { |
---|
670 | 655 | [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, 1xADC, 1xDACs, |
---|
671 | 656 | SPDIF in */ |
---|
672 | 657 | [ICE_EEP2_ACLINK] = 0x80, /* I2S */ |
---|