Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4baeb13 authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: add snapshot of qpnp-pdphy and policy_engine drivers



The qpnp-pdphy driver provides support for the PD PHY peripheral
found on Qualcomm Technologies, Inc. PMICs. This along with
the policy engine provides a protocol stack that supports
USB Power Delivery communication over a Type-C port.

This snapshot is taken as of msm-4.4
commit 312981bf914f ("ARM: dts: msm: Add sdhc ice device node for
sdm660").

Change-Id: I0a34076dee8476494dfccfe6fc807247caab8927
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 6d3ad968
Loading
Loading
Loading
Loading
+67 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. QPNP PD PHY - USB Power Delivery Physical layer

Required properties:
- compatible:		Must be "qcom,qpnp-pdphy"
- reg:			The base address for this peripheral
- vdd-pdphy-supply:	phandle to the VDD supply regulator node
- interrupts:		Specifies the interrupt associated with the peripheral.
- interrupt-names:	Specifies the interrupt names for the peripheral. Every
			available interrupt needs to have an associated name
			with it to indentify its purpose.

			The following interrupts are required:

			0: sig-tx
				Triggers when a signal (HardReset or CableReset)
				has been sent.
			1: sig-rx
				Triggers when a signal has been received.
			2: msg-tx
				Triggers when a message has been sent and the
				related GoodCRC has been received.
			3: msg-rx
				Triggers when a message has been received and
				the related GoodCRC was sent successfully.
			4: msg-tx-failed
				Triggers when a message failed all its
				transmission attempts, either due to a non-idle
				bus or missing GoodCRC reply.
			5: msg-tx-discarded
				Triggers when a message is received while a
				transmission request was in place. The request
				itself is discarded.
			6: msg-rx-discarded
				Triggers when a message was received but had to
				be discarded due to the RX buffer still in use
				by SW.

Optional properties:
- vbus-supply:		Regulator that enables VBUS source output
- vconn-supply:		Regulator that enables VCONN source output. This will
			be supplied on the USB CC line that is not used for
			communication when Ra resistance is detected.
- qcom,vconn-uses-external-source: Indicates whether VCONN supply is sourced
			from an external regulator. If omitted, then it is
			assumed it is connected to VBUS.

Example:
	qcom,qpnp-pdphy@1700 {
		compatible = "qcom,qpnp-pdphy";
		reg = <0x1700 0x100>;
		vdd-pdphy-supply = <&pm8998_l24>;
		interrupts = <0x2 0x17 0x0 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x17 0x1 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x17 0x2 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x17 0x3 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x17 0x4 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x17 0x5 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x17 0x6 IRQ_TYPE_EDGE_RISING>;

		interrupt-names = "sig-tx",
				  "sig-rx",
				  "msg-tx",
				  "msg-rx",
				  "msg-tx-failed",
				  "msg-tx-discarded",
				  "msg-rx-discarded";
	};
+2 −0
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ source "drivers/usb/chipidea/Kconfig"

source "drivers/usb/isp1760/Kconfig"

source "drivers/usb/pd/Kconfig"

comment "USB port drivers"

if USB
+2 −0
Original line number Diff line number Diff line
@@ -61,3 +61,5 @@ obj-$(CONFIG_USB_GADGET) += gadget/
obj-$(CONFIG_USB_COMMON)	+= common/

obj-$(CONFIG_USBIP_CORE)	+= usbip/

obj-$(CONFIG_USB_PD)            += pd/

drivers/usb/pd/Kconfig

0 → 100644
+29 −0
Original line number Diff line number Diff line
#
# USB Power Delivery driver configuration
#
menu "USB Power Delivery"

config USB_PD
	def_bool n

config USB_PD_POLICY
	tristate "USB Power Delivery Protocol and Policy Engine"
	depends on EXTCON
	depends on DUAL_ROLE_USB_INTF
	select USB_PD
	help
          Say Y here to enable USB PD protocol and policy engine.
	  This driver provides a class that implements the upper
	  layers of the USB Power Delivery stack. It requires a
	  PD PHY driver in order to transmit and receive PD
	  messages on its behalf.

config QPNP_USB_PDPHY
	tristate "QPNP USB Power Delivery PHY"
	depends on SPMI
	help
          Say Y here to enable QPNP USB PD PHY peripheral driver
	  which communicates over the SPMI bus. The is used to handle
	  the PHY layer communication of the Power Delivery stack.

endmenu
+6 −0
Original line number Diff line number Diff line
#
# Makefile for USB Power Delivery drivers
#

obj-$(CONFIG_USB_PD_POLICY)	+= policy_engine.o
obj-$(CONFIG_QPNP_USB_PDPHY)	+= qpnp-pdphy.o
Loading