Loading Documentation/devicetree/bindings/regulator/tps65132-regulator.txt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ Optional properties: pinctrl for EN-pins. For details of pinctrl properties, please refer to: "Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt" - ti,en-gpio-lpm: A boolean flag to indicate if the enable pin is configured to low power mode (LPM) when the output is disabled. Regulator child node required properties: - regulator-name: A string used as a descriptive name for the regulator Loading arch/arm/boot/dts/qcom/msm8916-qrd-skuh.dtsi +3 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,8 @@ qcom,pin-func = <0>; tps65132_en_default: en-default { driver-strength = <2>; bias-disable; drive-strength = <2>; bias-pull-down; }; }; }; Loading Loading @@ -116,6 +116,7 @@ compatible = "ti,tps65132"; reg = <0x3e>; i2c-pwr-supply = <&pm8916_l6>; ti,en-gpio-lpm; pinctrl-names = "default"; pinctrl-0 = <&tps65132_en_default>; Loading drivers/regulator/tps65132-regulator.c +14 −2 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ struct tps65132_chip { u8 apps_cfg_bit_pos; u8 apps_dischg_val; bool apps_dischg_cfg_postpone; bool en_gpio_lpm; }; #define TPS65132_REG_VPOS 0x00 Loading Loading @@ -99,9 +100,14 @@ static struct of_regulator_match tps65132_reg_matches[] = { static int tps65132_regulator_disable(struct regulator_dev *rdev) { struct tps65132_regulator *vreg = rdev_get_drvdata(rdev); struct tps65132_chip *chip = vreg->chip; if (chip->en_gpio_lpm) gpio_direction_input(vreg->en_gpio); else gpio_set_value_cansleep(vreg->en_gpio, vreg->gpio_flags & OF_GPIO_ACTIVE_LOW ? 1 : 0); vreg->is_enabled = false; return 0; Loading @@ -113,6 +119,10 @@ static int tps65132_regulator_enable(struct regulator_dev *rdev) struct tps65132_chip *chip = vreg->chip; int rc; if (chip->en_gpio_lpm) gpio_direction_output(vreg->en_gpio, vreg->gpio_flags & OF_GPIO_ACTIVE_LOW ? 0 : 1); else gpio_set_value_cansleep(vreg->en_gpio, vreg->gpio_flags & OF_GPIO_ACTIVE_LOW ? 0 : 1); vreg->is_enabled = true; Loading Loading @@ -386,6 +396,8 @@ static int tps65132_parse_dt(struct tps65132_chip *chip, return rc; } } chip->en_gpio_lpm = of_property_read_bool(client->dev.of_node, "ti,en-gpio-lpm"); for (i = 0; i < chip->num_regulators; i++) { match = &tps65132_reg_matches[i]; Loading Loading
Documentation/devicetree/bindings/regulator/tps65132-regulator.txt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ Optional properties: pinctrl for EN-pins. For details of pinctrl properties, please refer to: "Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt" - ti,en-gpio-lpm: A boolean flag to indicate if the enable pin is configured to low power mode (LPM) when the output is disabled. Regulator child node required properties: - regulator-name: A string used as a descriptive name for the regulator Loading
arch/arm/boot/dts/qcom/msm8916-qrd-skuh.dtsi +3 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,8 @@ qcom,pin-func = <0>; tps65132_en_default: en-default { driver-strength = <2>; bias-disable; drive-strength = <2>; bias-pull-down; }; }; }; Loading Loading @@ -116,6 +116,7 @@ compatible = "ti,tps65132"; reg = <0x3e>; i2c-pwr-supply = <&pm8916_l6>; ti,en-gpio-lpm; pinctrl-names = "default"; pinctrl-0 = <&tps65132_en_default>; Loading
drivers/regulator/tps65132-regulator.c +14 −2 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ struct tps65132_chip { u8 apps_cfg_bit_pos; u8 apps_dischg_val; bool apps_dischg_cfg_postpone; bool en_gpio_lpm; }; #define TPS65132_REG_VPOS 0x00 Loading Loading @@ -99,9 +100,14 @@ static struct of_regulator_match tps65132_reg_matches[] = { static int tps65132_regulator_disable(struct regulator_dev *rdev) { struct tps65132_regulator *vreg = rdev_get_drvdata(rdev); struct tps65132_chip *chip = vreg->chip; if (chip->en_gpio_lpm) gpio_direction_input(vreg->en_gpio); else gpio_set_value_cansleep(vreg->en_gpio, vreg->gpio_flags & OF_GPIO_ACTIVE_LOW ? 1 : 0); vreg->is_enabled = false; return 0; Loading @@ -113,6 +119,10 @@ static int tps65132_regulator_enable(struct regulator_dev *rdev) struct tps65132_chip *chip = vreg->chip; int rc; if (chip->en_gpio_lpm) gpio_direction_output(vreg->en_gpio, vreg->gpio_flags & OF_GPIO_ACTIVE_LOW ? 0 : 1); else gpio_set_value_cansleep(vreg->en_gpio, vreg->gpio_flags & OF_GPIO_ACTIVE_LOW ? 0 : 1); vreg->is_enabled = true; Loading Loading @@ -386,6 +396,8 @@ static int tps65132_parse_dt(struct tps65132_chip *chip, return rc; } } chip->en_gpio_lpm = of_property_read_bool(client->dev.of_node, "ti,en-gpio-lpm"); for (i = 0; i < chip->num_regulators; i++) { match = &tps65132_reg_matches[i]; Loading