Skip to content

Commit

Permalink
[Not for upstream] SoundWire: add lane kernel parameter
Browse files Browse the repository at this point in the history
We can use the parameters to specify data lane.
And we can know which lane is used by the debug trace.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
  • Loading branch information
bardliao authored and plbossart committed Jun 6, 2024
1 parent 028debc commit ca0a005
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/soundwire/generic_bandwidth_allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt,
list_for_each_entry(p_rt, &s_rt->port_list, port_node) {
ch = hweight32(p_rt->ch_mask);

dev_dbg(&s_rt->slave->dev, "%s p_rt->lane %d\n", __func__, p_rt->lane);
sdw_fill_xport_params(&p_rt->transport_params,
p_rt->num, false,
SDW_BLK_GRP_CNT_1,
Expand Down Expand Up @@ -106,6 +107,7 @@ static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt,

list_for_each_entry(p_rt, &m_rt->port_list, port_node) {

dev_dbg(bus->dev, "%s p_rt->lane %d\n", __func__, p_rt->lane);
sdw_fill_xport_params(&p_rt->transport_params, p_rt->num,
false, SDW_BLK_GRP_CNT_1, sample_int,
*port_bo, (*port_bo) >> 8, hstart, hstop,
Expand Down
10 changes: 10 additions & 0 deletions drivers/soundwire/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
#include <sound/soc.h>
#include "bus.h"

static int m_lane;
module_param(m_lane, int, 0444);
MODULE_PARM_DESC(m_lane, "Manager lane");

static int p_lane;
module_param(p_lane, int, 0444);
MODULE_PARM_DESC(p_lane, "Peripheral lane");

/*
* Array of supported rows and columns as per MIPI SoundWire Specification 1.1
*
Expand Down Expand Up @@ -990,6 +998,7 @@ static int sdw_slave_port_config(struct sdw_slave *slave,
ret = sdw_port_config(p_rt, port_config, i);
if (ret < 0)
return ret;
p_rt->lane = p_lane;
i++;
}

Expand Down Expand Up @@ -1038,6 +1047,7 @@ static int sdw_master_port_config(struct sdw_master_runtime *m_rt,
ret = sdw_port_config(p_rt, port_config, i);
if (ret < 0)
return ret;
p_rt->lane = m_lane;
i++;
}

Expand Down

0 comments on commit ca0a005

Please sign in to comment.