Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp610515lqj; Sun, 2 Jun 2024 13:38:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVEmj1sTUvOsY00Ei2cHDRWJ/3l2f2V51UBMqmklmTvdQSvrIq6nbhgkiGbwCtO27T9HKSURg7RVrpepeyZItQsLvvnZUcv0vAz3II4Xg== X-Google-Smtp-Source: AGHT+IHUxaTse8g6/YRqDUJ1AbauHNbVjb3zUXF5I8xM/B6NjK5ZjtPEYy8juOGNYXPYiSXfbEdb X-Received: by 2002:a05:6358:5f1a:b0:199:3210:d432 with SMTP id e5c5f4694b2df-19b48c4d9abmr1101590555d.14.1717360684165; Sun, 02 Jun 2024 13:38:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717360684; cv=pass; d=google.com; s=arc-20160816; b=c2TtpNj/Jp18UUoGSKHDINKLzFrpmylgcGbytzyGUknZEC6mcHIJ7xhCf+mh008rd3 k+QBDwKhVP5Eh9eIqtDuhKBPBf+2xUVzh3oulbn1az3ANn0iIDNX0tY3CsOCvcmp846I qikyD38WxDNwcIubkqBm0KpXtDca4qiZn8a4eyfIQEXx0NkF0ZDNFSX8EHzSu8OFWThA 0CVQC7ZTfm+HNqZJPe5QIZ4C6R11/TWajixqX3ubekBV49YS52vctlKfYnOynY5Jkwgl c6qGmv52fKjWf3lXRHQvHgErptVsmQv9CRGaz0WfkXQiZ4fJkVkepYgp4m8GeJwZ5szX jcnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xTu7TgWqZVAd6M9P/qgtMjmNVXvV33CqoO1c4TcfXKM=; fh=ng0FUFwPgHHqIHtWcUlLUSBs0e7fHIUGeuUhfcQSRgA=; b=WScaWoCQgvOLhedQoe4+UxvyvlVUEmMJnjEoDsWd/7zk19TzDNxlmYyGoU134iaX2e 33gOE3akxZF1kCmPhRFtLBANHEpJ6TiQ8F8O142wqrC8r6yAlzTEl+4qrUD/XfJUZ3Sd 1dfqwoDmqc37Yr4zV2Nc+TEoDQpxNZg7uClTX3Wj9SWaZ8dj32QqIwyT6e0PmTtQBrvV f5HgiL5t7lu8tghX8dN2g73koa1gaKOyYWeqvXkWcQQ+4EwCXwihT5S564dO7s5tzrsJ G6tpzx3C3Wowd1njiGMDuNXfIuRTRJ9W53l6z375nTmQPDINbIcOSTcOdWNvySBkVtdI +BVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=xuGF8b9z; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-198417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198417-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35b40c5a0si5498896a12.499.2024.06.02.13.38.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 13:38:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=xuGF8b9z; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-198417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198417-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AE177B2327D for ; Sun, 2 Jun 2024 20:23:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88EB984E0D; Sun, 2 Jun 2024 20:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b="xuGF8b9z" Received: from mail-108-mta89.mxroute.com (mail-108-mta89.mxroute.com [136.175.108.89]) (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 414A684DF2 for ; Sun, 2 Jun 2024 20:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.89 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717359625; cv=none; b=TlIE7U7suPV0WVnl75sgmkXr2B94YKkEYWU4OodBzFZDHpRBgc9CoYqh/3fbVhu8XHtbKTmmbu3cfsPx4KNMd567EtEIIgfP8lB6cZkxtbqMw+70gGkmK03wjtXuAGLVa2jKW9+WFVCiIKAj9pOLLmahEMZvASbSSqWF8Xh0t1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717359625; c=relaxed/simple; bh=pQK2j/aOaMt8ywl27zkrasiDgTR0TE4do7sZJlOPRRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f/JRxYvzqTbEekY8xw4meg9lh2hQIy4fe1yh7EywEsZSoduD31vSdKK+YBR1bIiNdDSURhbe2lj+oiGBWMZizYWDyS+yCcsc9WI+ZI9ydc9qUf4w/5gmFyvTO1HL1sowHRmEJqEP8QPe5zuU+aszjc5WGEU91iHaA82pzfbOmts= 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=xuGF8b9z; arc=none smtp.client-ip=136.175.108.89 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 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta89.mxroute.com (ZoneMTA) with ESMTPSA id 18fda96c508000e2b6.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 02 Jun 2024 20:14:25 +0000 X-Zone-Loop: 01371c03b4efb3a8a2b066470bd0b77acbf8a1122889 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=xuGF8b9zHsB5GMLIq0h70HuqNu rrDNXRI/N7xAwbieOStA2Mwzzb+uKRtu/kXFMpzV6Xb+WxOaNswGWjdrJt5+ZCEsCCZh4EOnLfnMA 78j6PfOQlPCuKj5jE/CzNJgaYiiuG1YFkgnvO8Dov0j1+k7gN4jHNUfD/mobPxg6YfEWRVuZTk0fp WAiYoyyc2IXdHLlvG38lV5kjk9hqqUrHQqfUCCrHqFtzis99xf+u5gJUXTXoSiADjtGCJRhtsPGdo CQ6XndzPikTYZpLP6NEaQ9vSQGzClUC4h0Xe4IW7nAb1oaLXZIP/SNBzLY6UJivV6aHGxgfn14n6K 3opyWgjw==; 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 v6 15/23] media: i2c: imx258: Set pixel_rate range to the same as the value Date: Sun, 2 Jun 2024 14:13:37 -0600 Message-ID: <20240602201345.328737-16-git@luigi311.com> In-Reply-To: <20240602201345.328737-1-git@luigi311.com> References: <20240602201345.328737-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: 8bit X-Authenticated-Id: personal@luigi311.com 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, link_freq = imx258->link_freq_menu_items[mode->link_freq_index]; pixel_rate = 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 = 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; ctrl_hdlr = &imx258->ctrl_handler; @@ -1293,18 +1293,13 @@ static int imx258_init_controls(struct imx258 *imx258) if (vflip) vflip->flags |= V4L2_CTRL_FLAG_READ_ONLY; - pixel_rate_max = - link_freq_to_pixel_rate(imx258->link_freq_menu_items[0], - imx258->nlanes); - pixel_rate_min = - link_freq_to_pixel_rate(imx258->link_freq_menu_items[1], - imx258->nlanes); + pixel_rate = link_freq_to_pixel_rate(imx258->link_freq_menu_items[0], + imx258->nlanes); /* By default, PIXEL_RATE is read only */ imx258->pixel_rate = 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); vblank_def = imx258->cur_mode->vts_def - imx258->cur_mode->height; vblank_min = imx258->cur_mode->vts_min - imx258->cur_mode->height; -- 2.44.0