mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <vkoul@kernel.org>
Cc: <broonie@kernel.org>, <yung-chuan.liao@linux.intel.com>,
	<pierre-louis.bossart@linux.dev>, <Basavaraj.Hiregoudar@amd.com>,
	<Sunil-kumar.Dommati@amd.com>, <venkataprasad.potturu@amd.com>,
	<Syed.SabaKareem@amd.com>, <Mario.Limonciello@amd.com>,
	<Poojitha.N@amd.com>, <sravisar@amd.com>, <Richard.Gong@amd.com>,
	<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Subject: [PATCH 09/11] soundwire: generic_bandwidth_allocation: export bandwidth helper functions
Date: Sun, 8 Nov 2026 03:38:04 +0530	[thread overview]
Message-ID: <20261107220913.4058072-10-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20261107220913.4058072-1-Vijendar.Mukunda@amd.com>

Export sdw_compute_dp0_port_params(), sdw_compute_port_params(),
sdw_select_row_col(), is_clock_scaling_supported() and
get_manager_lane() so that out-of-tree or modular SoundWire manager
drivers can call them directly. Remove the static qualifier from each
function and add the corresponding EXPORT_SYMBOL() and prototype in
bus.h.

Signed-off-by: Poojitha N <Poojitha.N@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 drivers/soundwire/bus.h                         |  6 ++++++
 .../soundwire/generic_bandwidth_allocation.c    | 17 +++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h
index 44e4f5193917..0c5c343b2c1c 100644
--- a/drivers/soundwire/bus.h
+++ b/drivers/soundwire/bus.h
@@ -241,5 +241,11 @@ void sdw_clear_slave_status(struct sdw_bus *bus, u32 request);
 int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
 void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
 			     struct sdw_transport_data *t_data);
+void sdw_compute_dp0_port_params(struct sdw_bus *bus);
+int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtime *stream);
+int sdw_select_row_col(struct sdw_bus *bus, int clk_freq);
+bool is_clock_scaling_supported(struct sdw_bus *bus);
+int get_manager_lane(struct sdw_bus *bus, struct sdw_master_runtime *m_rt,
+		     struct sdw_slave_runtime *s_rt, unsigned int curr_dr_freq);
 
 #endif /* __SDW_BUS_H */
diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
index 1dd3b2e5420c..cf2d2275b6aa 100644
--- a/drivers/soundwire/generic_bandwidth_allocation.c
+++ b/drivers/soundwire/generic_bandwidth_allocation.c
@@ -124,7 +124,7 @@ static void sdw_compute_dp0_master_ports(struct sdw_master_runtime *m_rt)
 	}
 }
 
-static void sdw_compute_dp0_port_params(struct sdw_bus *bus)
+void sdw_compute_dp0_port_params(struct sdw_bus *bus)
 {
 	struct sdw_master_runtime *m_rt;
 
@@ -136,6 +136,7 @@ static void sdw_compute_dp0_port_params(struct sdw_bus *bus)
 		sdw_compute_dp0_slave_ports(m_rt);
 	}
 }
+EXPORT_SYMBOL(sdw_compute_dp0_port_params);
 
 static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,
 				     struct sdw_group_params *params,
