Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * include/linux/mfd/wm8994/pdata.h -- Platform data for WM8994 |
| 3 | * |
| 4 | * Copyright 2009 Wolfson Microelectronics PLC. |
| 5 | * |
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License as published by the |
| 10 | * Free Software Foundation; either version 2 of the License, or (at your |
| 11 | * option) any later version. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #ifndef __MFD_WM8994_PDATA_H__ |
| 16 | #define __MFD_WM8994_PDATA_H__ |
| 17 | |
| 18 | #define WM8994_NUM_LDO 2 |
| 19 | #define WM8994_NUM_GPIO 11 |
| 20 | |
| 21 | struct wm8994_ldo_pdata { |
| 22 | /** GPIOs to enable regulator, 0 or less if not available */ |
| 23 | int enable; |
| 24 | |
| 25 | const char *supply; |
| 26 | struct regulator_init_data *init_data; |
| 27 | }; |
| 28 | |
Mark Brown | 8efcc57 | 2011-08-03 18:04:29 +0900 | [diff] [blame] | 29 | #define WM8994_CONFIGURE_GPIO 0x10000 |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 30 | |
| 31 | #define WM8994_DRC_REGS 5 |
Uk Kim | 3fcc0af | 2010-12-05 17:32:16 +0900 | [diff] [blame] | 32 | #define WM8994_EQ_REGS 20 |
Mark Brown | 131d810 | 2010-11-30 17:03:39 +0000 | [diff] [blame] | 33 | #define WM8958_MBC_CUTOFF_REGS 20 |
| 34 | #define WM8958_MBC_COEFF_REGS 48 |
Mark Brown | 09e10d7 | 2011-03-16 22:57:47 +0000 | [diff] [blame] | 35 | #define WM8958_MBC_COMBINED_REGS 56 |
| 36 | #define WM8958_VSS_HPF_REGS 2 |
| 37 | #define WM8958_VSS_REGS 148 |
Mark Brown | 3121587 | 2011-03-17 20:23:43 +0000 | [diff] [blame] | 38 | #define WM8958_ENH_EQ_REGS 32 |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * DRC configurations are specified with a label and a set of register |
| 42 | * values to write (the enable bits will be ignored). At runtime an |
| 43 | * enumerated control will be presented for each DRC block allowing |
| 44 | * the user to choose the configration to use. |
| 45 | * |
| 46 | * Configurations may be generated by hand or by using the DRC control |
| 47 | * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/ |
| 48 | * for details. |
| 49 | */ |
| 50 | struct wm8994_drc_cfg { |
| 51 | const char *name; |
| 52 | u16 regs[WM8994_DRC_REGS]; |
| 53 | }; |
| 54 | |
| 55 | /** |
| 56 | * ReTune Mobile configurations are specified with a label, sample |
| 57 | * rate and set of values to write (the enable bits will be ignored). |
| 58 | * |
| 59 | * Configurations are expected to be generated using the ReTune Mobile |
| 60 | * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ |
| 61 | */ |
| 62 | struct wm8994_retune_mobile_cfg { |
| 63 | const char *name; |
| 64 | unsigned int rate; |
| 65 | u16 regs[WM8994_EQ_REGS]; |
| 66 | }; |
| 67 | |
Mark Brown | 131d810 | 2010-11-30 17:03:39 +0000 | [diff] [blame] | 68 | /** |
| 69 | * Multiband compressor configurations are specified with a label and |
| 70 | * two sets of values to write. Configurations are expected to be |
| 71 | * generated using the multiband compressor configuration panel in |
| 72 | * WISCE - see http://www.wolfsonmicro.com/wisce/ |
| 73 | */ |
| 74 | struct wm8958_mbc_cfg { |
| 75 | const char *name; |
| 76 | u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; |
| 77 | u16 coeff_regs[WM8958_MBC_COEFF_REGS]; |
Mark Brown | 09e10d7 | 2011-03-16 22:57:47 +0000 | [diff] [blame] | 78 | |
| 79 | /* Coefficient layout when using MBC+VSS firmware */ |
| 80 | u16 combined_regs[WM8958_MBC_COMBINED_REGS]; |
| 81 | }; |
| 82 | |
| 83 | /** |
| 84 | * VSS HPF configurations are specified with a label and two values to |
| 85 | * write. Configurations are expected to be generated using the |
| 86 | * multiband compressor configuration panel in WISCE - see |
| 87 | * http://www.wolfsonmicro.com/wisce/ |
| 88 | */ |
| 89 | struct wm8958_vss_hpf_cfg { |
| 90 | const char *name; |
| 91 | u16 regs[WM8958_VSS_HPF_REGS]; |
| 92 | }; |
| 93 | |
| 94 | /** |
| 95 | * VSS configurations are specified with a label and array of values |
| 96 | * to write. Configurations are expected to be generated using the |
| 97 | * multiband compressor configuration panel in WISCE - see |
| 98 | * http://www.wolfsonmicro.com/wisce/ |
| 99 | */ |
| 100 | struct wm8958_vss_cfg { |
| 101 | const char *name; |
| 102 | u16 regs[WM8958_VSS_REGS]; |
Mark Brown | 131d810 | 2010-11-30 17:03:39 +0000 | [diff] [blame] | 103 | }; |
| 104 | |
Mark Brown | 3121587 | 2011-03-17 20:23:43 +0000 | [diff] [blame] | 105 | /** |
| 106 | * Enhanced EQ configurations are specified with a label and array of |
| 107 | * values to write. Configurations are expected to be generated using |
| 108 | * the multiband compressor configuration panel in WISCE - see |
| 109 | * http://www.wolfsonmicro.com/wisce/ |
| 110 | */ |
| 111 | struct wm8958_enh_eq_cfg { |
| 112 | const char *name; |
| 113 | u16 regs[WM8958_ENH_EQ_REGS]; |
| 114 | }; |
| 115 | |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 116 | struct wm8994_pdata { |
| 117 | int gpio_base; |
| 118 | |
| 119 | /** |
| 120 | * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO |
| 121 | * can be used for all zero values. |
| 122 | */ |
| 123 | int gpio_defaults[WM8994_NUM_GPIO]; |
| 124 | |
| 125 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; |
| 126 | |
Mark Brown | c9fbf7e | 2010-03-26 16:49:15 +0000 | [diff] [blame] | 127 | int irq_base; /** Base IRQ number for WM8994, required for IRQs */ |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 128 | |
| 129 | int num_drc_cfgs; |
| 130 | struct wm8994_drc_cfg *drc_cfgs; |
| 131 | |
| 132 | int num_retune_mobile_cfgs; |
| 133 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; |
| 134 | |
Mark Brown | 131d810 | 2010-11-30 17:03:39 +0000 | [diff] [blame] | 135 | int num_mbc_cfgs; |
| 136 | struct wm8958_mbc_cfg *mbc_cfgs; |
| 137 | |
Mark Brown | 09e10d7 | 2011-03-16 22:57:47 +0000 | [diff] [blame] | 138 | int num_vss_cfgs; |
| 139 | struct wm8958_vss_cfg *vss_cfgs; |
| 140 | |
| 141 | int num_vss_hpf_cfgs; |
| 142 | struct wm8958_vss_hpf_cfg *vss_hpf_cfgs; |
| 143 | |
Mark Brown | 3121587 | 2011-03-17 20:23:43 +0000 | [diff] [blame] | 144 | int num_enh_eq_cfgs; |
| 145 | struct wm8958_enh_eq_cfg *enh_eq_cfgs; |
| 146 | |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 147 | /* LINEOUT can be differential or single ended */ |
| 148 | unsigned int lineout1_diff:1; |
| 149 | unsigned int lineout2_diff:1; |
| 150 | |
| 151 | /* Common mode feedback */ |
| 152 | unsigned int lineout1fb:1; |
| 153 | unsigned int lineout2fb:1; |
| 154 | |
Mark Brown | 9b7c525 | 2011-02-17 20:05:44 -0800 | [diff] [blame] | 155 | /* IRQ for microphone detection if brought out directly as a |
| 156 | * signal. |
| 157 | */ |
| 158 | int micdet_irq; |
| 159 | |
Mark Brown | 48e028e | 2011-02-21 17:11:59 -0800 | [diff] [blame] | 160 | /* WM8994 microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 161 | unsigned int micbias1_lvl:1; |
| 162 | unsigned int micbias2_lvl:1; |
| 163 | |
Mark Brown | 48e028e | 2011-02-21 17:11:59 -0800 | [diff] [blame] | 164 | /* WM8994 jack detect threashold levels, see datasheet for values */ |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 165 | unsigned int jd_scthr:2; |
| 166 | unsigned int jd_thr:2; |
Mark Brown | 48e028e | 2011-02-21 17:11:59 -0800 | [diff] [blame] | 167 | |
| 168 | /* WM8958 microphone bias configuration */ |
| 169 | int micbias[2]; |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 170 | }; |
| 171 | |
| 172 | #endif |