cs35l56_hda.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. *
  3. * HDA audio driver for Cirrus Logic CS35L56 smart amp
  4. *
  5. * Copyright (C) 2023 Cirrus Logic, Inc. and
  6. * Cirrus Logic International Semiconductor Ltd.
  7. */
  8. #ifndef __CS35L56_HDA_H__
  9. #define __CS35L56_HDA_H__
  10. #include <linux/container_of.h>
  11. #include <linux/device.h>
  12. #include <linux/gpio/consumer.h>
  13. #include <linux/firmware/cirrus/cs_dsp.h>
  14. #include <linux/firmware/cirrus/wmfw.h>
  15. #include <linux/regulator/consumer.h>
  16. #include <linux/workqueue.h>
  17. #include <sound/cs35l56.h>
  18. struct dentry;
  19. struct cs35l56_hda {
  20. struct cs35l56_base base;
  21. struct hda_codec *codec;
  22. struct work_struct dsp_work;
  23. int index;
  24. const char *system_name;
  25. const char *amp_name;
  26. struct cs_dsp cs_dsp;
  27. bool playing;
  28. bool suspended;
  29. u8 asp_tx_mask;
  30. struct snd_kcontrol *posture_ctl;
  31. struct snd_kcontrol *volume_ctl;
  32. struct snd_kcontrol *mixer_ctl[4];
  33. #if IS_ENABLED(CONFIG_SND_DEBUG)
  34. struct dentry *debugfs_root;
  35. #endif
  36. };
  37. static inline struct cs35l56_hda *cs35l56_hda_from_base(struct cs35l56_base *cs35l56_base)
  38. {
  39. return container_of(cs35l56_base, struct cs35l56_hda, base);
  40. }
  41. extern const struct dev_pm_ops cs35l56_hda_pm_ops;
  42. int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int hid, int id);
  43. void cs35l56_hda_remove(struct device *dev);
  44. #endif /*__CS35L56_HDA_H__*/