Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hikmah Gumelar" <hikmahgumelar@gmail.com>
Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v4 3/7] media: i2c: add s5k5e8 image sensor driver
Date: Wed, 25 Nov 2026 12:44:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-233389@kernel.org> (raw)
In-Reply-To: <20261125123146.379057-4-hikmahgumelar@gmail.com>

Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] media: i2c: Kconfig: unintended removal of select V4L2_CCI_I2C
  from 53 drivers
- [High] media: i2c: premature VIDEO_OV12A10 Kconfig and Makefile
  entries without ov12a10.c
- [High] media: i2c: s5k5e8: missing VIDEO_S5K5E8 Kconfig entry and
  MAINTAINERS entry
- [Low] media: i2c: s5k5e8: open-coded CCI I2C helpers instead of
  v4l2-cci framework
- [Low] media: i2c: s5k5e8: legacy s_stream and manual mutex/streaming
  state
- [Low] media: i2c: s5k5e8: malformed indentation in default_mode and
  s5k5e8_set_ctrl()
--

commit f9317782624ff79a943a965105715454acccfd55
Author: Hikmah Gumelar <hikmahgumelar@gmail.com>

media: i2c: add s5k5e8 image sensor driver

This commit adds a V4L2 subdevice driver for the Samsung S5K5E8 5-megapixel
MIPI CSI-2 CMOS image sensor.

> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index 162b8ea026018..4ac9545f1581f 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -43,7 +43,6 @@ config VIDEO_CCS_PLL
>  
>  config VIDEO_ALVIUM_CSI2
>  	tristate "Allied Vision ALVIUM MIPI CSI-2 camera support"
> -	select V4L2_CCI_I2C
>  	help
>  	  This is a Video4Linux2 sensor-level driver for the Allied Vision
>  	  ALVIUM camera connected via MIPI CSI-2 interface.
> @@ -62,7 +61,6 @@ config VIDEO_AR0521
>  
>  config VIDEO_GC0308
>  	tristate "GalaxyCore GC0308 sensor support"
> -	select V4L2_CCI_I2C
>  	help
>  	  This is a Video4Linux2 sensor driver for the GalaxyCore
>  	  GC0308 camera.

[Severity: High]
Were these select V4L2_CCI_I2C lines removed by mistake from 53 existing
drivers in drivers/media/i2c/Kconfig?

V4L2_CCI_I2C is a promptless helper symbol, and devm_cci_regmap_init_i2c()
is only declared and compiled when CONFIG_V4L2_CCI_I2C is enabled. Without
these selects, any build that enables one of the 53 CCI-based drivers while
CONFIG_VIDEO_CCS is disabled fails with an implicit declaration of
devm_cci_regmap_init_i2c() and undefined references to the cci_*() helpers.

[ ... ]

> @@ -538,6 +506,15 @@ config VIDEO_OV08X40
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called ov08x40.
>  
> +config VIDEO_OV12A10
> +	tristate "OmniVision OV12A10 sensor support"
> +	help
> +	  This is a Video4Linux2 sensor-level driver for the OmniVision
> +	  OV12A10 12-megapixel MIPI CSI-2 CMOS image sensor.
> +
> +	  To compile this driver as a module, choose M here: the
> +	  module will be called ov12a10.
> +
>  config VIDEO_OV13858
>  	tristate "OmniVision OV13858 sensor support"
>  	help

[ ... ]

> diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
> index a750942e9c620..1ae704f57468c 100644
> --- a/drivers/media/i2c/Makefile
> +++ b/drivers/media/i2c/Makefile
> @@ -99,6 +99,7 @@ obj-$(CONFIG_VIDEO_OV02E10) += ov02e10.o
>  obj-$(CONFIG_VIDEO_OV05C10) += ov05c10.o
>  obj-$(CONFIG_VIDEO_OV08D10) += ov08d10.o
>  obj-$(CONFIG_VIDEO_OV08X40) += ov08x40.o
> +obj-$(CONFIG_VIDEO_OV12A10) += ov12a10.o
>  obj-$(CONFIG_VIDEO_OV13858) += ov13858.o
>  obj-$(CONFIG_VIDEO_OV13B10) += ov13b10.o
>  obj-$(CONFIG_VIDEO_OV2640) += ov2640.o

