From patchwork Fri Mar 4 18:17:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 12769781 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 A55E9C433F5 for ; Fri, 4 Mar 2022 18:20: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 EDCD51F5E; Fri, 4 Mar 2022 19:19:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EDCD51F5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646418007; bh=HCvFluqtT037DesTFX4Yr11Hb1/YSGRgoeD+/8CiSrw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sItP4hl1bJzo+Ekf/iFVSuWLcPOPlbhP7LI440V6tchmN8iEJu+8Pz/11Jm/3gBFl eKfTEMQDn2/T+gkH3iI6Db26GAkql+H4oRyr2nLEhN4ayXoMqzr82Us5d8lg2zIhl8 G40BE5TrT5rHIYyfxiz4G0F2F2F7zZAIso4SlmKI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E7A5FF800F0; Fri, 4 Mar 2022 19:18:36 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5DA47F80518; Fri, 4 Mar 2022 19:18:35 +0100 (CET) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 CA8EEF800F0 for ; Fri, 4 Mar 2022 19:18:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CA8EEF800F0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="gnbVJAcq" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646417909; x=1677953909; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HCvFluqtT037DesTFX4Yr11Hb1/YSGRgoeD+/8CiSrw=; b=gnbVJAcqI4GTOlVJdMpysXTsFTxN460raFzGT12ou5k0adgqBh7x6QYd efkJCUCt+pGN5bn2DgzJqoaye/+qUZu+WR3KPajODLGmVBJ1KqfuKaUgZ wKDINcth4Ac5X3BiatYk37J9fJlbCGm5cOn/H4ONNQN82EOGxf8FtsQy0 ijQb77M7VJ8iKxGUwsYkBQZIyyooAszDy/1ERmwSnZmXNeqnNagpNT4dV J4wCvVWlw7JIAookp4AJL/omufTpwqsn+7AFsR3kGwiMu6yfONwlBFpM3 N0bJ5ctTvxrZgzE1UKn8ZOc+2XXOnkBLkkSvshuji3ZzBbToghIoe4z4P A==; X-IronPort-AV: E=Sophos;i="5.90,155,1643698800"; d="scan'208";a="155759066" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Mar 2022 11:18:22 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 4 Mar 2022 11:18:22 -0700 Received: from rob-ult-m19940.amer.actel.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 4 Mar 2022 11:18:20 -0700 From: Codrin Ciubotariu To: , , , Subject: [PATCH 2/6] ASoC: add DT bindings for Microchip PDMC Date: Fri, 4 Mar 2022 20:17:52 +0200 Message-ID: <20220304181756.1894561-3-codrin.ciubotariu@microchip.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304181756.1894561-1-codrin.ciubotariu@microchip.com> References: <20220304181756.1894561-1-codrin.ciubotariu@microchip.com> MIME-Version: 1.0 Cc: lars@metafoo.de, nicolas.ferre@microchip.com, robh+dt@kernel.org, tiwai@suse.com, broonie@kernel.org, Codrin Ciubotariu 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" This patch adds DT bindings for the new Microchip PDMC embedded in sama7g5 SoCs. Signed-off-by: Codrin Ciubotariu --- .../devicetree/bindings/sound/mchp,pdmc.yaml | 99 +++++++++++++++++++ include/dt-bindings/sound/mchp,pdmc.h | 13 +++ 2 files changed, 112 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/mchp,pdmc.yaml create mode 100644 include/dt-bindings/sound/mchp,pdmc.h diff --git a/Documentation/devicetree/bindings/sound/mchp,pdmc.yaml b/Documentation/devicetree/bindings/sound/mchp,pdmc.yaml new file mode 100644 index 000000000000..bdf5c52c29d9 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/mchp,pdmc.yaml @@ -0,0 +1,99 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/mchp,pdmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip PDMC Device Tree Bindings + +maintainers: + - Codrin Ciubotariu + +description: + The Microchip Pulse Density Microphone Controller (PDMC) interfaces up to 4 digital microphones + having Pulse Density Modulated (PDM) outputs. + +properties: + "#sound-dai-cells": + const: 0 + + compatible: + const: microchip,sama7g5-pdmc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Peripheral Bus Clock + - description: Generic Clock + + clock-names: + items: + - const: pclk + - const: gclk + + dmas: + description: RX DMA Channel + maxItems: 1 + + dma-names: + const: rx + + microchip,mic-pos: + description: | + Position of PDM microphones on the DS line and the sampling edge (rising or falling) of the + CLK line. A microphone is represented as a pair of DS line and the sampling edge. The first + microhpone is mapped to channel 0, the second to channel 1, etc. + $ref: /schemas/types.yaml#/definitions/uint32-matrix + items: + items: + - description: value for DS line + - description: value for sampling edge + anyOf: + - enum: + - [0, 0] + - [0, 1] + - [1, 0] + - [1, 1] + minItems: 1 + maxItems: 4 + uniqueItems: true + +required: + - "#sound-dai-cells" + - compatible + - reg + - interrupts + - clocks + - clock-names + - dmas + - dma-names + - microchip,mic-pos + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + pdmc: pdmc@e1608000 { + #sound-dai-cells = <0>; + compatible = "microchip,sama7g5-pdmc"; + reg = <0xe1608000 0x4000>; + interrupts = ; + dmas = <&dma0 AT91_XDMAC_DT_PERID(37)>; + dma-names = "rx"; + clocks = <&pmc PMC_TYPE_PERIPHERAL 68>, <&pmc PMC_TYPE_GCK 68>; + clock-names = "pclk", "gclk"; + microchip,mic-pos = , + , + , + ; + }; diff --git a/include/dt-bindings/sound/mchp,pdmc.h b/include/dt-bindings/sound/mchp,pdmc.h new file mode 100644 index 000000000000..543c424a5a6f --- /dev/null +++ b/include/dt-bindings/sound/mchp,pdmc.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __DT_BINDINGS_MCHP_PDMC_H__ +#define __DT_BINDINGS_MCHP_PDMC_H__ + +/* PDM microphone's pin placement */ +#define MCHP_PDMC_DS0 0 +#define MCHP_PDMC_DS1 1 + +/* PDM microphone clock edge sampling */ +#define MCHP_PDMC_CLK_POSITIVE 0 +#define MCHP_PDMC_CLK_NEGATIVE 1 + +#endif /* __DT_BINDINGS_MCHP_PDMC_H__ */