From patchwork Thu Sep 29 08:35:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 9355935 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0115A6086A for ; Thu, 29 Sep 2016 08:39:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7A8A29912 for ; Thu, 29 Sep 2016 08:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC5A829900; Thu, 29 Sep 2016 08:39:20 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 88B0B29912 for ; Thu, 29 Sep 2016 08:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755261AbcI2Iim (ORCPT ); Thu, 29 Sep 2016 04:38:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56952 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754097AbcI2Igy (ORCPT ); Thu, 29 Sep 2016 04:36:54 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 08C3961803; Thu, 29 Sep 2016 08:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475138207; bh=shys1oDsZ9doDPmJadOgixd2DwHNmbCyZMVw9+/KXNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eYQc+s7On840Vl7uG6BZ5T/W39BYCnLL1NDa36uSDVZk6GACqVmXUUK8XG16a2e/n UDumvuPTZLdkBxcQSskAArboN4MOrTbzmUuIS8fenl2RXba5glwfk3yCfhuIP32975 0ybBkdn7VmzS/X44Lss3TYj5CiMes+LRfzR+4bWY= Received: from blr-ubuntu-34.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BF7A961AD3; Thu, 29 Sep 2016 08:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475138206; bh=shys1oDsZ9doDPmJadOgixd2DwHNmbCyZMVw9+/KXNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DXgzuNZ30ue3ceXXnhAUA54kfPUAOEY84pVupyrF/wlfOdkSt0jIgp6ckDLLnEp6w B0k0i2yOR8BW8+JhlCwA7orvfmejk2l+XBex3GskpbxAL8INg/l6wUmk6UL3b7OOdV 4/CyCcV+tRR13dULqrEnbr/pwJnsE9FJU2MWi62k= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org BF7A961AD3 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=rnayak@codeaurora.org From: Rajendra Nayak To: sboyd@codeaurora.org, mturquette@baylibre.com Cc: linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, tdas@codeaurora.org, Rajendra Nayak Subject: [PATCH v3 10/11] clk: Add clk_hw_get_clk() helper API to be used by clk providers Date: Thu, 29 Sep 2016 14:05:51 +0530 Message-Id: <1475138152-859-11-git-send-email-rnayak@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1475138152-859-1-git-send-email-rnayak@codeaurora.org> References: <1475138152-859-1-git-send-email-rnayak@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 Add a helper API that will allow clk providers to turn their clk_hw structures into struct clk pointer. Signed-off-by: Rajendra Nayak --- drivers/clk/clk.c | 6 ++++++ include/linux/clk-provider.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 820a939..a084132 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -186,6 +186,12 @@ const char *clk_hw_get_name(const struct clk_hw *hw) } EXPORT_SYMBOL_GPL(clk_hw_get_name); +struct clk *clk_hw_get_clk(const struct clk_hw *hw) +{ + return hw->clk; +} +EXPORT_SYMBOL_GPL(clk_hw_get_clk); + struct clk_hw *__clk_get_hw(struct clk *clk) { return !clk ? NULL : clk->core->hw; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index a39c0c5..77d05f1 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -729,6 +729,7 @@ void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw); /* helper functions */ const char *__clk_get_name(const struct clk *clk); const char *clk_hw_get_name(const struct clk_hw *hw); +struct clk *clk_hw_get_clk(const struct clk_hw *hw); struct clk_hw *__clk_get_hw(struct clk *clk); unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);