1 /* SPDX-License-Identifier: (GPL-2.0 OR MIT)
3 * Copyright (c) 2018 Baylibre SAS.
7 #ifndef _MESON_AXG_TDM_FORMATTER_H
8 #define _MESON_AXG_TDM_FORMATTER_H
12 struct platform_device;
14 struct snd_soc_dapm_widget;
17 struct axg_tdm_formatter_hw {
18 unsigned int skew_offset;
22 struct axg_tdm_formatter_ops {
23 struct axg_tdm_stream *(*get_stream)(struct snd_soc_dapm_widget *w);
24 void (*enable)(struct regmap *map);
25 void (*disable)(struct regmap *map);
26 int (*prepare)(struct regmap *map,
27 const struct axg_tdm_formatter_hw *quirks,
28 struct axg_tdm_stream *ts);
31 struct axg_tdm_formatter_driver {
32 const struct snd_soc_component_driver *component_drv;
33 const struct regmap_config *regmap_cfg;
34 const struct axg_tdm_formatter_ops *ops;
35 const struct axg_tdm_formatter_hw *quirks;
38 int axg_tdm_formatter_set_channel_masks(struct regmap *map,
39 struct axg_tdm_stream *ts,
41 int axg_tdm_formatter_event(struct snd_soc_dapm_widget *w,
42 struct snd_kcontrol *control,
44 int axg_tdm_formatter_probe(struct platform_device *pdev);
46 #endif /* _MESON_AXG_TDM_FORMATTER_H */