usb: pd: Don't notify EXTCON_USB unless type is SDP or CDP
commit 77f6fd8044
("usb: pd: Add support to notify plug
orientation via extcon") added an additional extcon notifier
to indicate orientation. But for the PE_SNK_STARTUP case
the change inadvertently notifies EXTCON_USB for all sink
states when it should just be for psy_type==USB|USB_CDP.
Add the missing curly braces to the if statement.
Change-Id: I19d424ff0d46cc0134210424a7d431b331cbf963
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
parent
7eb20e5733
commit
f33cac01f3
1 changed files with 2 additions and 1 deletions
|
@ -669,12 +669,13 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)
|
|||
pd->current_dr = DR_UFP;
|
||||
|
||||
if (pd->psy_type == POWER_SUPPLY_TYPE_USB ||
|
||||
pd->psy_type == POWER_SUPPLY_TYPE_USB_CDP)
|
||||
pd->psy_type == POWER_SUPPLY_TYPE_USB_CDP) {
|
||||
extcon_set_cable_state_(pd->extcon,
|
||||
EXTCON_USB_CC,
|
||||
is_cable_flipped(pd));
|
||||
extcon_set_cable_state_(pd->extcon,
|
||||
EXTCON_USB, 1);
|
||||
}
|
||||
}
|
||||
|
||||
pd->rx_msg_len = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue