From patchwork Wed Nov 1 10:54:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 13442768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C023C41535 for ; Wed, 1 Nov 2023 10:55:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232058AbjKAKze (ORCPT ); Wed, 1 Nov 2023 06:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjKAKzc (ORCPT ); Wed, 1 Nov 2023 06:55:32 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BFEB122 for ; Wed, 1 Nov 2023 03:55:26 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32f8441dfb5so2255928f8f.0 for ; Wed, 01 Nov 2023 03:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698836124; x=1699440924; 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=NvP0vvsp5vu5AYTnNQV4NonQsJ7RGcpCDrLUFWm9/JI=; b=bTuwdaQiMzxqHcclom9+uyNS1qAUeKW/yw+o1VvskkpSAcZ8zVmnhoF6ae77SryQpy 6xgeYWvx/c1lK469dEdj7Y+4aiYOdqlYEM6HgJldJYLJa6hGS+gvnp6VUcmCnG8j+pTr pTZusntJf16BhpjA2ocizJmT0FnkjOqhAPcu6PiCfNd3oebOfxTTDSiDkr2snhKCbIRX CzZqE7IPR0Vm7PJlWS6A8DnFuRLzh83eE6qjNfTbFLvK43GP4dsvhvTleCp6W10Vcxf6 rMYtPRQQardHjoDk+Hlr/egb34DIv43EM+kvR3t03w2RGTcSWMH57Oa6DrQ0fo0NAH4m uK2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698836124; x=1699440924; 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=NvP0vvsp5vu5AYTnNQV4NonQsJ7RGcpCDrLUFWm9/JI=; b=cvPbFjvMnK2w+wMn3ri9ceI6OdSj00Xs1MQDHNrPicqtcL+iaqTRFdLp+YzJSD94xj u6ygLZH4q85n1rQ0AKs4Jy6t0jDA9P2WpNMwGXGQE07B5jI9kqzWjbbq2MlS50aWZcFt ZH/1Q9oqsVQy4XcUvSAudvjcDLBmP14KtJBvoGdL7ErKUn9ZEWZ6pJ7sWT9/ND5l/hT4 oZvbxUM5g5oHva8yWxOMMkcyirK0BCM89PNPOCuMDDseXiXhWJi6NIn6w/UydiptLnfc RPfnw3wNospknHXpg+7NK82E9gbeXxfdARSpHjJCvn9nV82/7c01S/sUGanBT4sTK1Tp fGRw== X-Gm-Message-State: AOJu0YyELZ+HrQs8NkIV36BRJbbUxJWvgnVbmpokHuc6bdtSEbj9o28b 7E2TlgvTTZ9E10Z8njwGfRuTMQ== X-Google-Smtp-Source: AGHT+IFSRbBxcNnjAq2cV+V/pQOnMDVgssk/vTU72guiiokURwPww5ATyECZ5j3WmIv7PwjB9plPzA== X-Received: by 2002:a05:6000:1445:b0:32f:7a07:be0d with SMTP id v5-20020a056000144500b0032f7a07be0dmr12823221wrx.59.1698836124662; Wed, 01 Nov 2023 03:55:24 -0700 (PDT) Received: from [127.0.0.1] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id z2-20020a5d6542000000b0032d09f7a713sm3830948wrv.18.2023.11.01.03.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 03:55:23 -0700 (PDT) From: Bryan O'Donoghue Date: Wed, 01 Nov 2023 10:54:31 +0000 Subject: [PATCH v3 1/5] media: qcom: camss: Flag which VFEs require a power-domain MIME-Version: 1.0 Message-Id: <20231101-b4-camss-named-power-domains-v3-1-bbdf5f22462a@linaro.org> References: <20231101-b4-camss-named-power-domains-v3-0-bbdf5f22462a@linaro.org> In-Reply-To: <20231101-b4-camss-named-power-domains-v3-0-bbdf5f22462a@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 Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13-dev-26615 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 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; };