Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp514394ybh; Wed, 22 Jul 2020 06:29:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFWqcD73OvlR5BTIN6A4q6GtvVtoYK5B4R+Ci3YYiVcTAxo/CFrurIRWoorIFzc+Iib16f X-Received: by 2002:aa7:d457:: with SMTP id q23mr29482933edr.376.1595424594682; Wed, 22 Jul 2020 06:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595424594; cv=none; d=google.com; s=arc-20160816; b=WZ3vtjK8xJfGuBs8EB9ursdRRGELAOPB8pLSEu1clXhg3keqZI5J5ZlojHXt6wuZMm ETsou4ibtBgSB0sfUi/wO2KwnIedAE324y9SI0rFqvIlv7HTTOBxcT1EhMLFw5GF2tGq 0eY5FJfLekeGbsI6AszbTAcVyhM8Kp03uWfk3m+nuI/vold+Ltui6hNEq9SsyKAiCP6l alzm/LVyXVq/I2250GEJEsjyd5FI7y9/X0wYb4e4JWfNyDV8oxBqlOehWGP/qhBJrdZ6 z4BnA7eyoCJG+A6LFO/qvqN2P+htwuGDAwoKquDTsZ2SBTriB7/9oVlecUOz7rEEJ+An C7SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Bn3W/yOEHeOzNnlVFsaTIpra4z7wO3SBES1qBhvsulY=; b=Fr1YNIpj50LbCeJMMaWFYz2/96qVN0RDD1iXzHFn3yUR5DrJ7fT/8rg2nYv7Bo2EoT u89YnLNGavy4+VeZ6NgfZUDpMC1b4WXEiStA2v35UL3FJYOeRpBPsvtBKK0QIsLAmiGV eoye1kISqpk4dfn37/ELI01qXVYOTUjsmC8CFLjElgntMZOKL4RbVbEWKDNHSmDGCurx yoC7VpwMAAYiJCjU7xLgmjif8bDT0Mw1t/bPiBJAFpeC5FWzN2IZCE+iW2L1iB1tQToe /IRnC4W8L7Uc8ncyXzVzqByzNZbIZPjFLy4B8kAPf85sWd96V3ePVt7jz/HL0oUIHuVK Ivfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si13316edr.36.2020.07.22.06.29.31; Wed, 22 Jul 2020 06:29:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732250AbgGVN1O (ORCPT + 99 others); Wed, 22 Jul 2020 09:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727825AbgGVN1O (ORCPT ); Wed, 22 Jul 2020 09:27:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195D2C0619DC for ; Wed, 22 Jul 2020 06:27:14 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyEm5-0002P5-1w; Wed, 22 Jul 2020 15:27:09 +0200 Received: from mtr by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jyEm4-0005Hr-Fu; Wed, 22 Jul 2020 15:27:08 +0200 Date: Wed, 22 Jul 2020 15:27:08 +0200 From: Michael Tretter To: Amit Sunil Dhamne Cc: mturquette@baylibre.com, sboyd@codeaurora.org, sboyd@kernel.org, michal.simek@xilinx.com, mark.rutland@arm.com, linux-clk@vger.kernel.org, rajanv@xilinx.com, jollys@xilinx.com, tejasp@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rajan Vaja , Tejas Patel Subject: Re: [PATCH v2 2/3] clk: zynqmp: Use firmware specific divider clock flags Message-ID: <20200722132708.GD21264@pengutronix.de> References: <1595400932-303612-1-git-send-email-amit.sunil.dhamne@xilinx.com> <1595400932-303612-3-git-send-email-amit.sunil.dhamne@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1595400932-303612-3-git-send-email-amit.sunil.dhamne@xilinx.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:24:05 up 153 days, 20:54, 130 users, load average: 0.16, 0.13, 0.15 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mtr@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Jul 2020 23:55:31 -0700, Amit Sunil Dhamne wrote: > From: Rajan Vaja > > Use ZynqMP specific divider clock flags instead of using CCF flags. > > Signed-off-by: Rajan Vaja > Signed-off-by: Tejas Patel > Signed-off-by: Amit Sunil Dhamne > --- > drivers/clk/zynqmp/clk-zynqmp.h | 9 +++++++++ > drivers/clk/zynqmp/divider.c | 16 +++++++++++++++- > 2 files changed, 24 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqmp.h > index 3cb6149..ec33525 100644 > --- a/drivers/clk/zynqmp/clk-zynqmp.h > +++ b/drivers/clk/zynqmp/clk-zynqmp.h > @@ -32,6 +32,15 @@ > /* do not gate, ever */ > #define ZYNQMP_CLK_IS_CRITICAL BIT(11) > > +/* Type Flags for divider clock */ > +#define ZYNQMP_CLK_DIVIDER_ONE_BASED BIT(0) > +#define ZYNQMP_CLK_DIVIDER_POWER_OF_TWO BIT(1) > +#define ZYNQMP_CLK_DIVIDER_ALLOW_ZERO BIT(2) > +#define ZYNQMP_CLK_DIVIDER_HIWORD_MASK BIT(3) > +#define ZYNQMP_CLK_DIVIDER_ROUND_CLOSEST BIT(4) > +#define ZYNQMP_CLK_DIVIDER_READ_ONLY BIT(5) > +#define ZYNQMP_CLK_DIVIDER_MAX_AT_ZERO BIT(6) > + > enum topology_type { > TYPE_INVALID, > TYPE_MUX, > diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c > index 3ab57d9..86cb785 100644 > --- a/drivers/clk/zynqmp/divider.c > +++ b/drivers/clk/zynqmp/divider.c > @@ -320,7 +320,21 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name, > /* struct clk_divider assignments */ > div->is_frac = !!((nodes->flag & CLK_FRAC) | > (nodes->custom_type_flag & CUSTOM_FLAG_CLK_FRAC)); > - div->flags = nodes->type_flag; > + div->flags = 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_ONE_BASED) ? > + CLK_DIVIDER_ONE_BASED : 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_POWER_OF_TWO) ? > + CLK_DIVIDER_POWER_OF_TWO : 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_ALLOW_ZERO) ? > + CLK_DIVIDER_ALLOW_ZERO : 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_POWER_OF_TWO) ? > + CLK_DIVIDER_HIWORD_MASK : 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_ROUND_CLOSEST) ? > + CLK_DIVIDER_ROUND_CLOSEST : 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_READ_ONLY) ? > + CLK_DIVIDER_READ_ONLY : 0; > + div->flags |= (nodes->type_flag & ZYNQMP_CLK_DIVIDER_MAX_AT_ZERO) ? > + CLK_DIVIDER_MAX_AT_ZERO : 0; Add a helper function for converting the flags. Michael > div->hw.init = &init; > div->clk_id = clk_id; > div->div_type = nodes->type; > -- > 2.7.4 > > This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. >