History

soundwire: rename/clarify MIPI DisCo properties

The existing definitions are ambiguous and possibly misleading. For DP0, 'flow-control' is only relevant for the BRA protocol and should not be confused with async modes explicitly not supported for DP0, add prefix to follow MIPI DisCo definition The use of 'device_interrupts' is also questionable. The MIPI SoundWire spec defines Slave-, DP0- and DPN-level implementation-defined interrupts. Using the 'device' prefix in the last two cases is misleading, not only is the term 'device' overloaded but these properties are only valid at the DP0 and DPn levels. Rename to follow the MIPI definitions, no need to be creative here.

Pierre-Louis Bossart committed 7 years ago

Commit 8acbbfe1 parent f6686a74 files · +14 −13Browse files

Unified · Split

4 files
  1. drivers/soundwire/bus.c +1 −1
  2. drivers/soundwire/mipi_disco.c +3 −3
  3. drivers/soundwire/stream.c +3 −3
  4. include/linux/soundwire/sdw.h +7 −6
drivers/soundwire/bus.c+1−1
@@ -648,7 +648,7 @@ static int sdw_initialize_slave(struct sdw_slave *slave) · 647 unmodified lines
648648 return 0;
649649
650650 /* Enable DP0 interrupts */
651− val = prop->dp0_prop->device_interrupts;
651+ val = prop->dp0_prop->imp_def_interrupts;
652652 val |= SDW_DP0_INT_PORT_READY | SDW_DP0_INT_BRA_FAILURE;
653653
654654 ret = sdw_update(slave, SDW_DP0_INTMASK, val, val);
drivers/soundwire/mipi_disco.c+3−3
@@ -150,13 +150,13 @@ static int sdw_slave_read_dp0(struct sdw_slave *slave, · 149 unmodified lines
150150 dp0->words, dp0->num_words);
151151 }
152152
153− dp0->flow_controlled = fwnode_property_read_bool(port,
153+ dp0->BRA_flow_controlled = fwnode_property_read_bool(port,
154154 "mipi-sdw-bra-flow-controlled");
155155
156156 dp0->simple_ch_prep_sm = fwnode_property_read_bool(port,
157157 "mipi-sdw-simplified-channel-prepare-sm");
158158
159− dp0->device_interrupts = fwnode_property_read_bool(port,
159+ dp0->imp_def_interrupts = fwnode_property_read_bool(port,
160160 "mipi-sdw-imp-def-dp0-interrupts-supported");
161161
162162 return 0;
@@ -225,7 +225,7 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, · 62 unmodified lines
225225
226226 fwnode_property_read_u32(node,
227227 "mipi-sdw-imp-def-dpn-interrupts-supported",
228− &dpn[i].device_interrupts);
228+ &dpn[i].imp_def_interrupts);
229229
230230 fwnode_property_read_u32(node, "mipi-sdw-min-channel-number",
231231 &dpn[i].min_ch);
drivers/soundwire/stream.c+3−3
@@ -439,7 +439,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, · 438 unmodified lines
439439
440440 prep_ch.bank = bus->params.next_bank;
441441
442− if (dpn_prop->device_interrupts || !dpn_prop->simple_ch_prep_sm)
442+ if (dpn_prop->imp_def_interrupts || !dpn_prop->simple_ch_prep_sm)
443443 intr = true;
444444
445445 /*
@@ -449,7 +449,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, · 3 unmodified lines
449449 */
450450 if (prep && intr) {
451451 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep,
452− dpn_prop->device_interrupts);
452+ dpn_prop->imp_def_interrupts);
453453 if (ret < 0)
454454 return ret;
455455 }
@@ -493,7 +493,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, · 37 unmodified lines
493493 /* Disable interrupt after Port de-prepare */
494494 if (!prep && intr)
495495 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep,
496− dpn_prop->device_interrupts);
496+ dpn_prop->imp_def_interrupts);
497497
498498 return ret;
499499 }
include/linux/soundwire/sdw.h+7−6
@@ -206,10 +206,11 @@ enum sdw_clk_stop_mode { · 205 unmodified lines
206206 * (inclusive)
207207 * @num_words: number of wordlengths supported
208208 * @words: wordlengths supported
209− * @flow_controlled: Slave implementation results in an OK_NotReady
209+ * @BRA_flow_controlled: Slave implementation results in an OK_NotReady
210210 * response
211211 * @simple_ch_prep_sm: If channel prepare sequence is required
212− * @device_interrupts: If implementation-defined interrupts are supported
212+ * @imp_def_interrupts: If set, each bit corresponds to support for
213+ * implementation-defined interrupts
213214 *
214215 * The wordlengths are specified by Spec as max, min AND number of
215216 * discrete values, implementation can define based on the wordlengths they
@@ -220,9 +221,9 @@ struct sdw_dp0_prop { · 4 unmodified lines
220221 u32 min_word;
221222 u32 num_words;
222223 u32 *words;
223− bool flow_controlled;
224+ bool BRA_flow_controlled;
224225 bool simple_ch_prep_sm;
225− bool device_interrupts;
226+ bool imp_def_interrupts;
226227 };
227228
228229 /**
@@ -272,7 +273,7 @@ struct sdw_dpn_audio_mode { · 43 unmodified lines
272273 * @simple_ch_prep_sm: If the port supports simplified channel prepare state
273274 * machine
274275 * @ch_prep_timeout: Port-specific timeout value, in milliseconds
275− * @device_interrupts: If set, each bit corresponds to support for
276+ * @imp_def_interrupts: If set, each bit corresponds to support for
276277 * implementation-defined interrupts
277278 * @max_ch: Maximum channels supported
278279 * @min_ch: Minimum channels supported
@@ -297,7 +298,7 @@ struct sdw_dpn_prop { · 18 unmodified lines
297298 u32 max_grouping;
298299 bool simple_ch_prep_sm;
299300 u32 ch_prep_timeout;
300− u32 device_interrupts;
301+ u32 imp_def_interrupts;
301302 u32 max_ch;
302303 u32 min_ch;
303304 u32 num_ch;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t