aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 09:43:54 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 10:06:11 -0400
commit7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch)
tree5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /include/linux/mfd
parent7d754596756240fa918b94cd0c3011c77a638987 (diff)
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
Merge 'Linux v3.0' into Litmus
Some notes: * Litmus^RT scheduling class is the topmost scheduling class (above stop_sched_class). * scheduler_ipi() function (e.g., in smp_reschedule_interrupt()) may increase IPI latencies. * Added path into schedule() to quickly re-evaluate scheduling decision without becoming preemptive again. This used to be a standard path before the removal of BKL. Conflicts: Makefile arch/arm/kernel/calls.S arch/arm/kernel/smp.c arch/x86/include/asm/unistd_32.h arch/x86/kernel/smp.c arch/x86/kernel/syscall_table_32.S include/linux/hrtimer.h kernel/printk.c kernel/sched.c kernel/sched_fair.c
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/88pm860x.h28
-rw-r--r--include/linux/mfd/ab8500.h137
-rw-r--r--include/linux/mfd/ab8500/gpadc.h32
-rw-r--r--include/linux/mfd/ab8500/gpio.h21
-rw-r--r--include/linux/mfd/ab8500/sysctrl.h254
-rw-r--r--include/linux/mfd/abx500.h11
-rw-r--r--include/linux/mfd/asic3.h23
-rw-r--r--include/linux/mfd/core.h62
-rw-r--r--include/linux/mfd/db5500-prcmu.h45
-rw-r--r--include/linux/mfd/db8500-prcmu.h978
-rw-r--r--include/linux/mfd/ds1wm.h7
-rw-r--r--include/linux/mfd/max8997-private.h364
-rw-r--r--include/linux/mfd/max8997.h117
-rw-r--r--include/linux/mfd/max8998-private.h131
-rw-r--r--include/linux/mfd/max8998.h42
-rw-r--r--include/linux/mfd/mc13783.h308
-rw-r--r--include/linux/mfd/mc13892.h39
-rw-r--r--include/linux/mfd/mc13xxx.h153
-rw-r--r--include/linux/mfd/pcf50633/core.h7
-rw-r--r--include/linux/mfd/pm8xxx/core.h81
-rw-r--r--include/linux/mfd/pm8xxx/irq.h59
-rw-r--r--include/linux/mfd/pm8xxx/pm8921.h31
-rw-r--r--include/linux/mfd/sh_mobile_sdhi.h14
-rw-r--r--include/linux/mfd/stmpe.h6
-rw-r--r--include/linux/mfd/tc35892.h132
-rw-r--r--include/linux/mfd/tc3589x.h195
-rw-r--r--include/linux/mfd/ti_ssp.h93
-rw-r--r--include/linux/mfd/tmio.h28
-rw-r--r--include/linux/mfd/tps6105x.h101
-rw-r--r--include/linux/mfd/tps6586x.h31
-rw-r--r--include/linux/mfd/tps65910.h800
-rw-r--r--include/linux/mfd/twl4030-codec.h2
-rw-r--r--include/linux/mfd/wl1273-core.h290
-rw-r--r--include/linux/mfd/wm831x/core.h39
-rw-r--r--include/linux/mfd/wm831x/pdata.h15
-rw-r--r--include/linux/mfd/wm8350/audio.h3
-rw-r--r--include/linux/mfd/wm8350/pmic.h2
-rw-r--r--include/linux/mfd/wm8994/core.h13
-rw-r--r--include/linux/mfd/wm8994/pdata.h80
-rw-r--r--include/linux/mfd/wm8994/registers.h304
40 files changed, 4631 insertions, 447 deletions
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index bfd23bef7363..63b4fb8e3b6f 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -131,14 +131,16 @@ enum {
131 PM8607_ID_LDO8, 131 PM8607_ID_LDO8,
132 PM8607_ID_LDO9, 132 PM8607_ID_LDO9,
133 PM8607_ID_LDO10, 133 PM8607_ID_LDO10,
134 PM8607_ID_LDO11,
134 PM8607_ID_LDO12, 135 PM8607_ID_LDO12,
135 PM8607_ID_LDO13, 136 PM8607_ID_LDO13,
136 PM8607_ID_LDO14, 137 PM8607_ID_LDO14,
138 PM8607_ID_LDO15,
137 139
138 PM8607_ID_RG_MAX, 140 PM8607_ID_RG_MAX,
139}; 141};
140 142
141#define PM8607_VERSION (0x40) /* 8607 chip ID */ 143/* 8607 chip ID is 0x40 or 0x50 */
142#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */ 144#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */
143 145
144/* Interrupt Registers */ 146/* Interrupt Registers */
@@ -310,8 +312,6 @@ struct pm860x_chip {
310 312
311}; 313};
312 314
313#define PM8607_MAX_REGULATOR PM8607_ID_RG_MAX /* 3 Bucks, 13 LDOs */
314
315enum { 315enum {
316 GI2C_PORT = 0, 316 GI2C_PORT = 0,
317 PI2C_PORT, 317 PI2C_PORT,
@@ -330,6 +330,11 @@ struct pm860x_led_pdata {
330 unsigned long flags; 330 unsigned long flags;
331}; 331};
332 332
333struct pm860x_rtc_pdata {
334 int (*sync)(unsigned int ticks);
335 int vrtc;
336};
337
333struct pm860x_touch_pdata { 338struct pm860x_touch_pdata {
334 int gpadc_prebias; 339 int gpadc_prebias;
335 int slot_cycle; 340 int slot_cycle;
@@ -349,25 +354,34 @@ struct pm860x_power_pdata {
349struct pm860x_platform_data { 354struct pm860x_platform_data {
350 struct pm860x_backlight_pdata *backlight; 355 struct pm860x_backlight_pdata *backlight;
351 struct pm860x_led_pdata *led; 356 struct pm860x_led_pdata *led;
357 struct pm860x_rtc_pdata *rtc;
352 struct pm860x_touch_pdata *touch; 358 struct pm860x_touch_pdata *touch;
353 struct pm860x_power_pdata *power; 359 struct pm860x_power_pdata *power;
360 struct regulator_init_data *regulator;
354 361
355 unsigned short companion_addr; /* I2C address of companion chip */ 362 unsigned short companion_addr; /* I2C address of companion chip */
356 int i2c_port; /* Controlled by GI2C or PI2C */ 363 int i2c_port; /* Controlled by GI2C or PI2C */
357 int irq_mode; /* Clear interrupt by read/write(0/1) */ 364 int irq_mode; /* Clear interrupt by read/write(0/1) */
358 int irq_base; /* IRQ base number of 88pm860x */ 365 int irq_base; /* IRQ base number of 88pm860x */
359 struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; 366 int num_leds;
367 int num_backlights;
368 int num_regulators;
360}; 369};
361 370
362extern char pm860x_backlight_name[][MFD_NAME_SIZE];
363extern char pm860x_led_name[][MFD_NAME_SIZE];
364
365extern int pm860x_reg_read(struct i2c_client *, int); 371extern int pm860x_reg_read(struct i2c_client *, int);
366extern int pm860x_reg_write(struct i2c_client *, int, unsigned char); 372extern int pm860x_reg_write(struct i2c_client *, int, unsigned char);
367extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *); 373extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *);
368extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *); 374extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *);
369extern int pm860x_set_bits(struct i2c_client *, int, unsigned char, 375extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
370 unsigned char); 376 unsigned char);
377extern int pm860x_page_reg_read(struct i2c_client *, int);
378extern int pm860x_page_reg_write(struct i2c_client *, int, unsigned char);
379extern int pm860x_page_bulk_read(struct i2c_client *, int, int,
380 unsigned char *);
381extern int pm860x_page_bulk_write(struct i2c_client *, int, int,
382 unsigned char *);
383extern int pm860x_page_set_bits(struct i2c_client *, int, unsigned char,
384 unsigned char);
371 385
372extern int pm860x_device_init(struct pm860x_chip *chip, 386extern int pm860x_device_init(struct pm860x_chip *chip,
373 struct pm860x_platform_data *pdata) __devinit ; 387 struct pm860x_platform_data *pdata) __devinit ;
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
index f5cec4500f38..b31843075198 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/ab8500.h
@@ -10,6 +10,29 @@
10#include <linux/device.h> 10#include <linux/device.h>
11 11
12/* 12/*
13 * AB8500 bank addresses
14 */
15#define AB8500_SYS_CTRL1_BLOCK 0x1
16#define AB8500_SYS_CTRL2_BLOCK 0x2
17#define AB8500_REGU_CTRL1 0x3
18#define AB8500_REGU_CTRL2 0x4
19#define AB8500_USB 0x5
20#define AB8500_TVOUT 0x6
21#define AB8500_DBI 0x7
22#define AB8500_ECI_AV_ACC 0x8
23#define AB8500_RESERVED 0x9
24#define AB8500_GPADC 0xA
25#define AB8500_CHARGER 0xB
26#define AB8500_GAS_GAUGE 0xC
27#define AB8500_AUDIO 0xD
28#define AB8500_INTERRUPT 0xE
29#define AB8500_RTC 0xF
30#define AB8500_MISC 0x10
31#define AB8500_DEBUG 0x12
32#define AB8500_PROD_TEST 0x13
33#define AB8500_OTP_EMUL 0x15
34
35/*
13 * Interrupts 36 * Interrupts
14 */ 37 */
15 38
@@ -51,40 +74,84 @@
51#define AB8500_INT_ACC_DETECT_21DB_F 37 74#define AB8500_INT_ACC_DETECT_21DB_F 37
52#define AB8500_INT_ACC_DETECT_21DB_R 38 75#define AB8500_INT_ACC_DETECT_21DB_R 38
53#define AB8500_INT_GP_SW_ADC_CONV_END 39 76#define AB8500_INT_GP_SW_ADC_CONV_END 39
54#define AB8500_INT_BTEMP_LOW 72 77#define AB8500_INT_ACC_DETECT_1DB_F 33
55#define AB8500_INT_BTEMP_LOW_MEDIUM 73 78#define AB8500_INT_ACC_DETECT_1DB_R 34
56#define AB8500_INT_BTEMP_MEDIUM_HIGH 74 79#define AB8500_INT_ACC_DETECT_22DB_F 35
57#define AB8500_INT_BTEMP_HIGH 75 80#define AB8500_INT_ACC_DETECT_22DB_R 36
58#define AB8500_INT_USB_CHARGER_NOT_OK 81 81#define AB8500_INT_ACC_DETECT_21DB_F 37
59#define AB8500_INT_ID_WAKEUP_R 82 82#define AB8500_INT_ACC_DETECT_21DB_R 38
60#define AB8500_INT_ID_DET_R1R 84 83#define AB8500_INT_GP_SW_ADC_CONV_END 39
61#define AB8500_INT_ID_DET_R2R 85 84#define AB8500_INT_GPIO6R 40
62#define AB8500_INT_ID_DET_R3R 86 85#define AB8500_INT_GPIO7R 41
63#define AB8500_INT_ID_DET_R4R 87 86#define AB8500_INT_GPIO8R 42
64#define AB8500_INT_ID_WAKEUP_F 88 87#define AB8500_INT_GPIO9R 43
65#define AB8500_INT_ID_DET_R1F 90 88#define AB8500_INT_GPIO10R 44
66#define AB8500_INT_ID_DET_R2F 91 89#define AB8500_INT_GPIO11R 45
67#define AB8500_INT_ID_DET_R3F 92 90#define AB8500_INT_GPIO12R 46
68#define AB8500_INT_ID_DET_R4F 93 91#define AB8500_INT_GPIO13R 47
69#define AB8500_INT_USB_CHG_DET_DONE 94 92#define AB8500_INT_GPIO24R 48
70#define AB8500_INT_USB_CH_TH_PROT_F 96 93#define AB8500_INT_GPIO25R 49
71#define AB8500_INT_USB_CH_TH_PROP_R 97 94#define AB8500_INT_GPIO36R 50
72#define AB8500_INT_MAIN_CH_TH_PROP_F 98 95#define AB8500_INT_GPIO37R 51
73#define AB8500_INT_MAIN_CH_TH_PROT_R 99 96#define AB8500_INT_GPIO38R 52
74#define AB8500_INT_USB_CHARGER_NOT_OKF 103 97#define AB8500_INT_GPIO39R 53
75 98#define AB8500_INT_GPIO40R 54
76#define AB8500_NR_IRQS 104 99#define AB8500_INT_GPIO41R 55
77#define AB8500_NUM_IRQ_REGS 13 100#define AB8500_INT_GPIO6F 56
101#define AB8500_INT_GPIO7F 57
102#define AB8500_INT_GPIO8F 58
103#define AB8500_INT_GPIO9F 59
104#define AB8500_INT_GPIO10F 60
105#define AB8500_INT_GPIO11F 61
106#define AB8500_INT_GPIO12F 62
107#define AB8500_INT_GPIO13F 63
108#define AB8500_INT_GPIO24F 64
109#define AB8500_INT_GPIO25F 65
110#define AB8500_INT_GPIO36F 66
111#define AB8500_INT_GPIO37F 67
112#define AB8500_INT_GPIO38F 68
113#define AB8500_INT_GPIO39F 69
114#define AB8500_INT_GPIO40F 70
115#define AB8500_INT_GPIO41F 71
116#define AB8500_INT_ADP_SOURCE_ERROR 72
117#define AB8500_INT_ADP_SINK_ERROR 73
118#define AB8500_INT_ADP_PROBE_PLUG 74
119#define AB8500_INT_ADP_PROBE_UNPLUG 75
120#define AB8500_INT_ADP_SENSE_OFF 76
121#define AB8500_INT_USB_PHY_POWER_ERR 78
122#define AB8500_INT_USB_LINK_STATUS 79
123#define AB8500_INT_BTEMP_LOW 80
124#define AB8500_INT_BTEMP_LOW_MEDIUM 81
125#define AB8500_INT_BTEMP_MEDIUM_HIGH 82
126#define AB8500_INT_BTEMP_HIGH 83
127#define AB8500_INT_USB_CHARGER_NOT_OK 89
128#define AB8500_INT_ID_WAKEUP_R 90
129#define AB8500_INT_ID_DET_R1R 92
130#define AB8500_INT_ID_DET_R2R 93
131#define AB8500_INT_ID_DET_R3R 94
132#define AB8500_INT_ID_DET_R4R 95
133#define AB8500_INT_ID_WAKEUP_F 96
134#define AB8500_INT_ID_DET_R1F 98
135#define AB8500_INT_ID_DET_R2F 99
136#define AB8500_INT_ID_DET_R3F 100
137#define AB8500_INT_ID_DET_R4F 101
138#define AB8500_INT_USB_CHG_DET_DONE 102
139#define AB8500_INT_USB_CH_TH_PROT_F 104
140#define AB8500_INT_USB_CH_TH_PROT_R 105
141#define AB8500_INT_MAIN_CH_TH_PROT_F 106
142#define AB8500_INT_MAIN_CH_TH_PROT_R 107
143#define AB8500_INT_USB_CHARGER_NOT_OKF 111
78 144
79#define AB8500_NUM_REGULATORS 15 145#define AB8500_NR_IRQS 112
146#define AB8500_NUM_IRQ_REGS 14
80 147
81/** 148/**
82 * struct ab8500 - ab8500 internal structure 149 * struct ab8500 - ab8500 internal structure
83 * @dev: parent device 150 * @dev: parent device
84 * @lock: read/write operations lock 151 * @lock: read/write operations lock
85 * @irq_lock: genirq bus lock 152 * @irq_lock: genirq bus lock
86 * @revision: chip revision
87 * @irq: irq line 153 * @irq: irq line
154 * @chip_id: chip revision id
88 * @write: register write 155 * @write: register write
89 * @read: register read 156 * @read: register read
90 * @rx_buf: rx buf for SPI 157 * @rx_buf: rx buf for SPI
@@ -96,9 +163,10 @@ struct ab8500 {
96 struct device *dev; 163 struct device *dev;
97 struct mutex lock; 164 struct mutex lock;
98 struct mutex irq_lock; 165 struct mutex irq_lock;
99 int revision; 166
100 int irq_base; 167 int irq_base;
101 int irq; 168 int irq;
169 u8 chip_id;
102 170
103 int (*write) (struct ab8500 *a8500, u16 addr, u8 data); 171 int (*write) (struct ab8500 *a8500, u16 addr, u8 data);
104 int (*read) (struct ab8500 *a8500, u16 addr); 172 int (*read) (struct ab8500 *a8500, u16 addr);
@@ -110,24 +178,29 @@ struct ab8500 {
110 u8 oldmask[AB8500_NUM_IRQ_REGS]; 178 u8 oldmask[AB8500_NUM_IRQ_REGS];
111}; 179};
112 180
181struct regulator_reg_init;
113struct regulator_init_data; 182struct regulator_init_data;
183struct ab8500_gpio_platform_data;
114 184
115/** 185/**
116 * struct ab8500_platform_data - AB8500 platform data 186 * struct ab8500_platform_data - AB8500 platform data
117 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used 187 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used
118 * @init: board-specific initialization after detection of ab8500 188 * @init: board-specific initialization after detection of ab8500
189 * @num_regulator_reg_init: number of regulator init registers
190 * @regulator_reg_init: regulator init registers
191 * @num_regulator: number of regulators
119 * @regulator: machine-specific constraints for regulators 192 * @regulator: machine-specific constraints for regulators
120 */ 193 */
121struct ab8500_platform_data { 194struct ab8500_platform_data {
122 int irq_base; 195 int irq_base;
123 void (*init) (struct ab8500 *); 196 void (*init) (struct ab8500 *);
124 struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; 197 int num_regulator_reg_init;
198 struct ab8500_regulator_reg_init *regulator_reg_init;
199 int num_regulator;
200 struct regulator_init_data *regulator;
201 struct ab8500_gpio_platform_data *gpio;
125}; 202};
126 203
127extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data);
128extern int ab8500_read(struct ab8500 *a8500, u16 addr);
129extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data);
130
131extern int __devinit ab8500_init(struct ab8500 *ab8500); 204extern int __devinit ab8500_init(struct ab8500 *ab8500);
132extern int __devexit ab8500_exit(struct ab8500 *ab8500); 205extern int __devexit ab8500_exit(struct ab8500 *ab8500);
133 206
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/ab8500/gpadc.h
new file mode 100644
index 000000000000..46b954011f16
--- /dev/null
+++ b/include/linux/mfd/ab8500/gpadc.h
@@ -0,0 +1,32 @@
1/*
2 * Copyright (C) 2010 ST-Ericsson SA
3 * Licensed under GPLv2.
4 *
5 * Author: Arun R Murthy <arun.murthy@stericsson.com>
6 * Author: Daniel Willerud <daniel.willerud@stericsson.com>
7 */
8
9#ifndef _AB8500_GPADC_H
10#define _AB8500_GPADC_H
11
12/* GPADC source: From datasheet(ADCSwSel[4:0] in GPADCCtrl2) */
13#define BAT_CTRL 0x01
14#define BTEMP_BALL 0x02
15#define MAIN_CHARGER_V 0x03
16#define ACC_DETECT1 0x04
17#define ACC_DETECT2 0x05
18#define ADC_AUX1 0x06
19#define ADC_AUX2 0x07
20#define MAIN_BAT_V 0x08
21#define VBUS_V 0x09
22#define MAIN_CHARGER_C 0x0A
23#define USB_CHARGER_C 0x0B
24#define BK_BAT_V 0x0C
25#define DIE_TEMP 0x0D
26
27struct ab8500_gpadc;
28
29struct ab8500_gpadc *ab8500_gpadc_get(char *name);
30int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input);
31
32#endif /* _AB8500_GPADC_H */
diff --git a/include/linux/mfd/ab8500/gpio.h b/include/linux/mfd/ab8500/gpio.h
new file mode 100644
index 000000000000..488a8c920a29
--- /dev/null
+++ b/include/linux/mfd/ab8500/gpio.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright ST-Ericsson 2010.
3 *
4 * Author: Bibek Basu <bibek.basu@stericsson.com>
5 * Licensed under GPLv2.
6 */
7
8#ifndef _AB8500_GPIO_H
9#define _AB8500_GPIO_H
10
11/*
12 * Platform data to register a block: only the initial gpio/irq number.
13 */
14
15struct ab8500_gpio_platform_data {
16 int gpio_base;
17 u32 irq_base;
18 u8 config_reg[7];
19};
20
21#endif /* _AB8500_GPIO_H */
diff --git a/include/linux/mfd/ab8500/sysctrl.h b/include/linux/mfd/ab8500/sysctrl.h
new file mode 100644
index 000000000000..10da0291f8f8
--- /dev/null
+++ b/include/linux/mfd/ab8500/sysctrl.h
@@ -0,0 +1,254 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> for ST Ericsson.
4 * License terms: GNU General Public License (GPL) version 2
5 */
6#ifndef __AB8500_SYSCTRL_H
7#define __AB8500_SYSCTRL_H
8
9#include <linux/bitops.h>
10
11#ifdef CONFIG_AB8500_CORE
12
13int ab8500_sysctrl_read(u16 reg, u8 *value);
14int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value);
15
16#else
17
18static inline int ab8500_sysctrl_read(u16 reg, u8 *value)
19{
20 return 0;
21}
22
23static inline int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value)
24{
25 return 0;
26}
27
28#endif /* CONFIG_AB8500_CORE */
29
30static inline int ab8500_sysctrl_set(u16 reg, u8 bits)
31{
32 return ab8500_sysctrl_write(reg, bits, bits);
33}
34
35static inline int ab8500_sysctrl_clear(u16 reg, u8 bits)
36{
37 return ab8500_sysctrl_write(reg, bits, 0);
38}
39
40/* Registers */
41#define AB8500_TURNONSTATUS 0x100
42#define AB8500_RESETSTATUS 0x101
43#define AB8500_PONKEY1PRESSSTATUS 0x102
44#define AB8500_SYSCLKREQSTATUS 0x142
45#define AB8500_STW4500CTRL1 0x180
46#define AB8500_STW4500CTRL2 0x181
47#define AB8500_STW4500CTRL3 0x200
48#define AB8500_MAINWDOGCTRL 0x201
49#define AB8500_MAINWDOGTIMER 0x202
50#define AB8500_LOWBAT 0x203
51#define AB8500_BATTOK 0x204
52#define AB8500_SYSCLKTIMER 0x205
53#define AB8500_SMPSCLKCTRL 0x206
54#define AB8500_SMPSCLKSEL1 0x207
55#define AB8500_SMPSCLKSEL2 0x208
56#define AB8500_SMPSCLKSEL3 0x209
57#define AB8500_SYSULPCLKCONF 0x20A
58#define AB8500_SYSULPCLKCTRL1 0x20B
59#define AB8500_SYSCLKCTRL 0x20C
60#define AB8500_SYSCLKREQ1VALID 0x20D
61#define AB8500_SYSTEMCTRLSUP 0x20F
62#define AB8500_SYSCLKREQ1RFCLKBUF 0x210
63#define AB8500_SYSCLKREQ2RFCLKBUF 0x211
64#define AB8500_SYSCLKREQ3RFCLKBUF 0x212
65#define AB8500_SYSCLKREQ4RFCLKBUF 0x213
66#define AB8500_SYSCLKREQ5RFCLKBUF 0x214
67#define AB8500_SYSCLKREQ6RFCLKBUF 0x215
68#define AB8500_SYSCLKREQ7RFCLKBUF 0x216
69#define AB8500_SYSCLKREQ8RFCLKBUF 0x217
70#define AB8500_DITHERCLKCTRL 0x220
71#define AB8500_SWATCTRL 0x230
72#define AB8500_HIQCLKCTRL 0x232
73#define AB8500_VSIMSYSCLKCTRL 0x233
74
75/* Bits */
76#define AB8500_TURNONSTATUS_PORNVBAT BIT(0)
77#define AB8500_TURNONSTATUS_PONKEY1DBF BIT(1)
78#define AB8500_TURNONSTATUS_PONKEY2DBF BIT(2)
79#define AB8500_TURNONSTATUS_RTCALARM BIT(3)
80#define AB8500_TURNONSTATUS_MAINCHDET BIT(4)
81#define AB8500_TURNONSTATUS_VBUSDET BIT(5)
82#define AB8500_TURNONSTATUS_USBIDDETECT BIT(6)
83
84#define AB8500_RESETSTATUS_RESETN4500NSTATUS BIT(0)
85#define AB8500_RESETSTATUS_SWRESETN4500NSTATUS BIT(2)
86
87#define AB8500_PONKEY1PRESSSTATUS_PONKEY1PRESSTIME_MASK 0x7F
88#define AB8500_PONKEY1PRESSSTATUS_PONKEY1PRESSTIME_SHIFT 0
89
90#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ1STATUS BIT(0)
91#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ2STATUS BIT(1)
92#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ3STATUS BIT(2)
93#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ4STATUS BIT(3)
94#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ5STATUS BIT(4)
95#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ6STATUS BIT(5)
96#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ7STATUS BIT(6)
97#define AB8500_SYSCLKREQSTATUS_SYSCLKREQ8STATUS BIT(7)
98
99#define AB8500_STW4500CTRL1_SWOFF BIT(0)
100#define AB8500_STW4500CTRL1_SWRESET4500N BIT(1)
101#define AB8500_STW4500CTRL1_THDB8500SWOFF BIT(2)
102
103#define AB8500_STW4500CTRL2_RESETNVAUX1VALID BIT(0)
104#define AB8500_STW4500CTRL2_RESETNVAUX2VALID BIT(1)
105#define AB8500_STW4500CTRL2_RESETNVAUX3VALID BIT(2)
106#define AB8500_STW4500CTRL2_RESETNVMODVALID BIT(3)
107#define AB8500_STW4500CTRL2_RESETNVEXTSUPPLY1VALID BIT(4)
108#define AB8500_STW4500CTRL2_RESETNVEXTSUPPLY2VALID BIT(5)
109#define AB8500_STW4500CTRL2_RESETNVEXTSUPPLY3VALID BIT(6)
110#define AB8500_STW4500CTRL2_RESETNVSMPS1VALID BIT(7)
111
112#define AB8500_STW4500CTRL3_CLK32KOUT2DIS BIT(0)
113#define AB8500_STW4500CTRL3_RESETAUDN BIT(1)
114#define AB8500_STW4500CTRL3_RESETDENCN BIT(2)
115#define AB8500_STW4500CTRL3_THSDENA BIT(3)
116
117#define AB8500_MAINWDOGCTRL_MAINWDOGENA BIT(0)
118#define AB8500_MAINWDOGCTRL_MAINWDOGKICK BIT(1)
119#define AB8500_MAINWDOGCTRL_WDEXPTURNONVALID BIT(4)
120
121#define AB8500_MAINWDOGTIMER_MAINWDOGTIMER_MASK 0x7F
122#define AB8500_MAINWDOGTIMER_MAINWDOGTIMER_SHIFT 0
123
124#define AB8500_LOWBAT_LOWBATENA BIT(0)
125#define AB8500_LOWBAT_LOWBAT_MASK 0x7E
126#define AB8500_LOWBAT_LOWBAT_SHIFT 1
127
128#define AB8500_BATTOK_BATTOKSEL0THF_MASK 0x0F
129#define AB8500_BATTOK_BATTOKSEL0THF_SHIFT 0
130#define AB8500_BATTOK_BATTOKSEL1THF_MASK 0xF0
131#define AB8500_BATTOK_BATTOKSEL1THF_SHIFT 4
132
133#define AB8500_SYSCLKTIMER_SYSCLKTIMER_MASK 0x0F
134#define AB8500_SYSCLKTIMER_SYSCLKTIMER_SHIFT 0
135#define AB8500_SYSCLKTIMER_SYSCLKTIMERADJ_MASK 0xF0
136#define AB8500_SYSCLKTIMER_SYSCLKTIMERADJ_SHIFT 4
137
138#define AB8500_SMPSCLKCTRL_SMPSCLKINTSEL_MASK 0x03
139#define AB8500_SMPSCLKCTRL_SMPSCLKINTSEL_SHIFT 0
140#define AB8500_SMPSCLKCTRL_3M2CLKINTENA BIT(2)
141
142#define AB8500_SMPSCLKSEL1_VARMCLKSEL_MASK 0x07
143#define AB8500_SMPSCLKSEL1_VARMCLKSEL_SHIFT 0
144#define AB8500_SMPSCLKSEL1_VAPECLKSEL_MASK 0x38
145#define AB8500_SMPSCLKSEL1_VAPECLKSEL_SHIFT 3
146
147#define AB8500_SMPSCLKSEL2_VMODCLKSEL_MASK 0x07
148#define AB8500_SMPSCLKSEL2_VMODCLKSEL_SHIFT 0
149#define AB8500_SMPSCLKSEL2_VSMPS1CLKSEL_MASK 0x38
150#define AB8500_SMPSCLKSEL2_VSMPS1CLKSEL_SHIFT 3
151
152#define AB8500_SMPSCLKSEL3_VSMPS2CLKSEL_MASK 0x07
153#define AB8500_SMPSCLKSEL3_VSMPS2CLKSEL_SHIFT 0
154#define AB8500_SMPSCLKSEL3_VSMPS3CLKSEL_MASK 0x38
155#define AB8500_SMPSCLKSEL3_VSMPS3CLKSEL_SHIFT 3
156
157#define AB8500_SYSULPCLKCONF_ULPCLKCONF_MASK 0x03
158#define AB8500_SYSULPCLKCONF_ULPCLKCONF_SHIFT 0
159#define AB8500_SYSULPCLKCONF_CLK27MHZSTRE BIT(2)
160#define AB8500_SYSULPCLKCONF_TVOUTCLKDELN BIT(3)
161#define AB8500_SYSULPCLKCONF_TVOUTCLKINV BIT(4)
162#define AB8500_SYSULPCLKCONF_ULPCLKSTRE BIT(5)
163#define AB8500_SYSULPCLKCONF_CLK27MHZBUFENA BIT(6)
164#define AB8500_SYSULPCLKCONF_CLK27MHZPDENA BIT(7)
165
166#define AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK 0x03
167#define AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT 0
168#define AB8500_SYSULPCLKCTRL1_ULPCLKREQ BIT(2)
169#define AB8500_SYSULPCLKCTRL1_4500SYSCLKREQ BIT(3)
170#define AB8500_SYSULPCLKCTRL1_AUDIOCLKENA BIT(4)
171#define AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ BIT(5)
172#define AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ BIT(6)
173#define AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ BIT(7)
174
175#define AB8500_SYSCLKCTRL_TVOUTPLLENA BIT(0)
176#define AB8500_SYSCLKCTRL_TVOUTCLKENA BIT(1)
177#define AB8500_SYSCLKCTRL_USBCLKENA BIT(2)
178
179#define AB8500_SYSCLKREQ1VALID_SYSCLKREQ1VALID BIT(0)
180#define AB8500_SYSCLKREQ1VALID_ULPCLKREQ1VALID BIT(1)
181#define AB8500_SYSCLKREQ1VALID_USBSYSCLKREQ1VALID BIT(2)
182
183#define AB8500_SYSTEMCTRLSUP_EXTSUP12LPNCLKSEL_MASK 0x03
184#define AB8500_SYSTEMCTRLSUP_EXTSUP12LPNCLKSEL_SHIFT 0
185#define AB8500_SYSTEMCTRLSUP_EXTSUP3LPNCLKSEL_MASK 0x0C
186#define AB8500_SYSTEMCTRLSUP_EXTSUP3LPNCLKSEL_SHIFT 2
187#define AB8500_SYSTEMCTRLSUP_INTDB8500NOD BIT(4)
188
189#define AB8500_SYSCLKREQ1RFCLKBUF_SYSCLKREQ1RFCLKBUF2 BIT(2)
190#define AB8500_SYSCLKREQ1RFCLKBUF_SYSCLKREQ1RFCLKBUF3 BIT(3)
191#define AB8500_SYSCLKREQ1RFCLKBUF_SYSCLKREQ1RFCLKBUF4 BIT(4)
192
193#define AB8500_SYSCLKREQ2RFCLKBUF_SYSCLKREQ2RFCLKBUF2 BIT(2)
194#define AB8500_SYSCLKREQ2RFCLKBUF_SYSCLKREQ2RFCLKBUF3 BIT(3)
195#define AB8500_SYSCLKREQ2RFCLKBUF_SYSCLKREQ2RFCLKBUF4 BIT(4)
196
197#define AB8500_SYSCLKREQ3RFCLKBUF_SYSCLKREQ3RFCLKBUF2 BIT(2)
198#define AB8500_SYSCLKREQ3RFCLKBUF_SYSCLKREQ3RFCLKBUF3 BIT(3)
199#define AB8500_SYSCLKREQ3RFCLKBUF_SYSCLKREQ3RFCLKBUF4 BIT(4)
200
201#define AB8500_SYSCLKREQ4RFCLKBUF_SYSCLKREQ4RFCLKBUF2 BIT(2)
202#define AB8500_SYSCLKREQ4RFCLKBUF_SYSCLKREQ4RFCLKBUF3 BIT(3)
203#define AB8500_SYSCLKREQ4RFCLKBUF_SYSCLKREQ4RFCLKBUF4 BIT(4)
204
205#define AB8500_SYSCLKREQ5RFCLKBUF_SYSCLKREQ5RFCLKBUF2 BIT(2)
206#define AB8500_SYSCLKREQ5RFCLKBUF_SYSCLKREQ5RFCLKBUF3 BIT(3)
207#define AB8500_SYSCLKREQ5RFCLKBUF_SYSCLKREQ5RFCLKBUF4 BIT(4)
208
209#define AB8500_SYSCLKREQ6RFCLKBUF_SYSCLKREQ6RFCLKBUF2 BIT(2)
210#define AB8500_SYSCLKREQ6RFCLKBUF_SYSCLKREQ6RFCLKBUF3 BIT(3)
211#define AB8500_SYSCLKREQ6RFCLKBUF_SYSCLKREQ6RFCLKBUF4 BIT(4)
212
213#define AB8500_SYSCLKREQ7RFCLKBUF_SYSCLKREQ7RFCLKBUF2 BIT(2)
214#define AB8500_SYSCLKREQ7RFCLKBUF_SYSCLKREQ7RFCLKBUF3 BIT(3)
215#define AB8500_SYSCLKREQ7RFCLKBUF_SYSCLKREQ7RFCLKBUF4 BIT(4)
216
217#define AB8500_SYSCLKREQ8RFCLKBUF_SYSCLKREQ8RFCLKBUF2 BIT(2)
218#define AB8500_SYSCLKREQ8RFCLKBUF_SYSCLKREQ8RFCLKBUF3 BIT(3)
219#define AB8500_SYSCLKREQ8RFCLKBUF_SYSCLKREQ8RFCLKBUF4 BIT(4)
220
221#define AB8500_DITHERCLKCTRL_VARMDITHERENA BIT(0)
222#define AB8500_DITHERCLKCTRL_VSMPS3DITHERENA BIT(1)
223#define AB8500_DITHERCLKCTRL_VSMPS1DITHERENA BIT(2)
224#define AB8500_DITHERCLKCTRL_VSMPS2DITHERENA BIT(3)
225#define AB8500_DITHERCLKCTRL_VMODDITHERENA BIT(4)
226#define AB8500_DITHERCLKCTRL_VAPEDITHERENA BIT(5)
227#define AB8500_DITHERCLKCTRL_DITHERDEL_MASK 0xC0
228#define AB8500_DITHERCLKCTRL_DITHERDEL_SHIFT 6
229
230#define AB8500_SWATCTRL_UPDATERF BIT(0)
231#define AB8500_SWATCTRL_SWATENABLE BIT(1)
232#define AB8500_SWATCTRL_RFOFFTIMER_MASK 0x1C
233#define AB8500_SWATCTRL_RFOFFTIMER_SHIFT 2
234#define AB8500_SWATCTRL_SWATBIT5 BIT(6)
235
236#define AB8500_HIQCLKCTRL_SYSCLKREQ1HIQENAVALID BIT(0)
237#define AB8500_HIQCLKCTRL_SYSCLKREQ2HIQENAVALID BIT(1)
238#define AB8500_HIQCLKCTRL_SYSCLKREQ3HIQENAVALID BIT(2)
239#define AB8500_HIQCLKCTRL_SYSCLKREQ4HIQENAVALID BIT(3)
240#define AB8500_HIQCLKCTRL_SYSCLKREQ5HIQENAVALID BIT(4)
241#define AB8500_HIQCLKCTRL_SYSCLKREQ6HIQENAVALID BIT(5)
242#define AB8500_HIQCLKCTRL_SYSCLKREQ7HIQENAVALID BIT(6)
243#define AB8500_HIQCLKCTRL_SYSCLKREQ8HIQENAVALID BIT(7)
244
245#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ1VALID BIT(0)
246#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ2VALID BIT(1)
247#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ3VALID BIT(2)
248#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ4VALID BIT(3)
249#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ5VALID BIT(4)
250#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ6VALID BIT(5)
251#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ7VALID BIT(6)
252#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ8VALID BIT(7)
253
254#endif /* __AB8500_SYSCTRL_H */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 390726fcbcb1..896b5e47f16e 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -6,8 +6,7 @@
6 * 6 *
7 * ABX500 core access functions. 7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip 8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500 and possibly comming. It is not used for 9 * ab3100, ab3550, ab5500, and ab8500.
10 * ab4500 and ab8500 since they are another family of chip.
11 * 10 *
12 * Author: Mattias Wallin <mattias.wallin@stericsson.com> 11 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
13 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> 12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
@@ -35,6 +34,13 @@
35#define AB5500_2_0 0x21 34#define AB5500_2_0 0x21
36#define AB5500_2_1 0x22 35#define AB5500_2_1 0x22
37 36
37/* AB8500 CIDs*/
38#define AB8500_CUTEARLY 0x00
39#define AB8500_CUT1P0 0x10
40#define AB8500_CUT1P1 0x11
41#define AB8500_CUT2P0 0x20
42#define AB8500_CUT3P0 0x30
43
38/* 44/*
39 * AB3100, EVENTA1, A2 and A3 event register flags 45 * AB3100, EVENTA1, A2 and A3 event register flags
40 * these are catenated into a single 32-bit flag in the code 46 * these are catenated into a single 32-bit flag in the code
@@ -230,4 +236,5 @@ struct abx500_ops {
230}; 236};
231 237
232int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); 238int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
239void abx500_remove_ops(struct device *dev);
233#endif 240#endif
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h
index de3c4ad19afb..ed793b77a1c5 100644
--- a/include/linux/mfd/asic3.h
+++ b/include/linux/mfd/asic3.h
@@ -16,6 +16,13 @@
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19struct led_classdev;
20struct asic3_led {
21 const char *name;
22 const char *default_trigger;
23 struct led_classdev *cdev;
24};
25
19struct asic3_platform_data { 26struct asic3_platform_data {
20 u16 *gpio_config; 27 u16 *gpio_config;
21 unsigned int gpio_config_num; 28 unsigned int gpio_config_num;
@@ -23,6 +30,8 @@ struct asic3_platform_data {
23 unsigned int irq_base; 30 unsigned int irq_base;
24 31
25 unsigned int gpio_base; 32 unsigned int gpio_base;
33
34 struct asic3_led *leds;
26}; 35};
27 36
28#define ASIC3_NUM_GPIO_BANKS 4 37#define ASIC3_NUM_GPIO_BANKS 4
@@ -111,9 +120,9 @@ struct asic3_platform_data {
111#define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0) 120#define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0)
112#define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0) 121#define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0)
113#define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0) 122#define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0)
114#define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 1, 0) 123#define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 0, 0)
115#define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 1, 0) 124#define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 0, 0)
116#define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 1, 0) 125#define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 0, 0)
117#define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0) 126#define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0)
118#define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0) 127#define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0)
119#define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0) 128#define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0)
@@ -152,6 +161,7 @@ struct asic3_platform_data {
152#define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ 161#define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */
153#define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ 162#define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */
154 163
164#define ASIC3_NUM_LEDS 3
155#define ASIC3_LED_0_Base 0x0700 165#define ASIC3_LED_0_Base 0x0700
156#define ASIC3_LED_1_Base 0x0800 166#define ASIC3_LED_1_Base 0x0800
157#define ASIC3_LED_2_Base 0x0900 167#define ASIC3_LED_2_Base 0x0900
@@ -287,10 +297,17 @@ struct asic3_platform_data {
287 * 297 *
288 *****************************************************************************/ 298 *****************************************************************************/
289#define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ 299#define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */
300#define ASIC3_SD_CONFIG_SIZE 0x0200 /* Assumes 32 bit addressing */
290#define ASIC3_SD_CTRL_BASE 0x1000 301#define ASIC3_SD_CTRL_BASE 0x1000
291#define ASIC3_SDIO_CTRL_BASE 0x1200 302#define ASIC3_SDIO_CTRL_BASE 0x1200
292 303
293#define ASIC3_MAP_SIZE_32BIT 0x2000 304#define ASIC3_MAP_SIZE_32BIT 0x2000
294#define ASIC3_MAP_SIZE_16BIT 0x1000 305#define ASIC3_MAP_SIZE_16BIT 0x1000
295 306
307/* Functions needed by leds-asic3 */
308
309struct asic3;
310extern void asic3_write_register(struct asic3 *asic, unsigned int reg, u32 val);
311extern u32 asic3_read_register(struct asic3 *asic, unsigned int reg);
312
296#endif /* __ASIC3_H__ */ 313#endif /* __ASIC3_H__ */
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 11d740b8831d..4e76163dd862 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -25,29 +25,73 @@ struct mfd_cell {
25 const char *name; 25 const char *name;
26 int id; 26 int id;
27 27
28 /* refcounting for multiple drivers to use a single cell */
29 atomic_t *usage_count;
28 int (*enable)(struct platform_device *dev); 30 int (*enable)(struct platform_device *dev);
29 int (*disable)(struct platform_device *dev); 31 int (*disable)(struct platform_device *dev);
32
30 int (*suspend)(struct platform_device *dev); 33 int (*suspend)(struct platform_device *dev);
31 int (*resume)(struct platform_device *dev); 34 int (*resume)(struct platform_device *dev);
32 35
33 /* driver-specific data for MFD-aware "cell" drivers */ 36 /* platform data passed to the sub devices drivers */
34 void *driver_data;
35
36 /* platform_data can be used to either pass data to "generic"
37 driver or as a hook to mfd_cell for the "cell" drivers */
38 void *platform_data; 37 void *platform_data;
39 size_t data_size; 38 size_t pdata_size;
40 39
41 /* 40 /*
42 * This resources can be specified relatievly to the parent device. 41 * These resources can be specified relative to the parent device.
43 * For accessing device you should use resources from device 42 * For accessing hardware you should use resources from the platform dev
44 */ 43 */
45 int num_resources; 44 int num_resources;
46 const struct resource *resources; 45 const struct resource *resources;
46
47 /* don't check for resource conflicts */
48 bool ignore_resource_conflicts;
49
50 /*
51 * Disable runtime PM callbacks for this subdevice - see
52 * pm_runtime_no_callbacks().
53 */
54 bool pm_runtime_no_callbacks;
47}; 55};
48 56
57/*
58 * Convenience functions for clients using shared cells. Refcounting
59 * happens automatically, with the cell's enable/disable callbacks
60 * being called only when a device is first being enabled or no other
61 * clients are making use of it.
62 */
63extern int mfd_cell_enable(struct platform_device *pdev);
64extern int mfd_cell_disable(struct platform_device *pdev);
65
66/*
67 * "Clone" multiple platform devices for a single cell. This is to be used
68 * for devices that have multiple users of a cell. For example, if an mfd
69 * driver wants the cell "foo" to be used by a GPIO driver, an MTD driver,
70 * and a platform driver, the following bit of code would be use after first
71 * calling mfd_add_devices():
72 *
73 * const char *fclones[] = { "foo-gpio", "foo-mtd" };
74 * err = mfd_clone_cells("foo", fclones, ARRAY_SIZE(fclones));
75 *
76 * Each driver (MTD, GPIO, and platform driver) would then register
77 * platform_drivers for "foo-mtd", "foo-gpio", and "foo", respectively.
78 * The cell's .enable/.disable hooks should be used to deal with hardware
79 * resource contention.
80 */
81extern int mfd_clone_cell(const char *cell, const char **clones,
82 size_t n_clones);
83
84/*
85 * Given a platform device that's been created by mfd_add_devices(), fetch
86 * the mfd_cell that created it.
87 */
88static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
89{
90 return pdev->mfd_cell;
91}
92
49extern int mfd_add_devices(struct device *parent, int id, 93extern int mfd_add_devices(struct device *parent, int id,
50 const struct mfd_cell *cells, int n_devs, 94 struct mfd_cell *cells, int n_devs,
51 struct resource *mem_base, 95 struct resource *mem_base,
52 int irq_base); 96 int irq_base);
53 97
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h
new file mode 100644
index 000000000000..f0977986402c
--- /dev/null
+++ b/include/linux/mfd/db5500-prcmu.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 *
6 * U5500 PRCMU API.
7 */
8#ifndef __MACH_PRCMU_U5500_H
9#define __MACH_PRCMU_U5500_H
10
11#ifdef CONFIG_UX500_SOC_DB5500
12
13void db5500_prcmu_early_init(void);
14
15int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
16int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
17
18#else /* !CONFIG_UX500_SOC_DB5500 */
19
20static inline void db5500_prcmu_early_init(void)
21{
22}
23
24static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
25{
26 return -ENOSYS;
27}
28
29static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
30{
31 return -ENOSYS;
32}
33
34#endif /* CONFIG_UX500_SOC_DB5500 */
35
36static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events)
37{
38#ifdef CONFIG_MACH_U5500_SIMULATOR
39 return 0;
40#else
41 return -1;
42#endif
43}
44
45#endif /* __MACH_PRCMU_U5500_H */
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
new file mode 100644
index 000000000000..917dbcab701c
--- /dev/null
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -0,0 +1,978 @@
1/*
2 * Copyright (C) STMicroelectronics 2009
3 * Copyright (C) ST-Ericsson SA 2010
4 *
5 * License Terms: GNU General Public License v2
6 * Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
7 *
8 * PRCMU f/w APIs
9 */
10#ifndef __MFD_DB8500_PRCMU_H
11#define __MFD_DB8500_PRCMU_H
12
13#include <linux/interrupt.h>
14#include <linux/notifier.h>
15
16/* This portion previously known as <mach/prcmu-fw-defs_v1.h> */
17
18/**
19 * enum state - ON/OFF state definition
20 * @OFF: State is ON
21 * @ON: State is OFF
22 *
23 */
24enum state {
25 OFF = 0x0,
26 ON = 0x1,
27};
28
29/**
30 * enum ret_state - general purpose On/Off/Retention states
31 *
32 */
33enum ret_state {
34 OFFST = 0,
35 ONST = 1,
36 RETST = 2
37};
38
39/**
40 * enum clk_arm - ARM Cortex A9 clock schemes
41 * @A9_OFF:
42 * @A9_BOOT:
43 * @A9_OPPT1:
44 * @A9_OPPT2:
45 * @A9_EXTCLK:
46 */
47enum clk_arm {
48 A9_OFF,
49 A9_BOOT,
50 A9_OPPT1,
51 A9_OPPT2,
52 A9_EXTCLK
53};
54
55/**
56 * enum clk_gen - GEN#0/GEN#1 clock schemes
57 * @GEN_OFF:
58 * @GEN_BOOT:
59 * @GEN_OPPT1:
60 */
61enum clk_gen {
62 GEN_OFF,
63 GEN_BOOT,
64 GEN_OPPT1,
65};
66
67/* some information between arm and xp70 */
68
69/**
70 * enum romcode_write - Romcode message written by A9 AND read by XP70
71 * @RDY_2_DS: Value set when ApDeepSleep state can be executed by XP70
72 * @RDY_2_XP70_RST: Value set when 0x0F has been successfully polled by the
73 * romcode. The xp70 will go into self-reset
74 */
75enum romcode_write {
76 RDY_2_DS = 0x09,
77 RDY_2_XP70_RST = 0x10
78};
79
80/**
81 * enum romcode_read - Romcode message written by XP70 and read by A9
82 * @INIT: Init value when romcode field is not used
83 * @FS_2_DS: Value set when power state is going from ApExecute to
84 * ApDeepSleep
85 * @END_DS: Value set when ApDeepSleep power state is reached coming from
86 * ApExecute state
87 * @DS_TO_FS: Value set when power state is going from ApDeepSleep to
88 * ApExecute
89 * @END_FS: Value set when ApExecute power state is reached coming from
90 * ApDeepSleep state
91 * @SWR: Value set when power state is going to ApReset
92 * @END_SWR: Value set when the xp70 finished executing ApReset actions and
93 * waits for romcode acknowledgment to go to self-reset
94 */
95enum romcode_read {
96 INIT = 0x00,
97 FS_2_DS = 0x0A,
98 END_DS = 0x0B,
99 DS_TO_FS = 0x0C,
100 END_FS = 0x0D,
101 SWR = 0x0E,
102 END_SWR = 0x0F
103};
104
105/**
106 * enum ap_pwrst - current power states defined in PRCMU firmware
107 * @NO_PWRST: Current power state init
108 * @AP_BOOT: Current power state is apBoot
109 * @AP_EXECUTE: Current power state is apExecute
110 * @AP_DEEP_SLEEP: Current power state is apDeepSleep
111 * @AP_SLEEP: Current power state is apSleep
112 * @AP_IDLE: Current power state is apIdle
113 * @AP_RESET: Current power state is apReset
114 */
115enum ap_pwrst {
116 NO_PWRST = 0x00,
117 AP_BOOT = 0x01,
118 AP_EXECUTE = 0x02,
119 AP_DEEP_SLEEP = 0x03,
120 AP_SLEEP = 0x04,
121 AP_IDLE = 0x05,
122 AP_RESET = 0x06
123};
124
125/**
126 * enum ap_pwrst_trans - Transition states defined in PRCMU firmware
127 * @NO_TRANSITION: No power state transition
128 * @APEXECUTE_TO_APSLEEP: Power state transition from ApExecute to ApSleep
129 * @APIDLE_TO_APSLEEP: Power state transition from ApIdle to ApSleep
130 * @APBOOT_TO_APEXECUTE: Power state transition from ApBoot to ApExecute
131 * @APEXECUTE_TO_APDEEPSLEEP: Power state transition from ApExecute to
132 * ApDeepSleep
133 * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle
134 */
135enum ap_pwrst_trans {
136 NO_TRANSITION = 0x00,
137 APEXECUTE_TO_APSLEEP = 0x01,
138 APIDLE_TO_APSLEEP = 0x02, /* To be removed */
139 PRCMU_AP_SLEEP = 0x01,
140 APBOOT_TO_APEXECUTE = 0x03,
141 APEXECUTE_TO_APDEEPSLEEP = 0x04, /* To be removed */
142 PRCMU_AP_DEEP_SLEEP = 0x04,
143 APEXECUTE_TO_APIDLE = 0x05, /* To be removed */
144 PRCMU_AP_IDLE = 0x05,
145 PRCMU_AP_DEEP_IDLE = 0x07,
146};
147
148/**
149 * enum ddr_pwrst - DDR power states definition
150 * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
151 * @DDR_PWR_STATE_ON:
152 * @DDR_PWR_STATE_OFFLOWLAT:
153 * @DDR_PWR_STATE_OFFHIGHLAT:
154 */
155enum ddr_pwrst {
156 DDR_PWR_STATE_UNCHANGED = 0x00,
157 DDR_PWR_STATE_ON = 0x01,
158 DDR_PWR_STATE_OFFLOWLAT = 0x02,
159 DDR_PWR_STATE_OFFHIGHLAT = 0x03
160};
161
162/**
163 * enum arm_opp - ARM OPP states definition
164 * @ARM_OPP_INIT:
165 * @ARM_NO_CHANGE: The ARM operating point is unchanged
166 * @ARM_100_OPP: The new ARM operating point is arm100opp
167 * @ARM_50_OPP: The new ARM operating point is arm50opp
168 * @ARM_MAX_OPP: Operating point is "max" (more than 100)
169 * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
170 * @ARM_EXTCLK: The new ARM operating point is armExtClk
171 */
172enum arm_opp {
173 ARM_OPP_INIT = 0x00,
174 ARM_NO_CHANGE = 0x01,
175 ARM_100_OPP = 0x02,
176 ARM_50_OPP = 0x03,
177 ARM_MAX_OPP = 0x04,
178 ARM_MAX_FREQ100OPP = 0x05,
179 ARM_EXTCLK = 0x07
180};
181
182/**
183 * enum ape_opp - APE OPP states definition
184 * @APE_OPP_INIT:
185 * @APE_NO_CHANGE: The APE operating point is unchanged
186 * @APE_100_OPP: The new APE operating point is ape100opp
187 * @APE_50_OPP: 50%
188 */
189enum ape_opp {
190 APE_OPP_INIT = 0x00,
191 APE_NO_CHANGE = 0x01,
192 APE_100_OPP = 0x02,
193 APE_50_OPP = 0x03
194};
195
196/**
197 * enum hw_acc_state - State definition for hardware accelerator
198 * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged
199 * @HW_OFF: The hardware accelerator must be switched off
200 * @HW_OFF_RAMRET: The hardware accelerator must be switched off with its
201 * internal RAM in retention
202 * @HW_ON: The hwa hardware accelerator hwa must be switched on
203 *
204 * NOTE! Deprecated, to be removed when all users switched over to use the
205 * regulator API.
206 */
207enum hw_acc_state {
208 HW_NO_CHANGE = 0x00,
209 HW_OFF = 0x01,
210 HW_OFF_RAMRET = 0x02,
211 HW_ON = 0x04
212};
213
214/**
215 * enum mbox_2_arm_stat - Status messages definition for mbox_arm
216 * @BOOT_TO_EXECUTEOK: The apBoot to apExecute state transition has been
217 * completed
218 * @DEEPSLEEPOK: The apExecute to apDeepSleep state transition has been
219 * completed
220 * @SLEEPOK: The apExecute to apSleep state transition has been completed
221 * @IDLEOK: The apExecute to apIdle state transition has been completed
222 * @SOFTRESETOK: The A9 watchdog/ SoftReset state has been completed
223 * @SOFTRESETGO : The A9 watchdog/SoftReset state is on going
224 * @BOOT_TO_EXECUTE: The apBoot to apExecute state transition is on going
225 * @EXECUTE_TO_DEEPSLEEP: The apExecute to apDeepSleep state transition is on
226 * going
227 * @DEEPSLEEP_TO_EXECUTE: The apDeepSleep to apExecute state transition is on
228 * going
229 * @DEEPSLEEP_TO_EXECUTEOK: The apDeepSleep to apExecute state transition has
230 * been completed
231 * @EXECUTE_TO_SLEEP: The apExecute to apSleep state transition is on going
232 * @SLEEP_TO_EXECUTE: The apSleep to apExecute state transition is on going
233 * @SLEEP_TO_EXECUTEOK: The apSleep to apExecute state transition has been
234 * completed
235 * @EXECUTE_TO_IDLE: The apExecute to apIdle state transition is on going
236 * @IDLE_TO_EXECUTE: The apIdle to apExecute state transition is on going
237 * @IDLE_TO_EXECUTEOK: The apIdle to apExecute state transition has been
238 * completed
239 * @INIT_STATUS: Status init
240 */
241enum ap_pwrsttr_status {
242 BOOT_TO_EXECUTEOK = 0xFF,
243 DEEPSLEEPOK = 0xFE,
244 SLEEPOK = 0xFD,
245 IDLEOK = 0xFC,
246 SOFTRESETOK = 0xFB,
247 SOFTRESETGO = 0xFA,
248 BOOT_TO_EXECUTE = 0xF9,
249 EXECUTE_TO_DEEPSLEEP = 0xF8,
250 DEEPSLEEP_TO_EXECUTE = 0xF7,
251 DEEPSLEEP_TO_EXECUTEOK = 0xF6,
252 EXECUTE_TO_SLEEP = 0xF5,
253 SLEEP_TO_EXECUTE = 0xF4,
254 SLEEP_TO_EXECUTEOK = 0xF3,
255 EXECUTE_TO_IDLE = 0xF2,
256 IDLE_TO_EXECUTE = 0xF1,
257 IDLE_TO_EXECUTEOK = 0xF0,
258 RDYTODS_RETURNTOEXE = 0xEF,
259 NORDYTODS_RETURNTOEXE = 0xEE,
260 EXETOSLEEP_RETURNTOEXE = 0xED,
261 EXETOIDLE_RETURNTOEXE = 0xEC,
262 INIT_STATUS = 0xEB,
263
264 /*error messages */
265 INITERROR = 0x00,
266 PLLARMLOCKP_ER = 0x01,
267 PLLDDRLOCKP_ER = 0x02,
268 PLLSOCLOCKP_ER = 0x03,
269 PLLSOCK1LOCKP_ER = 0x04,
270 ARMWFI_ER = 0x05,
271 SYSCLKOK_ER = 0x06,
272 I2C_NACK_DATA_ER = 0x07,
273 BOOT_ER = 0x08,
274 I2C_STATUS_ALWAYS_1 = 0x0A,
275 I2C_NACK_REG_ADDR_ER = 0x0B,
276 I2C_NACK_DATA0123_ER = 0x1B,
277 I2C_NACK_ADDR_ER = 0x1F,
278 CURAPPWRSTISNOT_BOOT = 0x20,
279 CURAPPWRSTISNOT_EXECUTE = 0x21,
280 CURAPPWRSTISNOT_SLEEPMODE = 0x22,
281 CURAPPWRSTISNOT_CORRECTFORIT10 = 0x23,
282 FIFO4500WUISNOT_WUPEVENT = 0x24,
283 PLL32KLOCKP_ER = 0x29,
284 DDRDEEPSLEEPOK_ER = 0x2A,
285 ROMCODEREADY_ER = 0x50,
286 WUPBEFOREDS = 0x51,
287 DDRCONFIG_ER = 0x52,
288 WUPBEFORESLEEP = 0x53,
289 WUPBEFOREIDLE = 0x54
290}; /* earlier called as mbox_2_arm_stat */
291
292/**
293 * enum dvfs_stat - DVFS status messages definition
294 * @DVFS_GO: A state transition DVFS is on going
295 * @DVFS_ARM100OPPOK: The state transition DVFS has been completed for 100OPP
296 * @DVFS_ARM50OPPOK: The state transition DVFS has been completed for 50OPP
297 * @DVFS_ARMEXTCLKOK: The state transition DVFS has been completed for EXTCLK
298 * @DVFS_NOCHGTCLKOK: The state transition DVFS has been completed for
299 * NOCHGCLK
300 * @DVFS_INITSTATUS: Value init
301 */
302enum dvfs_stat {
303 DVFS_GO = 0xFF,
304 DVFS_ARM100OPPOK = 0xFE,
305 DVFS_ARM50OPPOK = 0xFD,
306 DVFS_ARMEXTCLKOK = 0xFC,
307 DVFS_NOCHGTCLKOK = 0xFB,
308 DVFS_INITSTATUS = 0x00
309};
310
311/**
312 * enum sva_mmdsp_stat - SVA MMDSP status messages
313 * @SVA_MMDSP_GO: SVAMMDSP interrupt has happened
314 * @SVA_MMDSP_INIT: Status init
315 */
316enum sva_mmdsp_stat {
317 SVA_MMDSP_GO = 0xFF,
318 SVA_MMDSP_INIT = 0x00
319};
320
321/**
322 * enum sia_mmdsp_stat - SIA MMDSP status messages
323 * @SIA_MMDSP_GO: SIAMMDSP interrupt has happened
324 * @SIA_MMDSP_INIT: Status init
325 */
326enum sia_mmdsp_stat {
327 SIA_MMDSP_GO = 0xFF,
328 SIA_MMDSP_INIT = 0x00
329};
330
331/**
332 * enum mbox_to_arm_err - Error messages definition
333 * @INIT_ERR: Init value
334 * @PLLARMLOCKP_ERR: PLLARM has not been correctly locked in given time
335 * @PLLDDRLOCKP_ERR: PLLDDR has not been correctly locked in the given time
336 * @PLLSOC0LOCKP_ERR: PLLSOC0 has not been correctly locked in the given time
337 * @PLLSOC1LOCKP_ERR: PLLSOC1 has not been correctly locked in the given time
338 * @ARMWFI_ERR: The ARM WFI has not been correctly executed in the given time
339 * @SYSCLKOK_ERR: The SYSCLK is not available in the given time
340 * @BOOT_ERR: Romcode has not validated the XP70 self reset in the given time
341 * @ROMCODESAVECONTEXT: The Romcode didn.t correctly save it secure context
342 * @VARMHIGHSPEEDVALTO_ERR: The ARM high speed supply value transfered
343 * through I2C has not been correctly executed in the given time
344 * @VARMHIGHSPEEDACCESS_ERR: The command value of VarmHighSpeedVal transfered
345 * through I2C has not been correctly executed in the given time
346 * @VARMLOWSPEEDVALTO_ERR:The ARM low speed supply value transfered through
347 * I2C has not been correctly executed in the given time
348 * @VARMLOWSPEEDACCESS_ERR: The command value of VarmLowSpeedVal transfered
349 * through I2C has not been correctly executed in the given time
350 * @VARMRETENTIONVALTO_ERR: The ARM retention supply value transfered through
351 * I2C has not been correctly executed in the given time
352 * @VARMRETENTIONACCESS_ERR: The command value of VarmRetentionVal transfered
353 * through I2C has not been correctly executed in the given time
354 * @VAPEHIGHSPEEDVALTO_ERR: The APE highspeed supply value transfered through
355 * I2C has not been correctly executed in the given time
356 * @VSAFEHPVALTO_ERR: The SAFE high power supply value transfered through I2C
357 * has not been correctly executed in the given time
358 * @VMODSEL1VALTO_ERR: The MODEM sel1 supply value transfered through I2C has
359 * not been correctly executed in the given time
360 * @VMODSEL2VALTO_ERR: The MODEM sel2 supply value transfered through I2C has
361 * not been correctly executed in the given time
362 * @VARMOFFACCESS_ERR: The command value of Varm ON/OFF transfered through
363 * I2C has not been correctly executed in the given time
364 * @VAPEOFFACCESS_ERR: The command value of Vape ON/OFF transfered through
365 * I2C has not been correctly executed in the given time
366 * @VARMRETACCES_ERR: The command value of Varm retention ON/OFF transfered
367 * through I2C has not been correctly executed in the given time
368 * @CURAPPWRSTISNOTBOOT:Generated when Arm want to do power state transition
369 * ApBoot to ApExecute but the power current state is not Apboot
370 * @CURAPPWRSTISNOTEXECUTE: Generated when Arm want to do power state
371 * transition from ApExecute to others power state but the
372 * power current state is not ApExecute
373 * @CURAPPWRSTISNOTSLEEPMODE: Generated when wake up events are transmitted
374 * but the power current state is not ApDeepSleep/ApSleep/ApIdle
375 * @CURAPPWRSTISNOTCORRECTDBG: Generated when wake up events are transmitted
376 * but the power current state is not correct
377 * @ARMREGU1VALTO_ERR:The ArmRegu1 value transferred through I2C has not
378 * been correctly executed in the given time
379 * @ARMREGU2VALTO_ERR: The ArmRegu2 value transferred through I2C has not
380 * been correctly executed in the given time
381 * @VAPEREGUVALTO_ERR: The VApeRegu value transfered through I2C has not
382 * been correctly executed in the given time
383 * @VSMPS3REGUVALTO_ERR: The VSmps3Regu value transfered through I2C has not
384 * been correctly executed in the given time
385 * @VMODREGUVALTO_ERR: The VModemRegu value transfered through I2C has not
386 * been correctly executed in the given time
387 */
388enum mbox_to_arm_err {
389 INIT_ERR = 0x00,
390 PLLARMLOCKP_ERR = 0x01,
391 PLLDDRLOCKP_ERR = 0x02,
392 PLLSOC0LOCKP_ERR = 0x03,
393 PLLSOC1LOCKP_ERR = 0x04,
394 ARMWFI_ERR = 0x05,
395 SYSCLKOK_ERR = 0x06,
396 BOOT_ERR = 0x07,
397 ROMCODESAVECONTEXT = 0x08,
398 VARMHIGHSPEEDVALTO_ERR = 0x10,
399 VARMHIGHSPEEDACCESS_ERR = 0x11,
400 VARMLOWSPEEDVALTO_ERR = 0x12,
401 VARMLOWSPEEDACCESS_ERR = 0x13,
402 VARMRETENTIONVALTO_ERR = 0x14,
403 VARMRETENTIONACCESS_ERR = 0x15,
404 VAPEHIGHSPEEDVALTO_ERR = 0x16,
405 VSAFEHPVALTO_ERR = 0x17,
406 VMODSEL1VALTO_ERR = 0x18,
407 VMODSEL2VALTO_ERR = 0x19,
408 VARMOFFACCESS_ERR = 0x1A,
409 VAPEOFFACCESS_ERR = 0x1B,
410 VARMRETACCES_ERR = 0x1C,
411 CURAPPWRSTISNOTBOOT = 0x20,
412 CURAPPWRSTISNOTEXECUTE = 0x21,
413 CURAPPWRSTISNOTSLEEPMODE = 0x22,
414 CURAPPWRSTISNOTCORRECTDBG = 0x23,
415 ARMREGU1VALTO_ERR = 0x24,
416 ARMREGU2VALTO_ERR = 0x25,
417 VAPEREGUVALTO_ERR = 0x26,
418 VSMPS3REGUVALTO_ERR = 0x27,
419 VMODREGUVALTO_ERR = 0x28
420};
421
422enum hw_acc {
423 SVAMMDSP = 0,
424 SVAPIPE = 1,
425 SIAMMDSP = 2,
426 SIAPIPE = 3,
427 SGA = 4,
428 B2R2MCDE = 5,
429 ESRAM12 = 6,
430 ESRAM34 = 7,
431};
432
433enum cs_pwrmgt {
434 PWRDNCS0 = 0,
435 WKUPCS0 = 1,
436 PWRDNCS1 = 2,
437 WKUPCS1 = 3
438};
439
440/* Defs related to autonomous power management */
441
442/**
443 * enum sia_sva_pwr_policy - Power policy
444 * @NO_CHGT: No change
445 * @DSPOFF_HWPOFF:
446 * @DSPOFFRAMRET_HWPOFF:
447 * @DSPCLKOFF_HWPOFF:
448 * @DSPCLKOFF_HWPCLKOFF:
449 *
450 */
451enum sia_sva_pwr_policy {
452 NO_CHGT = 0x0,
453 DSPOFF_HWPOFF = 0x1,
454 DSPOFFRAMRET_HWPOFF = 0x2,
455 DSPCLKOFF_HWPOFF = 0x3,
456 DSPCLKOFF_HWPCLKOFF = 0x4,
457};
458
459/**
460 * enum auto_enable - Auto Power enable
461 * @AUTO_OFF:
462 * @AUTO_ON:
463 *
464 */
465enum auto_enable {
466 AUTO_OFF = 0x0,
467 AUTO_ON = 0x1,
468};
469
470/* End of file previously known as prcmu-fw-defs_v1.h */
471
472/* PRCMU Wakeup defines */
473enum prcmu_wakeup_index {
474 PRCMU_WAKEUP_INDEX_RTC,
475 PRCMU_WAKEUP_INDEX_RTT0,
476 PRCMU_WAKEUP_INDEX_RTT1,
477 PRCMU_WAKEUP_INDEX_HSI0,
478 PRCMU_WAKEUP_INDEX_HSI1,
479 PRCMU_WAKEUP_INDEX_USB,
480 PRCMU_WAKEUP_INDEX_ABB,
481 PRCMU_WAKEUP_INDEX_ABB_FIFO,
482 PRCMU_WAKEUP_INDEX_ARM,
483 NUM_PRCMU_WAKEUP_INDICES
484};
485#define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
486
487/* PRCMU QoS APE OPP class */
488#define PRCMU_QOS_APE_OPP 1
489#define PRCMU_QOS_DDR_OPP 2
490#define PRCMU_QOS_DEFAULT_VALUE -1
491
492/**
493 * enum hw_acc_dev - enum for hw accelerators
494 * @HW_ACC_SVAMMDSP: for SVAMMDSP
495 * @HW_ACC_SVAPIPE: for SVAPIPE
496 * @HW_ACC_SIAMMDSP: for SIAMMDSP
497 * @HW_ACC_SIAPIPE: for SIAPIPE
498 * @HW_ACC_SGA: for SGA
499 * @HW_ACC_B2R2: for B2R2
500 * @HW_ACC_MCDE: for MCDE
501 * @HW_ACC_ESRAM1: for ESRAM1
502 * @HW_ACC_ESRAM2: for ESRAM2
503 * @HW_ACC_ESRAM3: for ESRAM3
504 * @HW_ACC_ESRAM4: for ESRAM4
505 * @NUM_HW_ACC: number of hardware accelerators
506 *
507 * Different hw accelerators which can be turned ON/
508 * OFF or put into retention (MMDSPs and ESRAMs).
509 * Used with EPOD API.
510 *
511 * NOTE! Deprecated, to be removed when all users switched over to use the
512 * regulator API.
513 */
514enum hw_acc_dev {
515 HW_ACC_SVAMMDSP,
516 HW_ACC_SVAPIPE,
517 HW_ACC_SIAMMDSP,
518 HW_ACC_SIAPIPE,
519 HW_ACC_SGA,
520 HW_ACC_B2R2,
521 HW_ACC_MCDE,
522 HW_ACC_ESRAM1,
523 HW_ACC_ESRAM2,
524 HW_ACC_ESRAM3,
525 HW_ACC_ESRAM4,
526 NUM_HW_ACC
527};
528
529/*
530 * Ids for all EPODs (power domains)
531 * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
532 * - EPOD_ID_SVAPIPE: power domain for SVA pipe
533 * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
534 * - EPOD_ID_SIAPIPE: power domain for SIA pipe
535 * - EPOD_ID_SGA: power domain for SGA
536 * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
537 * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
538 * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
539 * - NUM_EPOD_ID: number of power domains
540 */
541#define EPOD_ID_SVAMMDSP 0
542#define EPOD_ID_SVAPIPE 1
543#define EPOD_ID_SIAMMDSP 2
544#define EPOD_ID_SIAPIPE 3
545#define EPOD_ID_SGA 4
546#define EPOD_ID_B2R2_MCDE 5
547#define EPOD_ID_ESRAM12 6
548#define EPOD_ID_ESRAM34 7
549#define NUM_EPOD_ID 8
550
551/*
552 * state definition for EPOD (power domain)
553 * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
554 * - EPOD_STATE_OFF: The EPOD is switched off
555 * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
556 * retention
557 * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
558 * - EPOD_STATE_ON: Same as above, but with clock enabled
559 */
560#define EPOD_STATE_NO_CHANGE 0x00
561#define EPOD_STATE_OFF 0x01
562#define EPOD_STATE_RAMRET 0x02
563#define EPOD_STATE_ON_CLK_OFF 0x03
564#define EPOD_STATE_ON 0x04
565
566/*
567 * CLKOUT sources
568 */
569#define PRCMU_CLKSRC_CLK38M 0x00
570#define PRCMU_CLKSRC_ACLK 0x01
571#define PRCMU_CLKSRC_SYSCLK 0x02
572#define PRCMU_CLKSRC_LCDCLK 0x03
573#define PRCMU_CLKSRC_SDMMCCLK 0x04
574#define PRCMU_CLKSRC_TVCLK 0x05
575#define PRCMU_CLKSRC_TIMCLK 0x06
576#define PRCMU_CLKSRC_CLK009 0x07
577/* These are only valid for CLKOUT1: */
578#define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
579#define PRCMU_CLKSRC_I2CCLK 0x41
580#define PRCMU_CLKSRC_MSP02CLK 0x42
581#define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
582#define PRCMU_CLKSRC_HSIRXCLK 0x44
583#define PRCMU_CLKSRC_HSITXCLK 0x45
584#define PRCMU_CLKSRC_ARMCLKFIX 0x46
585#define PRCMU_CLKSRC_HDMICLK 0x47
586
587/*
588 * Definitions for autonomous power management configuration.
589 */
590
591#define PRCMU_AUTO_PM_OFF 0
592#define PRCMU_AUTO_PM_ON 1
593
594#define PRCMU_AUTO_PM_POWER_ON_HSEM BIT(0)
595#define PRCMU_AUTO_PM_POWER_ON_ABB_FIFO_IT BIT(1)
596
597enum prcmu_auto_pm_policy {
598 PRCMU_AUTO_PM_POLICY_NO_CHANGE,
599 PRCMU_AUTO_PM_POLICY_DSP_OFF_HWP_OFF,
600 PRCMU_AUTO_PM_POLICY_DSP_OFF_RAMRET_HWP_OFF,
601 PRCMU_AUTO_PM_POLICY_DSP_CLK_OFF_HWP_OFF,
602 PRCMU_AUTO_PM_POLICY_DSP_CLK_OFF_HWP_CLK_OFF,
603};
604
605/**
606 * struct prcmu_auto_pm_config - Autonomous power management configuration.
607 * @sia_auto_pm_enable: SIA autonomous pm enable. (PRCMU_AUTO_PM_{OFF,ON})
608 * @sia_power_on: SIA power ON enable. (PRCMU_AUTO_PM_POWER_ON_* bitmask)
609 * @sia_policy: SIA power policy. (enum prcmu_auto_pm_policy)
610 * @sva_auto_pm_enable: SVA autonomous pm enable. (PRCMU_AUTO_PM_{OFF,ON})
611 * @sva_power_on: SVA power ON enable. (PRCMU_AUTO_PM_POWER_ON_* bitmask)
612 * @sva_policy: SVA power policy. (enum prcmu_auto_pm_policy)
613 */
614struct prcmu_auto_pm_config {
615 u8 sia_auto_pm_enable;
616 u8 sia_power_on;
617 u8 sia_policy;
618 u8 sva_auto_pm_enable;
619 u8 sva_power_on;
620 u8 sva_policy;
621};
622
623/**
624 * enum ddr_opp - DDR OPP states definition
625 * @DDR_100_OPP: The new DDR operating point is ddr100opp
626 * @DDR_50_OPP: The new DDR operating point is ddr50opp
627 * @DDR_25_OPP: The new DDR operating point is ddr25opp
628 */
629enum ddr_opp {
630 DDR_100_OPP = 0x00,
631 DDR_50_OPP = 0x01,
632 DDR_25_OPP = 0x02,
633};
634
635/*
636 * Clock identifiers.
637 */
638enum prcmu_clock {
639 PRCMU_SGACLK,
640 PRCMU_UARTCLK,
641 PRCMU_MSP02CLK,
642 PRCMU_MSP1CLK,
643 PRCMU_I2CCLK,
644 PRCMU_SDMMCCLK,
645 PRCMU_SLIMCLK,
646 PRCMU_PER1CLK,
647 PRCMU_PER2CLK,
648 PRCMU_PER3CLK,
649 PRCMU_PER5CLK,
650 PRCMU_PER6CLK,
651 PRCMU_PER7CLK,
652 PRCMU_LCDCLK,
653 PRCMU_BMLCLK,
654 PRCMU_HSITXCLK,
655 PRCMU_HSIRXCLK,
656 PRCMU_HDMICLK,
657 PRCMU_APEATCLK,
658 PRCMU_APETRACECLK,
659 PRCMU_MCDECLK,
660 PRCMU_IPI2CCLK,
661 PRCMU_DSIALTCLK,
662 PRCMU_DMACLK,
663 PRCMU_B2R2CLK,
664 PRCMU_TVCLK,
665 PRCMU_SSPCLK,
666 PRCMU_RNGCLK,
667 PRCMU_UICCCLK,
668 PRCMU_NUM_REG_CLOCKS,
669 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
670 PRCMU_TIMCLK,
671};
672
673/*
674 * Definitions for controlling ESRAM0 in deep sleep.
675 */
676#define ESRAM0_DEEP_SLEEP_STATE_OFF 1
677#define ESRAM0_DEEP_SLEEP_STATE_RET 2
678
679#ifdef CONFIG_MFD_DB8500_PRCMU
680void __init prcmu_early_init(void);
681int prcmu_set_display_clocks(void);
682int prcmu_disable_dsipll(void);
683int prcmu_enable_dsipll(void);
684#else
685static inline void __init prcmu_early_init(void) {}
686#endif
687
688#ifdef CONFIG_MFD_DB8500_PRCMU
689
690int prcmu_set_rc_a2p(enum romcode_write);
691enum romcode_read prcmu_get_rc_p2a(void);
692enum ap_pwrst prcmu_get_xp70_current_state(void);
693int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll);
694
695void prcmu_enable_wakeups(u32 wakeups);
696static inline void prcmu_disable_wakeups(void)
697{
698 prcmu_enable_wakeups(0);
699}
700
701void prcmu_config_abb_event_readout(u32 abb_events);
702void prcmu_get_abb_event_buffer(void __iomem **buf);
703int prcmu_set_arm_opp(u8 opp);
704int prcmu_get_arm_opp(void);
705bool prcmu_has_arm_maxopp(void);
706bool prcmu_is_u8400(void);
707int prcmu_set_ape_opp(u8 opp);
708int prcmu_get_ape_opp(void);
709int prcmu_request_ape_opp_100_voltage(bool enable);
710int prcmu_release_usb_wakeup_state(void);
711int prcmu_set_ddr_opp(u8 opp);
712int prcmu_get_ddr_opp(void);
713unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
714void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
715/* NOTE! Use regulator framework instead */
716int prcmu_set_hwacc(u16 hw_acc_dev, u8 state);
717int prcmu_set_epod(u16 epod_id, u8 epod_state);
718void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
719 struct prcmu_auto_pm_config *idle);
720bool prcmu_is_auto_pm_enabled(void);
721
722int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
723int prcmu_request_clock(u8 clock, bool enable);
724int prcmu_set_clock_divider(u8 clock, u8 divider);
725int prcmu_config_esram0_deep_sleep(u8 state);
726int prcmu_config_hotdog(u8 threshold);
727int prcmu_config_hotmon(u8 low, u8 high);
728int prcmu_start_temp_sense(u16 cycles32k);
729int prcmu_stop_temp_sense(void);
730int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
731int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
732
733void prcmu_ac_wake_req(void);
734void prcmu_ac_sleep_req(void);
735void prcmu_system_reset(u16 reset_code);
736void prcmu_modem_reset(void);
737bool prcmu_is_ac_wake_requested(void);
738void prcmu_enable_spi2(void);
739void prcmu_disable_spi2(void);
740
741#else /* !CONFIG_MFD_DB8500_PRCMU */
742
743static inline int prcmu_set_rc_a2p(enum romcode_write code)
744{
745 return 0;
746}
747
748static inline enum romcode_read prcmu_get_rc_p2a(void)
749{
750 return INIT;
751}
752
753static inline enum ap_pwrst prcmu_get_xp70_current_state(void)
754{
755 return AP_EXECUTE;
756}
757
758static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
759 bool keep_ap_pll)
760{
761 return 0;
762}
763
764static inline void prcmu_enable_wakeups(u32 wakeups) {}
765
766static inline void prcmu_disable_wakeups(void) {}
767
768static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
769
770static inline int prcmu_set_arm_opp(u8 opp)
771{
772 return 0;
773}
774
775static inline int prcmu_get_arm_opp(void)
776{
777 return ARM_100_OPP;
778}
779
780static bool prcmu_has_arm_maxopp(void)
781{
782 return false;
783}
784
785static bool prcmu_is_u8400(void)
786{
787 return false;
788}
789
790static inline int prcmu_set_ape_opp(u8 opp)
791{
792 return 0;
793}
794
795static inline int prcmu_get_ape_opp(void)
796{
797 return APE_100_OPP;
798}
799
800static inline int prcmu_request_ape_opp_100_voltage(bool enable)
801{
802 return 0;
803}
804
805static inline int prcmu_release_usb_wakeup_state(void)
806{
807 return 0;
808}
809
810static inline int prcmu_set_ddr_opp(u8 opp)
811{
812 return 0;
813}
814
815static inline int prcmu_get_ddr_opp(void)
816{
817 return DDR_100_OPP;
818}
819
820static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
821{
822 return 0;
823}
824
825static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
826
827static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state)
828{
829 return 0;
830}
831
832static inline void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
833 struct prcmu_auto_pm_config *idle)
834{
835}
836
837static inline bool prcmu_is_auto_pm_enabled(void)
838{
839 return false;
840}
841
842static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
843{
844 return 0;
845}
846
847static inline int prcmu_request_clock(u8 clock, bool enable)
848{
849 return 0;
850}
851
852static inline int prcmu_set_clock_divider(u8 clock, u8 divider)
853{
854 return 0;
855}
856
857int prcmu_config_esram0_deep_sleep(u8 state)
858{
859 return 0;
860}
861
862static inline int prcmu_config_hotdog(u8 threshold)
863{
864 return 0;
865}
866
867static inline int prcmu_config_hotmon(u8 low, u8 high)
868{
869 return 0;
870}
871
872static inline int prcmu_start_temp_sense(u16 cycles32k)
873{
874 return 0;
875}
876
877static inline int prcmu_stop_temp_sense(void)
878{
879 return 0;
880}
881
882static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
883{
884 return -ENOSYS;
885}
886
887static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
888{
889 return -ENOSYS;
890}
891
892static inline void prcmu_ac_wake_req(void) {}
893
894static inline void prcmu_ac_sleep_req(void) {}
895
896static inline void prcmu_system_reset(u16 reset_code) {}
897
898static inline void prcmu_modem_reset(void) {}
899
900static inline bool prcmu_is_ac_wake_requested(void)
901{
902 return false;
903}
904
905#ifndef CONFIG_UX500_SOC_DB5500
906static inline int prcmu_set_display_clocks(void)
907{
908 return 0;
909}
910
911static inline int prcmu_disable_dsipll(void)
912{
913 return 0;
914}
915
916static inline int prcmu_enable_dsipll(void)
917{
918 return 0;
919}
920#endif
921
922static inline int prcmu_enable_spi2(void)
923{
924 return 0;
925}
926
927static inline int prcmu_disable_spi2(void)
928{
929 return 0;
930}
931
932#endif /* !CONFIG_MFD_DB8500_PRCMU */
933
934#ifdef CONFIG_UX500_PRCMU_QOS_POWER
935int prcmu_qos_requirement(int pm_qos_class);
936int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value);
937int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
938void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
939int prcmu_qos_add_notifier(int prcmu_qos_class,
940 struct notifier_block *notifier);
941int prcmu_qos_remove_notifier(int prcmu_qos_class,
942 struct notifier_block *notifier);
943#else
944static inline int prcmu_qos_requirement(int prcmu_qos_class)
945{
946 return 0;
947}
948
949static inline int prcmu_qos_add_requirement(int prcmu_qos_class,
950 char *name, s32 value)
951{
952 return 0;
953}
954
955static inline int prcmu_qos_update_requirement(int prcmu_qos_class,
956 char *name, s32 new_value)
957{
958 return 0;
959}
960
961static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name)
962{
963}
964
965static inline int prcmu_qos_add_notifier(int prcmu_qos_class,
966 struct notifier_block *notifier)
967{
968 return 0;
969}
970static inline int prcmu_qos_remove_notifier(int prcmu_qos_class,
971 struct notifier_block *notifier)
972{
973 return 0;
974}
975
976#endif
977
978#endif /* __MFD_DB8500_PRCMU_H */
diff --git a/include/linux/mfd/ds1wm.h b/include/linux/mfd/ds1wm.h
index be469a357cbb..38a372a0e285 100644
--- a/include/linux/mfd/ds1wm.h
+++ b/include/linux/mfd/ds1wm.h
@@ -3,4 +3,11 @@
3struct ds1wm_driver_data { 3struct ds1wm_driver_data {
4 int active_high; 4 int active_high;
5 int clock_rate; 5 int clock_rate;
6 /* in milliseconds, the amount of time to */
7 /* sleep following a reset pulse. Zero */
8 /* should work if your bus devices recover*/
9 /* time respects the 1-wire spec since the*/
10 /* ds1wm implements the precise timings of*/
11 /* a reset pulse/presence detect sequence.*/
12 unsigned int reset_recover_delay;
6}; 13};
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
new file mode 100644
index 000000000000..5ff2400ad46c
--- /dev/null
+++ b/include/linux/mfd/max8997-private.h
@@ -0,0 +1,364 @@
1/*
2 * max8997.h - Voltage regulator driver for the Maxim 8997
3 *
4 * Copyright (C) 2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef __LINUX_MFD_MAX8997_PRIV_H
23#define __LINUX_MFD_MAX8997_PRIV_H
24
25#include <linux/i2c.h>
26
27#define MAX8997_REG_INVALID (0xff)
28
29enum max8997_pmic_reg {
30 MAX8997_REG_PMIC_ID0 = 0x00,
31 MAX8997_REG_PMIC_ID1 = 0x01,
32 MAX8997_REG_INTSRC = 0x02,
33 MAX8997_REG_INT1 = 0x03,
34 MAX8997_REG_INT2 = 0x04,
35 MAX8997_REG_INT3 = 0x05,
36 MAX8997_REG_INT4 = 0x06,
37
38 MAX8997_REG_INT1MSK = 0x08,
39 MAX8997_REG_INT2MSK = 0x09,
40 MAX8997_REG_INT3MSK = 0x0a,
41 MAX8997_REG_INT4MSK = 0x0b,
42
43 MAX8997_REG_STATUS1 = 0x0d,
44 MAX8997_REG_STATUS2 = 0x0e,
45 MAX8997_REG_STATUS3 = 0x0f,
46 MAX8997_REG_STATUS4 = 0x10,
47
48 MAX8997_REG_MAINCON1 = 0x13,
49 MAX8997_REG_MAINCON2 = 0x14,
50 MAX8997_REG_BUCKRAMP = 0x15,
51
52 MAX8997_REG_BUCK1CTRL = 0x18,
53 MAX8997_REG_BUCK1DVS1 = 0x19,
54 MAX8997_REG_BUCK1DVS2 = 0x1a,
55 MAX8997_REG_BUCK1DVS3 = 0x1b,
56 MAX8997_REG_BUCK1DVS4 = 0x1c,
57 MAX8997_REG_BUCK1DVS5 = 0x1d,
58 MAX8997_REG_BUCK1DVS6 = 0x1e,
59 MAX8997_REG_BUCK1DVS7 = 0x1f,
60 MAX8997_REG_BUCK1DVS8 = 0x20,
61 MAX8997_REG_BUCK2CTRL = 0x21,
62 MAX8997_REG_BUCK2DVS1 = 0x22,
63 MAX8997_REG_BUCK2DVS2 = 0x23,
64 MAX8997_REG_BUCK2DVS3 = 0x24,
65 MAX8997_REG_BUCK2DVS4 = 0x25,
66 MAX8997_REG_BUCK2DVS5 = 0x26,
67 MAX8997_REG_BUCK2DVS6 = 0x27,
68 MAX8997_REG_BUCK2DVS7 = 0x28,
69 MAX8997_REG_BUCK2DVS8 = 0x29,
70 MAX8997_REG_BUCK3CTRL = 0x2a,
71 MAX8997_REG_BUCK3DVS = 0x2b,
72 MAX8997_REG_BUCK4CTRL = 0x2c,
73 MAX8997_REG_BUCK4DVS = 0x2d,
74 MAX8997_REG_BUCK5CTRL = 0x2e,
75 MAX8997_REG_BUCK5DVS1 = 0x2f,
76 MAX8997_REG_BUCK5DVS2 = 0x30,
77 MAX8997_REG_BUCK5DVS3 = 0x31,
78 MAX8997_REG_BUCK5DVS4 = 0x32,
79 MAX8997_REG_BUCK5DVS5 = 0x33,
80 MAX8997_REG_BUCK5DVS6 = 0x34,
81 MAX8997_REG_BUCK5DVS7 = 0x35,
82 MAX8997_REG_BUCK5DVS8 = 0x36,
83 MAX8997_REG_BUCK6CTRL = 0x37,
84 MAX8997_REG_BUCK6BPSKIPCTRL = 0x38,
85 MAX8997_REG_BUCK7CTRL = 0x39,
86 MAX8997_REG_BUCK7DVS = 0x3a,
87 MAX8997_REG_LDO1CTRL = 0x3b,
88 MAX8997_REG_LDO2CTRL = 0x3c,
89 MAX8997_REG_LDO3CTRL = 0x3d,
90 MAX8997_REG_LDO4CTRL = 0x3e,
91 MAX8997_REG_LDO5CTRL = 0x3f,
92 MAX8997_REG_LDO6CTRL = 0x40,
93 MAX8997_REG_LDO7CTRL = 0x41,
94 MAX8997_REG_LDO8CTRL = 0x42,
95 MAX8997_REG_LDO9CTRL = 0x43,
96 MAX8997_REG_LDO10CTRL = 0x44,
97 MAX8997_REG_LDO11CTRL = 0x45,
98 MAX8997_REG_LDO12CTRL = 0x46,
99 MAX8997_REG_LDO13CTRL = 0x47,
100 MAX8997_REG_LDO14CTRL = 0x48,
101 MAX8997_REG_LDO15CTRL = 0x49,
102 MAX8997_REG_LDO16CTRL = 0x4a,
103 MAX8997_REG_LDO17CTRL = 0x4b,
104 MAX8997_REG_LDO18CTRL = 0x4c,
105 MAX8997_REG_LDO21CTRL = 0x4d,
106
107 MAX8997_REG_MBCCTRL1 = 0x50,
108 MAX8997_REG_MBCCTRL2 = 0x51,
109 MAX8997_REG_MBCCTRL3 = 0x52,
110 MAX8997_REG_MBCCTRL4 = 0x53,
111 MAX8997_REG_MBCCTRL5 = 0x54,
112 MAX8997_REG_MBCCTRL6 = 0x55,
113 MAX8997_REG_OTPCGHCVS = 0x56,
114
115 MAX8997_REG_SAFEOUTCTRL = 0x5a,
116
117 MAX8997_REG_LBCNFG1 = 0x5e,
118 MAX8997_REG_LBCNFG2 = 0x5f,
119 MAX8997_REG_BBCCTRL = 0x60,
120
121 MAX8997_REG_FLASH1_CUR = 0x63, /* 0x63 ~ 0x6e for FLASH */
122 MAX8997_REG_FLASH2_CUR = 0x64,
123 MAX8997_REG_MOVIE_CUR = 0x65,
124 MAX8997_REG_GSMB_CUR = 0x66,
125 MAX8997_REG_BOOST_CNTL = 0x67,
126 MAX8997_REG_LEN_CNTL = 0x68,
127 MAX8997_REG_FLASH_CNTL = 0x69,
128 MAX8997_REG_WDT_CNTL = 0x6a,
129 MAX8997_REG_MAXFLASH1 = 0x6b,
130 MAX8997_REG_MAXFLASH2 = 0x6c,
131 MAX8997_REG_FLASHSTATUS = 0x6d,
132 MAX8997_REG_FLASHSTATUSMASK = 0x6e,
133
134 MAX8997_REG_GPIOCNTL1 = 0x70,
135 MAX8997_REG_GPIOCNTL2 = 0x71,
136 MAX8997_REG_GPIOCNTL3 = 0x72,
137 MAX8997_REG_GPIOCNTL4 = 0x73,
138 MAX8997_REG_GPIOCNTL5 = 0x74,
139 MAX8997_REG_GPIOCNTL6 = 0x75,
140 MAX8997_REG_GPIOCNTL7 = 0x76,
141 MAX8997_REG_GPIOCNTL8 = 0x77,
142 MAX8997_REG_GPIOCNTL9 = 0x78,
143 MAX8997_REG_GPIOCNTL10 = 0x79,
144 MAX8997_REG_GPIOCNTL11 = 0x7a,
145 MAX8997_REG_GPIOCNTL12 = 0x7b,
146
147 MAX8997_REG_LDO1CONFIG = 0x80,
148 MAX8997_REG_LDO2CONFIG = 0x81,
149 MAX8997_REG_LDO3CONFIG = 0x82,
150 MAX8997_REG_LDO4CONFIG = 0x83,
151 MAX8997_REG_LDO5CONFIG = 0x84,
152 MAX8997_REG_LDO6CONFIG = 0x85,
153 MAX8997_REG_LDO7CONFIG = 0x86,
154 MAX8997_REG_LDO8CONFIG = 0x87,
155 MAX8997_REG_LDO9CONFIG = 0x88,
156 MAX8997_REG_LDO10CONFIG = 0x89,
157 MAX8997_REG_LDO11CONFIG = 0x8a,
158 MAX8997_REG_LDO12CONFIG = 0x8b,
159 MAX8997_REG_LDO13CONFIG = 0x8c,
160 MAX8997_REG_LDO14CONFIG = 0x8d,
161 MAX8997_REG_LDO15CONFIG = 0x8e,
162 MAX8997_REG_LDO16CONFIG = 0x8f,
163 MAX8997_REG_LDO17CONFIG = 0x90,
164 MAX8997_REG_LDO18CONFIG = 0x91,
165 MAX8997_REG_LDO21CONFIG = 0x92,
166
167 MAX8997_REG_DVSOKTIMER1 = 0x97,
168 MAX8997_REG_DVSOKTIMER2 = 0x98,
169 MAX8997_REG_DVSOKTIMER4 = 0x99,
170 MAX8997_REG_DVSOKTIMER5 = 0x9a,
171
172 MAX8997_REG_PMIC_END = 0x9b,
173};
174
175enum max8997_muic_reg {
176 MAX8997_MUIC_REG_ID = 0x0,
177 MAX8997_MUIC_REG_INT1 = 0x1,
178 MAX8997_MUIC_REG_INT2 = 0x2,
179 MAX8997_MUIC_REG_INT3 = 0x3,
180 MAX8997_MUIC_REG_STATUS1 = 0x4,
181 MAX8997_MUIC_REG_STATUS2 = 0x5,
182 MAX8997_MUIC_REG_STATUS3 = 0x6,
183 MAX8997_MUIC_REG_INTMASK1 = 0x7,
184 MAX8997_MUIC_REG_INTMASK2 = 0x8,
185 MAX8997_MUIC_REG_INTMASK3 = 0x9,
186 MAX8997_MUIC_REG_CDETCTRL = 0xa,
187
188 MAX8997_MUIC_REG_CONTROL1 = 0xc,
189 MAX8997_MUIC_REG_CONTROL2 = 0xd,
190 MAX8997_MUIC_REG_CONTROL3 = 0xe,
191
192 MAX8997_MUIC_REG_END = 0xf,
193};
194
195enum max8997_haptic_reg {
196 MAX8997_HAPTIC_REG_GENERAL = 0x00,
197 MAX8997_HAPTIC_REG_CONF1 = 0x01,
198 MAX8997_HAPTIC_REG_CONF2 = 0x02,
199 MAX8997_HAPTIC_REG_DRVCONF = 0x03,
200 MAX8997_HAPTIC_REG_CYCLECONF1 = 0x04,
201 MAX8997_HAPTIC_REG_CYCLECONF2 = 0x05,
202 MAX8997_HAPTIC_REG_SIGCONF1 = 0x06,
203 MAX8997_HAPTIC_REG_SIGCONF2 = 0x07,
204 MAX8997_HAPTIC_REG_SIGCONF3 = 0x08,
205 MAX8997_HAPTIC_REG_SIGCONF4 = 0x09,
206 MAX8997_HAPTIC_REG_SIGDC1 = 0x0a,
207 MAX8997_HAPTIC_REG_SIGDC2 = 0x0b,
208 MAX8997_HAPTIC_REG_SIGPWMDC1 = 0x0c,
209 MAX8997_HAPTIC_REG_SIGPWMDC2 = 0x0d,
210 MAX8997_HAPTIC_REG_SIGPWMDC3 = 0x0e,
211 MAX8997_HAPTIC_REG_SIGPWMDC4 = 0x0f,
212 MAX8997_HAPTIC_REG_MTR_REV = 0x10,
213
214 MAX8997_HAPTIC_REG_END = 0x11,
215};
216
217/* slave addr = 0x0c: using "2nd part" of rev4 datasheet */
218enum max8997_rtc_reg {
219 MAX8997_RTC_CTRLMASK = 0x02,
220 MAX8997_RTC_CTRL = 0x03,
221 MAX8997_RTC_UPDATE1 = 0x04,
222 MAX8997_RTC_UPDATE2 = 0x05,
223 MAX8997_RTC_WTSR_SMPL = 0x06,
224
225 MAX8997_RTC_SEC = 0x10,
226 MAX8997_RTC_MIN = 0x11,
227 MAX8997_RTC_HOUR = 0x12,
228 MAX8997_RTC_DAY_OF_WEEK = 0x13,
229 MAX8997_RTC_MONTH = 0x14,
230 MAX8997_RTC_YEAR = 0x15,
231 MAX8997_RTC_DAY_OF_MONTH = 0x16,
232 MAX8997_RTC_ALARM1_SEC = 0x17,
233 MAX8997_RTC_ALARM1_MIN = 0x18,
234 MAX8997_RTC_ALARM1_HOUR = 0x19,
235 MAX8997_RTC_ALARM1_DAY_OF_WEEK = 0x1a,
236 MAX8997_RTC_ALARM1_MONTH = 0x1b,
237 MAX8997_RTC_ALARM1_YEAR = 0x1c,
238 MAX8997_RTC_ALARM1_DAY_OF_MONTH = 0x1d,
239 MAX8997_RTC_ALARM2_SEC = 0x1e,
240 MAX8997_RTC_ALARM2_MIN = 0x1f,
241 MAX8997_RTC_ALARM2_HOUR = 0x20,
242 MAX8997_RTC_ALARM2_DAY_OF_WEEK = 0x21,
243 MAX8997_RTC_ALARM2_MONTH = 0x22,
244 MAX8997_RTC_ALARM2_YEAR = 0x23,
245 MAX8997_RTC_ALARM2_DAY_OF_MONTH = 0x24,
246};
247
248enum max8997_irq_source {
249 PMIC_INT1 = 0,
250 PMIC_INT2,
251 PMIC_INT3,
252 PMIC_INT4,
253
254 FUEL_GAUGE, /* Ignored (MAX17042 driver handles) */
255
256 MUIC_INT1,
257 MUIC_INT2,
258 MUIC_INT3,
259
260 GPIO_LOW, /* Not implemented */
261 GPIO_HI, /* Not implemented */
262
263 FLASH_STATUS, /* Not implemented */
264
265 MAX8997_IRQ_GROUP_NR,
266};
267
268enum max8997_irq {
269 MAX8997_PMICIRQ_PWRONR,
270 MAX8997_PMICIRQ_PWRONF,
271 MAX8997_PMICIRQ_PWRON1SEC,
272 MAX8997_PMICIRQ_JIGONR,
273 MAX8997_PMICIRQ_JIGONF,
274 MAX8997_PMICIRQ_LOWBAT2,
275 MAX8997_PMICIRQ_LOWBAT1,
276
277 MAX8997_PMICIRQ_JIGR,
278 MAX8997_PMICIRQ_JIGF,
279 MAX8997_PMICIRQ_MR,
280 MAX8997_PMICIRQ_DVS1OK,
281 MAX8997_PMICIRQ_DVS2OK,
282 MAX8997_PMICIRQ_DVS3OK,
283 MAX8997_PMICIRQ_DVS4OK,
284
285 MAX8997_PMICIRQ_CHGINS,
286 MAX8997_PMICIRQ_CHGRM,
287 MAX8997_PMICIRQ_DCINOVP,
288 MAX8997_PMICIRQ_TOPOFFR,
289 MAX8997_PMICIRQ_CHGRSTF,
290 MAX8997_PMICIRQ_MBCHGTMEXPD,
291
292 MAX8997_PMICIRQ_RTC60S,
293 MAX8997_PMICIRQ_RTCA1,
294 MAX8997_PMICIRQ_RTCA2,
295 MAX8997_PMICIRQ_SMPL_INT,
296 MAX8997_PMICIRQ_RTC1S,
297 MAX8997_PMICIRQ_WTSR,
298
299 MAX8997_MUICIRQ_ADCError,
300 MAX8997_MUICIRQ_ADCLow,
301 MAX8997_MUICIRQ_ADC,
302
303 MAX8997_MUICIRQ_VBVolt,
304 MAX8997_MUICIRQ_DBChg,
305 MAX8997_MUICIRQ_DCDTmr,
306 MAX8997_MUICIRQ_ChgDetRun,
307 MAX8997_MUICIRQ_ChgTyp,
308
309 MAX8997_MUICIRQ_OVP,
310
311 MAX8997_IRQ_NR,
312};
313
314#define MAX8997_NUM_GPIO 12
315struct max8997_dev {
316 struct device *dev;
317 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
318 struct i2c_client *rtc; /* slave addr 0x0c */
319 struct i2c_client *haptic; /* slave addr 0x90 */
320 struct i2c_client *muic; /* slave addr 0x4a */
321 struct mutex iolock;
322
323 int type;
324 struct platform_device *battery; /* battery control (not fuel gauge) */
325
326 int irq;
327 int ono;
328 int irq_base;
329 bool wakeup;
330 struct mutex irqlock;
331 int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
332 int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
333
334 /* For hibernation */
335 u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
336 MAX8997_HAPTIC_REG_END];
337
338 bool gpio_status[MAX8997_NUM_GPIO];
339};
340
341enum max8997_types {
342 TYPE_MAX8997,
343 TYPE_MAX8966,
344};
345
346extern int max8997_irq_init(struct max8997_dev *max8997);
347extern void max8997_irq_exit(struct max8997_dev *max8997);
348extern int max8997_irq_resume(struct max8997_dev *max8997);
349
350extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
351extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count,
352 u8 *buf);
353extern int max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
354extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count,
355 u8 *buf);
356extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
357
358#define MAX8997_GPIO_INT_BOTH (0x3 << 4)
359#define MAX8997_GPIO_INT_RISE (0x2 << 4)
360#define MAX8997_GPIO_INT_FALL (0x1 << 4)
361
362#define MAX8997_GPIO_INT_MASK (0x3 << 4)
363#define MAX8997_GPIO_DATA_MASK (0x1 << 2)
364#endif /* __LINUX_MFD_MAX8997_PRIV_H */
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
new file mode 100644
index 000000000000..60931d089422
--- /dev/null
+++ b/include/linux/mfd/max8997.h
@@ -0,0 +1,117 @@
1/*
2 * max8997.h - Driver for the Maxim 8997/8966
3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * This driver is based on max8998.h
22 *
23 * MAX8997 has PMIC, MUIC, HAPTIC, RTC, FLASH, and Fuel Gauge devices.
24 * Except Fuel Gauge, every device shares the same I2C bus and included in
25 * this mfd driver. Although the fuel gauge is included in the chip, it is
26 * excluded from the driver because a) it has a different I2C bus from
27 * others and b) it can be enabled simply by using MAX17042 driver.
28 */
29
30#ifndef __LINUX_MFD_MAX8998_H
31#define __LINUX_MFD_MAX8998_H
32
33#include <linux/regulator/consumer.h>
34
35/* MAX8997/8966 regulator IDs */
36enum max8998_regulators {
37 MAX8997_LDO1 = 0,
38 MAX8997_LDO2,
39 MAX8997_LDO3,
40 MAX8997_LDO4,
41 MAX8997_LDO5,
42 MAX8997_LDO6,
43 MAX8997_LDO7,
44 MAX8997_LDO8,
45 MAX8997_LDO9,
46 MAX8997_LDO10,
47 MAX8997_LDO11,
48 MAX8997_LDO12,
49 MAX8997_LDO13,
50 MAX8997_LDO14,
51 MAX8997_LDO15,
52 MAX8997_LDO16,
53 MAX8997_LDO17,
54 MAX8997_LDO18,
55 MAX8997_LDO21,
56 MAX8997_BUCK1,
57 MAX8997_BUCK2,
58 MAX8997_BUCK3,
59 MAX8997_BUCK4,
60 MAX8997_BUCK5,
61 MAX8997_BUCK6,
62 MAX8997_BUCK7,
63 MAX8997_EN32KHZ_AP,
64 MAX8997_EN32KHZ_CP,
65 MAX8997_ENVICHG,
66 MAX8997_ESAFEOUT1,
67 MAX8997_ESAFEOUT2,
68 MAX8997_CHARGER_CV, /* control MBCCV of MBCCTRL3 */
69 MAX8997_CHARGER, /* charger current, MBCCTRL4 */
70 MAX8997_CHARGER_TOPOFF, /* MBCCTRL5 */
71
72 MAX8997_REG_MAX,
73};
74
75struct max8997_regulator_data {
76 int id;
77 struct regulator_init_data *initdata;
78};
79
80struct max8997_platform_data {
81 /* IRQ */
82 int irq_base;
83 int ono;
84 int wakeup;
85
86 /* ---- PMIC ---- */
87 struct max8997_regulator_data *regulators;
88 int num_regulators;
89
90 /*
91 * SET1~3 DVS GPIOs control Buck1, 2, and 5 simultaneously. Therefore,
92 * With buckx_gpiodvs enabled, the buckx cannot be controlled
93 * independently. To control buckx (of 1, 2, and 5) independently,
94 * disable buckx_gpiodvs and control with BUCKxDVS1 register.
95 *
96 * When buckx_gpiodvs and bucky_gpiodvs are both enabled, set_voltage
97 * on buckx will change the voltage of bucky at the same time.
98 *
99 */
100 bool ignore_gpiodvs_side_effect;
101 int buck125_gpios[3]; /* GPIO of [0]SET1, [1]SET2, [2]SET3 */
102 int buck125_default_idx; /* Default value of SET1, 2, 3 */
103 unsigned int buck1_voltage[8]; /* buckx_voltage in uV */
104 bool buck1_gpiodvs;
105 unsigned int buck2_voltage[8];
106 bool buck2_gpiodvs;
107 unsigned int buck5_voltage[8];
108 bool buck5_gpiodvs;
109
110 /* MUIC: Not implemented */
111 /* HAPTIC: Not implemented */
112 /* RTC: Not implemented */
113 /* Flash: Not implemented */
114 /* Charger control: Not implemented */
115};
116
117#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index 6dc75b3e2d33..effa5d3b96ae 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8698.h - Voltage regulator driver for the Maxim 8998 2 * max8998.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
@@ -23,6 +23,8 @@
23#ifndef __LINUX_MFD_MAX8998_PRIV_H 23#ifndef __LINUX_MFD_MAX8998_PRIV_H
24#define __LINUX_MFD_MAX8998_PRIV_H 24#define __LINUX_MFD_MAX8998_PRIV_H
25 25
26#define MAX8998_NUM_IRQ_REGS 4
27
26/* MAX 8998 registers */ 28/* MAX 8998 registers */
27enum { 29enum {
28 MAX8998_REG_IRQ1, 30 MAX8998_REG_IRQ1,
@@ -46,12 +48,12 @@ enum {
46 MAX8998_REG_ONOFF2, 48 MAX8998_REG_ONOFF2,
47 MAX8998_REG_ONOFF3, 49 MAX8998_REG_ONOFF3,
48 MAX8998_REG_ONOFF4, 50 MAX8998_REG_ONOFF4,
49 MAX8998_REG_BUCK1_DVSARM1, 51 MAX8998_REG_BUCK1_VOLTAGE1,
50 MAX8998_REG_BUCK1_DVSARM2, 52 MAX8998_REG_BUCK1_VOLTAGE2,
51 MAX8998_REG_BUCK1_DVSARM3, 53 MAX8998_REG_BUCK1_VOLTAGE3,
52 MAX8998_REG_BUCK1_DVSARM4, 54 MAX8998_REG_BUCK1_VOLTAGE4,
53 MAX8998_REG_BUCK2_DVSINT1, 55 MAX8998_REG_BUCK2_VOLTAGE1,
54 MAX8998_REG_BUCK2_DVSINT2, 56 MAX8998_REG_BUCK2_VOLTAGE2,
55 MAX8998_REG_BUCK3, 57 MAX8998_REG_BUCK3,
56 MAX8998_REG_BUCK4, 58 MAX8998_REG_BUCK4,
57 MAX8998_REG_LDO2_LDO3, 59 MAX8998_REG_LDO2_LDO3,
@@ -72,41 +74,104 @@ enum {
72 MAX8998_REG_LBCNFG2, 74 MAX8998_REG_LBCNFG2,
73}; 75};
74 76
77/* IRQ definitions */
78enum {
79 MAX8998_IRQ_DCINF,
80 MAX8998_IRQ_DCINR,
81 MAX8998_IRQ_JIGF,
82 MAX8998_IRQ_JIGR,
83 MAX8998_IRQ_PWRONF,
84 MAX8998_IRQ_PWRONR,
85
86 MAX8998_IRQ_WTSREVNT,
87 MAX8998_IRQ_SMPLEVNT,
88 MAX8998_IRQ_ALARM1,
89 MAX8998_IRQ_ALARM0,
90
91 MAX8998_IRQ_ONKEY1S,
92 MAX8998_IRQ_TOPOFFR,
93 MAX8998_IRQ_DCINOVPR,
94 MAX8998_IRQ_CHGRSTF,
95 MAX8998_IRQ_DONER,
96 MAX8998_IRQ_CHGFAULT,
97
98 MAX8998_IRQ_LOBAT1,
99 MAX8998_IRQ_LOBAT2,
100
101 MAX8998_IRQ_NR,
102};
103
104/* MAX8998 various variants */
105enum {
106 TYPE_MAX8998 = 0, /* Default */
107 TYPE_LP3974, /* National version of MAX8998 */
108 TYPE_LP3979, /* Added AVS */
109};
110
111#define MAX8998_IRQ_DCINF_MASK (1 << 2)
112#define MAX8998_IRQ_DCINR_MASK (1 << 3)
113#define MAX8998_IRQ_JIGF_MASK (1 << 4)
114#define MAX8998_IRQ_JIGR_MASK (1 << 5)
115#define MAX8998_IRQ_PWRONF_MASK (1 << 6)
116#define MAX8998_IRQ_PWRONR_MASK (1 << 7)
117
118#define MAX8998_IRQ_WTSREVNT_MASK (1 << 0)
119#define MAX8998_IRQ_SMPLEVNT_MASK (1 << 1)
120#define MAX8998_IRQ_ALARM1_MASK (1 << 2)
121#define MAX8998_IRQ_ALARM0_MASK (1 << 3)
122
123#define MAX8998_IRQ_ONKEY1S_MASK (1 << 0)
124#define MAX8998_IRQ_TOPOFFR_MASK (1 << 2)
125#define MAX8998_IRQ_DCINOVPR_MASK (1 << 3)
126#define MAX8998_IRQ_CHGRSTF_MASK (1 << 4)
127#define MAX8998_IRQ_DONER_MASK (1 << 5)
128#define MAX8998_IRQ_CHGFAULT_MASK (1 << 7)
129
130#define MAX8998_IRQ_LOBAT1_MASK (1 << 0)
131#define MAX8998_IRQ_LOBAT2_MASK (1 << 1)
132
133#define MAX8998_ENRAMP (1 << 4)
134
75/** 135/**
76 * struct max8998_dev - max8998 master device for sub-drivers 136 * struct max8998_dev - max8998 master device for sub-drivers
77 * @dev: master device of the chip (can be used to access platform data) 137 * @dev: master device of the chip (can be used to access platform data)
78 * @i2c_client: i2c client private data 138 * @i2c: i2c client private data for regulator
79 * @dev_read(): chip register read function 139 * @rtc: i2c client private data for rtc
80 * @dev_write(): chip register write function
81 * @dev_update(): chip register update function
82 * @iolock: mutex for serializing io access 140 * @iolock: mutex for serializing io access
141 * @irqlock: mutex for buslock
142 * @irq_base: base IRQ number for max8998, required for IRQs
143 * @irq: generic IRQ number for max8998
144 * @ono: power onoff IRQ number for max8998
145 * @irq_masks_cur: currently active value
146 * @irq_masks_cache: cached hardware value
147 * @type: indicate which max8998 "variant" is used
83 */ 148 */
84
85struct max8998_dev { 149struct max8998_dev {
86 struct device *dev; 150 struct device *dev;
87 struct i2c_client *i2c_client; 151 struct i2c_client *i2c;
88 int (*dev_read)(struct max8998_dev *max8998, u8 reg, u8 *dest); 152 struct i2c_client *rtc;
89 int (*dev_write)(struct max8998_dev *max8998, u8 reg, u8 val);
90 int (*dev_update)(struct max8998_dev *max8998, u8 reg, u8 val, u8 mask);
91 struct mutex iolock; 153 struct mutex iolock;
154 struct mutex irqlock;
155
156 int irq_base;
157 int irq;
158 int ono;
159 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
160 u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS];
161 int type;
162 bool wakeup;
92}; 163};
93 164
94static inline int max8998_read_reg(struct max8998_dev *max8998, u8 reg, 165int max8998_irq_init(struct max8998_dev *max8998);
95 u8 *value) 166void max8998_irq_exit(struct max8998_dev *max8998);
96{ 167int max8998_irq_resume(struct max8998_dev *max8998);
97 return max8998->dev_read(max8998, reg, value); 168
98} 169extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
99 170extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count,
100static inline int max8998_write_reg(struct max8998_dev *max8998, u8 reg, 171 u8 *buf);
101 u8 value) 172extern int max8998_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
102{ 173extern int max8998_bulk_write(struct i2c_client *i2c, u8 reg, int count,
103 return max8998->dev_write(max8998, reg, value); 174 u8 *buf);
104} 175extern int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
105
106static inline int max8998_update_reg(struct max8998_dev *max8998, u8 reg,
107 u8 value, u8 mask)
108{
109 return max8998->dev_update(max8998, reg, value, mask);
110}
111 176
112#endif /* __LINUX_MFD_MAX8998_PRIV_H */ 177#endif /* __LINUX_MFD_MAX8998_PRIV_H */
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index 1d3601a2d853..61daa167b576 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8698.h - Voltage regulator driver for the Maxim 8998 2 * max8998.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
@@ -66,13 +66,47 @@ struct max8998_regulator_data {
66 66
67/** 67/**
68 * struct max8998_board - packages regulator init data 68 * struct max8998_board - packages regulator init data
69 * @num_regulators: number of regultors used
70 * @regulators: array of defined regulators 69 * @regulators: array of defined regulators
70 * @num_regulators: number of regultors used
71 * @irq_base: base IRQ number for max8998, required for IRQs
72 * @ono: power onoff IRQ number for max8998
73 * @buck_voltage_lock: Do NOT change the values of the following six
74 * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot
75 * be other than the preset values.
76 * @buck1_voltage1: BUCK1 DVS mode 1 voltage register
77 * @buck1_voltage2: BUCK1 DVS mode 2 voltage register
78 * @buck1_voltage3: BUCK1 DVS mode 3 voltage register
79 * @buck1_voltage4: BUCK1 DVS mode 4 voltage register
80 * @buck2_voltage1: BUCK2 DVS mode 1 voltage register
81 * @buck2_voltage2: BUCK2 DVS mode 2 voltage register
82 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
83 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
84 * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2
85 * @buck2_set3: BUCK2 gpio pin to set output voltage
86 * @buck2_default_idx: Default for BUCK2 gpio pin.
87 * @wakeup: Allow to wake up from suspend
88 * @rtc_delay: LP3974 RTC chip bug that requires delay after a register
89 * write before reading it.
71 */ 90 */
72
73struct max8998_platform_data { 91struct max8998_platform_data {
74 int num_regulators;
75 struct max8998_regulator_data *regulators; 92 struct max8998_regulator_data *regulators;
93 int num_regulators;
94 int irq_base;
95 int ono;
96 bool buck_voltage_lock;
97 int buck1_voltage1;
98 int buck1_voltage2;
99 int buck1_voltage3;
100 int buck1_voltage4;
101 int buck2_voltage1;
102 int buck2_voltage2;
103 int buck1_set1;
104 int buck1_set2;
105 int buck1_default_idx;
106 int buck2_set3;
107 int buck2_default_idx;
108 bool wakeup;
109 bool rtc_delay;
76}; 110};
77 111
78#endif /* __LINUX_MFD_MAX8998_H */ 112#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 0fa44fb8dd26..7d0f3d6a0002 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright 2009 Pengutronix 2 * Copyright 2010 Yong Shen <yong.shen@linaro.org>
3 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 * 5 *
5 * This program is free software; you can redistribute it and/or modify it under 6 * This program is free software; you can redistribute it and/or modify it under
@@ -9,48 +10,83 @@
9#ifndef __LINUX_MFD_MC13783_H 10#ifndef __LINUX_MFD_MC13783_H
10#define __LINUX_MFD_MC13783_H 11#define __LINUX_MFD_MC13783_H
11 12
12#include <linux/interrupt.h> 13#include <linux/mfd/mc13xxx.h>
13 14
14struct mc13783; 15struct mc13783;
15 16
16void mc13783_lock(struct mc13783 *mc13783); 17struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783);
17void mc13783_unlock(struct mc13783 *mc13783);
18 18
19int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val); 19static inline void mc13783_lock(struct mc13783 *mc13783)
20int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val); 20{
21int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset, 21 mc13xxx_lock(mc13783_to_mc13xxx(mc13783));
22 u32 mask, u32 val); 22}
23
24static inline void mc13783_unlock(struct mc13783 *mc13783)
25{
26 mc13xxx_unlock(mc13783_to_mc13xxx(mc13783));
27}
28
29static inline int mc13783_reg_read(struct mc13783 *mc13783,
30 unsigned int offset, u32 *val)
31{
32 return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val);
33}
34
35static inline int mc13783_reg_write(struct mc13783 *mc13783,
36 unsigned int offset, u32 val)
37{
38 return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val);
39}
40
41static inline int mc13783_reg_rmw(struct mc13783 *mc13783,
42 unsigned int offset, u32 mask, u32 val)
43{
44 return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val);
45}
23 46
24int mc13783_get_flags(struct mc13783 *mc13783); 47static inline int mc13783_get_flags(struct mc13783 *mc13783)
48{
49 return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783));
50}
25 51
26int mc13783_irq_request(struct mc13783 *mc13783, int irq, 52static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq,
27 irq_handler_t handler, const char *name, void *dev); 53 irq_handler_t handler, const char *name, void *dev)
28int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, 54{
29 irq_handler_t handler, const char *name, void *dev); 55 return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq,
30int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); 56 handler, name, dev);
57}
31 58
32int mc13783_irq_mask(struct mc13783 *mc13783, int irq); 59static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
33int mc13783_irq_unmask(struct mc13783 *mc13783, int irq); 60 irq_handler_t handler, const char *name, void *dev)
34int mc13783_irq_status(struct mc13783 *mc13783, int irq, 61{
35 int *enabled, int *pending); 62 return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq,
36int mc13783_irq_ack(struct mc13783 *mc13783, int irq); 63 handler, name, dev);
64}
37 65
38static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated; 66static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev)
39static inline int mc13783_mask(struct mc13783 *mc13783, int irq)
40{ 67{
41 return mc13783_irq_mask(mc13783, irq); 68 return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev);
42} 69}
43 70
44static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated; 71static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
45static inline int mc13783_unmask(struct mc13783 *mc13783, int irq)
46{ 72{
47 return mc13783_irq_unmask(mc13783, irq); 73 return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq);
48} 74}
49 75
50static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated; 76static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq)
51static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
52{ 77{
53 return mc13783_irq_ack(mc13783, irq); 78 return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq);
79}
80static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq,
81 int *enabled, int *pending)
82{
83 return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783),
84 irq, enabled, pending);
85}
86
87static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
88{
89 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq);
54} 90}
55 91
56#define MC13783_ADC0 43 92#define MC13783_ADC0 43
@@ -66,96 +102,18 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
66 MC13783_ADC0_TSMOD1 | \ 102 MC13783_ADC0_TSMOD1 | \
67 MC13783_ADC0_TSMOD2) 103 MC13783_ADC0_TSMOD2)
68 104
69struct mc13783_led_platform_data { 105#define mc13783_regulator_init_data mc13xxx_regulator_init_data
70#define MC13783_LED_MD 0 106#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
71#define MC13783_LED_AD 1 107#define mc13783_led_platform_data mc13xxx_led_platform_data
72#define MC13783_LED_KP 2 108#define mc13783_leds_platform_data mc13xxx_leds_platform_data
73#define MC13783_LED_R1 3 109
74#define MC13783_LED_G1 4 110#define mc13783_platform_data mc13xxx_platform_data
75#define MC13783_LED_B1 5 111#define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN
76#define MC13783_LED_R2 6 112#define MC13783_USE_CODEC MC13XXX_USE_CODEC
77#define MC13783_LED_G2 7 113#define MC13783_USE_ADC MC13XXX_USE_ADC
78#define MC13783_LED_B2 8 114#define MC13783_USE_RTC MC13XXX_USE_RTC
79#define MC13783_LED_R3 9 115#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR
80#define MC13783_LED_G3 10 116#define MC13783_USE_LED MC13XXX_USE_LED
81#define MC13783_LED_B3 11
82#define MC13783_LED_MAX MC13783_LED_B3
83 int id;
84 const char *name;
85 const char *default_trigger;
86
87/* Three or two bits current selection depending on the led */
88 char max_current;
89};
90
91struct mc13783_leds_platform_data {
92 int num_leds;
93 struct mc13783_led_platform_data *led;
94
95#define MC13783_LED_TRIODE_MD (1 << 0)
96#define MC13783_LED_TRIODE_AD (1 << 1)
97#define MC13783_LED_TRIODE_KP (1 << 2)
98#define MC13783_LED_BOOST_EN (1 << 3)
99#define MC13783_LED_TC1HALF (1 << 4)
100#define MC13783_LED_SLEWLIMTC (1 << 5)
101#define MC13783_LED_SLEWLIMBL (1 << 6)
102#define MC13783_LED_TRIODE_TC1 (1 << 7)
103#define MC13783_LED_TRIODE_TC2 (1 << 8)
104#define MC13783_LED_TRIODE_TC3 (1 << 9)
105 int flags;
106
107#define MC13783_LED_AB_DISABLED 0
108#define MC13783_LED_AB_MD1 1
109#define MC13783_LED_AB_MD12 2
110#define MC13783_LED_AB_MD123 3
111#define MC13783_LED_AB_MD1234 4
112#define MC13783_LED_AB_MD1234_AD1 5
113#define MC13783_LED_AB_MD1234_AD12 6
114#define MC13783_LED_AB_MD1_AD 7
115 char abmode;
116
117#define MC13783_LED_ABREF_200MV 0
118#define MC13783_LED_ABREF_400MV 1
119#define MC13783_LED_ABREF_600MV 2
120#define MC13783_LED_ABREF_800MV 3
121 char abref;
122
123#define MC13783_LED_PERIOD_10MS 0
124#define MC13783_LED_PERIOD_100MS 1
125#define MC13783_LED_PERIOD_500MS 2
126#define MC13783_LED_PERIOD_2S 3
127 char bl_period;
128 char tc1_period;
129 char tc2_period;
130 char tc3_period;
131};
132
133/* to be cleaned up */
134struct regulator_init_data;
135
136struct mc13783_regulator_init_data {
137 int id;
138 struct regulator_init_data *init_data;
139};
140
141struct mc13783_regulator_platform_data {
142 int num_regulators;
143 struct mc13783_regulator_init_data *regulators;
144};
145
146struct mc13783_platform_data {
147 int num_regulators;
148 struct mc13783_regulator_init_data *regulators;
149 struct mc13783_leds_platform_data *leds;
150
151#define MC13783_USE_TOUCHSCREEN (1 << 0)
152#define MC13783_USE_CODEC (1 << 1)
153#define MC13783_USE_ADC (1 << 2)
154#define MC13783_USE_RTC (1 << 3)
155#define MC13783_USE_REGULATOR (1 << 4)
156#define MC13783_USE_LED (1 << 5)
157 unsigned int flags;
158};
159 117
160#define MC13783_ADC_MODE_TS 1 118#define MC13783_ADC_MODE_TS 1
161#define MC13783_ADC_MODE_SINGLE_CHAN 2 119#define MC13783_ADC_MODE_SINGLE_CHAN 2
@@ -165,80 +123,80 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
165 unsigned int channel, unsigned int *sample); 123 unsigned int channel, unsigned int *sample);
166 124
167 125
168#define MC13783_SW_SW1A 0 126#define MC13783_REG_SW1A 0
169#define MC13783_SW_SW1B 1 127#define MC13783_REG_SW1B 1
170#define MC13783_SW_SW2A 2 128#define MC13783_REG_SW2A 2
171#define MC13783_SW_SW2B 3 129#define MC13783_REG_SW2B 3
172#define MC13783_SW_SW3 4 130#define MC13783_REG_SW3 4
173#define MC13783_SW_PLL 5 131#define MC13783_REG_PLL 5
174#define MC13783_REGU_VAUDIO 6 132#define MC13783_REG_VAUDIO 6
175#define MC13783_REGU_VIOHI 7 133#define MC13783_REG_VIOHI 7
176#define MC13783_REGU_VIOLO 8 134#define MC13783_REG_VIOLO 8
177#define MC13783_REGU_VDIG 9 135#define MC13783_REG_VDIG 9
178#define MC13783_REGU_VGEN 10 136#define MC13783_REG_VGEN 10
179#define MC13783_REGU_VRFDIG 11 137#define MC13783_REG_VRFDIG 11
180#define MC13783_REGU_VRFREF 12 138#define MC13783_REG_VRFREF 12
181#define MC13783_REGU_VRFCP 13 139#define MC13783_REG_VRFCP 13
182#define MC13783_REGU_VSIM 14 140#define MC13783_REG_VSIM 14
183#define MC13783_REGU_VESIM 15 141#define MC13783_REG_VESIM 15
184#define MC13783_REGU_VCAM 16 142#define MC13783_REG_VCAM 16
185#define MC13783_REGU_VRFBG 17 143#define MC13783_REG_VRFBG 17
186#define MC13783_REGU_VVIB 18 144#define MC13783_REG_VVIB 18
187#define MC13783_REGU_VRF1 19 145#define MC13783_REG_VRF1 19
188#define MC13783_REGU_VRF2 20 146#define MC13783_REG_VRF2 20
189#define MC13783_REGU_VMMC1 21 147#define MC13783_REG_VMMC1 21
190#define MC13783_REGU_VMMC2 22 148#define MC13783_REG_VMMC2 22
191#define MC13783_REGU_GPO1 23 149#define MC13783_REG_GPO1 23
192#define MC13783_REGU_GPO2 24 150#define MC13783_REG_GPO2 24
193#define MC13783_REGU_GPO3 25 151#define MC13783_REG_GPO3 25
194#define MC13783_REGU_GPO4 26 152#define MC13783_REG_GPO4 26
195#define MC13783_REGU_V1 27 153#define MC13783_REG_V1 27
196#define MC13783_REGU_V2 28 154#define MC13783_REG_V2 28
197#define MC13783_REGU_V3 29 155#define MC13783_REG_V3 29
198#define MC13783_REGU_V4 30 156#define MC13783_REG_V4 30
199#define MC13783_REGU_PWGT1SPI 31 157#define MC13783_REG_PWGT1SPI 31
200#define MC13783_REGU_PWGT2SPI 32 158#define MC13783_REG_PWGT2SPI 32
201 159
202#define MC13783_IRQ_ADCDONE 0 160#define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE
203#define MC13783_IRQ_ADCBISDONE 1 161#define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE
204#define MC13783_IRQ_TS 2 162#define MC13783_IRQ_TS MC13XXX_IRQ_TS
205#define MC13783_IRQ_WHIGH 3 163#define MC13783_IRQ_WHIGH 3
206#define MC13783_IRQ_WLOW 4 164#define MC13783_IRQ_WLOW 4
207#define MC13783_IRQ_CHGDET 6 165#define MC13783_IRQ_CHGDET MC13XXX_IRQ_CHGDET
208#define MC13783_IRQ_CHGOV 7 166#define MC13783_IRQ_CHGOV 7
209#define MC13783_IRQ_CHGREV 8 167#define MC13783_IRQ_CHGREV MC13XXX_IRQ_CHGREV
210#define MC13783_IRQ_CHGSHORT 9 168#define MC13783_IRQ_CHGSHORT MC13XXX_IRQ_CHGSHORT
211#define MC13783_IRQ_CCCV 10 169#define MC13783_IRQ_CCCV MC13XXX_IRQ_CCCV
212#define MC13783_IRQ_CHGCURR 11 170#define MC13783_IRQ_CHGCURR MC13XXX_IRQ_CHGCURR
213#define MC13783_IRQ_BPON 12 171#define MC13783_IRQ_BPON MC13XXX_IRQ_BPON
214#define MC13783_IRQ_LOBATL 13 172#define MC13783_IRQ_LOBATL MC13XXX_IRQ_LOBATL
215#define MC13783_IRQ_LOBATH 14 173#define MC13783_IRQ_LOBATH MC13XXX_IRQ_LOBATH
216#define MC13783_IRQ_UDP 15 174#define MC13783_IRQ_UDP 15
217#define MC13783_IRQ_USB 16 175#define MC13783_IRQ_USB 16
218#define MC13783_IRQ_ID 19 176#define MC13783_IRQ_ID 19
219#define MC13783_IRQ_SE1 21 177#define MC13783_IRQ_SE1 21
220#define MC13783_IRQ_CKDET 22 178#define MC13783_IRQ_CKDET 22
221#define MC13783_IRQ_UDM 23 179#define MC13783_IRQ_UDM 23
222#define MC13783_IRQ_1HZ 24 180#define MC13783_IRQ_1HZ MC13XXX_IRQ_1HZ
223#define MC13783_IRQ_TODA 25 181#define MC13783_IRQ_TODA MC13XXX_IRQ_TODA
224#define MC13783_IRQ_ONOFD1 27 182#define MC13783_IRQ_ONOFD1 27
225#define MC13783_IRQ_ONOFD2 28 183#define MC13783_IRQ_ONOFD2 28
226#define MC13783_IRQ_ONOFD3 29 184#define MC13783_IRQ_ONOFD3 29
227#define MC13783_IRQ_SYSRST 30 185#define MC13783_IRQ_SYSRST MC13XXX_IRQ_SYSRST
228#define MC13783_IRQ_RTCRST 31 186#define MC13783_IRQ_RTCRST MC13XXX_IRQ_RTCRST
229#define MC13783_IRQ_PC 32 187#define MC13783_IRQ_PC MC13XXX_IRQ_PC
230#define MC13783_IRQ_WARM 33 188#define MC13783_IRQ_WARM MC13XXX_IRQ_WARM
231#define MC13783_IRQ_MEMHLD 34 189#define MC13783_IRQ_MEMHLD MC13XXX_IRQ_MEMHLD
232#define MC13783_IRQ_PWRRDY 35 190#define MC13783_IRQ_PWRRDY 35
233#define MC13783_IRQ_THWARNL 36 191#define MC13783_IRQ_THWARNL MC13XXX_IRQ_THWARNL
234#define MC13783_IRQ_THWARNH 37 192#define MC13783_IRQ_THWARNH MC13XXX_IRQ_THWARNH
235#define MC13783_IRQ_CLK 38 193#define MC13783_IRQ_CLK MC13XXX_IRQ_CLK
236#define MC13783_IRQ_SEMAF 39 194#define MC13783_IRQ_SEMAF 39
237#define MC13783_IRQ_MC2B 41 195#define MC13783_IRQ_MC2B 41
238#define MC13783_IRQ_HSDET 42 196#define MC13783_IRQ_HSDET 42
239#define MC13783_IRQ_HSL 43 197#define MC13783_IRQ_HSL 43
240#define MC13783_IRQ_ALSPTH 44 198#define MC13783_IRQ_ALSPTH 44
241#define MC13783_IRQ_AHSSHORT 45 199#define MC13783_IRQ_AHSSHORT 45
242#define MC13783_NUM_IRQ 46 200#define MC13783_NUM_IRQ MC13XXX_NUM_IRQ
243 201
244#endif /* __LINUX_MFD_MC13783_H */ 202#endif /* ifndef __LINUX_MFD_MC13783_H */
diff --git a/include/linux/mfd/mc13892.h b/include/linux/mfd/mc13892.h
new file mode 100644
index 000000000000..a00f2bec178c
--- /dev/null
+++ b/include/linux/mfd/mc13892.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2010 Yong Shen <yong.shen@linaro.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#ifndef __LINUX_MFD_MC13892_H
10#define __LINUX_MFD_MC13892_H
11
12#include <linux/mfd/mc13xxx.h>
13
14#define MC13892_SW1 0
15#define MC13892_SW2 1
16#define MC13892_SW3 2
17#define MC13892_SW4 3
18#define MC13892_SWBST 4
19#define MC13892_VIOHI 5
20#define MC13892_VPLL 6
21#define MC13892_VDIG 7
22#define MC13892_VSD 8
23#define MC13892_VUSB2 9
24#define MC13892_VVIDEO 10
25#define MC13892_VAUDIO 11
26#define MC13892_VCAM 12
27#define MC13892_VGEN1 13
28#define MC13892_VGEN2 14
29#define MC13892_VGEN3 15
30#define MC13892_VUSB 16
31#define MC13892_GPO1 17
32#define MC13892_GPO2 18
33#define MC13892_GPO3 19
34#define MC13892_GPO4 20
35#define MC13892_PWGT1SPI 21
36#define MC13892_PWGT2SPI 22
37#define MC13892_VCOINCELL 23
38
39#endif
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
new file mode 100644
index 000000000000..c064beaaccb7
--- /dev/null
+++ b/include/linux/mfd/mc13xxx.h
@@ -0,0 +1,153 @@
1/*
2 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#ifndef __LINUX_MFD_MC13XXX_H
10#define __LINUX_MFD_MC13XXX_H
11
12#include <linux/interrupt.h>
13
14struct mc13xxx;
15
16void mc13xxx_lock(struct mc13xxx *mc13xxx);
17void mc13xxx_unlock(struct mc13xxx *mc13xxx);
18
19int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val);
20int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val);
21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
22 u32 mask, u32 val);
23
24int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
25
26int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
27 irq_handler_t handler, const char *name, void *dev);
28int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
29 irq_handler_t handler, const char *name, void *dev);
30int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev);
31
32int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq);
33int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq);
34int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq,
35 int *enabled, int *pending);
36int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq);
37
38int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
39
40#define MC13XXX_IRQ_ADCDONE 0
41#define MC13XXX_IRQ_ADCBISDONE 1
42#define MC13XXX_IRQ_TS 2
43#define MC13XXX_IRQ_CHGDET 6
44#define MC13XXX_IRQ_CHGREV 8
45#define MC13XXX_IRQ_CHGSHORT 9
46#define MC13XXX_IRQ_CCCV 10
47#define MC13XXX_IRQ_CHGCURR 11
48#define MC13XXX_IRQ_BPON 12
49#define MC13XXX_IRQ_LOBATL 13
50#define MC13XXX_IRQ_LOBATH 14
51#define MC13XXX_IRQ_1HZ 24
52#define MC13XXX_IRQ_TODA 25
53#define MC13XXX_IRQ_SYSRST 30
54#define MC13XXX_IRQ_RTCRST 31
55#define MC13XXX_IRQ_PC 32
56#define MC13XXX_IRQ_WARM 33
57#define MC13XXX_IRQ_MEMHLD 34
58#define MC13XXX_IRQ_THWARNL 36
59#define MC13XXX_IRQ_THWARNH 37
60#define MC13XXX_IRQ_CLK 38
61
62#define MC13XXX_NUM_IRQ 46
63
64struct regulator_init_data;
65
66struct mc13xxx_regulator_init_data {
67 int id;
68 struct regulator_init_data *init_data;
69};
70
71struct mc13xxx_regulator_platform_data {
72 int num_regulators;
73 struct mc13xxx_regulator_init_data *regulators;
74};
75
76struct mc13xxx_led_platform_data {
77#define MC13783_LED_MD 0
78#define MC13783_LED_AD 1
79#define MC13783_LED_KP 2
80#define MC13783_LED_R1 3
81#define MC13783_LED_G1 4
82#define MC13783_LED_B1 5
83#define MC13783_LED_R2 6
84#define MC13783_LED_G2 7
85#define MC13783_LED_B2 8
86#define MC13783_LED_R3 9
87#define MC13783_LED_G3 10
88#define MC13783_LED_B3 11
89#define MC13783_LED_MAX MC13783_LED_B3
90 int id;
91 const char *name;
92 const char *default_trigger;
93
94/* Three or two bits current selection depending on the led */
95 char max_current;
96};
97
98struct mc13xxx_leds_platform_data {
99 int num_leds;
100 struct mc13xxx_led_platform_data *led;
101
102#define MC13783_LED_TRIODE_MD (1 << 0)
103#define MC13783_LED_TRIODE_AD (1 << 1)
104#define MC13783_LED_TRIODE_KP (1 << 2)
105#define MC13783_LED_BOOST_EN (1 << 3)
106#define MC13783_LED_TC1HALF (1 << 4)
107#define MC13783_LED_SLEWLIMTC (1 << 5)
108#define MC13783_LED_SLEWLIMBL (1 << 6)
109#define MC13783_LED_TRIODE_TC1 (1 << 7)
110#define MC13783_LED_TRIODE_TC2 (1 << 8)
111#define MC13783_LED_TRIODE_TC3 (1 << 9)
112 int flags;
113
114#define MC13783_LED_AB_DISABLED 0
115#define MC13783_LED_AB_MD1 1
116#define MC13783_LED_AB_MD12 2
117#define MC13783_LED_AB_MD123 3
118#define MC13783_LED_AB_MD1234 4
119#define MC13783_LED_AB_MD1234_AD1 5
120#define MC13783_LED_AB_MD1234_AD12 6
121#define MC13783_LED_AB_MD1_AD 7
122 char abmode;
123
124#define MC13783_LED_ABREF_200MV 0
125#define MC13783_LED_ABREF_400MV 1
126#define MC13783_LED_ABREF_600MV 2
127#define MC13783_LED_ABREF_800MV 3
128 char abref;
129
130#define MC13783_LED_PERIOD_10MS 0
131#define MC13783_LED_PERIOD_100MS 1
132#define MC13783_LED_PERIOD_500MS 2
133#define MC13783_LED_PERIOD_2S 3
134 char bl_period;
135 char tc1_period;
136 char tc2_period;
137 char tc3_period;
138};
139
140struct mc13xxx_platform_data {
141#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
142#define MC13XXX_USE_CODEC (1 << 1)
143#define MC13XXX_USE_ADC (1 << 2)
144#define MC13XXX_USE_RTC (1 << 3)
145#define MC13XXX_USE_REGULATOR (1 << 4)
146#define MC13XXX_USE_LED (1 << 5)
147 unsigned int flags;
148
149 struct mc13xxx_regulator_platform_data regulators;
150 struct mc13xxx_leds_platform_data *leds;
151};
152
153#endif /* ifndef __LINUX_MFD_MC13XXX_H */
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index ad411a78870c..50d4a047118d 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -227,4 +227,11 @@ static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
227 return dev_get_drvdata(dev); 227 return dev_get_drvdata(dev);
228} 228}
229 229
230int pcf50633_irq_init(struct pcf50633 *pcf, int irq);
231void pcf50633_irq_free(struct pcf50633 *pcf);
232#ifdef CONFIG_PM
233int pcf50633_irq_suspend(struct pcf50633 *pcf);
234int pcf50633_irq_resume(struct pcf50633 *pcf);
235#endif
236
230#endif 237#endif
diff --git a/include/linux/mfd/pm8xxx/core.h b/include/linux/mfd/pm8xxx/core.h
new file mode 100644
index 000000000000..bd2f4f64e931
--- /dev/null
+++ b/include/linux/mfd/pm8xxx/core.h
@@ -0,0 +1,81 @@
1/*
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13/*
14 * Qualcomm PMIC 8xxx driver header file
15 *
16 */
17
18#ifndef __MFD_PM8XXX_CORE_H
19#define __MFD_PM8XXX_CORE_H
20
21#include <linux/mfd/core.h>
22
23struct pm8xxx_drvdata {
24 int (*pmic_readb) (const struct device *dev, u16 addr, u8 *val);
25 int (*pmic_writeb) (const struct device *dev, u16 addr, u8 val);
26 int (*pmic_read_buf) (const struct device *dev, u16 addr, u8 *buf,
27 int n);
28 int (*pmic_write_buf) (const struct device *dev, u16 addr, u8 *buf,
29 int n);
30 int (*pmic_read_irq_stat) (const struct device *dev, int irq);
31 void *pm_chip_data;
32};
33
34static inline int pm8xxx_readb(const struct device *dev, u16 addr, u8 *val)
35{
36 struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
37
38 if (!dd)
39 return -EINVAL;
40 return dd->pmic_readb(dev, addr, val);
41}
42
43static inline int pm8xxx_writeb(const struct device *dev, u16 addr, u8 val)
44{
45 struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
46
47 if (!dd)
48 return -EINVAL;
49 return dd->pmic_writeb(dev, addr, val);
50}
51
52static inline int pm8xxx_read_buf(const struct device *dev, u16 addr, u8 *buf,
53 int n)
54{
55 struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
56
57 if (!dd)
58 return -EINVAL;
59 return dd->pmic_read_buf(dev, addr, buf, n);
60}
61
62static inline int pm8xxx_write_buf(const struct device *dev, u16 addr, u8 *buf,
63 int n)
64{
65 struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
66
67 if (!dd)
68 return -EINVAL;
69 return dd->pmic_write_buf(dev, addr, buf, n);
70}
71
72static inline int pm8xxx_read_irq_stat(const struct device *dev, int irq)
73{
74 struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
75
76 if (!dd)
77 return -EINVAL;
78 return dd->pmic_read_irq_stat(dev, irq);
79}
80
81#endif
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h
new file mode 100644
index 000000000000..4b21769f4483
--- /dev/null
+++ b/include/linux/mfd/pm8xxx/irq.h
@@ -0,0 +1,59 @@
1/*
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13/*
14 * Qualcomm PMIC irq 8xxx driver header file
15 *
16 */
17
18#ifndef __MFD_PM8XXX_IRQ_H
19#define __MFD_PM8XXX_IRQ_H
20
21#include <linux/errno.h>
22#include <linux/err.h>
23
24struct pm8xxx_irq_core_data {
25 u32 rev;
26 int nirqs;
27};
28
29struct pm8xxx_irq_platform_data {
30 int irq_base;
31 struct pm8xxx_irq_core_data irq_cdata;
32 int devirq;
33 int irq_trigger_flag;
34};
35
36struct pm_irq_chip;
37
38#ifdef CONFIG_MFD_PM8XXX_IRQ
39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
40struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev,
41 const struct pm8xxx_irq_platform_data *pdata);
42int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip);
43#else
44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
45{
46 return -ENXIO;
47}
48static inline struct pm_irq_chip * __devinit pm8xxx_irq_init(
49 const struct device *dev,
50 const struct pm8xxx_irq_platform_data *pdata)
51{
52 return ERR_PTR(-ENXIO);
53}
54static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip)
55{
56 return -ENXIO;
57}
58#endif /* CONFIG_MFD_PM8XXX_IRQ */
59#endif /* __MFD_PM8XXX_IRQ_H */
diff --git a/include/linux/mfd/pm8xxx/pm8921.h b/include/linux/mfd/pm8xxx/pm8921.h
new file mode 100644
index 000000000000..d5517fd32d1b
--- /dev/null
+++ b/include/linux/mfd/pm8xxx/pm8921.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13/*
14 * Qualcomm PMIC 8921 driver header file
15 *
16 */
17
18#ifndef __MFD_PM8921_H
19#define __MFD_PM8921_H
20
21#include <linux/device.h>
22#include <linux/mfd/pm8xxx/irq.h>
23
24#define PM8921_NR_IRQS 256
25
26struct pm8921_platform_data {
27 int irq_base;
28 struct pm8xxx_irq_platform_data *irq_pdata;
29};
30
31#endif
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
deleted file mode 100644
index 49067802a6d7..000000000000
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef __SH_MOBILE_SDHI_H__
2#define __SH_MOBILE_SDHI_H__
3
4#include <linux/types.h>
5
6struct sh_mobile_sdhi_info {
7 int dma_slave_tx;
8 int dma_slave_rx;
9 unsigned long tmio_flags;
10 u32 tmio_ocr_mask; /* available MMC voltages */
11 void (*set_pwr)(struct platform_device *pdev, int state);
12};
13
14#endif /* __SH_MOBILE_SDHI_H__ */
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index 39ca7588659b..e762c270d8d4 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -112,13 +112,19 @@ struct stmpe_keypad_platform_data {
112 bool no_autorepeat; 112 bool no_autorepeat;
113}; 113};
114 114
115#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)
116
115/** 117/**
116 * struct stmpe_gpio_platform_data - STMPE GPIO platform data 118 * struct stmpe_gpio_platform_data - STMPE GPIO platform data
117 * @gpio_base: first gpio number assigned. A maximum of 119 * @gpio_base: first gpio number assigned. A maximum of
118 * %STMPE_NR_GPIOS GPIOs will be allocated. 120 * %STMPE_NR_GPIOS GPIOs will be allocated.
121 * @norequest_mask: bitmask specifying which GPIOs should _not_ be
122 * requestable due to different usage (e.g. touch, keypad)
123 * STMPE_GPIO_NOREQ_* macros can be used here.
119 */ 124 */
120struct stmpe_gpio_platform_data { 125struct stmpe_gpio_platform_data {
121 int gpio_base; 126 int gpio_base;
127 unsigned norequest_mask;
122 void (*setup)(struct stmpe *stmpe, unsigned gpio_base); 128 void (*setup)(struct stmpe *stmpe, unsigned gpio_base);
123 void (*remove)(struct stmpe *stmpe, unsigned gpio_base); 129 void (*remove)(struct stmpe *stmpe, unsigned gpio_base);
124}; 130};
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h
deleted file mode 100644
index e47f770d3068..000000000000
--- a/include/linux/mfd/tc35892.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License, version 2
5 */
6
7#ifndef __LINUX_MFD_TC35892_H
8#define __LINUX_MFD_TC35892_H
9
10#include <linux/device.h>
11
12#define TC35892_RSTCTRL_IRQRST (1 << 4)
13#define TC35892_RSTCTRL_TIMRST (1 << 3)
14#define TC35892_RSTCTRL_ROTRST (1 << 2)
15#define TC35892_RSTCTRL_KBDRST (1 << 1)
16#define TC35892_RSTCTRL_GPIRST (1 << 0)
17
18#define TC35892_IRQST 0x91
19
20#define TC35892_MANFCODE_MAGIC 0x03
21#define TC35892_MANFCODE 0x80
22#define TC35892_VERSION 0x81
23#define TC35892_IOCFG 0xA7
24
25#define TC35892_CLKMODE 0x88
26#define TC35892_CLKCFG 0x89
27#define TC35892_CLKEN 0x8A
28
29#define TC35892_RSTCTRL 0x82
30#define TC35892_EXTRSTN 0x83
31#define TC35892_RSTINTCLR 0x84
32
33#define TC35892_GPIOIS0 0xC9
34#define TC35892_GPIOIS1 0xCA
35#define TC35892_GPIOIS2 0xCB
36#define TC35892_GPIOIBE0 0xCC
37#define TC35892_GPIOIBE1 0xCD
38#define TC35892_GPIOIBE2 0xCE
39#define TC35892_GPIOIEV0 0xCF
40#define TC35892_GPIOIEV1 0xD0
41#define TC35892_GPIOIEV2 0xD1
42#define TC35892_GPIOIE0 0xD2
43#define TC35892_GPIOIE1 0xD3
44#define TC35892_GPIOIE2 0xD4
45#define TC35892_GPIORIS0 0xD6
46#define TC35892_GPIORIS1 0xD7
47#define TC35892_GPIORIS2 0xD8
48#define TC35892_GPIOMIS0 0xD9
49#define TC35892_GPIOMIS1 0xDA
50#define TC35892_GPIOMIS2 0xDB
51#define TC35892_GPIOIC0 0xDC
52#define TC35892_GPIOIC1 0xDD
53#define TC35892_GPIOIC2 0xDE
54
55#define TC35892_GPIODATA0 0xC0
56#define TC35892_GPIOMASK0 0xc1
57#define TC35892_GPIODATA1 0xC2
58#define TC35892_GPIOMASK1 0xc3
59#define TC35892_GPIODATA2 0xC4
60#define TC35892_GPIOMASK2 0xC5
61
62#define TC35892_GPIODIR0 0xC6
63#define TC35892_GPIODIR1 0xC7
64#define TC35892_GPIODIR2 0xC8
65
66#define TC35892_GPIOSYNC0 0xE6
67#define TC35892_GPIOSYNC1 0xE7
68#define TC35892_GPIOSYNC2 0xE8
69
70#define TC35892_GPIOWAKE0 0xE9
71#define TC35892_GPIOWAKE1 0xEA
72#define TC35892_GPIOWAKE2 0xEB
73
74#define TC35892_GPIOODM0 0xE0
75#define TC35892_GPIOODE0 0xE1
76#define TC35892_GPIOODM1 0xE2
77#define TC35892_GPIOODE1 0xE3
78#define TC35892_GPIOODM2 0xE4
79#define TC35892_GPIOODE2 0xE5
80
81#define TC35892_INT_GPIIRQ 0
82#define TC35892_INT_TI0IRQ 1
83#define TC35892_INT_TI1IRQ 2
84#define TC35892_INT_TI2IRQ 3
85#define TC35892_INT_ROTIRQ 5
86#define TC35892_INT_KBDIRQ 6
87#define TC35892_INT_PORIRQ 7
88
89#define TC35892_NR_INTERNAL_IRQS 8
90#define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x))
91
92struct tc35892 {
93 struct mutex lock;
94 struct device *dev;
95 struct i2c_client *i2c;
96
97 int irq_base;
98 int num_gpio;
99 struct tc35892_platform_data *pdata;
100};
101
102extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data);
103extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg);
104extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length,
105 u8 *values);
106extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length,
107 const u8 *values);
108extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val);
109
110/**
111 * struct tc35892_gpio_platform_data - TC35892 GPIO platform data
112 * @gpio_base: first gpio number assigned to TC35892. A maximum of
113 * %TC35892_NR_GPIOS GPIOs will be allocated.
114 */
115struct tc35892_gpio_platform_data {
116 int gpio_base;
117};
118
119/**
120 * struct tc35892_platform_data - TC35892 platform data
121 * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used.
122 * @gpio: GPIO-specific platform data
123 */
124struct tc35892_platform_data {
125 int irq_base;
126 struct tc35892_gpio_platform_data *gpio;
127};
128
129#define TC35892_NR_GPIOS 24
130#define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS)
131
132#endif
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
new file mode 100644
index 000000000000..16c76e124f9c
--- /dev/null
+++ b/include/linux/mfd/tc3589x.h
@@ -0,0 +1,195 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License, version 2
5 */
6
7#ifndef __LINUX_MFD_TC3589x_H
8#define __LINUX_MFD_TC3589x_H
9
10#include <linux/device.h>
11
12enum tx3589x_block {
13 TC3589x_BLOCK_GPIO = 1 << 0,
14 TC3589x_BLOCK_KEYPAD = 1 << 1,
15};
16
17#define TC3589x_RSTCTRL_IRQRST (1 << 4)
18#define TC3589x_RSTCTRL_TIMRST (1 << 3)
19#define TC3589x_RSTCTRL_ROTRST (1 << 2)
20#define TC3589x_RSTCTRL_KBDRST (1 << 1)
21#define TC3589x_RSTCTRL_GPIRST (1 << 0)
22
23/* Keyboard Configuration Registers */
24#define TC3589x_KBDSETTLE_REG 0x01
25#define TC3589x_KBDBOUNCE 0x02
26#define TC3589x_KBDSIZE 0x03
27#define TC3589x_KBCFG_LSB 0x04
28#define TC3589x_KBCFG_MSB 0x05
29#define TC3589x_KBDIC 0x08
30#define TC3589x_KBDMSK 0x09
31#define TC3589x_EVTCODE_FIFO 0x10
32#define TC3589x_KBDMFS 0x8F
33
34#define TC3589x_IRQST 0x91
35
36#define TC3589x_MANFCODE_MAGIC 0x03
37#define TC3589x_MANFCODE 0x80
38#define TC3589x_VERSION 0x81
39#define TC3589x_IOCFG 0xA7
40
41#define TC3589x_CLKMODE 0x88
42#define TC3589x_CLKCFG 0x89
43#define TC3589x_CLKEN 0x8A
44
45#define TC3589x_RSTCTRL 0x82
46#define TC3589x_EXTRSTN 0x83
47#define TC3589x_RSTINTCLR 0x84
48
49/* Pull up/down configuration registers */
50#define TC3589x_IOCFG 0xA7
51#define TC3589x_IOPULLCFG0_LSB 0xAA
52#define TC3589x_IOPULLCFG0_MSB 0xAB
53#define TC3589x_IOPULLCFG1_LSB 0xAC
54#define TC3589x_IOPULLCFG1_MSB 0xAD
55#define TC3589x_IOPULLCFG2_LSB 0xAE
56
57#define TC3589x_GPIOIS0 0xC9
58#define TC3589x_GPIOIS1 0xCA
59#define TC3589x_GPIOIS2 0xCB
60#define TC3589x_GPIOIBE0 0xCC
61#define TC3589x_GPIOIBE1 0xCD
62#define TC3589x_GPIOIBE2 0xCE
63#define TC3589x_GPIOIEV0 0xCF
64#define TC3589x_GPIOIEV1 0xD0
65#define TC3589x_GPIOIEV2 0xD1
66#define TC3589x_GPIOIE0 0xD2
67#define TC3589x_GPIOIE1 0xD3
68#define TC3589x_GPIOIE2 0xD4
69#define TC3589x_GPIORIS0 0xD6
70#define TC3589x_GPIORIS1 0xD7
71#define TC3589x_GPIORIS2 0xD8
72#define TC3589x_GPIOMIS0 0xD9
73#define TC3589x_GPIOMIS1 0xDA
74#define TC3589x_GPIOMIS2 0xDB
75#define TC3589x_GPIOIC0 0xDC
76#define TC3589x_GPIOIC1 0xDD
77#define TC3589x_GPIOIC2 0xDE
78
79#define TC3589x_GPIODATA0 0xC0
80#define TC3589x_GPIOMASK0 0xc1
81#define TC3589x_GPIODATA1 0xC2
82#define TC3589x_GPIOMASK1 0xc3
83#define TC3589x_GPIODATA2 0xC4
84#define TC3589x_GPIOMASK2 0xC5
85
86#define TC3589x_GPIODIR0 0xC6
87#define TC3589x_GPIODIR1 0xC7
88#define TC3589x_GPIODIR2 0xC8
89
90#define TC3589x_GPIOSYNC0 0xE6
91#define TC3589x_GPIOSYNC1 0xE7
92#define TC3589x_GPIOSYNC2 0xE8
93
94#define TC3589x_GPIOWAKE0 0xE9
95#define TC3589x_GPIOWAKE1 0xEA
96#define TC3589x_GPIOWAKE2 0xEB
97
98#define TC3589x_GPIOODM0 0xE0
99#define TC3589x_GPIOODE0 0xE1
100#define TC3589x_GPIOODM1 0xE2
101#define TC3589x_GPIOODE1 0xE3
102#define TC3589x_GPIOODM2 0xE4
103#define TC3589x_GPIOODE2 0xE5
104
105#define TC3589x_INT_GPIIRQ 0
106#define TC3589x_INT_TI0IRQ 1
107#define TC3589x_INT_TI1IRQ 2
108#define TC3589x_INT_TI2IRQ 3
109#define TC3589x_INT_ROTIRQ 5
110#define TC3589x_INT_KBDIRQ 6
111#define TC3589x_INT_PORIRQ 7
112
113#define TC3589x_NR_INTERNAL_IRQS 8
114#define TC3589x_INT_GPIO(x) (TC3589x_NR_INTERNAL_IRQS + (x))
115
116struct tc3589x {
117 struct mutex lock;
118 struct device *dev;
119 struct i2c_client *i2c;
120
121 int irq_base;
122 int num_gpio;
123 struct tc3589x_platform_data *pdata;
124};
125
126extern int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data);
127extern int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg);
128extern int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length,
129 u8 *values);
130extern int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length,
131 const u8 *values);
132extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val);
133
134/*
135 * Keypad related platform specific constants
136 * These values may be modified for fine tuning
137 */
138#define TC_KPD_ROWS 0x8
139#define TC_KPD_COLUMNS 0x8
140#define TC_KPD_DEBOUNCE_PERIOD 0xA3
141#define TC_KPD_SETTLE_TIME 0xA3
142
143/**
144 * struct tc35893_platform_data - data structure for platform specific data
145 * @keymap_data: matrix scan code table for keycodes
146 * @krow: mask for available rows, value is 0xFF
147 * @kcol: mask for available columns, value is 0xFF
148 * @debounce_period: platform specific debounce time
149 * @settle_time: platform specific settle down time
150 * @irqtype: type of interrupt, falling or rising edge
151 * @enable_wakeup: specifies if keypad event can wake up system from sleep
152 * @no_autorepeat: flag for auto repetition
153 */
154struct tc3589x_keypad_platform_data {
155 const struct matrix_keymap_data *keymap_data;
156 u8 krow;
157 u8 kcol;
158 u8 debounce_period;
159 u8 settle_time;
160 unsigned long irqtype;
161 bool enable_wakeup;
162 bool no_autorepeat;
163};
164
165/**
166 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
167 * @gpio_base: first gpio number assigned to TC3589x. A maximum of
168 * %TC3589x_NR_GPIOS GPIOs will be allocated.
169 * @setup: callback for board-specific initialization
170 * @remove: callback for board-specific teardown
171 */
172struct tc3589x_gpio_platform_data {
173 int gpio_base;
174 void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base);
175 void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base);
176};
177
178/**
179 * struct tc3589x_platform_data - TC3589x platform data
180 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
181 * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used.
182 * @gpio: GPIO-specific platform data
183 * @keypad: keypad-specific platform data
184 */
185struct tc3589x_platform_data {
186 unsigned int block;
187 int irq_base;
188 struct tc3589x_gpio_platform_data *gpio;
189 const struct tc3589x_keypad_platform_data *keypad;
190};
191
192#define TC3589x_NR_GPIOS 24
193#define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
194
195#endif
diff --git a/include/linux/mfd/ti_ssp.h b/include/linux/mfd/ti_ssp.h
new file mode 100644
index 000000000000..dbb4b43bd20e
--- /dev/null
+++ b/include/linux/mfd/ti_ssp.h
@@ -0,0 +1,93 @@
1/*
2 * Sequencer Serial Port (SSP) driver for Texas Instruments' SoCs
3 *
4 * Copyright (C) 2010 Texas Instruments Inc
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __TI_SSP_H__
22#define __TI_SSP_H__
23
24struct ti_ssp_dev_data {
25 const char *dev_name;
26 void *pdata;
27 size_t pdata_size;
28};
29
30struct ti_ssp_data {
31 unsigned long out_clock;
32 struct ti_ssp_dev_data dev_data[2];
33};
34
35struct ti_ssp_spi_data {
36 unsigned long iosel;
37 int num_cs;
38 void (*select)(int cs);
39};
40
41/*
42 * Sequencer port IO pin configuration bits. These do not correlate 1-1 with
43 * the hardware. The iosel field in the port data combines iosel1 and iosel2,
44 * and is therefore not a direct map to register space. It is best to use the
45 * macros below to construct iosel values.
46 *
47 * least significant 16 bits --> iosel1
48 * most significant 16 bits --> iosel2
49 */
50
51#define SSP_IN 0x0000
52#define SSP_DATA 0x0001
53#define SSP_CLOCK 0x0002
54#define SSP_CHIPSEL 0x0003
55#define SSP_OUT 0x0004
56#define SSP_PIN_SEL(pin, v) ((v) << ((pin) * 3))
57#define SSP_PIN_MASK(pin) SSP_PIN_SEL(pin, 0x7)
58#define SSP_INPUT_SEL(pin) ((pin) << 16)
59
60/* Sequencer port config bits */
61#define SSP_EARLY_DIN BIT(8)
62#define SSP_DELAY_DOUT BIT(9)
63
64/* Sequence map definitions */
65#define SSP_CLK_HIGH BIT(0)
66#define SSP_CLK_LOW 0
67#define SSP_DATA_HIGH BIT(1)
68#define SSP_DATA_LOW 0
69#define SSP_CS_HIGH BIT(2)
70#define SSP_CS_LOW 0
71#define SSP_OUT_MODE BIT(3)
72#define SSP_IN_MODE 0
73#define SSP_DATA_REG BIT(4)
74#define SSP_ADDR_REG 0
75
76#define SSP_OPCODE_DIRECT ((0x0) << 5)
77#define SSP_OPCODE_TOGGLE ((0x1) << 5)
78#define SSP_OPCODE_SHIFT ((0x2) << 5)
79#define SSP_OPCODE_BRANCH0 ((0x4) << 5)
80#define SSP_OPCODE_BRANCH1 ((0x5) << 5)
81#define SSP_OPCODE_BRANCH ((0x6) << 5)
82#define SSP_OPCODE_STOP ((0x7) << 5)
83#define SSP_BRANCH(addr) ((addr) << 8)
84#define SSP_COUNT(cycles) ((cycles) << 8)
85
86int ti_ssp_raw_read(struct device *dev);
87int ti_ssp_raw_write(struct device *dev, u32 val);
88int ti_ssp_load(struct device *dev, int offs, u32* prog, int len);
89int ti_ssp_run(struct device *dev, u32 pc, u32 input, u32 *output);
90int ti_ssp_set_mode(struct device *dev, int mode);
91int ti_ssp_set_iosel(struct device *dev, u32 iosel);
92
93#endif /* __TI_SSP_H__ */
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f07425bc3dcd..5a90266c3a5a 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -4,6 +4,7 @@
4#include <linux/fb.h> 4#include <linux/fb.h>
5#include <linux/io.h> 5#include <linux/io.h>
6#include <linux/platform_device.h> 6#include <linux/platform_device.h>
7#include <linux/pm_runtime.h>
7 8
8#define tmio_ioread8(addr) readb(addr) 9#define tmio_ioread8(addr) readb(addr)
9#define tmio_ioread16(addr) readw(addr) 10#define tmio_ioread16(addr) readw(addr)
@@ -52,6 +53,21 @@
52 53
53/* tmio MMC platform flags */ 54/* tmio MMC platform flags */
54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) 55#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
56/*
57 * Some controllers can support a 2-byte block size when the bus width
58 * is configured in 4-bit mode.
59 */
60#define TMIO_MMC_BLKSZ_2BYTES (1 << 1)
61/*
62 * Some controllers can support SDIO IRQ signalling.
63 */
64#define TMIO_MMC_SDIO_IRQ (1 << 2)
65/*
66 * Some platforms can detect card insertion events with controller powered
67 * down, in which case they have to call tmio_mmc_cd_wakeup() to power up the
68 * controller and report the event to the driver.
69 */
70#define TMIO_MMC_HAS_COLD_CD (1 << 3)
55 71
56int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 72int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
57int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 73int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -61,6 +77,7 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
61struct tmio_mmc_dma { 77struct tmio_mmc_dma {
62 void *chan_priv_tx; 78 void *chan_priv_tx;
63 void *chan_priv_rx; 79 void *chan_priv_rx;
80 int alignment_shift;
64}; 81};
65 82
66/* 83/*
@@ -72,10 +89,21 @@ struct tmio_mmc_data {
72 unsigned long flags; 89 unsigned long flags;
73 u32 ocr_mask; /* available voltages */ 90 u32 ocr_mask; /* available voltages */
74 struct tmio_mmc_dma *dma; 91 struct tmio_mmc_dma *dma;
92 struct device *dev;
93 bool power;
75 void (*set_pwr)(struct platform_device *host, int state); 94 void (*set_pwr)(struct platform_device *host, int state);
76 void (*set_clk_div)(struct platform_device *host, int state); 95 void (*set_clk_div)(struct platform_device *host, int state);
96 int (*get_cd)(struct platform_device *host);
77}; 97};
78 98
99static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata)
100{
101 if (pdata && !pdata->power) {
102 pdata->power = true;
103 pm_runtime_get(pdata->dev);
104 }
105}
106
79/* 107/*
80 * data for the NAND controller 108 * data for the NAND controller
81 */ 109 */
diff --git a/include/linux/mfd/tps6105x.h b/include/linux/mfd/tps6105x.h
new file mode 100644
index 000000000000..386743dd931c
--- /dev/null
+++ b/include/linux/mfd/tps6105x.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (C) 2011 ST-Ericsson SA
3 * Written on behalf of Linaro for ST-Ericsson
4 *
5 * Author: Linus Walleij <linus.walleij@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9#ifndef MFD_TPS6105X_H
10#define MFD_TPS6105X_H
11
12#include <linux/i2c.h>
13#include <linux/regulator/machine.h>
14
15/*
16 * Register definitions to all subdrivers
17 */
18#define TPS6105X_REG_0 0x00
19#define TPS6105X_REG0_MODE_SHIFT 6
20#define TPS6105X_REG0_MODE_MASK (0x03<<6)
21/* These defines for both reg0 and reg1 */
22#define TPS6105X_REG0_MODE_SHUTDOWN 0x00
23#define TPS6105X_REG0_MODE_TORCH 0x01
24#define TPS6105X_REG0_MODE_TORCH_FLASH 0x02
25#define TPS6105X_REG0_MODE_VOLTAGE 0x03
26#define TPS6105X_REG0_VOLTAGE_SHIFT 4
27#define TPS6105X_REG0_VOLTAGE_MASK (3<<4)
28#define TPS6105X_REG0_VOLTAGE_450 0
29#define TPS6105X_REG0_VOLTAGE_500 1
30#define TPS6105X_REG0_VOLTAGE_525 2
31#define TPS6105X_REG0_VOLTAGE_500_2 3
32#define TPS6105X_REG0_DIMMING_SHIFT 3
33#define TPS6105X_REG0_TORCHC_SHIFT 0
34#define TPS6105X_REG0_TORCHC_MASK (7<<0)
35#define TPS6105X_REG0_TORCHC_0 0x00
36#define TPS6105X_REG0_TORCHC_50 0x01
37#define TPS6105X_REG0_TORCHC_75 0x02
38#define TPS6105X_REG0_TORCHC_100 0x03
39#define TPS6105X_REG0_TORCHC_150 0x04
40#define TPS6105X_REG0_TORCHC_200 0x05
41#define TPS6105X_REG0_TORCHC_250_400 0x06
42#define TPS6105X_REG0_TORCHC_250_500 0x07
43#define TPS6105X_REG_1 0x01
44#define TPS6105X_REG1_MODE_SHIFT 6
45#define TPS6105X_REG1_MODE_MASK (0x03<<6)
46#define TPS6105X_REG1_MODE_SHUTDOWN 0x00
47#define TPS6105X_REG1_MODE_TORCH 0x01
48#define TPS6105X_REG1_MODE_TORCH_FLASH 0x02
49#define TPS6105X_REG1_MODE_VOLTAGE 0x03
50#define TPS6105X_REG_2 0x02
51#define TPS6105X_REG_3 0x03
52
53/**
54 * enum tps6105x_mode - desired mode for the TPS6105x
55 * @TPS6105X_MODE_SHUTDOWN: this instance is inactive, not used for anything
56 * @TPS61905X_MODE_TORCH: this instance is used as a LED, usually a while
57 * LED, for example as backlight or flashlight. If this is set, the
58 * TPS6105X will register to the LED framework
59 * @TPS6105X_MODE_TORCH_FLASH: this instance is used as a flashgun, usually
60 * in a camera
61 * @TPS6105X_MODE_VOLTAGE: this instance is used as a voltage regulator and
62 * will register to the regulator framework
63 */
64enum tps6105x_mode {
65 TPS6105X_MODE_SHUTDOWN,
66 TPS6105X_MODE_TORCH,
67 TPS6105X_MODE_TORCH_FLASH,
68 TPS6105X_MODE_VOLTAGE,
69};
70
71/**
72 * struct tps6105x_platform_data - TPS61905x platform data
73 * @mode: what mode this instance shall be operated in,
74 * this is not selectable at runtime
75 * @regulator_data: initialization data for the voltage
76 * regulator if used as a voltage source
77 */
78struct tps6105x_platform_data {
79 enum tps6105x_mode mode;
80 struct regulator_init_data *regulator_data;
81};
82
83/**
84 * struct tps6105x - state holder for the TPS6105x drivers
85 * @mutex: mutex to serialize I2C accesses
86 * @i2c_client: corresponding I2C client
87 * @regulator: regulator device if used in voltage mode
88 */
89struct tps6105x {
90 struct tps6105x_platform_data *pdata;
91 struct mutex lock;
92 struct i2c_client *client;
93 struct regulator_dev *regulator;
94};
95
96extern int tps6105x_set(struct tps6105x *tps6105x, u8 reg, u8 value);
97extern int tps6105x_get(struct tps6105x *tps6105x, u8 reg, u8 *buf);
98extern int tps6105x_mask_and_set(struct tps6105x *tps6105x, u8 reg,
99 u8 bitmask, u8 bitvalues);
100
101#endif
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 772b3ae640af..b6bab1b04e25 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -18,6 +18,36 @@ enum {
18 TPS6586X_ID_LDO_RTC, 18 TPS6586X_ID_LDO_RTC,
19}; 19};
20 20
21enum {
22 TPS6586X_INT_PLDO_0,
23 TPS6586X_INT_PLDO_1,
24 TPS6586X_INT_PLDO_2,
25 TPS6586X_INT_PLDO_3,
26 TPS6586X_INT_PLDO_4,
27 TPS6586X_INT_PLDO_5,
28 TPS6586X_INT_PLDO_6,
29 TPS6586X_INT_PLDO_7,
30 TPS6586X_INT_COMP_DET,
31 TPS6586X_INT_ADC,
32 TPS6586X_INT_PLDO_8,
33 TPS6586X_INT_PLDO_9,
34 TPS6586X_INT_PSM_0,
35 TPS6586X_INT_PSM_1,
36 TPS6586X_INT_PSM_2,
37 TPS6586X_INT_PSM_3,
38 TPS6586X_INT_RTC_ALM1,
39 TPS6586X_INT_ACUSB_OVP,
40 TPS6586X_INT_USB_DET,
41 TPS6586X_INT_AC_DET,
42 TPS6586X_INT_BAT_DET,
43 TPS6586X_INT_CHG_STAT,
44 TPS6586X_INT_CHG_TEMP,
45 TPS6586X_INT_PP,
46 TPS6586X_INT_RESUME,
47 TPS6586X_INT_LOW_SYS,
48 TPS6586X_INT_RTC_ALM2,
49};
50
21struct tps6586x_subdev_info { 51struct tps6586x_subdev_info {
22 int id; 52 int id;
23 const char *name; 53 const char *name;
@@ -29,6 +59,7 @@ struct tps6586x_platform_data {
29 struct tps6586x_subdev_info *subdevs; 59 struct tps6586x_subdev_info *subdevs;
30 60
31 int gpio_base; 61 int gpio_base;
62 int irq_base;
32}; 63};
33 64
34/* 65/*
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
new file mode 100644
index 000000000000..8bb85b930c07
--- /dev/null
+++ b/include/linux/mfd/tps65910.h
@@ -0,0 +1,800 @@
1/*
2 * tps65910.h -- TI TPS6591x
3 *
4 * Copyright 2010-2011 Texas Instruments Inc.
5 *
6 * Author: Graeme Gregory <gg@slimlogic.co.uk>
7 * Author: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
8 * Author: Arnaud Deconinck <a-deconinck@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17#ifndef __LINUX_MFD_TPS65910_H
18#define __LINUX_MFD_TPS65910_H
19
20/* TPS chip id list */
21#define TPS65910 0
22#define TPS65911 1
23
24/* TPS regulator type list */
25#define REGULATOR_LDO 0
26#define REGULATOR_DCDC 1
27
28/*
29 * List of registers for component TPS65910
30 *
31 */
32
33#define TPS65910_SECONDS 0x0
34#define TPS65910_MINUTES 0x1
35#define TPS65910_HOURS 0x2
36#define TPS65910_DAYS 0x3
37#define TPS65910_MONTHS 0x4
38#define TPS65910_YEARS 0x5
39#define TPS65910_WEEKS 0x6
40#define TPS65910_ALARM_SECONDS 0x8
41#define TPS65910_ALARM_MINUTES 0x9
42#define TPS65910_ALARM_HOURS 0xA
43#define TPS65910_ALARM_DAYS 0xB
44#define TPS65910_ALARM_MONTHS 0xC
45#define TPS65910_ALARM_YEARS 0xD
46#define TPS65910_RTC_CTRL 0x10
47#define TPS65910_RTC_STATUS 0x11
48#define TPS65910_RTC_INTERRUPTS 0x12
49#define TPS65910_RTC_COMP_LSB 0x13
50#define TPS65910_RTC_COMP_MSB 0x14
51#define TPS65910_RTC_RES_PROG 0x15
52#define TPS65910_RTC_RESET_STATUS 0x16
53#define TPS65910_BCK1 0x17
54#define TPS65910_BCK2 0x18
55#define TPS65910_BCK3 0x19
56#define TPS65910_BCK4 0x1A
57#define TPS65910_BCK5 0x1B
58#define TPS65910_PUADEN 0x1C
59#define TPS65910_REF 0x1D
60#define TPS65910_VRTC 0x1E
61#define TPS65910_VIO 0x20
62#define TPS65910_VDD1 0x21
63#define TPS65910_VDD1_OP 0x22
64#define TPS65910_VDD1_SR 0x23
65#define TPS65910_VDD2 0x24
66#define TPS65910_VDD2_OP 0x25
67#define TPS65910_VDD2_SR 0x26
68#define TPS65910_VDD3 0x27
69#define TPS65910_VDIG1 0x30
70#define TPS65910_VDIG2 0x31
71#define TPS65910_VAUX1 0x32
72#define TPS65910_VAUX2 0x33
73#define TPS65910_VAUX33 0x34
74#define TPS65910_VMMC 0x35
75#define TPS65910_VPLL 0x36
76#define TPS65910_VDAC 0x37
77#define TPS65910_THERM 0x38
78#define TPS65910_BBCH 0x39
79#define TPS65910_DCDCCTRL 0x3E
80#define TPS65910_DEVCTRL 0x3F
81#define TPS65910_DEVCTRL2 0x40
82#define TPS65910_SLEEP_KEEP_LDO_ON 0x41
83#define TPS65910_SLEEP_KEEP_RES_ON 0x42
84#define TPS65910_SLEEP_SET_LDO_OFF 0x43
85#define TPS65910_SLEEP_SET_RES_OFF 0x44
86#define TPS65910_EN1_LDO_ASS 0x45
87#define TPS65910_EN1_SMPS_ASS 0x46
88#define TPS65910_EN2_LDO_ASS 0x47
89#define TPS65910_EN2_SMPS_ASS 0x48
90#define TPS65910_EN3_LDO_ASS 0x49
91#define TPS65910_SPARE 0x4A
92#define TPS65910_INT_STS 0x50
93#define TPS65910_INT_MSK 0x51
94#define TPS65910_INT_STS2 0x52
95#define TPS65910_INT_MSK2 0x53
96#define TPS65910_INT_STS3 0x54
97#define TPS65910_INT_MSK3 0x55
98#define TPS65910_GPIO0 0x60
99#define TPS65910_GPIO1 0x61
100#define TPS65910_GPIO2 0x62
101#define TPS65910_GPIO3 0x63
102#define TPS65910_GPIO4 0x64
103#define TPS65910_GPIO5 0x65
104#define TPS65910_GPIO6 0x66
105#define TPS65910_GPIO7 0x67
106#define TPS65910_GPIO8 0x68
107#define TPS65910_JTAGVERNUM 0x80
108#define TPS65910_MAX_REGISTER 0x80
109
110/*
111 * List of registers specific to TPS65911
112 */
113#define TPS65911_VDDCTRL 0x27
114#define TPS65911_VDDCTRL_OP 0x28
115#define TPS65911_VDDCTRL_SR 0x29
116#define TPS65911_LDO1 0x30
117#define TPS65911_LDO2 0x31
118#define TPS65911_LDO5 0x32
119#define TPS65911_LDO8 0x33
120#define TPS65911_LDO7 0x34
121#define TPS65911_LDO6 0x35
122#define TPS65911_LDO4 0x36
123#define TPS65911_LDO3 0x37
124#define TPS65911_VMBCH 0x6A
125#define TPS65911_VMBCH2 0x6B
126
127/*
128 * List of register bitfields for component TPS65910
129 *
130 */
131
132
133/*Register BCK1 (0x80) register.RegisterDescription */
134#define BCK1_BCKUP_MASK 0xFF
135#define BCK1_BCKUP_SHIFT 0
136
137
138/*Register BCK2 (0x80) register.RegisterDescription */
139#define BCK2_BCKUP_MASK 0xFF
140#define BCK2_BCKUP_SHIFT 0
141
142
143/*Register BCK3 (0x80) register.RegisterDescription */
144#define BCK3_BCKUP_MASK 0xFF
145#define BCK3_BCKUP_SHIFT 0
146
147
148/*Register BCK4 (0x80) register.RegisterDescription */
149#define BCK4_BCKUP_MASK 0xFF
150#define BCK4_BCKUP_SHIFT 0
151
152
153/*Register BCK5 (0x80) register.RegisterDescription */
154#define BCK5_BCKUP_MASK 0xFF
155#define BCK5_BCKUP_SHIFT 0
156
157
158/*Register PUADEN (0x80) register.RegisterDescription */
159#define PUADEN_EN3P_MASK 0x80
160#define PUADEN_EN3P_SHIFT 7
161#define PUADEN_I2CCTLP_MASK 0x40
162#define PUADEN_I2CCTLP_SHIFT 6
163#define PUADEN_I2CSRP_MASK 0x20
164#define PUADEN_I2CSRP_SHIFT 5
165#define PUADEN_PWRONP_MASK 0x10
166#define PUADEN_PWRONP_SHIFT 4
167#define PUADEN_SLEEPP_MASK 0x08
168#define PUADEN_SLEEPP_SHIFT 3
169#define PUADEN_PWRHOLDP_MASK 0x04
170#define PUADEN_PWRHOLDP_SHIFT 2
171#define PUADEN_BOOT1P_MASK 0x02
172#define PUADEN_BOOT1P_SHIFT 1
173#define PUADEN_BOOT0P_MASK 0x01
174#define PUADEN_BOOT0P_SHIFT 0
175
176
177/*Register REF (0x80) register.RegisterDescription */
178#define REF_VMBCH_SEL_MASK 0x0C
179#define REF_VMBCH_SEL_SHIFT 2
180#define REF_ST_MASK 0x03
181#define REF_ST_SHIFT 0
182
183
184/*Register VRTC (0x80) register.RegisterDescription */
185#define VRTC_VRTC_OFFMASK_MASK 0x08
186#define VRTC_VRTC_OFFMASK_SHIFT 3
187#define VRTC_ST_MASK 0x03
188#define VRTC_ST_SHIFT 0
189
190
191/*Register VIO (0x80) register.RegisterDescription */
192#define VIO_ILMAX_MASK 0xC0
193#define VIO_ILMAX_SHIFT 6
194#define VIO_SEL_MASK 0x0C
195#define VIO_SEL_SHIFT 2
196#define VIO_ST_MASK 0x03
197#define VIO_ST_SHIFT 0
198
199
200/*Register VDD1 (0x80) register.RegisterDescription */
201#define VDD1_VGAIN_SEL_MASK 0xC0
202#define VDD1_VGAIN_SEL_SHIFT 6
203#define VDD1_ILMAX_MASK 0x20
204#define VDD1_ILMAX_SHIFT 5
205#define VDD1_TSTEP_MASK 0x1C
206#define VDD1_TSTEP_SHIFT 2
207#define VDD1_ST_MASK 0x03
208#define VDD1_ST_SHIFT 0
209
210
211/*Register VDD1_OP (0x80) register.RegisterDescription */
212#define VDD1_OP_CMD_MASK 0x80
213#define VDD1_OP_CMD_SHIFT 7
214#define VDD1_OP_SEL_MASK 0x7F
215#define VDD1_OP_SEL_SHIFT 0
216
217
218/*Register VDD1_SR (0x80) register.RegisterDescription */
219#define VDD1_SR_SEL_MASK 0x7F
220#define VDD1_SR_SEL_SHIFT 0
221
222
223/*Register VDD2 (0x80) register.RegisterDescription */
224#define VDD2_VGAIN_SEL_MASK 0xC0
225#define VDD2_VGAIN_SEL_SHIFT 6
226#define VDD2_ILMAX_MASK 0x20
227#define VDD2_ILMAX_SHIFT 5
228#define VDD2_TSTEP_MASK 0x1C
229#define VDD2_TSTEP_SHIFT 2
230#define VDD2_ST_MASK 0x03
231#define VDD2_ST_SHIFT 0
232
233
234/*Register VDD2_OP (0x80) register.RegisterDescription */
235#define VDD2_OP_CMD_MASK 0x80
236#define VDD2_OP_CMD_SHIFT 7
237#define VDD2_OP_SEL_MASK 0x7F
238#define VDD2_OP_SEL_SHIFT 0
239
240/*Register VDD2_SR (0x80) register.RegisterDescription */
241#define VDD2_SR_SEL_MASK 0x7F
242#define VDD2_SR_SEL_SHIFT 0
243
244
245/*Registers VDD1, VDD2 voltage values definitions */
246#define VDD1_2_NUM_VOLTS 73
247#define VDD1_2_MIN_VOLT 6000
248#define VDD1_2_OFFSET 125
249
250
251/*Register VDD3 (0x80) register.RegisterDescription */
252#define VDD3_CKINEN_MASK 0x04
253#define VDD3_CKINEN_SHIFT 2
254#define VDD3_ST_MASK 0x03
255#define VDD3_ST_SHIFT 0
256#define VDDCTRL_MIN_VOLT 6000
257#define VDDCTRL_OFFSET 125
258
259/*Registers VDIG (0x80) to VDAC register.RegisterDescription */
260#define LDO_SEL_MASK 0x0C
261#define LDO_SEL_SHIFT 2
262#define LDO_ST_MASK 0x03
263#define LDO_ST_SHIFT 0
264#define LDO_ST_ON_BIT 0x01
265#define LDO_ST_MODE_BIT 0x02
266
267
268/* Registers LDO1 to LDO8 in tps65910 */
269#define LDO1_SEL_MASK 0xFC
270#define LDO3_SEL_MASK 0x7C
271#define LDO_MIN_VOLT 1000
272#define LDO_MAX_VOLT 3300;
273
274
275/*Register VDIG1 (0x80) register.RegisterDescription */
276#define VDIG1_SEL_MASK 0x0C
277#define VDIG1_SEL_SHIFT 2
278#define VDIG1_ST_MASK 0x03
279#define VDIG1_ST_SHIFT 0
280
281
282/*Register VDIG2 (0x80) register.RegisterDescription */
283#define VDIG2_SEL_MASK 0x0C
284#define VDIG2_SEL_SHIFT 2
285#define VDIG2_ST_MASK 0x03
286#define VDIG2_ST_SHIFT 0
287
288
289/*Register VAUX1 (0x80) register.RegisterDescription */
290#define VAUX1_SEL_MASK 0x0C
291#define VAUX1_SEL_SHIFT 2
292#define VAUX1_ST_MASK 0x03
293#define VAUX1_ST_SHIFT 0
294
295
296/*Register VAUX2 (0x80) register.RegisterDescription */
297#define VAUX2_SEL_MASK 0x0C
298#define VAUX2_SEL_SHIFT 2
299#define VAUX2_ST_MASK 0x03
300#define VAUX2_ST_SHIFT 0
301
302
303/*Register VAUX33 (0x80) register.RegisterDescription */
304#define VAUX33_SEL_MASK 0x0C
305#define VAUX33_SEL_SHIFT 2
306#define VAUX33_ST_MASK 0x03
307#define VAUX33_ST_SHIFT 0
308
309
310/*Register VMMC (0x80) register.RegisterDescription */
311#define VMMC_SEL_MASK 0x0C
312#define VMMC_SEL_SHIFT 2
313#define VMMC_ST_MASK 0x03
314#define VMMC_ST_SHIFT 0
315
316
317/*Register VPLL (0x80) register.RegisterDescription */
318#define VPLL_SEL_MASK 0x0C
319#define VPLL_SEL_SHIFT 2
320#define VPLL_ST_MASK 0x03
321#define VPLL_ST_SHIFT 0
322
323
324/*Register VDAC (0x80) register.RegisterDescription */
325#define VDAC_SEL_MASK 0x0C
326#define VDAC_SEL_SHIFT 2
327#define VDAC_ST_MASK 0x03
328#define VDAC_ST_SHIFT 0
329
330
331/*Register THERM (0x80) register.RegisterDescription */
332#define THERM_THERM_HD_MASK 0x20
333#define THERM_THERM_HD_SHIFT 5
334#define THERM_THERM_TS_MASK 0x10
335#define THERM_THERM_TS_SHIFT 4
336#define THERM_THERM_HDSEL_MASK 0x0C
337#define THERM_THERM_HDSEL_SHIFT 2
338#define THERM_RSVD1_MASK 0x02
339#define THERM_RSVD1_SHIFT 1
340#define THERM_THERM_STATE_MASK 0x01
341#define THERM_THERM_STATE_SHIFT 0
342
343
344/*Register BBCH (0x80) register.RegisterDescription */
345#define BBCH_BBSEL_MASK 0x06
346#define BBCH_BBSEL_SHIFT 1
347#define BBCH_BBCHEN_MASK 0x01
348#define BBCH_BBCHEN_SHIFT 0
349
350
351/*Register DCDCCTRL (0x80) register.RegisterDescription */
352#define DCDCCTRL_VDD2_PSKIP_MASK 0x20
353#define DCDCCTRL_VDD2_PSKIP_SHIFT 5
354#define DCDCCTRL_VDD1_PSKIP_MASK 0x10
355#define DCDCCTRL_VDD1_PSKIP_SHIFT 4
356#define DCDCCTRL_VIO_PSKIP_MASK 0x08
357#define DCDCCTRL_VIO_PSKIP_SHIFT 3
358#define DCDCCTRL_DCDCCKEXT_MASK 0x04
359#define DCDCCTRL_DCDCCKEXT_SHIFT 2
360#define DCDCCTRL_DCDCCKSYNC_MASK 0x03
361#define DCDCCTRL_DCDCCKSYNC_SHIFT 0
362
363
364/*Register DEVCTRL (0x80) register.RegisterDescription */
365#define DEVCTRL_RTC_PWDN_MASK 0x40
366#define DEVCTRL_RTC_PWDN_SHIFT 6
367#define DEVCTRL_CK32K_CTRL_MASK 0x20
368#define DEVCTRL_CK32K_CTRL_SHIFT 5
369#define DEVCTRL_SR_CTL_I2C_SEL_MASK 0x10
370#define DEVCTRL_SR_CTL_I2C_SEL_SHIFT 4
371#define DEVCTRL_DEV_OFF_RST_MASK 0x08
372#define DEVCTRL_DEV_OFF_RST_SHIFT 3
373#define DEVCTRL_DEV_ON_MASK 0x04
374#define DEVCTRL_DEV_ON_SHIFT 2
375#define DEVCTRL_DEV_SLP_MASK 0x02
376#define DEVCTRL_DEV_SLP_SHIFT 1
377#define DEVCTRL_DEV_OFF_MASK 0x01
378#define DEVCTRL_DEV_OFF_SHIFT 0
379
380
381/*Register DEVCTRL2 (0x80) register.RegisterDescription */
382#define DEVCTRL2_TSLOT_LENGTH_MASK 0x30
383#define DEVCTRL2_TSLOT_LENGTH_SHIFT 4
384#define DEVCTRL2_SLEEPSIG_POL_MASK 0x08
385#define DEVCTRL2_SLEEPSIG_POL_SHIFT 3
386#define DEVCTRL2_PWON_LP_OFF_MASK 0x04
387#define DEVCTRL2_PWON_LP_OFF_SHIFT 2
388#define DEVCTRL2_PWON_LP_RST_MASK 0x02
389#define DEVCTRL2_PWON_LP_RST_SHIFT 1
390#define DEVCTRL2_IT_POL_MASK 0x01
391#define DEVCTRL2_IT_POL_SHIFT 0
392
393
394/*Register SLEEP_KEEP_LDO_ON (0x80) register.RegisterDescription */
395#define SLEEP_KEEP_LDO_ON_VDAC_KEEPON_MASK 0x80
396#define SLEEP_KEEP_LDO_ON_VDAC_KEEPON_SHIFT 7
397#define SLEEP_KEEP_LDO_ON_VPLL_KEEPON_MASK 0x40
398#define SLEEP_KEEP_LDO_ON_VPLL_KEEPON_SHIFT 6
399#define SLEEP_KEEP_LDO_ON_VAUX33_KEEPON_MASK 0x20
400#define SLEEP_KEEP_LDO_ON_VAUX33_KEEPON_SHIFT 5
401#define SLEEP_KEEP_LDO_ON_VAUX2_KEEPON_MASK 0x10
402#define SLEEP_KEEP_LDO_ON_VAUX2_KEEPON_SHIFT 4
403#define SLEEP_KEEP_LDO_ON_VAUX1_KEEPON_MASK 0x08
404#define SLEEP_KEEP_LDO_ON_VAUX1_KEEPON_SHIFT 3
405#define SLEEP_KEEP_LDO_ON_VDIG2_KEEPON_MASK 0x04
406#define SLEEP_KEEP_LDO_ON_VDIG2_KEEPON_SHIFT 2
407#define SLEEP_KEEP_LDO_ON_VDIG1_KEEPON_MASK 0x02
408#define SLEEP_KEEP_LDO_ON_VDIG1_KEEPON_SHIFT 1
409#define SLEEP_KEEP_LDO_ON_VMMC_KEEPON_MASK 0x01
410#define SLEEP_KEEP_LDO_ON_VMMC_KEEPON_SHIFT 0
411
412
413/*Register SLEEP_KEEP_RES_ON (0x80) register.RegisterDescription */
414#define SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK 0x80
415#define SLEEP_KEEP_RES_ON_THERM_KEEPON_SHIFT 7
416#define SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK 0x40
417#define SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_SHIFT 6
418#define SLEEP_KEEP_RES_ON_VRTC_KEEPON_MASK 0x20
419#define SLEEP_KEEP_RES_ON_VRTC_KEEPON_SHIFT 5
420#define SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK 0x10
421#define SLEEP_KEEP_RES_ON_I2CHS_KEEPON_SHIFT 4
422#define SLEEP_KEEP_RES_ON_VDD3_KEEPON_MASK 0x08
423#define SLEEP_KEEP_RES_ON_VDD3_KEEPON_SHIFT 3
424#define SLEEP_KEEP_RES_ON_VDD2_KEEPON_MASK 0x04
425#define SLEEP_KEEP_RES_ON_VDD2_KEEPON_SHIFT 2
426#define SLEEP_KEEP_RES_ON_VDD1_KEEPON_MASK 0x02
427#define SLEEP_KEEP_RES_ON_VDD1_KEEPON_SHIFT 1
428#define SLEEP_KEEP_RES_ON_VIO_KEEPON_MASK 0x01
429#define SLEEP_KEEP_RES_ON_VIO_KEEPON_SHIFT 0
430
431
432/*Register SLEEP_SET_LDO_OFF (0x80) register.RegisterDescription */
433#define SLEEP_SET_LDO_OFF_VDAC_SETOFF_MASK 0x80
434#define SLEEP_SET_LDO_OFF_VDAC_SETOFF_SHIFT 7
435#define SLEEP_SET_LDO_OFF_VPLL_SETOFF_MASK 0x40
436#define SLEEP_SET_LDO_OFF_VPLL_SETOFF_SHIFT 6
437#define SLEEP_SET_LDO_OFF_VAUX33_SETOFF_MASK 0x20
438#define SLEEP_SET_LDO_OFF_VAUX33_SETOFF_SHIFT 5
439#define SLEEP_SET_LDO_OFF_VAUX2_SETOFF_MASK 0x10
440#define SLEEP_SET_LDO_OFF_VAUX2_SETOFF_SHIFT 4
441#define SLEEP_SET_LDO_OFF_VAUX1_SETOFF_MASK 0x08
442#define SLEEP_SET_LDO_OFF_VAUX1_SETOFF_SHIFT 3
443#define SLEEP_SET_LDO_OFF_VDIG2_SETOFF_MASK 0x04
444#define SLEEP_SET_LDO_OFF_VDIG2_SETOFF_SHIFT 2
445#define SLEEP_SET_LDO_OFF_VDIG1_SETOFF_MASK 0x02
446#define SLEEP_SET_LDO_OFF_VDIG1_SETOFF_SHIFT 1
447#define SLEEP_SET_LDO_OFF_VMMC_SETOFF_MASK 0x01
448#define SLEEP_SET_LDO_OFF_VMMC_SETOFF_SHIFT 0
449
450
451/*Register SLEEP_SET_RES_OFF (0x80) register.RegisterDescription */
452#define SLEEP_SET_RES_OFF_DEFAULT_VOLT_MASK 0x80
453#define SLEEP_SET_RES_OFF_DEFAULT_VOLT_SHIFT 7
454#define SLEEP_SET_RES_OFF_RSVD_MASK 0x60
455#define SLEEP_SET_RES_OFF_RSVD_SHIFT 5
456#define SLEEP_SET_RES_OFF_SPARE_SETOFF_MASK 0x10
457#define SLEEP_SET_RES_OFF_SPARE_SETOFF_SHIFT 4
458#define SLEEP_SET_RES_OFF_VDD3_SETOFF_MASK 0x08
459#define SLEEP_SET_RES_OFF_VDD3_SETOFF_SHIFT 3
460#define SLEEP_SET_RES_OFF_VDD2_SETOFF_MASK 0x04
461#define SLEEP_SET_RES_OFF_VDD2_SETOFF_SHIFT 2
462#define SLEEP_SET_RES_OFF_VDD1_SETOFF_MASK 0x02
463#define SLEEP_SET_RES_OFF_VDD1_SETOFF_SHIFT 1
464#define SLEEP_SET_RES_OFF_VIO_SETOFF_MASK 0x01
465#define SLEEP_SET_RES_OFF_VIO_SETOFF_SHIFT 0
466
467
468/*Register EN1_LDO_ASS (0x80) register.RegisterDescription */
469#define EN1_LDO_ASS_VDAC_EN1_MASK 0x80
470#define EN1_LDO_ASS_VDAC_EN1_SHIFT 7
471#define EN1_LDO_ASS_VPLL_EN1_MASK 0x40
472#define EN1_LDO_ASS_VPLL_EN1_SHIFT 6
473#define EN1_LDO_ASS_VAUX33_EN1_MASK 0x20
474#define EN1_LDO_ASS_VAUX33_EN1_SHIFT 5
475#define EN1_LDO_ASS_VAUX2_EN1_MASK 0x10
476#define EN1_LDO_ASS_VAUX2_EN1_SHIFT 4
477#define EN1_LDO_ASS_VAUX1_EN1_MASK 0x08
478#define EN1_LDO_ASS_VAUX1_EN1_SHIFT 3
479#define EN1_LDO_ASS_VDIG2_EN1_MASK 0x04
480#define EN1_LDO_ASS_VDIG2_EN1_SHIFT 2
481#define EN1_LDO_ASS_VDIG1_EN1_MASK 0x02
482#define EN1_LDO_ASS_VDIG1_EN1_SHIFT 1
483#define EN1_LDO_ASS_VMMC_EN1_MASK 0x01
484#define EN1_LDO_ASS_VMMC_EN1_SHIFT 0
485
486
487/*Register EN1_SMPS_ASS (0x80) register.RegisterDescription */
488#define EN1_SMPS_ASS_RSVD_MASK 0xE0
489#define EN1_SMPS_ASS_RSVD_SHIFT 5
490#define EN1_SMPS_ASS_SPARE_EN1_MASK 0x10
491#define EN1_SMPS_ASS_SPARE_EN1_SHIFT 4
492#define EN1_SMPS_ASS_VDD3_EN1_MASK 0x08
493#define EN1_SMPS_ASS_VDD3_EN1_SHIFT 3
494#define EN1_SMPS_ASS_VDD2_EN1_MASK 0x04
495#define EN1_SMPS_ASS_VDD2_EN1_SHIFT 2
496#define EN1_SMPS_ASS_VDD1_EN1_MASK 0x02
497#define EN1_SMPS_ASS_VDD1_EN1_SHIFT 1
498#define EN1_SMPS_ASS_VIO_EN1_MASK 0x01
499#define EN1_SMPS_ASS_VIO_EN1_SHIFT 0
500
501
502/*Register EN2_LDO_ASS (0x80) register.RegisterDescription */
503#define EN2_LDO_ASS_VDAC_EN2_MASK 0x80
504#define EN2_LDO_ASS_VDAC_EN2_SHIFT 7
505#define EN2_LDO_ASS_VPLL_EN2_MASK 0x40
506#define EN2_LDO_ASS_VPLL_EN2_SHIFT 6
507#define EN2_LDO_ASS_VAUX33_EN2_MASK 0x20
508#define EN2_LDO_ASS_VAUX33_EN2_SHIFT 5
509#define EN2_LDO_ASS_VAUX2_EN2_MASK 0x10
510#define EN2_LDO_ASS_VAUX2_EN2_SHIFT 4
511#define EN2_LDO_ASS_VAUX1_EN2_MASK 0x08
512#define EN2_LDO_ASS_VAUX1_EN2_SHIFT 3
513#define EN2_LDO_ASS_VDIG2_EN2_MASK 0x04
514#define EN2_LDO_ASS_VDIG2_EN2_SHIFT 2
515#define EN2_LDO_ASS_VDIG1_EN2_MASK 0x02
516#define EN2_LDO_ASS_VDIG1_EN2_SHIFT 1
517#define EN2_LDO_ASS_VMMC_EN2_MASK 0x01
518#define EN2_LDO_ASS_VMMC_EN2_SHIFT 0
519
520
521/*Register EN2_SMPS_ASS (0x80) register.RegisterDescription */
522#define EN2_SMPS_ASS_RSVD_MASK 0xE0
523#define EN2_SMPS_ASS_RSVD_SHIFT 5
524#define EN2_SMPS_ASS_SPARE_EN2_MASK 0x10
525#define EN2_SMPS_ASS_SPARE_EN2_SHIFT 4
526#define EN2_SMPS_ASS_VDD3_EN2_MASK 0x08
527#define EN2_SMPS_ASS_VDD3_EN2_SHIFT 3
528#define EN2_SMPS_ASS_VDD2_EN2_MASK 0x04
529#define EN2_SMPS_ASS_VDD2_EN2_SHIFT 2
530#define EN2_SMPS_ASS_VDD1_EN2_MASK 0x02
531#define EN2_SMPS_ASS_VDD1_EN2_SHIFT 1
532#define EN2_SMPS_ASS_VIO_EN2_MASK 0x01
533#define EN2_SMPS_ASS_VIO_EN2_SHIFT 0
534
535
536/*Register EN3_LDO_ASS (0x80) register.RegisterDescription */
537#define EN3_LDO_ASS_VDAC_EN3_MASK 0x80
538#define EN3_LDO_ASS_VDAC_EN3_SHIFT 7
539#define EN3_LDO_ASS_VPLL_EN3_MASK 0x40
540#define EN3_LDO_ASS_VPLL_EN3_SHIFT 6
541#define EN3_LDO_ASS_VAUX33_EN3_MASK 0x20
542#define EN3_LDO_ASS_VAUX33_EN3_SHIFT 5
543#define EN3_LDO_ASS_VAUX2_EN3_MASK 0x10
544#define EN3_LDO_ASS_VAUX2_EN3_SHIFT 4
545#define EN3_LDO_ASS_VAUX1_EN3_MASK 0x08
546#define EN3_LDO_ASS_VAUX1_EN3_SHIFT 3
547#define EN3_LDO_ASS_VDIG2_EN3_MASK 0x04
548#define EN3_LDO_ASS_VDIG2_EN3_SHIFT 2
549#define EN3_LDO_ASS_VDIG1_EN3_MASK 0x02
550#define EN3_LDO_ASS_VDIG1_EN3_SHIFT 1
551#define EN3_LDO_ASS_VMMC_EN3_MASK 0x01
552#define EN3_LDO_ASS_VMMC_EN3_SHIFT 0
553
554
555/*Register SPARE (0x80) register.RegisterDescription */
556#define SPARE_SPARE_MASK 0xFF
557#define SPARE_SPARE_SHIFT 0
558
559
560/*Register INT_STS (0x80) register.RegisterDescription */
561#define INT_STS_RTC_PERIOD_IT_MASK 0x80
562#define INT_STS_RTC_PERIOD_IT_SHIFT 7
563#define INT_STS_RTC_ALARM_IT_MASK 0x40
564#define INT_STS_RTC_ALARM_IT_SHIFT 6
565#define INT_STS_HOTDIE_IT_MASK 0x20
566#define INT_STS_HOTDIE_IT_SHIFT 5
567#define INT_STS_PWRHOLD_IT_MASK 0x10
568#define INT_STS_PWRHOLD_IT_SHIFT 4
569#define INT_STS_PWRON_LP_IT_MASK 0x08
570#define INT_STS_PWRON_LP_IT_SHIFT 3
571#define INT_STS_PWRON_IT_MASK 0x04
572#define INT_STS_PWRON_IT_SHIFT 2
573#define INT_STS_VMBHI_IT_MASK 0x02
574#define INT_STS_VMBHI_IT_SHIFT 1
575#define INT_STS_VMBDCH_IT_MASK 0x01
576#define INT_STS_VMBDCH_IT_SHIFT 0
577
578
579/*Register INT_MSK (0x80) register.RegisterDescription */
580#define INT_MSK_RTC_PERIOD_IT_MSK_MASK 0x80
581#define INT_MSK_RTC_PERIOD_IT_MSK_SHIFT 7
582#define INT_MSK_RTC_ALARM_IT_MSK_MASK 0x40
583#define INT_MSK_RTC_ALARM_IT_MSK_SHIFT 6
584#define INT_MSK_HOTDIE_IT_MSK_MASK 0x20
585#define INT_MSK_HOTDIE_IT_MSK_SHIFT 5
586#define INT_MSK_PWRHOLD_IT_MSK_MASK 0x10
587#define INT_MSK_PWRHOLD_IT_MSK_SHIFT 4
588#define INT_MSK_PWRON_LP_IT_MSK_MASK 0x08
589#define INT_MSK_PWRON_LP_IT_MSK_SHIFT 3
590#define INT_MSK_PWRON_IT_MSK_MASK 0x04
591#define INT_MSK_PWRON_IT_MSK_SHIFT 2
592#define INT_MSK_VMBHI_IT_MSK_MASK 0x02
593#define INT_MSK_VMBHI_IT_MSK_SHIFT 1
594#define INT_MSK_VMBDCH_IT_MSK_MASK 0x01
595#define INT_MSK_VMBDCH_IT_MSK_SHIFT 0
596
597
598/*Register INT_STS2 (0x80) register.RegisterDescription */
599#define INT_STS2_GPIO3_F_IT_MASK 0x80
600#define INT_STS2_GPIO3_F_IT_SHIFT 7
601#define INT_STS2_GPIO3_R_IT_MASK 0x40
602#define INT_STS2_GPIO3_R_IT_SHIFT 6
603#define INT_STS2_GPIO2_F_IT_MASK 0x20
604#define INT_STS2_GPIO2_F_IT_SHIFT 5
605#define INT_STS2_GPIO2_R_IT_MASK 0x10
606#define INT_STS2_GPIO2_R_IT_SHIFT 4
607#define INT_STS2_GPIO1_F_IT_MASK 0x08
608#define INT_STS2_GPIO1_F_IT_SHIFT 3
609#define INT_STS2_GPIO1_R_IT_MASK 0x04
610#define INT_STS2_GPIO1_R_IT_SHIFT 2
611#define INT_STS2_GPIO0_F_IT_MASK 0x02
612#define INT_STS2_GPIO0_F_IT_SHIFT 1
613#define INT_STS2_GPIO0_R_IT_MASK 0x01
614#define INT_STS2_GPIO0_R_IT_SHIFT 0
615
616
617/*Register INT_MSK2 (0x80) register.RegisterDescription */
618#define INT_MSK2_GPIO3_F_IT_MSK_MASK 0x80
619#define INT_MSK2_GPIO3_F_IT_MSK_SHIFT 7
620#define INT_MSK2_GPIO3_R_IT_MSK_MASK 0x40
621#define INT_MSK2_GPIO3_R_IT_MSK_SHIFT 6
622#define INT_MSK2_GPIO2_F_IT_MSK_MASK 0x20
623#define INT_MSK2_GPIO2_F_IT_MSK_SHIFT 5
624#define INT_MSK2_GPIO2_R_IT_MSK_MASK 0x10
625#define INT_MSK2_GPIO2_R_IT_MSK_SHIFT 4
626#define INT_MSK2_GPIO1_F_IT_MSK_MASK 0x08
627#define INT_MSK2_GPIO1_F_IT_MSK_SHIFT 3
628#define INT_MSK2_GPIO1_R_IT_MSK_MASK 0x04
629#define INT_MSK2_GPIO1_R_IT_MSK_SHIFT 2
630#define INT_MSK2_GPIO0_F_IT_MSK_MASK 0x02
631#define INT_MSK2_GPIO0_F_IT_MSK_SHIFT 1
632#define INT_MSK2_GPIO0_R_IT_MSK_MASK 0x01
633#define INT_MSK2_GPIO0_R_IT_MSK_SHIFT 0
634
635
636/*Register INT_STS3 (0x80) register.RegisterDescription */
637#define INT_STS3_GPIO5_F_IT_MASK 0x08
638#define INT_STS3_GPIO5_F_IT_SHIFT 3
639#define INT_STS3_GPIO5_R_IT_MASK 0x04
640#define INT_STS3_GPIO5_R_IT_SHIFT 2
641#define INT_STS3_GPIO4_F_IT_MASK 0x02
642#define INT_STS3_GPIO4_F_IT_SHIFT 1
643#define INT_STS3_GPIO4_R_IT_MASK 0x01
644#define INT_STS3_GPIO4_R_IT_SHIFT 0
645
646
647/*Register INT_MSK3 (0x80) register.RegisterDescription */
648#define INT_MSK3_GPIO5_F_IT_MSK_MASK 0x08
649#define INT_MSK3_GPIO5_F_IT_MSK_SHIFT 3
650#define INT_MSK3_GPIO5_R_IT_MSK_MASK 0x04
651#define INT_MSK3_GPIO5_R_IT_MSK_SHIFT 2
652#define INT_MSK3_GPIO4_F_IT_MSK_MASK 0x02
653#define INT_MSK3_GPIO4_F_IT_MSK_SHIFT 1
654#define INT_MSK3_GPIO4_R_IT_MSK_MASK 0x01
655#define INT_MSK3_GPIO4_R_IT_MSK_SHIFT 0
656
657
658/*Register GPIO (0x80) register.RegisterDescription */
659#define GPIO_DEB_MASK 0x10
660#define GPIO_DEB_SHIFT 4
661#define GPIO_PUEN_MASK 0x08
662#define GPIO_PUEN_SHIFT 3
663#define GPIO_CFG_MASK 0x04
664#define GPIO_CFG_SHIFT 2
665#define GPIO_STS_MASK 0x02
666#define GPIO_STS_SHIFT 1
667#define GPIO_SET_MASK 0x01
668#define GPIO_SET_SHIFT 0
669
670
671/*Register JTAGVERNUM (0x80) register.RegisterDescription */
672#define JTAGVERNUM_VERNUM_MASK 0x0F
673#define JTAGVERNUM_VERNUM_SHIFT 0
674
675
676/* Register VDDCTRL (0x27) bit definitions */
677#define VDDCTRL_ST_MASK 0x03
678#define VDDCTRL_ST_SHIFT 0
679
680
681/*Register VDDCTRL_OP (0x28) bit definitios */
682#define VDDCTRL_OP_CMD_MASK 0x80
683#define VDDCTRL_OP_CMD_SHIFT 7
684#define VDDCTRL_OP_SEL_MASK 0x7F
685#define VDDCTRL_OP_SEL_SHIFT 0
686
687
688/*Register VDDCTRL_SR (0x29) bit definitions */
689#define VDDCTRL_SR_SEL_MASK 0x7F
690#define VDDCTRL_SR_SEL_SHIFT 0
691
692
693/* IRQ Definitions */
694#define TPS65910_IRQ_VBAT_VMBDCH 0
695#define TPS65910_IRQ_VBAT_VMHI 1
696#define TPS65910_IRQ_PWRON 2
697#define TPS65910_IRQ_PWRON_LP 3
698#define TPS65910_IRQ_PWRHOLD 4
699#define TPS65910_IRQ_HOTDIE 5
700#define TPS65910_IRQ_RTC_ALARM 6
701#define TPS65910_IRQ_RTC_PERIOD 7
702#define TPS65910_IRQ_GPIO_R 8
703#define TPS65910_IRQ_GPIO_F 9
704#define TPS65910_NUM_IRQ 10
705
706#define TPS65911_IRQ_VBAT_VMBDCH 0
707#define TPS65911_IRQ_VBAT_VMBDCH2L 1
708#define TPS65911_IRQ_VBAT_VMBDCH2H 2
709#define TPS65911_IRQ_VBAT_VMHI 3
710#define TPS65911_IRQ_PWRON 4
711#define TPS65911_IRQ_PWRON_LP 5
712#define TPS65911_IRQ_PWRHOLD_F 6
713#define TPS65911_IRQ_PWRHOLD_R 7
714#define TPS65911_IRQ_HOTDIE 8
715#define TPS65911_IRQ_RTC_ALARM 9
716#define TPS65911_IRQ_RTC_PERIOD 10
717#define TPS65911_IRQ_GPIO0_R 11
718#define TPS65911_IRQ_GPIO0_F 12
719#define TPS65911_IRQ_GPIO1_R 13
720#define TPS65911_IRQ_GPIO1_F 14
721#define TPS65911_IRQ_GPIO2_R 15
722#define TPS65911_IRQ_GPIO2_F 16
723#define TPS65911_IRQ_GPIO3_R 17
724#define TPS65911_IRQ_GPIO3_F 18
725#define TPS65911_IRQ_GPIO4_R 19
726#define TPS65911_IRQ_GPIO4_F 20
727#define TPS65911_IRQ_GPIO5_R 21
728#define TPS65911_IRQ_GPIO5_F 22
729#define TPS65911_IRQ_WTCHDG 23
730#define TPS65911_IRQ_PWRDN 24
731
732#define TPS65911_NUM_IRQ 25
733
734
735/* GPIO Register Definitions */
736#define TPS65910_GPIO_DEB BIT(2)
737#define TPS65910_GPIO_PUEN BIT(3)
738#define TPS65910_GPIO_CFG BIT(2)
739#define TPS65910_GPIO_STS BIT(1)
740#define TPS65910_GPIO_SET BIT(0)
741
742/**
743 * struct tps65910_board
744 * Board platform data may be used to initialize regulators.
745 */
746
747struct tps65910_board {
748 int gpio_base;
749 int irq;
750 int irq_base;
751 int vmbch_threshold;
752 int vmbch2_threshold;
753 struct regulator_init_data *tps65910_pmic_init_data;
754};
755
756/**
757 * struct tps65910 - tps65910 sub-driver chip access routines
758 */
759
760struct tps65910 {
761 struct device *dev;
762 struct i2c_client *i2c_client;
763 struct mutex io_mutex;
764 unsigned int id;
765 int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest);
766 int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src);
767
768 /* Client devices */
769 struct tps65910_pmic *pmic;
770 struct tps65910_rtc *rtc;
771 struct tps65910_power *power;
772
773 /* GPIO Handling */
774 struct gpio_chip gpio;
775
776 /* IRQ Handling */
777 struct mutex irq_lock;
778 int chip_irq;
779 int irq_base;
780 int irq_num;
781 u32 irq_mask;
782};
783
784struct tps65910_platform_data {
785 int irq;
786 int irq_base;
787};
788
789int tps65910_set_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
790int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
791void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
792int tps65910_irq_init(struct tps65910 *tps65910, int irq,
793 struct tps65910_platform_data *pdata);
794
795static inline int tps65910_chip_id(struct tps65910 *tps65910)
796{
797 return tps65910->id;
798}
799
800#endif /* __LINUX_MFD_TPS65910_H */
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-codec.h
index 2ec317c68e59..5cc16bbd1da1 100644
--- a/include/linux/mfd/twl4030-codec.h
+++ b/include/linux/mfd/twl4030-codec.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * MFD driver for twl4030 codec submodule 2 * MFD driver for twl4030 codec submodule
3 * 3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> 4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 * 5 *
6 * Copyright: (C) 2009 Nokia Corporation 6 * Copyright: (C) 2009 Nokia Corporation
7 * 7 *
diff --git a/include/linux/mfd/wl1273-core.h b/include/linux/mfd/wl1273-core.h
new file mode 100644
index 000000000000..db2f3f454a1b
--- /dev/null
+++ b/include/linux/mfd/wl1273-core.h
@@ -0,0 +1,290 @@
1/*
2 * include/linux/mfd/wl1273-core.h
3 *
4 * Some definitions for the wl1273 radio receiver/transmitter chip.
5 *
6 * Copyright (C) 2010 Nokia Corporation
7 * Author: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24#ifndef WL1273_CORE_H
25#define WL1273_CORE_H
26
27#include <linux/i2c.h>
28#include <linux/mfd/core.h>
29
30#define WL1273_FM_DRIVER_NAME "wl1273-fm"
31#define RX71_FM_I2C_ADDR 0x22
32
33#define WL1273_STEREO_GET 0
34#define WL1273_RSSI_LVL_GET 1
35#define WL1273_IF_COUNT_GET 2
36#define WL1273_FLAG_GET 3
37#define WL1273_RDS_SYNC_GET 4
38#define WL1273_RDS_DATA_GET 5
39#define WL1273_FREQ_SET 10
40#define WL1273_AF_FREQ_SET 11
41#define WL1273_MOST_MODE_SET 12
42#define WL1273_MOST_BLEND_SET 13
43#define WL1273_DEMPH_MODE_SET 14
44#define WL1273_SEARCH_LVL_SET 15
45#define WL1273_BAND_SET 16
46#define WL1273_MUTE_STATUS_SET 17
47#define WL1273_RDS_PAUSE_LVL_SET 18
48#define WL1273_RDS_PAUSE_DUR_SET 19
49#define WL1273_RDS_MEM_SET 20
50#define WL1273_RDS_BLK_B_SET 21
51#define WL1273_RDS_MSK_B_SET 22
52#define WL1273_RDS_PI_MASK_SET 23
53#define WL1273_RDS_PI_SET 24
54#define WL1273_RDS_SYSTEM_SET 25
55#define WL1273_INT_MASK_SET 26
56#define WL1273_SEARCH_DIR_SET 27
57#define WL1273_VOLUME_SET 28
58#define WL1273_AUDIO_ENABLE 29
59#define WL1273_PCM_MODE_SET 30
60#define WL1273_I2S_MODE_CONFIG_SET 31
61#define WL1273_POWER_SET 32
62#define WL1273_INTX_CONFIG_SET 33
63#define WL1273_PULL_EN_SET 34
64#define WL1273_HILO_SET 35
65#define WL1273_SWITCH2FREF 36
66#define WL1273_FREQ_DRIFT_REPORT 37
67
68#define WL1273_PCE_GET 40
69#define WL1273_FIRM_VER_GET 41
70#define WL1273_ASIC_VER_GET 42
71#define WL1273_ASIC_ID_GET 43
72#define WL1273_MAN_ID_GET 44
73#define WL1273_TUNER_MODE_SET 45
74#define WL1273_STOP_SEARCH 46
75#define WL1273_RDS_CNTRL_SET 47
76
77#define WL1273_WRITE_HARDWARE_REG 100
78#define WL1273_CODE_DOWNLOAD 101
79#define WL1273_RESET 102
80
81#define WL1273_FM_POWER_MODE 254
82#define WL1273_FM_INTERRUPT 255
83
84/* Transmitter API */
85
86#define WL1273_CHANL_SET 55
87#define WL1273_SCAN_SPACING_SET 56
88#define WL1273_REF_SET 57
89#define WL1273_POWER_ENB_SET 90
90#define WL1273_POWER_ATT_SET 58
91#define WL1273_POWER_LEV_SET 59
92#define WL1273_AUDIO_DEV_SET 60
93#define WL1273_PILOT_DEV_SET 61
94#define WL1273_RDS_DEV_SET 62
95#define WL1273_PUPD_SET 91
96#define WL1273_AUDIO_IO_SET 63
97#define WL1273_PREMPH_SET 64
98#define WL1273_MONO_SET 66
99#define WL1273_MUTE 92
100#define WL1273_MPX_LMT_ENABLE 67
101#define WL1273_PI_SET 93
102#define WL1273_ECC_SET 69
103#define WL1273_PTY 70
104#define WL1273_AF 71
105#define WL1273_DISPLAY_MODE 74
106#define WL1273_RDS_REP_SET 77
107#define WL1273_RDS_CONFIG_DATA_SET 98
108#define WL1273_RDS_DATA_SET 99
109#define WL1273_RDS_DATA_ENB 94
110#define WL1273_TA_SET 78
111#define WL1273_TP_SET 79
112#define WL1273_DI_SET 80
113#define WL1273_MS_SET 81
114#define WL1273_PS_SCROLL_SPEED 82
115#define WL1273_TX_AUDIO_LEVEL_TEST 96
116#define WL1273_TX_AUDIO_LEVEL_TEST_THRESHOLD 73
117#define WL1273_TX_AUDIO_INPUT_LEVEL_RANGE_SET 54
118#define WL1273_RX_ANTENNA_SELECT 87
119#define WL1273_I2C_DEV_ADDR_SET 86
120#define WL1273_REF_ERR_CALIB_PARAM_SET 88
121#define WL1273_REF_ERR_CALIB_PERIODICITY_SET 89
122#define WL1273_SOC_INT_TRIGGER 52
123#define WL1273_SOC_AUDIO_PATH_SET 83
124#define WL1273_SOC_PCMI_OVERRIDE 84
125#define WL1273_SOC_I2S_OVERRIDE 85
126#define WL1273_RSSI_BLOCK_SCAN_FREQ_SET 95
127#define WL1273_RSSI_BLOCK_SCAN_START 97
128#define WL1273_RSSI_BLOCK_SCAN_DATA_GET 5
129#define WL1273_READ_FMANT_TUNE_VALUE 104
130
131#define WL1273_RDS_OFF 0
132#define WL1273_RDS_ON 1
133#define WL1273_RDS_RESET 2
134
135#define WL1273_AUDIO_DIGITAL 0
136#define WL1273_AUDIO_ANALOG 1
137
138#define WL1273_MODE_RX BIT(0)
139#define WL1273_MODE_TX BIT(1)
140#define WL1273_MODE_OFF BIT(2)
141#define WL1273_MODE_SUSPENDED BIT(3)
142
143#define WL1273_RADIO_CHILD BIT(0)
144#define WL1273_CODEC_CHILD BIT(1)
145
146#define WL1273_RX_MONO 1
147#define WL1273_RX_STEREO 0
148#define WL1273_TX_MONO 0
149#define WL1273_TX_STEREO 1
150
151#define WL1273_MAX_VOLUME 0xffff
152#define WL1273_DEFAULT_VOLUME 0x78b8
153
154/* I2S protocol, left channel first, data width 16 bits */
155#define WL1273_PCM_DEF_MODE 0x00
156
157/* Rx */
158#define WL1273_AUDIO_ENABLE_I2S BIT(0)
159#define WL1273_AUDIO_ENABLE_ANALOG BIT(1)
160
161/* Tx */
162#define WL1273_AUDIO_IO_SET_ANALOG 0
163#define WL1273_AUDIO_IO_SET_I2S 1
164
165#define WL1273_PUPD_SET_OFF 0x00
166#define WL1273_PUPD_SET_ON 0x01
167#define WL1273_PUPD_SET_RETENTION 0x10
168
169/* I2S mode */
170#define WL1273_IS2_WIDTH_32 0x0
171#define WL1273_IS2_WIDTH_40 0x1
172#define WL1273_IS2_WIDTH_22_23 0x2
173#define WL1273_IS2_WIDTH_23_22 0x3
174#define WL1273_IS2_WIDTH_48 0x4
175#define WL1273_IS2_WIDTH_50 0x5
176#define WL1273_IS2_WIDTH_60 0x6
177#define WL1273_IS2_WIDTH_64 0x7
178#define WL1273_IS2_WIDTH_80 0x8
179#define WL1273_IS2_WIDTH_96 0x9
180#define WL1273_IS2_WIDTH_128 0xa
181#define WL1273_IS2_WIDTH 0xf
182
183#define WL1273_IS2_FORMAT_STD (0x0 << 4)
184#define WL1273_IS2_FORMAT_LEFT (0x1 << 4)
185#define WL1273_IS2_FORMAT_RIGHT (0x2 << 4)
186#define WL1273_IS2_FORMAT_USER (0x3 << 4)
187
188#define WL1273_IS2_MASTER (0x0 << 6)
189#define WL1273_IS2_SLAVEW (0x1 << 6)
190
191#define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7)
192#define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7)
193
194#define WL1273_IS2_SDOWS_RR (0x0 << 8)
195#define WL1273_IS2_SDOWS_RF (0x1 << 8)
196#define WL1273_IS2_SDOWS_FR (0x2 << 8)
197#define WL1273_IS2_SDOWS_FF (0x3 << 8)
198
199#define WL1273_IS2_TRI_OPT (0x0 << 10)
200#define WL1273_IS2_TRI_ALWAYS (0x1 << 10)
201
202#define WL1273_IS2_RATE_48K (0x0 << 12)
203#define WL1273_IS2_RATE_44_1K (0x1 << 12)
204#define WL1273_IS2_RATE_32K (0x2 << 12)
205#define WL1273_IS2_RATE_22_05K (0x4 << 12)
206#define WL1273_IS2_RATE_16K (0x5 << 12)
207#define WL1273_IS2_RATE_12K (0x8 << 12)
208#define WL1273_IS2_RATE_11_025 (0x9 << 12)
209#define WL1273_IS2_RATE_8K (0xa << 12)
210#define WL1273_IS2_RATE (0xf << 12)
211
212#define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \
213 WL1273_IS2_FORMAT_STD | \
214 WL1273_IS2_MASTER | \
215 WL1273_IS2_TRI_AFTER_SENDING | \
216 WL1273_IS2_SDOWS_RR | \
217 WL1273_IS2_TRI_OPT | \
218 WL1273_IS2_RATE_48K)
219
220#define SCHAR_MIN (-128)
221#define SCHAR_MAX 127
222
223#define WL1273_FR_EVENT BIT(0)
224#define WL1273_BL_EVENT BIT(1)
225#define WL1273_RDS_EVENT BIT(2)
226#define WL1273_BBLK_EVENT BIT(3)
227#define WL1273_LSYNC_EVENT BIT(4)
228#define WL1273_LEV_EVENT BIT(5)
229#define WL1273_IFFR_EVENT BIT(6)
230#define WL1273_PI_EVENT BIT(7)
231#define WL1273_PD_EVENT BIT(8)
232#define WL1273_STIC_EVENT BIT(9)
233#define WL1273_MAL_EVENT BIT(10)
234#define WL1273_POW_ENB_EVENT BIT(11)
235#define WL1273_SCAN_OVER_EVENT BIT(12)
236#define WL1273_ERROR_EVENT BIT(13)
237
238#define TUNER_MODE_STOP_SEARCH 0
239#define TUNER_MODE_PRESET 1
240#define TUNER_MODE_AUTO_SEEK 2
241#define TUNER_MODE_AF 3
242#define TUNER_MODE_AUTO_SEEK_PI 4
243#define TUNER_MODE_AUTO_SEEK_BULK 5
244
245#define RDS_BLOCK_SIZE 3
246
247struct wl1273_fm_platform_data {
248 int (*request_resources) (struct i2c_client *client);
249 void (*free_resources) (void);
250 void (*enable) (void);
251 void (*disable) (void);
252
253 u8 forbidden_modes;
254 unsigned int children;
255};
256
257#define WL1273_FM_CORE_CELLS 2
258
259#define WL1273_BAND_OTHER 0
260#define WL1273_BAND_JAPAN 1
261
262#define WL1273_BAND_JAPAN_LOW 76000
263#define WL1273_BAND_JAPAN_HIGH 90000
264#define WL1273_BAND_OTHER_LOW 87500
265#define WL1273_BAND_OTHER_HIGH 108000
266
267#define WL1273_BAND_TX_LOW 76000
268#define WL1273_BAND_TX_HIGH 108000
269
270struct wl1273_core {
271 struct mfd_cell cells[WL1273_FM_CORE_CELLS];
272 struct wl1273_fm_platform_data *pdata;
273
274 unsigned int mode;
275 unsigned int i2s_mode;
276 unsigned int volume;
277 unsigned int audio_mode;
278 unsigned int channel_number;
279 struct mutex lock; /* for serializing fm radio operations */
280
281 struct i2c_client *client;
282
283 int (*read)(struct wl1273_core *core, u8, u16 *);
284 int (*write)(struct wl1273_core *core, u8, u16);
285 int (*write_data)(struct wl1273_core *core, u8 *, u16);
286 int (*set_audio)(struct wl1273_core *core, unsigned int);
287 int (*set_volume)(struct wl1273_core *core, unsigned int);
288};
289
290#endif /* ifndef WL1273_CORE_H */
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index eb5bd4e0e03c..0d515ee1c247 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -238,6 +238,16 @@ struct regulator_dev;
238 238
239#define WM831X_NUM_IRQ_REGS 5 239#define WM831X_NUM_IRQ_REGS 5
240 240
241enum wm831x_parent {
242 WM8310 = 0x8310,
243 WM8311 = 0x8311,
244 WM8312 = 0x8312,
245 WM8320 = 0x8320,
246 WM8321 = 0x8321,
247 WM8325 = 0x8325,
248 WM8326 = 0x8326,
249};
250
241struct wm831x { 251struct wm831x {
242 struct mutex io_lock; 252 struct mutex io_lock;
243 253
@@ -285,33 +295,10 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
285int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, 295int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
286 int count, u16 *buf); 296 int count, u16 *buf);
287 297
298int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq);
299void wm831x_device_exit(struct wm831x *wm831x);
300int wm831x_device_suspend(struct wm831x *wm831x);
288int wm831x_irq_init(struct wm831x *wm831x, int irq); 301int wm831x_irq_init(struct wm831x *wm831x, int irq);
289void wm831x_irq_exit(struct wm831x *wm831x); 302void wm831x_irq_exit(struct wm831x *wm831x);
290 303
291static inline int __must_check wm831x_request_irq(struct wm831x *wm831x,
292 unsigned int irq,
293 irq_handler_t handler,
294 unsigned long flags,
295 const char *name,
296 void *dev)
297{
298 return request_threaded_irq(irq, NULL, handler, flags, name, dev);
299}
300
301static inline void wm831x_free_irq(struct wm831x *wm831x,
302 unsigned int irq, void *dev)
303{
304 free_irq(irq, dev);
305}
306
307static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq)
308{
309 disable_irq(irq);
310}
311
312static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq)
313{
314 enable_irq(irq);
315}
316
317#endif 304#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index fd322aca33ba..ff42d700293f 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -80,7 +80,10 @@ struct wm831x_touch_pdata {
80 int isel; /** Current for pen down (uA) */ 80 int isel; /** Current for pen down (uA) */
81 int rpu; /** Pen down sensitivity resistor divider */ 81 int rpu; /** Pen down sensitivity resistor divider */
82 int pressure; /** Report pressure (boolean) */ 82 int pressure; /** Report pressure (boolean) */
83 int data_irq; /** Touch data ready IRQ */ 83 unsigned int data_irq; /** Touch data ready IRQ */
84 int data_irqf; /** IRQ flags for data ready IRQ */
85 unsigned int pd_irq; /** Touch pendown detect IRQ */
86 int pd_irqf; /** IRQ flags for pen down IRQ */
84}; 87};
85 88
86enum wm831x_watchdog_action { 89enum wm831x_watchdog_action {
@@ -102,14 +105,24 @@ struct wm831x_watchdog_pdata {
102#define WM831X_MAX_LDO 11 105#define WM831X_MAX_LDO 11
103#define WM831X_MAX_ISINK 2 106#define WM831X_MAX_ISINK 2
104 107
108#define WM831X_GPIO_CONFIGURE 0x10000
109#define WM831X_GPIO_NUM 16
110
105struct wm831x_pdata { 111struct wm831x_pdata {
112 /** Used to distinguish multiple WM831x chips */
113 int wm831x_num;
114
106 /** Called before subdevices are set up */ 115 /** Called before subdevices are set up */
107 int (*pre_init)(struct wm831x *wm831x); 116 int (*pre_init)(struct wm831x *wm831x);
108 /** Called after subdevices are set up */ 117 /** Called after subdevices are set up */
109 int (*post_init)(struct wm831x *wm831x); 118 int (*post_init)(struct wm831x *wm831x);
110 119
120 /** Put the /IRQ line into CMOS mode */
121 bool irq_cmos;
122
111 int irq_base; 123 int irq_base;
112 int gpio_base; 124 int gpio_base;
125 int gpio_defaults[WM831X_GPIO_NUM];
113 struct wm831x_backlight_pdata *backlight; 126 struct wm831x_backlight_pdata *backlight;
114 struct wm831x_backup_pdata *backup; 127 struct wm831x_backup_pdata *backup;
115 struct wm831x_battery_pdata *battery; 128 struct wm831x_battery_pdata *battery;
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h
index a95141eafce3..bd581c6fa085 100644
--- a/include/linux/mfd/wm8350/audio.h
+++ b/include/linux/mfd/wm8350/audio.h
@@ -522,9 +522,6 @@
522#define WM8350_MCLK_SEL_PLL_32K 3 522#define WM8350_MCLK_SEL_PLL_32K 3
523#define WM8350_MCLK_SEL_MCLK 5 523#define WM8350_MCLK_SEL_MCLK 5
524 524
525#define WM8350_MCLK_DIR_OUT 0
526#define WM8350_MCLK_DIR_IN 1
527
528/* clock divider id's */ 525/* clock divider id's */
529#define WM8350_ADC_CLKDIV 0 526#define WM8350_ADC_CLKDIV 0
530#define WM8350_DAC_CLKDIV 1 527#define WM8350_DAC_CLKDIV 1
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h
index e786fe9841ef..579b50ca2e02 100644
--- a/include/linux/mfd/wm8350/pmic.h
+++ b/include/linux/mfd/wm8350/pmic.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * pmic.h -- Power Managment Driver for Wolfson WM8350 PMIC 2 * pmic.h -- Power Management Driver for Wolfson WM8350 PMIC
3 * 3 *
4 * Copyright 2007 Wolfson Microelectronics PLC 4 * Copyright 2007 Wolfson Microelectronics PLC
5 * 5 *
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index de79baee4925..f0b69cdae41c 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -17,6 +17,11 @@
17 17
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19 19
20enum wm8994_type {
21 WM8994 = 0,
22 WM8958 = 1,
23};
24
20struct regulator_dev; 25struct regulator_dev;
21struct regulator_bulk_data; 26struct regulator_bulk_data;
22 27
@@ -48,11 +53,13 @@ struct wm8994 {
48 struct mutex io_lock; 53 struct mutex io_lock;
49 struct mutex irq_lock; 54 struct mutex irq_lock;
50 55
56 enum wm8994_type type;
57
51 struct device *dev; 58 struct device *dev;
52 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, 59 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg,
53 int bytes, void *dest); 60 int bytes, void *dest);
54 int (*write_dev)(struct wm8994 *wm8994, unsigned short reg, 61 int (*write_dev)(struct wm8994 *wm8994, unsigned short reg,
55 int bytes, void *src); 62 int bytes, const void *src);
56 63
57 void *control_data; 64 void *control_data;
58 65
@@ -64,10 +71,12 @@ struct wm8994 {
64 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; 71 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
65 72
66 /* Used over suspend/resume */ 73 /* Used over suspend/resume */
74 bool suspended;
67 u16 ldo_regs[WM8994_NUM_LDO_REGS]; 75 u16 ldo_regs[WM8994_NUM_LDO_REGS];
68 u16 gpio_regs[WM8994_NUM_GPIO_REGS]; 76 u16 gpio_regs[WM8994_NUM_GPIO_REGS];
69 77
70 struct regulator_dev *dbvdd; 78 struct regulator_dev *dbvdd;
79 int num_supplies;
71 struct regulator_bulk_data *supplies; 80 struct regulator_bulk_data *supplies;
72}; 81};
73 82
@@ -79,6 +88,8 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
79 unsigned short mask, unsigned short val); 88 unsigned short mask, unsigned short val);
80int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, 89int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
81 int count, u16 *buf); 90 int count, u16 *buf);
91int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
92 int count, const u16 *buf);
82 93
83 94
84/* Helper to save on boilerplate */ 95/* Helper to save on boilerplate */
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 5c51f367c061..d12f8d635a81 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -29,7 +29,13 @@ struct wm8994_ldo_pdata {
29#define WM8994_CONFIGURE_GPIO 0x8000 29#define WM8994_CONFIGURE_GPIO 0x8000
30 30
31#define WM8994_DRC_REGS 5 31#define WM8994_DRC_REGS 5
32#define WM8994_EQ_REGS 19 32#define WM8994_EQ_REGS 20
33#define WM8958_MBC_CUTOFF_REGS 20
34#define WM8958_MBC_COEFF_REGS 48
35#define WM8958_MBC_COMBINED_REGS 56
36#define WM8958_VSS_HPF_REGS 2
37#define WM8958_VSS_REGS 148
38#define WM8958_ENH_EQ_REGS 32
33 39
34/** 40/**
35 * DRC configurations are specified with a label and a set of register 41 * DRC configurations are specified with a label and a set of register
@@ -59,6 +65,54 @@ struct wm8994_retune_mobile_cfg {
59 u16 regs[WM8994_EQ_REGS]; 65 u16 regs[WM8994_EQ_REGS];
60}; 66};
61 67
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 */
74struct wm8958_mbc_cfg {
75 const char *name;
76 u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS];
77 u16 coeff_regs[WM8958_MBC_COEFF_REGS];
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 */
89struct 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 */
100struct wm8958_vss_cfg {
101 const char *name;
102 u16 regs[WM8958_VSS_REGS];
103};
104
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 */
111struct wm8958_enh_eq_cfg {
112 const char *name;
113 u16 regs[WM8958_ENH_EQ_REGS];
114};
115
62struct wm8994_pdata { 116struct wm8994_pdata {
63 int gpio_base; 117 int gpio_base;
64 118
@@ -78,6 +132,18 @@ struct wm8994_pdata {
78 int num_retune_mobile_cfgs; 132 int num_retune_mobile_cfgs;
79 struct wm8994_retune_mobile_cfg *retune_mobile_cfgs; 133 struct wm8994_retune_mobile_cfg *retune_mobile_cfgs;
80 134
135 int num_mbc_cfgs;
136 struct wm8958_mbc_cfg *mbc_cfgs;
137
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
144 int num_enh_eq_cfgs;
145 struct wm8958_enh_eq_cfg *enh_eq_cfgs;
146
81 /* LINEOUT can be differential or single ended */ 147 /* LINEOUT can be differential or single ended */
82 unsigned int lineout1_diff:1; 148 unsigned int lineout1_diff:1;
83 unsigned int lineout2_diff:1; 149 unsigned int lineout2_diff:1;
@@ -86,13 +152,21 @@ struct wm8994_pdata {
86 unsigned int lineout1fb:1; 152 unsigned int lineout1fb:1;
87 unsigned int lineout2fb:1; 153 unsigned int lineout2fb:1;
88 154
89 /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ 155 /* IRQ for microphone detection if brought out directly as a
156 * signal.
157 */
158 int micdet_irq;
159
160 /* WM8994 microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */
90 unsigned int micbias1_lvl:1; 161 unsigned int micbias1_lvl:1;
91 unsigned int micbias2_lvl:1; 162 unsigned int micbias2_lvl:1;
92 163
93 /* Jack detect threashold levels, see datasheet for values */ 164 /* WM8994 jack detect threashold levels, see datasheet for values */
94 unsigned int jd_scthr:2; 165 unsigned int jd_scthr:2;
95 unsigned int jd_thr:2; 166 unsigned int jd_thr:2;
167
168 /* WM8958 microphone bias configuration */
169 int micbias[2];
96}; 170};
97 171
98#endif 172#endif
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index 967f62f54159..f3ee84284670 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
@@ -63,13 +63,19 @@
63#define WM8994_MICBIAS 0x3A 63#define WM8994_MICBIAS 0x3A
64#define WM8994_LDO_1 0x3B 64#define WM8994_LDO_1 0x3B
65#define WM8994_LDO_2 0x3C 65#define WM8994_LDO_2 0x3C
66#define WM8958_MICBIAS1 0x3D
67#define WM8958_MICBIAS2 0x3E
66#define WM8994_CHARGE_PUMP_1 0x4C 68#define WM8994_CHARGE_PUMP_1 0x4C
69#define WM8958_CHARGE_PUMP_2 0x4D
67#define WM8994_CLASS_W_1 0x51 70#define WM8994_CLASS_W_1 0x51
68#define WM8994_DC_SERVO_1 0x54 71#define WM8994_DC_SERVO_1 0x54
69#define WM8994_DC_SERVO_2 0x55 72#define WM8994_DC_SERVO_2 0x55
70#define WM8994_DC_SERVO_4 0x57 73#define WM8994_DC_SERVO_4 0x57
71#define WM8994_DC_SERVO_READBACK 0x58 74#define WM8994_DC_SERVO_READBACK 0x58
72#define WM8994_ANALOGUE_HP_1 0x60 75#define WM8994_ANALOGUE_HP_1 0x60
76#define WM8958_MIC_DETECT_1 0xD0
77#define WM8958_MIC_DETECT_2 0xD1
78#define WM8958_MIC_DETECT_3 0xD2
73#define WM8994_CHIP_REVISION 0x100 79#define WM8994_CHIP_REVISION 0x100
74#define WM8994_CONTROL_INTERFACE 0x101 80#define WM8994_CONTROL_INTERFACE 0x101
75#define WM8994_WRITE_SEQUENCER_CTRL_1 0x110 81#define WM8994_WRITE_SEQUENCER_CTRL_1 0x110
@@ -109,6 +115,10 @@
109#define WM8994_AIF2DAC_LRCLK 0x315 115#define WM8994_AIF2DAC_LRCLK 0x315
110#define WM8994_AIF2DAC_DATA 0x316 116#define WM8994_AIF2DAC_DATA 0x316
111#define WM8994_AIF2ADC_DATA 0x317 117#define WM8994_AIF2ADC_DATA 0x317
118#define WM8958_AIF3_CONTROL_1 0x320
119#define WM8958_AIF3_CONTROL_2 0x321
120#define WM8958_AIF3DAC_DATA 0x322
121#define WM8958_AIF3ADC_DATA 0x323
112#define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400 122#define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400
113#define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401 123#define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401
114#define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402 124#define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402
@@ -242,6 +252,83 @@
242#define WM8994_INTERRUPT_STATUS_2_MASK 0x739 252#define WM8994_INTERRUPT_STATUS_2_MASK 0x739
243#define WM8994_INTERRUPT_CONTROL 0x740 253#define WM8994_INTERRUPT_CONTROL 0x740
244#define WM8994_IRQ_DEBOUNCE 0x748 254#define WM8994_IRQ_DEBOUNCE 0x748
255#define WM8958_DSP2_PROGRAM 0x900
256#define WM8958_DSP2_CONFIG 0x901
257#define WM8958_DSP2_MAGICNUM 0xA00
258#define WM8958_DSP2_RELEASEYEAR 0xA01
259#define WM8958_DSP2_RELEASEMONTHDAY 0xA02
260#define WM8958_DSP2_RELEASETIME 0xA03
261#define WM8958_DSP2_VERMAJMIN 0xA04
262#define WM8958_DSP2_VERBUILD 0xA05
263#define WM8958_DSP2_EXECCONTROL 0xA0D
264#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_1 0x2200
265#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C1_2 0x2201
266#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_1 0x2202
267#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C2_2 0x2203
268#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_1 0x2204
269#define WM8958_MBC_BAND_2_LOWER_CUTOFF_C3_2 0x2205
270#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_1 0x2206
271#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C2_2 0x2207
272#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_1 0x2208
273#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C3_2 0x2209
274#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_1 0x220A
275#define WM8958_MBC_BAND_2_UPPER_CUTOFF_C1_2 0x220B
276#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_1 0x220C
277#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C1_2 0x220D
278#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_1 0x220E
279#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C2_2 0x220F
280#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_1 0x2210
281#define WM8958_MBC_BAND_1_UPPER_CUTOFF_C3_2 0x2211
282#define WM8958_MBC_BAND_1_LOWER_CUTOFF_1 0x2212
283#define WM8958_MBC_BAND_1_LOWER_CUTOFF_2 0x2213
284#define WM8958_MBC_BAND_1_K_1 0x2400
285#define WM8958_MBC_BAND_1_K_2 0x2401
286#define WM8958_MBC_BAND_1_N1_1 0x2402
287#define WM8958_MBC_BAND_1_N1_2 0x2403
288#define WM8958_MBC_BAND_1_N2_1 0x2404
289#define WM8958_MBC_BAND_1_N2_2 0x2405
290#define WM8958_MBC_BAND_1_N3_1 0x2406
291#define WM8958_MBC_BAND_1_N3_2 0x2407
292#define WM8958_MBC_BAND_1_N4_1 0x2408
293#define WM8958_MBC_BAND_1_N4_2 0x2409
294#define WM8958_MBC_BAND_1_N5_1 0x240A
295#define WM8958_MBC_BAND_1_N5_2 0x240B
296#define WM8958_MBC_BAND_1_X1_1 0x240C
297#define WM8958_MBC_BAND_1_X1_2 0x240D
298#define WM8958_MBC_BAND_1_X2_1 0x240E
299#define WM8958_MBC_BAND_1_X2_2 0x240F
300#define WM8958_MBC_BAND_1_X3_1 0x2410
301#define WM8958_MBC_BAND_1_X3_2 0x2411
302#define WM8958_MBC_BAND_1_ATTACK_1 0x2412
303#define WM8958_MBC_BAND_1_ATTACK_2 0x2413
304#define WM8958_MBC_BAND_1_DECAY_1 0x2414
305#define WM8958_MBC_BAND_1_DECAY_2 0x2415
306#define WM8958_MBC_BAND_2_K_1 0x2416
307#define WM8958_MBC_BAND_2_K_2 0x2417
308#define WM8958_MBC_BAND_2_N1_1 0x2418
309#define WM8958_MBC_BAND_2_N1_2 0x2419
310#define WM8958_MBC_BAND_2_N2_1 0x241A
311#define WM8958_MBC_BAND_2_N2_2 0x241B
312#define WM8958_MBC_BAND_2_N3_1 0x241C
313#define WM8958_MBC_BAND_2_N3_2 0x241D
314#define WM8958_MBC_BAND_2_N4_1 0x241E
315#define WM8958_MBC_BAND_2_N4_2 0x241F
316#define WM8958_MBC_BAND_2_N5_1 0x2420
317#define WM8958_MBC_BAND_2_N5_2 0x2421
318#define WM8958_MBC_BAND_2_X1_1 0x2422
319#define WM8958_MBC_BAND_2_X1_2 0x2423
320#define WM8958_MBC_BAND_2_X2_1 0x2424
321#define WM8958_MBC_BAND_2_X2_2 0x2425
322#define WM8958_MBC_BAND_2_X3_1 0x2426
323#define WM8958_MBC_BAND_2_X3_2 0x2427
324#define WM8958_MBC_BAND_2_ATTACK_1 0x2428
325#define WM8958_MBC_BAND_2_ATTACK_2 0x2429
326#define WM8958_MBC_BAND_2_DECAY_1 0x242A
327#define WM8958_MBC_BAND_2_DECAY_2 0x242B
328#define WM8958_MBC_B2_PG2_1 0x242C
329#define WM8958_MBC_B2_PG2_2 0x242D
330#define WM8958_MBC_B1_PG2_1 0x242E
331#define WM8958_MBC_B1_PG2_2 0x242F
245#define WM8994_WRITE_SEQUENCER_0 0x3000 332#define WM8994_WRITE_SEQUENCER_0 0x3000
246#define WM8994_WRITE_SEQUENCER_1 0x3001 333#define WM8994_WRITE_SEQUENCER_1 0x3001
247#define WM8994_WRITE_SEQUENCER_2 0x3002 334#define WM8994_WRITE_SEQUENCER_2 0x3002
@@ -992,6 +1079,12 @@
992/* 1079/*
993 * R6 (0x06) - Power Management (6) 1080 * R6 (0x06) - Power Management (6)
994 */ 1081 */
1082#define WM8958_AIF3ADC_SRC_MASK 0x0600 /* AIF3ADC_SRC - [10:9] */
1083#define WM8958_AIF3ADC_SRC_SHIFT 9 /* AIF3ADC_SRC - [10:9] */
1084#define WM8958_AIF3ADC_SRC_WIDTH 2 /* AIF3ADC_SRC - [10:9] */
1085#define WM8958_AIF2DAC_SRC_MASK 0x0180 /* AIF2DAC_SRC - [8:7] */
1086#define WM8958_AIF2DAC_SRC_SHIFT 7 /* AIF2DAC_SRC - [8:7] */
1087#define WM8958_AIF2DAC_SRC_WIDTH 2 /* AIF2DAC_SRC - [8:7] */
995#define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */ 1088#define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */
996#define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */ 1089#define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */
997#define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */ 1090#define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */
@@ -1836,6 +1929,14 @@
1836#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */ 1929#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */
1837 1930
1838/* 1931/*
1932 * R77 (0x4D) - Charge Pump (2)
1933 */
1934#define WM8958_CP_DISCH 0x8000 /* CP_DISCH */
1935#define WM8958_CP_DISCH_MASK 0x8000 /* CP_DISCH */
1936#define WM8958_CP_DISCH_SHIFT 15 /* CP_DISCH */
1937#define WM8958_CP_DISCH_WIDTH 1 /* CP_DISCH */
1938
1939/*
1839 * R81 (0x51) - Class W (1) 1940 * R81 (0x51) - Class W (1)
1840 */ 1941 */
1841#define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */ 1942#define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */
@@ -1952,6 +2053,46 @@
1952#define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */ 2053#define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */
1953 2054
1954/* 2055/*
2056 * R208 (0xD0) - Mic Detect 1
2057 */
2058#define WM8958_MICD_BIAS_STARTTIME_MASK 0xF000 /* MICD_BIAS_STARTTIME - [15:12] */
2059#define WM8958_MICD_BIAS_STARTTIME_SHIFT 12 /* MICD_BIAS_STARTTIME - [15:12] */
2060#define WM8958_MICD_BIAS_STARTTIME_WIDTH 4 /* MICD_BIAS_STARTTIME - [15:12] */
2061#define WM8958_MICD_RATE_MASK 0x0F00 /* MICD_RATE - [11:8] */
2062#define WM8958_MICD_RATE_SHIFT 8 /* MICD_RATE - [11:8] */
2063#define WM8958_MICD_RATE_WIDTH 4 /* MICD_RATE - [11:8] */
2064#define WM8958_MICD_DBTIME 0x0002 /* MICD_DBTIME */
2065#define WM8958_MICD_DBTIME_MASK 0x0002 /* MICD_DBTIME */
2066#define WM8958_MICD_DBTIME_SHIFT 1 /* MICD_DBTIME */
2067#define WM8958_MICD_DBTIME_WIDTH 1 /* MICD_DBTIME */
2068#define WM8958_MICD_ENA 0x0001 /* MICD_ENA */
2069#define WM8958_MICD_ENA_MASK 0x0001 /* MICD_ENA */
2070#define WM8958_MICD_ENA_SHIFT 0 /* MICD_ENA */
2071#define WM8958_MICD_ENA_WIDTH 1 /* MICD_ENA */
2072
2073/*
2074 * R209 (0xD1) - Mic Detect 2
2075 */
2076#define WM8958_MICD_LVL_SEL_MASK 0x00FF /* MICD_LVL_SEL - [7:0] */
2077#define WM8958_MICD_LVL_SEL_SHIFT 0 /* MICD_LVL_SEL - [7:0] */
2078#define WM8958_MICD_LVL_SEL_WIDTH 8 /* MICD_LVL_SEL - [7:0] */
2079
2080/*
2081 * R210 (0xD2) - Mic Detect 3
2082 */
2083#define WM8958_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
2084#define WM8958_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
2085#define WM8958_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
2086#define WM8958_MICD_VALID 0x0002 /* MICD_VALID */
2087#define WM8958_MICD_VALID_MASK 0x0002 /* MICD_VALID */
2088#define WM8958_MICD_VALID_SHIFT 1 /* MICD_VALID */
2089#define WM8958_MICD_VALID_WIDTH 1 /* MICD_VALID */
2090#define WM8958_MICD_STS 0x0001 /* MICD_STS */
2091#define WM8958_MICD_STS_MASK 0x0001 /* MICD_STS */
2092#define WM8958_MICD_STS_SHIFT 0 /* MICD_STS */
2093#define WM8958_MICD_STS_WIDTH 1 /* MICD_STS */
2094
2095/*
1955 * R256 (0x100) - Chip Revision 2096 * R256 (0x100) - Chip Revision
1956 */ 2097 */
1957#define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ 2098#define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */
@@ -2069,6 +2210,14 @@
2069/* 2210/*
2070 * R520 (0x208) - Clocking (1) 2211 * R520 (0x208) - Clocking (1)
2071 */ 2212 */
2213#define WM8958_DSP2CLK_ENA 0x4000 /* DSP2CLK_ENA */
2214#define WM8958_DSP2CLK_ENA_MASK 0x4000 /* DSP2CLK_ENA */
2215#define WM8958_DSP2CLK_ENA_SHIFT 14 /* DSP2CLK_ENA */
2216#define WM8958_DSP2CLK_ENA_WIDTH 1 /* DSP2CLK_ENA */
2217#define WM8958_DSP2CLK_SRC 0x1000 /* DSP2CLK_SRC */
2218#define WM8958_DSP2CLK_SRC_MASK 0x1000 /* DSP2CLK_SRC */
2219#define WM8958_DSP2CLK_SRC_SHIFT 12 /* DSP2CLK_SRC */
2220#define WM8958_DSP2CLK_SRC_WIDTH 1 /* DSP2CLK_SRC */
2072#define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */ 2221#define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */
2073#define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */ 2222#define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */
2074#define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */ 2223#define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */
@@ -2553,6 +2702,63 @@
2553#define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */ 2702#define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */
2554 2703
2555/* 2704/*
2705 * R800 (0x320) - AIF3 Control (1)
2706 */
2707#define WM8958_AIF3_LRCLK_INV 0x0080 /* AIF3_LRCLK_INV */
2708#define WM8958_AIF3_LRCLK_INV_MASK 0x0080 /* AIF3_LRCLK_INV */
2709#define WM8958_AIF3_LRCLK_INV_SHIFT 7 /* AIF3_LRCLK_INV */
2710#define WM8958_AIF3_LRCLK_INV_WIDTH 1 /* AIF3_LRCLK_INV */
2711#define WM8958_AIF3_WL_MASK 0x0060 /* AIF3_WL - [6:5] */
2712#define WM8958_AIF3_WL_SHIFT 5 /* AIF3_WL - [6:5] */
2713#define WM8958_AIF3_WL_WIDTH 2 /* AIF3_WL - [6:5] */
2714#define WM8958_AIF3_FMT_MASK 0x0018 /* AIF3_FMT - [4:3] */
2715#define WM8958_AIF3_FMT_SHIFT 3 /* AIF3_FMT - [4:3] */
2716#define WM8958_AIF3_FMT_WIDTH 2 /* AIF3_FMT - [4:3] */
2717
2718/*
2719 * R801 (0x321) - AIF3 Control (2)
2720 */
2721#define WM8958_AIF3DAC_BOOST_MASK 0x0C00 /* AIF3DAC_BOOST - [11:10] */
2722#define WM8958_AIF3DAC_BOOST_SHIFT 10 /* AIF3DAC_BOOST - [11:10] */
2723#define WM8958_AIF3DAC_BOOST_WIDTH 2 /* AIF3DAC_BOOST - [11:10] */
2724#define WM8958_AIF3DAC_COMP 0x0010 /* AIF3DAC_COMP */
2725#define WM8958_AIF3DAC_COMP_MASK 0x0010 /* AIF3DAC_COMP */
2726#define WM8958_AIF3DAC_COMP_SHIFT 4 /* AIF3DAC_COMP */
2727#define WM8958_AIF3DAC_COMP_WIDTH 1 /* AIF3DAC_COMP */
2728#define WM8958_AIF3DAC_COMPMODE 0x0008 /* AIF3DAC_COMPMODE */
2729#define WM8958_AIF3DAC_COMPMODE_MASK 0x0008 /* AIF3DAC_COMPMODE */
2730#define WM8958_AIF3DAC_COMPMODE_SHIFT 3 /* AIF3DAC_COMPMODE */
2731#define WM8958_AIF3DAC_COMPMODE_WIDTH 1 /* AIF3DAC_COMPMODE */
2732#define WM8958_AIF3ADC_COMP 0x0004 /* AIF3ADC_COMP */
2733#define WM8958_AIF3ADC_COMP_MASK 0x0004 /* AIF3ADC_COMP */
2734#define WM8958_AIF3ADC_COMP_SHIFT 2 /* AIF3ADC_COMP */
2735#define WM8958_AIF3ADC_COMP_WIDTH 1 /* AIF3ADC_COMP */
2736#define WM8958_AIF3ADC_COMPMODE 0x0002 /* AIF3ADC_COMPMODE */
2737#define WM8958_AIF3ADC_COMPMODE_MASK 0x0002 /* AIF3ADC_COMPMODE */
2738#define WM8958_AIF3ADC_COMPMODE_SHIFT 1 /* AIF3ADC_COMPMODE */
2739#define WM8958_AIF3ADC_COMPMODE_WIDTH 1 /* AIF3ADC_COMPMODE */
2740#define WM8958_AIF3_LOOPBACK 0x0001 /* AIF3_LOOPBACK */
2741#define WM8958_AIF3_LOOPBACK_MASK 0x0001 /* AIF3_LOOPBACK */
2742#define WM8958_AIF3_LOOPBACK_SHIFT 0 /* AIF3_LOOPBACK */
2743#define WM8958_AIF3_LOOPBACK_WIDTH 1 /* AIF3_LOOPBACK */
2744
2745/*
2746 * R802 (0x322) - AIF3DAC Data
2747 */
2748#define WM8958_AIF3DAC_DAT_INV 0x0001 /* AIF3DAC_DAT_INV */
2749#define WM8958_AIF3DAC_DAT_INV_MASK 0x0001 /* AIF3DAC_DAT_INV */
2750#define WM8958_AIF3DAC_DAT_INV_SHIFT 0 /* AIF3DAC_DAT_INV */
2751#define WM8958_AIF3DAC_DAT_INV_WIDTH 1 /* AIF3DAC_DAT_INV */
2752
2753/*
2754 * R803 (0x323) - AIF3ADC Data
2755 */
2756#define WM8958_AIF3ADC_DAT_INV 0x0001 /* AIF3ADC_DAT_INV */
2757#define WM8958_AIF3ADC_DAT_INV_MASK 0x0001 /* AIF3ADC_DAT_INV */
2758#define WM8958_AIF3ADC_DAT_INV_SHIFT 0 /* AIF3ADC_DAT_INV */
2759#define WM8958_AIF3ADC_DAT_INV_WIDTH 1 /* AIF3ADC_DAT_INV */
2760
2761/*
2556 * R1024 (0x400) - AIF1 ADC1 Left Volume 2762 * R1024 (0x400) - AIF1 ADC1 Left Volume
2557 */ 2763 */
2558#define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */ 2764#define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */
@@ -4289,4 +4495,102 @@
4289#define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */ 4495#define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */
4290#define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */ 4496#define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */
4291 4497
4498/*
4499 * R2304 (0x900) - DSP2_Program
4500 */
4501#define WM8958_DSP2_ENA 0x0001 /* DSP2_ENA */
4502#define WM8958_DSP2_ENA_MASK 0x0001 /* DSP2_ENA */
4503#define WM8958_DSP2_ENA_SHIFT 0 /* DSP2_ENA */
4504#define WM8958_DSP2_ENA_WIDTH 1 /* DSP2_ENA */
4505
4506/*
4507 * R2305 (0x901) - DSP2_Config
4508 */
4509#define WM8958_MBC_SEL_MASK 0x0030 /* MBC_SEL - [5:4] */
4510#define WM8958_MBC_SEL_SHIFT 4 /* MBC_SEL - [5:4] */
4511#define WM8958_MBC_SEL_WIDTH 2 /* MBC_SEL - [5:4] */
4512#define WM8958_MBC_ENA 0x0001 /* MBC_ENA */
4513#define WM8958_MBC_ENA_MASK 0x0001 /* MBC_ENA */
4514#define WM8958_MBC_ENA_SHIFT 0 /* MBC_ENA */
4515#define WM8958_MBC_ENA_WIDTH 1 /* MBC_ENA */
4516
4517/*
4518 * R2560 (0xA00) - DSP2_MagicNum
4519 */
4520#define WM8958_DSP2_MAGIC_NUM_MASK 0xFFFF /* DSP2_MAGIC_NUM - [15:0] */
4521#define WM8958_DSP2_MAGIC_NUM_SHIFT 0 /* DSP2_MAGIC_NUM - [15:0] */
4522#define WM8958_DSP2_MAGIC_NUM_WIDTH 16 /* DSP2_MAGIC_NUM - [15:0] */
4523
4524/*
4525 * R2561 (0xA01) - DSP2_ReleaseYear
4526 */
4527#define WM8958_DSP2_RELEASE_YEAR_MASK 0xFFFF /* DSP2_RELEASE_YEAR - [15:0] */
4528#define WM8958_DSP2_RELEASE_YEAR_SHIFT 0 /* DSP2_RELEASE_YEAR - [15:0] */
4529#define WM8958_DSP2_RELEASE_YEAR_WIDTH 16 /* DSP2_RELEASE_YEAR - [15:0] */
4530
4531/*
4532 * R2562 (0xA02) - DSP2_ReleaseMonthDay
4533 */
4534#define WM8958_DSP2_RELEASE_MONTH_MASK 0xFF00 /* DSP2_RELEASE_MONTH - [15:8] */
4535#define WM8958_DSP2_RELEASE_MONTH_SHIFT 8 /* DSP2_RELEASE_MONTH - [15:8] */
4536#define WM8958_DSP2_RELEASE_MONTH_WIDTH 8 /* DSP2_RELEASE_MONTH - [15:8] */
4537#define WM8958_DSP2_RELEASE_DAY_MASK 0x00FF /* DSP2_RELEASE_DAY - [7:0] */
4538#define WM8958_DSP2_RELEASE_DAY_SHIFT 0 /* DSP2_RELEASE_DAY - [7:0] */
4539#define WM8958_DSP2_RELEASE_DAY_WIDTH 8 /* DSP2_RELEASE_DAY - [7:0] */
4540
4541/*
4542 * R2563 (0xA03) - DSP2_ReleaseTime
4543 */
4544#define WM8958_DSP2_RELEASE_HOURS_MASK 0xFF00 /* DSP2_RELEASE_HOURS - [15:8] */
4545#define WM8958_DSP2_RELEASE_HOURS_SHIFT 8 /* DSP2_RELEASE_HOURS - [15:8] */
4546#define WM8958_DSP2_RELEASE_HOURS_WIDTH 8 /* DSP2_RELEASE_HOURS - [15:8] */
4547#define WM8958_DSP2_RELEASE_MINS_MASK 0x00FF /* DSP2_RELEASE_MINS - [7:0] */
4548#define WM8958_DSP2_RELEASE_MINS_SHIFT 0 /* DSP2_RELEASE_MINS - [7:0] */
4549#define WM8958_DSP2_RELEASE_MINS_WIDTH 8 /* DSP2_RELEASE_MINS - [7:0] */
4550
4551/*
4552 * R2564 (0xA04) - DSP2_VerMajMin
4553 */
4554#define WM8958_DSP2_MAJOR_VER_MASK 0xFF00 /* DSP2_MAJOR_VER - [15:8] */
4555#define WM8958_DSP2_MAJOR_VER_SHIFT 8 /* DSP2_MAJOR_VER - [15:8] */
4556#define WM8958_DSP2_MAJOR_VER_WIDTH 8 /* DSP2_MAJOR_VER - [15:8] */
4557#define WM8958_DSP2_MINOR_VER_MASK 0x00FF /* DSP2_MINOR_VER - [7:0] */
4558#define WM8958_DSP2_MINOR_VER_SHIFT 0 /* DSP2_MINOR_VER - [7:0] */
4559#define WM8958_DSP2_MINOR_VER_WIDTH 8 /* DSP2_MINOR_VER - [7:0] */
4560
4561/*
4562 * R2565 (0xA05) - DSP2_VerBuild
4563 */
4564#define WM8958_DSP2_BUILD_VER_MASK 0xFFFF /* DSP2_BUILD_VER - [15:0] */
4565#define WM8958_DSP2_BUILD_VER_SHIFT 0 /* DSP2_BUILD_VER - [15:0] */
4566#define WM8958_DSP2_BUILD_VER_WIDTH 16 /* DSP2_BUILD_VER - [15:0] */
4567
4568/*
4569 * R2573 (0xA0D) - DSP2_ExecControl
4570 */
4571#define WM8958_DSP2_STOPC 0x0020 /* DSP2_STOPC */
4572#define WM8958_DSP2_STOPC_MASK 0x0020 /* DSP2_STOPC */
4573#define WM8958_DSP2_STOPC_SHIFT 5 /* DSP2_STOPC */
4574#define WM8958_DSP2_STOPC_WIDTH 1 /* DSP2_STOPC */
4575#define WM8958_DSP2_STOPS 0x0010 /* DSP2_STOPS */
4576#define WM8958_DSP2_STOPS_MASK 0x0010 /* DSP2_STOPS */
4577#define WM8958_DSP2_STOPS_SHIFT 4 /* DSP2_STOPS */
4578#define WM8958_DSP2_STOPS_WIDTH 1 /* DSP2_STOPS */
4579#define WM8958_DSP2_STOPI 0x0008 /* DSP2_STOPI */
4580#define WM8958_DSP2_STOPI_MASK 0x0008 /* DSP2_STOPI */
4581#define WM8958_DSP2_STOPI_SHIFT 3 /* DSP2_STOPI */
4582#define WM8958_DSP2_STOPI_WIDTH 1 /* DSP2_STOPI */
4583#define WM8958_DSP2_STOP 0x0004 /* DSP2_STOP */
4584#define WM8958_DSP2_STOP_MASK 0x0004 /* DSP2_STOP */
4585#define WM8958_DSP2_STOP_SHIFT 2 /* DSP2_STOP */
4586#define WM8958_DSP2_STOP_WIDTH 1 /* DSP2_STOP */
4587#define WM8958_DSP2_RUNR 0x0002 /* DSP2_RUNR */
4588#define WM8958_DSP2_RUNR_MASK 0x0002 /* DSP2_RUNR */
4589#define WM8958_DSP2_RUNR_SHIFT 1 /* DSP2_RUNR */
4590#define WM8958_DSP2_RUNR_WIDTH 1 /* DSP2_RUNR */
4591#define WM8958_DSP2_RUN 0x0001 /* DSP2_RUN */
4592#define WM8958_DSP2_RUN_MASK 0x0001 /* DSP2_RUN */
4593#define WM8958_DSP2_RUN_SHIFT 0 /* DSP2_RUN */
4594#define WM8958_DSP2_RUN_WIDTH 1 /* DSP2_RUN */
4595
4292#endif 4596#endif