public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "N, Harshapriya" <harshapriya.n@intel.com>,
	"Łukasz Majczak" <lma@semihalf.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Jie Yang <yang.jie@linux.intel.com>,
	Radoslaw Biernacki <rad@semihalf.com>,
	Ross Zwisler <zwisler@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	"M R, Sathya Prakash" <sathya.prakash.m.r@intel.com>,
	Bob Brandt <brndt@google.com>, Marcin Wojtas <mw@semihalf.com>,
	Alex Levin <levinale@chromium.org>
Subject: Re: [PATCH v3] ASoC: Intel: kbl_rt5663_rt5514_max98927: Split be_hw_params_fixup function
Date: Wed, 1 Jul 2020 11:48:16 -0500	[thread overview]
Message-ID: <7e38bb2e-2132-d305-e94d-043fa53bd836@linux.intel.com> (raw)
In-Reply-To: <BY5PR11MB4307C20278F32D17551112FAFD6C0@BY5PR11MB4307.namprd11.prod.outlook.com>



On 7/1/20 11:37 AM, N, Harshapriya wrote:
>>
>>>> For speakers and headsets its 48Khz, 2 ch and 24 bit and this
>>>> setting is done based on the front-end dai For speakers, however
>>>> support only
>>>> 16 bit, so we set it back to 16 bit If the front end dai is dmic,
>>>> then the channel
>>> is set to either 2 or 4 dmic_constraints. No other formats need to be set.
>>>>
>>>> All the SSP1 usages do not have the same parameters (as dmic is on
>>>> SSP1 and its different as given above) Most parameters are same for
>>> speakers and headset which are on different SSP. This is the reason we
>>> had a single fixup function.
>> On SSP1, for dmic we need to fix the channels which is derived from dmic_num
>> of the snd_soc_acpi_mach structure based on the number of dmic on the
>> board.
>> The channel is something that might be different from speakers.
>> We might not want to constraint the dmic capture to always be 48Khz as well.
>> Given this, there seems to me, 2 ways to set it:
>> 1. Derive if the fixup is being called for dmic or speaker 2. Having a new dailink
>>
>> If #2 is not preferred (going by Pierre's comments), can we use rtd-
>>> cpu_dai/codec_dai->name to figure out if its for dmic or speaker?
>> I can test this and get back to you.
> Tested and the following is something we can use without creating a new dailink.
>         	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
> 	if (!strcmp(codec_dai->name, KBL_REALTEK_DMIC_CODEC_DAI)) {
> 		if (params_channels(params) == 2 ||  DMIC_CH(dmic_constraints) == 2)
> 			channels->min = channels->max = 2;
> 		else
> 			channels->min = channels->max = 4;
> 	} else {
> 		rate->min = rate->max = 48000;
> 		channels->min = channels->max = 2;
> 		snd_mask_none(fmt);
> 		snd_mask_set_format(fmt, pcm_fmt);
> 	}
> 
> Pierre, thoughts?

thanks Harsha, that looks like what I had in mind, but my earlier 
question was why we deal with the rates and formats only in the last case?


  reply	other threads:[~2020-07-01 16:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 16:25 [PATCH v3] ASoC: Intel: kbl_rt5663_rt5514_max98927: Split be_hw_params_fixup function Lukasz Majczak
2020-05-21 16:32 ` Pierre-Louis Bossart
2020-05-21 17:08   ` Łukasz Majczak
2020-05-21 17:17     ` Pierre-Louis Bossart
2020-05-21 17:30       ` Łukasz Majczak
2020-05-21 18:10         ` Pierre-Louis Bossart
2020-06-29 11:11           ` Łukasz Majczak
2020-06-29 16:51             ` N, Harshapriya
2020-06-29 18:19               ` Łukasz Majczak
2020-06-29 22:30                 ` N, Harshapriya
2020-07-01 16:37                   ` N, Harshapriya
2020-07-01 16:48                     ` Pierre-Louis Bossart [this message]
2020-07-01 17:00                       ` N, Harshapriya
2020-07-01 17:08                         ` Pierre-Louis Bossart
2020-07-02 10:09                           ` Łukasz Majczak
2020-07-03 12:16 ` [PATCH v4] ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function Lukasz Majczak
2020-07-06 15:41   ` Pierre-Louis Bossart
2020-07-07  8:34   ` [PATCH v5] " Lukasz Majczak
2020-07-07 15:47     ` Pierre-Louis Bossart
2020-07-16 15:00       ` N, Harshapriya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e38bb2e-2132-d305-e94d-043fa53bd836@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brndt@google.com \
    --cc=harshapriya.n@intel.com \
    --cc=levinale@chromium.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lma@semihalf.com \
    --cc=mw@semihalf.com \
    --cc=rad@semihalf.com \
    --cc=sathya.prakash.m.r@intel.com \
    --cc=yang.jie@linux.intel.com \
    --cc=zwisler@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox