forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/aoa/codecs/onyx.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Apple Onboard Audio driver for Onyx codec
34 *
45 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
5
- *
6
- * GPL v2, can be found in COPYING.
7
- *
86 *
97 * This is a driver for the pcm3052 codec chip (codenamed Onyx)
108 * that is present in newer Apple hardware (with digital output).
....@@ -29,7 +27,6 @@
2927 * having just a single card on a system, and making the
3028 * 'card' pointer accessible to anyone who needs it instead
3129 * of hiding it in the aoa_snd_* functions...
32
- *
3330 */
3431 #include <linux/delay.h>
3532 #include <linux/module.h>
....@@ -100,7 +97,7 @@
10097 return 0;
10198 }
10299
103
-static struct snd_device_ops ops = {
100
+static const struct snd_device_ops ops = {
104101 .dev_register = onyx_dev_register,
105102 };
106103
....@@ -416,7 +413,7 @@
416413 }
417414
418415 #define SINGLE_BIT(n, type, description, address, mask, flags) \
419
-static struct snd_kcontrol_new n##_control = { \
416
+static const struct snd_kcontrol_new n##_control = { \
420417 .iface = SNDRV_CTL_ELEM_IFACE_##type, \
421418 .name = description, \
422419 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
....@@ -546,7 +543,7 @@
546543
547544 /* our registers */
548545
549
-static u8 register_map[] = {
546
+static const u8 register_map[] = {
550547 ONYX_REG_DAC_ATTEN_LEFT,
551548 ONYX_REG_DAC_ATTEN_RIGHT,
552549 ONYX_REG_CONTROL,
....@@ -562,7 +559,7 @@
562559 ONYX_REG_DIG_INFO4
563560 };
564561
565
-static u8 initial_values[ARRAY_SIZE(register_map)] = {
562
+static const u8 initial_values[ARRAY_SIZE(register_map)] = {
566563 0x80, 0x80, /* muted */
567564 ONYX_MRST | ONYX_SRST, /* but handled specially! */
568565 ONYX_MUTE_LEFT | ONYX_MUTE_RIGHT,