Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/platform-drvdata' and...
[deliverable/linux.git] / include / sound / simple_card_utils.h
CommitLineData
abd3147e
KM
1/*
2 * simple_card_core.h
3 *
4 * Copyright (c) 2016 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __SIMPLE_CARD_CORE_H
11#define __SIMPLE_CARD_CORE_H
12
13#include <sound/soc.h>
14
cecdef36
KM
15struct asoc_simple_dai {
16 const char *name;
17 unsigned int sysclk;
18 int slots;
19 int slot_width;
20 unsigned int tx_slot_mask;
21 unsigned int rx_slot_mask;
22 struct clk *clk;
23};
24
abd3147e
KM
25int asoc_simple_card_parse_daifmt(struct device *dev,
26 struct device_node *node,
27 struct device_node *codec,
28 char *prefix,
29 unsigned int *retfmt);
1db3312e
KM
30int asoc_simple_card_set_dailink_name(struct device *dev,
31 struct snd_soc_dai_link *dai_link,
32 const char *fmt, ...);
fc55c9b5
KM
33int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
34 char *prefix);
abd3147e 35
bb6fc620
KM
36#define asoc_simple_card_parse_clk_cpu(node, dai_link, simple_dai) \
37 asoc_simple_card_parse_clk(node, dai_link->cpu_of_node, simple_dai)
38#define asoc_simple_card_parse_clk_codec(node, dai_link, simple_dai) \
39 asoc_simple_card_parse_clk(node, dai_link->codec_of_node, simple_dai)
40int asoc_simple_card_parse_clk(struct device_node *node,
41 struct device_node *dai_of_node,
42 struct asoc_simple_dai *simple_dai);
43
ae30a694
KM
44#define asoc_simple_card_parse_cpu(node, dai_link, \
45 list_name, cells_name, is_single_link) \
46 asoc_simple_card_parse_dai(node, &dai_link->cpu_of_node, \
47 &dai_link->cpu_dai_name, list_name, cells_name, is_single_link)
48#define asoc_simple_card_parse_codec(node, dai_link, list_name, cells_name) \
49 asoc_simple_card_parse_dai(node, &dai_link->codec_of_node, \
50 &dai_link->codec_dai_name, list_name, cells_name, NULL)
51#define asoc_simple_card_parse_platform(node, dai_link, list_name, cells_name) \
52 asoc_simple_card_parse_dai(node, &dai_link->platform_of_node, \
53 NULL, list_name, cells_name, NULL)
54int asoc_simple_card_parse_dai(struct device_node *node,
55 struct device_node **endpoint_np,
56 const char **dai_name,
57 const char *list_name,
58 const char *cells_name,
59 int *is_single_links);
60
21ba62f8
KM
61int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
62 struct asoc_simple_dai *simple_dai);
c262c9ab
KM
63
64int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link);
983cebd6
KM
65void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link,
66 int is_single_links);
c262c9ab 67
0f4e0711
KM
68int asoc_simple_card_clean_reference(struct snd_soc_card *card);
69
abd3147e 70#endif /* __SIMPLE_CARD_CORE_H */
This page took 0.031128 seconds and 5 git commands to generate.