From: David Heidelberg <david@ixit.cz>
To: Jai Luthra <jai.luthra@ideasonboard.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] media: imx355: reuse existing CCS defines
Date: Thu, 27 Aug 2026 11:21:00 +0200 [thread overview]
Message-ID: <e03b34d6-e61f-48bd-9e13-970d7034c379@ixit.cz> (raw)
In-Reply-To: <178772520896.9142.15892216055046447878@freya>
On 26/08/2026 08:20, Jai Luthra wrote:
> 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.
It could work, but I wouldn't risk some undefined behavior. The datasheet define
it as is, so I would go against it (at least without seeing bigger benefit).
>
> You could also reuse the CCS PLL calculation helpers instead of hardcoding
> the values.
I tried, but I would skip it for now, so we keep the verified configurations
against datasheet. Maybe in the future if there is need for it and we can
validate against more configurations.
I'm sending v2 cleaning the driver up with the basic scope :)
Thank you
David
>
> [snip]
>
> Thanks,
> Jai
prev parent reply other threads:[~2026-08-27 9:21 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
2026-08-27 9:21 ` David Heidelberg [this message]
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=e03b34d6-e61f-48bd-9e13-970d7034c379@ixit.cz \
--to=david@ixit.cz \
--cc=dave.stevenson@raspberrypi.com \
--cc=jai.luthra@ideasonboard.com \
--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®