From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rajendra Nayak Subject: Re: [PATCH V2 1/2] clk: qcom: gdsc: Add support for gdscs with HW control Date: Tue, 10 Jan 2017 10:18:27 +0530 Message-ID: <5874679B.8010102@codeaurora.org> References: <1479472107-18472-1-git-send-email-sricharan@codeaurora.org> <1479472107-18472-2-git-send-email-sricharan@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:35524 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbdAJEsd (ORCPT ); Mon, 9 Jan 2017 23:48:33 -0500 In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Stanimir Varbanov , Sricharan R , sboyd@codeaurora.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org [].. >> static int gdsc_toggle_logic(struct gdsc *sc, bool en) >> { >> int ret; >> @@ -164,16 +171,28 @@ static int gdsc_enable(struct generic_pm_domain *domain) >> */ >> udelay(1); >> >> + /* Turn on HW trigger mode if supported */ >> + if (sc->flags & HW_CTRL) >> + return gdsc_hwctrl(sc, true); >> + >> return 0; >> } >> >> static int gdsc_disable(struct generic_pm_domain *domain) >> { >> struct gdsc *sc = domain_to_gdsc(domain); >> + int ret; >> >> if (sc->pwrsts == PWRSTS_ON) >> return gdsc_assert_reset(sc); >> >> + /* Turn off HW trigger mode if supported */ >> + if (sc->flags & HW_CTRL) { >> + ret = gdsc_hwctrl(sc, false); > > Looking in the downstream implementation the disabling of the hw control > bit shouldn't be enough. > > After disabling hw control bit we must have a 1us delay and polling for > enabled PWR_ON bit with timeout of 100us, only then we should continue > with disabling the GDSC in software controlled mode. Stan, thats right. I will send a patch to fix this up right-away. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation