Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp919970lqs; Wed, 6 Mar 2024 00:12:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOVyrvacyf338FFJS6pPl/JZf9G5HKxCkmSg+XDCAXD6votOkcwBpHR50tiSXMgKqzzM2yGFWUbFq+P7o2dKlqNvi9XMNi+jIekihg5g== X-Google-Smtp-Source: AGHT+IEKOMrCgVc0YLDvLE2joSOATpMwsRkNNH260rvKqoBHQnXrAmR7CSTbj2/3TX+aT0R2ugzn X-Received: by 2002:a05:6402:c94:b0:566:a235:7f14 with SMTP id cm20-20020a0564020c9400b00566a2357f14mr9735316edb.16.1709712747236; Wed, 06 Mar 2024 00:12:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709712747; cv=pass; d=google.com; s=arc-20160816; b=lNA98gsBsUCTrX/R+m4eeOKMYZNRETEmXRw8mEKGkYHeGFlIa/JtF6RziidKzRBCG1 m/BMoUUleAnVpkve18LqKCKqY71PLMYGVwix/2xuxiXwq/iMpQWvxYPV4MqMK6aij498 Uquk+pu0nKIbSEDe/Zn2o0tP++mFN4vQDEAq7t9yggXf6Do+Li4KxqihqVxDb+ouOUb9 y05ROIcXIsh10Lh84LralUaRljmOcMUrx7PsU3XGH4AUwR5lAyqm+E8gOvNdQUWlUPje kKonGLTkBcIY7ZuixY6ozFXigGJxHY1sP7mNo8gTKquY4lAKe8chEJmE76D+5cR7q3Pa kMPA== 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=h5/e2dShRhrPuN83Klz5CaKwWsTmM+GWSIJfFdodYP4=; fh=eifuCktBRB00X4wy5JPPTIgqiZv2LVqlwvP3VHSb5to=; b=Qc1Co5bh0Z7Z1sYxeLDNfqZvJXtwFMAxe6fMoepUcqDAJgDSgo3LoZ23CsPfFO7nt0 oE8hs75Dh3sdfUQV7bYwvj90T+E9yHmYnw9ajI0skc+FlYonXXOo67Hz5GovW1cedqHD lZ3D1ZGA4Jjqd7Rm+z5yNyqfNKXyiPkR0UrZpr25SBxCHDpXmCphFmm2fwFPOZGasHJY pYTUeoGudezZEzzttpBochVS0qY9HJSpLbqLJyDcqfgmy8cLulKXXJ3aUdclWcv4jn5J Xr6KvWCklPSz770Xh1lfBoFUYBDYbqyAZB19x5Wn3MDhQpAU8ptY9ohaBQncvIF1BQKs 1wVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=bU3xHkUh; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-93476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93476-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 n8-20020a05640205c800b00567229ec651si3486841edx.316.2024.03.06.00.12.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 00:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93476-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=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=bU3xHkUh; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-93476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93476-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 392961F220BC for ; Wed, 6 Mar 2024 08:11:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CF125DF0A; Wed, 6 Mar 2024 08:11:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bU3xHkUh" 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 155565CDC9; Wed, 6 Mar 2024 08:11:00 +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=1709712665; cv=none; b=ZSK6VctwMNO5+YiCUaCI7AP5uQroUGgUlqJBVPd4yXjVrHQELppvna6U6VZxTGZpcjj2xngFecxYDgrcRQ5il/fqxOAz+sJXlcgzUE5IMEG0sOaDO2VHXwcYmsxuQ7uAIbjaYIVj1jbpDzwBqQVoB05MzLeLvfiTUGG1ZN9Hzfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709712665; c=relaxed/simple; bh=eGi/asiE2T7+c3wnXbY4y7w7m3h3dlY60L0/uI3eZV4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wii55ACH/6EtuO/zXan7OXGYHZs4SsNz8Dmzh8IjSeSy58uf7Ewu5yEucFEDh1HtO0SPimheKSDIHIti5bdSGsCdVNLT43QyRi9xL6cmNLqjsMfrVBCwkja7uHHMODrQYDUmQaT6/2DEMKgqTBw3d5XtUHomNfZwOsQHAG8nh7s= 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=bU3xHkUh; 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.70]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CB89AFAD; Wed, 6 Mar 2024 09:10:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1709712642; bh=eGi/asiE2T7+c3wnXbY4y7w7m3h3dlY60L0/uI3eZV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bU3xHkUh5Ce5AMZYe+761JpiwDI2oWM3wuA3h+SUzAImZLIiAqg6TWk1NSnhnggqb 8j6gk6SRI32cPcdXGuwHwotWmwmtPtQBr0RLSYMCHVabff8JBQwaFix+GOqZX02xTd ZMRNWxL1opE+bbaW9f7ExvL5aje86LTG5p117K8Q= From: Umang Jain To: linux-media@vger.kernel.org Cc: Alexander Shiyan , Kieran Bingham , Mauro Carvalho Chehab , Sakari Ailus , open list , Umang Jain Subject: [PATCH 2/5] media: imx335: Parse fwnode properties Date: Wed, 6 Mar 2024 13:40:35 +0530 Message-ID: <20240306081038.212412-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240306081038.212412-1-umang.jain@ideasonboard.com> References: <20240306081038.212412-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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index a42f48823515..7f3f74240cd0 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -1222,13 +1222,15 @@ 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; u64 pclk; s64 link_freq_in_use; u8 bpp; int ret; - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 7); + /* v4l2_fwnode_device_properties can add two more controls */ + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 9); if (ret) return ret; @@ -1313,6 +1315,15 @@ static int imx335_init_controls(struct imx335 *imx335) return ctrl_hdlr->error; } + ret = v4l2_fwnode_device_parse(imx335->dev, &props); + if (ret) + return ret; + + ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx335_ctrl_ops, + &props); + if (ret) + return ret; + imx335->sd.ctrl_handler = ctrl_hdlr; return 0; -- 2.43.0