| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | #ifndef __SOUND_PCM_PARAMS_H |
|---|
| 2 | 3 | #define __SOUND_PCM_PARAMS_H |
|---|
| 3 | 4 | |
|---|
| 4 | 5 | /* |
|---|
| 5 | 6 | * PCM params helpers |
|---|
| 6 | 7 | * Copyright (c) by Abramo Bagnara <abramo@alsa-project.org> |
|---|
| 7 | | - * |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * You should have received a copy of the GNU General Public License |
|---|
| 20 | | - * along with this program; if not, write to the Free Software |
|---|
| 21 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 22 | | - * |
|---|
| 23 | 8 | */ |
|---|
| 24 | 9 | |
|---|
| 25 | 10 | #include <sound/pcm.h> |
|---|
| .. | .. |
|---|
| 37 | 22 | #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) |
|---|
| 38 | 23 | #define MASK_OFS(i) ((i) >> 5) |
|---|
| 39 | 24 | #define MASK_BIT(i) (1U << ((i) & 31)) |
|---|
| 40 | | - |
|---|
| 41 | | -static inline size_t snd_mask_sizeof(void) |
|---|
| 42 | | -{ |
|---|
| 43 | | - return sizeof(struct snd_mask); |
|---|
| 44 | | -} |
|---|
| 45 | 25 | |
|---|
| 46 | 26 | static inline void snd_mask_none(struct snd_mask *mask) |
|---|
| 47 | 27 | { |
|---|
| .. | .. |
|---|
| 148 | 128 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
|---|
| 149 | 129 | } |
|---|
| 150 | 130 | |
|---|
| 131 | +/* Most of drivers need only this one */ |
|---|
| 132 | +static inline int snd_mask_test_format(const struct snd_mask *mask, |
|---|
| 133 | + snd_pcm_format_t format) |
|---|
| 134 | +{ |
|---|
| 135 | + return snd_mask_test(mask, (__force unsigned int)format); |
|---|
| 136 | +} |
|---|
| 137 | + |
|---|
| 151 | 138 | static inline int snd_mask_single(const struct snd_mask *mask) |
|---|
| 152 | 139 | { |
|---|
| 153 | 140 | int i, c = 0; |
|---|