Received: by 2002:a05:7208:3228:b0:82:47:81bb with SMTP id cb40csp546539rbb; Fri, 12 Apr 2024 09:01:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6dxuk7Wf++nrtaVd04WB4KVN7Wv9s1S8jrZXmCoalokmI+JYnT10uZChc/3ej9cYufG6R2lDv3YXRX22wVS5vjAZMlTHGffuZgv9Aww== X-Google-Smtp-Source: AGHT+IH1FWlRj1r0UE8c89NvXyvbUJSQSUKusyx3fzaWwAbxSKeIuzMaCAySQydkvRNZGwh8+aIl X-Received: by 2002:a17:907:d2a:b0:a52:22c4:8158 with SMTP id gn42-20020a1709070d2a00b00a5222c48158mr2211682ejc.56.1712937709135; Fri, 12 Apr 2024 09:01:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712937709; cv=pass; d=google.com; s=arc-20160816; b=eSGQck2METyAWCHenpqsmR9vrHzPL0PJdlhycoSRgEifL57BZ1VbCSdr0pzoYZsYwf NVw8CCBsrvHlbV67sx9yxWXsXMxGSUIM/Y57rLMeLZYrpBlIdiUmrQ3fmWnfWDFfny2C pF6OFw+z4khVEPCZ9/frrW+/6BbvZv5Z9lNY7jLpKK7SLqorT1tBFCdq//e2RxhKz446 mu0upe3X2iiDs8KaFuuDRXAQ3ScyO1AxLEMNNiDXoOM/zo3tuFXHPM5iwvOxEyBVJXS+ pL/wzxPl4UOrW6LhL9T72I4m8d8Ef/JnHa2I/4FBkESGFIZXC4LBeY0KMCKy3/epcAMu mSjQ== 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=TXV+55tSBd3tuq3pTXr7OMD4AddJ3DCHPldlJFI2xXk=; fh=ubgSGivyX1a6nEb6mxS2lPUzB/FQ53Lzp2BE7D6lOQ4=; b=EjdDu8pz2vbZGo+YDlSbU/YWuIkEYpsX9N4vXSEkjXDDXc8w2VMOBg4F0KJD7HXKRY kHbTBXRykb6ay+GAdGxTlR+9lPMUGqFjkoXdWSo2MikXfpF5mFp0slTZDKkSCnDNWe3e EQI8er1fIkTZhI/3X07mVg3MSfYbjL93BdI/NEymZhhLY0V+lLYX5fnGLiaajsiCoqbU 6uF/0MD1LoszxX40REcjYlVGbD6Cg2jVOQQwuzqXPGmQz07jpjEX/8sDgfuhRfRfIuFU +R35rKEmtoPD3LElqVVdmEMJQ0YB4jGXlJhSGcax9knnRtQFfhJMLzbywzt1rXQhCZn9 F7Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=tK0qkGHG; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-142995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142995-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 13-20020a170906328d00b00a523cce7f4bsi436592ejw.628.2024.04.12.09.01.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 09:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=tK0qkGHG; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-142995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142995-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 CCA1E1F24626 for ; Fri, 12 Apr 2024 16:01:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52580149C41; Fri, 12 Apr 2024 16:01:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tK0qkGHG" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D4081494A8; Fri, 12 Apr 2024 16:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712937659; cv=none; b=FWPI1ccam9ksFnbvAFRJYraNElrPyMsA4dH0rm/U6Y1HYtix/+iFnqrTQrYtO/x2v4XY3DZfKnjOSxMBJwgDZGqRwjopGKilngt1qK3/HWTHywFKHVY3lz3AgvDgQtt7SgGejVH3aFoV0DzE+RukkW3/6zeL/DzCevGrq0qfN00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712937659; c=relaxed/simple; bh=jNXV8hHoJduX5tXufEQNHt5F63rCqvvq3i2twRk/QcE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r56WvMD+QV/BLO/Y4mUM0C1jWL1AfSxW38Uw0iRb4/O4jUXDg6dZs7pFYGYUdXRwYrf05TzQrRx8osOkkyfrS0eiZx/rdpCPtwSOeQmpbFMb1Us2ZFa8ulYyaCEf70KUmsQwfBnTJKFxh/Ir5vBT7PyuquaGHJm6NvYytBGJk8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=tK0qkGHG; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from umang.jain (unknown [103.251.226.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6018CA12; Fri, 12 Apr 2024 18:00:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1712937613; bh=jNXV8hHoJduX5tXufEQNHt5F63rCqvvq3i2twRk/QcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tK0qkGHGuNKwqiWGNCzS2ejCn8mDUhwD/UI3WriGP14gU8hZ0V6mQCR+0bAgstHpl eDX1kebiR+ywpBH7BDCfabQ/3Bp8jHSGEhbrPo2cxEw8+F0xgDL1opx/aXcmnT/Pfq TT+ukgFV3eJPozu7EtyJZ0893lV8NNNgUdrifLIM= From: Umang Jain To: linux-media@vger.kernel.org Cc: Alexander Shiyan , Kieran Bingham , Sakari Ailus , open list , Umang Jain Subject: [PATCH v6 2/6] media: imx335: Parse fwnode properties Date: Fri, 12 Apr 2024 21:30:35 +0530 Message-ID: <20240412160039.276743-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240412160039.276743-1-umang.jain@ideasonboard.com> References: <20240412160039.276743-1-umang.jain@ideasonboard.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 From: Kieran Bingham Call the V4L2 fwnode device parser to handle controls that are standardised by the framework. Signed-off-by: Kieran Bingham Signed-off-by: Umang Jain --- drivers/media/i2c/imx335.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index c633ea1380e7..cebe8cfd77be 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -1227,10 +1227,16 @@ static int imx335_init_controls(struct imx335 *imx335) { struct v4l2_ctrl_handler *ctrl_hdlr = &imx335->ctrl_handler; const struct imx335_mode *mode = imx335->cur_mode; + struct v4l2_fwnode_device_properties props; u32 lpfr; int ret; - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 7); + ret = v4l2_fwnode_device_parse(imx335->dev, &props); + if (ret) + return ret; + + /* v4l2_fwnode_device_properties can add two more controls */ + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 9); if (ret) return ret; @@ -1295,6 +1301,8 @@ static int imx335_init_controls(struct imx335 *imx335) if (imx335->hblank_ctrl) imx335->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; + v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx335_ctrl_ops, &props); + if (ctrl_hdlr->error) { dev_err(imx335->dev, "control init failed: %d\n", ctrl_hdlr->error); -- 2.43.0