[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251021-dell-xps13-9345-enable-audio-v1-2-6f3f6bbd977b@linaro.org>
Date: Tue, 21 Oct 2025 16:50:45 +0300
From: Abel Vesa <abel.vesa@...aro.org>
To: Srinivas Kandagatla <srini@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>
Cc: linux-sound@...r.kernel.org, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Abel Vesa <abel.vesa@...aro.org>
Subject: [PATCH RFC 2/3] ASoC: qcom: x1e80100: Add Dell XPS13 9345 support
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@...aro.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
Powered by blists - more mailing lists