From patchwork Wed Jul 27 14:26:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 593752 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 D3FD6C04A68 for ; Wed, 27 Jul 2022 14:28:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 830141652; Wed, 27 Jul 2022 16:27:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 830141652 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658932096; bh=Nr9+qlLRq8JqOHIRVs57Ha+hQfm30inyv1gbWMTmLaM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Vjg1QdCO5+cWnFrU7nAxxrVk5Ed22hXP7ZUi/WXwl8hUZb34qK2hPpURtnVTEAvyf DmF/C6CAWCeX8nd0TQWN6nseSJjm+bsb95u4ytvfJD5YpC0mj3b6lL5HidrZX7waNc 1kqhlqrdo/Z5wgojOZzeqm/xjxYMzULIAH9Sh4TE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0893EF80544; Wed, 27 Jul 2022 16:26:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D93CEF80543; Wed, 27 Jul 2022 16:26:55 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.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 AA35BF80155 for ; Wed, 27 Jul 2022 16:26:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AA35BF80155 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="XGIV9fHF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJYwNedsuersceWKI31CfBevuyJQoLcXP2qsTEBgETkky3J4T6s6CPYiaFfH4U9Cwin7ZOrf/4Ehi7fg4595BuqIZ85B89ufkePqCcCDYDz2s+rblNgSL1+tzD3w3Y4GcBAp0uwsHgZ9QGN7XAbvRKsFgiCbeESD+axobEQ6YeWPe/0FbNXNfVIu//hk2VRalYsYaqzNdmf4N7vLQ67Do102fq/4JW1Ah+faH6LkJ14H4s6fCqxIkYuKt04dKFYsfZKONkaZowFcBr9w3MkIwew2uKtud4r1hvR5ZiuTj53hfvKNFEPTulYF81CtyE2AAf2E/5Trs/1GrzcVr/bVjg== 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=s3aD8t/LRAS+RTeXX67+nt2C+BjTya53f44Ez2mn2pA=; b=m8xiPaZksy/Vcu6YKt5KGjWmq5/csT5MVBL+U+/j6e3FSbbqdlNLhQIYReZqfiPJPjHGKb7qpnNxUU7F2+q49Xh1Z/L1WI06ezjPxFJmOzmX1a6yESIc4B+v1Xbnus2FLrhNtMCm8PQ2fOQOIm10nOhGmooVcDThytuG6TsLylSBDT2t0QRYpzMuUb3uCbiA3H02lsav3kIO+2bov00TuZkWnFpGb0cQJWvA4GCPLrCRZHhiUylkWtO8xBVPmJEEU/63ZOlTMZERlEjXbKqwXg59bUvLz7upCI0LAM8tbezGfljec4q5RtZ7a2hMzCVSLhL3JMR1MBzJa32YwZNx3w== 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=s3aD8t/LRAS+RTeXX67+nt2C+BjTya53f44Ez2mn2pA=; b=XGIV9fHFMDQhTtj0ze2pHxvFS3KZOPjbfmBb+LFXO6dpRXCC6V1UHNx7CWSLdZFjMNj+A+rcqnr8Umyj4sfpSzypI4I/UKJC3FjfiGhg7lvGBhQwD48D2JeLt/8Rb2jOEMcWHuZ6+l8CHOB18Z03GTwbN87DDHI/tOwwjCtilGFGet0cRVuqtdWGXBCKY18+09QX56m/gD/mez7pK0pJKAMf1FIGQHgyY8hm9T32HlZtHF3U9bsQmpWrcHT1KYKQzDLUPg229QNBE0A5u258+IFNfBAgvpSh5bPo96AZN+ZPMBS2mOtqaox00xbs8zOOpECt3gbZeHyo4ZdSbWXeGA== Received: from MW2PR16CA0017.namprd16.prod.outlook.com (2603:10b6:907::30) by MN2PR12MB3005.namprd12.prod.outlook.com (2603:10b6:208:c5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.25; Wed, 27 Jul 2022 14:26:44 +0000 Received: from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::f5) by MW2PR16CA0017.outlook.office365.com (2603:10b6:907::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.10 via Frontend Transport; Wed, 27 Jul 2022 14:26:44 +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 CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5482.10 via Frontend Transport; Wed, 27 Jul 2022 14:26:44 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 27 Jul 2022 14:26:41 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 27 Jul 2022 07:26:41 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Wed, 27 Jul 2022 07:26:38 -0700 From: Sameer Pujar To: , , , , , , Subject: [PATCH 1/2] ASoC: dt-bindings: Add sample format conversion Date: Wed, 27 Jul 2022 19:56:22 +0530 Message-ID: <1658931983-31647-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1658931983-31647-1-git-send-email-spujar@nvidia.com> References: <1658931983-31647-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cd28919-a952-4711-19cb-08da6fdc0813 X-MS-TrafficTypeDiagnostic: MN2PR12MB3005:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FgPx2XfvxGOB9A2GDKvVLSMuzbWjORVzkqMLnY4MEWiUTyeuM33LeOTsv2TfzOen+1qz6UJt9LdU/1NztP8yy3/u+49Njbtc+Wu+a1eR97XfGb6rzMCbDady+ZbZAqlm7hNmXEzOQeaW2IyhG3cR2Wixf8xelRD0HRWywlRQOp84ZKY0lMaOG1+OULAL2qVMk3EouZOfy980TsqbZ+SuYWJhJl5d4f4hzQL/n5pZQJC9N65/9/kWvSJM/yMyPaWpM93vHkfID6O6vbRtxpJA8Oiw1CGcANNWdyYWh+8ZlqHeOvx20g2uIrhWv3b5afF6XGucxsahXN/YWUHQUiQTxrvvQMRo3XQ58oix4dRepjRxva0y8UP4Zf21GJCrDUb68/xuT0OZJRwwWm1b2AzWNtFuNYvtrTBWNZiWolYsi7NmuyOvI4FDD7Lc5jr4B3GGDh4aeBT5AM8YZYmY6exOS2I0MVryXYJ2xcZ2KimNHqrYHbByiIYTXYrpRtZv77WNm/KpngCeHyvukx+zi5RcT3mFF0nFixmKhdvNcCqvnicQa7z1BOw2yXZBVnpVJP0FbWbBk1zGzPxLqWBkytW0TyRCy/l/cKYXk2ZDwEQCD/8Qu1BgITcF2n+s4iXtdZ8b+l1YIB6w3w4RUexOAvKjI9M+bbkJOOLMqva5x0sy2l+RyUXmkScLjAjCfBz1mLmL8aKgD2H2vZCMEqGJJablNJ0TjckpBisbhGVB37dO/HWc03eVMzTn98y2Z/x8mXxjyF6zvCtASYEQWz8AkAlnsgc39+ChcmKV9YQb9sbEMODAd3Zrv4R5ucJinXBaVPZgiW4Y5VpZJnPPYqXYtqs5+A== 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)(346002)(396003)(376002)(39860400002)(136003)(36840700001)(46966006)(40470700004)(7416002)(8936002)(5660300002)(70586007)(70206006)(82310400005)(8676002)(4326008)(40480700001)(40460700003)(186003)(2906002)(36860700001)(356005)(81166007)(86362001)(36756003)(316002)(82740400003)(110136005)(54906003)(2616005)(26005)(426003)(336012)(47076005)(107886003)(41300700001)(478600001)(7696005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2022 14:26:44.4210 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cd28919-a952-4711-19cb-08da6fdc0813 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: CO1NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3005 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 simple-card and audio-graph based sound cards. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- .../devicetree/bindings/sound/audio-graph-port.yaml | 21 +++++++++++++++++++++ .../devicetree/bindings/sound/audio-graph.yaml | 11 +++++++++++ .../devicetree/bindings/sound/simple-card.yaml | 15 +++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 5c36867..d7491038 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -24,6 +24,17 @@ properties: convert-channels: description: CPU to Codec rate channels. $ref: /schemas/types.yaml#/definitions/uint32 + convert-sample-format: + description: CPU to Codec sample format. + Value Format + 0 S8 + 2 S16_LE + 6 S24_LE + 10 S32_LE + 32 S24_3LE + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 2, 6, 10, 32] + patternProperties: "^endpoint(@[0-9a-f]+)?": $ref: /schemas/graph.yaml#/$defs/endpoint-base @@ -70,6 +81,16 @@ patternProperties: convert-channels: description: CPU to Codec rate channels. $ref: /schemas/types.yaml#/definitions/uint32 + convert-sample-format: + description: CPU to Codec sample format. + Value Format + 0 S8 + 2 S16_LE + 6 S24_LE + 10 S32_LE + 32 S24_3LE + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 2, 6, 10, 32] 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..df8a994 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph.yaml @@ -32,6 +32,17 @@ properties: convert-channels: description: CPU to Codec rate channels. $ref: /schemas/types.yaml#/definitions/uint32 + convert-sample-format: + description: CPU to Codec sample format. + Value Format + 0 S8 + 2 S16_LE + 6 S24_LE + 10 S32_LE + 32 S24_3LE + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 2, 6, 10, 32] + pa-gpios: maxItems: 1 hp-det-gpio: diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Documentation/devicetree/bindings/sound/simple-card.yaml index b261d49..6decd73 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.yaml +++ b/Documentation/devicetree/bindings/sound/simple-card.yaml @@ -77,6 +77,17 @@ definitions: description: CPU to Codec rate channels. $ref: /schemas/types.yaml#/definitions/uint32 + convert-sample-format: + description: CPU to Codec sample format. + Value Format + 0 S8 + 2 S16_LE + 6 S24_LE + 10 S32_LE + 32 S24_3LE + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 2, 6, 10, 32] + prefix: description: "device name prefix" $ref: /schemas/types.yaml#/definitions/string @@ -191,6 +202,8 @@ properties: $ref: "#/definitions/convert-rate" simple-audio-card,convert-channels: $ref: "#/definitions/convert-channels" + simple-audio-card,convert-sample-format: + $ref: "#/definitions/convert-sample-format" simple-audio-card,prefix: $ref: "#/definitions/prefix" simple-audio-card,pin-switches: @@ -234,6 +247,8 @@ patternProperties: $ref: "#/definitions/convert-rate" convert-channels: $ref: "#/definitions/convert-channels" + convert-sample-format: + $ref: "#/definitions/convert-sample-format" prefix: $ref: "#/definitions/prefix" pin-switches: From patchwork Wed Jul 27 14:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 594083 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 34E6BC04A68 for ; Wed, 27 Jul 2022 14:28:26 +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 619F61660; Wed, 27 Jul 2022 16:27:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 619F61660 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1658932104; bh=+GXRVjd//X4JfnkXdOdAjEpCe4lEilhbMqfcqloMjO8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kRvN0m0qhK1YyMPClmyxV6gEd4xeXHgZGGDdt3gaI0OWftFDN0L1XvCuqVpZ2hfq/ 3HUY4Aai3jYs8Qz+0Aoa9wMhOnifNYMw//XL2cPQJtx6C94pEsyG3Ug+za+VDvdUHZ msZrgNaTeNOnpynIb5fW75askDDIQeeW4Ktezdpc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 796F2F800FA; Wed, 27 Jul 2022 16:27:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6CE34F80551; Wed, 27 Jul 2022 16:26:59 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2051.outbound.protection.outlook.com [40.107.102.51]) (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 7B6EFF800FA for ; Wed, 27 Jul 2022 16:26:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7B6EFF800FA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="DoA0WsLj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fEhU951Ofy4O6CrtKA+ajEIGOKzR/nWqzFIWprAkPNkguyzLeziPjkXg6eRpH7m3NFj8Qi5ln81uv5J9erEFEgNajqFYhTO3jU0H5D0WIM7uRoTWbdwR79sq08blanmiPN3f+rg5EcbhliCu9XUM5W4HosPOhFsvnHevIxWTXUHypYUNAF3egT0PRgL567M8kgUvJCugMQUMsAXsuQJrDh2sw5R9pvIvXwo9FtlaeAYTaa7BzWPNcXuvDrZl35o5xbLinsCXqtuMLy+UYTqNKCLkOmkOqBZuNpcAyfQFNVeVVTaE5tKpyH3doniZIQ+C+9vUP7BX4jubxjYXC4PKBg== 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=yYll37jJ/5ARnWpURdJ9bZ9HIaGmaIfC4gshWatZxFg=; b=Pp9XlgNe+ZlpyIfDgx8jQwFseDiULXTWeR4JfM+VV3I0qKuZs28LTWPTlVBTZkmDCRZ2Ng6TL+tNBCYvtekg4XwDy3+zLf1v+7fLbbyHw6dyWxZPckDYoAFHPuREWjPdXvybyeu4EVgYDF2KRmgO178fnUqd0txvMj8XIRyMgRH4uPm1lLAxcSLKNSrJ9xfwwRJARwhd8rBhNVDaYQSnwjsEu0heUQ5BrQnTx+2jtiTnEm6/wT8Z+zZL/En0N4yy1XGhPcs3OHkxRgpC7rP0GMl4hrZOv9nd6z79YsiPMDKmX/r0lMP8D2to0DQM8cvyZLa4K29xACHNZzqBJYohyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=yYll37jJ/5ARnWpURdJ9bZ9HIaGmaIfC4gshWatZxFg=; b=DoA0WsLj8Fg94PaGtaAq2ANPTVs00cK/Z1xLk2IuJw936YcMW3EqwtNeWWECTZZzTs1kh6fTaJKQXsEdf7BU2AiKfVwAqTIMD/iktxfosy54OrI+6T4TGFwJMs26GFP46u+Nt62UEqbhZ7DmVdnhu++sB/BGaukpmY9Aihe7mjdvlrwHjWnAC0SiD6JhD1NbovPyVA/4xnjg03SPT8Pj7/cXD8ZwLB5slD3FfoHZcZqbLm30tJfeRu60xIo76Fy8tM1fdzVOW7R/AA8gdmUJ/AYBVyyPRVjQBx0OYptmas9y2Bqa+r4T1/R6dDet3M+27ZnnDUUonSKbRE/HPy+qUg== Received: from MW2PR16CA0062.namprd16.prod.outlook.com (2603:10b6:907:1::39) by BN6PR12MB1410.namprd12.prod.outlook.com (2603:10b6:404:18::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.20; Wed, 27 Jul 2022 14:26:46 +0000 Received: from CO1NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1:cafe::3a) by MW2PR16CA0062.outlook.office365.com (2603:10b6:907:1::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19 via Frontend Transport; Wed, 27 Jul 2022 14:26:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT066.mail.protection.outlook.com (10.13.175.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5482.10 via Frontend Transport; Wed, 27 Jul 2022 14:26:45 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 27 Jul 2022 14:26:45 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 27 Jul 2022 07:26:44 -0700 Received: from audio.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Wed, 27 Jul 2022 07:26:41 -0700 From: Sameer Pujar To: , , , , , , Subject: [PATCH 2/2] ASoC: simple-card-utils: Fixup DAI sample format Date: Wed, 27 Jul 2022 19:56:23 +0530 Message-ID: <1658931983-31647-3-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1658931983-31647-1-git-send-email-spujar@nvidia.com> References: <1658931983-31647-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3c01a366-85a3-430b-2457-08da6fdc08b3 X-MS-TrafficTypeDiagnostic: BN6PR12MB1410:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kZlGXnhMfZZ8c+F8jPYmO6uw2HFfmbVnPH4Rd0C0v4vwkwaVtJYFuZISIEyF6ZxSaQgkl2VaQhYZSaoOp7NooGPtX8tYTl596rjq0wY723ELV7/n4E6yHrTG1HkUWPytNlG6n+hth3AOZsYL/qmTybCHATFF1psfK+wdDXRle0MsLszdICWmACFbUlAhjkHBYdY+dPkP332KI7z8qWmiFEqRmq31qNgapXV80jeKhUrClHFvGjlVE7RwMT7XFZmUByxLvHYYs/fe5rZyZQZQuyja9/P4Q7NvZ0UdUbsgaqHJVoQ22n4wor1hEnV9E07EfmYIaPXWudmGO521wOq4By8MGoOsfaDXp2Ll8qiCAYcdXWbm05iCBIYlZ3jvjnw/Wq+efvVm3RB3S1IKTyhKBqZTcUZKclWp6FIk+Z8D1CmGjOrwBqJCo0g04dBqp28e4sCfezH/OvWFZrdPPd4K2VHBwnV4HZa4jAbC3G9kG3/Zm4hHhUDP/21XDdJAOGq1UNWx9Q2QXm0ELiucGokldoTDB4ngbtYRWDb6aj39oV6T0AfUljrqto+OISqv7zmXMbj17QC/KTILAB4zEZuc/3zUVj8iw4vQ4Udp25k7r8JTyQBj/eonuUeyMx8DEr7wBBdiNa/+HX8fIEiN89OTZqG/Jli3juYeuEPig/m8pGJ2HN5VNRZHqPWqxMWmoUkA3GPii33MI+e8be9iUfhJqHAPedPp7ow1vZpDq8NVIkiHYsUkiOHw6iDwnyJsxm6PzRGfQTT3LEWLP89MXm4cgHf1ZbUOJwRs6zPrtFck8wzBPUYwrXighgEi2M8UDCblE7JJLW83fqxBStT3zOzSCg== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(376002)(136003)(346002)(396003)(46966006)(36840700001)(40470700004)(5660300002)(82740400003)(110136005)(8676002)(8936002)(4326008)(7416002)(316002)(54906003)(7696005)(70206006)(86362001)(26005)(478600001)(40480700001)(41300700001)(47076005)(36756003)(2616005)(356005)(82310400005)(81166007)(426003)(336012)(70586007)(186003)(6666004)(107886003)(40460700003)(36860700001)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2022 14:26:45.4542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c01a366-85a3-430b-2457-08da6fdc08b3 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1410 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 | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index ab55f40..39ea57d 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; + int 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..6ce5102 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -22,6 +22,8 @@ void asoc_simple_convert_fixup(struct asoc_simple_data *data, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + struct snd_mask *mask = hw_param_mask(params, + SNDRV_PCM_HW_PARAM_FORMAT); if (data->convert_rate) rate->min = @@ -30,6 +32,11 @@ 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 >= 0) { + snd_mask_none(mask); + snd_mask_set(mask, data->convert_sample_format); + } } EXPORT_SYMBOL_GPL(asoc_simple_convert_fixup); @@ -49,6 +56,11 @@ 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 */ + data->convert_sample_format = -EINVAL; + snprintf(prop, sizeof(prop), "%s%s", prefix, "convert-sample-format"); + of_property_read_u32(np, prop, &data->convert_sample_format); } EXPORT_SYMBOL_GPL(asoc_simple_parse_convert);