172661ff7SRichard Fitzgerald /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
272661ff7SRichard Fitzgerald /*
372661ff7SRichard Fitzgerald  * cs35l45.h -- CS35L45 ALSA SoC audio driver DT bindings header
472661ff7SRichard Fitzgerald  *
572661ff7SRichard Fitzgerald  * Copyright 2022 Cirrus Logic, Inc.
672661ff7SRichard Fitzgerald  */
772661ff7SRichard Fitzgerald 
872661ff7SRichard Fitzgerald #ifndef DT_CS35L45_H
972661ff7SRichard Fitzgerald #define DT_CS35L45_H
1072661ff7SRichard Fitzgerald 
1172661ff7SRichard Fitzgerald /*
1272661ff7SRichard Fitzgerald  * cirrus,asp-sdout-hiz-ctrl
1372661ff7SRichard Fitzgerald  *
1472661ff7SRichard Fitzgerald  * TX_HIZ_UNUSED:   TX pin high-impedance during unused slots.
1572661ff7SRichard Fitzgerald  * TX_HIZ_DISABLED: TX pin high-impedance when all channels disabled.
1672661ff7SRichard Fitzgerald  */
1772661ff7SRichard Fitzgerald #define CS35L45_ASP_TX_HIZ_UNUSED	0x1
1872661ff7SRichard Fitzgerald #define CS35L45_ASP_TX_HIZ_DISABLED	0x2
1972661ff7SRichard Fitzgerald 
20*fa8c052bSVlad.Karpovich /*
21*fa8c052bSVlad.Karpovich  * Optional GPIOX Sub-nodes:
22*fa8c052bSVlad.Karpovich  *  The cs35l45 node can have up to three "cirrus,gpio-ctrlX" ('X' = [1,2,3])
23*fa8c052bSVlad.Karpovich  *  sub-nodes for configuring the GPIO pins.
24*fa8c052bSVlad.Karpovich  *
25*fa8c052bSVlad.Karpovich  * - gpio-dir : GPIO pin direction. Valid only when 'gpio-ctrl'
26*fa8c052bSVlad.Karpovich  *   is 1.
27*fa8c052bSVlad.Karpovich  *    0 = Output
28*fa8c052bSVlad.Karpovich  *    1 = Input (Default)
29*fa8c052bSVlad.Karpovich  *
30*fa8c052bSVlad.Karpovich  * - gpio-lvl : GPIO level. Valid only when 'gpio-ctrl' is 1 and 'gpio-dir' is 0.
31*fa8c052bSVlad.Karpovich  *
32*fa8c052bSVlad.Karpovich  *    0 = Low (Default)
33*fa8c052bSVlad.Karpovich  *    1 = High
34*fa8c052bSVlad.Karpovich  *
35*fa8c052bSVlad.Karpovich  * - gpio-op-cfg : GPIO output configuration. Valid only when 'gpio-ctrl' is 1
36*fa8c052bSVlad.Karpovich  *   and 'gpio-dir' is 0.
37*fa8c052bSVlad.Karpovich  *
38*fa8c052bSVlad.Karpovich  *    0 = CMOS (Default)
39*fa8c052bSVlad.Karpovich  *    1 = Open Drain
40*fa8c052bSVlad.Karpovich  *
41*fa8c052bSVlad.Karpovich  * - gpio-pol : GPIO output polarity select. Valid only when 'gpio-ctrl' is 1
42*fa8c052bSVlad.Karpovich  *   and 'gpio-dir' is 0.
43*fa8c052bSVlad.Karpovich  *
44*fa8c052bSVlad.Karpovich  *    0 = Non-inverted, Active High (Default)
45*fa8c052bSVlad.Karpovich  *    1 = Inverted, Active Low
46*fa8c052bSVlad.Karpovich  *
47*fa8c052bSVlad.Karpovich  * - gpio-invert : Defines the polarity of the GPIO pin if configured
48*fa8c052bSVlad.Karpovich  *   as input.
49*fa8c052bSVlad.Karpovich  *
50*fa8c052bSVlad.Karpovich  *    0 = Not inverted (Default)
51*fa8c052bSVlad.Karpovich  *    1 = Inverted
52*fa8c052bSVlad.Karpovich  *
53*fa8c052bSVlad.Karpovich  * - gpio-ctrl : Defines the function of the GPIO pin.
54*fa8c052bSVlad.Karpovich  *
55*fa8c052bSVlad.Karpovich  * GPIO1:
56*fa8c052bSVlad.Karpovich  *   0 = High impedance input (Default)
57*fa8c052bSVlad.Karpovich  *   1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
58*fa8c052bSVlad.Karpovich  *   2 = Pin acts as MDSYNC, direction controlled by MDSYNC
59*fa8c052bSVlad.Karpovich  *   3-7 = Reserved
60*fa8c052bSVlad.Karpovich  *
61*fa8c052bSVlad.Karpovich  * GPIO2:
62*fa8c052bSVlad.Karpovich  *   0 = High impedance input (Default)
63*fa8c052bSVlad.Karpovich  *   1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
64*fa8c052bSVlad.Karpovich  *   2 = Pin acts as open drain INT
65*fa8c052bSVlad.Karpovich  *   3 = Reserved
66*fa8c052bSVlad.Karpovich  *   4 = Pin acts as push-pull output INT. Active low.
67*fa8c052bSVlad.Karpovich  *   5 = Pin acts as push-pull output INT. Active high.
68*fa8c052bSVlad.Karpovich  *   6,7 = Reserved
69*fa8c052bSVlad.Karpovich  *
70*fa8c052bSVlad.Karpovich  * GPIO3:
71*fa8c052bSVlad.Karpovich  *   0 = High impedance input (Default)
72*fa8c052bSVlad.Karpovich  *   1 = Pin acts as a GPIO, direction controlled by 'gpio-dir'
73*fa8c052bSVlad.Karpovich  *   2-7 = Reserved
74*fa8c052bSVlad.Karpovich  */
75*fa8c052bSVlad.Karpovich #define CS35L45_NUM_GPIOS	0x3
76*fa8c052bSVlad.Karpovich 
7772661ff7SRichard Fitzgerald #endif /* DT_CS35L45_H */
78