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 CFDB22253EC for ; Wed, 1 Jul 2026 02:43:09 +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=1782873791; cv=none; b=H68N8H/9pQQKV8rJgISJVn4JZlBRue8ATMsvCpt4BoQ+E+hiNW5cE6Ns39iXpynHC5gP4sX0V8BKR1fBtlNVmoPhOCoKGwCB2DIsLH4sRYBUHhXNBA342wS7Hd8WhscFOGmvOG8F1zuANE02HQ8cyR7MPo5g4CJBgMD+xDIGocg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782873791; c=relaxed/simple; bh=FapcmhSDWdIbfGDn7d2E074RgF70uLIGNaphnZUIFUI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rVCgXrmPKg0eYKwrZ/CwfQ++KxhhQnd735K6ZCZokqkC9Nq1H0CyKJRnWVaFVQUrU6jj2tT2jSLK/c4xg6RA7C4ox4q371+FwmgXG91+a6t9TGuS1sPzFYosqmPWhk3YCSh79C/YSnh/52m+zd0DQEnzMMUSPbr0hyYS6iC6o7A= 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=JfEXkNZr; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kuDH6dZl; 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="JfEXkNZr"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kuDH6dZl" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65UNM5Td3472299 for ; Wed, 1 Jul 2026 02:43:08 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= 22j6kvPQxvDqX/JKFeoFPtRFjXD2z68YaP+Kr9Dut+A=; b=JfEXkNZrhlpEGX6c wORIgFA1wnP0W8g/y8VSm+xA/UUCGVvga9IabRKuC3pmLvPOFfuPiFdounGvRkzm nQaEU/AO0r4nJ4x2Y6YIv0KXx6b268iy3ohlNwVRRg6uxjHtfMMXhEXfjmNxh+hp Cz3GHu0TtTLk4uScfm8xhf95x0Wg6K7VXYmt3zcoFrWZHA55dmybAZw7X6e7jg1H o6UM08W76BtJlV7VuAZom8CHk/1lW5QKQv9A3EkAU9AOHevBXAfssULeqq4nU71G DENXYq0EyY5KsbzXYqqnHUw78DG/OiaXUBdzw00ceM9DqjpYr8LjjOE+c7jA9coy V7xt2g== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f4fc0ax06-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Jul 2026 02:43:08 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2c804e38c65so3740155ad.2 for ; Tue, 30 Jun 2026 19:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782873788; x=1783478588; 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=22j6kvPQxvDqX/JKFeoFPtRFjXD2z68YaP+Kr9Dut+A=; b=kuDH6dZlxiSQcOFW/kOsBIh8iirW3fXA6jTmEbz940/TWDLMUG+vOImjKmzAUfR6yB x5xj9HWwGUjKS2RUXzvhYGfiWFX85kK0WYsMw6ickeN0mN080WXDAleiBakQMnvEy293 wMCU5THc4sEtfVQ9IFHJWrQv0WHwztdbIiWiUx1dg3NQGfey7B0Qxd61xp5Ut52weyHm 8vjhozY3NFZJtolzBq8QNkaUDNlbaq+7avkzQJA+5s1498WNCj/REwDeu40twedc0vdc dVDcOa+kKspfYuaQYpIpKXuL25M+PGerv8XPF0JyvsNFp3jt4Ud/4vuMSHv0Jwzw3WTU BbYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782873788; x=1783478588; 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=22j6kvPQxvDqX/JKFeoFPtRFjXD2z68YaP+Kr9Dut+A=; b=sStT5PwJbadF698aXOMJva806NSuDDp1WBUSEmbIK85I8HXArl4ZR6RsRcHnylvgqN CpFOWh1z225P/ttfJxX5DOrIDgJnZSn6Zxb7mgZWxJ2T2n2vUiTOFoUKoOP6xsGrLKi7 uceWew+YxElBVMfE/arIv5DEocAuBpIXfysLI63MwHIB1ptIM4ZutQ1lulfIuc9WWoqa I5vgCllQqcpndS1WywT1XNORAwZgNQOlclFLl4Q3gXlYlrMO9i+PqhNMVmmfbuDRi/Ob 9QBwxn+O7SdA0FCPqwPIH9caaX4ymDk0Pio+dau8ojBWjPZi07m0P0oQLF7IdLMuxrd/ 9gRw== X-Forwarded-Encrypted: i=1; AHgh+RoH3Hd7kwSuaCQesQLi7ojDqI7xRG/icDeX2GLl6yGi092j36QU1/PBGqZLfT5fJe/S1icyrBodchVnNK4=@vger.kernel.org X-Gm-Message-State: AOJu0YzyXrDiKpvQRcIYtqguhyZRwzkijlhxUt0hKb80O47vYdpt9mnl F/AF/sesmGyCyRSJ8/8WMf16SnzDdNH3T73GHIsf1sifW8dFbVeh3pS5crKVK45h4f6kBjb0b9e CNhdi1IcaG91tkvOjR36/jqJ+rLCRTz1YwM6BBMchP4l6W5khnBaGkot5bplOVF6E7Eda/BdjEo yBSg== X-Gm-Gg: AfdE7cnJLXCe2XleW9U6ozSXZFnXyaR2scPuS9iHi1ePxAcwBqhyJOzVoVHKlsM9JET lMIgrAMbA2m/bS3JlAkCjYFGQAH9qakSsVGhvJSmVzJHEw3QL9gel6fnbK2RfkSMQRv+WMrrOmb eB89cV/hHCx/lI5mGqMzHiGgFAjGN9CFcxqfL1qIDi0Q97ILCx2zysN7ZiVo+vQFDYqBam7OAXb 7N4EiyRZhAuf6cNuQhU0hKpwnQyA3RAXxUdeMi4uUhO1JMhvoaeM4XxCR05MAEVBNGVwAqRojoE E6WgUKCJXhr3tmr3pmdgLSiq9dpTeMucw0uI3ocM0AQLAG9IMOKXrgNqqNCS4urrGEo0G8xLI1a IG2BzgB0jvbrGSs0eLabcwGOlJnOz7h9PhNJRYliK3HiXW3X728Vp0UGhhWRtTm2SX54Y/qrg9q 84+y8= X-Received: by 2002:a17:902:e806:b0:2c9:ff83:41fa with SMTP id d9443c01a7336-2ca5a61025emr29556615ad.24.1782873787746; Tue, 30 Jun 2026 19:43:07 -0700 (PDT) X-Received: by 2002:a17:902:e806:b0:2c9:ff83:41fa with SMTP id d9443c01a7336-2ca5a61025emr29556345ad.24.1782873787318; Tue, 30 Jun 2026 19:43:07 -0700 (PDT) Received: from [10.133.33.85] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca4bae1e2asm17087495ad.73.2026.06.30.19.43.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2026 19:43:06 -0700 (PDT) Message-ID: Date: Wed, 1 Jul 2026 10:43:01 +0800 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 v2 1/4] soc: qcom: rpmh: Allow non-child devices to issue write commands To: Mark Brown , Konrad Dybcio Cc: Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , David Collins , Subbaraman Narayanamurthy , Kamal Wadhwa , Maulik Shah , kernel@oss.qualcomm.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org References: <20260528-pinctrl-level-shifter-v2-1-3a6a025392bf@oss.qualcomm.com> <4ac5hjmr6divqs4myhcw5sveuboj265sw2jwslbivrfwh5e7ce@6d7ajvgikkgt> <18235340-cd42-4d88-bfdb-19aecdd63d68@oss.qualcomm.com> <9927f5d7-1eca-4936-b38c-678e76ac11cb@oss.qualcomm.com> <837dc7e2-4db8-4a7d-a19f-e53ddbcc9cf6@oss.qualcomm.com> <4edaf745-d24f-4ce0-9605-e3971f067b68@oss.qualcomm.com> <88b5d0e1-4b78-4b79-b9aa-d6438eeced9c@oss.qualcomm.com> Content-Language: en-US From: Fenglin Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAxMDAyNyBTYWx0ZWRfXztvOTI+2yNMU l874a21WAHFnzoR5IhTfvqKXunM7BQ/9Dlbny0fSnY7o7GBn1Bym5W9Pmndn+0dRF8FCjxaPI8/ Uj6le/Pt+S4Nu/JFYn6WhADujS18khXEimuFBn4Id12Pbujs0OFRRLRsB03zQdDYjz+Rh8fZliX H1g9qIoR251AFiGZVlE8DQg+mp0ajWegPVb3XpIniKlRO0jNY+VYpzuiAmP3m6DoKTR1iHDkey4 PvRpL9fCMOr6qy4oXLEMY8ays/EFyFEWf/WZKxXuIvS2IKNDQWC1X5XA2381QnH0/uytKHuOPp0 GElUJOpld0GnElBBhH90UmYAg1xPACqlWb2jIjHYYFOHgfRADWTagEAj9yut7SQ1jytCLBKxZQF 2yCUtge9nf5tnFPzZSwQUaKQwY0LYM0Xfy0+nr1KR5AV9fpFiHb1uz6BgYSWASEMZbmKxfumiTq 65uov70fZWHyhuG7DoQ== X-Proofpoint-GUID: 7mG-N9L_nNZEOvwOdR07YSRrfzH1WOcL X-Proofpoint-ORIG-GUID: 7mG-N9L_nNZEOvwOdR07YSRrfzH1WOcL X-Authority-Analysis: v=2.4 cv=Ivkutr/g c=1 sm=1 tr=0 ts=6a447ebc cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=pB9SGBul9zH5g0KS9pAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAxMDAyNyBTYWx0ZWRfX0cpQ5YG9UWMv o8bO3OjTE3qdVqwZhHOK56PIwgIqwUNYFfJG34JmIvu0GezaI0V1mGQq+IUnfxR6+Xk0XTFpSxS itcDrH315LT6b10AI8X9Y/ZVea1FyyA= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-30_06,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 malwarescore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607010027 On 6/30/2026 10:37 PM, Mark Brown wrote: > On Tue, Jun 30, 2026 at 04:28:54PM +0200, Konrad Dybcio wrote: > >> +Mark, would you accept not-quite-a-regulator driver? > > Probably not, but I'm having a hard time telling what the problem is - > the quoting level is rather deep and multiple levels of it don't use any > word wrapping within paragraphs so it's all excessively hard to read. > Frankly I very nearly just deleted the mail unread. Could someone > summarise what's going on here please? Hi Mark, Please see a short summary below: Qcom PMH0101 includes bi-directional level-shifter (BIDIR_LVL_SHIFTER) modules that act as open-drain voltage translators, mainly to support 1.2 to 1.8V voltage translation on the I2C bus between the SoC with 1.2V IOs and other I2C clients with 1.8V IOs. Each module shares two physical pins with two GPIO modules, and control of the BIDIR_LVL_SHIFTER module is centralized on the AOP side with 'XOB' resources so it can be shared between different subsystems. When a BIDIR_LVL_SHIFTER is enabled, it needs to send RPMh commands to enable it and SPMI commands to disable the related two GPIO modules, to make sure their circuitry does not interfere with it. For now, the suggestion is to write a new driver for BIDIR_LVL_SHIFTER and place it as a child of the rpmh_rsc device, and refer to pinstate nodes to disable these two GPIO modules. However, we are now facing a difficulty in deciding which subsystem the new driver should belong to. We expected that the new driver should provide following capabilities: 1. Enable and disable the level-shifter at runtime. Consumers, likely I2C client devices, will enable it when active and disable it when not, mainly to save power. 2. Allow sharing the level-shifter between multiple consumers, even across different subsystems (currently managed by AOP). Following are the approaches that we are considered, and it seems only a regulator device could satisfy the requirement the best but we want to check with you if you are fine to put it in the regulator framework. A. Using the mux subsystem: The level-shifter acts as a switch, so it fits the mux subsystem physically. It can be enabled/disabled via ‘mux_control_select()’ and ‘mux_control_deselect()’. However, with multiple consumers, a second call to ‘mux_control_select()’ is blocked until ‘mux_control_deselect()’ is called, so votes from multiple consumers are not allowed and can’t be aggregated. B. Using the GPIO/pinctrl subsystem: After moving to a new driver, the level-shifter doesn’t fit the GPIO controller or pinctrl device concept. It has only one pinmux, and each level-shifter works with two pins. Also, both GPIO and pinctrl frameworks require exclusive control, and couldn't shared between consumers. C. Using the regulator framework: The level-shifter is controlled via the RPMh XOB resource at the AOP side, which was adopted from the idea of power rails sharing between subsystems. The regulator framework’s APIs and reference counting fit the requirements for sharing between multiple consumers. The problem is, the level-shifter isn’t a power rail so it is conceptually not a regulator. Thanks Fenglin Wu