@@ -397,7 +398,7 @@ static int sdw_get_group_count(struct sdw_bus *bus,
  * @bus: SDW Bus instance
  * @stream: Soundwire stream
  */
-static int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtime *stream)
+int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtime *stream)
 {
 	struct sdw_group_params *params = NULL;
 	struct sdw_group group;
@@ -431,8 +432,9 @@ static int sdw_compute_port_params(struct sdw_bus *bus, struct sdw_stream_runtim
 
 	return ret;
 }
+EXPORT_SYMBOL(sdw_compute_port_params);
 
-static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
+int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
 {
 	struct sdw_master_prop *prop = &bus->prop;
 	int r, c;
@@ -455,8 +457,9 @@ static int sdw_select_row_col(struct sdw_bus *bus, int clk_freq)
 
 	return -EINVAL;
 }
+EXPORT_SYMBOL(sdw_select_row_col);
 
-static bool is_clock_scaling_supported(struct sdw_bus *bus)
+bool is_clock_scaling_supported(struct sdw_bus *bus)
 {
 	struct sdw_master_runtime *m_rt;
 	struct sdw_slave_runtime *s_rt;
@@ -468,6 +471,7 @@ static bool is_clock_scaling_supported(struct sdw_bus *bus)
 
 	return true;
 }
+EXPORT_SYMBOL(is_clock_scaling_supported);
 
 /**
  * is_lane_connected_to_all_peripherals: Check if the given manager lane connects to all peripherals
@@ -500,8 +504,8 @@ static bool is_lane_connected_to_all_peripherals(struct sdw_master_runtime *m_rt
 	return true;
 }
 
-static int get_manager_lane(struct sdw_bus *bus, struct sdw_master_runtime *m_rt,
-			    struct sdw_slave_runtime *s_rt, unsigned int curr_dr_freq)
+int get_manager_lane(struct sdw_bus *bus, struct sdw_master_runtime *m_rt,
+		     struct sdw_slave_runtime *s_rt, unsigned int curr_dr_freq)
 {
 	struct sdw_slave_prop *slave_prop = &s_rt->slave->prop;
 	struct sdw_port_runtime *m_p_rt;
@@ -544,6 +548,7 @@ static int get_manager_lane(struct sdw_bus *bus, struct sdw_master_runtime *m_rt
 	/* No available multi lane found, only lane 0 can be used */
 	return 0;
 }
+EXPORT_SYMBOL(get_manager_lane);
 
 /**
  * sdw_compute_bus_params: Compute bus parameters
-- 
2.53.0


  parent reply	other threads:[~2026-11-07 22:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 22:07 [PATCH 00/11] soundwire: amd: add ACP7B/7E/7F SoundWire manager support Vijendar Mukunda
2026-11-07 22:07 ` [PATCH 01/11] soundwire: amd: add ACP7B/7E/7F register definitions and revision IDs Vijendar Mukunda
2026-11-07 22:07 ` [PATCH 02/11] soundwire: amd: add ACP7B/7E/7F hardware backend Vijendar Mukunda
2026-11-07 22:07 ` [PATCH 03/11] soundwire: amd: extend ctl_word_prep to set SSP_TAG for ACP7B/7E/7F Vijendar Mukunda
2026-11-07 22:07 ` [PATCH 04/11] soundwire: amd: add ACP7B/7E/7F DAI PCM capabilities in register_dais() Vijendar Mukunda
2026-11-07 22:08 ` [PATCH 05/11] soundwire: amd: enable host wake support for ACP7B/7E/7F Vijendar Mukunda
2026-11-07 22:08 ` [PATCH 06/11] soundwire: amd: add ACP7B/7E/7F clock-stop support Vijendar Mukunda
2026-11-07 22:08 ` [PATCH 07/11] soundwire: amd: add IO pad enable/disable for ACP7B/7E/7F D0/D3 sequence Vijendar Mukunda
2026-11-07 22:08 ` [PATCH 08/11] soundwire: generic_bandwidth_allocation: fix hwidth for skipped block offset Vijendar Mukunda
2026-11-07 22:08 ` Vijendar Mukunda [this message]
2026-11-07 22:08 ` [PATCH 10/11] soundwire: amd: add ACP7x generic bandwidth allocation support Vijendar Mukunda
2026-11-07 22:08 ` [PATCH 11/11] soundwire: amd: add interrupt_enabled synchronization for ACP7B/7E/7F Vijendar Mukunda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261107220913.4058072-10-Vijendar.Mukunda@amd.com \
    --to=vijendar.mukunda@amd.com \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Poojitha.N@amd.com \
    --cc=Richard.Gong@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=Syed.SabaKareem@amd.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=sravisar@amd.com \
    --cc=venkataprasad.potturu@amd.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®