alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe
@ 2023-01-02 11:41 Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 2/8] ASoC: codecs: wsa881x: " Krzysztof Kozlowski
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wsa883x.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
index 966ba4909204..8d69ed340e83 100644
--- a/sound/soc/codecs/wsa883x.c
+++ b/sound/soc/codecs/wsa883x.c
@@ -1375,7 +1375,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
 	struct device *dev = &pdev->dev;
 	int ret;
 
-	wsa883x = devm_kzalloc(&pdev->dev, sizeof(*wsa883x), GFP_KERNEL);
+	wsa883x = devm_kzalloc(dev, sizeof(*wsa883x), GFP_KERNEL);
 	if (!wsa883x)
 		return -ENOMEM;
 
@@ -1388,17 +1388,17 @@ static int wsa883x_probe(struct sdw_slave *pdev,
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to enable vdd regulator\n");
 
-	wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
+	wsa883x->sd_n = devm_gpiod_get_optional(dev, "powerdown",
 						GPIOD_FLAGS_BIT_NONEXCLUSIVE | GPIOD_OUT_HIGH);
 	if (IS_ERR(wsa883x->sd_n)) {
-		ret = dev_err_probe(&pdev->dev, PTR_ERR(wsa883x->sd_n),
+		ret = dev_err_probe(dev, PTR_ERR(wsa883x->sd_n),
 				    "Shutdown Control GPIO not found\n");
 		goto err;
 	}
 
-	dev_set_drvdata(&pdev->dev, wsa883x);
+	dev_set_drvdata(dev, wsa883x);
 	wsa883x->slave = pdev;
-	wsa883x->dev = &pdev->dev;
+	wsa883x->dev = dev;
 	wsa883x->sconfig.ch_count = 1;
 	wsa883x->sconfig.bps = 1;
 	wsa883x->sconfig.direction = SDW_DATA_DIR_RX;
@@ -1413,7 +1413,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
 	wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config);
 	if (IS_ERR(wsa883x->regmap)) {
 		gpiod_direction_output(wsa883x->sd_n, 1);
-		ret = dev_err_probe(&pdev->dev, PTR_ERR(wsa883x->regmap),
+		ret = dev_err_probe(dev, PTR_ERR(wsa883x->regmap),
 				    "regmap_init failed\n");
 		goto err;
 	}
@@ -1423,7 +1423,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
 	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
 
-	ret = devm_snd_soc_register_component(&pdev->dev,
+	ret = devm_snd_soc_register_component(dev,
 					      &wsa883x_component_drv,
 					       wsa883x_dais,
 					       ARRAY_SIZE(wsa883x_dais));
-- 
2.34.1


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

* [PATCH 2/8] ASoC: codecs: wsa881x: Simplify &pdev->dev in probe
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 3/8] ASoC: codecs: wsa881x: Simplify with dev_err_probe Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wsa881x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index 6c8b1db649b8..cd7be55f6a89 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1113,20 +1113,20 @@ static int wsa881x_probe(struct sdw_slave *pdev,
 	struct wsa881x_priv *wsa881x;
 	struct device *dev = &pdev->dev;
 
-	wsa881x = devm_kzalloc(&pdev->dev, sizeof(*wsa881x), GFP_KERNEL);
+	wsa881x = devm_kzalloc(dev, sizeof(*wsa881x), GFP_KERNEL);
 	if (!wsa881x)
 		return -ENOMEM;
 
-	wsa881x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
+	wsa881x->sd_n = devm_gpiod_get_optional(dev, "powerdown",
 						GPIOD_FLAGS_BIT_NONEXCLUSIVE);
 	if (IS_ERR(wsa881x->sd_n)) {
 		dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
 		return PTR_ERR(wsa881x->sd_n);
 	}
 
-	dev_set_drvdata(&pdev->dev, wsa881x);
+	dev_set_drvdata(dev, wsa881x);
 	wsa881x->slave = pdev;
-	wsa881x->dev = &pdev->dev;
+	wsa881x->dev = dev;
 	wsa881x->sconfig.ch_count = 1;
 	wsa881x->sconfig.bps = 1;
 	wsa881x->sconfig.frame_rate = 48000;
@@ -1149,7 +1149,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
 	pm_runtime_set_active(dev);
 	pm_runtime_enable(dev);
 
-	return devm_snd_soc_register_component(&pdev->dev,
+	return devm_snd_soc_register_component(dev,
 					       &wsa881x_component_drv,
 					       wsa881x_dais,
 					       ARRAY_SIZE(wsa881x_dais));
-- 
2.34.1


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

* [PATCH 3/8] ASoC: codecs: wsa881x: Simplify with dev_err_probe
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 2/8] ASoC: codecs: wsa881x: " Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 4/8] ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

Code can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wsa881x.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index cd7be55f6a89..6df9c48f42bf 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1119,10 +1119,9 @@ static int wsa881x_probe(struct sdw_slave *pdev,
 
 	wsa881x->sd_n = devm_gpiod_get_optional(dev, "powerdown",
 						GPIOD_FLAGS_BIT_NONEXCLUSIVE);
-	if (IS_ERR(wsa881x->sd_n)) {
-		dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
-		return PTR_ERR(wsa881x->sd_n);
-	}
+	if (IS_ERR(wsa881x->sd_n))
+		return dev_err_probe(dev, PTR_ERR(wsa881x->sd_n),
+				     "Shutdown Control GPIO not found\n");
 
 	dev_set_drvdata(dev, wsa881x);
 	wsa881x->slave = pdev;
@@ -1138,10 +1137,8 @@ static int wsa881x_probe(struct sdw_slave *pdev,
 	gpiod_direction_output(wsa881x->sd_n, 1);
 
 	wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
-	if (IS_ERR(wsa881x->regmap)) {
-		dev_err(&pdev->dev, "regmap_init failed\n");
-		return PTR_ERR(wsa881x->regmap);
-	}
+	if (IS_ERR(wsa881x->regmap))
+		return dev_err_probe(dev, PTR_ERR(wsa881x->regmap), "regmap_init failed\n");
 
 	pm_runtime_set_autosuspend_delay(dev, 3000);
 	pm_runtime_use_autosuspend(dev);
-- 
2.34.1


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

* [PATCH 4/8] ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 2/8] ASoC: codecs: wsa881x: " Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 3/8] ASoC: codecs: wsa881x: Simplify with dev_err_probe Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 5/8] arm64: dts: qcom: sdm850-lenovo-yoga-c630: Use proper WSA881x " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value while preserving backwards DTB
compatibility.  It is not possible to detect whether ACTIVE_HIGH flag in
DTB is because it is an old DTB (using incorrect flag) or it is a new
DTB with a correct hardware pin polarity description.  Therefore the
solution prioritizes backwards compatibility while relying on relevant
DTS being upstreamed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wsa881x.c | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index 6df9c48f42bf..7a5d31483cfc 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -679,6 +679,11 @@ struct wsa881x_priv {
 	struct sdw_stream_runtime *sruntime;
 	struct sdw_port_config port_config[WSA881X_MAX_SWR_PORTS];
 	struct gpio_desc *sd_n;
+	/*
+	 * Logical state for SD_N GPIO: high for shutdown, low for enable.
+	 * For backwards compatibility.
+	 */
+	unsigned int sd_n_val;
 	int version;
 	int active_ports;
 	bool port_prepared[WSA881X_MAX_SWR_PORTS];
@@ -1123,6 +1128,26 @@ static int wsa881x_probe(struct sdw_slave *pdev,
 		return dev_err_probe(dev, PTR_ERR(wsa881x->sd_n),
 				     "Shutdown Control GPIO not found\n");
 
+	/*
+	 * Backwards compatibility work-around.
+	 *
+	 * The SD_N GPIO is active low, however upstream DTS used always active
+	 * high.  Changing the flag in driver and DTS will break backwards
+	 * compatibility, so add a simple value inversion to work with both old
+	 * and new DTS.
+	 *
+	 * This won't work properly with DTS using the flags properly in cases:
+	 * 1. Old DTS with proper ACTIVE_LOW, however such case was broken
+	 *    before as the driver required the active high.
+	 * 2. New DTS with proper ACTIVE_HIGH (intended), which is rare case
+	 *    (not existing upstream) but possible. This is the price of
+	 *    backwards compatibility, therefore this hack should be removed at
+	 *    some point.
+	 */
+	wsa881x->sd_n_val = gpiod_is_active_low(wsa881x->sd_n);
+	if (!wsa881x->sd_n_val)
+		dev_warn(dev, "Using ACTIVE_HIGH for shutdown GPIO. Your DTB might be outdated or you use unsupported configuration for the GPIO.");
+
 	dev_set_drvdata(dev, wsa881x);
 	wsa881x->slave = pdev;
 	wsa881x->dev = dev;
@@ -1134,7 +1159,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
 	pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
 	pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
 	pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
-	gpiod_direction_output(wsa881x->sd_n, 1);
+	gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val);
 
 	wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
 	if (IS_ERR(wsa881x->regmap))
@@ -1157,7 +1182,7 @@ static int __maybe_unused wsa881x_runtime_suspend(struct device *dev)
 	struct regmap *regmap = dev_get_regmap(dev, NULL);
 	struct wsa881x_priv *wsa881x = dev_get_drvdata(dev);
 
-	gpiod_direction_output(wsa881x->sd_n, 0);
+	gpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val);
 
 	regcache_cache_only(regmap, true);
 	regcache_mark_dirty(regmap);
@@ -1172,13 +1197,13 @@ static int __maybe_unused wsa881x_runtime_resume(struct device *dev)
 	struct wsa881x_priv *wsa881x = dev_get_drvdata(dev);
 	unsigned long time;
 
-	gpiod_direction_output(wsa881x->sd_n, 1);
+	gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val);
 
 	time = wait_for_completion_timeout(&slave->initialization_complete,
 					   msecs_to_jiffies(WSA881X_PROBE_TIMEOUT));
 	if (!time) {
 		dev_err(dev, "Initialization not complete, timed out\n");
-		gpiod_direction_output(wsa881x->sd_n, 0);
+		gpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val);
 		return -ETIMEDOUT;
 	}
 
-- 
2.34.1


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

* [PATCH 5/8] arm64: dts: qcom: sdm850-lenovo-yoga-c630: Use proper WSA881x shutdown GPIO polarity
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-01-02 11:41 ` [PATCH 4/8] ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 6/8] arm64: dts: qcom: sdm850-samsung-w737: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The WSA881x shutdown GPIO is active low (SD_N), but Linux driver assumed
DTS always comes with active high.  Since Linux drivers were updated to
handle proper flag, correct the DTS.

The change is not backwards compatible with older Linux kernel.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index f32b7445f7c9..25d167cb5e7f 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -788,7 +788,7 @@ swm: swm@c85 {
 		left_spkr: speaker@0,3 {
 			compatible = "sdw10217211000";
 			reg = <0 3>;
-			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
+			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_LOW>;
 			#thermal-sensor-cells = <0>;
 			sound-name-prefix = "SpkrLeft";
 			#sound-dai-cells = <0>;
@@ -796,7 +796,7 @@ left_spkr: speaker@0,3 {
 
 		right_spkr: speaker@0,4 {
 			compatible = "sdw10217211000";
-			powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>;
+			powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_LOW>;
 			reg = <0 4>;
 			#thermal-sensor-cells = <0>;
 			sound-name-prefix = "SpkrRight";
-- 
2.34.1


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

* [PATCH 6/8] arm64: dts: qcom: sdm850-samsung-w737: Use proper WSA881x shutdown GPIO polarity
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2023-01-02 11:41 ` [PATCH 5/8] arm64: dts: qcom: sdm850-lenovo-yoga-c630: Use proper WSA881x " Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 7/8] arm64: dts: qcom: sm8250-mtp: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The WSA881x shutdown GPIO is active low (SD_N), but Linux driver assumed
DTS always comes with active high.  Since Linux drivers were updated to
handle proper flag, correct the DTS.

The change is not backwards compatible with older Linux kernel.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
index daca1e0ad62a..1980080fffa7 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
@@ -720,7 +720,7 @@ swm: swm@c85 {
 		left_spkr: speaker@0,3 {
 			compatible = "sdw10217211000";
 			reg = <0 3>;
-			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
+			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_LOW>;
 			#thermal-sensor-cells = <0>;
 			sound-name-prefix = "SpkrLeft";
 			#sound-dai-cells = <0>;
@@ -728,7 +728,7 @@ left_spkr: speaker@0,3 {
 
 		right_spkr: speaker@0,4 {
 			compatible = "sdw10217211000";
-			powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>;
+			powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_LOW>;
 			reg = <0 4>;
 			#thermal-sensor-cells = <0>;
 			sound-name-prefix = "SpkrRight";
-- 
2.34.1


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

* [PATCH 7/8] arm64: dts: qcom: sm8250-mtp: Use proper WSA881x shutdown GPIO polarity
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2023-01-02 11:41 ` [PATCH 6/8] arm64: dts: qcom: sdm850-samsung-w737: " Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-02 11:41 ` [PATCH 8/8] arm64: dts: qcom: qrb5165-rb5: " Krzysztof Kozlowski
  2023-01-16 14:48 ` (subset) [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Mark Brown
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The WSA881x shutdown GPIO is active low (SD_N), but Linux driver assumed
DTS always comes with active high.  Since Linux drivers were updated to
handle proper flag, correct the DTS.

The change is not backwards compatible with older Linux kernel.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8250-mtp.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8250-mtp.dts b/arch/arm64/boot/dts/qcom/sm8250-mtp.dts
index 3ed8c84e25b8..f3669c1a311e 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-mtp.dts
@@ -760,7 +760,7 @@ &swr0 {
 	left_spkr: speaker@0,3 {
 		compatible = "sdw10217211000";
 		reg = <0 3>;
-		powerdown-gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;
+		powerdown-gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
 		#thermal-sensor-cells = <0>;
 		sound-name-prefix = "SpkrLeft";
 		#sound-dai-cells = <0>;
@@ -769,7 +769,7 @@ left_spkr: speaker@0,3 {
 	right_spkr: speaker@0,4 {
 		compatible = "sdw10217211000";
 		reg = <0 4>;
-		powerdown-gpios = <&tlmm 127 GPIO_ACTIVE_HIGH>;
+		powerdown-gpios = <&tlmm 127 GPIO_ACTIVE_LOW>;
 		#thermal-sensor-cells = <0>;
 		sound-name-prefix = "SpkrRight";
 		#sound-dai-cells = <0>;
-- 
2.34.1


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

* [PATCH 8/8] arm64: dts: qcom: qrb5165-rb5: Use proper WSA881x shutdown GPIO polarity
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2023-01-02 11:41 ` [PATCH 7/8] arm64: dts: qcom: sm8250-mtp: " Krzysztof Kozlowski
@ 2023-01-02 11:41 ` Krzysztof Kozlowski
  2023-01-16 14:48 ` (subset) [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Mark Brown
  7 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-02 11:41 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, devicetree, linux-kernel, alsa-devel
  Cc: Krzysztof Kozlowski

The WSA881x shutdown GPIO is active low (SD_N), but Linux driver assumed
DTS always comes with active high.  Since Linux drivers were updated to
handle proper flag, correct the DTS.

The change is not backwards compatible with older Linux kernel.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index 8c64cb060e21..5c510d59c054 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -1010,7 +1010,7 @@ &swr0 {
 	left_spkr: speaker@0,3 {
 		compatible = "sdw10217211000";
 		reg = <0 3>;
-		powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_HIGH>;
+		powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
 		#thermal-sensor-cells = <0>;
 		sound-name-prefix = "SpkrLeft";
 		#sound-dai-cells = <0>;
@@ -1019,7 +1019,7 @@ left_spkr: speaker@0,3 {
 	right_spkr: speaker@0,4 {
 		compatible = "sdw10217211000";
 		reg = <0 4>;
-		powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_HIGH>;
+		powerdown-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>;
 		#thermal-sensor-cells = <0>;
 		sound-name-prefix = "SpkrRight";
 		#sound-dai-cells = <0>;
-- 
2.34.1


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

* Re: (subset) [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe
  2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2023-01-02 11:41 ` [PATCH 8/8] arm64: dts: qcom: qrb5165-rb5: " Krzysztof Kozlowski
@ 2023-01-16 14:48 ` Mark Brown
  7 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2023-01-16 14:48 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-arm-msm,
	devicetree, linux-kernel, alsa-devel, Krzysztof Kozlowski

On Mon, 02 Jan 2023 12:41:45 +0100, Krzysztof Kozlowski wrote:
> The probe already stores pointer to &pdev->dev, so use it to make the
> code a bit easier to read.
> 
> 

Applied to

   broonie/sound.git for-next

Thanks!

[1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe
      commit: d5ce5d3895a33fa8e0dce89c2404facbdef55dcb
[2/8] ASoC: codecs: wsa881x: Simplify &pdev->dev in probe
      commit: c617c9e7024d152426acf9f1aaf01070b6852f13
[3/8] ASoC: codecs: wsa881x: Simplify with dev_err_probe
      commit: 31a90367443b21f76b972c00aad3430447c999d6
[4/8] ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity
      commit: 738455858a2d21b769f673892546cf8300c9fd78

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2023-01-16 14:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 11:41 [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 2/8] ASoC: codecs: wsa881x: " Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 3/8] ASoC: codecs: wsa881x: Simplify with dev_err_probe Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 4/8] ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 5/8] arm64: dts: qcom: sdm850-lenovo-yoga-c630: Use proper WSA881x " Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 6/8] arm64: dts: qcom: sdm850-samsung-w737: " Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 7/8] arm64: dts: qcom: sm8250-mtp: " Krzysztof Kozlowski
2023-01-02 11:41 ` [PATCH 8/8] arm64: dts: qcom: qrb5165-rb5: " Krzysztof Kozlowski
2023-01-16 14:48 ` (subset) [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).