Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp132427ima; Fri, 1 Feb 2019 00:32:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN6LPEX2dKdI067OG6J0sLEjK2pfAGeAXx/5CesYIoJBghk/GTnbmQ+4Bd2wrntlENz+xM6P X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr38478635plb.192.1549009959849; Fri, 01 Feb 2019 00:32:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549009959; cv=none; d=google.com; s=arc-20160816; b=jPWqHR23dKHRDP0107s8nRb3y8QOcHaOTQ/4ZZdpRnvrioIw4c1CL7Ghcq7nrXyqKb ah6UW6nx7ZBWoXv4pI0kwWmE6YhteQxax8PRLwwOyM8jU7HlbJBRZoduS2LI8blZjEPo 0silWf4f4R0LL+YubazpJZH+89fdT36fYl8NWaYu8ahrrUPr0PTVybhp4I3tuZxKE5RK JIuq95dsLlKwI1B7kUARddpa0piZoPD2mDHKMiaFG6OoRGXU0sLpKkBi1ZPEED6uah1B 19IGaXmZhxw3ijOpXwCdOwNeqmDB6p1oyVKudybhfwV96hK+UIlYCcfx5mIdC8aznuen j9zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=meb7dFEz57aP8kNl2BdWYam46iMRP7IUNuPveQFYVuM=; b=O3teT/IWCUwnSEk9XbMy0agUG09aYoe3cxeJYydb8V3Kgr1QQ6xtb3TN4P6VMuuCOI MO18RG7ddOZOtde2Ozi75gmfrRtUPBnK/SDl6gZ004KIvL7zVUXr8wPWLirZaNMhgQMi ic5GVcIWK34LIXuAEDUqi0huzaTBcG42Uf9HpEihrIbrYp2FgDvNP48xQ7WEtDIxHRb2 QH49WFpYR8jtK0CeMwFDX0ub7yu7KAE/6mL8fB3BykvdcyNlXgM48gd4m0OKlBzsmh+b vynA+R5ph0ockZ7SRB8y/yWGvc4pgvyhif9z2hEZzGNub5fuUHEBxRoqIRNR2oZF5zgT XXDg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69si6163987pgd.284.2019.02.01.00.32.24; Fri, 01 Feb 2019 00:32:39 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729399AbfBAIbq (ORCPT + 99 others); Fri, 1 Feb 2019 03:31:46 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:47459 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727356AbfBAIag (ORCPT ); Fri, 1 Feb 2019 03:30:36 -0500 X-UUID: 040a61fecca74f9d902c6d12b5f2d887-20190201 X-UUID: 040a61fecca74f9d902c6d12b5f2d887-20190201 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1132226348; Fri, 01 Feb 2019 16:30:27 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 1 Feb 2019 16:30:26 +0800 Received: from mtkslt210.mediatek.inc (10.21.14.14) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 1 Feb 2019 16:30:26 +0800 From: Weiyi Lu To: Nicolas Boichat , Matthias Brugger , Stephen Boyd , Rob Herring CC: James Liao , Fan Chen , , , , , , , Weiyi Lu Subject: [PATCH v4 07/12] clk: mediatek: Add flags support for mtk_gate data Date: Fri, 1 Feb 2019 16:30:11 +0800 Message-ID: <20190201083016.25856-9-weiyi.lu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190201083016.25856-1-weiyi.lu@mediatek.com> References: <20190201083016.25856-1-weiyi.lu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 116390C3C4E605597479EC203FF67BD451D1273B3A3D4E555CA5B57D5D7C5AC72000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On some Mediatek platforms, there are critical clocks of clock gate type. To register clock gate with flags CLK_IS_CRITICAL, we need to add the flags field in mtk_gate data and register APIs. Signed-off-by: Weiyi Lu --- drivers/clk/mediatek/clk-gate.c | 5 +++-- drivers/clk/mediatek/clk-gate.h | 3 ++- drivers/clk/mediatek/clk-mtk.c | 3 ++- drivers/clk/mediatek/clk-mtk.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c index 934bf0e45e26..85daf826619a 100644 --- a/drivers/clk/mediatek/clk-gate.c +++ b/drivers/clk/mediatek/clk-gate.c @@ -157,7 +157,8 @@ struct clk *mtk_clk_register_gate( int clr_ofs, int sta_ofs, u8 bit, - const struct clk_ops *ops) + const struct clk_ops *ops, + unsigned long flags) { struct mtk_clk_gate *cg; struct clk *clk; @@ -168,7 +169,7 @@ struct clk *mtk_clk_register_gate( return ERR_PTR(-ENOMEM); init.name = name; - init.flags = CLK_SET_RATE_PARENT; + init.flags = flags | CLK_SET_RATE_PARENT; init.parent_names = parent_name ? &parent_name : NULL; init.num_parents = parent_name ? 1 : 0; init.ops = ops; diff --git a/drivers/clk/mediatek/clk-gate.h b/drivers/clk/mediatek/clk-gate.h index 72ef89b3ad7b..9f766dfe1d57 100644 --- a/drivers/clk/mediatek/clk-gate.h +++ b/drivers/clk/mediatek/clk-gate.h @@ -47,6 +47,7 @@ struct clk *mtk_clk_register_gate( int clr_ofs, int sta_ofs, u8 bit, - const struct clk_ops *ops); + const struct clk_ops *ops, + unsigned long flags); #endif /* __DRV_CLK_GATE_H */ diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index 9c0ae4278a94..35359e5397c7 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -130,7 +130,8 @@ int mtk_clk_register_gates(struct device_node *node, gate->regs->set_ofs, gate->regs->clr_ofs, gate->regs->sta_ofs, - gate->shift, gate->ops); + gate->shift, gate->ops, + gate->flags); if (IS_ERR(clk)) { pr_err("Failed to register clk %s: %ld\n", diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h index 11b5517903d0..928905496c4b 100644 --- a/drivers/clk/mediatek/clk-mtk.h +++ b/drivers/clk/mediatek/clk-mtk.h @@ -158,6 +158,7 @@ struct mtk_gate { const struct mtk_gate_regs *regs; int shift; const struct clk_ops *ops; + unsigned long flags; }; int mtk_clk_register_gates(struct device_node *node, -- 2.18.0