Commit 3e4f74e0 authored by Yong Wu's avatar Yong Wu Committed by Krzysztof Kozlowski

memory: mtk-smi: Add clocks for smi-sub-common

SMI sub common only have one output port. thus it has only one gals
clocks(gals0). then, smi-sub-common require the three clocks(apb/smi/gals0)
in has_gals case.
Signed-off-by: default avatarYong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210914113703.31466-9-yong.wu@mediatek.comSigned-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
parent 47404757
...@@ -74,10 +74,12 @@ static const char * const mtk_smi_larb_clks[] = {"apb", "smi", "gals"}; ...@@ -74,10 +74,12 @@ static const char * const mtk_smi_larb_clks[] = {"apb", "smi", "gals"};
/* /*
* common: Require these four clocks in has_gals case. Otherwise, only apb/smi are required. * common: Require these four clocks in has_gals case. Otherwise, only apb/smi are required.
* sub common: Require apb/smi/gals0 clocks in has_gals case. Otherwise, only apb/smi are required.
*/ */
static const char * const mtk_smi_common_clks[] = {"apb", "smi", "gals0", "gals1"}; static const char * const mtk_smi_common_clks[] = {"apb", "smi", "gals0", "gals1"};
#define MTK_SMI_COM_REQ_CLK_NR 2 #define MTK_SMI_COM_REQ_CLK_NR 2
#define MTK_SMI_COM_GALS_REQ_CLK_NR MTK_SMI_CLK_NR_MAX #define MTK_SMI_COM_GALS_REQ_CLK_NR MTK_SMI_CLK_NR_MAX
#define MTK_SMI_SUB_COM_GALS_REQ_CLK_NR 3
struct mtk_smi_common_plat { struct mtk_smi_common_plat {
enum mtk_smi_type type; enum mtk_smi_type type;
...@@ -467,8 +469,12 @@ static int mtk_smi_common_probe(struct platform_device *pdev) ...@@ -467,8 +469,12 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
common->dev = dev; common->dev = dev;
common->plat = of_device_get_match_data(dev); common->plat = of_device_get_match_data(dev);
if (common->plat->has_gals) if (common->plat->has_gals) {
if (common->plat->type == MTK_SMI_GEN2)
clk_required = MTK_SMI_COM_GALS_REQ_CLK_NR; clk_required = MTK_SMI_COM_GALS_REQ_CLK_NR;
else if (common->plat->type == MTK_SMI_GEN2_SUB_COMM)
clk_required = MTK_SMI_SUB_COM_GALS_REQ_CLK_NR;
}
ret = mtk_smi_dts_clk_init(dev, common, mtk_smi_common_clks, clk_required, 0); ret = mtk_smi_dts_clk_init(dev, common, mtk_smi_common_clks, clk_required, 0);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment