Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1501099rda; Mon, 23 Oct 2023 14:49:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYu3XinrC2TEAOdgCnuIGcc9XSw8M8UsKMLt8eYHstgTo/gmvIQxE4Z7w4GDgkMD8embB+ X-Received: by 2002:a05:6a00:1389:b0:6bb:def8:b0a7 with SMTP id t9-20020a056a00138900b006bbdef8b0a7mr11955486pfg.3.1698097799479; Mon, 23 Oct 2023 14:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698097799; cv=none; d=google.com; s=arc-20160816; b=L8jOs+dRVnX4lQ4+gx+AkfBYH13CNYoGDPWrkNRJKctllRLUXi2nDcK9RyY88wvT+V GMkHMCtXgsFMXHuH5KggpDyB9EbblQznhUQaWl4D12+n6FCN1j4mHdCoZ38wXYsnnzl6 lmkK0A9h9sBM6lSj9kyfBy8qBd18yiruJvYlQGvh5zhxQWGBUARxCB2pGXrEihMSqM95 6x+ipnboX2w1r8PhjPI6xy4gZKViPSNMlQm+WyimiI5wbI57eCvvTbT/NZAbE90KN3zV kO3hCYPclv49WHleviVNxg4B6+a43g/oVw7W0X7H72gcD7FV7lXUYqBBcdOZCkxr/fzd fL5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=eRpkYQ1yWHzXIQiDaWA2X9B6aGOEDEmshNF9lUm8s1E=; fh=p+mi5Td8bOurAzEd8CdVTJhDRtapyUXUHLHoRH6vUVQ=; b=mJPUyOvoQLARC9Xs1uinVLhKwMMzMq4Z2HWfxJ4zoBJbY3IlcGzdFRzfpQLetkCFgn mTRQFFcdcccNEMJjZRaHIvEAEO+UW/WmBJSkK28MMonQYbPLMNUBoMR13awdVTYdoWPr M0Q7LntREXpZzcUUlyd2rBEG0kyFulneUmel9wMHsQqKGpNA64JlcxAVYPxoMmmQjcmD kaFpD4A6oRtsaHmTI4WsQjUiWux/lph14ve5ECelZPEqB+Tsjk0P2ZesMJJHFeKDuX2C uvMDf6ZP6mVZ+4Br1sHR6Bh0Omfrq8w7dTFm07amDrmaGGFGzyHVu5wYX+9pARHjn+zV dSyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u206-20020a6279d7000000b006ba82adb9acsi7199269pfc.332.2023.10.23.14.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 14:49:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 42E13809A790; Mon, 23 Oct 2023 14:49:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231352AbjJWVtf (ORCPT + 99 others); Mon, 23 Oct 2023 17:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjJWVte (ORCPT ); Mon, 23 Oct 2023 17:49:34 -0400 Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18E810C for ; Mon, 23 Oct 2023 14:49:32 -0700 (PDT) Received: from [92.206.139.21] (helo=note-book.lan) by smtprelay01.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qv2nh-0004Kz-0O; Mon, 23 Oct 2023 23:49:29 +0200 From: =?utf-8?q?Andr=C3=A9_Apitzsch?= Date: Mon, 23 Oct 2023 23:47:52 +0200 Subject: [PATCH 3/4] media: i2c: imx214: Read orientation and rotation from system firmware MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231023-imx214-v1-3-b33f1bbd1fcf@apitzsch.eu> References: <20231023-imx214-v1-0-b33f1bbd1fcf@apitzsch.eu> In-Reply-To: <20231023-imx214-v1-0-b33f1bbd1fcf@apitzsch.eu> To: Ricardo Ribalda , Sakari Ailus , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, =?utf-8?q?Andr=C3=A9_Apitzsch?= X-Mailer: b4 0.12.3 X-Df-Sender: YW5kcmVAYXBpdHpzY2guZXU= X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 14:49:51 -0700 (PDT) Obtain rotation and orientation information from system firmware and register the appropriate controls. Signed-off-by: André Apitzsch --- drivers/media/i2c/imx214.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index 554fc4733128..bef8dc36e2d0 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -704,9 +704,14 @@ static int imx214_ctrls_init(struct imx214 *imx214) .width = 1120, .height = 1120, }; + struct v4l2_fwnode_device_properties props; struct v4l2_ctrl_handler *ctrl_hdlr; int ret; + ret = v4l2_fwnode_device_parse(imx214->dev, &props); + if (ret < 0) + return ret; + ctrl_hdlr = &imx214->ctrls; ret = v4l2_ctrl_handler_init(&imx214->ctrls, 3); if (ret) @@ -746,6 +751,8 @@ static int imx214_ctrls_init(struct imx214 *imx214) V4L2_CID_UNIT_CELL_SIZE, v4l2_ctrl_ptr_create((void *)&unit_size)); + v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx214_ctrl_ops, &props); + ret = ctrl_hdlr->error; if (ret) { v4l2_ctrl_handler_free(ctrl_hdlr); -- 2.42.0