Skip to content

Commit 6b1e19d

Browse files
Garlic Tsengbroonie
authored andcommitted
ASoC: mediatek: let mt8173 use mediatek common structure
Modify mt8173 driver implementation to use common structure. Signed-off-by: Garlic Tseng <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 283b612 commit 6b1e19d

File tree

5 files changed

+318
-425
lines changed

5 files changed

+318
-425
lines changed

sound/soc/mediatek/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
config SND_SOC_MEDIATEK
2+
tristate
3+
14
config SND_SOC_MT8173
25
tristate "ASoC support for Mediatek MT8173 chip"
36
depends on ARCH_MEDIATEK
7+
select SND_SOC_MEDIATEK
48
help
59
This adds ASoC platform driver support for Mediatek MT8173 chip
610
that can be used with other codecs.

sound/soc/mediatek/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# 8173 Machine support
1+
obj-$(CONFIG_SND_SOC_MEDIATEK) += common/
22
obj-$(CONFIG_SND_SOC_MT8173) += mt8173/

sound/soc/mediatek/common/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (C) 2015 MediaTek Inc.
3+
#
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License version 2 as
6+
# published by the Free Software Foundation.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
14+
# platform driver
15+
snd-soc-mtk-common-objs := mtk-afe-platform-driver.o mtk-afe-fe-dai.o
16+
obj-$(CONFIG_SND_SOC_MEDIATEK) += snd-soc-mtk-common.o

sound/soc/mediatek/mt8173/mt8173-afe-common.h

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ enum {
4646
};
4747

4848
enum {
49-
MT8173_AFE_IRQ_1,
50-
MT8173_AFE_IRQ_2,
51-
MT8173_AFE_IRQ_3,
52-
MT8173_AFE_IRQ_4,
53-
MT8173_AFE_IRQ_5,
54-
MT8173_AFE_IRQ_6,
55-
MT8173_AFE_IRQ_7,
56-
MT8173_AFE_IRQ_8,
49+
MT8173_AFE_IRQ_DL1,
50+
MT8173_AFE_IRQ_DL2,
51+
MT8173_AFE_IRQ_VUL,
52+
MT8173_AFE_IRQ_DAI,
53+
MT8173_AFE_IRQ_AWB,
54+
MT8173_AFE_IRQ_MOD_DAI,
55+
MT8173_AFE_IRQ_HDMI,
5756
MT8173_AFE_IRQ_NUM,
5857
};
5958

@@ -71,31 +70,4 @@ enum {
7170
MT8173_CLK_NUM
7271
};
7372

74-
struct mt8173_afe;
75-
struct snd_pcm_substream;
76-
77-
struct mt8173_afe_memif_data {
78-
int id;
79-
const char *name;
80-
int reg_ofs_base;
81-
int reg_ofs_cur;
82-
int fs_shift;
83-
int mono_shift;
84-
int enable_shift;
85-
int irq_reg_cnt;
86-
int irq_cnt_shift;
87-
int irq_en_shift;
88-
int irq_fs_shift;
89-
int irq_clr_shift;
90-
int msb_shift;
91-
};
92-
93-
struct mt8173_afe_memif {
94-
unsigned int phys_buf_addr;
95-
int buffer_size;
96-
struct snd_pcm_substream *substream;
97-
const struct mt8173_afe_memif_data *data;
98-
const struct mt8173_afe_irq_data *irqdata;
99-
};
100-
10173
#endif

0 commit comments

Comments
 (0)