From nobody Tue Feb 10 01:30:58 2026 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 4FB442F3609 for ; Tue, 6 Jan 2026 01:01:30 +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=1767661293; cv=none; b=ZuLKondDl9xLga2kZ9glwLG7lUTz9K8O40WS4jjMqosfjXVVGWMR2Kv8toTBCwTqzDUenlOmDvlSr3mt/bPv2CujN+FH9ZvtIdKFPph5w8bs2QJMLTIis4mkC4hEqsZQinSTDhJiArZtKT6fjzTztHiEf5haJSfQKYthfVa3j2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767661293; c=relaxed/simple; bh=vGKw+wEv4m8AuXcSbM8ug5QUp/CDr75AFUCT++yOsvs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QQf9tJNutlmqQQVsh/JgWpJn4JSa6Xew4FbxiNYCQyMdXPHmrtyE55GogrfLm2MMMRWOqP+S8OHA2oJ9f4dUhoeSOh3UBpTLsKoJ5eGTYCmbixLVAtuiB4zrJDuCGdWzXdFtLfm0I1rt9d+HbdzWxnhhOVNWfZdhU5ISqklhK+Q= 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=iJND170N; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hI1V/Pcu; 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="iJND170N"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hI1V/Pcu" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6060nFlP2745421 for ; Tue, 6 Jan 2026 01:01:29 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= toWGAj7SgswRPrjJQFNYvHcUGCLQpi1FqKeAVpzqbvU=; b=iJND170NW1tlBMQB HYoxumSS2BP8uillqDNEGwEiprL8Z7jNmZVPJApMFMAswdb9bJ5/1fFbcpSsYXM8 Bqsy3M6n1ZGBsDyKJvrS9X2Kmt5VPPKKfi/6jeViftU15HfJ0cycqXdrXQHTw2k1 KtTh5+2/44vamyxPnAyfJXVhEMmZabVmzQeAi1AdKzkHWnBfF3dYwlXbP2E1N3AU s3iVAyZUUpAD45jQieYRy+3SX6KdHNLSizY6ULzhaaCxQ3JaFittHSPyC3v762Fa PMw+Yj2Km5cWQ2XIReRVz9EZraWD5CGdVvxEnM9FUuEpnOoTj1Y62B/VSv1+WkqB AOazbQ== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bgg9yscfj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 06 Jan 2026 01:01:29 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8b9fa6f808cso141529385a.1 for ; Mon, 05 Jan 2026 17:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767661289; x=1768266089; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=toWGAj7SgswRPrjJQFNYvHcUGCLQpi1FqKeAVpzqbvU=; b=hI1V/Pcuney3KEUzHH7oey1/c2QYHF7gZxDAkxlbGx1Y65vx3UkNHuVzkF2i9ZYUoC sCN/hjSh75u0nTWPSkmy5qTBpckqewxP+ExuxQAXfvuLa8MtiRCKCwhTgQUPxHuZukwO jh74JYlxJB4X8b3VSdru6t0Z2BE/AZq5FwwNGrb4dM0PnXGSL/9sHzgIFvmFeC9gPcPI +5JfNc87uAAjdiEE5KZ5QCEXOpXu8fehQvRte2AXRpsz/Zq6uqj75laZe3cD81Pdv55R 5VTS3Zh9brl0UR/jUt/pp1DurN0KbLattkza8+EBMKxEeQBC9m7bOOxe51yv/MC9NXEo T1AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767661289; x=1768266089; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=toWGAj7SgswRPrjJQFNYvHcUGCLQpi1FqKeAVpzqbvU=; b=tKyHTN8fl1HpNm22HYyforpWPGT17sHo9CjhLThmgYQ2f50idyMcS580+8Br0XE3qH PSgPrvc1HAESaGqGFMbFwl66i2hlkTUt8OzfBLUfBFYdak88MPiE6ppV/ccWg7c+brVZ a0uLbLksIqW4dcAmZ5G+Ot6XQMy3GWIqjoTnsNlb+VTVdIrSDqqf4oE04Vl/RpNuHZke 12+6SIofERpaBlaU3CL6OmmxdKTnXR9J9cQ/Ja8q7EdkzvUOmlQepyjgyWQXsOo5jJIt bWd1JmEJXfn666U2rOmNWlNuHQ8vpn0RJPLbpjbLFqKK1DIFkVNdxJZDlN7zxlN6jnzY ZPSA== X-Forwarded-Encrypted: i=1; AJvYcCVefmIxjIsz4TWRj43LLwypFTZC720i7dv1gRKA8GGJhDUk5lfJu4CDQUp8u2SWyxipu/sjgoI+FKfOm+c=@vger.kernel.org X-Gm-Message-State: AOJu0Yyp4xzS0gnsB3QulgRh3RVDDoXGSyoBu3gcTTVjyKf0uSNVk/gx VWQIdaGmVipPhMpZdUhtMi6hsagK4Qiti/7i8vErSDsfTyrlnTnYtQCmAEad41VXt7I9zbfGpcu hCqVKGiupvMEsCppQLdcoZ2IOB7k9hXhOLBl1iO3uotL5MuK6qbc7YKuDk9ZyMcdk5ZE= X-Gm-Gg: AY/fxX6MRL41Yd0YaFrKN6eI2M1w0UYueBthg0kHZh9rIDFs+goYFGTk1TxKNO2M8+D gPavTnhpLwWedqXL1HZMyB+ww+H1CZpjvhtH8bSakKuJM7IdV608I+H5fl/yIIbll/w7sHBhxAl W8maUL4A15zCGJifUJomY3M/jRHfwZRltMrKvwpsV9l0+zSUP2LBc/0fOFHo1wzMOTnfxNSjH+k uZ2xEfSwW5TD401X8UDZtDyJ7mv6q3XPIoXqIy/l39UGhzYOJykU7p666vByP4TEW+7MQDDFXDp ZvvH4OCfKEUbr0mUUsxjL1Z0EwqhM8hESUZJzdTxRNR0lnN55/KvNzLQOv4F6D0plIiDrfu6C/B npEJNK0MU2J64lhZq/budJnxyjyQltJh9VmkPK8AmMFQrxVZuqcMOK3W5rFSWpBhSIKWoN8jyRe CtC+Zffgt/So9837mrSGsHIdY= X-Received: by 2002:ac8:7d06:0:b0:4ee:24fc:bea3 with SMTP id d75a77b69052e-4ffa770d84fmr20866221cf.35.1767661288612; Mon, 05 Jan 2026 17:01:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGRIkm3qB3iAMhjMsr9K7RBdmhsGoeWiJuR1zZQW9HRAWrshi4AJ0+6RJy7rL89ggSBiDVrw== X-Received: by 2002:ac8:7d06:0:b0:4ee:24fc:bea3 with SMTP id d75a77b69052e-4ffa770d84fmr20865361cf.35.1767661287983; Mon, 05 Jan 2026 17:01:27 -0800 (PST) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59b65cea8b1sm181082e87.6.2026.01.05.17.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jan 2026 17:01:25 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 06 Jan 2026 03:01:14 +0200 Subject: [PATCH v2 04/14] wifi: ath10k: snoc: support powering on the device via pwrseq 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: quoted-printable Message-Id: <20260106-wcn3990-pwrctl-v2-4-0386204328be@oss.qualcomm.com> References: <20260106-wcn3990-pwrctl-v2-0-0386204328be@oss.qualcomm.com> In-Reply-To: <20260106-wcn3990-pwrctl-v2-0-0386204328be@oss.qualcomm.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz , Jeff Johnson , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , Vinod Koul , Balakrishna Godavarthi , Matthias Kaehlcke Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-pm@vger.kernel.org, Krzysztof Kozlowski , Bartosz Golaszewski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4482; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=vGKw+wEv4m8AuXcSbM8ug5QUp/CDr75AFUCT++yOsvs=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBpXF7Z98G7nWfKXlYg2gNCIQMwgRzHPZzJbxVnJ z1q/ZSkHjaJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaVxe2QAKCRCLPIo+Aiko 1fEZB/4tvPMVzx1O9X5hVg4SC8qKvMxE3IAdsH/tCrsqATAl0+wRT2TyB9Hn7GAeWvGOctHu3iH Wz1nzZlcEEGfMaeWu5SwWMpltRfuQ30OmP73iSkLDJIyDkaYgNS18F1gFf+O6ny0yTUySKvTrcD yyXDgiHMM2btCQT/nwRoSHoTn9L8puSf+qIsWNnwNXcYhQ//We6KROhs35aw/OlL/hwOSrlP/S/ 5HwYUn/Y4mmzJ5Htk1E8M+w9R1szu/pRNZ3IJKY3GuKUB9KSiWfh873JV70NTtpLblRXY42mIM+ v4EhUqx2idwTvvn1tfM66om+MAtEwG9gtY9dLCdkm/h9l9Pv X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=M89A6iws c=1 sm=1 tr=0 ts=695c5ee9 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=JZG1H6jYz0umZupwJd8A:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA2MDAwNyBTYWx0ZWRfX234rgccvC1d5 KxLoqD97mk9s4AsKzX6K85O2uvGx7+0gcYpJYr62c3o0yAYc2CDgT4OvpWoVFzo5kwlJjlD2k// 6gCereo1SJtifoBeS/U7MM50zijpVf0/rQNEEap9N0A32Er66rAWviYmyMhT1qV9Wo+6KxHZr/+ L0N5oTrPwAYcazQifMAemxWos2twoYX4U9gTcMob5JyfpT8FhmwDkKKoa6+i86tVA8EvGtb4vy8 ozVgH24Rtgdcdb6KnNnudtRf19J45b05o4UTOMW+ObARKiTVS0OMl9oSBWAdy9wJewqvCoekeZw yPGQS1SteYjnPwwUoeqWPvfW06/Qpnj9xuiOKCILMcVW0hb66bt0Z904x8DNUUeqsoBtICtDRH7 f0wMMHCTf9x8ksFQ5+FI1hp3R6+LdUEcJyYr3Id4r0eiubJa1R+Vhd/aYhImMMD4+4XyxIo9b0E qE7FIw6CZTD/Ht3Hxbw== X-Proofpoint-ORIG-GUID: PaR7GffQVStQ_VAdqxSJFesUKzl_8t76 X-Proofpoint-GUID: PaR7GffQVStQ_VAdqxSJFesUKzl_8t76 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-05_02,2026-01-05_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 priorityscore=1501 phishscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601060007 The WCN39xx family of WiFi/BT chips incorporates a simple PMU, spreading voltages over internal rails. Implement support for using powersequencer for this family of ATH10k devices in addition to using regulators. Reviewed-by: Bartosz Golaszewski Signed-off-by: Dmitry Baryshkov --- drivers/net/wireless/ath/ath10k/snoc.c | 54 ++++++++++++++++++++++++++++++= ++-- drivers/net/wireless/ath/ath10k/snoc.h | 2 ++ 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/= ath/ath10k/snoc.c index b3f6424c17d3..3600c8eb19a3 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1023,9 +1024,15 @@ static int ath10k_hw_power_on(struct ath10k *ar) =20 ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power on\n"); =20 + if (ar_snoc->pwrseq) { + ret =3D pwrseq_power_on(ar_snoc->pwrseq); + if (ret) + return ret; + } + ret =3D regulator_bulk_enable(ar_snoc->num_vregs, ar_snoc->vregs); if (ret) - return ret; + goto pwrseq_off; =20 ret =3D clk_bulk_prepare_enable(ar_snoc->num_clks, ar_snoc->clks); if (ret) @@ -1035,18 +1042,28 @@ static int ath10k_hw_power_on(struct ath10k *ar) =20 vreg_off: regulator_bulk_disable(ar_snoc->num_vregs, ar_snoc->vregs); +pwrseq_off: + pwrseq_power_off(ar_snoc->pwrseq); + return ret; } =20 static int ath10k_hw_power_off(struct ath10k *ar) { struct ath10k_snoc *ar_snoc =3D ath10k_snoc_priv(ar); + int ret_seq =3D 0; + int ret_vreg; =20 ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power off\n"); =20 clk_bulk_disable_unprepare(ar_snoc->num_clks, ar_snoc->clks); =20 - return regulator_bulk_disable(ar_snoc->num_vregs, ar_snoc->vregs); + ret_vreg =3D regulator_bulk_disable(ar_snoc->num_vregs, ar_snoc->vregs); + + if (ar_snoc->pwrseq) + ret_seq =3D pwrseq_power_off(ar_snoc->pwrseq); + + return ret_vreg ? : ret_seq; } =20 static void ath10k_snoc_wlan_disable(struct ath10k *ar) @@ -1762,7 +1779,38 @@ static int ath10k_snoc_probe(struct platform_device = *pdev) goto err_release_resource; } =20 - ar_snoc->num_vregs =3D ARRAY_SIZE(ath10k_regulators); + /* + * devm_pwrseq_get() can return -EPROBE_DEFER in two cases: + * - it is not supposed to be used + * - it is supposed to be used, but the driver hasn't probed yet. + * + * There is no simple way to distinguish between these two cases, but: + * - if it is not supposed to be used, then regulator_bulk_get() will + * return all regulators as expected, continuing the probe + * - if it is supposed to be used, but wasn't probed yet, we will get + * -EPROBE_DEFER from regulator_bulk_get() too. + * + * For backwards compatibility with DTs specifying regulators directly + * rather than using the PMU device, ignore the defer error from + * pwrseq. + */ + ar_snoc->pwrseq =3D devm_pwrseq_get(&pdev->dev, "wlan"); + if (IS_ERR(ar_snoc->pwrseq)) { + ret =3D PTR_ERR(ar_snoc->pwrseq); + ar_snoc->pwrseq =3D NULL; + if (ret !=3D -EPROBE_DEFER) + goto err_free_irq; + + ar_snoc->num_vregs =3D ARRAY_SIZE(ath10k_regulators); + } else { + /* + * The first regulator (vdd-0.8-cx-mx) is used to power on part + * of the SoC rather than the PMU on WCN399x, the rest are + * handled via pwrseq. + */ + ar_snoc->num_vregs =3D 1; + } + ar_snoc->vregs =3D devm_kcalloc(&pdev->dev, ar_snoc->num_vregs, sizeof(*ar_snoc->vregs), GFP_KERNEL); if (!ar_snoc->vregs) { diff --git a/drivers/net/wireless/ath/ath10k/snoc.h b/drivers/net/wireless/= ath/ath10k/snoc.h index d4bce1707696..eeaa1c009cb0 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.h +++ b/drivers/net/wireless/ath/ath10k/snoc.h @@ -53,6 +53,7 @@ enum ath10k_snoc_flags { }; =20 struct clk_bulk_data; +struct pwrseq_desc; struct regulator_bulk_data; =20 struct ath10k_snoc { @@ -73,6 +74,7 @@ struct ath10k_snoc { struct ath10k_snoc_ce_irq ce_irqs[CE_COUNT_MAX]; struct ath10k_ce ce; struct timer_list rx_post_retry; + struct pwrseq_desc *pwrseq; struct regulator_bulk_data *vregs; size_t num_vregs; struct clk_bulk_data *clks; --=20 2.47.3