From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFC81C4345F for ; Mon, 29 Apr 2024 20:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S4OLKPcYrQhm2o07lhfZ/wpO4rlwBO0QSv/JG9VMO3k=; b=sNw6NB9h4+MT1c vAoqeIAqMw3rBPwWfcdNiZlOZtacIxkZJYOr8D0npdB8TENQpbd0oJy4I0b/UV4rDeGAnxA7/9YxZ ZGga7Q2Ejapk96KRZTkKBbGD7hxq/pgWJSQ97XCgn71k2EAyBVWM77QqZ0mh3TqJhHHvLmMQZ/DFK 33aSfSrXeLm77Zc3bFxLyUWA+kCTEcOZWp7SaELDpP98+ZotL4gz6d0Wp07QWCHMbagZQDgoS3B9i kpUSqgaLWFzB65p8mUTHkGMqsNDQKAT5ojdr5ZEoqjQ+pJZBvIf6kbZCrlcJBrZ+Y8JsiHV75PDBi YTYHpOQL3byYpUE78kmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1XCu-000000046sV-36IC; Mon, 29 Apr 2024 20:02:36 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1XCs-000000046pP-0I03 for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 20:02:35 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a58e2740cd7so425597466b.1 for ; Mon, 29 Apr 2024 13:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714420946; x=1715025746; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VsKE8r7F5xni1GwzY6+eg4w0O41Z5E2Stz6sTWPm390=; b=We5n0zItrr02LWmiAoaEkNTJHINY3REqfqiJZXhh6hhkNJ6kIl4dYkdnNd3qqbdUNK NDBNu4kQs/18SHlU/qlO0KuvSvSNbdVBGWaoENsJJe2DM6Oe3lAHGcJwTcId3YCMWFE2 jD7UcHF/rPTvCdzq8aDWSR/YcwHe9NanxrNu9OXrPJKjA+IhYyiDymUXCgARHWwYPDCa 7rGf/Amqc+wr8pe7NvIfYC0/J68QSVkJMRzmsGFS7/AcXCePi1hicnwIhUbMKL+uOMGT wdG5DslVTIBpPdWO9etRD0/LlA4aFH8O7+aRP8+mJZmcoe8yDgQhZiMZiDQyZjNrL+FY 9/hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714420946; x=1715025746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VsKE8r7F5xni1GwzY6+eg4w0O41Z5E2Stz6sTWPm390=; b=NBuRWotK7ETWiV6gXHyt6gbIG6CKCgmGsQBpqh7qYRHorvHk8cp4A5BF1ySfYKHEZO a6M25SP9bfKvl/ovM1hzM0uDXMOMUfQbU11wpY+XqKhSSGNHsrjTftkY77zerFFX9zn7 vC/Nmz/Gut6E7deCzG7nLzgwYJjOzgpYKSzNnHFDHhrQItrff5NC1RhsAUfO5fNwP3Ap FYfvAVtfk+DgR8YPscqUq0iteYnXGkhFvDGBIOh4FpUYYojHLSRVmAQ220pqodb8RCCO IgEOnsV/7/QOU9R/DEGDytx1eXHg3uARBdBsNkOE6fXuXWmFRBb1oy6DLnP15fcqgqu8 vvLQ== X-Forwarded-Encrypted: i=1; AJvYcCVtMbAkU7AFOVACi1oRmht9OISdOGqSxam56RNQcxIqYadwYNoMacmC49NKcQe9tfDT2Z3rwx3cO4+3vbPXs/S2LLF/IO6QO6NGCGwqOuNPcy8YLMc= X-Gm-Message-State: AOJu0YyASLjF829x/7FMGk8yFy1IKwxqZjo8RcSEXqNS+BT5X/UnDItz IijPAJfTA25WVJjD6bbp5NIIKruX+qQ/kscS7XenyEXrqv6YDtvk X-Google-Smtp-Source: AGHT+IHIKx0SyAjsW4Smx5uzNZpKk0OnRHPvT5Zv6XPyI3hdLPyaGW8TdxmJ1VY4Gefq40RqnxSymg== X-Received: by 2002:a17:907:7e9e:b0:a58:e8cf:664f with SMTP id qb30-20020a1709077e9e00b00a58e8cf664fmr718919ejc.23.1714420945336; Mon, 29 Apr 2024 13:02:25 -0700 (PDT) Received: from jernej-laptop.localnet (86-58-6-171.dynamic.telemach.net. [86.58.6.171]) by smtp.gmail.com with ESMTPSA id r20-20020a170906705400b00a555ef55ab5sm14215787ejj.218.2024.04.29.13.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 13:02:24 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Ban Tao , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Chen-Yu Tsai , Samuel Holland , Joao Schim Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ASoC: sunxi: DMIC: Add controls for adjusting the mic gains Date: Mon, 29 Apr 2024 22:02:23 +0200 Message-ID: <2931892.e9J7NaK4W3@jernej-laptop> In-Reply-To: <20240429194920.1596257-1-joao@schimsalabim.eu> References: <20240429194920.1596257-1-joao@schimsalabim.eu> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_130234_144120_1FA63E93 X-CRM114-Status: GOOD ( 19.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dne ponedeljek, 29. april 2024 ob 21:49:20 GMT +2 je Joao Schim napisal(a): > The AllWinner H6 and later SoCs that sport a DMIC block contain a set of registers to control > the gain (left + right) of each of the four supported channels. > > Add ASoC controls for changing each of the stereo channel gains using alsamixer and alike > > Signed-off-by: Joao Schim Reviewed-by: Jernej Skrabec Best regards, Jernej > --- > sound/soc/sunxi/sun50i-dmic.c | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/sound/soc/sunxi/sun50i-dmic.c b/sound/soc/sunxi/sun50i-dmic.c > index c76628bc86c6..dd32780fb6a4 100644 > --- a/sound/soc/sunxi/sun50i-dmic.c > +++ b/sound/soc/sunxi/sun50i-dmic.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > > #define SUN50I_DMIC_EN_CTL (0x00) > #define SUN50I_DMIC_EN_CTL_GLOBE BIT(8) > @@ -43,6 +44,17 @@ > #define SUN50I_DMIC_CH_NUM_N_MASK GENMASK(2, 0) > #define SUN50I_DMIC_CNT (0x2c) > #define SUN50I_DMIC_CNT_N (1 << 0) > +#define SUN50I_DMIC_D0D1_VOL_CTR (0x30) > + #define SUN50I_DMIC_D0D1_VOL_CTR_0R (0) > + #define SUN50I_DMIC_D0D1_VOL_CTR_0L (8) > + #define SUN50I_DMIC_D0D1_VOL_CTR_1R (16) > + #define SUN50I_DMIC_D0D1_VOL_CTR_1L (24) > +#define SUN50I_DMIC_D2D3_VOL_CTR (0x34) > + #define SUN50I_DMIC_D2D3_VOL_CTR_2R (0) > + #define SUN50I_DMIC_D2D3_VOL_CTR_2L (8) > + #define SUN50I_DMIC_D2D3_VOL_CTR_3R (16) > + #define SUN50I_DMIC_D2D3_VOL_CTR_3L (24) > + > #define SUN50I_DMIC_HPF_CTRL (0x38) > #define SUN50I_DMIC_VERSION (0x50) > > @@ -273,8 +285,30 @@ static const struct of_device_id sun50i_dmic_of_match[] = { > }; > MODULE_DEVICE_TABLE(of, sun50i_dmic_of_match); > > +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(sun50i_dmic_vol_scale, -12000, 75, 1); > + > +static const struct snd_kcontrol_new sun50i_dmic_controls[] = { > + > + SOC_DOUBLE_TLV("DMIC Channel 0 Capture Volume", SUN50I_DMIC_D0D1_VOL_CTR, > + SUN50I_DMIC_D0D1_VOL_CTR_0L, SUN50I_DMIC_D0D1_VOL_CTR_0R, > + 0xFF, 0, sun50i_dmic_vol_scale), > + SOC_DOUBLE_TLV("DMIC Channel 1 Capture Volume", SUN50I_DMIC_D0D1_VOL_CTR, > + SUN50I_DMIC_D0D1_VOL_CTR_1L, SUN50I_DMIC_D0D1_VOL_CTR_1R, > + 0xFF, 0, sun50i_dmic_vol_scale), > + SOC_DOUBLE_TLV("DMIC Channel 2 Capture Volume", SUN50I_DMIC_D2D3_VOL_CTR, > + SUN50I_DMIC_D2D3_VOL_CTR_2L, SUN50I_DMIC_D2D3_VOL_CTR_2R, > + 0xFF, 0, sun50i_dmic_vol_scale), > + SOC_DOUBLE_TLV("DMIC Channel 3 Capture Volume", SUN50I_DMIC_D2D3_VOL_CTR, > + SUN50I_DMIC_D2D3_VOL_CTR_3L, SUN50I_DMIC_D2D3_VOL_CTR_3R, > + 0xFF, 0, sun50i_dmic_vol_scale), > + > + > +}; > + > static const struct snd_soc_component_driver sun50i_dmic_component = { > .name = "sun50i-dmic", > + .controls = sun50i_dmic_controls, > + .num_controls = ARRAY_SIZE(sun50i_dmic_controls), > }; > > static int sun50i_dmic_runtime_suspend(struct device *dev) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel