From patchwork Mon Aug 8 05:27:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12938475 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 97B97C00140 for ; Mon, 8 Aug 2022 05:29:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8CF1C846; Mon, 8 Aug 2022 07:28:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8CF1C846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1659936560; bh=qGEYjniltrS1tM20uwgHZ4Z4/mKUjHICAlQVVwkk0nM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=I9uq2Bhvx87Gs5gVKGuoLwPx+skwlskMVk5W0ipXgdLZJEUrgtV/ErXFPq6H98Lrc T95TL4MFQBGBn/5+PQHEQOxCTH7O+skpqHy8lTgwz9eTHuSeVbh+VEWgmuye6M6VzP CJCUagvfj/l5403GFjaKIBoVXXrSZpctv92Hrim0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0BEFDF80548; Mon, 8 Aug 2022 07:28:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CAE19F804B1; Mon, 8 Aug 2022 07:27:57 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2055.outbound.protection.outlook.com [40.107.223.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8DD48F800E8 for ; Mon, 8 Aug 2022 07:27:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8DD48F800E8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jZosXpVf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hxBoLP5dVMaIJPSWFPIYARHMVhF+6n7b5w+kn/5hlt8/yHPc81qnJZ/UHJr2snTj5OJuPldq3tl3LLCp4D2goqVnIKv2yxnHD0DreFnCtJ++GZVIF2GEKKsQypPH9lmT1MwYzBlZbZ+HbuDO/o34/zw/3t6Df7WAoeSb9qWEANekUSIR3QudqEkDn2AS9SZqzs05tmwXV42At43CWNWuuHk7ctkLgjyPPkMKxG5bRFS9VR6VxBq0XavCjJIE9WPUmcKbR0uKn3JTXLD9CK2prdrfAPISgi6zmtPIWa+uCnM6SWHukCiyJ4BVbk5x4hzV+OzYPHGERgplG8GhGGWB2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Oi8UoOBGdEQahrq7GeszTYGcv7X4EM1WeWRQILzpG6Q=; b=i2rFgPjloNBIBrehvbk5fzkHlBkG+dy01kBOPoFQg1w30RvGzEmFzyt217gGrhZaFWcGx7kg11HnYl/QAlxinBtuNgHLuOLdkyJ0aeShUhivSBs84UPRmfVRA0nfI05JP+/75A74s0Q3dv0Yl6CdIglJSGrrHxgbnVFLCMtRjStzoxZcAOxZtlvtTIp0cU193M8wSts5MseNGC8w0/NruB0wx0oQscTD32B1Oa0Ui9m8G3T632/riufaG8pJ3DGLyr9Cpp0bhg3p/hZAy+U8U6lHk2O8STGczgu5DN/dlqnWNuAPDLWHhZHY1lcLIloXAeV/rSVgzflDNyjgcHHEMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=renesas.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oi8UoOBGdEQahrq7GeszTYGcv7X4EM1WeWRQILzpG6Q=; b=jZosXpVfTfap59HAa0mrvjcK3QcEAxCMyxx3lulGvJdWu+451m0EcKM15xL4FMP8o4szxO5wXSpSdFLvtxl4MLVg5XUX6kT8Qpum76Mq3SzvKrojihUrpQ5FyLmO7VXc8qtD0ioNDjZ9F24NM9h8RE3il//4AG9C+0fqkJZVXCg5vx505+XUHMISVRgcUWv5qvgVn0yzGpqKWo0zUJfphe9JCKLg7rtqAbzZCUTx66XH8AqHzzslh0HLm/tbCPq4NJQaIdtT1wiOJ4DK4bTknp/RJZ3FEuYRYsHeqmXlRkvieCpgz8wSZdW8N4STeTNrOiWXSYv3iKl+vIkcAZLSpg== Received: from DS7PR05CA0105.namprd05.prod.outlook.com (2603:10b6:8:56::19) by MN2PR12MB4079.namprd12.prod.outlook.com (2603:10b6:208:1d5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Mon, 8 Aug 2022 05:27:47 +0000 Received: from DM6NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::61) by DS7PR05CA0105.outlook.office365.com (2603:10b6:8:56::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.7 via Frontend Transport; Mon, 8 Aug 2022 05:27:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT025.mail.protection.outlook.com (10.13.172.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5504.14 via Frontend Transport; Mon, 8 Aug 2022 05:27:47 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 8 Aug 2022 05:27:46 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Sun, 7 Aug 2022 22:27:45 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Sun, 7 Aug 2022 22:27:42 -0700 From: Sameer Pujar To: , , , , , , Subject: [PATCH v3 1/3] ASoC: dt-bindings: Definitions for DAI params Date: Mon, 8 Aug 2022 10:57:30 +0530 Message-ID: <1659936452-2254-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1659936452-2254-1-git-send-email-spujar@nvidia.com> References: <1659936452-2254-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32fdfd86-97ea-4421-5cf8-08da78feba7c X-MS-TrafficTypeDiagnostic: MN2PR12MB4079:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mKw04Ilh4zhu/k3CYA/hTCSbnW1obuumm75NATVGgZTlj64oakMhHu2OXVCrQP+kg4gt/re2h7wkkEhcfGFJXAt3RoFryF5KS7q6X8ziyoHDkPqV/kXsDUpzfE89WwSDescrzMgjQdkQeTuS53wk2FzF3L9LsW0soMHWO0xKvfsRQ4CmpBnFIXDcY2usR+YiRqlH4Qx+NQQIQ741EUvGvwpkqMKw8HWn0QO77v7cwdqcu5PfulXZQfORtVZRqr4SSscwpEQyJiq6mEjh8+5vhwvYfJ7wjvbJUuVZzQiTvZIAdZ1Yna0MSloto14PMf1PMpxD8Ig2Am09XDJkGdQnWV5E5gCM12LN7EtMgap9THFF5Ypjju5Zi5dff6q5YO6gd6dz9KNkN2sDC2o9Pf3uJMe5QsLE6ERX3ALV9pwLDk+UhkuHjju2HfIBz/Y5CyHdBc+VSSZAjAhJeyN4LTLWPlfW7fdYkMdq77Q1ZkJyI3VjMHdAVHzq8ndEYrj0WlotUhQ/Ah5pamyw8OAasX+eezoe5Vd4fIZUfBSM4ZYksGE8zaApxdUFqfqv5bN62+ztdJWRB1OUocdse1xC8XGV19+JX9dTH5pUBbHS87tUv46oa8QV7Oq/ennXcQOLP9RxvcVXQcncuRp386mJBhRKnYPS+IhnXi8cC7QIxR7g1KZLzUZQEwlRp6TzubpGaHljChBc9EwrmHV+MWGUh/sjPXgl53DmyiYZyyAUbdD1ul4Bjm38O0Qdhnlzol01NIAFmXwi2oHFTLCsHNd3wGFRjrMavdvV0muTHbISjx7bdIlRZ8YVctkJDc4S1G90UkdRB8I1pZMGl77amCPqURl/IYo/v9Fitux7qWuYINld6XW94ITP0EhzKjp4r4oykYVjhwjobfVZdj2hx5SUG2IGqBPfE2bokTpppoUDxM/Mzh6hGUfV05ITyHhEEQ4l43p0mE/rE2wH71cYLKWxl0pmyw== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(376002)(346002)(136003)(46966006)(36840700001)(40470700004)(2906002)(36860700001)(82310400005)(40460700003)(40480700001)(81166007)(356005)(82740400003)(83380400001)(966005)(26005)(41300700001)(54906003)(110136005)(5660300002)(8676002)(316002)(4326008)(8936002)(7416002)(478600001)(70206006)(70586007)(7696005)(6666004)(47076005)(107886003)(336012)(2616005)(426003)(186003)(36756003)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2022 05:27:47.0835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32fdfd86-97ea-4421-5cf8-08da78feba7c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4079 Cc: Sameer Pujar , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The "convert-channels" and "convert-rate" bindings are available for audio-graph-card and are documented in the audio-graph-port.yaml and the audio-graph.yaml. There is duplication of property details at multiple places. Introduce a new schema to have common definitions for DAI params and these can be re-used in other schemas wherever applicable. Presently update audio-graph-card bindings to use these definitions. If required simple-card bindings can be extended to make use of common definitions. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- .../bindings/sound/audio-graph-port.yaml | 13 ++++------ .../devicetree/bindings/sound/audio-graph.yaml | 7 +++-- .../devicetree/bindings/sound/dai-params.yaml | 30 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/dai-params.yaml diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 5c36867..fa3931b 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -19,11 +19,10 @@ properties: description: "device name prefix" $ref: /schemas/types.yaml#/definitions/string convert-rate: - description: CPU to Codec rate convert. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels: - description: CPU to Codec rate channels. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" + patternProperties: "^endpoint(@[0-9a-f]+)?": $ref: /schemas/graph.yaml#/$defs/endpoint-base @@ -65,11 +64,9 @@ patternProperties: - msb - lsb convert-rate: - description: CPU to Codec rate convert. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels: - description: CPU to Codec rate channels. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" dai-tdm-slot-width-map: description: Mapping of sample widths to slot widths. For hardware diff --git a/Documentation/devicetree/bindings/sound/audio-graph.yaml b/Documentation/devicetree/bindings/sound/audio-graph.yaml index 4b46794..ffee5c9 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph.yaml @@ -27,11 +27,10 @@ properties: description: User specified audio sound widgets. $ref: /schemas/types.yaml#/definitions/non-unique-string-array convert-rate: - description: CPU to Codec rate convert. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels: - description: CPU to Codec rate channels. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" + pa-gpios: maxItems: 1 hp-det-gpio: diff --git a/Documentation/devicetree/bindings/sound/dai-params.yaml b/Documentation/devicetree/bindings/sound/dai-params.yaml new file mode 100644 index 0000000..f1421a0 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/dai-params.yaml @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/dai-params.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Digital Audio Interface (DAI) Stream Parameters + +maintainers: + - Kuninori Morimoto + +select: false + +$defs: + + dai-channels: + description: Number of audio channels used by DAI + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 32 + + dai-sample-rate: + description: Audio sample rate used by DAI + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 8000 + maximum: 192000 + +properties: {} + +additionalProperties: true From patchwork Mon Aug 8 05:27:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12938476 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 A0A1FC00140 for ; Mon, 8 Aug 2022 05:29:30 +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 DA7D9868; Mon, 8 Aug 2022 07:28:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DA7D9868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1659936568; bh=1EuNNBWfwLA+T23YQNuYyqw3r/oMydPFM7lvJQUqKFA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=idJ2M3GYx5VjDaExE/+2ATo/DylTiKV3qGnKYV2IUV0OiFA/7p4JzyQG6OrcsYuKc HkI/jXE1q/Sni4ZEE3Xmi2b0t7mYRGUqQyU+/C243uUNxJsrF0cT9ZxLpGXB9NRWBz fmNg9tpHS7qGxGvQhm2+lImWoozw3bx7GSeRV7pk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8524BF80552; Mon, 8 Aug 2022 07:28:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24E8CF80553; Mon, 8 Aug 2022 07:28:04 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2048.outbound.protection.outlook.com [40.107.223.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 53059F80430 for ; Mon, 8 Aug 2022 07:27:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 53059F80430 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qImlC+Lt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScmQY0K6jweRy1KKdJ7IMurtByAWHD8fCXOX8lsHYGfZlPkWoypMx5fRbqlNsCUVRNMvf5C5c4Y+MQ2AnbdY8MYFzlgxaApyRcaH95+tTRTmTmMwJWv6XP6aOgSnmM8+VLRhdmvxnGaVgO6D7hyXpfPI9ZpuVJ0E0uboqbrwtg3cedhrfgYVsULRSFWh4lyGbsoqp3IHdpjjlc8qeEdf3IH2WIKfqzEbvTXN5YYroCnrHs9NZFPSGgdJjqjgHq5JB4hATAC3PK11PAqZzx12K0mG35PZLFKV4V+6sLq5JtQZ7YZorobCzgJzLJwyjEnwwsvz0n4/ho/2x7zeCGuFdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zQRihwPB5Tsz2nWsKiF5E11gspYY2vrRUD2myAvBqLQ=; b=Rmpu5VWyaPhD5Nl6C3lkWf32HMeIuGykB8u10aOus9p/RRVq/K5uR4h0xgQTqarfWsjQU8ym7puroR0nQuWwhJz3JukfnwGLfKE0+UartWclShwnDMbFST6Zsqssrwvo6J0ZfbPwbPHuGNwKAPLnqxz7a/EPpGxi3Ifv96uCgHaYiCMkVIQBB2MR2eSF5uXesYLDI6mgPkgmXl22Se3KEyPPbPyV3OTzJXFALPv6Yp41A8XLWNTOOF/pEzgJIuETRt3C6lJSYHBr7TZwhraLhIOZYc/RMPodNY+ngkuuNN7hE5GRb6vo+GTFRaWlvx/IOOmuHoihmYTPfVWzBQgcwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=renesas.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQRihwPB5Tsz2nWsKiF5E11gspYY2vrRUD2myAvBqLQ=; b=qImlC+LtfIzWZCT24JmpVjtNinQzjGdiQcZ6q4VHCNfDJQLk2bZ7skHvk/mJR+KT4Un4Lv4We8MAjwTYQ3KLE0x0tB/6EmtjJ5ts0vPiKdQi7i5gT+gMTXHUT6NJ62a+CLlOOATYu2Cpb6IkKF63C/ewpqdTB6caSGpFILynVGZ36rjqoI+L7Jszb1nfvRktQ7TjfsWMbpDQDEMyNH1c3DIaCZToH7sV+5R+7Sim5Tf5jJPauWJAmzTLIFiQhIXgxpjGxGKR2X01rOE5bayjl8Qgo97JIbpKbsi3Ddr1qKWSqz7YmtlbbVwUdnWds7TxRCmQeGc0tEkBatOHEXWxRg== Received: from DM6PR21CA0022.namprd21.prod.outlook.com (2603:10b6:5:174::32) by DS7PR12MB6024.namprd12.prod.outlook.com (2603:10b6:8:84::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.19; Mon, 8 Aug 2022 05:27:50 +0000 Received: from DM6NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:5:174:cafe::11) by DM6PR21CA0022.outlook.office365.com (2603:10b6:5:174::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.7 via Frontend Transport; Mon, 8 Aug 2022 05:27:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT003.mail.protection.outlook.com (10.13.173.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5504.14 via Frontend Transport; Mon, 8 Aug 2022 05:27:50 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 8 Aug 2022 05:27:50 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Sun, 7 Aug 2022 22:27:49 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Sun, 7 Aug 2022 22:27:46 -0700 From: Sameer Pujar To: , , , , , , Subject: [PATCH v3 2/3] ASoC: dt-bindings: Add sample format conversion Date: Mon, 8 Aug 2022 10:57:31 +0530 Message-ID: <1659936452-2254-3-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1659936452-2254-1-git-send-email-spujar@nvidia.com> References: <1659936452-2254-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98b6e753-84ee-4d9a-484a-08da78febcaf X-MS-TrafficTypeDiagnostic: DS7PR12MB6024:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 24TNSGA7bgiJCPegu5FPuhHMGXyc6+hwIw7dV/BzYRkU9DbhTpzaMMvjQa68NwYXzclwXOkWSR3+Au641Cw3PzmZxzFodbY8A2lySuuki7vQfj0ygcUwnJX6Bmv7U237GvTL8VK86/kuvWeVKtLWvscbssNm8jS8kyIGPg98g/tc6UYOiPtl0OX4kjYaYQGugXdNU1BuBow7zlgOgWdY01PL46iZ+pdKjaSXUtpFjm96kcwJwS9IojAeTMiklmng323u5EFTKbzCyVioOc2ksBbYvXFHitosuZ7BSw2fcZdBBXHDgFgk1n+NxluY20oyPDNK1ZjJ2gWFZRp/quGZY6vkc2ZA7ztS3hPYCwzzlIeb4oaizQVIotFZnJHh+fJp3VnR41eV3Cs4I8b0D2t7CTNczGTxvC1ZR+rflRxBAFiWZjAeKX9hwfrAl/nfWtIARfEkQQzLSYvckGnARHhCoG1BNkm4d1visjxOkzvEDPdsnns7VWp5w6Tg6m54FKf05AXcDEkwmPVAcBqEEsDx8uTk8NPt0wq5dOm/TdCr6rQs8isgHbnq55ox/ZMW+UXABLa8Jmgbra6kJ/oUw4bOo5WyX5nb0fAuGYvwJ/IHspUEf+gcaUZ4F46xrJdNMuAyhNr6i3FcJ+Es0KYbvAsPjMHfiN6kUMRO+f6zD57nFDoiL5htAR712D2GhrSjiNB+7fDLiWoqQF77jOrDFZIHRDu4PQAyTR1k02o+oUKqAe4Gx9xmqhmCGsjcZ4bDi8zGsFzD8vtgBBvR+n1P3b66Zg6g1QRbuSwROf0jYQA4wXIcHXvBFREQF7oOd6w4WvIIWHf6DHImw8vVM+Vd/sSreA== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(39860400002)(376002)(346002)(36840700001)(40470700004)(46966006)(41300700001)(36756003)(2616005)(107886003)(6666004)(7696005)(82310400005)(186003)(2906002)(26005)(36860700001)(478600001)(40460700003)(4326008)(336012)(426003)(47076005)(54906003)(110136005)(81166007)(40480700001)(8936002)(82740400003)(7416002)(316002)(5660300002)(8676002)(70586007)(70206006)(356005)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2022 05:27:50.7726 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98b6e753-84ee-4d9a-484a-08da78febcaf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6024 Cc: Sameer Pujar , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Presently "convert-channels" and "convert-rate" DT bindings are available for channel and rate fixups respectively. Similarly add "convert-sample-format" binding to fixup DAI sample format as well. This is added to audio-graph-card based bindings. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/sound/audio-graph-port.yaml | 4 ++++ Documentation/devicetree/bindings/sound/audio-graph.yaml | 2 ++ Documentation/devicetree/bindings/sound/dai-params.yaml | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index fa3931b..7ff7a4a 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -22,6 +22,8 @@ properties: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" + convert-sample-format: + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format" patternProperties: "^endpoint(@[0-9a-f]+)?": @@ -67,6 +69,8 @@ patternProperties: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" + convert-sample-format: + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format" dai-tdm-slot-width-map: description: Mapping of sample widths to slot widths. For hardware diff --git a/Documentation/devicetree/bindings/sound/audio-graph.yaml b/Documentation/devicetree/bindings/sound/audio-graph.yaml index ffee5c9..aaa99c2 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph.yaml @@ -30,6 +30,8 @@ properties: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" + convert-sample-format: + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format" pa-gpios: maxItems: 1 diff --git a/Documentation/devicetree/bindings/sound/dai-params.yaml b/Documentation/devicetree/bindings/sound/dai-params.yaml index f1421a0..f5fb71f 100644 --- a/Documentation/devicetree/bindings/sound/dai-params.yaml +++ b/Documentation/devicetree/bindings/sound/dai-params.yaml @@ -19,6 +19,16 @@ $defs: minimum: 1 maximum: 32 + dai-sample-format: + description: Audio sample format used by DAI + $ref: /schemas/types.yaml#/definitions/string + enum: + - s8 + - s16_le + - s24_le + - s24_3le + - s32_le + dai-sample-rate: description: Audio sample rate used by DAI $ref: /schemas/types.yaml#/definitions/uint32 From patchwork Mon Aug 8 05:27:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12938477 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 6584DC00140 for ; Mon, 8 Aug 2022 05:29:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 11E2DAEA; Mon, 8 Aug 2022 07:28:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 11E2DAEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1659936580; bh=BTAJ/Pbd0FMo1Kk0QD0LcqOThSfZTyyWvEPzq0s0hj0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gOtyIRN0Q/1/LpSF8R60LIWSDwsheA/lhMge4vc2aDB4TFX9G4yoIwhlKX4K3TkmG U8nNqiFGtc6BjBOOsVq34/QMwvmWrJdJT384QrnkBXn/EJjOC+tMyVOVoBKBzbkP5k nCZmnGLcCMxmepfqBz++QQloQkWLbq4Wk2iueCno= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7C80FF80558; Mon, 8 Aug 2022 07:28:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9C337F80557; Mon, 8 Aug 2022 07:28:08 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062.outbound.protection.outlook.com [40.107.94.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 12A56F80551 for ; Mon, 8 Aug 2022 07:28:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 12A56F80551 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="n3G0Bekp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KcpDsNRS2kvSn0lET8mkrZqotT/IjJOvAynreW3eqP+XKV3KlbVRu1HFryQMN0yYcFWjbgSUkVn/gIX4V+2aYNFsKfa/CgNYSH/a9jAIboGqTE/KDMMPOhPvCN/sFHQwPtrfZBef6cTNGWYhFslP6BwO4LQ5RF7E7phHc3O/FsEpTLKu1CCwaleg5gZIEDoH2TznBv5g33vrJ/5WXy8ZhVQps138w9hGB8gkJ487mMVBsGsiGYeQRAImgXOmve+J7+dESKtUIPYlrLLkijYpqDq0cD5k4xROIMjoeOgYt/0HU5WP4wQliS8iECXbsI+FZmjqFlGF2yhaGkJWJe2oQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cfNcRFaISfDrIFhYwQbPhX7g6U7B0ezGsuFF8+x9Fsc=; b=fFDzNE/Kit4b6h1SN1HLGg16q5YKh0AT2uK6p66s75cSjd22mWOSdSiafLltkudChbid/XW8EAjLEft49glr5IJRQx7P83FKkI61lAXNR0bU84hcHtMEJL00QMtzcXQ2/0TT1aRt7lUda7k3ZPWVnPTGXKaivJygCEMLh9v2rF3YoJKpiJ0/eGJq6g0ZXcIIosmqn39DGPAZpxiqLyrjj5/R4KelertV9Eg5nzDPl3Ni4SWRjxvMTRfrhox9fvzgSyQmKEn0O2KXp5j3rtgDFUhgEjk/is7StVYIgEy6/pJpm5MOaZbxugzUYnymTF0QqyIdW8TK9kMLCfM2xgx5PA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=renesas.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cfNcRFaISfDrIFhYwQbPhX7g6U7B0ezGsuFF8+x9Fsc=; b=n3G0BekpwXoBjXRVQhPFf92EyauoPU3hrKXgQAKuCS/hN/n0D8ilPIpTJS+ohBeR7sqsbb9uUHiUIHqoMukOW3hLNL/YEgl2Nsp3ESt+4Zt8r4k9D2Q/oDl9BMRKS01kqfHbXhhjsJAt2dN7p0raN6R9xtzSZuAWjtofH5poeuKe3dauVhep9YubpoJ2CngRh8T0S+AmcT+yNfXcJpJ+gS8cJXDGUi8h5/KVlZ8G43udDEPqE3hpHF2XcmkoEEr89rcaHft53e2MMW+mERFrLA1B/Ef1ohcyBNemn8nWmz52KXaRkoZtACpQ8b4rmc3J+qsmJcW70OkNq/M3DJCd7g== Received: from DM6PR07CA0131.namprd07.prod.outlook.com (2603:10b6:5:330::19) by BN6PR12MB1137.namprd12.prod.outlook.com (2603:10b6:404:1c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Mon, 8 Aug 2022 05:27:54 +0000 Received: from DM6NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:5:330:cafe::b7) by DM6PR07CA0131.outlook.office365.com (2603:10b6:5:330::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Mon, 8 Aug 2022 05:27:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT034.mail.protection.outlook.com (10.13.173.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5504.14 via Frontend Transport; Mon, 8 Aug 2022 05:27:54 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 8 Aug 2022 05:27:53 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Sun, 7 Aug 2022 22:27:53 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Sun, 7 Aug 2022 22:27:50 -0700 From: Sameer Pujar To: , , , , , , Subject: [PATCH v3 3/3] ASoC: simple-card-utils: Fixup DAI sample format Date: Mon, 8 Aug 2022 10:57:32 +0530 Message-ID: <1659936452-2254-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1659936452-2254-1-git-send-email-spujar@nvidia.com> References: <1659936452-2254-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 135f38e2-0dbd-4b01-1d68-08da78febee9 X-MS-TrafficTypeDiagnostic: BN6PR12MB1137:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zY6WA1lV22RsxBPOj5gNP6ObIGccebEPN5luwv+5nO0UqWz+/4oPUZ00EvFGzNnxHm2UD5BEuVNiGNs9ZanE6GphVauhE9hxkjnqj5E5uisb86msTBEZ5GWANU55i2SXGMaqZNgqy9bN/7mJgxH4mv/49ZC2TM+l9ox2gYkbzLe0BqpaEC7WlYXuQU1bKFUGnQMWK7ZZcw2+3Q1yjvOBaDfW9UHKGq8bIyG7eO4cPq9bUiyjAoh0WwYle8wpHLgZ+zjaVgh/G5fv/2/BQ9Z3e6mgjwSNYVL84Z1npcfJTbtFSoRC/j87tT0yXWjHnUJNJzTJ07zxc+VH/eKPiFiC1TbQzsmNW/mMF79qPB9+1aqsVz+pfu5eVRAWn3zYfpb0GwF5vqm5kS/5IuXBap/L3bukVFileFJaIBt4REgIIy0s3MvxaZ+qLGSjqBh/Op98nW8zFMvhSSjTr7xAcjjwIkwNiheM0hVLBTNTki6zMQlB4mEofKxfM808uqB8El30d7B92djJkkYmYbndc6jIDzs5hf2OPJVnhrMnf5Gnx+bMmjcjgenPjZbJ+kiZj/17v35wV6ZGZQ1OIDBLpLf+qIPUABfTvNcHNFQVG/HgAAKoV3ZVyfcrZrQHnPW8+c7UGMeapqjxBbc809eACI4yfYgvNFVUilgd8euouuz5fKfZmJDd4iXwAEdceYvaJXTJcnxqaTMHzT/gIfJZ8csd/QPvFAUwlWgutfGZj+CusSjWfCaaFFLSoMVhFUGEd96jlP0X/jJ3kWCd+a5suhQeBA3yV+rwigMPzYdvbADilueS8DoGECUmUhtqoEqJuCxTmQxTPEEya4Ysqe4TQ9e36A== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(39860400002)(346002)(136003)(396003)(40470700004)(36840700001)(46966006)(40460700003)(86362001)(36756003)(82310400005)(2906002)(356005)(81166007)(7416002)(5660300002)(36860700001)(8936002)(478600001)(8676002)(70206006)(4326008)(40480700001)(6666004)(7696005)(70586007)(41300700001)(107886003)(110136005)(47076005)(426003)(336012)(54906003)(82740400003)(26005)(2616005)(316002)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2022 05:27:54.5071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 135f38e2-0dbd-4b01-1d68-08da78febee9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1137 Cc: Sameer Pujar , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Parse "convert-sample-format" DT binding and fixup the sample format as applicable. This is similar to the existing "convert-channels" and "convert-rate" properties for channels and rate fixup respectively. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- include/sound/simple_card_utils.h | 1 + sound/soc/generic/simple-card-utils.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index ab55f40..a0b827f 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -39,6 +39,7 @@ struct asoc_simple_dai { struct asoc_simple_data { u32 convert_rate; u32 convert_channels; + const char *convert_sample_format; }; struct asoc_simple_jack { diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 4a29e31..1b201dd 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -15,6 +15,33 @@ #include #include +static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data, + struct snd_pcm_hw_params *params) +{ + int i; + struct snd_mask *mask = hw_param_mask(params, + SNDRV_PCM_HW_PARAM_FORMAT); + struct { + char *fmt; + u32 val; + } of_sample_fmt_table[] = { + { "s8", SNDRV_PCM_FORMAT_S8}, + { "s16_le", SNDRV_PCM_FORMAT_S16_LE}, + { "s24_le", SNDRV_PCM_FORMAT_S24_LE}, + { "s24_3le", SNDRV_PCM_FORMAT_S24_3LE}, + { "s32_le", SNDRV_PCM_FORMAT_S32_LE}, + }; + + for (i = 0; i < ARRAY_SIZE(of_sample_fmt_table); i++) { + if (!strcmp(data->convert_sample_format, + of_sample_fmt_table[i].fmt)) { + snd_mask_none(mask); + snd_mask_set(mask, of_sample_fmt_table[i].val); + break; + } + } +} + void asoc_simple_convert_fixup(struct asoc_simple_data *data, struct snd_pcm_hw_params *params) { @@ -30,6 +57,9 @@ void asoc_simple_convert_fixup(struct asoc_simple_data *data, if (data->convert_channels) channels->min = channels->max = data->convert_channels; + + if (data->convert_sample_format) + asoc_simple_fixup_sample_fmt(data, params); } EXPORT_SYMBOL_GPL(asoc_simple_convert_fixup); @@ -49,6 +79,10 @@ void asoc_simple_parse_convert(struct device_node *np, /* channels transfer */ snprintf(prop, sizeof(prop), "%s%s", prefix, "convert-channels"); of_property_read_u32(np, prop, &data->convert_channels); + + /* convert sample format */ + snprintf(prop, sizeof(prop), "%s%s", prefix, "convert-sample-format"); + of_property_read_string(np, prop, &data->convert_sample_format); } EXPORT_SYMBOL_GPL(asoc_simple_parse_convert);