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

Commit 75631018 authored by Umang Agrawal's avatar Umang Agrawal
Browse files

power: qpnp-typec: Add snapshot of qpnp-typec driver



This is snapshot of the qpnp-typec driver as of msm-3.18
commit a1898eec073a ("power: qpnp-typec: add support for QPNP Type-C
module").
While at it, fix minor structure declaration error.

Change-Id: If0bb3a082f113f5860f7aabfc753565752dde58e
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent 098abe14
Loading
Loading
Loading
Loading
+61 −0
Original line number Original line Diff line number Diff line
QPNP USB Type-C module

QPNP USB Type-C module supports USB type-c ports and detection of
USB Type-C chargers that can supply upto 3A Vbus current for charging.

The QPNP USB Type-C interfaces via the SPMI bus.

Required properties :
- compatible : Must be "qcom,qpnp-typec"
- reg:			The SPMI address for this peripheral
- 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.

			- vrd-change:		Triggers on change in current
						capability of charger.
			- ufp-detach:		Triggers on cable detach in
						UFP mode.
			- ufp-detect:		Triggers on charger insertion.
			- dfp-detach:		Triggers on cable detach in
						DFP mode.
			- dfp-detect:		Triggers on OTG cable insertion.
			- vbus-err:		Triggers if VBUS is not
						detected within 275 msec after
						CC detection in UFP mode.
			- vconn-oc:		Triggers on VCONN overcurrent
						in DFP mode with active cable.

Optional properties:
- pinctrl-names : This should be defined if a target uses pinctrl framework
  for SSMUX control pin. See "pinctrl" in
  Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt.
  It should specify the names of the configs that pinctrl can install in driver.
  Following are the pinctrl config that can be installed:
      "typec_ssmux_config" : Default configuration of pins.
- <supply-name>-supply: handle to the regulator device tree node.
        "supply-name" is "ss-mux" regulator to drive super-speed MUX chip.
- qcom,role-reversal-supported : A boolean property that when present enables
			support of dual role class.

Example:
	qcom,qpnp-typec@bf00 {
		compatible = "qcom,qpnp-typec";
		reg = <0xbf00 0x100>;
		interrupts =	<0x0 0xbf 0x0>,
				<0x0 0xbf 0x1>,
				<0x0 0xbf 0x2>,
				<0x0 0xbf 0x3>,
				<0x0 0xbf 0x4>,
				<0x0 0xbf 0x6>,
				<0x0 0xbf 0x7>;

		interrupt-names =	"vrd-change",
					"ufp-detach",
					"ufp-detect",
					"dfp-detach",
					"dfp-detect",
					"vbus-err",
					"vconn-oc";
	};
+11 −0
Original line number Original line Diff line number Diff line
@@ -91,4 +91,15 @@ config QPNP_QNOVO
	  module. It also allows userspace code to read diagnostics of voltage
	  module. It also allows userspace code to read diagnostics of voltage
	  and current measured during certain phases of the pulses.
	  and current measured during certain phases of the pulses.


config QPNP_TYPEC
	tristate "QPNP Type-C driver"
	depends on MFD_SPMI_PMIC
	help
	  Say Y here to enable QPNP Type-C driver.
	  The QPNP Type-C module supports the USB type-C protocol. It supports
	  type-C cable detection and other type-C parameters such as
	  current-capability and CC-orientation. The module does not support
	  USB power-delivery. The driver adds support to report these type-C
	  parameters via the power-supply framework.

endmenu
endmenu
+1 −0
Original line number Original line Diff line number Diff line
@@ -7,3 +7,4 @@ obj-$(CONFIG_SMB1351_USB_CHARGER) += smb1351-charger.o pmic-voter.o battery.o
obj-$(CONFIG_QPNP_SMB2)		+= step-chg-jeita.o battery.o qpnp-smb2.o smb-lib.o pmic-voter.o storm-watch.o
obj-$(CONFIG_QPNP_SMB2)		+= step-chg-jeita.o battery.o qpnp-smb2.o smb-lib.o pmic-voter.o storm-watch.o
obj-$(CONFIG_SMB138X_CHARGER)	+= step-chg-jeita.o smb138x-charger.o smb-lib.o pmic-voter.o storm-watch.o battery.o
obj-$(CONFIG_SMB138X_CHARGER)	+= step-chg-jeita.o smb138x-charger.o smb-lib.o pmic-voter.o storm-watch.o battery.o
obj-$(CONFIG_QPNP_QNOVO)	+= qpnp-qnovo.o battery.o
obj-$(CONFIG_QPNP_QNOVO)	+= qpnp-qnovo.o battery.o
obj-$(CONFIG_QPNP_TYPEC)	+= qpnp-typec.o
+1023 −0

File added.

Preview size limit exceeded, changes collapsed.