From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF543429CCC for ; Fri, 17 Jul 2026 14:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784298030; cv=none; b=e5NBmjhKdi5PtOMLWMken7GbR/ZhO9gPzxJoO9PrLmw+iujWucdpSfiA8XzgwfIllJY7n1FQHhdPnhgOhoUUNwnz9YcCZix+RC4hWs1fjbPT8lnpDpy0pLUrJkL+sjgNzpQg9B2GRM5MUpXPZSaNLb6dLwOwAHnTkDSrBFKiP0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784298030; c=relaxed/simple; bh=7LLEImUmKPo7SrHc26UeJn3JRceGlHaMvwT2HiiujVE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pqL0tFPTXSy7RKCcvZugJFiaoJtXgh1Ta/9XKBwnSeAoy4pkEvMWBLZ1OpNhOkaEG2fm1beZGUOvzcoWUf5kLNbDN1fqsJCnS6jy68Rux1OtNHsfDkKW2sQ5J8TjJpDTXvbgR8vLknxo2ZehvTfd2n6TP0bWfiJHPiyrSJ3ivi0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=LQqz+zEN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=h9M651Wf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="LQqz+zEN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="h9M651Wf" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66HE7qeL1875184 for ; Fri, 17 Jul 2026 14:20:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= c04Q9myq+d/MYa7ft3VRmwYFh54ZKESQ0C1fHms6BKU=; b=LQqz+zEN9Mu0LN6M j+oZ4ymN9I145FJgcg3C9bf44RcQLM1wJuVVvQIVxEAeZqbp5HhUHxgUa4BreMf1 8KaJ06eHycqFNNy/XuHWidbcRAmFGOgnSVcnzk8qpIsydreaw2cpjiX5yEAqmXNJ 1/lRbBGfxx6EawlYsT+YD2NTb6ZhEzFNH+fG2UsUPJglsb0n1pAaCMrVH2T7m07i MVJHYPOsxuQm5KXVRnI1ODym7vR+myB1WYOiQvNLQ/Cb/p/JkTxOt6pOw+1vaqmX Ig2Jff5QYZ0Iux5E6ZTBPTusTJZTPmQ8nssbf/PqnNBJsvsRj7n68qlgFDNzx8+2 I+yyeQ== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fff9p9q2v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 17 Jul 2026 14:20:26 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c1d7886cdso20533481cf.1 for ; Fri, 17 Jul 2026 07:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784298026; x=1784902826; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=c04Q9myq+d/MYa7ft3VRmwYFh54ZKESQ0C1fHms6BKU=; b=h9M651WfVk5wY51ZeNeQFzcQ0JU9D/hZaq4VSD8L8Tu+Yh5YDv1FJMCF/dy3GCaKG7 Ji0gqYPZfD96VE/N0V9eHzdMbleF/KQ+gU5Io0+5NTmvY9WsylJ6GRX0HzU+qb4ehvlp B4HceXVm9RLrfJOv88EwTPC1qeEOX/UEqE9LobLKB4UQZYejZAgcyqOK4lGiDZfS9wGG Kx4TQFbdFEi8t2BgoKQ/mBh+uH1F9dwYJctsC54U+pQ2WM+aPZrJXGE1TkpAM5GS/v+F qtmKVolx9Y/utpzhpEWXrujIgaA0EWCfO64bC7n+XMcNseORl6DXPvWcTYsqwe/5txsx 0asg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784298026; x=1784902826; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=c04Q9myq+d/MYa7ft3VRmwYFh54ZKESQ0C1fHms6BKU=; b=RBHxvYFSQZoIwEsmv7Q9XoUr6Hl5HIBspYXrw4yxbQcH8A698valBYDBTMGUlZ+VrA d4DJiLbuAUEZUBI9W2lLgr7DDhFv3aWcIl8fYF5de6fh9SBvoL0JQzL1jrqaHvMZiox4 SS4dqiNd92pzG2vOkyVixItDNAUC+QJHYh2OzvLMa7j6rZRdiAUTZXjaTDfiSPAH2Agk nZcZVfu8ISdVoqjNigeAqXdpEiu6lx0DCC7n83MtDuF4lpFblk7l2eRWEMb8VOjmgJK/ y7S8iacArA+4uQzaWV7vo3UiMxlgBdG/EmkVemO4q81Ula44XMdBRk0DLEzq/eJK0NKn 6WhA== X-Forwarded-Encrypted: i=1; AHgh+Rq4hCi7z+rucaF3B28eH+ZZUk9esIJDOIn2x4jxHyU1RYdGYtQuBuxrV/6Jx/VBbAA85ryhdNWwBKxDxnk=@vger.kernel.org X-Gm-Message-State: AOJu0YwExRzkNL48TgyFYZgXofyC6M87KrxRuD8faWjQDczL/voRNiBn DK2JJW6mCRxg9kYB45gh/rqrhtU09fsdO7P9gcPnDcohPphn7Wbq1fL+pPFsc01SLvIuJPubWaB KYT5uEHq9wukrfN7xuAL3nzvg+XSy5/K5SXtZ0gk8CJieteI/6hXcecMf1pB26jcCfOs= X-Gm-Gg: AfdE7ckSorSuEaSRPVMC1Hi/qFSe/nPSFSLAUcpws3qykQpzjlqqaGR/9pwzt/eZhp4 xrd/LGHUDM6GERIZ8k3GWGWQ1K2vI7pOhw/ppQuSIlAWIwzY61IC23vGHuy+dD0O6gQpeX2HU2p R68/Exy9GjlVYl4TtiPmKe6lvfRkqu4UkO8xwD1qZlV7k8h1iCA++uEXmLUUCJm2eJGrkzEDEyW o1mnGNcQlQeSMEhLZW7qmKBK3oimMTjCjtouNuquWQAwRuE7c7yjwR0Pj6fRibwAVqSQ0qcITpt 9JyUXZUHWbgbP+AUF1hd0WVWcjHcOs1yv0zWV8e+BMFbOvVNiuvJ2JtFvPrBoklXnMRMFbX2pFs QvU6rGnKK3/SZlYqjCr8KhmcpKcz4z8GrBFTwNl6r0RzNBO4TJNYGw69H6N7/z0HFrJF7JlsX+N uZAW+Ubfllg3vMyqtWTVtcsf94BndkGi3ZCHDyKXY9tLOyNzGHIDs= X-Received: by 2002:ac8:5e46:0:b0:51c:217f:518 with SMTP id d75a77b69052e-5213a38435amr27878391cf.6.1784298025811; Fri, 17 Jul 2026 07:20:25 -0700 (PDT) X-Received: by 2002:ac8:5e46:0:b0:51c:217f:518 with SMTP id d75a77b69052e-5213a38435amr27877851cf.6.1784298025251; Fri, 17 Jul 2026 07:20:25 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:751c:d61c:c91:60dd]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1740bf91bdsm79085966b.63.2026.07.17.07.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 07:20:24 -0700 (PDT) From: Loic Poulain Date: Fri, 17 Jul 2026 16:20:20 +0200 Subject: [PATCH 1/4] media: qcom: camss: Add PM clock support and integrate with runtime PM Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260717-camss-version-v1-1-7ed71fea95e8@oss.qualcomm.com> References: <20260717-camss-version-v1-0-7ed71fea95e8@oss.qualcomm.com> In-Reply-To: <20260717-camss-version-v1-0-7ed71fea95e8@oss.qualcomm.com> To: Bryan O'Donoghue , Vladimir Zapolskiy , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Loic Poulain X-Mailer: b4 0.14.2 X-Proofpoint-GUID: R2F7h763L-S71l-CAVs_bpCvcQl2fuOd X-Proofpoint-ORIG-GUID: R2F7h763L-S71l-CAVs_bpCvcQl2fuOd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE3MDE0NiBTYWx0ZWRfX9RBU5mJ4xNr4 EfiQtA9NSk4IDG+lwy9Ex+wqnU7K5lmpzrPuGiOtTmJAGYsxJZs83Sn6xZavbhJwWd6QwpW9OWF Wij2RDqvNVYZl8gObWZ6B4zyCgApganW1ZXvFDeh+Gl9s/rFZ7J9O0Mig3eE9Kje3jAI+jBO37W 87MUREVTCUFKe7hyPtHcom8r4NKKc31KjSEYuM2Qh0XWGo3hgx2j86WSrh0zZjBpt8z+hGXq6Lr m8LFX1lpqpAdJE+qiqyCNYPxzpw3Yk9/hHHiXJkYN8M1z8H/oesBYgawGM9G2KvfA7gBqP8DkG8 aNb1w691uAhHJ/VNDV3QK/+Dzm3+GemM4yghOq3WVo4J3D7KASYwZGae4qLjfZVcN1Nl9S5D19P s1WR6an3a4xTiISKIlV6FV4WEqXjOdexqfSoYkUiKpePzncGi97/3U8ImnHmn/U4lqSEOI4muXC uCp+ZQkGfemxfMqE1Cw== X-Authority-Analysis: v=2.4 cv=TaqmcxQh c=1 sm=1 tr=0 ts=6a5a3a2a cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=BAJ2-saCjKdBVCgQpPYA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE3MDE0NiBTYWx0ZWRfX16/f2E8okk5A ALCsV31ECuVXxl0TyU0nHltd+Ess7xI1ujcIzKdYxoatAv9tpf2pn7W2/XLKPsQiva6C9QlUN3o bkgtH3zRIAeNJxLU1FwHxuoxjhhmEMM= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-17_04,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 spamscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607170146 Add optional PM clock support to the CAMSS driver using the PM clock framework. This allows CAMSS clocks to be registered once and automatically managed during runtime suspend and resume. This is especially useful for global CAMSS clocks that are shared across multiple CAMSS subblocks. This avoids the need for each subblock to reference and manage the shared clocks individually. A typical example is the set of clocks in the top_group, which may be used by CSID, PHY, CCI, and other CAMSS blocks. Introduce a small PM clock descriptor table in the CAMSS resources structure to describe clocks and their optional rates. Initialize these clocks at probe time and delegate clock ownership to the PM core. Hook PM clock handling into the runtime PM callbacks to ensure clocks are properly suspended and resumed alongside power domains and ICC paths. Signed-off-by: Loic Poulain --- drivers/media/platform/qcom/camss/camss.c | 40 ++++++++++++++++++++++++++++++- drivers/media/platform/qcom/camss/camss.h | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 2123f6388e3d7eafe669efd6b033e22d8eb5cf79..6a2bf3373e8755805c8cd0f8fe5037b788d68fa2 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -5346,6 +5347,35 @@ static void camss_genpd_cleanup(struct camss *camss) dev_pm_domain_detach(camss->genpd, true); } +/* + * camss_init_pm_clks - register shared CAMSS clocks with the PM clock framework + * + * Clocks listed in res->pm_clks are shared across all CAMSS sub-devices (e.g. + * top_ahb, axi). They are managed automatically by the PM framework. + */ +static int camss_init_pm_clks(struct camss *camss) +{ + struct device *dev = camss->dev; + unsigned int i; + int ret; + + if (!camss->res->pm_clks[0]) + return 0; + + ret = devm_pm_clk_create(dev); + if (ret) + return ret; + + for (i = 0; i < CAMSS_RES_MAX && camss->res->pm_clks[i]; i++) { + ret = pm_clk_add(dev, camss->res->pm_clks[i]); + if (ret) + dev_warn(dev, "failed to add pm_clk %s: %d\n", + camss->res->pm_clks[i], ret); + } + + return 0; +} + /* * camss_probe - Probe CAMSS platform device * @pdev: Pointer to CAMSS platform device @@ -5434,6 +5464,10 @@ static int camss_probe(struct platform_device *pdev) pm_runtime_enable(dev); + ret = camss_init_pm_clks(camss); + if (ret) + goto err_v4l2_device_unregister; + ret = camss_parse_ports(camss); if (ret < 0) goto err_v4l2_device_unregister; @@ -5775,7 +5809,7 @@ static int __maybe_unused camss_runtime_suspend(struct device *dev) return ret; } - return 0; + return pm_clk_suspend(dev); } static int __maybe_unused camss_runtime_resume(struct device *dev) @@ -5785,6 +5819,10 @@ static int __maybe_unused camss_runtime_resume(struct device *dev) int i; int ret; + ret = pm_clk_resume(dev); + if (ret) + return ret; + for (i = 0; i < camss->res->icc_path_num; i++) { ret = icc_set_bw(camss->icc_path[i], icc_res[i].icc_bw_tbl.avg, diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h index 93d691c8ac63b2a47dbb234856b627d8911a1851..fe5fe25d5f18d8a3ce35b48077a975f1453c341f 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -107,6 +107,7 @@ enum icc_count { struct camss_resources { enum camss_version version; const char *pd_name; + const char *pm_clks[CAMSS_RES_MAX]; const struct camss_subdev_resources *csiphy_res; const struct camss_subdev_resources *tpg_res; const struct camss_subdev_resources *csid_res; -- 2.34.1