[Severity: High]
Does adding VIDEO_OV12A10 to Kconfig and Makefile here break the build when
CONFIG_VIDEO_OV12A10 is enabled?

drivers/media/i2c/ov12a10.c is not added until the later commit "media:
i2c: add ov12a10 image sensor driver" in this series, so enabling
CONFIG_VIDEO_OV12A10 at this commit fails with no rule to make target
drivers/media/i2c/ov12a10.o.

> @@ -137,6 +138,7 @@ obj-$(CONFIG_VIDEO_RJ54N1) += rj54n1cb0c.o
>  obj-$(CONFIG_VIDEO_S5C73M3) += s5c73m3/
>  obj-$(CONFIG_VIDEO_S5K3M5) += s5k3m5.o
>  obj-$(CONFIG_VIDEO_S5K5BAF) += s5k5baf.o
> +obj-$(CONFIG_VIDEO_S5K5E8) += s5k5e8.o
>  obj-$(CONFIG_VIDEO_S5K6A3) += s5k6a3.o
>  obj-$(CONFIG_VIDEO_S5KJN1) += s5kjn1.o
>  obj-$(CONFIG_VIDEO_S5KJN5) += s5kjn5.o

[Severity: High]
Is a config VIDEO_S5K5E8 entry missing from drivers/media/i2c/Kconfig?

Without a VIDEO_S5K5E8 symbol in Kconfig, CONFIG_VIDEO_S5K5E8 can never be
enabled and drivers/media/i2c/s5k5e8.c is never compiled. An entry in
MAINTAINERS is also missing for the new driver.

> diff --git a/drivers/media/i2c/s5k5e8.c b/drivers/media/i2c/s5k5e8.c
> new file mode 100644
> index 0000000000000..d25b978d7eda6
> --- /dev/null
> +++ b/drivers/media/i2c/s5k5e8.c

[ ... ]

> +static const struct s5k5e8_mode default_mode = {
> +		.width = 2592, .height = 1944, .hts_def = 2856,
> +			.num_regs = ARRAY_SIZE(s5k5e8_2592x1944_regs),
> +		.regs = s5k5e8_2592x1944_regs,
> +	};

[ ... ]

> +static int s5k5e8_read_reg(struct s5k5e8 *s5k5e8, u16 reg, u32 len, u32 *val)
> +{
> +	struct i2c_client *client = v4l2_get_subdevdata(&s5k5e8->sd);
> +	struct i2c_msg msgs[2];
> +	u8 addr_buf[2], data_buf[4] = { 0 };
> +	int ret;
> +
> +	put_unaligned_be16(reg, addr_buf);
> +	msgs[0].addr = client->addr;
> +	msgs[0].flags = 0;
> +	msgs[0].len = 2;
> +	msgs[0].buf = addr_buf;
> +	msgs[1].addr = client->addr;
> +	msgs[1].flags = I2C_M_RD;
> +	msgs[1].len = len;
> +	msgs[1].buf = &data_buf[4 - len];
> +	ret = i2c_transfer(client->adapter, msgs, 2);
> +	if (ret != 2)
> +		return ret < 0 ? ret : -EIO;
> +	*val = get_unaligned_be32(data_buf);
> +	return 0;
> +}
> +
> +static int s5k5e8_write_reg(struct s5k5e8 *s5k5e8, u16 reg, u32 len, u32 val)
> +{
> +	struct i2c_client *client = v4l2_get_subdevdata(&s5k5e8->sd);
> +	u8 buf[6];
> +	int ret;
> +
> +	put_unaligned_be16(reg, buf);
> +	put_unaligned_be32(val << (8 * (4 - len)), buf + 2);
> +	ret = i2c_master_send(client, buf, len + 2);
> +	return ret == len + 2 ? 0 : (ret < 0 ? ret : -EIO);
> +}
> +
> +static int s5k5e8_write_regs(struct s5k5e8 *s5k5e8, const struct s5k5e8_reg *regs, u32 len)
> +{
> +	u32 i;
> +	int ret;
> +
> +	for (i = 0; i < len; i++) {
> +		ret = s5k5e8_write_reg(s5k5e8, regs[i].address, 1, regs[i].val);
> +		if (ret)
> +			return ret;
> +	}
> +	return 0;
> +}

