RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
Hi Xiubo Li Lars-Peter has point out the root cause. It is caused by the SND_SOC_FSL_ASOC_CARD, which will select SND_SOC_IMX_PCM_DMA. Thank you very much anyway. Best regards Wang shengjiu -Original Message- From: Xiubo Li-B47053 Sent: Tuesday, August 19, 2014 5:00 PM To: Wang Shengjiu-B02247 Cc: Lars-Peter Clausen; lgirdw...@gmail.com; broo...@kernel.org; pe...@perex.cz; ti...@suse.de; nicoleots...@gmail.com; shc_w...@mail.ru; Estevam Fabio-R49496; x...@kosagi.com; a...@arndb.de; s...@canb.auug.org.au; ti...@tabi.org; alsa-de...@alsa-project.org; linuxppc-...@lists.ozlabs.org; linux-kernel@vger.kernel.org Subject: RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA How about the following : diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 5ae777a..d42f18c 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -15,7 +15,7 @@ config SND_SOC_FSL_ASRC config SND_SOC_FSL_SAI tristate "Synchronous Audio Interface (SAI) module support" select REGMAP_MMIO - select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n + select SND_SOC_IMX_PCM_DMA select SND_SOC_GENERIC_DMAENGINE_PCM help Say Y if you want to add Synchronous Audio Interface (SAI) @@ -25,7 +25,7 @@ config SND_SOC_FSL_SAI config SND_SOC_FSL_SSI tristate "Synchronous Serial Interface module support" - select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n + select SND_SOC_IMX_PCM_DMA select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n && (MXC_TZIC || MXC_AVIC) select REGMAP_MMIO help @@ -37,7 +37,7 @@ config SND_SOC_FSL_SSI config SND_SOC_FSL_SPDIF tristate "Sony/Philips Digital Interface module support" select REGMAP_MMIO - select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n + select SND_SOC_IMX_PCM_DMA select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n && (MXC_TZIC || MXC_AVIC) help Say Y if you want to add Sony/Philips Digital Interface (SPDIF) @@ -48,7 +48,7 @@ config SND_SOC_FSL_SPDIF config SND_SOC_FSL_ESAI tristate "Enhanced Serial Audio Interface (ESAI) module support" select REGMAP_MMIO - select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n + select SND_SOC_IMX_PCM_DMA help Say Y if you want to add Enhanced Synchronous Audio Interface (ESAI) support for the Freescale CPUs. @@ -76,6 +76,7 @@ config SND_SOC_FSL_ASOC_CARD config SND_SOC_IMX_PCM_DMA tristate + depends on SND_IMX_SOC select SND_SOC_GENERIC_DMAENGINE_PCM config SND_SOC_IMX_AUDMUX Thanks, BRs Xiubo > -Original Message- > From: Shengjiu Wang [mailto:shengjiu.w...@freescale.com] > Sent: Tuesday, August 19, 2014 4:21 PM > To: Xiubo Li-B47053 > Cc: Lars-Peter Clausen; lgirdw...@gmail.com; broo...@kernel.org; > pe...@perex.cz; ti...@suse.de; nicoleots...@gmail.com; > shc_w...@mail.ru; Estevam Fabio-R49496; x...@kosagi.com; > a...@arndb.de; s...@canb.auug.org.au; ti...@tabi.org; > alsa-de...@alsa-project.org; linuxppc-...@lists.ozlabs.org; > linux-kernel@vger.kernel.org > Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove > dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA > > On Tue, Aug 19, 2014 at 04:13:15PM +0800, Xiubo Li-B47053 wrote: > > > Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: > > > remove > dependence > > > of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA > > > > > > On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote: > > > > On 08/18/2014 10:38 AM, Shengjiu Wang wrote: > > > > >Build kernel with SND_SOC_IMC_PCM_DMA=m && SND_IMX_SOC=n leads > > > > >the > > > following > > > > >error: > > > > > > > > > >sound/built-in.o: In function `fsl_sai_probe': > > > > >>>fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init' > > > > >sound/built-in.o: In function `fsl_esai_probe': > > > > >>>fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init' > > > > > > > > > >Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' > which is > > > > >defined in imx-pcm-dma.c, so need to select > > > > >SND_SOC_IMX_PCM_DMA, but it > > > depends > > > > >on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will > > > > >not be selected. > > > > >So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA. > > > > > > > > > >Reported-by: kbuild test robot > > > > >Signed-off-by: Shengjiu Wang > > > > > > > > Those if conditions where just added[1] by Arnd to avoid other > > > > build failures. So just removing them again makes little sense. > > > > > > > > As far as I can see imx_pcm_dma_init() should be stubbed out > > > > when SND_SOC_IMX_PCM_DMA is not selected. So what's going on here? > > > > > > > > [1] > > > > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/ > ?id=ff40 > > > 260f79dc0436604452bccd449bffd25ebafb > > > > > > > Lars-Peter
RE: [PATCH V2 2/3] ARM: clk-imx6q: Add missing lvds and anaclk clock to the clock tree
Hi Stash, Shawn Do we have such API for exclusive clock? Or Do you have example for these exclusive clocks? Best regards Wang shengjiu -Original Message- From: Lucas Stach [mailto:l.st...@pengutronix.de] Sent: Wednesday, August 06, 2014 10:42 PM To: Wang Shengjiu-B02247 Cc: Guo Shawn-R65073; ker...@pengutronix.de; li...@arm.linux.org.uk; robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com; ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; Chen Guangyu-B42378; linux-arm-ker...@lists.infradead.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 2/3] ARM: clk-imx6q: Add missing lvds and anaclk clock to the clock tree Am Mittwoch, den 06.08.2014, 16:35 +0800 schrieb Shengjiu Wang: > anaclk1 and anaclk2 is the clock source for lvds1_in and lvds2_in. > lvds1_in and lvds2_in can be used to provide external clock source to > the internal pll, such as pll4_audio and pll5_video. > pll4_audio and pll5_video can have multiple source, not only "osc", so > add them. > > Signed-off-by: Nicolin Chen > Signed-off-by: Shengjiu Wang > --- > arch/arm/mach-imx/clk-imx6q.c | 12 ++-- > include/dt-bindings/clock/imx6qdl-clock.h |8 +++- > 2 files changed, 17 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/mach-imx/clk-imx6q.c > b/arch/arm/mach-imx/clk-imx6q.c index 1d6dd59..330aad3 100644 > --- a/arch/arm/mach-imx/clk-imx6q.c > +++ b/arch/arm/mach-imx/clk-imx6q.c > @@ -73,6 +73,7 @@ static const char *lvds_sels[] = { > "pll4_audio", "pll5_video", "pll8_mlb", "enet_ref", > "pcie_ref_125m", "sata_ref_100m", > }; > +static const char *pll_av_sels[] = { "osc", "lvds1_in", "lvds2_in", > +"dummy", }; > > static struct clk *clk[IMX6QDL_CLK_END]; static struct > clk_onecell_data clk_data; @@ -119,6 +120,9 @@ static void __init > imx6q_clocks_init(struct device_node *ccm_node) > clk[IMX6QDL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0); > clk[IMX6QDL_CLK_CKIH] = imx_obtain_fixed_clock("ckih1", 0); > clk[IMX6QDL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0); > + /* Clock source from external clock via ANACLK1/2 PADs */ > + clk[IMX6QDL_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0); > + clk[IMX6QDL_CLK_ANACLK2] = imx_obtain_fixed_clock("anaclk2", 0); > > np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop"); > base = of_iomap(np, 0); > @@ -136,8 +140,8 @@ static void __init imx6q_clocks_init(struct device_node > *ccm_node) > clk[IMX6QDL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, > "pll1_sys", "osc", base,0x7f); > clk[IMX6QDL_CLK_PLL2_BUS] = imx_clk_pllv3(IMX_PLLV3_GENERIC, > "pll2_bus", "osc", base + 0x30, 0x1); > clk[IMX6QDL_CLK_PLL3_USB_OTG] = imx_clk_pllv3(IMX_PLLV3_USB, > "pll3_usb_otg", "osc", base + 0x10, 0x3); > - clk[IMX6QDL_CLK_PLL4_AUDIO]= imx_clk_pllv3(IMX_PLLV3_AV, > "pll4_audio", "osc", base + 0x70, 0x7f); > - clk[IMX6QDL_CLK_PLL5_VIDEO]= imx_clk_pllv3(IMX_PLLV3_AV, > "pll5_video", "osc", base + 0xa0, 0x7f); > + clk[IMX6QDL_CLK_PLL4_AUDIO]= imx_clk_pllv3(IMX_PLLV3_AV, > "pll4_audio", "pll4_sel", base + 0x70, 0x7f); > + clk[IMX6QDL_CLK_PLL5_VIDEO]= imx_clk_pllv3(IMX_PLLV3_AV, > "pll5_video", "pll5_sel", base + 0xa0, 0x7f); > clk[IMX6QDL_CLK_PLL6_ENET] = imx_clk_pllv3(IMX_PLLV3_ENET, > "pll6_enet","osc", base + 0xe0, 0x3); > clk[IMX6QDL_CLK_PLL7_USB_HOST] = imx_clk_pllv3(IMX_PLLV3_USB, > "pll7_usb_host","osc", base + 0x20, 0x3); > > @@ -169,6 +173,8 @@ static void __init imx6q_clocks_init(struct > device_node *ccm_node) > > clk[IMX6QDL_CLK_LVDS1_SEL] = imx_clk_mux("lvds1_sel", base + 0x160, 0, > 5, lvds_sels, ARRAY_SIZE(lvds_sels)); > clk[IMX6QDL_CLK_LVDS2_SEL] = imx_clk_mux("lvds2_sel", base + 0x160, > 5, 5, lvds_sels, ARRAY_SIZE(lvds_sels)); > + clk[IMX6QDL_CLK_PLL4_SEL] = imx_clk_mux("pll4_sel", base + 0x70, 14, > 2, pll_av_sels, ARRAY_SIZE(pll_av_sels)); > + clk[IMX6QDL_CLK_PLL5_SEL] = imx_clk_mux("pll5_sel", base + 0xa0, > +14, 2, pll_av_sels, ARRAY_SIZE(pll_av_sels)); > > /* >* lvds1_gate and lvds2_gate are pseudo-gates. Both can be @@ > -178,6 +184,8 @@ static void __init imx6q_clocks_init(struct device_node > *ccm_node) >*/ > clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate("lvds1_gate", "lvds1_sel", > base + 0x160, 10); > clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate("lvds2_gate", > "lvds2_sel", base + 0x160, 11); > + clk[IMX6QDL_CLK_LVDS1_IN] = imx_clk_gate("lvds1_in", "anaclk1", base + > 0x160, 12); > + clk[IMX6QDL_CLK_LVDS2_IN] = imx_clk_gate("lvds2_in", "anaclk2", base > ++ 0x160, 13); > I think we need something more clever here. With both lvds in and out modeled as a clock gate it is possible for the user to enable both at the same time. The reference manual on the contrary states that both states are mutually exclusive: "Do not enable input
RE: [PATCH V2 3/3] ARM: imx6q: Add the clock route from external OSC to ESAI clock
Ok, thanks. -Original Message- From: Shawn Guo [mailto:shawn@freescale.com] Sent: Thursday, August 07, 2014 11:12 AM To: Wang Shengjiu-B02247 Cc: ker...@pengutronix.de; li...@arm.linux.org.uk; robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com; ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; Chen Guangyu-B42378; linux-arm-ker...@lists.infradead.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 3/3] ARM: imx6q: Add the clock route from external OSC to ESAI clock On Wed, Aug 06, 2014 at 04:35:15PM +0800, Shengjiu Wang wrote: > This patch mainly adds the clock route from external 24.576MHz OSC to > internal ESAI clock via analog clock2 PADs on the SoC and pll4 so that > ESAI can get an entirely synchronous clock source against CS42888. > > [ 1, We found if using pll4 to generate a 24.576MHz from inernal 24.0MHz OSC, > we would get noise during the audio playback via ESAI->CS42888 even though > this generated clock's rate is equal to the external one statistically. It > might be resulted from the tiny difference between two clock source, which > might be crucial to the sensitive CODEC we use -- CS42888. > > 2, Ideally, we should use bypass mode for pll4 since we only need to get > the raw rate (24.576MHz) while currently bypass mode in clk-pllv3.c isn't > supported. After bypass mode implement, then we can refine this > patch.] I meant we should implement bypass mode first. I will give it a try. Shawn > > Expected result: > > anaclk2 0 124576000 >lvds2_in 0 124576000 > pll4_sel 0 124576000 > pll4_audio 0 1786432000 > pll4_post_div 0 1786432000 >pll4_audio_div 0 1786432000 > esai_sel 0 1786432000 > esai_pred0 198304000 > esai_podf 0 124576000 >esai_extal 0 124576000 > > Signed-off-by: Nicolin Chen > Signed-off-by: Shengjiu Wang > --- > arch/arm/mach-imx/clk-imx6q.c |5 + > arch/arm/mach-imx/mach-imx6q.c | 28 > 2 files changed, 33 insertions(+) > > diff --git a/arch/arm/mach-imx/clk-imx6q.c > b/arch/arm/mach-imx/clk-imx6q.c index 330aad3..29151cb 100644 > --- a/arch/arm/mach-imx/clk-imx6q.c > +++ b/arch/arm/mach-imx/clk-imx6q.c > @@ -414,6 +414,10 @@ static void __init imx6q_clocks_init(struct device_node > *ccm_node) > of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); > > clk_register_clkdev(clk[IMX6QDL_CLK_ENET_REF], "enet_ref", NULL); > + clk_register_clkdev(clk[IMX6QDL_CLK_PLL4_AUDIO_DIV], "pll4_audio_div", > NULL); > + clk_register_clkdev(clk[IMX6QDL_CLK_PLL4_SEL], "pll4_sel", NULL); > + clk_register_clkdev(clk[IMX6QDL_CLK_LVDS2_IN], "lvds2_in", NULL); > + clk_register_clkdev(clk[IMX6QDL_CLK_ESAI_EXTAL], "esai_extal", > +NULL); > > if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || > cpu_is_imx6dl()) { > @@ -457,6 +461,7 @@ static void __init imx6q_clocks_init(struct > device_node *ccm_node) > > /* Audio-related clocks configuration */ > clk_set_parent(clk[IMX6QDL_CLK_SPDIF_SEL], > clk[IMX6QDL_CLK_PLL3_PFD3_454M]); > + clk_set_parent(clk[IMX6QDL_CLK_ESAI_SEL], > +clk[IMX6QDL_CLK_PLL4_AUDIO_DIV]); > > /* All existing boards with PCIe use LVDS1 */ > if (IS_ENABLED(CONFIG_PCI_IMX6)) > diff --git a/arch/arm/mach-imx/mach-imx6q.c > b/arch/arm/mach-imx/mach-imx6q.c index d51c6e9..ea24a96 100644 > --- a/arch/arm/mach-imx/mach-imx6q.c > +++ b/arch/arm/mach-imx/mach-imx6q.c > @@ -362,6 +362,28 @@ put_node: > of_node_put(np); > } > > +#define ESAI_AUDIO_MCLK 24576000 > + > +static void __init imx6q_audio_lvds2_init(void) { > +struct clk *pll4_sel, *lvds2_in, *pll4_audio_div, > +*esai_extal; > + > +pll4_audio_div = clk_get_sys(NULL, "pll4_audio_div"); > +pll4_sel = clk_get_sys(NULL, "pll4_sel"); > +lvds2_in = clk_get_sys(NULL, "lvds2_in"); > +esai_extal = clk_get_sys(NULL, "esai_extal"); > +if (IS_ERR(pll4_audio_div) || IS_ERR(pll4_sel) || > +IS_ERR(lvds2_in) || IS_ERR(esai_extal)) > +return; > + > +if (clk_get_rate(lvds2_in) != ESAI_AUDIO_MCLK) > +return; > + > +clk_set_parent(pll4_sel, lvds2_in); > +clk_set_rate(pll4_audio_div, 786432000); > +clk_set_rate(esai_extal, ESAI_AUDIO_MCLK); } > + > static struct platform_device imx6q_cpufreq_pdev = { > .name = "imx6q-cpufreq", > }; > @@ -379,6 +401,12 @@ static void __init imx6q_init_late(void) > imx6q_opp_init(); > platform_device_register(&imx6q_cpufreq_pdev); > } > + > + if (of_machine_is_compatible("fsl,imx
RE: [alsa-devel] [PATCH] ASoC: cs42xx8: Add SND_SOC_DAIFMT_DSP_A support
Hi all Sorry, add more maintainers. Best regards Wang shengjiu -Original Message- From: alsa-devel-boun...@alsa-project.org [mailto:alsa-devel-boun...@alsa-project.org] On Behalf Of Shengjiu Wang Sent: Monday, July 14, 2014 6:40 PM To: broo...@linaro.org Cc: alsa-de...@alsa-project.org Subject: [alsa-devel] [PATCH] ASoC: cs42xx8: Add SND_SOC_DAIFMT_DSP_A support According to the spec, the definition of TDM and ONELINE_24 for CS42XX8_INTF_DAC and CS42XX8_INTF_ADC is wrong. correct them and enable SND_SOC_DAIFMT_DSP_A support. Signed-off-by: Shengjiu Wang --- sound/soc/codecs/cs42xx8.c | 3 +++ sound/soc/codecs/cs42xx8.h | 8 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index ec53ffc..02b1520 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c @@ -219,6 +219,9 @@ static int cs42xx8_set_dai_fmt(struct snd_soc_dai *codec_dai, case SND_SOC_DAIFMT_RIGHT_J: val = CS42XX8_INTF_DAC_DIF_RIGHTJ | CS42XX8_INTF_ADC_DIF_RIGHTJ; break; + case SND_SOC_DAIFMT_DSP_A: + val = CS42XX8_INTF_DAC_DIF_TDM | CS42XX8_INTF_ADC_DIF_TDM; + break; default: dev_err(codec->dev, "unsupported dai format\n"); return -EINVAL; diff --git a/sound/soc/codecs/cs42xx8.h b/sound/soc/codecs/cs42xx8.h index da0b94a..b2c10e5 100644 --- a/sound/soc/codecs/cs42xx8.h +++ b/sound/soc/codecs/cs42xx8.h @@ -128,8 +128,8 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap); #define CS42XX8_INTF_DAC_DIF_RIGHTJ(2 << CS42XX8_INTF_DAC_DIF_SHIFT) #define CS42XX8_INTF_DAC_DIF_RIGHTJ_16 (3 << CS42XX8_INTF_DAC_DIF_SHIFT) #define CS42XX8_INTF_DAC_DIF_ONELINE_20(4 << CS42XX8_INTF_DAC_DIF_SHIFT) -#define CS42XX8_INTF_DAC_DIF_ONELINE_24(6 << CS42XX8_INTF_DAC_DIF_SHIFT) -#define CS42XX8_INTF_DAC_DIF_TDM (7 << CS42XX8_INTF_DAC_DIF_SHIFT) +#define CS42XX8_INTF_DAC_DIF_ONELINE_24(5 << CS42XX8_INTF_DAC_DIF_SHIFT) +#define CS42XX8_INTF_DAC_DIF_TDM (6 << CS42XX8_INTF_DAC_DIF_SHIFT) #define CS42XX8_INTF_ADC_DIF_SHIFT 0 #define CS42XX8_INTF_ADC_DIF_WIDTH 3 #define CS42XX8_INTF_ADC_DIF_MASK (((1 << CS42XX8_INTF_ADC_DIF_WIDTH) - 1) << CS42XX8_INTF_ADC_DIF_SHIFT) @@ -138,8 +138,8 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap); #define CS42XX8_INTF_ADC_DIF_RIGHTJ(2 << CS42XX8_INTF_ADC_DIF_SHIFT) #define CS42XX8_INTF_ADC_DIF_RIGHTJ_16 (3 << CS42XX8_INTF_ADC_DIF_SHIFT) #define CS42XX8_INTF_ADC_DIF_ONELINE_20(4 << CS42XX8_INTF_ADC_DIF_SHIFT) -#define CS42XX8_INTF_ADC_DIF_ONELINE_24(6 << CS42XX8_INTF_ADC_DIF_SHIFT) -#define CS42XX8_INTF_ADC_DIF_TDM (7 << CS42XX8_INTF_ADC_DIF_SHIFT) +#define CS42XX8_INTF_ADC_DIF_ONELINE_24(5 << CS42XX8_INTF_ADC_DIF_SHIFT) +#define CS42XX8_INTF_ADC_DIF_TDM (6 << CS42XX8_INTF_ADC_DIF_SHIFT) /* ADC Control & DAC De-Emphasis (Address 05h) */ #define CS42XX8_ADCCTL_ADC_HPF_FREEZE_SHIFT7 -- 1.8.0 ___ Alsa-devel mailing list alsa-de...@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/