| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
|---|
| 3 | 4 | * Universal routines for AK4531 codec |
|---|
| 4 | | - * |
|---|
| 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 | | - * |
|---|
| 20 | 5 | */ |
|---|
| 21 | 6 | |
|---|
| 22 | 7 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 270 | 255 | static const DECLARE_TLV_DB_SCALE(db_scale_mono, -2800, 400, 0); |
|---|
| 271 | 256 | static const DECLARE_TLV_DB_SCALE(db_scale_input, -5000, 200, 0); |
|---|
| 272 | 257 | |
|---|
| 273 | | -static struct snd_kcontrol_new snd_ak4531_controls[] = { |
|---|
| 258 | +static const struct snd_kcontrol_new snd_ak4531_controls[] = { |
|---|
| 274 | 259 | |
|---|
| 275 | 260 | AK4531_DOUBLE_TLV("Master Playback Switch", 0, |
|---|
| 276 | 261 | AK4531_LMASTER, AK4531_RMASTER, 7, 7, 1, 1, |
|---|
| .. | .. |
|---|
| 350 | 335 | return snd_ak4531_free(ak4531); |
|---|
| 351 | 336 | } |
|---|
| 352 | 337 | |
|---|
| 353 | | -static u8 snd_ak4531_initial_map[0x19 + 1] = { |
|---|
| 338 | +static const u8 snd_ak4531_initial_map[0x19 + 1] = { |
|---|
| 354 | 339 | 0x9f, /* 00: Master Volume Lch */ |
|---|
| 355 | 340 | 0x9f, /* 01: Master Volume Rch */ |
|---|
| 356 | 341 | 0x9f, /* 02: Voice Volume Lch */ |
|---|
| .. | .. |
|---|
| 386 | 371 | unsigned int idx; |
|---|
| 387 | 372 | int err; |
|---|
| 388 | 373 | struct snd_ak4531 *ak4531; |
|---|
| 389 | | - static struct snd_device_ops ops = { |
|---|
| 374 | + static const struct snd_device_ops ops = { |
|---|
| 390 | 375 | .dev_free = snd_ak4531_dev_free, |
|---|
| 391 | 376 | }; |
|---|
| 392 | 377 | |
|---|
| .. | .. |
|---|
| 481 | 466 | static void |
|---|
| 482 | 467 | snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531) |
|---|
| 483 | 468 | { |
|---|
| 484 | | - struct snd_info_entry *entry; |
|---|
| 485 | | - |
|---|
| 486 | | - if (! snd_card_proc_new(card, "ak4531", &entry)) |
|---|
| 487 | | - snd_info_set_text_ops(entry, ak4531, snd_ak4531_proc_read); |
|---|
| 469 | + snd_card_ro_proc_new(card, "ak4531", ak4531, snd_ak4531_proc_read); |
|---|
| 488 | 470 | } |
|---|