axg-tdm-formatter.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_hw {
  14. unsigned int skew_offset;
  15. };
  16. struct axg_tdm_formatter_ops {
  17. struct axg_tdm_stream *(*get_stream)(struct snd_soc_dapm_widget *w);
  18. void (*enable)(struct regmap *map);
  19. void (*disable)(struct regmap *map);
  20. int (*prepare)(struct regmap *map,
  21. const struct axg_tdm_formatter_hw *quirks,
  22. struct axg_tdm_stream *ts);
  23. };
  24. struct axg_tdm_formatter_driver {
  25. const struct snd_soc_component_driver *component_drv;
  26. const struct regmap_config *regmap_cfg;
  27. const struct axg_tdm_formatter_ops *ops;
  28. const struct axg_tdm_formatter_hw *quirks;
  29. };
  30. int axg_tdm_formatter_set_channel_masks(struct regmap *map,
  31. struct axg_tdm_stream *ts,
  32. unsigned int offset);
  33. int axg_tdm_formatter_event(struct snd_soc_dapm_widget *w,
  34. struct snd_kcontrol *control,
  35. int event);
  36. int axg_tdm_formatter_probe(struct platform_device *pdev);
  37. #endif /* _MESON_AXG_TDM_FORMATTER_H */