Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4755453imm; Mon, 30 Jul 2018 22:42:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdVIP2ssh9+EuSNWvhop3I9eEMOJqxlk5hRlg8YU2SbWSWgzu3UexM6C53+zKKqjTsKyGLi X-Received: by 2002:a63:f713:: with SMTP id x19-v6mr18940301pgh.233.1533015730575; Mon, 30 Jul 2018 22:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533015730; cv=none; d=google.com; s=arc-20160816; b=L1BZwPlFROk43xkGGMeD55F3CyIF1+KBiOxgd3d+FRK0vWaBPVHKmLzTWp6kZ9vJ+b R4zrZt57Buqk76NPSHQEcMySDtEYIUisGp6HTTQetl6DJ9SsxCaqcZIEx0VoUndlEUz7 uVGMUMSuhSUsGWFyRF+8ILRdcUdMauNUAH6Ah6hjafHIU0+VR79kheuqerLkW9PjdLBa 5GUiPQJTSdWyDA8XubsxN8DrgGnTu4w4yFdNpD+uYG6kD+Dnx5f+KMoXiqclV1IXjxjZ ELykR96AKk/VJgfgReA2+B8TPL8lcwNhwVBdLNE8gkdHlBUZqhL5yEnJtha9eZ/VpT6K 76eA== 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:arc-authentication-results; bh=/3dtQr+ry4Zgao/TrAYl3bGnLH745BlZbIJsY5Bqfs4=; b=Y1CwEsm+2JqzXgHAqRxN5e0/sRPXtW7M4Qr7RtcJm4Vr7GdaPNZ0HeIrfeyG459tyK LqrLEnZtIP7FSjMWX6ak8AUBJCkjsTCXHwtJT86EsZDsvn9agN8doD1SOtGFkzHuscb0 Ue+8+u4xeyZAlzZ4YHrany8jEM7Z9qZw+8ayKJ707heZ9dNFxWRiTuRy2PoiVl6YQc0g CcowcJe45f0yeTow/NIZD9G+xPrHmUoLQheiyNeE95/XvR+F7787/L9WeRUyvA/D9LI5 3QU+GicKRTPi7zBMghG9wyYmRUAzzbJeZ6YnKGQXS3qyniJ3ZsPf7zunnxgzV3dO8Tc5 VCFg== 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 b7-v6si12618240plk.29.2018.07.30.22.41.56; Mon, 30 Jul 2018 22:42:10 -0700 (PDT) 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 S1731366AbeGaHSn (ORCPT + 99 others); Tue, 31 Jul 2018 03:18:43 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:17539 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729639AbeGaHSD (ORCPT ); Tue, 31 Jul 2018 03:18:03 -0400 X-UUID: 9b339fbd0a094250bc309804ee957a64-20180731 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 887360; Tue, 31 Jul 2018 13:39:29 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 31 Jul 2018 13:39:27 +0800 Received: from mtkslt303.mediatek.inc (10.21.14.116) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Tue, 31 Jul 2018 13:39:27 +0800 From: Erin Lo To: Matthias Brugger , Rob Herring , Mark Rutland , Thomas Gleixner , Jason Cooper , Marc Zyngier , Greg Kroah-Hartman , Stephen Boyd CC: , srv_heupstream , , , , , , , , , , Weiyi Lu Subject: [PATCH v4 06/10] clk: mediatek: Add flags support for mtk_gate data Date: Tue, 31 Jul 2018 13:38:03 +0800 Message-ID: <1533015487-60189-7-git-send-email-erin.lo@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533015487-60189-1-git-send-email-erin.lo@mediatek.com> References: <1533015487-60189-1-git-send-email-erin.lo@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Weiyi Lu 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 Signed-off-by: Erin Lo --- 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 934bf0e..25d25c3 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 int 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 72ef89b..631cd3a 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 int flags); #endif /* __DRV_CLK_GATE_H */ diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c index 50becd0..15310f8 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c @@ -131,7 +131,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 61693f6..c3285ff 100644 --- a/drivers/clk/mediatek/clk-mtk.h +++ b/drivers/clk/mediatek/clk-mtk.h @@ -217,6 +217,7 @@ struct mtk_gate { const struct mtk_gate_regs *regs; int shift; const struct clk_ops *ops; + unsigned int flags; }; int mtk_clk_register_gates(struct device_node *node, -- 1.9.1