diff mbox

[V1,1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

Message ID 3a0c98ca698e4d38b3e92f339049b883@BN1PR0301MB0609.namprd03.prod.outlook.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xiubo Li Aug. 19, 2014, 9 a.m. UTC
How about the following :



Thanks,


BRs
Xiubo



> -----Original Message-----
> From: Shengjiu Wang [mailto:shengjiu.wang@freescale.com]
> Sent: Tuesday, August 19, 2014 4:21 PM
> To: Xiubo Li-B47053
> Cc: Lars-Peter Clausen; lgirdwood@gmail.com; broonie@kernel.org;
> perex@perex.cz; tiwai@suse.de; nicoleotsuka@gmail.com; shc_work@mail.ru;
> Estevam Fabio-R49496; xobs@kosagi.com; arnd@arndb.de; sfr@canb.auug.org.au;
> timur@tabi.org; alsa-devel@alsa-project.org; linuxppc-dev@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 <fengguang.wu@intel.com>
> > > > >Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> > > >
> > > > 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 Clausen & Arnd
> > >
> > > The purpose of Arnd's patch is same with me, which is to resolve the build
> > > error when SND_SOC_IMX_PCM_DMA=m & SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
> > > error is "undefined reference to `imx_pcm_dma_init'".
> > > But Arnd's patch didn't involve this situation that SND_IMX_SOC=n &
> > > SND_SOC_IMX_PCM_DMA=m.
> > >
> > > Currently I think out a solution for this issue is to change
> > >
> > > select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
> > >
> > > to
> > >
> > > depends on SND_SOC_IMX_PCM_DMA != m
> > >
> > > How do you think about this?
> > >
> >
> > What will happen if to build both SAI/ESAI and IMX_PCM_DMA as modules at the
> same
> > time ?
> >
> > Thanks,
> >
> > BRs
> > Xiubo
> 
> I didn't find error/warning when SAI/ESAI and IMX_PCM_DMA are as modules. The
> build is successful.
> 
> >
> >
> > > best regards
> > > Wang shengjiu

Comments

Takashi Iwai Aug. 19, 2014, 10:35 a.m. UTC | #1
At Tue, 19 Aug 2014 09:00:06 +0000,
Li.Xiubo@freescale.com wrote:
> 
> 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

I see the problem has been addressed, so JFYI: a reverse selection
doesn't resolve "depends on".  It's a known shortcoming.  That is, a
selected item can select further others, but cannot depend on others.


Takashi
Lars-Peter Clausen Aug. 19, 2014, 10:39 a.m. UTC | #2
On 08/19/2014 12:35 PM, Takashi Iwai wrote:
> At Tue, 19 Aug 2014 09:00:06 +0000,
> Li.Xiubo@freescale.com wrote:
>>
>> 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
>
> I see the problem has been addressed, so JFYI: a reverse selection
> doesn't resolve "depends on".  It's a known shortcoming.  That is, a
> selected item can select further others, but cannot depend on others.

The item will still be selected regardless of its dependencies, but Kconfig 
will print a warning if one or more of the dependencies are not met along 
with the dependency chain that causes the warning. So you'll have a clue why 
things go wrong.

- Lars
diff mbox

Patch

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