From patchwork Mon Nov 19 23:47:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10689623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF0BF13BB for ; Mon, 19 Nov 2018 23:47:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15DD2A3F0 for ; Mon, 19 Nov 2018 23:47:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B56712A567; Mon, 19 Nov 2018 23:47:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 692C62A3F0 for ; Mon, 19 Nov 2018 23:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732148AbeKTKNW (ORCPT ); Tue, 20 Nov 2018 05:13:22 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:55138 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726431AbeKTKNW (ORCPT ); Tue, 20 Nov 2018 05:13:22 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8C7D260F39; Mon, 19 Nov 2018 23:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542671234; bh=wdqBCYihQ6Q6FwhJQZHjTJyK6hJPxkoDalFBTcPQ5TQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jW7rKHwtb1sqR10Cw/xAkgVDfewC6UCjA3iGSI7yNFBrLatyU8KU72kdUY5Eygq+X Jpa/FhkzCv3wc50SSh/T/3jhr7Z3XnpyG9AaeAD6soU2J1injMjN3jE9WV9dV0Fw83 Iz6eF3z+fD3ZU/oSY741rTS1IZFSGukXXbXfDJ1Y= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C46D160BDE; Mon, 19 Nov 2018 23:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542671233; bh=wdqBCYihQ6Q6FwhJQZHjTJyK6hJPxkoDalFBTcPQ5TQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mHyfvIu7WTxtJ9ATU2ZX7dHhuhVNwgBMjJx699zJ0SjWdkBxDzP2UGXNANigaZvA7 fPKvV25lftpWWWDB8JptapAVgP0Q2hPBTSMFO623/0xFTD8xnLOMk+orwcrrOkfCTE FVYjZFPtdTzFv02+EkChNpObVM4aZnNtS4W3GYm8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C46D160BDE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: sboyd@kernel.org, mturquette@baylibre.com Cc: andy.gross@linaro.org, david.brown@linaro.org, rnayak@codeaurora.org, okukatla@codeaurora.org, tdas@codeaurora.org, linux-arm-msm@vger.kernel.orgi, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, robdclark@gmail.com, freedreno@lists.freedesktop.org Subject: [PATCH 2/4] clk: qcom: gdsc: Don't override existing gdsc pd functions Date: Mon, 19 Nov 2018 16:47:04 -0700 Message-Id: <20181119234706.5821-3-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181119234706.5821-1-jcrouse@codeaurora.org> References: <20181119234706.5821-1-jcrouse@codeaurora.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In very extreme cases an individual gdsc may wish to override the power domain enable or disable callback functions for their own purposes. Only set the generic gdsc callback if the function pointers are not already set. Signed-off-by: Jordan Crouse Acked-by: Rajendra Nayak --- drivers/clk/qcom/gdsc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index b6adca1f3918..7b55368b9a9c 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -394,8 +394,10 @@ static int gdsc_init(struct gdsc *sc) else gdsc_clear_mem_on(sc); - sc->pd.power_off = gdsc_disable; - sc->pd.power_on = gdsc_enable; + if (!sc->pd.power_off) + sc->pd.power_off = gdsc_disable; + if (!sc->pd.power_on) + sc->pd.power_on = gdsc_enable; pm_genpd_init(&sc->pd, NULL, !on); return 0;