Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1281839rwe; Thu, 25 Aug 2022 20:53:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR42yzFBtxPHg+tatT2c5EvvW0Xt7OvLjMgDQG5d72gcsDnujVfNDtqebn5WJTlJoFSju7im X-Received: by 2002:a63:6a05:0:b0:42a:3b5d:8084 with SMTP id f5-20020a636a05000000b0042a3b5d8084mr1731082pgc.281.1661486030958; Thu, 25 Aug 2022 20:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661486030; cv=none; d=google.com; s=arc-20160816; b=hlsjLSAd4X6VHBZU+KjpPCrM4VO/JJLpGYFHCQkIo+vxUQq3T6e9uVtvEHEukC2cQu omtyCgPZHn+CShmqVXioAGeQUQWqxlgRqY3VpogohVhqYNg+dY3bk3VDCRHADwL+14kO bu3matScxoiyBqV2esb6MI0VGaiURlHCro6dRj2ad5cGpS/NXAuvpfgTh1WYOkL7ctXQ ZA1P0UL/poa9HZCjheOpuNQbP7k1hl51JICrne5TWaKTQWuOaOIwJSBKpa26g9LT7Rio 7cvrDV6fjd7UZitiUZxFbPWRzSrc4/ZOXx93g3IXH35doVrwD4fGzCYrl3AaaOYgqV8i 1D5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:feedback-id:dkim-signature:dkim-signature; bh=ml0QXgJ11ruYlZ5YBTcNNwBdbFxRHL+i328CjCLIyDQ=; b=1EFGKuz7vC6Py7e3QclUKfewUCc21SwB6FK4XZDTGO6+aXDH4hUiGdkU9NbmtXe2VY C/MFXcZ/s4SshotRoUhhQOJOnQWipXd07fm8/2O0hpKs58i1BhcYbvGkgX2zUi8JaEdi ckPy7hEtgBuyQ5TucM1tybREjtLcelnIKrT4eSK/nFJrD2Wi+usccraEXQ2t9QLB2HhN YL3KssG38jeWRgwo7Ne/LsIhRMWtYbADzCz9rDFLb5UbrgzeGcRN0180HBVBIRsBWoZL jXcdsS0ta7dGODJPaxHpDDlj+DWaJKkhlIIsV3Y2QVCjCmy+eYFmquEPfIjRHURr7c3n E9mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=ErudUJeo; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=k7jTPLkA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a635602000000b0042b4c537b6dsi762618pgb.473.2022.08.25.20.53.40; Thu, 25 Aug 2022 20:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=ErudUJeo; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=k7jTPLkA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243720AbiHZDfq (ORCPT + 99 others); Thu, 25 Aug 2022 23:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiHZDfk (ORCPT ); Thu, 25 Aug 2022 23:35:40 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432BAC7412 for ; Thu, 25 Aug 2022 20:35:39 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 048F53200A5A; Thu, 25 Aug 2022 23:35:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 25 Aug 2022 23:35:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1661484935; x= 1661571335; bh=ml0QXgJ11ruYlZ5YBTcNNwBdbFxRHL+i328CjCLIyDQ=; b=E rudUJeoAWxjsiGudYFg/YqyOI1UcDJYDuAlZvPjSs/8nnR+3qtXp0cqbzV5QjLgY 6Bn/1zavNXJegVdtEWVuBt5Hhe2DU6xpmkiOmkCynMN/zIr55nh51mANZBC6cxFe 0MVugqYnZRc4aDAVy1+hiapL4FfN2ShEzvK1tMG3z3ma1ZZSW3HPG8BExmtZ86Ly EdAlJpVJrW22Wr9WzFj+XTNNLt7nUzO2FlbpUvxscxdOXDyyHXO3dRHfV3W+ESwf v3MVVREIx3lRwbo9KYHTw0rX+bItIR9CLZTqpffcAsACXeXXd4zuPJIHAPM75275 osI3e2wyd4XuK1yMCqAjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1661484935; x= 1661571335; bh=ml0QXgJ11ruYlZ5YBTcNNwBdbFxRHL+i328CjCLIyDQ=; b=k 7jTPLkA1GPCOeTF315UggtQcrak/RA7HRfKj+M6s5YwS0fVDo9M9Q33hGbASCCV2 pWPdtYOabfbGXyzBZ3rNGZWXiRSKpYtOVT8y0Q7IKFBghFlLNb7wYmI0bdudixRZ opE4/iC5qfes23b2iSGKs8z6rqND+EVLi7Nk7NGkfWX0M7uGvWdilr/3+/Jtez0z Leo0hDndSftiUlEACjaHJpIFjjB6hcheWukJqMK5+MR3E6Dfn8oPOfRFEEZuHq3j Ls7af1+rMsfC9s1UX8pBI31ogw7+ZlI7gv4wXNpDYs4wd4bKnqvxxV6esvn/KdPk dSbTzH5NEkHeENDstf6DA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejgedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfevfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghl sehshhholhhlrghnugdrohhrgheqnecuggftrfgrthhtvghrnhepleeiheeggedtieeugf effffhvdelkefgheetheehffevteffheejiefgffehtdehnecuffhomhgrihhnpehlihhn uhigqdhsuhhngihirdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Aug 2022 23:35:34 -0400 (EDT) Subject: Re: [PATCH v8 1/2] ASoC: sunxi: Add Allwinner H6 Digital MIC driver To: =?UTF-8?B?54+t5rab?= Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, wens@csie.org, jernej.skrabec@gmail.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev References: <1660229343-14133-1-git-send-email-fengzheng923@gmail.com> <3fb9adb7-96ef-c85e-069d-ef7f7ff09bc3@sholland.org> From: Samuel Holland Message-ID: Date: Thu, 25 Aug 2022 22:35:33 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/23/22 10:08 AM, 班涛 wrote: > Samuel Holland 于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