switch (status) {
case SDW_SLAVE_ATTACHED:
- cs35l56->sdw_in_clock_stop_1 = false;
if (cs35l56->sdw_attached)
break;
return 0;
}
-static int __maybe_unused cs35l56_sdw_clk_stop(struct sdw_slave *peripheral,
- enum sdw_clk_stop_mode mode,
- enum sdw_clk_stop_type type)
-{
- struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev);
-
- dev_dbg(cs35l56->base.dev, "%s: clock_stop_mode%d stage:%d\n", __func__, mode, type);
-
- switch (type) {
- case SDW_CLK_POST_PREPARE:
- if (mode == SDW_CLK_STOP_MODE1)
- cs35l56->sdw_in_clock_stop_1 = true;
- else
- cs35l56->sdw_in_clock_stop_1 = false;
- return 0;
- default:
- return 0;
- }
-}
-
static const struct sdw_slave_ops cs35l56_sdw_ops = {
.read_prop = cs35l56_sdw_read_prop,
.interrupt_callback = cs35l56_sdw_interrupt,
.update_status = cs35l56_sdw_update_status,
- .clk_stop = cs35l56_sdw_clk_stop,
};
static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *cs35l56)
struct sdw_slave *peripheral = cs35l56->sdw_peripheral;
int ret;
- dev_dbg(cs35l56->base.dev, "attached:%u unattach_request:%u in_clock_stop_1:%u\n",
- cs35l56->sdw_attached, peripheral->unattach_request, cs35l56->sdw_in_clock_stop_1);
+ dev_dbg(cs35l56->base.dev, "attached:%u unattach_request:%u\n",
+ cs35l56->sdw_attached, peripheral->unattach_request);
- if (cs35l56->sdw_in_clock_stop_1 || peripheral->unattach_request) {
- /* Cannot access registers until bus is re-initialized. */
- dev_dbg(cs35l56->base.dev, "Wait for initialization_complete\n");
- ret = sdw_slave_wait_for_init(peripheral, 5000);
- if (ret)
- return ret;
-
- cs35l56->sdw_in_clock_stop_1 = false;
+ /* Cannot access registers until bus is re-initialized. */
+ ret = sdw_slave_wait_for_init(peripheral, 5000);
+ if (ret)
+ return ret;
- /*
- * Don't call regcache_mark_dirty(), we can't be sure that the
- * Manager really did issue a Bus Reset.
- */
- }
+ /*
+ * Don't call regcache_mark_dirty(), we can't be sure that the
+ * Manager really did issue a Bus Reset.
+ */
return 0;
}