Commit Graph

5 Commits

Author SHA1 Message Date
rickyniu
72e43ad501 linux: usb: usbpd.h: add "include <linux/err.h>" for kernel 4.19
add "include <linux/err.h>" for build pass on kernel 4.19
usbpd.h use some err message

Bug: 140367237

Change-Id: I7374dddba489395e5cbcdb27fcd9004f80456740
Signed-off-by: rickyniu <rickyniu@google.com>
2020-05-30 02:03:56 +08:00
Pratham Pratap
88731b2564 usb: pd: Add flag to notify peer_usb_comm support to dp
Some Type-C multi-port adapters which do not support usb connection
are advertising the multi-functionality in DP alt mode. If
multi-functionality is preferred, the DP driver assumes the adapter
supports usb connection and USB phy driver will program the PHY mode
to DP+USB.

In source mode, usb PD driver checks for the peer_usb_connection
of the adapter. If it does not support usb then it will stop usb stack
and update the PHY MODE to USB only mode from phy_suspend path.
The result is, usb may program the combo PHY to usb only mode when DP
is already connected. This is causing AUX read/write timeouts when DP
is trying to access the phy registers.

To fix this issue, a flag in SVID connect handler in usbpd driver to
notify peer_usb_comm support to the DP driver. DP driver will read this
flag and program the phy mode.

Change-Id: Iae6a9596000313ede51d8af3c4989c74ac2f0b10
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
2019-10-15 14:30:06 -07:00
Jack Pham
1322981da0 usb: pd: Allow receiving VDM messages during suspend
Add an API to allow a VDM client (e.g. DisplayPort) to indicate
that the system is entering suspend but that an incoming VDM
message is expected. If a VDM is then received, it will bypass
kick_sm() which would otherwise abort the suspend and instead
be handed to the client VDM handler directly.

The flag can be reset either explicitly, if a soft/hard reset
occur, or if a VDM TX is requested, as those situations would
require the state machine to run in the worker thread normally.

Change-Id: I8af7e13abad766f9e4245149da9457f1c62a25d5
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-02-26 09:59:53 -08:00
Satya Rama Aditya Pinapala
10ffbfa2c7 drm/msm/dp: Snapshot of DP and supporting files
This snapshot includes DP and supporting files for compilation.
This change also has the copyright year update to the files. Snapshot
was taken from msm-4.14 as of commit 1df57774a520
("ARM: dts: msm: Remove dma-coherent for IPA for sdxprairie").

Change-Id: I7152ec12a1c3c8346e158540c8bf70d4bbc2c372
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
2019-02-01 12:37:40 -08:00
Jack Pham
2b54fa83e7 usb: pd: fix compilation errors
Fix compilation errors introduced during the snapshot from
msm-4.14 and subsequent cherry-picks.

 - Add missing linux/usb/usbpd.h header
 - Upstream moved extcon definitions to <linux/extcon-provider.h>
 - Fix missing space after '=' in Makefile, otherwise 'pd'
   subdirectory fails to be included
 - Fix a few places where break/return were incorrectly used
 - MSG_BATTERY_STATUS is not an extended message so handling
   should have been done in handle_data_snk_ready()

Change-Id: I248b17a8479572b53b2a792877460d6474bca113
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2019-01-09 09:50:36 -08:00