From nobody Tue Feb 10 05:10:02 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 3C99E2E0B71 for ; Tue, 30 Dec 2025 23:36:14 +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=1767137776; cv=none; b=BYKDdUqnFrLIMfuGZAsCFCbJiVPlu8ZPrpcBVG8gvydKcCoU2FYvi9lSbrhW+3trEyzurxidviZLqSxOh0wbgb1Ce9BtbNr8YaBfkQLFUIgVTZc/zuIJsWDUry/Ec4H5zNkeIMtAsaz66ai+tzkrqwS1UfOxT3dMaXKlHztc3KY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767137776; c=relaxed/simple; bh=7QSioEYvGLnmvEenw/yHYmMfZ9Xg0f5fS8NTJWat/EI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I1wMRGVxbfoQeBlArtyc3uXW4mAEYTcJivsCKiawj+AxS5jtAZXcSOiqjvjHi2/nviF55lYu/uzVkOVM6+Boewxwi+Yyk6VO7+XjdLyPCbLqajJI+WaJ6hb8EQ1GZmD+yn2agkKYoTfqBTM3fGy61Up0F+aaLe7ZT1+YUrbSfBI= 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=o0/OoV1O; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Lrf773ef; 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="o0/OoV1O"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Lrf773ef" 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 5BUNVxKs2392639 for ; Tue, 30 Dec 2025 23:36:13 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= T4CuQYcWJDm2WGHsZX04dpGhQA7HPPf+2qQrhA2V7ZQ=; b=o0/OoV1OThKPsxHz si//UThuoOCGVSMdE94/7+HwvXZCDVXhmqZnBBs2OGmVHCy+1F/ZooG3jXKK5YTt 4Whur72cD/C2Kt2nxFlSvBnPwxlYCKFEhsLSzb/mE8bbu05Tt7ML695ApiNdk6OE a3asbtKS54AZWJfiVXbGO9OVPqZNeqsUoTPD1Mh1nUbVIwzTfwImwiGTV94C+Wh7 ALdd6bHE/Wuwdmwa46G0u3myvVMSwLYsUTGFoaZsGApVuRX+vOmk+cr6Z+Ql4cco IYznBc2nfWWRPj2Lvl9Oj5L/EgdvqVX6o2gGcvlxHunIXz8lG+UpcEHc+QSduj75 fEYwDw== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bbqk1ccyf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 30 Dec 2025 23:36:13 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-4f4a92bf359so236069271cf.2 for ; Tue, 30 Dec 2025 15:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767137772; x=1767742572; 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=T4CuQYcWJDm2WGHsZX04dpGhQA7HPPf+2qQrhA2V7ZQ=; b=Lrf773efuYIpkGNnfqp6vYU2yha0poDjPYaY7kO7Y/8EA1jPCelsK5PG1Dm4wKSaxm dhZd0Bhks+oQZHA8MeAqYCFc+s65ilsQAiqjDCnOny0cv/kWp1Y7+b9RTVeD/4O/IY+c D5UbyS4qkH8LB7K7uFdwe1NvJ2RG6KJ7zV2HhOdtZ+71RW93BGGM6mW5D9Yq2lGYRUC9 s+AWoeboyme9fsRcPLgKyVDz/9iARp6h8BuaixKAQVdm6P+hs5Y+GwZVjGqBihz/Fs7H 7/LskoziO8lPQ/aFNNqybfi/x3js2JteUMBy7LtO8D+zRYY6tXQSDcIvm+rEBtX+baKp +6yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767137772; x=1767742572; 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=T4CuQYcWJDm2WGHsZX04dpGhQA7HPPf+2qQrhA2V7ZQ=; b=lsJZI3tuqbnu9qEbZFIKjOXMVDqLlcP1RPepQS7us8MwgL0BTqp1B0lIhoCQpxpwnD 29B/A+x4HFteJCuSO+zKLpAY9DMXeVmnxm/WUYisHGCL4Yd9Y6+T/Hrz4GPTSUCPDyOR Kzj+1EVWUfYCi3Y9zzmpKFiqRx8zSKNao9C7JRCf/rj5P7EhS5qv28p6dt4uS7DfckUW 5duUpp6ZHPJme2X/GNrFL+Ki+u6sBHEix7stmDh8BpSHI/1pjamhXsZnlU69BrSQriWO gMwyjj9crJLbY9MT0K+mzLdxoxAp6iqqprI8s/+encqP2EkHcJ3RUnvwwvqXYhDFJh/3 UPog== X-Forwarded-Encrypted: i=1; AJvYcCVEI5XNpAM9GGKZFR7cehoscQl6mwpmlVpNnPbTPxD8h6EF11rYKroRK/OP8VIX6dEtF7DEJT4ObTre2cs=@vger.kernel.org X-Gm-Message-State: AOJu0YzSkaWlBeFvfnJyj6aMIN5gXwb4lrXynztjyI+MrMjpzhWXHIya 5EhFVjzOzpzrAkY3eEH2IBXXzKS7NXRYkGMBj0IgAL5ouDH61dQrLAWbRn0wN0C/VJQKG6MR171 Oca9xcAA1BkO1MAxMcb4QDDX68aViC9dIVrppJBTzk4u01AUAe5WIkcZo6aLL89FLdeg= X-Gm-Gg: AY/fxX5YeEb5akKTZPQ6OTgX+jCA6FFBypcbBvkQrolEWCJHZDehDp2AnxkCvbep0Gz Je9PCH+bKNpEaNKcP9L20KbEUKx+JLFz71fmON6LuqIB47f6kxsEmNrk9dIwYOE6ftcCvNQDAv3 nVqlYbMKfN5PuM3ancbI2lMlDoaJmTCrVKD4Dr9wlBl1N4mIKosP9Ti0rXkpKdMZqhPzI3DJ890 WBXYChH/+6X4iiEgm3IXWRdq8pimGSfWn0zFbgnRVdCciWYvgbJ2or2awFD/JrSTqQ6xSYjOJP0 np+J97No+DjmAOOopVNUE/hykaK9fhPVIOjuKg0TpMrPITnaphpjbYHqLFaHG+aoNpfiLtyKbF8 a1dfF9cu+jfNUnG0+MTu5BXtGHyfYD1DItSkDgJ7C5A+OFvp2OGAyzRX3ByKuDCFHQ+wr876L+0 6tDiJxMcq7zPKGT4TgO0FKIMI= X-Received: by 2002:a05:622a:4d43:b0:4f1:b9e1:f08f with SMTP id d75a77b69052e-4f4abccef46mr678516781cf.5.1767137772363; Tue, 30 Dec 2025 15:36:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlDPU6Dqq5czWrRWiRVo3KDmDnZib/IbWQyj9oxLhrnXD3CT7PTTDOP/hBeaierKDJ77x3Ew== X-Received: by 2002:a05:622a:4d43:b0:4f1:b9e1:f08f with SMTP id d75a77b69052e-4f4abccef46mr678516561cf.5.1767137771935; Tue, 30 Dec 2025 15:36:11 -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-59a18620337sm10349574e87.86.2025.12.30.15.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Dec 2025 15:36:11 -0800 (PST) From: Dmitry Baryshkov Date: Wed, 31 Dec 2025 01:35:54 +0200 Subject: [PATCH 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: <20251231-wcn3990-pwrctl-v1-4-1ff4d6028ad5@oss.qualcomm.com> References: <20251231-wcn3990-pwrctl-v1-0-1ff4d6028ad5@oss.qualcomm.com> In-Reply-To: <20251231-wcn3990-pwrctl-v1-0-1ff4d6028ad5@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 X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3870; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=7QSioEYvGLnmvEenw/yHYm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ccMKe1KdLpb+AKWtCtWxS78KRJFI9g+Nu Nj2wMk7cheOEsoHlwyA++26jRUmKtXW4813pwfbbDB5njJ3oigX7abSadxCbeNiHyM2VOxexZ5R Rcr0uxXAGmJ5vUG4jCw== X-Authority-Analysis: v=2.4 cv=Tf6bdBQh c=1 sm=1 tr=0 ts=695461ed cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=Hs-j7k2oS4XMYd915dMA:9 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-GUID: fXVcIs1Ste8EySq0DXwIglYTAJ--EdIz 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=2025-12-30_04,2025-12-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 impostorscore=0 suspectscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512300211 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. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bartosz Golaszewski --- drivers/net/wireless/ath/ath10k/snoc.c | 43 ++++++++++++++++++++++++++++++= +--- drivers/net/wireless/ath/ath10k/snoc.h | 2 ++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/= ath/ath10k/snoc.c index b3f6424c17d3..919d4b0b87cd 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,27 @@ static int ath10k_snoc_probe(struct platform_device = *pdev) goto err_release_resource; } =20 - ar_snoc->num_vregs =3D ARRAY_SIZE(ath10k_regulators); + /* + * Backwards compatibility, ignore the defer error from pwrseq, if it + * should be used, we will get an error from regulator get. + */ + 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