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

Commit 1cf46383 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "defconfig: arm64: sdm855: enable USB PD drivers"

parents 324aba3b 26cb2e3a
Loading
Loading
Loading
Loading
+74 −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.
- qcom,default-sink-caps: List of 32-bit values representing the nominal sink
			capabilities in voltage (millivolts) and current
			(milliamps) pairs.

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";

		qcom,default-sink-caps = <5000 3000>, /* 5V @ 3A */
					 <9000 3000>, /* 9V @ 3A */
					 <12000 2250>; /* 12V @ 2.25A */
	};
+3 −0
Original line number Diff line number Diff line
@@ -318,6 +318,7 @@ CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_QCOM_EMU_PHY=y
CONFIG_USB_MSM_SSPHY_QMP=y
CONFIG_MSM_HSUSB_PHY=y
CONFIG_DUAL_ROLE_USB_INTF=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_VBUS_DRAW=500
CONFIG_USB_CONFIGFS=y
@@ -325,6 +326,8 @@ CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_DIAG=y
CONFIG_USB_PD_POLICY=y
CONFIG_QPNP_USB_PDPHY=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_TEST=y
+3 −0
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_QCOM_EMU_PHY=y
CONFIG_USB_MSM_SSPHY_QMP=y
CONFIG_MSM_HSUSB_PHY=y
CONFIG_DUAL_ROLE_USB_INTF=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_VBUS_DRAW=500
CONFIG_USB_CONFIGFS=y
@@ -332,6 +333,8 @@ CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_DIAG=y
CONFIG_USB_PD_POLICY=y
CONFIG_QPNP_USB_PDPHY=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_TEST=y
+54 −0
Original line number Diff line number Diff line
@@ -486,6 +486,21 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id)
}
EXPORT_SYMBOL_GPL(extcon_sync);

int extcon_blocking_sync(struct extcon_dev *edev, unsigned int id, bool val)
{
	int index;

	if (!edev)
		return -EINVAL;

	index = find_cable_index_by_id(edev, id);
	if (index < 0)
		return index;

	return blocking_notifier_call_chain(&edev->bnh[index], val, edev);
}
EXPORT_SYMBOL(extcon_blocking_sync);

/**
 * extcon_get_state() - Get the state of an external connector.
 * @edev:	the extcon device
@@ -935,6 +950,38 @@ int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
}
EXPORT_SYMBOL_GPL(extcon_register_notifier);

int extcon_register_blocking_notifier(struct extcon_dev *edev, unsigned int id,
			struct notifier_block *nb)
{
	int idx = -EINVAL;

	if (!edev || !nb)
		return -EINVAL;

	idx = find_cable_index_by_id(edev, id);
	if (idx < 0)
		return idx;

	return blocking_notifier_chain_register(&edev->bnh[idx], nb);
}
EXPORT_SYMBOL(extcon_register_blocking_notifier);

int extcon_unregister_blocking_notifier(struct extcon_dev *edev,
			unsigned int id, struct notifier_block *nb)
{
	int idx;

	if (!edev || !nb)
		return -EINVAL;

	idx = find_cable_index_by_id(edev, id);
	if (idx < 0)
		return idx;

	return blocking_notifier_chain_unregister(&edev->bnh[idx], nb);
}
EXPORT_SYMBOL(extcon_unregister_blocking_notifier);

/**
 * extcon_unregister_notifier() - Unregister a notifier block from the extcon.
 * @edev:	the extcon device
@@ -1265,6 +1312,13 @@ int extcon_dev_register(struct extcon_dev *edev)
		goto err_dev;
	}

	edev->bnh = devm_kzalloc(&edev->dev,
			sizeof(*edev->bnh) * edev->max_supported, GFP_KERNEL);
	if (!edev->bnh) {
		ret = -ENOMEM;
		goto err_dev;
	}

	for (index = 0; index < edev->max_supported; index++)
		RAW_INIT_NOTIFIER_HEAD(&edev->nh[index]);

+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct extcon_dev {
	struct device dev;
	struct raw_notifier_head nh_all;
	struct raw_notifier_head *nh;
	struct blocking_notifier_head *bnh;
	struct list_head entry;
	int max_supported;
	spinlock_t lock;	/* could be called by irq handler */
Loading