From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 359C4352C4F for ; Fri, 30 Jan 2026 16:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792059; cv=none; b=VUCQdGxy6dTZiHVipjyabzpiMEL5OQrTwm3bIubm2ZpKqEad4Vj04PniusQpMNZSs21exaDSIfgv/PunhIhd5XYQxp6UUPrwMV5Qicuyz9qhnDpDvu329GxqiJZD0R5hnGJanEvS3vfeok/kg95b4EZL6fPGwYQ5+MhRhNRxRUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792059; c=relaxed/simple; bh=cW/CdnUqHSo8CZnbbZvcXwLLmwlTJ7iZ14B0yAcTM54=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aUsopsqr3qi1alVS4F3doX4zhq2HSk5y/gkWWrS2DQW6Zb2fh5FpGq3zPXAI6h1gF5rfnayex/ssGY5gVVP63sXsO4peUxa2GDSz3QH3jc5FORp6c2nBBDu2ZjpO1tNIWn+OYNefzABIBVM8UhwcZY99M5hsWjH6EY2k/uoYdVg= 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=cm3AW8yb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Qzvg/QRm; arc=none smtp.client-ip=205.220.168.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="cm3AW8yb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Qzvg/QRm" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60UATaLN1488881 for ; Fri, 30 Jan 2026 16:54:17 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= awvAk9dpp7+jKmkbUjTkfr4pBxnpPpuKXslnuuCHXiM=; b=cm3AW8yb00HVORLd OvwbA+Ip6FEQUvKzXOGqwCN5OznQjPOv1NVLK1A/HYFKCSuEdlFjdZiVDFwd5h3l EfRDCZqNJoYcdsjZiSa8yomBySoYYiITJwaDqKqyHO57x/bF0d+HkLym2miXHzoE 8UwwEKmQ9+2M/6wWLUUApPqtq3vtW9Or0k2hBVv5uQjahm/Em9d4Vm5ithH0j8O3 f9r3cJAoDDiHcENv5cPS/Hc7K6dDPleqMsfUY0RPbegxXgyIhAXQFnlkwt8e84yi YKu6/e3BABt8sb3EIfCePROs9kq9Ks+hTyhEXjRvRwO3kxfumFWzZTvi+IlSczl/ XZu7rA== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c0bp3uyyg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 30 Jan 2026 16:54:17 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2a7701b6353so24725755ad.3 for ; Fri, 30 Jan 2026 08:54:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769792056; x=1770396856; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=awvAk9dpp7+jKmkbUjTkfr4pBxnpPpuKXslnuuCHXiM=; b=Qzvg/QRm1mkUarPvSRde/E2C2tfWU30m6gcZ6E1eaxXXZFPVBqMePqcGTkg8jllvTq 8J0FdY5YL2e5pMN2Eb2Qu3V3Ytrj61EHoN4Vc0MyjToRvgEytuyW5PfmX4Oz3Iiy0f7j N3ga4ACCHkUgphoRPp66q30SQl0+oPvuhhT+dqfiNCG1wmdwzgZnvPPzzQneoC0/tvyE jzhfwjYPXkQv1viSk/xclPa7pKEJRtlK9U84qWSYS/fgorlElhfJ1VJXeGN3LZd9d9Pz PVhOY7LqIqjNl0I9Ym4Z4gg5uBAiM9u4XuHxHIRlX89vgGZAvsAYtTQG/4j/3NFp9h5O Bgfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769792056; x=1770396856; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=awvAk9dpp7+jKmkbUjTkfr4pBxnpPpuKXslnuuCHXiM=; b=k6iqynJbDvclGjevCy1BgpGFD2nGOXdiVbCobaeICxEMx47UEYgUdGoGRZDjPoTGOQ 5xPCwurhIXX/A3J30oRm8SUHA250y/xyonY/5f4xK82j+xT/mxlITKYKnHhhYvCjtpgu QmoVODBFjH1fvaq7SALPX+paV7SqfLeq9KF3Ou9u+WVYmxKA50b7FeHwHuamjcdlgaAa 34j/QohzVEe1dQUXvj2MXGxK3lPCC6rN3/PhYMFYqM5IPmSiHXwvQwUgqVCXWhGRmVj8 KRYf0ultUhVPOUEJNHOtFmXvpP7kg8Q8AqAZi8wCxQx/LlCr5LR7/SL43RTdLx62MVW5 Nhmg== X-Forwarded-Encrypted: i=1; AJvYcCVNU3CevtQs0w1/6TtpW/rvBdmQHH3/4mdBThnNktvOYLLQZa5qgcJcRiMgTIrITilqwvzPso8KQGW1Sa4=@vger.kernel.org X-Gm-Message-State: AOJu0YxXAyjopffbkQY092BShUFJazxMItL/qIJctcrRE72o9Po1wGuw oGN5i/IHYLF82Kn7OGXzpBbxBAJy6UxF7ymmabIqNeCG5r+5snDWHuCRiNBgTrJ9+34VesGmLrY doROSZH1jnEmZJyyE2avbpHpN1/lSk4J5xaZi8+gk06AzPg3D7KSAfCcWqNrH9Hve+t8= X-Gm-Gg: AZuq6aJiqbT8dZaDkecSfVqoZR1gOlioipkMgmLoiRSTq4qUK/fiRl1h9E+THWBy15H jfq7VPt6yMeisy8KxHVDPgpzkWdwBbmzTdhlld9ECkwRSt3QVdbFN11xEC8jYMXlKgWXB6jlqH6 gPAKzyqn7L1d/3Qmqxrqf3NC8PBnh31IzHGYcmpIlaNulhfHnTSUulFxfYVQW/KGIAmkiU3KGOR u2tCVZYgWHlJwv4N+3hArjzFNV48eJ9RtUcVfaqdaHtuJT/GiO92TdwEdz0v2q/92mu8JqnWTF+ 8zLbkPiZNVH4WSawDNi1tPlwlh4rvFJDzLUqiqul+vt2445JDY3VuJuz9kXo2OKux9D0etcw2eq 3NTVM8wB7g89BKHjf11Yk+QX6pRfKnI6Pvng8k8iS X-Received: by 2002:a17:903:41d1:b0:2a8:ac0f:9ad1 with SMTP id d9443c01a7336-2a8d7ec4e83mr39817765ad.16.1769792056425; Fri, 30 Jan 2026 08:54:16 -0800 (PST) X-Received: by 2002:a17:903:41d1:b0:2a8:ac0f:9ad1 with SMTP id d9443c01a7336-2a8d7ec4e83mr39817365ad.16.1769792055824; Fri, 30 Jan 2026 08:54:15 -0800 (PST) Received: from [192.168.1.7] ([49.204.111.90]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b4c3afdsm78616215ad.61.2026.01.30.08.54.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jan 2026 08:54:15 -0800 (PST) Message-ID: Date: Fri, 30 Jan 2026 22:24:06 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 06/12] soc: qcom: geni-se: Introduce helper APIs for performance control To: Konrad Dybcio , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mukesh Kumar Savaliya , Viken Dadhaniya , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bryan.odonoghue@linaro.org, dmitry.baryshkov@oss.qualcomm.com, bjorn.andersson@oss.qualcomm.com Cc: prasad.sodagudi@oss.qualcomm.com, quic_vtanuku@quicinc.com, aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com References: <20260112104722.591521-1-praveen.talari@oss.qualcomm.com> <20260112104722.591521-7-praveen.talari@oss.qualcomm.com> Content-Language: en-US From: Praveen Talari In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: SUWhceUnvWxMtU3ApSk1IZHmyN-zavGg X-Proofpoint-ORIG-GUID: SUWhceUnvWxMtU3ApSk1IZHmyN-zavGg X-Authority-Analysis: v=2.4 cv=d6T4CBjE c=1 sm=1 tr=0 ts=697ce239 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=10aD+GSAjGS7IfLbEAHBKg==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=JTZeKb06zDgOFcaq6ncA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTMwMDEzOSBTYWx0ZWRfX7uGTaJq4W38H WmQFZBMnI4P8MViBKuFhLq8fpzxntSiy4PjTDjYXdxXG1Sju5ufA+mCDznY2jF39AHnVHnzMtSx Fgqs9M9hH3T43YwyF/QM4dzS61EivuyGDKDmScpD/nVuao3pKQYH7uWWdURAHo5wbA0norwUI8w q42LkaVWFMY991Nt9jrg4dNDIqAg1/0uMVPTIfHqMvNjVfZVuiGEjinrPUom5ozaGZMPHXYmG9O afNMviBUvPRsZF3S9U3ElKFWUyYwHxBvX2jXOg5FtipAxQ6kAa+gCBCBzTcz3ZZclgto8RDoTbC 2DVUsCuRW6pNYIdxmsKGScLv43LHsriSurpDwaAGs7OaqlbrY8NA2H3+rdMUJIDXwp2NYHuiwEt KW8b5z68vwGc4Utd9rfQcQh7BLmQsMG6p0CTe1/3cNgH3pwgEju/hDHVUkuFf2X0VZNKAJcH/mq a/4j9ZAtNSUe1alydGg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-30_02,2026-01-30_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 malwarescore=0 clxscore=1015 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601300139 Hi Konrad On 1/30/2026 5:53 PM, Konrad Dybcio wrote: > On 1/12/26 11:47 AM, Praveen Talari wrote: >> The GENI Serial Engine (SE) drivers (I2C, SPI, and SERIAL) currently >> manage performance levels and operating points directly. This resulting >> in code duplication across drivers. such as configuring a specific level >> or find and apply an OPP based on a clock frequency. >> >> Introduce two new helper APIs, geni_se_set_perf_level() and >> geni_se_set_perf_opp(), addresses this issue by providing a streamlined >> method for the GENI Serial Engine (SE) drivers to find and set the OPP >> based on the desired performance level, thereby eliminating redundancy. >> >> Signed-off-by: Praveen Talari >> --- > > [...] > >> +/** >> + * geni_se_set_perf_level() - Set performance level for GENI SE. >> + * @se: Pointer to the struct geni_se instance. >> + * @level: The desired performance level. >> + * >> + * Sets the performance level by directly calling dev_pm_opp_set_level >> + * on the performance device associated with the SE. >> + * >> + * Return: 0 on success, or a negative error code on failure. >> + */ >> +int geni_se_set_perf_level(struct geni_se *se, unsigned long level) >> +{ >> + return dev_pm_opp_set_level(se->pd_list->pd_devs[DOMAIN_IDX_PERF], level); >> +} >> +EXPORT_SYMBOL_GPL(geni_se_set_perf_level); > > This function is never used it will be used by UART driver, not for I2C/SPI. > >> + >> +/** >> + * geni_se_set_perf_opp() - Set performance OPP for GENI SE by frequency. >> + * @se: Pointer to the struct geni_se instance. >> + * @clk_freq: The requested clock frequency. >> + * >> + * Finds the nearest operating performance point (OPP) for the given >> + * clock frequency and applies it to the SE's performance device. >> + * >> + * Return: 0 on success, or a negative error code on failure. >> + */ >> +int geni_se_set_perf_opp(struct geni_se *se, unsigned long clk_freq) > > I think with the SPI driver in mind (which seems to do a simple rateset APIs were added as generic interfaces shared across I²C/SPI which is specific to firmware control, not Linux control. > for both backends) we could do: > >> +{ >> + struct device *perf_dev = se->pd_list->pd_devs[DOMAIN_IDX_PERF]; > > Then, we can do struct device * perf_dev = se->dev; I don't think, it is needed since this is specific to firmware control, not Linux control. Thanks, Praveen Talari > > if (se->pd_list && se->pd_list->pd_devs[DOMAIN_IDX_PERF]) > perf_dev = se->pd_list->pd_devs[DOMAIN_IDX_PERF]; > > and reuse it in both cases, completely transparently to the caller > > Konrad