xref: /linux/sound/soc/tegra/tegra_asoc_machine.h (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
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);
16de8fc2b0SDmitry Osipenko 	const char *codec_dev_name;
17*db635ba4SDmitry Osipenko 	const char *hp_jack_name;
18cc8f70f5SDmitry Osipenko 	struct snd_soc_card *card;
19cc8f70f5SDmitry Osipenko 	unsigned int mclk_id;
20cc8f70f5SDmitry Osipenko 	bool hp_jack_gpio_active_low;
21cc8f70f5SDmitry Osipenko 	bool add_common_dapm_widgets;
22cc8f70f5SDmitry Osipenko 	bool add_common_controls;
23cc8f70f5SDmitry Osipenko 	bool add_common_snd_ops;
24cc8f70f5SDmitry Osipenko 	bool add_headset_jack;
25cc8f70f5SDmitry Osipenko 	bool add_mic_jack;
26cc8f70f5SDmitry Osipenko 	bool add_hp_jack;
27cc8f70f5SDmitry Osipenko 	bool set_ac97;
28cc8f70f5SDmitry Osipenko };
29cc8f70f5SDmitry Osipenko 
30cc8f70f5SDmitry Osipenko struct tegra_machine {
318c1b3b15SDmitry Osipenko 	struct clk *clk_pll_a_out0;
328c1b3b15SDmitry Osipenko 	struct clk *clk_pll_a;
338c1b3b15SDmitry Osipenko 	struct clk *clk_cdev1;
348c1b3b15SDmitry Osipenko 	unsigned int set_baseclock;
358c1b3b15SDmitry Osipenko 	unsigned int set_mclk;
36cc8f70f5SDmitry Osipenko 	const struct tegra_asoc_data *asoc;
37cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_ext_mic_en;
38cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_int_mic_en;
39cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_spkr_en;
40cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_mic_det;
41cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_ear_sel;
42cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_hp_mute;
43cc8f70f5SDmitry Osipenko 	struct gpio_desc *gpiod_hp_det;
44cc8f70f5SDmitry Osipenko 	struct snd_soc_jack *mic_jack;
45cc8f70f5SDmitry Osipenko 	struct snd_soc_jack_gpio *hp_jack_gpio;
46cc8f70f5SDmitry Osipenko };
47cc8f70f5SDmitry Osipenko 
48cc8f70f5SDmitry Osipenko int tegra_asoc_machine_probe(struct platform_device *pdev);
49cc8f70f5SDmitry Osipenko int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd);
50cc8f70f5SDmitry Osipenko 
51cc8f70f5SDmitry Osipenko #endif
52