Message ID | 20240221-rk3308-audio-codec-v3-3-dfa34abfcef6@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-74520-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp949981dyc; Wed, 21 Feb 2024 02:31:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWXkQzEbI4q5ARuOVM6Yq9tNFaqvCsd1fbSeCHrC/k5OFw27pKWTtaiDDYp8FXRl3RRfeW4XKFyAvOwQoV+Flfx1bemeA== X-Google-Smtp-Source: AGHT+IG/7IMHRjef467zakvQDg/u7rbZHzgPJmkzgnu73+eeXiaDe+P7vmK+IgYzSK7WXRrvhyrf X-Received: by 2002:a05:6a00:80d4:b0:6e2:de02:598e with SMTP id ei20-20020a056a0080d400b006e2de02598emr9573461pfb.33.1708511495376; Wed, 21 Feb 2024 02:31:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708511495; cv=pass; d=google.com; s=arc-20160816; b=Ky8tbR47cCBIjsmQzy4SgvVkiHNMtz5PpjcrN94zPa8E3zHQuf2p50XMst7PtSx1Lz ZTqHhqYVLPbuNi7tuzKO+4CjnxPHT1H5bECSdM84gALJh8K2T7y3HRWhEwvXg0HWOtxE glizFZpm0rGgrCekDrrzVFQ8mxIfOxOdvHsS1tBnMXO8kPyt3cdfzyNVorwIufP/oJXH hvLicog0/8ijDuD1zcdzBHAaZQqg4BdF6S9Sb9vSO8I7jHRTNLNZ/JjtsI7Qq+g/2m87 odetMjaMN6LVqYrwOmalHz2oB3uYMm4zQBYMDCS7SMa/trMZlZffpYUrXtf4NwMLtVqR gpJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=KUrik2L/XdfT2NBxFB5is5OzPEkx0nf8lGt/JdUz6EE=; fh=YBpXnBz4z5WTNuRpmEjjmJAYZAysFFiStO3A7cE8DhM=; b=wlIVLCoGMM4MqZMflHcMNR+A0fxguxMQXx1bJ3QXSnbc8uSGhJckO0VXQXEM+yAJcU jus+TPa+tuwSgkk5qeyTKzT+UXXdZP28AzpSSsT5fIQLQMGvLHweeByT4DhREMcePT60 hbPNXZjaKMKadtwCLUhGJAYNf0eoJa+zRvtdFjFQ4LeyJwgGy2UUXxU1wPk6PXvAMP+4 XDrinQMiNrRhpACQRoYWeCsSiPisTa5wBpHiEHcE/eIx8adlBTMa6POhD24wtXzsrir5 xpQUQ9ChsIRlSspOgJyJG5hMufV8OzSOqZw2WaRKHcHTA2XqWHL+1XoRiYydX03bs/E7 /D7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=T3fUK25O; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-74520-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74520-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i12-20020a056a00004c00b006e0eff486f4si7202614pfk.61.2024.02.21.02.31.35 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 02:31:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74520-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=T3fUK25O; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-74520-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74520-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 223AD288EEF for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 10:24:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 933293F9F0; Wed, 21 Feb 2024 10:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="T3fUK25O" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EF2F3E470; Wed, 21 Feb 2024 10:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708510995; cv=none; b=H4ANatPPscqMNKGh38OpX2eJ0oHSnNeo9TAksqDHY0/RNDvTVfUwmOouiXZ/cyPsDk4WA3elSbK0Ymyu1u5HpENHbnFQ/BipHt5rqDe/VZB04N3Sy43KYPFqRijOZsUum9JSLj4Am/dmmSQo35TiAHqaN79jqbqANE0GbdS6U84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708510995; c=relaxed/simple; bh=wSlFXJNr/cmsVO2H+EFpGOVDsAhGPl+1vkHJEhpG3ME=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a++UT7n1n6zwe3M08UZ8NHTk9EwWCZu/b2GO1KpcPBijmSF1KK90f6xUAd+FyCnyJYugYvVVvlxJb+tiPagzSsWk2ISGRfbc7xUUoMdTzhrtrJPkvrXNIHRVdyTTyoY3EdJpA8qmu46fstiUBjPNIvGp1RDlTKRZyoJY75BVTT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=T3fUK25O; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 67DCF240003; Wed, 21 Feb 2024 10:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708510991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUrik2L/XdfT2NBxFB5is5OzPEkx0nf8lGt/JdUz6EE=; b=T3fUK25OtBYlXiQ83D6l9qjN93jlVX6k3Kec8Ptp0EUERId6w8rla6gdrSKst+wK+d/olU Q90Lv7Of5QpOxyCm13N3TOSKhcCgemYWUIx/uYP9rFE/QzC9OgdLVJgWuIu1LWfUEzCxtI MxWSf6AJmLLGKmXMYNzTd9ZOwOhurcXnvMaUtSvLW7itf1dg86CA4BjplAZ5356+HTVSXL X9tbFw2uIU8upxI5cNYFgzweonS5yNewyzMMrIoZuAqW/CY/cAVQaPndAiq1vW8ziB5K66 yXbNeWU90Gtw1/WXGJ/xjCQix7HOuYHadzGKov1DxDdIevZs0bwMbDM/ixYCeA== From: Luca Ceresoli <luca.ceresoli@bootlin.com> Date: Wed, 21 Feb 2024 11:22:47 +0100 Subject: [PATCH v3 3/7] ASoC: core: add SOC_DOUBLE_RANGE_TLV() helper macro Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240221-rk3308-audio-codec-v3-3-dfa34abfcef6@bootlin.com> References: <20240221-rk3308-audio-codec-v3-0-dfa34abfcef6@bootlin.com> In-Reply-To: <20240221-rk3308-audio-codec-v3-0-dfa34abfcef6@bootlin.com> To: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Heiko Stuebner <heiko@sntech.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, linux-rockchip@lists.infradead.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Ceresoli <luca.ceresoli@bootlin.com> X-Mailer: b4 0.12.4 X-GND-Sasl: luca.ceresoli@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791504149610951577 X-GMAIL-MSGID: 1791504149610951577 |
Series |
Add support for the internal RK3308 audio codec
|
|
Commit Message
Luca Ceresoli
Feb. 21, 2024, 10:22 a.m. UTC
No macro currently allows handling a stereo control that has left and right
in the same register and whose minimum register value is not zero. Add one
that does that.
Note that even though the snd_soc_*_volsw_range() look more appropriate
given the _range suffix, they are not suitable because they don't honor the
two shift values. The snd_soc_*_volsw() look more generic and are suitable
for the task.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changed in v3: nothing
This patch is new in v2.
---
include/sound/soc.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 6defc5547ff9..7492315ce0b8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -149,6 +149,18 @@ {.reg = xreg, .rreg = xreg, \ .shift = shift_left, .rshift = shift_right, \ .max = xmax, .min = xmin} } +#define SOC_DOUBLE_RANGE_TLV(xname, xreg, xshift_left, xshift_right, xmin, xmax, \ + xinvert, tlv_array) \ +{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ + .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ + SNDRV_CTL_ELEM_ACCESS_READWRITE,\ + .tlv.p = (tlv_array), \ + .info = snd_soc_info_volsw, \ + .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ + .private_value = (unsigned long)&(struct soc_mixer_control) \ + {.reg = xreg, .rreg = xreg, \ + .shift = xshift_left, .rshift = xshift_right, \ + .min = xmin, .max = xmax, .invert = xinvert} } #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\