.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, |
---|
3 | 4 | * Takashi Iwai <tiwai@suse.de> |
---|
.. | .. |
---|
13 | 14 | * |
---|
14 | 15 | * TODO: |
---|
15 | 16 | * -- |
---|
16 | | - * |
---|
17 | | - * This program is free software; you can redistribute it and/or modify |
---|
18 | | - * it under the terms of the GNU General Public License as published by |
---|
19 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
20 | | - * (at your option) any later version. |
---|
21 | | - * |
---|
22 | | - * This program is distributed in the hope that it will be useful, |
---|
23 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
24 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
25 | | - * GNU General Public License for more details. |
---|
26 | | - * |
---|
27 | | - * You should have received a copy of the GNU General Public License |
---|
28 | | - * along with this program; if not, write to the Free Software |
---|
29 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
30 | | - * |
---|
31 | 17 | */ |
---|
32 | 18 | |
---|
33 | 19 | #include <linux/time.h> |
---|
.. | .. |
---|
197 | 183 | /* |
---|
198 | 184 | * List of data sources available for each destination |
---|
199 | 185 | */ |
---|
200 | | -static unsigned int emu1010_src_regs[] = { |
---|
| 186 | +static const unsigned int emu1010_src_regs[] = { |
---|
201 | 187 | EMU_SRC_SILENCE,/* 0 */ |
---|
202 | 188 | EMU_SRC_DOCK_MIC_A1, /* 1 */ |
---|
203 | 189 | EMU_SRC_DOCK_MIC_B1, /* 2 */ |
---|
.. | .. |
---|
254 | 240 | }; |
---|
255 | 241 | |
---|
256 | 242 | /* 1616(m) cardbus */ |
---|
257 | | -static unsigned int emu1616_src_regs[] = { |
---|
| 243 | +static const unsigned int emu1616_src_regs[] = { |
---|
258 | 244 | EMU_SRC_SILENCE, |
---|
259 | 245 | EMU_SRC_DOCK_MIC_A1, |
---|
260 | 246 | EMU_SRC_DOCK_MIC_B1, |
---|
.. | .. |
---|
310 | 296 | * Data destinations - physical EMU outputs. |
---|
311 | 297 | * Each destination has an enum mixer control to choose a data source |
---|
312 | 298 | */ |
---|
313 | | -static unsigned int emu1010_output_dst[] = { |
---|
| 299 | +static const unsigned int emu1010_output_dst[] = { |
---|
314 | 300 | EMU_DST_DOCK_DAC1_LEFT1, /* 0 */ |
---|
315 | 301 | EMU_DST_DOCK_DAC1_RIGHT1, /* 1 */ |
---|
316 | 302 | EMU_DST_DOCK_DAC2_LEFT1, /* 2 */ |
---|
.. | .. |
---|
338 | 324 | }; |
---|
339 | 325 | |
---|
340 | 326 | /* 1616(m) cardbus */ |
---|
341 | | -static unsigned int emu1616_output_dst[] = { |
---|
| 327 | +static const unsigned int emu1616_output_dst[] = { |
---|
342 | 328 | EMU_DST_DOCK_DAC1_LEFT1, |
---|
343 | 329 | EMU_DST_DOCK_DAC1_RIGHT1, |
---|
344 | 330 | EMU_DST_DOCK_DAC2_LEFT1, |
---|
.. | .. |
---|
364 | 350 | * capture (EMU32 + I2S links) |
---|
365 | 351 | * Each destination has an enum mixer control to choose a data source |
---|
366 | 352 | */ |
---|
367 | | -static unsigned int emu1010_input_dst[] = { |
---|
| 353 | +static const unsigned int emu1010_input_dst[] = { |
---|
368 | 354 | EMU_DST_ALICE2_EMU32_0, |
---|
369 | 355 | EMU_DST_ALICE2_EMU32_1, |
---|
370 | 356 | EMU_DST_ALICE2_EMU32_2, |
---|
.. | .. |
---|
498 | 484 | .private_value = chid \ |
---|
499 | 485 | } |
---|
500 | 486 | |
---|
501 | | -static struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = { |
---|
| 487 | +static const struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = { |
---|
502 | 488 | EMU1010_SOURCE_OUTPUT("Dock DAC1 Left Playback Enum", 0), |
---|
503 | 489 | EMU1010_SOURCE_OUTPUT("Dock DAC1 Right Playback Enum", 1), |
---|
504 | 490 | EMU1010_SOURCE_OUTPUT("Dock DAC2 Left Playback Enum", 2), |
---|
.. | .. |
---|
527 | 513 | |
---|
528 | 514 | |
---|
529 | 515 | /* 1616(m) cardbus */ |
---|
530 | | -static struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { |
---|
| 516 | +static const struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { |
---|
531 | 517 | EMU1010_SOURCE_OUTPUT("Dock DAC1 Left Playback Enum", 0), |
---|
532 | 518 | EMU1010_SOURCE_OUTPUT("Dock DAC1 Right Playback Enum", 1), |
---|
533 | 519 | EMU1010_SOURCE_OUTPUT("Dock DAC2 Left Playback Enum", 2), |
---|
.. | .. |
---|
559 | 545 | .private_value = chid \ |
---|
560 | 546 | } |
---|
561 | 547 | |
---|
562 | | -static struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = { |
---|
| 548 | +static const struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = { |
---|
563 | 549 | EMU1010_SOURCE_INPUT("DSP 0 Capture Enum", 0), |
---|
564 | 550 | EMU1010_SOURCE_INPUT("DSP 1 Capture Enum", 1), |
---|
565 | 551 | EMU1010_SOURCE_INPUT("DSP 2 Capture Enum", 2), |
---|
.. | .. |
---|
627 | 613 | .private_value = chid \ |
---|
628 | 614 | } |
---|
629 | 615 | |
---|
630 | | -static struct snd_kcontrol_new snd_emu1010_adc_pads[] = { |
---|
| 616 | +static const struct snd_kcontrol_new snd_emu1010_adc_pads[] = { |
---|
631 | 617 | EMU1010_ADC_PADS("ADC1 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD1), |
---|
632 | 618 | EMU1010_ADC_PADS("ADC2 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD2), |
---|
633 | 619 | EMU1010_ADC_PADS("ADC3 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD3), |
---|
.. | .. |
---|
675 | 661 | .private_value = chid \ |
---|
676 | 662 | } |
---|
677 | 663 | |
---|
678 | | -static struct snd_kcontrol_new snd_emu1010_dac_pads[] = { |
---|
| 664 | +static const struct snd_kcontrol_new snd_emu1010_dac_pads[] = { |
---|
679 | 665 | EMU1010_DAC_PADS("DAC1 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD1), |
---|
680 | 666 | EMU1010_DAC_PADS("DAC2 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD2), |
---|
681 | 667 | EMU1010_DAC_PADS("DAC3 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD3), |
---|
.. | .. |
---|
1065 | 1051 | } |
---|
1066 | 1052 | |
---|
1067 | 1053 | |
---|
1068 | | -static struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { |
---|
| 1054 | +static const struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { |
---|
1069 | 1055 | I2C_VOLUME("Mic Capture Volume", 0), |
---|
1070 | 1056 | I2C_VOLUME("Line Capture Volume", 0) |
---|
1071 | 1057 | }; |
---|
.. | .. |
---|
1139 | 1125 | return change; |
---|
1140 | 1126 | } |
---|
1141 | 1127 | |
---|
1142 | | -static struct snd_kcontrol_new snd_audigy_spdif_output_rate = |
---|
| 1128 | +static const struct snd_kcontrol_new snd_audigy_spdif_output_rate = |
---|
1143 | 1129 | { |
---|
1144 | 1130 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
---|
1145 | 1131 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
.. | .. |
---|
1792 | 1778 | int err, pcm; |
---|
1793 | 1779 | struct snd_kcontrol *kctl; |
---|
1794 | 1780 | struct snd_card *card = emu->card; |
---|
1795 | | - char **c; |
---|
1796 | | - static char *emu10k1_remove_ctls[] = { |
---|
| 1781 | + const char * const *c; |
---|
| 1782 | + static const char * const emu10k1_remove_ctls[] = { |
---|
1797 | 1783 | /* no AC97 mono, surround, center/lfe */ |
---|
1798 | 1784 | "Master Mono Playback Switch", |
---|
1799 | 1785 | "Master Mono Playback Volume", |
---|
.. | .. |
---|
1807 | 1793 | "LFE Playback Volume", |
---|
1808 | 1794 | NULL |
---|
1809 | 1795 | }; |
---|
1810 | | - static char *emu10k1_rename_ctls[] = { |
---|
| 1796 | + static const char * const emu10k1_rename_ctls[] = { |
---|
1811 | 1797 | "Surround Digital Playback Volume", "Surround Playback Volume", |
---|
1812 | 1798 | "Center Digital Playback Volume", "Center Playback Volume", |
---|
1813 | 1799 | "LFE Digital Playback Volume", "LFE Playback Volume", |
---|
1814 | 1800 | NULL |
---|
1815 | 1801 | }; |
---|
1816 | | - static char *audigy_remove_ctls[] = { |
---|
| 1802 | + static const char * const audigy_remove_ctls[] = { |
---|
1817 | 1803 | /* Master/PCM controls on ac97 of Audigy has no effect */ |
---|
1818 | 1804 | /* On the Audigy2 the AC97 playback is piped into |
---|
1819 | 1805 | * the Philips ADC for 24bit capture */ |
---|
.. | .. |
---|
1840 | 1826 | "External Amplifier", |
---|
1841 | 1827 | NULL |
---|
1842 | 1828 | }; |
---|
1843 | | - static char *audigy_rename_ctls[] = { |
---|
| 1829 | + static const char * const audigy_rename_ctls[] = { |
---|
1844 | 1830 | /* use conventional names */ |
---|
1845 | 1831 | "Wave Playback Volume", "PCM Playback Volume", |
---|
1846 | 1832 | /* "Wave Capture Volume", "PCM Capture Volume", */ |
---|
.. | .. |
---|
1850 | 1836 | "Master Mono Playback Volume", "Phone Output Playback Volume", |
---|
1851 | 1837 | NULL |
---|
1852 | 1838 | }; |
---|
1853 | | - static char *audigy_rename_ctls_i2c_adc[] = { |
---|
| 1839 | + static const char * const audigy_rename_ctls_i2c_adc[] = { |
---|
1854 | 1840 | //"Analog Mix Capture Volume","OLD Analog Mix Capture Volume", |
---|
1855 | 1841 | "Line Capture Volume", "Analog Mix Capture Volume", |
---|
1856 | 1842 | "Wave Playback Volume", "OLD PCM Playback Volume", |
---|
.. | .. |
---|
1859 | 1845 | "CD Capture Volume", "IEC958 Optical Capture Volume", |
---|
1860 | 1846 | NULL |
---|
1861 | 1847 | }; |
---|
1862 | | - static char *audigy_remove_ctls_i2c_adc[] = { |
---|
| 1848 | + static const char * const audigy_remove_ctls_i2c_adc[] = { |
---|
1863 | 1849 | /* On the Audigy2 ZS Notebook |
---|
1864 | 1850 | * Capture via WM8775 */ |
---|
1865 | 1851 | "Mic Capture Volume", |
---|
.. | .. |
---|
1868 | 1854 | "IEC958 Optical Capture Volume", |
---|
1869 | 1855 | NULL |
---|
1870 | 1856 | }; |
---|
1871 | | - static char *audigy_remove_ctls_1361t_adc[] = { |
---|
| 1857 | + static const char * const audigy_remove_ctls_1361t_adc[] = { |
---|
1872 | 1858 | /* On the Audigy2 the AC97 playback is piped into |
---|
1873 | 1859 | * the Philips ADC for 24bit capture */ |
---|
1874 | 1860 | "PCM Playback Switch", |
---|
.. | .. |
---|
1886 | 1872 | "Line2 Capture Volume", |
---|
1887 | 1873 | NULL |
---|
1888 | 1874 | }; |
---|
1889 | | - static char *audigy_rename_ctls_1361t_adc[] = { |
---|
| 1875 | + static const char * const audigy_rename_ctls_1361t_adc[] = { |
---|
1890 | 1876 | "Master Playback Switch", "Master Capture Switch", |
---|
1891 | 1877 | "Master Playback Volume", "Master Capture Volume", |
---|
1892 | 1878 | "Wave Master Playback Volume", "Master Playback Volume", |
---|
.. | .. |
---|
1912 | 1898 | if (emu->card_capabilities->ac97_chip) { |
---|
1913 | 1899 | struct snd_ac97_bus *pbus; |
---|
1914 | 1900 | struct snd_ac97_template ac97; |
---|
1915 | | - static struct snd_ac97_bus_ops ops = { |
---|
| 1901 | + static const struct snd_ac97_bus_ops ops = { |
---|
1916 | 1902 | .write = snd_emu10k1_ac97_write, |
---|
1917 | 1903 | .read = snd_emu10k1_ac97_read, |
---|
1918 | 1904 | }; |
---|