Skip to content

Commit 18eb864

Browse files
Runyang Chenbebarino
authored andcommitted
clk: mediatek: reset: add infra_ao reset support for MT8188
The infra_ao reset is needed for MT8188. - Add mtk_clk_rst_desc for MT8188. - Add register reset controller function for MT8188 infra_ao. - Add infra_ao_idx_map for MT8188. Signed-off-by: Runyang Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 2cf4ec5 commit 18eb864

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/clk/mediatek/clk-mt8188-infra_ao.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <dt-bindings/clock/mediatek,mt8188-clk.h>
8+
#include <dt-bindings/reset/mt8188-resets.h>
89
#include <linux/clk-provider.h>
910
#include <linux/platform_device.h>
1011

@@ -176,9 +177,32 @@ static const struct mtk_gate infra_ao_clks[] = {
176177
"infra_ao_aes_msdcfde_0p", "top_aes_msdcfde", 18),
177178
};
178179

180+
static u16 infra_ao_rst_ofs[] = {
181+
INFRA_RST0_SET_OFFSET,
182+
INFRA_RST1_SET_OFFSET,
183+
INFRA_RST2_SET_OFFSET,
184+
INFRA_RST3_SET_OFFSET,
185+
INFRA_RST4_SET_OFFSET,
186+
};
187+
188+
static u16 infra_ao_idx_map[] = {
189+
[MT8188_INFRA_RST1_THERMAL_MCU_RST] = 1 * RST_NR_PER_BANK + 2,
190+
[MT8188_INFRA_RST1_THERMAL_CTRL_RST] = 1 * RST_NR_PER_BANK + 4,
191+
[MT8188_INFRA_RST3_PTP_CTRL_RST] = 3 * RST_NR_PER_BANK + 5,
192+
};
193+
194+
static const struct mtk_clk_rst_desc infra_ao_rst_desc = {
195+
.version = MTK_RST_SET_CLR,
196+
.rst_bank_ofs = infra_ao_rst_ofs,
197+
.rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs),
198+
.rst_idx_map = infra_ao_idx_map,
199+
.rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map),
200+
};
201+
179202
static const struct mtk_clk_desc infra_ao_desc = {
180203
.clks = infra_ao_clks,
181204
.num_clks = ARRAY_SIZE(infra_ao_clks),
205+
.rst_desc = &infra_ao_rst_desc,
182206
};
183207

184208
static const struct of_device_id of_match_clk_mt8188_infra_ao[] = {

0 commit comments

Comments
 (0)