.. | .. |
---|
| 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 Library 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 | 3 | */ |
---|
16 | 4 | |
---|
17 | 5 | /* |
---|
.. | .. |
---|
1115 | 1103 | hwwrite(vortex->mmio, |
---|
1116 | 1104 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0xc, |
---|
1117 | 1105 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); |
---|
| 1106 | + fallthrough; |
---|
1118 | 1107 | /* 3 pages */ |
---|
1119 | 1108 | case 3: |
---|
1120 | 1109 | dma->cfg0 |= 0x12000000; |
---|
.. | .. |
---|
1122 | 1111 | hwwrite(vortex->mmio, |
---|
1123 | 1112 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x8, |
---|
1124 | 1113 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); |
---|
| 1114 | + fallthrough; |
---|
1125 | 1115 | /* 2 pages */ |
---|
1126 | 1116 | case 2: |
---|
1127 | 1117 | dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize - 1); |
---|
1128 | 1118 | hwwrite(vortex->mmio, |
---|
1129 | 1119 | VORTEX_ADBDMA_BUFBASE + (adbdma << 4) + 0x4, |
---|
1130 | 1120 | snd_pcm_sgbuf_get_addr(dma->substream, psize)); |
---|
| 1121 | + fallthrough; |
---|
1131 | 1122 | /* 1 page */ |
---|
1132 | 1123 | case 1: |
---|
1133 | 1124 | dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize - 1) << 0xc); |
---|
.. | .. |
---|
1390 | 1381 | dma->cfg1 |= 0x88000000 | 0x44000000 | 0x30000000 | (psize-1); |
---|
1391 | 1382 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0xc, |
---|
1392 | 1383 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 3)); |
---|
| 1384 | + fallthrough; |
---|
1393 | 1385 | /* 3 pages */ |
---|
1394 | 1386 | case 3: |
---|
1395 | 1387 | dma->cfg0 |= 0x12000000; |
---|
1396 | 1388 | dma->cfg1 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); |
---|
1397 | 1389 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x8, |
---|
1398 | 1390 | snd_pcm_sgbuf_get_addr(dma->substream, psize * 2)); |
---|
| 1391 | + fallthrough; |
---|
1399 | 1392 | /* 2 pages */ |
---|
1400 | 1393 | case 2: |
---|
1401 | 1394 | dma->cfg0 |= 0x88000000 | 0x44000000 | 0x10000000 | (psize-1); |
---|
1402 | 1395 | hwwrite(vortex->mmio, VORTEX_WTDMA_BUFBASE + (wtdma << 4) + 0x4, |
---|
1403 | 1396 | snd_pcm_sgbuf_get_addr(dma->substream, psize)); |
---|
| 1397 | + fallthrough; |
---|
1404 | 1398 | /* 1 page */ |
---|
1405 | 1399 | case 1: |
---|
1406 | 1400 | dma->cfg0 |= 0x80000000 | 0x40000000 | ((psize-1) << 0xc); |
---|
.. | .. |
---|
1995 | 1989 | // Higher level ADB audio path (de)allocator. |
---|
1996 | 1990 | |
---|
1997 | 1991 | /* Resource manager */ |
---|
1998 | | -static int resnum[VORTEX_RESOURCE_LAST] = |
---|
| 1992 | +static const int resnum[VORTEX_RESOURCE_LAST] = |
---|
1999 | 1993 | { NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D }; |
---|
2000 | 1994 | /* |
---|
2001 | 1995 | Checkout/Checkin resource of given type. |
---|
.. | .. |
---|
2004 | 1998 | out: Mean checkout if != 0. Else mean Checkin resource. |
---|
2005 | 1999 | restype: Indicates type of resource to be checked in or out. |
---|
2006 | 2000 | */ |
---|
2007 | | -static char |
---|
| 2001 | +static int |
---|
2008 | 2002 | vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype) |
---|
2009 | 2003 | { |
---|
2010 | 2004 | int i, qty = resnum[restype], resinuse = 0; |
---|