[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250723154753.GH6719@pendragon.ideasonboard.com>
Date: Wed, 23 Jul 2025 18:47:53 +0300
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Allen Ballway <ballway@...omium.org>
Cc: Hans de Goede <hansg@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: ov8865: move mode_configure out of state_configure
On Tue, Jul 22, 2025 at 01:35:43PM -0700, Allen Ballway wrote:
> ov8865_mode_configure() only needs to be called on sensor init, but it can
> be called multiple times from ov8865_state_configure(). Move
> ov8865_mode_configure() to ov8865_sensor_init().
>
> Signed-off-by: Allen Ballway <ballway@...omium.org>
> ---
> drivers/media/i2c/ov8865.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c
> index 95ffe7536aa6aba814f4e5c3d12e7279470b2f07..1d1a1f261bf4ab5c09848402dc057e2f572504e7 100644
> --- a/drivers/media/i2c/ov8865.c
> +++ b/drivers/media/i2c/ov8865.c
> @@ -2304,14 +2304,6 @@ static int ov8865_state_configure(struct ov8865_sensor *sensor,
> if (sensor->state.streaming)
> return -EBUSY;
>
> - /* State will be configured at first power on otherwise. */
> - if (pm_runtime_enabled(sensor->dev) &&
> - !pm_runtime_suspended(sensor->dev)) {
> - ret = ov8865_mode_configure(sensor, mode, mbus_code);
> - if (ret)
> - return ret;
> - }
> -
> ret = ov8865_state_mipi_configure(sensor, mode, mbus_code);
> if (ret)
> return ret;
> @@ -2384,6 +2376,13 @@ static int ov8865_sensor_init(struct ov8865_sensor *sensor)
> }
>
> /* Configure current mode. */
> + ret = ov8865_mode_configure(sensor, sensor->state.mode,
> + sensor->state.mbus_code);
How about the implication on ov8865_set_fmt() that will not update the
link freq and pixel rate controls anymore ?
> + if (ret) {
> + dev_err(sensor->dev, "failed to configure mode\n");
> + return ret;
> + }
> +
> ret = ov8865_state_configure(sensor, sensor->state.mode,
> sensor->state.mbus_code);
> if (ret) {
>
> ---
> base-commit: 6832a9317eee280117cd695fa885b2b7a7a38daf
> change-id: 20250722-mode_configure-80105fbd835d
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists