Skip to content

Commit 196856d

Browse files
committed
Merge tag 'usb-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some small USB driver fixes and new device ids for 6.13-rc7. Included in here are: - usb serial new device ids - typec bugfixes for reported issues - dwc3 driver fixes - chipidea driver fixes - gadget driver fixes - other minor fixes for reported problems. All of these have been in linux-next for a while, with no reported issues" * tag 'usb-6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: option: add Neoway N723-EA support USB: serial: option: add MeiG Smart SRM815 USB: serial: cp210x: add Phoenix Contact UPS Device usb: typec: fix pm usage counter imbalance in ucsi_ccg_sync_control() usb-storage: Add max sectors quirk for Nokia 208 usb: gadget: midi2: Reverse-select at the right place usb: gadget: f_fs: Remove WARN_ON in functionfs_bind USB: core: Disable LPM only for non-suspended ports usb: fix reference leak in usb_new_device() usb: typec: tcpci: fix NULL pointer issue on shared irq case usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null usb: chipidea: ci_hdrc_imx: decrement device's refcount in .remove() and in the error path of .probe() usb: typec: ucsi: Set orientation as none when connector is unplugged usb: gadget: configfs: Ignore trailing LF for user strings to cdev USB: usblp: return error when setting unsupported protocol usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints usb: typec: tcpm/tcpci_maxim: fix error code in max_contaminant_read_resistance_kohm() usb: host: xhci-plat: set skip_phy_initialization if software node has XHCI_SKIP_PHY_INIT property usb: dwc3-am62: Disable autosuspend during remove usb: dwc3: gadget: fix writing NYET threshold
2 parents be54864 + f3149ed commit 196856d

File tree

20 files changed

+84
-41
lines changed

20 files changed

+84
-41
lines changed

drivers/usb/chipidea/ci_hdrc_imx.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,25 +370,29 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
370370
data->pinctrl = devm_pinctrl_get(dev);
371371
if (PTR_ERR(data->pinctrl) == -ENODEV)
372372
data->pinctrl = NULL;
373-
else if (IS_ERR(data->pinctrl))
374-
return dev_err_probe(dev, PTR_ERR(data->pinctrl),
373+
else if (IS_ERR(data->pinctrl)) {
374+
ret = dev_err_probe(dev, PTR_ERR(data->pinctrl),
375375
"pinctrl get failed\n");
376+
goto err_put;
377+
}
376378

377379
data->hsic_pad_regulator =
378380
devm_regulator_get_optional(dev, "hsic");
379381
if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) {
380382
/* no pad regulator is needed */
381383
data->hsic_pad_regulator = NULL;
382-
} else if (IS_ERR(data->hsic_pad_regulator))
383-
return dev_err_probe(dev, PTR_ERR(data->hsic_pad_regulator),
384+
} else if (IS_ERR(data->hsic_pad_regulator)) {
385+
ret = dev_err_probe(dev, PTR_ERR(data->hsic_pad_regulator),
384386
"Get HSIC pad regulator error\n");
387+
goto err_put;
388+
}
385389

386390
if (data->hsic_pad_regulator) {
387391
ret = regulator_enable(data->hsic_pad_regulator);
388392
if (ret) {
389393
dev_err(dev,
390394
"Failed to enable HSIC pad regulator\n");
391-
return ret;
395+
goto err_put;
392396
}
393397
}
394398
}
@@ -402,13 +406,14 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
402406
dev_err(dev,
403407
"pinctrl_hsic_idle lookup failed, err=%ld\n",
404408
PTR_ERR(pinctrl_hsic_idle));
405-
return PTR_ERR(pinctrl_hsic_idle);
409+
ret = PTR_ERR(pinctrl_hsic_idle);
410+
goto err_put;
406411
}
407412

408413
ret = pinctrl_select_state(data->pinctrl, pinctrl_hsic_idle);
409414
if (ret) {
410415
dev_err(dev, "hsic_idle select failed, err=%d\n", ret);
411-
return ret;
416+
goto err_put;
412417
}
413418

