Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp537969rdh; Thu, 26 Oct 2023 08:51:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGSHoJUf8UMVMUfOe3DyiZaTeGJTPzfmLCNaDviXJSpd2Lg3D1U8/YZTQLJKm3JceyPES0x X-Received: by 2002:a05:6871:4090:b0:1ea:7002:494d with SMTP id kz16-20020a056871409000b001ea7002494dmr21638412oab.46.1698335465550; Thu, 26 Oct 2023 08:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698335465; cv=none; d=google.com; s=arc-20160816; b=nE5SzTVANaGt/wJd+Z1jF2kDVtwAAPkdR3SDPnI1Cb53w5qpQhBtE4rN7qjSAYKmdN fNz7r9nwbob//zGzNjKVHAkGrgottjVXEhJFgM55Z6h+rFhwKLnn+uR0jtcCJ7amlYLq 2/Qgd/AgZpna2+6HZsnRAr6L6JyYw0Qh0Nrzi/Ny1ABbvXlNf3Ux4544poIcO/aLreF0 2cOjFx0di2unQulgbPXzzwf3iMj/8AAV2EcabiOAfCI+w6FGFx7FOP0HhyeOuFo3dwnH 0umX9W36olTTYI5pBv4lb5VEYZiO6DmXhA3Y81xCCknfPpMTWHhcNinCkt6vjN9XVw2X tiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I4eTVZcrGQlOPNYTx/N/Kit5wvfICmRRRsyBtCJrWm8=; fh=EDIpuMICZLR0WVxMad9x0w3NcC1c7tvexkVv5l4gf40=; b=zsfyBllsCj77/cN4pQX/qV1Y1dZs7qaRWswWNC1YlfERpfUuddrQ4/+KSguq08ueIy 83TW3keflzCPXeoh9qXnOYgSYxFzQEEe95i2z9vztYUArD4yJqqj7pyP2G9BkVseEEgh 9L6r/wjNr293JwjSSO2xBYNAYNPXCm76LkKBf2x9yLH2N+XCYf/Lh0H7vdaTlYfVt2BK l551JQqGGPgYyoittmno8cEzJGMKeeRHXQMw2TCMhFGff3SeIqFvo0EMRpGqHuu2aihE qYPJml47Hqpw0BEhHypPWtNpfWeIUTdoxzCzZa3H1L0aLMdGy/t36sUaEwrsIVjvWZZK udTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xj6EAYZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e72-20020a25694b000000b00da06203c706si6420705ybc.318.2023.10.26.08.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 08:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xj6EAYZX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 25E2C8217EE7; Thu, 26 Oct 2023 08:51:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345511AbjJZPu4 (ORCPT + 99 others); Thu, 26 Oct 2023 11:50:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345487AbjJZPuv (ORCPT ); Thu, 26 Oct 2023 11:50:51 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B1F1AA for ; Thu, 26 Oct 2023 08:50:48 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507cee17b00so1560447e87.2 for ; Thu, 26 Oct 2023 08:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698335446; x=1698940246; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I4eTVZcrGQlOPNYTx/N/Kit5wvfICmRRRsyBtCJrWm8=; b=Xj6EAYZXmi5cT5Kx6cgnF6v2izByFzNGMYFGIYmNeMidy9MesNJv50iH4JWu8t3yTk IQJUoLICAxHqtvKvgVnmOC8ZEXS8PrVashDS2mq6Qk4l4nSh4hC5jKf5F9AeMX1b0wdg l5Pgs3a++tJb0yix+jSmeSRcuwFIrGE31YfpEx0kL4ChMI5xQil/glIekgyD5j0qhiya Lh9sSgRCSXyUcGuHZWTlamLe024JZzJhD/MDLiQa1mS0G4RAhu/L4d6TwFhIptozNhIO Jk/qZKvMKeGUmTFRYfjZD3Yojc+JOr0416l3NL3QwSPZ71BVIvN2pvgQwWtySEBQlYpR MoAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698335447; x=1698940247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I4eTVZcrGQlOPNYTx/N/Kit5wvfICmRRRsyBtCJrWm8=; b=UR8Cdhk36RK/IIBgsuyCVDL29FZaJKQ864Ya9T4xGWmoeiL/AnidT0Ams7fmlTLPq2 R8fQSbRuJ/rdccLQRnctsjS8jbZtLf/V0xdBX1ktO/YIuoKG8szoHr557Rq6P8mPhDMC 3bFw86vBRyP/tKL9byZleuy4qtcr2wbkNmuv1qXAQPCcA1pWstFG7N6wYDE0jhNLF3hD 1iOHbwar9Q3s9QqdJNSibMkU6dt6uOIpGI0fqGvX4Do1no4W8JCI9XUSA+9MUT4A7U9P apODbL8sH2EacejYVXlkK+zL6NbD2Vs/DI6hjJRCzsiQS8ddQG35dQI/qdt89ci+80nX VNnQ== X-Gm-Message-State: AOJu0Yxj0yyTDemkS1DTEEw9WJt2OT/4BvarUrxqrtyU0IorE8JqMD8H QAG9RS5ohqA3V2VNAr19mcmE2w== X-Received: by 2002:a05:6512:3da8:b0:508:11c3:c8d9 with SMTP id k40-20020a0565123da800b0050811c3c8d9mr6637976lfv.52.1698335446670; Thu, 26 Oct 2023 08:50:46 -0700 (PDT) Received: from sagittarius-a.nxsw.local ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id m28-20020a05600c3b1c00b003feae747ff2sm2938289wms.35.2023.10.26.08.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 08:50:46 -0700 (PDT) From: Bryan O'Donoghue To: hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, rfoss@kernel.org, todor.too@gmail.com, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, bryan.odonoghue@linaro.org Subject: [PATCH v2 1/5] media: qcom: camss: Flag which VFEs require a power-domain Date: Thu, 26 Oct 2023 16:50:38 +0100 Message-ID: <20231026155042.551731-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026155042.551731-1-bryan.odonoghue@linaro.org> References: <20231026155042.551731-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 26 Oct 2023 08:51:03 -0700 (PDT) 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. Add the flag and populate the resources. Subsequent patches will disjunct on the bool. 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