| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
|---|
| 3 | 4 | * and (c) 1999 Steve Ratcliffe <steve@parabola.demon.co.uk> |
|---|
| 4 | 5 | * Copyright (C) 1999-2000 Takashi Iwai <tiwai@suse.de> |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Routines for control of EMU8000 chip |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | | - * GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; if not, write to the Free Software |
|---|
| 20 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 21 | 8 | */ |
|---|
| 22 | 9 | |
|---|
| 23 | 10 | #include <linux/wait.h> |
|---|
| .. | .. |
|---|
| 235 | 222 | /* |
|---|
| 236 | 223 | * initialization arrays; from ADIP |
|---|
| 237 | 224 | */ |
|---|
| 238 | | -static unsigned short init1[128] = { |
|---|
| 225 | +static const unsigned short init1[128] = { |
|---|
| 239 | 226 | 0x03ff, 0x0030, 0x07ff, 0x0130, 0x0bff, 0x0230, 0x0fff, 0x0330, |
|---|
| 240 | 227 | 0x13ff, 0x0430, 0x17ff, 0x0530, 0x1bff, 0x0630, 0x1fff, 0x0730, |
|---|
| 241 | 228 | 0x23ff, 0x0830, 0x27ff, 0x0930, 0x2bff, 0x0a30, 0x2fff, 0x0b30, |
|---|
| .. | .. |
|---|
| 257 | 244 | 0xf3ff, 0x0c30, 0xf7ff, 0x0d30, 0xfbff, 0x0e30, 0xffff, 0x0f30, |
|---|
| 258 | 245 | }; |
|---|
| 259 | 246 | |
|---|
| 260 | | -static unsigned short init2[128] = { |
|---|
| 247 | +static const unsigned short init2[128] = { |
|---|
| 261 | 248 | 0x03ff, 0x8030, 0x07ff, 0x8130, 0x0bff, 0x8230, 0x0fff, 0x8330, |
|---|
| 262 | 249 | 0x13ff, 0x8430, 0x17ff, 0x8530, 0x1bff, 0x8630, 0x1fff, 0x8730, |
|---|
| 263 | 250 | 0x23ff, 0x8830, 0x27ff, 0x8930, 0x2bff, 0x8a30, 0x2fff, 0x8b30, |
|---|
| .. | .. |
|---|
| 279 | 266 | 0xf3ff, 0x8c30, 0xf7ff, 0x8d30, 0xfbff, 0x8e30, 0xffff, 0x8f30, |
|---|
| 280 | 267 | }; |
|---|
| 281 | 268 | |
|---|
| 282 | | -static unsigned short init3[128] = { |
|---|
| 269 | +static const unsigned short init3[128] = { |
|---|
| 283 | 270 | 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5, |
|---|
| 284 | 271 | 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x8F7C, 0x167E, 0xF254, |
|---|
| 285 | 272 | 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x8BAA, 0x1B6D, 0xF234, |
|---|
| .. | .. |
|---|
| 301 | 288 | 0x1342, 0xD36E, 0x3EC7, 0xB3FF, 0x0000, 0x8365, 0x1420, 0x9570, |
|---|
| 302 | 289 | }; |
|---|
| 303 | 290 | |
|---|
| 304 | | -static unsigned short init4[128] = { |
|---|
| 291 | +static const unsigned short init4[128] = { |
|---|
| 305 | 292 | 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5, |
|---|
| 306 | 293 | 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x0F7C, 0x167E, 0x7254, |
|---|
| 307 | 294 | 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x0BAA, 0x1B6D, 0x7234, |
|---|
| .. | .. |
|---|
| 328 | 315 | * is meant to work |
|---|
| 329 | 316 | */ |
|---|
| 330 | 317 | static void |
|---|
| 331 | | -send_array(struct snd_emu8000 *emu, unsigned short *data, int size) |
|---|
| 318 | +send_array(struct snd_emu8000 *emu, const unsigned short *data, int size) |
|---|
| 332 | 319 | { |
|---|
| 333 | 320 | int i; |
|---|
| 334 | | - unsigned short *p; |
|---|
| 321 | + const unsigned short *p; |
|---|
| 335 | 322 | |
|---|
| 336 | 323 | p = data; |
|---|
| 337 | 324 | for (i = 0; i < size; i++, p++) |
|---|
| .. | .. |
|---|
| 561 | 548 | * Bass/Treble Equalizer |
|---|
| 562 | 549 | *----------------------------------------------------------------*/ |
|---|
| 563 | 550 | |
|---|
| 564 | | -static unsigned short bass_parm[12][3] = { |
|---|
| 551 | +static const unsigned short bass_parm[12][3] = { |
|---|
| 565 | 552 | {0xD26A, 0xD36A, 0x0000}, /* -12 dB */ |
|---|
| 566 | 553 | {0xD25B, 0xD35B, 0x0000}, /* -8 */ |
|---|
| 567 | 554 | {0xD24C, 0xD34C, 0x0000}, /* -6 */ |
|---|
| .. | .. |
|---|
| 576 | 563 | {0xC26A, 0xC36A, 0x0002}, /* +12 dB */ |
|---|
| 577 | 564 | }; |
|---|
| 578 | 565 | |
|---|
| 579 | | -static unsigned short treble_parm[12][9] = { |
|---|
| 566 | +static const unsigned short treble_parm[12][9] = { |
|---|
| 580 | 567 | {0x821E, 0xC26A, 0x031E, 0xC36A, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, /* -12 dB */ |
|---|
| 581 | 568 | {0x821E, 0xC25B, 0x031E, 0xC35B, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, |
|---|
| 582 | 569 | {0x821E, 0xC24C, 0x031E, 0xC34C, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, |
|---|
| .. | .. |
|---|
| 868 | 855 | return change; |
|---|
| 869 | 856 | } |
|---|
| 870 | 857 | |
|---|
| 871 | | -static struct snd_kcontrol_new mixer_bass_control = |
|---|
| 858 | +static const struct snd_kcontrol_new mixer_bass_control = |
|---|
| 872 | 859 | { |
|---|
| 873 | 860 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 874 | 861 | .name = "Synth Tone Control - Bass", |
|---|
| .. | .. |
|---|
| 878 | 865 | .private_value = 0, |
|---|
| 879 | 866 | }; |
|---|
| 880 | 867 | |
|---|
| 881 | | -static struct snd_kcontrol_new mixer_treble_control = |
|---|
| 868 | +static const struct snd_kcontrol_new mixer_treble_control = |
|---|
| 882 | 869 | { |
|---|
| 883 | 870 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 884 | 871 | .name = "Synth Tone Control - Treble", |
|---|
| .. | .. |
|---|
| 935 | 922 | return change; |
|---|
| 936 | 923 | } |
|---|
| 937 | 924 | |
|---|
| 938 | | -static struct snd_kcontrol_new mixer_chorus_mode_control = |
|---|
| 925 | +static const struct snd_kcontrol_new mixer_chorus_mode_control = |
|---|
| 939 | 926 | { |
|---|
| 940 | 927 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 941 | 928 | .name = "Chorus Mode", |
|---|
| .. | .. |
|---|
| 945 | 932 | .private_value = 1, |
|---|
| 946 | 933 | }; |
|---|
| 947 | 934 | |
|---|
| 948 | | -static struct snd_kcontrol_new mixer_reverb_mode_control = |
|---|
| 935 | +static const struct snd_kcontrol_new mixer_reverb_mode_control = |
|---|
| 949 | 936 | { |
|---|
| 950 | 937 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 951 | 938 | .name = "Reverb Mode", |
|---|
| .. | .. |
|---|
| 997 | 984 | return change; |
|---|
| 998 | 985 | } |
|---|
| 999 | 986 | |
|---|
| 1000 | | -static struct snd_kcontrol_new mixer_fm_chorus_depth_control = |
|---|
| 987 | +static const struct snd_kcontrol_new mixer_fm_chorus_depth_control = |
|---|
| 1001 | 988 | { |
|---|
| 1002 | 989 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 1003 | 990 | .name = "FM Chorus Depth", |
|---|
| .. | .. |
|---|
| 1007 | 994 | .private_value = 1, |
|---|
| 1008 | 995 | }; |
|---|
| 1009 | 996 | |
|---|
| 1010 | | -static struct snd_kcontrol_new mixer_fm_reverb_depth_control = |
|---|
| 997 | +static const struct snd_kcontrol_new mixer_fm_reverb_depth_control = |
|---|
| 1011 | 998 | { |
|---|
| 1012 | 999 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 1013 | 1000 | .name = "FM Reverb Depth", |
|---|
| .. | .. |
|---|
| 1018 | 1005 | }; |
|---|
| 1019 | 1006 | |
|---|
| 1020 | 1007 | |
|---|
| 1021 | | -static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = { |
|---|
| 1008 | +static const struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = { |
|---|
| 1022 | 1009 | &mixer_bass_control, |
|---|
| 1023 | 1010 | &mixer_treble_control, |
|---|
| 1024 | 1011 | &mixer_chorus_mode_control, |
|---|
| .. | .. |
|---|
| 1090 | 1077 | struct snd_seq_device *awe; |
|---|
| 1091 | 1078 | struct snd_emu8000 *hw; |
|---|
| 1092 | 1079 | int err; |
|---|
| 1093 | | - static struct snd_device_ops ops = { |
|---|
| 1080 | + static const struct snd_device_ops ops = { |
|---|
| 1094 | 1081 | .dev_free = snd_emu8000_dev_free, |
|---|
| 1095 | 1082 | }; |
|---|
| 1096 | 1083 | |
|---|