From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D444035F184; Fri, 7 Aug 2026 15:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786116429; cv=none; b=j4jN9qd/lg2uiMHqP9seffx0nacqBTsyN9Cod7x+0kGOeSao62ih0tcPtOHXeNCsIE1nEdiVs6odViznfX3g/RTerYOHj705qz9yXjK8jGM+3P12QDtUvGjZtIVdxnFCe7fr/K+EcgnfCxgD3VgRCyau+vTh1Q7iCCOCv3WNQJo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786116429; c=relaxed/simple; bh=Axw1O7ocMWffPd3ACkqcKVxgx3Pk/L9UjL2dPqanV8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cBVEewOrJrGZJim94Fl6PQiUNO88v5l3ID5DFgKaBgaNDlswtxILtb32A++S/H6l6NNfyTzOeAdLd3UA4Bg+092nMZyGGFHtYscINW2gy8/BraWmfCEZsUePrUf/+KyLpy/qbgUa4yfgILyWmc+2EoUr1xetfZVtFsEHt2/a+Aw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TSZYiNjL; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TSZYiNjL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4351A1F00A3D; Fri, 7 Aug 2026 15:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786116427; bh=WKG8IWOvjctd//I+c57TzMqSgya6NIhObeuaTg1iSeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TSZYiNjLFvrLG/c4uji8xBFlTWcMwAy/NeAzoKlAWh8iAfe6wz7v2g5xq24Tgv4fK Kv7EVnM+eTRPEr5Yxkx04bSIRm9H4AEbdrs0IPLzEDpxUVgTSRa6VN/+2P5uu97vZd nM7gC0V/LRnJ1yC14cHCyBhyiP5h2KB8A2w0gWok= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Laurent Pinchart , Jacopo Mondi , Dave Stevenson , Sakari Ailus , Hans Verkuil , Sasha Levin Subject: [PATCH 6.6 228/261] media: i2c: imx219: Dont store the current mode in the imx219 structure Date: Fri, 7 Aug 2026 16:39:45 +0200 Message-ID: <20260807143420.291718628@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260807143415.358597922@linuxfoundation.org> References: <20260807143415.358597922@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laurent Pinchart [ Upstream commit e3e5d172d5fce9151bc101427554a158d4759856 ] The mode field of the imx219 structure is only used in imx219_init_controls(), after the probe function sets it to point to the default mode. Use the default mode directly when initializing controls, and drop the mode field from the imx219 structure. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Stable-dep-of: 2c4f1ba73543 ("media: imx219: Fix maximum frame length in lines") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/i2c/imx219.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -1067,8 +1067,8 @@ static unsigned long imx219_get_pixel_ra static int imx219_init_controls(struct imx219 *imx219) { struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd); + const struct imx219_mode *mode = &supported_modes[0]; struct v4l2_ctrl_handler *ctrl_hdlr; - unsigned int height = imx219->mode->height; struct v4l2_fwnode_device_properties props; int exposure_max, exposure_def, hblank; int i, ret; @@ -1097,15 +1097,15 @@ static int imx219_init_controls(struct i /* Initial vblank/hblank/exposure parameters based on current mode */ imx219->vblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx219_ctrl_ops, V4L2_CID_VBLANK, IMX219_VBLANK_MIN, - IMX219_VTS_MAX - height, 1, - imx219->mode->vts_def - height); - hblank = IMX219_PPL_DEFAULT - imx219->mode->width; + IMX219_VTS_MAX - mode->height, 1, + mode->vts_def - mode->height); + hblank = IMX219_PPL_DEFAULT - mode->width; imx219->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx219_ctrl_ops, V4L2_CID_HBLANK, hblank, hblank, 1, hblank); if (imx219->hblank) imx219->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; - exposure_max = imx219->mode->vts_def - 4; + exposure_max = mode->vts_def - 4; exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ? exposure_max : IMX219_EXPOSURE_DEFAULT; imx219->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx219_ctrl_ops, @@ -1298,7 +1298,8 @@ static int imx219_probe(struct i2c_clien /* Set default mode to max resolution */ imx219->mode = &supported_modes[0]; - /* sensor doesn't enter LP-11 state upon power up until and unless + /* + * Sensor doesn't enter LP-11 state upon power up until and unless * streaming is started, so upon power up switch the modes to: * streaming -> standby */