devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345
@ 2025-10-21 13:50 Abel Vesa
  2025-10-21 13:50 ` [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card Abel Vesa
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Abel Vesa @ 2025-10-21 13:50 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Abel Vesa,
	Sibi Sankar, Sibi Sankar

The current X Elite driver for sound card is mapping the channels from
left to right on all X Elite based laptops. The Dell XPS13 9345 seems to
be the one-off when the speakers/tweeters are mapped starting from right
to left.

So rework the driver to bring in a swapped mapping for 4 channels setups
and use it with the dedicated XPS13 compatible.

The devicetree node is included for proof-of-concept purposes.

Sending this as an RFC since it probably will need more discussion
before settling on the approach on how to handle this properly on future
devices.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
Abel Vesa (2):
      ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card
      ASoC: qcom: x1e80100: Add Dell XPS13 9345 support

Sibi Sankar (1):
      arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter

 .../devicetree/bindings/sound/qcom,sm8250.yaml     |   1 +
 .../boot/dts/qcom/x1e80100-dell-xps13-9345.dts     | 139 +++++++++++++++++++++
 sound/soc/qcom/x1e80100.c                          |  49 +++++++-
 3 files changed, 184 insertions(+), 5 deletions(-)
---
base-commit: fe45352cd106ae41b5ad3f0066c2e54dbb2dfd70
change-id: 20251021-dell-xps13-9345-enable-audio-799bfbd7e7ed

Best regards,
-- 
Abel Vesa <abel.vesa@linaro.org>


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

* [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card
  2025-10-21 13:50 [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Abel Vesa
@ 2025-10-21 13:50 ` Abel Vesa
  2025-10-22 10:56   ` Krzysztof Kozlowski
  2025-10-21 13:50 ` [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support Abel Vesa
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Abel Vesa @ 2025-10-21 13:50 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Abel Vesa

The Dell XPS13 9345 maps the speakers and tweeters starting from
the right side instead of left, which means we need to handle it
differently then the rest of the X Elite platforms.

So document its new compatible.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
index 868acc077046596120ea7f427e802282ed03c853..20566224d2e42574ab96f93c11924bbeae22f0bc 100644
--- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
@@ -29,6 +29,7 @@ properties:
               - qcom,sm8750-sndcard
           - const: qcom,sm8450-sndcard
       - enum:
+          - dell,xps13-9345-sndcard
           - fairphone,fp4-sndcard
           - fairphone,fp5-sndcard
           - qcom,apq8096-sndcard

-- 
2.48.1


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

* [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support
  2025-10-21 13:50 [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Abel Vesa
  2025-10-21 13:50 ` [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card Abel Vesa
@ 2025-10-21 13:50 ` Abel Vesa
  2025-10-22 10:34   ` Dmitry Baryshkov
  2025-10-21 13:50 ` [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter Abel Vesa
  2025-10-21 20:21 ` [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Srinivas Kandagatla
  3 siblings, 1 reply; 9+ messages in thread
From: Abel Vesa @ 2025-10-21 13:50 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Abel Vesa

On Dell XPS13 9345, the PCM channels are mapped starting with right
hand side instead of left. So in order to support this, we need to
hardcode the mapping and tie it up to a dedicated board compatible.

So define a match data that brings the mapping as well, for the XPS 13,
while the rest of the boards will fallback to use the mapping based
on number of channels.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 sound/soc/qcom/x1e80100.c | 49 ++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 5 deletions(-)

diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c
index 444f2162889f7d9d4b6b06bddc980d8a15dd988b..e21cf534b2ac3875b694f381f260164acb2e3ae4 100644
--- a/sound/soc/qcom/x1e80100.c
+++ b/sound/soc/qcom/x1e80100.c
@@ -15,10 +15,17 @@
 #include "qdsp6/q6dsp-common.h"
 #include "sdw.h"
 
+struct x1e80100_snd_cfg {
+	const char *driver_name;
+	const unsigned int *channels_map;
+	int channels_num;
+};
+
 struct x1e80100_snd_data {
 	bool stream_prepared[AFE_PORT_MAX];
 	struct snd_soc_card *card;
 	struct sdw_stream_runtime *sruntime[AFE_PORT_MAX];
+	const struct x1e80100_snd_cfg *cfg;
 	struct snd_soc_jack jack;
 	struct snd_soc_jack dp_jack[8];
 	bool jack_setup;
@@ -95,8 +102,16 @@ static int x1e80100_snd_hw_params(struct snd_pcm_substream *substream,
 	return qcom_snd_sdw_hw_params(substream, params, &data->sruntime[cpu_dai->id]);
 }
 
-static int x1e80100_snd_hw_map_channels(unsigned int *ch_map, int num)
+static int x1e80100_snd_hw_map_channels(struct x1e80100_snd_data *data,
+					unsigned int *ch_map, int num)
 {
+	if (data->cfg->channels_map) {
+		for (int i = 0; i < data->cfg->channels_num; i++)
+			ch_map[i] = data->cfg->channels_map[i];
+
+		return 0;
+	}
+
 	switch (num) {
 	case 1:
 		ch_map[0] = PCM_CHANNEL_FC;
@@ -136,7 +151,7 @@ static int x1e80100_snd_prepare(struct snd_pcm_substream *substream)
 	switch (cpu_dai->id) {
 	case WSA_CODEC_DMA_RX_0:
 	case WSA_CODEC_DMA_RX_1:
-		ret = x1e80100_snd_hw_map_channels(rx_slot, channels);
+		ret = x1e80100_snd_hw_map_channels(data, rx_slot, channels);
 		if (ret)
 			return ret;
 
@@ -210,15 +225,39 @@ static int x1e80100_platform_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	card->driver_name = of_device_get_match_data(dev);
+	data->cfg = of_device_get_match_data(dev);
+
+	card->driver_name = data->cfg->driver_name;
 	x1e80100_add_be_ops(card);
 
 	return devm_snd_soc_register_card(dev, card);
 }
 
+static const struct x1e80100_snd_cfg x1e80100_cfg = {
+	.driver_name = "x1e80100",
+};
+
+static const struct x1e80100_snd_cfg glymur_cfg = {
+	.driver_name = "glymur",
+};
+
+static const unsigned int right_left_4_channels_map[] = {
+	PCM_CHANNEL_FR,
+	PCM_CHANNEL_RB,
+	PCM_CHANNEL_FL,
+	PCM_CHANNEL_LB,
+};
+
+static const struct x1e80100_snd_cfg dell_xps13_9345_cfg = {
+	.driver_name = "x1e80100",
+	.channels_map = right_left_4_channels_map,
+	.channels_num = ARRAY_SIZE(right_left_4_channels_map),
+};
+
 static const struct of_device_id snd_x1e80100_dt_match[] = {
-	{ .compatible = "qcom,x1e80100-sndcard", .data = "x1e80100" },
-	{ .compatible = "qcom,glymur-sndcard", .data = "glymur" },
+	{ .compatible = "qcom,x1e80100-sndcard", .data = &x1e80100_cfg, },
+	{ .compatible = "dell,xps13-9345-sndcard", .data = &dell_xps13_9345_cfg, },
+	{ .compatible = "qcom,glymur-sndcard", .data = &glymur_cfg, },
 	{}
 };
 MODULE_DEVICE_TABLE(of, snd_x1e80100_dt_match);

-- 
2.48.1


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

* [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter
  2025-10-21 13:50 [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Abel Vesa
  2025-10-21 13:50 ` [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card Abel Vesa
  2025-10-21 13:50 ` [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support Abel Vesa
@ 2025-10-21 13:50 ` Abel Vesa
  2025-10-22 16:28   ` Konrad Dybcio
  2025-10-22 17:04   ` Alexey Klimov
  2025-10-21 20:21 ` [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Srinivas Kandagatla
  3 siblings, 2 replies; 9+ messages in thread
From: Abel Vesa @ 2025-10-21 13:50 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Abel Vesa,
	Sibi Sankar, Sibi Sankar

From: Sibi Sankar <sibi.sankar@oss.qualcomm.com>

Enable left and right speakers/tweeters on the X1E80100 Dell XPS13 9345.

Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 .../boot/dts/qcom/x1e80100-dell-xps13-9345.dts     | 139 +++++++++++++++++++++
 1 file changed, 139 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts b/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
index 58f8caaa7258077d2c267048ca048279109ddb71..a05dfe2c51364b3ec04963590d9b02b9fda9f336 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
@@ -151,6 +151,50 @@ linux,cma {
 		};
 	};
 
+	sound {
+		compatible = "dell,xps13-9345-sndcard";
+		model = "X1E80100-Dell-XPS-13-9345";
+		audio-routing = "WooferLeft IN", "WSA WSA_SPK1 OUT",
+				"TweeterLeft IN", "WSA WSA_SPK2 OUT",
+				"WooferRight IN", "WSA2 WSA_SPK1 OUT",
+				"TweeterRight IN", "WSA2 WSA_SPK2 OUT";
+
+		wsa-dai-link {
+			link-name = "WSA Playback";
+
+			cpu {
+				sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
+			};
+
+			codec {
+				sound-dai = <&left_woofer>, <&left_tweeter>,
+					    <&swr0 0>, <&lpass_wsamacro 0>,
+					    <&right_woofer>, <&right_tweeter>,
+					    <&swr3 0>, <&lpass_wsa2macro 0>;
+			};
+
+			platform {
+				sound-dai = <&q6apm>;
+			};
+		};
+
+		va-dai-link {
+			link-name = "VA Capture";
+
+			cpu {
+				sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
+			};
+
+			codec {
+				sound-dai = <&lpass_vamacro 0>;
+			};
+
+			platform {
+				sound-dai = <&q6apm>;
+			};
+		};
+	};
+
 	vreg_edp_3p3: regulator-edp-3p3 {
 		compatible = "regulator-fixed";
 
@@ -415,6 +459,13 @@ vreg_bob2: bob2 {
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
 
+		vreg_l1b_1p8: ldo1 {
+			regulator-name = "vreg_l1b_1p8";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
+
 		vreg_l2b_3p0: ldo2 {
 			regulator-name = "vreg_l2b_3p0";
 			regulator-min-microvolt = <3072000>;
@@ -880,6 +931,32 @@ &iris {
 	status = "okay";
 };
 
+&lpass_tlmm {
+	spkr_01_sd_n_active: spkr-01-sd-n-active-state {
+		pins = "gpio12";
+		function = "gpio";
+		drive-strength = <16>;
+		bias-disable;
+		output-low;
+	};
+
+	spkr_23_sd_n_active: spkr-23-sd-n-active-state {
+		pins = "gpio13";
+		function = "gpio";
+		drive-strength = <16>;
+		bias-disable;
+		output-low;
+	};
+};
+
+&lpass_vamacro {
+	pinctrl-0 = <&dmic01_default>, <&dmic23_default>;
+	pinctrl-names = "default";
+
+	vdd-micb-supply = <&vreg_l1b_1p8>;
+	qcom,dmic-sample-rate = <4800000>;
+};
+
 &mdss {
 	status = "okay";
 };
@@ -1067,6 +1144,68 @@ &smb2360_1_eusb2_repeater {
 	vdd3-supply = <&vreg_l14b_3p0>;
 };
 
+&swr0 {
+	status = "okay";
+
+	pinctrl-0 = <&wsa_swr_active>, <&spkr_01_sd_n_active>;
+	pinctrl-names = "default";
+
+	/* WSA8845, Left Woofer */
+	left_woofer: speaker@0,0 {
+		compatible = "sdw20217020400";
+		reg = <0 0>;
+		reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "WooferLeft";
+		vdd-1p8-supply = <&vreg_l15b_1p8>;
+		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <1 2 3 7 10 13>;
+	};
+
+	/* WSA8845, Left Tweeter */
+	left_tweeter: speaker@0,1 {
+		compatible = "sdw20217020400";
+		reg = <0 1>;
+		reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TweeterLeft";
+		vdd-1p8-supply = <&vreg_l15b_1p8>;
+		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <4 5 6 7 11 13>;
+	};
+};
+
+&swr3 {
+	status = "okay";
+
+	pinctrl-0 = <&wsa2_swr_active>, <&spkr_23_sd_n_active>;
+	pinctrl-names = "default";
+
+	/* WSA8845, Right Woofer */
+	right_woofer: speaker@0,0 {
+		compatible = "sdw20217020400";
+		reg = <0 0>;
+		reset-gpios = <&lpass_tlmm 13 GPIO_ACTIVE_LOW>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "WooferRight";
+		vdd-1p8-supply = <&vreg_l15b_1p8>;
+		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <1 2 3 7 10 13>;
+	};
+
+	/* WSA8845, Right Tweeter */
+	right_tweeter: speaker@0,1 {
+		compatible = "sdw20217020400";
+		reg = <0 1>;
+		reset-gpios = <&lpass_tlmm 13 GPIO_ACTIVE_LOW>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TweeterRight";
+		vdd-1p8-supply = <&vreg_l15b_1p8>;
+		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <4 5 6 7 11 13>;
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <44 4>,  /* SPI11 (TPM) */
 			       <76 4>,  /* SPI19 (TZ Protected) */

-- 
2.48.1


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

* Re: [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345
  2025-10-21 13:50 [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Abel Vesa
                   ` (2 preceding siblings ...)
  2025-10-21 13:50 ` [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter Abel Vesa
@ 2025-10-21 20:21 ` Srinivas Kandagatla
  3 siblings, 0 replies; 9+ messages in thread
From: Srinivas Kandagatla @ 2025-10-21 20:21 UTC (permalink / raw)
  To: Abel Vesa, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Sibi Sankar

Thanks Abel for sending this one out.

On 10/21/25 2:50 PM, Abel Vesa wrote:
> The current X Elite driver for sound card is mapping the channels from
> left to right on all X Elite based laptops. The Dell XPS13 9345 seems to
> be the one-off when the speakers/tweeters are mapped starting from right
> to left.
> 
> So rework the driver to bring in a swapped mapping for 4 channels setups
> and use it with the dedicated XPS13 compatible.
> 
> The devicetree node is included for proof-of-concept purposes.
> 
> Sending this as an RFC since it probably will need more discussion
> before settling on the approach on how to handle this properly on future
> devices.
We have few options here, one is the way that you have done, other way
is to add a mixer control in the machine driver which should allow xps
ucm to select correct channel map.
This should also allow bit more flexibility incase any other machines
have different wiring of tweeters and main speakers.

--srini

> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> Abel Vesa (2):
>       ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card
>       ASoC: qcom: x1e80100: Add Dell XPS13 9345 support
> 
> Sibi Sankar (1):
>       arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter
> 
>  .../devicetree/bindings/sound/qcom,sm8250.yaml     |   1 +
>  .../boot/dts/qcom/x1e80100-dell-xps13-9345.dts     | 139 +++++++++++++++++++++
>  sound/soc/qcom/x1e80100.c                          |  49 +++++++-
>  3 files changed, 184 insertions(+), 5 deletions(-)
> ---
> base-commit: fe45352cd106ae41b5ad3f0066c2e54dbb2dfd70
> change-id: 20251021-dell-xps13-9345-enable-audio-799bfbd7e7ed
> 
> Best regards,


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

* Re: [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support
  2025-10-21 13:50 ` [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support Abel Vesa
@ 2025-10-22 10:34   ` Dmitry Baryshkov
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2025-10-22 10:34 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-sound, linux-arm-msm,
	devicetree, linux-kernel

On Tue, Oct 21, 2025 at 04:50:45PM +0300, Abel Vesa wrote:
> On Dell XPS13 9345, the PCM channels are mapped starting with right
> hand side instead of left. So in order to support this, we need to
> hardcode the mapping and tie it up to a dedicated board compatible.
> 
> So define a match data that brings the mapping as well, for the XPS 13,
> while the rest of the boards will fallback to use the mapping based
> on number of channels.
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
>  sound/soc/qcom/x1e80100.c | 49 ++++++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 44 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c
> index 444f2162889f7d9d4b6b06bddc980d8a15dd988b..e21cf534b2ac3875b694f381f260164acb2e3ae4 100644
> --- a/sound/soc/qcom/x1e80100.c
> +++ b/sound/soc/qcom/x1e80100.c
> @@ -15,10 +15,17 @@
>  #include "qdsp6/q6dsp-common.h"
>  #include "sdw.h"
>  
> +struct x1e80100_snd_cfg {
> +	const char *driver_name;
> +	const unsigned int *channels_map;
> +	int channels_num;
> +};
> +
>  struct x1e80100_snd_data {
>  	bool stream_prepared[AFE_PORT_MAX];
>  	struct snd_soc_card *card;
>  	struct sdw_stream_runtime *sruntime[AFE_PORT_MAX];
> +	const struct x1e80100_snd_cfg *cfg;
>  	struct snd_soc_jack jack;
>  	struct snd_soc_jack dp_jack[8];
>  	bool jack_setup;
> @@ -95,8 +102,16 @@ static int x1e80100_snd_hw_params(struct snd_pcm_substream *substream,
>  	return qcom_snd_sdw_hw_params(substream, params, &data->sruntime[cpu_dai->id]);
>  }
>  
> -static int x1e80100_snd_hw_map_channels(unsigned int *ch_map, int num)
> +static int x1e80100_snd_hw_map_channels(struct x1e80100_snd_data *data,
> +					unsigned int *ch_map, int num)
>  {
> +	if (data->cfg->channels_map) {
> +		for (int i = 0; i < data->cfg->channels_num; i++)
> +			ch_map[i] = data->cfg->channels_map[i];
> +
> +		return 0;
> +	}

Why by default the driver remaps channels depending on the usecase, but
for XPS we use a static map?

> +
>  	switch (num) {
>  	case 1:
>  		ch_map[0] = PCM_CHANNEL_FC;

-- 
With best wishes
Dmitry

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

* Re: [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card
  2025-10-21 13:50 ` [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card Abel Vesa
@ 2025-10-22 10:56   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-22 10:56 UTC (permalink / raw)
  To: Abel Vesa, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel

On 21/10/2025 15:50, Abel Vesa wrote:
> The Dell XPS13 9345 maps the speakers and tweeters starting from
> the right side instead of left, which means we need to handle it
> differently then the rest of the X Elite platforms.
> 
> So document its new compatible.
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
>  Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
> index 868acc077046596120ea7f427e802282ed03c853..20566224d2e42574ab96f93c11924bbeae22f0bc 100644
> --- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
> +++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
> @@ -29,6 +29,7 @@ properties:
>                - qcom,sm8750-sndcard
>            - const: qcom,sm8450-sndcard
>        - enum:
> +          - dell,xps13-9345-sndcard

When I explained you how to proceed, I said - you need front compatible,
because this sound card is compatible with existing one, with a quirk
needed.

Might not matter if we go with mixers solution as suggested by Srini.

Best regards,
Krzysztof

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

* Re: [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter
  2025-10-21 13:50 ` [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter Abel Vesa
@ 2025-10-22 16:28   ` Konrad Dybcio
  2025-10-22 17:04   ` Alexey Klimov
  1 sibling, 0 replies; 9+ messages in thread
From: Konrad Dybcio @ 2025-10-22 16:28 UTC (permalink / raw)
  To: Abel Vesa, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Sibi Sankar

On 10/21/25 3:50 PM, Abel Vesa wrote:
> From: Sibi Sankar <sibi.sankar@oss.qualcomm.com>
> 
> Enable left and right speakers/tweeters on the X1E80100 Dell XPS13 9345.
> 
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---

[...]

> +&lpass_tlmm {
> +	spkr_01_sd_n_active: spkr-01-sd-n-active-state {
> +		pins = "gpio12";
> +		function = "gpio";
> +		drive-strength = <16>;
> +		bias-disable;
> +		output-low;
> +	};
> +
> +	spkr_23_sd_n_active: spkr-23-sd-n-active-state {
> +		pins = "gpio13";
> +		function = "gpio";
> +		drive-strength = <16>;
> +		bias-disable;
> +		output-low;

Drop output-low in both definitions

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter
  2025-10-21 13:50 ` [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter Abel Vesa
  2025-10-22 16:28   ` Konrad Dybcio
@ 2025-10-22 17:04   ` Alexey Klimov
  1 sibling, 0 replies; 9+ messages in thread
From: Alexey Klimov @ 2025-10-22 17:04 UTC (permalink / raw)
  To: Abel Vesa, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-sound, linux-arm-msm, devicetree, linux-kernel, Sibi Sankar

On Tue Oct 21, 2025 at 2:50 PM BST, Abel Vesa wrote:
> From: Sibi Sankar <sibi.sankar@oss.qualcomm.com>
>
> Enable left and right speakers/tweeters on the X1E80100 Dell XPS13 9345.
>
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
>  .../boot/dts/qcom/x1e80100-dell-xps13-9345.dts     | 139 +++++++++++++++++++++
>  1 file changed, 139 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts b/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
> index 58f8caaa7258077d2c267048ca048279109ddb71..a05dfe2c51364b3ec04963590d9b02b9fda9f336 100644
> --- a/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
> +++ b/arch/arm64/boot/dts/qcom/x1e80100-dell-xps13-9345.dts
> @@ -151,6 +151,50 @@ linux,cma {
>  		};
>  	};
>  
> +	sound {
> +		compatible = "dell,xps13-9345-sndcard";
> +		model = "X1E80100-Dell-XPS-13-9345";
> +		audio-routing = "WooferLeft IN", "WSA WSA_SPK1 OUT",
> +				"TweeterLeft IN", "WSA WSA_SPK2 OUT",
> +				"WooferRight IN", "WSA2 WSA_SPK1 OUT",
> +				"TweeterRight IN", "WSA2 WSA_SPK2 OUT";
> +
> +		wsa-dai-link {
> +			link-name = "WSA Playback";
> +
> +			cpu {
> +				sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
> +			};
> +
> +			codec {
> +				sound-dai = <&left_woofer>, <&left_tweeter>,
> +					    <&swr0 0>, <&lpass_wsamacro 0>,
> +					    <&right_woofer>, <&right_tweeter>,
> +					    <&swr3 0>, <&lpass_wsa2macro 0>;
> +			};
> +
> +			platform {
> +				sound-dai = <&q6apm>;
> +			};
> +		};
> +
> +		va-dai-link {
> +			link-name = "VA Capture";
> +
> +			cpu {
> +				sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
> +			};
> +
> +			codec {
> +				sound-dai = <&lpass_vamacro 0>;
> +			};
> +
> +			platform {
> +				sound-dai = <&q6apm>;
> +			};
> +		};
> +	};
> +
>  	vreg_edp_3p3: regulator-edp-3p3 {
>  		compatible = "regulator-fixed";
>  
> @@ -415,6 +459,13 @@ vreg_bob2: bob2 {
>  			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>  		};
>  
> +		vreg_l1b_1p8: ldo1 {
> +			regulator-name = "vreg_l1b_1p8";
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1800000>;
> +			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> +		};
> +
>  		vreg_l2b_3p0: ldo2 {
>  			regulator-name = "vreg_l2b_3p0";
>  			regulator-min-microvolt = <3072000>;
> @@ -880,6 +931,32 @@ &iris {
>  	status = "okay";
>  };
>  
> +&lpass_tlmm {
> +	spkr_01_sd_n_active: spkr-01-sd-n-active-state {
> +		pins = "gpio12";
> +		function = "gpio";
> +		drive-strength = <16>;
> +		bias-disable;
> +		output-low;
> +	};
> +
> +	spkr_23_sd_n_active: spkr-23-sd-n-active-state {
> +		pins = "gpio13";
> +		function = "gpio";
> +		drive-strength = <16>;
> +		bias-disable;
> +		output-low;
> +	};
> +};

Recently it was adviced to remove output properties for gpio and
non-gpio functions.
For instance here: https://lore.kernel.org/linux-arm-msm/39ebaf4e-e91f-4568-8de6-9fc1f805a1e4@oss.qualcomm.com/

These output-low should be removed.

After that:

Reviewed-by: Alexey Klimov <alexey.klimov@linaro.org>


> +&lpass_vamacro {
> +	pinctrl-0 = <&dmic01_default>, <&dmic23_default>;
> +	pinctrl-names = "default";
> +
> +	vdd-micb-supply = <&vreg_l1b_1p8>;
> +	qcom,dmic-sample-rate = <4800000>;
> +};
> +
>  &mdss {
>  	status = "okay";
>  };
> @@ -1067,6 +1144,68 @@ &smb2360_1_eusb2_repeater {
>  	vdd3-supply = <&vreg_l14b_3p0>;
>  };
>  
> +&swr0 {
> +	status = "okay";
> +
> +	pinctrl-0 = <&wsa_swr_active>, <&spkr_01_sd_n_active>;
> +	pinctrl-names = "default";
> +
> +	/* WSA8845, Left Woofer */
> +	left_woofer: speaker@0,0 {
> +		compatible = "sdw20217020400";
> +		reg = <0 0>;
> +		reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "WooferLeft";
> +		vdd-1p8-supply = <&vreg_l15b_1p8>;
> +		vdd-io-supply = <&vreg_l12b_1p2>;
> +		qcom,port-mapping = <1 2 3 7 10 13>;
> +	};
> +
> +	/* WSA8845, Left Tweeter */
> +	left_tweeter: speaker@0,1 {
> +		compatible = "sdw20217020400";
> +		reg = <0 1>;
> +		reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "TweeterLeft";
> +		vdd-1p8-supply = <&vreg_l15b_1p8>;
> +		vdd-io-supply = <&vreg_l12b_1p2>;
> +		qcom,port-mapping = <4 5 6 7 11 13>;
> +	};
> +};
> +
> +&swr3 {
> +	status = "okay";
> +
> +	pinctrl-0 = <&wsa2_swr_active>, <&spkr_23_sd_n_active>;
> +	pinctrl-names = "default";
> +
> +	/* WSA8845, Right Woofer */
> +	right_woofer: speaker@0,0 {
> +		compatible = "sdw20217020400";
> +		reg = <0 0>;
> +		reset-gpios = <&lpass_tlmm 13 GPIO_ACTIVE_LOW>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "WooferRight";
> +		vdd-1p8-supply = <&vreg_l15b_1p8>;
> +		vdd-io-supply = <&vreg_l12b_1p2>;
> +		qcom,port-mapping = <1 2 3 7 10 13>;
> +	};
> +
> +	/* WSA8845, Right Tweeter */
> +	right_tweeter: speaker@0,1 {
> +		compatible = "sdw20217020400";
> +		reg = <0 1>;
> +		reset-gpios = <&lpass_tlmm 13 GPIO_ACTIVE_LOW>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "TweeterRight";
> +		vdd-1p8-supply = <&vreg_l15b_1p8>;
> +		vdd-io-supply = <&vreg_l12b_1p2>;
> +		qcom,port-mapping = <4 5 6 7 11 13>;
> +	};
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <44 4>,  /* SPI11 (TPM) */
>  			       <76 4>,  /* SPI19 (TZ Protected) */


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

end of thread, other threads:[~2025-10-22 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-21 13:50 [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Abel Vesa
2025-10-21 13:50 ` [PATCH RFC 1/3] ASoC: dt-bindings: qcom,sm8250: Add Dell XPS13 9345 sound card Abel Vesa
2025-10-22 10:56   ` Krzysztof Kozlowski
2025-10-21 13:50 ` [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support Abel Vesa
2025-10-22 10:34   ` Dmitry Baryshkov
2025-10-21 13:50 ` [PATCH RFC 3/3] arm64: dts: qcom: x1e80100-dell-xps13-9345: Add Left/Right Speakers and Tweeter Abel Vesa
2025-10-22 16:28   ` Konrad Dybcio
2025-10-22 17:04   ` Alexey Klimov
2025-10-21 20:21 ` [PATCH RFC 0/3] ASoC: qcom: x1e80100: Add sound card support for Dell XPS13 9345 Srinivas Kandagatla

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).