mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rex-BC Chen <rex-bc.chen@mediatek.com>
To: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Cc: <mturquette@baylibre.com>, <sboyd@kernel.org>,
	<matthias.bgg@gmail.com>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <p.zabel@pengutronix.de>,
	<angelogioacchino.delregno@collabora.com>,
	<chun-jie.chen@mediatek.com>, <wenst@chromium.org>,
	<runyang.chen@mediatek.com>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v7 05/19] clk: mediatek: reset: Merge and revise reset register function
Date: Mon, 23 May 2022 13:09:53 +0800	[thread overview]
Message-ID: <cdfe094579737473b8d97cd584c1b157aaa54fc7.camel@mediatek.com> (raw)
In-Reply-To: <20220520151212.rrrtekst7uhnojds@notapiano>

On Fri, 2022-05-20 at 11:12 -0400, Nícolas F. R. A. Prado wrote:
> Hi Rex,
> 
> On Thu, May 19, 2022 at 08:55:13PM +0800, Rex-BC Chen wrote:
> > There are two versions for clock reset register control for
> > MediaTek
> > SoCs. The old hardware is one bit per reset control, and does not
> > have separate registers for bit set, clear and read-back
> > operations.
> > This matches the scheme supported by the simple reset driver.
> > 
> > However, because we need to use different data structure from
> > reset_simple_data, we can not use the operation of simple reset
> > driver.
> > For this reason, we keep the original functions and name this
> > version
> > as "MTK_RST_SIMPLE".
> > 
> > In this patch:
> > - Add a version enumeration to separate different reset hardware.
> > - Merge the reset register function of simple and set_clr into one
> >   function "mtk_register_reset_controller".
> > - Rename input variable "num_regs" to "rst_bank_nr" to avoid
> >   confusion. This variable is used to define the quantity of reset
> > bank.
> > - Document mtk_reset_version and mtk_register_reset_controller.
> > 
> > Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
> > Reviewed-by: AngeloGioacchino Del Regno <
> > angelogioacchino.delregno@collabora.com>
> > ---
> 
> <snip>
> 
> > index 764a8affe206..2a39eec9cff7 100644
> > --- a/drivers/clk/mediatek/reset.h
> > +++ b/drivers/clk/mediatek/reset.h
> > @@ -9,16 +9,32 @@
> >  #include <linux/reset-controller.h>
> >  #include <linux/types.h>
> >  
> > +/**
> > + * enum mtk_reset_version - Version of MediaTek clock reset
> > controller.
> > + * @MTK_RST_SIMPLE: Use the same registers for bit set and clear.
> > + * @MTK_RST_SET_CLR: Use separate registers for bit set and clear.
> > + * @MTK_RST_MAX: Total quantity of version for MediaTek clock
> > reset controller.
> > + */
> > +enum mtk_reset_version {
> > +	MTK_RST_SIMPLE = 0,
> > +	MTK_RST_SET_CLR,
> > +	MTK_RST_MAX,
> > +};
> > +
> >  struct mtk_reset {
> >  	struct regmap *regmap;
> >  	int regofs;
> >  	struct reset_controller_dev rcdev;
> >  };
> >  
> > +/**
> > + * mtk_register_reset_controller - Register MediaTek clock reset
> > controller
> > + * @np: Pointer to device node.
> > + * @rst_bank_nr: Quantity of reset bank.
> > + * @reg_ofs: Base offset of the reset register.
> > + * @version: Version of MediaTek clock reset controller.
> > + */
> >  void mtk_register_reset_controller(struct device_node *np,
> > -				   unsigned int num_regs, int regofs);
> > -
> > -void mtk_register_reset_controller_set_clr(struct device_node *np,
> > -					   unsigned int num_regs, int
> > regofs);
> > +				   u32 rst_bank_nr, u16 reg_ofs, u8
> > version);
> 
> Why not use 'enum mtk_reset_version' instead of a generic u8? Same
> thing when
> you move it to a struct in patch 6.
> 
> Thanks,
> Nícolas

HEllo Nícolas,

Thanks for the review.
I will modify for both patch 5 and 6 for this in next version.

BRs,
Rex


  reply	other threads:[~2022-05-23  5:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 12:55 [PATCH v7 00/19] Cleanup MediaTek clk reset drivers and support SoCs Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 01/19] clk: mediatek: reset: Add reset.h Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 02/19] clk: mediatek: reset: Fix written reset bit offset Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 03/19] clk: mediatek: reset: Refine and reorder functions in reset.c Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 04/19] clk: mediatek: reset: Extract common drivers to update function Rex-BC Chen
2022-05-20 14:55   ` Nícolas F. R. A. Prado
2022-05-23  5:08     ` Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 05/19] clk: mediatek: reset: Merge and revise reset register function Rex-BC Chen
2022-05-20 15:12   ` Nícolas F. R. A. Prado
2022-05-23  5:09     ` Rex-BC Chen [this message]
2022-05-19 12:55 ` [PATCH v7 06/19] clk: mediatek: reset: Revise structure to control reset register Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 07/19] clk: mediatek: reset: Support nonsequence base offsets of reset registers Rex-BC Chen
2022-05-20 15:18   ` Nícolas F. R. A. Prado
2022-05-23  5:10     ` Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 08/19] clk: mediatek: reset: Support inuput argument index mode Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 09/19] clk: mediatek: reset: Change return type for clock reset register function Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 10/19] clk: mediatek: reset: Add new register reset function with device Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 11/19] clk: mediatek: reset: Add reset support for simple probe Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 12/19] dt-bindings: arm: mediatek: Add #reset-cells property for MT8192/MT8195 Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 13/19] dt-bindings: reset: mediatek: Add infra_ao reset index " Rex-BC Chen
2022-05-20  2:58   ` Rex-BC Chen
2022-05-20  3:10     ` Chen-Yu Tsai
     [not found]       ` <20220521042323.BA60AC385A5@smtp.kernel.org>
2022-05-23  5:14         ` Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 14/19] clk: mediatek: reset: Add infra_ao reset support " Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 15/19] arm64: dts: mediatek: Add infra #reset-cells property for MT8192 Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 16/19] arm64: dts: mediatek: Add infra #reset-cells property for MT8195 Rex-BC Chen
2022-05-20 15:30   ` Nícolas F. R. A. Prado
2022-05-23  5:11     ` Rex-BC Chen
2022-05-19 12:55 ` [PATCH v7 17/19] dt-bindings: reset: mediatek: Add infra_ao reset index for MT8186 Rex-BC Chen
2022-05-20 22:32   ` Rob Herring
2022-05-19 12:55 ` [PATCH v7 18/19] dt-bindings: arm: mediatek: Add #reset-cells property " Rex-BC Chen
2022-05-20 22:33   ` Rob Herring
2022-05-19 12:55 ` [PATCH v7 19/19] clk: mediatek: reset: Add infra_ao reset support " Rex-BC Chen
2022-05-20 15:40 ` [PATCH v7 00/19] Cleanup MediaTek clk reset drivers and support SoCs Nícolas F. R. A. Prado
2022-05-23  5:12   ` Rex-BC Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cdfe094579737473b8d97cd584c1b157aaa54fc7.camel@mediatek.com \
    --to=rex-bc.chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chun-jie.chen@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=nfraprado@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=runyang.chen@mediatek.com \
    --cc=sboyd@kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome