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 | |
| 29 | #define WM8994_CONFIGURE_GPIO 0x8000 |
| 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 | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * DRC configurations are specified with a label and a set of register |
| 38 | * values to write (the enable bits will be ignored). At runtime an |
| 39 | * enumerated control will be presented for each DRC block allowing |
| 40 | * the user to choose the configration to use. |
| 41 | * |
| 42 | * Configurations may be generated by hand or by using the DRC control |
| 43 | * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/ |
| 44 | * for details. |
| 45 | */ |
| 46 | struct wm8994_drc_cfg { |
| 47 | const char *name; |
| 48 | u16 regs[WM8994_DRC_REGS]; |
| 49 | }; |
| 50 | |
| 51 | /** |
| 52 | * ReTune Mobile configurations are specified with a label, sample |
| 53 | * rate and set of values to write (the enable bits will be ignored). |
| 54 | * |
| 55 | * Configurations are expected to be generated using the ReTune Mobile |
| 56 | * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ |
| 57 | */ |
| 58 | struct wm8994_retune_mobile_cfg { |
| 59 | const char *name; |
| 60 | unsigned int rate; |
| 61 | u16 regs[WM8994_EQ_REGS]; |
| 62 | }; |
| 63 | |
Mark Brown | 131d810 | 2010-11-30 17:03:39 +0000 | [diff] [blame] | 64 | /** |
| 65 | * Multiband compressor configurations are specified with a label and |
| 66 | * two sets of values to write. Configurations are expected to be |
| 67 | * generated using the multiband compressor configuration panel in |
| 68 | * WISCE - see http://www.wolfsonmicro.com/wisce/ |
| 69 | */ |
| 70 | struct wm8958_mbc_cfg { |
| 71 | const char *name; |
| 72 | u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; |
| 73 | u16 coeff_regs[WM8958_MBC_COEFF_REGS]; |
| 74 | }; |
| 75 | |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 76 | struct wm8994_pdata { |
| 77 | int gpio_base; |
| 78 | |
| 79 | /** |
| 80 | * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO |
| 81 | * can be used for all zero values. |
| 82 | */ |
| 83 | int gpio_defaults[WM8994_NUM_GPIO]; |
| 84 | |
| 85 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; |
| 86 | |
Mark Brown | c9fbf7e | 2010-03-26 16:49:15 +0000 | [diff] [blame] | 87 | int irq_base; /** Base IRQ number for WM8994, required for IRQs */ |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 88 | |
| 89 | int num_drc_cfgs; |
| 90 | struct wm8994_drc_cfg *drc_cfgs; |
| 91 | |
| 92 | int num_retune_mobile_cfgs; |
| 93 | struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; |
| 94 | |
Mark Brown | 131d810 | 2010-11-30 17:03:39 +0000 | [diff] [blame] | 95 | int num_mbc_cfgs; |
| 96 | struct wm8958_mbc_cfg *mbc_cfgs; |
| 97 | |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 98 | /* LINEOUT can be differential or single ended */ |
| 99 | unsigned int lineout1_diff:1; |
| 100 | unsigned int lineout2_diff:1; |
| 101 | |
| 102 | /* Common mode feedback */ |
| 103 | unsigned int lineout1fb:1; |
| 104 | unsigned int lineout2fb:1; |
| 105 | |
Mark Brown | 9b7c525 | 2011-02-17 20:05:44 -0800 | [diff] [blame^] | 106 | /* IRQ for microphone detection if brought out directly as a |
| 107 | * signal. |
| 108 | */ |
| 109 | int micdet_irq; |
| 110 | |
Mark Brown | 9e50108 | 2010-01-29 18:20:29 +0000 | [diff] [blame] | 111 | /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ |
| 112 | unsigned int micbias1_lvl:1; |
| 113 | unsigned int micbias2_lvl:1; |
| 114 | |
| 115 | /* Jack detect threashold levels, see datasheet for values */ |
| 116 | unsigned int jd_scthr:2; |
| 117 | unsigned int jd_thr:2; |
| 118 | }; |
| 119 | |
| 120 | #endif |