hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/core/jack.c
....@@ -1,22 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Jack abstraction layer
34 *
45 * Copyright 2008 Wolfson Microelectronics
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- *
206 */
217
228 #include <linux/input.h>
....@@ -33,17 +19,13 @@
3319 };
3420
3521 #ifdef CONFIG_SND_JACK_INPUT_DEV
36
-static int jack_switch_types[] = {
22
+static const int jack_switch_types[SND_JACK_SWITCH_TYPES] = {
3723 SW_HEADPHONE_INSERT,
3824 SW_MICROPHONE_INSERT,
3925 SW_LINEOUT_INSERT,
4026 SW_JACK_PHYSICAL_INSERT,
4127 SW_VIDEOOUT_INSERT,
4228 SW_LINEIN_INSERT,
43
- SW_HPHL_OVERCURRENT,
44
- SW_HPHR_OVERCURRENT,
45
- SW_UNSUPPORT_INSERT,
46
- SW_MICROPHONE2_INSERT,
4729 };
4830 #endif /* CONFIG_SND_JACK_INPUT_DEV */
4931
....@@ -222,7 +204,7 @@
222204 struct snd_jack *jack;
223205 struct snd_jack_kctl *jack_kctl = NULL;
224206 int err;
225
- static struct snd_device_ops ops = {
207
+ static const struct snd_device_ops ops = {
226208 .dev_free = snd_jack_dev_free,
227209 #ifdef CONFIG_SND_JACK_INPUT_DEV
228210 .dev_register = snd_jack_dev_register,
....@@ -261,7 +243,7 @@
261243
262244 jack->type = type;
263245
264
- for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++)
246
+ for (i = 0; i < SND_JACK_SWITCH_TYPES; i++)
265247 if (type & (1 << i))
266248 input_set_capability(jack->input_dev, EV_SW,
267249 jack_switch_types[i]);