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

Commit 026bc864 authored by Chris Lew's avatar Chris Lew
Browse files

net: qrtr: haven: Read peer name from device tree



Add support for the primary vm to read the vm peer name from device
tree. This information is needed to share memory to the peer vm.

Change-Id: Ied71d254975e08dcf6c1c51f49687aceced141a9
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 394a2675
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ struct haven_pipe {
 * @base: Base of the shared fifo.
 * @size: fifo size.
 * @master: primary vm indicator.
 * @peer_name: name of vm peer.
 * @label: label for haven resources
 * @tx_dbl: doorbell for tx notifications.
 * @rx_dbl: doorbell for rx notifications.
@@ -54,6 +55,7 @@ struct qrtr_haven_dev {
	void *base;
	size_t size;
	bool master;
	u32 peer_name;

	u32 label;
	void *tx_dbl;
@@ -336,12 +338,19 @@ static int qrtr_haven_probe(struct platform_device *pdev)
		return ret;
	}
	qdev->master = of_property_read_bool(node, "qcom,master");

	ret = qrtr_haven_map_memory(qdev);
	if (ret)
		return ret;

	qrtr_haven_fifo_init(qdev);

	if (qdev->master) {
		ret = of_property_read_u32(node, "peer-name", &qdev->peer_name);
		if (ret)
			qdev->peer_name = HH_SELF_VM;
	}

	dbl_label = qdev->label;
	qdev->tx_dbl = hh_dbl_tx_register(dbl_label);
	if (IS_ERR_OR_NULL(qdev->tx_dbl)) {