2 * mtk-base-afe.h -- Mediatek base afe structure
4 * Copyright (c) 2016 MediaTek Inc.
5 * Author: Garlic Tseng <garlic.tseng@mediatek.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 and
9 * only version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef _MTK_BASE_AFE_H_
18 #define _MTK_BASE_AFE_H_
20 struct mtk_base_memif_data
{
36 int agent_disable_reg
;
37 int agent_disable_shift
;
40 struct mtk_base_irq_data
{
55 struct mtk_base_afe_memif
;
56 struct mtk_base_afe_irq
;
58 struct snd_pcm_substream
;
62 void __iomem
*base_addr
;
64 struct regmap
*regmap
;
65 struct mutex irq_alloc_lock
; /* dynamic alloc irq lock */
67 unsigned int const *reg_back_up_list
;
68 unsigned int *reg_back_up
;
69 unsigned int reg_back_up_list_num
;
71 int (*runtime_suspend
)(struct device
*dev
);
72 int (*runtime_resume
)(struct device
*dev
);
75 struct mtk_base_afe_memif
*memif
;
77 struct mtk_base_afe_irq
*irqs
;
80 const struct snd_pcm_hardware
*mtk_afe_hardware
;
81 int (*memif_fs
)(struct snd_pcm_substream
*substream
,
83 int (*irq_fs
)(struct snd_pcm_substream
*substream
,
89 struct mtk_base_afe_memif
{
90 unsigned int phys_buf_addr
;
92 struct snd_pcm_substream
*substream
;
93 const struct mtk_base_memif_data
*data
;
98 struct mtk_base_afe_irq
{
99 const struct mtk_base_irq_data
*irq_data
;