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

Commit a4962dc5 authored by Vignesh Kulothungan's avatar Vignesh Kulothungan Committed by Gerrit - the friendly Code Review server
Browse files

soundwire: add support to disable dynamic port map



Add support to disable dynamic port map via device tree
property.
Do not update master clock when dynamic port map
is disabled for a sound wire master.

Change-Id: I9f9344866faa4d1c342787e014102d9182ed56ae
Signed-off-by: default avatarVignesh Kulothungan <vigneshk@codeaurora.org>
parent 70561ef6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/regmap.h>
#include "audio_mod_devicetable.h"

#define SWR_CLK_RATE_0P3MHZ       300000
#define SWR_CLK_RATE_0P6MHZ       600000
#define SWR_CLK_RATE_1P2MHZ      1200000
#define SWR_CLK_RATE_2P4MHZ      2400000
+14 −2
Original line number Diff line number Diff line
@@ -1567,6 +1567,7 @@ static int swrm_connect_port(struct swr_master *master,
		mport->req_ch |= mstr_ch_msk;
		master->port_en_mask |= (1 << mstr_port_id);
		if (swrm->clk_stop_mode0_supp &&
				swrm->dynamic_port_map_supported &&
				(mport->ch_rate < portinfo->ch_rate[i])) {
			mport->ch_rate = portinfo->ch_rate[i];
			swrm_update_bus_clk(swrm);
@@ -1633,7 +1634,9 @@ static int swrm_disconnect_port(struct swr_master *master,
		}
		port_req->req_ch &= ~portinfo->ch_en[i];
		mport->req_ch &= ~mstr_ch_mask;
		if (swrm->clk_stop_mode0_supp && !mport->req_ch) {
		if (swrm->clk_stop_mode0_supp &&
				swrm->dynamic_port_map_supported &&
				!mport->req_ch) {
			mport->ch_rate = 0;
			swrm_update_bus_clk(swrm);
		}
@@ -2326,6 +2329,15 @@ static int swrm_probe(struct platform_device *pdev)
		dev_err(&pdev->dev, "%s: failed to get master id\n", __func__);
		goto err_pdata_fail;
	}
	ret = of_property_read_u32(pdev->dev.of_node, "qcom,dynamic-port-map-supported",
				&swrm->dynamic_port_map_supported);
	if (ret) {
		dev_dbg(&pdev->dev,
			"%s: failed to get dynamic port map support, use default\n",
			__func__);
		swrm->dynamic_port_map_supported = 1;
	}

	if (!(of_property_read_u32(pdev->dev.of_node,
			"swrm-io-base", &swrm->swrm_base_reg)))
		ret = of_property_read_u32(pdev->dev.of_node,
+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ struct swr_mstr_ctrl {
	u8 rcmd_id;
	u8 wcmd_id;
	u32 master_id;
	u32 dynamic_port_map_supported;
	void *handle; /* SWR Master handle from client for read and writes */
	int (*read)(void *handle, int reg);
	int (*write)(void *handle, int reg, int val);