Skip to content

Commit 7efcda4

Browse files
committed
soundwire: add bpt_hstop in struct sdw_bus_params
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->params.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 621993e commit 7efcda4

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->params.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->params.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->params.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->params.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->params.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.params.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.params.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.params.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
@@ -590,6 +590,7 @@ enum sdw_port_prep_ops {
590590
* @curr_dr_freq: Current double rate clock frequency, in Hz
591591
* @bandwidth: Current bandwidth
592592
* @lane_used_bandwidth: how much bandwidth in bits per second is used by each lane
593+
* @bpt_hstop: The hstop of the BPT stream
593594
* @col: Active columns
594595
* @row: Active rows
595596
* @s_data_mode: NORMAL, STATIC or PRBS mode for all Slave ports
@@ -604,6 +605,7 @@ struct sdw_bus_params {
604605
unsigned int curr_dr_freq;
605606
unsigned int bandwidth;
606607
unsigned int lane_used_bandwidth[SDW_MAX_LANES];
608+
int bpt_hstop;
607609
unsigned int col;
608610
unsigned int row;
609611
int s_data_mode;

0 commit comments

Comments
 (0)