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
648 return 0;648 return 0;
649 649
650 /* Enable DP0 interrupts */650 /* Enable DP0 interrupts */
651 val = prop->dp0_prop->device_interrupts;651 val = prop->dp0_prop->imp_def_interrupts;
652 val |= SDW_DP0_INT_PORT_READY | SDW_DP0_INT_BRA_FAILURE;652 val |= SDW_DP0_INT_PORT_READY | SDW_DP0_INT_BRA_FAILURE;
653 653
654 ret = sdw_update(slave, SDW_DP0_INTMASK, val, val);654 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
150 dp0->words, dp0->num_words);150 dp0->words, dp0->num_words);
151 }151 }
152 152
153 dp0->flow_controlled = fwnode_property_read_bool(port,153 dp0->BRA_flow_controlled = fwnode_property_read_bool(port,
154 "mipi-sdw-bra-flow-controlled");154 "mipi-sdw-bra-flow-controlled");
155 155
156 dp0->simple_ch_prep_sm = fwnode_property_read_bool(port,156 dp0->simple_ch_prep_sm = fwnode_property_read_bool(port,
157 "mipi-sdw-simplified-channel-prepare-sm");157 "mipi-sdw-simplified-channel-prepare-sm");
158 158
159 dp0->device_interrupts = fwnode_property_read_bool(port,159 dp0->imp_def_interrupts = fwnode_property_read_bool(port,
160 "mipi-sdw-imp-def-dp0-interrupts-supported");160 "mipi-sdw-imp-def-dp0-interrupts-supported");
161 161
162 return 0;162 return 0;
@@ -225,7 +225,7 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, · 62 unmodified lines
225 225
226 fwnode_property_read_u32(node,226 fwnode_property_read_u32(node,
227 "mipi-sdw-imp-def-dpn-interrupts-supported",227 "mipi-sdw-imp-def-dpn-interrupts-supported",
228 &dpn[i].device_interrupts);228 &dpn[i].imp_def_interrupts);
229 229
230 fwnode_property_read_u32(node, "mipi-sdw-min-channel-number",230 fwnode_property_read_u32(node, "mipi-sdw-min-channel-number",
231 &dpn[i].min_ch);231 &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
439 439
440 prep_ch.bank = bus->params.next_bank;440 prep_ch.bank = bus->params.next_bank;
441 441
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)
443 intr = true;443 intr = true;
444 444
445 /*445 /*
@@ -449,7 +449,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, · 3 unmodified lines
449 */449 */
450 if (prep && intr) {450 if (prep && intr) {
451 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep,451 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep,
452 dpn_prop->device_interrupts);452 dpn_prop->imp_def_interrupts);
453 if (ret < 0)453 if (ret < 0)
454 return ret;454 return ret;
455 }455 }
@@ -493,7 +493,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, · 37 unmodified lines
493 /* Disable interrupt after Port de-prepare */493 /* Disable interrupt after Port de-prepare */
494 if (!prep && intr)494 if (!prep && intr)
495 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep,495 ret = sdw_configure_dpn_intr(s_rt->slave, p_rt->num, prep,
496 dpn_prop->device_interrupts);496 dpn_prop->imp_def_interrupts);
497 497
498 return ret;498 return ret;
499}499}
include/linux/soundwire/sdw.h+7−6
@@ -206,10 +206,11 @@ enum sdw_clk_stop_mode { · 205 unmodified lines
206 * (inclusive)206 * (inclusive)
207 * @num_words: number of wordlengths supported207 * @num_words: number of wordlengths supported
208 * @words: wordlengths supported208 * @words: wordlengths supported
209 * @flow_controlled: Slave implementation results in an OK_NotReady209 * @BRA_flow_controlled: Slave implementation results in an OK_NotReady
210 * response210 * response
211 * @simple_ch_prep_sm: If channel prepare sequence is required211 * @simple_ch_prep_sm: If channel prepare sequence is required
212 * @device_interrupts: If implementation-defined interrupts are supported212 * @imp_def_interrupts: If set, each bit corresponds to support for
213 * implementation-defined interrupts
213 *214 *
214 * The wordlengths are specified by Spec as max, min AND number of215 * The wordlengths are specified by Spec as max, min AND number of
215 * discrete values, implementation can define based on the wordlengths they216 * discrete values, implementation can define based on the wordlengths they
@@ -220,9 +221,9 @@ struct sdw_dp0_prop { · 4 unmodified lines
220 u32 min_word;221 u32 min_word;
221 u32 num_words;222 u32 num_words;
222 u32 *words;223 u32 *words;
223 bool flow_controlled;224 bool BRA_flow_controlled;
224 bool simple_ch_prep_sm;225 bool simple_ch_prep_sm;
225 bool device_interrupts;226 bool imp_def_interrupts;
226};227};
227 228
228/**229/**
@@ -272,7 +273,7 @@ struct sdw_dpn_audio_mode { · 43 unmodified lines
272 * @simple_ch_prep_sm: If the port supports simplified channel prepare state273 * @simple_ch_prep_sm: If the port supports simplified channel prepare state
273 * machine274 * machine
274 * @ch_prep_timeout: Port-specific timeout value, in milliseconds275 * @ch_prep_timeout: Port-specific timeout value, in milliseconds
275 * @device_interrupts: If set, each bit corresponds to support for276 * @imp_def_interrupts: If set, each bit corresponds to support for
276 * implementation-defined interrupts277 * implementation-defined interrupts
277 * @max_ch: Maximum channels supported278 * @max_ch: Maximum channels supported
278 * @min_ch: Minimum channels supported279 * @min_ch: Minimum channels supported
@@ -297,7 +298,7 @@ struct sdw_dpn_prop { · 18 unmodified lines
297 u32 max_grouping;298 u32 max_grouping;
298 bool simple_ch_prep_sm;299 bool simple_ch_prep_sm;
299 u32 ch_prep_timeout;300 u32 ch_prep_timeout;
300 u32 device_interrupts;301 u32 imp_def_interrupts;
301 u32 max_ch;302 u32 max_ch;
302 u32 min_ch;303 u32 min_ch;
303 u32 num_ch;304 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