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 782D32367B5 for ; Fri, 4 Sep 2026 13:59:43 +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=1788530385; cv=none; b=Qa6fNGR6Ol9NHhv523j1AIsShRBwItUn6IwK802WxgxuOswA5FNc3m7y84d+IMdYYnPGubxgZBXLnDGOW03pP+eRrCR2RD26nw5adkxgKCc+3I3lAAHDjS6C4o+pPHYkBGFStp0IARQw4IOLcnMzzWxfkNgIF07uelDgTR3ONyo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788530385; c=relaxed/simple; bh=7pCFeF+gU3ZAuL7WEqKYbLZ08IsQzpqKN5xp8+HwQ+U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lO/6OSXZoGaJw/i706IwSUDyOBjtEyMXNl8U8xXArsQZFl3dQjwVJVzwP7tV/bs+D6RdIFN2dTWq529IgP5HOaj0VzaK4ieYuGrLc/MEngVXkKg37u6xhCGT8ZM7vz6WJ8eZWTu/EJKVaMaBdG9BxHkPqH9Tx9MyZaH6AXkm1zU= 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=T51kJztQ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AdHf24i0; 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="T51kJztQ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AdHf24i0" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 684DgifY3719425 for ; Fri, 4 Sep 2026 13:59:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=4RMHhI2ZfjbNe1CKw5LT3jL0 mAhEr4O/HrQd7u9Jkos=; b=T51kJztQDFgdxHc7U69v8uKcn/eLjcz87y31AZPi TtmMVaQfCwx8h5XjI4zLzn1l9GnOFahIoXY5XY4b/5t25L63PDshmCPZxEjr6zkp 0efMrcLrcmIl4R/aL4Jf2ygmQyIklH7MOHL9KK7bUN9e1rU5VGQdFV5602hsLwY+ /tZMrjTZ+/MoMVTXN/wkjjw4H68Wn2OFkBilA0QFHMdjWO2h/82Zlvw9rBw/8ypI 3nBcPPgn/g2rqkdkkvrfkZLe5DAroUxixwM0FEjS54SVLxFoXNr5bu28ZanZysms gSN8H4Pl9aXR0N0DzOdiXcS6sA0+cd7N5toyiUTVwC293A== Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gfqqd1wq0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 04 Sep 2026 13:59:42 +0000 (GMT) Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-5c670254c88so939617e0c.2 for ; Fri, 04 Sep 2026 06:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788530380; x=1789135180; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=4RMHhI2ZfjbNe1CKw5LT3jL0mAhEr4O/HrQd7u9Jkos=; b=AdHf24i00YjdKqv8KP+HvVjxZMNJYwCGkPkb7dvg1d4FhUykpzdjy2HXCS2hNlNECg Bw6wslOc6XTlxYxEn8z3MrtcpjhOEfiVm0Yjh5WnfomRSm/0ZCZgTElRgeoQf8mmWBbG n307Pi/IFt+VzrPnabD/9gqalDQhwuSB1yFxB4zQjZabY/xTEg8gwU67e28ZJUiv3/GK EyIBrhCIPmA1vOPDlo9UeNtil2bRA2Hcd/3R45u9/hKhuahe+8s61vuCBNLQGyvABbT8 T+1QNQIv3xxVMFWZlG+KGFGhqnvTYzpRYKBE6HLy5BcJmRYExOz8z6QRH0zwctwo5JYG +fQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788530380; x=1789135180; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4RMHhI2ZfjbNe1CKw5LT3jL0mAhEr4O/HrQd7u9Jkos=; b=tFtPVX5NcJ7HZVFtVvHj0m0kUj83W3wBGNdwvYHBlkBlFQZBQyY+lpNjMgXHr1IT/K BhVCqSUbOyEg7pvui8p8BjEmyeqlnmRPNn+EmAqlQ3PV1Z7ByBMMsyktFPlRcLuUo5D+ eVLFOwpIz4dN1v4dMcuLXpp9Q5YO6RtNJz16wjm7hi5/oZXZtjmfUOgftxsS8q6azhOs QLVoz4qpvhK6X8IIKz/JLBrmE6xHko9yl9bg3wzXptl/KBRmZsqJDEmj8wmbRPzbN16c +VDd5/FNT3pjZiVfwrueagJSvKOGlQYHFALrEkKvD+lazYHCPWG1zCO6T1Kd20dn4PP8 Cbzw== X-Forwarded-Encrypted: i=1; AKwUvByJBDJM3tA4iD2H6FWI9vmzjrPaTXKTj65ajGY2KuRlMaU5DWxjHPjMgpw/R5pBhSR5Suhr5gJaU49J@vger.kernel.org X-Gm-Message-State: AFuF++lV8uWkVnynLMW/RYuKGoBWIFTsfkSh+ju/R8N6/QdjG5PG/XEV i9NGcDr1Nr5cJoXCmzfqG94123TUBUn9nSWKTtTsxoFqXCMUqvKloGXmGdyruVCbw38HMH85eUw 5fPBRMJ0ouohraCyDF+fREAz55rCFp7IDwrg1MzWCZvYQh9IpfqB2lUyzVS8BEKaZ X-Gm-Gg: AYBFou1Sa4hSWaCyfpOYb8Fic46fOmuNySWB7DY1JL8jpkMo40gX4yi/PU6g/dyDOXY Ebf8y/rnTPEOPP2PHZaKXp5QbKOQSOc45MbA+egtMDUBY6AYWviBQMHjaDeBTVw9LbiDkb0gNaz V3m08tz8/DRpY3SsEqj2PPBE/Xc6my9bwdKtkviDArfnM7JBWXD8DeyBRtjrHA9J89a5LbVnbDk JSnX3BN1nj+7ymG07XIZ997kmbBuBOIgGkVlJy5QmVwn7d4wCZzHi9FaFudgjIF/Xt+2PwAKIQI ZwcfnbdS1EtPObicijsrl/oxkxaA43cnGwPJOt61Bi1lyNTccjVrOy7vfejyrKaeWqcMWosydxI DsmXHE9k44HPY9g== X-Received: by 2002:a05:6102:b02:b0:786:c86c:4f5e with SMTP id ada2fe7eead31-78a4a6e7023mr2348236137.3.1788530380571; Fri, 04 Sep 2026 06:59:40 -0700 (PDT) X-Received: by 2002:a05:6102:b02:b0:786:c86c:4f5e with SMTP id ada2fe7eead31-78a4a6e7023mr2348208137.3.1788530380019; Fri, 04 Sep 2026 06:59:40 -0700 (PDT) Received: from localhost ([188.216.77.92]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cee7fec25sm172877955e9.13.2026.09.04.06.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 06:59:38 -0700 (PDT) Date: Fri, 4 Sep 2026 15:59:38 +0200 From: Lorenzo Bianconi To: Bjorn Helgaas Cc: Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chaitanya Chundru , Linus Walleij , Bartosz Golaszewski , Bjorn Andersson , Konrad Dybcio , Michael Walle , Alex Elder , Daniel Thompson , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 3/5] PCI/pwrctrl: tc9563: add GPIO auxiliary device support Message-ID: References: <20260903-pci-tc9563-aux-v2-3-34c625b542c1@oss.qualcomm.com> <20260903211718.GA2247285@bhelgaas> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VXoiADj/XRej++0X" Content-Disposition: inline In-Reply-To: <20260903211718.GA2247285@bhelgaas> X-Authority-Analysis: v=2.4 cv=XtnK/1F9 c=1 sm=1 tr=0 ts=6a9acece cx=c_pps a=JIY1xp/sjQ9K5JH4t62bdg==:117 a=WpTaRW6qxYHRGzLzQsVYzg==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=1XWaLZrsAAAA:8 a=h4XguDUzrQ5YFVcWg1QA:9 a=CjuIK1q_8ugA:10 a=JwWWi_KuMMMZo6bZ-A0A:9 a=tNoRWFLymzeba-QzToBc:22 X-Proofpoint-GUID: Ub-SyxLs9RmaCgSKzBlrE3A8EEcOF_Mi X-Proofpoint-ORIG-GUID: Ub-SyxLs9RmaCgSKzBlrE3A8EEcOF_Mi X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA0MDEyNyBTYWx0ZWRfX0jKgzsM7zTVr R5pWdEo+IT5qj/KWGCIeFQeysC7IiR8el+31K0hyOQ4XMcnyWB23NCHYUbpjTZKuaoYeUcXEMRb GWOF/0JTUiANJFk3r/+22B3ZjF3mB9Y= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA0MDEyNyBTYWx0ZWRfX44peKiLb4Lh2 PcGEsl1xq8pEhb81AvYIX4fEJPZS3BLU8DYHZWXDoVYI6tRUSght+T8V/ou7Hr/Pg/YQgWHtpPA 5hTKakloMVSBnzwAbhI9FaBaoPS5Qabnahgw5m/m01jD34J0dpWHKP9lkACEzYEysvfj9gD28IS 8sgwMlBC6hkp/RXfiwga+UVQfhVlEpXhu7tFWzzV5ZnhfKDdDqlstjbiGH9G5t5h5nD8dz9VRgm r2Kc0Okdmelqtmp5DJjEu+gHccrPxlCwmFLklwb7xzeKbcPpJsx+R1VlMBCM0JnzteRR7VIcom0 jxN4UBkRdZWrK6Hwyb/5NjUZ8Gj2JTEkfZBSVCN3/UjP/+ugXIU/hRiWSTk42TlAgPgU35pMUXX m8z8t2jEigScP8pjL00MiSKBNajc4A== 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 phishscore=0 suspectscore=0 malwarescore=0 spamscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609040127 --VXoiADj/XRej++0X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Thu, Sep 03, 2026 at 09:52:59AM +0200, Lorenzo Bianconi wrote: > > The TC9563 embeds a GPIO controller used for per-port reset signals. > > Create an auxiliary device for it so the gpio-tc9563 driver can > > register the GPIO chip and enable DT-based GPIO lookups. Pass the > > tc9563 regmap to the auxiliary device as its platform data. > >=20 > > The downstream port DT parsing loop gains an of_node_is_type() filter > > to skip non-PCI child nodes such as the GPIO controller node. >=20 > "Add an of_node_is_type() filter in the downstream port DT parsing > loop ..." to match the rest. Or even just "Skip non-PCI nodes such as > GPIO controller nodes when parsing downstream port DT". ack, I will fix it in v2. >=20 > > The pwrctrl driver does not wait for the GPIO chip to be probed. The > > per-port reset GPIO lookup, returning -EPROBE_DEFER until the chip is > > registered, is added in the next patch. > >=20 > > Select AUXILIARY_BUS and GPIO_TC9563 in Kconfig. > >=20 > > Signed-off-by: Lorenzo Bianconi >=20 > What's the merge strategy? I guess this depends on the previous > drivers/gpio patches because they add linux/soc/qcom/tc9563.h, which > this patch uses, so they all have to go together? Yes, right. I guess all of the series can go via pci tree if gpio maintaine= rs are fine with that. >=20 > Capitalize "Add GPIO ..." in the subject to match the history, then ack, I will fix it in v2. >=20 > Acked-by: Bjorn Helgaas >=20 > > --- > > drivers/pci/pwrctrl/Kconfig | 1 + > > drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c | 80 ++++++++++++++++++++++++= ++++++-- > > 2 files changed, 78 insertions(+), 3 deletions(-) > >=20 > > diff --git a/drivers/pci/pwrctrl/Kconfig b/drivers/pci/pwrctrl/Kconfig > > index 1952ab4f29b6..38aab596aa04 100644 > > --- a/drivers/pci/pwrctrl/Kconfig > > +++ b/drivers/pci/pwrctrl/Kconfig > > @@ -29,6 +29,7 @@ config PCI_PWRCTRL_TC9563 > > select PCI_PWRCTRL > > default m if ARCH_QCOM > > depends on I2C > > + depends on GPIO_TC9563 > > select REGMAP_I2C > > help > > Say Y here to enable the PCI Power Control driver of TC9563 PCIe > > diff --git a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c b/drivers/pci/pwr= ctrl/pci-pwrctrl-tc9563.c > > index b0d8912690a2..6df512d78b54 100644 > > --- a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c > > +++ b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c > > @@ -4,11 +4,13 @@ > > */ > > =20 > > #include > > +#include > > #include > > #include > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -20,12 +22,10 @@ > > #include > > #include > > #include > > +#include >=20 > Alphabetize in with the rest of the #includes. ack, I will fix it in v2. Regards, Lorenzo >=20 > > =20 > > #include "../pci.h" > > =20 > > -#define TC9563_GPIO_CONFIG 0x801208 > > -#define TC9563_RESET_GPIO 0x801210 > > - > > #define TC9563_PORT_L0S_DELAY 0x82496c > > #define TC9563_PORT_L1_DELAY 0x824970 > > =20 > > @@ -393,6 +393,73 @@ static int tc9563_pwrctrl_parse_device_dt(struct d= evice_node *node, > > return 0; > > } > > =20 > > +static void tc9563_pwrctrl_adev_release(struct device *dev) > > +{ > > + struct auxiliary_device *adev =3D to_auxiliary_dev(dev); > > + > > + of_node_put(adev->dev.of_node); > > + kfree(adev); > > +} > > + > > +static void tc9563_pwrctrl_adev_remove(void *data) > > +{ > > + struct auxiliary_device *adev =3D data; > > + > > + auxiliary_device_delete(adev); > > + auxiliary_device_uninit(adev); > > +} > > + > > +static int tc9563_pwrctrl_adev_add(struct device *dev, const char *nam= e, > > + u32 id, struct device_node *of_node, > > + void *priv_data) > > +{ > > + struct auxiliary_device *adev; > > + int ret; > > + > > + adev =3D kzalloc_obj(*adev); > > + if (!adev) > > + return -ENOMEM; > > + > > + adev->id =3D id; > > + adev->name =3D name; > > + adev->dev.parent =3D dev; > > + adev->dev.platform_data =3D priv_data; > > + adev->dev.release =3D tc9563_pwrctrl_adev_release; > > + adev->dev.of_node =3D of_node_get(of_node); > > + > > + ret =3D auxiliary_device_init(adev); > > + if (ret) { > > + of_node_put(adev->dev.of_node); > > + kfree(adev); > > + return ret; > > + } > > + > > + ret =3D auxiliary_device_add(adev); > > + if (ret) { > > + auxiliary_device_uninit(adev); > > + return ret; > > + } > > + > > + return devm_add_action_or_reset(dev, tc9563_pwrctrl_adev_remove, adev= ); > > +} > > + > > +static int tc9563_pwrctrl_add_gpio_adev(struct tc9563_pwrctrl *tc9563) > > +{ > > + struct device *dev =3D tc9563->pwrctrl.dev; > > + struct fwnode_handle *fwnode; > > + int ret; > > + > > + fwnode =3D gpiochip_node_get_first(dev); > > + if (!fwnode) > > + return 0; > > + > > + ret =3D tc9563_pwrctrl_adev_add(dev, TC9563_GPIO_DEV_NAME, 0, > > + to_of_node(fwnode), tc9563->regmap); > > + fwnode_handle_put(fwnode); > > + > > + return ret; > > +} > > + > > static int tc9563_pwrctrl_power_off(struct pci_pwrctrl *pwrctrl) > > { > > struct tc9563_pwrctrl *tc9563 =3D container_of(pwrctrl, > > @@ -565,6 +632,9 @@ static int tc9563_pwrctrl_probe(struct platform_dev= ice *pdev) > > */ > > port =3D TC9563_USP; > > for_each_child_of_node_scoped(node, child) { > > + if (!of_node_is_type(child, "pci")) > > + continue; > > + > > if (++port >=3D TC9563_MAX) > > break; > > =20 > > @@ -596,6 +666,10 @@ static int tc9563_pwrctrl_probe(struct platform_de= vice *pdev) > > tc9563->pwrctrl.power_on =3D tc9563_pwrctrl_power_on; > > tc9563->pwrctrl.power_off =3D tc9563_pwrctrl_power_off; > > =20 > > + ret =3D tc9563_pwrctrl_add_gpio_adev(tc9563); > > + if (ret) > > + goto remove_i2c; > > + > > ret =3D devm_pci_pwrctrl_device_set_ready(dev, &tc9563->pwrctrl); > > if (ret) > > goto power_off; > >=20 > > --=20 > > 2.55.0 > >=20 --VXoiADj/XRej++0X Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaprOygAKCRA6cBh0uS2t rIY/AP0fU8j6Qo/YEywAp/ZkDDvk9lcJmRDc7tUAlt8NEnh7XAD+Kyg/S1IVYqkZ DVuwwVt67UDrac7CTDeIMgzWtPusKgQ= =Zf0R -----END PGP SIGNATURE----- --VXoiADj/XRej++0X--