Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp439291rdf; Fri, 3 Nov 2023 05:29:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdftPysO7IlWxZEVsSv6A3cK3ycdJj9ZfRge8BbboFi7paQuS+eHfwK17FhxgAVSrDJaD3 X-Received: by 2002:a17:903:1c5:b0:1cc:66d5:493e with SMTP id e5-20020a17090301c500b001cc66d5493emr13924053plh.8.1699014559503; Fri, 03 Nov 2023 05:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699014559; cv=none; d=google.com; s=arc-20160816; b=Tuxxf0FElJcL6Kg47iIJcuVa3d+VW0FI5ALbNT0/UZVRe1EAwPjvHzCSwkvdOJ81HB XQAnK3dqn+9K1Q/udZiWYAfR6ePHzCtUSiJyCq+xZ8QsbB4bFa6TWun1YpOEBS5Zud5K ifXvlWNiifqESRLuFULhbT5zdsbniypKvkRYhWrpc8HtZv/WmzihNhNcZKJiBTlLmMX/ q4uSD+SF+9RorSSHlc8lkFc593hFlbJZV4BnYhoBs94nLxIQbN/WZLiZeVu4PdO8vuYr mIloHiSVAqp62ERTJuVyz6t0BdjXKhSXIyBUl6YiJGJq++VI+it0o4EyfXDmam3KdUl2 55lA== 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=zTYEqLLNmR1N4okYeqWn6wyTkma1n9rDOnlFsmpgOkyWJ8WFZjE8qolYlsOBZCF0uc BdDO1I14m062wWMxR3I9WrrJjt8ZLKL/wjfidp8GlW+1RLn34IIQyNuaMxRolS5cMtHW fkGelSAYNoqtUvHz2IOq1HuJl/okmmJQ5wVdL/q+9jbSrPgm/C3zRjgmBijeKBeYPLtS 65WweHrJIdfIY36NXhPJkHwnTZhpHWARhuucFNJXy2rvc6/I+C6jsYZncBJ9egq2q0/H toEXqqnFBPnOj8cUaGcnWCLtXAAUWfXOkATrmF9JPBPTCFyxAzlUkcr9Ea2CroXiOMUc NjUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wmqclJiT; 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 q7-20020a17090311c700b001c737e1d3bfsi1487755plh.237.2023.11.03.05.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 05:29:19 -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=wmqclJiT; 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 75FB581373DE; Fri, 3 Nov 2023 05:29:18 -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 S1376499AbjKCM3M (ORCPT + 99 others); Fri, 3 Nov 2023 08:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376451AbjKCM3K (ORCPT ); Fri, 3 Nov 2023 08:29:10 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F3071A8 for ; Fri, 3 Nov 2023 05:29:04 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4084095722aso14909135e9.1 for ; Fri, 03 Nov 2023 05:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699014542; x=1699619342; 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=wmqclJiT8CLQsS9V4QC1RDHpyFRE7DxyW8ZLCFGauC19Tx1IZVF1btplKs05NM2jkW CjsnNuXkTB+6MPrKaXxjbODfjV2ylm9sIJZFlGuiqR9xr2wGaxc+sNkbdSGhCKLtPuXg aVTk02X5DnW8QP+2FGf7gBheicXTmprreKibot7hbEv3dAhg0cPPZXQ6lrma9NhxLxer MTiT1H2EffbouwRXztSQ7Nqw1LtY3s6TgZYRXR6Tu4VfoKtrboVjAaCh+h8wUUycURhh 2h8nSuo1KSXVcxacDOaxJ0hfCbEqUKStrm4ZXJYUcapJfPNh+x7EnZx+B5NW/k/huTQC EBEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699014542; x=1699619342; 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=Wibv9MUr35BlSmjn4enwiJTvtsURuCv1UqRr/Hl17Y95fpha31IrD/jXodDYglYSwN SeJjsl85HXJNBYCbnmxRNFRojEOkBOqUaXprYgfYn2YMBE+S40I3wtA6aZZht1BGwFnt c+TCZb6gmTC7twFm+lcurXi0OUVds/picDzoip2+TLzZF3sD5yJuFvSLZMaJ/YqxIzJU yeVJw3+90YrL45ybT8nv5HcYbAHs7KROi7Ic3fCLYjQD6hRRVkud9TQ4cC3tEMwSJJIF h31d7lnKxmwRH8x/1XZScEUNHj74NpLvVYSumto7HJdvAtEY/2BNKdOO8ihDvDIFbUtX qk3g== X-Gm-Message-State: AOJu0YwhyBTOo6ep+HQCZs8tp5UKqtntWmHd2g1LhiU/KWHYfsod9r0m P/Im5k9tvasuCoIEBsvomgS0zA== X-Received: by 2002:a05:600c:d8:b0:409:718b:33e0 with SMTP id u24-20020a05600c00d800b00409718b33e0mr1183300wmm.16.1699014542297; Fri, 03 Nov 2023 05:29:02 -0700 (PDT) Received: from [127.0.0.1] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b0040772138bb7sm2402918wmb.2.2023.11.03.05.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 05:29:01 -0700 (PDT) From: Bryan O'Donoghue Date: Fri, 03 Nov 2023 12:28:58 +0000 Subject: [PATCH v4 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: <20231103-b4-camss-named-power-domains-v4-1-33a905359dbc@linaro.org> References: <20231103-b4-camss-named-power-domains-v4-0-33a905359dbc@linaro.org> In-Reply-To: <20231103-b4-camss-named-power-domains-v4-0-33a905359dbc@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=-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,T_SCC_BODY_TEXT_LINE autolearn=ham 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]); Fri, 03 Nov 2023 05:29:18 -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. 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