Loading Documentation/devicetree/bindings/regulator/gdsc-regulator.txt +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ Optional properties: identifier. If this is specified, then a QMP message should be sent to enable the GDSC instead of setting SW_COLLAPSE=0. - qcom,skip-disable-before-sw-enable: Presence denotes a hardware requirement to leave the GDSC on that has been enabled by an entity external to HLOS. [1]: Documentation/devicetree/bindings/arm/msm/msm_bus.txt Loading arch/arm64/boot/dts/qcom/atoll-gdsc.dtsi +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -134,6 +134,7 @@ qcom,poll-cfg-gdscr; domain-addr = <&gpu_gx_domain_addr>; sw-reset = <&gpu_gx_sw_reset>; qcom,skip-disable-before-sw-enable; status = "disabled"; }; Loading drivers/clk/qcom/gdsc-regulator.c +13 −1 Original line number Diff line number Diff line /* * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -88,6 +88,7 @@ struct gdsc { int reset_count; int root_clk_idx; u32 gds_timeout; bool skip_disable_before_enable; }; enum gdscr_status { Loading Loading @@ -166,6 +167,9 @@ static int gdsc_is_enabled(struct regulator_dev *rdev) if (!sc->toggle_logic) return !sc->resets_asserted; if (sc->skip_disable_before_enable) return false; if (sc->parent_regulator) { /* * The parent regulator for the GDSC is required to be on to Loading Loading @@ -258,6 +262,9 @@ static int gdsc_enable(struct regulator_dev *rdev) uint32_t regval, hw_ctrl_regval = 0x0; int i, ret = 0; if (sc->skip_disable_before_enable) return 0; if (sc->parent_regulator) { ret = regulator_set_voltage(sc->parent_regulator, RPMH_REGULATOR_LEVEL_LOW_SVS, INT_MAX); Loading Loading @@ -423,6 +430,8 @@ static int gdsc_enable(struct regulator_dev *rdev) sc->is_bus_enabled = false; } sc->skip_disable_before_enable = false; if (ret && sc->parent_regulator) regulator_set_voltage(sc->parent_regulator, 0, INT_MAX); Loading Loading @@ -994,6 +1003,9 @@ static int gdsc_probe(struct platform_device *pdev) clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_PERIPH); } sc->skip_disable_before_enable = of_property_read_bool( pdev->dev.of_node, "qcom,skip-disable-before-sw-enable"); reg_config.dev = &pdev->dev; reg_config.init_data = init_data; reg_config.driver_data = sc; Loading Loading
Documentation/devicetree/bindings/regulator/gdsc-regulator.txt +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ Optional properties: identifier. If this is specified, then a QMP message should be sent to enable the GDSC instead of setting SW_COLLAPSE=0. - qcom,skip-disable-before-sw-enable: Presence denotes a hardware requirement to leave the GDSC on that has been enabled by an entity external to HLOS. [1]: Documentation/devicetree/bindings/arm/msm/msm_bus.txt Loading
arch/arm64/boot/dts/qcom/atoll-gdsc.dtsi +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -134,6 +134,7 @@ qcom,poll-cfg-gdscr; domain-addr = <&gpu_gx_domain_addr>; sw-reset = <&gpu_gx_sw_reset>; qcom,skip-disable-before-sw-enable; status = "disabled"; }; Loading
drivers/clk/qcom/gdsc-regulator.c +13 −1 Original line number Diff line number Diff line /* * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -88,6 +88,7 @@ struct gdsc { int reset_count; int root_clk_idx; u32 gds_timeout; bool skip_disable_before_enable; }; enum gdscr_status { Loading Loading @@ -166,6 +167,9 @@ static int gdsc_is_enabled(struct regulator_dev *rdev) if (!sc->toggle_logic) return !sc->resets_asserted; if (sc->skip_disable_before_enable) return false; if (sc->parent_regulator) { /* * The parent regulator for the GDSC is required to be on to Loading Loading @@ -258,6 +262,9 @@ static int gdsc_enable(struct regulator_dev *rdev) uint32_t regval, hw_ctrl_regval = 0x0; int i, ret = 0; if (sc->skip_disable_before_enable) return 0; if (sc->parent_regulator) { ret = regulator_set_voltage(sc->parent_regulator, RPMH_REGULATOR_LEVEL_LOW_SVS, INT_MAX); Loading Loading @@ -423,6 +430,8 @@ static int gdsc_enable(struct regulator_dev *rdev) sc->is_bus_enabled = false; } sc->skip_disable_before_enable = false; if (ret && sc->parent_regulator) regulator_set_voltage(sc->parent_regulator, 0, INT_MAX); Loading Loading @@ -994,6 +1003,9 @@ static int gdsc_probe(struct platform_device *pdev) clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_PERIPH); } sc->skip_disable_before_enable = of_property_read_bool( pdev->dev.of_node, "qcom,skip-disable-before-sw-enable"); reg_config.dev = &pdev->dev; reg_config.init_data = init_data; reg_config.driver_data = sc; Loading