Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp605285lqj; Sun, 2 Jun 2024 13:21:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/tpYTCtK6ZZj5BUe5iH7SwtQyemcEInXnoe/0JAjdC9iers/drp1kZ+XKJSSsv8UIxOqc64afO/0WDox8DGERsRIAHWWbZJcQ8YS4ww== X-Google-Smtp-Source: AGHT+IEkivJe7yWIOR0/F7zuBYgSUT8vcfCPxdQJVu2y4yI704vxl4vIM2HTPZSH5ARRMvbHfW0G X-Received: by 2002:a17:906:b343:b0:a59:b02a:90da with SMTP id a640c23a62f3a-a6822348c6bmr544468666b.68.1717359669052; Sun, 02 Jun 2024 13:21:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717359669; cv=pass; d=google.com; s=arc-20160816; b=ogcoj6XYnzRY81y+dFjKfcsUWymxPZs6iEqhWvxYIqr6xhmMHCf6UnZMtIIhvcTTCc xr38rYpvdogSId4BoICposcUfKQbPulrcUqVgLlnV3iEksHNgefqqoZ2JdQmRvhm4SzE yPlO7UwKIfOC79wELZB7NE4+C8F48BIs2iIG6o6wz9psSDMDEF9ZMWEmCtqHHsaEeDpB +4zBp4G2ioB7m/R1cWMXiJeGXPevuUpgED7WiTH2MGLQyVJJcFZ/Cp2b70mfvr2NAeoN o/v1bzxBSYzhqzh9rHOC+NwJxFvhLH/S0nU3fA9pJi39FhJebT65h/cHnM+Gy6cYWRMV rpkQ== 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=Jxe1gPtYFCmEVv9eTkE7KcDWNvKsfj2RH86DpQggAUU=; fh=ng0FUFwPgHHqIHtWcUlLUSBs0e7fHIUGeuUhfcQSRgA=; b=0fMZ/hCXe3Sol9yHMsbScKem7BnGtKCsOtZO+ZUx9Az9DMdGoaKI5623WKEMzvgHUj JPvCuKVSeCKbPJTlVymSYB2bUwGOWC8DQ8UF42tx4ihMrRF2PS2uo7Dwn6l7qvG+WSI7 Vzbrn74NQtxY63pWKJb0RdLugdEjZE2H7g5Tls3VQYjLdqLBcvQgy0KV0kUYWGOSuG66 wjB3pvWG7SNrrNqiyOymB1+OojPrUeM+Bi/9meUS8UTeTvUP8fkwFAQyR96QpzOedFJp P55DomzWerMg6+VdW26W71KegU0NTDYll0J3VBtWdyk46R7C4653HdBOfTT2Z4FCxr7N 5a/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=SU6NupzX; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-198410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198410-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a69018ada6asi59575566b.172.2024.06.02.13.21.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 13:21:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=SU6NupzX; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-198410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198410-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BBE691F221F0 for ; Sun, 2 Jun 2024 20:21:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50DCD824AB; Sun, 2 Jun 2024 20:19:41 +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="SU6NupzX" Received: from mail-108-mta86.mxroute.com (mail-108-mta86.mxroute.com [136.175.108.86]) (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 184E6763E6 for ; Sun, 2 Jun 2024 20:19:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.86 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717359580; cv=none; b=IsLWE65DGOrmmHQrAUYAapzkKtzdlq1wXzUXZ+C5LEt5Fw/ugdSQ9WLDU/uJ8So9dKKTd18elQHvlwXaCgmCMEr6cOuMdGBoH9QZ5RWcBLPPtn/OHZCt+z0UsTFbxizGORyaIsK01CozV45iwH7ZmG7WZPUt0+BsX90Msjun0aQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717359580; c=relaxed/simple; bh=vmDWxnFYVlMeX8mv6XV77VsSX93jJDH21Yu7+jdTofM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jdZWZtTH4cODCB5sCDu/8gvqF8lpQ3C+oI2cfpFDEunewIG3HACtPVOeTjGGHqCq4/BQuIDnuRMJtIrFHRdIgpnStWVGOSagrlz/MoturpnHI5dhfGNBP3QBVyF+lniedEGLsPsjveAitEy78gouRNCWdfqj87kI2hbRTP4fDbg= 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=SU6NupzX; arc=none smtp.client-ip=136.175.108.86 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-mta86.mxroute.com (ZoneMTA) with ESMTPSA id 18fda9677c0000e2b6.010 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 02 Jun 2024 20:14:05 +0000 X-Zone-Loop: 8ce7f52addde3cc6928a15410d27b7643a3286ffb821 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=Jxe1gPtYFCmEVv9eTkE7KcDWNvKsfj2RH86DpQggAUU=; b=SU6NupzXCG/9f+iXmj9c3c45n6 WzJpgZ2VnmFmM1n1t8W4uJPEncFH3I8L7QuEkmEobRyGhwA9KCxGCgEk2jvy+9WlCYPu1tgaqvOkX 29YBgbFxmzwuZRRDGOGZaSvIc2vp5UXsdI9EBGlCxqRxDzw60BP79h2KzQe0+4qqIvIRZ7rimWMFT uuSUnNHHu7wrwO3oUqwUv3WHp0t95o4USZostWhpzL2D50iZP/AACrahJSE9I1S/1SNCarBKK0JdP s51dSTBd3yIzSWqg8BFXEebhU3NHiCWrSmyfxXMJtD4iMV4zr2LccQ5YOuQL+fgXn1K14TxEGZJdG rFmYUq0A==; 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 06/23] media: i2c: imx258: Make V4L2_CID_VBLANK configurable. Date: Sun, 2 Jun 2024 14:13:28 -0600 Message-ID: <20240602201345.328737-7-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 The values and ranges of V4L2_CID_VBLANK are all computed, so there is no reason for it to be a read only control. Remove the register values from the mode lists, add the handler, and remove the read only flag. Signed-off-by: Dave Stevenson Signed-off-by: Luis Garcia Reviewed-by: Pavel Machek --- drivers/media/i2c/imx258.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index 495eaada2945..321b504c6a48 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -30,6 +30,8 @@ #define IMX258_VTS_30FPS_VGA 0x034c #define IMX258_VTS_MAX 0xffff +#define IMX258_REG_VTS 0x0340 + /* HBLANK control - read only */ #define IMX258_PPL_DEFAULT 5352 @@ -202,8 +204,6 @@ static const struct imx258_reg mode_4208x3120_regs[] = { { 0x0114, 0x03 }, { 0x0342, 0x14 }, { 0x0343, 0xE8 }, - { 0x0340, 0x0C }, - { 0x0341, 0x50 }, { 0x0344, 0x00 }, { 0x0345, 0x00 }, { 0x0346, 0x00 }, @@ -319,8 +319,6 @@ static const struct imx258_reg mode_2104_1560_regs[] = { { 0x0114, 0x03 }, { 0x0342, 0x14 }, { 0x0343, 0xE8 }, - { 0x0340, 0x06 }, - { 0x0341, 0x38 }, { 0x0344, 0x00 }, { 0x0345, 0x00 }, { 0x0346, 0x00 }, @@ -436,8 +434,6 @@ static const struct imx258_reg mode_1048_780_regs[] = { { 0x0114, 0x03 }, { 0x0342, 0x14 }, { 0x0343, 0xE8 }, - { 0x0340, 0x03 }, - { 0x0341, 0x4C }, { 0x0344, 0x00 }, { 0x0345, 0x00 }, { 0x0346, 0x00 }, @@ -800,6 +796,11 @@ static int imx258_set_ctrl(struct v4l2_ctrl *ctrl) BIT(IMX258_HDR_RATIO_MAX)); } break; + case V4L2_CID_VBLANK: + ret = imx258_write_reg(imx258, IMX258_REG_VTS, + IMX258_REG_VALUE_16BIT, + imx258->cur_mode->height + ctrl->val); + break; default: dev_info(&client->dev, "ctrl(id:0x%x,val:0x%x) is not handled\n", @@ -1174,9 +1175,6 @@ static int imx258_init_controls(struct imx258 *imx258) IMX258_VTS_MAX - imx258->cur_mode->height, 1, vblank_def); - if (imx258->vblank) - imx258->vblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; - imx258->hblank = v4l2_ctrl_new_std( ctrl_hdlr, &imx258_ctrl_ops, V4L2_CID_HBLANK, IMX258_PPL_DEFAULT - imx258->cur_mode->width, -- 2.44.0