From patchwork Mon Nov 7 11:24:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ritesh Harjani X-Patchwork-Id: 9414743 X-Patchwork-Delegate: agross@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 77A9760512 for ; Mon, 7 Nov 2016 11:25:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66AA928BBB for ; Mon, 7 Nov 2016 11:25:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B15628BCC; Mon, 7 Nov 2016 11:25:35 +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 0B66F28BC2 for ; Mon, 7 Nov 2016 11:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752077AbcKGLZd (ORCPT ); Mon, 7 Nov 2016 06:25:33 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:59968 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbcKGLZc (ORCPT ); Mon, 7 Nov 2016 06:25:32 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4AC6161269; Mon, 7 Nov 2016 11:25:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1478517931; bh=7yRW6yYtI8zMDH9Xq1aY0c9WwF3paAdFA1jUn45GCgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aw3APQuZ7qW1OfXR3UVGlSyZr4ea3p9CMB57mJ8O/F6A1ToJwCq14+1lcQpdeUnr/ xl3mjHOzDxStvEFRVM8RioY2XFuXPyeu1SRUtyCBIuAb2nnoCnhH9PNkq3Qkl7xWPa MHk1M/Sq41Zu8fSFXy8YdBJfl4WiwxkvWoDbtW1o= Received: from rharjani-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: riteshh@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 69A9C606DC; Mon, 7 Nov 2016 11:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1478517930; bh=7yRW6yYtI8zMDH9Xq1aY0c9WwF3paAdFA1jUn45GCgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KuUsCLtEqMAwa5/RsRS4HYdpbZFh7DMeNcCtrwKGjp8gV4hWOqQSYF+9oy4cP6kXc W2RjncJvnMB/LLmSVZajnWz9+k9AZ+WILiqTeexHE81Uhr5FAksGcZfgZGouPG/oQq iSKlSDQTo9Lis72RQ8FFNCJ3155Favn9Udzm+gWE= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 69A9C606DC 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=riteshh@codeaurora.org From: Ritesh Harjani To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, adrian.hunter@intel.com, shawn.lin@rock-chips.com, sboyd@codeaurora.org Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org, david.brown@linaro.org, andy.gross@linaro.org, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, alex.lemberg@sandisk.com, mateusz.nowak@intel.com, Yuliy.Izrailov@sandisk.com, asutoshd@codeaurora.org, kdorfman@codeaurora.org, david.griego@linaro.org, stummala@codeaurora.org, venkatg@codeaurora.org, rnayak@codeaurora.org, pramod.gurav@linaro.org Subject: [PATCH v6 01/14] clk: Add clk_hw_get_clk() helper API to be used by clk providers Date: Mon, 7 Nov 2016 16:54:24 +0530 Message-Id: <1478517877-23733-2-git-send-email-riteshh@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1478517877-23733-1-git-send-email-riteshh@codeaurora.org> References: <1478517877-23733-1-git-send-email-riteshh@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rajendra Nayak 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 0fb39fe..52ef035 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 af59638..37022a9 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -729,6 +729,7 @@ struct clk_hw *clk_hw_register_gpio_mux(struct device *dev, const char *name, /* 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);