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

Commit 83514e67 authored by Aditya Bavanari's avatar Aditya Bavanari Committed by Gerrit - the friendly Code Review server
Browse files

soc: pinctrl-lpi: Disable core clock only if it is enabled



Clock driver throws warning when clock disable is called
without enable. Disable core clock only if the respective clock
enable is successful to avoid this warning.

Change-Id: I489647a444c9be326e5805c353385240c6c6d0fc
Signed-off-by: default avatarAditya Bavanari <abavanar@codeaurora.org>
parent 72070ea2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ struct lpi_gpio_state {
	struct gpio_chip chip;
	char __iomem	*base;
	struct clk *lpass_core_hw_vote;
	bool core_hw_vote_status;
};

static const char *const lpi_gpio_groups[] = {
@@ -645,6 +646,7 @@ static int lpi_pinctrl_probe(struct platform_device *pdev)
		dev_dbg(dev, "%s: unable to get core clk handle %d\n",
			__func__, ret);

	state->core_hw_vote_status = false;
	pm_runtime_set_autosuspend_delay(&pdev->dev, LPI_AUTO_SUSPEND_DELAY);
	pm_runtime_use_autosuspend(&pdev->dev);
	pm_runtime_set_suspended(&pdev->dev);
@@ -695,6 +697,8 @@ static int lpi_pinctrl_runtime_resume(struct device *dev)
	if (ret < 0)
		dev_err(dev, "%s: lpass core hw enable failed\n",
			__func__);
	else
		state->core_hw_vote_status = true;

	pm_runtime_set_autosuspend_delay(dev, LPI_AUTO_SUSPEND_DELAY);
	return 0;
@@ -712,7 +716,10 @@ static int lpi_pinctrl_runtime_suspend(struct device *dev)
		return 0;
	}

	if (state->core_hw_vote_status) {
		clk_disable_unprepare(state->lpass_core_hw_vote);
		state->core_hw_vote_status = false;
	}
	return 0;
}