linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs
@ 2022-06-22  6:47 Yassine Oudjana
  2022-06-22  6:47 ` [PATCH 1/3] " Yassine Oudjana
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yassine Oudjana @ 2022-06-22  6:47 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, Yassine Oudjana, devicetree, alsa-devel,
	linux-arm-msm, phone-devel, linux-kernel

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


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

* [PATCH 1/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs
  2022-06-22  6:47 [PATCH 0/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs Yassine Oudjana
@ 2022-06-22  6:47 ` Yassine Oudjana
  2022-06-22 14:35   ` Krzysztof Kozlowski
  2022-06-22  6:47 ` [PATCH 2/3] ASoC: wcd9335: Use DT bindings instead of local DAI definitions Yassine Oudjana
  2022-06-22  6:47 ` [PATCH 3/3] arm64: dts: qcom: Use WCD9335 DT bindings Yassine Oudjana
  2 siblings, 1 reply; 7+ messages in thread
From: Yassine Oudjana @ 2022-06-22  6:47 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, Yassine Oudjana, devicetree, alsa-devel,
	linux-arm-msm, phone-devel, linux-kernel

From: Yassine Oudjana <y.oudjana@protonmail.com>

Add bindings for the DAIs available in WCD9335 to avoid
having to use unclear number indices in device trees.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
---
 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 <srinivas.kandagatla@linaro.org>
 M:	Banajit Goswami <bgoswami@quicinc.com>
 L:	alsa-devel@alsa-project.org (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


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

* [PATCH 2/3] ASoC: wcd9335: Use DT bindings instead of local DAI definitions
  2022-06-22  6:47 [PATCH 0/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs Yassine Oudjana
  2022-06-22  6:47 ` [PATCH 1/3] " Yassine Oudjana
@ 2022-06-22  6:47 ` Yassine Oudjana
  2022-06-22 14:35   ` Krzysztof Kozlowski
  2022-06-22  6:47 ` [PATCH 3/3] arm64: dts: qcom: Use WCD9335 DT bindings Yassine Oudjana
  2 siblings, 1 reply; 7+ messages in thread
From: Yassine Oudjana @ 2022-06-22  6:47 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, Yassine Oudjana, devicetree, alsa-devel,
	linux-arm-msm, phone-devel, linux-kernel

From: Yassine Oudjana <y.oudjana@protonmail.com>

Get DAI indices from DT bindings and remove the currently used
local definitions.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
---
 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


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

* [PATCH 3/3] arm64: dts: qcom: Use WCD9335 DT bindings
  2022-06-22  6:47 [PATCH 0/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs Yassine Oudjana
  2022-06-22  6:47 ` [PATCH 1/3] " Yassine Oudjana
  2022-06-22  6:47 ` [PATCH 2/3] ASoC: wcd9335: Use DT bindings instead of local DAI definitions Yassine Oudjana
@ 2022-06-22  6:47 ` Yassine Oudjana
  2022-06-22 14:36   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 7+ messages in thread
From: Yassine Oudjana @ 2022-06-22  6:47 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, Yassine Oudjana, devicetree, alsa-devel,
	linux-arm-msm, phone-devel, linux-kernel

From: Yassine Oudjana <y.oudjana@protonmail.com>

Replace DAI indices in codec nodes with definitions from the WCD9335
DT bindings for devices that use WCD9335.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
---
 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


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

* Re: [PATCH 1/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs
  2022-06-22  6:47 ` [PATCH 1/3] " Yassine Oudjana
@ 2022-06-22 14:35   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 14:35 UTC (permalink / raw)
  To: Yassine Oudjana, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, devicetree, alsa-devel, linux-arm-msm,
	phone-devel, linux-kernel

On 22/06/2022 08:47, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> Add bindings for the DAIs available in WCD9335 to avoid
> having to use unclear number indices in device trees.
> 
> Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
> ---
>  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 <srinivas.kandagatla@linaro.org>
>  M:	Banajit Goswami <bgoswami@quicinc.com>
>  L:	alsa-devel@alsa-project.org (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 <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

* Re: [PATCH 2/3] ASoC: wcd9335: Use DT bindings instead of local DAI definitions
  2022-06-22  6:47 ` [PATCH 2/3] ASoC: wcd9335: Use DT bindings instead of local DAI definitions Yassine Oudjana
@ 2022-06-22 14:35   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 14:35 UTC (permalink / raw)
  To: Yassine Oudjana, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, devicetree, alsa-devel, linux-arm-msm,
	phone-devel, linux-kernel

On 22/06/2022 08:47, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> Get DAI indices from DT bindings and remove the currently used
> local definitions.
> 
> Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
> ---


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

* Re: [PATCH 3/3] arm64: dts: qcom: Use WCD9335 DT bindings
  2022-06-22  6:47 ` [PATCH 3/3] arm64: dts: qcom: Use WCD9335 DT bindings Yassine Oudjana
@ 2022-06-22 14:36   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 14:36 UTC (permalink / raw)
  To: Yassine Oudjana, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Srinivas Kandagatla, Banajit Goswami,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Yassine Oudjana, devicetree, alsa-devel, linux-arm-msm,
	phone-devel, linux-kernel

On 22/06/2022 08:47, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> Replace DAI indices in codec nodes with definitions from the WCD9335
> DT bindings for devices that use WCD9335.
> 
> Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
> ---
>  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

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

end of thread, other threads:[~2022-06-22 14:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  6:47 [PATCH 0/3] ASoC: dt-bindings: Add bindings for WCD9335 DAIs Yassine Oudjana
2022-06-22  6:47 ` [PATCH 1/3] " Yassine Oudjana
2022-06-22 14:35   ` Krzysztof Kozlowski
2022-06-22  6:47 ` [PATCH 2/3] ASoC: wcd9335: Use DT bindings instead of local DAI definitions Yassine Oudjana
2022-06-22 14:35   ` Krzysztof Kozlowski
2022-06-22  6:47 ` [PATCH 3/3] arm64: dts: qcom: Use WCD9335 DT bindings Yassine Oudjana
2022-06-22 14:36   ` Krzysztof Kozlowski

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