Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5652154imb; Thu, 7 Mar 2019 22:21:50 -0800 (PST) X-Google-Smtp-Source: APXvYqx1vSkGch9rx1vwfeRBgdHnCYIP2RethSF6zHpHyM1oPseK/xfufKxDYfeG/o1JIRUMDPoq X-Received: by 2002:a17:902:6a83:: with SMTP id n3mr17088663plk.313.1552026110105; Thu, 07 Mar 2019 22:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552026110; cv=none; d=google.com; s=arc-20160816; b=qySBv3bRG0WEiakCIxPXwU0iH46qBYBqJ7f5GJY/29PhnBiV2Y0i8I+q0aCRA63i2U iwi55HUqlf4wZtZ/K4tYaYaM0Oj0bo8Ex3xLP0mTMU+frh7o2kv9EhWOhfw4nEyUrCLd Vc7Qwz9D85XAggx5D3tmkdGxDnyK5vCrdxVY5czQyEU2x0ZPYatSpVZrJfFTcvMBx4Yx 4Kn37h7JtX2MMu5rDqYlPRDgTwhVyE16YrdgXC9Ki6kdSXVeV/OM3SRkSSjoNendIvft kXjfhJBx+HZ7xTN6aV41nttem6nPoBi5FDU+nzKHRe4UWGBCZzfGD/vfzz0xw2eZ2UAt rZjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wJt9KTqEs6PQ/4BCTlYdLFCrzchCw4x0e5cQ1YECBGE=; b=lRwx1tMcjb5XJo1tw6R+zjly/r+LbVTrc03bTMDK++terebAuwGY4W6t8bBrU/fSW+ y+PPivtWtdJetnKVy9s7jAROStuoohhocC89HqAsa2ULYefIEq2Dt+Lk4UxQrz8cfg5c s8Z7kdXVIzsTw0jqYgJH4JLepDVhhnhbavKgUhI+Htjz7gk+s9/P0yQl533CMCghKLCn ZuigpmPC6z06xBI400iSXDzF2DvtVnOUIirhHax2aINMb0g43rLzxA+K9oF0ZQoC9gXd IwrS2tlnpoY/LBI/o7D+hXOES4jx9cdglwzKvSTWial9adfu6bYprUYhQoPi/ZCeU7VE 2WmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BxbKtbnn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i65si6165293pfj.105.2019.03.07.22.21.34; Thu, 07 Mar 2019 22:21:50 -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; dkim=pass header.i=@chromium.org header.s=google header.b=BxbKtbnn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726392AbfCHGVK (ORCPT + 99 others); Fri, 8 Mar 2019 01:21:10 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:37716 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbfCHGVK (ORCPT ); Fri, 8 Mar 2019 01:21:10 -0500 Received: by mail-qk1-f195.google.com with SMTP id m9so10588770qkl.4 for ; Thu, 07 Mar 2019 22:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wJt9KTqEs6PQ/4BCTlYdLFCrzchCw4x0e5cQ1YECBGE=; b=BxbKtbnn2Okxku+HH5kPqtvTDZf4c85eiZfk/e1uwTKj1NUThDKfaoOQ8o78fT70ka HuyA2ix+2trqd59FzZ1OcrcEby3hlyU25Jo/BBKnFjlXJjiel/JhrpizMvKjJwgCrWLn aooKtAmWXKGf6kCfKqTuh33caKKtN3cQtcKF0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wJt9KTqEs6PQ/4BCTlYdLFCrzchCw4x0e5cQ1YECBGE=; b=KdwR/d6dMkXC7vG+Cs4E200TS8q9Tn+YkpD6hMJXx8IVEVSuyapnwDJzAFRotYa6Wo iikJDQr0CJw7QGpwJmSImoZntilH5yhwG76wqkOsA4BXdVPwh7K2oTYQSvmoOkfcUFSk lvZNqV65dU/z59aZ0W0c6IryLf4n1nnMpRndj/faZZE4hGcTT9l5yySg+F7mn+ocsqyy WxZ4f/A8cRMkJ99cotOTBT0Uz0/fPXeBjB1wo2vaGVo3ANHMpCuOta2xKZsJB1eMhjso hcEXNbIKE2HVp7+nydFlb8ZzUdTe1d2/2etYU/9nu+c2rRYLNmXM1vtrx9bMPtRyOm/c kf8w== X-Gm-Message-State: APjAAAUfnovXNQR/DPW+IVLLSIHdGuTiZ1n2yWFugW5646QzEDnQNZW+ wq0lZku94LDaLDKOZ42U5frjTq/os8IAFPmehYg/yg== X-Received: by 2002:ae9:ef05:: with SMTP id d5mr13058150qkg.323.1552026068798; Thu, 07 Mar 2019 22:21:08 -0800 (PST) MIME-Version: 1.0 References: <20190305050546.23431-1-weiyi.lu@mediatek.com> <20190305050546.23431-8-weiyi.lu@mediatek.com> In-Reply-To: <20190305050546.23431-8-weiyi.lu@mediatek.com> From: Nicolas Boichat Date: Fri, 8 Mar 2019 14:20:57 +0800 Message-ID: Subject: Re: [PATCH v5 6/9] clk: mediatek: Add flags support for mtk_gate data To: Weiyi Lu Cc: Matthias Brugger , Stephen Boyd , Rob Herring , James Liao , Fan Chen , linux-arm Mailing List , lkml , "moderated list:ARM/Mediatek SoC support" , linux-clk@vger.kernel.org, srv_heupstream , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 1:06 PM Weiyi Lu wrote: > > 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 Reviewed-and-tested-by: Nicolas Boichat > --- > 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 >