hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/sound/pci/ca0106/ca0106_proc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 2004 James Courtier-Dutton <James@superbug.demon.co.uk>
34 * Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
....@@ -44,21 +45,6 @@
4445 *
4546 * This code was initially based on code from ALSA's emu10k1x.c which is:
4647 * Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com>
47
- *
48
- * This program is free software; you can redistribute it and/or modify
49
- * it under the terms of the GNU General Public License as published by
50
- * the Free Software Foundation; either version 2 of the License, or
51
- * (at your option) any later version.
52
- *
53
- * This program is distributed in the hope that it will be useful,
54
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
55
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56
- * GNU General Public License for more details.
57
- *
58
- * You should have received a copy of the GNU General Public License
59
- * along with this program; if not, write to the Free Software
60
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
61
- *
6248 */
6349 #include <linux/delay.h>
6450 #include <linux/init.h>
....@@ -80,7 +66,7 @@
8066 const char *name;
8167 };
8268
83
-static struct snd_ca0106_category_str snd_ca0106_con_category[] = {
69
+static const struct snd_ca0106_category_str snd_ca0106_con_category[] = {
8470 { IEC958_AES1_CON_DAT, "DAT" },
8571 { IEC958_AES1_CON_VCR, "VCR" },
8672 { IEC958_AES1_CON_MICROPHONE, "microphone" },
....@@ -424,30 +410,20 @@
424410
425411 int snd_ca0106_proc_init(struct snd_ca0106 *emu)
426412 {
427
- struct snd_info_entry *entry;
428
-
429
- if(! snd_card_proc_new(emu->card, "iec958", &entry))
430
- snd_info_set_text_ops(entry, emu, snd_ca0106_proc_iec958);
431
- if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
432
- snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read32);
433
- entry->c.text.write = snd_ca0106_proc_reg_write32;
434
- entry->mode |= 0200;
435
- }
436
- if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
437
- snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read16);
438
- if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
439
- snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read8);
440
- if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
441
- snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1);
442
- entry->c.text.write = snd_ca0106_proc_reg_write;
443
- entry->mode |= 0200;
444
- }
445
- if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
446
- entry->c.text.write = snd_ca0106_proc_i2c_write;
447
- entry->private_data = emu;
448
- entry->mode |= 0200;
449
- }
450
- if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
451
- snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2);
413
+ snd_card_ro_proc_new(emu->card, "iec958", emu, snd_ca0106_proc_iec958);
414
+ snd_card_rw_proc_new(emu->card, "ca0106_reg32", emu,
415
+ snd_ca0106_proc_reg_read32,
416
+ snd_ca0106_proc_reg_write32);
417
+ snd_card_ro_proc_new(emu->card, "ca0106_reg16", emu,
418
+ snd_ca0106_proc_reg_read16);
419
+ snd_card_ro_proc_new(emu->card, "ca0106_reg8", emu,
420
+ snd_ca0106_proc_reg_read8);
421
+ snd_card_rw_proc_new(emu->card, "ca0106_regs1", emu,
422
+ snd_ca0106_proc_reg_read1,
423
+ snd_ca0106_proc_reg_write);
424
+ snd_card_rw_proc_new(emu->card, "ca0106_i2c", emu, NULL,
425
+ snd_ca0106_proc_i2c_write);
426
+ snd_card_ro_proc_new(emu->card, "ca0106_regs2", emu,
427
+ snd_ca0106_proc_reg_read2);
452428 return 0;
453429 }