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