mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
soundwire: Intel: add wake_enable parameter to stop_bus ops
Currently, we assume the bus is wakeable when the bus clock stops. But in some case like system suspend, we want to stop the bus but keep the bus unwakeable. No function change in this commit. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20260901030311.232823-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
267665f8a3
commit
8c1e69e322
|
|
@ -188,10 +188,10 @@ static inline int sdw_intel_start_bus_after_clock_stop(struct sdw_intel *sdw)
|
|||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
static inline int sdw_intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
|
||||
static inline int sdw_intel_stop_bus(struct sdw_intel *sdw, bool clock_stop, bool wake_enable)
|
||||
{
|
||||
if (SDW_INTEL_CHECK_OPS(sdw, stop_bus))
|
||||
return SDW_INTEL_OPS(sdw, stop_bus)(sdw, clock_stop);
|
||||
return SDW_INTEL_OPS(sdw, stop_bus)(sdw, clock_stop, wake_enable);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ int intel_start_bus(struct sdw_intel *sdw);
|
|||
int intel_start_bus_after_reset(struct sdw_intel *sdw);
|
||||
void intel_check_clock_stop(struct sdw_intel *sdw);
|
||||
int intel_start_bus_after_clock_stop(struct sdw_intel *sdw);
|
||||
int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop);
|
||||
int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop, bool wake_enable);
|
||||
|
||||
/* common bank switch routines */
|
||||
int intel_pre_bank_switch(struct sdw_intel *sdw);
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ static int __maybe_unused intel_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
ret = sdw_intel_stop_bus(sdw, false);
|
||||
ret = sdw_intel_stop_bus(sdw, false, false);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "%s: cannot stop bus: %d\n", __func__, ret);
|
||||
return ret;
|
||||
|
|
@ -698,14 +698,14 @@ static int __maybe_unused intel_suspend_runtime(struct device *dev)
|
|||
clock_stop_quirks = sdw->link_res->clock_stop_quirks;
|
||||
|
||||
if (clock_stop_quirks & SDW_INTEL_CLK_STOP_TEARDOWN) {
|
||||
ret = sdw_intel_stop_bus(sdw, false);
|
||||
ret = sdw_intel_stop_bus(sdw, false, false);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "%s: cannot stop bus during teardown: %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
} else if (clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET || !clock_stop_quirks) {
|
||||
ret = sdw_intel_stop_bus(sdw, true);
|
||||
ret = sdw_intel_stop_bus(sdw, true, true);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "%s: cannot stop bus during clock_stop: %d\n",
|
||||
__func__, ret);
|
||||
|
|
|
|||
|
|
@ -202,11 +202,11 @@ int intel_start_bus_after_clock_stop(struct sdw_intel *sdw)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
|
||||
int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop, bool wake_enable)
|
||||
{
|
||||
struct device *dev = sdw->cdns.dev;
|
||||
struct sdw_cdns *cdns = &sdw->cdns;
|
||||
bool wake_enable = false;
|
||||
bool en = false;
|
||||
int ret;
|
||||
|
||||
cancel_delayed_work_sync(&cdns->attach_dwork);
|
||||
|
|
@ -216,7 +216,7 @@ int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
|
|||
if (ret < 0)
|
||||
dev_err(dev, "%s: cannot stop clock: %d\n", __func__, ret);
|
||||
else
|
||||
wake_enable = true;
|
||||
en = wake_enable;
|
||||
}
|
||||
|
||||
ret = sdw_cdns_enable_interrupt(cdns, false);
|
||||
|
|
@ -231,7 +231,7 @@ int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
|
|||
return ret;
|
||||
}
|
||||
|
||||
sdw_intel_shim_wake(sdw, wake_enable);
|
||||
sdw_intel_shim_wake(sdw, en);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ struct sdw_intel_hw_ops {
|
|||
int (*start_bus)(struct sdw_intel *sdw);
|
||||
int (*start_bus_after_reset)(struct sdw_intel *sdw);
|
||||
int (*start_bus_after_clock_stop)(struct sdw_intel *sdw);
|
||||
int (*stop_bus)(struct sdw_intel *sdw, bool clock_stop);
|
||||
int (*stop_bus)(struct sdw_intel *sdw, bool clock_stop, bool wake_enable);
|
||||
|
||||
int (*link_power_up)(struct sdw_intel *sdw);
|
||||
int (*link_power_down)(struct sdw_intel *sdw);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user