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 6ED545013A8 for ; Fri, 4 Sep 2026 15:42:31 +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=1788536562; cv=none; b=ffMIw6ifRjAjV64uLxKV2RoSDmo/XNHVVrrFIO8NcERb9kdBc+j8Kx5FPAGdkN/1Xj7XDeCU3h+9mRTn8CPBjpWlkjO46HRGT1fM3d5H0VmXL3Mb3OutOLR+NstTqZ5tfDG0+97xQ5XrCYK01K2bGD2z+YRS6qeFSgGVorphQQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788536562; c=relaxed/simple; bh=v+n+nmdFdnTVbNIb0TxN7WMBm2mqsLqLg3eHOpRK3EY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bnu+v4Mhkv+cBD7aS15NI6KH3YIyu/Tu1DZVMkdoH0xxYHn0WUmwxmAZSn6YVekizbkQZrz/LY0Upm+ujBeSbGTq4FOohzcrtbQz3yD916mrSVjl8ghNq6JlxCld8d7N+ZKAJZUUHIcDTeqdPTsonaXstObGbUyAKkR5asHKLfQ= 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=a2GDmqUb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hl0ADRbb; 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="a2GDmqUb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hl0ADRbb" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 684EiSiC195841 for ; Fri, 4 Sep 2026 15:42:28 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= rJpihxR8z/RckkhTvBE3C58BSaU7qi/UDpmaSYSphAU=; b=a2GDmqUbUYlfiQ28 syEw97CMlDNJ4iCtBqfFLCVtd0PsCRa25LknCzyN3oQR8wZblfNI7ssPV+Nd9Ea8 fCNjAi1KufL8Yxx0I+MUfsA1LzkC/cT+1GA24CSCjB0tAzjy0PtWKH4b2QJqCZNW lW5Trmt90lG/Gb8BojHHcnjxd9H/wuF0B34kUI1BAjq3JkypTRTWQFLy1d+iWXn7 d/E4bU1sgyWQBkzl7e9HJlyfezxw0Dv3kqXgP0RA1hPPXwVl20uB63aaSRA3JVo2 OBgsU3ZAnlbxjRCkKx4QOXRFZn7xpIrZKAoCHNyNiiISW1xtllU8gzvCEjd3daBB odYoTA== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gg0120j46-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 04 Sep 2026 15:42:28 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-930b571432fso185676685a.0 for ; Fri, 04 Sep 2026 08:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788536548; x=1789141348; 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=rJpihxR8z/RckkhTvBE3C58BSaU7qi/UDpmaSYSphAU=; b=hl0ADRbbvESClIk8f21MTRihuSDpZjncSZar1C4k3sunhYimt3QAVM3jkDbjtDD/1o ACtDQpuAGUKJdaPx3f9/t6KQPt0HpTCpXjWveZuV1Ka2QzE4dTXqOKQC97XgUp32IOvW C2GP1TYELMmBkttq9ANw6J1CjIt10ppgWR3jOk2unhH3lVpqnzX+mB0m5KBLnNOPYD2m q9u+tUpWdLljM2X2xuXfg3nHZ3z2GA01E9huSy+orpWn/KBvNeEFzIClyS9R669t7uR5 wojTOOXLIFZyxyEfTZa21n0XLpUVnRXRyLeMDQ+eZqEiaDoFIhBdVLElZ0CKXHvkH7x/ htvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788536548; x=1789141348; 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=rJpihxR8z/RckkhTvBE3C58BSaU7qi/UDpmaSYSphAU=; b=qHTti1Oc+bfmlVAoSbI4GqCiWQrlPspl9hfN2t3oh0NmrYUo4TxZAgXehjzXeQEiB+ UFvgLHgTDAn8/LBYGQK2kDHvDv8pgql+XC4qFbHunXwvKaBIDck2dFM274bcldQcfNDW 2DPnrHX6Hh6z0DACBp6qr/nMO3AEZneFs11AE8PHpeBezlpuZTSaw/AHzRrHo50X3sPX Nr5b/DorgH1RLQ7qRJ5liAXTC5DNmnw5+TDIN/tnVkY3uNrtHowN6iwtGw8/zmtHc4aQ namDRc9+AKPp3W7+JgDQ3CsJNIY2YkI/XVi7d/199BMCUMKFFYga9vAWinFEqur8M7bs 9J4A== X-Gm-Message-State: AFuF++k1jagwfouYmnI6XYfZaQ0N1F0f1ZcNd1UGobxBaM7yzT+YMhpO dzeQSUKSaEpNATjfZWDombe7zGjiSmQPVpMxEIbTPj+1bajauA5UBNL6bVJT7FOc9KGsLiQsLLl h/pSL+AJA8YI8wcf5DiiB0H0/JRm8XAy0Hp/oYBiFphdzRDh8yRTzynUcMj2O084= X-Gm-Gg: AYBFou3V2nScdabqYnuGzA6XzYh+h4BNllZpt4+NYQKfq3dt/ISjZRemTQqktitZPbQ exH3qUuKJprV6Y9En5BVWwlmMUG6tPdhTltcqFUsJo/EDB1mT89b+jqtchcteg7hcziE4KIkPSg LJVPzmCsTANz7STL8H1Oq2ND5cf5Scj9tbQGYsA9qI9MggjinUr8Kr0Q4aCDEUFN9gstZUISZJt wH5gc4++iZAVEg2xS0w10S0yBwU32lGueYpTX3WpePKxBJ0KnrrdKePCvs/BJj3OFAGH8eKtzLS cqg0sK1Q4YfOB4fA9VEqR0+UZKoEHCK5ADgAL0YNsYpuZPvIav7F8lSNr8MGaT7OI9L7rCb/hUl EAN8I2+Ik4Q2DMyCHYiptkImuugtsKj5EB1iYkYD93E2TYJjN5moIf85+5zenBvDBYbKeYskoaC wlXNL7CHQ8xuh+0E2KvYsNj0651xzqmG3HyEWhdkGmQFmvKBVoPXA= X-Received: by 2002:a05:620a:2713:b0:939:72cb:bae7 with SMTP id af79cd13be357-93972cbbeafmr868828085a.30.1788536547661; Fri, 04 Sep 2026 08:42:27 -0700 (PDT) X-Received: by 2002:a05:620a:2713:b0:939:72cb:bae7 with SMTP id af79cd13be357-93972cbbeafmr868822885a.30.1788536547161; Fri, 04 Sep 2026 08:42:27 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:e90a:787f:72ea:b218]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49ce5533ffbsm160668505e9.3.2026.09.04.08.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 08:42:26 -0700 (PDT) From: Loic Poulain Date: Fri, 04 Sep 2026 17:42:19 +0200 Subject: [PATCH v6 04/11] power: sequencing: pcie-m2: Report power controllability Precedence: bulk X-Mailing-List: linux-pci@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: <20260904-monza-wireless-v6-4-d8c5042b3efd@oss.qualcomm.com> References: <20260904-monza-wireless-v6-0-d8c5042b3efd@oss.qualcomm.com> In-Reply-To: <20260904-monza-wireless-v6-0-d8c5042b3efd@oss.qualcomm.com> To: Manivannan Sadhasivam , Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, devicetree@vger.kernel.org, Manivannan Sadhasivam , Loic Poulain , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA0MDE0MyBTYWx0ZWRfX7R5PAqN/cxik 05gZvTbmTb14Io7az/zXbPNEY/FNzL1OVGMuHiaoj4sYKH9LPd4SXGaLLtEjBdhNw+o88xuF1jq JGNMlfIusglfgae5pOiJyidQp0ry6RE= X-Proofpoint-GUID: 0uOZ93KyaLh7nYrpL2GQTtr_DSISPFs4 X-Authority-Analysis: v=2.4 cv=LreiDHdc c=1 sm=1 tr=0 ts=6a9ae6e4 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=Wval_j7vKiRkorSqWqkA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-ORIG-GUID: 0uOZ93KyaLh7nYrpL2GQTtr_DSISPFs4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA0MDE0MyBTYWx0ZWRfXzFefiTjeFo+q c9fmNqZkOgp/aWdb08i0z72I54vnSpxUJ6xyByYZrOiFZUHQPJCQjih3NSKhHWBim/Xy+CccwXI iVqCDu1YotlIyRWJ/GZzXeLsN+JEGv4bzqdmu0t4CjFKYmh+zceQgiSTR1MW7JbMtsiWB+8WXfd eBJnboxQaRoXmxZ7Opi7s20CD9W+GMo9nd5K8egtIJ7gYvM5c5LLE8bILl07IOrzZlsldwo4GiM WF/LWhcVLzETlDYbgR4ZVPGUO834sXr/3HnbugNpWgBYJt6nWieG0CnaZ4fYYlx5yEjOEu7TLKK mARZg7MC4VAFyynEdAowJofi7ovQe+HEQnONU/74AS52y21aF/sfieSFoLSALDVgsa9f8Zh6fLc UWN3gNXJNC1pTSmXYWqR3zHJaS3Od1u3pH7kzjUuiGN3k7+jx7IRwdSTo30xffDX1hLIN5TYAU+ QFFEs6Tkxbp2gk9S2iA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-04_04,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 bulkscore=0 phishscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609040143 The M.2 Key E connector gates/resets its functions through the W_DISABLE1# (PCIe/WiFi) and W_DISABLE2# (Bluetooth) signals. When a signal is not routed to a host GPIO, the corresponding enable/disable callbacks are no-ops, so the consumer cannot gate or reset that function on its own. Implement the .is_controllable() callback on the "uart" and "pcie" targets so that consumers can query this per instance (based on the runtime presence of the W_DISABLE2#/W_DISABLE1# GPIOs) via pwrseq_is_controllable(). Reviewed-by: Dmitry Baryshkov Reviewed-by: Manivannan Sadhasivam Reviewed-by: Manivannan Sadhasivam Signed-off-by: Loic Poulain --- drivers/power/sequencing/pwrseq-pcie-m2.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequencing/pwrseq-pcie-m2.c index de9848a9a9f19dba6d2e9d756c3d30f6648738ed..bee1aa0e077db139a52d307890053492b4513db2 100644 --- a/drivers/power/sequencing/pwrseq-pcie-m2.c +++ b/drivers/power/sequencing/pwrseq-pcie-m2.c @@ -83,6 +83,18 @@ static int pwrseq_pci_m2_e_uart_disable(struct pwrseq_device *pwrseq) return gpiod_set_value_cansleep(ctx->w_disable2_gpio, 1); } +static bool pwrseq_pci_m2_e_uart_is_controllable(struct pwrseq_device *pwrseq) +{ + struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); + + /* + * The UART enable is driven through the W_DISABLE2# line. When it is not + * wired up on this connector the enable/disable callbacks are no-ops, so + * the host cannot gate the Bluetooth function on its own. + */ + return !!ctx->w_disable2_gpio; +} + static const struct pwrseq_unit_data pwrseq_pcie_m2_e_uart_unit_data = { .name = "uart-enable", .deps = pwrseq_pcie_m2_unit_deps, @@ -104,6 +116,18 @@ static int pwrseq_pci_m2_e_pcie_disable(struct pwrseq_device *pwrseq) return gpiod_set_value_cansleep(ctx->w_disable1_gpio, 1); } +static bool pwrseq_pci_m2_e_pcie_is_controllable(struct pwrseq_device *pwrseq) +{ + struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq); + + /* + * The PCIe/WiFi enable is driven through the W_DISABLE1# line. When it + * is not wired up on this connector the enable/disable callbacks are + * no-ops, so the host cannot gate the PCIe/WiFi function on its own. + */ + return !!ctx->w_disable1_gpio; +} + static const struct pwrseq_unit_data pwrseq_pcie_m2_e_pcie_unit_data = { .name = "pcie-enable", .deps = pwrseq_pcie_m2_unit_deps, @@ -132,12 +156,14 @@ static const struct pwrseq_target_data pwrseq_pcie_m2_e_uart_target_data = { .name = "uart", .unit = &pwrseq_pcie_m2_e_uart_unit_data, .post_enable = pwrseq_pcie_m2_e_pwup_delay, + .is_controllable = pwrseq_pci_m2_e_uart_is_controllable, }; static const struct pwrseq_target_data pwrseq_pcie_m2_e_pcie_target_data = { .name = "pcie", .unit = &pwrseq_pcie_m2_e_pcie_unit_data, .post_enable = pwrseq_pcie_m2_e_pwup_delay, + .is_controllable = pwrseq_pci_m2_e_pcie_is_controllable, }; static const struct pwrseq_target_data pwrseq_pcie_m2_m_pcie_target_data = { -- 2.34.1