From nobody Fri Dec 19 07:16:38 2025 Received: from mail-108-mta195.mxroute.com (mail-108-mta195.mxroute.com [136.175.108.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0D7712F367 for ; Wed, 1 May 2024 15:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714577186; cv=none; b=cW6crWzcqPyTDexiEbFZbRQTMIWW1ntCzD//wioo0AahFZ7+WVulpToNbdzO9qzWdl9lfYj8SEkwO60hBKQbFCQzXhVbqNQgptfHh+koZ8zxpZIShC5u1zDUjIJGP/PDm1O+E59tdpuGyFBgg2oAQGBeQ3pa/zqPYQc/lodmCv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714577186; c=relaxed/simple; bh=pQK2j/aOaMt8ywl27zkrasiDgTR0TE4do7sZJlOPRRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nc10OxL3whxbtt7wtgKGvZLc36xpr1+3uOtfV+7IH+oJ7/63eQrH8J/oL2pkfymn5LmhVtyVH7QN+W8TIQUmW0VvN4OwGJbsKf1MHpc+Ppk1vtl0QBk7ljlGnDS90KWr4t1ygTIezJVWNSS9GHzogT1viCQlG6UnqjSsRhGPjDI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com; spf=pass smtp.mailfrom=luigi311.com; dkim=pass (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b=sF6+cUNB; arc=none smtp.client-ip=136.175.108.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=luigi311.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b="sF6+cUNB" Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta195.mxroute.com (ZoneMTA) with ESMTPSA id 18f34c2a8f10008ca2.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 01 May 2024 15:25:23 +0000 X-Zone-Loop: 8e767b9aa04f06eb533072d05c4a2b63022e3ed7d85a DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=luigi311.com; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xTu7TgWqZVAd6M9P/qgtMjmNVXvV33CqoO1c4TcfXKM=; b=sF6+cUNBUNjUpX54jnLdLfUJIB BGdEb7Z5kkBFMr+Ptoo6XYiM6pFNSQTyuq+fvVd0y6QMca8E+nMI91AXkF4HVZ2PP2ayDMGVEUKra 9JkFDSQZmK9IshV7fe5PgK8n2QzE1xb2f2SqoxSkEqX/k9bDcfndtBkDRniMQGSH2Hy2ELhHjqU6w jMECHm+ut9IKOpSK8FDKjaEwCFshnzPnWa0ej09cZgMqT0vu5EvQQPzpnFXHTv7cNJniwfr9X8piY 8V+p/7tAJggLTgBkqdUry5hmGENrD9xShLHlsKDb6W0sjmCGF2MZD0jDmqAgQJmxAQcA7cDeZva34 xXeYbUaw==; From: git@luigi311.com To: linux-media@vger.kernel.org Cc: dave.stevenson@raspberrypi.com, jacopo.mondi@ideasonboard.com, mchehab@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, sakari.ailus@linux.intel.com, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, phone-devel@vger.kernel.org, Luis Garcia Subject: [PATCH v5 15/25] media: i2c: imx258: Set pixel_rate range to the same as the value Date: Wed, 1 May 2024 09:24:32 -0600 Message-ID: <20240501152442.1072627-16-git@luigi311.com> In-Reply-To: <20240501152442.1072627-1-git@luigi311.com> References: <20240501152442.1072627-1-git@luigi311.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: personal@luigi311.com Content-Type: text/plain; charset="utf-8" From: Dave Stevenson With a read only control there is limited point in advertising a minimum and maximum for the control, so change to set the value, min, and max all to the selected pixel rate. Signed-off-by: Dave Stevenson Reviewed-by: Jacopo Mondi Signed-off-by: Luis Garcia Reviewed-by: Pavel Machek --- drivers/media/i2c/imx258.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index 9c83ba1232fa..4eb5f2eba491 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -971,7 +971,8 @@ static int imx258_set_pad_format(struct v4l2_subdev *sd, =20 link_freq =3D imx258->link_freq_menu_items[mode->link_freq_index]; pixel_rate =3D link_freq_to_pixel_rate(link_freq, imx258->nlanes); - __v4l2_ctrl_s_ctrl_int64(imx258->pixel_rate, pixel_rate); + __v4l2_ctrl_modify_range(imx258->pixel_rate, pixel_rate, + pixel_rate, 1, pixel_rate); /* Update limits and set FPS to default */ vblank_def =3D imx258->cur_mode->vts_def - imx258->cur_mode->height; @@ -1261,8 +1262,7 @@ static int imx258_init_controls(struct imx258 *imx258) struct v4l2_ctrl *vflip, *hflip; s64 vblank_def; s64 vblank_min; - s64 pixel_rate_min; - s64 pixel_rate_max; + s64 pixel_rate; int ret; =20 ctrl_hdlr =3D &imx258->ctrl_handler; @@ -1293,18 +1293,13 @@ static int imx258_init_controls(struct imx258 *imx2= 58) if (vflip) vflip->flags |=3D V4L2_CTRL_FLAG_READ_ONLY; =20 - pixel_rate_max =3D - link_freq_to_pixel_rate(imx258->link_freq_menu_items[0], - imx258->nlanes); - pixel_rate_min =3D - link_freq_to_pixel_rate(imx258->link_freq_menu_items[1], - imx258->nlanes); + pixel_rate =3D link_freq_to_pixel_rate(imx258->link_freq_menu_items[0], + imx258->nlanes); /* By default, PIXEL_RATE is read only */ imx258->pixel_rate =3D v4l2_ctrl_new_std(ctrl_hdlr, &imx258_ctrl_ops, V4L2_CID_PIXEL_RATE, - pixel_rate_min, pixel_rate_max, - 1, pixel_rate_max); - + pixel_rate, pixel_rate, + 1, pixel_rate); =20 vblank_def =3D imx258->cur_mode->vts_def - imx258->cur_mode->height; vblank_min =3D imx258->cur_mode->vts_min - imx258->cur_mode->height; --=20 2.44.0