Merge "usb: report displayport capable port partner disconnect to drm" into main
This commit is contained in:
commit
10c5df0b97
3 changed files with 20 additions and 0 deletions
|
@ -1223,6 +1223,16 @@ static void uevent_event(uint32_t /*epevents*/, struct data *payload) {
|
||||||
payload->usb->mPartnerUp = true;
|
payload->usb->mPartnerUp = true;
|
||||||
pthread_cond_signal(&payload->usb->mPartnerCV);
|
pthread_cond_signal(&payload->usb->mPartnerCV);
|
||||||
pthread_mutex_unlock(&payload->usb->mPartnerLock);
|
pthread_mutex_unlock(&payload->usb->mPartnerLock);
|
||||||
|
} else if (std::regex_match(cp, std::regex("(remove)(.*)(-partner)"))) {
|
||||||
|
string drmDisconnectPath = string(kDisplayPortDrmPath) + "usbc_cable_disconnect";
|
||||||
|
|
||||||
|
if (payload->usb->mPartnerSupportsDisplayPort) {
|
||||||
|
ALOGI("displayport partner removed");
|
||||||
|
if (!WriteStringToFile("1", drmDisconnectPath)) {
|
||||||
|
ALOGE("Failed to signal disconnect to drm");
|
||||||
|
}
|
||||||
|
payload->usb->mPartnerSupportsDisplayPort = false;
|
||||||
|
}
|
||||||
} else if (!strncmp(cp, "DEVTYPE=typec_", strlen("DEVTYPE=typec_")) ||
|
} else if (!strncmp(cp, "DEVTYPE=typec_", strlen("DEVTYPE=typec_")) ||
|
||||||
!strncmp(cp, "DRIVER=max77759tcpc",
|
!strncmp(cp, "DRIVER=max77759tcpc",
|
||||||
strlen("DRIVER=max77759tcpc")) ||
|
strlen("DRIVER=max77759tcpc")) ||
|
||||||
|
@ -1389,6 +1399,8 @@ ScopedAStatus Usb::setCallback(const shared_ptr<IUsbCallback>& in_callback) {
|
||||||
return ScopedAStatus::ok();
|
return ScopedAStatus::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** DisplayPort Alt Mode Helpers *****/
|
||||||
|
|
||||||
Status Usb::getDisplayPortUsbPathHelper(string *path) {
|
Status Usb::getDisplayPortUsbPathHelper(string *path) {
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
Status result = Status::ERROR;
|
Status result = Status::ERROR;
|
||||||
|
@ -1805,6 +1817,7 @@ void Usb::setupDisplayPortPoll() {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ALOGI("usbdp: setup: beginning setup for displayport poll thread");
|
ALOGI("usbdp: setup: beginning setup for displayport poll thread");
|
||||||
|
mPartnerSupportsDisplayPort = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If thread is currently starting, then it hasn't setup DisplayPort fd's, and we can abandon
|
* If thread is currently starting, then it hasn't setup DisplayPort fd's, and we can abandon
|
||||||
|
|
|
@ -156,6 +156,11 @@ struct Usb : public BnUsb {
|
||||||
* eventfd to monitor whether a connection results in DisplayPort Alt Mode activating.
|
* eventfd to monitor whether a connection results in DisplayPort Alt Mode activating.
|
||||||
*/
|
*/
|
||||||
int mDisplayPortActivateTimer;
|
int mDisplayPortActivateTimer;
|
||||||
|
/*
|
||||||
|
* Indicates whether or not port partner supports DisplayPort, and is used to
|
||||||
|
* communicate to the drm when the port partner physically disconnects.
|
||||||
|
*/
|
||||||
|
bool mPartnerSupportsDisplayPort;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
pthread_t mPoll;
|
pthread_t mPoll;
|
||||||
|
|
|
@ -21,6 +21,7 @@ on post-fs
|
||||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
|
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
|
||||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
|
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
|
||||||
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
|
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
|
||||||
|
chown root system /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
|
||||||
chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess
|
chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess
|
||||||
chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id
|
chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id
|
||||||
chown root system /sys/devices/platform/11110000.usb/usb_data_enabled
|
chown root system /sys/devices/platform/11110000.usb/usb_data_enabled
|
||||||
|
@ -44,4 +45,5 @@ on post-fs
|
||||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
|
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/orientation
|
||||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
|
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/pin_assignment
|
||||||
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
|
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/link_status
|
||||||
|
chmod 664 /sys/devices/platform/110f0000.drmdp/drm-displayport/usbc_cable_disconnect
|
||||||
chmod 664 /sys/devices/platform/google,pogo/enable_usb
|
chmod 664 /sys/devices/platform/google,pogo/enable_usb
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue