Skip to content

Commit 1793936

Browse files
morimotobroonie
authored andcommitted
ASoC: add soc-card.c
Current ALSA SoC has some snd_soc_card_xxx() functions, and card->xxx() callbacks. But, it is implemented randomly at random place. To collect all card related functions into one place, this patch creats new soc-card.c. Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 317ec67 commit 1793936

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

include/sound/soc-card.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0
2+
*
3+
* soc-card.h
4+
*
5+
* Copyright (C) 2019 Renesas Electronics Corp.
6+
* Kuninori Morimoto <[email protected]>
7+
*/
8+
#ifndef __SOC_CARD_H
9+
#define __SOC_CARD_H
10+
11+
#endif /* __SOC_CARD_H */

include/sound/soc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,5 +1450,6 @@ static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
14501450
}
14511451

14521452
#include <sound/soc-component.h>
1453+
#include <sound/soc-card.h>
14531454

14541455
#endif

sound/soc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-utils.o soc-dai.o soc-component.o
3-
snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o soc-link.o
3+
snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o soc-link.o soc-card.o
44
snd-soc-core-$(CONFIG_SND_SOC_COMPRESS) += soc-compress.o
55

66
ifneq ($(CONFIG_SND_SOC_TOPOLOGY),)

sound/soc/soc-card.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
//
3+
// soc-card.c
4+
//
5+
// Copyright (C) 2019 Renesas Electronics Corp.
6+
// Kuninori Morimoto <[email protected]>
7+
//
8+
#include <sound/soc.h>
9+
10+
#define soc_card_ret(dai, ret) _soc_card_ret(dai, __func__, ret)
11+
static inline int _soc_card_ret(struct snd_soc_card *card,
12+
const char *func, int ret)
13+
{
14+
switch (ret) {
15+
case -EPROBE_DEFER:
16+
case -ENOTSUPP:
17+
case 0:
18+
break;
19+
default:
20+
dev_err(card->dev,
21+
"ASoC: error at %s on %s: %d\n",
22+
func, card->name, ret);
23+
}
24+
25+
return ret;
26+
}

0 commit comments

Comments
 (0)