Commit 090472ed authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'usb-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / PHY / Thunderbolt fixes from Greg KH:
 "Here are a number of reverts, fixes, and new device ids for 6.7-rc3
  for the USB, PHY, and Thunderbolt driver subsystems. Include in here
  are:

   - reverts of some PHY drivers that went into 6.7-rc1 that shouldn't
     have been merged yet, the author is reworking them based on review
     comments as they were using older apis that shouldn't be used
     anymore for newer drivers

   - small thunderbolt driver fixes for reported issues

   - USB driver fixes for a variety of small issues in dwc3, typec,
     xhci, and other smaller drivers.

   - new device ids for usb-serial and onboard_usb_hub drivers.

  All of these have been in linux-next with no reported issues"

* tag 'usb-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits)
  USB: serial: option: add Luat Air72*U series products
  USB: dwc3: qcom: fix ACPI platform device leak
  USB: dwc3: qcom: fix software node leak on probe errors
  USB: dwc3: qcom: fix resource leaks on probe deferral
  USB: dwc3: qcom: simplify wakeup interrupt setup
  USB: dwc3: qcom: fix wakeup after probe deferral
  dt-bindings: usb: qcom,dwc3: fix example wakeup interrupt types
  usb: misc: onboard-hub: add support for Microchip USB5744
  dt-bindings: usb: microchip,usb5744: Add second supply
  usb: misc: ljca: Fix enumeration error on Dell Latitude 9420
  USB: serial: option: add Fibocom L7xx modules
  USB: xhci-plat: fix legacy PHY double init
  usb: typec: tipd: Supply also I2C driver data
  usb: xhci-mtk: fix in-ep's start-split check failure
  usb: dwc3: set the dma max_seg_size
  usb: config: fix iteration issue in 'usb_get_bos_descriptor()'
  usb: dwc3: add missing of_node_put and platform_device_put
  USB: dwc2: write HCINT with INTMASK applied
  usb: misc: ljca: Drop _ADR support to get ljca children devices
  usb: cdnsp: Fix deadlock issue during using NCM gadget
  ...