[Severity: Low]
Could this driver use the V4L2 CCI regmap helpers (devm_cci_regmap_init_i2c(),
cci_read(), cci_write(), and cci_multi_reg_write()) instead of open-coding
16-bit big-endian I2C register access in s5k5e8_read_reg(),
s5k5e8_write_reg(), and s5k5e8_write_regs()? Also, s5k5e8_probe() can use
v4l2_link_freq_to_bitmap() to validate the link frequency.

[ ... ]

> +	switch (ctrl->id) {
> +	case V4L2_CID_ANALOGUE_GAIN:
> +		ret = s5k5e8_write_reg(s5k5e8, S5K5E8_REG_ANALOG_GAIN, 2, ctrl->val);
> +	break;
> +	case V4L2_CID_EXPOSURE:
> +		ret = s5k5e8_write_reg(s5k5e8, S5K5E8_REG_EXPOSURE, 2, ctrl->val);
> +	break;
> +	case V4L2_CID_VBLANK:
> +		ret = s5k5e8_write_reg(s5k5e8, S5K5E8_REG_VTS, 2,
> +				       s5k5e8->cur_mode->height + ctrl->val);
> +	break;
> +	case V4L2_CID_TEST_PATTERN:
> +		ret = s5k5e8_write_reg(s5k5e8, S5K5E8_REG_TEST_PATTERN, 2, ctrl->val);
> +	break;
> +	}

[Severity: Low]
This isn't a bug, but the break statements in s5k5e8_set_ctrl() are aligned
with the case labels, and the fields and closing brace in default_mode above
have inconsistent indentation.

[ ... ]

> +static int s5k5e8_set_stream(struct v4l2_subdev *sd, int enable)
> +{
> +	struct s5k5e8 *s5k5e8 = to_s5k5e8(sd);
> +	int ret = 0;
> +
> +	mutex_lock(&s5k5e8->mutex);
> +	if (s5k5e8->streaming == enable) {
> +		mutex_unlock(&s5k5e8->mutex);
> +		return 0;
> +	}

[ ... ]

> +static const struct v4l2_subdev_video_ops s5k5e8_video_ops = { .s_stream = s5k5e8_set_stream };

[Severity: Low]
Should this implement .enable_streams and .disable_streams in s5k5e8_pad_ops
with .s_stream = v4l2_subdev_s_stream_helper instead of wiring a custom
.s_stream callback and tracking s5k5e8->streaming manually? Aliasing
s5k5e8->sd.state_lock to s5k5e8->ctrl_handler.lock would also avoid the need
for a separate s5k5e8->mutex.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125123146.379057-1-hikmahgumelar@gmail.com?part=3

  reply	other threads:[~2026-11-25 12:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 12:31 [PATCH v4 0/7] arm64: dts: qcom: msm8953-xiaomi-tissot: enable front and rear cameras Hikmah Gumelar
2026-11-25 12:31 ` [PATCH v4 1/7] clk: qcom: gcc-msm8953: fix csi_phytimer_clk_src 100MHz parent Hikmah Gumelar
2026-11-25 12:31 ` [PATCH v4 2/7] media: dt-bindings: media: i2c: add Samsung S5K5E8 Hikmah Gumelar
2026-11-25 12:31 ` [PATCH v4 3/7] media: i2c: add s5k5e8 image sensor driver Hikmah Gumelar
2026-11-25 12:44   ` sashiko-bot [this message]
2026-11-25 12:31 ` [PATCH v4 4/7] media: dt-bindings: media: i2c: add OmniVision OV12A10 Hikmah Gumelar
2026-11-25 12:31 ` [PATCH v4 5/7] media: i2c: add ov12a10 image sensor driver Hikmah Gumelar
2026-11-25 12:50   ` sashiko-bot
2026-11-25 12:31 ` [PATCH v4 6/7] arm64: dts: qcom: msm8953: add CAMSS node and MCLK pinctrl states Hikmah Gumelar
2026-11-25 12:31 ` [PATCH v4 7/7] arm64: dts: qcom: msm8953-xiaomi-tissot: enable front and rear cameras Hikmah Gumelar
2026-11-25 12:45   ` sashiko-bot

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=sashiko-outbox-233389@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hikmahgumelar@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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