diff mbox

[RFC,03/10] ASoC: Intel: Skylake: add HDA BE DAIs

Message ID 1512119648-2700-4-git-send-email-rakesh.a.ughreja@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ughreja, Rakesh A Dec. 1, 2017, 9:14 a.m. UTC
Add support for HDA BE DAIs in SKL platform driver.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
---
 sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

Comments

Pierre-Louis Bossart Dec. 1, 2017, 6:20 p.m. UTC | #1
On 12/1/17 3:14 AM, Rakesh Ughreja wrote:
> Add support for HDA BE DAIs in SKL platform driver.
> 
> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
> ---
>   sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++-------
>   1 file changed, 25 insertions(+), 7 deletions(-)
> 
> diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
> index e6fee7a..3dcb241 100644
> --- a/sound/soc/intel/skylake/skl-pcm.c
> +++ b/sound/soc/intel/skylake/skl-pcm.c
> @@ -956,21 +956,39 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
>   	},
>   },
>   {
> -	.name = "HD-Codec Pin",
> +	.name = "Analog CPU DAI",
>   	.ops = &skl_link_dai_ops,
>   	.playback = {
> -		.stream_name = "HD-Codec Tx",
> -		.channels_min = HDA_STEREO,
> +		.stream_name = "Analog CPU Playback",
> +		.channels_min = HDA_MONO,
>   		.channels_max = HDA_STEREO,
>   		.rates = SNDRV_PCM_RATE_48000,
> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
> +		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
>   	},
>   	.capture = {
> -		.stream_name = "HD-Codec Rx",
> -		.channels_min = HDA_STEREO,
> +		.stream_name = "Analog CPU Capture",
> +		.channels_min = HDA_MONO,
>   		.channels_max = HDA_STEREO,
>   		.rates = SNDRV_PCM_RATE_48000,
> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
> +		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
> +	},
> +},
> +{
> +	.name = "Digital CPU DAI",

I am not sure I get the meaning of analog/digital.

Did you mean external codec vs. iDisp codec?

Or did you really mean analog? I don't think you can control this front 
the CPU side, e.g. if the codec has an S/PDIF output it remains digital.

> +	.ops = &skl_link_dai_ops,
> +	.playback = {
> +		.stream_name = "Digital CPU Playback",
> +		.channels_min = HDA_MONO,
> +		.channels_max = HDA_STEREO,
> +		.rates = SNDRV_PCM_RATE_48000,
> +		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
> +	},
> +	.capture = {
> +		.stream_name = "Digital CPU Capture",
> +		.channels_min = HDA_MONO,
> +		.channels_max = HDA_STEREO,
> +		.rates = SNDRV_PCM_RATE_48000,
> +		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
>   	},
>   },
>   };
>
Ughreja, Rakesh A Dec. 4, 2017, 4:14 p.m. UTC | #2
>-----Original Message-----
>From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
>Sent: Friday, December 1, 2017 11:50 PM
>To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
>project.org; broonie@kernel.org; tiwai@suse.de; liam.r.girdwood@linux.intel.com
>Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
><patches.audio@intel.com>
>Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
>
>On 12/1/17 3:14 AM, Rakesh Ughreja wrote:
>> Add support for HDA BE DAIs in SKL platform driver.
>>
>> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
>> ---
>>   sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++------
>-
>>   1 file changed, 25 insertions(+), 7 deletions(-)
>>
>> diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-
>pcm.c
>> index e6fee7a..3dcb241 100644
>> --- a/sound/soc/intel/skylake/skl-pcm.c
>> +++ b/sound/soc/intel/skylake/skl-pcm.c
>> @@ -956,21 +956,39 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
>>   	},
>>   },
>>   {
>> -	.name = "HD-Codec Pin",
>> +	.name = "Analog CPU DAI",
>>   	.ops = &skl_link_dai_ops,
>>   	.playback = {
>> -		.stream_name = "HD-Codec Tx",
>> -		.channels_min = HDA_STEREO,
>> +		.stream_name = "Analog CPU Playback",
>> +		.channels_min = HDA_MONO,
>>   		.channels_max = HDA_STEREO,
>>   		.rates = SNDRV_PCM_RATE_48000,
>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>SNDRV_PCM_FMTBIT_S24_LE,
>>   	},
>>   	.capture = {
>> -		.stream_name = "HD-Codec Rx",
>> -		.channels_min = HDA_STEREO,
>> +		.stream_name = "Analog CPU Capture",
>> +		.channels_min = HDA_MONO,
>>   		.channels_max = HDA_STEREO,
>>   		.rates = SNDRV_PCM_RATE_48000,
>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>SNDRV_PCM_FMTBIT_S24_LE,
>> +	},
>> +},
>> +{
>> +	.name = "Digital CPU DAI",
>
>I am not sure I get the meaning of analog/digital.
>
>Did you mean external codec vs. iDisp codec?
>
>Or did you really mean analog? I don't think you can control this front
>the CPU side, e.g. if the codec has an S/PDIF output it remains digital.

I was trying to map the BE CPU DAIs to hda_pcm_stream. 
The way it is defined here.
https://elixir.free-electrons.com/linux/v4.15-rc2/source/sound/pci/hda/hda_generic.c#L5374

>
>> +	.ops = &skl_link_dai_ops,
>> +	.playback = {
>> +		.stream_name = "Digital CPU Playback",
>> +		.channels_min = HDA_MONO,
>> +		.channels_max = HDA_STEREO,
>> +		.rates = SNDRV_PCM_RATE_48000,
>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>SNDRV_PCM_FMTBIT_S24_LE,
>> +	},
>> +	.capture = {
>> +		.stream_name = "Digital CPU Capture",
>> +		.channels_min = HDA_MONO,
>> +		.channels_max = HDA_STEREO,
>> +		.rates = SNDRV_PCM_RATE_48000,
>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>SNDRV_PCM_FMTBIT_S24_LE,
>>   	},
>>   },
>>   };
>>
Pierre-Louis Bossart Dec. 4, 2017, 4:40 p.m. UTC | #3
On 12/4/17 10:14 AM, Ughreja, Rakesh A wrote:
> 
> 
>> -----Original Message-----
>> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
>> Sent: Friday, December 1, 2017 11:50 PM
>> To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
>> project.org; broonie@kernel.org; tiwai@suse.de; liam.r.girdwood@linux.intel.com
>> Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
>> <patches.audio@intel.com>
>> Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
>>
>> On 12/1/17 3:14 AM, Rakesh Ughreja wrote:
>>> Add support for HDA BE DAIs in SKL platform driver.
>>>
>>> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
>>> ---
>>>    sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++------
>> -
>>>    1 file changed, 25 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-
>> pcm.c
>>> index e6fee7a..3dcb241 100644
>>> --- a/sound/soc/intel/skylake/skl-pcm.c
>>> +++ b/sound/soc/intel/skylake/skl-pcm.c
>>> @@ -956,21 +956,39 @@ static struct snd_soc_dai_driver skl_platform_dai[] = {
>>>    	},
>>>    },
>>>    {
>>> -	.name = "HD-Codec Pin",
>>> +	.name = "Analog CPU DAI",
>>>    	.ops = &skl_link_dai_ops,
>>>    	.playback = {
>>> -		.stream_name = "HD-Codec Tx",
>>> -		.channels_min = HDA_STEREO,
>>> +		.stream_name = "Analog CPU Playback",
>>> +		.channels_min = HDA_MONO,
>>>    		.channels_max = HDA_STEREO,
>>>    		.rates = SNDRV_PCM_RATE_48000,
>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>> SNDRV_PCM_FMTBIT_S24_LE,
>>>    	},
>>>    	.capture = {
>>> -		.stream_name = "HD-Codec Rx",
>>> -		.channels_min = HDA_STEREO,
>>> +		.stream_name = "Analog CPU Capture",
>>> +		.channels_min = HDA_MONO,
>>>    		.channels_max = HDA_STEREO,
>>>    		.rates = SNDRV_PCM_RATE_48000,
>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>> SNDRV_PCM_FMTBIT_S24_LE,
>>> +	},
>>> +},
>>> +{
>>> +	.name = "Digital CPU DAI",
>>
>> I am not sure I get the meaning of analog/digital.
>>
>> Did you mean external codec vs. iDisp codec?
>>
>> Or did you really mean analog? I don't think you can control this front
>> the CPU side, e.g. if the codec has an S/PDIF output it remains digital.
> 
> I was trying to map the BE CPU DAIs to hda_pcm_stream.
> The way it is defined here.
> https://elixir.free-electrons.com/linux/v4.15-rc2/source/sound/pci/hda/hda_generic.c#L5374

ok, but I still don't know what those BEs are supposed to refer to or mean.

> 
>>
>>> +	.ops = &skl_link_dai_ops,
>>> +	.playback = {
>>> +		.stream_name = "Digital CPU Playback",
>>> +		.channels_min = HDA_MONO,
>>> +		.channels_max = HDA_STEREO,
>>> +		.rates = SNDRV_PCM_RATE_48000,
>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>> SNDRV_PCM_FMTBIT_S24_LE,
>>> +	},
>>> +	.capture = {
>>> +		.stream_name = "Digital CPU Capture",
>>> +		.channels_min = HDA_MONO,
>>> +		.channels_max = HDA_STEREO,
>>> +		.rates = SNDRV_PCM_RATE_48000,
>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>> SNDRV_PCM_FMTBIT_S24_LE,
>>>    	},
>>>    },
>>>    };
>>>
>
Ughreja, Rakesh A Dec. 4, 2017, 4:44 p.m. UTC | #4
>-----Original Message-----
>From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
>Sent: Monday, December 4, 2017 10:11 PM
>To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
>project.org; broonie@kernel.org; tiwai@suse.de; liam.r.girdwood@linux.intel.com
>Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
><patches.audio@intel.com>
>Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
>
>On 12/4/17 10:14 AM, Ughreja, Rakesh A wrote:
>>
>>
>>> -----Original Message-----
>>> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
>>> Sent: Friday, December 1, 2017 11:50 PM
>>> To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
>>> project.org; broonie@kernel.org; tiwai@suse.de;
>liam.r.girdwood@linux.intel.com
>>> Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
>>> <patches.audio@intel.com>
>>> Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
>>>
>>> On 12/1/17 3:14 AM, Rakesh Ughreja wrote:
>>>> Add support for HDA BE DAIs in SKL platform driver.
>>>>
>>>> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
>>>> ---
>>>>    sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++--
>----
>>> -
>>>>    1 file changed, 25 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-
>>> pcm.c
>>>> index e6fee7a..3dcb241 100644
>>>> --- a/sound/soc/intel/skylake/skl-pcm.c
>>>> +++ b/sound/soc/intel/skylake/skl-pcm.c
>>>> @@ -956,21 +956,39 @@ static struct snd_soc_dai_driver skl_platform_dai[]
>= {
>>>>    	},
>>>>    },
>>>>    {
>>>> -	.name = "HD-Codec Pin",
>>>> +	.name = "Analog CPU DAI",
>>>>    	.ops = &skl_link_dai_ops,
>>>>    	.playback = {
>>>> -		.stream_name = "HD-Codec Tx",
>>>> -		.channels_min = HDA_STEREO,
>>>> +		.stream_name = "Analog CPU Playback",
>>>> +		.channels_min = HDA_MONO,
>>>>    		.channels_max = HDA_STEREO,
>>>>    		.rates = SNDRV_PCM_RATE_48000,
>>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>>    	},
>>>>    	.capture = {
>>>> -		.stream_name = "HD-Codec Rx",
>>>> -		.channels_min = HDA_STEREO,
>>>> +		.stream_name = "Analog CPU Capture",
>>>> +		.channels_min = HDA_MONO,
>>>>    		.channels_max = HDA_STEREO,
>>>>    		.rates = SNDRV_PCM_RATE_48000,
>>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>> +	},
>>>> +},
>>>> +{
>>>> +	.name = "Digital CPU DAI",
>>>
>>> I am not sure I get the meaning of analog/digital.
>>>
>>> Did you mean external codec vs. iDisp codec?
>>>
>>> Or did you really mean analog? I don't think you can control this front
>>> the CPU side, e.g. if the codec has an S/PDIF output it remains digital.
>>
>> I was trying to map the BE CPU DAIs to hda_pcm_stream.
>> The way it is defined here.
>> https://elixir.free-electrons.com/linux/v4.15-
>rc2/source/sound/pci/hda/hda_generic.c#L5374
>
>ok, but I still don't know what those BEs are supposed to refer to or mean.

In the ASoC HDA codec driver it maps the hda_pcm_stream to codc DAI.
In the machine driver we map/bind the codec DAI to CPU BE DAI.
Pierre-Louis Bossart Dec. 4, 2017, 4:51 p.m. UTC | #5
On 12/4/17 10:44 AM, Ughreja, Rakesh A wrote:
> 
> 
>> -----Original Message-----
>> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
>> Sent: Monday, December 4, 2017 10:11 PM
>> To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
>> project.org; broonie@kernel.org; tiwai@suse.de; liam.r.girdwood@linux.intel.com
>> Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
>> <patches.audio@intel.com>
>> Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
>>
>> On 12/4/17 10:14 AM, Ughreja, Rakesh A wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
>>>> Sent: Friday, December 1, 2017 11:50 PM
>>>> To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
>>>> project.org; broonie@kernel.org; tiwai@suse.de;
>> liam.r.girdwood@linux.intel.com
>>>> Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
>>>> <patches.audio@intel.com>
>>>> Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
>>>>
>>>> On 12/1/17 3:14 AM, Rakesh Ughreja wrote:
>>>>> Add support for HDA BE DAIs in SKL platform driver.
>>>>>
>>>>> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
>>>>> ---
>>>>>     sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++--
>> ----
>>>> -
>>>>>     1 file changed, 25 insertions(+), 7 deletions(-)
>>>>>
>>>>> diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-
>>>> pcm.c
>>>>> index e6fee7a..3dcb241 100644
>>>>> --- a/sound/soc/intel/skylake/skl-pcm.c
>>>>> +++ b/sound/soc/intel/skylake/skl-pcm.c
>>>>> @@ -956,21 +956,39 @@ static struct snd_soc_dai_driver skl_platform_dai[]
>> = {
>>>>>     	},
>>>>>     },
>>>>>     {
>>>>> -	.name = "HD-Codec Pin",
>>>>> +	.name = "Analog CPU DAI",
>>>>>     	.ops = &skl_link_dai_ops,
>>>>>     	.playback = {
>>>>> -		.stream_name = "HD-Codec Tx",
>>>>> -		.channels_min = HDA_STEREO,
>>>>> +		.stream_name = "Analog CPU Playback",
>>>>> +		.channels_min = HDA_MONO,
>>>>>     		.channels_max = HDA_STEREO,
>>>>>     		.rates = SNDRV_PCM_RATE_48000,
>>>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>>>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>>>     	},
>>>>>     	.capture = {
>>>>> -		.stream_name = "HD-Codec Rx",
>>>>> -		.channels_min = HDA_STEREO,
>>>>> +		.stream_name = "Analog CPU Capture",
>>>>> +		.channels_min = HDA_MONO,
>>>>>     		.channels_max = HDA_STEREO,
>>>>>     		.rates = SNDRV_PCM_RATE_48000,
>>>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
>>>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
>>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>>> +	},
>>>>> +},
>>>>> +{
>>>>> +	.name = "Digital CPU DAI",
>>>>
>>>> I am not sure I get the meaning of analog/digital.
>>>>
>>>> Did you mean external codec vs. iDisp codec?
>>>>
>>>> Or did you really mean analog? I don't think you can control this front
>>>> the CPU side, e.g. if the codec has an S/PDIF output it remains digital.
>>>
>>> I was trying to map the BE CPU DAIs to hda_pcm_stream.
>>> The way it is defined here.
>>> https://elixir.free-electrons.com/linux/v4.15-
>> rc2/source/sound/pci/hda/hda_generic.c#L5374
>>
>> ok, but I still don't know what those BEs are supposed to refer to or mean.
> 
> In the ASoC HDA codec driver it maps the hda_pcm_stream to codc DAI.
> In the machine driver we map/bind the codec DAI to CPU BE DAI.

I meant the difference between pcm_analog_playback, 
pcm_analog_alt_playback and pcm_digital_playback in the hda_generic.c 
file you mentioned.

> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Takashi Iwai Dec. 4, 2017, 5:01 p.m. UTC | #6
On Mon, 04 Dec 2017 17:51:17 +0100,
Pierre-Louis Bossart wrote:
> 
> On 12/4/17 10:44 AM, Ughreja, Rakesh A wrote:
> >
> >
> >> -----Original Message-----
> >> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
> >> Sent: Monday, December 4, 2017 10:11 PM
> >> To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
> >> project.org; broonie@kernel.org; tiwai@suse.de; liam.r.girdwood@linux.intel.com
> >> Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
> >> <patches.audio@intel.com>
> >> Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
> >>
> >> On 12/4/17 10:14 AM, Ughreja, Rakesh A wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
> >>>> Sent: Friday, December 1, 2017 11:50 PM
> >>>> To: Ughreja, Rakesh A <rakesh.a.ughreja@intel.com>; alsa-devel@alsa-
> >>>> project.org; broonie@kernel.org; tiwai@suse.de;
> >> liam.r.girdwood@linux.intel.com
> >>>> Cc: Koul, Vinod <vinod.koul@intel.com>; Patches Audio
> >>>> <patches.audio@intel.com>
> >>>> Subject: Re: [alsa-devel] [RFC 03/10] ASoC: Intel: Skylake: add HDA BE DAIs
> >>>>
> >>>> On 12/1/17 3:14 AM, Rakesh Ughreja wrote:
> >>>>> Add support for HDA BE DAIs in SKL platform driver.
> >>>>>
> >>>>> Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
> >>>>> ---
> >>>>>     sound/soc/intel/skylake/skl-pcm.c | 32 +++++++++++++++++++++++++--
> >> ----
> >>>> -
> >>>>>     1 file changed, 25 insertions(+), 7 deletions(-)
> >>>>>
> >>>>> diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-
> >>>> pcm.c
> >>>>> index e6fee7a..3dcb241 100644
> >>>>> --- a/sound/soc/intel/skylake/skl-pcm.c
> >>>>> +++ b/sound/soc/intel/skylake/skl-pcm.c
> >>>>> @@ -956,21 +956,39 @@ static struct snd_soc_dai_driver skl_platform_dai[]
> >> = {
> >>>>>     	},
> >>>>>     },
> >>>>>     {
> >>>>> -	.name = "HD-Codec Pin",
> >>>>> +	.name = "Analog CPU DAI",
> >>>>>     	.ops = &skl_link_dai_ops,
> >>>>>     	.playback = {
> >>>>> -		.stream_name = "HD-Codec Tx",
> >>>>> -		.channels_min = HDA_STEREO,
> >>>>> +		.stream_name = "Analog CPU Playback",
> >>>>> +		.channels_min = HDA_MONO,
> >>>>>     		.channels_max = HDA_STEREO,
> >>>>>     		.rates = SNDRV_PCM_RATE_48000,
> >>>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
> >>>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
> >>>> SNDRV_PCM_FMTBIT_S24_LE,
> >>>>>     	},
> >>>>>     	.capture = {
> >>>>> -		.stream_name = "HD-Codec Rx",
> >>>>> -		.channels_min = HDA_STEREO,
> >>>>> +		.stream_name = "Analog CPU Capture",
> >>>>> +		.channels_min = HDA_MONO,
> >>>>>     		.channels_max = HDA_STEREO,
> >>>>>     		.rates = SNDRV_PCM_RATE_48000,
> >>>>> -		.formats = SNDRV_PCM_FMTBIT_S16_LE,
> >>>>> +		.formats = SNDRV_PCM_FMTBIT_S16_LE |
> >>>> SNDRV_PCM_FMTBIT_S24_LE,
> >>>>> +	},
> >>>>> +},
> >>>>> +{
> >>>>> +	.name = "Digital CPU DAI",
> >>>>
> >>>> I am not sure I get the meaning of analog/digital.
> >>>>
> >>>> Did you mean external codec vs. iDisp codec?
> >>>>
> >>>> Or did you really mean analog? I don't think you can control this front
> >>>> the CPU side, e.g. if the codec has an S/PDIF output it remains digital.
> >>>
> >>> I was trying to map the BE CPU DAIs to hda_pcm_stream.
> >>> The way it is defined here.
> >>> https://elixir.free-electrons.com/linux/v4.15-
> >> rc2/source/sound/pci/hda/hda_generic.c#L5374
> >>
> >> ok, but I still don't know what those BEs are supposed to refer to or mean.
> >
> > In the ASoC HDA codec driver it maps the hda_pcm_stream to codc DAI.
> > In the machine driver we map/bind the codec DAI to CPU BE DAI.
> 
> I meant the difference between pcm_analog_playback,
> pcm_analog_alt_playback and pcm_digital_playback in the hda_generic.c
> file you mentioned.

pcm_analog_playback is for the primary PCM streams that are assigned
to the analog I/O jacks (hp, mic, line-out, etc).  pcm_analog_alt is
for the alternative PCM stream, usually assigned for the independent
headphone PCM stream on certain codec chips.  pcm_digital_playback is
for either SPDIF or HDMI/DP, but mostly only for SPDIF, as HDMI/DP is
usually not dealt by generic driver but by HDMI codec driver.


Takashi
diff mbox

Patch

diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index e6fee7a..3dcb241 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -956,21 +956,39 @@  static struct snd_soc_dai_driver skl_platform_dai[] = {
 	},
 },
 {
-	.name = "HD-Codec Pin",
+	.name = "Analog CPU DAI",
 	.ops = &skl_link_dai_ops,
 	.playback = {
-		.stream_name = "HD-Codec Tx",
-		.channels_min = HDA_STEREO,
+		.stream_name = "Analog CPU Playback",
+		.channels_min = HDA_MONO,
 		.channels_max = HDA_STEREO,
 		.rates = SNDRV_PCM_RATE_48000,
-		.formats = SNDRV_PCM_FMTBIT_S16_LE,
+		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
 	},
 	.capture = {
-		.stream_name = "HD-Codec Rx",
-		.channels_min = HDA_STEREO,
+		.stream_name = "Analog CPU Capture",
+		.channels_min = HDA_MONO,
 		.channels_max = HDA_STEREO,
 		.rates = SNDRV_PCM_RATE_48000,
-		.formats = SNDRV_PCM_FMTBIT_S16_LE,
+		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
+	},
+},
+{
+	.name = "Digital CPU DAI",
+	.ops = &skl_link_dai_ops,
+	.playback = {
+		.stream_name = "Digital CPU Playback",
+		.channels_min = HDA_MONO,
+		.channels_max = HDA_STEREO,
+		.rates = SNDRV_PCM_RATE_48000,
+		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
+	},
+	.capture = {
+		.stream_name = "Digital CPU Capture",
+		.channels_min = HDA_MONO,
+		.channels_max = HDA_STEREO,
+		.rates = SNDRV_PCM_RATE_48000,
+		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
 	},
 },
 };