414419
data->pinctrl_hsic_active = pinctrl_lookup_state(data->pinctrl,
@@ -417,7 +422,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
417422
dev_err(dev,
418423
"pinctrl_hsic_active lookup failed, err=%ld\n",
419424
PTR_ERR(data->pinctrl_hsic_active));
420-
return PTR_ERR(data->pinctrl_hsic_active);
425+
ret = PTR_ERR(data->pinctrl_hsic_active);
426+
goto err_put;
421427
}
422428
}
423429

@@ -527,6 +533,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
527533
if (pdata.flags & CI_HDRC_PMQOS)
528534
cpu_latency_qos_remove_request(&data->pm_qos_req);
529535
data->ci_pdev = NULL;
536+
err_put:
537+
put_device(data->usbmisc_data->dev);
530538
return ret;
531539
}
532540

@@ -551,6 +559,7 @@ static void ci_hdrc_imx_remove(struct platform_device *pdev)
551559
if (data->hsic_pad_regulator)
552560
regulator_disable(data->hsic_pad_regulator);
553561
}
562+
put_device(data->usbmisc_data->dev);
554563
}
555564

556565
static void ci_hdrc_imx_shutdown(struct platform_device *pdev)

drivers/usb/class/usblp.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,11 +1337,12 @@ static int usblp_set_protocol(struct usblp *usblp, int protocol)
13371337
if (protocol < USBLP_FIRST_PROTOCOL || protocol > USBLP_LAST_PROTOCOL)
13381338
return -EINVAL;
13391339

1340+
alts = usblp->protocol[protocol].alt_setting;
1341+
if (alts < 0)
1342+
return -EINVAL;
1343+
13401344
/* Don't unnecessarily set the interface if there's a single alt. */
13411345
if (usblp->intf->num_altsetting > 1) {
1342-
alts = usblp->protocol[protocol].alt_setting;
1343-
if (alts < 0)
1344-
return -EINVAL;
13451346
r = usb_set_interface(usblp->dev, usblp->ifnum, alts);
13461347
if (r < 0) {
13471348
printk(KERN_ERR "usblp: can't set desired altsetting %d on interface %d\n",

drivers/usb/core/hub.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,13 +2663,13 @@ int usb_new_device(struct usb_device *udev)
26632663
err = sysfs_create_link(&udev->dev.kobj,
26642664
&port_dev->dev.kobj, "port");
26652665
if (err)
2666-
goto fail;
2666+
goto out_del_dev;
26672667

26682668
err = sysfs_create_link(&port_dev->dev.kobj,
26692669
&udev->dev.kobj, "device");
26702670
if (err) {
26712671
sysfs_remove_link(&udev->dev.kobj, "port");
2672-
goto fail;
2672+
goto out_del_dev;
26732673
}
26742674

26752675
if (!test_and_set_bit(port1, hub->child_usage_bits))
@@ -2683,6 +2683,8 @@ int usb_new_device(struct usb_device *udev)
26832683
pm_runtime_put_sync_autosuspend(&udev->dev);
26842684
return err;
26852685

2686+
out_del_dev:
2687+
device_del(&udev->dev);
26862688
fail:
26872689
usb_set_device_state(udev, USB_STATE_NOTATTACHED);
26882690
pm_runtime_disable(&udev->dev);

drivers/usb/core/port.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,11 @@ static int usb_port_runtime_suspend(struct device *dev)
453453
static void usb_port_shutdown(struct device *dev)
454454
{
455455
struct usb_port *port_dev = to_usb_port(dev);
456+
struct usb_device *udev = port_dev->child;
456457

457-
if (port_dev->child) {
458-
usb_disable_usb2_hardware_lpm(port_dev->child);
459-
usb_unlocked_disable_lpm(port_dev->child);
458+
if (udev && !udev->port_is_suspended) {
459+
usb_disable_usb2_hardware_lpm(udev);
460+
usb_unlocked_disable_lpm(udev);
460461
}
461462
}
462463

drivers/usb/dwc3/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
#define DWC3_DCTL_TRGTULST_SS_INACT (DWC3_DCTL_TRGTULST(6))
465465

466466
/* These apply for core versions 1.94a and later */
467+
#define DWC3_DCTL_NYET_THRES_MASK (0xf << 20)
467468
#define DWC3_DCTL_NYET_THRES(n) (((n) & 0xf) << 20)
468469

469470
#define DWC3_DCTL_KEEP_CONNECT BIT(19)

drivers/usb/dwc3/dwc3-am62.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ static void dwc3_ti_remove(struct platform_device *pdev)
309309

310310
pm_runtime_put_sync(dev);
311311
pm_runtime_disable(dev);
312+
pm_runtime_dont_use_autosuspend(dev);
312313
pm_runtime_set_suspended(dev);
313314
}
314315

drivers/usb/dwc3/gadget.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4195,8 +4195,10 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
41954195
WARN_ONCE(DWC3_VER_IS_PRIOR(DWC3, 240A) && dwc->has_lpm_erratum,
41964196
"LPM Erratum not available on dwc3 revisions < 2.40a\n");
41974197

4198-
if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A))
4198+
if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A)) {
4199+
reg &= ~DWC3_DCTL_NYET_THRES_MASK;
41994200
reg |= DWC3_DCTL_NYET_THRES(dwc->lpm_nyet_threshold);
4201+
}
42004202

