1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
249010336SCharles Keepax /*
349010336SCharles Keepax  * Device Tree defines for Arizona devices
449010336SCharles Keepax  *
549010336SCharles Keepax  * Copyright 2015 Cirrus Logic Inc.
649010336SCharles Keepax  *
749010336SCharles Keepax  * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
849010336SCharles Keepax  */
949010336SCharles Keepax 
1049010336SCharles Keepax #ifndef _DT_BINDINGS_MFD_ARIZONA_H
1149010336SCharles Keepax #define _DT_BINDINGS_MFD_ARIZONA_H
1249010336SCharles Keepax 
1349010336SCharles Keepax /* GPIO Function Definitions */
1449010336SCharles Keepax #define ARIZONA_GP_FN_TXLRCLK                    0x00
1549010336SCharles Keepax #define ARIZONA_GP_FN_GPIO                       0x01
1649010336SCharles Keepax #define ARIZONA_GP_FN_IRQ1                       0x02
1749010336SCharles Keepax #define ARIZONA_GP_FN_IRQ2                       0x03
1849010336SCharles Keepax #define ARIZONA_GP_FN_OPCLK                      0x04
1949010336SCharles Keepax #define ARIZONA_GP_FN_FLL1_OUT                   0x05
2049010336SCharles Keepax #define ARIZONA_GP_FN_FLL2_OUT                   0x06
2149010336SCharles Keepax #define ARIZONA_GP_FN_PWM1                       0x08
2249010336SCharles Keepax #define ARIZONA_GP_FN_PWM2                       0x09
2349010336SCharles Keepax #define ARIZONA_GP_FN_SYSCLK_UNDERCLOCKED        0x0A
2449010336SCharles Keepax #define ARIZONA_GP_FN_ASYNCCLK_UNDERCLOCKED      0x0B
2549010336SCharles Keepax #define ARIZONA_GP_FN_FLL1_LOCK                  0x0C
2649010336SCharles Keepax #define ARIZONA_GP_FN_FLL2_LOCK                  0x0D
2749010336SCharles Keepax #define ARIZONA_GP_FN_FLL1_CLOCK_OK              0x0F
2849010336SCharles Keepax #define ARIZONA_GP_FN_FLL2_CLOCK_OK              0x10
2949010336SCharles Keepax #define ARIZONA_GP_FN_HEADPHONE_DET              0x12
3049010336SCharles Keepax #define ARIZONA_GP_FN_MIC_DET                    0x13
3149010336SCharles Keepax #define ARIZONA_GP_FN_WSEQ_STATUS                0x15
3249010336SCharles Keepax #define ARIZONA_GP_FN_CIF_ADDRESS_ERROR          0x16
3349010336SCharles Keepax #define ARIZONA_GP_FN_ASRC1_LOCK                 0x1A
3449010336SCharles Keepax #define ARIZONA_GP_FN_ASRC2_LOCK                 0x1B
3549010336SCharles Keepax #define ARIZONA_GP_FN_ASRC_CONFIG_ERROR          0x1C
3649010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_SIGNAL_DETECT         0x1D
3749010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_ANTICLIP              0x1E
3849010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_DECAY                 0x1F
3949010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_NOISE                 0x20
4049010336SCharles Keepax #define ARIZONA_GP_FN_DRC1_QUICK_RELEASE         0x21
4149010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_SIGNAL_DETECT         0x22
4249010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_ANTICLIP              0x23
4349010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_DECAY                 0x24
4449010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_NOISE                 0x25
4549010336SCharles Keepax #define ARIZONA_GP_FN_DRC2_QUICK_RELEASE         0x26
4649010336SCharles Keepax #define ARIZONA_GP_FN_MIXER_DROPPED_SAMPLE       0x27
4749010336SCharles Keepax #define ARIZONA_GP_FN_AIF1_CONFIG_ERROR          0x28
4849010336SCharles Keepax #define ARIZONA_GP_FN_AIF2_CONFIG_ERROR          0x29
4949010336SCharles Keepax #define ARIZONA_GP_FN_AIF3_CONFIG_ERROR          0x2A
5049010336SCharles Keepax #define ARIZONA_GP_FN_SPK_TEMP_SHUTDOWN          0x2B
5149010336SCharles Keepax #define ARIZONA_GP_FN_SPK_TEMP_WARNING           0x2C
5249010336SCharles Keepax #define ARIZONA_GP_FN_UNDERCLOCKED               0x2D
5349010336SCharles Keepax #define ARIZONA_GP_FN_OVERCLOCKED                0x2E
5449010336SCharles Keepax #define ARIZONA_GP_FN_DSP_IRQ1                   0x35
5549010336SCharles Keepax #define ARIZONA_GP_FN_DSP_IRQ2                   0x36
5649010336SCharles Keepax #define ARIZONA_GP_FN_ASYNC_OPCLK                0x3D
5749010336SCharles Keepax #define ARIZONA_GP_FN_BOOT_DONE                  0x44
5849010336SCharles Keepax #define ARIZONA_GP_FN_DSP1_RAM_READY             0x45
5949010336SCharles Keepax #define ARIZONA_GP_FN_SYSCLK_ENA_STATUS          0x4B
6049010336SCharles Keepax #define ARIZONA_GP_FN_ASYNCCLK_ENA_STATUS        0x4C
6149010336SCharles Keepax 
6249010336SCharles Keepax /* GPIO Configuration Bits */
6349010336SCharles Keepax #define ARIZONA_GPN_DIR                          0x8000
6449010336SCharles Keepax #define ARIZONA_GPN_PU                           0x4000
6549010336SCharles Keepax #define ARIZONA_GPN_PD                           0x2000
6649010336SCharles Keepax #define ARIZONA_GPN_LVL                          0x0800
6749010336SCharles Keepax #define ARIZONA_GPN_POL                          0x0400
6849010336SCharles Keepax #define ARIZONA_GPN_OP_CFG                       0x0200
6949010336SCharles Keepax #define ARIZONA_GPN_DB                           0x0100
7049010336SCharles Keepax 
7149010336SCharles Keepax /* Provide some defines for the most common configs */
7249010336SCharles Keepax #define ARIZONA_GP_DEFAULT             0xffffffff
7349010336SCharles Keepax #define ARIZONA_GP_OUTPUT              (ARIZONA_GP_FN_GPIO)
7449010336SCharles Keepax #define ARIZONA_GP_INPUT               (ARIZONA_GP_FN_GPIO | \
7549010336SCharles Keepax 					ARIZONA_GPN_DIR)
7649010336SCharles Keepax 
7749010336SCharles Keepax #define ARIZONA_32KZ_MCLK1 1
7849010336SCharles Keepax #define ARIZONA_32KZ_MCLK2 2
7949010336SCharles Keepax #define ARIZONA_32KZ_NONE  3
8049010336SCharles Keepax 
8149010336SCharles Keepax #define ARIZONA_DMIC_MICVDD   0
8249010336SCharles Keepax #define ARIZONA_DMIC_MICBIAS1 1
8349010336SCharles Keepax #define ARIZONA_DMIC_MICBIAS2 2
8449010336SCharles Keepax #define ARIZONA_DMIC_MICBIAS3 3
8549010336SCharles Keepax 
8649010336SCharles Keepax #define ARIZONA_INMODE_DIFF 0
8749010336SCharles Keepax #define ARIZONA_INMODE_SE   1
8849010336SCharles Keepax #define ARIZONA_INMODE_DMIC 2
8949010336SCharles Keepax 
90056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_CONTINUOUS                 0
91056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_250US                      1
92056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_500US                      2
93056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_1MS                        3
94056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_2MS                        4
95056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_4MS                        5
96056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_8MS                        6
97056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_16MS                       7
98056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_32MS                       8
99056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_64MS                       9
100056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_128MS                      10
101056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_256MS                      11
102056c3e75SCharles Keepax #define ARIZONA_MICD_TIME_512MS                      12
103056c3e75SCharles Keepax 
1049e86b2adSInha Song #define ARIZONA_ACCDET_MODE_MIC 0
1059e86b2adSInha Song #define ARIZONA_ACCDET_MODE_HPL 1
1069e86b2adSInha Song #define ARIZONA_ACCDET_MODE_HPR 2
107e76e397aSCharles Keepax #define ARIZONA_ACCDET_MODE_HPM 4
108e76e397aSCharles Keepax #define ARIZONA_ACCDET_MODE_ADC 7
1099e86b2adSInha Song 
11037ac9c90SCharles Keepax #define ARIZONA_GPSW_OPEN           0
11137ac9c90SCharles Keepax #define ARIZONA_GPSW_CLOSED         1
11237ac9c90SCharles Keepax #define ARIZONA_GPSW_CLAMP_ENABLED  2
11337ac9c90SCharles Keepax #define ARIZONA_GPSW_CLAMP_DISABLED 3
11437ac9c90SCharles Keepax 
11549010336SCharles Keepax #endif
116