xref: /freebsd/sys/contrib/device-tree/Bindings/sound/microchip,sama7g5-pdmc.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2cb7aa33aSEmmanuel Vadot%YAML 1.2
3cb7aa33aSEmmanuel Vadot---
4cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/microchip,sama7g5-pdmc.yaml#
5cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6cb7aa33aSEmmanuel Vadot
7cb7aa33aSEmmanuel Vadottitle: Microchip Pulse Density Microphone Controller
8cb7aa33aSEmmanuel Vadot
9cb7aa33aSEmmanuel Vadotmaintainers:
10cb7aa33aSEmmanuel Vadot  - Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
11cb7aa33aSEmmanuel Vadot
12cb7aa33aSEmmanuel Vadotdescription:
13cb7aa33aSEmmanuel Vadot  The Microchip Pulse Density Microphone Controller (PDMC) interfaces up to 4
14cb7aa33aSEmmanuel Vadot  digital microphones having Pulse Density Modulated (PDM) outputs.
15cb7aa33aSEmmanuel Vadot
16cb7aa33aSEmmanuel VadotallOf:
17cb7aa33aSEmmanuel Vadot  - $ref: dai-common.yaml#
18cb7aa33aSEmmanuel Vadot
19cb7aa33aSEmmanuel Vadotproperties:
20cb7aa33aSEmmanuel Vadot  compatible:
21cb7aa33aSEmmanuel Vadot    const: microchip,sama7g5-pdmc
22cb7aa33aSEmmanuel Vadot
23cb7aa33aSEmmanuel Vadot  reg:
24cb7aa33aSEmmanuel Vadot    maxItems: 1
25cb7aa33aSEmmanuel Vadot
26cb7aa33aSEmmanuel Vadot  "#sound-dai-cells":
27cb7aa33aSEmmanuel Vadot    const: 0
28cb7aa33aSEmmanuel Vadot
29cb7aa33aSEmmanuel Vadot  interrupts:
30cb7aa33aSEmmanuel Vadot    maxItems: 1
31cb7aa33aSEmmanuel Vadot
32cb7aa33aSEmmanuel Vadot  clocks:
33cb7aa33aSEmmanuel Vadot    items:
34cb7aa33aSEmmanuel Vadot      - description: Peripheral Bus Clock
35cb7aa33aSEmmanuel Vadot      - description: Generic Clock
36cb7aa33aSEmmanuel Vadot
37cb7aa33aSEmmanuel Vadot  clock-names:
38cb7aa33aSEmmanuel Vadot    items:
39cb7aa33aSEmmanuel Vadot      - const: pclk
40cb7aa33aSEmmanuel Vadot      - const: gclk
41cb7aa33aSEmmanuel Vadot
42cb7aa33aSEmmanuel Vadot  dmas:
43cb7aa33aSEmmanuel Vadot    description: RX DMA Channel
44cb7aa33aSEmmanuel Vadot    maxItems: 1
45cb7aa33aSEmmanuel Vadot
46cb7aa33aSEmmanuel Vadot  dma-names:
47cb7aa33aSEmmanuel Vadot    const: rx
48cb7aa33aSEmmanuel Vadot
49cb7aa33aSEmmanuel Vadot  microchip,mic-pos:
50cb7aa33aSEmmanuel Vadot    description: |
51cb7aa33aSEmmanuel Vadot      Position of PDM microphones on the DS line and the sampling edge (rising
52cb7aa33aSEmmanuel Vadot      or falling) of the CLK line. A microphone is represented as a pair of DS
53cb7aa33aSEmmanuel Vadot      line and the sampling edge. The first microphone is mapped to channel 0,
54cb7aa33aSEmmanuel Vadot      the second to channel 1, etc.
55cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-matrix
56cb7aa33aSEmmanuel Vadot    items:
57cb7aa33aSEmmanuel Vadot      items:
58cb7aa33aSEmmanuel Vadot        - description: value for DS line
59*f126890aSEmmanuel Vadot          enum: [0, 1]
60cb7aa33aSEmmanuel Vadot        - description: value for sampling edge
61*f126890aSEmmanuel Vadot          enum: [0, 1]
62cb7aa33aSEmmanuel Vadot    minItems: 1
63cb7aa33aSEmmanuel Vadot    maxItems: 4
64cb7aa33aSEmmanuel Vadot    uniqueItems: true
65cb7aa33aSEmmanuel Vadot
66cb7aa33aSEmmanuel Vadot  microchip,startup-delay-us:
67cb7aa33aSEmmanuel Vadot    description: |
68cb7aa33aSEmmanuel Vadot      Specifies the delay in microseconds that needs to be applied after
69cb7aa33aSEmmanuel Vadot      enabling the PDMC microphones to avoid unwanted noise due to microphones
70cb7aa33aSEmmanuel Vadot      not being ready.
71cb7aa33aSEmmanuel Vadot
72cb7aa33aSEmmanuel Vadotrequired:
73cb7aa33aSEmmanuel Vadot  - compatible
74cb7aa33aSEmmanuel Vadot  - reg
75cb7aa33aSEmmanuel Vadot  - "#sound-dai-cells"
76cb7aa33aSEmmanuel Vadot  - interrupts
77cb7aa33aSEmmanuel Vadot  - clocks
78cb7aa33aSEmmanuel Vadot  - clock-names
79cb7aa33aSEmmanuel Vadot  - dmas
80cb7aa33aSEmmanuel Vadot  - dma-names
81cb7aa33aSEmmanuel Vadot  - microchip,mic-pos
82cb7aa33aSEmmanuel Vadot
83cb7aa33aSEmmanuel VadotunevaluatedProperties: false
84cb7aa33aSEmmanuel Vadot
85cb7aa33aSEmmanuel Vadotexamples:
86cb7aa33aSEmmanuel Vadot  - |
87cb7aa33aSEmmanuel Vadot    #include <dt-bindings/clock/at91.h>
88cb7aa33aSEmmanuel Vadot    #include <dt-bindings/dma/at91.h>
89cb7aa33aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
90cb7aa33aSEmmanuel Vadot    #include <dt-bindings/sound/microchip,pdmc.h>
91cb7aa33aSEmmanuel Vadot
92cb7aa33aSEmmanuel Vadot    pdmc: sound@e1608000 {
93cb7aa33aSEmmanuel Vadot        compatible = "microchip,sama7g5-pdmc";
94cb7aa33aSEmmanuel Vadot        reg = <0xe1608000 0x4000>;
95cb7aa33aSEmmanuel Vadot        #sound-dai-cells = <0>;
96cb7aa33aSEmmanuel Vadot        interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
97cb7aa33aSEmmanuel Vadot        dmas = <&dma0 AT91_XDMAC_DT_PERID(37)>;
98cb7aa33aSEmmanuel Vadot        dma-names = "rx";
99cb7aa33aSEmmanuel Vadot        clocks = <&pmc PMC_TYPE_PERIPHERAL 68>, <&pmc PMC_TYPE_GCK 68>;
100cb7aa33aSEmmanuel Vadot        clock-names = "pclk", "gclk";
101cb7aa33aSEmmanuel Vadot        microchip,mic-pos = <MCHP_PDMC_DS0 MCHP_PDMC_CLK_POSITIVE>,
102cb7aa33aSEmmanuel Vadot                            <MCHP_PDMC_DS0 MCHP_PDMC_CLK_NEGATIVE>,
103cb7aa33aSEmmanuel Vadot                            <MCHP_PDMC_DS1 MCHP_PDMC_CLK_POSITIVE>,
104cb7aa33aSEmmanuel Vadot                            <MCHP_PDMC_DS1 MCHP_PDMC_CLK_NEGATIVE>;
105cb7aa33aSEmmanuel Vadot    };
106