42014203
dwc3_gadget_dctl_write_safe(dwc, reg);
42024204
} else {

drivers/usb/gadget/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ config USB_F_MIDI
211211

212212
config USB_F_MIDI2
213213
tristate
214+
select SND_UMP
215+
select SND_UMP_LEGACY_RAWMIDI
214216

215217
config USB_F_HID
216218
tristate
@@ -445,8 +447,6 @@ config USB_CONFIGFS_F_MIDI2
445447
depends on USB_CONFIGFS
446448
depends on SND
447449
select USB_LIBCOMPOSITE
448-
select SND_UMP
449-
select SND_UMP_LEGACY_RAWMIDI
450450
select USB_F_MIDI2
451451
help
452452
The MIDI 2.0 function driver provides the generic emulated

drivers/usb/gadget/configfs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,15 @@ static ssize_t gadget_string_s_store(struct config_item *item, const char *page,
827827
{
828828
struct gadget_string *string = to_gadget_string(item);
829829
int size = min(sizeof(string->string), len + 1);
830+
ssize_t cpy_len;
830831

831832
if (len > USB_MAX_STRING_LEN)
832833
return -EINVAL;
833834

834-
return strscpy(string->string, page, size);
835+
cpy_len = strscpy(string->string, page, size);
836+
if (cpy_len > 0 && string->string[cpy_len - 1] == '\n')
837+
string->string[cpy_len - 1] = 0;
838+
return len;
835839
}
836840
CONFIGFS_ATTR(gadget_string_, s);
837841

drivers/usb/gadget/function/f_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
22852285
struct usb_gadget_strings **lang;
22862286
int first_id;
22872287

2288-
if (WARN_ON(ffs->state != FFS_ACTIVE
2288+
if ((ffs->state != FFS_ACTIVE
22892289
|| test_and_set_bit(FFS_FL_BOUND, &ffs->flags)))
22902290
return -EBADFD;
22912291

drivers/usb/gadget/function/f_uac2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
11851185
uac2->as_in_alt = 0;
11861186
}
11871187

1188+
std_ac_if_desc.bNumEndpoints = 0;
11881189
if (FUOUT_EN(uac2_opts) || FUIN_EN(uac2_opts)) {
11891190
uac2->int_ep = usb_ep_autoconfig(gadget, &fs_ep_int_desc);
11901191
if (!uac2->int_ep) {

drivers/usb/gadget/function/u_serial.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,10 @@ void gserial_disconnect(struct gserial *gser)
14201420
/* REVISIT as above: how best to track this? */
14211421
port->port_line_coding = gser->port_line_coding;
14221422

1423+
/* disable endpoints, aborting down any active I/O */
1424+
usb_ep_disable(gser->out);
1425+
usb_ep_disable(gser->in);
1426+
14231427
port->port_usb = NULL;
14241428
gser->ioport = NULL;
14251429
if (port->port.count > 0) {
@@ -1431,10 +1435,6 @@ void gserial_disconnect(struct gserial *gser)
14311435
spin_unlock(&port->port_lock);
14321436
spin_unlock_irqrestore(&serial_port_lock, flags);
14331437

1434-
/* disable endpoints, aborting down any active I/O */
1435-
usb_ep_disable(gser->out);
1436-
usb_ep_disable(gser->in);
1437-
14381438
/* finally, free any unused/unusable I/O buffers */
14391439
spin_lock_irqsave(&port->port_lock, flags);
14401440
if (port->port.count == 0)

drivers/usb/host/xhci-plat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
290290

291291
hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
292292

293-
if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
293+
if ((priv && (priv->quirks & XHCI_SKIP_PHY_INIT)) ||
294+
(xhci->quirks & XHCI_SKIP_PHY_INIT))
294295
hcd->skip_phy_initialization = 1;
295296

296297
if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK))

drivers/usb/serial/cp210x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ static const struct usb_device_id id_table[] = {
223223
{ USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
224224
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
225225
{ USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
226+
{ USB_DEVICE(0x1B93, 0x1013) }, /* Phoenix Contact UPS Device */
226227
{ USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
227228
{ USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
228229
{ USB_DEVICE(0x1D6F, 0x0010) }, /* Seluxit ApS RF Dongle */

drivers/usb/serial/option.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ static void option_instat_callback(struct urb *urb);
621621

622622
/* MeiG Smart Technology products */
623623
#define MEIGSMART_VENDOR_ID 0x2dee
624-
/* MeiG Smart SRM825L based on Qualcomm 315 */
624+
/* MeiG Smart SRM815/SRM825L based on Qualcomm 315 */
625625
#define MEIGSMART_PRODUCT_SRM825L 0x4d22
626626
/* MeiG Smart SLM320 based on UNISOC UIS8910 */
627627
#define MEIGSMART_PRODUCT_SLM320 0x4d41
@@ -2405,13 +2405,15 @@ static const struct usb_device_id option_ids[] = {
24052405
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
24062406
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) },
24072407
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM770A, 0xff, 0, 0) },
2408+
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0, 0) },
24082409
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x30) },
24092410
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x40) },
24102411
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x60) },
24112412
{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0530, 0xff), /* TCL IK512 MBIM */
24122413
.driver_info = NCTRL(1) },
24132414
{ USB_DEVICE_INTERFACE_CLASS(0x1bbb, 0x0640, 0xff), /* TCL IK512 ECM */
24142415
.driver_info = NCTRL(3) },
2416+
{ USB_DEVICE_INTERFACE_CLASS(0x2949, 0x8700, 0xff) }, /* Neoway N723-EA */
24152417
{ } /* Terminating entry */
24162418
};
24172419
MODULE_DEVICE_TABLE(usb, option_ids);

