0001
0002
0003
0004
0005
0006
0007 #ifndef _MESON_SND_CARD_H
0008 #define _MESON_SND_CARD_H
0009
0010 struct device_node;
0011 struct platform_device;
0012
0013 struct snd_soc_card;
0014 struct snd_pcm_substream;
0015 struct snd_pcm_hw_params;
0016
0017 #define DT_PREFIX "amlogic,"
0018
0019 struct meson_card_match_data {
0020 int (*add_link)(struct snd_soc_card *card,
0021 struct device_node *node,
0022 int *index);
0023 };
0024
0025 struct meson_card {
0026 const struct meson_card_match_data *match_data;
0027 struct snd_soc_card card;
0028 void **link_data;
0029 };
0030
0031 unsigned int meson_card_parse_daifmt(struct device_node *node,
0032 struct device_node *cpu_node);
0033
0034 int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream,
0035 struct snd_pcm_hw_params *params,
0036 unsigned int mclk_fs);
0037
0038 int meson_card_reallocate_links(struct snd_soc_card *card,
0039 unsigned int num_links);
0040 int meson_card_parse_dai(struct snd_soc_card *card,
0041 struct device_node *node,
0042 struct device_node **dai_of_node,
0043 const char **dai_name);
0044 int meson_card_set_be_link(struct snd_soc_card *card,
0045 struct snd_soc_dai_link *link,
0046 struct device_node *node);
0047 int meson_card_set_fe_link(struct snd_soc_card *card,
0048 struct snd_soc_dai_link *link,
0049 struct device_node *node,
0050 bool is_playback);
0051
0052 int meson_card_probe(struct platform_device *pdev);
0053 int meson_card_remove(struct platform_device *pdev);
0054
0055 #endif