Soumya Managoli | 9d62724 | 2018-02-24 16:13:25 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __MSM8952_SLIMBUS_AUDIO |
| 14 | #define __MSM8952_SLIMBUS_AUDIO |
| 15 | |
| 16 | #include <dsp/apr_audio-v2.h> |
| 17 | |
| 18 | struct ext_intf_cfg { |
| 19 | atomic_t quat_mi2s_clk_ref; |
| 20 | atomic_t quin_mi2s_clk_ref; |
| 21 | atomic_t auxpcm_mi2s_clk_ref; |
| 22 | }; |
| 23 | |
| 24 | enum { |
| 25 | PRIM_MI2S = 0, |
| 26 | SEC_MI2S, |
| 27 | TERT_MI2S, |
| 28 | QUAT_MI2S, |
| 29 | QUIN_MI2S, |
| 30 | MI2S_MAX, |
| 31 | }; |
| 32 | |
| 33 | struct msm8952_codec { |
| 34 | void* (*get_afe_config_fn)(struct snd_soc_codec *codec, |
| 35 | enum afe_config_type config_type); |
| 36 | }; |
| 37 | |
| 38 | struct msm8952_asoc_mach_data { |
| 39 | int ext_pa; |
| 40 | int us_euro_gpio; |
| 41 | struct delayed_work hs_detect_dwork; |
| 42 | struct snd_soc_codec *codec; |
| 43 | struct msm8952_codec msm8952_codec_fn; |
| 44 | struct ext_intf_cfg clk_ref; |
| 45 | struct snd_info_entry *codec_root; |
| 46 | void __iomem *vaddr_gpio_mux_spkr_ctl; |
| 47 | void __iomem *vaddr_gpio_mux_mic_ctl; |
| 48 | void __iomem *vaddr_gpio_mux_pcm_ctl; |
| 49 | void __iomem *vaddr_gpio_mux_quin_ctl; |
| 50 | void __iomem *vaddr_gpio_mux_qui_pcm_sec_mode_ctl; |
| 51 | void __iomem *vaddr_gpio_mux_mic_ext_clk_ctl; |
| 52 | void __iomem *vaddr_gpio_mux_sec_tlmm_ctl; |
| 53 | struct device_node *us_euro_gpio_p; |
| 54 | struct device_node *mi2s_gpio_p[MI2S_MAX]; |
| 55 | }; |
| 56 | |
| 57 | int msm_slim_0_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 58 | struct snd_pcm_hw_params *params); |
| 59 | int msm_slim_0_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 60 | struct snd_pcm_hw_params *params); |
| 61 | int msm_slim_1_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 62 | struct snd_pcm_hw_params *params); |
| 63 | int msm_slim_2_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 64 | struct snd_pcm_hw_params *params); |
| 65 | int msm_slim_4_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 66 | struct snd_pcm_hw_params *params); |
| 67 | int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 68 | struct snd_pcm_hw_params *params); |
| 69 | int msm_slim_5_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 70 | struct snd_pcm_hw_params *params); |
| 71 | int msm_slim_6_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 72 | struct snd_pcm_hw_params *params); |
| 73 | int msm_slim_5_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 74 | struct snd_pcm_hw_params *params); |
| 75 | int msm_snd_hw_params(struct snd_pcm_substream *substream, |
| 76 | struct snd_pcm_hw_params *params); |
| 77 | int msm8952_slimbus_2_hw_params(struct snd_pcm_substream *substream, |
| 78 | struct snd_pcm_hw_params *params); |
| 79 | int msm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 80 | struct snd_pcm_hw_params *params); |
| 81 | int msm_quin_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 82 | struct snd_pcm_hw_params *params); |
| 83 | int msm_btsco_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 84 | struct snd_pcm_hw_params *params); |
| 85 | int msm_proxy_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 86 | struct snd_pcm_hw_params *params); |
| 87 | int msm_proxy_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 88 | struct snd_pcm_hw_params *params); |
| 89 | int msm_tdm_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 90 | struct snd_pcm_hw_params *params); |
| 91 | int msm_audrx_init(struct snd_soc_pcm_runtime *rtd); |
| 92 | int msm_mi2s_snd_hw_params(struct snd_pcm_substream *substream, |
| 93 | struct snd_pcm_hw_params *params); |
| 94 | int msm_snd_cpe_hw_params(struct snd_pcm_substream *substream, |
| 95 | struct snd_pcm_hw_params *params); |
| 96 | int msm_tdm_snd_hw_params(struct snd_pcm_substream *substream, |
| 97 | struct snd_pcm_hw_params *params); |
| 98 | int msm_quat_mi2s_snd_startup(struct snd_pcm_substream *substream); |
| 99 | void msm_quat_mi2s_snd_shutdown(struct snd_pcm_substream *substream); |
| 100 | |
| 101 | int msm_quin_mi2s_snd_startup(struct snd_pcm_substream *substream); |
| 102 | void msm_quin_mi2s_snd_shutdown(struct snd_pcm_substream *substream); |
| 103 | |
| 104 | int msm_auxpcm_be_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 105 | struct snd_pcm_hw_params *params); |
| 106 | int msm_prim_auxpcm_startup(struct snd_pcm_substream *substream); |
| 107 | void msm_prim_auxpcm_shutdown(struct snd_pcm_substream *substream); |
| 108 | |
| 109 | int msm_tdm_startup(struct snd_pcm_substream *substream); |
| 110 | void msm_tdm_shutdown(struct snd_pcm_substream *substream); |
| 111 | |
| 112 | struct snd_soc_card *populate_snd_card_dailinks(struct device *dev); |
| 113 | int msm_slim_4_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 114 | struct snd_pcm_hw_params *params); |
| 115 | int msm895x_wsa881x_init(struct snd_soc_component *component); |
| 116 | int msm8952_init_wsa_dev(struct platform_device *pdev, |
| 117 | struct snd_soc_card *card); |
| 118 | void msm895x_free_auxdev_mem(struct platform_device *pdev); |
| 119 | #endif |