Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b112aeeb authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: swr-mstr: Ignore redundant slave path control command"

parents 1e509a5e cab8d72a
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
@@ -58,6 +59,11 @@ enum {
	MASTER_ID_RX,
	MASTER_ID_TX
};

enum {
	ENABLE_PENDING,
	DISABLE_PENDING
};
#define TRUE 1
#define FALSE 0

@@ -958,18 +964,28 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable)
	bank = get_inactive_bank_num(swrm);

	if (enable) {
		if (!test_bit(ENABLE_PENDING, &swrm->port_req_pending)) {
			dev_dbg(swrm->dev, "%s:No pending connect port req\n",
				__func__);
			goto exit;
		}
		clear_bit(ENABLE_PENDING, &swrm->port_req_pending);
		ret = swrm_get_port_config(swrm);
		if (ret) {
			/* cannot accommodate ports */
			swrm_cleanup_disabled_port_reqs(master);
			pm_runtime_mark_last_busy(swrm->dev);
			pm_runtime_put_autosuspend(swrm->dev);
			mutex_unlock(&swrm->mlock);
			return -EINVAL;
		}
		/* apply the new port config*/
		swrm_apply_port_config(master);
	} else {
		if (!test_bit(DISABLE_PENDING, &swrm->port_req_pending)) {
			dev_dbg(swrm->dev, "%s:No pending disconn port req\n",
				__func__);
			goto exit;
		}
		clear_bit(DISABLE_PENDING, &swrm->port_req_pending);
		swrm_disable_ports(master, bank);
	}
	dev_dbg(swrm->dev, "%s: enable: %d, cfg_devs: %d\n",
@@ -1022,6 +1038,7 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable)
		pm_runtime_mark_last_busy(swrm->dev);
		pm_runtime_put_autosuspend(swrm->dev);
	}
exit:
	mutex_unlock(&swrm->mlock);
return 0;
}
@@ -1098,6 +1115,7 @@ static int swrm_connect_port(struct swr_master *master,
		master->port_en_mask |= (1 << mstr_port_id);
	}
	master->num_port += portinfo->num_port;
	set_bit(ENABLE_PENDING, &swrm->port_req_pending);
	swr_port_response(master, portinfo->tid);

	mutex_unlock(&swrm->mlock);
@@ -1158,6 +1176,7 @@ static int swrm_disconnect_port(struct swr_master *master,
		mport->req_ch &= ~mstr_ch_mask;
	}
	master->num_port -= portinfo->num_port;
	set_bit(DISABLE_PENDING, &swrm->port_req_pending);
	swr_port_response(master, portinfo->tid);
	mutex_unlock(&swrm->mlock);

+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ struct swr_mstr_ctrl {
	int slave_status;
	struct swrm_mports mport_cfg[SWR_MAX_MSTR_PORT_NUM];
	struct list_head port_req_list;
	unsigned long port_req_pending;
	int state;
	struct platform_device *pdev;
	int num_rx_chs;