Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2772569lqz; Wed, 3 Apr 2024 08:13:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoXqZ0rWWDnzt2j0bfnMEN4nibAedAp3BUbIIliTnyPo9It+BbcFEKZWz2Cj+4TrKGLvcDYFw8tJQWMWtXyb9OxK5OoIF2J2kAchRmpQ== X-Google-Smtp-Source: AGHT+IFWrNwRJBkS9YWlVdGoS2r8yV+BZRZqqzpDUFziXayEDYPoLJZ/XagtaiUJDK8UdPSRYPDL X-Received: by 2002:a05:6a20:914a:b0:1a3:683a:2cd8 with SMTP id x10-20020a056a20914a00b001a3683a2cd8mr17663297pzc.28.1712157191518; Wed, 03 Apr 2024 08:13:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712157191; cv=pass; d=google.com; s=arc-20160816; b=eW5XdDka0eFaoVTd2YPhnagE/6F9kjK4naVeqQRsGW1TPhRvmiLnBeM8w4hbsALTvL ozk2CJ7fMP5A2R7KZNk0y5un7bNAdhjyv1m2piRNUYfIQASoIgZ0OljZI/hDyjpo3W4k U7vAIT1XCB67q7dFBMbRe2cOdIhPxiP+ye58IIkMSYcmsSktqup0zpe3tpHgguYhKgRb LLoe6fbDmlBEDS0R5TSiqe9m6322Ya6joxL9Am9vT69xRQRACCenwI6QzxzZ/CEJnPGc oPEMeogXQ4vrEDTjP3LhtRnR32vfBsGsostOTtor7F0pUmBimApcUwWyirXWNWGXbq/I UnSg== 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=um6Hj3+66bt6kjL5BKukA1fuuXmDo6jHd9WAJeM/FZM=; fh=ng0FUFwPgHHqIHtWcUlLUSBs0e7fHIUGeuUhfcQSRgA=; b=PSZqa42JOwktWRMsXbWcTN1Ku1oCW+APmNSlt7HyZjbIGbLoAex5Id0ot4XSjK/qBX ythZZchZe0hcGe7TzLcCZ/xdOb3ENSIcItEePACC6ncNDPNhgqTW2LjuNIiaQqGmw9HY YVI6jyLJAkA3ieZP9ullnpIZ0VH6pKnEkEwGOI5So4hVOfZRTDkRuPewdJUbavD/fi85 8zpf66mw4FiDbSheLKPQvAP/a5tggASAIrIu4ZdmsTm6Fu6vK9uCF4ij1JErsTZ/Md6i BHu390aKtVKPeroobeJO9eL2H8pSSWXVVPojyUJ8ijIrZAWcoyXSLIGZhWCEszl6PRY/ j1uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=yhQ0Igzq; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-130050-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130050-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 124-20020a630182000000b005f0a5127bd5si8087155pgb.113.2024.04.03.08.13.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130050-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=yhQ0Igzq; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-130050-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130050-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E3BA284F05 for ; Wed, 3 Apr 2024 15:11:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AD4E14D445; Wed, 3 Apr 2024 15:08:57 +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="yhQ0Igzq" Received: from mail-108-mta254.mxroute.com (mail-108-mta254.mxroute.com [136.175.108.254]) (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 B4C1414A61B for ; Wed, 3 Apr 2024 15:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.254 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156936; cv=none; b=DlUEtgn3kuctJESGDxAaH0+NIqN/nqkRX1taR3k/+QIlSoPTee5NsOg6rhdiFV1yTcY0WS8yIMCAhp+1bZ1QO6K+9JNGf1IePtZ6V7sYH1MlLber6csgIsWQU7PYyx4AqGd2tjdC5VAuFWCmGoy5NWfDhEceTYHNvJzcOxBhoww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156936; c=relaxed/simple; bh=orKRL9k3h4MQbuG4dRP6H2viAfkBXdURmtZNsy+EARg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LqwvWcy67uOuyAQKJqjsIFE6r9rNZeL3R+oJ7Ll0Mo9U1HM/ZspoagPxZ+m6py0rf5efeuPPD2SW91Ps7eiwj/UW3p5kDeEM6+GreDhUr9CKhTHfZtpbTggFf8ZUReQuehkllfuaIVqI0CefH6NFJtz5jtgyp78LgxwA45ZxHc8= 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=yhQ0Igzq; arc=none smtp.client-ip=136.175.108.254 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.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta254.mxroute.com (ZoneMTA) with ESMTPSA id 18ea4807e200003bea.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 03 Apr 2024 15:07:48 +0000 X-Zone-Loop: 67d2db673e63ebb065ae01d1621e75d9db726cb87034 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=um6Hj3+66bt6kjL5BKukA1fuuXmDo6jHd9WAJeM/FZM=; b=yhQ0IgzqM+a20jFZcASsvQ5ncx EMiRWEP5cGixlUh+70Z6ymKyvMOMtTlpsNHm+OQ3DSSKkvCbsKbP2JnmUvXeAQkiMf2TlesAkd6/h mZdcpPDFWE5Jh67T8CoeNe5WB4/jVIPNa1VgLtUHmZt48pVB3WDMntqgH/Q99lFzOrZXTwAZ6cbqH +U0q18W+/c04ecmR8UnwHr2Lrq1IH3NDTcTWbEzsf1v0ugvxYUf6TJxzas9wfClobp9mwQqFbjzmY HlOld8pueeoRTacIuXL10sIwK7AEk0WpjaDYYPqrdmQjIZZQSCi+aCJqaXmxC6vXq5u6ZhEPSAvl5 nPKQwLMQ==; 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 v3 15/25] media: i2c: imx258: Set pixel_rate range to the same as the value Date: Wed, 3 Apr 2024 09:03:44 -0600 Message-ID: <20240403150355.189229-16-git@luigi311.com> In-Reply-To: <20240403150355.189229-1-git@luigi311.com> References: <20240403150355.189229-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 --- 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 c242e318be11..7d434bc12c6a 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; @@ -1262,8 +1263,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; @@ -1294,18 +1294,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.42.0