add "simple-mfd" support for MediaTek audio subsystem
Subsystems (5)
cover add "simple-mfd" support for MediaTek audio subsystem
Hi,
The reason for this series is that MediaTek audio hardware block expose more than a single functionality, but register those in different kernel subsystems. Same issue could also be found in MMSYS: https://lkml.org/lkml/2017/11/14/669
Hence use "simple-mfd" to handle this kind of situation, that will make sure all children are registered - and we don't need to write an MFD driver specially. It was tested on the bananapi-r2 and the MT2701/MT7622 EVB.
[1]~[3]: modify the current audio driver accordingly. [5][6]: add clock driver for MT2701 and add missing data for MT7622.
changes since v1:
- To avoid writing an MFD driver, we add "simple-mfd" in the audsys binding.
- Move three top clocks to audio driver [1] as we remove mfd/mtk-audsys.c in v1.
Ryder Lee (6):
ASoC: mediatek: add some core clocks for MT2701 AFE
ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device
ASoC: mediatek: update MT2701 AFE documentation to adapt mfd device
dt-bindings: clock: mediatek: add "simple-mfd" in audsys documentation
clk: mediatek: update missing clock data for MT7622 audsys
clk: mediatek: add audsys support for MT2701
.../bindings/arm/mediatek/mediatek,audsys.txt | 21 ++- .../devicetree/bindings/sound/mt2701-afe-pcm.txt | 171 +++++++++++--------- drivers/clk/mediatek/Kconfig | 6 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt2701-aud.c | 174 +++++++++++++++++++++ drivers/clk/mediatek/clk-mt7622-aud.c | 3 +- include/dt-bindings/clock/mt7622-clk.h | 3 +- sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c | 30 +++- sound/soc/mediatek/mt2701/mt2701-afe-common.h | 3 + sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 45 +++--- sound/soc/mediatek/mt2701/mt2701-reg.h | 1 - 11 files changed, 345 insertions(+), 113 deletions(-) create mode 100644 drivers/clk/mediatek/clk-mt2701-aud.c
Signature · 1 line
1.9.1
PATCH 1/6 ASoC: mediatek: add some core clocks for MT2701 AFE
Add three core clocks for MT2701 AFE.
--- sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c | 30 ++++++++++++++++++++++- sound/soc/mediatek/mt2701/mt2701-afe-common.h | 3 +++ 2 files changed, 32 insertions(+), 1 deletion(-)
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c +29 -1
@@ -18,8 +18,11 @@#include "mt2701-afe-clock-ctrl.h" static const char *const base_clks[] = { + [MT2701_INFRA_SYS_AUDIO ] ="infra_sys_audio_clk" , [MT2701_TOP_AUD_MCLK_SRC0 ] ="top_audio_mux1_sel" , [MT2701_TOP_AUD_MCLK_SRC1 ] ="top_audio_mux2_sel" , + [MT2701_TOP_AUD_A1SYS ] ="top_audio_a1sys_hp" , + [MT2701_TOP_AUD_A2SYS ] ="top_audio_a2sys_hp" , [MT2701_AUDSYS_AFE ] ="audio_afe_pd" , [MT2701_AUDSYS_AFE_CONN ] ="audio_afe_conn_pd" , [MT2701_AUDSYS_A1SYS ] ="audio_a1sys_pd" ,
@@ -169,10 +172,26 @@ static int mt2701_afe_enable_audsys(struct mtk_base_afe *afe)struct mt2701_afe_private *afe_priv = afe->platform_priv;int ret; - ret =clk_prepare_enable (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +/* Enable infra clock gate */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_INFRA_SYS_AUDIO ]);if (ret)return ret; +/* Enable top a1sys clock gate */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_TOP_AUD_A1SYS ]); +if (ret) + goto err_a1sys; + +/* Enable top a2sys clock gate */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_TOP_AUD_A2SYS ]); +if (ret) + goto err_a2sys; + +/* Internal clock gates */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +if (ret) + goto err_afe; + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_AUDSYS_A1SYS ]);if (ret) goto err_audio_a1sys;
@@ -193,6 +212,12 @@ static int mt2701_afe_enable_audsys(struct mtk_base_afe *afe)clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_A1SYS ]); err_audio_a1sys:clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +err_afe: +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A2SYS ]); +err_a2sys: +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A1SYS ]); +err_a1sys: +clk_disable_unprepare (afe_priv->base_ck[MT2701_INFRA_SYS_AUDIO ]);return ret; }
@@ -205,6 +230,9 @@ static void mt2701_afe_disable_audsys(struct mtk_base_afe *afe)clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_A2SYS ]);clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_A1SYS ]);clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A1SYS ]); +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A2SYS ]); +clk_disable_unprepare (afe_priv->base_ck[MT2701_INFRA_SYS_AUDIO ]); }int mt2701_afe_enable_clock (struct mtk_base_afe *afe)
sound/soc/mediatek/mt2701/mt2701-afe-common.h +3 -0
@@ -61,8 +61,11 @@ enum { };enum audio_base_clock { +MT2701_INFRA_SYS_AUDIO ,MT2701_TOP_AUD_MCLK_SRC0 ,MT2701_TOP_AUD_MCLK_SRC1 , +MT2701_TOP_AUD_A1SYS , +MT2701_TOP_AUD_A2SYS ,MT2701_AUDSYS_AFE ,MT2701_AUDSYS_AFE_CONN ,MT2701_AUDSYS_A1SYS ,
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Mark Brown
maintainerApplied "ASoC: mediatek: add some core clocks for MT2701 AFE" to the asoc tree
The patch
ASoC: mediatek: add some core clocks for MT2701 AFE
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
Quoted 1 line
From
96365d9fdb2f0d81bfc010298289a8c168931cd0Mon Sep 17 00:00:00 2001
From: Ryder Lee <ryder.lee-NuS5LvNUpcJWk0Htik3J/[email protected]>
Date: Thu, 4 Jan 2018 15:44:07 +0800
Subject: [PATCH] ASoC: mediatek: add some core clocks for MT2701 AFE
Add three core clocks for MT2701 AFE.
--- sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c | 30 ++++++++++++++++++++++- sound/soc/mediatek/mt2701/mt2701-afe-common.h | 3 +++ 2 files changed, 32 insertions(+), 1 deletion(-)
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c +29 -1
@@ -18,8 +18,11 @@#include "mt2701-afe-clock-ctrl.h" static const char *const base_clks[] = { + [MT2701_INFRA_SYS_AUDIO ] ="infra_sys_audio_clk" , [MT2701_TOP_AUD_MCLK_SRC0 ] ="top_audio_mux1_sel" , [MT2701_TOP_AUD_MCLK_SRC1 ] ="top_audio_mux2_sel" , + [MT2701_TOP_AUD_A1SYS ] ="top_audio_a1sys_hp" , + [MT2701_TOP_AUD_A2SYS ] ="top_audio_a2sys_hp" , [MT2701_AUDSYS_AFE ] ="audio_afe_pd" , [MT2701_AUDSYS_AFE_CONN ] ="audio_afe_conn_pd" , [MT2701_AUDSYS_A1SYS ] ="audio_a1sys_pd" ,
@@ -169,10 +172,26 @@ static int mt2701_afe_enable_audsys(struct mtk_base_afe *afe)struct mt2701_afe_private *afe_priv = afe->platform_priv;int ret; - ret =clk_prepare_enable (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +/* Enable infra clock gate */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_INFRA_SYS_AUDIO ]);if (ret)return ret; +/* Enable top a1sys clock gate */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_TOP_AUD_A1SYS ]); +if (ret) + goto err_a1sys; + +/* Enable top a2sys clock gate */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_TOP_AUD_A2SYS ]); +if (ret) + goto err_a2sys; + +/* Internal clock gates */ + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +if (ret) + goto err_afe; + ret =clk_prepare_enable (afe_priv->base_ck[MT2701_AUDSYS_A1SYS ]);if (ret) goto err_audio_a1sys;
@@ -193,6 +212,12 @@ static int mt2701_afe_enable_audsys(struct mtk_base_afe *afe)clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_A1SYS ]); err_audio_a1sys:clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +err_afe: +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A2SYS ]); +err_a2sys: +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A1SYS ]); +err_a1sys: +clk_disable_unprepare (afe_priv->base_ck[MT2701_INFRA_SYS_AUDIO ]);return ret; }
@@ -205,6 +230,9 @@ static void mt2701_afe_disable_audsys(struct mtk_base_afe *afe)clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_A2SYS ]);clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_A1SYS ]);clk_disable_unprepare (afe_priv->base_ck[MT2701_AUDSYS_AFE ]); +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A1SYS ]); +clk_disable_unprepare (afe_priv->base_ck[MT2701_TOP_AUD_A2SYS ]); +clk_disable_unprepare (afe_priv->base_ck[MT2701_INFRA_SYS_AUDIO ]); }int mt2701_afe_enable_clock (struct mtk_base_afe *afe)
sound/soc/mediatek/mt2701/mt2701-afe-common.h +3 -0
@@ -61,8 +61,11 @@ enum { };enum audio_base_clock { +MT2701_INFRA_SYS_AUDIO ,MT2701_TOP_AUD_MCLK_SRC0 ,MT2701_TOP_AUD_MCLK_SRC1 , +MT2701_TOP_AUD_A1SYS , +MT2701_TOP_AUD_A2SYS ,MT2701_AUDSYS_AFE ,MT2701_AUDSYS_AFE_CONN ,MT2701_AUDSYS_A1SYS ,
Signature · 1 line
2.15.1
PATCH 2/6 ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device
In reply to Ryder LeeAs the new MFD parent is in place, modify MT2701 AFE driver to adapt it.
--- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 45 +++++++++++++----------------- sound/soc/mediatek/mt2701/mt2701-reg.h | 1 - 2 files changed, 20 insertions(+), 26 deletions(-)
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +20 -25
@@ -17,6 +17,7 @@#include <linux/delay.h> #include <linux/module.h> +#include <linux/mfd/syscon.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/pm_runtime.h>
@@ -1368,14 +1369,6 @@ static int mt2701_irq_fs(struct snd_pcm_substream *substream, unsigned int rate) }, }; -static const struct regmap_config mt2701_afe_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =AFE_END_ADDR , - .cache_type =REGCACHE_NONE , -}; -static irqreturn_t mt2701_asys_isr (int irq_id,void *dev) {int id;
@@ -1414,9 +1407,9 @@ static int mt2701_afe_runtime_resume(struct device *dev)static int mt2701_afe_pcm_dev_probe (struct platform_device *pdev) { +struct snd_soc_component *component;struct mtk_base_afe *afe;struct mt2701_afe_private *afe_priv; -struct resource *res;struct device *dev;int i, irq_id, ret;
@@ -1446,17 +1439,11 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)return ret; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - - afe->base_addr =devm_ioremap_resource (&pdev->dev, res); - -if (IS_ERR (afe->base_addr)) -return PTR_ERR (afe->base_addr); - - afe->regmap =devm_regmap_init_mmio (&pdev->dev, afe->base_addr, - &mt2701_afe_regmap_config); -if (IS_ERR (afe->regmap)) -return PTR_ERR (afe->regmap); + afe->regmap =syscon_node_to_regmap (dev->parent->of_node); +if (!afe->regmap) { +dev_err (dev,"could not get regmap from parent\n" ); +return -ENODEV ; + }mutex_init (&afe->irq_alloc_lock);
@@ -1490,6 +1477,12 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) = &mt2701_i2s_data[i][I2S_IN]; } + component =kzalloc (sizeof (*component),GFP_KERNEL ); +if (!component) +return -ENOMEM ; + + component->regmap = afe->regmap; + afe->mtk_afe_hardware = &mt2701_afe_hardware; afe->memif_fs = mt2701_memif_fs; afe->irq_fs = mt2701_irq_fs;
@@ -1502,7 +1495,7 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) ret =mt2701_init_clock (afe);if (ret) {dev_err (dev,"init clock error\n" ); -return ret; + goto err_init_clock; }platform_set_drvdata (pdev, afe);
@@ -1521,10 +1514,10 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) goto err_platform; } - ret =snd_soc_register_component (&pdev->dev, - &mt2701_afe_pcm_dai_component, - mt2701_afe_pcm_dais, -ARRAY_SIZE (mt2701_afe_pcm_dais)); + ret =snd_soc_add_component (dev, component, + &mt2701_afe_pcm_dai_component, + mt2701_afe_pcm_dais, +ARRAY_SIZE (mt2701_afe_pcm_dais));if (ret) {dev_warn (dev,"err_dai_component\n" ); goto err_dai_component;
@@ -1538,6 +1531,8 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)pm_runtime_put_sync (dev); err_pm_disable:pm_runtime_disable (dev); +err_init_clock: +kfree (component);return ret; }
sound/soc/mediatek/mt2701/mt2701-reg.h +0 -1
@@ -145,5 +145,4 @@#define ASYS_I2S_CON_WIDE_MODE_SET (x) ((x) << 1)#define ASYS_I2S_IN_PHASE_FIX (0x1 << 31) -#define AFE_END_ADDR 0x15e0#endif
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device" to the asoc tree
The patch
ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
Quoted 1 line
From
dfa3cbb83e099d5ef9809b67ea3bff3a39dc2f06Mon Sep 17 00:00:00 2001
From: Ryder Lee <[email protected]>
Date: Thu, 4 Jan 2018 15:44:08 +0800
Subject: [PATCH] ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device
As the new MFD parent is in place, modify MT2701 AFE driver to adapt it.
--- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 45 +++++++++++++----------------- sound/soc/mediatek/mt2701/mt2701-reg.h | 1 - 2 files changed, 20 insertions(+), 26 deletions(-)
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +20 -25
@@ -17,6 +17,7 @@#include <linux/delay.h> #include <linux/module.h> +#include <linux/mfd/syscon.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/pm_runtime.h>
@@ -1368,14 +1369,6 @@ static const struct mt2701_i2s_data mt2701_i2s_data[MT2701_I2S_NUM][2] = { }, }; -static const struct regmap_config mt2701_afe_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =AFE_END_ADDR , - .cache_type =REGCACHE_NONE , -}; -static irqreturn_t mt2701_asys_isr (int irq_id,void *dev) {int id;
@@ -1414,9 +1407,9 @@ static int mt2701_afe_runtime_resume(struct device *dev)static int mt2701_afe_pcm_dev_probe (struct platform_device *pdev) { +struct snd_soc_component *component;struct mtk_base_afe *afe;struct mt2701_afe_private *afe_priv; -struct resource *res;struct device *dev;int i, irq_id, ret;
@@ -1446,17 +1439,11 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)return ret; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - - afe->base_addr =devm_ioremap_resource (&pdev->dev, res); - -if (IS_ERR (afe->base_addr)) -return PTR_ERR (afe->base_addr); - - afe->regmap =devm_regmap_init_mmio (&pdev->dev, afe->base_addr, - &mt2701_afe_regmap_config); -if (IS_ERR (afe->regmap)) -return PTR_ERR (afe->regmap); + afe->regmap =syscon_node_to_regmap (dev->parent->of_node); +if (!afe->regmap) { +dev_err (dev,"could not get regmap from parent\n" ); +return -ENODEV ; + }mutex_init (&afe->irq_alloc_lock);
@@ -1490,6 +1477,12 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) = &mt2701_i2s_data[i][I2S_IN]; } + component =kzalloc (sizeof (*component),GFP_KERNEL ); +if (!component) +return -ENOMEM ; + + component->regmap = afe->regmap; + afe->mtk_afe_hardware = &mt2701_afe_hardware; afe->memif_fs = mt2701_memif_fs; afe->irq_fs = mt2701_irq_fs;
@@ -1502,7 +1495,7 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) ret =mt2701_init_clock (afe);if (ret) {dev_err (dev,"init clock error\n" ); -return ret; + goto err_init_clock; }platform_set_drvdata (pdev, afe);
@@ -1521,10 +1514,10 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) goto err_platform; } - ret =snd_soc_register_component (&pdev->dev, - &mt2701_afe_pcm_dai_component, - mt2701_afe_pcm_dais, -ARRAY_SIZE (mt2701_afe_pcm_dais)); + ret =snd_soc_add_component (dev, component, + &mt2701_afe_pcm_dai_component, + mt2701_afe_pcm_dais, +ARRAY_SIZE (mt2701_afe_pcm_dais));if (ret) {dev_warn (dev,"err_dai_component\n" ); goto err_dai_component;
@@ -1538,6 +1531,8 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)pm_runtime_put_sync (dev); err_pm_disable:pm_runtime_disable (dev); +err_init_clock: +kfree (component);return ret; }
sound/soc/mediatek/mt2701/mt2701-reg.h +0 -1
@@ -145,5 +145,4 @@#define ASYS_I2S_CON_WIDE_MODE_SET (x) ((x) << 1)#define ASYS_I2S_IN_PHASE_FIX (0x1 << 31) -#define AFE_END_ADDR 0x15e0#endif
Signature · 1 line
2.15.1
PATCH 3/6 ASoC: mediatek: update MT2701 AFE documentation to adapt mfd device
In reply to Ryder LeeAs the new MFD parent is in place, modify MT2701 AFE documentation to adapt it. Also add three core clocks in example.
--- .../devicetree/bindings/sound/mt2701-afe-pcm.txt | 171 +++++++++++---------- 1 file changed, 93 insertions(+), 78 deletions(-)
Documentation/devicetree/bindings/sound/mt2701-afe-pcm.txt +93 -78
@@ -2,15 +2,17 @@ Mediatek AFE PCM controller for mt2701 Required properties: - compatible = "mediatek,mt2701-audio"; -- reg: register location and size - interrupts: should contain AFE and ASYS interrupts - interrupt-names: should be "afe" and "asys" - power-domains: should define the power domain - clocks: Must contain an entry for each entry in clock-names See ../clocks/clock-bindings.txt for details - clock-names: should have these clock names: + "infra_sys_audio_clk", "top_audio_mux1_sel", "top_audio_mux2_sel", + "top_audio_a1sys_hp", + "top_audio_a2sys_hp", "i2s0_src_sel", "i2s1_src_sel", "i2s2_src_sel",
@@ -45,85 +47,98 @@ Required properties: - assigned-clocks-parents: parent of input clocks of assigned clocks. - assigned-clock-rates: list of clock frequencies of assigned clocks. +Must be a subnode of MediaTek audsys device tree node. +See ../arm/mediatek/mediatek,audsys.txt for details about the parent node. + Example: - afe: mt2701-afe-pcm at 11220000 { - compatible = "mediatek,mt2701-audio"; - reg = <0 0x11220000 0 0x2000>, - <0 0x112A0000 0 0x20000>; - interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>, - <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>; - interrupt-names = "afe", "asys"; - power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; - clocks = <&topckgen CLK_TOP_AUD_MUX1_SEL>, - <&topckgen CLK_TOP_AUD_MUX2_SEL>, - <&topckgen CLK_TOP_AUD_K1_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K2_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K3_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K4_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K1_SRC_DIV>, - <&topckgen CLK_TOP_AUD_K2_SRC_DIV>, - <&topckgen CLK_TOP_AUD_K3_SRC_DIV>, - <&topckgen CLK_TOP_AUD_K4_SRC_DIV>, - <&topckgen CLK_TOP_AUD_I2S1_MCLK>, - <&topckgen CLK_TOP_AUD_I2S2_MCLK>, - <&topckgen CLK_TOP_AUD_I2S3_MCLK>, - <&topckgen CLK_TOP_AUD_I2S4_MCLK>, - <&audiosys CLK_AUD_I2SO1>, - <&audiosys CLK_AUD_I2SO2>, - <&audiosys CLK_AUD_I2SO3>, - <&audiosys CLK_AUD_I2SO4>, - <&audiosys CLK_AUD_I2SIN1>, - <&audiosys CLK_AUD_I2SIN2>, - <&audiosys CLK_AUD_I2SIN3>, - <&audiosys CLK_AUD_I2SIN4>, - <&audiosys CLK_AUD_ASRCO1>, - <&audiosys CLK_AUD_ASRCO2>, - <&audiosys CLK_AUD_ASRCO3>, - <&audiosys CLK_AUD_ASRCO4>, - <&audiosys CLK_AUD_AFE>, - <&audiosys CLK_AUD_AFE_CONN>, - <&audiosys CLK_AUD_A1SYS>, - <&audiosys CLK_AUD_A2SYS>, - <&audiosys CLK_AUD_AFE_MRGIF>; + audsys: audio-subsystem at 11220000 { + compatible = "mediatek,mt2701-audsys", "syscon", "simple-mfd"; + ... + + afe: audio-controller { + compatible = "mediatek,mt2701-audio"; + interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>, + <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "afe", "asys"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; + + clocks = <&infracfg CLK_INFRA_AUDIO>, + <&topckgen CLK_TOP_AUD_MUX1_SEL>, + <&topckgen CLK_TOP_AUD_MUX2_SEL>, + <&topckgen CLK_TOP_AUD_48K_TIMING>, + <&topckgen CLK_TOP_AUD_44K_TIMING>, + <&topckgen CLK_TOP_AUD_K1_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K2_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K3_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K4_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K1_SRC_DIV>, + <&topckgen CLK_TOP_AUD_K2_SRC_DIV>, + <&topckgen CLK_TOP_AUD_K3_SRC_DIV>, + <&topckgen CLK_TOP_AUD_K4_SRC_DIV>, + <&topckgen CLK_TOP_AUD_I2S1_MCLK>, + <&topckgen CLK_TOP_AUD_I2S2_MCLK>, + <&topckgen CLK_TOP_AUD_I2S3_MCLK>, + <&topckgen CLK_TOP_AUD_I2S4_MCLK>, + <&audsys CLK_AUD_I2SO1>, + <&audsys CLK_AUD_I2SO2>, + <&audsys CLK_AUD_I2SO3>, + <&audsys CLK_AUD_I2SO4>, + <&audsys CLK_AUD_I2SIN1>, + <&audsys CLK_AUD_I2SIN2>, + <&audsys CLK_AUD_I2SIN3>, + <&audsys CLK_AUD_I2SIN4>, + <&audsys CLK_AUD_ASRCO1>, + <&audsys CLK_AUD_ASRCO2>, + <&audsys CLK_AUD_ASRCO3>, + <&audsys CLK_AUD_ASRCO4>, + <&audsys CLK_AUD_AFE>, + <&audsys CLK_AUD_AFE_CONN>, + <&audsys CLK_AUD_A1SYS>, + <&audsys CLK_AUD_A2SYS>, + <&audsys CLK_AUD_AFE_MRGIF>; - clock-names = "top_audio_mux1_sel", - "top_audio_mux2_sel", - "i2s0_src_sel", - "i2s1_src_sel", - "i2s2_src_sel", - "i2s3_src_sel", - "i2s0_src_div", - "i2s1_src_div", - "i2s2_src_div", - "i2s3_src_div", - "i2s0_mclk_en", - "i2s1_mclk_en", - "i2s2_mclk_en", - "i2s3_mclk_en", - "i2so0_hop_ck", - "i2so1_hop_ck", - "i2so2_hop_ck", - "i2so3_hop_ck", - "i2si0_hop_ck", - "i2si1_hop_ck", - "i2si2_hop_ck", - "i2si3_hop_ck", - "asrc0_out_ck", - "asrc1_out_ck", - "asrc2_out_ck", - "asrc3_out_ck", - "audio_afe_pd", - "audio_afe_conn_pd", - "audio_a1sys_pd", - "audio_a2sys_pd", - "audio_mrgif_pd"; + clock-names = "infra_sys_audio_clk", + "top_audio_mux1_sel", + "top_audio_mux2_sel", + "top_audio_a1sys_hp", + "top_audio_a2sys_hp", + "i2s0_src_sel", + "i2s1_src_sel", + "i2s2_src_sel", + "i2s3_src_sel", + "i2s0_src_div", + "i2s1_src_div", + "i2s2_src_div", + "i2s3_src_div", + "i2s0_mclk_en", + "i2s1_mclk_en", + "i2s2_mclk_en", + "i2s3_mclk_en", + "i2so0_hop_ck", + "i2so1_hop_ck", + "i2so2_hop_ck", + "i2so3_hop_ck", + "i2si0_hop_ck", + "i2si1_hop_ck", + "i2si2_hop_ck", + "i2si3_hop_ck", + "asrc0_out_ck", + "asrc1_out_ck", + "asrc2_out_ck", + "asrc3_out_ck", + "audio_afe_pd", + "audio_afe_conn_pd", + "audio_a1sys_pd", + "audio_a2sys_pd", + "audio_mrgif_pd"; - assigned-clocks = <&topckgen CLK_TOP_AUD_MUX1_SEL>, - <&topckgen CLK_TOP_AUD_MUX2_SEL>, - <&topckgen CLK_TOP_AUD_MUX1_DIV>, - <&topckgen CLK_TOP_AUD_MUX2_DIV>; - assigned-clock-parents = <&topckgen CLK_TOP_AUD1PLL_98M>, - <&topckgen CLK_TOP_AUD2PLL_90M>; - assigned-clock-rates = <0>, <0>, <49152000>, <45158400>; + assigned-clocks = <&topckgen CLK_TOP_AUD_MUX1_SEL>, + <&topckgen CLK_TOP_AUD_MUX2_SEL>, + <&topckgen CLK_TOP_AUD_MUX1_DIV>, + <&topckgen CLK_TOP_AUD_MUX2_DIV>; + assigned-clock-parents = <&topckgen CLK_TOP_AUD1PLL_98M>, + <&topckgen CLK_TOP_AUD2PLL_90M>; + assigned-clock-rates = <0>, <0>, <49152000>, <45158400>; + }; };
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: mediatek: update MT2701 AFE documentation to adapt mfd device" to the asoc tree
The patch
ASoC: mediatek: update MT2701 AFE documentation to adapt mfd device
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
Quoted 1 line
From
7f12a56367bf526afde7e81820a8c7d97e75ed10Mon Sep 17 00:00:00 2001
From: Ryder Lee <ryder.lee-NuS5LvNUpcJWk0Htik3J/[email protected]>
Date: Thu, 4 Jan 2018 15:44:09 +0800
Subject: [PATCH] ASoC: mediatek: update MT2701 AFE documentation to adapt mfd
device
As the new MFD parent is in place, modify MT2701 AFE documentation to adapt it. Also add three core clocks in example.
--- .../devicetree/bindings/sound/mt2701-afe-pcm.txt | 171 +++++++++++---------- 1 file changed, 93 insertions(+), 78 deletions(-)
Documentation/devicetree/bindings/sound/mt2701-afe-pcm.txt +93 -78
@@ -2,15 +2,17 @@ Mediatek AFE PCM controller for mt2701 Required properties: - compatible = "mediatek,mt2701-audio"; -- reg: register location and size - interrupts: should contain AFE and ASYS interrupts - interrupt-names: should be "afe" and "asys" - power-domains: should define the power domain - clocks: Must contain an entry for each entry in clock-names See ../clocks/clock-bindings.txt for details - clock-names: should have these clock names: + "infra_sys_audio_clk", "top_audio_mux1_sel", "top_audio_mux2_sel", + "top_audio_a1sys_hp", + "top_audio_a2sys_hp", "i2s0_src_sel", "i2s1_src_sel", "i2s2_src_sel",
@@ -45,85 +47,98 @@ Required properties: - assigned-clocks-parents: parent of input clocks of assigned clocks. - assigned-clock-rates: list of clock frequencies of assigned clocks. +Must be a subnode of MediaTek audsys device tree node. +See ../arm/mediatek/mediatek,audsys.txt for details about the parent node. + Example: - afe: mt2701-afe-pcm@11220000 { - compatible = "mediatek,mt2701-audio"; - reg = <0 0x11220000 0 0x2000>, - <0 0x112A0000 0 0x20000>; - interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>, - <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>; - interrupt-names = "afe", "asys"; - power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; - clocks = <&topckgen CLK_TOP_AUD_MUX1_SEL>, - <&topckgen CLK_TOP_AUD_MUX2_SEL>, - <&topckgen CLK_TOP_AUD_K1_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K2_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K3_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K4_SRC_SEL>, - <&topckgen CLK_TOP_AUD_K1_SRC_DIV>, - <&topckgen CLK_TOP_AUD_K2_SRC_DIV>, - <&topckgen CLK_TOP_AUD_K3_SRC_DIV>, - <&topckgen CLK_TOP_AUD_K4_SRC_DIV>, - <&topckgen CLK_TOP_AUD_I2S1_MCLK>, - <&topckgen CLK_TOP_AUD_I2S2_MCLK>, - <&topckgen CLK_TOP_AUD_I2S3_MCLK>, - <&topckgen CLK_TOP_AUD_I2S4_MCLK>, - <&audiosys CLK_AUD_I2SO1>, - <&audiosys CLK_AUD_I2SO2>, - <&audiosys CLK_AUD_I2SO3>, - <&audiosys CLK_AUD_I2SO4>, - <&audiosys CLK_AUD_I2SIN1>, - <&audiosys CLK_AUD_I2SIN2>, - <&audiosys CLK_AUD_I2SIN3>, - <&audiosys CLK_AUD_I2SIN4>, - <&audiosys CLK_AUD_ASRCO1>, - <&audiosys CLK_AUD_ASRCO2>, - <&audiosys CLK_AUD_ASRCO3>, - <&audiosys CLK_AUD_ASRCO4>, - <&audiosys CLK_AUD_AFE>, - <&audiosys CLK_AUD_AFE_CONN>, - <&audiosys CLK_AUD_A1SYS>, - <&audiosys CLK_AUD_A2SYS>, - <&audiosys CLK_AUD_AFE_MRGIF>; + audsys: audio-subsystem@11220000 { + compatible = "mediatek,mt2701-audsys", "syscon", "simple-mfd"; + ... + + afe: audio-controller { + compatible = "mediatek,mt2701-audio"; + interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>, + <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "afe", "asys"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; + + clocks = <&infracfg CLK_INFRA_AUDIO>, + <&topckgen CLK_TOP_AUD_MUX1_SEL>, + <&topckgen CLK_TOP_AUD_MUX2_SEL>, + <&topckgen CLK_TOP_AUD_48K_TIMING>, + <&topckgen CLK_TOP_AUD_44K_TIMING>, + <&topckgen CLK_TOP_AUD_K1_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K2_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K3_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K4_SRC_SEL>, + <&topckgen CLK_TOP_AUD_K1_SRC_DIV>, + <&topckgen CLK_TOP_AUD_K2_SRC_DIV>, + <&topckgen CLK_TOP_AUD_K3_SRC_DIV>, + <&topckgen CLK_TOP_AUD_K4_SRC_DIV>, + <&topckgen CLK_TOP_AUD_I2S1_MCLK>, + <&topckgen CLK_TOP_AUD_I2S2_MCLK>, + <&topckgen CLK_TOP_AUD_I2S3_MCLK>, + <&topckgen CLK_TOP_AUD_I2S4_MCLK>, + <&audsys CLK_AUD_I2SO1>, + <&audsys CLK_AUD_I2SO2>, + <&audsys CLK_AUD_I2SO3>, + <&audsys CLK_AUD_I2SO4>, + <&audsys CLK_AUD_I2SIN1>, + <&audsys CLK_AUD_I2SIN2>, + <&audsys CLK_AUD_I2SIN3>, + <&audsys CLK_AUD_I2SIN4>, + <&audsys CLK_AUD_ASRCO1>, + <&audsys CLK_AUD_ASRCO2>, + <&audsys CLK_AUD_ASRCO3>, + <&audsys CLK_AUD_ASRCO4>, + <&audsys CLK_AUD_AFE>, + <&audsys CLK_AUD_AFE_CONN>, + <&audsys CLK_AUD_A1SYS>, + <&audsys CLK_AUD_A2SYS>, + <&audsys CLK_AUD_AFE_MRGIF>; - clock-names = "top_audio_mux1_sel", - "top_audio_mux2_sel", - "i2s0_src_sel", - "i2s1_src_sel", - "i2s2_src_sel", - "i2s3_src_sel", - "i2s0_src_div", - "i2s1_src_div", - "i2s2_src_div", - "i2s3_src_div", - "i2s0_mclk_en", - "i2s1_mclk_en", - "i2s2_mclk_en", - "i2s3_mclk_en", - "i2so0_hop_ck", - "i2so1_hop_ck", - "i2so2_hop_ck", - "i2so3_hop_ck", - "i2si0_hop_ck", - "i2si1_hop_ck", - "i2si2_hop_ck", - "i2si3_hop_ck", - "asrc0_out_ck", - "asrc1_out_ck", - "asrc2_out_ck", - "asrc3_out_ck", - "audio_afe_pd", - "audio_afe_conn_pd", - "audio_a1sys_pd", - "audio_a2sys_pd", - "audio_mrgif_pd"; + clock-names = "infra_sys_audio_clk", + "top_audio_mux1_sel", + "top_audio_mux2_sel", + "top_audio_a1sys_hp", + "top_audio_a2sys_hp", + "i2s0_src_sel", + "i2s1_src_sel", + "i2s2_src_sel", + "i2s3_src_sel", + "i2s0_src_div", + "i2s1_src_div", + "i2s2_src_div", + "i2s3_src_div", + "i2s0_mclk_en", + "i2s1_mclk_en", + "i2s2_mclk_en", + "i2s3_mclk_en", + "i2so0_hop_ck", + "i2so1_hop_ck", + "i2so2_hop_ck", + "i2so3_hop_ck", + "i2si0_hop_ck", + "i2si1_hop_ck", + "i2si2_hop_ck", + "i2si3_hop_ck", + "asrc0_out_ck", + "asrc1_out_ck", + "asrc2_out_ck", + "asrc3_out_ck", + "audio_afe_pd", + "audio_afe_conn_pd", + "audio_a1sys_pd", + "audio_a2sys_pd", + "audio_mrgif_pd"; - assigned-clocks = <&topckgen CLK_TOP_AUD_MUX1_SEL>, - <&topckgen CLK_TOP_AUD_MUX2_SEL>, - <&topckgen CLK_TOP_AUD_MUX1_DIV>, - <&topckgen CLK_TOP_AUD_MUX2_DIV>; - assigned-clock-parents = <&topckgen CLK_TOP_AUD1PLL_98M>, - <&topckgen CLK_TOP_AUD2PLL_90M>; - assigned-clock-rates = <0>, <0>, <49152000>, <45158400>; + assigned-clocks = <&topckgen CLK_TOP_AUD_MUX1_SEL>, + <&topckgen CLK_TOP_AUD_MUX2_SEL>, + <&topckgen CLK_TOP_AUD_MUX1_DIV>, + <&topckgen CLK_TOP_AUD_MUX2_DIV>; + assigned-clock-parents = <&topckgen CLK_TOP_AUD1PLL_98M>, + <&topckgen CLK_TOP_AUD2PLL_90M>; + assigned-clock-rates = <0>, <0>, <49152000>, <45158400>; + }; };
Signature · 6 lines
2.15.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/6 dt-bindings: clock: mediatek: add "simple-mfd" in audsys documentation
In reply to Ryder LeeAdd "simple-mfd" to support MFD device and add a compatible string for MT2701.
--- .../bindings/arm/mediatek/mediatek,audsys.txt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +14 -6
@@ -6,17 +6,25 @@ The MediaTek AUDSYS controller provides various clocks to the system. Required Properties: - compatible: Should be one of: - - "mediatek,mt7622-audsys", "syscon" + - "mediatek,mt2701-audsys", "syscon", "simple-mfd" + - "mediatek,mt7622-audsys", "syscon", "simple-mfd" - #clock-cells: Must be 1 The AUDSYS controller uses the common clk binding from Documentation/devicetree/bindings/clock/clock-bindings.txt The available clocks are defined in dt-bindings/clock/mt*-clk.h. +See ../sound/mt2701-afe-pcm.txt for details about required subnode. + Example: -audsys: audsys at 11220000 { - compatible = "mediatek,mt7622-audsys", "syscon"; - reg = <0 0x11220000 0 0x1000>; - #clock-cells = <1>; -}; + audsys: audio-subsystem at 11220000 { + compatible = "mediatek,mt2701-audsys", "syscon", "simple-mfd"; + reg = <0 0x11220000 0 0x1000>; + #clock-cells = <1>; + + afe: audio-controller { + compatible = "mediatek,mt2701-audio"; + ... + }; + };
Signature · 1 line
1.9.1
Rob Herring
maintainerRe: [PATCH v1 4/6] dt-bindings: clock: mediatek: add "simple-mfd" in audsys documentation
Quoted 12 lines · Ryder Lee
Add "simple-mfd" to support MFD device and add a compatible string for MT2701.
Signed-off-by Ryder Lee <[email protected]>--- .../bindings/arm/mediatek/mediatek,audsys.txt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +0
-0
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt The MediaTek AUDSYS controller provides various clocks to the system. · line 11
Quoted 7 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +2
-1@@ -6,17 +6,25 @@ The MediaTek AUDSYS controller provides various clocks to the system. Required Properties: - compatible: Should be one of: - - "mediatek,mt7622-audsys", "syscon" + - "mediatek,mt2701-audsys", "syscon", "simple-mfd" + - "mediatek,mt7622-audsys", "syscon", "simple-mfd" - #clock-cells: Must be 1
I don't think this is a simple-mfd. The AFE uses clocks created by its parent, right? So the parent should be probed first. You should have the parent instantiate the child nodes.
Quoted 30 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +12
-5The AUDSYS controller uses the common clk binding from Documentation/devicetree/bindings/clock/clock-bindings.txt The available clocks are defined in dt-bindings/clock/mt*-clk.h. +See ../sound/mt2701-afe-pcm.txt for details about required subnode. + Example: -audsys: audsys at 11220000 { - compatible = "mediatek,mt7622-audsys", "syscon"; - reg = <0 0x11220000 0 0x1000>; - #clock-cells = <1>; -}; + audsys: audio-subsystem at 11220000 { + compatible = "mediatek,mt2701-audsys", "syscon", "simple-mfd"; + reg = <0 0x11220000 0 0x1000>; + #clock-cells = <1>; + + afe: audio-controller { + compatible = "mediatek,mt2701-audio"; + ... + }; + };Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v1 4/6] dt-bindings: clock: mediatek: add "simple-mfd" in audsys documentation
Quoted 15 lines · Rob Herring
Quoted 14 lines · Ryder Lee
Add "simple-mfd" to support MFD device and add a compatible string for MT2701.
Signed-off-by Ryder Lee <[email protected]>--- .../bindings/arm/mediatek/mediatek,audsys.txt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +0
-0@@ -6,17 +6,25 @@ The MediaTek AUDSYS controller provides various clocks to the system. Required Properties:
Quoted 9 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt The MediaTek AUDSYS controller provides various clocks to the system. · line 11
Quoted 5 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +2
-1- compatible: Should be one of: - - "mediatek,mt7622-audsys", "syscon" + - "mediatek,mt2701-audsys", "syscon", "simple-mfd" + - "mediatek,mt7622-audsys", "syscon", "simple-mfd" - #clock-cells: Must be 1I don't think this is a simple-mfd. The AFE uses clocks created by its parent, right? So the parent should be probed first. You should have the parent instantiate the child nodes.
The reason I add simple-mfd here is to make sure all drivers are probed. We don't need to know the probing sequence but let *deferred probing* to handle that. Otherwise, I think there is no difference between audsys and other clock nodes (the only difference is audsys shares its register regions with AFE).
But yes, parent should be probed first in general. How about this:
audio-subsystem at 11220000 {
compatible = "syscon", "simple-mfd";
reg = <0 0x11220000 0 0x2000>;
audsys: clock-controller {
compatible = "mediatek,mt2701-audsys";
#clock-cells = <1>;
};
afe: audio-controller {
compatible = "mediatek,mt2701-audio";
.....
<&topckgen CLK_TOP_AUD_I2S4_MCLK>,
<&audsys CLK_AUD_I2SO1>,
....
};
};I prefer to separate these nodes as we could see them as unrelated functions. Or, alternatively, I could add a MFD driver to instantiate both audsys and AFE driver.
The similar discussion thread could be found in other subsystem:
http://lists.infradead.org/pipermail/linux-mediatek/2017-October/011035.html
I want to come up with a consistent approach to handle this kind of situation.
Quoted 30 lines
Quoted 30 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +12
-5The AUDSYS controller uses the common clk binding from Documentation/devicetree/bindings/clock/clock-bindings.txt The available clocks are defined in dt-bindings/clock/mt*-clk.h. +See ../sound/mt2701-afe-pcm.txt for details about required subnode. + Example: -audsys: audsys at 11220000 { - compatible = "mediatek,mt7622-audsys", "syscon"; - reg = <0 0x11220000 0 0x1000>; - #clock-cells = <1>; -}; + audsys: audio-subsystem at 11220000 { + compatible = "mediatek,mt2701-audsys", "syscon", "simple-mfd"; + reg = <0 0x11220000 0 0x1000>; + #clock-cells = <1>; + + afe: audio-controller { + compatible = "mediatek,mt2701-audio"; + ... + }; + };Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/6 clk: mediatek: update missing clock data for MT7622 audsys
In reply to Ryder LeeAdd missing clock data 'CLK_AUDIO_AFE_CONN' for MT7622 audsys.
--- drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++- include/dt-bindings/clock/mt7622-clk.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/clk/mediatek/clk-mt7622-aud.c +2 -1
@@ -106,6 +106,7 @@GATE_AUDIO1 (CLK_AUDIO_INTDIR ,"audio_intdir" ,"intdir_sel" ,20 ),GATE_AUDIO1 (CLK_AUDIO_A1SYS ,"audio_a1sys" ,"a1sys_hp_sel" ,21 ),GATE_AUDIO1 (CLK_AUDIO_A2SYS ,"audio_a2sys" ,"a2sys_hp_sel" ,22 ), +GATE_AUDIO1 (CLK_AUDIO_AFE_CONN ,"audio_afe_conn" ,"a1sys_hp_sel" ,23 ),/* AUDIO2 */ GATE_AUDIO2 (CLK_AUDIO_UL1 ,"audio_ul1" ,"a1sys_hp_sel" ,0 ), GATE_AUDIO2(CLK_AUDIO_UL2, "audio_ul2", "a1sys_hp_sel", 1),
@@ -146,7 +147,7 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev) clk_data =mtk_alloc_clk_data (CLK_AUDIO_NR_CLK );mtk_clk_register_gates (node, audio_clks,ARRAY_SIZE (audio_clks), - clk_data); + clk_data); r =of_clk_add_provider (node, of_clk_src_onecell_get, clk_data);if (r)
include/dt-bindings/clock/mt7622-clk.h +2 -1
@@ -235,7 +235,8 @@#define CLK_AUDIO_MEM_ASRC3 43#define CLK_AUDIO_MEM_ASRC4 44#define CLK_AUDIO_MEM_ASRC5 45 -#define CLK_AUDIO_NR_CLK 46 +#define CLK_AUDIO_AFE_CONN 46 +#define CLK_AUDIO_NR_CLK 47/* SSUSBSYS */
Signature · 1 line
1.9.1
Rob Herring
maintainerRe: [PATCH v1 5/6] clk: mediatek: update missing clock data for MT7622 audsys
Quoted 21 lines · Ryder Lee
Add missing clock data '
CLK_AUDIO_AFE_CONN' for MT7622 audsys.Signed-off-by Ryder Lee <[email protected]>--- drivers/clk/mediatek/clk-mt7622-aud.c | 3 ++- include/dt-bindings/clock/mt7622-clk.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/clk/mediatek/clk-mt7622-aud.c +1
-0@@ -106,6 +106,7 @@GATE_AUDIO1 (CLK_AUDIO_INTDIR ,"audio_intdir" ,"intdir_sel" ,20 ),GATE_AUDIO1 (CLK_AUDIO_A1SYS ,"audio_a1sys" ,"a1sys_hp_sel" ,21 ),GATE_AUDIO1 (CLK_AUDIO_A2SYS ,"audio_a2sys" ,"a2sys_hp_sel" ,22 ), +GATE_AUDIO1 (CLK_AUDIO_AFE_CONN ,"audio_afe_conn" ,"a1sys_hp_sel" ,23 ),/* AUDIO2 */ GATE_AUDIO2 (CLK_AUDIO_UL1 ,"audio_ul1" ,"a1sys_hp_sel" ,0 ), GATE_AUDIO2(CLK_AUDIO_UL2, "audio_ul2", "a1sys_hp_sel", 1),
drivers/clk/mediatek/clk-mt7622-aud.c static int clk_mt7622_audiosys_init(struct platform_device *pdev) · line 150
Quoted 5 lines
drivers/clk/mediatek/clk-mt7622-aud.c +1
-1@@ -146,7 +147,7 @@ static int clk_mt7622_audiosys_init(struct platform_device *pdev) clk_data =mtk_alloc_clk_data (CLK_AUDIO_NR_CLK );mtk_clk_register_gates (node, audio_clks,ARRAY_SIZE (audio_clks), - clk_data); + clk_data);
Drop this unrelated change.
Quoted 24 lines
drivers/clk/mediatek/clk-mt7622-aud.c +0
-0r =of_clk_add_provider (node, of_clk_src_onecell_get, clk_data);if (r)include/dt-bindings/clock/mt7622-clk.h +2
-1@@ -235,7 +235,8 @@#define CLK_AUDIO_MEM_ASRC3 43#define CLK_AUDIO_MEM_ASRC4 44#define CLK_AUDIO_MEM_ASRC5 45 -#define CLK_AUDIO_NR_CLK 46 +#define CLK_AUDIO_AFE_CONN 46 +#define CLK_AUDIO_NR_CLK 47/* SSUSBSYS */ Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/6 clk: mediatek: add audsys support for MT2701
In reply to Ryder LeeAdd clock driver support for MT2701 audsys.
--- drivers/clk/mediatek/Kconfig | 6 ++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt2701-aud.c | 174 ++++++++++++++++++++++++++++++++++ 3 files changed, 181 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt2701-aud.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -50,6 +50,12 @@ config COMMON_CLK_MT2701_BDPSYS ---help--- This driver supports Mediatek MT2701 bdpsys clocks. +config COMMON_CLK_MT2701_AUDSYS + bool "Clock driver for Mediatek MT2701 audsys" + depends on COMMON_CLK_MT2701 + ---help--- + This driver supports Mediatek MT2701 audsys clocks. + config COMMON_CLK_MT2712 bool "Clock driver for Mediatek MT2712" depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_COMMON_CLK_MT6797_MMSYS) += clk-mt6797-mm.o obj-$(CONFIG_COMMON_CLK_MT6797_VDECSYS) += clk-mt6797-vdec.o obj-$(CONFIG_COMMON_CLK_MT6797_VENCSYS) += clk-mt6797-venc.o obj-$(CONFIG_COMMON_CLK_MT2701) += clk-mt2701.o +obj-$(CONFIG_COMMON_CLK_MT2701_AUDSYS) += clk-mt2701-aud.o obj-$(CONFIG_COMMON_CLK_MT2701_BDPSYS) += clk-mt2701-bdp.o obj-$(CONFIG_COMMON_CLK_MT2701_ETHSYS) += clk-mt2701-eth.o obj-$(CONFIG_COMMON_CLK_MT2701_HIFSYS) += clk-mt2701-hif.o
drivers/clk/mediatek/clk-mt2701-aud.c new file +174 -0
174 lines not on this page · raw message
Signature · 1 line
1.9.1