forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/pci/cs46xx/dsp_spos_scb_lib.c
....@@ -1,19 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
2
- *
3
- * This program is free software; you can redistribute it and/or modify
4
- * it under the terms of the GNU General Public License as published by
5
- * the Free Software Foundation; either version 2 of the License, or
6
- * (at your option) any later version.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program; if not, write to the Free Software
15
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
- *
173 */
184
195 /*
....@@ -254,8 +240,9 @@
254240 if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL &&
255241 scb->proc_info == NULL) {
256242
257
- if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
258
- ins->proc_dsp_dir)) != NULL) {
243
+ entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
244
+ ins->proc_dsp_dir);
245
+ if (entry) {
259246 scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL);
260247 if (!scb_info) {
261248 snd_info_free_entry(entry);
....@@ -265,18 +252,8 @@
265252
266253 scb_info->chip = chip;
267254 scb_info->scb_desc = scb;
268
-
269
- entry->content = SNDRV_INFO_CONTENT_TEXT;
270
- entry->private_data = scb_info;
271
- entry->mode = S_IFREG | 0644;
272
-
273
- entry->c.text.read = cs46xx_dsp_proc_scb_info_read;
274
-
275
- if (snd_info_register(entry) < 0) {
276
- snd_info_free_entry(entry);
277
- kfree (scb_info);
278
- entry = NULL;
279
- }
255
+ snd_info_set_text_ops(entry, scb_info,
256
+ cs46xx_dsp_proc_scb_info_read);
280257 }
281258 out:
282259 scb->proc_info = entry;
....@@ -1168,7 +1145,7 @@
11681145 return scb;
11691146 }
11701147
1171
-static u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = {
1148
+static const u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = {
11721149 0x0600, /* 1 */
11731150 0x1500, /* 2 */
11741151 0x1580, /* 3 */
....@@ -1203,7 +1180,7 @@
12031180 0x2400, /* 32 */
12041181 };
12051182
1206
-static u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = {
1183
+static const u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = {
12071184 0x2B80,
12081185 0x2BA0,
12091186 0x2BC0,
....@@ -1220,7 +1197,7 @@
12201197 0x2E20
12211198 };
12221199
1223
-static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
1200
+static const u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
12241201 0x2480,
12251202 0x2500,
12261203 0x2580,
....@@ -1316,7 +1293,7 @@
13161293 if (src_scb == NULL) {
13171294 if (ins->nsrc_scb >= DSP_MAX_SRC_NR) {
13181295 dev_err(chip->card->dev,
1319
- "dsp_spos: to many SRC instances\n!");
1296
+ "dsp_spos: too many SRC instances\n!");
13201297 return NULL;
13211298 }
13221299