From patchwork Mon May 8 11:30:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 680548 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 CCB09C7EE22 for ; Wed, 10 May 2023 06:33:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3132F1046; Wed, 10 May 2023 08:32:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3132F1046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683700410; bh=xUvh+PRl/XdMVBeVeCBd3bv7Ap8clPKGRiK9O1aBMR8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=HyodaMY8xnre4XJ6iv3B7IXR2vOZuLmYpwYk2wN/6jwVXCCJ6/YXEy5yKSyG8Icr1 4t+GvWM4xIot92WY9duqzMFnbxPxbk1CIvmuJhLrSq6oLFZLGSsAYoUKPKaiy+Imba OlDU/db4jwpfk9E5C10DD+UrndV+SBuvtajHW9a4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9F354F80557; Wed, 10 May 2023 08:32:20 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH v2 2/7] ASoC: Add Google Chameleon v3 codec driver Date: Mon, 8 May 2023 13:30:32 +0200 In-Reply-To: <20230508113037.137627-1-pan@semihalf.com> References: <20230508113037.137627-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Wed, 10 May 2023 06:32:16 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168370033806.26.12147904079723720510@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, amstan@chromium.org, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add driver for the codec IP present on Google Chameleon v3 Signed-off-by: Paweł Anikiel --- sound/soc/codecs/Kconfig | 8 +++++++ sound/soc/codecs/Makefile | 2 ++ sound/soc/codecs/chv3-codec.c | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 sound/soc/codecs/chv3-codec.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 79d2362ad055..f8f15e96ade5 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -57,6 +57,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_AW88395 imply SND_SOC_BT_SCO imply SND_SOC_BD28623 + imply SND_SOC_CHV3_CODEC imply SND_SOC_CQ0093VC imply SND_SOC_CROS_EC_CODEC imply SND_SOC_CS35L32 @@ -643,6 +644,13 @@ config SND_SOC_BD28623 config SND_SOC_BT_SCO tristate "Dummy BT SCO codec driver" +config SND_SOC_CHV3_CODEC + tristate "Google Chameleon v3 codec driver" + help + Enable support for the Google Chameleon v3 audio codec. + This codec does not have a control interface, it always outputs + 8 channel S32_LE audio. + config SND_SOC_CPCAP tristate "Motorola CPCAP codec" depends on MFD_CPCAP || COMPILE_TEST diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index 5cdbae88e6e3..8cee836f4831 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -51,6 +51,7 @@ snd-soc-aw88395-objs := aw88395/aw88395.o \ aw88395/aw88395_device.o snd-soc-bd28623-objs := bd28623.o snd-soc-bt-sco-objs := bt-sco.o +snd-soc-chv3-codec-objs := chv3-codec.o snd-soc-cpcap-objs := cpcap.o snd-soc-cq93vc-objs := cq93vc.o snd-soc-cros-ec-codec-objs := cros_ec_codec.o @@ -425,6 +426,7 @@ obj-$(CONFIG_SND_SOC_AW88395_LIB) += snd-soc-aw88395-lib.o obj-$(CONFIG_SND_SOC_AW88395) +=snd-soc-aw88395.o obj-$(CONFIG_SND_SOC_BD28623) += snd-soc-bd28623.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o +obj-$(CONFIG_SND_SOC_CHV3_CODEC) += snd-soc-chv3-codec.o obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o obj-$(CONFIG_SND_SOC_CPCAP) += snd-soc-cpcap.o obj-$(CONFIG_SND_SOC_CROS_EC_CODEC) += snd-soc-cros-ec-codec.o diff --git a/sound/soc/codecs/chv3-codec.c b/sound/soc/codecs/chv3-codec.c new file mode 100644 index 000000000000..ab99effa6874 --- /dev/null +++ b/sound/soc/codecs/chv3-codec.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include +#include + +static struct snd_soc_dai_driver chv3_codec_dai = { + .name = "chv3-codec-hifi", + .capture = { + .stream_name = "Capture", + .channels_min = 8, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + }, +}; + +static const struct snd_soc_component_driver soc_component_dev_chv3_codec = { +}; + +static int chv3_codec_probe(struct platform_device *pdev) +{ + return devm_snd_soc_register_component(&pdev->dev, + &soc_component_dev_chv3_codec, &chv3_codec_dai, 1); +} + +static const struct of_device_id chv3_codec_of_match[] = { + { .compatible = "google,chv3-codec", }, + { } +}; + +static struct platform_driver chv3_codec_platform_driver = { + .driver = { + .name = "chv3-codec", + .of_match_table = chv3_codec_of_match, + }, + .probe = chv3_codec_probe, +}; +module_platform_driver(chv3_codec_platform_driver); + +MODULE_DESCRIPTION("ASoC Chameleon v3 codec driver"); +MODULE_AUTHOR("Pawel Anikiel "); +MODULE_LICENSE("GPL"); From patchwork Mon May 8 11:30:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 680549 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 97ED1C77B7D for ; Wed, 10 May 2023 06:33:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 938711050; Wed, 10 May 2023 08:32:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 938711050 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683700380; bh=FwbLxo5MbL87Z+TU5KDbhpd9RTa2B/77ghBu36ZoG6g=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=N2DIYB8ogQWkr9HiK0E4iyN/ItlmlSDMV2TGnfzvZS1vk/m4izCNd+OIC1+WLgsnN 7xzjgEDgADj3vGOhKvhqzTHWkvcFj/4N9t9GwpVBxpqqaRUGJH2H3SwHebneMweyFn zSH8ik6Ss4MygJ2dNdjAjm82E3UaCnEWnEqa1Pww= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C1E62F80544; Wed, 10 May 2023 08:30:59 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH v2 3/7] ASoC: dt-bindings: Add Google Chameleon v3 i2s device Date: Mon, 8 May 2023 13:30:33 +0200 In-Reply-To: <20230508113037.137627-1-pan@semihalf.com> References: <20230508113037.137627-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Wed, 10 May 2023 06:30:55 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168370025888.26.7471125901389928303@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, amstan@chromium.org, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add binding for google,chv3-i2s device. Signed-off-by: Paweł Anikiel --- .../bindings/sound/google,chv3-i2s.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml diff --git a/Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml b/Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml new file mode 100644 index 000000000000..3ce910f44d39 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 I2S device + +maintainers: + - Paweł Anikiel + +description: | + I2S device for the Google Chameleon v3. The device handles both RX + and TX using a producer/consumer ring buffer design. + +properties: + compatible: + const: google,chv3-i2s + + reg: + items: + - description: core registers + - description: irq registers + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include + + i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = ; + }; From patchwork Mon May 8 11:30:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 680547 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 16708C77B7D for ; Wed, 10 May 2023 06:33:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0DA2E1084; Wed, 10 May 2023 08:33:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0DA2E1084 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683700437; bh=7hkqB67ueLmc7zjVefLgn5oHsk7a99IQ4Vds3QR66DM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=ioIDFkQElXqi9ojlGsEb4suOcE/NTNx8F6CrIElTqlPvCoEq+jUckJt1s4malwKpt toBDPsIR4KlUsJD94OXTuaXuGW/RVA2QhGE9zPJPhBh/leRVt/bFSdIwy7A3ZlhtEL pkIZYWzHEWFkYTZM8CrL/fEzRM3pfwUZ0eBV47OA= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 43D8EF80568; Wed, 10 May 2023 08:32:22 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH v2 6/7] ARM: dts: chameleonv3: Add Chameleon v3 audio Date: Mon, 8 May 2023 13:30:36 +0200 In-Reply-To: <20230508113037.137627-1-pan@semihalf.com> References: <20230508113037.137627-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Wed, 10 May 2023 06:32:16 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168370034141.26.10571410279810810100@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, amstan@chromium.org, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add dts nodes for i2s, audio codec, and simple-audio-card devices. Signed-off-by: Paweł Anikiel --- .../boot/dts/socfpga_arria10_chameleonv3.dts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts index f0483ef46a36..a69819e26144 100644 --- a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +++ b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts @@ -15,6 +15,61 @@ aliases { i2c0 = &i2c0; i2c1 = &i2c1; }; + + soc { + i2s0: i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = ; + #sound-dai-cells = <0>; + }; + + i2s1: i2s@c0060400 { + compatible = "google,chv3-i2s"; + reg = <0xc0060400 0x100>, + <0xc0060f10 0x10>; + interrupts = ; + #sound-dai-cells = <0>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "chv3-audio"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,dai-link@0 { + reg = <0>; + cpu { + sound-dai = <&i2s0>; + }; + codec { + sound-dai = <&chv3_codec>; + }; + }; + + simple-audio-card,dai-link@1 { + reg = <1>; + format = "i2s"; + cpu { + sound-dai = <&i2s1>; + }; + codec { + sound-dai = <&ssm2603>; + bitclock-master; + frame-master; + system-clock-frequency = <22579200>; + mclk-fs = <512>; + }; + }; + }; + + chv3_codec: audio-codec { + compatible = "google,chv3-codec"; + #sound-dai-cells = <0>; + }; }; &gmac0 { @@ -39,6 +94,7 @@ &i2c0 { ssm2603: audio-codec@1a { compatible = "adi,ssm2603"; reg = <0x1a>; + #sound-dai-cells = <0>; }; };