Skip to content

Commit be47c8e

Browse files
committed
Merge tag 'soundwire-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire
Pull soundwire updates from Vinod Koul: - Core now has improved handling of errors for clock stop - Support for qcom v2.0.0 status registers and command ignored interrupt and more logging for failures - DMI quirk for HP Omen machine * tag 'soundwire-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: dmi-quirks: update HP Omen match soundwire: bus: improve error handling for clock stop prepare/deprepare soundwire: qcom: Log clk_get("iface") failures soundwire: qcom: handle command ignored interrupt soundwire: qcom: use newer link status tregister on v2.0.0
2 parents bfafa2c + 4ea2b6d commit be47c8e

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

drivers/soundwire/bus.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static int sdw_slave_clk_stop_prepare(struct sdw_slave *slave,
10011001
return ret;
10021002
}
10031003

1004-
static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num)
1004+
static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num, bool prepare)
10051005
{
10061006
int retry = bus->clk_stop_timeout;
10071007
int val;
@@ -1015,7 +1015,8 @@ static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num)
10151015
}
10161016
val &= SDW_SCP_STAT_CLK_STP_NF;
10171017
if (!val) {
1018-
dev_dbg(bus->dev, "clock stop prep/de-prep done slave:%d\n",
1018+
dev_dbg(bus->dev, "clock stop %s done slave:%d\n",
1019+
prepare ? "prepare" : "deprepare",
10191020
dev_num);
10201021
return 0;
10211022
}
@@ -1024,7 +1025,8 @@ static int sdw_bus_wait_for_clk_prep_deprep(struct sdw_bus *bus, u16 dev_num)
10241025
retry--;
10251026
} while (retry);
10261027

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

10301032
return -ETIMEDOUT;
@@ -1095,7 +1097,7 @@ int sdw_bus_prep_clk_stop(struct sdw_bus *bus)
10951097
*/
10961098
if (!simple_clk_stop) {
10971099
ret = sdw_bus_wait_for_clk_prep_deprep(bus,
1098-
SDW_BROADCAST_DEV_NUM);
1100+
SDW_BROADCAST_DEV_NUM, true);
10991101
/*
11001102
* if there are no Slave devices present and the reply is
11011103
* Command_Ignored/-ENODATA, we don't need to continue with the
@@ -1215,7 +1217,7 @@ int sdw_bus_exit_clk_stop(struct sdw_bus *bus)
12151217
* state machine
12161218
*/
12171219
if (!simple_clk_stop) {
1218-
ret = sdw_bus_wait_for_clk_prep_deprep(bus, SDW_BROADCAST_DEV_NUM);
1220+
ret = sdw_bus_wait_for_clk_prep_deprep(bus, SDW_BROADCAST_DEV_NUM, false);
12191221
if (ret < 0)
12201222
dev_warn(bus->dev, "clock stop deprepare wait failed:%d\n", ret);
12211223
}

drivers/soundwire/dmi-quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
141141
{
142142
.matches = {
143143
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
144-
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-k0xxx"),
144+
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16"),
145145
},
146146
.driver_data = (void *)hp_omen_16,
147147
},

drivers/soundwire/qcom.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#define SWRM_INTERRUPT_STATUS_BUS_RESET_FINISHED_V2 BIT(13)
6161
#define SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 BIT(14)
6262
#define SWRM_INTERRUPT_STATUS_EXT_CLK_STOP_WAKEUP BIT(16)
63+
#define SWRM_INTERRUPT_STATUS_CMD_IGNORED_AND_EXEC_CONTINUED BIT(19)
6364
#define SWRM_INTERRUPT_MAX 17
6465
#define SWRM_V1_3_INTERRUPT_MASK_ADDR 0x204
6566
#define SWRM_V1_3_INTERRUPT_CLEAR 0x208
@@ -776,6 +777,17 @@ static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id)
776777
break;
777778
case SWRM_INTERRUPT_STATUS_EXT_CLK_STOP_WAKEUP:
778779
break;
780+
case SWRM_INTERRUPT_STATUS_CMD_IGNORED_AND_EXEC_CONTINUED:
781+
ctrl->reg_read(ctrl,
782+
ctrl->reg_layout[SWRM_REG_CMD_FIFO_STATUS],
783+
&value);
784+
dev_err(ctrl->dev,
785+
"%s: SWR CMD ignored, fifo status %x\n",
786+
__func__, value);
787+
788+
/* Wait 3.5ms to clear */
789+
usleep_range(3500, 3505);
790+
break;
779791
default:
780792
dev_err_ratelimited(ctrl->dev,
781793
"%s: SWR unknown interrupt value: %d\n",
@@ -801,8 +813,8 @@ static bool swrm_wait_for_frame_gen_enabled(struct qcom_swrm_ctrl *ctrl)
801813
int comp_sts;
802814

803815
do {
804-
ctrl->reg_read(ctrl, SWRM_COMP_STATUS, &comp_sts);
805-
816+
ctrl->reg_read(ctrl, ctrl->reg_layout[SWRM_REG_FRAME_GEN_ENABLED],
817+
&comp_sts);
806818
if (comp_sts & SWRM_FRM_GEN_ENABLED)
807819
return true;
808820

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

15511563
ctrl->hclk = devm_clk_get(dev, "iface");
15521564
if (IS_ERR(ctrl->hclk)) {
1553-
ret = PTR_ERR(ctrl->hclk);
1565+
ret = dev_err_probe(dev, PTR_ERR(ctrl->hclk), "unable to get iface clock\n");
15541566
goto err_init;
15551567
}
15561568

0 commit comments

Comments
 (0)