]>
Commit | Line | Data |
---|---|---|
abd3147e | 1 | /* |
29a43aa9 | 2 | * simple_card_utils.h |
abd3147e KM |
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 | */ | |
29a43aa9 KM |
10 | #ifndef __SIMPLE_CARD_UTILS_H |
11 | #define __SIMPLE_CARD_UTILS_H | |
abd3147e KM |
12 | |
13 | #include <sound/soc.h> | |
14 | ||
cecdef36 KM |
15 | struct 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 |
25 | int 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); | |
e5668cae | 30 | __printf(3, 4) |
1db3312e KM |
31 | int asoc_simple_card_set_dailink_name(struct device *dev, |
32 | struct snd_soc_dai_link *dai_link, | |
33 | const char *fmt, ...); | |
fc55c9b5 KM |
34 | int asoc_simple_card_parse_card_name(struct snd_soc_card *card, |
35 | char *prefix); | |
abd3147e | 36 | |
e984fd61 KM |
37 | #define asoc_simple_card_parse_clk_cpu(dev, node, dai_link, simple_dai) \ |
38 | asoc_simple_card_parse_clk(dev, node, dai_link->cpu_of_node, simple_dai) | |
39 | #define asoc_simple_card_parse_clk_codec(dev, node, dai_link, simple_dai) \ | |
40 | asoc_simple_card_parse_clk(dev, node, dai_link->codec_of_node, simple_dai) | |
41 | int asoc_simple_card_parse_clk(struct device *dev, | |
42 | struct device_node *node, | |
bb6fc620 KM |
43 | struct device_node *dai_of_node, |
44 | struct asoc_simple_dai *simple_dai); | |
45 | ||
ae30a694 KM |
46 | #define asoc_simple_card_parse_cpu(node, dai_link, \ |
47 | list_name, cells_name, is_single_link) \ | |
48 | asoc_simple_card_parse_dai(node, &dai_link->cpu_of_node, \ | |
49 | &dai_link->cpu_dai_name, list_name, cells_name, is_single_link) | |
50 | #define asoc_simple_card_parse_codec(node, dai_link, list_name, cells_name) \ | |
51 | asoc_simple_card_parse_dai(node, &dai_link->codec_of_node, \ | |
52 | &dai_link->codec_dai_name, list_name, cells_name, NULL) | |
53 | #define asoc_simple_card_parse_platform(node, dai_link, list_name, cells_name) \ | |
54 | asoc_simple_card_parse_dai(node, &dai_link->platform_of_node, \ | |
55 | NULL, list_name, cells_name, NULL) | |
56 | int asoc_simple_card_parse_dai(struct device_node *node, | |
57 | struct device_node **endpoint_np, | |
58 | const char **dai_name, | |
59 | const char *list_name, | |
60 | const char *cells_name, | |
61 | int *is_single_links); | |
62 | ||
21ba62f8 KM |
63 | int asoc_simple_card_init_dai(struct snd_soc_dai *dai, |
64 | struct asoc_simple_dai *simple_dai); | |
c262c9ab KM |
65 | |
66 | int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); | |
983cebd6 KM |
67 | void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, |
68 | int is_single_links); | |
c262c9ab | 69 | |
0f4e0711 KM |
70 | int asoc_simple_card_clean_reference(struct snd_soc_card *card); |
71 | ||
29a43aa9 | 72 | #endif /* __SIMPLE_CARD_UTILS_H */ |