4b74873b158fe632b743c2df92874cc7b2fd7417
[openwrt/staging/wigyori.git] / target / linux / mediatek / patches-5.15 / 350-07-cpufreq-mediatek-Make-sram-regulator-optional.patch
1 From f6114c2bc563a8050e9dc874ad87e1448865f031 Mon Sep 17 00:00:00 2001
2 From: Jia-Wei Chang <jia-wei.chang@mediatek.com>
3 Date: Fri, 22 Apr 2022 15:52:33 +0800
4 Subject: [PATCH 07/21] cpufreq: mediatek: Make sram regulator optional
5
6 For some MediaTek SoCs, like MT8186, it's possible that the sram regulator
7 is shared between CPU and CCI.
8 We hope regulator framework can return error for error handling rather
9 than a dummy handler from regulator_get api.
10 Therefore, we choose to use regulator_get_optional.
11
12 Signed-off-by: Jia-Wei Chang <jia-wei.chang@mediatek.com>
13 Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
14 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
15 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
16 ---
17 drivers/cpufreq/mediatek-cpufreq.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 --- a/drivers/cpufreq/mediatek-cpufreq.c
21 +++ b/drivers/cpufreq/mediatek-cpufreq.c
22 @@ -354,7 +354,7 @@ static int mtk_cpu_dvfs_info_init(struct
23 }
24
25 /* Both presence and absence of sram regulator are valid cases. */
26 - info->sram_reg = regulator_get_exclusive(cpu_dev, "sram");
27 + info->sram_reg = regulator_get_optional(cpu_dev, "sram");
28 if (IS_ERR(info->sram_reg))
29 info->sram_reg = NULL;
30 else {