copier: Remove DAI device drv trigger

Use dai_zephyr_trigger() instead. Remove the state modification in
dai_zephyr_trigger() and handle it in the copier_comp_trigger().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
Ranjani Sridharan 2023-05-15 10:59:31 -07:00 committed by Ranjani Sridharan
parent 5f4be32822
commit 6ffb052691
2 changed files with 13 additions and 20 deletions

View File

@ -1130,18 +1130,12 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd)
comp_dbg(dev, "copier_comp_trigger()");
/*
* do not modify the comp state in case of single endpoint DAI, it will be done in
* dai_zephyr_trigger()
*/
if (!(dev->ipc_config.type == SOF_COMP_DAI && cd->endpoint_num == 1)) {
ret = comp_set_state(dev, cmd);
if (ret < 0)
return ret;
ret = comp_set_state(dev, cmd);
if (ret < 0)
return ret;
if (ret == COMP_STATUS_STATE_ALREADY_SET)
return PPL_STATUS_PATH_STOP;
}
if (ret == COMP_STATUS_STATE_ALREADY_SET)
return PPL_STATUS_PATH_STOP;
switch (dev->ipc_config.type) {
case SOF_COMP_HOST:
@ -1158,7 +1152,13 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd)
return ret;
} else {
for (i = 0; i < cd->endpoint_num; i++) {
ret = cd->endpoint[i]->drv->ops.trigger(cd->endpoint[i], cmd);
ret = comp_set_state(cd->endpoint[i], cmd);
if (ret < 0)
return ret;
if (ret == COMP_STATUS_STATE_ALREADY_SET)
return PPL_STATUS_PATH_STOP;
ret = dai_zephyr_trigger(cd->dd[i], cd->endpoint[i], cmd);
if (ret < 0)
return ret;
}

View File

@ -1152,17 +1152,10 @@ static int dai_reset(struct comp_dev *dev)
/* used to pass standard and bespoke command (with data) to component */
static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, int cmd)
{
int ret;
int ret = 0;
comp_dbg(dev, "dai_comp_trigger_internal(), command = %u", cmd);
ret = comp_set_state(dev, cmd);
if (ret < 0)
return ret;
if (ret == COMP_STATUS_STATE_ALREADY_SET)
return PPL_STATUS_PATH_STOP;
switch (cmd) {
case COMP_TRIGGER_START:
comp_dbg(dev, "dai_comp_trigger_internal(), START");