summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
blob: dc7f4afbb7775f0973065504601d74b384d2718e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/loongson,ls-audio-card.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Loongson 7axxx/2kxxx ASoC audio sound card driver

maintainers:
  - Yingkun Meng <mengyingkun@loongson.cn>
  - Binbin Zhou <zhoubinbin@loongson.cn>

description:
  The binding describes the sound card present in loongson
  7axxx/2kxxx platform. The sound card is an ASoC component
  which uses Loongson I2S controller to transfer the audio data.

allOf:
  - $ref: sound-card-common.yaml#

properties:
  compatible:
    enum:
      - loongson,ls-audio-card  # Loongson-2K1000/Loongson-2K2000/LS7A
      - loongson,ls2k0300-forever-pi-audio-card # CTCISZ Forever Pi
      - loongson,ls2k0300-dl2k0300b-audio-card # ATK-DL2K0300B

  mclk-fs:
    $ref: simple-card.yaml#/definitions/mclk-fs

  cpu:
    description: Holds subnode which indicates cpu dai.
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        maxItems: 1
    required:
      - sound-dai

  codec:
    description: Holds subnode which indicates codec dai.
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        maxItems: 1
    required:
      - sound-dai

  spkr-en-gpios:
    maxItems: 1
    description: The GPIO that enables the speakers

  hp-ctl-gpios:
    maxItems: 1
    description: The GPIO that control the headphones

  hp-det-gpios:
    maxItems: 1
    description: The GPIO that detect headphones are plugged in

required:
  - compatible
  - mclk-fs
  - cpu
  - codec

unevaluatedProperties: false

examples:
  - |
    sound {
        compatible = "loongson,ls-audio-card";
        model = "loongson-audio";
        mclk-fs = <512>;

        cpu {
            sound-dai = <&i2s>;
        };
        codec {
             sound-dai = <&es8323>;
        };
    };

  - |
    #include <dt-bindings/gpio/gpio.h>

    sound {
        compatible = "loongson,ls2k0300-dl2k0300b-audio-card";
        model = "loongson-audio";
        mclk-fs = <512>;
        hp-det-gpios = <&gpio 81 GPIO_ACTIVE_HIGH>;
        spkr-en-gpios = <&gpio 86 GPIO_ACTIVE_HIGH>;
        hp-ctl-gpios = <&gpio 87 GPIO_ACTIVE_HIGH>;
        audio-routing =
                      "Headphone", "LOUT1",
                      "Headphone", "ROUT1",
                      "Speaker", "LOUT2",
                      "Speaker", "ROUT2";

        cpu {
            sound-dai = <&i2s>;
        };

        codec {
             sound-dai = <&es8388>;
        };
    };