Message ID | 20200814053926.10789-2-hui.wang@canonical.com |
---|---|
State | New |
Headers | show |
Series | alsa/sof: support 1 and 3 dmics | expand |
On 14.08.20 07:39, Hui Wang wrote: > From: Jaska Uimonen <jaska.uimonen@linux.intel.com> > > BugLink: https://bugs.launchpad.net/bugs/1891585 > > Currently the dmic check code supports only devices with 2 or 4 dmics. > With other dmic counts the function will return 0. Lately we've seen > devices with only 1 dmic thus enable also configurations with 1, and > possibly 3, dmics. Add also topology postfix -1ch and -3ch for new dmic > configuration. > > Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> > (Cherry picked from b38e6b9033485f7e662f3a0067fae0ee560c11e4 > git://github.com/thesofproject/linux.git) > Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Stefan Bader <stefan.bader@canonical.com> > --- With additional clarification in this thread. > sound/soc/sof/intel/hda.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c > index d051d0b45168..a61218381119 100644 > --- a/sound/soc/sof/intel/hda.c > +++ b/sound/soc/sof/intel/hda.c > @@ -544,7 +544,7 @@ static int check_nhlt_dmic(struct snd_sof_dev *sdev) > if (nhlt) { > dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); > intel_nhlt_free(nhlt); > - if (dmic_num == 2 || dmic_num == 4) > + if (dmic_num >= 1 && dmic_num <= 4) > return dmic_num; > } > > @@ -992,9 +992,15 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev) > dmic_num = hda_dmic_num; > > switch (dmic_num) { > + case 1: > + dmic_str = "-1ch"; > + break; > case 2: > dmic_str = "-2ch"; > break; > + case 3: > + dmic_str = "-3ch"; > + break; > case 4: > dmic_str = "-4ch"; > break; >
On Fri, Aug 14, 2020 at 01:39:26PM +0800, Hui Wang wrote: > From: Jaska Uimonen <jaska.uimonen@linux.intel.com> > > BugLink: https://bugs.launchpad.net/bugs/1891585 > > Currently the dmic check code supports only devices with 2 or 4 dmics. > With other dmic counts the function will return 0. Lately we've seen > devices with only 1 dmic thus enable also configurations with 1, and > possibly 3, dmics. Add also topology postfix -1ch and -3ch for new dmic > configuration. > > Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> > (Cherry picked from b38e6b9033485f7e662f3a0067fae0ee560c11e4 > git://github.com/thesofproject/linux.git) > Signed-off-by: Hui Wang <hui.wang@canonical.com> Note that this should be "cherry picked from ..." rather than what you have. We have scripts that expect the format from 'git cherry-pick -x', so it's recommended you use that. With this fixed: Acked-by: Seth Forshee <seth.forshee@canonical.com> Applied to groovy/master-next, thanks!
On 2020/8/15 上午4:02, Seth Forshee wrote: > On Fri, Aug 14, 2020 at 01:39:26PM +0800, Hui Wang wrote: >> From: Jaska Uimonen <jaska.uimonen@linux.intel.com> >> >> BugLink: https://bugs.launchpad.net/bugs/1891585 >> >> Currently the dmic check code supports only devices with 2 or 4 dmics. >> With other dmic counts the function will return 0. Lately we've seen >> devices with only 1 dmic thus enable also configurations with 1, and >> possibly 3, dmics. Add also topology postfix -1ch and -3ch for new dmic >> configuration. >> >> Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> >> (Cherry picked from b38e6b9033485f7e662f3a0067fae0ee560c11e4 >> git://github.com/thesofproject/linux.git) >> Signed-off-by: Hui Wang <hui.wang@canonical.com> > Note that this should be "cherry picked from ..." rather than what you > have. We have scripts that expect the format from 'git cherry-pick -x', > so it's recommended you use that. With this fixed: > > Acked-by: Seth Forshee <seth.forshee@canonical.com> > > Applied to groovy/master-next, thanks! OK, got it. thanks.
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index d051d0b45168..a61218381119 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -544,7 +544,7 @@ static int check_nhlt_dmic(struct snd_sof_dev *sdev) if (nhlt) { dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); intel_nhlt_free(nhlt); - if (dmic_num == 2 || dmic_num == 4) + if (dmic_num >= 1 && dmic_num <= 4) return dmic_num; } @@ -992,9 +992,15 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev) dmic_num = hda_dmic_num; switch (dmic_num) { + case 1: + dmic_str = "-1ch"; + break; case 2: dmic_str = "-2ch"; break; + case 3: + dmic_str = "-3ch"; + break; case 4: dmic_str = "-4ch"; break;