Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp75530lqh; Wed, 27 Mar 2024 15:27:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvZ2BtmRm704DLr8Njhrl2JLJNQwSvt/Oe5gGrM2qQOX1PEhJjOh7aluaFP1El0m2Bvzg94dSWg+8OVv/u68mwjGNo0RXEq23lcSt0BA== X-Google-Smtp-Source: AGHT+IHAyp6Yx4kTShZxtjd/7kMXSavNSXfG7oIan3FJ0Mohkb8sua1Wfb9c0hlvDUFrtWEhoUyc X-Received: by 2002:a05:6a21:a58f:b0:1a3:4d98:3be0 with SMTP id gd15-20020a056a21a58f00b001a34d983be0mr1634932pzc.13.1711578460649; Wed, 27 Mar 2024 15:27:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711578460; cv=pass; d=google.com; s=arc-20160816; b=XM/nbgfs+K8uSJ2f51XsqzHXZokGs4r85kvggvMEK5ElhXqYD4BhC0RwPaw4BGAjxj /Xcbb5bRVBiD++EMTrAMYAFNzGnG4WcAtGC5QOzCztnSshmK0huq3OXBmITvxxmKXxY6 a2xyjQRzRR3J+zh/5W8cmSYRuFHHxUszySvPV9HcB3aMM3enR4SNrMuFJTbnd2PU0Jsa cKhfIDATJYX84WdPQRBp9KYA+h6ZsuAMb5/xH0SFY/dhTcGRECyzjRGhjsXCgXPLnyK8 kZYOQsITM267Pe/VvCtAJbc21cSXwETYZDvwFFpC6HLyNijeVffH2LNPUxu0G4+C0I9x SwDw== 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=XYmNM0zbv3+O+YfnDH4hEcGfkU7Y/smW11E/sBjJxo8=; fh=sX11liakLT8PowH2ltAqXJKmySswDeI0fhK7/UC79fU=; b=Jg5tsZkrerBBpXCmztma7Y8NsEL1xasiP1B5wjtWnkDvnfO+yK9FHSyv7jK1NxA5OJ rj+RUos3bZyvgtWoFFMhxfDpSHg6xz30XYeoE7OodasH4lD2KeXujUTuGR525UO9e9Xm 2eKzG1u0nRBJc8pyiDLTohScuGATu8IoXd+NhyxM1tFVoGmDgobE8lDoOdTYmQm0HkWV X7AhL5cDYSFmstxb4eTGON6fx9jCL700PnQkAczGHMBqFUuGBUxeEDXbUR/hdI6LqGUU xWGn5ROfCSHRPTM9emwsVESst6u/0bigS+h5EZuYxLgG/zfAZB+fkhX9fqyc30HUTdxE C/rA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=g7SU4XMM; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-122096-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122096-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w10-20020a17090aea0a00b002a091b64089si184959pjy.64.2024.03.27.15.27.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 15:27:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122096-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=g7SU4XMM; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-122096-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122096-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 D89F4299D9A for ; Wed, 27 Mar 2024 22:27:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6FEF1553B1; Wed, 27 Mar 2024 22:26:21 +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="g7SU4XMM" Received: from mail-108-mta225.mxroute.com (mail-108-mta225.mxroute.com [136.175.108.225]) (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 19FA115530E for ; Wed, 27 Mar 2024 22:26:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711578380; cv=none; b=o00oIDN3eMdlI3raGJhYv740IPy9onMMzE2+D0Bi0vxI4oWE5zsrhiiUAQps9WooNax6Ar8p+/Hj7I9HsBrJeQJ8ujgbLzc3Kkzcew201jknmVsbTIgTPQPjLiOehgFvtfjmtmly9wuU3ZltmF82wzebN7dZxWuJe9+Xy4jSMYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711578380; c=relaxed/simple; bh=sWAfFhAGvw4CqbUg4tIVjRY+a1yJUW3dKOY9ml8HHIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TzfdlJ/AYDRPMNunCXq235sOb6qaxW1+ISQIo/xX4CQVQT4g26JbDerhiI/YaLeV9p395LmHr40m/Vt734nSCvhyYLzXhA2U8cWs15BQapKmEmAVjSEnizosFKcJ4OM2dBbCyK9a7d67Cgjl7l+fw6FxoVtq3vIE7Ep6ckWfDt0= 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=g7SU4XMM; arc=none smtp.client-ip=136.175.108.225 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-mta225.mxroute.com (ZoneMTA) with ESMTPSA id 18e82008a100003bea.00f for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 27 Mar 2024 22:20:57 +0000 X-Zone-Loop: caa505e625927f978e84229fd0cf14c10aba882a2f42 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=XYmNM0zbv3+O+YfnDH4hEcGfkU7Y/smW11E/sBjJxo8=; b=g7SU4XMM9krCpmgXNfHrKEJBpW CTnnP2TprTEucaiqC+47/lOIbypqNpPpmywUcFzqmKdTy61emrqfiRPzlGOIsqEze5g/A2uUiMIWI zcePYWKiUEuIsJ/30qHjmi0t/P1fUGSl9iGA6IGP0OxSF5TQR+B11+tD6gv0GB6IiaP6GDsEnCFGy SNfI+AxvGKgL3zD289MEFgWmi3zr8bRC0fB0cvsl+3UIusc0hqk63sEHLg+Zx3+AvHp2HGIEabo2T v1Zn607jf1aPKfIqzQwYSEj2aamwi5QOQdM8FlmXRnAjZdmIsP0ASJqlQ2Fa7WfqHeGtZzvOWn5iO +B1ZfjXw==; 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, x@xnux.eu Subject: [PATCH 06/23] media: i2c: imx258: Make V4L2_CID_VBLANK configurable. Date: Wed, 27 Mar 2024 16:20:18 -0600 Message-ID: <20240327222035.47208-7-git@luigi311.com> In-Reply-To: <20240327222035.47208-1-git@luigi311.com> References: <20240327222035.47208-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 --- 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.42.0