Merge tag 'acpi-6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[linux-block.git] / drivers / soundwire / generic_bandwidth_allocation.c
index f7c66083a4dd5e9e2f4a3f896bb4d0f5e9be1bc0..325c475b6a66dd2e950b77712a7dbeb4f9535076 100644 (file)
@@ -6,6 +6,7 @@
  *
  */
 
+#include <linux/bitops.h>
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/mod_devicetable.h>
@@ -28,15 +29,8 @@ struct sdw_group {
        unsigned int *rates;
 };
 
-struct sdw_transport_data {
-       int hstart;
-       int hstop;
-       int block_offset;
-       int sub_block_offset;
-};
-
-static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
-                                   struct sdw_transport_data *t_data)
+void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
+                            struct sdw_transport_data *t_data)
 {
        struct sdw_slave_runtime *s_rt = NULL;
        struct sdw_port_runtime *p_rt;
@@ -54,7 +48,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
                slave_total_ch = 0;
 
                list_for_each_entry(p_rt, &s_rt->port_list, port_node) {
-                       ch = sdw_ch_mask_to_ch(p_rt->ch_mask);
+                       ch = hweight32(p_rt->ch_mask);
 
                        sdw_fill_xport_params(&p_rt->transport_params,
                                              p_rt->num, false,
@@ -85,6 +79,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
                }
        }
 }
+EXPORT_SYMBOL(sdw_compute_slave_ports);
 
 static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,
                                     struct sdw_group_params *params,