Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 6/7] media: rcar-isp: Rename base register variable
Date: Tue, 22 Apr 2025 01:47:58 +0300	[thread overview]
Message-ID: <20250421224758.GC17813@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20250421224733.GB17813@pendragon.ideasonboard.com>

On Tue, Apr 22, 2025 at 01:47:35AM +0300, Laurent Pinchart wrote:
> Hi Niklas,
> 
> Thank you for the patch.
> 
> On Mon, Apr 21, 2025 at 01:12:39PM +0200, Niklas Söderlund wrote:
> > Prepare for extending the driver to in addition to support the channel
> 
> s/support/supporting/
> 
> > selector (CS) also support the core ISP. The two different functions
> > have different base addresses so the driver needs to distinguish between
> > them.
> > 
> > Prepare for this by marking existing base address variable and
> > read/write functions to make it clear it operates on the CS portion of
> 
> s/it operates/they operate/
> 
> > the driver. There is no functional change.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > ---
> >  .../media/platform/renesas/rcar-isp/csisp.c   | 46 +++++++++----------
> >  1 file changed, 23 insertions(+), 23 deletions(-)
> > 
> > diff --git a/drivers/media/platform/renesas/rcar-isp/csisp.c b/drivers/media/platform/renesas/rcar-isp/csisp.c
> > index 4bc89d4757fa..f36d43c2e0a2 100644
> > --- a/drivers/media/platform/renesas/rcar-isp/csisp.c
> > +++ b/drivers/media/platform/renesas/rcar-isp/csisp.c
> > @@ -159,7 +159,7 @@ enum rcar_isp_pads {
> >  
> >  struct rcar_isp {
> >  	struct device *dev;
> > -	void __iomem *base;
> > +	void __iomem *csbase;
> >  	struct reset_control *rstc;
> >  
> >  	enum rcar_isp_input csi_input;
> > @@ -184,14 +184,14 @@ static inline struct rcar_isp *notifier_to_isp(struct v4l2_async_notifier *n)
> >  	return container_of(n, struct rcar_isp, notifier);
> >  }
> >  
> > -static void risp_write(struct rcar_isp *isp, u32 offset, u32 value)
> > +static void risp_write_cs(struct rcar_isp *isp, u32 offset, u32 value)
> 
> Not sure what the other write function will be called, but I would have
> called this risp_cs_write(). Up to you.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I meant

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> >  {
> > -	iowrite32(value, isp->base + offset);
> > +	iowrite32(value, isp->csbase + offset);
> >  }
> >  
> > -static u32 risp_read(struct rcar_isp *isp, u32 offset)
> > +static u32 risp_read_cs(struct rcar_isp *isp, u32 offset)
> >  {
> > -	return ioread32(isp->base + offset);
> > +	return ioread32(isp->csbase + offset);
> >  }
> >  
> >  static int risp_power_on(struct rcar_isp *isp)
> > @@ -245,31 +245,31 @@ static int risp_start(struct rcar_isp *isp, struct v4l2_subdev_state *state)
> >  	if (isp->csi_input == RISP_CSI_INPUT1)
> >  		sel_csi = ISPINPUTSEL0_SEL_CSI0;
> >  
> > -	risp_write(isp, ISPINPUTSEL0_REG,
> > -		   risp_read(isp, ISPINPUTSEL0_REG) | sel_csi);
> > +	risp_write_cs(isp, ISPINPUTSEL0_REG,
> > +		      risp_read_cs(isp, ISPINPUTSEL0_REG) | sel_csi);
> >  
> >  	/* Configure Channel Selector. */
> >  	for (vc = 0; vc < 4; vc++) {
> >  		u8 ch = vc + 4;
> >  		u8 dt = format->datatype;
> >  
> > -		risp_write(isp, ISPCS_FILTER_ID_CH_REG(ch), BIT(vc));
> > -		risp_write(isp, ISPCS_DT_CODE03_CH_REG(ch),
> > -			   ISPCS_DT_CODE03_EN3 | ISPCS_DT_CODE03_DT3(dt) |
> > -			   ISPCS_DT_CODE03_EN2 | ISPCS_DT_CODE03_DT2(dt) |
> > -			   ISPCS_DT_CODE03_EN1 | ISPCS_DT_CODE03_DT1(dt) |
> > -			   ISPCS_DT_CODE03_EN0 | ISPCS_DT_CODE03_DT0(dt));
> > +		risp_write_cs(isp, ISPCS_FILTER_ID_CH_REG(ch), BIT(vc));
> > +		risp_write_cs(isp, ISPCS_DT_CODE03_CH_REG(ch),
> > +			      ISPCS_DT_CODE03_EN3 | ISPCS_DT_CODE03_DT3(dt) |
> > +			      ISPCS_DT_CODE03_EN2 | ISPCS_DT_CODE03_DT2(dt) |
> > +			      ISPCS_DT_CODE03_EN1 | ISPCS_DT_CODE03_DT1(dt) |
> > +			      ISPCS_DT_CODE03_EN0 | ISPCS_DT_CODE03_DT0(dt));
> >  	}
> >  
> >  	/* Setup processing method. */
> > -	risp_write(isp, ISPPROCMODE_DT_REG(format->datatype),
> > -		   ISPPROCMODE_DT_PROC_MODE_VC3(format->procmode) |
> > -		   ISPPROCMODE_DT_PROC_MODE_VC2(format->procmode) |
> > -		   ISPPROCMODE_DT_PROC_MODE_VC1(format->procmode) |
> > -		   ISPPROCMODE_DT_PROC_MODE_VC0(format->procmode));
> > +	risp_write_cs(isp, ISPPROCMODE_DT_REG(format->datatype),
> > +		      ISPPROCMODE_DT_PROC_MODE_VC3(format->procmode) |
> > +		      ISPPROCMODE_DT_PROC_MODE_VC2(format->procmode) |
> > +		      ISPPROCMODE_DT_PROC_MODE_VC1(format->procmode) |
> > +		      ISPPROCMODE_DT_PROC_MODE_VC0(format->procmode));
> >  
> >  	/* Start ISP. */
> > -	risp_write(isp, ISPSTART_REG, ISPSTART_START);
> > +	risp_write_cs(isp, ISPSTART_REG, ISPSTART_START);
> >  
> >  	ret = v4l2_subdev_enable_streams(isp->remote, isp->remote_pad,
> >  					 BIT_ULL(0));
> > @@ -284,7 +284,7 @@ static void risp_stop(struct rcar_isp *isp)
> >  	v4l2_subdev_disable_streams(isp->remote, isp->remote_pad, BIT_ULL(0));
> >  
> >  	/* Stop ISP. */
> > -	risp_write(isp, ISPSTART_REG, ISPSTART_STOP);
> > +	risp_write_cs(isp, ISPSTART_REG, ISPSTART_STOP);
> >  
> >  	risp_power_off(isp);
> >  }
> > @@ -465,9 +465,9 @@ static const struct media_entity_operations risp_entity_ops = {
> >  static int risp_probe_resources(struct rcar_isp *isp,
> >  				struct platform_device *pdev)
> >  {
> > -	isp->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
> > -	if (IS_ERR(isp->base))
> > -		return PTR_ERR(isp->base);
> > +	isp->csbase = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
> > +	if (IS_ERR(isp->csbase))
> > +		return PTR_ERR(isp->csbase);
> >  
> >  	isp->rstc = devm_reset_control_get(&pdev->dev, NULL);
> >  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2025-04-21 22:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-21 11:12 [PATCH v2 0/7] rcar-isp: Prepare for ISP core support Niklas Söderlund
2025-04-21 11:12 ` [PATCH v2 1/7] dt-bindings: media: renesas,isp: Add ISP core function block Niklas Söderlund
2025-04-21 22:36   ` Laurent Pinchart
2025-04-23 11:24   ` Geert Uytterhoeven
2025-04-23 12:24     ` Laurent Pinchart
2025-04-23 15:48   ` Rob Herring (Arm)
2025-04-21 11:12 ` [PATCH v2 2/7] arm64: dts: renesas: r8a779a0: " Niklas Söderlund
2025-04-21 11:12 ` [PATCH v2 3/7] arm64: dts: renesas: r8a779g0: " Niklas Söderlund
2025-04-21 11:12 ` [PATCH v2 4/7] arm64: dts: renesas: r8a779h0: " Niklas Söderlund
2025-04-21 11:12 ` [PATCH v2 5/7] media: rcar-isp: Move driver to own directory Niklas Söderlund
2025-04-21 22:42   ` Laurent Pinchart
2025-04-21 11:12 ` [PATCH v2 6/7] media: rcar-isp: Rename base register variable Niklas Söderlund
2025-04-21 22:47   ` Laurent Pinchart
2025-04-21 22:47     ` Laurent Pinchart [this message]
2025-04-21 11:12 ` [PATCH v2 7/7] media: rcar-isp: Parse named cs memory region Niklas Söderlund
2025-04-21 22:55   ` Laurent Pinchart

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=20250421224758.GC17813@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=hverkuil@xs4all.nl \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.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