Add DT bindings for WCD9335 DAIs and use them in the driver as well
as all device trees currently using WCD9335.
Yassine Oudjana (3):
ASoC: dt-bindings: Add bindings for WCD9335 DAIs
ASoC: wcd9335: Use DT bindings instead of local DAI definitions
arm64: dts: qcom: Use WCD9335 DT bindings
MAINTAINERS | 1 +
arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 5 +++--
.../arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts | 5 +++--
.../boot/dts/qcom/msm8996-xiaomi-scorpio.dts | 5 +++--
include/dt-bindings/sound/qcom,wcd9335.h | 15 +++++++++++++++
sound/soc/codecs/wcd9335.c | 13 ++-----------
6 files changed, 27 insertions(+), 17 deletions(-)
create mode 100644 include/dt-bindings/sound/qcom,wcd9335.h
--
2.36.1
From: Yassine Oudjana <[email protected]>
Get DAI indices from DT bindings and remove the currently used
local definitions.
Signed-off-by: Yassine Oudjana <[email protected]>
---
sound/soc/codecs/wcd9335.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 7d40a61b03b0..3554b95462e8 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -24,6 +24,8 @@
#include "wcd9335.h"
#include "wcd-clsh-v2.h"
+#include <dt-bindings/sound/qcom,wcd9335.h>
+
#define WCD9335_RATES_MASK (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000)
@@ -203,17 +205,6 @@ enum wcd9335_sido_voltage {
SIDO_VOLTAGE_NOMINAL_MV = 1100,
};
-enum {
- AIF1_PB = 0,
- AIF1_CAP,
- AIF2_PB,
- AIF2_CAP,
- AIF3_PB,
- AIF3_CAP,
- AIF4_PB,
- NUM_CODEC_DAIS,
-};
-
enum {
COMPANDER_1, /* HPH_L */
COMPANDER_2, /* HPH_R */
--
2.36.1
From: Yassine Oudjana <[email protected]>
Add bindings for the DAIs available in WCD9335 to avoid
having to use unclear number indices in device trees.
Signed-off-by: Yassine Oudjana <[email protected]>
---
MAINTAINERS | 1 +
include/dt-bindings/sound/qcom,wcd9335.h | 15 +++++++++++++++
2 files changed, 16 insertions(+)
create mode 100644 include/dt-bindings/sound/qcom,wcd9335.h
diff --git a/MAINTAINERS b/MAINTAINERS
index b774f21828f7..2bcc3cc129c5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16366,6 +16366,7 @@ M: Srinivas Kandagatla <[email protected]>
M: Banajit Goswami <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Supported
+F: include/dt-bindings/sound/qcom,wcd9335.h
F: sound/soc/codecs/lpass-va-macro.c
F: sound/soc/codecs/lpass-wsa-macro.*
F: sound/soc/codecs/msm8916-wcd-analog.c
diff --git a/include/dt-bindings/sound/qcom,wcd9335.h b/include/dt-bindings/sound/qcom,wcd9335.h
new file mode 100644
index 000000000000..709d33ca748d
--- /dev/null
+++ b/include/dt-bindings/sound/qcom,wcd9335.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+
+#ifndef __DT_QCOM_WCD9335_H
+#define __DT_QCOM_WCD9335_H
+
+#define AIF1_PB 0
+#define AIF1_CAP 1
+#define AIF2_PB 2
+#define AIF2_CAP 3
+#define AIF3_PB 4
+#define AIF3_CAP 5
+#define AIF4_PB 6
+#define NUM_CODEC_DAIS 7
+
+#endif
--
2.36.1
From: Yassine Oudjana <[email protected]>
Replace DAI indices in codec nodes with definitions from the WCD9335
DT bindings for devices that use WCD9335.
Signed-off-by: Yassine Oudjana <[email protected]>
---
arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 5 +++--
arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts | 5 +++--
arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts | 5 +++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
index 49afbb1a066a..ff915cd8e5a6 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
+++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
@@ -13,6 +13,7 @@
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
+#include <dt-bindings/sound/qcom,wcd9335.h>
/*
* GPIO name legend: proper name = the GPIO line is used as GPIO
@@ -1009,7 +1010,7 @@ platform {
};
codec {
- sound-dai = <&wcd9335 6>;
+ sound-dai = <&wcd9335 AIF4_PB>;
};
};
@@ -1024,7 +1025,7 @@ platform {
};
codec {
- sound-dai = <&wcd9335 1>;
+ sound-dai = <&wcd9335 AIF1_CAP>;
};
};
};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
index 22978d06f85b..261f2ea7def0 100644
--- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
+++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
@@ -9,6 +9,7 @@
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
#include <dt-bindings/input/ti-drv260x.h>
+#include <dt-bindings/sound/qcom,wcd9335.h>
/ {
model = "Xiaomi Mi 5";
@@ -193,7 +194,7 @@ platform {
};
codec {
- sound-dai = <&wcd9335 6>;
+ sound-dai = <&wcd9335 AIF4_PB>;
};
};
@@ -208,7 +209,7 @@ platform {
};
codec {
- sound-dai = <&wcd9335 1>;
+ sound-dai = <&wcd9335 AIF1_CAP>;
};
};
};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
index 1e2dd6763ad1..c9f935cfb587 100644
--- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
+++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
@@ -9,6 +9,7 @@
#include "pmi8996.dtsi"
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
+#include <dt-bindings/sound/qcom,wcd9335.h>
/ {
model = "Xiaomi Mi Note 2";
@@ -171,7 +172,7 @@ platform {
};
codec {
- sound-dai = <&wcd9335 6>;
+ sound-dai = <&wcd9335 AIF4_PB>;
};
};
@@ -186,7 +187,7 @@ platform {
};
codec {
- sound-dai = <&wcd9335 1>;
+ sound-dai = <&wcd9335 AIF1_CAP>;
};
};
};
--
2.36.1
On 22/06/2022 08:47, Yassine Oudjana wrote:
> From: Yassine Oudjana <[email protected]>
>
> Get DAI indices from DT bindings and remove the currently used
> local definitions.
>
> Signed-off-by: Yassine Oudjana <[email protected]>
> ---
Acked-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
On 22/06/2022 08:47, Yassine Oudjana wrote:
> From: Yassine Oudjana <[email protected]>
>
> Replace DAI indices in codec nodes with definitions from the WCD9335
> DT bindings for devices that use WCD9335.
>
> Signed-off-by: Yassine Oudjana <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 5 +++--
> arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts | 5 +++--
> arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts | 5 +++--
> 3 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
> index 49afbb1a066a..ff915cd8e5a6 100644
> --- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
> +++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
> @@ -13,6 +13,7 @@
> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
> #include <dt-bindings/sound/qcom,q6afe.h>
> #include <dt-bindings/sound/qcom,q6asm.h>
> +#include <dt-bindings/sound/qcom,wcd9335.h>
>
> /*
> * GPIO name legend: proper name = the GPIO line is used as GPIO
> @@ -1009,7 +1010,7 @@ platform {
> };
>
> codec {
> - sound-dai = <&wcd9335 6>;
> + sound-dai = <&wcd9335 AIF4_PB>;
> };
> };
>
> @@ -1024,7 +1025,7 @@ platform {
> };
>
> codec {
> - sound-dai = <&wcd9335 1>;
> + sound-dai = <&wcd9335 AIF1_CAP>;
> };
> };
> };
> diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
> index 22978d06f85b..261f2ea7def0 100644
> --- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
> @@ -9,6 +9,7 @@
> #include <dt-bindings/sound/qcom,q6afe.h>
> #include <dt-bindings/sound/qcom,q6asm.h>
> #include <dt-bindings/input/ti-drv260x.h>
> +#include <dt-bindings/sound/qcom,wcd9335.h>
Keep the order, so this goes before input (even though it is not really
alphabetical, but that's life...).
>
> / {
> model = "Xiaomi Mi 5";
> @@ -193,7 +194,7 @@ platform {
> };
>
> codec {
> - sound-dai = <&wcd9335 6>;
> + sound-dai = <&wcd9335 AIF4_PB>;
> };
> };
>
> @@ -208,7 +209,7 @@ platform {
> };
>
> codec {
> - sound-dai = <&wcd9335 1>;
> + sound-dai = <&wcd9335 AIF1_CAP>;
> };
> };
> };
> diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
> index 1e2dd6763ad1..c9f935cfb587 100644
> --- a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
> @@ -9,6 +9,7 @@
> #include "pmi8996.dtsi"
> #include <dt-bindings/sound/qcom,q6afe.h>
> #include <dt-bindings/sound/qcom,q6asm.h>
> +#include <dt-bindings/sound/qcom,wcd9335.h>
>
> / {
> model = "Xiaomi Mi Note 2";
> @@ -171,7 +172,7 @@ platform {
> };
>
> codec {
> - sound-dai = <&wcd9335 6>;
> + sound-dai = <&wcd9335 AIF4_PB>;
> };
> };
>
> @@ -186,7 +187,7 @@ platform {
> };
>
> codec {
> - sound-dai = <&wcd9335 1>;
> + sound-dai = <&wcd9335 AIF1_CAP>;
> };
> };
> };
Best regards,
Krzysztof
On 22/06/2022 08:47, Yassine Oudjana wrote:
> From: Yassine Oudjana <[email protected]>
>
> Add bindings for the DAIs available in WCD9335 to avoid
> having to use unclear number indices in device trees.
>
> Signed-off-by: Yassine Oudjana <[email protected]>
> ---
> MAINTAINERS | 1 +
> include/dt-bindings/sound/qcom,wcd9335.h | 15 +++++++++++++++
> 2 files changed, 16 insertions(+)
> create mode 100644 include/dt-bindings/sound/qcom,wcd9335.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b774f21828f7..2bcc3cc129c5 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -16366,6 +16366,7 @@ M: Srinivas Kandagatla <[email protected]>
> M: Banajit Goswami <[email protected]>
> L: [email protected] (moderated for non-subscribers)
> S: Supported
> +F: include/dt-bindings/sound/qcom,wcd9335.h
> F: sound/soc/codecs/lpass-va-macro.c
> F: sound/soc/codecs/lpass-wsa-macro.*
> F: sound/soc/codecs/msm8916-wcd-analog.c
> diff --git a/include/dt-bindings/sound/qcom,wcd9335.h b/include/dt-bindings/sound/qcom,wcd9335.h
> new file mode 100644
> index 000000000000..709d33ca748d
> --- /dev/null
> +++ b/include/dt-bindings/sound/qcom,wcd9335.h
> @@ -0,0 +1,15 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +
> +#ifndef __DT_QCOM_WCD9335_H
> +#define __DT_QCOM_WCD9335_H
Header guard should match better path, so:
__DT_SOUND_QCOM_WCD9335_H
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof