[PATCH] media: imx335: Use correct register width for HNUM

Kieran Bingham posted 1 patch 9 months, 3 weeks ago
drivers/media/i2c/imx335.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] media: imx335: Use correct register width for HNUM
Posted by Kieran Bingham 9 months, 3 weeks ago
From: Umang Jain <umang.jain@ideasonboard.com>

CCI_REG_HNUM should be using CCI_REG16_LE() instead of CCI_REG8()
as HNUM spans from 0x302e[0:7] to 0x302f[0:3].

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 drivers/media/i2c/imx335.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index db424b178e98..0418875e996c 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -31,7 +31,7 @@
 #define IMX335_REG_CPWAIT_TIME		CCI_REG8(0x300d)
 #define IMX335_REG_WINMODE		CCI_REG8(0x3018)
 #define IMX335_REG_HTRIMMING_START	CCI_REG16_LE(0x302c)
-#define IMX335_REG_HNUM			CCI_REG8(0x302e)
+#define IMX335_REG_HNUM			CCI_REG16_LE(0x302e)
 
 /* Lines per frame */
 #define IMX335_REG_VMAX			CCI_REG24_LE(0x3030)
-- 
2.48.1
Re: [PATCH] media: imx335: Use correct register width for HNUM
Posted by Sakari Ailus 9 months, 2 weeks ago
Hi Kieran,

On Tue, Apr 22, 2025 at 01:20:52PM +0100, Kieran Bingham wrote:
> From: Umang Jain <umang.jain@ideasonboard.com>
> 
> CCI_REG_HNUM should be using CCI_REG16_LE() instead of CCI_REG8()
> as HNUM spans from 0x302e[0:7] to 0x302f[0:3].
> 
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Does this need Fixes:/Cc: stable tags?

> ---
>  drivers/media/i2c/imx335.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> index db424b178e98..0418875e996c 100644
> --- a/drivers/media/i2c/imx335.c
> +++ b/drivers/media/i2c/imx335.c
> @@ -31,7 +31,7 @@
>  #define IMX335_REG_CPWAIT_TIME		CCI_REG8(0x300d)
>  #define IMX335_REG_WINMODE		CCI_REG8(0x3018)
>  #define IMX335_REG_HTRIMMING_START	CCI_REG16_LE(0x302c)
> -#define IMX335_REG_HNUM			CCI_REG8(0x302e)
> +#define IMX335_REG_HNUM			CCI_REG16_LE(0x302e)
>  
>  /* Lines per frame */
>  #define IMX335_REG_VMAX			CCI_REG24_LE(0x3030)

-- 
Regards,

Sakari Ailus
Re: [PATCH] media: imx335: Use correct register width for HNUM
Posted by Kieran Bingham 9 months, 2 weeks ago
Quoting Sakari Ailus (2025-04-25 08:58:46)
> Hi Kieran,
> 
> On Tue, Apr 22, 2025 at 01:20:52PM +0100, Kieran Bingham wrote:
> > From: Umang Jain <umang.jain@ideasonboard.com>
> > 
> > CCI_REG_HNUM should be using CCI_REG16_LE() instead of CCI_REG8()
> > as HNUM spans from 0x302e[0:7] to 0x302f[0:3].
> > 
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Does this need Fixes:/Cc: stable tags?

Aha, yes. I think we could/should add:

Fixes: 8f0926dba799 ("media: imx335: Use V4L2 CCI for accessing sensor registers")

which is when the conversion happened.

Thanks.

> > ---
> >  drivers/media/i2c/imx335.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> > index db424b178e98..0418875e996c 100644
> > --- a/drivers/media/i2c/imx335.c
> > +++ b/drivers/media/i2c/imx335.c
> > @@ -31,7 +31,7 @@
> >  #define IMX335_REG_CPWAIT_TIME               CCI_REG8(0x300d)
> >  #define IMX335_REG_WINMODE           CCI_REG8(0x3018)
> >  #define IMX335_REG_HTRIMMING_START   CCI_REG16_LE(0x302c)
> > -#define IMX335_REG_HNUM                      CCI_REG8(0x302e)
> > +#define IMX335_REG_HNUM                      CCI_REG16_LE(0x302e)
> >  
> >  /* Lines per frame */
> >  #define IMX335_REG_VMAX                      CCI_REG24_LE(0x3030)
> 
> -- 
> Regards,
> 
> Sakari Ailus