public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] ASoC: cs35l41: Steam Deck Shared boost properties quirk
@ 2023-03-01 12:44 Lucas Tanure
  2023-03-01 14:50 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lucas Tanure @ 2023-03-01 12:44 UTC (permalink / raw)
  To: David Rhodes, Charles Keepax, Liam Girdwood, Krzysztof Kozlowski,
	Mark Brown, Rob Herring, Jaroslav Kysela,
	Takashi Iwai --cc=alsa-devel @ alsa-project . org
  Cc: patches, linux-kernel, kernel, 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.

Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
Changes since V2:
 - sent the wrong patch with missing fixed lines
Changes since V1:
 - else in same line as {
---
 sound/soc/codecs/cs35l41.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index c223d83e02cf..a9e1a7469b45 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -1037,9 +1037,15 @@ 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)
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-02  2:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-01 12:44 [PATCH v3] ASoC: cs35l41: Steam Deck Shared boost properties quirk Lucas Tanure
2023-03-01 14:50 ` Mark Brown
2023-03-01 16:14   ` Lucas Tanure
2023-03-01 18:08 ` David Rhodes
2023-03-02  2:45 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox