From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5A19D3F1AD0; Tue, 19 May 2026 10:52:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779187964; cv=none; b=o1uIAlss0TJbWqjCgrcHHYfWXPj1agKTV+4TMD4Z77Fb84n1nkX7uCmKH1AFtk456s8fjxuoKCJSF6/oj40E9a6LtdyJKC97mtO8l2RpI7tUexYKM/KRW0jPfUvfIZvDL11u6MBvvjwEnoTtSVxN9284HYgabcArkw1BNAsjdtY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779187964; c=relaxed/simple; bh=Cy2/bPs/rSok9uMT/gK2sDe+hS8oVGB88lo6zGkQOmc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JBhdnZ/Otf+6QzZ8FiIE+xQkreJt5gk/rVCgqFmyo1/2W8FX2izoQhmIM3b+rS8ZH96b6jjQReOh43n4g0S6UKVQBv+QGx5TrdDNi65CDLMLKzNCmGd0p3lrk5YXTuKXIRnoWC50bk8+t6FOM+5tsSyt0yoxiPsqlJuDbVZDPrs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kWz7Kx5T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kWz7Kx5T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E209C2BCC6; Tue, 19 May 2026 10:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779187963; bh=Cy2/bPs/rSok9uMT/gK2sDe+hS8oVGB88lo6zGkQOmc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kWz7Kx5TVLlWVu72GY9voiMhxIyEuEm9imAfQlzZYq+bxM21xfMAVwAl3zvQbZEUZ JOcHNGebtV4o6d8OG2PEuWvhTI5tMTgZywq/yvA/YTEjtAgN0I8TZinb/zOVLMpQG2 lMVcdeSxgb15YzHeGfpNg63ryBWav5NmIPgdlW40YXPFmn887JvuqvtKW81x/Q7qH8 8sLNVflNCsJ63BzbZQvdyIgX0SGpFFgeFrJSqSnQ6LDAAEIYKRLs/xTI+VbXMTxmc4 cHwvSyDIThKz9M+NCbVJyeSKAqU1k6uh3S80K/Xa6FQDUlyp+02SWk0/ReZbfK21gW PzWbQMCgRqqWQ== Date: Tue, 19 May 2026 12:52:41 +0200 From: Krzysztof Kozlowski To: taygoth Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown , Liam Girdwood , Wesley Cheng , Greg Kroah-Hartman , Heikki Krogerus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Bryan O'Donoghue , Casey Connolly Subject: Re: [PATCH 3/6] usb: typec: add Qualcomm PMI8998 role-switch driver Message-ID: <20260519-adaptable-beneficial-emu-00da28@quoll> References: <6fedbcd344505b63de72037f69ea94f916255f03.1779127507.git.taygoth@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6fedbcd344505b63de72037f69ea94f916255f03.1779127507.git.taygoth@gmail.com> On Tue, May 19, 2026 at 01:22:48AM +0500, taygoth wrote: > The Qualcomm PMI8998 PMIC integrates a USB Type-C detection block in > its SMB2 charger USBIN region at offset 0x1300. The block performs CC > sensing, debounce and Rp/Rd resolution in silicon and reports role > changes through a single consolidated "type-c-change" interrupt. > > This driver reads TYPE_C_STATUS_4 on probe and on every interrupt, > decodes the hardware-detected role (host / device / none) and pushes > it to a usb_role_switch consumer (typically dwc3) so the controller > can flip between peripheral and host on cable orientation change. An > optional VBUS supply regulator is toggled on USB_ROLE_HOST transitions > so bus-powered downstream peripherals can be powered. > > No software TCPM state machine is used because the hardware handles > the Type-C protocol natively, and the PMI8998 interrupt topology does > not expose the granular per-event signals the TCPM code path expects. > Power Delivery is not implemented in this driver; the PMI8998 PDPHY > block at offset 0x1700 (register-identical to PM8150B) can be wired > up by a separate driver later if PD negotiation is required. > > This enables USB host mode on the OnePlus 6 (enchilada), OnePlus 6T > (fajita), Xiaomi Poco F1 (beryllium), SHIFT 6mq (axolotl) and other > SDM845-based phones that use the PMI8998 as their second PMIC. > > Signed-off-by: taygoth Incomplete identity. > --- > drivers/usb/typec/Kconfig | 17 ++ > drivers/usb/typec/Makefile | 1 + > drivers/usb/typec/qcom_pmi8998_typec.c | 213 +++++++++++++++++++++++++ > 3 files changed, 231 insertions(+) > create mode 100644 drivers/usb/typec/qcom_pmi8998_typec.c Do not mix up subsystems which take entire sets in one patchset. USB patches should be split. Best regards, Krzysztof