| .. | .. |
|---|
| 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) 2009 Takashi Iwai <tiwai@suse.de> |
|---|
| 7 | 8 | * Based on the patches by Rainer Zimmermann <mail@lightshed.de> |
|---|
| 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 | 9 | */ |
|---|
| 24 | 10 | |
|---|
| 25 | 11 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 130 | 116 | unsigned char mux_bits[2]; /* extra bits for ADC mute */ |
|---|
| 131 | 117 | }; |
|---|
| 132 | 118 | |
|---|
| 133 | | -static struct maya_vol_info vol_info[WM_NUM_VOLS] = { |
|---|
| 119 | +static const struct maya_vol_info vol_info[WM_NUM_VOLS] = { |
|---|
| 134 | 120 | [WM_VOL_HP] = { |
|---|
| 135 | 121 | .maxval = 80, |
|---|
| 136 | 122 | .regs = { WM8776_REG_HEADPHONE_L, WM8776_REG_HEADPHONE_R }, |
|---|
| .. | .. |
|---|
| 172 | 158 | struct snd_ctl_elem_info *uinfo) |
|---|
| 173 | 159 | { |
|---|
| 174 | 160 | unsigned int idx = kcontrol->private_value; |
|---|
| 175 | | - struct maya_vol_info *vol = &vol_info[idx]; |
|---|
| 161 | + const struct maya_vol_info *vol = &vol_info[idx]; |
|---|
| 176 | 162 | |
|---|
| 177 | 163 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
|---|
| 178 | 164 | uinfo->count = 2; |
|---|
| .. | .. |
|---|
| 203 | 189 | struct snd_wm8776 *wm = |
|---|
| 204 | 190 | &chip->wm[snd_ctl_get_ioff(kcontrol, &ucontrol->id)]; |
|---|
| 205 | 191 | unsigned int idx = kcontrol->private_value; |
|---|
| 206 | | - struct maya_vol_info *vol = &vol_info[idx]; |
|---|
| 192 | + const struct maya_vol_info *vol = &vol_info[idx]; |
|---|
| 207 | 193 | unsigned int val, data; |
|---|
| 208 | 194 | int ch, changed = 0; |
|---|
| 209 | 195 | |
|---|
| .. | .. |
|---|
| 438 | 424 | * controls to be added |
|---|
| 439 | 425 | */ |
|---|
| 440 | 426 | |
|---|
| 441 | | -static struct snd_kcontrol_new maya_controls[] = { |
|---|
| 427 | +static const struct snd_kcontrol_new maya_controls[] = { |
|---|
| 442 | 428 | { |
|---|
| 443 | 429 | .name = "Crossmix Playback Volume", |
|---|
| 444 | 430 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| .. | .. |
|---|
| 676 | 662 | /* |
|---|
| 677 | 663 | * chip addresses on I2C bus |
|---|
| 678 | 664 | */ |
|---|
| 679 | | -static unsigned char wm8776_addr[2] = { |
|---|
| 665 | +static const unsigned char wm8776_addr[2] = { |
|---|
| 680 | 666 | 0x34, 0x36, /* codec 0 & 1 */ |
|---|
| 681 | 667 | }; |
|---|
| 682 | 668 | |
|---|
| .. | .. |
|---|
| 726 | 712 | * hence the driver needs to sets up it properly. |
|---|
| 727 | 713 | */ |
|---|
| 728 | 714 | |
|---|
| 729 | | -static unsigned char maya44_eeprom[] = { |
|---|
| 715 | +static const unsigned char maya44_eeprom[] = { |
|---|
| 730 | 716 | [ICE_EEP2_SYSCONF] = 0x45, |
|---|
| 731 | 717 | /* clock xin1=49.152MHz, mpu401, 2 stereo ADCs+DACs */ |
|---|
| 732 | 718 | [ICE_EEP2_ACLINK] = 0x80, |
|---|