linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nina Wu <nina-cm.wu@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Neal Liu <neal.liu@mediatek.com>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<srv_heupstream@mediatek.com>, <Jackson-kt.Chang@mediatek.com>
Subject: Re: [PATCH v2 4/6] soc: mediatek: devapc: rename variable for new IC support
Date: Thu, 8 Apr 2021 13:58:21 +0800	[thread overview]
Message-ID: <1617861501.8874.4.camel@mtksdccf07> (raw)
In-Reply-To: <a76686d1-3544-fcb9-4c3e-1498ec29ff47@gmail.com>

Hi, Matthias

On Tue, 2021-04-06 at 15:43 +0200, Matthias Brugger wrote:
> Regarding the commit subject:
> "soc: mediatek: devapc: rename variable for new IC support"
> maybe something like:
> "soc: mediatek: devapc: rename register variable infra_base"
> 
> Other then that looks good to me.
> 

OK. I will fix it in the next version.

Thanks

> On 01/04/2021 08:38, Nina Wu wrote:
> > From: Nina Wu <Nina-CM.Wu@mediatek.com>
> > 
> > For new ICs, there are multiple devapc HWs for different subsys.
> > For example, there is devapc respectively for infra, peri, peri2, etc.
> > So we rename the variable 'infra_base' to 'base' for code readability.
> > 
> > Signed-off-by: Nina Wu <Nina-CM.Wu@mediatek.com>
> > ---
> >  drivers/soc/mediatek/mtk-devapc.c | 24 ++++++++++++------------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/soc/mediatek/mtk-devapc.c b/drivers/soc/mediatek/mtk-devapc.c
> > index 68c3e35..bcf6e3c 100644
> > --- a/drivers/soc/mediatek/mtk-devapc.c
> > +++ b/drivers/soc/mediatek/mtk-devapc.c
> > @@ -45,7 +45,7 @@ struct mtk_devapc_data {
> >  
> >  struct mtk_devapc_context {
> >  	struct device *dev;
> > -	void __iomem *infra_base;
> > +	void __iomem *base;
> >  	u32 vio_idx_num;
> >  	struct clk *infra_clk;
> >  	const struct mtk_devapc_data *data;
> > @@ -56,7 +56,7 @@ static void clear_vio_status(struct mtk_devapc_context *ctx)
> >  	void __iomem *reg;
> >  	int i;
> >  
> > -	reg = ctx->infra_base + ctx->data->vio_sta_offset;
> > +	reg = ctx->base + ctx->data->vio_sta_offset;
> >  
> >  	for (i = 0; i < VIO_MOD_TO_REG_IND(ctx->vio_idx_num - 1); i++)
> >  		writel(GENMASK(31, 0), reg + 4 * i);
> > @@ -71,7 +71,7 @@ static void mask_module_irq(struct mtk_devapc_context *ctx, bool mask)
> >  	u32 val;
> >  	int i;
> >  
> > -	reg = ctx->infra_base + ctx->data->vio_mask_offset;
> > +	reg = ctx->base + ctx->data->vio_mask_offset;
> >  
> >  	if (mask)
> >  		val = GENMASK(31, 0);
> > @@ -113,11 +113,11 @@ static int devapc_sync_vio_dbg(struct mtk_devapc_context *ctx)
> >  	int ret;
> >  	u32 val;
> >  
> > -	pd_vio_shift_sta_reg = ctx->infra_base +
> > +	pd_vio_shift_sta_reg = ctx->base +
> >  			       ctx->data->vio_shift_sta_offset;
> > -	pd_vio_shift_sel_reg = ctx->infra_base +
> > +	pd_vio_shift_sel_reg = ctx->base +
> >  			       ctx->data->vio_shift_sel_offset;
> > -	pd_vio_shift_con_reg = ctx->infra_base +
> > +	pd_vio_shift_con_reg = ctx->base +
> >  			       ctx->data->vio_shift_con_offset;
> >  
> >  	/* Find the minimum shift group which has violation */
> > @@ -159,8 +159,8 @@ static void devapc_extract_vio_dbg(struct mtk_devapc_context *ctx)
> >  	void __iomem *vio_dbg0_reg;
> >  	void __iomem *vio_dbg1_reg;
> >  
> > -	vio_dbg0_reg = ctx->infra_base + ctx->data->vio_dbg0_offset;
> > -	vio_dbg1_reg = ctx->infra_base + ctx->data->vio_dbg1_offset;
> > +	vio_dbg0_reg = ctx->base + ctx->data->vio_dbg0_offset;
> > +	vio_dbg1_reg = ctx->base + ctx->data->vio_dbg1_offset;
> >  
> >  	vio_dbgs.vio_dbg0 = readl(vio_dbg0_reg);
> >  	vio_dbgs.vio_dbg1 = readl(vio_dbg1_reg);
> > @@ -198,7 +198,7 @@ static irqreturn_t devapc_violation_irq(int irq_number, void *data)
> >   */
> >  static void start_devapc(struct mtk_devapc_context *ctx)
> >  {
> > -	writel(BIT(31), ctx->infra_base + ctx->data->apc_con_offset);
> > +	writel(BIT(31), ctx->base + ctx->data->apc_con_offset);
> >  
> >  	mask_module_irq(ctx, false);
> >  }
> > @@ -210,7 +210,7 @@ static void stop_devapc(struct mtk_devapc_context *ctx)
> >  {
> >  	mask_module_irq(ctx, true);
> >  
> > -	writel(BIT(2), ctx->infra_base + ctx->data->apc_con_offset);
> > +	writel(BIT(2), ctx->base + ctx->data->apc_con_offset);
> >  }
> >  
> >  static const struct mtk_devapc_data devapc_mt6779 = {
> > @@ -249,8 +249,8 @@ static int mtk_devapc_probe(struct platform_device *pdev)
> >  	ctx->data = of_device_get_match_data(&pdev->dev);
> >  	ctx->dev = &pdev->dev;
> >  
> > -	ctx->infra_base = of_iomap(node, 0);
> > -	if (!ctx->infra_base)
> > +	ctx->base = of_iomap(node, 0);
> > +	if (!ctx->base)
> >  		return -EINVAL;
> >  
> >  	if (of_property_read_u32(node, "vio_idx_num", &ctx->vio_idx_num))
> > 


  reply	other threads:[~2021-04-08  5:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  6:38 [PATCH v2 1/6] dt-bindings: devapc: Update bindings Nina Wu
2021-04-01  6:38 ` [PATCH v2 2/6] soc: mediatek: devapc: move 'vio_idx_num' info to DT Nina Wu
2021-04-06 13:41   ` Matthias Brugger
2021-04-08  5:57     ` Nina Wu
2021-04-01  6:38 ` [PATCH v2 3/6] soc: mediatek: devapc: add shared flag to IRQ Nina Wu
2021-04-01  6:38 ` [PATCH v2 4/6] soc: mediatek: devapc: rename variable for new IC support Nina Wu
2021-04-06 13:43   ` Matthias Brugger
2021-04-08  5:58     ` Nina Wu [this message]
2021-04-01  6:38 ` [PATCH v2 5/6] soc: mediatek: devapc: add debug register " Nina Wu
2021-04-06 13:53   ` Matthias Brugger
2021-04-08  6:09     ` Nina Wu
2021-04-01  6:38 ` [PATCH v2 6/6] soc: mediatek: devapc: support mt8192 Nina Wu
2021-04-06 13:55   ` Matthias Brugger
2021-04-08  6:14     ` Nina Wu
2021-04-08 20:43 ` [PATCH v2 1/6] dt-bindings: devapc: Update bindings Rob Herring
2021-04-09  3:30   ` Nina Wu

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=1617861501.8874.4.camel@mtksdccf07 \
    --to=nina-cm.wu@mediatek.com \
    --cc=Jackson-kt.Chang@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=neal.liu@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=srv_heupstream@mediatek.com \
    --cc=thunder.leizhen@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).