Merge 318745c5ea on remote branch

Change-Id: Id974ee3aabd7d99c3285668450d3206af3a424db
This commit is contained in:
Linux Build Service Account committed 2023-10-27 07:27:29 -07:00
commit f3875bf8b6
4 files changed
+52 -16

No files matched your search

+17 -4
View File
@@ -81,14 +81,12 @@ int btfm_slim_slave_enable_port(struct btfmslim *btfmslim, uint8_t port_num,
uint8_t reg_val = 0, en;
uint8_t rxport_num = 0;
uint16_t reg;
uint8_t prev_reg_val = 0;
BTFMSLIM_DBG("port(%d) enable(%d)", port_num, enable);
if (rxport) {
BTFMSLIM_DBG("sample rate is %d", btfmslim->sample_rate);
if (enable &&
btfmslim->sample_rate != 44100 &&
btfmslim->sample_rate != 88200) {
BTFMSLIM_DBG("setting multichannel bit");
if (enable) {
/* For SCO Rx, A2DP Rx other than 44.1 and 88.2Khz */
if (port_num < 24) {
rxport_num = port_num - 16;
@@ -102,6 +100,21 @@ int btfm_slim_slave_enable_port(struct btfmslim *btfmslim, uint8_t port_num,
rxport_num);
}
if (btfmslim->sample_rate == 44100 ||
btfmslim->sample_rate == 88200) {
BTFMSLIM_DBG("unsetting multichannel bit");
ret = btfm_slim_read(btfmslim, reg, 1,
&prev_reg_val, IFD);
if (ret < 0) {
BTFMSLIM_ERR("error %d reading", ret);
prev_reg_val = 0;
}
BTFMSLIM_DBG("prev_reg_val (%d) from reg(%x)",
prev_reg_val, reg);
reg_val = prev_reg_val & ~reg_val;
} else
BTFMSLIM_DBG("setting multichannel bit");
BTFMSLIM_DBG("writing reg_val (%d) to reg(%x)",
reg_val, reg);
ret = btfm_slim_write(btfmslim, reg, 1, &reg_val, IFD);
+1 -1
View File
@@ -358,7 +358,7 @@ static struct mhi_sat_device *find_sat_dev_by_id(
static bool mhi_sat_isvalid_header(struct sat_header *hdr, int len)
{
/* validate payload size */
if (len >= sizeof(*hdr) && (len != hdr->payload_size + sizeof(*hdr)))
if (len < sizeof(*hdr) || len != hdr->payload_size + sizeof(*hdr))
return false;
/* validate SAT IPC version */
+28 -9
View File
@@ -2005,6 +2005,24 @@ static void dwc3_gsi_event_buf_alloc(struct dwc3 *dwc)
}
}
static void dwc3_msm_modify_pipectl(struct dwc3 *dwc, bool set)
{
struct dwc3_msm *mdwc = dev_get_drvdata(dwc->dev->parent);
u32 reg;
reg = dwc3_msm_read_reg(mdwc->base, DWC3_GUSB3PIPECTL(0));
if (set) {
if ((dwc->speed != DWC3_DSTS_SUPERSPEED) &&
(dwc->speed != DWC3_DSTS_SUPERSPEED_PLUS))
reg |= DWC3_GUSB3PIPECTL_SUSPHY;
} else {
reg &= ~(DWC3_GUSB3PIPECTL_SUSPHY);
}
dwc3_msm_write_reg(mdwc->base, DWC3_GUSB3PIPECTL(0), reg);
}
static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event,
unsigned int value)
{
@@ -2070,6 +2088,9 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event,
break;
case DWC3_CONTROLLER_CONNDONE_EVENT:
dev_dbg(mdwc->dev, "DWC3_CONTROLLER_CONNDONE_EVENT received\n");
dwc3_msm_modify_pipectl(dwc, true);
/*
* Add power event if the dbm indicates coming out of L1 by
* interrupt
@@ -2194,6 +2215,13 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event,
break;
case DWC3_CONTROLLER_NOTIFY_CLEAR_DB:
dev_dbg(mdwc->dev, "DWC3_CONTROLLER_NOTIFY_CLEAR_DB\n");
/*
* Clear the susphy bit here to ensure it is not set during
* the course of controller initialisation process.
*/
dwc3_msm_modify_pipectl(dwc, false);
if (!mdwc->gsi_ev_buff)
break;
@@ -2266,15 +2294,6 @@ static void dwc3_msm_power_collapse_por(struct dwc3_msm *mdwc)
dev_err(mdwc->dev, "%s: dwc3_core init failed (%d)\n",
__func__, ret);
/* Get initial P3 status and enable IN_P3 event */
if (dwc3_is_usb31(dwc))
val = dwc3_msm_read_reg_field(mdwc->base,
DWC31_LINK_GDBGLTSSM,
DWC3_GDBGLTSSM_LINKSTATE_MASK);
else
val = dwc3_msm_read_reg_field(mdwc->base,
DWC3_GDBGLTSSM, DWC3_GDBGLTSSM_LINKSTATE_MASK);
atomic_set(&mdwc->in_p3, val == DWC3_LINK_STATE_U3);
dwc3_msm_write_reg_field(mdwc->base, PWR_EVNT_IRQ_MASK_REG,
PWR_EVNT_POWERDOWN_IN_P3_MASK, 1);
+6 -2
View File
@@ -2472,8 +2472,11 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
/* prevent pending bh to run later */
flush_work(&dwc->bh_work);
if (is_on)
dwc3_device_core_soft_reset(dwc);
if (is_on) {
ret = dwc3_device_core_soft_reset(dwc);
if (ret != 0)
goto done;
}
spin_lock_irqsave(&dwc->lock, flags);
if (dwc->ep0state != EP0_SETUP_PHASE)
@@ -2502,6 +2505,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
}
enable_irq(dwc->irq);
done:
pm_runtime_mark_last_busy(dwc->dev);
pm_runtime_put_autosuspend(dwc->dev);
dbg_event(0xFF, "Pullup put",