Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <runyang.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230525075011.7032-3-runyang.chen@mediatek.com
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Runyang Chen and committed by
Stephen Boyd
18eb864f 2cf4ec53

+24
+24
drivers/clk/mediatek/clk-mt8188-infra_ao.c
··· 5 5 */ 6 6 7 7 #include <dt-bindings/clock/mediatek,mt8188-clk.h> 8 + #include <dt-bindings/reset/mt8188-resets.h> 8 9 #include <linux/clk-provider.h> 9 10 #include <linux/platform_device.h> 10 11 ··· 177 176 "infra_ao_aes_msdcfde_0p", "top_aes_msdcfde", 18), 178 177 }; 179 178 179 + static u16 infra_ao_rst_ofs[] = { 180 + INFRA_RST0_SET_OFFSET, 181 + INFRA_RST1_SET_OFFSET, 182 + INFRA_RST2_SET_OFFSET, 183 + INFRA_RST3_SET_OFFSET, 184 + INFRA_RST4_SET_OFFSET, 185 + }; 186 + 187 + static u16 infra_ao_idx_map[] = { 188 + [MT8188_INFRA_RST1_THERMAL_MCU_RST] = 1 * RST_NR_PER_BANK + 2, 189 + [MT8188_INFRA_RST1_THERMAL_CTRL_RST] = 1 * RST_NR_PER_BANK + 4, 190 + [MT8188_INFRA_RST3_PTP_CTRL_RST] = 3 * RST_NR_PER_BANK + 5, 191 + }; 192 + 193 + static const struct mtk_clk_rst_desc infra_ao_rst_desc = { 194 + .version = MTK_RST_SET_CLR, 195 + .rst_bank_ofs = infra_ao_rst_ofs, 196 + .rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs), 197 + .rst_idx_map = infra_ao_idx_map, 198 + .rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map), 199 + }; 200 + 180 201 static const struct mtk_clk_desc infra_ao_desc = { 181 202 .clks = infra_ao_clks, 182 203 .num_clks = ARRAY_SIZE(infra_ao_clks), 204 + .rst_desc = &infra_ao_rst_desc, 183 205 }; 184 206 185 207 static const struct of_device_id of_match_clk_mt8188_infra_ao[] = {