On 6/7/19 3:56 AM, Srinivas Kandagatla wrote:
This patch adds SDW_MAX_PORT so that other driver can use it.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
Â include/linux/soundwire/sdw.h | 1 +
Â 1 file changed, 1 insertion(+)
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
index aac68e879fae..80ca997e4e5d 100644
@@ -36,6 +36,7 @@ struct sdw_slave;
Â #define SDW_FRAME_CTRL_BITSÂÂÂÂÂÂÂ 48
Â #define SDW_MAX_DEVICESÂÂÂÂÂÂÂÂÂÂÂ 11
+#define SDW_MAX_PORTSÂÂÂ 14
That's an ambiguous definition.
You can have 16 ports per the SoundWire spec, but DP0 is reserved for control and DP15 is an alias for all ports (same idea as device 15 for broadcast operations but limited to a single device), which leaves 14 ports for audio usages.
In the MIPI specs, specifically the DisCo part, the difference is called about with the the DP0 and DPn notations, so this could be SDW_MAX_DPn. Alternatively you could use SDW_MAX_AUDIO_PORTS which is more self-explanatory and does not require in-depth familiarity with the spec.
Â #define SDW_VALID_PORT_RANGE(n)ÂÂÂÂÂÂÂ ((n) <= 14 && (n) >= 1)
Â #define SDW_DAI_ID_RANGE_STARTÂÂÂÂÂÂÂ 100