| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Apple Onboard Audio driver for Onyx codec |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2006 Johannes Berg <johannes@sipsolutions.net> |
|---|
| 5 | | - * |
|---|
| 6 | | - * GPL v2, can be found in COPYING. |
|---|
| 7 | | - * |
|---|
| 8 | 6 | * |
|---|
| 9 | 7 | * This is a driver for the pcm3052 codec chip (codenamed Onyx) |
|---|
| 10 | 8 | * that is present in newer Apple hardware (with digital output). |
|---|
| .. | .. |
|---|
| 29 | 27 | * having just a single card on a system, and making the |
|---|
| 30 | 28 | * 'card' pointer accessible to anyone who needs it instead |
|---|
| 31 | 29 | * of hiding it in the aoa_snd_* functions... |
|---|
| 32 | | - * |
|---|
| 33 | 30 | */ |
|---|
| 34 | 31 | #include <linux/delay.h> |
|---|
| 35 | 32 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 100 | 97 | return 0; |
|---|
| 101 | 98 | } |
|---|
| 102 | 99 | |
|---|
| 103 | | -static struct snd_device_ops ops = { |
|---|
| 100 | +static const struct snd_device_ops ops = { |
|---|
| 104 | 101 | .dev_register = onyx_dev_register, |
|---|
| 105 | 102 | }; |
|---|
| 106 | 103 | |
|---|
| .. | .. |
|---|
| 416 | 413 | } |
|---|
| 417 | 414 | |
|---|
| 418 | 415 | #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 = { \ |
|---|
| 420 | 417 | .iface = SNDRV_CTL_ELEM_IFACE_##type, \ |
|---|
| 421 | 418 | .name = description, \ |
|---|
| 422 | 419 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
|---|
| .. | .. |
|---|
| 546 | 543 | |
|---|
| 547 | 544 | /* our registers */ |
|---|
| 548 | 545 | |
|---|
| 549 | | -static u8 register_map[] = { |
|---|
| 546 | +static const u8 register_map[] = { |
|---|
| 550 | 547 | ONYX_REG_DAC_ATTEN_LEFT, |
|---|
| 551 | 548 | ONYX_REG_DAC_ATTEN_RIGHT, |
|---|
| 552 | 549 | ONYX_REG_CONTROL, |
|---|
| .. | .. |
|---|
| 562 | 559 | ONYX_REG_DIG_INFO4 |
|---|
| 563 | 560 | }; |
|---|
| 564 | 561 | |
|---|
| 565 | | -static u8 initial_values[ARRAY_SIZE(register_map)] = { |
|---|
| 562 | +static const u8 initial_values[ARRAY_SIZE(register_map)] = { |
|---|
| 566 | 563 | 0x80, 0x80, /* muted */ |
|---|
| 567 | 564 | ONYX_MRST | ONYX_SRST, /* but handled specially! */ |
|---|
| 568 | 565 | ONYX_MUTE_LEFT | ONYX_MUTE_RIGHT, |
|---|