.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for C-Media CMI8328-based soundcards, such as AudioExcel AV500 |
---|
3 | 4 | * Copyright (c) 2012 Ondrej Zary |
---|
.. | .. |
---|
31 | 32 | #endif |
---|
32 | 33 | |
---|
33 | 34 | /* I/O port is configured by jumpers on the card to one of these */ |
---|
34 | | -static int cmi8328_ports[] = { 0x530, 0xe80, 0xf40, 0x604 }; |
---|
| 35 | +static const int cmi8328_ports[] = { 0x530, 0xe80, 0xf40, 0x604 }; |
---|
35 | 36 | #define CMI8328_MAX ARRAY_SIZE(cmi8328_ports) |
---|
36 | 37 | |
---|
37 | 38 | static int index[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = -1}; |
---|
.. | .. |
---|
192 | 193 | } |
---|
193 | 194 | |
---|
194 | 195 | /* find index of an item in "-1"-ended array */ |
---|
195 | | -static int array_find(int array[], int item) |
---|
| 196 | +static int array_find(const int array[], int item) |
---|
196 | 197 | { |
---|
197 | 198 | int i; |
---|
198 | 199 | |
---|
.. | .. |
---|
203 | 204 | return -1; |
---|
204 | 205 | } |
---|
205 | 206 | /* the same for long */ |
---|
206 | | -static int array_find_l(long array[], long item) |
---|
| 207 | +static int array_find_l(const long array[], long item) |
---|
207 | 208 | { |
---|
208 | 209 | int i; |
---|
209 | 210 | |
---|
.. | .. |
---|
223 | 224 | struct resource *res; |
---|
224 | 225 | #endif |
---|
225 | 226 | int err, pos; |
---|
226 | | - static long mpu_ports[] = { 0x330, 0x300, 0x310, 0x320, 0x332, 0x334, |
---|
| 227 | + static const long mpu_ports[] = { 0x330, 0x300, 0x310, 0x320, 0x332, 0x334, |
---|
227 | 228 | 0x336, -1 }; |
---|
228 | | - static u8 mpu_port_bits[] = { 3, 0, 1, 2, 4, 5, 6 }; |
---|
229 | | - static int mpu_irqs[] = { 9, 7, 5, 3, -1 }; |
---|
230 | | - static u8 mpu_irq_bits[] = { 3, 2, 1, 0 }; |
---|
231 | | - static int irqs[] = { 9, 10, 11, 7, -1 }; |
---|
232 | | - static u8 irq_bits[] = { 2, 3, 4, 1 }; |
---|
233 | | - static int dma1s[] = { 3, 1, 0, -1 }; |
---|
234 | | - static u8 dma_bits[] = { 3, 2, 1 }; |
---|
235 | | - static int dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, {0, -1} }; |
---|
| 229 | + static const u8 mpu_port_bits[] = { 3, 0, 1, 2, 4, 5, 6 }; |
---|
| 230 | + static const int mpu_irqs[] = { 9, 7, 5, 3, -1 }; |
---|
| 231 | + static const u8 mpu_irq_bits[] = { 3, 2, 1, 0 }; |
---|
| 232 | + static const int irqs[] = { 9, 10, 11, 7, -1 }; |
---|
| 233 | + static const u8 irq_bits[] = { 2, 3, 4, 1 }; |
---|
| 234 | + static const int dma1s[] = { 3, 1, 0, -1 }; |
---|
| 235 | + static const u8 dma_bits[] = { 3, 2, 1 }; |
---|
| 236 | + static const int dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, {0, -1} }; |
---|
236 | 237 | u16 port = cmi8328_ports[ndev]; |
---|
237 | 238 | u8 val; |
---|
238 | 239 | |
---|
.. | .. |
---|
434 | 435 | cmi = card->private_data; |
---|
435 | 436 | snd_cmi8328_cfg_save(cmi->port, cmi->cfg); |
---|
436 | 437 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
---|
437 | | - snd_pcm_suspend_all(cmi->wss->pcm); |
---|
438 | 438 | cmi->wss->suspend(cmi->wss); |
---|
439 | 439 | |
---|
440 | 440 | return 0; |
---|