Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1122739rdb; Sat, 18 Nov 2023 04:12:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWb3ZOfB8fDqhmLbnAoXBQ27bVzv0wTwDqhGKSNwp7JMl/HX6Hzysoql0Nv8C8vI/vUh1B X-Received: by 2002:a9d:5f0e:0:b0:6b9:b600:589 with SMTP id f14-20020a9d5f0e000000b006b9b6000589mr2127295oti.15.1700309563634; Sat, 18 Nov 2023 04:12:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700309563; cv=none; d=google.com; s=arc-20160816; b=Oi1C35JosDe+YVlGI7dSsQi1PLy4EfMqXm+lD1M++jJa1KWQZ6/brEqQkNiL5pj6dl 5hlw7TCtPOSholf6p23Bybun/QsrVv2hshBC/+vb4DMhCfJxqZWpS3zOAbR/btNa441g FlJq21Pp5avY4vzmNsJRETi7X5oQw2a743Kev46Z3PtURFV78n+KjimZ95oJq5zMvCTv l9H1TSr5nSab9af19VgUtDSDS0bhnqw72wbfBX4w/r4g21/QXKrg5+OGKUmuEtgZbdkm hJmCazxPb2/Zec3Foj4asbwjANcNyuI4pjb206zP4AZsJE2QOUc03dyc2ksIrvlP/HlW R20Q== 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 :dkim-signature; bh=X26+8wItEuS2j+BVlRHOHS9xadXwL+/+KykUmMySayM=; fh=+21+21gNft/7To99MfcGJu9QkWyyZ7J1aCqrKBAZjFw=; b=dOJ2iiFr9t1yMWvixN/+GVSb3pxVTmyUFMJ38rwPXZ3FYfOrjBx0v5HEur5xGa7RRd ddLUndVU+JTcK45k+QF8gLaN0TOcwdp4Dl+GF24iaDbD7cpA0PeSZNUJlVZBI3+2RXc+ jOF2xABg+NJ9tI/VLXLHiaNyBM7HDkIrFdsAcu/n3SzbD0blixZtcKkcSHW32CY/QqbF B88uoV7t23GQssROFMv5vhi7cNLkdZciuDcweoKjOypnpnOfklvMvf8zX7HJOljW9Hb/ M/Pi+cXDRFAdeKc5T2btBMAMns2eCdoSX3vZxOImoq1FkVphvg3xB4AA5uH18rKIwpWb puFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=es1AM+Lr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id f2-20020a631f02000000b005bd0728aeccsi3992481pgf.407.2023.11.18.04.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 04:12:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=es1AM+Lr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5989D81ADB65; Sat, 18 Nov 2023 04:12:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbjKRMLq (ORCPT + 99 others); Sat, 18 Nov 2023 07:11:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjKRMLp (ORCPT ); Sat, 18 Nov 2023 07:11:45 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4895D49 for ; Sat, 18 Nov 2023 04:11:41 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c5039d4e88so37538141fa.3 for ; Sat, 18 Nov 2023 04:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700309500; x=1700914300; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=X26+8wItEuS2j+BVlRHOHS9xadXwL+/+KykUmMySayM=; b=es1AM+Lr8lsvx7R3ir8M4EnRWiUMmYdHPzq5WwyvJbsaI1QMgzWjUAeeVSgPiWavRO +Xx8NwXYM4Exnev42GZgZ6g4htWMrjJhBnLd/5eMKre0OcLLmpfywwvjlY5A3PbzJlDS KXeTrCSkI0P3o+lJD6sV2XaODamkdGXdmXX9nEM9LACYYhKf6zd9ZvVtmX/ZAZauxztp fbdrnOZHd2OvdJ2LqFHapoGBR/zciETi5c/QVNqsYVaHVU/Lu8jw2AFEu8LwBldi1K+A +gC2T1WuBk6tvcb6wrAHoxiKSj2uA6QCqzFBFCWPR1h0d84Z3UxP7EdrqHZEz9LvByEd 3b3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700309500; x=1700914300; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X26+8wItEuS2j+BVlRHOHS9xadXwL+/+KykUmMySayM=; b=DtP8E1oiqT1ATdAbx3QHCm9U1guEEgnBLMPdxWN8GPcdYtrCwNPvegYTw+u4uLk1FQ 1oIn3fnPNMJ3RN426xRj6SVKox3J/qOphKJYS/gQ1/qRb+kafAP765l6WZdBX4fj06Md wQ5ZGT3Ph2SnLxDLVLQb7+BYI0hjKhk8UNbYlPn/kyRL/iqd0NHntQOuKbjK8Nl0AjK5 eYJhmequVnQ4WBO7DeTFFF8tYUcJ/qaX4du7kuhY+TmlAtT5beN2xmf9K218WdFqWGV3 IxQ+hFSHyN9hlu+DQyYuPttAxFjeMI9y4pqzhYyaQ9m+oqgN33q2bqBlwRRA2oh8SQ3w mjnA== X-Gm-Message-State: AOJu0YyZM7F21Pu5kXNXmKCz3HetbJPARdlhraeARsCHQbNBfne87lQ/ Ulr1oYIRG4RijRHBgouQO5r+xg== X-Received: by 2002:a2e:8042:0:b0:2c6:ef8d:b49d with SMTP id p2-20020a2e8042000000b002c6ef8db49dmr2054322ljg.24.1700309499891; Sat, 18 Nov 2023 04:11:39 -0800 (PST) Received: from [127.0.0.1] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id n18-20020a05600c3b9200b00407efbc4361sm10955775wms.9.2023.11.18.04.11.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 04:11:39 -0800 (PST) From: Bryan O'Donoghue Date: Sat, 18 Nov 2023 12:11:35 +0000 Subject: [PATCH v5 1/7] media: qcom: camss: Flag which VFEs require a power-domain MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231118-b4-camss-named-power-domains-v5-1-55eb0f35a30a@linaro.org> References: <20231118-b4-camss-named-power-domains-v5-0-55eb0f35a30a@linaro.org> In-Reply-To: <20231118-b4-camss-named-power-domains-v5-0-55eb0f35a30a@linaro.org> To: hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, Robert Foss , Todor Tomov , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , matti.lehtimaki@gmail.com, quic_grosikop@quicinc.com Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13-dev-26615 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Sat, 18 Nov 2023 04:12:29 -0800 (PST) At the moment we have some complex code for determining if a VFE requires a power-domain attachment. Particularly discordant in this scheme is the subtle reliance on VFE and VFE Lite declaration ordering in our resources. VFE id is used to determine if a VFE is lite or not and consequently if a VFE requires power-domain attachment. VFE Lite though is not a correct delineation between power-domain and non power-domain state since early SoCs have neither VFE Lite nor power-domains attached to VFEs. Introduce has_pd to the VFE resource structure to allow the CAMSS code to understand if it needs to try to attach a power-domain for a given VFE. As a side-effect from this we no longer need to care about VFE Lite or non-Lite or the id number associated with either and which order the VFE/VFE Lite was declared in. Reviewed-by: Konrad Dybcio Tested-by: Matti Lehtimäki Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss.c | 8 ++++++++ drivers/media/platform/qcom/camss/camss.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 8e78dd8d5961e..ed01a3ac7a38e 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -278,6 +278,7 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { .reg = { "vfe0" }, .interrupt = { "vfe0" }, .line_num = 3, + .has_pd = true, .ops = &vfe_ops_4_7 }, @@ -298,6 +299,7 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { .reg = { "vfe1" }, .interrupt = { "vfe1" }, .line_num = 3, + .has_pd = true, .ops = &vfe_ops_4_7 } }; @@ -468,6 +470,7 @@ static const struct camss_subdev_resources vfe_res_660[] = { .reg = { "vfe0" }, .interrupt = { "vfe0" }, .line_num = 3, + .has_pd = true, .ops = &vfe_ops_4_8 }, @@ -491,6 +494,7 @@ static const struct camss_subdev_resources vfe_res_660[] = { .reg = { "vfe1" }, .interrupt = { "vfe1" }, .line_num = 3, + .has_pd = true, .ops = &vfe_ops_4_8 } }; @@ -658,6 +662,7 @@ static const struct camss_subdev_resources vfe_res_845[] = { .reg = { "vfe0" }, .interrupt = { "vfe0" }, .line_num = 4, + .has_pd = true, .ops = &vfe_ops_170 }, @@ -680,6 +685,7 @@ static const struct camss_subdev_resources vfe_res_845[] = { .reg = { "vfe1" }, .interrupt = { "vfe1" }, .line_num = 4, + .has_pd = true, .ops = &vfe_ops_170 }, @@ -840,6 +846,7 @@ static const struct camss_subdev_resources vfe_res_8250[] = { .reg = { "vfe0" }, .interrupt = { "vfe0" }, .line_num = 3, + .has_pd = true, .ops = &vfe_ops_480 }, /* VFE1 */ @@ -860,6 +867,7 @@ static const struct camss_subdev_resources vfe_res_8250[] = { .reg = { "vfe1" }, .interrupt = { "vfe1" }, .line_num = 3, + .has_pd = true, .ops = &vfe_ops_480 }, /* VFE2 (lite) */ diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h index 8acad7321c09d..b854cff1774d4 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -49,6 +49,7 @@ struct camss_subdev_resources { char *reg[CAMSS_RES_MAX]; char *interrupt[CAMSS_RES_MAX]; u8 line_num; + bool has_pd; const void *ops; }; -- 2.42.0