xref: /linux/include/dt-bindings/mfd/arizona.h (revision 49010336290f4e3e4249c43bff1a1ff065c8f94e)
1*49010336SCharles Keepax /*
2*49010336SCharles Keepax  * Device Tree defines for Arizona devices
3*49010336SCharles Keepax  *
4*49010336SCharles Keepax  * Copyright 2015 Cirrus Logic Inc.
5*49010336SCharles Keepax  *
6*49010336SCharles Keepax  * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
7*49010336SCharles Keepax  *
8*49010336SCharles Keepax  * This program is free software; you can redistribute it and/or modify
9*49010336SCharles Keepax  * it under the terms of the GNU General Public License version 2 as
10*49010336SCharles Keepax  * published by the Free Software Foundation.
11*49010336SCharles Keepax  */
12*49010336SCharles Keepax 
13*49010336SCharles Keepax #ifndef _DT_BINDINGS_MFD_ARIZONA_H
14*49010336SCharles Keepax #define _DT_BINDINGS_MFD_ARIZONA_H
15*49010336SCharles Keepax 
16*49010336SCharles Keepax /* GPIO Function Definitions */
17*49010336SCharles Keepax #define ARIZONA_GP_FN_TXLRCLK                    0x00
18*49010336SCharles Keepax #define ARIZONA_GP_FN_GPIO                       0x01
19*49010336SCharles Keepax #define ARIZONA_GP_FN_IRQ1                       0x02
20*49010336SCharles Keepax #define ARIZONA_GP_FN_IRQ2                       0x03
21*49010336SCharles Keepax #define ARIZONA_GP_FN_OPCLK                      0x04
22*49010336SCharles Keepax #define ARIZONA_GP_FN_FLL1_OUT                   0x05
23*49010336SCharles Keepax #define ARIZONA_GP_FN_FLL2_OUT                   0x06
24*49010336SCharles Keepax #define ARIZONA_GP_FN_PWM1                       0x08
25*49010336SCharles Keepax #define ARIZONA_GP_FN_PWM2                       0x09
26*49010336SCharles Keepax #define ARIZONA_GP_FN_SYSCLK_UNDERCLOCKED        0x0A
27*49010336SCharles Keepax #define ARIZONA_GP_FN_ASYNCCLK_UNDERCLOCKED      0x0B
28*49010336SCharles Keepax #define ARIZONA_GP_FN_FLL1_LOCK                  0x0C
29*49010336SCharles Keepax #define ARIZONA_GP_FN_FLL2_LOCK                  0x0D
30*49010336SCharles Keepax #define ARIZONA_GP_FN_FLL1_CLOCK_OK              0x0F
31*49010336SCharles Keepax #define ARIZONA_GP_FN_FLL2_CLOCK_OK              0x10
32*49010336SCharles Keepax #define ARIZONA_GP_FN_HEADPHONE_DET              0x12
33*49010336SCharles Keepax #define ARIZONA_GP_FN_MIC_DET                    0x13
34*49010336SCharles Keepax #define ARIZONA_GP_FN_WSEQ_STATUS                0x15
35*49010336SCharles Keepax #define ARIZONA_GP_FN_CIF_ADDRESS_ERROR          0x16
36*49010336SCharles Keepax #define ARIZONA_GP_FN_ASRC1_LOCK                 0x1A
37*49010336SCharles Keepax #define ARIZONA_GP_FN_ASRC2_LOCK                 0x1B
38*49010336SCharles Keepax #define ARIZONA_GP_FN_ASRC_CONFIG_ERROR          0x1C
39*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_SIGNAL_DETECT         0x1D
40*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_ANTICLIP              0x1E
41*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_DECAY                 0x1F
42*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_NOISE                 0x20
43*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_QUICK_RELEASE         0x21
44*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_SIGNAL_DETECT         0x22
45*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_ANTICLIP              0x23
46*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_DECAY                 0x24
47*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_NOISE                 0x25
48*49010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_QUICK_RELEASE         0x26
49*49010336SCharles Keepax #define ARIZONA_GP_FN_MIXER_DROPPED_SAMPLE       0x27
50*49010336SCharles Keepax #define ARIZONA_GP_FN_AIF1_CONFIG_ERROR          0x28
51*49010336SCharles Keepax #define ARIZONA_GP_FN_AIF2_CONFIG_ERROR          0x29
52*49010336SCharles Keepax #define ARIZONA_GP_FN_AIF3_CONFIG_ERROR          0x2A
53*49010336SCharles Keepax #define ARIZONA_GP_FN_SPK_TEMP_SHUTDOWN          0x2B
54*49010336SCharles Keepax #define ARIZONA_GP_FN_SPK_TEMP_WARNING           0x2C
55*49010336SCharles Keepax #define ARIZONA_GP_FN_UNDERCLOCKED               0x2D
56*49010336SCharles Keepax #define ARIZONA_GP_FN_OVERCLOCKED                0x2E
57*49010336SCharles Keepax #define ARIZONA_GP_FN_DSP_IRQ1                   0x35
58*49010336SCharles Keepax #define ARIZONA_GP_FN_DSP_IRQ2                   0x36
59*49010336SCharles Keepax #define ARIZONA_GP_FN_ASYNC_OPCLK                0x3D
60*49010336SCharles Keepax #define ARIZONA_GP_FN_BOOT_DONE                  0x44
61*49010336SCharles Keepax #define ARIZONA_GP_FN_DSP1_RAM_READY             0x45
62*49010336SCharles Keepax #define ARIZONA_GP_FN_SYSCLK_ENA_STATUS          0x4B
63*49010336SCharles Keepax #define ARIZONA_GP_FN_ASYNCCLK_ENA_STATUS        0x4C
64*49010336SCharles Keepax 
65*49010336SCharles Keepax /* GPIO Configuration Bits */
66*49010336SCharles Keepax #define ARIZONA_GPN_DIR                          0x8000
67*49010336SCharles Keepax #define ARIZONA_GPN_PU                           0x4000
68*49010336SCharles Keepax #define ARIZONA_GPN_PD                           0x2000
69*49010336SCharles Keepax #define ARIZONA_GPN_LVL                          0x0800
70*49010336SCharles Keepax #define ARIZONA_GPN_POL                          0x0400
71*49010336SCharles Keepax #define ARIZONA_GPN_OP_CFG                       0x0200
72*49010336SCharles Keepax #define ARIZONA_GPN_DB                           0x0100
73*49010336SCharles Keepax 
74*49010336SCharles Keepax /* Provide some defines for the most common configs */
75*49010336SCharles Keepax #define ARIZONA_GP_DEFAULT             0xffffffff
76*49010336SCharles Keepax #define ARIZONA_GP_OUTPUT              (ARIZONA_GP_FN_GPIO)
77*49010336SCharles Keepax #define ARIZONA_GP_INPUT               (ARIZONA_GP_FN_GPIO | \
78*49010336SCharles Keepax 					ARIZONA_GPN_DIR)
79*49010336SCharles Keepax 
80*49010336SCharles Keepax #define ARIZONA_32KZ_MCLK1 1
81*49010336SCharles Keepax #define ARIZONA_32KZ_MCLK2 2
82*49010336SCharles Keepax #define ARIZONA_32KZ_NONE  3
83*49010336SCharles Keepax 
84*49010336SCharles Keepax #define ARIZONA_DMIC_MICVDD   0
85*49010336SCharles Keepax #define ARIZONA_DMIC_MICBIAS1 1
86*49010336SCharles Keepax #define ARIZONA_DMIC_MICBIAS2 2
87*49010336SCharles Keepax #define ARIZONA_DMIC_MICBIAS3 3
88*49010336SCharles Keepax 
89*49010336SCharles Keepax #define ARIZONA_INMODE_DIFF 0
90*49010336SCharles Keepax #define ARIZONA_INMODE_SE   1
91*49010336SCharles Keepax #define ARIZONA_INMODE_DMIC 2
92*49010336SCharles Keepax 
93*49010336SCharles Keepax #endif
94