Skip to content

Commit

Permalink
Merge remote-tracking branch 'soundwire/next' into sound/upstream-202…
Browse files Browse the repository at this point in the history
…31023
  • Loading branch information
plbossart committed Oct 23, 2023
2 parents 5524595 + 4ea2b6d commit e6bc5f2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
12 changes: 7 additions & 5 deletions drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ static int sdw_slave_clk_stop_prepare(struct sdw_slave *slave,
return ret;
}

static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num)
static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num, bool prepare)
{
int retry = bus->clk_stop_timeout;
int val;
Expand All @@ -1036,7 +1036,8 @@ static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num)
}
val &= SDW_SCP_STAT_CLK_STP_NF;
if (!val) {
dev_dbg(bus->dev, "clock stop prep/de-prep done slave:%d\n",
dev_dbg(bus->dev, "clock stop %s done slave:%d\n",
prepare ? "prepare" : "deprepare",
dev_num);
return 0;
}
Expand All @@ -1045,7 +1046,8 @@ static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num)
retry--;
} while (retry);

dev_err(bus->dev, "clock stop prep/de-prep failed slave:%d\n",
dev_dbg(bus->dev, "clock stop %s did not complete for slave:%d\n",
prepare ? "prepare" : "deprepare",
dev_num);

return -ETIMEDOUT;
Expand Down Expand Up @@ -1116,7 +1118,7 @@ int sdw_bus_prep_clk_stop(struct sdw_bus *bus)
*/
if (!simple_clk_stop) {
ret = sdw_bus_wait_for_clk_prep_deprep(bus,
SDW_BROADCAST_DEV_NUM);
SDW_BROADCAST_DEV_NUM, true);
/*
* if there are no Slave devices present and the reply is
* Command_Ignored/-ENODATA, we don't need to continue with the
Expand Down Expand Up @@ -1236,7 +1238,7 @@ int sdw_bus_exit_clk_stop(struct sdw_bus *bus)
* state machine
*/
if (!simple_clk_stop) {
ret = sdw_bus_wait_for_clk_prep_deprep(bus, SDW_BROADCAST_DEV_NUM);
ret = sdw_bus_wait_for_clk_prep_deprep(bus, SDW_BROADCAST_DEV_NUM, false);
if (ret < 0)
dev_warn(bus->dev, "clock stop deprepare wait failed:%d\n", ret);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/soundwire/dmi-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-k0xxx"),
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16"),
},
.driver_data = (void *)hp_omen_16,
},
Expand Down
18 changes: 15 additions & 3 deletions drivers/soundwire/qcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#define SWRM_INTERRUPT_STATUS_BUS_RESET_FINISHED_V2 BIT(13)
#define SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 BIT(14)
#define SWRM_INTERRUPT_STATUS_EXT_CLK_STOP_WAKEUP BIT(16)
#define SWRM_INTERRUPT_STATUS_CMD_IGNORED_AND_EXEC_CONTINUED BIT(19)
#define SWRM_INTERRUPT_MAX 17
#define SWRM_V1_3_INTERRUPT_MASK_ADDR 0x204
#define SWRM_V1_3_INTERRUPT_CLEAR 0x208
Expand Down Expand Up @@ -776,6 +777,17 @@ static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id)
break;
case SWRM_INTERRUPT_STATUS_EXT_CLK_STOP_WAKEUP:
break;
case SWRM_INTERRUPT_STATUS_CMD_IGNORED_AND_EXEC_CONTINUED:
ctrl->reg_read(ctrl,
ctrl->reg_layout[SWRM_REG_CMD_FIFO_STATUS],
&value);
dev_err(ctrl->dev,
"%s: SWR CMD ignored, fifo status %x\n",
__func__, value);

/* Wait 3.5ms to clear */
usleep_range(3500, 3505);
break;
default:
dev_err_ratelimited(ctrl->dev,
"%s: SWR unknown interrupt value: %d\n",
Expand All @@ -801,8 +813,8 @@ static bool swrm_wait_for_frame_gen_enabled(struct qcom_swrm_ctrl *ctrl)
int comp_sts;

do {
ctrl->reg_read(ctrl, SWRM_COMP_STATUS, &comp_sts);

ctrl->reg_read(ctrl, ctrl->reg_layout[SWRM_REG_FRAME_GEN_ENABLED],
&comp_sts);
if (comp_sts & SWRM_FRM_GEN_ENABLED)
return true;

Expand Down Expand Up @@ -1550,7 +1562,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)

ctrl->hclk = devm_clk_get(dev, "iface");
if (IS_ERR(ctrl->hclk)) {
ret = PTR_ERR(ctrl->hclk);
ret = dev_err_probe(dev, PTR_ERR(ctrl->hclk), "unable to get iface clock\n");
goto err_init;
}

Expand Down

0 comments on commit e6bc5f2

Please sign in to comment.