Commit 9ff50bf2 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk driver fixes from Stephen Boyd:

 - Make the regulator state match the GDSC power domain state at boot on
   Qualcomm SoCs so that the regulator isn't turned off inadvertently.

 - Fix earlycon on i.MX6Q SoCs

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: qcom: gdsc: Ensure regulator init state matches GDSC state
  clk: imx6q: fix uart earlycon unwork
parents 9085423f 9711759a
...@@ -974,6 +974,6 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) ...@@ -974,6 +974,6 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
hws[IMX6QDL_CLK_PLL3_USB_OTG]->clk); hws[IMX6QDL_CLK_PLL3_USB_OTG]->clk);
} }
imx_register_uart_clocks(1); imx_register_uart_clocks(2);
} }
CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init); CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init);
...@@ -357,27 +357,43 @@ static int gdsc_init(struct gdsc *sc) ...@@ -357,27 +357,43 @@ static int gdsc_init(struct gdsc *sc)
if (on < 0) if (on < 0)
return on; return on;
/* if (on) {
* Votable GDSCs can be ON due to Vote from other masters. /* The regulator must be on, sync the kernel state */
* If a Votable GDSC is ON, make sure we have a Vote. if (sc->rsupply) {
*/ ret = regulator_enable(sc->rsupply);
if ((sc->flags & VOTABLE) && on) if (ret < 0)
gdsc_enable(&sc->pd); return ret;
}
/* /*
* Make sure the retain bit is set if the GDSC is already on, otherwise * Votable GDSCs can be ON due to Vote from other masters.
* we end up turning off the GDSC and destroying all the register * If a Votable GDSC is ON, make sure we have a Vote.
* contents that we thought we were saving. */
*/ if (sc->flags & VOTABLE) {
if ((sc->flags & RETAIN_FF_ENABLE) && on) ret = regmap_update_bits(sc->regmap, sc->gdscr,
gdsc_retain_ff_on(sc); SW_COLLAPSE_MASK, val);
if (ret)
return ret;
}
/* Turn on HW trigger mode if supported */
if (sc->flags & HW_CTRL) {
ret = gdsc_hwctrl(sc, true);
if (ret < 0)
return ret;
}
/* If ALWAYS_ON GDSCs are not ON, turn them ON */ /*
if (sc->flags & ALWAYS_ON) { * Make sure the retain bit is set if the GDSC is already on,
if (!on) * otherwise we end up turning off the GDSC and destroying all
gdsc_enable(&sc->pd); * the register contents that we thought we were saving.
*/
if (sc->flags & RETAIN_FF_ENABLE)
gdsc_retain_ff_on(sc);
} else if (sc->flags & ALWAYS_ON) {
/* If ALWAYS_ON GDSCs are not ON, turn them ON */
gdsc_enable(&sc->pd);
on = true; on = true;
sc->pd.flags |= GENPD_FLAG_ALWAYS_ON;
} }
if (on || (sc->pwrsts & PWRSTS_RET)) if (on || (sc->pwrsts & PWRSTS_RET))
...@@ -385,6 +401,8 @@ static int gdsc_init(struct gdsc *sc) ...@@ -385,6 +401,8 @@ static int gdsc_init(struct gdsc *sc)
else else
gdsc_clear_mem_on(sc); gdsc_clear_mem_on(sc);
if (sc->flags & ALWAYS_ON)
sc->pd.flags |= GENPD_FLAG_ALWAYS_ON;
if (!sc->pd.power_off) if (!sc->pd.power_off)
sc->pd.power_off = gdsc_disable; sc->pd.power_off = gdsc_disable;
if (!sc->pd.power_on) if (!sc->pd.power_on)
......
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