mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
Merge 17d426628c ("usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE") into android14-6.1-lts
Steps on the way to 6.1.129 Resolves merge conflicts in: drivers/usb/dwc3/core.c Change-Id: I2c283da276b9179cd76403d2fa83da077615d0be Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -1621,8 +1621,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
|
|||||||
u8 tx_thr_num_pkt_prd = 0;
|
u8 tx_thr_num_pkt_prd = 0;
|
||||||
u8 tx_max_burst_prd = 0;
|
u8 tx_max_burst_prd = 0;
|
||||||
u8 tx_fifo_resize_max_num;
|
u8 tx_fifo_resize_max_num;
|
||||||
const char *usb_psy_name;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* default to highest possible threshold */
|
/* default to highest possible threshold */
|
||||||
lpm_nyet_threshold = 0xf;
|
lpm_nyet_threshold = 0xf;
|
||||||
@@ -1655,13 +1653,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
|
|||||||
else
|
else
|
||||||
dwc->sysdev = dwc->dev;
|
dwc->sysdev = dwc->dev;
|
||||||
|
|
||||||
ret = device_property_read_string(dev, "usb-psy-name", &usb_psy_name);
|
|
||||||
if (ret >= 0) {
|
|
||||||
dwc->usb_psy = power_supply_get_by_name(usb_psy_name);
|
|
||||||
if (!dwc->usb_psy)
|
|
||||||
dev_err(dev, "couldn't get usb power supply\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
dwc->has_lpm_erratum = device_property_read_bool(dev,
|
dwc->has_lpm_erratum = device_property_read_bool(dev,
|
||||||
"snps,has-lpm-erratum");
|
"snps,has-lpm-erratum");
|
||||||
device_property_read_u8(dev, "snps,lpm-nyet-threshold",
|
device_property_read_u8(dev, "snps,lpm-nyet-threshold",
|
||||||
@@ -1976,6 +1967,23 @@ static int dwc3_get_num_ports(struct dwc3 *dwc)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct power_supply *dwc3_get_usb_power_supply(struct dwc3 *dwc)
|
||||||
|
{
|
||||||
|
struct power_supply *usb_psy;
|
||||||
|
const char *usb_psy_name;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = device_property_read_string(dwc->dev, "usb-psy-name", &usb_psy_name);
|
||||||
|
if (ret < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
usb_psy = power_supply_get_by_name(usb_psy_name);
|
||||||
|
if (!usb_psy)
|
||||||
|
return ERR_PTR(-EPROBE_DEFER);
|
||||||
|
|
||||||
|
return usb_psy;
|
||||||
|
}
|
||||||
|
|
||||||
static int dwc3_probe(struct platform_device *pdev)
|
static int dwc3_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
@@ -2024,6 +2032,10 @@ static int dwc3_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
dwc3_get_properties(dwc);
|
dwc3_get_properties(dwc);
|
||||||
|
|
||||||
|
dwc->usb_psy = dwc3_get_usb_power_supply(dwc);
|
||||||
|
if (IS_ERR(dwc->usb_psy))
|
||||||
|
return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n");
|
||||||
|
|
||||||
dwc->reset = devm_reset_control_array_get_optional_shared(dev);
|
dwc->reset = devm_reset_control_array_get_optional_shared(dev);
|
||||||
if (IS_ERR(dwc->reset)) {
|
if (IS_ERR(dwc->reset)) {
|
||||||
ret = PTR_ERR(dwc->reset);
|
ret = PTR_ERR(dwc->reset);
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
of_node_put(args.np);
|
||||||
am62->offset = args.args[0];
|
am62->offset = args.args[0];
|
||||||
|
|
||||||
ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code);
|
ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code);
|
||||||
|
|||||||
@@ -4101,7 +4101,7 @@ static void run_state_machine(struct tcpm_port *port)
|
|||||||
port->caps_count = 0;
|
port->caps_count = 0;
|
||||||
port->pd_capable = true;
|
port->pd_capable = true;
|
||||||
tcpm_set_state_cond(port, SRC_SEND_CAPABILITIES_TIMEOUT,
|
tcpm_set_state_cond(port, SRC_SEND_CAPABILITIES_TIMEOUT,
|
||||||
PD_T_SEND_SOURCE_CAP);
|
PD_T_SENDER_RESPONSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SRC_SEND_CAPABILITIES_TIMEOUT:
|
case SRC_SEND_CAPABILITIES_TIMEOUT:
|
||||||
|
|||||||
Reference in New Issue
Block a user