0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __LINUX_SND_WM8903_H
0009 #define __LINUX_SND_WM8903_H
0010
0011
0012
0013
0014
0015 #define WM8903_GPIO_CONFIG_ZERO 0x8000
0016
0017
0018
0019
0020 #define WM8903_MICDET_THR_MASK 0x0030
0021 #define WM8903_MICDET_THR_SHIFT 4
0022 #define WM8903_MICDET_THR_WIDTH 2
0023 #define WM8903_MICSHORT_THR_MASK 0x000C
0024 #define WM8903_MICSHORT_THR_SHIFT 2
0025 #define WM8903_MICSHORT_THR_WIDTH 2
0026 #define WM8903_MICDET_ENA 0x0002
0027 #define WM8903_MICDET_ENA_MASK 0x0002
0028 #define WM8903_MICDET_ENA_SHIFT 1
0029 #define WM8903_MICDET_ENA_WIDTH 1
0030 #define WM8903_MICBIAS_ENA 0x0001
0031 #define WM8903_MICBIAS_ENA_MASK 0x0001
0032 #define WM8903_MICBIAS_ENA_SHIFT 0
0033 #define WM8903_MICBIAS_ENA_WIDTH 1
0034
0035
0036
0037
0038
0039
0040 #define WM8903_GPn_FN_GPIO_OUTPUT 0
0041 #define WM8903_GPn_FN_BCLK 1
0042 #define WM8903_GPn_FN_IRQ_OUTPT 2
0043 #define WM8903_GPn_FN_GPIO_INPUT 3
0044 #define WM8903_GPn_FN_MICBIAS_CURRENT_DETECT 4
0045 #define WM8903_GPn_FN_MICBIAS_SHORT_DETECT 5
0046 #define WM8903_GPn_FN_DMIC_LR_CLK_OUTPUT 6
0047 #define WM8903_GPn_FN_FLL_LOCK_OUTPUT 8
0048 #define WM8903_GPn_FN_FLL_CLOCK_OUTPUT 9
0049
0050
0051
0052
0053 #define WM8903_GP1_FN_MASK 0x1F00
0054 #define WM8903_GP1_FN_SHIFT 8
0055 #define WM8903_GP1_FN_WIDTH 5
0056 #define WM8903_GP1_DIR 0x0080
0057 #define WM8903_GP1_DIR_MASK 0x0080
0058 #define WM8903_GP1_DIR_SHIFT 7
0059 #define WM8903_GP1_DIR_WIDTH 1
0060 #define WM8903_GP1_OP_CFG 0x0040
0061 #define WM8903_GP1_OP_CFG_MASK 0x0040
0062 #define WM8903_GP1_OP_CFG_SHIFT 6
0063 #define WM8903_GP1_OP_CFG_WIDTH 1
0064 #define WM8903_GP1_IP_CFG 0x0020
0065 #define WM8903_GP1_IP_CFG_MASK 0x0020
0066 #define WM8903_GP1_IP_CFG_SHIFT 5
0067 #define WM8903_GP1_IP_CFG_WIDTH 1
0068 #define WM8903_GP1_LVL 0x0010
0069 #define WM8903_GP1_LVL_MASK 0x0010
0070 #define WM8903_GP1_LVL_SHIFT 4
0071 #define WM8903_GP1_LVL_WIDTH 1
0072 #define WM8903_GP1_PD 0x0008
0073 #define WM8903_GP1_PD_MASK 0x0008
0074 #define WM8903_GP1_PD_SHIFT 3
0075 #define WM8903_GP1_PD_WIDTH 1
0076 #define WM8903_GP1_PU 0x0004
0077 #define WM8903_GP1_PU_MASK 0x0004
0078 #define WM8903_GP1_PU_SHIFT 2
0079 #define WM8903_GP1_PU_WIDTH 1
0080 #define WM8903_GP1_INTMODE 0x0002
0081 #define WM8903_GP1_INTMODE_MASK 0x0002
0082 #define WM8903_GP1_INTMODE_SHIFT 1
0083 #define WM8903_GP1_INTMODE_WIDTH 1
0084 #define WM8903_GP1_DB 0x0001
0085 #define WM8903_GP1_DB_MASK 0x0001
0086 #define WM8903_GP1_DB_SHIFT 0
0087 #define WM8903_GP1_DB_WIDTH 1
0088
0089
0090
0091
0092 #define WM8903_GP2_FN_MASK 0x1F00
0093 #define WM8903_GP2_FN_SHIFT 8
0094 #define WM8903_GP2_FN_WIDTH 5
0095 #define WM8903_GP2_DIR 0x0080
0096 #define WM8903_GP2_DIR_MASK 0x0080
0097 #define WM8903_GP2_DIR_SHIFT 7
0098 #define WM8903_GP2_DIR_WIDTH 1
0099 #define WM8903_GP2_OP_CFG 0x0040
0100 #define WM8903_GP2_OP_CFG_MASK 0x0040
0101 #define WM8903_GP2_OP_CFG_SHIFT 6
0102 #define WM8903_GP2_OP_CFG_WIDTH 1
0103 #define WM8903_GP2_IP_CFG 0x0020
0104 #define WM8903_GP2_IP_CFG_MASK 0x0020
0105 #define WM8903_GP2_IP_CFG_SHIFT 5
0106 #define WM8903_GP2_IP_CFG_WIDTH 1
0107 #define WM8903_GP2_LVL 0x0010
0108 #define WM8903_GP2_LVL_MASK 0x0010
0109 #define WM8903_GP2_LVL_SHIFT 4
0110 #define WM8903_GP2_LVL_WIDTH 1
0111 #define WM8903_GP2_PD 0x0008
0112 #define WM8903_GP2_PD_MASK 0x0008
0113 #define WM8903_GP2_PD_SHIFT 3
0114 #define WM8903_GP2_PD_WIDTH 1
0115 #define WM8903_GP2_PU 0x0004
0116 #define WM8903_GP2_PU_MASK 0x0004
0117 #define WM8903_GP2_PU_SHIFT 2
0118 #define WM8903_GP2_PU_WIDTH 1
0119 #define WM8903_GP2_INTMODE 0x0002
0120 #define WM8903_GP2_INTMODE_MASK 0x0002
0121 #define WM8903_GP2_INTMODE_SHIFT 1
0122 #define WM8903_GP2_INTMODE_WIDTH 1
0123 #define WM8903_GP2_DB 0x0001
0124 #define WM8903_GP2_DB_MASK 0x0001
0125 #define WM8903_GP2_DB_SHIFT 0
0126 #define WM8903_GP2_DB_WIDTH 1
0127
0128
0129
0130
0131 #define WM8903_GP3_FN_MASK 0x1F00
0132 #define WM8903_GP3_FN_SHIFT 8
0133 #define WM8903_GP3_FN_WIDTH 5
0134 #define WM8903_GP3_DIR 0x0080
0135 #define WM8903_GP3_DIR_MASK 0x0080
0136 #define WM8903_GP3_DIR_SHIFT 7
0137 #define WM8903_GP3_DIR_WIDTH 1
0138 #define WM8903_GP3_OP_CFG 0x0040
0139 #define WM8903_GP3_OP_CFG_MASK 0x0040
0140 #define WM8903_GP3_OP_CFG_SHIFT 6
0141 #define WM8903_GP3_OP_CFG_WIDTH 1
0142 #define WM8903_GP3_IP_CFG 0x0020
0143 #define WM8903_GP3_IP_CFG_MASK 0x0020
0144 #define WM8903_GP3_IP_CFG_SHIFT 5
0145 #define WM8903_GP3_IP_CFG_WIDTH 1
0146 #define WM8903_GP3_LVL 0x0010
0147 #define WM8903_GP3_LVL_MASK 0x0010
0148 #define WM8903_GP3_LVL_SHIFT 4
0149 #define WM8903_GP3_LVL_WIDTH 1
0150 #define WM8903_GP3_PD 0x0008
0151 #define WM8903_GP3_PD_MASK 0x0008
0152 #define WM8903_GP3_PD_SHIFT 3
0153 #define WM8903_GP3_PD_WIDTH 1
0154 #define WM8903_GP3_PU 0x0004
0155 #define WM8903_GP3_PU_MASK 0x0004
0156 #define WM8903_GP3_PU_SHIFT 2
0157 #define WM8903_GP3_PU_WIDTH 1
0158 #define WM8903_GP3_INTMODE 0x0002
0159 #define WM8903_GP3_INTMODE_MASK 0x0002
0160 #define WM8903_GP3_INTMODE_SHIFT 1
0161 #define WM8903_GP3_INTMODE_WIDTH 1
0162 #define WM8903_GP3_DB 0x0001
0163 #define WM8903_GP3_DB_MASK 0x0001
0164 #define WM8903_GP3_DB_SHIFT 0
0165 #define WM8903_GP3_DB_WIDTH 1
0166
0167
0168
0169
0170 #define WM8903_GP4_FN_MASK 0x1F00
0171 #define WM8903_GP4_FN_SHIFT 8
0172 #define WM8903_GP4_FN_WIDTH 5
0173 #define WM8903_GP4_DIR 0x0080
0174 #define WM8903_GP4_DIR_MASK 0x0080
0175 #define WM8903_GP4_DIR_SHIFT 7
0176 #define WM8903_GP4_DIR_WIDTH 1
0177 #define WM8903_GP4_OP_CFG 0x0040
0178 #define WM8903_GP4_OP_CFG_MASK 0x0040
0179 #define WM8903_GP4_OP_CFG_SHIFT 6
0180 #define WM8903_GP4_OP_CFG_WIDTH 1
0181 #define WM8903_GP4_IP_CFG 0x0020
0182 #define WM8903_GP4_IP_CFG_MASK 0x0020
0183 #define WM8903_GP4_IP_CFG_SHIFT 5
0184 #define WM8903_GP4_IP_CFG_WIDTH 1
0185 #define WM8903_GP4_LVL 0x0010
0186 #define WM8903_GP4_LVL_MASK 0x0010
0187 #define WM8903_GP4_LVL_SHIFT 4
0188 #define WM8903_GP4_LVL_WIDTH 1
0189 #define WM8903_GP4_PD 0x0008
0190 #define WM8903_GP4_PD_MASK 0x0008
0191 #define WM8903_GP4_PD_SHIFT 3
0192 #define WM8903_GP4_PD_WIDTH 1
0193 #define WM8903_GP4_PU 0x0004
0194 #define WM8903_GP4_PU_MASK 0x0004
0195 #define WM8903_GP4_PU_SHIFT 2
0196 #define WM8903_GP4_PU_WIDTH 1
0197 #define WM8903_GP4_INTMODE 0x0002
0198 #define WM8903_GP4_INTMODE_MASK 0x0002
0199 #define WM8903_GP4_INTMODE_SHIFT 1
0200 #define WM8903_GP4_INTMODE_WIDTH 1
0201 #define WM8903_GP4_DB 0x0001
0202 #define WM8903_GP4_DB_MASK 0x0001
0203 #define WM8903_GP4_DB_SHIFT 0
0204 #define WM8903_GP4_DB_WIDTH 1
0205
0206
0207
0208
0209 #define WM8903_GP5_FN_MASK 0x1F00
0210 #define WM8903_GP5_FN_SHIFT 8
0211 #define WM8903_GP5_FN_WIDTH 5
0212 #define WM8903_GP5_DIR 0x0080
0213 #define WM8903_GP5_DIR_MASK 0x0080
0214 #define WM8903_GP5_DIR_SHIFT 7
0215 #define WM8903_GP5_DIR_WIDTH 1
0216 #define WM8903_GP5_OP_CFG 0x0040
0217 #define WM8903_GP5_OP_CFG_MASK 0x0040
0218 #define WM8903_GP5_OP_CFG_SHIFT 6
0219 #define WM8903_GP5_OP_CFG_WIDTH 1
0220 #define WM8903_GP5_IP_CFG 0x0020
0221 #define WM8903_GP5_IP_CFG_MASK 0x0020
0222 #define WM8903_GP5_IP_CFG_SHIFT 5
0223 #define WM8903_GP5_IP_CFG_WIDTH 1
0224 #define WM8903_GP5_LVL 0x0010
0225 #define WM8903_GP5_LVL_MASK 0x0010
0226 #define WM8903_GP5_LVL_SHIFT 4
0227 #define WM8903_GP5_LVL_WIDTH 1
0228 #define WM8903_GP5_PD 0x0008
0229 #define WM8903_GP5_PD_MASK 0x0008
0230 #define WM8903_GP5_PD_SHIFT 3
0231 #define WM8903_GP5_PD_WIDTH 1
0232 #define WM8903_GP5_PU 0x0004
0233 #define WM8903_GP5_PU_MASK 0x0004
0234 #define WM8903_GP5_PU_SHIFT 2
0235 #define WM8903_GP5_PU_WIDTH 1
0236 #define WM8903_GP5_INTMODE 0x0002
0237 #define WM8903_GP5_INTMODE_MASK 0x0002
0238 #define WM8903_GP5_INTMODE_SHIFT 1
0239 #define WM8903_GP5_INTMODE_WIDTH 1
0240 #define WM8903_GP5_DB 0x0001
0241 #define WM8903_GP5_DB_MASK 0x0001
0242 #define WM8903_GP5_DB_SHIFT 0
0243 #define WM8903_GP5_DB_WIDTH 1
0244
0245 #define WM8903_NUM_GPIO 5
0246
0247 struct wm8903_platform_data {
0248 bool irq_active_low;
0249
0250
0251
0252
0253
0254
0255 u16 micdet_cfg;
0256
0257 int micdet_delay;
0258
0259 int gpio_base;
0260 u32 gpio_cfg[WM8903_NUM_GPIO];
0261 };
0262
0263 #endif