Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp406959lqc; Fri, 8 Mar 2024 00:34:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVq3WlewoyrDc86DAnGAHMKJwG6On2io4oWvLNSEYNIoayWhUtUBqp6+MzCHW8+o+xH2ilJbUh8wMWQoOnMKlBdbJE8p8f3hz6gfMBnGw== X-Google-Smtp-Source: AGHT+IGHxwgrmLr8FrZhL2jr6Bgaa6Y8NSwVAlN4RO24Gcr7bxLlUudUjHsCjR7ef2Ooh3qs0Br2 X-Received: by 2002:a05:6e02:9a:b0:366:1d2e:2fce with SMTP id bc26-20020a056e02009a00b003661d2e2fcemr2486876ilb.6.1709886892178; Fri, 08 Mar 2024 00:34:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709886892; cv=pass; d=google.com; s=arc-20160816; b=eNIiw8rswbbwvj12Lmu7ZusAM8vUQ5Eg4yoasRakOYxFhM876ZzT3/IzOwhSyOi5Ra JOaFSFv32shjokVpEhCub0L6IVE7rNpIzIzfcZjMIzTmaZlocfU7rKA1Zl5lpoxChLXS NLnYki+8JCf+28BpwvFfPJHM5Yn/RPN5muFKrtuBxiDAFDRC9xzIrq2vOW/uKk+8Q543 pG5y5TPKKAaX+x3MvkNGq8QKVwzMg2YaWLbxH/oLSktejB+Am/tZQB+tuy13Es7xKcrK +5F6DrmkTVLzkf8jW1l15+gerAjegUe8OTPGQ24H4eqqu3Z6H/kxmVLnz5ZRNvzvhVLj x/Ww== 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=LewMhFPYGytunbotJzB5y66UTxwk/yeiZUaoyo+c/aM=; fh=oMnFP44GZn5KSs5vtdAIvSX6p76oFoh48gPvpU1naKQ=; b=mv2nO255v3ruRbmKOAlDjmvgHcVzyqfPApJ6A0WaB7qjVtzNirpw6vDfgMBByhJovj 9XjnuA8I7BqlWkvl6ITo2rYKYk2/pAhaTgYsra/n4s1DR+N/6zFolpQsiQWFxdStpUlO lbiroEoIgCoOJFxxVFgVGLRgoKAajTInrErNQzA2N78GhVPU+htpvs/A2U4sE+NfEAnm Y05kH65Xx71etHnzwOo5/DHygpaVPBNqWx3BeQ/SxoBrxFuHtzSvGaEHsZpmjW5O1jHf AY3lZ0sRuh7u76v6GdYNYPYdgbgR+qF3xTgCKOwNe/c8RH8/W1g4d72/ctFH23oKjE02 nfLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="SN/7T8jv"; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-96656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96656-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id o20-20020a637e54000000b005dc4e366f46si15576965pgn.127.2024.03.08.00.34.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 00:34:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="SN/7T8jv"; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-96656-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96656-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F135CB235C9 for ; Fri, 8 Mar 2024 08:34:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7636352F6D; Fri, 8 Mar 2024 08:33:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SN/7T8jv" 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 DEC9037171; Fri, 8 Mar 2024 08:33:29 +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=1709886811; cv=none; b=Qucr4BiAfHFQOfdAvPUS9+O1LVP9W6UgZ/ooYGdeXJF5GGxiUMR2AAO1BKuJ3OQ+4+G0/9qH6+Rn4It9wrpNLcMDjqRNCpO//Z1v1DbjhanYv8i1FosH6J2JfoUkDOLNejV57P8H5KfL0uYJoyAcfMi2Vnh0qF5R1aWSqsjHfUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709886811; c=relaxed/simple; bh=QAcCvi/VWLJ9KXWFVAp95ifhx0kCqdkYbogSkEAjqxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j+ZV1SHfsHg9LHmvOQEpRtUpmM+KKcoepDSgJTxgSwPDbVtX53Ad71mu7hNlUkvIfAMlYlkariMovR785HHggyRolzuDv8rALofzmo6TI4qizDSF8egVvi4BzgGMxgOK2gaPDygU7wzrEULweKCCi4FHB+tymlKmZW/nOmhT55E= 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=SN/7T8jv; 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 48CC282A; Fri, 8 Mar 2024 09:33:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1709886789; bh=QAcCvi/VWLJ9KXWFVAp95ifhx0kCqdkYbogSkEAjqxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SN/7T8jvQD7+hyWNpkwxQfTCj1IcpshESwl0TBSUe966HhJzSFkQ0H6lLY1RHPzvq 8ZTPrOJzNbpuLERuhMYrEvSTS6dCsJ93ofPa1kfgvK8lhgWIWkq8hFjPuUjTurdV+f SiN2dqyCMAApp9zy5K69myY7kbS/Zj67cALPe32E= From: Umang Jain To: linux-media@vger.kernel.org Cc: Alexander Shiyan , Kieran Bingham , Sakari Ailus , open list , Dave Stevenson , Umang Jain Subject: [PATCH v2 2/6] media: imx335: Parse fwnode properties Date: Fri, 8 Mar 2024 14:03:08 +0530 Message-ID: <20240308083312.90279-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240308083312.90279-1-umang.jain@ideasonboard.com> References: <20240308083312.90279-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 7162b0a3cef3..819ab3a6c5fc 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -1225,10 +1225,12 @@ 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); + /* v4l2_fwnode_device_properties can add two more controls */ + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 9); if (ret) return ret; @@ -1300,6 +1302,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