Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3188841ybf; Tue, 3 Mar 2020 01:04:33 -0800 (PST) X-Google-Smtp-Source: ADFU+vtsLro8nxCLqbcFYXUWNuHIKU+bKqRzCJnwqAMLpdcTkZeZbpjGhEJkSWiRRIDZOW5WUKaa X-Received: by 2002:a05:6830:1e37:: with SMTP id t23mr2732871otr.16.1583226273073; Tue, 03 Mar 2020 01:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583226273; cv=none; d=google.com; s=arc-20160816; b=04TkXJLgqVuwXAeV11IpAScxwdh1MEcdJ4ZPTZ2QGYDdSeKZWsfDbK8i3/NJXV2bxj swhVtO8VwDTmAYN635VDFvHxih0mSgb8ZAHA7g8RFkZZ/+gSwPVlWg8oxHB5ZSLh4zH0 PJXdgVQvt1oJ2a1o/6bqiOwOIVm6KQsO8FHlG5P4UkJGovcR+KbEDOvZUjNsnqWRnlsn EA6Xi2MIxqfRdSk2jDtzjTPkoaUvQVzWRFIFyd9KmeCt49LUi4uHY+U33sJDOholQnml dIEFxPlvstduHPMaeSfSxIPCipA0X1KxduNfaVZbeLs51oKc4d1dhYzuUAEQViPqhkJB DIrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=X9CU8LX7uIdltFKlDhWkv58p06Q1boo/DNtuy0Kf7yk=; b=HcLIh0pxQxbT9JVQeI7LE1K4V22P2QLfrekxl/vcrEjUV7g6fIhbp1RAg8CTjaY1Im +xNn80YERTMuRHRMweGDAPNYwdBFYn7kHjk4N2pK/e5AFOe5+NyXsOC8XUzYXlVNGIyM 1gVhcdFOcZcR+iv1eP6kDQLbg/bOkM184TPb2VfjQxktZ6xKn1p3QJlKnllaupqCUWG/ Y7hBB/5ag+HgTUxgklTNncQsxKphQ6gDebno5GxAbL5QKIfMir7eoWRHZh9SSgeWXf69 yDB8K3B/AOfVQofEw597O/ZLiwY0esWLwqCRuR/l938QShwnDc6+riiAGABVOgLjBpg9 PYoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e81si8181508ote.13.2020.03.03.01.04.21; Tue, 03 Mar 2020 01:04:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728078AbgCCJDu (ORCPT + 99 others); Tue, 3 Mar 2020 04:03:50 -0500 Received: from inva021.nxp.com ([92.121.34.21]:39864 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbgCCJDo (ORCPT ); Tue, 3 Mar 2020 04:03:44 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 049C5201334; Tue, 3 Mar 2020 10:03:43 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EAFC4201332; Tue, 3 Mar 2020 10:03:42 +0100 (CET) Received: from fsr-ub1664-175.ea.freescale.net (fsr-ub1664-175.ea.freescale.net [10.171.82.40]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id EFAE520414; Tue, 3 Mar 2020 10:03:41 +0100 (CET) From: Abel Vesa To: Rob Herring , Shawn Guo , Sascha Hauer , Fabio Estevam , Mike Turquette , Stephen Boyd , Lee Jones , Anson Huang , Leonard Crestez , Peng Fan , Jacky Bai Cc: NXP Linux Team , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , linux-clk@vger.kernel.org, Abel Vesa Subject: [RFC 06/11] clk: imx: Add helpers for passing the device as argument Date: Tue, 3 Mar 2020 11:03:21 +0200 Message-Id: <1583226206-19758-7-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583226206-19758-1-git-send-email-abel.vesa@nxp.com> References: <1583226206-19758-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All the imx clocks that need to be registered by the audiomix need to pass on the device so that the runtime PM support could work properly. Signed-off-by: Abel Vesa --- drivers/clk/imx/clk.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index cb28f06..42960a9 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -321,6 +321,13 @@ static inline struct clk_hw *imx_clk_hw_gate(const char *name, const char *paren shift, 0, &imx_ccm_lock); } +static inline struct clk_hw *imx_dev_clk_hw_gate(struct device *dev, const char *name, + const char *parent, void __iomem *reg, u8 shift) +{ + return clk_hw_register_gate(dev, name, parent, CLK_SET_RATE_PARENT, reg, + shift, 0, &imx_ccm_lock); +} + static inline struct clk_hw *imx_clk_hw_gate_dis(const char *name, const char *parent, void __iomem *reg, u8 shift) { @@ -422,6 +429,15 @@ static inline struct clk_hw *imx_clk_hw_mux(const char *name, void __iomem *reg, width, 0, &imx_ccm_lock); } +static inline struct clk_hw *imx_dev_clk_hw_mux(struct device *dev, const char *name, + void __iomem *reg, u8 shift, u8 width, + const char * const *parents, int num_parents) +{ + return clk_hw_register_mux(dev, name, parents, num_parents, + CLK_SET_RATE_NO_REPARENT | CLK_SET_PARENT_GATE, + reg, shift, width, 0, &imx_ccm_lock); +} + static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg, u8 shift, u8 width, const char * const *parents, int num_parents) @@ -484,6 +500,19 @@ static inline struct clk_hw *imx_clk_hw_mux_flags(const char *name, reg, shift, width, 0, &imx_ccm_lock); } +static inline struct clk_hw *imx_dev_clk_hw_mux_flags(struct device *dev, + const char *name, + void __iomem *reg, u8 shift, + u8 width, + const char * const *parents, + int num_parents, + unsigned long flags) +{ + return clk_hw_register_mux(dev, name, parents, num_parents, + flags | CLK_SET_RATE_NO_REPARENT, + reg, shift, width, 0, &imx_ccm_lock); +} + struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name, struct clk *div, struct clk *mux, struct clk *pll, struct clk *step); -- 2.7.4