0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __MFD_WM8994_PDATA_H__
0011 #define __MFD_WM8994_PDATA_H__
0012
0013
0014 #define WM8904_GPIO_NO_CONFIG 0x8000
0015
0016
0017
0018
0019 #define WM8904_MICDET_THR_MASK 0x0070
0020 #define WM8904_MICDET_THR_SHIFT 4
0021 #define WM8904_MICDET_THR_WIDTH 3
0022 #define WM8904_MICSHORT_THR_MASK 0x000C
0023 #define WM8904_MICSHORT_THR_SHIFT 2
0024 #define WM8904_MICSHORT_THR_WIDTH 2
0025 #define WM8904_MICDET_ENA 0x0002
0026 #define WM8904_MICDET_ENA_MASK 0x0002
0027 #define WM8904_MICDET_ENA_SHIFT 1
0028 #define WM8904_MICDET_ENA_WIDTH 1
0029 #define WM8904_MICBIAS_ENA 0x0001
0030 #define WM8904_MICBIAS_ENA_MASK 0x0001
0031 #define WM8904_MICBIAS_ENA_SHIFT 0
0032 #define WM8904_MICBIAS_ENA_WIDTH 1
0033
0034
0035
0036
0037 #define WM8904_MIC_DET_FILTER_ENA 0x8000
0038 #define WM8904_MIC_DET_FILTER_ENA_MASK 0x8000
0039 #define WM8904_MIC_DET_FILTER_ENA_SHIFT 15
0040 #define WM8904_MIC_DET_FILTER_ENA_WIDTH 1
0041 #define WM8904_MIC_SHORT_FILTER_ENA 0x4000
0042 #define WM8904_MIC_SHORT_FILTER_ENA_MASK 0x4000
0043 #define WM8904_MIC_SHORT_FILTER_ENA_SHIFT 14
0044 #define WM8904_MIC_SHORT_FILTER_ENA_WIDTH 1
0045 #define WM8904_MICBIAS_SEL_MASK 0x0007
0046 #define WM8904_MICBIAS_SEL_SHIFT 0
0047 #define WM8904_MICBIAS_SEL_WIDTH 3
0048
0049
0050
0051
0052
0053 #define WM8904_GPIO1_PU 0x0020
0054 #define WM8904_GPIO1_PU_MASK 0x0020
0055 #define WM8904_GPIO1_PU_SHIFT 5
0056 #define WM8904_GPIO1_PU_WIDTH 1
0057 #define WM8904_GPIO1_PD 0x0010
0058 #define WM8904_GPIO1_PD_MASK 0x0010
0059 #define WM8904_GPIO1_PD_SHIFT 4
0060 #define WM8904_GPIO1_PD_WIDTH 1
0061 #define WM8904_GPIO1_SEL_MASK 0x000F
0062 #define WM8904_GPIO1_SEL_SHIFT 0
0063 #define WM8904_GPIO1_SEL_WIDTH 4
0064
0065
0066
0067
0068 #define WM8904_GPIO2_PU 0x0020
0069 #define WM8904_GPIO2_PU_MASK 0x0020
0070 #define WM8904_GPIO2_PU_SHIFT 5
0071 #define WM8904_GPIO2_PU_WIDTH 1
0072 #define WM8904_GPIO2_PD 0x0010
0073 #define WM8904_GPIO2_PD_MASK 0x0010
0074 #define WM8904_GPIO2_PD_SHIFT 4
0075 #define WM8904_GPIO2_PD_WIDTH 1
0076 #define WM8904_GPIO2_SEL_MASK 0x000F
0077 #define WM8904_GPIO2_SEL_SHIFT 0
0078 #define WM8904_GPIO2_SEL_WIDTH 4
0079
0080
0081
0082
0083 #define WM8904_GPIO3_PU 0x0020
0084 #define WM8904_GPIO3_PU_MASK 0x0020
0085 #define WM8904_GPIO3_PU_SHIFT 5
0086 #define WM8904_GPIO3_PU_WIDTH 1
0087 #define WM8904_GPIO3_PD 0x0010
0088 #define WM8904_GPIO3_PD_MASK 0x0010
0089 #define WM8904_GPIO3_PD_SHIFT 4
0090 #define WM8904_GPIO3_PD_WIDTH 1
0091 #define WM8904_GPIO3_SEL_MASK 0x000F
0092 #define WM8904_GPIO3_SEL_SHIFT 0
0093 #define WM8904_GPIO3_SEL_WIDTH 4
0094
0095
0096
0097
0098 #define WM8904_GPI7_ENA 0x0200
0099 #define WM8904_GPI7_ENA_MASK 0x0200
0100 #define WM8904_GPI7_ENA_SHIFT 9
0101 #define WM8904_GPI7_ENA_WIDTH 1
0102 #define WM8904_GPI8_ENA 0x0100
0103 #define WM8904_GPI8_ENA_MASK 0x0100
0104 #define WM8904_GPI8_ENA_SHIFT 8
0105 #define WM8904_GPI8_ENA_WIDTH 1
0106 #define WM8904_GPIO_BCLK_MODE_ENA 0x0080
0107 #define WM8904_GPIO_BCLK_MODE_ENA_MASK 0x0080
0108 #define WM8904_GPIO_BCLK_MODE_ENA_SHIFT 7
0109 #define WM8904_GPIO_BCLK_MODE_ENA_WIDTH 1
0110 #define WM8904_GPIO_BCLK_SEL_MASK 0x000F
0111 #define WM8904_GPIO_BCLK_SEL_SHIFT 0
0112 #define WM8904_GPIO_BCLK_SEL_WIDTH 4
0113
0114 #define WM8904_MIC_REGS 2
0115 #define WM8904_GPIO_REGS 4
0116 #define WM8904_DRC_REGS 4
0117 #define WM8904_EQ_REGS 24
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129 struct wm8904_drc_cfg {
0130 const char *name;
0131 u16 regs[WM8904_DRC_REGS];
0132 };
0133
0134
0135
0136
0137
0138
0139
0140
0141 struct wm8904_retune_mobile_cfg {
0142 const char *name;
0143 unsigned int rate;
0144 u16 regs[WM8904_EQ_REGS];
0145 };
0146
0147 struct wm8904_pdata {
0148 int num_drc_cfgs;
0149 struct wm8904_drc_cfg *drc_cfgs;
0150
0151 int num_retune_mobile_cfgs;
0152 struct wm8904_retune_mobile_cfg *retune_mobile_cfgs;
0153
0154 u32 gpio_cfg[WM8904_GPIO_REGS];
0155 u32 mic_cfg[WM8904_MIC_REGS];
0156 };
0157
0158 #endif