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 BB2013AE194 for ; Tue, 2 Jun 2026 07:30:00 +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=1780385404; cv=none; b=ZodjIzgvnKXcXxbajjNwwQVLDs4c1aBP3l1MX4/GRKsjYipZiNhVWwJn/uM2o20Dd+s3W0C7V92MouPG1OO0PTkdLPuMN3ySkB2MjQJafEj5fmeorE0sFewx8nq1zh1noOJEJTyEo4wts8OfHzE5pZQhRjddTKKKvv1aCJ9rYsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780385404; c=relaxed/simple; bh=f5sezRu9tjzvfzojxxbxhZ96R0OsebYnOvfx8CxrWJU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HZ4sqJH00L4dWI3L1zS/Zx5ObOJb0YxVAFKyX18le9/5qi9QnPH9fSa1L2zd3MLYr+naQUbLFLw4iYAlshBEzZpYRaMkt5OFpZTnUELE/QNzW5MFDx5zP7ofnG69MSbLx3QS4F8eqrB7aHFDoUAiVidbZM0ZhHWjjR31Ob0fSc8= 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=O+jooV3F; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LHh9OmO/; 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="O+jooV3F"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LHh9OmO/" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65245hMW2691980 for ; Tue, 2 Jun 2026 07:30:00 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= QUeKHWwTq2n3NcB1fiL1lGPzCZOFlPVRKYeeEWe70sY=; b=O+jooV3FCEoeuLhL tOD+4drsw50g5ZKyXxC0c0Yx1LmcDI1+9lS4VNdDaOMlo+/oEg7By2PMK9GUCAoS g4CaHnVjUF8hDFjNnDZI79RfPQwV2Cr/ZpU7vMMrZI6LHK1eYrbDJvbv/MwsX1KI KMc1P3W999VQl1tgbjhEfbOcOo+uKsY7bJkBRkdunaKDm+xOqWoDV7V/kGBQGWhH 5FFRVM+w4QoYwBFzvnw0oyPPJp6ekLMF9o/x8+8e6h1cqLg8nWXiCsIkDhD3Vmdm mt1zkzm8zMoa255fJh1RtWIgtjyiSrMklyQe5H8dSWqZJvJsoLe/WquVjbIPhLOE sKrD/Q== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ehqumgrmf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 02 Jun 2026 07:29:59 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2c0c36f4b76so23395005ad.3 for ; Tue, 02 Jun 2026 00:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780385399; x=1780990199; 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=QUeKHWwTq2n3NcB1fiL1lGPzCZOFlPVRKYeeEWe70sY=; b=LHh9OmO/gvEIYbk7EGfEzJxdtFLXX5vbrBMD/KsVC/M93018PoNnMb7KbvOc4NNtZH +rSHBcnwW85TycxWeaBxRkgG97w5WGOUC0c+pWzDoJBMg8NfyYpWG1Yqz1GjgBfqvY72 8g4koudjlEB/SxuF19+ZHmMytl91a7IRrNs5rvSmkbvd2wdNfXCqBH8rciqUkzffWhGO 2ns5qto/d+fKz69mGeXcBS3YbrnJUcebRITYLbozFzEgBartq3PxELs0hbm2Wg7qv4CC jBLhH6u4zJ5ZrY+ck5mVnndmBf765vjUBbz4U3dh3p2RVUBcSCHeR7sfg8dOVichkVzI gppw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780385399; x=1780990199; 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=QUeKHWwTq2n3NcB1fiL1lGPzCZOFlPVRKYeeEWe70sY=; b=hqAwUiGJBN0MVhHGsFMjnoOGOegr3X4IJSsnccZEWkdBu/QUsp4rquqOifzZZ2RDzY +O5VcyenyWddwF2NPb4e4YoL/hLHMMV/OlfibEKTsc9zpINHlqMCJvzL3WjdvHz1SVYq 7N8O51+TODXBw7em0cZ3EKtAYV3thNB9eApbdT3uvnO6Cs4pGDw0dwiCQQwUrv3UJWuJ 1J0pGISyyBlD4/pXZDMgXmiUBweDf2hS/DIp6Cc0ZFKEi3lApSvSe4dmiU6S8FdH12Fi 2gwiDNPRJPut+V8ZJvoD1u0UiEwj2BDndRa/+ciaHHU1kE15wfWO9SSGKYNuEg6RbOId 6icw== X-Forwarded-Encrypted: i=1; AFNElJ+Xw/d81nCJ3ycxrcCMW20/4cy4//T3mRjMmIDnONPZN5OWUhya/9Eq7Xo4H3vBTUGvyd3fOPS9hk4oVyE=@vger.kernel.org X-Gm-Message-State: AOJu0YxXNtyRPt57j3L5gUByNBVnz7h1js2iymKresPFRBkFqm3ZjoF4 1Ijjv1pwZX85CX614AupsCLwtZPSUbpBulDCYtR1eCUo4571vo/M90ZxjhCzFt/lOVP7Br4WfQQ UdtjTWKnVMPOYlQnXL/c2GrJfY1xkMgGpNr25+jMn5KWJbxaB64celfPtCwwJMo3u4Kw= X-Gm-Gg: Acq92OHUVUjYLXBpsQBbosSqfLmUv9E8YXw1naQeTy2Agdrg0yJza8eIS6b9Qf7DvNQ tVraRgDUB4PranZl73S5ln/fh461fxIJ9BRtBO1tuBdIcvDT0b6qK4cFnc3InC4tlLYxtZTEUrz +enX9/RCUOt91yIDGP7CCkE2VkesQgByoFtxuW97N/wfk6GMYR+xWQHhRXOszlYPSvBsO6hb+t/ l1yZ0stLyC6Ni4/0sMKz2jIXXBKzykikJrmhjHhHm7nTXdJRYwy837a+6ru1/0mEra9qMDcVXRK M264rOJrVRUI7PjDkXPAyU3LWJ5wpQxXC3VTkT+qiWRj30gwVUqoDGnmPZiXTqxt0ZvRuwOVK5d LH/XZSkJ3lTtjV286agkTZn4WlHhojeMFJJCI8S5zvlZmigT0j18khw7ZZCy2xU/HXRSB7SRFP2 c2+naUGDdpZqr+VJr07HY+ubZ5 X-Received: by 2002:a17:903:986:b0:2bf:1e59:d99 with SMTP id d9443c01a7336-2bf367950ffmr150381875ad.8.1780385399228; Tue, 02 Jun 2026 00:29:59 -0700 (PDT) X-Received: by 2002:a17:903:986:b0:2bf:1e59:d99 with SMTP id d9443c01a7336-2bf367950ffmr150381655ad.8.1780385398742; Tue, 02 Jun 2026 00:29:58 -0700 (PDT) Received: from [10.133.33.59] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf239fdf0asm123199395ad.26.2026.06.02.00.29.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jun 2026 00:29:58 -0700 (PDT) Message-ID: <18235340-cd42-4d88-bfdb-19aecdd63d68@oss.qualcomm.com> Date: Tue, 2 Jun 2026 15:29:53 +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: Dmitry Baryshkov Cc: 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-0-3a6a025392bf@oss.qualcomm.com> <20260528-pinctrl-level-shifter-v2-1-3a6a025392bf@oss.qualcomm.com> <4ac5hjmr6divqs4myhcw5sveuboj265sw2jwslbivrfwh5e7ce@6d7ajvgikkgt> Content-Language: en-US From: Fenglin Wu In-Reply-To: <4ac5hjmr6divqs4myhcw5sveuboj265sw2jwslbivrfwh5e7ce@6d7ajvgikkgt> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAyMDA2OCBTYWx0ZWRfXwIsssDelKoGO kyWd7MTQftsFqBM9qRSVam8tVoLLvFGscJPov5lsAQXvJp74Uyc5ItKazjH99xupdh4p1+WSCfP U//4bEQEEcQIjySzxi/ZJwkd63CpTuDUsij4ZIh7IfgqS9T2np3X0cLv3ZbXiBdKxqISfHirQaw 4Ge5yzkDl1djGyPuHNa26kUNToS+JBRFsQqBMWDfsYs6OgsteYu6kquBMiv5cXpMe8oWpHo8L4c JbDdIrPMJFsXv2nTWRYETEgJ289NVN3r8aa1r373b7te9n18jgxFh86CeEmebfFRfmikpy8tYAM 6tsxLCHQHrsWOAK0Hz5GNPOw2+0J7SshWKUDZh3mX9m56rv1Gr512igYgWIvMGE0PL1k1w4ewF/ 0sZUNvl2bvB04BcrjB5N/qYOISCeatmftM6OM/c48NF3XueV+hWzJA1Nem52p5CUQ/yy0DP2A22 KV+60DC6LJf/++iOIlw== X-Proofpoint-ORIG-GUID: e7yg44PkDJjITyX6WjyLmLgZbuuvfnan X-Proofpoint-GUID: e7yg44PkDJjITyX6WjyLmLgZbuuvfnan X-Authority-Analysis: v=2.4 cv=Rrv16imK c=1 sm=1 tr=0 ts=6a1e8677 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=1fo9jZtHFcPKizIzv_QA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 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-01_07,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 suspectscore=0 impostorscore=0 phishscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606020068 On 6/1/2026 9:37 PM, Dmitry Baryshkov wrote: > On Thu, May 28, 2026 at 06:05:35PM -0700, Fenglin Wu wrote: >> Currently, the RPMH driver only allows child devices of the RPMH >> controller to issue commands, as it assumes dev->parent points to the >> RSC device. >> >> There is a possibility that certain devices which are not children of >> the RPMH controller want to send commands for special control at the >> RPMH side. For example, in PMH0101 PMICs, there are bidirectional >> level shifter (LS) peripherals, and each LS works with a pair of PMIC >> GPIOs. The control of the LS, which is combined with the GPIO >> configuration, is handled by RPMH firmware for sharing the resource >> between different subsystems. From a hardware point of view, the LS >> functionality is tied to a pair of PMIC GPIOs, so its control is more >> suitable to be added in the pinctrl-spmi-gpio driver by adding the >> level-shifter function. However, the pinctrl-spmi-gpio device is a >> child device of the SPMI controller, not the RPMH controller. > This replicates the story of the PMIC regulators. There are two drivers, > one SPMI and one RPMh. Why don't we add a separate, RPMh-based GPIO > driver targeting only those paired GPIOs (and we don't even need to > represent them as a pair, it might be just one pin). Thanks for the suggestion. I agree that adding a separate, RPMh-based GPIO driver would be more straightforward from RPMh control perspective. It makes the new device as a child of the RSC device then it can naturally use the APIs for RPMh commands. The main challenge here is, we need to make the level-shifter mutually exclusive with other GPIO functions when the GPIO pairs are used in level-shifter function, which means we need to write SPMI commands to disable the associated GPIO modules. I am not sure if AOP already handles this; as far as I know, AOP only manages the BIDIR_LVL_SHIFTER module registers. Let me double check on this internally, if the GPIO modules could be controlled along with BIDIR_LVL_SHIFTER module registers at AOP side, and get back. Also, I would still insist on the pin group configuration, as the level-shifter would only work between 2 pins. Do you see any concerns if we represent the level-shifter as following even after move to a new driver? pmh0101-ls1-en { groups = "gpio11, gpio12"; function = "level-shifter"; qcom,1p2v-1p8v-ls-en = <1>; }; pmh0101-ls1-dis { groups = "gpio11, gpio12"; function = "level-shifter"; qcom,1p2v-1p8v-ls-en = <0>; };