drivers/usb/storage/unusual_devs.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ UNUSUAL_DEV( 0x0421, 0x06aa, 0x1110, 0x1110,
255255
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
256256
US_FL_MAX_SECTORS_64 ),
257257

258+
/* Added by Lubomir Rintel <[email protected]>, a very fine chap */
259+
UNUSUAL_DEV( 0x0421, 0x06c2, 0x0000, 0x0406,
260+
"Nokia",
261+
"Nokia 208",
262+
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
263+
US_FL_MAX_SECTORS_64 ),
264+
258265
#ifdef NO_SDDR09
259266
UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100,
260267
"Microtech",

drivers/usb/typec/tcpm/maxim_contaminant.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int max_contaminant_read_resistance_kohm(struct max_tcpci_chip *chip,
135135

136136
mv = max_contaminant_read_adc_mv(chip, channel, sleep_msec, raw, true);
137137
if (mv < 0)
138-
return ret;
138+
return mv;
139139

140140
/* OVP enable */
141141
ret = regmap_update_bits(regmap, TCPC_VENDOR_CC_CTRL2, CCOVPDIS, 0);
@@ -157,7 +157,7 @@ static int max_contaminant_read_resistance_kohm(struct max_tcpci_chip *chip,
157157

158158
mv = max_contaminant_read_adc_mv(chip, channel, sleep_msec, raw, true);
159159
if (mv < 0)
160-
return ret;
160+
return mv;
161161
/* Disable current source */
162162
ret = regmap_update_bits(regmap, TCPC_VENDOR_CC_CTRL2, SBURPCTRL, 0);
163163
if (ret < 0)

drivers/usb/typec/tcpm/tcpci.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ static int tcpci_init(struct tcpc_dev *tcpc)
700700

701701
tcpci->alert_mask = reg;
702702

703-
return tcpci_write16(tcpci, TCPC_ALERT_MASK, reg);
703+
return 0;
704704
}
705705

706706
irqreturn_t tcpci_irq(struct tcpci *tcpci)
@@ -923,22 +923,27 @@ static int tcpci_probe(struct i2c_client *client)
923923

924924
chip->data.set_orientation = err;
925925

926+
chip->tcpci = tcpci_register_port(&client->dev, &chip->data);
927+
if (IS_ERR(chip->tcpci))
928+
return PTR_ERR(chip->tcpci);
929+
926930
err = devm_request_threaded_irq(&client->dev, client->irq, NULL,
927931
_tcpci_irq,
928932
IRQF_SHARED | IRQF_ONESHOT,
929933
dev_name(&client->dev), chip);
930934
if (err < 0)
931-
return err;
935+
goto unregister_port;
932936

933-
/*
934-
* Disable irq while registering port. If irq is configured as an edge
935-
* irq this allow to keep track and process the irq as soon as it is enabled.
936-
*/
937-
disable_irq(client->irq);
938-
chip->tcpci = tcpci_register_port(&client->dev, &chip->data);
939-
enable_irq(client->irq);
937+
/* Enable chip interrupts at last */
938+
err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, chip->tcpci->alert_mask);
939+
if (err < 0)
940+
goto unregister_port;
940941

