Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c326afe authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Add skip-disable-before-sw-enable flag to gx_gdsc"

parents 01313c58 82a0cd1c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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

+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
@@ -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";
	};

+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
@@ -88,6 +88,7 @@ struct gdsc {
	int			reset_count;
	int			root_clk_idx;
	u32			gds_timeout;
	bool			skip_disable_before_enable;
};

enum gdscr_status {
@@ -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
@@ -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);
@@ -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);

@@ -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;