tegra_asoc_machine.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __TEGRA_ASOC_MACHINE_H__
  3. #define __TEGRA_ASOC_MACHINE_H__
  4. struct clk;
  5. struct gpio_desc;
  6. struct snd_soc_card;
  7. struct snd_soc_jack;
  8. struct platform_device;
  9. struct snd_soc_jack_gpio;
  10. struct snd_soc_pcm_runtime;
  11. struct tegra_asoc_data {
  12. unsigned int (*mclk_rate)(unsigned int srate);
  13. const char *codec_dev_name;
  14. const char *hp_jack_name;
  15. struct snd_soc_card *card;
  16. unsigned int mclk_id;
  17. bool hp_jack_gpio_active_low;
  18. bool add_common_dapm_widgets;
  19. bool add_common_controls;
  20. bool add_common_snd_ops;
  21. bool add_headset_jack;
  22. bool add_mic_jack;
  23. bool add_hp_jack;
  24. bool set_ac97;
  25. };
  26. struct tegra_machine {
  27. struct clk *clk_pll_a_out0;
  28. struct clk *clk_pll_a;
  29. struct clk *clk_cdev1;
  30. unsigned int set_baseclock;
  31. unsigned int set_mclk;
  32. const struct tegra_asoc_data *asoc;
  33. struct gpio_desc *gpiod_ext_mic_en;
  34. struct gpio_desc *gpiod_int_mic_en;
  35. struct gpio_desc *gpiod_spkr_en;
  36. struct gpio_desc *gpiod_mic_det;
  37. struct gpio_desc *gpiod_ear_sel;
  38. struct gpio_desc *gpiod_hp_mute;
  39. struct gpio_desc *gpiod_hp_det;
  40. struct snd_soc_jack *mic_jack;
  41. struct snd_soc_jack_gpio *hp_jack_gpio;
  42. };
  43. int tegra_asoc_machine_probe(struct platform_device *pdev);
  44. int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd);
  45. #endif