| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * include/linux/mfd/wm8994/pdata.h -- Platform data for WM8994 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright 2009 Wolfson Microelectronics PLC. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  This program is free software; you can redistribute  it and/or modify it | 
					
						
							|  |  |  |  *  under  the terms of  the GNU General  Public License as published by the | 
					
						
							|  |  |  |  *  Free Software Foundation;  either version 2 of the  License, or (at your | 
					
						
							|  |  |  |  *  option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __MFD_WM8994_PDATA_H__
 | 
					
						
							|  |  |  | #define __MFD_WM8994_PDATA_H__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define WM8994_NUM_LDO   2
 | 
					
						
							|  |  |  | #define WM8994_NUM_GPIO 11
 | 
					
						
							| 
									
										
										
										
											2013-03-20 10:12:10 +01:00
										 |  |  | #define WM8994_NUM_AIF   3
 | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | struct wm8994_ldo_pdata { | 
					
						
							|  |  |  | 	/** GPIOs to enable regulator, 0 or less if not available */ | 
					
						
							|  |  |  | 	int enable; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-28 18:48:14 +00:00
										 |  |  | 	const struct regulator_init_data *init_data; | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-03 18:04:29 +09:00
										 |  |  | #define WM8994_CONFIGURE_GPIO 0x10000
 | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define WM8994_DRC_REGS 5
 | 
					
						
							| 
									
										
										
										
											2010-12-05 17:32:16 +09:00
										 |  |  | #define WM8994_EQ_REGS  20
 | 
					
						
							| 
									
										
										
										
											2010-11-30 17:03:39 +00:00
										 |  |  | #define WM8958_MBC_CUTOFF_REGS 20
 | 
					
						
							|  |  |  | #define WM8958_MBC_COEFF_REGS  48
 | 
					
						
							| 
									
										
										
										
											2011-03-16 22:57:47 +00:00
										 |  |  | #define WM8958_MBC_COMBINED_REGS 56
 | 
					
						
							|  |  |  | #define WM8958_VSS_HPF_REGS 2
 | 
					
						
							|  |  |  | #define WM8958_VSS_REGS 148
 | 
					
						
							| 
									
										
										
										
											2011-03-17 20:23:43 +00:00
										 |  |  | #define WM8958_ENH_EQ_REGS 32
 | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * DRC configurations are specified with a label and a set of register | 
					
						
							|  |  |  |  * values to write (the enable bits will be ignored).  At runtime an | 
					
						
							|  |  |  |  * enumerated control will be presented for each DRC block allowing | 
					
						
							|  |  |  |  * the user to choose the configration to use. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Configurations may be generated by hand or by using the DRC control | 
					
						
							|  |  |  |  * panel provided by the WISCE - see  http://www.wolfsonmicro.com/wisce/
 | 
					
						
							|  |  |  |  * for details. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8994_drc_cfg { | 
					
						
							|  |  |  |         const char *name; | 
					
						
							|  |  |  |         u16 regs[WM8994_DRC_REGS]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * ReTune Mobile configurations are specified with a label, sample | 
					
						
							|  |  |  |  * rate and set of values to write (the enable bits will be ignored). | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Configurations are expected to be generated using the ReTune Mobile | 
					
						
							|  |  |  |  * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8994_retune_mobile_cfg { | 
					
						
							|  |  |  |         const char *name; | 
					
						
							|  |  |  |         unsigned int rate; | 
					
						
							|  |  |  |         u16 regs[WM8994_EQ_REGS]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-30 17:03:39 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * Multiband compressor configurations are specified with a label and | 
					
						
							|  |  |  |  * two sets of values to write.  Configurations are expected to be | 
					
						
							|  |  |  |  * generated using the multiband compressor configuration panel in | 
					
						
							|  |  |  |  * WISCE - see http://www.wolfsonmicro.com/wisce/
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8958_mbc_cfg { | 
					
						
							|  |  |  | 	const char *name; | 
					
						
							|  |  |  | 	u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; | 
					
						
							|  |  |  | 	u16 coeff_regs[WM8958_MBC_COEFF_REGS]; | 
					
						
							| 
									
										
										
										
											2011-03-16 22:57:47 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* Coefficient layout when using MBC+VSS firmware */ | 
					
						
							|  |  |  | 	u16 combined_regs[WM8958_MBC_COMBINED_REGS]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * VSS HPF configurations are specified with a label and two values to | 
					
						
							|  |  |  |  * write.  Configurations are expected to be generated using the | 
					
						
							|  |  |  |  * multiband compressor configuration panel in WISCE - see | 
					
						
							|  |  |  |  * http://www.wolfsonmicro.com/wisce/
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8958_vss_hpf_cfg { | 
					
						
							|  |  |  | 	const char *name; | 
					
						
							|  |  |  | 	u16 regs[WM8958_VSS_HPF_REGS]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * VSS configurations are specified with a label and array of values | 
					
						
							|  |  |  |  * to write.  Configurations are expected to be generated using the | 
					
						
							|  |  |  |  * multiband compressor configuration panel in WISCE - see | 
					
						
							|  |  |  |  * http://www.wolfsonmicro.com/wisce/
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8958_vss_cfg { | 
					
						
							|  |  |  | 	const char *name; | 
					
						
							|  |  |  | 	u16 regs[WM8958_VSS_REGS]; | 
					
						
							| 
									
										
										
										
											2010-11-30 17:03:39 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-17 20:23:43 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * Enhanced EQ configurations are specified with a label and array of | 
					
						
							|  |  |  |  * values to write.  Configurations are expected to be generated using | 
					
						
							|  |  |  |  * the multiband compressor configuration panel in WISCE - see | 
					
						
							|  |  |  |  * http://www.wolfsonmicro.com/wisce/
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8958_enh_eq_cfg { | 
					
						
							|  |  |  | 	const char *name; | 
					
						
							|  |  |  | 	u16 regs[WM8958_ENH_EQ_REGS]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-01 13:44:25 +00:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * Microphone detection rates, used to tune response rates and power | 
					
						
							|  |  |  |  * consumption for WM8958/WM1811 microphone detection. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @sysclk: System clock rate to use this configuration for. | 
					
						
							|  |  |  |  * @idle: True if this configuration should use when no accessory is detected, | 
					
						
							|  |  |  |  *        false otherwise. | 
					
						
							|  |  |  |  * @start: Value for MICD_BIAS_START_TIME register field (not shifted). | 
					
						
							|  |  |  |  * @rate: Value for MICD_RATE register field (not shifted). | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | struct wm8958_micd_rate { | 
					
						
							|  |  |  | 	int sysclk; | 
					
						
							|  |  |  | 	bool idle; | 
					
						
							|  |  |  | 	int start; | 
					
						
							|  |  |  | 	int rate; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | struct wm8994_pdata { | 
					
						
							|  |  |  | 	int gpio_base; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO | 
					
						
							|  |  |  | 	 * can be used for all zero values. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	int gpio_defaults[WM8994_NUM_GPIO]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-26 16:49:15 +00:00
										 |  |  | 	int irq_base;  /** Base IRQ number for WM8994, required for IRQs */ | 
					
						
							| 
									
										
										
										
											2012-06-01 16:33:19 +01:00
										 |  |  | 	unsigned long irq_flags; /** user irq flags */ | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         int num_drc_cfgs; | 
					
						
							|  |  |  |         struct wm8994_drc_cfg *drc_cfgs; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         int num_retune_mobile_cfgs; | 
					
						
							|  |  |  |         struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-30 17:03:39 +00:00
										 |  |  | 	int num_mbc_cfgs; | 
					
						
							|  |  |  | 	struct wm8958_mbc_cfg *mbc_cfgs; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-16 22:57:47 +00:00
										 |  |  | 	int num_vss_cfgs; | 
					
						
							|  |  |  | 	struct wm8958_vss_cfg *vss_cfgs; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	int num_vss_hpf_cfgs; | 
					
						
							|  |  |  | 	struct wm8958_vss_hpf_cfg *vss_hpf_cfgs; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-17 20:23:43 +00:00
										 |  |  | 	int num_enh_eq_cfgs; | 
					
						
							|  |  |  | 	struct wm8958_enh_eq_cfg *enh_eq_cfgs; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-01 13:44:25 +00:00
										 |  |  | 	int num_micd_rates; | 
					
						
							|  |  |  | 	struct wm8958_micd_rate *micd_rates; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-21 17:54:52 +01:00
										 |  |  | 	/* Power up delays to add after microphone bias power up (ms) */ | 
					
						
							|  |  |  | 	int micb1_delay; | 
					
						
							|  |  |  | 	int micb2_delay; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  |         /* LINEOUT can be differential or single ended */ | 
					
						
							|  |  |  |         unsigned int lineout1_diff:1; | 
					
						
							|  |  |  |         unsigned int lineout2_diff:1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /* Common mode feedback */ | 
					
						
							|  |  |  |         unsigned int lineout1fb:1; | 
					
						
							|  |  |  |         unsigned int lineout2fb:1; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-28 16:50:15 +01:00
										 |  |  | 	/* Delay between detecting a jack and starting microphone
 | 
					
						
							|  |  |  | 	 * detect (specified in ms) | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	int micdet_delay; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-30 13:42:29 +01:00
										 |  |  | 	/* Delay between microphone detect completing and reporting on
 | 
					
						
							|  |  |  | 	 * insert (specified in ms) | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	int mic_id_delay; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-17 20:05:44 -08:00
										 |  |  | 	/* IRQ for microphone detection if brought out directly as a
 | 
					
						
							|  |  |  | 	 * signal. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	int micdet_irq; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-21 17:11:59 -08:00
										 |  |  |         /* WM8994 microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  |         unsigned int micbias1_lvl:1; | 
					
						
							|  |  |  |         unsigned int micbias2_lvl:1; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-21 17:11:59 -08:00
										 |  |  |         /* WM8994 jack detect threashold levels, see datasheet for values */ | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  |         unsigned int jd_scthr:2; | 
					
						
							|  |  |  |         unsigned int jd_thr:2; | 
					
						
							| 
									
										
										
										
											2011-02-21 17:11:59 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-21 16:23:35 +00:00
										 |  |  | 	/* Configure WM1811 jack detection for use with external capacitor */ | 
					
						
							|  |  |  | 	unsigned int jd_ext_cap:1; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-21 17:11:59 -08:00
										 |  |  | 	/* WM8958 microphone bias configuration */ | 
					
						
							|  |  |  | 	int micbias[2]; | 
					
						
							| 
									
										
										
										
											2011-08-22 15:43:55 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-30 10:55:14 +00:00
										 |  |  | 	/* WM8958 microphone detection ranges */ | 
					
						
							|  |  |  | 	u16 micd_lvl_sel; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-22 15:43:55 +02:00
										 |  |  | 	/* Disable the internal pull downs on the LDOs if they are
 | 
					
						
							|  |  |  | 	 * always driven (eg, connected to an always on supply or | 
					
						
							|  |  |  | 	 * GPIO that always drives an output.  If they float power | 
					
						
							|  |  |  | 	 * consumption will rise. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	bool ldo_ena_always_driven; | 
					
						
							| 
									
										
										
										
											2011-11-03 13:20:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * SPKMODE must be pulled internally by the device on this | 
					
						
							|  |  |  | 	 * system. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	bool spkmode_pu; | 
					
						
							| 
									
										
										
										
											2013-03-20 10:12:10 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Maximum number of channels clocks will be generated for, | 
					
						
							|  |  |  | 	 * useful for systems where and I2S bus with multiple data | 
					
						
							|  |  |  | 	 * lines is mastered. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	int max_channels_clocked[WM8994_NUM_AIF]; | 
					
						
							| 
									
										
										
										
											2013-05-06 16:12:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * GPIO for the IRQ pin if host only supports edge triggering | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	int irq_gpio; | 
					
						
							| 
									
										
										
										
											2010-01-29 18:20:29 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |