public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, hdegoede@redhat.com
Subject: Re: [PATCH 5/6] media: ccs: Better separate CCS static data access
Date: Fri, 10 Nov 2023 16:46:22 +0200	[thread overview]
Message-ID: <20231110144622.GD21167@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20231110094705.1367083-6-sakari.ailus@linux.intel.com>

Hi Sakari,

Thank you for the patch.

On Fri, Nov 10, 2023 at 11:47:04AM +0200, Sakari Ailus wrote:
> Separate CCS static data read-only register access in ccs-reg-access.c.

Please explain why. I don't have enough information to review this
patch.

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/media/i2c/ccs/ccs-reg-access.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/media/i2c/ccs/ccs-reg-access.c b/drivers/media/i2c/ccs/ccs-reg-access.c
> index 25993445f4fe..652d705a2ef5 100644
> --- a/drivers/media/i2c/ccs/ccs-reg-access.c
> +++ b/drivers/media/i2c/ccs/ccs-reg-access.c
> @@ -197,8 +197,8 @@ static int __ccs_read_addr(struct ccs_sensor *sensor, u32 reg, u32 *val,
>  	return 0;
>  }
>  
> -static int __ccs_read_data(struct ccs_reg *regs, size_t num_regs,
> -			   u32 reg, u32 *val)
> +static int __ccs_static_read_only(struct ccs_reg *regs, size_t num_regs,
> +				  u32 reg, u32 *val)
>  {
>  	unsigned int width = ccs_reg_width(reg);
>  	size_t i;
> @@ -235,16 +235,16 @@ static int __ccs_read_data(struct ccs_reg *regs, size_t num_regs,
>  	return -ENOENT;
>  }
>  
> -static int ccs_read_data(struct ccs_sensor *sensor, u32 reg, u32 *val)
> +static int ccs_static_read_only(struct ccs_sensor *sensor, u32 reg, u32 *val)
>  {
> -	if (!__ccs_read_data(sensor->sdata.sensor_read_only_regs,
> -			     sensor->sdata.num_sensor_read_only_regs,
> -			     reg, val))
> +	if (!__ccs_static_read_only(sensor->sdata.sensor_read_only_regs,
> +				    sensor->sdata.num_sensor_read_only_regs,
> +				    reg, val))
>  		return 0;
>  
> -	return __ccs_read_data(sensor->mdata.module_read_only_regs,
> -			       sensor->mdata.num_module_read_only_regs,
> -			       reg, val);
> +	return __ccs_static_read_only(sensor->mdata.module_read_only_regs,
> +				      sensor->mdata.num_module_read_only_regs,
> +				      reg, val);
>  }
>  
>  static int ccs_read_addr_raw(struct ccs_sensor *sensor, u32 reg, u32 *val,
> @@ -253,7 +253,7 @@ static int ccs_read_addr_raw(struct ccs_sensor *sensor, u32 reg, u32 *val,
>  	int rval;
>  
>  	if (data) {
> -		rval = ccs_read_data(sensor, reg, val);
> +		rval = ccs_static_read_only(sensor, reg, val);
>  		if (!rval)
>  			return 0;
>  	}

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2023-11-10 17:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10  9:46 [PATCH 0/6] Use V4L2 CCI in CCS driver Sakari Ailus
2023-11-10  9:47 ` [PATCH 1/6] media: v4l: cci: Include linux/bits.h Sakari Ailus
2023-11-10 11:11   ` Hans de Goede
2023-11-10 14:44   ` Laurent Pinchart
2023-11-10  9:47 ` [PATCH 2/6] media: v4l: cci: Add driver-private bit definitions Sakari Ailus
2023-11-10 11:11   ` Hans de Goede
2023-11-10 14:44   ` Laurent Pinchart
2023-11-10 21:21     ` Sakari Ailus
2023-11-10  9:47 ` [PATCH 3/6] media: v4l: cci: Add macros to obtain register width Sakari Ailus
2023-11-10 11:14   ` Hans de Goede
2023-11-10 11:17     ` Sakari Ailus
2023-11-10 14:44       ` Laurent Pinchart
2023-11-10 14:49         ` Laurent Pinchart
2023-11-10 14:52           ` Hans de Goede
2023-11-10 21:21             ` Sakari Ailus
2023-11-10  9:47 ` [PATCH 4/6] media: ccs: Generate V4L2 CCI compliant register definitions Sakari Ailus
2023-11-10  9:47 ` [PATCH 5/6] media: ccs: Better separate CCS static data access Sakari Ailus
2023-11-10 14:46   ` Laurent Pinchart [this message]
2023-11-10 21:24     ` Sakari Ailus
2023-11-10  9:47 ` [PATCH 6/6] media: ccs: Use V4L2 CCI for accessing sensor registers Sakari Ailus
2023-11-10 15:21   ` Laurent Pinchart
2023-11-10 21:38     ` Sakari Ailus
2023-11-10 22:53       ` Laurent Pinchart
2023-11-10 23:03         ` Sakari Ailus

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=20231110144622.GD21167@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-media@vger.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