[PATCH v2 0/5] fsl-asoc-card: Add optional dt property for setting mclk-id
This is a follow up of patchset:
[RFC patch 0/5] Support BCLK input clock in tlv320aic31xx
Sound cards may allow using different main clock inputs. In the generic fsl-asoc-card driver, these values are hardcoded for each specific card configuration.
Let's make it more flexible, allowing setting mclk-id from the device-tree node.
Changes in v2: * Split patch adding mckl-id property.
Ariel D'Alessandro (5): dt-bindings: sound: Rename tlv320aic31xx-micbias as tlv320aic31xx dt-bindings: tlv320aic31xx: Define PLL clock inputs ASoC: bindings: fsl-asoc-card: Add mclk-id optional property ASoC: fsl-asoc-card: Add optional dt property for setting mclk-id ASoC: fsl-asoc-card: Remove BCLK default value for tlv320aic31xx card
.../devicetree/bindings/sound/fsl-asoc-card.txt | 1 + .../devicetree/bindings/sound/tlv320aic31xx.txt | 2 +- arch/arm/boot/dts/am43x-epos-evm.dts | 2 +- include/dt-bindings/sound/tlv320aic31xx-micbias.h | 9 --------- include/dt-bindings/sound/tlv320aic31xx.h | 14 ++++++++++++++ sound/soc/codecs/tlv320aic31xx.c | 2 +- sound/soc/fsl/fsl-asoc-card.c | 7 ++++++- 7 files changed, 24 insertions(+), 13 deletions(-) delete mode 100644 include/dt-bindings/sound/tlv320aic31xx-micbias.h create mode 100644 include/dt-bindings/sound/tlv320aic31xx.h
Let's use a more generic name, so other definitions for tlv320aic31xx can be included.
Signed-off-by: Ariel D'Alessandro ariel.dalessandro@collabora.com Acked-by: Rob Herring robh@kernel.org --- .../devicetree/bindings/sound/tlv320aic31xx.txt | 2 +- arch/arm/boot/dts/am43x-epos-evm.dts | 2 +- include/dt-bindings/sound/tlv320aic31xx-micbias.h | 9 --------- include/dt-bindings/sound/tlv320aic31xx.h | 9 +++++++++ sound/soc/codecs/tlv320aic31xx.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 include/dt-bindings/sound/tlv320aic31xx-micbias.h create mode 100644 include/dt-bindings/sound/tlv320aic31xx.h
diff --git a/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt b/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt index e372303697dc..bbad98d5b986 100644 --- a/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt +++ b/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt @@ -58,7 +58,7 @@ The pins can be used in referring sound node's audio-routing property.
Example: #include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/sound/tlv320aic31xx-micbias.h> +#include <dt-bindings/sound/tlv320aic31xx.h>
tlv320aic31xx: tlv320aic31xx@18 { compatible = "ti,tlv320aic311x"; diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts index 2f4d2e4e9b3e..4f9a7251a107 100644 --- a/arch/arm/boot/dts/am43x-epos-evm.dts +++ b/arch/arm/boot/dts/am43x-epos-evm.dts @@ -11,7 +11,7 @@ #include <dt-bindings/pinctrl/am43xx.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pwm/pwm.h> -#include <dt-bindings/sound/tlv320aic31xx-micbias.h> +#include <dt-bindings/sound/tlv320aic31xx.h>
/ { model = "TI AM43x EPOS EVM"; diff --git a/include/dt-bindings/sound/tlv320aic31xx-micbias.h b/include/dt-bindings/sound/tlv320aic31xx-micbias.h deleted file mode 100644 index c6895a18a455..000000000000 --- a/include/dt-bindings/sound/tlv320aic31xx-micbias.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __DT_TLV320AIC31XX_MICBIAS_H -#define __DT_TLV320AIC31XX_MICBIAS_H - -#define MICBIAS_2_0V 1 -#define MICBIAS_2_5V 2 -#define MICBIAS_AVDDV 3 - -#endif /* __DT_TLV320AIC31XX_MICBIAS_H */ diff --git a/include/dt-bindings/sound/tlv320aic31xx.h b/include/dt-bindings/sound/tlv320aic31xx.h new file mode 100644 index 000000000000..3a845fbba992 --- /dev/null +++ b/include/dt-bindings/sound/tlv320aic31xx.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __DT_TLV320AIC31XX_H +#define __DT_TLV320AIC31XX_H + +#define MICBIAS_2_0V 1 +#define MICBIAS_2_5V 2 +#define MICBIAS_AVDDV 3 + +#endif /* __DT_TLV320AIC31XX_H */ diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index e77342aff46d..8331dc26bcd2 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -32,7 +32,7 @@ #include <sound/soc.h> #include <sound/initval.h> #include <sound/tlv.h> -#include <dt-bindings/sound/tlv320aic31xx-micbias.h> +#include <dt-bindings/sound/tlv320aic31xx.h>
#include "tlv320aic31xx.h"
Add constants for the different PLL clock inputs in tlv320aic31xx.
Signed-off-by: Ariel D'Alessandro ariel.dalessandro@collabora.com --- include/dt-bindings/sound/tlv320aic31xx.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/dt-bindings/sound/tlv320aic31xx.h b/include/dt-bindings/sound/tlv320aic31xx.h index 3a845fbba992..4a80238ab250 100644 --- a/include/dt-bindings/sound/tlv320aic31xx.h +++ b/include/dt-bindings/sound/tlv320aic31xx.h @@ -6,4 +6,9 @@ #define MICBIAS_2_5V 2 #define MICBIAS_AVDDV 3
+#define PLL_CLKIN_MCLK 0x00 +#define PLL_CLKIN_BCLK 0x01 +#define PLL_CLKIN_GPIO1 0x02 +#define PLL_CLKIN_DIN 0x03 + #endif /* __DT_TLV320AIC31XX_H */
On Mon, Jan 17, 2022 at 10:21:06AM -0300, Ariel D'Alessandro wrote:
Add constants for the different PLL clock inputs in tlv320aic31xx.
Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.
Support setting the sound card main clock input from the device-tree using the mclk-id property.
Signed-off-by: Ariel D'Alessandro ariel.dalessandro@collabora.com --- Documentation/devicetree/bindings/sound/fsl-asoc-card.txt | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt index 23d83fa7609f..b219626a5403 100644 --- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt +++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt @@ -82,6 +82,7 @@ Optional properties: - dai-format : audio format, for details see simple-card.yaml. - frame-inversion : dai-link uses frame clock inversion, for details see simple-card.yaml. - bitclock-inversion : dai-link uses bit clock inversion, for details see simple-card.yaml. + - mclk-id : main clock id, specific for each card configuration.
Optional unless SSI is selected as a CPU DAI:
Sound cards may allow using different main clock inputs. In the generic fsl-asoc-card driver, these values are hardcoded for each specific card configuration.
Let's make it more flexible, allowing setting mclk-id from the device-tree node. Otherwise, the default value for each card configuration is used.
Signed-off-by: Ariel D'Alessandro ariel.dalessandro@collabora.com --- sound/soc/fsl/fsl-asoc-card.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 5ee945505281..156d3c669274 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -693,6 +693,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) goto asrc_fail; }
+ /* + * Allow setting mclk-id from the device-tree node. Otherwise, the + * default value for each card configuration is used. + */ + of_property_read_u32(np, "mclk-id", &priv->codec_priv.mclk_id); + /* Format info from DT is optional. */ snd_soc_daifmt_parse_clock_provider_as_phandle(np, NULL, &bitclkprovider, &frameprovider); if (bitclkprovider || frameprovider) {
Now that fsl-asoc-card support setting mclk-id through the device-tree mclk-id property, let's remove the default BCLK configuration for this card.
Signed-off-by: Ariel D'Alessandro ariel.dalessandro@collabora.com --- sound/soc/fsl/fsl-asoc-card.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 156d3c669274..370bc790c6ba 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -637,7 +637,6 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->dai_link[2].dpcm_capture = 0; priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT; priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT; - priv->codec_priv.mclk_id = AIC31XX_PLL_CLKIN_BCLK; priv->card.dapm_routes = audio_map_tx; priv->card.num_dapm_routes = ARRAY_SIZE(audio_map_tx); } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) {
On Mon, 17 Jan 2022 10:21:04 -0300, Ariel D'Alessandro wrote:
This is a follow up of patchset:
[RFC patch 0/5] Support BCLK input clock in tlv320aic31xx
Sound cards may allow using different main clock inputs. In the generic fsl-asoc-card driver, these values are hardcoded for each specific card configuration.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/5] dt-bindings: sound: Rename tlv320aic31xx-micbias as tlv320aic31xx commit: 85f856f790b5fd427cb31b3f62755713174da0aa [2/5] dt-bindings: tlv320aic31xx: Define PLL clock inputs commit: 6045ffd366283236f0de79c8a0e98ae766e9a8f9 [3/5] ASoC: bindings: fsl-asoc-card: Add mclk-id optional property commit: 55915f20ad9ae92015bf7b2c4ac854e5b720d63f [4/5] ASoC: fsl-asoc-card: Add optional dt property for setting mclk-id commit: e6ec5a3936ee0c01f46e1d09dc758bb762e06dd9 [5/5] ASoC: fsl-asoc-card: Remove BCLK default value for tlv320aic31xx card commit: d4c4e2861560ab1cbf540bbda5bcdf4c92b17110
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
participants (2)
-
Ariel D'Alessandro
-
Mark Brown