diff options
author | Olof Johansson <olof@lixom.net> | 2017-06-19 01:51:43 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2017-06-19 01:51:43 -0400 |
commit | a32e6a353dac8641dcdc25854d2c64134839c07f (patch) | |
tree | 4c66517773481f837a5418838a1e2a701e0f137c | |
parent | 8c5c25067044b7bcb2201e761483ef4cacc970d8 (diff) | |
parent | 980532a5dda319eeafadc5c590376626ad178f4f (diff) |
Merge tag 'renesas-rcar-sysc-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/drivers
Renesas ARM Based SoC R-Car SYSC Updates for v4.13
Use GENPD_FLAG_ALWAYS_ON in R-Car SYSC driver
* tag 'renesas-rcar-sysc-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ON
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | drivers/soc/renesas/rcar-sysc.c | 28 | ||||
-rw-r--r-- | drivers/soc/renesas/rcar-sysc.h | 2 |
2 files changed, 4 insertions, 26 deletions
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c index dcad5c42a5e8..7c8da3c90011 100644 --- a/drivers/soc/renesas/rcar-sysc.c +++ b/drivers/soc/renesas/rcar-sysc.c | |||
@@ -181,17 +181,6 @@ static int rcar_sysc_pd_power_off(struct generic_pm_domain *genpd) | |||
181 | struct rcar_sysc_pd *pd = to_rcar_pd(genpd); | 181 | struct rcar_sysc_pd *pd = to_rcar_pd(genpd); |
182 | 182 | ||
183 | pr_debug("%s: %s\n", __func__, genpd->name); | 183 | pr_debug("%s: %s\n", __func__, genpd->name); |
184 | |||
185 | if (pd->flags & PD_NO_CR) { | ||
186 | pr_debug("%s: Cannot control %s\n", __func__, genpd->name); | ||
187 | return -EBUSY; | ||
188 | } | ||
189 | |||
190 | if (pd->flags & PD_BUSY) { | ||
191 | pr_debug("%s: %s busy\n", __func__, genpd->name); | ||
192 | return -EBUSY; | ||
193 | } | ||
194 | |||
195 | return rcar_sysc_power_down(&pd->ch); | 184 | return rcar_sysc_power_down(&pd->ch); |
196 | } | 185 | } |
197 | 186 | ||
@@ -200,12 +189,6 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd) | |||
200 | struct rcar_sysc_pd *pd = to_rcar_pd(genpd); | 189 | struct rcar_sysc_pd *pd = to_rcar_pd(genpd); |
201 | 190 | ||
202 | pr_debug("%s: %s\n", __func__, genpd->name); | 191 | pr_debug("%s: %s\n", __func__, genpd->name); |
203 | |||
204 | if (pd->flags & PD_NO_CR) { | ||
205 | pr_debug("%s: Cannot control %s\n", __func__, genpd->name); | ||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | return rcar_sysc_power_up(&pd->ch); | 192 | return rcar_sysc_power_up(&pd->ch); |
210 | } | 193 | } |
211 | 194 | ||
@@ -223,8 +206,7 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |||
223 | * only be turned off if the CPU is not in use. | 206 | * only be turned off if the CPU is not in use. |
224 | */ | 207 | */ |
225 | pr_debug("PM domain %s contains %s\n", name, "CPU"); | 208 | pr_debug("PM domain %s contains %s\n", name, "CPU"); |
226 | pd->flags |= PD_BUSY; | 209 | genpd->flags |= GENPD_FLAG_ALWAYS_ON; |
227 | gov = &pm_domain_always_on_gov; | ||
228 | } else if (pd->flags & PD_SCU) { | 210 | } else if (pd->flags & PD_SCU) { |
229 | /* | 211 | /* |
230 | * This domain contains an SCU and cache-controller, and | 212 | * This domain contains an SCU and cache-controller, and |
@@ -232,19 +214,17 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) | |||
232 | * not in use. | 214 | * not in use. |
233 | */ | 215 | */ |
234 | pr_debug("PM domain %s contains %s\n", name, "SCU"); | 216 | pr_debug("PM domain %s contains %s\n", name, "SCU"); |
235 | pd->flags |= PD_BUSY; | 217 | genpd->flags |= GENPD_FLAG_ALWAYS_ON; |
236 | gov = &pm_domain_always_on_gov; | ||
237 | } else if (pd->flags & PD_NO_CR) { | 218 | } else if (pd->flags & PD_NO_CR) { |
238 | /* | 219 | /* |
239 | * This domain cannot be turned off. | 220 | * This domain cannot be turned off. |
240 | */ | 221 | */ |
241 | pd->flags |= PD_BUSY; | 222 | genpd->flags |= GENPD_FLAG_ALWAYS_ON; |
242 | gov = &pm_domain_always_on_gov; | ||
243 | } | 223 | } |
244 | 224 | ||
245 | if (!(pd->flags & (PD_CPU | PD_SCU))) { | 225 | if (!(pd->flags & (PD_CPU | PD_SCU))) { |
246 | /* Enable Clock Domain for I/O devices */ | 226 | /* Enable Clock Domain for I/O devices */ |
247 | genpd->flags = GENPD_FLAG_PM_CLK; | 227 | genpd->flags |= GENPD_FLAG_PM_CLK; |
248 | if (has_cpg_mstp) { | 228 | if (has_cpg_mstp) { |
249 | genpd->attach_dev = cpg_mstp_attach_dev; | 229 | genpd->attach_dev = cpg_mstp_attach_dev; |
250 | genpd->detach_dev = cpg_mstp_detach_dev; | 230 | genpd->detach_dev = cpg_mstp_detach_dev; |
diff --git a/drivers/soc/renesas/rcar-sysc.h b/drivers/soc/renesas/rcar-sysc.h index 07edb049a401..1a5bebaf54ba 100644 --- a/drivers/soc/renesas/rcar-sysc.h +++ b/drivers/soc/renesas/rcar-sysc.h | |||
@@ -20,8 +20,6 @@ | |||
20 | #define PD_SCU BIT(1) /* Area contains SCU and L2 cache */ | 20 | #define PD_SCU BIT(1) /* Area contains SCU and L2 cache */ |
21 | #define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */ | 21 | #define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */ |
22 | 22 | ||
23 | #define PD_BUSY BIT(3) /* Busy, for internal use only */ | ||
24 | |||
25 | #define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */ | 23 | #define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */ |
26 | #define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */ | 24 | #define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */ |
27 | #define PD_ALWAYS_ON PD_NO_CR /* Always-on area */ | 25 | #define PD_ALWAYS_ON PD_NO_CR /* Always-on area */ |