Skip to contentSkip to conversation

mfd: cs42l43: Correct SoundWire port list

PATCH Superseded Charles Keepax 1 participant 2 messages Nov 29, 2023 – Nov 30, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mfd: cs42l43: Correct SoundWire port list

Two ports are missing from the port list, and the wrong port is set to 4 channels. Also the attempt to list them by function is rather misguided, there is nothing in the hardware that fixes a particular port to one function. Fix the missing ports, correct the port set to 4 channels and add a define to get the port mask for each port.

Fixes ace6d1448138 ("mfd: cs42l43: Add support for cs42l43 core driver")

---

Changes since v1:
- Use a macro for the ports
- Add correction to the port being marked as 4 channels

Thanks,
Charles

 drivers/mfd/cs42l43-sdw.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
drivers/mfd/cs42l43-sdw.c +7 -15
index 7392b3d2e6b96..96f74f7a318cb 100644
@@ -17,13 +17,7 @@
 
 #include "cs42l43.h"
 
-enum cs42l43_sdw_ports {
-	CS42L43_DMIC_DEC_ASP_PORT = 1,
-	CS42L43_SPK_TX_PORT,
-	CS42L43_SPDIF_HP_PORT,
-	CS42L43_SPK_RX_PORT,
-	CS42L43_ASP_PORT,
-};
+#define CS42L43_SDW_PORT(port) BIT(port)
 
 static const struct regmap_config cs42l43_sdw_regmap = {
 	.reg_bits		= 32,
@@ -55,9 +49,10 @@ static int cs42l43_read_prop(struct sdw_slave *sdw)
 	prop->use_domain_irq = true;
 	prop->paging_support = true;
 	prop->wake_capable = true;
-	prop->source_ports = BIT(CS42L43_DMIC_DEC_ASP_PORT) | BIT(CS42L43_SPK_TX_PORT);
-	prop->sink_ports = BIT(CS42L43_SPDIF_HP_PORT) |
-			   BIT(CS42L43_SPK_RX_PORT) | BIT(CS42L43_ASP_PORT);
+	prop->source_ports = CS42L43_SDW_PORT(1) | CS42L43_SDW_PORT(2) |
+			     CS42L43_SDW_PORT(3) | CS42L43_SDW_PORT(4);
+	prop->sink_ports = CS42L43_SDW_PORT(5) | CS42L43_SDW_PORT(6) |
+			   CS42L43_SDW_PORT(7);
 	prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY;
 	prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY |
 			      SDW_SCP_INT1_IMPL_DEF;
@@ -78,11 +73,8 @@ static int cs42l43_read_prop(struct sdw_slave *sdw)
 		dpn[i].max_word = 24;
 		i++;
 	}
-	/*
-	 * All ports are 2 channels max, except the first one,
-	 * CS42L43_DMIC_DEC_ASP_PORT.
-	 */
-	dpn[CS42L43_DMIC_DEC_ASP_PORT].max_ch = 4;
+	/* All ports are 2 channels max, except the first one. */
+	dpn[0].max_ch = 4;
 
 	nval = hweight32(prop->sink_ports);
 	prop->sink_dpn_prop = devm_kcalloc(dev, nval, sizeof(*prop->sink_dpn_prop),
Signature · 1 line
2.39.2
#1 lore raw
Quoted 9 lines · Charles Keepax

Two ports are missing from the port list, and the wrong port is set to 4 channels. Also the attempt to list them by function is rather misguided, there is nothing in the hardware that fixes a particular port to one function. Fix the missing ports, correct the port set to 4 channels and add a define to get the port mask for each port.

Fixes ace6d1448138 ("mfd: cs42l43: Add support for cs42l43 core driver")

---

Apologies but scratch this, I am going to flip things around and just specifying the ports it ends up looking much nicer, new spin incoming.

Thanks,
Charles