Skip to contentSkip to conversation

ASoC: cs35l41: Steam Deck Shared boost properties quirk

PATCH Superseded Lucas Tanure 2 participants 2 messages Mar 1, 2023

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: cs35l41: Steam Deck Shared boost properties quirk

Add support for Steam Deck bios old properties. If a Steam deck didn't upgrade the BIOS, the driver should be able to handle the previous properties for shared boost types.

---
 sound/soc/codecs/cs35l41.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
sound/soc/codecs/cs35l41.c +11 -3
index c223d83e02cf..d5f9eee88cba 100644
@@ -1037,9 +1037,17 @@ static int cs35l41_handle_pdata(struct device *dev, struct cs35l41_hw_cfg *hw_cf
 	unsigned int val;
 	int ret;
 
-	ret = device_property_read_u32(dev, "cirrus,boost-type", &val);
-	if (ret >= 0)
-		hw_cfg->bst_type = val;
+	if (device_property_read_bool(dev, "cirrus,shared-boost-active")){
+		hw_cfg->bst_type = CS35L41_SHD_BOOST_ACTV;
+	}
+	else if (device_property_read_bool(dev, "cirrus,shared-boost-passive")) {
+		hw_cfg->bst_type = CS35L41_SHD_BOOST_PASS;
+	}
+	else {
+		ret = device_property_read_u32(dev, "cirrus,boost-type", &val);
+		if (ret >= 0)
+			hw_cfg->bst_type = val;
+	}
 
 	ret = device_property_read_u32(dev, "cirrus,boost-peak-milliamp", &val);
 	if (ret >= 0)
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Lucas Tanure

Add support for Steam Deck bios old properties. If a Steam deck didn't upgrade the BIOS, the driver should be able to handle the previous properties for shared boost types.

---
 sound/soc/codecs/cs35l41.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
sound/soc/codecs/cs35l41.c +0 -0
index c223d83e02cf..d5f9eee88cba 100644

sound/soc/codecs/cs35l41.c static int cs35l41_handle_pdata(struct device *dev, struct cs35l41_hw_cfg *hw_cf · line 1043

Quoted 10 lines
sound/soc/codecs/cs35l41.c +4 -3
@@ -1037,9 +1037,17 @@ static int cs35l41_handle_pdata(struct device *dev, struct cs35l41_hw_cfg *hw_cf
 	unsigned int val;
 	int ret;
 
-	ret = device_property_read_u32(dev, "cirrus,boost-type", &val);
-	if (ret >= 0)
-		hw_cfg->bst_type = val;
+	if (device_property_read_bool(dev, "cirrus,shared-boost-active")){
+		hw_cfg->bst_type = CS35L41_SHD_BOOST_ACTV;
+	}
+	else if (device_property_read_bool(dev, "cirrus,shared-boost-passive")) {

else should really be on the same line as the closing bracket. But apart from that minor nit, looks good to me:

Thanks,
Charles