mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jai Luthra <jai.luthra@ideasonboard.com>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>,
	David Heidelberg via B4 Relay <devnull+david.ixit.cz@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	david@ixit.cz
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Heidelberg <david@ixit.cz>
Subject: Re: [PATCH RFC] media: imx355: reuse existing CCS defines
Date: Wed, 26 Aug 2026 11:50:08 +0530	[thread overview]
Message-ID: <178772520896.9142.15892216055046447878@freya> (raw)
In-Reply-To: <20260819-imx355-ccsify-v1-1-0b6cef77e340@ixit.cz>

Hi David,

Quoting David Heidelberg via B4 Relay (2026-08-20 01:47:08)
> From: David Heidelberg <david@ixit.cz>
> 
> The driver may not be MIPU CCS compliant, but does use same address and
> often set same values as compliant drivers. Do not define for every Sony
> imx* driver registers we already know and are standard.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> I'm sending this as RFC, because we'll need to upstream at least 4 - 6
> drivers, which aren't compliant with MIPI CCS. Quirking these drivers in
> mipi-ccs would be pointless, thou we could at least simplify and unify
> what needs to be separate.
> 

Indeed, while working on IMX708 I realized it was in the same bucket, and
ended up implementing a similar approach (of reusing register defines and
helpers from CCS).

> Thanks for the feedback, just did few lines for the idea how the final
> changes will look like. Anything ambiguous will be left as is.
> ---
>  drivers/media/i2c/imx355.c | 46 +++++++++++++++-------------------------------
>  1 file changed, 15 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c
> index 8eb8588cb71bb..57f7c70d18453 100644
> --- a/drivers/media/i2c/imx355.c
> +++ b/drivers/media/i2c/imx355.c
> @@ -14,50 +14,34 @@
>  #include <linux/unaligned.h>
>  
>  #include <media/v4l2-cci.h>
>  #include <media/v4l2-ctrls.h>
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-event.h>
>  #include <media/v4l2-fwnode.h>
>  
> -#define IMX355_REG_MODE_SELECT         CCI_REG8(0x0100)
> -#define IMX355_MODE_STANDBY            0x00
> -#define IMX355_MODE_STREAMING          0x01
> +#include "ccs/ccs-regs.h"
>  
> -/* Chip ID */
> -#define IMX355_REG_CHIP_ID             CCI_REG16(0x0016)
>  #define IMX355_CHIP_ID                 0x0355
>  
> -#define IMX355_REG_LANE_SEL            CCI_REG8(0x0114)
> -
>  /* PLL registers that depend on the external clock frequency */
>  #define IMX355_REG_EXTCLK_FREQ         CCI_REG16(0x0136)
>  #define IMX355_REG_PLL_OP_PREDIV       CCI_REG8(0x030d)
> -#define IMX355_REG_PLL_OP_MUL          CCI_REG16(0x030e)
>  #define IMX355_REG_PLL_IVT_PCK_DIV     CCI_REG8(0x0301)
>  #define IMX355_REG_PLL_IVT_SYSCK_DIV   CCI_REG8(0x0303)

I think rest of the PLL registers could also be reused here?

While they are defined as CCI_REG16, I think writing just a byte to it
should work okay.

You could also reuse the CCS PLL calculation helpers instead of hardcoding
the values.

[snip]

Thanks,
    Jai

  reply	other threads:[~2026-08-26  6:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 20:17 David Heidelberg via B4 Relay
2026-08-26  6:20 ` Jai Luthra [this message]
2026-08-27  9:21   ` David Heidelberg

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=178772520896.9142.15892216055046447878@freya \
    --to=jai.luthra@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=david@ixit.cz \
    --cc=devnull+david.ixit.cz@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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

all inboxes | Powered by JetHome®