parents b46ae77f cb9a830e
...@@ -36,7 +36,11 @@ properties: ...@@ -36,7 +36,11 @@ properties:
vdd-supply: vdd-supply:
description: description:
VDD power supply to the hub 3V3 power supply to the hub
vdd2-supply:
description:
1V2 power supply to the hub
peer-hub: peer-hub:
$ref: /schemas/types.yaml#/definitions/phandle $ref: /schemas/types.yaml#/definitions/phandle
...@@ -62,6 +66,7 @@ allOf: ...@@ -62,6 +66,7 @@ allOf:
properties: properties:
reset-gpios: false reset-gpios: false
vdd-supply: false vdd-supply: false
vdd2-supply: false
peer-hub: false peer-hub: false
i2c-bus: false i2c-bus: false
else: else:
......
...@@ -521,8 +521,8 @@ examples: ...@@ -521,8 +521,8 @@ examples:
interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>; <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
interrupt-names = "hs_phy_irq", "ss_phy_irq", interrupt-names = "hs_phy_irq", "ss_phy_irq",
"dm_hs_phy_irq", "dp_hs_phy_irq"; "dm_hs_phy_irq", "dp_hs_phy_irq";
......
...@@ -41,7 +41,7 @@ examples: ...@@ -41,7 +41,7 @@ examples:
- | - |
usb { usb {
phys = <&usb2_phy1>, <&usb3_phy1>; phys = <&usb2_phy1>, <&usb3_phy1>;
phy-names = "usb"; phy-names = "usb2", "usb3";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
......
...@@ -87,7 +87,6 @@ source "drivers/phy/motorola/Kconfig" ...@@ -87,7 +87,6 @@ source "drivers/phy/motorola/Kconfig"
source "drivers/phy/mscc/Kconfig" source "drivers/phy/mscc/Kconfig"
source "drivers/phy/qualcomm/Kconfig" source "drivers/phy/qualcomm/Kconfig"
source "drivers/phy/ralink/Kconfig" source "drivers/phy/ralink/Kconfig"
source "drivers/phy/realtek/Kconfig"
source "drivers/phy/renesas/Kconfig" source "drivers/phy/renesas/Kconfig"
source "drivers/phy/rockchip/Kconfig" source "drivers/phy/rockchip/Kconfig"
source "drivers/phy/samsung/Kconfig" source "drivers/phy/samsung/Kconfig"
......
...@@ -26,7 +26,6 @@ obj-y += allwinner/ \ ...@@ -26,7 +26,6 @@ obj-y += allwinner/ \
mscc/ \ mscc/ \
qualcomm/ \ qualcomm/ \
ralink/ \ ralink/ \
realtek/ \
renesas/ \ renesas/ \
rockchip/ \ rockchip/ \
samsung/ \ samsung/ \
......
# SPDX-License-Identifier: GPL-2.0
#
# Phy drivers for Realtek platforms
#
if ARCH_REALTEK || COMPILE_TEST
config PHY_RTK_RTD_USB2PHY
tristate "Realtek RTD USB2 PHY Transceiver Driver"
depends on USB_SUPPORT
select GENERIC_PHY
select USB_PHY
select USB_COMMON
help
Enable this to support Realtek SoC USB2 phy transceiver.
The DHC (digital home center) RTD series SoCs used the Synopsys
DWC3 USB IP. This driver will do the PHY initialization
of the parameters.
config PHY_RTK_RTD_USB3PHY
tristate "Realtek RTD USB3 PHY Transceiver Driver"
depends on USB_SUPPORT
select GENERIC_PHY
select USB_PHY
select USB_COMMON
help
Enable this to support Realtek SoC USB3 phy transceiver.
The DHC (digital home center) RTD series SoCs used the Synopsys
DWC3 USB IP. This driver will do the PHY initialization
of the parameters.
endif # ARCH_REALTEK || COMPILE_TEST
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_PHY_RTK_RTD_USB2PHY) += phy-rtk-usb2.o
obj-$(CONFIG_PHY_RTK_RTD_USB3PHY) += phy-rtk-usb3.o
This diff is collapsed.
This diff is collapsed.
...@@ -1143,7 +1143,7 @@ int tb_port_lane_bonding_enable(struct tb_port *port) ...@@ -1143,7 +1143,7 @@ int tb_port_lane_bonding_enable(struct tb_port *port)
* Only set bonding if the link was not already bonded. This * Only set bonding if the link was not already bonded. This
* avoids the lane adapter to re-enter bonding state. * avoids the lane adapter to re-enter bonding state.
*/ */
if (width == TB_LINK_WIDTH_SINGLE) { if (width == TB_LINK_WIDTH_SINGLE && !tb_is_upstream_port(port)) {
ret = tb_port_set_lane_bonding(port, true); ret = tb_port_set_lane_bonding(port, true);
if (ret) if (ret)
goto err_lane1; goto err_lane1;
...@@ -2880,6 +2880,7 @@ static int tb_switch_lane_bonding_disable(struct tb_switch *sw) ...@@ -2880,6 +2880,7 @@ static int tb_switch_lane_bonding_disable(struct tb_switch *sw)
return tb_port_wait_for_link_width(down, TB_LINK_WIDTH_SINGLE, 100); return tb_port_wait_for_link_width(down, TB_LINK_WIDTH_SINGLE, 100);
} }
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width) static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
{ {
struct tb_port *up, *down, *port; struct tb_port *up, *down, *port;
...@@ -2919,10 +2920,10 @@ static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width) ...@@ -2919,10 +2920,10 @@ static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)
return ret; return ret;
} }
sw->link_width = width;
return 0; return 0;
} }
/* Note updating sw->link_width done in tb_switch_update_link_attributes() */
static int tb_switch_asym_disable(struct tb_switch *sw) static int tb_switch_asym_disable(struct tb_switch *sw)
{ {
struct tb_port *up, *down; struct tb_port *up, *down;
...@@ -2957,7 +2958,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw) ...@@ -2957,7 +2958,6 @@ static int tb_switch_asym_disable(struct tb_switch *sw)
return ret; return ret;
} }
sw->link_width = TB_LINK_WIDTH_DUAL;
return 0; return 0;
} }
......
...@@ -213,7 +213,17 @@ static void tb_add_dp_resources(struct tb_switch *sw) ...@@ -213,7 +213,17 @@ static void tb_add_dp_resources(struct tb_switch *sw)
if (!tb_switch_query_dp_resource(sw, port)) if (!tb_switch_query_dp_resource(sw, port))
continue; continue;
list_add(&port->list, &tcm->dp_resources); /*
* If DP IN on device router exist, position it at the
* beginning of the DP resources list, so that it is used
* before DP IN of the host router. This way external GPU(s)
* will be prioritized when pairing DP IN to a DP OUT.
*/
if (tb_route(sw))
list_add(&port->list, &tcm->dp_resources);
else
list_add_tail(&port->list, &tcm->dp_resources);
tb_port_dbg(port, "DP IN resource available\n"); tb_port_dbg(port, "DP IN resource available\n");
} }
} }
......
...@@ -1529,6 +1529,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data) ...@@ -1529,6 +1529,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data)
unsigned long flags; unsigned long flags;
int counter = 0; int counter = 0;
local_bh_disable();
spin_lock_irqsave(&pdev->lock, flags); spin_lock_irqsave(&pdev->lock, flags);
if (pdev->cdnsp_state & (CDNSP_STATE_HALTED | CDNSP_STATE_DYING)) { if (pdev->cdnsp_state & (CDNSP_STATE_HALTED | CDNSP_STATE_DYING)) {
...@@ -1541,6 +1542,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data) ...@@ -1541,6 +1542,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data)
cdnsp_died(pdev); cdnsp_died(pdev);
spin_unlock_irqrestore(&pdev->lock, flags); spin_unlock_irqrestore(&pdev->lock, flags);
local_bh_enable();
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1557,6 +1559,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data) ...@@ -1557,6 +1559,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data)
cdnsp_update_erst_dequeue(pdev, event_ring_deq, 1); cdnsp_update_erst_dequeue(pdev, event_ring_deq, 1);
spin_unlock_irqrestore(&pdev->lock, flags); spin_unlock_irqrestore(&pdev->lock, flags);
local_bh_enable();
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -1047,7 +1047,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) ...@@ -1047,7 +1047,7 @@ int usb_get_bos_descriptor(struct usb_device *dev)
if (cap->bDescriptorType != USB_DT_DEVICE_CAPABILITY) { if (cap->bDescriptorType != USB_DT_DEVICE_CAPABILITY) {
dev_notice(ddev, "descriptor type invalid, skip\n"); dev_notice(ddev, "descriptor type invalid, skip\n");
continue; goto skip_to_next_descriptor;
} }
switch (cap_type) { switch (cap_type) {
...@@ -1078,6 +1078,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) ...@@ -1078,6 +1078,7 @@ int usb_get_bos_descriptor(struct usb_device *dev)
break; break;
} }
skip_to_next_descriptor:
total_len -= length; total_len -= length;
buffer += length; buffer += length;
} }
......
...@@ -622,29 +622,6 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type, ...@@ -622,29 +622,6 @@ static int hub_ext_port_status(struct usb_hub *hub, int port1, int type,
ret = 0; ret = 0;
} }
mutex_unlock(&hub->status_mutex); mutex_unlock(&hub->status_mutex);
/*
* There is no need to lock status_mutex here, because status_mutex
* protects hub->status, and the phy driver only checks the port
* status without changing the status.
*/
if (!ret) {
struct usb_device *hdev = hub->hdev;
/*
* Only roothub will be notified of port state changes,
* since the USB PHY only cares about changes at the next
* level.
*/
if (is_root_hub(hdev)) {
struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
if (hcd->usb_phy)
usb_phy_notify_port_status(hcd->usb_phy,
port1 - 1, *status, *change);
}
}
return ret; return ret;
} }
......
...@@ -2015,15 +2015,17 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum) ...@@ -2015,15 +2015,17 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum)
{ {
struct dwc2_qtd *qtd; struct dwc2_qtd *qtd;
struct dwc2_host_chan *chan; struct dwc2_host_chan *chan;
u32 hcint, hcintmsk; u32 hcint, hcintraw, hcintmsk;
chan = hsotg->hc_ptr_array[chnum]; chan = hsotg->hc_ptr_array[chnum];
hcint = dwc2_readl(hsotg, HCINT(chnum)); hcintraw = dwc2_readl(hsotg, HCINT(chnum));
hcintmsk = dwc2_readl(hsotg, HCINTMSK(chnum)); hcintmsk = dwc2_readl(hsotg, HCINTMSK(chnum));
hcint = hcintraw & hcintmsk;
dwc2_writel(hsotg, hcint, HCINT(chnum));
if (!chan) { if (!chan) {
dev_err(hsotg->dev, "## hc_ptr_array for channel is NULL ##\n"); dev_err(hsotg->dev, "## hc_ptr_array for channel is NULL ##\n");
dwc2_writel(hsotg, hcint, HCINT(chnum));
return; return;
} }
...@@ -2032,11 +2034,9 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum) ...@@ -2032,11 +2034,9 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum)
chnum); chnum);
dev_vdbg(hsotg->dev, dev_vdbg(hsotg->dev,
" hcint 0x%08x, hcintmsk 0x%08x, hcint&hcintmsk 0x%08x\n", " hcint 0x%08x, hcintmsk 0x%08x, hcint&hcintmsk 0x%08x\n",
hcint, hcintmsk, hcint & hcintmsk); hcintraw, hcintmsk, hcint);
} }
dwc2_writel(hsotg, hcint, HCINT(chnum));
/* /*
* If we got an interrupt after someone called * If we got an interrupt after someone called
* dwc2_hcd_endpoint_disable() we don't want to crash below * dwc2_hcd_endpoint_disable() we don't want to crash below
...@@ -2046,8 +2046,7 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum) ...@@ -2046,8 +2046,7 @@ static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum)
return; return;
} }
chan->hcint = hcint; chan->hcint = hcintraw;
hcint &= hcintmsk;
/* /*
* If the channel was halted due to a dequeue, the qtd list might * If the channel was halted due to a dequeue, the qtd list might
......
...@@ -2034,6 +2034,8 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -2034,6 +2034,8 @@ static int dwc3_probe(struct platform_device *pdev)
pm_runtime_put(dev); pm_runtime_put(dev);
dma_set_max_seg_size(dev, UINT_MAX);
return 0; return 0;
err_exit_debugfs: err_exit_debugfs:
......
...@@ -505,6 +505,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc) ...@@ -505,6 +505,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc)
dwc->role_switch_default_mode = USB_DR_MODE_PERIPHERAL; dwc->role_switch_default_mode = USB_DR_MODE_PERIPHERAL;
mode = DWC3_GCTL_PRTCAP_DEVICE; mode = DWC3_GCTL_PRTCAP_DEVICE;
} }
dwc3_set_mode(dwc, mode);
dwc3_role_switch.fwnode = dev_fwnode(dwc->dev); dwc3_role_switch.fwnode = dev_fwnode(dwc->dev);
dwc3_role_switch.set = dwc3_usb_role_switch_set; dwc3_role_switch.set = dwc3_usb_role_switch_set;
...@@ -526,7 +527,6 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc) ...@@ -526,7 +527,6 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc)
} }
} }
dwc3_set_mode(dwc, mode);
return 0; return 0;
} }
#else #else
......
...@@ -546,10 +546,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev) ...@@ -546,10 +546,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
pdata ? pdata->hs_phy_irq_index : -1); pdata ? pdata->hs_phy_irq_index : -1);
if (irq > 0) { if (irq > 0) {
/* Keep wakeup interrupts disabled until suspend */ /* Keep wakeup interrupts disabled until suspend */
irq_set_status_flags(irq, IRQ_NOAUTOEN);
ret = devm_request_threaded_irq(qcom->dev, irq, NULL, ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
qcom_dwc3_resume_irq, qcom_dwc3_resume_irq,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT, IRQF_ONESHOT | IRQF_NO_AUTOEN,
"qcom_dwc3 HS", qcom); "qcom_dwc3 HS", qcom);
if (ret) { if (ret) {
dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret); dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret);
...@@ -561,10 +560,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev) ...@@ -561,10 +560,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
irq = dwc3_qcom_get_irq(pdev, "dp_hs_phy_irq", irq = dwc3_qcom_get_irq(pdev, "dp_hs_phy_irq",
pdata ? pdata->dp_hs_phy_irq_index : -1); pdata ? pdata->dp_hs_phy_irq_index : -1);
if (irq > 0) { if (irq > 0) {
irq_set_status_flags(irq, IRQ_NOAUTOEN);
ret = devm_request_threaded_irq(qcom->dev, irq, NULL, ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
qcom_dwc3_resume_irq, qcom_dwc3_resume_irq,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT, IRQF_ONESHOT | IRQF_NO_AUTOEN,
"qcom_dwc3 DP_HS", qcom); "qcom_dwc3 DP_HS", qcom);
if (ret) { if (ret) {
dev_err(qcom->dev, "dp_hs_phy_irq failed: %d\n", ret); dev_err(qcom->dev, "dp_hs_phy_irq failed: %d\n", ret);
...@@ -576,10 +574,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev) ...@@ -576,10 +574,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
irq = dwc3_qcom_get_irq(pdev, "dm_hs_phy_irq", irq = dwc3_qcom_get_irq(pdev, "dm_hs_phy_irq",
pdata ? pdata->dm_hs_phy_irq_index : -1); pdata ? pdata->dm_hs_phy_irq_index : -1);
if (irq > 0) { if (irq > 0) {
irq_set_status_flags(irq, IRQ_NOAUTOEN);
ret = devm_request_threaded_irq(qcom->dev, irq, NULL, ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
qcom_dwc3_resume_irq, qcom_dwc3_resume_irq,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT, IRQF_ONESHOT | IRQF_NO_AUTOEN,
"qcom_dwc3 DM_HS", qcom); "qcom_dwc3 DM_HS", qcom);
if (ret) { if (ret) {
dev_err(qcom->dev, "dm_hs_phy_irq failed: %d\n", ret); dev_err(qcom->dev, "dm_hs_phy_irq failed: %d\n", ret);
...@@ -591,10 +588,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev) ...@@ -591,10 +588,9 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
irq = dwc3_qcom_get_irq(pdev, "ss_phy_irq", irq = dwc3_qcom_get_irq(pdev, "ss_phy_irq",
pdata ? pdata->ss_phy_irq_index : -1); pdata ? pdata->ss_phy_irq_index : -1);
if (irq > 0) { if (irq > 0) {
irq_set_status_flags(irq, IRQ_NOAUTOEN);
ret = devm_request_threaded_irq(qcom->dev, irq, NULL, ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
qcom_dwc3_resume_irq, qcom_dwc3_resume_irq,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT, IRQF_ONESHOT | IRQF_NO_AUTOEN,
"qcom_dwc3 SS", qcom); "qcom_dwc3 SS", qcom);
if (ret) { if (ret) {
dev_err(qcom->dev, "ss_phy_irq failed: %d\n", ret); dev_err(qcom->dev, "ss_phy_irq failed: %d\n", ret);
...@@ -758,6 +754,7 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev) ...@@ -758,6 +754,7 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev)
if (!qcom->dwc3) { if (!qcom->dwc3) {
ret = -ENODEV; ret = -ENODEV;
dev_err(dev, "failed to get dwc3 platform device\n"); dev_err(dev, "failed to get dwc3 platform device\n");
of_platform_depopulate(dev);
} }
node_put: node_put:
...@@ -766,9 +763,9 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev) ...@@ -766,9 +763,9 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev)
return ret; return ret;
} }
static struct platform_device * static struct platform_device *dwc3_qcom_create_urs_usb_platdev(struct device *dev)
dwc3_qcom_create_urs_usb_platdev(struct device *dev)
{ {
struct platform_device *urs_usb = NULL;
struct fwnode_handle *fwh; struct fwnode_handle *fwh;
struct acpi_device *adev; struct acpi_device *adev;
char name[8]; char name[8];
...@@ -788,9 +785,26 @@ dwc3_qcom_create_urs_usb_platdev(struct device *dev) ...@@ -788,9 +785,26 @@ dwc3_qcom_create_urs_usb_platdev(struct device *dev)
adev = to_acpi_device_node(fwh); adev = to_acpi_device_node(fwh);
if (!adev) if (!adev)
return NULL; goto err_put_handle;
urs_usb = acpi_create_platform_device(adev, NULL);
if (IS_ERR_OR_NULL(urs_usb))
goto err_put_handle;
return urs_usb;
err_put_handle:
fwnode_handle_put(fwh);
return urs_usb;
}
return acpi_create_platform_device(adev, NULL); static void dwc3_qcom_destroy_urs_usb_platdev(struct platform_device *urs_usb)
{
struct fwnode_handle *fwh = urs_usb->dev.fwnode;
platform_device_unregister(urs_usb);
fwnode_handle_put(fwh);
} }
static int dwc3_qcom_probe(struct platform_device *pdev) static int dwc3_qcom_probe(struct platform_device *pdev)
...@@ -874,13 +888,13 @@ static int dwc3_qcom_probe(struct platform_device *pdev) ...@@ -874,13 +888,13 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
qcom->qscratch_base = devm_ioremap_resource(dev, parent_res); qcom->qscratch_base = devm_ioremap_resource(dev, parent_res);
if (IS_ERR(qcom->qscratch_base)) { if (IS_ERR(qcom->qscratch_base)) {
ret = PTR_ERR(qcom->qscratch_base); ret = PTR_ERR(qcom->qscratch_base);
goto clk_disable; goto free_urs;
} }
ret = dwc3_qcom_setup_irq(pdev); ret = dwc3_qcom_setup_irq(pdev);
if (ret) { if (ret) {
dev_err(dev, "failed to setup IRQs, err=%d\n", ret); dev_err(dev, "failed to setup IRQs, err=%d\n", ret);
goto clk_disable; goto free_urs;
} }
/* /*
...@@ -899,7 +913,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) ...@@ -899,7 +913,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(dev, "failed to register DWC3 Core, err=%d\n", ret); dev_err(dev, "failed to register DWC3 Core, err=%d\n", ret);
goto depopulate; goto free_urs;
} }
ret = dwc3_qcom_interconnect_init(qcom); ret = dwc3_qcom_interconnect_init(qcom);
...@@ -931,10 +945,16 @@ static int dwc3_qcom_probe(struct platform_device *pdev) ...@@ -931,10 +945,16 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
interconnect_exit: interconnect_exit:
dwc3_qcom_interconnect_exit(qcom); dwc3_qcom_interconnect_exit(qcom);
depopulate: depopulate:
if (np) if (np) {
of_platform_depopulate(&pdev->dev); of_platform_depopulate(&pdev->dev);
else } else {
platform_device_put(pdev); device_remove_software_node(&qcom->dwc3->dev);
platform_device_del(qcom->dwc3);
}
platform_device_put(qcom->dwc3);
free_urs:
if (qcom->urs_usb)
dwc3_qcom_destroy_urs_usb_platdev(qcom->urs_usb);
clk_disable: clk_disable:
for (i = qcom->num_clocks - 1; i >= 0; i--) { for (i = qcom->num_clocks - 1; i >= 0; i--) {
clk_disable_unprepare(qcom->clks[i]); clk_disable_unprepare(qcom->clks[i]);
...@@ -953,11 +973,16 @@ static void dwc3_qcom_remove(struct platform_device *pdev) ...@@ -953,11 +973,16 @@ static void dwc3_qcom_remove(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int i; int i;
device_remove_software_node(&qcom->dwc3->dev); if (np) {
if (np)
of_platform_depopulate(&pdev->dev); of_platform_depopulate(&pdev->dev);
else } else {
platform_device_put(pdev); device_remove_software_node(&qcom->dwc3->dev);
platform_device_del(qcom->dwc3);
}
platform_device_put(qcom->dwc3);
if (qcom->urs_usb)
dwc3_qcom_destroy_urs_usb_platdev(qcom->urs_usb);
for (i = qcom->num_clocks - 1; i >= 0; i--) { for (i = qcom->num_clocks - 1; i >= 0; i--) {
clk_disable_unprepare(qcom->clks[i]); clk_disable_unprepare(qcom->clks[i]);
......
...@@ -183,10 +183,13 @@ static enum usb_device_speed __get_dwc3_maximum_speed(struct device_node *np) ...@@ -183,10 +183,13 @@ static enum usb_device_speed __get_dwc3_maximum_speed(struct device_node *np)
ret = of_property_read_string(dwc3_np, "maximum-speed", &maximum_speed); ret = of_property_read_string(dwc3_np, "maximum-speed", &maximum_speed);
if (ret < 0) if (ret < 0)
return USB_SPEED_UNKNOWN; goto out;
ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed);
out:
of_node_put(dwc3_np);
return (ret < 0) ? USB_SPEED_UNKNOWN : ret; return (ret < 0) ? USB_SPEED_UNKNOWN : ret;
} }
...@@ -339,6 +342,9 @@ static int dwc3_rtk_probe_dwc3_core(struct dwc3_rtk *rtk) ...@@ -339,6 +342,9 @@ static int dwc3_rtk_probe_dwc3_core(struct dwc3_rtk *rtk)
switch_usb2_role(rtk, rtk->cur_role); switch_usb2_role(rtk, rtk->cur_role);
platform_device_put(dwc3_pdev);
of_node_put(dwc3_node);
return 0; return 0;
err_pdev_put: err_pdev_put:
......
...@@ -650,9 +650,8 @@ static int check_isoc_ss_overlap(struct mu3h_sch_ep_info *sch_ep, u32 offset) ...@@ -650,9 +650,8 @@ static int check_isoc_ss_overlap(struct mu3h_sch_ep_info *sch_ep, u32 offset)
if (sch_ep->ep_type == ISOC_OUT_EP) { if (sch_ep->ep_type == ISOC_OUT_EP) {
for (j = 0; j < sch_ep->num_budget_microframes; j++) { for (j = 0; j < sch_ep->num_budget_microframes; j++) {
k = XHCI_MTK_BW_INDEX(base + j + CS_OFFSET); k = XHCI_MTK_BW_INDEX(base + j);
/* use cs to indicate existence of in-ss @(base+j) */ if (tt->in_ss_cnt[k])
if (tt->fs_bus_bw_in[k])
return -ESCH_SS_OVERLAP; return -ESCH_SS_OVERLAP;
} }
} else if (sch_ep->ep_type == ISOC_IN_EP || sch_ep->ep_type == INT_IN_EP) { } else if (sch_ep->ep_type == ISOC_IN_EP || sch_ep->ep_type == INT_IN_EP) {
...@@ -769,6 +768,14 @@ static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used) ...@@ -769,6 +768,14 @@ static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used)
tt->fs_frame_bw[f] -= (u16)sch_ep->bw_budget_table[j]; tt->fs_frame_bw[f] -= (u16)sch_ep->bw_budget_table[j];
} }
} }
if (sch_ep->ep_type == ISOC_IN_EP || sch_ep->ep_type == INT_IN_EP) {
k = XHCI_MTK_BW_INDEX(base);
if (used)
tt->in_ss_cnt[k]++;
else
tt->in_ss_cnt[k]--;
}
} }
if (used) if (used)
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
* @fs_bus_bw_in: save bandwidth used by FS/LS IN eps in each uframes * @fs_bus_bw_in: save bandwidth used by FS/LS IN eps in each uframes
* @ls_bus_bw: save bandwidth used by LS eps in each uframes * @ls_bus_bw: save bandwidth used by LS eps in each uframes
* @fs_frame_bw: save bandwidth used by FS/LS eps in each FS frames * @fs_frame_bw: save bandwidth used by FS/LS eps in each FS frames
* @in_ss_cnt: the count of Start-Split for IN eps
* @ep_list: Endpoints using this TT * @ep_list: Endpoints using this TT
*/ */
struct mu3h_sch_tt { struct mu3h_sch_tt {
...@@ -45,6 +46,7 @@ struct mu3h_sch_tt { ...@@ -45,6 +46,7 @@ struct mu3h_sch_tt {
u16 fs_bus_bw_in[XHCI_MTK_MAX_ESIT]; u16 fs_bus_bw_in[XHCI_MTK_MAX_ESIT];
u8 ls_bus_bw[XHCI_MTK_MAX_ESIT]; u8 ls_bus_bw[XHCI_MTK_MAX_ESIT];
u16 fs_frame_bw[XHCI_MTK_FRAMES_CNT]; u16 fs_frame_bw[XHCI_MTK_FRAMES_CNT];
u8 in_ss_cnt[XHCI_MTK_MAX_ESIT];
struct list_head ep_list; struct list_head ep_list;
}; };
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/usb/phy.h> #include <linux/usb/phy.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -148,7 +149,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s ...@@ -148,7 +149,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
int ret; int ret;
int irq; int irq;
struct xhci_plat_priv *priv = NULL; struct xhci_plat_priv *priv = NULL;
bool of_match;
if (usb_disabled()) if (usb_disabled())
return -ENODEV; return -ENODEV;
...@@ -253,16 +254,23 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s ...@@ -253,16 +254,23 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
&xhci->imod_interval); &xhci->imod_interval);
} }
hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0); /*
if (IS_ERR(hcd->usb_phy)) { * Drivers such as dwc3 manages PHYs themself (and rely on driver name
ret = PTR_ERR(hcd->usb_phy); * matching for the xhci platform device).
if (ret == -EPROBE_DEFER) */
goto disable_clk; of_match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);
hcd->usb_phy = NULL; if (of_match) {
} else { hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
ret = usb_phy_init(hcd->usb_phy); if (IS_ERR(hcd->usb_phy)) {
if (ret) ret = PTR_ERR(hcd->usb_phy);
goto disable_clk; if (ret == -EPROBE_DEFER)
goto disable_clk;
hcd->usb_phy = NULL;
} else {
ret = usb_phy_init(hcd->usb_phy);
if (ret)
goto disable_clk;
}
} }
hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
...@@ -285,15 +293,17 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s ...@@ -285,15 +293,17 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
goto dealloc_usb2_hcd; goto dealloc_usb2_hcd;
} }
xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, if (of_match) {
"usb-phy", 1); xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,
if (IS_ERR(xhci->shared_hcd->usb_phy)) { "usb-phy", 1);
xhci->shared_hcd->usb_phy = NULL; if (IS_ERR(xhci->shared_hcd->usb_phy)) {
} else { xhci->shared_hcd->usb_phy = NULL;
ret = usb_phy_init(xhci->shared_hcd->usb_phy); } else {
if (ret) ret = usb_phy_init(xhci->shared_hcd->usb_phy);
dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n", if (ret)
__func__, ret); dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n",
__func__, ret);
}
} }
xhci->shared_hcd->tpl_support = hcd->tpl_support; xhci->shared_hcd->tpl_support = hcd->tpl_support;
......
...@@ -432,6 +432,8 @@ static const struct usb_device_id onboard_hub_id_table[] = { ...@@ -432,6 +432,8 @@ static const struct usb_device_id onboard_hub_id_table[] = {
{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2412) }, /* USB2412 USB 2.0 */ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2412) }, /* USB2412 USB 2.0 */
{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */
{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2517) }, /* USB2517 USB 2.0 */ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2517) }, /* USB2517 USB 2.0 */
{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2744) }, /* USB5744 USB 2.0 */
{ USB_DEVICE(VENDOR_ID_MICROCHIP, 0x5744) }, /* USB5744 USB 3.0 */
{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */
{ USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */
{ USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */ { USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */
......
...@@ -16,6 +16,11 @@ static const struct onboard_hub_pdata microchip_usb424_data = { ...@@ -16,6 +16,11 @@ static const struct onboard_hub_pdata microchip_usb424_data = {
.num_supplies = 1, .num_supplies = 1,
}; };
static const struct onboard_hub_pdata microchip_usb5744_data = {
.reset_us = 0,
.num_supplies = 2,
};
static const struct onboard_hub_pdata realtek_rts5411_data = { static const struct onboard_hub_pdata realtek_rts5411_data = {
.reset_us = 0, .reset_us = 0,
.num_supplies = 1, .num_supplies = 1,
...@@ -50,6 +55,8 @@ static const struct of_device_id onboard_hub_match[] = { ...@@ -50,6 +55,8 @@ static const struct of_device_id onboard_hub_match[] = {
{ .compatible = "usb424,2412", .data = &microchip_usb424_data, }, { .compatible = "usb424,2412", .data = &microchip_usb424_data, },
{ .compatible = "usb424,2514", .data = &microchip_usb424_data, }, { .compatible = "usb424,2514", .data = &microchip_usb424_data, },
{ .compatible = "usb424,2517", .data = &microchip_usb424_data, }, { .compatible = "usb424,2517", .data = &microchip_usb424_data, },
{ .compatible = "usb424,2744", .data = &microchip_usb5744_data, },
{ .compatible = "usb424,5744", .data = &microchip_usb5744_data, },
{ .compatible = "usb451,8140", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8140", .data = &ti_tusb8041_data, },
{ .compatible = "usb451,8142", .data = &ti_tusb8041_data, }, { .compatible = "usb451,8142", .data = &ti_tusb8041_data, },
{ .compatible = "usb4b4,6504", .data = &cypress_hx3_data, }, { .compatible = "usb4b4,6504", .data = &cypress_hx3_data, },
......
...@@ -457,8 +457,8 @@ static void ljca_auxdev_acpi_bind(struct ljca_adapter *adap, ...@@ -457,8 +457,8 @@ static void ljca_auxdev_acpi_bind(struct ljca_adapter *adap,
u64 adr, u8 id) u64 adr, u8 id)
{ {
struct ljca_match_ids_walk_data wd = { 0 }; struct ljca_match_ids_walk_data wd = { 0 };
struct acpi_device *parent, *adev;
struct device *dev = adap->dev; struct device *dev = adap->dev;
struct acpi_device *parent;
char uid[4]; char uid[4];
parent = ACPI_COMPANION(dev); parent = ACPI_COMPANION(dev);
...@@ -466,17 +466,7 @@ static void ljca_auxdev_acpi_bind(struct ljca_adapter *adap, ...@@ -466,17 +466,7 @@ static void ljca_auxdev_acpi_bind(struct ljca_adapter *adap,
return; return;
/* /*
* get auxdev ACPI handle from the ACPI device directly * Currently LJCA hw doesn't use _ADR instead the shipped
* under the parent that matches _ADR.
*/
adev = acpi_find_child_device(parent, adr, false);
if (adev) {
ACPI_COMPANION_SET(&auxdev->dev, adev);
return;
}
/*
* _ADR is a grey area in the ACPI specification, some
* platforms use _HID to distinguish children devices. * platforms use _HID to distinguish children devices.
*/ */
switch (adr) { switch (adr) {
...@@ -656,10 +646,11 @@ static int ljca_enumerate_spi(struct ljca_adapter *adap) ...@@ -656,10 +646,11 @@ static int ljca_enumerate_spi(struct ljca_adapter *adap)
unsigned int i; unsigned int i;
int ret; int ret;
/* Not all LJCA chips implement SPI, a timeout reading the descriptors is normal */
ret = ljca_send(adap, LJCA_CLIENT_MNG, LJCA_MNG_ENUM_SPI, NULL, 0, buf, ret = ljca_send(adap, LJCA_CLIENT_MNG, LJCA_MNG_ENUM_SPI, NULL, 0, buf,
sizeof(buf), true, LJCA_ENUM_CLIENT_TIMEOUT_MS); sizeof(buf), true, LJCA_ENUM_CLIENT_TIMEOUT_MS);
if (ret < 0) if (ret < 0)
return ret; return (ret == -ETIMEDOUT) ? 0 : ret;
/* check firmware response */ /* check firmware response */
desc = (struct ljca_spi_descriptor *)buf; desc = (struct ljca_spi_descriptor *)buf;
......
...@@ -203,8 +203,8 @@ static void option_instat_callback(struct urb *urb); ...@@ -203,8 +203,8 @@ static void option_instat_callback(struct urb *urb);
#define DELL_PRODUCT_5829E_ESIM 0x81e4 #define DELL_PRODUCT_5829E_ESIM 0x81e4
#define DELL_PRODUCT_5829E 0x81e6 #define DELL_PRODUCT_5829E 0x81e6
#define DELL_PRODUCT_FM101R 0x8213 #define DELL_PRODUCT_FM101R_ESIM 0x8213
#define DELL_PRODUCT_FM101R_ESIM 0x8215 #define DELL_PRODUCT_FM101R 0x8215
#define KYOCERA_VENDOR_ID 0x0c88 #define KYOCERA_VENDOR_ID 0x0c88
#define KYOCERA_PRODUCT_KPC650 0x17da #define KYOCERA_PRODUCT_KPC650 0x17da
...@@ -609,6 +609,8 @@ static void option_instat_callback(struct urb *urb); ...@@ -609,6 +609,8 @@ static void option_instat_callback(struct urb *urb);
#define UNISOC_VENDOR_ID 0x1782 #define UNISOC_VENDOR_ID 0x1782
/* TOZED LT70-C based on UNISOC SL8563 uses UNISOC's vendor ID */ /* TOZED LT70-C based on UNISOC SL8563 uses UNISOC's vendor ID */
#define TOZED_PRODUCT_LT70C 0x4055 #define TOZED_PRODUCT_LT70C 0x4055
/* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */
#define LUAT_PRODUCT_AIR720U 0x4e00
/* Device flags */ /* Device flags */
...@@ -1546,7 +1548,8 @@ static const struct usb_device_id option_ids[] = { ...@@ -1546,7 +1548,8 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff), { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
.driver_info = RSVD(4) }, .driver_info = RSVD(4) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff),
.driver_info = RSVD(4) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */
.driver_info = RSVD(4) }, .driver_info = RSVD(4) },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) },
...@@ -2249,6 +2252,7 @@ static const struct usb_device_id option_ids[] = { ...@@ -2249,6 +2252,7 @@ static const struct usb_device_id option_ids[] = {
.driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, .driver_info = RSVD(4) | RSVD(5) | RSVD(6) },
{ USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */ { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */ { USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x0001, 0xff, 0xff, 0xff) }, /* Fibocom L716-EU (ECM/RNDIS mode) */
{ USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */
.driver_info = RSVD(4) | RSVD(5) }, .driver_info = RSVD(4) | RSVD(5) },
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
...@@ -2271,6 +2275,7 @@ static const struct usb_device_id option_ids[] = { ...@@ -2271,6 +2275,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) },
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
MODULE_DEVICE_TABLE(usb, option_ids); MODULE_DEVICE_TABLE(usb, option_ids);
......
...@@ -4273,7 +4273,8 @@ static void run_state_machine(struct tcpm_port *port) ...@@ -4273,7 +4273,8 @@ static void run_state_machine(struct tcpm_port *port)
current_lim = PD_P_SNK_STDBY_MW / 5; current_lim = PD_P_SNK_STDBY_MW / 5;
tcpm_set_current_limit(port, current_lim, 5000); tcpm_set_current_limit(port, current_lim, 5000);
/* Not sink vbus if operational current is 0mA */ /* Not sink vbus if operational current is 0mA */
tcpm_set_charge(port, !!pdo_max_current(port->snk_pdo[0])); tcpm_set_charge(port, !port->pd_supported ||
pdo_max_current(port->snk_pdo[0]));
if (!port->pd_supported) if (!port->pd_supported)
tcpm_set_state(port, SNK_READY, 0); tcpm_set_state(port, SNK_READY, 0);
...@@ -5391,6 +5392,15 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port) ...@@ -5391,6 +5392,15 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port)
if (port->bist_request == BDO_MODE_TESTDATA && port->tcpc->set_bist_data) if (port->bist_request == BDO_MODE_TESTDATA && port->tcpc->set_bist_data)
port->tcpc->set_bist_data(port->tcpc, false); port->tcpc->set_bist_data(port->tcpc, false);
switch (port->state) {
case ERROR_RECOVERY:
case PORT_RESET:
case PORT_RESET_WAIT_OFF:
return;
default:
break;
}
if (port->ams != NONE_AMS) if (port->ams != NONE_AMS)
port->ams = NONE_AMS; port->ams = NONE_AMS;
if (port->hard_reset_count < PD_N_HARD_RESET_COUNT) if (port->hard_reset_count < PD_N_HARD_RESET_COUNT)
......
...@@ -968,16 +968,17 @@ static int tps25750_start_patch_burst_mode(struct tps6598x *tps) ...@@ -968,16 +968,17 @@ static int tps25750_start_patch_burst_mode(struct tps6598x *tps)
ret = of_property_match_string(np, "reg-names", "patch-address"); ret = of_property_match_string(np, "reg-names", "patch-address");
if (ret < 0) { if (ret < 0) {
dev_err(tps->dev, "failed to get patch-address %d\n", ret); dev_err(tps->dev, "failed to get patch-address %d\n", ret);
return ret; goto release_fw;
} }
ret = of_property_read_u32_index(np, "reg", ret, &addr); ret = of_property_read_u32_index(np, "reg", ret, &addr);
if (ret) if (ret)
return ret; goto release_fw;
if (addr == 0 || (addr >= 0x20 && addr <= 0x23)) { if (addr == 0 || (addr >= 0x20 && addr <= 0x23)) {
dev_err(tps->dev, "wrong patch address %u\n", addr); dev_err(tps->dev, "wrong patch address %u\n", addr);
return -EINVAL; ret = -EINVAL;
goto release_fw;
} }
bpms_data.addr = (u8)addr; bpms_data.addr = (u8)addr;
...@@ -1226,7 +1227,10 @@ static int tps6598x_probe(struct i2c_client *client) ...@@ -1226,7 +1227,10 @@ static int tps6598x_probe(struct i2c_client *client)
TPS_REG_INT_PLUG_EVENT; TPS_REG_INT_PLUG_EVENT;
} }
tps->data = device_get_match_data(tps->dev); if (dev_fwnode(tps->dev))
tps->data = device_get_match_data(tps->dev);
else
tps->data = i2c_get_match_data(client);
if (!tps->data) if (!tps->data)
return -EINVAL; return -EINVAL;
...@@ -1425,7 +1429,7 @@ static const struct of_device_id tps6598x_of_match[] = { ...@@ -1425,7 +1429,7 @@ static const struct of_device_id tps6598x_of_match[] = {
MODULE_DEVICE_TABLE(of, tps6598x_of_match); MODULE_DEVICE_TABLE(of, tps6598x_of_match);
static const struct i2c_device_id tps6598x_id[] = { static const struct i2c_device_id tps6598x_id[] = {
{ "tps6598x" }, { "tps6598x", (kernel_ulong_t)&tps6598x_data },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, tps6598x_id); MODULE_DEVICE_TABLE(i2c, tps6598x_id);
......
...@@ -144,10 +144,6 @@ struct usb_phy { ...@@ -144,10 +144,6 @@ struct usb_phy {
*/ */
int (*set_wakeup)(struct usb_phy *x, bool enabled); int (*set_wakeup)(struct usb_phy *x, bool enabled);
/* notify phy port status change */
int (*notify_port_status)(struct usb_phy *x, int port,
u16 portstatus, u16 portchange);
/* notify phy connect status change */ /* notify phy connect status change */
int (*notify_connect)(struct usb_phy *x, int (*notify_connect)(struct usb_phy *x,
enum usb_device_speed speed); enum usb_device_speed speed);
...@@ -320,15 +316,6 @@ usb_phy_set_wakeup(struct usb_phy *x, bool enabled) ...@@ -320,15 +316,6 @@ usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
return 0; return 0;
} }
static inline int
usb_phy_notify_port_status(struct usb_phy *x, int port, u16 portstatus, u16 portchange)
{
if (x && x->notify_port_status)
return x->notify_port_status(x, port, portstatus, portchange);
else
return 0;
}
static inline int static inline int
usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment