Skip to content

Commit 010e781

Browse files
committed
soundwire: add bpt_hstop in struct sdw_bus
To allow BPT and audio stream work simultaneously, we need to record the hstop of the BPT stream. And use column bpt_hstop + 1 to the last column for audio streams. No function changed since bus->bpt_hstop is set to bus->params.col - 1 for now. Will update bus->audio_stream_hstart in the follow up commit. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 6255a29 commit 010e781

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

drivers/soundwire/generic_bandwidth_allocation.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ static void sdw_compute_dp0_slave_ports(struct sdw_master_runtime *m_rt)
9797
list_for_each_entry(p_rt, &s_rt->port_list, port_node) {
9898
sdw_fill_xport_params(&p_rt->transport_params, p_rt->num, false,
9999
SDW_BLK_GRP_CNT_1, bus->params.col, 0, 0, 1,
100-
bus->params.col - 1, SDW_BLK_PKG_PER_PORT, 0x0);
100+
bus->bpt_hstop, SDW_BLK_PKG_PER_PORT, 0x0);
101101

102-
sdw_fill_port_params(&p_rt->port_params, p_rt->num, bus->params.col - 1,
102+
sdw_fill_port_params(&p_rt->port_params, p_rt->num, bus->bpt_hstop,
103103
SDW_PORT_FLOW_MODE_ISOCH, SDW_PORT_DATA_MODE_NORMAL);
104104
}
105105
}
@@ -113,9 +113,9 @@ static void sdw_compute_dp0_master_ports(struct sdw_master_runtime *m_rt)
113113
list_for_each_entry(p_rt, &m_rt->port_list, port_node) {
114114
sdw_fill_xport_params(&p_rt->transport_params, p_rt->num, false,
115115
SDW_BLK_GRP_CNT_1, bus->params.col, 0, 0, 1,
116-
bus->params.col - 1, SDW_BLK_PKG_PER_PORT, 0x0);
116+
bus->bpt_hstop, SDW_BLK_PKG_PER_PORT, 0x0);
117117

118-
sdw_fill_port_params(&p_rt->port_params, p_rt->num, bus->params.col - 1,
118+
sdw_fill_port_params(&p_rt->port_params, p_rt->num, bus->bpt_hstop,
119119
SDW_PORT_FLOW_MODE_ISOCH, SDW_PORT_DATA_MODE_NORMAL);
120120
}
121121
}
@@ -700,6 +700,7 @@ int sdw_compute_params(struct sdw_bus *bus, struct sdw_stream_runtime *stream)
700700
if (ret < 0)
701701
return ret;
702702

703+
bus->bpt_hstop = bus->params.col - 1;
703704
if (stream->type == SDW_STREAM_BPT) {
704705
sdw_compute_dp0_port_params(bus);
705706
return 0;

drivers/soundwire/intel_ace2x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static int intel_ace2x_bpt_open_stream(struct sdw_intel *sdw, struct sdw_slave *
159159
command = (msg->flags & SDW_MSG_FLAG_WRITE) ? 0 : 1;
160160

161161
ret = sdw_cdns_bpt_find_bandwidth(command, cdns->bus.params.row,
162-
cdns->bus.params.col,
162+
cdns->bus.bpt_hstop + 1,
163163
prop->default_frame_rate,
164164
&tx_dma_bandwidth, &rx_dma_bandwidth);
165165
if (ret < 0)
@@ -185,7 +185,7 @@ static int intel_ace2x_bpt_open_stream(struct sdw_intel *sdw, struct sdw_slave *
185185
/* Add up pdi buffer size and frame numbers of each BPT sections */
186186
for (i = 0; i < msg->sections; i++) {
187187
ret = sdw_cdns_bpt_find_buffer_sizes(command, cdns->bus.params.row,
188-
cdns->bus.params.col,
188+
cdns->bus.bpt_hstop + 1,
189189
msg->sec[i].len, max_data_per_frame,
190190
slave->prop.bra_block_alignment,
191191
&data_per_frame, &pdi0_buffer_size_,
@@ -210,7 +210,7 @@ static int intel_ace2x_bpt_open_stream(struct sdw_intel *sdw, struct sdw_slave *
210210
if (command) { /* read */
211211
/* Get buffer size of a full frame */
212212
ret = sdw_cdns_bpt_find_buffer_sizes(command, cdns->bus.params.row,
213-
cdns->bus.params.col,
213+
cdns->bus.bpt_hstop + 1,
214214
data_per_frame, max_data_per_frame,
215215
slave->prop.bra_block_alignment,
216216
&data_per_frame, &pdi0_buf_size_pre_frame,

include/linux/soundwire/sdw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ struct sdw_stream_runtime {
10031003
* @stream_refcount: number of streams currently using this bus
10041004
* @bpt_stream_refcount: number of BTP streams currently using this bus (should
10051005
* be zero or one, multiple streams per link is not supported).
1006+
* @bpt_hstop: The hstop of the BPT stream.
10061007
* @bpt_stream: pointer stored to handle BTP streams.
10071008
* @ops: Master callback ops
10081009
* @port_ops: Master port callback ops
@@ -1043,6 +1044,7 @@ struct sdw_bus {
10431044
struct sdw_bus_params params;
10441045
int stream_refcount;
10451046
int bpt_stream_refcount;
1047+
int bpt_hstop;
10461048
struct sdw_stream_runtime *bpt_stream;
10471049
const struct sdw_master_ops *ops;
10481050
const struct sdw_master_port_ops *port_ops;

0 commit comments

Comments
 (0)