| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 4 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 5 | | - * (at your option) any later version. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 8 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 9 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 10 | | - * GNU General Public License for more details. |
|---|
| 11 | | - * |
|---|
| 12 | | - * You should have received a copy of the GNU General Public License |
|---|
| 13 | | - * along with this program; if not, write to the Free Software |
|---|
| 14 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 15 | | - * |
|---|
| 16 | 3 | */ |
|---|
| 17 | 4 | |
|---|
| 18 | 5 | /* |
|---|
| .. | .. |
|---|
| 40 | 27 | static int cs46xx_dsp_async_init (struct snd_cs46xx *chip, |
|---|
| 41 | 28 | struct dsp_scb_descriptor * fg_entry); |
|---|
| 42 | 29 | |
|---|
| 43 | | -static enum wide_opcode wide_opcodes[] = { |
|---|
| 30 | +static const enum wide_opcode wide_opcodes[] = { |
|---|
| 44 | 31 | WIDE_FOR_BEGIN_LOOP, |
|---|
| 45 | 32 | WIDE_FOR_BEGIN_LOOP2, |
|---|
| 46 | 33 | WIDE_COND_GOTO_ADDR, |
|---|
| .. | .. |
|---|
| 799 | 786 | |
|---|
| 800 | 787 | ins->snd_card = card; |
|---|
| 801 | 788 | |
|---|
| 802 | | - if ((entry = snd_info_create_card_entry(card, "dsp", card->proc_root)) != NULL) { |
|---|
| 803 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 789 | + entry = snd_info_create_card_entry(card, "dsp", card->proc_root); |
|---|
| 790 | + if (entry) |
|---|
| 804 | 791 | entry->mode = S_IFDIR | 0555; |
|---|
| 805 | | - |
|---|
| 806 | | - if (snd_info_register(entry) < 0) { |
|---|
| 807 | | - snd_info_free_entry(entry); |
|---|
| 808 | | - entry = NULL; |
|---|
| 809 | | - } |
|---|
| 810 | | - } |
|---|
| 811 | | - |
|---|
| 812 | 792 | ins->proc_dsp_dir = entry; |
|---|
| 813 | 793 | |
|---|
| 814 | 794 | if (!ins->proc_dsp_dir) |
|---|
| 815 | 795 | return -ENOMEM; |
|---|
| 816 | 796 | |
|---|
| 817 | | - if ((entry = snd_info_create_card_entry(card, "spos_symbols", ins->proc_dsp_dir)) != NULL) { |
|---|
| 818 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 819 | | - entry->private_data = chip; |
|---|
| 820 | | - entry->mode = S_IFREG | 0644; |
|---|
| 821 | | - entry->c.text.read = cs46xx_dsp_proc_symbol_table_read; |
|---|
| 822 | | - if (snd_info_register(entry) < 0) { |
|---|
| 823 | | - snd_info_free_entry(entry); |
|---|
| 824 | | - entry = NULL; |
|---|
| 825 | | - } |
|---|
| 826 | | - } |
|---|
| 827 | | - ins->proc_sym_info_entry = entry; |
|---|
| 797 | + entry = snd_info_create_card_entry(card, "spos_symbols", |
|---|
| 798 | + ins->proc_dsp_dir); |
|---|
| 799 | + if (entry) |
|---|
| 800 | + snd_info_set_text_ops(entry, chip, |
|---|
| 801 | + cs46xx_dsp_proc_symbol_table_read); |
|---|
| 828 | 802 | |
|---|
| 829 | | - if ((entry = snd_info_create_card_entry(card, "spos_modules", ins->proc_dsp_dir)) != NULL) { |
|---|
| 830 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 831 | | - entry->private_data = chip; |
|---|
| 832 | | - entry->mode = S_IFREG | 0644; |
|---|
| 833 | | - entry->c.text.read = cs46xx_dsp_proc_modules_read; |
|---|
| 834 | | - if (snd_info_register(entry) < 0) { |
|---|
| 835 | | - snd_info_free_entry(entry); |
|---|
| 836 | | - entry = NULL; |
|---|
| 837 | | - } |
|---|
| 838 | | - } |
|---|
| 839 | | - ins->proc_modules_info_entry = entry; |
|---|
| 803 | + entry = snd_info_create_card_entry(card, "spos_modules", |
|---|
| 804 | + ins->proc_dsp_dir); |
|---|
| 805 | + if (entry) |
|---|
| 806 | + snd_info_set_text_ops(entry, chip, |
|---|
| 807 | + cs46xx_dsp_proc_modules_read); |
|---|
| 840 | 808 | |
|---|
| 841 | | - if ((entry = snd_info_create_card_entry(card, "parameter", ins->proc_dsp_dir)) != NULL) { |
|---|
| 842 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 843 | | - entry->private_data = chip; |
|---|
| 844 | | - entry->mode = S_IFREG | 0644; |
|---|
| 845 | | - entry->c.text.read = cs46xx_dsp_proc_parameter_dump_read; |
|---|
| 846 | | - if (snd_info_register(entry) < 0) { |
|---|
| 847 | | - snd_info_free_entry(entry); |
|---|
| 848 | | - entry = NULL; |
|---|
| 849 | | - } |
|---|
| 850 | | - } |
|---|
| 851 | | - ins->proc_parameter_dump_info_entry = entry; |
|---|
| 809 | + entry = snd_info_create_card_entry(card, "parameter", |
|---|
| 810 | + ins->proc_dsp_dir); |
|---|
| 811 | + if (entry) |
|---|
| 812 | + snd_info_set_text_ops(entry, chip, |
|---|
| 813 | + cs46xx_dsp_proc_parameter_dump_read); |
|---|
| 852 | 814 | |
|---|
| 853 | | - if ((entry = snd_info_create_card_entry(card, "sample", ins->proc_dsp_dir)) != NULL) { |
|---|
| 854 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 855 | | - entry->private_data = chip; |
|---|
| 856 | | - entry->mode = S_IFREG | 0644; |
|---|
| 857 | | - entry->c.text.read = cs46xx_dsp_proc_sample_dump_read; |
|---|
| 858 | | - if (snd_info_register(entry) < 0) { |
|---|
| 859 | | - snd_info_free_entry(entry); |
|---|
| 860 | | - entry = NULL; |
|---|
| 861 | | - } |
|---|
| 862 | | - } |
|---|
| 863 | | - ins->proc_sample_dump_info_entry = entry; |
|---|
| 815 | + entry = snd_info_create_card_entry(card, "sample", |
|---|
| 816 | + ins->proc_dsp_dir); |
|---|
| 817 | + if (entry) |
|---|
| 818 | + snd_info_set_text_ops(entry, chip, |
|---|
| 819 | + cs46xx_dsp_proc_sample_dump_read); |
|---|
| 864 | 820 | |
|---|
| 865 | | - if ((entry = snd_info_create_card_entry(card, "task_tree", ins->proc_dsp_dir)) != NULL) { |
|---|
| 866 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 867 | | - entry->private_data = chip; |
|---|
| 868 | | - entry->mode = S_IFREG | 0644; |
|---|
| 869 | | - entry->c.text.read = cs46xx_dsp_proc_task_tree_read; |
|---|
| 870 | | - if (snd_info_register(entry) < 0) { |
|---|
| 871 | | - snd_info_free_entry(entry); |
|---|
| 872 | | - entry = NULL; |
|---|
| 873 | | - } |
|---|
| 874 | | - } |
|---|
| 875 | | - ins->proc_task_info_entry = entry; |
|---|
| 821 | + entry = snd_info_create_card_entry(card, "task_tree", |
|---|
| 822 | + ins->proc_dsp_dir); |
|---|
| 823 | + if (entry) |
|---|
| 824 | + snd_info_set_text_ops(entry, chip, |
|---|
| 825 | + cs46xx_dsp_proc_task_tree_read); |
|---|
| 876 | 826 | |
|---|
| 877 | | - if ((entry = snd_info_create_card_entry(card, "scb_info", ins->proc_dsp_dir)) != NULL) { |
|---|
| 878 | | - entry->content = SNDRV_INFO_CONTENT_TEXT; |
|---|
| 879 | | - entry->private_data = chip; |
|---|
| 880 | | - entry->mode = S_IFREG | 0644; |
|---|
| 881 | | - entry->c.text.read = cs46xx_dsp_proc_scb_read; |
|---|
| 882 | | - if (snd_info_register(entry) < 0) { |
|---|
| 883 | | - snd_info_free_entry(entry); |
|---|
| 884 | | - entry = NULL; |
|---|
| 885 | | - } |
|---|
| 886 | | - } |
|---|
| 887 | | - ins->proc_scb_info_entry = entry; |
|---|
| 827 | + entry = snd_info_create_card_entry(card, "scb_info", |
|---|
| 828 | + ins->proc_dsp_dir); |
|---|
| 829 | + if (entry) |
|---|
| 830 | + snd_info_set_text_ops(entry, chip, |
|---|
| 831 | + cs46xx_dsp_proc_scb_read); |
|---|
| 888 | 832 | |
|---|
| 889 | 833 | mutex_lock(&chip->spos_mutex); |
|---|
| 890 | 834 | /* register/update SCB's entries on proc */ |
|---|
| .. | .. |
|---|
| 905 | 849 | |
|---|
| 906 | 850 | if (!ins) |
|---|
| 907 | 851 | return 0; |
|---|
| 908 | | - |
|---|
| 909 | | - snd_info_free_entry(ins->proc_sym_info_entry); |
|---|
| 910 | | - ins->proc_sym_info_entry = NULL; |
|---|
| 911 | | - |
|---|
| 912 | | - snd_info_free_entry(ins->proc_modules_info_entry); |
|---|
| 913 | | - ins->proc_modules_info_entry = NULL; |
|---|
| 914 | | - |
|---|
| 915 | | - snd_info_free_entry(ins->proc_parameter_dump_info_entry); |
|---|
| 916 | | - ins->proc_parameter_dump_info_entry = NULL; |
|---|
| 917 | | - |
|---|
| 918 | | - snd_info_free_entry(ins->proc_sample_dump_info_entry); |
|---|
| 919 | | - ins->proc_sample_dump_info_entry = NULL; |
|---|
| 920 | | - |
|---|
| 921 | | - snd_info_free_entry(ins->proc_scb_info_entry); |
|---|
| 922 | | - ins->proc_scb_info_entry = NULL; |
|---|
| 923 | | - |
|---|
| 924 | | - snd_info_free_entry(ins->proc_task_info_entry); |
|---|
| 925 | | - ins->proc_task_info_entry = NULL; |
|---|
| 926 | 852 | |
|---|
| 927 | 853 | mutex_lock(&chip->spos_mutex); |
|---|
| 928 | 854 | for (i = 0; i < ins->nscb; ++i) { |
|---|
| .. | .. |
|---|
| 1112 | 1038 | |
|---|
| 1113 | 1039 | int fifo_addr, fifo_span, valid_slots; |
|---|
| 1114 | 1040 | |
|---|
| 1115 | | - static struct dsp_spos_control_block sposcb = { |
|---|
| 1041 | + static const struct dsp_spos_control_block sposcb = { |
|---|
| 1116 | 1042 | /* 0 */ HFG_TREE_SCB,HFG_STACK, |
|---|
| 1117 | 1043 | /* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR, |
|---|
| 1118 | 1044 | /* 2 */ DSP_SPOS_DC,0, |
|---|