Loading Documentation/devicetree/bindings/regulator/gdsc-regulator.txt +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,12 @@ Optional properties: - qcom,support-hw-trigger: Presence denotes a hardware feature to switch on/off this regulator based on internal HW signals to save more power. - qcom,enable-root-clk: Presence denotes that the clocks in the "clocks" property are requried to be enabled before gdsc is turned on and disabled before turning off gdsc. This will be used in susbsystems where reset is synchronous and root clk is active without sw being aware of its state. Example: gdsc_oxili_gx: qcom,gdsc@fd8c4024 { Loading drivers/clk/qcom/gdsc.c +15 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ struct gdsc { bool toggle_periph; bool toggle_logic; bool resets_asserted; bool root_en; }; static int gdsc_is_enabled(struct regulator_dev *rdev) Loading @@ -69,6 +70,11 @@ static int gdsc_enable(struct regulator_dev *rdev) uint32_t regval; int i, ret; if (sc->root_en) { for (i = 0; i < sc->clock_count; i++) clk_prepare_enable(sc->clocks[i]); } if (sc->toggle_logic) { regval = readl_relaxed(sc->gdscr); if (regval & HW_CONTROL_MASK) { Loading Loading @@ -147,6 +153,11 @@ static int gdsc_disable(struct regulator_dev *rdev) sc->resets_asserted = true; } if (sc->root_en) { for (i = sc->clock_count-1; i >= 0; i--) clk_disable_unprepare(sc->clocks[i]); } return ret; } Loading Loading @@ -279,6 +290,10 @@ static int gdsc_probe(struct platform_device *pdev) sizeof(struct clk *) * sc->clock_count, GFP_KERNEL); if (!sc->clocks) return -ENOMEM; sc->root_en = of_property_read_bool(pdev->dev.of_node, "qcom,enable-root-clk"); for (i = 0; i < sc->clock_count; i++) { const char *clock_name; of_property_read_string_index(pdev->dev.of_node, "clock-names", Loading Loading
Documentation/devicetree/bindings/regulator/gdsc-regulator.txt +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,12 @@ Optional properties: - qcom,support-hw-trigger: Presence denotes a hardware feature to switch on/off this regulator based on internal HW signals to save more power. - qcom,enable-root-clk: Presence denotes that the clocks in the "clocks" property are requried to be enabled before gdsc is turned on and disabled before turning off gdsc. This will be used in susbsystems where reset is synchronous and root clk is active without sw being aware of its state. Example: gdsc_oxili_gx: qcom,gdsc@fd8c4024 { Loading
drivers/clk/qcom/gdsc.c +15 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ struct gdsc { bool toggle_periph; bool toggle_logic; bool resets_asserted; bool root_en; }; static int gdsc_is_enabled(struct regulator_dev *rdev) Loading @@ -69,6 +70,11 @@ static int gdsc_enable(struct regulator_dev *rdev) uint32_t regval; int i, ret; if (sc->root_en) { for (i = 0; i < sc->clock_count; i++) clk_prepare_enable(sc->clocks[i]); } if (sc->toggle_logic) { regval = readl_relaxed(sc->gdscr); if (regval & HW_CONTROL_MASK) { Loading Loading @@ -147,6 +153,11 @@ static int gdsc_disable(struct regulator_dev *rdev) sc->resets_asserted = true; } if (sc->root_en) { for (i = sc->clock_count-1; i >= 0; i--) clk_disable_unprepare(sc->clocks[i]); } return ret; } Loading Loading @@ -279,6 +290,10 @@ static int gdsc_probe(struct platform_device *pdev) sizeof(struct clk *) * sc->clock_count, GFP_KERNEL); if (!sc->clocks) return -ENOMEM; sc->root_en = of_property_read_bool(pdev->dev.of_node, "qcom,enable-root-clk"); for (i = 0; i < sc->clock_count; i++) { const char *clock_name; of_property_read_string_index(pdev->dev.of_node, "clock-names", Loading