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

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

Merge "slim-msm: Synchronize SSR callbacks"

parents 608c991c 97442af0
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -711,7 +711,6 @@ static int ngd_bulk_wr(struct slim_controller *ctrl, u8 la, u8 mt, u8 mc,
	struct msm_slim_ctrl *dev = slim_get_ctrldata(ctrl);
	int i, ret;
	struct msm_slim_endp *endpoint = &dev->tx_msgq;
	struct sps_pipe *pipe = endpoint->sps;
	u32 *header;
	DECLARE_COMPLETION_ONSTACK(done);

@@ -808,8 +807,8 @@ static int ngd_bulk_wr(struct slim_controller *ctrl, u8 la, u8 mt, u8 mc,
		goto retpath;
	}

	ret = sps_transfer_one(pipe, dev->bulk.wr_dma, dev->bulk.size, NULL,
				SPS_IOVEC_FLAG_EOT);
	ret = sps_transfer_one(endpoint->sps, dev->bulk.wr_dma, dev->bulk.size,
						NULL, SPS_IOVEC_FLAG_EOT);
	if (ret) {
		SLIM_WARN(dev, "sps transfer one returned error:%d", ret);
		goto retpath;
@@ -1471,11 +1470,13 @@ static void ngd_adsp_down(struct msm_slim_ctrl *dev)
	struct slim_controller *ctrl = &dev->ctrl;
	struct slim_device *sbdev;

	mutex_lock(&dev->ssr_lock);
	ngd_slim_enable(dev, false);
	/* device up should be called again after SSR */
	list_for_each_entry(sbdev, &ctrl->devs, dev_list)
		slim_report_absent(sbdev);
	SLIM_INFO(dev, "SLIM ADSP SSR (DOWN) done\n");
	mutex_unlock(&dev->ssr_lock);
}

static void ngd_adsp_up(struct work_struct *work)
@@ -1484,7 +1485,9 @@ static void ngd_adsp_up(struct work_struct *work)
		container_of(work, struct msm_slim_qmi, ssr_up);
	struct msm_slim_ctrl *dev =
		container_of(qmi, struct msm_slim_ctrl, qmi);
	mutex_lock(&dev->ssr_lock);
	ngd_slim_enable(dev, true);
	mutex_unlock(&dev->ssr_lock);
}

static ssize_t show_mask(struct device *device, struct device_attribute *attr,
@@ -1648,6 +1651,7 @@ static int ngd_slim_probe(struct platform_device *pdev)
	init_completion(&dev->reconf);
	init_completion(&dev->ctrl_up);
	mutex_init(&dev->tx_lock);
	mutex_init(&dev->ssr_lock);
	spin_lock_init(&dev->tx_buf_lock);
	spin_lock_init(&dev->rx_lock);
	dev->ee = 1;
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -284,6 +284,7 @@ struct msm_slim_ctrl {
	struct clk		*rclk;
	struct clk		*hclk;
	struct mutex		tx_lock;
	struct mutex		ssr_lock;
	spinlock_t		tx_buf_lock;
	u8			pgdla;
	enum msm_slim_msgq	use_rx_msgqs;