From: Samuel Holland <samuel@sholland.org>
To: 班涛 <fengzheng923@gmail.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
tiwai@suse.com, jernej.skrabec@gmail.com, lgirdwood@gmail.com,
wens@csie.org, broonie@kernel.org, linux-sunxi@lists.linux.dev,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v8 1/2] ASoC: sunxi: Add Allwinner H6 Digital MIC driver
Date: Thu, 25 Aug 2022 22:35:33 -0500 [thread overview]
Message-ID: <b36262df-9324-6cd3-b74c-5b93840dabb0@sholland.org> (raw)
In-Reply-To: <CAE=m618gz8mzRnvX-w6fpNmTc=5Bd0KTKeR1NvpNZkbj29=ayg@mail.gmail.com>
On 8/23/22 10:08 AM, 班涛 wrote:
> Samuel Holland <samuel@sholland.org> 于2022年8月20 日周六 14:57写道:
> On 8/11/22 9:49 AM, Ban Tao wrote:
> > + switch (params_format(params)) {
> > + case SNDRV_PCM_FORMAT_S16_LE:
> > + regmap_update_bits(host->regmap, SUN50I_DMIC_RXFIFO_CTL,
> > + SUN50I_DMIC_RXFIFO_CTL_SAMPLE_MASK,
> > + SUN50I_DMIC_RXFIFO_CTL_SAMPLE_16);
> > + break;
> > + case SNDRV_PCM_FORMAT_S24_LE:
> > + regmap_update_bits(host->regmap, SUN50I_DMIC_RXFIFO_CTL,
> > + SUN50I_DMIC_RXFIFO_CTL_SAMPLE_MASK,
> > + SUN50I_DMIC_RXFIFO_CTL_SAMPLE_24);
> > + break;
> > + default:
> > + dev_err(cpu_dai->dev, "Invalid format!\n");
> > + return -EINVAL;
> > + }
> > + regmap_update_bits(host->regmap, SUN50I_DMIC_RXFIFO_CTL,
> > + SUN50I_DMIC_RXFIFO_CTL_MODE_MASK,
> > + SUN50I_DMIC_RXFIFO_CTL_MODE_MSB);
>
> I checked the manuals again, and I may have given you bad information. There
> appear to be two variants of the DMIC hardware.
>
> A63, H6, V5 V100, and V5x6 manuals list Mode 1 as "reserved" for a 24-bit sample
> resolution. The newer SoCs (A50, A133, D1, H616, and R329) describe Mode 1 as
> extending the 21-bit sample with three zeros at the LSB to make 24 bits, which
> is what we want.
>
> On my D1 board, recording in S24_LE gives me good audio data, with equivalent
> loudness to S16_LE, as I would expect. If this also works on older SoCs like H6,
> then the manual is wrong, and the driver is fine.
>
>
> I checked the H6 manual, DMIC also supports 24bits. The H6 SoC works fine in
> mode 1. I don't know where your manual came from, mine is provided by SUNXI.
I am referencing the manual linked from the linux-sunxi wiki, section 7.4.5.7:
https://linux-sunxi.org/images/4/46/Allwinner_H6_V200_User_Manual_V1.1.pdf
For 24-bit received audio sample:
Mode 0: RXDATA[31:0] = {FIFO_O[23:0], 8'h0}
Mode 1: Reserved
Since the manual is wrong, could you please add a comment? Something like "The
hardware supports FIFO mode 1 for 24-bit samples, even though the H6 manual
describes that combination as reserved."
Regards,
Samuel
next prev parent reply other threads:[~2022-08-26 3:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 14:49 [PATCH v8 1/2] ASoC: sunxi: Add Allwinner H6 Digital MIC driver Ban Tao
2022-08-20 6:57 ` Samuel Holland
2022-08-23 15:08 ` 班涛
2022-08-26 3:35 ` Samuel Holland [this message]
[not found] ` <73dceca7-5244-ffa6-6ead-d4de84584b68@linux.intel.com>
2022-08-23 15:05 ` 班涛
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=b36262df-9324-6cd3-b74c-5b93840dabb0@sholland.org \
--to=samuel@sholland.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=fengzheng923@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=tiwai@suse.com \
--cc=wens@csie.org \
/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;
as well as URLs for NNTP newsgroup(s).