From patchwork Wed Nov 24 22:00:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637991 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 75677C433EF for ; Wed, 24 Nov 2021 22:14: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 8B41F1878; Wed, 24 Nov 2021 23:13:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B41F1878 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637792083; bh=xS8ddv4zKX2JunJZdPjwJglEBs8rVDsumpZkEpy607I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=i+xzPcW1CnkYyWkYfwWJmA1jvtwRoJhb2AYcyitrTcjeZujEMfP8mBEJ0/GBOajiU XPxVKe0CAb0MULG9v58uVL+LUgkELodVhs5G/z9fGU+GkQdRnWTaRqsqA38g4HH5LI OD1CAzUHj2e3L4M4wGA0VP6H5RLupTfFN2X3aXqc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C9E8BF805A0; Wed, 24 Nov 2021 23:07:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4C914F801F7; Wed, 24 Nov 2021 23:07:36 +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 CC689F80245 for ; Wed, 24 Nov 2021 23:06:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CC689F80245 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qfW/HGnp" Received: by mail-lf1-x130.google.com with SMTP id c32so10997453lfv.4 for ; Wed, 24 Nov 2021 14:06:36 -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=2uuzWPY9rvjqfLr6fV1cmdNXd06jrQuuKD96OjbdPNQ=; b=qfW/HGnpwCJ+dlE2szaDZeKhas1KXNCAysUabq12Y4F5YGkDbHpghxFVOofzIK/kTC gElro/xsp2BmqhbbG3ukENdsXrM9TwUCWplBi6kH+whRJB8SDMaLZFjTvHm/8V03CJ++ RLRTk+bu7Y3J9gdjMza+jSJyJjieaKdSMxy+eD8wOGX3WLkHpww8wtwwMBsFJLUhrAH/ P4l/0QOWxp7sTeiB5tf21QhBm7/gvsft2MS/cFZlxQX+b45CW4ykPXboy/+9UXz7gz1W B5RpB040Vl27+liyU/91pUGKM5/H4jly777rmEfqoluq7zNJgdIPhoMtAPKruSeaH/P0 6MPQ== 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=2uuzWPY9rvjqfLr6fV1cmdNXd06jrQuuKD96OjbdPNQ=; b=EBeBPb2W3T+dDetG70KQOnH5nWrMF1klkXSWUH9BzsfNZtuDw9l15B5zrL0p5CFzeV qw174eNIv/x9kbv/HtKsTNPl6+3yAzpTcOltLNaYF/7ZNv3TFfmEH49/VFGRFcAX+Wwz fmtOiLbLibV+fSNrrgWLd0F2XLapr8VoiDsHfUvdPPYbK4w0bH8ZIzHBlQnyfdqY0LSz Gfyf8j3qU8+3eGuTk+unOkUDxzOI1viwxrR0+ioIVMQVbXGNAwPHbKZjRAyYi9JJccBx 1K1gdCvmS+eXzu80J82Zs+N2D/kHaQD2qFQIMNvBi9JmIXEnrv++JN4v6P2SUJYPZxuw vGdA== X-Gm-Message-State: AOAM532mcYFB/XfrhtgDakL8llOYaXGQ7CY+Ft3r/5l9rTnw/hm7fzhA jDAGArZoHKNiveYFesgzawE= X-Google-Smtp-Source: ABdhPJzQ5wmPsf7MT2kOseSoWuXZrjMS2l8zY/SyQMJGCvCCrfyBLGpbOCXFy5OZHCgrTdnaiZanxQ== X-Received: by 2002:a05:6512:249:: with SMTP id b9mr19394202lfo.496.1637791590799; Wed, 24 Nov 2021 14:06:30 -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 w17sm93266ljh.15.2021.11.24.14.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:30 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 01/20] ASoC: dt-bindings: Add binding for Tegra20 S/PDIF Date: Thu, 25 Nov 2021 01:00:38 +0300 Message-Id: <20211124220057.15763-2-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 --- .../bindings/sound/nvidia,tegra20-spdif.yaml | 88 +++++++++++++++++++ 1 file changed, 88 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..4a2747d64772 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra20-spdif.yaml @@ -0,0 +1,88 @@ +# 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 + + assigned-clocks: true + assigned-clock-parents: true + +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 Wed Nov 24 22:00:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637951 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 2AB16C433F5 for ; Wed, 24 Nov 2021 22:07:35 +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 94FB017BF; Wed, 24 Nov 2021 23:06:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 94FB017BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791653; bh=UJPX5om0NpE0shZXifG9hhxCjt1/wWfpUvTiID01OUM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=D9F7KUwIF/GJwVXKe/UYWk7+usKWj9yDkxeYsHW1xoAyJIG6YgNNjwsnYheyaxM7d oQtRHMw/SUdh/BxDyrn8MzGh1wmjc52kTwbXKjmF/m0lXoDeuR919uuUIMYzU/N80x NyVwYDrZhbQybsoppLwaH5StHTtvCnl3kzuup95A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 21B30F8032D; Wed, 24 Nov 2021 23:06:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4D4AEF804AD; Wed, 24 Nov 2021 23:06:40 +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 369AFF8013A for ; Wed, 24 Nov 2021 23:06:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 369AFF8013A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HhIn/DTx" Received: by mail-lf1-x130.google.com with SMTP id bu18so11106781lfb.0 for ; Wed, 24 Nov 2021 14:06:32 -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=MICB7mqmtHJVlNvBv+SpnWZStTf75CqEHyV3SkIQNcM=; b=HhIn/DTxG+D4VfSf2OQYzEE48im3KVlsU7kOnmsyyR9CmnJXYni1HO1NFe5pqJ4PTN OGXFX5iISFdbDHGQVbUJbgW4fGwJKApNGMWY5gPBxNJGZQS6JYzJ6x2l6+BuKBtv9qs6 kpWqN+BWZVOk94Cp31E2S/bI4cENe70RshvOHmyGWCMKT8BKM1g6CUYGRQAzJuzZjCP6 apIMCILOeJ1p+mReMRFK9M0GxBY2CI4pdDrdErVBmx4HGFUwvNYT8Wg6ECFz/SJU+91T QrV6I7hbKK8nHcstU0o86z9ffx8tvcOLhqlMk7aAphpdoExJ3exK+FQwizJyRGk5HCjS 5EzA== 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=MICB7mqmtHJVlNvBv+SpnWZStTf75CqEHyV3SkIQNcM=; b=iIvOl2qywIo+Lr1e2HyiIqBISByZp+YDgL7fa8olQsvAYcwH8eWVcyHqghSX30HvXZ nz8MM4ep2/M2KMP6gFzrljjgNJ/EEjgDfJSb449BozNQ4lYjTgufEZLE5tDyEWtVcWoH dgO/Dxb239HQ6V7EOA50FHap6LlnOsZZ32MZYmoJBO/UWTzXfduN5NwSoJQiIDZ+XuN5 RZyeFAQH5CjgXsjl5KxxLYVEkFebVJhk54B8LWQi4yIUJfQ2r33tjdwFf37gmq+opA2R 7fVc09wLH4UqJ9y2JDHhXEAIWPcWM0igDhUuJDMOPC7s7M3bF7t2meITRy3ZCl+wkkng CatA== X-Gm-Message-State: AOAM532aGVUC143NeiPW0WDA7jZwCP+UgIsayePZT8quNIMHVEn4unf0 dvdCumIMniSPIP3rH5abUOI= X-Google-Smtp-Source: ABdhPJwRcOg8FSHfX1XMSp6JKcqGsETM9PJXhUfm1mZ0N3DupGcSvfd54SIFkK8zcPH7ShULyXhhSw== X-Received: by 2002:a05:6512:2341:: with SMTP id p1mr18799257lfu.204.1637791591580; Wed, 24 Nov 2021 14:06:31 -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 w17sm93266ljh.15.2021.11.24.14.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:31 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 02/20] ASoC: dt-bindings: tegra20-i2s: Convert to schema Date: Thu, 25 Nov 2021 01:00:39 +0300 Message-Id: <20211124220057.15763-3-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 --- .../bindings/sound/nvidia,tegra20-i2s.txt | 30 -------- .../bindings/sound/nvidia,tegra20-i2s.yaml | 71 +++++++++++++++++++ 2 files changed, 71 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..cd87eb4ef995 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml @@ -0,0 +1,71 @@ +# 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 + - clock-names + - 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 Wed Nov 24 22:00:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637953 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 E5B08C433EF for ; Wed, 24 Nov 2021 22:08: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 E9F9517DF; Wed, 24 Nov 2021 23:07:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E9F9517DF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791703; bh=+dF1qh0+Gqkva+s7T5FctA4V9oME9sOpX1bTESqLD/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=MiTsX+DW5pUnk+/004QyD7yElUOFxVNN6T9oCadghVTIMW8xk0ByBmrZC+Qi0EbO6 39s0cq8ClOZLNOLVKoJvhMXvPtdh72nUV9/ePI6PvM/GrIoQDZo+mpHvCbWfB5Nps6 MSzjwRdwcxRa9WgelwQ2R6J6V7TSgzBYJ8kWBqXE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D3ADAF804E7; Wed, 24 Nov 2021 23:06:44 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9783F804AD; Wed, 24 Nov 2021 23:06:41 +0100 (CET) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (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 B444EF8014D for ; Wed, 24 Nov 2021 23:06:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B444EF8014D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NnGQjYeM" Received: by mail-lj1-x230.google.com with SMTP id u22so8382035lju.7 for ; Wed, 24 Nov 2021 14:06:33 -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=piUl9l4MQ9w1o9KgxY94nBJ6EwDi73VAxTX3rtlk9+s=; b=NnGQjYeMF7hAh3MvNIYc14WpNok1tPGHyd1qnl/CGxuC+gbNQCaXAPra1OaALM+Bcj Ba16/vKJx+czY7gUhwlanY6zp1lXw2Z0rH0G8iZNes7WdJkB0wspYS+G/h61RDgKJSR0 MGHSYJZfcQKuLEEC17W5xAId3EV/xQkQZBqjGUVtA+NGMq/VLLBMuffjjTlKbnu3dwFw V0kvvVOREK4dIEKpxxid4r23XsFL91vPkgOVTUw4E98V5/KCjrgQnG2gIcTBUskM+Aeb 2AL6qhW/16WZmPfp8lLHwhGJ6DWls1++NZr2CDkSIHB8Sg+y0OQUBbmeS33FhJq1UkTZ dSZg== 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=piUl9l4MQ9w1o9KgxY94nBJ6EwDi73VAxTX3rtlk9+s=; b=rxupLyFo8S/lRiMWwcK2O6GYE0sM4Rubt3Ir+S2z8ahW/q3+aO74SKzv/4Eh+N/0dp xawH9mY5C9IHPJ9dOsxpZ7BHSKVul+ZqSv9D6KDo3OFt9neBZ1Pc484o6y7oX84V4Gdk 9xYfhkTqm52x3APdr6fFUB4x7nAR67kp4iTuPqCaEGHZhLz7JhTIYuEkjiaLF09puP6m NPwTEMriXFA7SsqxTad8hej2kwtCmpi2yuYybguYeOzvhiQdwCKa7GwYxdo3vX+mrQRH 72q9m2nLY86E5I/b9X28SpjBxT5a4UiGw5MIL7qvgwd7h1U+xthrCqLsE1uweMbY6lX3 fvWQ== X-Gm-Message-State: AOAM5310QnbNiXvddWiczKrbfbw0pAGvcd2auQ2/vf32Gj/DRgwimsxg 8J9KLVpv6o2aASZi+l3JDhY= X-Google-Smtp-Source: ABdhPJyC5uiCLhekgH2zxjYZ7iOS2JEJsVe0rvh5Rs4pecyXEimPxIdfdARMrq1pZ88KSK26qXk7Jg== X-Received: by 2002:a2e:9017:: with SMTP id h23mr19436751ljg.13.1637791592719; Wed, 24 Nov 2021 14:06:32 -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 w17sm93266ljh.15.2021.11.24.14.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:32 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 03/20] ASoC: dt-bindings: tegra20-i2s: Document new nvidia, fixed-parent-rate property Date: Thu, 25 Nov 2021 01:00:40 +0300 Message-Id: <20211124220057.15763-4-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 --- .../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 cd87eb4ef995..28f964c759f6 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 Wed Nov 24 22:00:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637987 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 AE442C433EF for ; Wed, 24 Nov 2021 22:14: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 D20E617E7; Wed, 24 Nov 2021 23:13:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D20E617E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637792044; 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=sLcIgvo6q3lz0TI3Dc6bdHnycyWYmSS0laj/VhtlyQlPkhJTJqx0fVeM4rlgmo18f cxix9F4VQPPWU01gcGPWkwnTipsFk8drHhOTMMnd3crgwXKw2ni1yHERVLr/kJ76kL TJpIguEHMK1pyc0GFOlMv6q7v5HJKQ0KYzB5lex0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6FDD6F80212; Wed, 24 Nov 2021 23:07:37 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 458FCF8058C; Wed, 24 Nov 2021 23:07:36 +0100 (CET) Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (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 394C8F801F7 for ; Wed, 24 Nov 2021 23:06:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 394C8F801F7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ARwTAJfT" Received: by mail-lf1-x12e.google.com with SMTP id bi37so10957617lfb.5 for ; Wed, 24 Nov 2021 14:06:35 -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=ARwTAJfTqtelTIPULCHTr4G1ZuHUenvIBkuGFZhD92TpJknc06Pw4cc8Q0R4MkYvx6 ZrGOgymmMNeLJVRsE9/cc5Ab3/Isn6TJ/W0hPgcZwOEfa3j2FDIf0rCGr7KuMPBV59Si SJWeTuh6I7v7M09Q623XB87OkuNd+AwC4UztBJOpDnXF5/CBuHKP3gHgvGh5xNJ2QBbX 9lOkMvN8rkLKzWw1To+uJiANLdC1wZCXreMAsaQUt4OfMwVpVCDk7gxkrKflx3D4zStc heknKMF8Gd2Lhn0RUV5qxHSS/hp6xVdYYKOqg1/ycE7I2303I3dBEl5MG0m2eWG+ITKX nlug== 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=tl3QHxjeXP8tIw5R/xRBD5f4iGcny949vz3ysZIp3JyNsQAUTRYCkS2QaH+WHx87pr z+cnTHA4BH7Kev6eL79aJpR5V7LQy+2cTOlbd7eOa7lPDAONAQ2MDbUTHlMpmmISNo5W 2yT9WWys5U4xQdTkCkTB9FQLb3yDWfqBKR3DIojbTTims+GWWzMJIJfhnRmGKxia8BAg MJa7ya/MQHt1EASXKg4TEfeXK5QWIVctyrmjJcVqqbNUfkZaJLtHnqBI/WwTucamEVN3 SPvVOXW/7U5ki1Vqx8ZSV34An0RPoFEpte5uW4K3vUZx1jVucX3Otc1CMze/P2LtMc8/ QQPg== X-Gm-Message-State: AOAM530aZqrZQ33SfMBT/gTIGUWuFCXw4jVOkQV0RdBWIUfqol++tzML bI8Sp8hmMda0MhR6p4iQCYM= X-Google-Smtp-Source: ABdhPJzhi7UNU46047RRxIFY+qitxZ5+V78jiCA3Ag2Za0QxQcgCp2Ay3wCtMWWTnZuxJO6SBU4FjQ== X-Received: by 2002:a19:c308:: with SMTP id t8mr18436846lff.621.1637791593535; Wed, 24 Nov 2021 14:06:33 -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 w17sm93266ljh.15.2021.11.24.14.06.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:33 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 04/20] dt-bindings: host1x: Document optional HDMI sound-dai-cells Date: Thu, 25 Nov 2021 01:00:41 +0300 Message-Id: <20211124220057.15763-5-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 --- .../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 Wed Nov 24 22:00:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637961 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 945ACC433EF for ; Wed, 24 Nov 2021 22:09: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 BBBE617BB; Wed, 24 Nov 2021 23:08:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BBBE617BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791771; bh=OsOturNdjtG3hBrUOewxcmKWr+GmrlJTjxY35LGB/0A=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EjzfH3Sdmuh3NXEOBZwVtF+kM+3i0R86jwtzH8PBGkt1C/R17ope1NnuJTLh8QjwJ +F1VOPbs3TChp5X07B6Yi82o+k4oQkhqDFbVA13qZd3xpaj/hAeFOANWP0VNF59OlK xjNhSmDVRvN3sNF4U5pmoo7FxAsH7vrtXzm8dUCg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 27CEDF80519; Wed, 24 Nov 2021 23:06:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF774F804F2; Wed, 24 Nov 2021 23:06:46 +0100 (CET) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 7CB2FF80302 for ; Wed, 24 Nov 2021 23:06:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7CB2FF80302 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BNzkIwDk" Received: by mail-lj1-x22c.google.com with SMTP id z8so8367966ljz.9 for ; Wed, 24 Nov 2021 14:06:35 -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=GOTn7eXs/dAu+lzrstonS6bV/obhXYqPBxpagkI+NbQ=; b=BNzkIwDk3BqFtBCJnlx+pZQmG/hQM1mUvfdYmbK/URC1F7GJOyjCp6Dqw6Y6iSof3C AG6tZ/JnxcJIZp6CdFsRG30x78DWDWb+/ORdS5UeGUa9Q6EDRlcmDHjXKzDL5imjfzOz mHcg2mQyhXw0jwBL2Q81ZRQqvhvK74gMqRSUvJwAaiprZG7XzxytciuM4wHuDny9H2OW rEU1VKKCPULetRjUQHwAW9v+0p1yrCfyfYGZW9DrPxAnr/r75XAB1B3KjR7ayez0Js0Z 5vR6nGFjosAxh4Xd7C6uZe1wY5X1BUUYZQlPCV7IoXZs8NJ7sAEhxjT/Ky10YifQqYCP cp0w== 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=GOTn7eXs/dAu+lzrstonS6bV/obhXYqPBxpagkI+NbQ=; b=wieey8MaLDd1oUJcBGkSrYDRTDk2q8UwBdGIroQW4KLTtoB+FIA2/6Qx8Fj5Ew2KkS Mc98mCIeOePZX8f6gSX/ZKv9DCuSPTRgMs7i1m5hPAQOb1edRUrdFibc4RwprkPrOzf4 GOF5BJbTVKmCEwqkZt77Qd6JL3PgaYXbdFZq78II+UhSDGs0zk774R4ib808jgz32InK T4gtKo45EXNetZL5QWDACApP6wNMEr92XT+x2x0zYuqvP4Q0geoMuSPhxOlMTCLw7YjY +zF+Lj9aKLipjdkO3erYx4yMzEZDvOSi/RZFwXV5Ez6yaGAUfNvj1Bw3CCZyIFavidfG HtEQ== X-Gm-Message-State: AOAM532z8rjN3T9YM6vXkB5uB/WKkhY1+f4LLKKkzm1LtEoqT7RyPzCR RN2inRErQJdXyJOgrWcbiQg= X-Google-Smtp-Source: ABdhPJyy8BytKEHwI+l4vFi0hWhPaJ69lP21xhKGo+0hoS+udh1c27JbDvdGiJMcQHn8m0xcPOexFA== X-Received: by 2002:a2e:b711:: with SMTP id j17mr20929790ljo.39.1637791594526; Wed, 24 Nov 2021 14:06:34 -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 w17sm93266ljh.15.2021.11.24.14.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:34 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 05/20] ASoC: tegra20-spdif: stop setting slave_id Date: Thu, 25 Nov 2021 01:00:42 +0300 Message-Id: <20211124220057.15763-6-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 7751575cd6d6..57a6c576b91f 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -290,7 +290,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 Wed Nov 24 22:00:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637967 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 31396C433EF for ; Wed, 24 Nov 2021 22:10:31 +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 5DDF217D4; Wed, 24 Nov 2021 23:09:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5DDF217D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791829; bh=yJLbY0Ibh5GGbjilTVPPqneyfq24PxZlF14d+djHmKE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JQYuCsgYmWmDvQor/Suz0qjCPT7D0NlHOcvYulBQQ62D1jzYQhFRKbHbR+KcL/S0O QlsW6f6NQOMbZcsNgV740jzuSNPefEO+oU4h7puj8Ev2x7Z7wOmaMZfQlC9kSPULky wUwkeyeeQKfGqa/FTN7rDnN3n04v/hYKMAYTRgGY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8BAF5F80524; Wed, 24 Nov 2021 23:06:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9E71AF80519; Wed, 24 Nov 2021 23:06: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 B50A9F804ED for ; Wed, 24 Nov 2021 23:06:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B50A9F804ED Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UqwzU78y" Received: by mail-lj1-x235.google.com with SMTP id 207so8350044ljf.10 for ; Wed, 24 Nov 2021 14:06: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=1JU496kEAul2Xrq2ly7/mGbdp4YdTxxslXy87kjnkVE=; b=UqwzU78ytiFl6/Y/ntkoBchG3Lc6SXt6mrHGgPBCHW5nh9kTIg+ls1wTiTKE4yID3C we6f23L5TPwplR8LoL/OQ9Cp5QLkkALk6tyAMys6W6VkLak7/ZwmqIqbKtayFHFkxD31 LnTAE+RnHWBlZOGQrmklnFF1nUKQDd82jjO7PCZVmrcNOMS3Fz6Lvt3wSV0a+bSf4gOe VfNb0TCxamCV9LKcR2Rrf05Elmd04arCw0ITH9RiP7vPHuhjMzO4bisyW1gmlkl64Ctv GC8BtGu6I+eOvvfVohuGYchkVfQ5MRCz2ObBvNX7O4YGCtPv6Wug/RWU1+ySuc8hlE+c EWGQ== 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=1JU496kEAul2Xrq2ly7/mGbdp4YdTxxslXy87kjnkVE=; b=hPpkr8K9/TwPSlB0DNtjAFOSd740KARKMg96tWh6L1LFcDdbZWbtKLkAa1nSG5UcXU 84Wzn/5dvx0+zZOwEjJ97o1c7bksc02Hq03CnFq3hgSZ0MOkFdJ4Xet8XIQUrznCTwtr tVEJEcQ3tGo7xBZbYI093k24TOuMKtwKY2mq3AXsqrk93hjsAPHbRPr65JY0rv6Ydcyz 8txVVkUUfG0FFNMYFbUgF9Iogak8tMBt6pwGEx8hfSHfYGa4vl3HKTeuXBq8blLZ4dPi Sz0b28dl2RHW3BCXkvuxaYNfMrVz38COdTS01LR4XRo4SXnjCSiiU3fSm3WckhIk8quj oaGw== X-Gm-Message-State: AOAM533zZOGZVWz2Em6LkbsHI1TcnnbNR88lH9UAMXdd+cM0201t/SR3 f1V6cA0zscDApBH40Dvrl8E= X-Google-Smtp-Source: ABdhPJyzNTbRmF53l+Iw649bJHHzEY01rJ+pkrDrJDSRRi2322Eki64x9PXyd93QePOA6hecAJIOhA== X-Received: by 2002:a2e:9450:: with SMTP id o16mr19173212ljh.444.1637791595711; Wed, 24 Nov 2021 14:06:35 -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 w17sm93266ljh.15.2021.11.24.14.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:35 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 06/20] ASoC: tegra20: spdif: Support device-tree Date: Thu, 25 Nov 2021 01:00:43 +0300 Message-Id: <20211124220057.15763-7-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 57a6c576b91f..bd81df5378d1 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 @@ -332,10 +333,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, @@ -346,4 +354,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 Wed Nov 24 22:00:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637989 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 B374CC433F5 for ; Wed, 24 Nov 2021 22:14:21 +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 D28181872; Wed, 24 Nov 2021 23:13:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D28181872 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637792059; bh=z9uhrtoxOlBMx2zkXRL55J5C7qwhtRXL2We9PM4uCGI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Z9rop0v5FDW3KPz5E4wSQVwIEVp8HubhIaausG8er6pieUdNPB0bpMdhOt3F8ShqI 0RaFQCqBP5O9hdRdf+fZB+9/BOiOyXCJY4CBu2kmc8DbDit3fCliLazpeaMcAVaph/ BD9Ufw2//Mdh9Xfgz4kwSsFCbzRcKeJDT3c8w8pM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1BDB3F80302; Wed, 24 Nov 2021 23:07:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 490A8F8014D; Wed, 24 Nov 2021 23:07:36 +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 AAD79F80212 for ; Wed, 24 Nov 2021 23:06:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AAD79F80212 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J+ph0bGf" Received: by mail-lf1-x12b.google.com with SMTP id k37so10993994lfv.3 for ; Wed, 24 Nov 2021 14:06:37 -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=c5Fktc8z3pKDnGBiR9xJxzlv3HvufbR7qsaFtUM4qP0=; b=J+ph0bGfDz+0f3SGqVBhKJcKJtE145w0Qd6X3dDnesGFzTRO3D1oKZZSXP/i31IGrL p1luco5cjM6V7Cg8Ikv1d/qcpY5z9yIUKJG+CTO0D7xvFfh5tPLkhUIV92H0l1HkZ7pB vEZkYlEuWq5wqgJtgjc4Sfx61LwcS3Yf0NrKKwdJicwDHo0atAO2jNPn1mctE6+eQID5 38nBlkG/XgtkZR+0ETbCCuqvYOykfTMwvVp8lRlO5cjYyCElqzRbF0YQUHnhAIgdM8lo qzgD5yJd/FI6D/F7JpmnzqTjwHkYOgiZamAhCDdQz+r20/xvJwhCv96wID4QmvMihIKs FD6w== 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=c5Fktc8z3pKDnGBiR9xJxzlv3HvufbR7qsaFtUM4qP0=; b=GF8IJA4qvuAkYbcwKCcz1O/SxSb+/XPo0hlO/ACG9zCkJ7HLPmdCcGT8/q9clqIIpF 6DQiv6sGSXihdDDmAFcvZ5NL7THLukfrQAzT2HIUNuUmhq6invCdHD14HrNbCmVcqWz0 XgqhFi/8GoJWYxIDggL6GYHtv8kkU4IV8IaLVY8w/oLYjVhCd3B4lfX2bdQmV4JjYHJA kGZWHsVh0xzgk+Hf2usIsgSS3wbeqYczrlD4wWQAF0XZn3rfUbHTsXZgP7rD9ex5DAvE dRvu1JwqQ57rAYgJbeuoI1AAQaNB951Te19F0iMcnwXGE/wup5SP16NQpAWZ0G/QQNQR 7EbQ== X-Gm-Message-State: AOAM531FSp4w+lTBNUnvvZmjET9ofjFoGivti9dvzG9KHdQkp9rVnEKC 9BoeZVutHslDYoz8XXrnu+I= X-Google-Smtp-Source: ABdhPJwux3qwntifRbiT4YwO9EgIoEEHEAiuyxDM9ZVeZbtEWZwxZ2RjX4+Z+AMZAYBRz8ID00EvdQ== X-Received: by 2002:a05:6512:3ba6:: with SMTP id g38mr18521398lfv.330.1637791596481; Wed, 24 Nov 2021 14:06:36 -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 w17sm93266ljh.15.2021.11.24.14.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:36 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 07/20] ASoC: tegra20: spdif: Set FIFO trigger level Date: Thu, 25 Nov 2021 01:00:44 +0300 Message-Id: <20211124220057.15763-8-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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" Program FIFO trigger level properly to fix x4 accelerated playback. 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 bd81df5378d1..6650875d2555 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -70,6 +70,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 Wed Nov 24 22:00:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637971 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 EC895C433F5 for ; Wed, 24 Nov 2021 22:11: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 0E4C217BB; Wed, 24 Nov 2021 23:10:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E4C217BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791865; 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=WIWOm3NAcAN4jsYWveBWjNEqIXa/iHQ6fkUP0ap8MCNRwPMaXQZK5puWtjM9ppmzs wLYdNK7dydW4pWix2QveIJPaTqo28MM+4gdUYwmQmwleV4Pppwg/JFbEVNqgzgjW7T z6gl4QxCx77OKG8LwkufhL92loUadCnBmal3sPcE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5BE2CF80529; Wed, 24 Nov 2021 23:06:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 87663F8051E; Wed, 24 Nov 2021 23:06:55 +0100 (CET) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (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 515D0F804EC for ; Wed, 24 Nov 2021 23:06:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 515D0F804EC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NY/QaCjl" Received: by mail-lj1-x231.google.com with SMTP id l9so8412089ljq.5 for ; Wed, 24 Nov 2021 14:06:42 -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=NY/QaCjlj9jgK5URhmeklHM2EVr5Cj9FkC04T9ouxfXOI/ffv1uanSeMvRRUUpTJMs yF3wA3QA85B6jL+LSwahSV1YxMRGC/ddxjdid3UBFwoYu1dTQBBy9MISi8MCWoQtD0R2 XhKUeuiNCkCqUJwp7ZTES9DZGTf9sMdq5XdL2Paao7RFxLWYE0vPhtjrqdJrQb5uyRLF MKrYEcXGOPBU3pbDKHX7SbYYIe0gnm9nlkk3/ynK5oEwnUnfzSu1YWnWmdMgQoTQ3nJR Fo4tEdZ/FlnXzLv6sNB1CoMS/iMT02Gil98b83/0Yf4RzP2/cCE6XUDezUueY2X1Idad QVjg== 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=jBwL4PzE7DSkAR7eP+AYzQ9TV3UGF1CDH9yNtJdTK8I+YeiXgpAkJrxz0ev1HBDJ5D ibG+/Ih2RewPaVGyI+3y7FVeIkAE3hzCU71Ao8WU++NzawXheqiIG4WvOdkhDnYepzr1 KrsnQ8Zn2WeUM5/Bf6GlHUtcrtxYOjqdE2dHxiyOVVnEJVpiwY3yyu+DPjNWpqEI+Ad0 fC1t81fKyU4//McZL1l3ix1yUGAuMazmRPeYa9PSyiPLR7qnJ+ryUBeE5l+Cp8PEBif6 yDuVhUHL1iQUCIdOLc+4/nKDHMbF+d/p2X2FUy8ZSHDcwq9+sgmX1AbdHh5OKsDpgAjE tMFw== X-Gm-Message-State: AOAM5327gGNJvMxgsoxdztc/gHqSAlhnPuCl/ZPzlSfdPztLF/4bVV23 CPbdpSpXIQXmKmA0zaKyefg= X-Google-Smtp-Source: ABdhPJxMcR5/ecEUq7nU2V2k+gv9udFcA9YjKObt98jdvy73sHqkqgxre2x8TdIo01cmYWP4KfK0OA== X-Received: by 2002:a05:651c:49b:: with SMTP id s27mr19200524ljc.404.1637791597212; Wed, 24 Nov 2021 14:06:37 -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 w17sm93266ljh.15.2021.11.24.14.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:36 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 08/20] ASoC: tegra20: spdif: Improve driver's code Date: Thu, 25 Nov 2021 01:00:45 +0300 Message-Id: <20211124220057.15763-9-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637957 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 08C11C433F5 for ; Wed, 24 Nov 2021 22:08:56 +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 31FEE17EF; Wed, 24 Nov 2021 23:08:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 31FEE17EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791734; 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=ebv+yi+mvybaJzOJ6IOiBVITmikYKKc4sk+HMavb7mc4OpasVoGHfeyVbWmTs0atl bQvhH+aYD6xc8IBox8GoUIOO6U43rT2wmEZIh25kAP2HpKpkUa8r9jhyAtZhJRb/Ru bN6w7FbeIfOQvspwuYNU2r9yQD6CRI2WlOt/Jv0Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5FF97F80507; Wed, 24 Nov 2021 23:06:50 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EAFCAF804E7; Wed, 24 Nov 2021 23:06:43 +0100 (CET) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 40397F8013A for ; Wed, 24 Nov 2021 23:06:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 40397F8013A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a+huXng7" Received: by mail-lf1-x12d.google.com with SMTP id c32so10998200lfv.4 for ; Wed, 24 Nov 2021 14:06:39 -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=a+huXng7esgCNPuV7SwhtEtqPyIZia6XzlCsNh38W/pcBzm5vLO/WtN0fKU7aKh+8/ CIBprKjVIMWJngggQJIAhh/K3cv8cU0v6tqMBF+c4FbvO28PeEdAa7QgEYvw7BqBHKuF tbtWmxtm5J7+z1rOoruqJlG7facc+QjOwA4UuOGVlenQ4F7M+ID+9zWzw3FQMMhO6rag cOLQBiIHP+86c68dSSg8C+MoJCet4S7Yl7gAKa9BMrwcpui/lo/YDygOk8KX5bE/6q2j Q0lKYbq6e9JUkorNC7H3DeIcG+HFS86rpuvXxAR6xJLhoAbYH9oeT9qlhqjFTJCdiBbL Ir9g== 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=GvTquLBVkbLGw6D5GFn0ExuZca16bp6y/mlZpJ6Lbt8/n0+z0QZamYLR1ypI+/paYw uuWJ6EsdmsrSW11V5UsdRXEG8yRnV5RDOdr89LbYhvyu3yrGEwMuApOV7esjYik7xATZ Sa5AJxJus7vfMfFgiEHZsbOEc6hRLtO+CGJr/BenS7zlftb6nAyo5+DkrhtcZGM/lJAo BoVzv93sgK9OntD/aLouaHFXP0M36rsjsb8fgshwlYdEwsOIuT7IWmw2Mp3UJ/qoHi9i A9TMMXfeYyR/Xl69bFajsvYwOrNPHFeIx5I8i1laH4pRZrhpSxBzwbnU3fzjYkhERHUD Zkyg== X-Gm-Message-State: AOAM531RZw1sGjgqhGh8r6MjKJ2Y7sndnpAPEkBZvOx5ygzVVodpYiwS dRzwubfbZ8X9Plb00Qz45DI= X-Google-Smtp-Source: ABdhPJxCMiI0o3HkziLhuPY402vnYenV2NdTnAA2rDvSVmJpZ2nJ1F/bnaflrwME9Hek/dqCHJ/c4w== X-Received: by 2002:a05:6512:3095:: with SMTP id z21mr18114135lfd.423.1637791598355; Wed, 24 Nov 2021 14:06:38 -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 w17sm93266ljh.15.2021.11.24.14.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:38 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 09/20] ASoC: tegra20: spdif: Use more resource-managed helpers Date: Thu, 25 Nov 2021 01:00:46 +0300 Message-Id: <20211124220057.15763-10-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12637973 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 A22DFC433FE for ; Wed, 24 Nov 2021 22:11: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 D11481813; Wed, 24 Nov 2021 23:10:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D11481813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791886; 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=szr7BOtFBXFY3gr9riBZJlzrZtzHCcUu3rWCrKvBeBLMhktkXysGv4r5HfnXvJ+bW juAdKy81q6ekcATk0euRc2N2ZhjfSjcf3GixeSc8jCTHBxAlR2aBf6AtHhhxH+dtAa QTu4L/apJgXQM/BNcEum5gnGBngk90qRy+tEzAHE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 48CF6F80537; Wed, 24 Nov 2021 23:07:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1FF6AF8051E; Wed, 24 Nov 2021 23:06:56 +0100 (CET) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 32A16F804F2 for ; Wed, 24 Nov 2021 23:06:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 32A16F804F2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nzn1Zr7Z" Received: by mail-lj1-x22c.google.com with SMTP id d11so8360081ljg.8 for ; Wed, 24 Nov 2021 14:06:39 -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=Nzn1Zr7Z1nrg0JoFWQhRq9L6857jELbFKXYHMYwkcAr3l2KmVk92FB6xiCfv7NZi6+ +79xgqINhBea0Mt2rHsc4kMwePIQSqTr1mM/3DmnJ1Q73J771ltws6e4Ia7lCLFwqon8 m1WSOw/krg9QDhakKFvjIAqwlnBj9JLjAsGE+5aYhtlniSIuv74r6LdiYRxhfwERkQ44 iCT/T+p9BKBNTeN9UeCJAHlndr+i4hlMXqg7B0IWtBQMh4iN7Q8cyZslbTNCjcmr+sfX sTHrU55G3En6fqjIubE0HN+82/mkpGCVXuJfmo39JKTNfhYe1tcGcqjF+5Hc2JOxTzrA 9Vmw== 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=jzcfjtirsKjjO790c8deadajNLgOF8tziWaS8iAyV0O89Fev0OgOjUTMlPG50o9pGV oAK1WhwacTkJXvZ32AB5DwCxJvK8/ZcjE3Y7jaOQQcctzxMB8Q5ZA9VcQ2Jo1Lzle09d hRKu659ovhDUKUtzmzKAPSg68MCyrR/eyh1Quk8uWudbck4XyyooEsAxsF5kB3lJfbyC Z9Bbpxh6a+F25DGLTF91ywaisPkHUcMCjh4ilZ90/aZJpxeXEuMvZ+ASTASz0r73aiZO kSgmdL4gfwbFP5+LCGupMNm68wEO/szWkmfjjxz7uga/SZd420JH9Qc3IIA0ZchnIDvB QX3g== X-Gm-Message-State: AOAM531xapoWzLNuq1BhIgxim8sa6d2Y4RJ8+SDqj66iHSiyUSNhhtit uR68f/GT+8jXvw5yXKJZRxk= X-Google-Smtp-Source: ABdhPJzaAFS/CuP9FcblCUP9M0RxRCSGVXKhjQ/HQPDgaShaCJTYQsOF2UuaQNEsHiWi0iHYhadZZw== X-Received: by 2002:a2e:b88d:: with SMTP id r13mr19439402ljp.362.1637791599105; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:38 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 10/20] ASoC: tegra20: spdif: Reset hardware Date: Thu, 25 Nov 2021 01:00:47 +0300 Message-Id: <20211124220057.15763-11-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637963 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 EC899C433EF for ; Wed, 24 Nov 2021 22:09:48 +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 EC6AA17E2; Wed, 24 Nov 2021 23:08:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EC6AA17E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791787; 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=mtPYUSlTPrcUIfHZjrZMXhGP03esn0SSqX0vpsbyWo4k+XoiWqWApt8D7/68vTA6N 7rKJgw+G4VgRLLYJAw+Fjx9RsALMCrESZNcza3JLTimrKU2WcTb6JoEn8VGcKILSsN tK70jI5xGmawjWvKdwc1IBvlUFPj2oM4+T0XHwKU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1B32AF8051D; Wed, 24 Nov 2021 23:06:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9E0E3F804FD; Wed, 24 Nov 2021 23:06:47 +0100 (CET) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (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 CA328F8011F for ; Wed, 24 Nov 2021 23:06:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CA328F8011F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nJAo4iPf" Received: by mail-lj1-x234.google.com with SMTP id u22so8382522lju.7 for ; Wed, 24 Nov 2021 14:06: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=XQZdihin90lA7efVTDzu3CsDg/xeb8H7EeSD4A6ITqg=; b=nJAo4iPfwBFY1ROe3048h1ybqQlX//p3YjSX7Pe0idWjl7D5Xl7cOhLCOiOdeHEVtw i1TsPOsnewcD5UwgabPKGc1V8ufc2Zd+FJV0+A0q6BgfW74cgH0ysttiHo0JEuKO06Rf oSinD/HXvoSsQPpiGhkH5NiAnlXw69WbXOkSEmz5iXw1DnlDdAz0TEcgI6GlEiPRdKb/ o069dFlaoy5lyEDSGze4gA+OToJs1MdOl69LwnbHH6fpJD3OU8yGdMtR7rBHQx5ehabg p1FSHjplifcYroZVsJCoW1Pl7SCG52FqXEMBlrRcXhVCQLxFhlKVMSxxPb7NXXuUNqPG 2orA== 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=AMeObhn6yKuOe5xF2vz8mP8XwBXO4yMuGiSwGD4JFzqbQ2Jd8PJUms62yrpUstVMQt srO9ufjwjZQPeASUvXbxKWW+9ZIoHLFNeJkG0fDvhk+cQVaxU3C6KWzLux5wOacf1VGo NUsTRwc8veqUQrAzFTcAytNaH1F+vb6VIAPgUTgvOXrlcxCBmRDhqQ1byy24nFmKfaFT da5kwI7aXzgNugBgEBViOzWzJookc+1Nq+0qTjwpAUxocSyO8YXW2BMLRvdG7mBZS7mC Vaup74gCgbEKLcJMDs+Lo8Ni5aoV69QHApYRxnF/zJpmdQktutk/OHcGVf8g56uDF7tG i6/A== X-Gm-Message-State: AOAM530iWJ4PvRFK40evze3ZsNBJdlK+BcbeZGsIf7Ar/bl2lT+8PzvG 3b7v49bbJDhk8Ny+mM6pgZbnzbXqg0o= X-Google-Smtp-Source: ABdhPJz7K2sn4O/88yaV122GJMihQ39VL0qbxsHYUBy+2XB+hcfq/s90uDVNIgFsxMF0NuDwPmYVYw== X-Received: by 2002:a2e:b5d2:: with SMTP id g18mr19708991ljn.354.1637791599934; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:39 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 11/20] ASoC: tegra20: spdif: Support system suspend Date: Thu, 25 Nov 2021 01:00:48 +0300 Message-Id: <20211124220057.15763-12-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637959 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 9D158C433F5 for ; Wed, 24 Nov 2021 22:09:16 +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 AC4D717F5; Wed, 24 Nov 2021 23:08:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AC4D717F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791754; bh=YdMWroKNp4gtmpv9BTvYCm2Zi5Q+CG8GZ4Ztzlp1794=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Jza7U1cN6WbHQMXH0ixwxtJ7Tko0HLiWEO/MXGneztczixwd6ECiK0x4BNWNnLVLt EvCw7sHO1wi9g1wGAPiZwAkC0Wb6qE+HtvTSQBU9clictsFR45gY2Uy1RnXWz1Nnsd JOy3konhMFdG+DxgYnr3G1xajlyfpsOlAY//Cg2Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 74028F80516; Wed, 24 Nov 2021 23:06:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 199CCF804F3; Wed, 24 Nov 2021 23:06:46 +0100 (CET) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (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 57F28F804AD for ; Wed, 24 Nov 2021 23:06:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57F28F804AD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YRhMLDyY" Received: by mail-lf1-x135.google.com with SMTP id c32so10998470lfv.4 for ; Wed, 24 Nov 2021 14:06:42 -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=jNvT/R4t+rzbZzB5aB94PXkUOPrierROlgYm0m2uVuc=; b=YRhMLDyY4rZ43/0hssaw5SpluNtAnn3C+1u1ZitobNEI8ekjIPlNOt0YtPtGYhXi8T SWNpQuFh8XLycEFM/l+9ef9bujp+WhboWeYtk5MewdKyPRD9a41pgCmzi6idQqbLn9u6 mm9lMyJC6Kz6uZ+evHrorQTkAYMxxC826GsyIWRyOzss4Vb/+UrDbLaaWPRCASKSK9DV iedD/9N8poWKTI2D2y9posABZzxscfb0O/MbZyVGH5ZySNGcnYJ7qr/TLn+47bSOIg9k IMXDCC3mg1jePjbdFMNCHAWvQbbBtDNUk46Yk+x1FYMWpi1CBoJK2gVcIQDP9VCqgyqf jjtw== 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=jNvT/R4t+rzbZzB5aB94PXkUOPrierROlgYm0m2uVuc=; b=QaxdBVsaJEzoT3ZuxZJQrPlm7bjGxXseQYn2qOZFQ0S1VlsQ2wt+MIkIOh6EXhQGYT OholC9nijmkP54ab7nhlTQ271bK5L14nQV+VD+0YSkqZSTbWfpQmz3SB93C0Ly2Hnp9l Wcexy/M9mqxzgnJHUmRw4wtKQHNRdBF72cqfBdvjx2n3l78E5Q9ifdXIjG5zW72Cswpu gAibJXs6HBXNp9EbGyAo/j6YEzb+57PyJPiqb1pNKItLG9AOSOYvU3THnMPai6oATzTA fejom8C3RqF2jbvTE0wZTLofXk0UJ2jrAh97dGQPZPnqT/5tpqiHO2Z0rTEHj8T3e72e swCg== X-Gm-Message-State: AOAM533Vd5uy9Ip3H3LKeowBc7Dpg+vt5ELAcamveRJZy7uz/uQmDw00 GAbI+8YOGsC9Gf629PWsYeA= X-Google-Smtp-Source: ABdhPJzOsDeVvxud++jQTrtONEupHnOumkD3Q77alNsX1DaeJIUOusKyNA09/6r6jtJiI3+HAIYHxQ== X-Received: by 2002:ac2:4bc1:: with SMTP id o1mr19043798lfq.254.1637791600702; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:40 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 12/20] ASoC: tegra20: spdif: Filter out unsupported rates Date: Thu, 25 Nov 2021 01:00:49 +0300 Message-Id: <20211124220057.15763-13-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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..f3e3c6df232b 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(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 Wed Nov 24 22:00: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: 12637965 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 9DD55C433EF for ; Wed, 24 Nov 2021 22:10:08 +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 AD9B117EE; Wed, 24 Nov 2021 23:09:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD9B117EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791806; 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=a0fMQJ/WzCgGYdMbpwHfP8vgmxWzwtVhGSiOwzVvHflLrEr6Nk5CxlwiRaOCKCzUD yfl1joP+t4KQz8WRn7qqMXkdwxrIcGAeMERvoxumFvdY3vCxAqKc3dgRJZTnDUDocC g3H+m330UEw1qBsfCPMX30wVKJBDK1T9tea2QKSI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 62988F804EC; Wed, 24 Nov 2021 23:06:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61CDBF80508; Wed, 24 Nov 2021 23:06:50 +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 B64D0F804F1 for ; Wed, 24 Nov 2021 23:06:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B64D0F804F1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N9Baz8q2" Received: by mail-lj1-x22f.google.com with SMTP id z8so8368503ljz.9 for ; Wed, 24 Nov 2021 14:06:42 -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=N9Baz8q2DqK27TaB2J4mb/JnUajtBPszltKTVyNhFOKW4qUEHVuQ0aRiaiVxmNyTEo L4FxWxCU2pI4kpV/VNf0mSD694Cn1AzeBVA3LOphq1w2C2agzGMEcUTwiPeXdLYjmmig QffN2CjSp/YliPk54uaBQU3zUdq7DmSAynmNVxIkc4eq9fPl7MXU7VETJ/kw+MHmNImi JuCtuerWMdPfI2mBcsT+rfH93KyVMe6g7pd7mJfZo2UCuM8e7Y04Lgil5r9WaHLTCWPt OHIQ+XwxRcslvurW6k0OAR7WiqcVRwl+49fhuD2oUywl3AJhudG1lNID/ckEXC32C+tk eAJg== 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=ZFFMri95Kn+a1A2maPbic+ZHglrXU5wuTs+mlZvw2/S3HJwyNqeiUdNx7fHAcm0q2t quW9mQXiKgGD8FCmI/wE8XCagFXucoKmt09zDvWhRg+/ScXT/NhYkzhtvZVmF+EvU95R qUpUuI/dxZhWcaH1svzwIyQUlUGFnsPdVWxtFeiFypf3b2VEYLsuP1yjunrPZAj6cEkt IJATxFZVy4Qd3fhAKdq4Um6AfTzxdqJHv+5HEjZbKZ2fmgeFUU7jb7f89vjBD+OZzp9c BTPbKY6qc7oh4BrLToTX6FRC3GaWs0IMmBgHS1GN3BCNlr2ZmcR/n3CljEFDiVQIe1VL s2og== X-Gm-Message-State: AOAM532V5UUmcCdQKQrJT/n6vMIR8ojSFW76L73JmHKMrcyqLKWeyG8r Z+j93OYFuuebk2QFKFDJ/lE= X-Google-Smtp-Source: ABdhPJyCpgiEOJzd9mFn07Zj9pNHsOCa3BIY+8+AFhiTIqkj8hp+qu3U+J6IMuHBPzJV5rd0mGdP2g== X-Received: by 2002:a2e:b177:: with SMTP id a23mr19413448ljm.2.1637791601451; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:41 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 13/20] ASoC: tegra20: i2s: Filter out unsupported rates Date: Thu, 25 Nov 2021 01:00:50 +0300 Message-Id: <20211124220057.15763-14-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637975 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 63F1FC433F5 for ; Wed, 24 Nov 2021 22:11:49 +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 9354F1816; Wed, 24 Nov 2021 23:10:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9354F1816 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791907; 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=cAKdeiTuek8FqiEDQqOB6fsTdbFnfhdcn5HiWmZJpcEwun1VkR8sn0AFveRLqmZBT 56GLWX458EdhTs2LYWaUgFYBEbHEq0GWDkkQGywVxv0ZcV/dJ6lXtSvBwu+OdVzkQQ v0dm3+yQdlrSuthSon50xnd4b1AJdpn4W/6hP8w8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9A83BF80539; Wed, 24 Nov 2021 23:07:02 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D89FFF80528; Wed, 24 Nov 2021 23:06:57 +0100 (CET) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (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 85D1CF804FB for ; Wed, 24 Nov 2021 23:06:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 85D1CF804FB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pnA9n1gQ" Received: by mail-lj1-x236.google.com with SMTP id k2so8427407lji.4 for ; Wed, 24 Nov 2021 14:06: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=J2ouOYArYTiGPyKjaLg9beinXsL+bwxgMLfVEklW094=; b=pnA9n1gQI9hSs1rmixoW7n5S4z1lJAqgp8X3BpEZd0LjaqU/dT4zRL+OeE1rKtZnld JSUusimIa2AFyh4JlQli+Xs+yoCMqmQ8hb5g6H+Xp49/SC5PeD+LtR1yxtbWd14vINrq HiXBjF2ftObNSwKUv4XOat9OhGeQ6MFh3o6QEWirQ2F+DxQ0AAV0F/mYglkPO26fTyal tVEUyMMz3VcQgMR4RYk73Xmr6a8o3oDUTIvCD8/9dfxXIx63hJnGm+CO5Mr79/lyj9y7 EljVST/+J8ctzhW6fdnTHCUC7LG2sa6htuHwscJZDvcAh6KrONesooQyPKX9Jq8VLf5r GkEg== 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=Qio2rdhNXVY3FHce7vLinAeSMFKY5SfFB8jr8JI3aTVQj1hQmdW4yo1kg8GNmTL9E6 0gZHxpPiB+e09UnTf/aV/jjs7MwW1tcAyIUqNVHo9CWdiDcGPye3Q01m8Qa+OfPag4tg W4P/uotrsfFvDhrIeZpjKMV7na8cYdemouxqv1CQV2WTEcaEx1ea0+XQ0FPGPxTwvYu8 5lOKq4FGA1gm5n4eX8EvBk0oWE7aF0micI6IKR9DpbarD5IuKP9CHSQd9BUUxiOgyO3I mkxtjYNee+e3ywwUXZOpwSLbwqqvJc3TpDu6ra3zymRFGyM4vL1gTGmZYtvNsLpzQK+D FjGQ== X-Gm-Message-State: AOAM532MWRgv8AX4ZeZ0Dty4gPoxppUgKxd1oRXITYG16zPwbZg8U96r rqXWpaytE0oOPRLlXq3jS+k76KgB1LU= X-Google-Smtp-Source: ABdhPJwJSd+Si40B6GfMYdhTeNYiyWm8DOVcAAxmkWLOpTKPR07lt7OcXz3u27yqFTmPOsd95JEF4A== X-Received: by 2002:a05:651c:2119:: with SMTP id a25mr19932045ljq.131.1637791602196; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:41 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 14/20] drm/tegra: hdmi: Unwind tegra_hdmi_init() errors Date: Thu, 25 Nov 2021 01:00:51 +0300 Message-Id: <20211124220057.15763-15-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637977 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 9DBD6C433EF for ; Wed, 24 Nov 2021 22:12: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 D4FF317E4; Wed, 24 Nov 2021 23:11:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D4FF317E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791925; 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=tgDgVYO3b5TWa+VZICSqF91uElrllMLDPztGxefgIAlEmkOxcCkMpL2+QegMrZ5Ow vf5SIvookILi9Sd4KLOfDuGdGl8lOs1voZlJbFif71P/Ajz3fOz2jBA0fsSXPEPTNS vi50m2pX4TKjhjBPme1PQE+iUYCaN0BuT7+0MDcY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 71E53F8053C; Wed, 24 Nov 2021 23:07:03 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 67395F80539; Wed, 24 Nov 2021 23:07:00 +0100 (CET) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 D4590F804FD for ; Wed, 24 Nov 2021 23:06:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D4590F804FD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jv/wwOY2" Received: by mail-lj1-x22c.google.com with SMTP id t11so8394928ljh.6 for ; Wed, 24 Nov 2021 14:06: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=kfCGGQxmJYAAbJN5Gn/Us5aT7XWQ41BpqEskSKXA+Zs=; b=Jv/wwOY2Bu+5aeNm8yAHlc5wAIxwBlz1dISKQoDftg2gCxX3GJdDc6uONTqTDvDEW3 ZdWSQ4e2TFq+YKys32AwR7ty+e5Q/RfOLunheKXInZWTuwJ5JrmKn7+6/Fa69LI1mCOA lsuDrAIPakqlx/YuXeZB81cK+hpJ49QNzICwMntvOYzwjc2CT87+BYqYBK7zx6ds76Fh q5CSb+QwdqJRFl3L09fNxNQZwFYTRRS5/4+WdVSm/v4waFlTh1T2HrldRxEbXwS52tP3 UZyCD6nUanYaL/pgZ3SqGigPYiSzwal7VQzDd9/HEAC+3AhOHl7YwSiebKx4jjP722MR VOeA== 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=WTIltBbqgGZlTXCiJd6eNIMiCnnLjLQeoC4Xmc0pvR5qT2NJuHVwnTjStJubxMMrCa wt0CFmf5OuDuWjob4gvNueQyHSyBkrJ69hRrW9sdGC0fAS91HEkRBsK+kT8fiWIELKyj +Lz8wX8ePeSEbO3+mfc84M6jx2S9Dacc6nrytL1MI41UY1euOR7OfxrRpYrbAguqMjz7 Mn8oHy+rCneRavDjFoCzqydmL8fdowbKMEpL37lN2I7ERu+s6NIn0RCqObr+WCCvf0Pw KMCVbwwcqLwXokOXhlYpUUbuFPfKAWefFuqOkb/iiLTEUzRRk7DbhMlEMDqiuHGIZGfK 8x8A== X-Gm-Message-State: AOAM533SYoh9IHEscyWqWFiueoK59pgLET1rsWqhI+GXrJPOxuf9etTk E7L55yUogrBmRIVEYXoU/cUT1UJEEO8= X-Google-Smtp-Source: ABdhPJwO+XbsIalbBsR68blY1jAQ8EeqhM7BySHdgJLmgm6yhrIxGHjg0nvSGHIxu2kdNY4V0NjKyg== X-Received: by 2002:a2e:8686:: with SMTP id l6mr20767449lji.520.1637791602967; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:42 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 15/20] drm/tegra: hdmi: Register audio CODEC on Tegra20 Date: Thu, 25 Nov 2021 01:00:52 +0300 Message-Id: <20211124220057.15763-16-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637979 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 864B7C433EF for ; Wed, 24 Nov 2021 22:12: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 9CEEF1843; Wed, 24 Nov 2021 23:11:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CEEF1843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791942; 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=j38O+p3UNWwe394RVSTFpUPK7A2dlOBVrPDeU87Y1GkYALnTa+WNNqt25djSVG74Q Bim68mZlib/96fhyhX/8GAAqu5f3vlhTrxiVfIHZIWzVIoqKT/HP2WTx1oPYHj/yFt LptuhnG1sqEPpT18fDIoqTruTItQqDQXEVV1jzzE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 05139F8053D; Wed, 24 Nov 2021 23:07:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B3571F8053A; Wed, 24 Nov 2021 23:07:01 +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 92D20F8011F for ; Wed, 24 Nov 2021 23:06:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 92D20F8011F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qgeNkG/Y" Received: by mail-lf1-x136.google.com with SMTP id bi37so10958769lfb.5 for ; Wed, 24 Nov 2021 14:06: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=0mQGburGzaVO6t6m0C9ToG0s590roHzjwKj9a/U1hq8=; b=qgeNkG/YSpN04SgTwmxGtE9fxwMvHmG1tLMQxOvQoP90z2gq9ZepTslJVcIW7s8kEQ 7zhRy11AKHS8DuzXcprd6y1Qj+W6enzLNeFDEsxy366wgx4goUnG9xLOFA7Av10rUrwU p0uxzVIavAr0Sc9Pl0vgE5LfMh+sNZG3MQScL89cLobW6QbuVG7V9li1hH5nPso2/xb9 O4Qa4e90RWIkqWgHgymHXL4eHB+OwBYGdA7mLxG7grHf0UwLrPIkY/JXndONIHbM9geU zdWAKYgHScyHnzGS3P86PxAd6oXgSPe5h8ktUVEgm0xBqL/rG7pefq3pj36n1EqntV6M v+fA== 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=LK3mmGIcD/82hmoc6rV6g8C8g3pRzdos8ZP6Yi9/G81cAtoIgWyYV5bcDP53AZEQll NOCgOOEslfTWcj23Rw5+mgRCerq0TofT3MzwXGGGvKFjuVJmMZ7C+SnpOgX7ZRlFqlkY ByQAueZEmx/M11cDN/LWjLbiAzRj0VWD4fN6qAVtkA03LKsSgA+ZyDjAucTox3FDVBio T830wFp2lpRMuxeWEBAdChDeRfoHrTNOvBIu3wPHYuwwSXR2hqb+iEmytVBtrj4DFtK7 pm/9wwvhk5jwj1g5H3yxz6c3993jOVlgAeccrveNL7rhsadj8FLtLB58AtMkj2X6WGh2 Gigw== X-Gm-Message-State: AOAM532wa0p+NzbOAkZZJ0CEriLbC7xUfjBtwAK/5Xagk2AgCd4LG2+5 ITDV2Npqe52WJdXd4D2w7OI= X-Google-Smtp-Source: ABdhPJw5VhxwaZFlstkQ6hcX5lmByTMobxw76HSVCCUXmrUW+Z7gg08zBntVYZdk9l/Xjm2zSheOyQ== X-Received: by 2002:a05:6512:3d1d:: with SMTP id d29mr19171889lfv.685.1637791603722; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:43 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 16/20] ARM: tegra_defconfig: Enable S/PDIF driver Date: Thu, 25 Nov 2021 01:00:53 +0300 Message-Id: <20211124220057.15763-17-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637969 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 845EAC433F5 for ; Wed, 24 Nov 2021 22:10:53 +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 993C217E3; Wed, 24 Nov 2021 23:10:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 993C217E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791851; 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=eIJut5xT4NFiKktIZOAhibur34FcyvupgzmGGdrAzrAtupBA3cgIJ2K3yt21nX1J4 tGU4s8emd/C/IWejr1DHNAuLuGYEWaFCpphhQBLnBPcJgONs1yh/kO97fK/B2tpdBy nplhChNNG1yt9uUaXhPXqUE8y01TM5pv9rqSEO1Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6AD5EF80525; Wed, 24 Nov 2021 23:06:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26622F8051F; Wed, 24 Nov 2021 23:06:54 +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 A0346F804AD for ; Wed, 24 Nov 2021 23:06:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A0346F804AD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mMaACgOE" Received: by mail-lf1-x130.google.com with SMTP id l22so10958498lfg.7 for ; Wed, 24 Nov 2021 14:06: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=pyWXKSD/ngAWTwm6HA1HadGHkUDHHAfqetu21/vFVIM=; b=mMaACgOERSenGcWLmEoPPJgHhkMiAOulay0sv0LWaWQjUgzWbk0njA+eHQFw6bf7L7 9XOnsWVMupgevKRLOiZaqLG7dUZtOV945CJFwJh+7sx2lVMJQsN9OxuK39vlXGU3Yg3v TfcqyppW6ujcpicdJLj2rGXrQoksV+Uak9OjjPypM7+V9tZjmsnUFUgtTCWr7nPvedKI ROQEs5xMbEXm3QH/VzvAaH6EIbPm17ixh11PUZQYbEfWCT5id6Hkk3f7WBW/IRnccKjB x76kMWlBeOlh1hj/idXLQ6q82W8Mzuz4dSJ7vrZfTH0b3QPcXlPEIIEJ4Dhx+/2CzbV4 fS8w== 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=k2IdsG4rLRfW7UtrcTCMw7FiirO33PLH5dnLPW746s0DK5naZMvuGAH1zUxjvnQ4xX BfUPBz2RcUJODgoIBRC6yviAPiLb7mnk8mbbnUd1/zM1ZQ9GTGSKT5pheivUtdjkkiuc 6USQ96DMv7RdMu9W+JlTRMs7K4EZl/qgEo7O2R8AojQrl7Ir9f95ZNiAr6tkvKGhfu8y 8cNewGOB4X24a7ki3in8ECIQtwedFoYKOWnByVIPcQSLkwZvOGlFE3tSPq82nnG+DJPh OypSfrEInzBKoEcc+Vc5AcLMJhAOnwphSxp9ngR7E95PZPH9TODObMPpZtrqjckcmOI+ DLhw== X-Gm-Message-State: AOAM533NiLwVLt+yne8C+UQI5kPq8+a+Wm4jjHrgEX6NjwD8S3RMbkDt 6bYbuYZcU01tEN3e7Kvn0po= X-Google-Smtp-Source: ABdhPJza1gucFIMiw7WDt9rwXdn3NZAoRTr2XAdbH095/UnxQNN+DzGeh7xH7/8MELMaGpv5Zlm2Vg== X-Received: by 2002:a05:6512:2292:: with SMTP id f18mr18381994lfu.18.1637791604612; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:44 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 17/20] ARM: tegra: Add S/PDIF node to Tegra20 device-tree Date: Thu, 25 Nov 2021 01:00:54 +0300 Message-Id: <20211124220057.15763-18-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637983 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 92057C433EF for ; Wed, 24 Nov 2021 22:13:19 +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 C75F31816; Wed, 24 Nov 2021 23:12:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C75F31816 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791997; 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=OvW44OJozjGbh8rYR0GuaX2QRA+lXGLEDGyf/Y083rq6Ta4NBxFYlXws22gzS5mhS h1qMM5x3xm2oE/wgyz1GVjTAxBrvZ5CvaBlc6zcdvuHha84/Vs/+Z7h4U/TlXazscV qDC945Ym/ZtOHB2ngy7mjHFIXMkqu1XmKicumYOw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B25F8F80568; Wed, 24 Nov 2021 23:07:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 92D42F80543; Wed, 24 Nov 2021 23:07:06 +0100 (CET) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (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 E467FF80510 for ; Wed, 24 Nov 2021 23:06:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E467FF80510 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AzhidqPU" Received: by mail-lj1-x22e.google.com with SMTP id l9so8412666ljq.5 for ; Wed, 24 Nov 2021 14:06: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=n2CS486VK3pErXweLhn8rqAyzxInSDaJTqOjIWkbv/Q=; b=AzhidqPUkoUns8QOS62dAH1aAyY6x8WzVSMaCWSMW/v7EjfiKy6xrqhiqXmtxhUCmC /2G7YwfhBCmAhfarvaBJPMX6gaEcOnjUiG+Q+tOfpv7zbn0bRKLu+xWhqlyEz3y9hlU3 oNRBMFHqkO74xCuNB5bRP5swXj65BF2de/4RtXs86ACsZT4NJiyw0ioVlhTr5kow+TM4 S76hg0ZNS780AvAd1wHLb00xgPLbneEOhx7vragCXrctYxh4jYNgnW4qHXpytxHBeGrA B08iJ56WOCm7lFe5CwvMgy9Jg+21GDCxsdSkFq0eohdxR7psifo27PBS1xxiUThkk1In EhPg== 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=U90gLaGSotG6I7vA0Czj4MlMBy4NTL5eintrm7b/YZ4v8M0pk8W2GXlCLjCMiL7xky 6ATTazUhVSkW5lffQ6AmgKPxyrYCb4fU8qewX9JQ/niHnN7wbMdBVLjrFwZiKDkHA5TB Rbi+Uz+x1NjpthaWBcrjPMefleideBJORSao9oa03TDoVVZGJYXd3z7t2SVkMZPzgozE W+e/YkU6C58LOHNPuJOyu22iYbmnbm4B4BZBf31lpYeej6Kn3mVuc+qOn+Cnq7w+B5M0 e+Op+NokADYE4DEKwFEZrFXuuPfj9hGWqyAp8q/Vaa0txX/YW1ya6+lBfHyfc4bq65+m 1vQg== X-Gm-Message-State: AOAM531yN9OB+VsdI+zWySMvjXfOMhBZGy1pIPv+o3ZNaY1ILm8QtDgP TNzwbopCAv2UB7mePdsw0nw= X-Google-Smtp-Source: ABdhPJwRHr0nxYuROaGQUAZSqmgr+yRP+LZJ4IR9xN3LqBlcWJvx+zvAwwT+8xfj2BU3q2YKedVOLw== X-Received: by 2002:a2e:94d7:: with SMTP id r23mr19197418ljh.224.1637791605366; Wed, 24 Nov 2021 14:06: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 w17sm93266ljh.15.2021.11.24.14.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:45 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 18/20] ARM: tegra: Add HDMI audio graph to Tegra20 device-tree Date: Thu, 25 Nov 2021 01:00:55 +0300 Message-Id: <20211124220057.15763-19-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637981 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 6B4A1C433EF for ; Wed, 24 Nov 2021 22:13:03 +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 97BA01831; Wed, 24 Nov 2021 23:12:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 97BA01831 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637791981; 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=gV+xtSkPJDMgO++/kV3ApI4vdbwBMi0u1RCn19KHva3DN5JKvNTRdebjyxBKT3owy BghSJzN5GQSQ7+EtaHgaVxrsv0tATRwKUit4JIi8hXZwBXXHKP8wl1i/Nrl6hzd6E1 dKvP0agjqSPZTJMg07b5x3gTkNf0cQEgSZEwCAws= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 31EF2F8055B; Wed, 24 Nov 2021 23:07:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4DE39F8053D; Wed, 24 Nov 2021 23:07:03 +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 9AB78F80506 for ; Wed, 24 Nov 2021 23:06:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9AB78F80506 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HOHh27+H" Received: by mail-lf1-x131.google.com with SMTP id b40so10917464lfv.10 for ; Wed, 24 Nov 2021 14:06:47 -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=HOHh27+H2jtaXVi+1wHU1itSTfNFFWN+qdR8CcjckuXtJWHLt/NplZ5GAdnAH7BJId fI+Dwhmyo81WnvPtsdfSqGNOJOfmy8o72YdcMFkQCqSxcf7Q2aAm7QGGUwpAD9cds28x uv6I4YN5rtQFr/VApnqDY14AwJ408it87uIMgAAnRjX1E2NZV28I+kc7aI39PKKJQ+eh GdXXJ26g31PW5sOwYPAviPnJe6TLKhty6Snep3IldzHGKeUHSb3qo4OwEqnaF9HRseVP PtFb22WftdH13Yst/Ud3U+ojlNVvQtcHyVp4KS6jrE32NZl5AfVFUSwkIp5d0HGVbolW yFdw== 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=OfODDaiJS2Tw9lK+1pdoAwE4Mm5u5qste6cIzhIJ2eE4fOX7zfOIRlespAZKC2SzGm GJiZvAj4mljYC0TTJCTEkjmvjiO3fICddJAzuRa8re1HedIZlLwUq028XvZ2PF7+LtSb QFfOPNxsP0BrVMuqjlWuY4dC9ZREOheU8zoYTwsQzUvqrRBJF722ITCT1vOylRydnR5a vr1O3n4AAYVomXYECXejUmvApX15pHgow/tmkRbD4ujVxtkEBty3014VLiL99cLcGHqa QA2b3xsXjYIii5Ie6KTzQCQbErB0972UD3w+PsPJVVkPj9yvp4iIADAcl2R25wFEsI9U z7zQ== X-Gm-Message-State: AOAM530tqzsvwZOhutJPNrWaU6PrRxFhkhRGg8jNFouIbEnLh6ei3tTo Sm9ARW3e8AoxkoM4wMDr+ZM= X-Google-Smtp-Source: ABdhPJzmz2JI+oXafYYQHLzUOXd2AKTrSiYF3p2dJHvQqPMl1kXR7yDugyNVJd0nfhS7swYv1UQ6kw== X-Received: by 2002:a19:dc51:: with SMTP id f17mr19510257lfj.555.1637791606149; Wed, 24 Nov 2021 14:06:46 -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 w17sm93266ljh.15.2021.11.24.14.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:45 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 19/20] ARM: tegra: acer-a500: Enable S/PDIF and HDMI audio Date: Thu, 25 Nov 2021 01:00:56 +0300 Message-Id: <20211124220057.15763-20-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 Wed Nov 24 22:00: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: 12637985 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 CFCFAC433F5 for ; Wed, 24 Nov 2021 22:13:49 +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 00EE61865; Wed, 24 Nov 2021 23:12:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 00EE61865 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637792028; 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=psGow5l9PPuAj35mUKQkuTuokn6OVUXz5PF78LX8ac8xa1FM5zSas+EeXiGldScwM J1qo2tfzi2satjrmqwIxad2hSfYel6QQF/l/NaxKZfzb880qIgAVa5qOEQK2cnmzv8 7oi2g3beeJgB0PJ5Dhy8EWMO80xrvZxOiFdwn5gk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CAEE7F8057C; Wed, 24 Nov 2021 23:07:11 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3B130F80548; Wed, 24 Nov 2021 23:07:08 +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 CE98AF8050F for ; Wed, 24 Nov 2021 23:06:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CE98AF8050F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RLjzrUjM" Received: by mail-lf1-x12b.google.com with SMTP id b1so10874728lfs.13 for ; Wed, 24 Nov 2021 14:06: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=hEN8lxqzB5PkjPszcdUxNpJc6epYJF7n5YUfahDhZts=; b=RLjzrUjM8S5jsmnXNKx086PozjojEBgI97mJK6oNkLYNvq5zuxlJFBR2ySrncrjDNl 4fxT/3GbaHGiMRVauMHpM4xrS7BHKf335Xrt6kY3wHT9kXIsGvQC/dRY10guNJZDSYIe Sx9KJEqojbSiq7Aj2iwRmWtyZV6F4eVf8Cm6grpDZxrA6qVSDkhC8sWYz9hSKYVHX+Xd lknPSpO3sBMUZ+hGRcHV2ACFC43qjFCQGgx5Ov68+pHr8LRe6wkpriZ8zKdZZjmOk4nh 5Zo37iV313OGLMG6DhkuZ6Yw1YPkSKKs05Tqr2seqt6jFoPf0QXLZnfFAfuitDlvsrhE B9mg== 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=ObZlzjoGSzXhs6f7jJoOrEmRTVtNjlYBqChqRvIdY7ssxTlekABHZ5EEbi9jJjWNZ6 CBZ8/VW88zMBRJVSFTi2PZLqZqKZOFhA7WaWmVpYqcBZZ5Sf29z5OiLPpnASRClIyrzD lFfVcD62zEntNfIJY2EvsmJAbW6ycDd3Yr9QBfXkKi86ckRXrBVWi2UvQD6toUyBc3nA EfuykSaHgeyAdZnXtmIqQkH6keSNfqwi+9szK7ywGEIn+5A42L7c+UGSMEboIEMX40yy Q2+buATmDiEU1LX1Q9HIggg92EgxC5BjyxaaVZGmKHOodbeeePMpbd8Ah4XW5C9tKWqw k5gw== X-Gm-Message-State: AOAM530TnQIPmWcbTvlvMPLfFm3dsV2zrnnKOrMeeZ299RKWJa1TyUx0 1CLWP1CBrQB5qd0YZGBvBOs= X-Google-Smtp-Source: ABdhPJyIUhRHjHnojCL+ENORXllGnFFyQb8ITUY4N//P9DJOrpX//870vLxvAdYWiBUcVX7wb14qhQ== X-Received: by 2002:ac2:4e89:: with SMTP id o9mr18872451lfr.384.1637791606935; Wed, 24 Nov 2021 14:06:46 -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 w17sm93266ljh.15.2021.11.24.14.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 14:06:46 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Takashi Iwai , Jaroslav Kysela , Liam Girdwood , Agneli , Rob Herring Subject: [PATCH v1 20/20] ARM: tegra: paz00: Enable S/PDIF and HDMI audio Date: Thu, 25 Nov 2021 01:00:57 +0300 Message-Id: <20211124220057.15763-21-digetx@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211124220057.15763-1-digetx@gmail.com> References: <20211124220057.15763-1-digetx@gmail.com> MIME-Version: 1.0 Cc: linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Arnd Bergmann 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 {