From patchwork Fri Nov 26 16:17:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641065 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 1EAF3C433EF for ; Fri, 26 Nov 2021 16:22:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 474D61A9E; Fri, 26 Nov 2021 17:21:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 474D61A9E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943725; bh=4QPGnBBhCX5kfrEiA9GcVlLtmgkaxKcT5t7rLu+rzsY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qOgrswRdxJ5zGBJUUhQcy2uBXwQYO79/tlvFXJYlP3jIADl6JtF7fJnBcCmchiNip srseEl7RITEi4T2UAzkm3EaGv9On2SVHHxDQ0H1l679G4NmKMkmcMeEcynNyerKEbN ZNP24k0LyPTTd2OcU5leV3y9p3AzAGPdeb+cBxqU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 30A39F80507; Fri, 26 Nov 2021 17:20:03 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 92755F80245; Fri, 26 Nov 2021 17:19:52 +0100 (CET) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4A705F801F7 for ; Fri, 26 Nov 2021 17:19:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4A705F801F7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pmn0vtIl" Received: by mail-lj1-x235.google.com with SMTP id j18so6525747ljc.12 for ; Fri, 26 Nov 2021 08:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qK0ts7tSPXqbn+UV99/el3TluqWl3fnnOWodFc+vpkg=; b=Pmn0vtIlqSKEdyEV/mRDjpdG0O/iIE7rX0GbGsZ326iW9MdkgI+N5JaHDiQcV0ZmS9 s4mpBHjz/7079fkGZPCvb2Vo0bI3spK0A3LWqDQ+dpdFVGntM/eWN9OoWOuyRTH+64B3 IaHtf/9xA6SzLzmJjcZL++iKWiBokestwrBvJiNUVh4Yk9aYXyl6lPVkacuxZGZ/Bx/N bIoV6e8Le0wnz6SsRhMauxy7ArLSQrzlpxcv2FF4mP++cZ2c2pd0I+d3K7wMxTvetWbP U87t+R2UCkC04NPB0LqGKnYfFl9jL2UWUYLDxdyTg3RGEaqSxNumKFEA9qakcaeJmDae npbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qK0ts7tSPXqbn+UV99/el3TluqWl3fnnOWodFc+vpkg=; b=Nf6dbWsJANpdfmfEIU6kHaJlODbcs2xtVyRzapjbKeDw56GtZ26PwRE7U+HxeiSqVa xiHVSbXP05p9QFxnz+LV9yYtwzbQRyk1KTFro0qJ9Psruu0UWPt6Lfzv5iBgQf+wBxdD rI220GCivKxA09v7nuepVICvaomibV/Q7vabnew5G2tdNfsBPlkiixqla9VWph80gIR0 mhgKyT9pEjVt7TIBQXE2dLskLIIFgFBud/NJn+ga+MnS1isDeMh9wk+jkcpoMacbGdVa csg98fcMDehTF04y4/vb3CIG9fCJaogTBJ6A7Bd1HupSn/OhceiNDkGG8rebhhuNEc2x FF+Q== X-Gm-Message-State: AOAM532FTY0WkdUfVaBXtz3OjVB0w4z8NxA84AtxMQ9N1AFJlYiXR37Y S5XpQ4kTDCUisfrUG9vJnsM= X-Google-Smtp-Source: ABdhPJxTJmcAap80hyd09S2lN6AlqNMLYeO32b48+fRf5WDQzP8DiYELFZORQcZMSD+wC0g73ko2fQ== X-Received: by 2002:a2e:2a41:: with SMTP id q62mr30884162ljq.515.1637943579438; Fri, 26 Nov 2021 08:19:39 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:38 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 01/20] ASoC: dt-bindings: Add binding for Tegra20 S/PDIF Date: Fri, 26 Nov 2021 19:17:48 +0300 Message-Id: <20211126161807.15776-2-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add device-tree binding for Tegra20 S/PDIF controller. Signed-off-by: Dmitry Osipenko Reviewed-by: Rob Herring --- .../bindings/sound/nvidia,tegra20-spdif.yaml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-spdif.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra20-spdif.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra20-spdif.yaml new file mode 100644 index 000000000000..00240205817d --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra20-spdif.yaml @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra20-spdif.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra20 S/PDIF Controller + +description: | + The S/PDIF controller supports both input and output in serial audio + digital interface format. The input controller can digitally recover + a clock from the received stream. The S/PDIF controller is also used + to generate the embedded audio for HDMI output channel. + +maintainers: + - Thierry Reding + - Jon Hunter + +properties: + compatible: + const: nvidia,tegra20-spdif + + reg: + maxItems: 1 + + resets: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 2 + + clock-names: + items: + - const: spdif_out + - const: spdif_in + + dmas: + minItems: 2 + + dma-names: + items: + - const: rx + - const: tx + + "#sound-dai-cells": + const: 0 + + nvidia,fixed-parent-rate: + description: | + Specifies whether board prefers parent clock to stay at a fixed rate. + This allows multiple Tegra20 audio components work simultaneously by + limiting number of supportable audio rates. + type: boolean + +required: + - compatible + - reg + - resets + - interrupts + - clocks + - clock-names + - dmas + - dma-names + - "#sound-dai-cells" + +additionalProperties: false + +examples: + - | + spdif@70002400 { + compatible = "nvidia,tegra20-spdif"; + reg = <0x70002400 0x200>; + interrupts = <77>; + clocks = <&tegra_car99>, <&tegra_car 98>; + clock-names = "spdif_out", "spdif_in"; + resets = <&tegra_car 10>; + dmas = <&apbdma 3>, <&apbdma 3>; + dma-names = "rx", "tx"; + #sound-dai-cells = <0>; + }; + +... From patchwork Fri Nov 26 16:17:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641059 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 7EF23C433EF for ; Fri, 26 Nov 2021 16:20:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A6312193A; Fri, 26 Nov 2021 17:19:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A6312193A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943639; bh=FLrKch/eqhfmgzFiobhXVEUwGyzbrglWHnYYBbHB9ew=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mLSbtpQLCAOgXxZ17JDJl1JdZ4vchlMFpCquOJqNBHkQRa5csQmmXN8EENXIlhiET LkgZIWrO+c8xCnDUuhGfvqeykipp125/Y+Hi5lL94YyYEnJagNFS0suNvJCg2yMgt6 kTORebCvjM8kkJhsQCnozRfNFWdJHdsHaVVf0Pps= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EDE57F80087; Fri, 26 Nov 2021 17:19:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99F03F80302; Fri, 26 Nov 2021 17:19:47 +0100 (CET) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B073DF80132 for ; Fri, 26 Nov 2021 17:19:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B073DF80132 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gf9VIf7I" Received: by mail-lf1-x12a.google.com with SMTP id b40so25471882lfv.10 for ; Fri, 26 Nov 2021 08:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8AhGRJaoVn1IrWGJ+5EHhVIJuQTwIW4TlUfHNDbUYl0=; b=gf9VIf7ILO+koaNF6veBCGsOnIjFAHjV9jZKRTPqVVFyH6j8CESRZEpANBWMaZG2TR xpjJL7NtJrqw1ZjlYAmAnUFl8ek+P2efkdt1B/Or7kcu3iJ8NWuJgMl91GgcQhjknouk XIjVLx5HoE1uWBKucb5mSE9EX7D1E7Fci4NahzhvyuxIbY4ldY5SPjjKmVSof3zwLRs2 er7kihMp7qqh5ZndfenJSGIkc3p2SRq5sV1h6JMTfR50hrEs9XT0YJASKFQ+YtbwpWxK jp3+NY0VAiHPNHZ9Bi1XrkgF8+o1XA6u2l4+pH2/q5vTshzi2FO/CDxQ4UvhfkR9UHZ1 Z+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8AhGRJaoVn1IrWGJ+5EHhVIJuQTwIW4TlUfHNDbUYl0=; b=QHdvuKIbCRJFfxFiazShC//R0D5ocha5jZjZXzocg1zbfcdbgBJL2kaGrFu923BJ9M Z9gd31ZDSZrM/E8HyT30M6hylipW3V4mv4imR1WkLYKdEUHq6z4HqfmiZTBrwbj9O7Ak YnVwgYf5EO2ifnyBkecm7cbehI+UeHCeAeA1xY8p+Ti0WqZWaXC/t76l7eQyT2JBJrnN XT879CQ2u65i8CwduthL2hJ+KNpi58aKp0BHSOn7y1pH8bxAvR7E3NPxEm6dMRnJ36LM NVWTJlT+rh8N7vruRMZR5y+57KAojYMt+hkbyVIeS3EeIWw7mYYEQevbSMIrZZV0Vvzs iVow== X-Gm-Message-State: AOAM5338c/CdYSjpVyi9qXrJgIPfMJo9ikMSf31Vrub0IFjEFX6jiBt8 ifQXROElpBVE1evH/eCW41I= X-Google-Smtp-Source: ABdhPJxaUvItDXQX2K+4aMi2wXJ6fVnLZSJi/ilFd4JYO1HwMEBAxC35yJ3/i3javAwM6xF3n5Y60A== X-Received: by 2002:a05:6512:1051:: with SMTP id c17mr31584295lfb.35.1637943580427; Fri, 26 Nov 2021 08:19:40 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:40 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 02/20] ASoC: dt-bindings: tegra20-i2s: Convert to schema Date: Fri, 26 Nov 2021 19:17:49 +0300 Message-Id: <20211126161807.15776-3-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Convert NVIDIA Tegra20 I2S binding to schema. Signed-off-by: Dmitry Osipenko Reviewed-by: Rob Herring --- .../bindings/sound/nvidia,tegra20-i2s.txt | 30 -------- .../bindings/sound/nvidia,tegra20-i2s.yaml | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 30 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.txt create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.txt deleted file mode 100644 index dc30c6bfbe95..000000000000 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.txt +++ /dev/null @@ -1,30 +0,0 @@ -NVIDIA Tegra 20 I2S controller - -Required properties: -- compatible : "nvidia,tegra20-i2s" -- reg : Should contain I2S registers location and length -- interrupts : Should contain I2S interrupt -- resets : Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names : Must include the following entries: - - i2s -- dmas : Must contain an entry for each entry in clock-names. - See ../dma/dma.txt for details. -- dma-names : Must include the following entries: - - rx - - tx -- clocks : Must contain one entry, for the module clock. - See ../clocks/clock-bindings.txt for details. - -Example: - -i2s@70002800 { - compatible = "nvidia,tegra20-i2s"; - reg = <0x70002800 0x200>; - interrupts = < 45 >; - clocks = <&tegra_car 11>; - resets = <&tegra_car 11>; - reset-names = "i2s"; - dmas = <&apbdma 21>, <&apbdma 21>; - dma-names = "rx", "tx"; -}; diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml new file mode 100644 index 000000000000..ad43b237d9af --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra20-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra20 I2S Controller + +description: | + The I2S Controller streams synchronous serial audio data between system + memory and an external audio device. The controller supports the I2S Left + Justified Mode, Right Justified Mode, and DSP mode formats. + +maintainers: + - Thierry Reding + - Jon Hunter + +properties: + compatible: + const: nvidia,tegra20-i2s + + reg: + maxItems: 1 + + resets: + maxItems: 1 + + reset-names: + const: i2s + + interrupts: + maxItems: 1 + + clocks: + minItems: 1 + + dmas: + minItems: 2 + + dma-names: + items: + - const: rx + - const: tx + +required: + - compatible + - reg + - resets + - reset-names + - interrupts + - clocks + - dmas + - dma-names + +additionalProperties: false + +examples: + - | + i2s@70002800 { + compatible = "nvidia,tegra20-i2s"; + reg = <0x70002800 0x200>; + interrupts = <45>; + clocks = <&tegra_car 11>; + resets = <&tegra_car 11>; + reset-names = "i2s"; + dmas = <&apbdma 21>, <&apbdma 21>; + dma-names = "rx", "tx"; + }; + +... From patchwork Fri Nov 26 16:17:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641067 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 57387C433F5 for ; Fri, 26 Nov 2021 16:22:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8D5C71AA5; Fri, 26 Nov 2021 17:21:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8D5C71AA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943742; bh=G+5sClwCEMLoGZCR5rOKJ7V+lGgpEeTe/4QSydrHLns=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Cxl33xpXh32mDXqNXV6OWoHC7DLxLngPyvb35jgC3oE66nyMeSE2pPZNC/B9zyJQb jr9oKs8TaotF8FC/mu5P7LvbWUkLcaZa5X4OcPlq/PItw0PZtaQWvUY73hyGPAnBrY USYUFXrdAbLJTUTsB2rTApsV+8NuT0DoTZRtHXW8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 21E8DF8050F; Fri, 26 Nov 2021 17:20:05 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 254C3F804CF; Fri, 26 Nov 2021 17:19:52 +0100 (CET) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1E327F80132 for ; Fri, 26 Nov 2021 17:19:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1E327F80132 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LNs+LBfm" Received: by mail-lf1-x136.google.com with SMTP id c32so25542969lfv.4 for ; Fri, 26 Nov 2021 08:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=po9scD5dBEjtGuaNhMEfvHFzFtb9Ravcd9iJs0UTlhE=; b=LNs+LBfmYL28Sq2zZuiCUBRiBODtL+mQpFsAHjq8Zns4ntquqRmiplXDwyVYKjduMI FbBQ996hudy2zR49koSrDFj5aYM3xtC0Kaxo2GgTTTeV4X8BH7GgRhIO5Apf8tgxGpz5 XRw/giTB4gdN0aG+rI4CRwgaLfu98u4su4XqHszD+O3lUkEvkdo569+5zMcgIaKLb0r8 TljFdnnVI1/a484vxfGIIbtn/uWJJQUAu+Ia18aV2wmvt9mtp8dQICwELCUZ/8Zi2DoA x4yqLx6ME4DKZWXHShFuwEmDl8iY+XJ0LJkhqFrjdD6Hpqd3JGLbLBx54DyeuGa2R1Bq T9vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=po9scD5dBEjtGuaNhMEfvHFzFtb9Ravcd9iJs0UTlhE=; b=2JRHOniCj+M3gcYsue6aYBc8ZDmlX2EbljVu3kCz7ddAKQhncRWPuo717tkMwt3SyM 7xojzNhD1rp/a+wXCY3YKqhRF4Fc2Ya6aWJx7DJVIafKt6MqaH3StqVSr7XaYCpzHZD1 rrfnfXG46wxb+aBjQt5ObIEbbwn1gEW7yICZuKUALrxZhDqCds9JbS+uN0NQ+5vdKrjs 0hfTUFEe9Q3Z6xscPMUh5VVvRiA7JEvwqznx1b+0q9K6e/zXlAeGUEIL7rPm5EsXz9/y A9H9tVwBsuvStAN5Pozm5LEmwAbzqx9YE3D6xT16oTp0/G0tq3hVYEOoTztBMzycFQ4J 072Q== X-Gm-Message-State: AOAM531CTU4MkvZW6Bq/dw9Nfu2ykTSmmYdTraLoxr08AAf4XecYfmIx u6LI2hNHPdn2wEJHUToqVzk= X-Google-Smtp-Source: ABdhPJxYVWZExVjYtIGn+qzQ1ofRZlsbTingOF1DzMsidrhuUxsrKi22yVGR0OWGg5FMU/aNw7eVXQ== X-Received: by 2002:ac2:5cd7:: with SMTP id f23mr30678322lfq.153.1637943581509; Fri, 26 Nov 2021 08:19:41 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:41 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 03/20] ASoC: dt-bindings: tegra20-i2s: Document new nvidia, fixed-parent-rate property Date: Fri, 26 Nov 2021 19:17:50 +0300 Message-Id: <20211126161807.15776-4-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Document new nvidia,fixed-parent-rate property which instructs that this board wants parent clock to stay at a fixed rate. It allows to prevent conflicts between audio components that share same parent PLL. For instance, this property allows to have HDMI audio, speaker and headphones in the system playing audio simultaneously, which is a common pattern for consumer devices. Signed-off-by: Dmitry Osipenko Reviewed-by: Rob Herring --- .../devicetree/bindings/sound/nvidia,tegra20-i2s.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml index ad43b237d9af..68ae124eaf80 100644 --- a/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml @@ -42,6 +42,13 @@ properties: - const: rx - const: tx + nvidia,fixed-parent-rate: + description: | + Specifies whether board prefers parent clock to stay at a fixed rate. + This allows multiple Tegra20 audio components work simultaneously by + limiting number of supportable audio rates. + type: boolean + required: - compatible - reg From patchwork Fri Nov 26 16:17:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641063 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 EB549C433EF for ; Fri, 26 Nov 2021 16:21:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D01B81A94; Fri, 26 Nov 2021 17:20:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D01B81A94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943691; bh=LzzPOO+RM6FEOiFNwxVrD5niwYNDvz2u+GaEY3CfkBM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bw/tmedR2zMVWLZX3kkN6FAXqEmp26K5Dg+0chDJaEFzy32B8Z4mRDP2upTm/jTMb L5U3sYKwCVplxwQBKSWlMZW3qRQxmnJ7Ce5ilVCCJVIidb5nKiZpsIe6LKsW6zdb3O zJ5bvBMmY0g9X2/0BKAy+qXPDZanBIn0D9Aemsag= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6900AF804CF; Fri, 26 Nov 2021 17:19:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2F677F804CF; Fri, 26 Nov 2021 17:19:51 +0100 (CET) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4EA91F80212 for ; Fri, 26 Nov 2021 17:19:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4EA91F80212 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kHcqo3Hd" Received: by mail-lf1-x129.google.com with SMTP id k37so25544372lfv.3 for ; Fri, 26 Nov 2021 08:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jZtmNInV251GqgFq3K9ZRWdCyBV26EPK8i39JKkeuGY=; b=kHcqo3Hdoj+Nqd8Ud4iK9R/J/uH0C/whKTjYqjDf/tc4gbFtOi20b+X0fwScJI3XgE w1uJD3Kn/ZPx+GJe5Ni17mAKfxobdslbSTtHt9ZgYI7mD54nlnN3Xn5N+OUh5jS86tqH 1R29ze3ftawnZjR8t+tOedRBH7Bgl4wPJiRGm1oiD0WronEIfoQAoQDfPmZ5oHkhjxTJ BM1grZQI4H8T34r+xH4xnqdbWnR099DKjL3t/aqmVQsRFZUBTcRk7nnb1dIOjN05Eqcz kFQmwBFUjNiHiZkWrHOc6vH2BJTE8t+Lw8shx9I+HJWQloEOtGR+Xt3SvRqzQmbJt0G/ z45Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jZtmNInV251GqgFq3K9ZRWdCyBV26EPK8i39JKkeuGY=; b=0JsYe/I8ap1+v4HXSQrOfLNI9BQmEIEz7i1Qm0nPIoMj1/Gw8uqp0jLJv/8n7ZlYzp RmxWDIFEf41e56dHh78xpFh2W9gTumnys8R8i2DhMl84I9I9YAD9IzDr7wgh/G8BbYZ/ yPX83J06S/DrajxEglDODH8qJCdESuTKpeJ5SOODEHjBbPoHUAEf9F8Q3V8Yo5zWH27g yO9H9KtPgxMnAf99eAJmPLup/3Lp4Em60wpc/6Jctp7i19FMH5detJD2V1cjEr0kSlrL 5AaMpDSzrCawnUAWmybqV0LrybUqYjivhQ326Wl3DBj7bIRfJQoyeAfAQ2lXB1Hag1Ac a8Aw== X-Gm-Message-State: AOAM531AaNvWWMheMFJC+LAvB4nndcTosRd1XswfqfqyIvKM+NPW86QI XMWAIjgUnZiLEk45R9V5llU= X-Google-Smtp-Source: ABdhPJyu83chU0nnqPvnIxvSELamyDC2FkUBRpE0GuXjevFykLKZzCD2MrUwMLgf0AfqXE32YyaF5A== X-Received: by 2002:a05:6512:2212:: with SMTP id h18mr32046721lfu.55.1637943582592; Fri, 26 Nov 2021 08:19:42 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:42 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 04/20] dt-bindings: host1x: Document optional HDMI sound-dai-cells Date: Fri, 26 Nov 2021 19:17:51 +0300 Message-Id: <20211126161807.15776-5-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Document new optional sound-dai-cells property of HDMI node. This node will be used as endpoint of HDMI sound DAI graph. Signed-off-by: Dmitry Osipenko Acked-by: Rob Herring --- .../devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt index e61999ce54e9..27b746f28f31 100644 --- a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +++ b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt @@ -297,6 +297,7 @@ of the following host1x client modules: - nvidia,edid: supplies a binary EDID blob - nvidia,panel: phandle of a display panel - operating-points-v2: See ../bindings/opp/opp.txt for details. + - #sound-dai-cells: Should be 0. - tvo: TV encoder output From patchwork Fri Nov 26 16:17:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641075 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 654E5C433F5 for ; Fri, 26 Nov 2021 16:23:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9C8411AAB; Fri, 26 Nov 2021 17:22:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C8411AAB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943821; bh=tAN41LYEO4Im+uxTfYf9YsqL8/qCZeUu4zYtpncCODc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LBRAeMtlShloALEW2Jr7RIuLCsiLRKLyC64wilGEAFWgh85Jw6g9/nlAPFJ+vE64k HaAcdZiOPvkJbQo6Cd/nJ5+3qeQn7WjRdQ+PfDXlI+HND5t/sWpDa0TYjdhllVfHJ0 GwxyyWsh4d5RZUNzvn5pBWtaITx8KIO/K0m/sSIc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 81BDBF80524; Fri, 26 Nov 2021 17:20:12 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9D6FF80508; Fri, 26 Nov 2021 17:19:59 +0100 (CET) Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8797AF804EC for ; Fri, 26 Nov 2021 17:19:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8797AF804EC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BvKSZeYo" Received: by mail-lf1-x129.google.com with SMTP id l22so25476929lfg.7 for ; Fri, 26 Nov 2021 08:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wwvCc+bauYKKq4pTyZaKz2pCnGZty8ijk6MykhM6LJk=; b=BvKSZeYoEu1pJJt+n6o+vj50x1ldkP551fdVZxAJJQLdVUFGwPBzAIrF5H+7esXwHx n8own3qM05XoxI0sjPD064mGbDJYgQsXfUbZ5MIO05z8iIYjmtRdkKT5j0qD5Z2az0Jk UgsVHrgG2+MvETMaNKhRvVnkXunohyLJVeytrxOcNVoFj9pd8wQ3SQv8v/ibUtmgacPy ks0GJc1FIuDh3ZKQoL4cs4vQxpaDcGcq87T6G6fqBvQzUszhXwvpYZXNRvM4dS7oRSp1 a4rK+JOdqWuQE1Dhk/XVLpE7/zREWJ2zqRHV9yeoavSk6IclxwhKhMj46sTIj3eb5Cbc PU/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wwvCc+bauYKKq4pTyZaKz2pCnGZty8ijk6MykhM6LJk=; b=pfiZ32TcrTUiN2BzRDu3ZpFxd/Gx1UrVliLso/+LzwNGGSiDKsET9CWRNTaPdIac3C IP/SBcPge/zHjcTop5RpvAdSaXgP+q9C2m9rpgjGB7l3Oljftx66PUpXWkPFuTBWUHD6 aVD5NucMgkHkwxftxo4bxVaj/8ECp9hMUcG78UUmi2WywOQQSPtYIoVlQFQKD5sLAX2p Lpe1tSopZZCoSinTRq0YSKTl2MmPQeclKW46c4Jqmcn3cfCXJK3C0A9E6wLk4HgZ/QUK xOU4jeuLeLM0vaNFyW2dgySEkptwqfYjo306csjxCoU6qUH2q+kIJjJsk1gRNcN2Mah8 pzUg== X-Gm-Message-State: AOAM533ezbTkt5oWDvE5AZH3gMFs4Yhqspiw9FFaJol6rOGTO7yqlk9+ cenBFINH+p0TkQ3MrYpua+E= X-Google-Smtp-Source: ABdhPJw+O1sqA1AEApn4w0e8LsIJFSmfr+1YbfviViPwQQyCT2nco+0hcMYFnmfPveS50cbky2WMkg== X-Received: by 2002:a19:4312:: with SMTP id q18mr30933828lfa.299.1637943583577; Fri, 26 Nov 2021 08:19:43 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:43 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 05/20] ASoC: tegra20: spdif: Set FIFO trigger level Date: Fri, 26 Nov 2021 19:17:52 +0300 Message-Id: <20211126161807.15776-6-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" FIFO trigger level must be not less than the size of DMA burst, otherwise audio will be played x4 faster that it should be because part of the DMA data will be dropped on FIFO input buffer overflow. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 7751575cd6d6..6f0570cde964 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -69,6 +69,14 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(spdif->regmap, TEGRA20_SPDIF_CTRL, mask, val); + /* + * FIFO trigger level must be bigger than DMA burst or equal to it, + * otherwise data is discarded on overflow. + */ + regmap_update_bits(spdif->regmap, TEGRA20_SPDIF_DATA_FIFO_CSR, + TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_MASK, + TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_TU4_WORD_FULL); + switch (params_rate(params)) { case 32000: spdifclock = 4096000; From patchwork Fri Nov 26 16:17:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641071 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 EB02BC433EF for ; Fri, 26 Nov 2021 16:23:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EE1821A9D; Fri, 26 Nov 2021 17:22:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EE1821A9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943791; bh=UORYBz1eeo61x50Z3tys3rviKpDlzvxFjX1T9Mjtuqw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CMX3CANQ2Pk9S+iRwM++h3xjRXlrl8u7xGwg/ZD94reCJcGmR9KWiPhFYq9GcM9D0 WYWO2TmPV5djQf/gRNDjx9PlpeHEY/COpdeffVfxlYIQYtOBM4sHvRbYRT4CEl0iIC I3Kql1URJZEhhNSWa9pVRy4nJE9fpNx+Lq+4Z2r8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9C3AAF80519; Fri, 26 Nov 2021 17:20:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 31923F804F2; Fri, 26 Nov 2021 17:19:55 +0100 (CET) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DD929F80259 for ; Fri, 26 Nov 2021 17:19:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD929F80259 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BJbfUBs2" Received: by mail-lf1-x12a.google.com with SMTP id f18so25506072lfv.6 for ; Fri, 26 Nov 2021 08:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AAin265JOVL+o94pQxCU+sQvf2Xm5+tMWz8fFEKib7U=; b=BJbfUBs27vN/BXdrfZVLl+mcJlwxpt03ZG4BcmkKKYWyfYJy4vev3auqKaPv6mPLXq sCQksErcwYoAayxWRm2Fu8khU3NBW4ciWpcYxtaOAU1bBo2TT/sdHvtcOmqRlEpEM0Qy cXZnwb29eLcWAJc4cKYTreTbQ0TBZ7SSjP8Bw1fIYr2bOg86wtvJ++7OrAFCPfVNO1Lc GNOscG8hx+Ctx4DqIOM9dMx18cRwBS2kTsf0qAFQDs7ksTgB73o+LstacLuJI/RHCsLr m6TYv2sSM8TQwO1xrrIfgIlP0d1HbGQfH3+2DKxyAorsM2rpA6yYn2fovZ+lr3Um2+zC WznA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AAin265JOVL+o94pQxCU+sQvf2Xm5+tMWz8fFEKib7U=; b=sTnL5pGxfnXnBAf/d0X3wIHDzXGLKNCinK0P9BWXqGrp3Ol0rLXg1EftLR4mt9OCqg 8TNU1/7fgFWNu6f/U03IbADUvXsaTHcmhLH/wiC4xdBODjddqWdMVDDopHvYvkyn2503 FrkF9BRp9YxOjrgMnx6GfVdA8MY9+/JDwLaT5cAdHmAOQPKbUqRGKZPUzxrmpNefXQS8 UncwEmjyu+G1qXME5GTPVmLPBqYqAbD1ynnVYxuaGMdEQZVqk8+1rVjalh6TOBqFqqIa PfR3+vQM/fIGXar0kB/BorlZayBEFfXjAMsM8CnfHcLIR1msvMuJ+6djGaUZxLQSSJhD o0wA== X-Gm-Message-State: AOAM530M54RUXDmrbZxMlQ1ymO7UPhyLO2vB93AlYV1DIP3Ac28YzR/o yBdT/zIULHPy6MQKMRS8MtI= X-Google-Smtp-Source: ABdhPJxyXEvKVmf7LUHm7Bq10BUL0d0eGbpP6e98npXd/QQMkZcwI8MdZNl5vLC50uFeRYPW04jNlQ== X-Received: by 2002:a05:6512:3da2:: with SMTP id k34mr30230293lfv.605.1637943584717; Fri, 26 Nov 2021 08:19:44 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:44 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 06/20] ASoC: tegra20-spdif: stop setting slave_id Date: Fri, 26 Nov 2021 19:17:53 +0300 Message-Id: <20211126161807.15776-7-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Arnd Bergmann The DMA resource is never set up anywhere, and passing this as slave_id has not been the proper procedure in a long time. As a preparation for removing all slave_id references from the ALSA code, remove this one. According to Dmitry Osipenko, this driver has never been used and the mechanism for configuring DMA would not work as it is implemented, so this part will get rewritten when the driver gets put into use again in the future. Reviewed-by: Dmitry Osipenko Signed-off-by: Arnd Bergmann --- sound/soc/tegra/tegra20_spdif.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 6f0570cde964..e45e371edc42 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -298,7 +298,6 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) spdif->playback_dma_data.addr = mem->start + TEGRA20_SPDIF_DATA_OUT; spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; spdif->playback_dma_data.maxburst = 4; - spdif->playback_dma_data.slave_id = dmareq->start; pm_runtime_enable(&pdev->dev); From patchwork Fri Nov 26 16:17:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641123 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 0CBC6C433F5 for ; Fri, 26 Nov 2021 16:24:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3650A1AB3; Fri, 26 Nov 2021 17:23:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3650A1AB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943878; bh=S6IilNKdyiqLrg66HkYXNGJUZYfm7+SZPWzSxs6xur4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uTtJibGluFi+g+pSTDXmWS9/m6MvkqxTIe4cjbxzR9f6OSeaxec7ruJlamNmEto9Z pRJKbKIv6AF+LnjldKbcUtPS4n81mYQ+PvIXow5p9BXbfl4FHuypoGKORAopqCePoC 3vi4wZom2tKjZ92+tDouT5VBAcKFRE6IdaA8JnIc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 52BF5F80536; Fri, 26 Nov 2021 17:20:15 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 70231F80508; Fri, 26 Nov 2021 17:20:02 +0100 (CET) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4EB52F80212 for ; Fri, 26 Nov 2021 17:19:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4EB52F80212 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TCD9cLoC" Received: by mail-lf1-x131.google.com with SMTP id k37so25544681lfv.3 for ; Fri, 26 Nov 2021 08:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mwo4lC7FD/kahBv1NqaH+i3tNvopsZJiJsXaLzIpIZs=; b=TCD9cLoCNbfUnZM9J4HcmwXzAfE4L8q7phnym6pZ33wnza+OUwA0voHnXlbFX8BALc 98huQvHMfRZhR6vs0iXkCJdDzPLwc5Iu+hxNfnAJnOhuly6FVmgiTFQv0PNbYTrY2rHK dXyOTzj2XWTpCS6APfNz7Hm9xKXXuqF/C+ZhAAm2IgEouLO7p3q6Mlpn1p7veF13LonA /7ZVdUUY7c6q4wvZ6+486FTu58keZbE7EBmxdkLoAiwTtH0JeaxWgQvf0AkdolivqHRy bEpOVWzuuV7+krtw1TWDsd1Sze10F/d3Wbvxxvs00NCVytod7kMqi7KRBBzLhKj0lu3v rHtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mwo4lC7FD/kahBv1NqaH+i3tNvopsZJiJsXaLzIpIZs=; b=UNeeGLV9LtYvmwLKJ4CiPdOxf4RjWYaN+vNo97SN6WNidHrEFGZo2qk4usDVjPYrLX kngWpEtWLmfxirC4TQ3X9aXyUGzXISiO+1hinukOvtvtWaOByn4FYRCUH+RSR5jTnI22 ZyZxLIwHuFh9on+yvK1JzGLkB79ZfVIZfZBV28CYCouExDhgJdm3aJawMfH9vWzmpWlj j1uk3nN9knKe6cKzxMzutPax86asT73i1Y4btIki7w2bw1p3eX6bREg060P3vghUGfjx 0JSZ3nifjKeRAV7Mtu4Tr1Qg9oTQS1ZkcGsPRbG/v4h+FFyqVZcgRCipe+7Z/NiE0hiH 2QVA== X-Gm-Message-State: AOAM531jruiHFW6mEIy8MQ2Xue4IDfxFZdSyAhlpx0l3X2xfZ9Y2AcAg 02kQKyJ0yNmxbo1gXqpLPiWdUxL4p6k= X-Google-Smtp-Source: ABdhPJy2HOctdB6ar2RL70kTPxIThtcFWFugw3cBJPBAONKS4zeQwsXwB5N/38mWQcSQnbt2QPuv7A== X-Received: by 2002:ac2:4e0b:: with SMTP id e11mr30573216lfr.208.1637943585591; Fri, 26 Nov 2021 08:19:45 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:45 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 07/20] ASoC: tegra20: spdif: Support device-tree Date: Fri, 26 Nov 2021 19:17:54 +0300 Message-Id: <20211126161807.15776-8-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Tegra20 S/PDIF driver was added in a pre-DT era and was never used since that time. Revive driver by adding device-tree support. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index e45e371edc42..6650875d2555 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -340,10 +341,17 @@ static const struct dev_pm_ops tegra20_spdif_pm_ops = { tegra20_spdif_runtime_resume, NULL) }; +static const struct of_device_id tegra20_spdif_of_match[] = { + { .compatible = "nvidia,tegra20-spdif", }, + {}, +}; +MODULE_DEVICE_TABLE(of, tegra20_spdif_of_match); + static struct platform_driver tegra20_spdif_driver = { .driver = { .name = DRV_NAME, .pm = &tegra20_spdif_pm_ops, + .of_match_table = tegra20_spdif_of_match, }, .probe = tegra20_spdif_platform_probe, .remove = tegra20_spdif_platform_remove, @@ -354,4 +362,3 @@ module_platform_driver(tegra20_spdif_driver); MODULE_AUTHOR("Stephen Warren "); MODULE_DESCRIPTION("Tegra20 SPDIF ASoC driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:" DRV_NAME); From patchwork Fri Nov 26 16:17:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641073 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 2D03CC433F5 for ; Fri, 26 Nov 2021 16:23:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4AE6D193D; Fri, 26 Nov 2021 17:22:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4AE6D193D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943796; bh=yR4SWGDnOGE7JcXvzMIkyeUl/mS53sfrAoF7+FU5BDE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CpnKuKb0Z19PrYhMdbVBLagebJy2GIeMZQ+JQEwdqf1Xh373vv8HA783KE6W1XHEt KtNfN00LqJ/uCedbua0V/Yfb5/9eREx0nxfSooabDC0i5p3ALu+8vGLOk7kPXvYJNO O71P71SQULWBtj1na3F7afdrOMo6U+gv7SDEAwis= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6500AF8051B; Fri, 26 Nov 2021 17:20:11 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 46211F804FC; Fri, 26 Nov 2021 17:19:57 +0100 (CET) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 79F78F804AD for ; Fri, 26 Nov 2021 17:19:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 79F78F804AD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BPiYz2We" Received: by mail-lj1-x22a.google.com with SMTP id 207so19669736ljf.10 for ; Fri, 26 Nov 2021 08:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d38MEEq+r0QwqDvnuwxQbfydxKTbgpiZ5kKyEJPIo+w=; b=BPiYz2WeGMWsPtKS1APNfVB/7nuy9JzoTlEySilxtxLhjzkr81In3mdT04JjniVVM9 3wb4vg4bMVZrc9ZLO+3EzVO9oDyvqMAxX663+WLoplWxgMdgeHGPqcD2tjeImTmSZbNK H6xOdWkq5PvGG3wEi13PuvRkOYJ1gAYKw7W+bJLtrx8nfoXcEfBxk0eVvN10Z2srZ4KB GvZXGCt6oWUTHqfdcvgpjkel7EM+qr0OgOCFBp9uu/4Mpqf2pDQ/Wt9TVo5vsxhZ6Ryu sFJ3t3O3SsJuZPOoTK8l9iIcDKUUj5jTSOS/sU+8/fX6ppC+3U+wvJDP2Aw9Y5YZjB0O uEPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d38MEEq+r0QwqDvnuwxQbfydxKTbgpiZ5kKyEJPIo+w=; b=K+4hmABg4beknmJqfE1Cn8Wxdu2FFMkhJsnuWiUuSAndPWUk4jz9gSU7yQGTIdsk80 4UyFw1TY2EF5P+Ueg0cqD94DXndnWRfMRI8kqj5yNMEB3qtDIsuU2qKRMZ8xxdS304Hn 86+ufaicZQtVPZyaSet13J0WMfLExEVI+QYuDZVoxobKZuPgulSkR0e6tc8pxC34KNnw 6EmiXXoIam02AKkpUUAoHwN+43d57EUnsx5aTE5EBuPxOjTCqebBZ/wTwWqTYAvk/WGh Yz2SjRC0+STOs3VddDoqIH3OIo6fxXs0dVuBTCfjcrji8qtLPjvZG1Xetht4xVeUmjUq Mc7w== X-Gm-Message-State: AOAM532jB86jWhk1OxxsLQ/p2it3343jrT3yNtr130CyTvr6PewK0RNg oY4MY182BQMRLE8L44AxdSw= X-Google-Smtp-Source: ABdhPJwiDLKsyEpyZvghDGkDwPjRYeINMptb0ZgLeUnAm7qiWhxhH0ZBchRFF4q5jWPmusqDhLfroA== X-Received: by 2002:a2e:3012:: with SMTP id w18mr31124844ljw.217.1637943587520; Fri, 26 Nov 2021 08:19:47 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:46 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 08/20] ASoC: tegra20: spdif: Improve driver's code Date: Fri, 26 Nov 2021 19:17:55 +0300 Message-Id: <20211126161807.15776-9-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" - Clean up whitespaces, defines and variables. - Remove obsolete code. - Adhere to upstream coding style. - Don't override returned error code. - Replace pr_err with dev_err. No functional changes are made by this patch. This is a minor code's refactoring that will ease further maintenance of the driver. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 49 ++++++++++++--------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 6650875d2555..9383683aa4e9 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -23,8 +23,6 @@ #include "tegra20_spdif.h" -#define DRV_NAME "tegra20-spdif" - static __maybe_unused int tegra20_spdif_runtime_suspend(struct device *dev) { struct tegra20_spdif *spdif = dev_get_drvdata(dev); @@ -49,11 +47,10 @@ static __maybe_unused int tegra20_spdif_runtime_resume(struct device *dev) } static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct snd_soc_dai *dai) + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) { - struct device *dev = dai->dev; - struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); + struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); unsigned int mask = 0, val = 0; int ret, spdifclock; @@ -106,7 +103,7 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, ret = clk_set_rate(spdif->clk_spdif_out, spdifclock); if (ret) { - dev_err(dev, "Can't set SPDIF clock rate: %d\n", ret); + dev_err(dai->dev, "Can't set SPDIF clock rate: %d\n", ret); return ret; } @@ -127,9 +124,9 @@ static void tegra20_spdif_stop_playback(struct tegra20_spdif *spdif) } static int tegra20_spdif_trigger(struct snd_pcm_substream *substream, int cmd, - struct snd_soc_dai *dai) + struct snd_soc_dai *dai) { - struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); + struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -151,7 +148,7 @@ static int tegra20_spdif_trigger(struct snd_pcm_substream *substream, int cmd, static int tegra20_spdif_probe(struct snd_soc_dai *dai) { - struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); + struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); dai->capture_dma_data = NULL; dai->playback_dma_data = &spdif->playback_dma_data; @@ -160,26 +157,26 @@ static int tegra20_spdif_probe(struct snd_soc_dai *dai) } static const struct snd_soc_dai_ops tegra20_spdif_dai_ops = { - .hw_params = tegra20_spdif_hw_params, - .trigger = tegra20_spdif_trigger, + .hw_params = tegra20_spdif_hw_params, + .trigger = tegra20_spdif_trigger, }; static struct snd_soc_dai_driver tegra20_spdif_dai = { - .name = DRV_NAME, + .name = "tegra20-spdif", .probe = tegra20_spdif_probe, .playback = { .stream_name = "Playback", .channels_min = 2, .channels_max = 2, .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | - SNDRV_PCM_RATE_48000, + SNDRV_PCM_RATE_48000, .formats = SNDRV_PCM_FMTBIT_S16_LE, }, .ops = &tegra20_spdif_dai_ops, }; static const struct snd_soc_component_driver tegra20_spdif_component = { - .name = DRV_NAME, + .name = "tegra20-spdif", }; static bool tegra20_spdif_wr_rd_reg(struct device *dev, unsigned int reg) @@ -260,7 +257,7 @@ static const struct regmap_config tegra20_spdif_regmap_config = { static int tegra20_spdif_platform_probe(struct platform_device *pdev) { struct tegra20_spdif *spdif; - struct resource *mem, *dmareq; + struct resource *mem; void __iomem *regs; int ret; @@ -273,27 +270,19 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) spdif->clk_spdif_out = devm_clk_get(&pdev->dev, "spdif_out"); if (IS_ERR(spdif->clk_spdif_out)) { - pr_err("Can't retrieve spdif clock\n"); - ret = PTR_ERR(spdif->clk_spdif_out); - return ret; + dev_err(&pdev->dev, "Could not retrieve spdif clock\n"); + return PTR_ERR(spdif->clk_spdif_out); } regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); if (IS_ERR(regs)) return PTR_ERR(regs); - dmareq = platform_get_resource(pdev, IORESOURCE_DMA, 0); - if (!dmareq) { - dev_err(&pdev->dev, "No DMA resource\n"); - return -ENODEV; - } - spdif->regmap = devm_regmap_init_mmio(&pdev->dev, regs, - &tegra20_spdif_regmap_config); + &tegra20_spdif_regmap_config); if (IS_ERR(spdif->regmap)) { dev_err(&pdev->dev, "regmap init failed\n"); - ret = PTR_ERR(spdif->regmap); - return ret; + return PTR_ERR(spdif->regmap); } spdif->playback_dma_data.addr = mem->start + TEGRA20_SPDIF_DATA_OUT; @@ -306,7 +295,6 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) &tegra20_spdif_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); - ret = -ENOMEM; goto err_pm_disable; } @@ -349,14 +337,13 @@ MODULE_DEVICE_TABLE(of, tegra20_spdif_of_match); static struct platform_driver tegra20_spdif_driver = { .driver = { - .name = DRV_NAME, + .name = "tegra20-spdif", .pm = &tegra20_spdif_pm_ops, .of_match_table = tegra20_spdif_of_match, }, .probe = tegra20_spdif_platform_probe, .remove = tegra20_spdif_platform_remove, }; - module_platform_driver(tegra20_spdif_driver); MODULE_AUTHOR("Stephen Warren "); From patchwork Fri Nov 26 16:17:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641069 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 C1CE5C433F5 for ; Fri, 26 Nov 2021 16:22:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DDC161A96; Fri, 26 Nov 2021 17:21:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DDC161A96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943762; bh=8Jq3Q1/m+dsROHk9hVl8I3G5iOiKajzkzheVO2tqvI0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SD7Whb/ohjECfBJ1G3mmJParIPvFLxpHgBvbC7+3uuQXZHpFgDsPY4MKyNhzAHPb7 vCEZvXDQvAvZq57AFMk/PzEcDVbp9N4OSN1IBxRzf2zSOTLJH8Sy6jnbLNgILtylvM tJmk36OnQAEFIQ0nHjAioJutHWaVF0zS7LwYoC7A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 76FA8F80245; Fri, 26 Nov 2021 17:20:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E45C4F804F3; Fri, 26 Nov 2021 17:19:55 +0100 (CET) Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AF6A9F80132 for ; Fri, 26 Nov 2021 17:19:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF6A9F80132 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="La5mOtY3" Received: by mail-lf1-x12c.google.com with SMTP id k37so25544943lfv.3 for ; Fri, 26 Nov 2021 08:19:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qt8PrFF5rWy8Gj1ABxOEOakxJdpJR0LJrG627NKAlx8=; b=La5mOtY3/M8w++da9HHf3ilhXsZ1KGsAAtaZV6vw0DQtGrZlfepS5+oQzw89vUZXdZ lFXq50dzCiYjF/19pzaZNoMDOyzLK1aGieF+/wulJTKPNonb6qX7ISF4ZLLmpW3V2Kvk x6nFm9PE8F2T5bE1xAy/B0YX2lMzGE4af7HknxwurhPLjqtN32zHNgsiah4xM8Gk4gf+ yJBaKEOAjG0fPpY6gIvunJyG01Vh1uYp7WMRpC3kEUgmd5tltyYNO3enXRcLoOaQVa+s l8VtGxr8jrx6cMJYCZWm7PRQODYvS6y8lWmt61Syz5Nzaqhpp93Nd0c4PYI+izwaMKpX H/sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qt8PrFF5rWy8Gj1ABxOEOakxJdpJR0LJrG627NKAlx8=; b=B6bsVRnKssIGIJrOEfrOhZfoG4g3dUBthN/+bD0+OxPR3R8JKBt1si+DBECnWztuBy lL0SvFHydBkAoUracjvv5ruA5iYZYbKq55pJo/VGammIkWAj4OmiZdjxx9bwHtCCPI+L zrGcM7zWvKJD4d7vasEnw3AW3XAZxqQYIj+MnYg5gnNvg0QQkyTguHUvBzAOJmfaBGvY SFd160gLgkGodOlotZB3B1rWVmhkXF18DBA8SbzjEN+64ucwW8RANeCMCPbyGpKmVA4/ 3MvaK/glUK+qmIp/rOK0O+6nVuxUPfJMULBFeFAAorDh+p/B3elBoyfOpNsJUCB2kGrw 3L3A== X-Gm-Message-State: AOAM533dyTD2ADifToNILCHBIRiIdc2P+toOVNscbEcn+FI9I3emTKr2 OtMyQeQ6UUKj20dkdvbjLD8= X-Google-Smtp-Source: ABdhPJxvQfHFCUgjvQyYJWDy3x5QSXmLFgMMVvGsAr0GSOiFc5UtsOFPEdBBiLzH2+GMGjuVrVz/sg== X-Received: by 2002:a19:7019:: with SMTP id h25mr31884909lfc.464.1637943588560; Fri, 26 Nov 2021 08:19:48 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:48 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 09/20] ASoC: tegra20: spdif: Use more resource-managed helpers Date: Fri, 26 Nov 2021 19:17:56 +0300 Message-Id: <20211126161807.15776-10-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Use resource-managed helpers to make code cleaner. Driver's remove callback isn't needed anymore since driver is completely resource-managed now. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 33 +++++++++------------------------ sound/soc/tegra/tegra_pcm.c | 6 ++++++ sound/soc/tegra/tegra_pcm.h | 1 + 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 9383683aa4e9..6ca48bc322ae 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -289,38 +289,24 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; spdif->playback_dma_data.maxburst = 4; - pm_runtime_enable(&pdev->dev); + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; - ret = snd_soc_register_component(&pdev->dev, &tegra20_spdif_component, - &tegra20_spdif_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &tegra20_spdif_component, + &tegra20_spdif_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); - goto err_pm_disable; + return ret; } - ret = tegra_pcm_platform_register(&pdev->dev); + ret = devm_tegra_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - goto err_unregister_component; + return ret; } - return 0; - -err_unregister_component: - snd_soc_unregister_component(&pdev->dev); -err_pm_disable: - pm_runtime_disable(&pdev->dev); - - return ret; -} - -static int tegra20_spdif_platform_remove(struct platform_device *pdev) -{ - tegra_pcm_platform_unregister(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); - - pm_runtime_disable(&pdev->dev); - return 0; } @@ -342,7 +328,6 @@ static struct platform_driver tegra20_spdif_driver = { .of_match_table = tegra20_spdif_of_match, }, .probe = tegra20_spdif_platform_probe, - .remove = tegra20_spdif_platform_remove, }; module_platform_driver(tegra20_spdif_driver); diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index ef1e74d95236..468c8e77de21 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -48,6 +48,12 @@ int tegra_pcm_platform_register(struct device *dev) } EXPORT_SYMBOL_GPL(tegra_pcm_platform_register); +int devm_tegra_pcm_platform_register(struct device *dev) +{ + return devm_snd_dmaengine_pcm_register(dev, &tegra_dmaengine_pcm_config, 0); +} +EXPORT_SYMBOL_GPL(devm_tegra_pcm_platform_register); + int tegra_pcm_platform_register_with_chan_names(struct device *dev, struct snd_dmaengine_pcm_config *config, char *txdmachan, char *rxdmachan) diff --git a/sound/soc/tegra/tegra_pcm.h b/sound/soc/tegra/tegra_pcm.h index d602126c65b7..2a36eea1740d 100644 --- a/sound/soc/tegra/tegra_pcm.h +++ b/sound/soc/tegra/tegra_pcm.h @@ -32,6 +32,7 @@ int tegra_pcm_hw_params(struct snd_soc_component *component, snd_pcm_uframes_t tegra_pcm_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream); int tegra_pcm_platform_register(struct device *dev); +int devm_tegra_pcm_platform_register(struct device *dev); int tegra_pcm_platform_register_with_chan_names(struct device *dev, struct snd_dmaengine_pcm_config *config, char *txdmachan, char *rxdmachan); From patchwork Fri Nov 26 16:17:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641119 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 3E808C433F5 for ; Fri, 26 Nov 2021 16:24:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 70C901AA5; Fri, 26 Nov 2021 17:23:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 70C901AA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943843; bh=0Y0EQKphoKVU8LA+mSh/t0dDqSxkfRn2A9TEReYxdBs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=k7OXd5sOJ0AF33GO98zKff9Dqetfv/5UKGCsSAr9inPs2ourKWhS5pF5CtUQnXZFc nPIJ16hw3oiA6okFQvdE6Z+TpcYQLIcJ0gBWpGT99yd+bCGofXA0vt6Ir0eb8Ti8eA dIb+nkhcOj9cOJKXFB+oDJSMO7O9HbVT/Nj4mPqA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id ED788F80528; Fri, 26 Nov 2021 17:20:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7BA46F804F1; Fri, 26 Nov 2021 17:19:56 +0100 (CET) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3BA60F80245 for ; Fri, 26 Nov 2021 17:19:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3BA60F80245 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SbQVrq7M" Received: by mail-lf1-x132.google.com with SMTP id l22so25477496lfg.7 for ; Fri, 26 Nov 2021 08:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tbG85K+O8+Dl5om1+PZ6lAYg/7hr7N71/G0INRgPxNw=; b=SbQVrq7MGFxE62ut5dReO76clPquqYcsD5seMI2r5Ekfjjt57czFCxJNrK6toz4fjX gK/+H/RbcjerAOl2Q+IZnFcr91n/AP4jmXVIUVSKgSFI47xRJr8NDsB9zC7QOxZbqW66 M3BlaMTKXFOUNW88+Mm9SN1WmrZg+4Rnk+djZujQKMFdF67VQ5FjHE4vaTQTyZ7acQGr 09nr18Rt/7sGh6+HhfCJYhisArNj4RqK7pLyP+Ppu/Ti+a6HPDSHpxS47gdyECNAEWJ9 obeZPolP6lQ0yjztIPPRIVjBQ27mOMuk1MjQw6QLtCvSYDplDU2GupVO6W3Jyhnkw2Bi +GVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbG85K+O8+Dl5om1+PZ6lAYg/7hr7N71/G0INRgPxNw=; b=8GVsPCsqALfHMwE8oKQDTMx8OvNAEmnuTb4m0w6oNTv8gqbd/mmJ+2CS9apE4Ote0A 8bqeWvo7ysKyLP+ElYSFeRWrbGU7wPJxQ7bZGA+L5xtre8C0IobwlvSzeEL3CLpMQyII /cRVdUw/PSQ6xiKsmdVpaOMqVpx9m7hKUlscQTMZcH3waSJA0phIekREDbJz7ISG05ta mInhWHPKVTWjuH4dWxYtS+Li4QVzn6tx4VoujsheKawdeEuWC8zDsp/txucDCCNTgC8o FX//NXVWJx83c/+XIMFEu+M2Vyr+nBd5IjiLNPQW0730+ZqoYkB3PpFsJa78UWQxch01 yZfQ== X-Gm-Message-State: AOAM532UY5wuecgePkdQz5kEbsa76xlcnlXcSo32DHmUYRBCfi9qKLRd UhaoKKAXjTmlupvAMaTZ7ABDwl+AAkQ= X-Google-Smtp-Source: ABdhPJwDWO1Vlta1tP9gZbVb8KmrLyN84n3kqDO9aJna1XKbuzUtfmj5/ve/FnkPuT1etUb+1fdSDg== X-Received: by 2002:a05:6512:2eb:: with SMTP id m11mr29264894lfq.326.1637943589496; Fri, 26 Nov 2021 08:19:49 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:49 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 10/20] ASoC: tegra20: spdif: Reset hardware Date: Fri, 26 Nov 2021 19:17:57 +0300 Message-Id: <20211126161807.15776-11-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Reset S/PDIF controller on runtime PM suspend/resume to ensure that we always have a consistent hardware state. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 32 ++++++++++++++++++++++++++++++++ sound/soc/tegra/tegra20_spdif.h | 1 + 2 files changed, 33 insertions(+) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 6ca48bc322ae..8b9bac30d5cd 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +29,8 @@ static __maybe_unused int tegra20_spdif_runtime_suspend(struct device *dev) { struct tegra20_spdif *spdif = dev_get_drvdata(dev); + regcache_cache_only(spdif->regmap, true); + clk_disable_unprepare(spdif->clk_spdif_out); return 0; @@ -37,13 +41,35 @@ static __maybe_unused int tegra20_spdif_runtime_resume(struct device *dev) struct tegra20_spdif *spdif = dev_get_drvdata(dev); int ret; + ret = reset_control_assert(spdif->reset); + if (ret) + return ret; + ret = clk_prepare_enable(spdif->clk_spdif_out); if (ret) { dev_err(dev, "clk_enable failed: %d\n", ret); return ret; } + usleep_range(10, 100); + + ret = reset_control_deassert(spdif->reset); + if (ret) + goto disable_clocks; + + regcache_cache_only(spdif->regmap, false); + regcache_mark_dirty(spdif->regmap); + + ret = regcache_sync(spdif->regmap); + if (ret) + goto disable_clocks; + return 0; + +disable_clocks: + clk_disable_unprepare(spdif->clk_spdif_out); + + return ret; } static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, @@ -268,6 +294,12 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, spdif); + spdif->reset = devm_reset_control_get_exclusive(&pdev->dev, NULL); + if (IS_ERR(spdif->reset)) { + dev_err(&pdev->dev, "Can't retrieve spdif reset\n"); + return PTR_ERR(spdif->reset); + } + spdif->clk_spdif_out = devm_clk_get(&pdev->dev, "spdif_out"); if (IS_ERR(spdif->clk_spdif_out)) { dev_err(&pdev->dev, "Could not retrieve spdif clock\n"); diff --git a/sound/soc/tegra/tegra20_spdif.h b/sound/soc/tegra/tegra20_spdif.h index 1973ffc2d5c7..ff4b79e2052f 100644 --- a/sound/soc/tegra/tegra20_spdif.h +++ b/sound/soc/tegra/tegra20_spdif.h @@ -451,6 +451,7 @@ struct tegra20_spdif { struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data; struct regmap *regmap; + struct reset_control *reset; }; #endif From patchwork Fri Nov 26 16:17:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641121 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 636CCC433F5 for ; Fri, 26 Nov 2021 16:24:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8E2E11A94; Fri, 26 Nov 2021 17:23:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8E2E11A94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943862; bh=L+wkMXZmldTuXsHQy8SCCSvRec8VY7bSCXi2lDMNsJY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=je5MYNKv3lJ08pMunkrBI7eaB0v6z3ai9t9D06JF3cnK59bKStiYIIiAdcSH+EfDm 3UP3iLSrZMqcNa+Xfxb6kAZeWwItRFDRYgTUj/EsK94SbE5gVMI2OH5MxJpjvvI3qx Uy771RdbEubhuGEHNTxhSWBIR+RFX29+EQSLNZ8w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B57D6F80526; Fri, 26 Nov 2021 17:20:14 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C754AF804F2; Fri, 26 Nov 2021 17:20:00 +0100 (CET) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 84935F804ED for ; Fri, 26 Nov 2021 17:19:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 84935F804ED Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F1IsN1lN" Received: by mail-lj1-x235.google.com with SMTP id u22so19727802lju.7 for ; Fri, 26 Nov 2021 08:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XQZdihin90lA7efVTDzu3CsDg/xeb8H7EeSD4A6ITqg=; b=F1IsN1lNqFntYo6bCbHB9CPRZvvY/nTXdJo+Us3PXxM0NkiSnU7nUaMk/j/ma8/fAX 1eWdx4wrvVz0g9/srkBaAayU0zUTkrtWurvknhUJJwI6+JLMw5hfEEaI7yBcyE+zTU60 3VvyVvlOfs3coaF5eRyiLMvstMebJYewwg03H5v1b1VaezeZX1hIsjLvGa36vN92WmmT ilMDoNkp7il0KAGRyZEGqJcEUunJhDUVlXyCu3mOmwn9g8ZVhnOOFk0JL+fKc0B4ExAZ 21A54gVXgh3tsqJcaqHD+taoAkT4yqz3/MTCXhgDmOwAeOglSsVhQWTw1vJZ8lgPJVJg D2dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XQZdihin90lA7efVTDzu3CsDg/xeb8H7EeSD4A6ITqg=; b=yOneARAosmW8KYI4zFpvQ4uhfcKjWXUhFASu5c41W4Ijoj2C4AHGhA+d6Jt/6C6dE0 mQkTNCOP7hHTLSKtVqWP7O5ix7uEqsTg0aVskO0pRmiHZRyXpFSsc+Ozucfs9Tod6YK3 iVTYgq0t+JAifvUfZB25qnh0DD4l+7fU7jjszUpsERVY7xBgLQp+cMRG0oOH13oQeXYf Vmcv44NeReD1amOKsRMg+wkwQhy5lFoTDqzs2U77qWGMLih8l2b/kcxOCGt3/n98wcKi cqmeQ2Y3blK/YS2OPp7fLZuWIzwMIhp1wERR8+Qm9ir5il1WOOO1gm9O3yduwJPTLe1Q uHOQ== X-Gm-Message-State: AOAM531z5NULSV0uiHmRhp+3HIdE9zxM7JHpRZapdGeqYtquNT3uyP1L zp7iiuwrs2sra3SBE6xLWJk= X-Google-Smtp-Source: ABdhPJyeY+DJa2sflfc3Mxo+CLSNCZ8db8o1DJ/F5GgZWoSelxfLa5+6d4xFyI0nij43neTNk1WsoA== X-Received: by 2002:a2e:a279:: with SMTP id k25mr32248372ljm.37.1637943590529; Fri, 26 Nov 2021 08:19:50 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:50 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 11/20] ASoC: tegra20: spdif: Support system suspend Date: Fri, 26 Nov 2021 19:17:58 +0300 Message-Id: <20211126161807.15776-12-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Support system suspend by enforcing runtime PM suspend/resume. Now there is no doubt that h/w is indeed stopped during suspend and that h/w state will be properly restored after resume. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 8b9bac30d5cd..89f7fc5c8aad 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -345,6 +345,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) static const struct dev_pm_ops tegra20_spdif_pm_ops = { SET_RUNTIME_PM_OPS(tegra20_spdif_runtime_suspend, tegra20_spdif_runtime_resume, NULL) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) }; static const struct of_device_id tegra20_spdif_of_match[] = { From patchwork Fri Nov 26 16:17:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641133 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 1E84AC433FE for ; Fri, 26 Nov 2021 16:26:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4D70E1AB2; Fri, 26 Nov 2021 17:25:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4D70E1AB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943982; bh=wkxRzk0gGHhRxdg0s/E7ZJ8SSDX3ZdsAvqG+8g09ymU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TNNdMCG2vZ1r5gQxuvYL+O0JRCQA4qJI0XsTQ+jePiI2Uo4UF/RBRuGwjftmm7Imr 3ZgyZCHmwN3nTkxP9RatPlUIB6b4c+e1JqnQZfk9Z4Aobpvk6WSWD5nx1EiNgyEXM4 H4XBeJ+WxmfTQF4oS6mY6Qk5zJZjcR8lvugsm9cE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CABBAF80564; Fri, 26 Nov 2021 17:20:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C2A4FF80518; Fri, 26 Nov 2021 17:20:08 +0100 (CET) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 78F85F804FF for ; Fri, 26 Nov 2021 17:19:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 78F85F804FF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TJnwJBrv" Received: by mail-lf1-x134.google.com with SMTP id n12so25550317lfe.1 for ; Fri, 26 Nov 2021 08:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C6zkQtDZQENoW1Sivb5bfco/O//qUuyceF3hyVGGf7c=; b=TJnwJBrvNJkT1a6gaTqkuKSMg/trzJTt+KT0MRm3CDHp+iTU1GPUYU9T2WekDGOWzr 1147WeSkCkbe/ztrnLz9JmpByGJW1VVpLeKOgwlFEjMS4+qUTOJrHwS4QDUzlxmpNpJc UuFYiMsF00Db2/JLMcoPe3eqvib5N7r9d9zoCGXfIx20gWJ+dG1tmyGYv7WpMqTtfv4q XUcFIsJ+Ax0/U30r6hfkAViqXzvCyytLNB8hPCE1Yz2kumH9rKmzHcx/Q+cGokUSKFEO bcdV9LxfZVce0X34M/dfLhwU3rzxnN2QOUEFYiNW8gnVzIv6McjfJyW/HkBJuHg0IzqV Yi9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C6zkQtDZQENoW1Sivb5bfco/O//qUuyceF3hyVGGf7c=; b=NNRyAVyFfA+y0tb3mjkYrNIbfHBpzHrdstsXdfmVoEPxB00LFwYwKutczCN3V7jmp1 wLnGN40EUQ+ZRm/jINOzOK2qguWO3s68OsmT4z4yxL/XFi+Gc+lKAld32EhsqIawKNo8 zvPamdtqHXDgieDGC+PZFrEUT/Nh1D+mGrxiOmcx26EPjoYbdGHPGuUGCh94Z8gwI79Y /47xdC00RB34BQVtFLG4qq41j1QIxwNJDuUHRAhwwgLKZwpkZFwi9r/SV9VdXGpdRH62 pdKM/ooDDYC6NQ6rGz0acslM0z/zMycaZRLeMO0HQJVf9esPruK0/q6tRC+u51/68y3g SnUQ== X-Gm-Message-State: AOAM530LW3XgMMVdS1gtz+/Rwgf4AbdFAUzEuvV6W5dPhpnHIfM6rQ/h 90sodDjnNKWnIJFWOuaLxas= X-Google-Smtp-Source: ABdhPJwT1QIqpn6SrUIqAx9QKx1rgWGepcJAaepjwG8YbY5Cgfk2W3egIqISDds2VGCoj1Ig2/wwFg== X-Received: by 2002:ac2:58d9:: with SMTP id u25mr32199346lfo.514.1637943591668; Fri, 26 Nov 2021 08:19:51 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:51 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 12/20] ASoC: tegra20: spdif: Filter out unsupported rates Date: Fri, 26 Nov 2021 19:17:59 +0300 Message-Id: <20211126161807.15776-13-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" SPDIF and other SoC components share audio PLL on Tegra, thus only one component may set the desired base clock rate. This creates problem for HDMI audio because it uses SPDIF and audio may not work if SPDIF's clock doesn't exactly match standard audio rate since some receivers may reject audio in that case. Filter out audio rates which SPDIF output can't support, assuming that other components won't change rate at runtime. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_spdif.c | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index 89f7fc5c8aad..52be59c58126 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -79,6 +79,7 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); unsigned int mask = 0, val = 0; int ret, spdifclock; + long rate; mask |= TEGRA20_SPDIF_CTRL_PACK | TEGRA20_SPDIF_CTRL_BIT_MODE_MASK; @@ -133,6 +134,12 @@ static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, return ret; } + rate = clk_get_rate(spdif->clk_spdif_out); + if (rate != spdifclock) + dev_warn_once(dai->dev, + "SPDIF clock rate %d doesn't match requested rate %lu\n", + spdifclock, rate); + return 0; } @@ -172,6 +179,59 @@ static int tegra20_spdif_trigger(struct snd_pcm_substream *substream, int cmd, return 0; } +static int tegra20_spdif_filter_rates(struct snd_pcm_hw_params *params, + struct snd_pcm_hw_rule *rule) +{ + struct snd_interval *r = hw_param_interval(params, rule->var); + struct snd_soc_dai *dai = rule->private; + struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); + struct clk *parent = clk_get_parent(spdif->clk_spdif_out); + const unsigned int rates[] = { 32000, 44100, 48000 }; + long i, parent_rate, valid_rates = 0; + + parent_rate = clk_get_rate(parent); + if (parent_rate <= 0) { + dev_err(dai->dev, "Can't get parent clock rate: %ld\n", + parent_rate); + return parent_rate ?: -EINVAL; + } + + for (i = 0; i < ARRAY_SIZE(rates); i++) { + if (parent_rate % (rates[i] * 128) == 0) + valid_rates |= BIT(i); + } + + /* + * At least one rate must be valid, otherwise the parent clock isn't + * audio PLL. Nothing should be filtered in this case. + */ + if (!valid_rates) + valid_rates = BIT(ARRAY_SIZE(rates)) - 1; + + return snd_interval_list(r, ARRAY_SIZE(rates), rates, valid_rates); +} + +static int tegra20_spdif_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + if (!device_property_read_bool(dai->dev, "nvidia,fixed-parent-rate")) + return 0; + + /* + * SPDIF and I2S share audio PLL. HDMI takes audio packets from SPDIF + * and audio may not work on some TVs if clock rate isn't precise. + * + * PLL rate is controlled by I2S side. Filter out audio rates that + * don't match PLL rate at the start of stream to allow both SPDIF + * and I2S work simultaneously, assuming that PLL rate won't be + * changed later on. + */ + return snd_pcm_hw_rule_add(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, + tegra20_spdif_filter_rates, dai, + SNDRV_PCM_HW_PARAM_RATE, -1); +} + static int tegra20_spdif_probe(struct snd_soc_dai *dai) { struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); @@ -185,6 +245,7 @@ static int tegra20_spdif_probe(struct snd_soc_dai *dai) static const struct snd_soc_dai_ops tegra20_spdif_dai_ops = { .hw_params = tegra20_spdif_hw_params, .trigger = tegra20_spdif_trigger, + .startup = tegra20_spdif_startup, }; static struct snd_soc_dai_driver tegra20_spdif_dai = { From patchwork Fri Nov 26 16:18:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641125 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 8AA66C433EF for ; Fri, 26 Nov 2021 16:25:09 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B4BB019FE; Fri, 26 Nov 2021 17:24:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B4BB019FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943907; bh=J9f/dCqvxzNLtC4ITMqx0G40QPSZDaHRk+DovXcnCqk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GGmHCfDoumNQ7IO6hotyzSakpcwSTjdQlENDQ4HCYgGH7UEYDeDxbmin0P35kSaoa amGCBNruQ6kQoHzHy+Tup1a172pXq78atPuhxsxGUTCABO/gDBIquA1nwX1kYxvuBP XFHbW5rQVHd3AGQ1eKA6qj7Qq2GoqeNhi1Pc92oc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 73C0CF80543; Fri, 26 Nov 2021 17:20:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40AACF804F2; Fri, 26 Nov 2021 17:20:03 +0100 (CET) Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AA39EF80132 for ; Fri, 26 Nov 2021 17:19:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AA39EF80132 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HlrAKhbu" Received: by mail-lf1-x12b.google.com with SMTP id u3so25493381lfl.2 for ; Fri, 26 Nov 2021 08:19:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KhBo+jV3YB73Mp9ZeA7lb5QO9nWQOxbQBa92iKZ/6e0=; b=HlrAKhbuyvb8pdna51HltVnBFaB0F3geQuZfnQcUYEFWFQizrXE4lh/3lsBU1sOSCr Nb2QWYhkX9qQg6mdg/Dfs/045ZDocL+nmFVZYoMpJOVoZY9sjitYsudn5VTvg4Xe7Ywd I6tSRfmoyhFoqyaUAVdv06Mpz/Mp3l0z7AiU82BQmmwb7tTLs2p+blg5ONvBr+6w5+gg kzmLHpVTQMmUX+HBFmIQv2oecCR+ynZ5bYWI4Q2YIsUmLEWxR2nTaEyrEpavs+TbZbf6 uUXu3kZZPDngPDpptiRiaj72IJ1l72M88eqfczBjE+k6xkF6TIDB9mwp5dAuYmM2e0E0 CFLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KhBo+jV3YB73Mp9ZeA7lb5QO9nWQOxbQBa92iKZ/6e0=; b=EAe7pWaWBd/5161Vf3fb4mfqTUzuNyrbYKTgk731AbO1S2ckTnWqMGhGQbMhAXYJTC Cq+u4T5eHql4GzRQgc/hSrXzi/EV3z9mzmap3FbJtFHDMfgZ7U5wZpr0iB2kQhAZGlQg kZRz5YtwxgYRcgCzaqVUjmA1JVFDABMtaqGzl4KXjFvQbxpu/fa5oiTfq5m2mtQ/BbkH 6QuS5ghPRlO7rqTqiWYzrJfoWGN3Ze3DNkz832PYYDjENc9Jb/joyKSfMCcXKXad5tDk P8iSlswNAy/QTa1rnDLst5iwB01K+OmErr8t+C5bWatxqfIIDwk467aD/d+fV91MwG5S SWcg== X-Gm-Message-State: AOAM531cI0181IuCb3gPlnYJTQZmG6noJsrzFAUUv1k/IZmkMmZWYaCL /D5WF6ctCogObStLSha3FIM= X-Google-Smtp-Source: ABdhPJyqg0aE9dQ4pKabfAO56PZNA8uIGEm2iF7teqFeNDNfWW8LUoshpDDjHrHx7nCiKJFd+d4Kvg== X-Received: by 2002:a19:c795:: with SMTP id x143mr31768962lff.249.1637943592894; Fri, 26 Nov 2021 08:19:52 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:52 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 13/20] ASoC: tegra20: i2s: Filter out unsupported rates Date: Fri, 26 Nov 2021 19:18:00 +0300 Message-Id: <20211126161807.15776-14-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Support new nvidia,fixed-parent-rate device-tree property which instructs I2S that board wants parent clock rate to stay at a fixed rate. This allows to play audio over S/PDIF and I2S simultaneously. The root of the problem is that audio components on Tegra share the same audio PLL, and thus, only a subset of rates can be supported if we want to play audio simultaneously. Filter out audio rates that don't match parent clock rate if device-tree has the nvidia,fixed-parent-rate property. Signed-off-by: Dmitry Osipenko --- sound/soc/tegra/tegra20_i2s.c | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c index 266d2cab9f49..27365a877e47 100644 --- a/sound/soc/tegra/tegra20_i2s.c +++ b/sound/soc/tegra/tegra20_i2s.c @@ -262,10 +262,59 @@ static int tegra20_i2s_probe(struct snd_soc_dai *dai) return 0; } +static const unsigned int tegra20_i2s_rates[] = { + 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000 +}; + +static int tegra20_i2s_filter_rates(struct snd_pcm_hw_params *params, + struct snd_pcm_hw_rule *rule) +{ + struct snd_interval *r = hw_param_interval(params, rule->var); + struct snd_soc_dai *dai = rule->private; + struct tegra20_i2s *i2s = dev_get_drvdata(dai->dev); + struct clk *parent = clk_get_parent(i2s->clk_i2s); + long i, parent_rate, valid_rates = 0; + + parent_rate = clk_get_rate(parent); + if (parent_rate <= 0) { + dev_err(dai->dev, "Can't get parent clock rate: %ld\n", + parent_rate); + return parent_rate ?: -EINVAL; + } + + for (i = 0; i < ARRAY_SIZE(tegra20_i2s_rates); i++) { + if (parent_rate % (tegra20_i2s_rates[i] * 128) == 0) + valid_rates |= BIT(i); + } + + /* + * At least one rate must be valid, otherwise the parent clock isn't + * audio PLL. Nothing should be filtered in this case. + */ + if (!valid_rates) + valid_rates = BIT(ARRAY_SIZE(tegra20_i2s_rates)) - 1; + + return snd_interval_list(r, ARRAY_SIZE(tegra20_i2s_rates), + tegra20_i2s_rates, valid_rates); +} + +static int tegra20_i2s_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + if (!device_property_read_bool(dai->dev, "nvidia,fixed-parent-rate")) + return 0; + + return snd_pcm_hw_rule_add(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, + tegra20_i2s_filter_rates, dai, + SNDRV_PCM_HW_PARAM_RATE, -1); +} + static const struct snd_soc_dai_ops tegra20_i2s_dai_ops = { .set_fmt = tegra20_i2s_set_fmt, .hw_params = tegra20_i2s_hw_params, .trigger = tegra20_i2s_trigger, + .startup = tegra20_i2s_startup, }; static const struct snd_soc_dai_driver tegra20_i2s_dai_template = { From patchwork Fri Nov 26 16:18:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641127 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 A4ED0C433F5 for ; Fri, 26 Nov 2021 16:25:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A72D91A9D; Fri, 26 Nov 2021 17:24:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A72D91A9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943926; bh=taRbsqCzWB1a5KkmqBumvGryO0mM6cypNDIK6Sc4BAI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ti8EKqGztL4s9bnr2Wh0MsWgiuyD/98Bwm7LQYqk3aHs6jMYc8FO2JnetSwjpkbrJ PALoTZGgiW1Yes9d8+S+oiqTQp/uLaTZsNOZCKtSQO9WEde769Njhb9xbCxhtMOqi1 jFZmZH6q68w8/gWdR5xx7B/6EPkZLD/0XruGrFAg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1C17BF8054A; Fri, 26 Nov 2021 17:20:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 18516F80511; Fri, 26 Nov 2021 17:20:04 +0100 (CET) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F17C1F80245 for ; Fri, 26 Nov 2021 17:19:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F17C1F80245 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X6Qoj4Zh" Received: by mail-lf1-x12a.google.com with SMTP id c32so25544092lfv.4 for ; Fri, 26 Nov 2021 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J2ouOYArYTiGPyKjaLg9beinXsL+bwxgMLfVEklW094=; b=X6Qoj4ZhOaFBVDQNFBnNR3t7hp3vEEwXxbZern/ZQbYxgqUJYv4AScqsBuJ73e8Iby b6E0g8zTh8Ng/vTEY3BcjX16mLYX382sMlU9jXdUYddolleHq7Xju1SpglbeiuhvA9ec YuZLhkDakLWze9cNl+YPU/YT1VzdtplEB2NEecWCDsIYOxqpDO2ha7KDmSIcqIAJXUZp OhOaJr1GcLXGkqwtQVVaCapj+6ctuujv2PmNvSXgoPxH2/bpqFnV4sapVVWlOLXy9URc tvfjGlP59XQiI5qHUcO12udjNLUkgbj3u/sElqUWZ2aOK3TJPibHLClSyKI+Ge6ZeyCS n1Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J2ouOYArYTiGPyKjaLg9beinXsL+bwxgMLfVEklW094=; b=njsqquOTMa0IO1lCxGyBMaAq+gJwrYxklgwKD0g/UdM6SL+3PRQ+tfbsKxV6HzGltL ihrPqz8ir9bCCxSt8vuhkyqyW2nhqhfayZToyqL34j3zHfyxyOFq3J+qhaLSdGq/6UXt YYqrLV2/vDGR+NJASboBwCvNWs9WAXq/ZaAovJOn8I45ovGoHbH3vKdo0yZ5W4ppky0+ GT1xoq6UacXAyXeSDtqHrWwhoyKQoIKot8dvn28VL3s+iTTGeYDeIVxMusbLyxuh9Lb4 TPTcyTaxR1n50zev+3JKxVtHVANGicmyLRWY5AaJ+zNivW0Nb6niCtS4/KQ7eQQQTqiW ZO4A== X-Gm-Message-State: AOAM531ScawKe/20jE/iOuU1tOXomlGzCzGIK4MYIU8Oeu7AOn/7++K5 VTR+xg5YPF/ZWXUI2T+agrg= X-Google-Smtp-Source: ABdhPJx1S5VSCeVt+lhrxJEnN4E3jZNeyvTZuhJ0KfH/4BlVMHy6qUL8X955jzS+e6Uo1LAS9fS4Qw== X-Received: by 2002:a05:6512:1296:: with SMTP id u22mr30661465lfs.296.1637943594114; Fri, 26 Nov 2021 08:19:54 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:53 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 14/20] drm/tegra: hdmi: Unwind tegra_hdmi_init() errors Date: Fri, 26 Nov 2021 19:18:01 +0300 Message-Id: <20211126161807.15776-15-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add missing error unwinding to tegra_hdmi_init(), for consistency. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/hdmi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 9a87d351a828..142ad696426f 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1456,22 +1456,31 @@ static int tegra_hdmi_init(struct host1x_client *client) if (err < 0) { dev_err(client->dev, "failed to enable HDMI regulator: %d\n", err); - return err; + goto output_exit; } err = regulator_enable(hdmi->pll); if (err < 0) { dev_err(hdmi->dev, "failed to enable PLL regulator: %d\n", err); - return err; + goto disable_hdmi; } err = regulator_enable(hdmi->vdd); if (err < 0) { dev_err(hdmi->dev, "failed to enable VDD regulator: %d\n", err); - return err; + goto disable_pll; } return 0; + +disable_pll: + regulator_disable(hdmi->pll); +disable_hdmi: + regulator_disable(hdmi->hdmi); +output_exit: + tegra_output_exit(&hdmi->output); + + return err; } static int tegra_hdmi_exit(struct host1x_client *client) From patchwork Fri Nov 26 16:18:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641131 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 C39C1C433EF for ; Fri, 26 Nov 2021 16:26:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 01E411AC5; Fri, 26 Nov 2021 17:25:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 01E411AC5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943965; bh=BdTPIEKRC2U+bwp0Jp1MyNUSPqFlgUK5ZT30uDb8w2Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CG1J3qrfrK6sjcuaCYHh3jSmnWD+GzqH+C0vV3JSquxg1l6T20VD7ey/wKhAd+oh2 R8oRktDq5W5Vo5Jbi17gvhbwCezAO9beDPCMoQ8F6WEL3VtoXgzgUcNwquiSSXOB3e FDy8cEniAJ4w59MoHCgDXgc5K//4vNmewk/J+q50= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 439A0F8055A; Fri, 26 Nov 2021 17:20:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 058CAF80517; Fri, 26 Nov 2021 17:20:08 +0100 (CET) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AE114F804FB for ; Fri, 26 Nov 2021 17:19:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AE114F804FB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ipmb1hI9" Received: by mail-lf1-x133.google.com with SMTP id r26so25480964lfn.8 for ; Fri, 26 Nov 2021 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kfCGGQxmJYAAbJN5Gn/Us5aT7XWQ41BpqEskSKXA+Zs=; b=Ipmb1hI9I3LqLAc4llsJHl8SJTx2kQzibPyGtPfp1/Y9A/sitqwO0RqDuE0gjNdEt3 U+0W0ViUB2CPahHhsK7KVNGns9Z8jt/FYPP0cjQvn7dESQqWi8Va5Jh+Xj2mRBnUVKwR pRQEQzuQ8hKBJKybPue8TReT5JYIrhAPmynoIiwTZ+JveVEZUIGW5lBjK8kOYondYiDw xijCIdN89JkFulH9e1AcfdEmuQrrXBL/9XuwXmQZiqhE1opM0tGGrE7TF/sEFlGbqbYj uyQ+CnQ78FVMhmhDoYi9TRW2C0gJ1OaFAeO/r4E/ouHa+q8N83UA48cPvgwYAMIhkMvS vSlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kfCGGQxmJYAAbJN5Gn/Us5aT7XWQ41BpqEskSKXA+Zs=; b=7fz9hpYaVOORbq95CNwHfUI7cNVXDeONjH+zRL5YZ8NW4gHhw7gvaAzM2ACW2pI2gw t0+Fgbugks6zli+YTvKi67nruefcrqNIEtOTBuuQxMwE/qCD/U2JQd6W/UaqRpR5kc4n LRBODQQe4ni0DrHypvNZKDphY9FSdCkvHcgYBTvaX2LajmDjxysm/Ipnh09R4vMMNGVN 9JFligUG7qJ4uxo60emJWHfYft6Tn/J9eG9PiqsO7Db5WjjsbknNec0t1CWzR4IwWbdH 2AHdQVDXxCcCYPivjt8JIceDQwcrVre4lV/s7XdcV43fa7TjUbzNuuSgU/PLiXi2LHhe heKw== X-Gm-Message-State: AOAM530drcLXyw7C1tDMPVSeRKw5EcVgczg/gNk40E/pBgSY/CV+jF/y uuryEM+1kE7SW6EDN5bwQVk= X-Google-Smtp-Source: ABdhPJyJGEksZUgkHKxVYIKdv5rjrh2hlfjVuxNe0IU+N7eMkjjTtROdMS/3zbsAC58jieHxUE6U6A== X-Received: by 2002:ac2:5607:: with SMTP id v7mr30465207lfd.71.1637943595108; Fri, 26 Nov 2021 08:19:55 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:54 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 15/20] drm/tegra: hdmi: Register audio CODEC on Tegra20 Date: Fri, 26 Nov 2021 19:18:02 +0300 Message-Id: <20211126161807.15776-16-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Tegra20 SoC supports only S/PDIF source for HDMI audio. Register ASoC HDMI S/PDIF CODEC for Tegra20, it will be linked with the S/PDIF CPU DAI. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/Kconfig | 3 + drivers/gpu/drm/tegra/hdmi.c | 153 +++++++++++++++++++++++++++++++--- 2 files changed, 145 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/tegra/Kconfig b/drivers/gpu/drm/tegra/Kconfig index 32fe64553d2e..40f0d14cb240 100644 --- a/drivers/gpu/drm/tegra/Kconfig +++ b/drivers/gpu/drm/tegra/Kconfig @@ -13,6 +13,9 @@ config DRM_TEGRA_ORIG select INTERCONNECT select IOMMU_IOVA select CEC_CORE if CEC_NOTIFIER + select SND_SIMPLE_CARD if SND_SOC_TEGRA20_SPDIF + select SND_SOC_HDMI_CODEC if SND_SOC_TEGRA20_SPDIF + select SND_AUDIO_GRAPH_CARD if SND_SOC_TEGRA20_SPDIF help Choose this option if you have an NVIDIA Tegra SoC. diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 142ad696426f..a99861f95e89 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -18,6 +18,8 @@ #include +#include + #include #include #include @@ -81,6 +83,9 @@ struct tegra_hdmi { bool dvi; struct drm_info_list *debugfs_files; + + struct platform_device *audio_pdev; + struct mutex audio_lock; }; static inline struct tegra_hdmi * @@ -363,6 +368,18 @@ static const struct tmds_config tegra124_tmds_config[] = { }, }; +static void tegra_hdmi_audio_lock(struct tegra_hdmi *hdmi) +{ + mutex_lock(&hdmi->audio_lock); + disable_irq(hdmi->irq); +} + +static void tegra_hdmi_audio_unlock(struct tegra_hdmi *hdmi) +{ + enable_irq(hdmi->irq); + mutex_unlock(&hdmi->audio_lock); +} + static int tegra_hdmi_get_audio_config(unsigned int audio_freq, unsigned int pix_clock, struct tegra_hdmi_audio_config *config) @@ -832,6 +849,23 @@ static void tegra_hdmi_setup_tmds(struct tegra_hdmi *hdmi, HDMI_NV_PDISP_SOR_IO_PEAK_CURRENT); } +static int tegra_hdmi_reconfigure_audio(struct tegra_hdmi *hdmi) +{ + int err; + + err = tegra_hdmi_setup_audio(hdmi); + if (err < 0) { + tegra_hdmi_disable_audio_infoframe(hdmi); + tegra_hdmi_disable_audio(hdmi); + } else { + tegra_hdmi_setup_audio_infoframe(hdmi); + tegra_hdmi_enable_audio_infoframe(hdmi); + tegra_hdmi_enable_audio(hdmi); + } + + return err; +} + static bool tegra_output_is_hdmi(struct tegra_output *output) { struct edid *edid; @@ -1138,6 +1172,8 @@ static void tegra_hdmi_encoder_disable(struct drm_encoder *encoder) u32 value; int err; + tegra_hdmi_audio_lock(hdmi); + /* * The following accesses registers of the display controller, so make * sure it's only executed when the output is attached to one. @@ -1162,6 +1198,10 @@ static void tegra_hdmi_encoder_disable(struct drm_encoder *encoder) tegra_hdmi_writel(hdmi, 0, HDMI_NV_PDISP_INT_ENABLE); tegra_hdmi_writel(hdmi, 0, HDMI_NV_PDISP_INT_MASK); + hdmi->pixel_clock = 0; + + tegra_hdmi_audio_unlock(hdmi); + err = host1x_client_suspend(&hdmi->client); if (err < 0) dev_err(hdmi->dev, "failed to suspend: %d\n", err); @@ -1185,6 +1225,8 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder) return; } + tegra_hdmi_audio_lock(hdmi); + /* * Enable and unmask the HDA codec SCRATCH0 register interrupt. This * is used for interoperability between the HDA codec driver and the @@ -1390,6 +1432,8 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder) } /* TODO: add HDCP support */ + + tegra_hdmi_audio_unlock(hdmi); } static int @@ -1419,6 +1463,91 @@ static const struct drm_encoder_helper_funcs tegra_hdmi_encoder_helper_funcs = { .atomic_check = tegra_hdmi_encoder_atomic_check, }; +static int tegra_hdmi_hw_params(struct device *dev, void *data, + struct hdmi_codec_daifmt *fmt, + struct hdmi_codec_params *hparms) +{ + struct tegra_hdmi *hdmi = data; + int ret = 0; + + tegra_hdmi_audio_lock(hdmi); + + hdmi->format.sample_rate = hparms->sample_rate; + hdmi->format.channels = hparms->channels; + + if (hdmi->pixel_clock && !hdmi->dvi) + ret = tegra_hdmi_reconfigure_audio(hdmi); + + tegra_hdmi_audio_unlock(hdmi); + + return ret; +} + +static int tegra_hdmi_audio_startup(struct device *dev, void *data) +{ + struct tegra_hdmi *hdmi = data; + int ret; + + ret = host1x_client_resume(&hdmi->client); + if (ret < 0) + dev_err(hdmi->dev, "failed to resume: %d\n", ret); + + return ret; +} + +static void tegra_hdmi_audio_shutdown(struct device *dev, void *data) +{ + struct tegra_hdmi *hdmi = data; + int ret; + + tegra_hdmi_audio_lock(hdmi); + + hdmi->format.sample_rate = 0; + hdmi->format.channels = 0; + + tegra_hdmi_audio_unlock(hdmi); + + ret = host1x_client_suspend(&hdmi->client); + if (ret < 0) + dev_err(hdmi->dev, "failed to suspend: %d\n", ret); +} + +static const struct hdmi_codec_ops tegra_hdmi_codec_ops = { + .hw_params = tegra_hdmi_hw_params, + .audio_startup = tegra_hdmi_audio_startup, + .audio_shutdown = tegra_hdmi_audio_shutdown, +}; + +static int tegra_hdmi_codec_register(struct tegra_hdmi *hdmi) +{ + struct hdmi_codec_pdata codec_data = {}; + + if (hdmi->config->has_hda) + return 0; + + codec_data.ops = &tegra_hdmi_codec_ops; + codec_data.data = hdmi; + codec_data.spdif = 1; + + hdmi->audio_pdev = platform_device_register_data(hdmi->dev, + HDMI_CODEC_DRV_NAME, + PLATFORM_DEVID_AUTO, + &codec_data, + sizeof(codec_data)); + if (IS_ERR(hdmi->audio_pdev)) + return PTR_ERR(hdmi->audio_pdev); + + hdmi->format.channels = 2; + + return 0; +} + +static void tegra_hdmi_codec_unregister(struct tegra_hdmi *hdmi) +{ + if (hdmi->audio_pdev) + platform_device_unregister(hdmi->audio_pdev); +} + static int tegra_hdmi_init(struct host1x_client *client) { struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); @@ -1471,8 +1600,16 @@ static int tegra_hdmi_init(struct host1x_client *client) goto disable_pll; } + err = tegra_hdmi_codec_register(hdmi); + if (err < 0) { + dev_err(hdmi->dev, "failed to register audio codec: %d\n", err); + goto disable_vdd; + } + return 0; +disable_vdd: + regulator_disable(hdmi->vdd); disable_pll: regulator_disable(hdmi->pll); disable_hdmi: @@ -1487,6 +1624,8 @@ static int tegra_hdmi_exit(struct host1x_client *client) { struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); + tegra_hdmi_codec_unregister(hdmi); + tegra_output_exit(&hdmi->output); regulator_disable(hdmi->vdd); @@ -1611,7 +1750,6 @@ static irqreturn_t tegra_hdmi_irq(int irq, void *data) { struct tegra_hdmi *hdmi = data; u32 value; - int err; value = tegra_hdmi_readl(hdmi, HDMI_NV_PDISP_INT_STATUS); tegra_hdmi_writel(hdmi, value, HDMI_NV_PDISP_INT_STATUS); @@ -1626,16 +1764,7 @@ static irqreturn_t tegra_hdmi_irq(int irq, void *data) format = value & SOR_AUDIO_HDA_CODEC_SCRATCH0_FMT_MASK; tegra_hda_parse_format(format, &hdmi->format); - - err = tegra_hdmi_setup_audio(hdmi); - if (err < 0) { - tegra_hdmi_disable_audio_infoframe(hdmi); - tegra_hdmi_disable_audio(hdmi); - } else { - tegra_hdmi_setup_audio_infoframe(hdmi); - tegra_hdmi_enable_audio_infoframe(hdmi); - tegra_hdmi_enable_audio(hdmi); - } + tegra_hdmi_reconfigure_audio(hdmi); } else { tegra_hdmi_disable_audio_infoframe(hdmi); tegra_hdmi_disable_audio(hdmi); @@ -1663,6 +1792,8 @@ static int tegra_hdmi_probe(struct platform_device *pdev) hdmi->stereo = false; hdmi->dvi = false; + mutex_init(&hdmi->audio_lock); + hdmi->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(hdmi->clk)) { dev_err(&pdev->dev, "failed to get clock\n"); From patchwork Fri Nov 26 16:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641129 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 66FCFC433EF for ; Fri, 26 Nov 2021 16:25:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 964081AC0; Fri, 26 Nov 2021 17:24:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 964081AC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637943943; bh=9EcX4jOmIU+43AMkKdabHqLJOG2xOBvSPljvX6kGj/Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UgtgEioFnxUr4pZ0sXS97Wm6kb3AMP7zje9waK+hgEG7K99GAiVlwYYTHgkq8CsI1 uwYwkLINYohryczRIghawhrWtq/P48RnEQlg808jGICkm6yEvfhGL1KymQJCnwsNg2 FEicJkwcZ5Mc12wdq+CQVdHLEezNqsSKgDlqN1BU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C3806F80553; Fri, 26 Nov 2021 17:20:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97F3EF80245; Fri, 26 Nov 2021 17:20:07 +0100 (CET) Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 17476F804EC for ; Fri, 26 Nov 2021 17:19:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 17476F804EC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fuV2rpY5" Received: by mail-lf1-x12f.google.com with SMTP id t26so25466623lfk.9 for ; Fri, 26 Nov 2021 08:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0mQGburGzaVO6t6m0C9ToG0s590roHzjwKj9a/U1hq8=; b=fuV2rpY5vWtXLgfFL3kQDRM+ioE76IqkOsczEVCgP55ZUOsM6JRi1k1DUic6KroJPS 0tKyZlRv6Eyfnu2i63/8F5l3GQ3gMNc9CdD0hLqviK+wvyStY1jg5iC7kGuzI3eIMcEf PB+2xvrZY342AogXJzAfszoXobBHB6Q3p0iYRgcdy2pL+5r5mbobIWDkdh/z9DTNnsQb x59msvnA+cjRsiH/FH7HPP0qQ5JLIZK47Am2iLsa5Qd3Lq9qRfBeS03r7y+yojAESQhP ShNJV3gqMzXfS0qwS2eGeNOLcm9Wh0FHqRbij68DTKDMYHAQ1d0SLguifx4pu026d7wv /dEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0mQGburGzaVO6t6m0C9ToG0s590roHzjwKj9a/U1hq8=; b=LKjyuodwV9WLG7zfk1QCB0wP1yzBzRnZVjlIj6EaKWICbl/4exLaCvZTq+52PNad5I 4gtu20lAeknJ5yJvTHxCE0bQ6iDg70Xfbtg3QO+urbPD2mXOAQHF+gUNVd94S331Uzfn BlSrYGqCcM8HwAnmgSNsbeaKljv439MrSVB6hb4Szui8u/tnLaLvoG79Kw7Bj0CYoz5i 8tNwi2u6qVPXmUAwJgxZQiiH4W3hfp9bMgzBh6NgPKd7bsS1g79iWNVc7mlnQHxyc44m bOXHo40aJAE62uCKli8b0tPyM/FTsDA5XG5zDr+8ECtDXz1nT+l2QyfUSBa6532Oav0B DFww== X-Gm-Message-State: AOAM532+v7Qi56EHlPza/jgIN3vD16lE/Vb0oxMToVLc7uzkJggip3uj 9U/WDlwbXM1cKyxqQ29YVNo= X-Google-Smtp-Source: ABdhPJylJzqB2ZvlpxpzfeqjArW2IsHMhFnA0BIsWJR6W+91PfSCYZb5GLBH1w9hRPLmfiiTF5DZOg== X-Received: by 2002:a05:6512:23a7:: with SMTP id c39mr31318838lfv.655.1637943596282; Fri, 26 Nov 2021 08:19:56 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:55 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 16/20] ARM: tegra_defconfig: Enable S/PDIF driver Date: Fri, 26 Nov 2021 19:18:03 +0300 Message-Id: <20211126161807.15776-17-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Enable Tegra20 S/PDIF driver. It's a part of HDMI audio subsystem on Tegra. Signed-off-by: Dmitry Osipenko --- arch/arm/configs/tegra_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig index 817b39190d54..1b8f8fdbedc5 100644 --- a/arch/arm/configs/tegra_defconfig +++ b/arch/arm/configs/tegra_defconfig @@ -235,6 +235,7 @@ CONFIG_SND_HDA_CODEC_HDMI=y CONFIG_SND_SOC=y CONFIG_SND_SOC_TEGRA=y CONFIG_SND_SOC_TEGRA20_I2S=y +CONFIG_SND_SOC_TEGRA20_SPDIF=y CONFIG_SND_SOC_TEGRA30_I2S=y CONFIG_SND_SOC_TEGRA_RT5640=y CONFIG_SND_SOC_TEGRA_WM8753=y From patchwork Fri Nov 26 16:18:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641139 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 4A406C433F5 for ; Fri, 26 Nov 2021 16:27:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6D8511AC7; Fri, 26 Nov 2021 17:26:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6D8511AC7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637944058; bh=Q+iZfZiuFAwG+py6EhLGHr0HJdeFsJpOkfBShhQuc9Q=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KhcmGvVP71AyfPcyXQ8j+RKDEsBz5Nz58XuTSAN9LTFg8urLRlQvhMFbRSmF2IFRD nSzA4kY7d+FOdwnRvGFujych/sNWsTGDhY7j+84UMlRzo0emEXTctP8bZEAzAuKMOp qklJqPqo2Pj4MD/P04jSsxxxBpkRfoDZAGV8UeUg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9109FF805AC; Fri, 26 Nov 2021 17:20:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9FD51F80526; Fri, 26 Nov 2021 17:20:12 +0100 (CET) Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2A24AF80515 for ; Fri, 26 Nov 2021 17:20:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2A24AF80515 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bdbspkD2" Received: by mail-lj1-x22f.google.com with SMTP id t11so19726606ljh.6 for ; Fri, 26 Nov 2021 08:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pyWXKSD/ngAWTwm6HA1HadGHkUDHHAfqetu21/vFVIM=; b=bdbspkD2uxc8qeriYgYo3urTgP3sVL8LPoyinGG3VjF3C7Lw0RK+XZckeGj0vFEJHn XQ4zadccolf5Ix433mkdFsT6vgImRa6Txk210jDxGGs2WztWVW5Y9CpKN8ks1hCa1VoP MxyOOSkQGswD28YdxKvlc2JDyMc1jj0NVGVovHOfgYq6LoJTdWVQXajaanCtGL1TdQ1i +WwdN6tfAhUArRz59d16jrN3THi5VHiu1P1uHM7Egb1SzwU0RYaOxhLHHfG3Uw+UoD3O LtVtusEJIBWcyT1kojXzI8gP4RLEwwLnfE9bWG5pUgcIpqyp/yhYbnhxT7suOiB95i7B AOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pyWXKSD/ngAWTwm6HA1HadGHkUDHHAfqetu21/vFVIM=; b=YePTlNnxzKq0GN+pWmbgHin7OhL6ZYc7BfZYFH+WWMoytkJAQs3sEfuFENVAgalSls sLAYjBmwhbr6DNZVtgs4A3ICN3S+qx5Am3KOH4th1nQaOFLpjwbH+LaQUnDwTMInSy5H 4Dt7ZMGyGdsq8Q6IlVkyaP/eswGJyT5Hy4Uzfbp6TAN9ql0nTCuvBGa0rhek8yD/jykz AY53Rzse/RLPjGK2JeBXGGtDdWjj5F5vEuP+FLBWkS1apju0s/ccTyVRQeAWV8ULfFAI yiQRw5CC/VUsRMCvJj5z7wKisxtjPHas8FdA+acSsNyvKgsV6tHF9Fo5P7HFKMmB5GKa eFPA== X-Gm-Message-State: AOAM531APDhxxFhyTsMX0wIMRB4pqHxLu+4zhNWVF28bBKMTv1HYFPCW 2YReVEWo3K06GLZqxuJ1yKg= X-Google-Smtp-Source: ABdhPJxpm9nqKWKezaZcIWKSbgNt+5aswTDFHwGvFf90WbQr4/XEZVYSn1hrv8SDqgkyr4alLXIBbw== X-Received: by 2002:a2e:9217:: with SMTP id k23mr31531018ljg.267.1637943597317; Fri, 26 Nov 2021 08:19:57 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:56 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 17/20] ARM: tegra: Add S/PDIF node to Tegra20 device-tree Date: Fri, 26 Nov 2021 19:18:04 +0300 Message-Id: <20211126161807.15776-18-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add S/PDIF node to Tegra20 device-tree. It's needed for enabling HDMI audio support. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra20.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi index 63c2c2f8c0ce..799da7dc929b 100644 --- a/arch/arm/boot/dts/tegra20.dtsi +++ b/arch/arm/boot/dts/tegra20.dtsi @@ -197,6 +197,7 @@ hdmi@54280000 { reset-names = "hdmi"; power-domains = <&pd_core>; operating-points-v2 = <&hdmi_dvfs_opp_table>; + #sound-dai-cells = <0>; status = "disabled"; }; @@ -396,6 +397,23 @@ tegra_ac97: ac97@70002000 { status = "disabled"; }; + tegra_spdif: spdif@70002400 { + compatible = "nvidia,tegra20-spdif"; + reg = <0x70002400 0x200>; + interrupts = ; + clocks = <&tegra_car TEGRA20_CLK_SPDIF_OUT>, + <&tegra_car TEGRA20_CLK_SPDIF_IN>; + clock-names = "spdif_out", "spdif_in"; + resets = <&tegra_car 10>; + dmas = <&apbdma 3>, <&apbdma 3>; + dma-names = "rx", "tx"; + #sound-dai-cells = <0>; + status = "disabled"; + + assigned-clocks = <&tegra_car TEGRA20_CLK_SPDIF_OUT>; + assigned-clock-parents = <&tegra_car TEGRA20_CLK_PLL_A_OUT0>; + }; + tegra_i2s1: i2s@70002800 { compatible = "nvidia,tegra20-i2s"; reg = <0x70002800 0x200>; From patchwork Fri Nov 26 16:18:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641135 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 4D8E6C433F5 for ; Fri, 26 Nov 2021 16:26:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6FDE41ABF; Fri, 26 Nov 2021 17:25:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6FDE41ABF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637944005; bh=2uXCgcmnLPw/UxUc6tU22WhvW6eiURJr8LMnJ4vK018=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JDRPhlPZ9CphL7x0cH+zUbKnAxNi5PXWqySlWxxalc3f4XYBKcHsR6maWUhYZN+k6 MZq6ew7imCkZAqVR5rKqtgbj+75VoY5uLTRIlMnoK99XzOwCJB9por7lsy85zJ1rbr k9lB47cvh6sot+/kkh8OwJtokX2lS2PE+R+mJNTY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 76EA0F80566; Fri, 26 Nov 2021 17:20:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E94F6F80517; Fri, 26 Nov 2021 17:20:08 +0100 (CET) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 02E97F80508 for ; Fri, 26 Nov 2021 17:20:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 02E97F80508 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o1DWMEb1" Received: by mail-lf1-x130.google.com with SMTP id k37so25546028lfv.3 for ; Fri, 26 Nov 2021 08:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n2CS486VK3pErXweLhn8rqAyzxInSDaJTqOjIWkbv/Q=; b=o1DWMEb1T5JGVr+QWfi0T8rJPO9ShLpM0eQbXgMMr1Ed0qb2n7CzvFC7hCAawvCPjx FV77MEtaOndwrCgVn5Sl4KDEhJsbBKzAxNGNRXVBjPaL/LmhyrnWk260AE3Kij5qsMxv WaEC377zdSgBY0l6XBQdtMnvb65ENAdKn+3FvcPi/297odNW3wdI6m3NJI+lf72WHljj EVyvLb6/gON+hYDViwFpZGMAbtDN6k8BbdmGS2dSfkwbEVaklbvQsAgfgDnwTBcx6lTG HnR5BI5gcu1hbvTRG2a3Rbio74zanVGBd4Pj8kVpHVZ9Er58G3FegIsKtV4ByQChJjjw EDEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n2CS486VK3pErXweLhn8rqAyzxInSDaJTqOjIWkbv/Q=; b=lNYF4i9xbwnbYJaJpp7PyPwCxsln8DNKcYupEIzbSqpj4e1xrQ2ebabljCOnvL1Ip5 5DIeuEg7OxNIOkMf5DDk5aFr9hKoRSxcyxZDux9U/2vDtpcXMNzo2reA0ZUyMNBRqffK BlpCpMO7o5KypSVyRJ/LnbUsFQbkAujhHwiAyOgwMTA3g7mBMqRFXtlQnAjSYJ46D2Un wwTe0t6VnZ89YCBLwWY3FP17L+RguYzAuGLkhQv5uYNVZNTD5P8+8690dMyoj4ncqPAR F0lfnJ/d7OgzCVHPAimuaz7/3XYTyITbCobFCBtyfJl7hD3yu44hBObURGt6tFZM9QzZ p2vA== X-Gm-Message-State: AOAM532Q/g9cjyMPN6KGMXWnGIUqjBy4KDefammP7Sef/Za2s9DG2Kdv wRtXNY6tIsq6+g6RmPKrKHg= X-Google-Smtp-Source: ABdhPJxufa09SdYBqo/kYgmkWvAdAZeSGh63a/rnmEQbEH51oFmeKfaB2ac9qq451gtYc6UF3a/UoQ== X-Received: by 2002:ac2:4571:: with SMTP id k17mr29916266lfm.631.1637943598334; Fri, 26 Nov 2021 08:19:58 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:57 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 18/20] ARM: tegra: Add HDMI audio graph to Tegra20 device-tree Date: Fri, 26 Nov 2021 19:18:05 +0300 Message-Id: <20211126161807.15776-19-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add HDMI audio graph to Tegra20 device-tree to enable HDMI audio on Tegra20 devices. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra20.dtsi | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi index 799da7dc929b..a2cdc591b4be 100644 --- a/arch/arm/boot/dts/tegra20.dtsi +++ b/arch/arm/boot/dts/tegra20.dtsi @@ -186,7 +186,7 @@ rgb { }; }; - hdmi@54280000 { + tegra_hdmi: hdmi@54280000 { compatible = "nvidia,tegra20-hdmi"; reg = <0x54280000 0x00040000>; interrupts = ; @@ -1063,4 +1063,24 @@ pmu { interrupt-affinity = <&{/cpus/cpu@0}>, <&{/cpus/cpu@1}>; }; + + sound-hdmi { + compatible = "simple-audio-card"; + simple-audio-card,name = "NVIDIA Tegra20 HDMI"; + + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,dai-link@0 { + reg = <0>; + + cpu { + sound-dai = <&tegra_spdif>; + }; + + codec { + sound-dai = <&tegra_hdmi>; + }; + }; + }; }; From patchwork Fri Nov 26 16:18:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641137 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 E0DDFC433F5 for ; Fri, 26 Nov 2021 16:27:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1686F1ABD; Fri, 26 Nov 2021 17:26:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1686F1ABD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637944041; bh=In3mLWtGDD+dbq28/TAIw2GWqp3plC4mvHCKuvHKlMU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QT8upMlaLpmqKva2IN18VDT+wie+R6YR6ceZNQSMVGwO49JOlFr7I0AK2BYPqOfs9 sRr+W/rwkYxFOQPT63ULKhR7bgIDfaJdAuk0Np1LpLos0y7Lp8E5Pm5XaCXIpbeVjo lcUXxILLiDb5ERnfq11ii+jraTdVHxrkiq4B3790= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 164A4F8059F; Fri, 26 Nov 2021 17:20:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97B70F80520; Fri, 26 Nov 2021 17:20:11 +0100 (CET) Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B440CF80508 for ; Fri, 26 Nov 2021 17:20:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B440CF80508 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kzlqHTAd" Received: by mail-lj1-x22b.google.com with SMTP id k2so19766379lji.4 for ; Fri, 26 Nov 2021 08:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FxP5tB2iw5BzQOiwdyEyNre1QfPs8oOiaNDQeHGYp/A=; b=kzlqHTAdAhqx9uMFzd+CS4o7MQx3tt2NukcjKGssEu7kZMdW6fHarWUCrdqGzEAwPl fpuAPJ+zod57zNo+qtkm16mdGqs0Lh7iJJmFsIz6PMJ8AdXsA79F7/qVESlXK84AuKM1 jATo9QykkskeMCYiqB+uKO0bxgT5WZL1Ni6iXRzMNQG1pph0oy763E1aOMuKM2wmLvQ5 8ktA43IdTnoWWp/YlUGc4H9Jx+6+if72dzmi747LiVxyMPDfwsw+Wwj37c/TWmviZiFy 1r77P+bQkb8YTtwu0AV9LbDAZQpvvyPyHhjYNAgOY211JJBMx6WUp/3/uGtrlDrdpbf5 8t8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FxP5tB2iw5BzQOiwdyEyNre1QfPs8oOiaNDQeHGYp/A=; b=Qmovi9SdOXYX/vtQGF8a9VLzjdJ3vPOqsTfsQHfz1yA9cZzgUKPc4o/HiF5ZaSumtX kxIZnG4+KYFI9M4yqjM+RJ10zRTH7Hd0Ofl13lhpshM4zKZzZWsaQeWY3WSuQfPM3j+z xvljdyuSMhdusyw2zL1x3BhrluRH5dKdmkt/ISkpBavLODQhJ+LhTW2qvE/CH5FIHdoV uORdMl87TxrWTNWLJb6kyXBP0tAxlWu60SlrvN3VZ4WOwdDOVgDLlkhM4ZIzmdTCg6o1 GNaygMUzDx4aUufDV2sF6S862x9EZMAZIwMY5c3CspKnaENdH4an+5+4ZDwLl93L4Ye/ gXsg== X-Gm-Message-State: AOAM530Y5fanXllTbIKR1aiqxPjPHpnhfQOr3puumHOs5Yh+r/A6cDpF e25CGH5BlwrQJvTXMdZmuoM= X-Google-Smtp-Source: ABdhPJzxsTtZB9drLrB4WxixNDRQ7Fx6NNECUmkUX+4V5l25QUsz4gPwn3zgWqi6R9W+ucTu1kGc3w== X-Received: by 2002:a2e:8991:: with SMTP id c17mr30947654lji.361.1637943599494; Fri, 26 Nov 2021 08:19:59 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:19:58 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 19/20] ARM: tegra: acer-a500: Enable S/PDIF and HDMI audio Date: Fri, 26 Nov 2021 19:18:06 +0300 Message-Id: <20211126161807.15776-20-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Enable S/PDIF controller to enable HDMI audio support on Acer A500. Use nvidia,fixed-parent-rate property that prevents audio rate conflict between S/PDIF and I2S. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra20-acer-a500-picasso.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts index db388ddd062f..f47b946627c3 100644 --- a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts +++ b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts @@ -376,8 +376,16 @@ pta { }; }; + tegra_spdif: spdif@70002400 { + status = "okay"; + + nvidia,fixed-parent-rate; + }; + tegra_i2s1: i2s@70002800 { status = "okay"; + + nvidia,fixed-parent-rate; }; uartb: serial@70006040 { From patchwork Fri Nov 26 16:18:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12641141 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 C6E23C433F5 for ; Fri, 26 Nov 2021 16:27:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CDAD81AD0; Fri, 26 Nov 2021 17:27:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDAD81AD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637944077; bh=XuA56N4mylb5psuq/ixrXJz4DcnFsm/izIrnhfR7AeQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FpfxPpuqRmi2HYJh8uh+pIiI2i8/7ItwVxi2rj4AoFVseQHXYEwhq5CkaujmYhT/U L+2vv+rmVkGhvUCcm6MU35S7SdDmBH6CRWfE7khnBTnmATe3ux/wfb3mGebmRLZKPW YliqcnNv4eWa3kr1/o73JPbWH90jJCOLmxcNhNbU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 14283F805B0; Fri, 26 Nov 2021 17:20:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 423C9F80552; Fri, 26 Nov 2021 17:20:17 +0100 (CET) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DF285F80508 for ; Fri, 26 Nov 2021 17:20:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DF285F80508 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oTcerw3j" Received: by mail-lj1-x232.google.com with SMTP id l7so19725683lja.2 for ; Fri, 26 Nov 2021 08:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hEN8lxqzB5PkjPszcdUxNpJc6epYJF7n5YUfahDhZts=; b=oTcerw3jboBSgaI5lBASiQ0+yvoxajfozbWkKUsSmofKDE934IXHDdxNhB8W9inQH8 Deth1OvQaNwgcuyT1EYOl7z37XeRTOtofk3rfAARsYrFqOpJrZaMP2yWgRj3wWz8rhOS c9Dce6wjkImXLFLe+QdB7nP22gzehsMpGLBEEMDo0XSy8AW6kq9BhVWDy3FC77Jlsbrv NXnqGvMr1srJooL0mlDZs8j2QAzGmCQDiJde7E6dgpDRF550dE9c1UQxnnqLqUJtU5t6 jyg7JecYzESPBU3YZ5QeRjpyQX3JKtntQB7xj3ORrmWmqbKeewF4FQ6LCWyGzgfuLizK K0vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hEN8lxqzB5PkjPszcdUxNpJc6epYJF7n5YUfahDhZts=; b=3ORF+zzYgEo5oMmyBRTl+Wx4cAD5pGYQZMyIUQaxiI+L8TEh4XVHIuhD+m1Wm12m5q pX6ogCw1WNBxMtXaiPKvmuN5q/G2Ln+CCShP1CWjRq0mYj1kC5IVAR4mbTs+zTk5FnWn r+WUpbiDDGNeTpaRt/pdsAi03Tmzt/+GmfacvMiGvkipb5Hi1pHeel7d2wUp9VrxMzzH RZefL7C5BHdhBmXp5yEFPHfjStuEdO3pWwRIo9D7wXfdgCcBX2X/q3btFW8UiatVarvj uHDKtWw9IRes+Pt6dtQVTbrXfc888p/w8eXNk1YPTDy1yeDAxY7f+hUquOrl8xvvyAQE E2jw== X-Gm-Message-State: AOAM532WdciFaFGK836jb4aAPAoXP1Mzwfa7w66J2lLHagr9LnAjUTLs IYy1oqpT8/gRsryN1ioC2vOIMjcbpqY= X-Google-Smtp-Source: ABdhPJzz5wBDSCE4Eo1QRQj2umu9yNSwj9Kxjmg73qAOgEls3WYa2Hilna7xfBmiFLf2MVj1rIyQ9w== X-Received: by 2002:a2e:a792:: with SMTP id c18mr32236469ljf.443.1637943601285; Fri, 26 Nov 2021 08:20:01 -0800 (PST) Received: from localhost.localdomain (94-29-48-99.dynamic.spd-mgts.ru. [94.29.48.99]) by smtp.gmail.com with ESMTPSA id t7sm613381lfl.260.2021.11.26.08.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Nov 2021 08:20:00 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v2 20/20] ARM: tegra: paz00: Enable S/PDIF and HDMI audio Date: Fri, 26 Nov 2021 19:18:07 +0300 Message-Id: <20211126161807.15776-21-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126161807.15776-1-digetx@gmail.com> References: <20211126161807.15776-1-digetx@gmail.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Enable S/PDIF controller to enable HDMI audio support on Toshiba AC100. Use nvidia,fixed-parent-rate property that prevents audio rate conflict between S/PDIF and I2S. Tested-by: Agneli Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra20-paz00.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts index 5b2260f61f05..921a811632a1 100644 --- a/arch/arm/boot/dts/tegra20-paz00.dts +++ b/arch/arm/boot/dts/tegra20-paz00.dts @@ -264,8 +264,16 @@ conf_ld17_0 { }; }; + spdif@70002400 { + status = "okay"; + + nvidia,fixed-parent-rate; + }; + i2s@70002800 { status = "okay"; + + nvidia,fixed-parent-rate; }; serial@70006000 {