941-
return PTR_ERR_OR_ZERO(chip->tcpci);
942+
return 0;
943+
944+
unregister_port:
945+
tcpci_unregister_port(chip->tcpci);
946+
return err;
942947
}
943948

944949
static void tcpci_remove(struct i2c_client *client)

drivers/usb/typec/ucsi/ucsi_ccg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,16 +646,16 @@ static int ucsi_ccg_sync_control(struct ucsi *ucsi, u64 command)
646646
UCSI_CMD_CONNECTOR_MASK;
647647
if (con_index == 0) {
648648
ret = -EINVAL;
649-
goto unlock;
649+
goto err_put;
650650
}
651651
con = &uc->ucsi->connector[con_index - 1];
652652
ucsi_ccg_update_set_new_cam_cmd(uc, con, &command);
653653
}
654654

655655
ret = ucsi_sync_control_common(ucsi, command);
656656

657+
err_put:
657658
pm_runtime_put_sync(uc->dev);
658-
unlock:
659659
mutex_unlock(&uc->lock);
660660

661661
return ret;

drivers/usb/typec/ucsi/ucsi_glink.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con)
185185
struct pmic_glink_ucsi *ucsi = ucsi_get_drvdata(con->ucsi);
186186
int orientation;
187187

188+
if (!UCSI_CONSTAT(con, CONNECTED)) {
189+
typec_set_orientation(con->port, TYPEC_ORIENTATION_NONE);
190+
return;
191+
}
192+
188193
if (con->num > PMIC_GLINK_MAX_PORTS ||
189194
!ucsi->port_orientation[con->num - 1])
190195
return;

0 commit comments

Comments
 (0)