| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 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 | | - * |
|---|
| 17 | 3 | */ |
|---|
| 18 | 4 | |
|---|
| 19 | 5 | /* |
|---|
| .. | .. |
|---|
| 254 | 240 | if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL && |
|---|
| 255 | 241 | scb->proc_info == NULL) { |
|---|
| 256 | 242 | |
|---|
| 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) { |
|---|
| 259 | 246 | scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL); |
|---|
| 260 | 247 | if (!scb_info) { |
|---|
| 261 | 248 | snd_info_free_entry(entry); |
|---|
| .. | .. |
|---|
| 265 | 252 | |
|---|
| 266 | 253 | scb_info->chip = chip; |
|---|
| 267 | 254 | 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); |
|---|
| 280 | 257 | } |
|---|
| 281 | 258 | out: |
|---|
| 282 | 259 | scb->proc_info = entry; |
|---|
| .. | .. |
|---|
| 1168 | 1145 | return scb; |
|---|
| 1169 | 1146 | } |
|---|
| 1170 | 1147 | |
|---|
| 1171 | | -static u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = { |
|---|
| 1148 | +static const u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = { |
|---|
| 1172 | 1149 | 0x0600, /* 1 */ |
|---|
| 1173 | 1150 | 0x1500, /* 2 */ |
|---|
| 1174 | 1151 | 0x1580, /* 3 */ |
|---|
| .. | .. |
|---|
| 1203 | 1180 | 0x2400, /* 32 */ |
|---|
| 1204 | 1181 | }; |
|---|
| 1205 | 1182 | |
|---|
| 1206 | | -static u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = { |
|---|
| 1183 | +static const u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = { |
|---|
| 1207 | 1184 | 0x2B80, |
|---|
| 1208 | 1185 | 0x2BA0, |
|---|
| 1209 | 1186 | 0x2BC0, |
|---|
| .. | .. |
|---|
| 1220 | 1197 | 0x2E20 |
|---|
| 1221 | 1198 | }; |
|---|
| 1222 | 1199 | |
|---|
| 1223 | | -static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = { |
|---|
| 1200 | +static const u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = { |
|---|
| 1224 | 1201 | 0x2480, |
|---|
| 1225 | 1202 | 0x2500, |
|---|
| 1226 | 1203 | 0x2580, |
|---|
| .. | .. |
|---|
| 1316 | 1293 | if (src_scb == NULL) { |
|---|
| 1317 | 1294 | if (ins->nsrc_scb >= DSP_MAX_SRC_NR) { |
|---|
| 1318 | 1295 | dev_err(chip->card->dev, |
|---|
| 1319 | | - "dsp_spos: to many SRC instances\n!"); |
|---|
| 1296 | + "dsp_spos: too many SRC instances\n!"); |
|---|
| 1320 | 1297 | return NULL; |
|---|
| 1321 | 1298 | } |
|---|
| 1322 | 1299 | |
|---|