Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp152586rdb; Tue, 31 Oct 2023 03:53:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeVgXBeBR423w7++1slriAt1AIZgwcXqNQduwpD35ruxoavil6/nZycAU4/2m0KSmJSZwa X-Received: by 2002:a05:6a20:914a:b0:17d:b971:ebf0 with SMTP id x10-20020a056a20914a00b0017db971ebf0mr10985892pzc.53.1698749606608; Tue, 31 Oct 2023 03:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698749606; cv=none; d=google.com; s=arc-20160816; b=hYeZiHvN16bzCZPFLWom+j5gGX99aZLQw6H4hbbAESs6uRycCpk3Db7jT8ipEn9YyM weGpUTHuBiDGxXtOhFyZk7YJa0yMNXHgaaoZq0MKNTioQRxMKa8BIhB+9HzeHu6/Qyw5 EN2UmcKcgeJ82vZ8XlywSc+bslif5+RrUaZeM9p1bIguoj/QYFW9k66p04fSLDxYzslB +l0fGoqW21OPKnKRo60SL+UXx0wvo1LZhgAYIn2tV06o5EcqNjupfl+Zf6NpEp9vSM42 L3TtOSRgawUObm2iPnTrWdsct3x0/+UZyxGmZ4SqWoFBGLhZDqcD4b3iS4X++UYoZXlM wgtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=PZEtEH4BVMdZ/99eBNfi6obYrRNvQ11tTN1yHiXWSCY=; fh=7iotfooMA0j7FS1TJwLo8s7hKvS/VUhTpTp1pJHCixw=; b=cgo4NK5b4PPpTAg7w044oxKp/thEQqpVLAk+s69a6EbxT48Xk5KzEQtliZGCIGXcjF jzPGSeN9XyE1aXrLVwltq0ZvPgqDp0kh+6eMy2fpQrxxpAtyfXGOzCxsUwZGD51xTq2L cKHHa7aRV1EUHCKrKGvhNdIlsaXns/oBSPbKpDMYXv0/ZW/MPgiGmELGRlQyEUWKb/Sb fUv4H4frWUwpzz/A50iOpXDYFgmvf8aeWYcZMhuvYJSGvfUZ+OxMz4w4IxUqAnFvZtsf snGqnpo1fpJYnwWRhj/atS8S3fFXSot16AV5XuEB2wXL7ovg5e2suRuk6UpUoECrzhbz 6EaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tCQUs/CQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y15-20020a056a00180f00b006bd27e41c17si842456pfa.314.2023.10.31.03.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 03:53:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tCQUs/CQ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 9C2618031109; Tue, 31 Oct 2023 03:53:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343996AbjJaKxN (ORCPT + 99 others); Tue, 31 Oct 2023 06:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343983AbjJaKxM (ORCPT ); Tue, 31 Oct 2023 06:53:12 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8271CC1 for ; Tue, 31 Oct 2023 03:53:09 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2c523ac38fbso81018311fa.0 for ; Tue, 31 Oct 2023 03:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698749588; x=1699354388; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PZEtEH4BVMdZ/99eBNfi6obYrRNvQ11tTN1yHiXWSCY=; b=tCQUs/CQGX7qkZl7sK+pzKlRD4ZGlwLE3kpQZXv1T3liztiwAalv159qhT9vkG7ziF +VgtWAUACeNLw8rEp40q49lhFPEAWKH0xpGC1RudYamHcyHsOwbraI7Mqdz3NfvQiB0J RJfmFo4tox+R6zAsH3nkrP3RsHdfB/ZyrRfWzk3QH6k2K5vltKNo9rNFfOM4KTARmpd+ rxAisoiSLxSpJRhqiCER+hhQSUOPB6DgGfKjs4MBjizT9pWVsMRruQCK6hnkPz/xhnXu K8mQXI4vd36swduRJ2VbSoAnO7jqf2gKvmqoBKdl671uoa9InUX5WNLpzx5d0m8usIZG guFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698749588; x=1699354388; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PZEtEH4BVMdZ/99eBNfi6obYrRNvQ11tTN1yHiXWSCY=; b=EK6D6mV4T1VzH3oEp6/0KobSTcc0w2ZXP9UI/SRS/VzXG3yLyD8W5NzPNHYF37YzYr 8JtekBikunjXeo1TLbarTiCX+4YZX2ogo7Rl5Ee9kW/LMteC+Xw53CJ1ljI0q4beL2+N eaxOMLOpOyl6H8iReR60iLd2BRYbZ5nnoPgvw4cX/SzPj3IVjJDY4mSOOBVx9ysztx9w 2AvMcrmG6f9Xi9a7cr1rxshjTOT+c+7mG5s4NTcN/zTBvSwbwzYdYhskQrUJRpDQm4vw OIN6Si5iKM7DS3Agz+7EkhTzITkueRXipt1c8QJJYCg/HJQyAs5Nlds79k++R7LEcSVu zpCA== X-Gm-Message-State: AOJu0Yy172iadysUHeRrYC5fF4100BvjYVnW0L9KIO2fDPnUM+JCovc6 7zTadtaqp9f3RGPZJCQRkishYA== X-Received: by 2002:a2e:2c11:0:b0:2c5:1e3f:7379 with SMTP id s17-20020a2e2c11000000b002c51e3f7379mr9581736ljs.48.1698749587617; Tue, 31 Oct 2023 03:53:07 -0700 (PDT) Received: from [192.168.143.96] (178235177091.dynamic-4-waw-k-1-1-0.vectranet.pl. [178.235.177.91]) by smtp.gmail.com with ESMTPSA id x12-20020a2ea98c000000b002c0055834b3sm160671ljq.4.2023.10.31.03.53.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Oct 2023 03:53:07 -0700 (PDT) Message-ID: Date: Tue, 31 Oct 2023 11:53:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] media: qcom: camss: Add support for named power-domains Content-Language: en-US To: Bryan O'Donoghue , hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, rfoss@kernel.org, todor.too@gmail.com, andersson@kernel.org, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231026155042.551731-1-bryan.odonoghue@linaro.org> <20231026155042.551731-6-bryan.odonoghue@linaro.org> From: Konrad Dybcio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5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <20231026155042.551731-6-bryan.odonoghue@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 03:53:23 -0700 (PDT) On 26.10.2023 17:50, Bryan O'Donoghue wrote: > Right now we use fixed indexes to assign power-domains, with a > requirement for the TOP GDSC to come last in the list. > > Adding support for named power-domains means the declaration in the dtsi > can come in any order. > > After this change we continue to support the old indexing - if a SoC > resource declration or the in-use dtb doesn't declare power-domain names > we fall back to the default legacy indexing. > > From this point on though new SoC additions should contain named > power-domains, eventually we will drop support for legacy indexing. > > Signed-off-by: Bryan O'Donoghue > --- > drivers/media/platform/qcom/camss/camss-vfe.c | 24 ++++++++++++++++- > drivers/media/platform/qcom/camss/camss.c | 26 +++++++++++++++---- > drivers/media/platform/qcom/camss/camss.h | 2 ++ > 3 files changed, 46 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c > index ebd5da6ad3f2f..cb48723efd8a0 100644 > --- a/drivers/media/platform/qcom/camss/camss-vfe.c > +++ b/drivers/media/platform/qcom/camss/camss-vfe.c > @@ -1381,7 +1381,29 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, > if (!res->line_num) > return -EINVAL; > > - if (res->has_pd) { > + /* Power domain */ Unnecessary, I think > + > + if (res->pd_name) { No need to nullcheck, dev_pm_domain_attach_by_name seems to return NULL when the name is NULL [...] > - if (IS_ERR(camss->genpd)) { > + if (camss->res->pd_name) { ditto > + camss->genpd = dev_pm_domain_attach_by_name(camss->dev, > + camss->res->pd_name); > + if (IS_ERR(camss->genpd)) { > + ret = PTR_ERR(camss->genpd); > + goto fail_pm; > + } > + } > + Looks good otherwise, I think Konrad