axg-tdm-formatter.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: (GPL-2.0 OR MIT)
  2. *
  3. * Copyright (c) 2018 Baylibre SAS.
  4. * Author: Jerome Brunet <jbrunet@baylibre.com>
  5. */
  6. #ifndef _MESON_AXG_TDM_FORMATTER_H
  7. #define _MESON_AXG_TDM_FORMATTER_H
  8. #include "axg-tdm.h"
  9. struct platform_device;
  10. struct regmap;
  11. struct snd_soc_dapm_widget;
  12. struct snd_kcontrol;
  13. struct axg_tdm_formatter_ops {
  14. struct axg_tdm_stream *(*get_stream)(struct snd_soc_dapm_widget *w);
  15. void (*enable)(struct regmap *map);
  16. void (*disable)(struct regmap *map);
  17. int (*prepare)(struct regmap *map, struct axg_tdm_stream *ts);
  18. };
  19. struct axg_tdm_formatter_driver {
  20. const struct snd_soc_component_driver *component_drv;
  21. const struct regmap_config *regmap_cfg;
  22. const struct axg_tdm_formatter_ops *ops;
  23. bool invert_sclk;
  24. };
  25. int axg_tdm_formatter_set_channel_masks(struct regmap *map,
  26. struct axg_tdm_stream *ts,
  27. unsigned int offset);
  28. int axg_tdm_formatter_event(struct snd_soc_dapm_widget *w,
  29. struct snd_kcontrol *control,
  30. int event);
  31. int axg_tdm_formatter_probe(struct platform_device *pdev);
  32. #endif /* _MESON_AXG_TDM_FORMATTER_H */