public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Mirela Rabulea <mirela.rabulea@nxp.com>,
	mchehab@kernel.org, sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl,
	laurent.pinchart+renesas@ideasonboard.com,
	laurentiu.palcu@nxp.com, robert.chiras@nxp.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	LnxRevLi@nxp.com, kieran.bingham@ideasonboard.com,
	hdegoede@redhat.com, dave.stevenson@raspberrypi.com,
	mike.rudenko@gmail.com, alain.volmat@foss.st.com,
	julien.vuillaumier@nxp.com, alice.yuan@nxp.com
Subject: Re: [PATCH 2/5] media: ox05b1s: Add omnivision OX05B1S raw sensor driver
Date: Tue, 29 Oct 2024 07:17:06 +0100	[thread overview]
Message-ID: <f20c0e4a-488e-4e4e-8c15-a27df312280e@kernel.org> (raw)
In-Reply-To: <20241028190628.257249-3-mirela.rabulea@nxp.com>

On 28/10/2024 20:06, Mirela Rabulea wrote:
> Add a v4l2 subdevice driver for the Omnivision OX05B1S RGB-IR sensor.
> 
> The Omnivision OX05B1S is a 1/2.5-Inch CMOS image sensor with an
> active array size of 2592 x 1944.
> 
> The following features are supported for OX05B1S:
> - Manual exposure an gain control support
> - vblank/hblank control support
> - Supported resolution: 2592 x 1944 @ 30fps (SGRBG10)

...

> +
> +static const struct v4l2_subdev_ops ox05b1s_subdev_ops = {
> +	.video = &ox05b1s_subdev_video_ops,
> +	.pad   = &ox05b1s_subdev_pad_ops,
> +};
> +
> +static const struct v4l2_subdev_internal_ops ox05b1s_internal_ops = {
> +	.init_state = ox05b1s_init_state,
> +};
> +
> +static void ox05b1s_get_gpios(struct ox05b1s *sensor)
> +{
> +	struct device *dev = &sensor->i2c_client->dev;
> +
> +	sensor->rst_gpio = devm_gpiod_get_optional(dev, "reset",
> +						   GPIOD_OUT_HIGH);
> +	if (IS_ERR(sensor->rst_gpio))
> +		dev_warn(dev, "No sensor reset pin available");

Same comment as for clock further.

> +}
> +

...

> +static int ox05b1s_probe(struct i2c_client *client)
> +{
> +	int retval;
> +	struct device *dev = &client->dev;
> +	struct v4l2_subdev *sd;
> +	struct ox05b1s *sensor;
> +
> +	sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL);
> +	if (!sensor)
> +		return -ENOMEM;
> +
> +	sensor->regmap = devm_regmap_init_i2c(client, &ox05b1s_regmap_config);
> +	if (IS_ERR(sensor->regmap)) {
> +		dev_err(dev, "Failed to allocate sensor register map\n");

Allocation errors never result with error msg. Unless you meant
something else than allocation, but then syntax is return dev_err_probe.

> +		return PTR_ERR(sensor->regmap);
> +	}
> +
> +	sensor->i2c_client = client;
> +
> +	sensor->model = of_device_get_match_data(dev);
> +
> +	ox05b1s_get_gpios(sensor);
> +
> +	sensor->sensor_clk = devm_clk_get(dev, "csi_mclk");
> +	if (IS_ERR(sensor->sensor_clk)) {
> +		sensor->sensor_clk = NULL;
> +		dev_warn(dev, "Sensor csi_mclk is missing, using oscillator from sensor module\n");

Nope, syntax is return dev_err_probe. Why would you warn on probe deferral?

> +	}
> +


...

> +
> +module_i2c_driver(ox05b1s_i2c_driver);
> +MODULE_DESCRIPTION("Omnivision OX05B1S MIPI Camera Subdev Driver");
> +MODULE_AUTHOR("Mirela Rabulea <mirela.rabulea@nxp.com>");
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/media/i2c/ox05b1s/ox05b1s_regs_5mp.h b/drivers/media/i2c/ox05b1s/ox05b1s_regs_5mp.h
> new file mode 100644
> index 000000000000..3c34724c1d7e
> --- /dev/null
> +++ b/drivers/media/i2c/ox05b1s/ox05b1s_regs_5mp.h
> @@ -0,0 +1,1160 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * A register configuration for Omnivision OX05B1S raw camera, 2592 x 1944 @30fps BGGR10
> + * Copyright (C) 2024, NXP
> + * Copyright (C) 2024, Omnivision
> + *
> + */
> +#ifndef _OX05B1S_REGS_2592x1944_H_
> +#define _OX05B1S_REGS_2592x1944_H_
> +
> +/* 2592X1944_30FPS_FULL_RGBIr 2592 1944 */
> +static struct ox05b1s_reg ovx5b_init_setting_2592x1944[] = {

How this could be in the header? Why do you need multiple of copies of
it? No, move to the driver.



Best regards,
Krzysztof


  reply	other threads:[~2024-10-29  6:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 19:06 [PATCH 0/5] media: i2c: Add OX05B1S camera sensor driver Mirela Rabulea
2024-10-28 19:06 ` [PATCH 1/5] dt-bindings: media: i2c: Add bindings for OX05B1S " Mirela Rabulea
2024-10-29  6:14   ` Krzysztof Kozlowski
2024-10-29 12:10     ` Laurent Pinchart
2024-10-29 12:15       ` Krzysztof Kozlowski
2024-10-29 12:21         ` Laurent Pinchart
2024-10-29 12:28           ` Krzysztof Kozlowski
2024-10-29 12:46             ` Laurent Pinchart
2024-10-29 12:47               ` Krzysztof Kozlowski
2024-10-29 13:36     ` [EXT] " Mirela Rabulea
2024-10-29 13:49       ` Krzysztof Kozlowski
2024-10-29 11:44   ` Bryan O'Donoghue
2024-10-29 11:57     ` Laurent Pinchart
2024-10-29 12:00       ` Bryan O'Donoghue
2024-10-30  6:08         ` [EXT] " Mirela Rabulea
2024-10-30  6:02       ` Mirela Rabulea
2024-11-04 14:25         ` Laurent Pinchart
2024-11-26 16:10           ` Mirela Rabulea
2024-10-28 19:06 ` [PATCH 2/5] media: ox05b1s: Add omnivision OX05B1S raw " Mirela Rabulea
2024-10-29  6:17   ` Krzysztof Kozlowski [this message]
2024-10-28 19:06 ` [PATCH 3/5] MAINTAINERS: Add entry for OX05B1S " Mirela Rabulea
2024-10-28 19:06 ` [PATCH 4/5] dt-bindings: media: i2c: Update bindings for OX05B1S with OS08A20 Mirela Rabulea
2024-10-29  6:17   ` Krzysztof Kozlowski
2024-10-29 14:02     ` [EXT] " Mirela Rabulea
2024-10-29 16:46       ` Krzysztof Kozlowski
2024-10-28 19:06 ` [PATCH 5/5] media: ox05b1s: Add support for Omnivision OS08A20 raw sensor Mirela Rabulea
2024-11-01 12:08   ` Sakari Ailus
2024-11-04 13:21     ` [EXT] " Mirela Rabulea

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=f20c0e4a-488e-4e4e-8c15-a27df312280e@kernel.org \
    --to=krzk@kernel.org \
    --cc=LnxRevLi@nxp.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alice.yuan@nxp.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=julien.vuillaumier@nxp.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=laurentiu.palcu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mike.rudenko@gmail.com \
    --cc=mirela.rabulea@nxp.com \
    --cc=robert.chiras@nxp.com \
    --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