diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 14:53:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 14:53:11 -0400 |
commit | 4b781474682434e7881f20e9dfbe6687ea619795 (patch) | |
tree | bdd976645ead7f04900e60017502e6a41b03e601 /include | |
parent | 53f2c4a8fd882009a2a75c5b72d6898c0808616e (diff) | |
parent | 29f772d41c01ad6b72c3de705e79779857badcde (diff) |
Merge tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
"Besides the usual cleanups, this one brings:
* Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton,
ST-E's STAX211, Samsung's MAX77693 and TI's LM3533.
* Device tree support for the twl6040, tps65910, da9502 and ab8500
drivers.
* Fairly big tps56910, ab8500 and db8500 updates.
* i2c support for mc13xxx.
* Our regular update for the wm8xxx driver from Mark."
Fix up various conflicts with other trees, largely due to ab5500 removal
etc.
* tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits)
mfd: Fix build break of max77693 by adding REGMAP_I2C option
mfd: Fix twl6040 build failure
mfd: Fix max77693 build failure
mfd: ab8500-core should depend on MFD_DB8500_PRCMU
gpio: tps65910: dt: process gpio specific device node info
mfd: Remove the parsing of dt info for tps65910 gpio
mfd: Save device node parsed platform data for tps65910 sub devices
mfd: Add r_select to lm3533 platform data
gpio: Add Intel Centerton support to gpio-sch
mfd: Emulate active low IRQs as well as active high IRQs for wm831x
mfd: Mark two lm3533 zone registers as volatile
mfd: Fix return type of lm533 attribute is_visible
mfd: Enable Device Tree support in the ab8500-pwm driver
mfd: Enable Device Tree support in the ab8500-sysctrl driver
mfd: Add support for Device Tree to twl6040
mfd: Register the twl6040 child for the ASoC codec unconditionally
mfd: Allocate twl6040 IRQ numbers dynamically
mfd: twl6040 code cleanup in interrupt initialization part
mfd: Enable ab8500-gpadc driver for Device Tree
mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/abx500/ab8500.h | 18 | ||||
-rw-r--r-- | include/linux/mfd/anatop.h | 4 | ||||
-rw-r--r-- | include/linux/mfd/asic3.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/da9052/da9052.h | 19 | ||||
-rw-r--r-- | include/linux/mfd/lm3533.h | 104 | ||||
-rw-r--r-- | include/linux/mfd/lpc_ich.h | 48 | ||||
-rw-r--r-- | include/linux/mfd/max77693-private.h | 227 | ||||
-rw-r--r-- | include/linux/mfd/max77693.h | 36 | ||||
-rw-r--r-- | include/linux/mfd/sta2x11-mfd.h | 324 | ||||
-rw-r--r-- | include/linux/mfd/stmpe.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/tps65910.h | 49 | ||||
-rw-r--r-- | include/linux/mfd/twl6040.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/wm831x/core.h | 12 | ||||
-rw-r--r-- | include/linux/mfd/wm8350/core.h | 9 | ||||
-rw-r--r-- | include/linux/mfd/wm8400-private.h | 14 | ||||
-rw-r--r-- | include/linux/mfd/wm8994/core.h | 1 | ||||
-rw-r--r-- | include/linux/mfd/wm8994/registers.h | 3 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 1 |
18 files changed, 846 insertions, 29 deletions
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index fccc3002f271..91dd3ef63e99 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #ifndef MFD_AB8500_H | 7 | #ifndef MFD_AB8500_H |
8 | #define MFD_AB8500_H | 8 | #define MFD_AB8500_H |
9 | 9 | ||
10 | #include <linux/atomic.h> | ||
10 | #include <linux/mutex.h> | 11 | #include <linux/mutex.h> |
11 | 12 | ||
12 | struct device; | 13 | struct device; |
@@ -194,6 +195,14 @@ enum ab8500_version { | |||
194 | #define AB9540_INT_GPIO52F 123 | 195 | #define AB9540_INT_GPIO52F 123 |
195 | #define AB9540_INT_GPIO53F 124 | 196 | #define AB9540_INT_GPIO53F 124 |
196 | #define AB9540_INT_GPIO54F 125 /* not 8505 */ | 197 | #define AB9540_INT_GPIO54F 125 /* not 8505 */ |
198 | /* ab8500_irq_regoffset[16] -> IT[Source|Latch|Mask]25 */ | ||
199 | #define AB8505_INT_KEYSTUCK 128 | ||
200 | #define AB8505_INT_IKR 129 | ||
201 | #define AB8505_INT_IKP 130 | ||
202 | #define AB8505_INT_KP 131 | ||
203 | #define AB8505_INT_KEYDEGLITCH 132 | ||
204 | #define AB8505_INT_MODPWRSTATUSF 134 | ||
205 | #define AB8505_INT_MODPWRSTATUSR 135 | ||
197 | 206 | ||
198 | /* | 207 | /* |
199 | * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the | 208 | * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the |
@@ -203,8 +212,8 @@ enum ab8500_version { | |||
203 | * which is larger. | 212 | * which is larger. |
204 | */ | 213 | */ |
205 | #define AB8500_NR_IRQS 112 | 214 | #define AB8500_NR_IRQS 112 |
206 | #define AB8505_NR_IRQS 128 | 215 | #define AB8505_NR_IRQS 136 |
207 | #define AB9540_NR_IRQS 128 | 216 | #define AB9540_NR_IRQS 136 |
208 | /* This is set to the roof of any AB8500 chip variant IRQ counts */ | 217 | /* This is set to the roof of any AB8500 chip variant IRQ counts */ |
209 | #define AB8500_MAX_NR_IRQS AB9540_NR_IRQS | 218 | #define AB8500_MAX_NR_IRQS AB9540_NR_IRQS |
210 | 219 | ||
@@ -216,6 +225,7 @@ enum ab8500_version { | |||
216 | * @dev: parent device | 225 | * @dev: parent device |
217 | * @lock: read/write operations lock | 226 | * @lock: read/write operations lock |
218 | * @irq_lock: genirq bus lock | 227 | * @irq_lock: genirq bus lock |
228 | * @transfer_ongoing: 0 if no transfer ongoing | ||
219 | * @irq: irq line | 229 | * @irq: irq line |
220 | * @version: chip version id (e.g. ab8500 or ab9540) | 230 | * @version: chip version id (e.g. ab8500 or ab9540) |
221 | * @chip_id: chip revision id | 231 | * @chip_id: chip revision id |
@@ -234,7 +244,7 @@ struct ab8500 { | |||
234 | struct device *dev; | 244 | struct device *dev; |
235 | struct mutex lock; | 245 | struct mutex lock; |
236 | struct mutex irq_lock; | 246 | struct mutex irq_lock; |
237 | 247 | atomic_t transfer_ongoing; | |
238 | int irq_base; | 248 | int irq_base; |
239 | int irq; | 249 | int irq; |
240 | enum ab8500_version version; | 250 | enum ab8500_version version; |
@@ -280,6 +290,8 @@ extern int __devinit ab8500_init(struct ab8500 *ab8500, | |||
280 | enum ab8500_version version); | 290 | enum ab8500_version version); |
281 | extern int __devexit ab8500_exit(struct ab8500 *ab8500); | 291 | extern int __devexit ab8500_exit(struct ab8500 *ab8500); |
282 | 292 | ||
293 | extern int ab8500_suspend(struct ab8500 *ab8500); | ||
294 | |||
283 | static inline int is_ab8500(struct ab8500 *ab) | 295 | static inline int is_ab8500(struct ab8500 *ab) |
284 | { | 296 | { |
285 | return ab->version == AB8500_VERSION_AB8500; | 297 | return ab->version == AB8500_VERSION_AB8500; |
diff --git a/include/linux/mfd/anatop.h b/include/linux/mfd/anatop.h index 22c1007d3ec5..7f92acf03d9e 100644 --- a/include/linux/mfd/anatop.h +++ b/include/linux/mfd/anatop.h | |||
@@ -34,7 +34,7 @@ struct anatop { | |||
34 | spinlock_t reglock; | 34 | spinlock_t reglock; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | extern u32 anatop_get_bits(struct anatop *, u32, int, int); | 37 | extern u32 anatop_read_reg(struct anatop *, u32); |
38 | extern void anatop_set_bits(struct anatop *, u32, int, int, u32); | 38 | extern void anatop_write_reg(struct anatop *, u32, u32, u32); |
39 | 39 | ||
40 | #endif /* __LINUX_MFD_ANATOP_H */ | 40 | #endif /* __LINUX_MFD_ANATOP_H */ |
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h index ef6faa5cee46..e1148d037e7b 100644 --- a/include/linux/mfd/asic3.h +++ b/include/linux/mfd/asic3.h | |||
@@ -31,6 +31,8 @@ struct asic3_platform_data { | |||
31 | 31 | ||
32 | unsigned int gpio_base; | 32 | unsigned int gpio_base; |
33 | 33 | ||
34 | unsigned int clock_rate; | ||
35 | |||
34 | struct asic3_led *leds; | 36 | struct asic3_led *leds; |
35 | }; | 37 | }; |
36 | 38 | ||
diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h index 8313cd9658e3..0507c4c21a7d 100644 --- a/include/linux/mfd/da9052/da9052.h +++ b/include/linux/mfd/da9052/da9052.h | |||
@@ -33,6 +33,18 @@ | |||
33 | 33 | ||
34 | #include <linux/mfd/da9052/reg.h> | 34 | #include <linux/mfd/da9052/reg.h> |
35 | 35 | ||
36 | /* Common - HWMON Channel Definations */ | ||
37 | #define DA9052_ADC_VDDOUT 0 | ||
38 | #define DA9052_ADC_ICH 1 | ||
39 | #define DA9052_ADC_TBAT 2 | ||
40 | #define DA9052_ADC_VBAT 3 | ||
41 | #define DA9052_ADC_IN4 4 | ||
42 | #define DA9052_ADC_IN5 5 | ||
43 | #define DA9052_ADC_IN6 6 | ||
44 | #define DA9052_ADC_TSI 7 | ||
45 | #define DA9052_ADC_TJUNC 8 | ||
46 | #define DA9052_ADC_VBBAT 9 | ||
47 | |||
36 | #define DA9052_IRQ_DCIN 0 | 48 | #define DA9052_IRQ_DCIN 0 |
37 | #define DA9052_IRQ_VBUS 1 | 49 | #define DA9052_IRQ_VBUS 1 |
38 | #define DA9052_IRQ_DCINREM 2 | 50 | #define DA9052_IRQ_DCINREM 2 |
@@ -79,6 +91,9 @@ struct da9052 { | |||
79 | struct device *dev; | 91 | struct device *dev; |
80 | struct regmap *regmap; | 92 | struct regmap *regmap; |
81 | 93 | ||
94 | struct mutex auxadc_lock; | ||
95 | struct completion done; | ||
96 | |||
82 | int irq_base; | 97 | int irq_base; |
83 | struct regmap_irq_chip_data *irq_data; | 98 | struct regmap_irq_chip_data *irq_data; |
84 | u8 chip_id; | 99 | u8 chip_id; |
@@ -86,6 +101,10 @@ struct da9052 { | |||
86 | int chip_irq; | 101 | int chip_irq; |
87 | }; | 102 | }; |
88 | 103 | ||
104 | /* ADC API */ | ||
105 | int da9052_adc_manual_read(struct da9052 *da9052, unsigned char channel); | ||
106 | int da9052_adc_read_temp(struct da9052 *da9052); | ||
107 | |||
89 | /* Device I/O API */ | 108 | /* Device I/O API */ |
90 | static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg) | 109 | static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg) |
91 | { | 110 | { |
diff --git a/include/linux/mfd/lm3533.h b/include/linux/mfd/lm3533.h new file mode 100644 index 000000000000..594bc591f256 --- /dev/null +++ b/include/linux/mfd/lm3533.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * lm3533.h -- LM3533 interface | ||
3 | * | ||
4 | * Copyright (C) 2011-2012 Texas Instruments | ||
5 | * | ||
6 | * Author: Johan Hovold <jhovold@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_MFD_LM3533_H | ||
15 | #define __LINUX_MFD_LM3533_H | ||
16 | |||
17 | #define LM3533_ATTR_RO(_name) \ | ||
18 | DEVICE_ATTR(_name, S_IRUGO, show_##_name, NULL) | ||
19 | #define LM3533_ATTR_RW(_name) \ | ||
20 | DEVICE_ATTR(_name, S_IRUGO | S_IWUSR , show_##_name, store_##_name) | ||
21 | |||
22 | struct device; | ||
23 | struct regmap; | ||
24 | |||
25 | struct lm3533 { | ||
26 | struct device *dev; | ||
27 | |||
28 | struct regmap *regmap; | ||
29 | |||
30 | int gpio_hwen; | ||
31 | int irq; | ||
32 | |||
33 | unsigned have_als:1; | ||
34 | unsigned have_backlights:1; | ||
35 | unsigned have_leds:1; | ||
36 | }; | ||
37 | |||
38 | struct lm3533_ctrlbank { | ||
39 | struct lm3533 *lm3533; | ||
40 | struct device *dev; | ||
41 | int id; | ||
42 | }; | ||
43 | |||
44 | struct lm3533_als_platform_data { | ||
45 | unsigned pwm_mode:1; /* PWM input mode (default analog) */ | ||
46 | u8 r_select; /* 1 - 127 (ignored in PWM-mode) */ | ||
47 | }; | ||
48 | |||
49 | struct lm3533_bl_platform_data { | ||
50 | char *name; | ||
51 | u16 max_current; /* 5000 - 29800 uA (800 uA step) */ | ||
52 | u8 default_brightness; /* 0 - 255 */ | ||
53 | u8 pwm; /* 0 - 0x3f */ | ||
54 | }; | ||
55 | |||
56 | struct lm3533_led_platform_data { | ||
57 | char *name; | ||
58 | const char *default_trigger; | ||
59 | u16 max_current; /* 5000 - 29800 uA (800 uA step) */ | ||
60 | u8 pwm; /* 0 - 0x3f */ | ||
61 | }; | ||
62 | |||
63 | enum lm3533_boost_freq { | ||
64 | LM3533_BOOST_FREQ_500KHZ, | ||
65 | LM3533_BOOST_FREQ_1000KHZ, | ||
66 | }; | ||
67 | |||
68 | enum lm3533_boost_ovp { | ||
69 | LM3533_BOOST_OVP_16V, | ||
70 | LM3533_BOOST_OVP_24V, | ||
71 | LM3533_BOOST_OVP_32V, | ||
72 | LM3533_BOOST_OVP_40V, | ||
73 | }; | ||
74 | |||
75 | struct lm3533_platform_data { | ||
76 | int gpio_hwen; | ||
77 | |||
78 | enum lm3533_boost_ovp boost_ovp; | ||
79 | enum lm3533_boost_freq boost_freq; | ||
80 | |||
81 | struct lm3533_als_platform_data *als; | ||
82 | |||
83 | struct lm3533_bl_platform_data *backlights; | ||
84 | int num_backlights; | ||
85 | |||
86 | struct lm3533_led_platform_data *leds; | ||
87 | int num_leds; | ||
88 | }; | ||
89 | |||
90 | extern int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb); | ||
91 | extern int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb); | ||
92 | |||
93 | extern int lm3533_ctrlbank_set_brightness(struct lm3533_ctrlbank *cb, u8 val); | ||
94 | extern int lm3533_ctrlbank_get_brightness(struct lm3533_ctrlbank *cb, u8 *val); | ||
95 | extern int lm3533_ctrlbank_set_max_current(struct lm3533_ctrlbank *cb, | ||
96 | u16 imax); | ||
97 | extern int lm3533_ctrlbank_set_pwm(struct lm3533_ctrlbank *cb, u8 val); | ||
98 | extern int lm3533_ctrlbank_get_pwm(struct lm3533_ctrlbank *cb, u8 *val); | ||
99 | |||
100 | extern int lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val); | ||
101 | extern int lm3533_write(struct lm3533 *lm3533, u8 reg, u8 val); | ||
102 | extern int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask); | ||
103 | |||
104 | #endif /* __LINUX_MFD_LM3533_H */ | ||
diff --git a/include/linux/mfd/lpc_ich.h b/include/linux/mfd/lpc_ich.h new file mode 100644 index 000000000000..fec5256c3f5d --- /dev/null +++ b/include/linux/mfd/lpc_ich.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * linux/drivers/mfd/lpc_ich.h | ||
3 | * | ||
4 | * Copyright (c) 2012 Extreme Engineering Solution, Inc. | ||
5 | * Author: Aaron Sierra <asierra@xes-inc.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 2 as published | ||
9 | * by the Free Software Foundation. | ||
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; see the file COPYING. If not, write to | ||
18 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | #ifndef LPC_ICH_H | ||
21 | #define LPC_ICH_H | ||
22 | |||
23 | /* Watchdog resources */ | ||
24 | #define ICH_RES_IO_TCO 0 | ||
25 | #define ICH_RES_IO_SMI 1 | ||
26 | #define ICH_RES_MEM_OFF 2 | ||
27 | #define ICH_RES_MEM_GCS 0 | ||
28 | |||
29 | /* GPIO resources */ | ||
30 | #define ICH_RES_GPIO 0 | ||
31 | #define ICH_RES_GPE0 1 | ||
32 | |||
33 | /* GPIO compatibility */ | ||
34 | #define ICH_I3100_GPIO 0x401 | ||
35 | #define ICH_V5_GPIO 0x501 | ||
36 | #define ICH_V6_GPIO 0x601 | ||
37 | #define ICH_V7_GPIO 0x701 | ||
38 | #define ICH_V9_GPIO 0x801 | ||
39 | #define ICH_V10CORP_GPIO 0xa01 | ||
40 | #define ICH_V10CONS_GPIO 0xa11 | ||
41 | |||
42 | struct lpc_ich_info { | ||
43 | char name[32]; | ||
44 | unsigned int iTCO_version; | ||
45 | unsigned int gpio_version; | ||
46 | }; | ||
47 | |||
48 | #endif | ||
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h new file mode 100644 index 000000000000..68263c5fa53c --- /dev/null +++ b/include/linux/mfd/max77693-private.h | |||
@@ -0,0 +1,227 @@ | |||
1 | /* | ||
2 | * max77693-private.h - Voltage regulator driver for the Maxim 77693 | ||
3 | * | ||
4 | * Copyright (C) 2012 Samsung Electrnoics | ||
5 | * SangYoung Son <hello.son@samsung.com> | ||
6 | * | ||
7 | * This program is not provided / owned by Maxim Integrated Products. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | */ | ||
23 | |||
24 | #ifndef __LINUX_MFD_MAX77693_PRIV_H | ||
25 | #define __LINUX_MFD_MAX77693_PRIV_H | ||
26 | |||
27 | #include <linux/i2c.h> | ||
28 | |||
29 | #define MAX77693_NUM_IRQ_MUIC_REGS 3 | ||
30 | #define MAX77693_REG_INVALID (0xff) | ||
31 | |||
32 | /* Slave addr = 0xCC: PMIC, Charger, Flash LED */ | ||
33 | enum max77693_pmic_reg { | ||
34 | MAX77693_LED_REG_IFLASH1 = 0x00, | ||
35 | MAX77693_LED_REG_IFLASH2 = 0x01, | ||
36 | MAX77693_LED_REG_ITORCH = 0x02, | ||
37 | MAX77693_LED_REG_ITORCHTIMER = 0x03, | ||
38 | MAX77693_LED_REG_FLASH_TIMER = 0x04, | ||
39 | MAX77693_LED_REG_FLASH_EN = 0x05, | ||
40 | MAX77693_LED_REG_MAX_FLASH1 = 0x06, | ||
41 | MAX77693_LED_REG_MAX_FLASH2 = 0x07, | ||
42 | MAX77693_LED_REG_MAX_FLASH3 = 0x08, | ||
43 | MAX77693_LED_REG_MAX_FLASH4 = 0x09, | ||
44 | MAX77693_LED_REG_VOUT_CNTL = 0x0A, | ||
45 | MAX77693_LED_REG_VOUT_FLASH1 = 0x0B, | ||
46 | MAX77693_LED_REG_VOUT_FLASH2 = 0x0C, | ||
47 | MAX77693_LED_REG_FLASH_INT = 0x0E, | ||
48 | MAX77693_LED_REG_FLASH_INT_MASK = 0x0F, | ||
49 | MAX77693_LED_REG_FLASH_INT_STATUS = 0x10, | ||
50 | |||
51 | MAX77693_PMIC_REG_PMIC_ID1 = 0x20, | ||
52 | MAX77693_PMIC_REG_PMIC_ID2 = 0x21, | ||
53 | MAX77693_PMIC_REG_INTSRC = 0x22, | ||
54 | MAX77693_PMIC_REG_INTSRC_MASK = 0x23, | ||
55 | MAX77693_PMIC_REG_TOPSYS_INT = 0x24, | ||
56 | MAX77693_PMIC_REG_TOPSYS_INT_MASK = 0x26, | ||
57 | MAX77693_PMIC_REG_TOPSYS_STAT = 0x28, | ||
58 | MAX77693_PMIC_REG_MAINCTRL1 = 0x2A, | ||
59 | MAX77693_PMIC_REG_LSCNFG = 0x2B, | ||
60 | |||
61 | MAX77693_CHG_REG_CHG_INT = 0xB0, | ||
62 | MAX77693_CHG_REG_CHG_INT_MASK = 0xB1, | ||
63 | MAX77693_CHG_REG_CHG_INT_OK = 0xB2, | ||
64 | MAX77693_CHG_REG_CHG_DETAILS_00 = 0xB3, | ||
65 | MAX77693_CHG_REG_CHG_DETAILS_01 = 0xB4, | ||
66 | MAX77693_CHG_REG_CHG_DETAILS_02 = 0xB5, | ||
67 | MAX77693_CHG_REG_CHG_DETAILS_03 = 0xB6, | ||
68 | MAX77693_CHG_REG_CHG_CNFG_00 = 0xB7, | ||
69 | MAX77693_CHG_REG_CHG_CNFG_01 = 0xB8, | ||
70 | MAX77693_CHG_REG_CHG_CNFG_02 = 0xB9, | ||
71 | MAX77693_CHG_REG_CHG_CNFG_03 = 0xBA, | ||
72 | MAX77693_CHG_REG_CHG_CNFG_04 = 0xBB, | ||
73 | MAX77693_CHG_REG_CHG_CNFG_05 = 0xBC, | ||
74 | MAX77693_CHG_REG_CHG_CNFG_06 = 0xBD, | ||
75 | MAX77693_CHG_REG_CHG_CNFG_07 = 0xBE, | ||
76 | MAX77693_CHG_REG_CHG_CNFG_08 = 0xBF, | ||
77 | MAX77693_CHG_REG_CHG_CNFG_09 = 0xC0, | ||
78 | MAX77693_CHG_REG_CHG_CNFG_10 = 0xC1, | ||
79 | MAX77693_CHG_REG_CHG_CNFG_11 = 0xC2, | ||
80 | MAX77693_CHG_REG_CHG_CNFG_12 = 0xC3, | ||
81 | MAX77693_CHG_REG_CHG_CNFG_13 = 0xC4, | ||
82 | MAX77693_CHG_REG_CHG_CNFG_14 = 0xC5, | ||
83 | MAX77693_CHG_REG_SAFEOUT_CTRL = 0xC6, | ||
84 | |||
85 | MAX77693_PMIC_REG_END, | ||
86 | }; | ||
87 | |||
88 | /* Slave addr = 0x4A: MUIC */ | ||
89 | enum max77693_muic_reg { | ||
90 | MAX77693_MUIC_REG_ID = 0x00, | ||
91 | MAX77693_MUIC_REG_INT1 = 0x01, | ||
92 | MAX77693_MUIC_REG_INT2 = 0x02, | ||
93 | MAX77693_MUIC_REG_INT3 = 0x03, | ||
94 | MAX77693_MUIC_REG_STATUS1 = 0x04, | ||
95 | MAX77693_MUIC_REG_STATUS2 = 0x05, | ||
96 | MAX77693_MUIC_REG_STATUS3 = 0x06, | ||
97 | MAX77693_MUIC_REG_INTMASK1 = 0x07, | ||
98 | MAX77693_MUIC_REG_INTMASK2 = 0x08, | ||
99 | MAX77693_MUIC_REG_INTMASK3 = 0x09, | ||
100 | MAX77693_MUIC_REG_CDETCTRL1 = 0x0A, | ||
101 | MAX77693_MUIC_REG_CDETCTRL2 = 0x0B, | ||
102 | MAX77693_MUIC_REG_CTRL1 = 0x0C, | ||
103 | MAX77693_MUIC_REG_CTRL2 = 0x0D, | ||
104 | MAX77693_MUIC_REG_CTRL3 = 0x0E, | ||
105 | |||
106 | MAX77693_MUIC_REG_END, | ||
107 | }; | ||
108 | |||
109 | /* Slave addr = 0x90: Haptic */ | ||
110 | enum max77693_haptic_reg { | ||
111 | MAX77693_HAPTIC_REG_STATUS = 0x00, | ||
112 | MAX77693_HAPTIC_REG_CONFIG1 = 0x01, | ||
113 | MAX77693_HAPTIC_REG_CONFIG2 = 0x02, | ||
114 | MAX77693_HAPTIC_REG_CONFIG_CHNL = 0x03, | ||
115 | MAX77693_HAPTIC_REG_CONFG_CYC1 = 0x04, | ||
116 | MAX77693_HAPTIC_REG_CONFG_CYC2 = 0x05, | ||
117 | MAX77693_HAPTIC_REG_CONFIG_PER1 = 0x06, | ||
118 | MAX77693_HAPTIC_REG_CONFIG_PER2 = 0x07, | ||
119 | MAX77693_HAPTIC_REG_CONFIG_PER3 = 0x08, | ||
120 | MAX77693_HAPTIC_REG_CONFIG_PER4 = 0x09, | ||
121 | MAX77693_HAPTIC_REG_CONFIG_DUTY1 = 0x0A, | ||
122 | MAX77693_HAPTIC_REG_CONFIG_DUTY2 = 0x0B, | ||
123 | MAX77693_HAPTIC_REG_CONFIG_PWM1 = 0x0C, | ||
124 | MAX77693_HAPTIC_REG_CONFIG_PWM2 = 0x0D, | ||
125 | MAX77693_HAPTIC_REG_CONFIG_PWM3 = 0x0E, | ||
126 | MAX77693_HAPTIC_REG_CONFIG_PWM4 = 0x0F, | ||
127 | MAX77693_HAPTIC_REG_REV = 0x10, | ||
128 | |||
129 | MAX77693_HAPTIC_REG_END, | ||
130 | }; | ||
131 | |||
132 | enum max77693_irq_source { | ||
133 | LED_INT = 0, | ||
134 | TOPSYS_INT, | ||
135 | CHG_INT, | ||
136 | MUIC_INT1, | ||
137 | MUIC_INT2, | ||
138 | MUIC_INT3, | ||
139 | |||
140 | MAX77693_IRQ_GROUP_NR, | ||
141 | }; | ||
142 | |||
143 | enum max77693_irq { | ||
144 | /* PMIC - FLASH */ | ||
145 | MAX77693_LED_IRQ_FLED2_OPEN, | ||
146 | MAX77693_LED_IRQ_FLED2_SHORT, | ||
147 | MAX77693_LED_IRQ_FLED1_OPEN, | ||
148 | MAX77693_LED_IRQ_FLED1_SHORT, | ||
149 | MAX77693_LED_IRQ_MAX_FLASH, | ||
150 | |||
151 | /* PMIC - TOPSYS */ | ||
152 | MAX77693_TOPSYS_IRQ_T120C_INT, | ||
153 | MAX77693_TOPSYS_IRQ_T140C_INT, | ||
154 | MAX77693_TOPSYS_IRQ_LOWSYS_INT, | ||
155 | |||
156 | /* PMIC - Charger */ | ||
157 | MAX77693_CHG_IRQ_BYP_I, | ||
158 | MAX77693_CHG_IRQ_THM_I, | ||
159 | MAX77693_CHG_IRQ_BAT_I, | ||
160 | MAX77693_CHG_IRQ_CHG_I, | ||
161 | MAX77693_CHG_IRQ_CHGIN_I, | ||
162 | |||
163 | /* MUIC INT1 */ | ||
164 | MAX77693_MUIC_IRQ_INT1_ADC, | ||
165 | MAX77693_MUIC_IRQ_INT1_ADC_LOW, | ||
166 | MAX77693_MUIC_IRQ_INT1_ADC_ERR, | ||
167 | MAX77693_MUIC_IRQ_INT1_ADC1K, | ||
168 | |||
169 | /* MUIC INT2 */ | ||
170 | MAX77693_MUIC_IRQ_INT2_CHGTYP, | ||
171 | MAX77693_MUIC_IRQ_INT2_CHGDETREUN, | ||
172 | MAX77693_MUIC_IRQ_INT2_DCDTMR, | ||
173 | MAX77693_MUIC_IRQ_INT2_DXOVP, | ||
174 | MAX77693_MUIC_IRQ_INT2_VBVOLT, | ||
175 | MAX77693_MUIC_IRQ_INT2_VIDRM, | ||
176 | |||
177 | /* MUIC INT3 */ | ||
178 | MAX77693_MUIC_IRQ_INT3_EOC, | ||
179 | MAX77693_MUIC_IRQ_INT3_CGMBC, | ||
180 | MAX77693_MUIC_IRQ_INT3_OVP, | ||
181 | MAX77693_MUIC_IRQ_INT3_MBCCHG_ERR, | ||
182 | MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, | ||
183 | MAX77693_MUIC_IRQ_INT3_BAT_DET, | ||
184 | |||
185 | MAX77693_IRQ_NR, | ||
186 | }; | ||
187 | |||
188 | struct max77693_dev { | ||
189 | struct device *dev; | ||
190 | struct i2c_client *i2c; /* 0xCC , PMIC, Charger, Flash LED */ | ||
191 | struct i2c_client *muic; /* 0x4A , MUIC */ | ||
192 | struct i2c_client *haptic; /* 0x90 , Haptic */ | ||
193 | struct mutex iolock; | ||
194 | |||
195 | int type; | ||
196 | |||
197 | struct regmap *regmap; | ||
198 | struct regmap *regmap_muic; | ||
199 | struct regmap *regmap_haptic; | ||
200 | |||
201 | struct irq_domain *irq_domain; | ||
202 | |||
203 | int irq; | ||
204 | int irq_gpio; | ||
205 | bool wakeup; | ||
206 | struct mutex irqlock; | ||
207 | int irq_masks_cur[MAX77693_IRQ_GROUP_NR]; | ||
208 | int irq_masks_cache[MAX77693_IRQ_GROUP_NR]; | ||
209 | }; | ||
210 | |||
211 | enum max77693_types { | ||
212 | TYPE_MAX77693, | ||
213 | }; | ||
214 | |||
215 | extern int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest); | ||
216 | extern int max77693_bulk_read(struct regmap *map, u8 reg, int count, | ||
217 | u8 *buf); | ||
218 | extern int max77693_write_reg(struct regmap *map, u8 reg, u8 value); | ||
219 | extern int max77693_bulk_write(struct regmap *map, u8 reg, int count, | ||
220 | u8 *buf); | ||
221 | extern int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask); | ||
222 | |||
223 | extern int max77693_irq_init(struct max77693_dev *max77686); | ||
224 | extern void max77693_irq_exit(struct max77693_dev *max77686); | ||
225 | extern int max77693_irq_resume(struct max77693_dev *max77686); | ||
226 | |||
227 | #endif /* __LINUX_MFD_MAX77693_PRIV_H */ | ||
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h new file mode 100644 index 000000000000..1d28ae90384e --- /dev/null +++ b/include/linux/mfd/max77693.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * max77693.h - Driver for the Maxim 77693 | ||
3 | * | ||
4 | * Copyright (C) 2012 Samsung Electrnoics | ||
5 | * SangYoung Son <hello.son@samsung.com> | ||
6 | * | ||
7 | * This program is not provided / owned by Maxim Integrated Products. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | * This driver is based on max8997.h | ||
24 | * | ||
25 | * MAX77693 has PMIC, Charger, Flash LED, Haptic, MUIC devices. | ||
26 | * The devices share the same I2C bus and included in | ||
27 | * this mfd driver. | ||
28 | */ | ||
29 | |||
30 | #ifndef __LINUX_MFD_MAX77693_H | ||
31 | #define __LINUX_MFD_MAX77693_H | ||
32 | |||
33 | struct max77693_platform_data { | ||
34 | int wakeup; | ||
35 | }; | ||
36 | #endif /* __LINUX_MFD_MAX77693_H */ | ||
diff --git a/include/linux/mfd/sta2x11-mfd.h b/include/linux/mfd/sta2x11-mfd.h new file mode 100644 index 000000000000..d179227e866f --- /dev/null +++ b/include/linux/mfd/sta2x11-mfd.h | |||
@@ -0,0 +1,324 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2009-2011 Wind River Systems, Inc. | ||
3 | * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini) | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
12 | * See the GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | * | ||
18 | * The STMicroelectronics ConneXt (STA2X11) chip has several unrelated | ||
19 | * functions in one PCI endpoint functions. This driver simply | ||
20 | * registers the platform devices in this iomemregion and exports a few | ||
21 | * functions to access common registers | ||
22 | */ | ||
23 | |||
24 | #ifndef __STA2X11_MFD_H | ||
25 | #define __STA2X11_MFD_H | ||
26 | #include <linux/types.h> | ||
27 | #include <linux/pci.h> | ||
28 | |||
29 | /* | ||
30 | * The MFD PCI block includes the GPIO peripherals and other register blocks. | ||
31 | * For GPIO, we have 32*4 bits (I use "gsta" for "gpio sta2x11".) | ||
32 | */ | ||
33 | #define GSTA_GPIO_PER_BLOCK 32 | ||
34 | #define GSTA_NR_BLOCKS 4 | ||
35 | #define GSTA_NR_GPIO (GSTA_GPIO_PER_BLOCK * GSTA_NR_BLOCKS) | ||
36 | |||
37 | /* Pinconfig is set by the board definition: altfunc, pull-up, pull-down */ | ||
38 | struct sta2x11_gpio_pdata { | ||
39 | unsigned pinconfig[GSTA_NR_GPIO]; | ||
40 | }; | ||
41 | |||
42 | /* Macros below lifted from sh_pfc.h, with minor differences */ | ||
43 | #define PINMUX_TYPE_NONE 0 | ||
44 | #define PINMUX_TYPE_FUNCTION 1 | ||
45 | #define PINMUX_TYPE_OUTPUT_LOW 2 | ||
46 | #define PINMUX_TYPE_OUTPUT_HIGH 3 | ||
47 | #define PINMUX_TYPE_INPUT 4 | ||
48 | #define PINMUX_TYPE_INPUT_PULLUP 5 | ||
49 | #define PINMUX_TYPE_INPUT_PULLDOWN 6 | ||
50 | |||
51 | /* Give names to GPIO pins, like PXA does, taken from the manual */ | ||
52 | #define STA2X11_GPIO0 0 | ||
53 | #define STA2X11_GPIO1 1 | ||
54 | #define STA2X11_GPIO2 2 | ||
55 | #define STA2X11_GPIO3 3 | ||
56 | #define STA2X11_GPIO4 4 | ||
57 | #define STA2X11_GPIO5 5 | ||
58 | #define STA2X11_GPIO6 6 | ||
59 | #define STA2X11_GPIO7 7 | ||
60 | #define STA2X11_GPIO8_RGBOUT_RED7 8 | ||
61 | #define STA2X11_GPIO9_RGBOUT_RED6 9 | ||
62 | #define STA2X11_GPIO10_RGBOUT_RED5 10 | ||
63 | #define STA2X11_GPIO11_RGBOUT_RED4 11 | ||
64 | #define STA2X11_GPIO12_RGBOUT_RED3 12 | ||
65 | #define STA2X11_GPIO13_RGBOUT_RED2 13 | ||
66 | #define STA2X11_GPIO14_RGBOUT_RED1 14 | ||
67 | #define STA2X11_GPIO15_RGBOUT_RED0 15 | ||
68 | #define STA2X11_GPIO16_RGBOUT_GREEN7 16 | ||
69 | #define STA2X11_GPIO17_RGBOUT_GREEN6 17 | ||
70 | #define STA2X11_GPIO18_RGBOUT_GREEN5 18 | ||
71 | #define STA2X11_GPIO19_RGBOUT_GREEN4 19 | ||
72 | #define STA2X11_GPIO20_RGBOUT_GREEN3 20 | ||
73 | #define STA2X11_GPIO21_RGBOUT_GREEN2 21 | ||
74 | #define STA2X11_GPIO22_RGBOUT_GREEN1 22 | ||
75 | #define STA2X11_GPIO23_RGBOUT_GREEN0 23 | ||
76 | #define STA2X11_GPIO24_RGBOUT_BLUE7 24 | ||
77 | #define STA2X11_GPIO25_RGBOUT_BLUE6 25 | ||
78 | #define STA2X11_GPIO26_RGBOUT_BLUE5 26 | ||
79 | #define STA2X11_GPIO27_RGBOUT_BLUE4 27 | ||
80 | #define STA2X11_GPIO28_RGBOUT_BLUE3 28 | ||
81 | #define STA2X11_GPIO29_RGBOUT_BLUE2 29 | ||
82 | #define STA2X11_GPIO30_RGBOUT_BLUE1 30 | ||
83 | #define STA2X11_GPIO31_RGBOUT_BLUE0 31 | ||
84 | #define STA2X11_GPIO32_RGBOUT_VSYNCH 32 | ||
85 | #define STA2X11_GPIO33_RGBOUT_HSYNCH 33 | ||
86 | #define STA2X11_GPIO34_RGBOUT_DEN 34 | ||
87 | #define STA2X11_GPIO35_ETH_CRS_DV 35 | ||
88 | #define STA2X11_GPIO36_ETH_TXD1 36 | ||
89 | #define STA2X11_GPIO37_ETH_TXD0 37 | ||
90 | #define STA2X11_GPIO38_ETH_TX_EN 38 | ||
91 | #define STA2X11_GPIO39_MDIO 39 | ||
92 | #define STA2X11_GPIO40_ETH_REF_CLK 40 | ||
93 | #define STA2X11_GPIO41_ETH_RXD1 41 | ||
94 | #define STA2X11_GPIO42_ETH_RXD0 42 | ||
95 | #define STA2X11_GPIO43_MDC 43 | ||
96 | #define STA2X11_GPIO44_CAN_TX 44 | ||
97 | #define STA2X11_GPIO45_CAN_RX 45 | ||
98 | #define STA2X11_GPIO46_MLB_DAT 46 | ||
99 | #define STA2X11_GPIO47_MLB_SIG 47 | ||
100 | #define STA2X11_GPIO48_SPI0_CLK 48 | ||
101 | #define STA2X11_GPIO49_SPI0_TXD 49 | ||
102 | #define STA2X11_GPIO50_SPI0_RXD 50 | ||
103 | #define STA2X11_GPIO51_SPI0_FRM 51 | ||
104 | #define STA2X11_GPIO52_SPI1_CLK 52 | ||
105 | #define STA2X11_GPIO53_SPI1_TXD 53 | ||
106 | #define STA2X11_GPIO54_SPI1_RXD 54 | ||
107 | #define STA2X11_GPIO55_SPI1_FRM 55 | ||
108 | #define STA2X11_GPIO56_SPI2_CLK 56 | ||
109 | #define STA2X11_GPIO57_SPI2_TXD 57 | ||
110 | #define STA2X11_GPIO58_SPI2_RXD 58 | ||
111 | #define STA2X11_GPIO59_SPI2_FRM 59 | ||
112 | #define STA2X11_GPIO60_I2C0_SCL 60 | ||
113 | #define STA2X11_GPIO61_I2C0_SDA 61 | ||
114 | #define STA2X11_GPIO62_I2C1_SCL 62 | ||
115 | #define STA2X11_GPIO63_I2C1_SDA 63 | ||
116 | #define STA2X11_GPIO64_I2C2_SCL 64 | ||
117 | #define STA2X11_GPIO65_I2C2_SDA 65 | ||
118 | #define STA2X11_GPIO66_I2C3_SCL 66 | ||
119 | #define STA2X11_GPIO67_I2C3_SDA 67 | ||
120 | #define STA2X11_GPIO68_MSP0_RCK 68 | ||
121 | #define STA2X11_GPIO69_MSP0_RXD 69 | ||
122 | #define STA2X11_GPIO70_MSP0_RFS 70 | ||
123 | #define STA2X11_GPIO71_MSP0_TCK 71 | ||
124 | #define STA2X11_GPIO72_MSP0_TXD 72 | ||
125 | #define STA2X11_GPIO73_MSP0_TFS 73 | ||
126 | #define STA2X11_GPIO74_MSP0_SCK 74 | ||
127 | #define STA2X11_GPIO75_MSP1_CK 75 | ||
128 | #define STA2X11_GPIO76_MSP1_RXD 76 | ||
129 | #define STA2X11_GPIO77_MSP1_FS 77 | ||
130 | #define STA2X11_GPIO78_MSP1_TXD 78 | ||
131 | #define STA2X11_GPIO79_MSP2_CK 79 | ||
132 | #define STA2X11_GPIO80_MSP2_RXD 80 | ||
133 | #define STA2X11_GPIO81_MSP2_FS 81 | ||
134 | #define STA2X11_GPIO82_MSP2_TXD 82 | ||
135 | #define STA2X11_GPIO83_MSP3_CK 83 | ||
136 | #define STA2X11_GPIO84_MSP3_RXD 84 | ||
137 | #define STA2X11_GPIO85_MSP3_FS 85 | ||
138 | #define STA2X11_GPIO86_MSP3_TXD 86 | ||
139 | #define STA2X11_GPIO87_MSP4_CK 87 | ||
140 | #define STA2X11_GPIO88_MSP4_RXD 88 | ||
141 | #define STA2X11_GPIO89_MSP4_FS 89 | ||
142 | #define STA2X11_GPIO90_MSP4_TXD 90 | ||
143 | #define STA2X11_GPIO91_MSP5_CK 91 | ||
144 | #define STA2X11_GPIO92_MSP5_RXD 92 | ||
145 | #define STA2X11_GPIO93_MSP5_FS 93 | ||
146 | #define STA2X11_GPIO94_MSP5_TXD 94 | ||
147 | #define STA2X11_GPIO95_SDIO3_DAT3 95 | ||
148 | #define STA2X11_GPIO96_SDIO3_DAT2 96 | ||
149 | #define STA2X11_GPIO97_SDIO3_DAT1 97 | ||
150 | #define STA2X11_GPIO98_SDIO3_DAT0 98 | ||
151 | #define STA2X11_GPIO99_SDIO3_CLK 99 | ||
152 | #define STA2X11_GPIO100_SDIO3_CMD 100 | ||
153 | #define STA2X11_GPIO101 101 | ||
154 | #define STA2X11_GPIO102 102 | ||
155 | #define STA2X11_GPIO103 103 | ||
156 | #define STA2X11_GPIO104 104 | ||
157 | #define STA2X11_GPIO105_SDIO2_DAT3 105 | ||
158 | #define STA2X11_GPIO106_SDIO2_DAT2 106 | ||
159 | #define STA2X11_GPIO107_SDIO2_DAT1 107 | ||
160 | #define STA2X11_GPIO108_SDIO2_DAT0 108 | ||
161 | #define STA2X11_GPIO109_SDIO2_CLK 109 | ||
162 | #define STA2X11_GPIO110_SDIO2_CMD 110 | ||
163 | #define STA2X11_GPIO111 111 | ||
164 | #define STA2X11_GPIO112 112 | ||
165 | #define STA2X11_GPIO113 113 | ||
166 | #define STA2X11_GPIO114 114 | ||
167 | #define STA2X11_GPIO115_SDIO1_DAT3 115 | ||
168 | #define STA2X11_GPIO116_SDIO1_DAT2 116 | ||
169 | #define STA2X11_GPIO117_SDIO1_DAT1 117 | ||
170 | #define STA2X11_GPIO118_SDIO1_DAT0 118 | ||
171 | #define STA2X11_GPIO119_SDIO1_CLK 119 | ||
172 | #define STA2X11_GPIO120_SDIO1_CMD 120 | ||
173 | #define STA2X11_GPIO121 121 | ||
174 | #define STA2X11_GPIO122 122 | ||
175 | #define STA2X11_GPIO123 123 | ||
176 | #define STA2X11_GPIO124 124 | ||
177 | #define STA2X11_GPIO125_UART2_TXD 125 | ||
178 | #define STA2X11_GPIO126_UART2_RXD 126 | ||
179 | #define STA2X11_GPIO127_UART3_TXD 127 | ||
180 | |||
181 | /* | ||
182 | * The APB bridge has its own registers, needed by our users as well. | ||
183 | * They are accessed with the following read/mask/write function. | ||
184 | */ | ||
185 | u32 sta2x11_apbreg_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val); | ||
186 | |||
187 | /* CAN and MLB */ | ||
188 | #define APBREG_BSR 0x00 /* Bridge Status Reg */ | ||
189 | #define APBREG_PAER 0x08 /* Peripherals Address Error Reg */ | ||
190 | #define APBREG_PWAC 0x20 /* Peripheral Write Access Control reg */ | ||
191 | #define APBREG_PRAC 0x40 /* Peripheral Read Access Control reg */ | ||
192 | #define APBREG_PCG 0x60 /* Peripheral Clock Gating Reg */ | ||
193 | #define APBREG_PUR 0x80 /* Peripheral Under Reset Reg */ | ||
194 | #define APBREG_EMU_PCG 0xA0 /* Emulator Peripheral Clock Gating Reg */ | ||
195 | |||
196 | #define APBREG_CAN (1 << 1) | ||
197 | #define APBREG_MLB (1 << 3) | ||
198 | |||
199 | /* SARAC */ | ||
200 | #define APBREG_BSR_SARAC 0x100 /* Bridge Status Reg */ | ||
201 | #define APBREG_PAER_SARAC 0x108 /* Peripherals Address Error Reg */ | ||
202 | #define APBREG_PWAC_SARAC 0x120 /* Peripheral Write Access Control reg */ | ||
203 | #define APBREG_PRAC_SARAC 0x140 /* Peripheral Read Access Control reg */ | ||
204 | #define APBREG_PCG_SARAC 0x160 /* Peripheral Clock Gating Reg */ | ||
205 | #define APBREG_PUR_SARAC 0x180 /* Peripheral Under Reset Reg */ | ||
206 | #define APBREG_EMU_PCG_SARAC 0x1A0 /* Emulator Peripheral Clock Gating Reg */ | ||
207 | |||
208 | #define APBREG_SARAC (1 << 2) | ||
209 | |||
210 | /* | ||
211 | * The system controller has its own registers. Some of these are accessed | ||
212 | * by out users as well, using the following read/mask/write/function | ||
213 | */ | ||
214 | u32 sta2x11_sctl_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val); | ||
215 | |||
216 | #define SCTL_SCCTL 0x00 /* System controller control register */ | ||
217 | #define SCTL_ARMCFG 0x04 /* ARM configuration register */ | ||
218 | #define SCTL_SCPLLCTL 0x08 /* PLL control status register */ | ||
219 | #define SCTL_SCPLLFCTRL 0x0c /* PLL frequency control register */ | ||
220 | #define SCTL_SCRESFRACT 0x10 /* PLL fractional input register */ | ||
221 | #define SCTL_SCRESCTRL1 0x14 /* Peripheral reset control 1 */ | ||
222 | #define SCTL_SCRESXTRL2 0x18 /* Peripheral reset control 2 */ | ||
223 | #define SCTL_SCPEREN0 0x1c /* Peripheral clock enable register 0 */ | ||
224 | #define SCTL_SCPEREN1 0x20 /* Peripheral clock enable register 1 */ | ||
225 | #define SCTL_SCPEREN2 0x24 /* Peripheral clock enable register 2 */ | ||
226 | #define SCTL_SCGRST 0x28 /* Peripheral global reset */ | ||
227 | #define SCTL_SCPCIPMCR1 0x30 /* PCI power management control 1 */ | ||
228 | #define SCTL_SCPCIPMCR2 0x34 /* PCI power management control 2 */ | ||
229 | #define SCTL_SCPCIPMSR1 0x38 /* PCI power management status 1 */ | ||
230 | #define SCTL_SCPCIPMSR2 0x3c /* PCI power management status 2 */ | ||
231 | #define SCTL_SCPCIPMSR3 0x40 /* PCI power management status 3 */ | ||
232 | #define SCTL_SCINTREN 0x44 /* Interrupt enable */ | ||
233 | #define SCTL_SCRISR 0x48 /* RAW interrupt status */ | ||
234 | #define SCTL_SCCLKSTAT0 0x4c /* Peripheral clocks status 0 */ | ||
235 | #define SCTL_SCCLKSTAT1 0x50 /* Peripheral clocks status 1 */ | ||
236 | #define SCTL_SCCLKSTAT2 0x54 /* Peripheral clocks status 2 */ | ||
237 | #define SCTL_SCRSTSTA 0x58 /* Reset status register */ | ||
238 | |||
239 | #define SCTL_SCRESCTRL1_USB_PHY_POR (1 << 0) | ||
240 | #define SCTL_SCRESCTRL1_USB_OTG (1 << 1) | ||
241 | #define SCTL_SCRESCTRL1_USB_HRST (1 << 2) | ||
242 | #define SCTL_SCRESCTRL1_USB_PHY_HOST (1 << 3) | ||
243 | #define SCTL_SCRESCTRL1_SATAII (1 << 4) | ||
244 | #define SCTL_SCRESCTRL1_VIP (1 << 5) | ||
245 | #define SCTL_SCRESCTRL1_PER_MMC0 (1 << 6) | ||
246 | #define SCTL_SCRESCTRL1_PER_MMC1 (1 << 7) | ||
247 | #define SCTL_SCRESCTRL1_PER_GPIO0 (1 << 8) | ||
248 | #define SCTL_SCRESCTRL1_PER_GPIO1 (1 << 9) | ||
249 | #define SCTL_SCRESCTRL1_PER_GPIO2 (1 << 10) | ||
250 | #define SCTL_SCRESCTRL1_PER_GPIO3 (1 << 11) | ||
251 | #define SCTL_SCRESCTRL1_PER_MTU0 (1 << 12) | ||
252 | #define SCTL_SCRESCTRL1_KER_SPI0 (1 << 13) | ||
253 | #define SCTL_SCRESCTRL1_KER_SPI1 (1 << 14) | ||
254 | #define SCTL_SCRESCTRL1_KER_SPI2 (1 << 15) | ||
255 | #define SCTL_SCRESCTRL1_KER_MCI0 (1 << 16) | ||
256 | #define SCTL_SCRESCTRL1_KER_MCI1 (1 << 17) | ||
257 | #define SCTL_SCRESCTRL1_PRE_HSI2C0 (1 << 18) | ||
258 | #define SCTL_SCRESCTRL1_PER_HSI2C1 (1 << 19) | ||
259 | #define SCTL_SCRESCTRL1_PER_HSI2C2 (1 << 20) | ||
260 | #define SCTL_SCRESCTRL1_PER_HSI2C3 (1 << 21) | ||
261 | #define SCTL_SCRESCTRL1_PER_MSP0 (1 << 22) | ||
262 | #define SCTL_SCRESCTRL1_PER_MSP1 (1 << 23) | ||
263 | #define SCTL_SCRESCTRL1_PER_MSP2 (1 << 24) | ||
264 | #define SCTL_SCRESCTRL1_PER_MSP3 (1 << 25) | ||
265 | #define SCTL_SCRESCTRL1_PER_MSP4 (1 << 26) | ||
266 | #define SCTL_SCRESCTRL1_PER_MSP5 (1 << 27) | ||
267 | #define SCTL_SCRESCTRL1_PER_MMC (1 << 28) | ||
268 | #define SCTL_SCRESCTRL1_KER_MSP0 (1 << 29) | ||
269 | #define SCTL_SCRESCTRL1_KER_MSP1 (1 << 30) | ||
270 | #define SCTL_SCRESCTRL1_KER_MSP2 (1 << 31) | ||
271 | |||
272 | #define SCTL_SCPEREN0_UART0 (1 << 0) | ||
273 | #define SCTL_SCPEREN0_UART1 (1 << 1) | ||
274 | #define SCTL_SCPEREN0_UART2 (1 << 2) | ||
275 | #define SCTL_SCPEREN0_UART3 (1 << 3) | ||
276 | #define SCTL_SCPEREN0_MSP0 (1 << 4) | ||
277 | #define SCTL_SCPEREN0_MSP1 (1 << 5) | ||
278 | #define SCTL_SCPEREN0_MSP2 (1 << 6) | ||
279 | #define SCTL_SCPEREN0_MSP3 (1 << 7) | ||
280 | #define SCTL_SCPEREN0_MSP4 (1 << 8) | ||
281 | #define SCTL_SCPEREN0_MSP5 (1 << 9) | ||
282 | #define SCTL_SCPEREN0_SPI0 (1 << 10) | ||
283 | #define SCTL_SCPEREN0_SPI1 (1 << 11) | ||
284 | #define SCTL_SCPEREN0_SPI2 (1 << 12) | ||
285 | #define SCTL_SCPEREN0_I2C0 (1 << 13) | ||
286 | #define SCTL_SCPEREN0_I2C1 (1 << 14) | ||
287 | #define SCTL_SCPEREN0_I2C2 (1 << 15) | ||
288 | #define SCTL_SCPEREN0_I2C3 (1 << 16) | ||
289 | #define SCTL_SCPEREN0_SVDO_LVDS (1 << 17) | ||
290 | #define SCTL_SCPEREN0_USB_HOST (1 << 18) | ||
291 | #define SCTL_SCPEREN0_USB_OTG (1 << 19) | ||
292 | #define SCTL_SCPEREN0_MCI0 (1 << 20) | ||
293 | #define SCTL_SCPEREN0_MCI1 (1 << 21) | ||
294 | #define SCTL_SCPEREN0_MCI2 (1 << 22) | ||
295 | #define SCTL_SCPEREN0_MCI3 (1 << 23) | ||
296 | #define SCTL_SCPEREN0_SATA (1 << 24) | ||
297 | #define SCTL_SCPEREN0_ETHERNET (1 << 25) | ||
298 | #define SCTL_SCPEREN0_VIC (1 << 26) | ||
299 | #define SCTL_SCPEREN0_DMA_AUDIO (1 << 27) | ||
300 | #define SCTL_SCPEREN0_DMA_SOC (1 << 28) | ||
301 | #define SCTL_SCPEREN0_RAM (1 << 29) | ||
302 | #define SCTL_SCPEREN0_VIP (1 << 30) | ||
303 | #define SCTL_SCPEREN0_ARM (1 << 31) | ||
304 | |||
305 | #define SCTL_SCPEREN1_UART0 (1 << 0) | ||
306 | #define SCTL_SCPEREN1_UART1 (1 << 1) | ||
307 | #define SCTL_SCPEREN1_UART2 (1 << 2) | ||
308 | #define SCTL_SCPEREN1_UART3 (1 << 3) | ||
309 | #define SCTL_SCPEREN1_MSP0 (1 << 4) | ||
310 | #define SCTL_SCPEREN1_MSP1 (1 << 5) | ||
311 | #define SCTL_SCPEREN1_MSP2 (1 << 6) | ||
312 | #define SCTL_SCPEREN1_MSP3 (1 << 7) | ||
313 | #define SCTL_SCPEREN1_MSP4 (1 << 8) | ||
314 | #define SCTL_SCPEREN1_MSP5 (1 << 9) | ||
315 | #define SCTL_SCPEREN1_SPI0 (1 << 10) | ||
316 | #define SCTL_SCPEREN1_SPI1 (1 << 11) | ||
317 | #define SCTL_SCPEREN1_SPI2 (1 << 12) | ||
318 | #define SCTL_SCPEREN1_I2C0 (1 << 13) | ||
319 | #define SCTL_SCPEREN1_I2C1 (1 << 14) | ||
320 | #define SCTL_SCPEREN1_I2C2 (1 << 15) | ||
321 | #define SCTL_SCPEREN1_I2C3 (1 << 16) | ||
322 | #define SCTL_SCPEREN1_USB_PHY (1 << 17) | ||
323 | |||
324 | #endif /* __STA2X11_MFD_H */ | ||
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index 8516fd1eaabc..f8d5b4d5843f 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
@@ -117,7 +117,7 @@ struct matrix_keymap_data; | |||
117 | * @no_autorepeat: disable key autorepeat | 117 | * @no_autorepeat: disable key autorepeat |
118 | */ | 118 | */ |
119 | struct stmpe_keypad_platform_data { | 119 | struct stmpe_keypad_platform_data { |
120 | struct matrix_keymap_data *keymap_data; | 120 | const struct matrix_keymap_data *keymap_data; |
121 | unsigned int debounce_ms; | 121 | unsigned int debounce_ms; |
122 | unsigned int scan_count; | 122 | unsigned int scan_count; |
123 | bool no_autorepeat; | 123 | bool no_autorepeat; |
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 1c6c2860d1a6..dd8dc0a6c462 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #define __LINUX_MFD_TPS65910_H | 18 | #define __LINUX_MFD_TPS65910_H |
19 | 19 | ||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/regmap.h> | ||
21 | 22 | ||
22 | /* TPS chip id list */ | 23 | /* TPS chip id list */ |
23 | #define TPS65910 0 | 24 | #define TPS65910 0 |
@@ -783,6 +784,18 @@ | |||
783 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 0x4 | 784 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 0x4 |
784 | #define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8 | 785 | #define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8 |
785 | 786 | ||
787 | /* | ||
788 | * Sleep keepon data: Maintains the state in sleep mode | ||
789 | * @therm_keepon: Keep on the thermal monitoring in sleep state. | ||
790 | * @clkout32k_keepon: Keep on the 32KHz clock output in sleep state. | ||
791 | * @i2chs_keepon: Keep on high speed internal clock in sleep state. | ||
792 | */ | ||
793 | struct tps65910_sleep_keepon_data { | ||
794 | unsigned therm_keepon:1; | ||
795 | unsigned clkout32k_keepon:1; | ||
796 | unsigned i2chs_keepon:1; | ||
797 | }; | ||
798 | |||
786 | /** | 799 | /** |
787 | * struct tps65910_board | 800 | * struct tps65910_board |
788 | * Board platform data may be used to initialize regulators. | 801 | * Board platform data may be used to initialize regulators. |
@@ -794,6 +807,8 @@ struct tps65910_board { | |||
794 | int irq_base; | 807 | int irq_base; |
795 | int vmbch_threshold; | 808 | int vmbch_threshold; |
796 | int vmbch2_threshold; | 809 | int vmbch2_threshold; |
810 | bool en_dev_slp; | ||
811 | struct tps65910_sleep_keepon_data *slp_keepon; | ||
797 | bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; | 812 | bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; |
798 | unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; | 813 | unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; |
799 | struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; | 814 | struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; |
@@ -809,16 +824,14 @@ struct tps65910 { | |||
809 | struct regmap *regmap; | 824 | struct regmap *regmap; |
810 | struct mutex io_mutex; | 825 | struct mutex io_mutex; |
811 | unsigned int id; | 826 | unsigned int id; |
812 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); | ||
813 | int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src); | ||
814 | 827 | ||
815 | /* Client devices */ | 828 | /* Client devices */ |
816 | struct tps65910_pmic *pmic; | 829 | struct tps65910_pmic *pmic; |
817 | struct tps65910_rtc *rtc; | 830 | struct tps65910_rtc *rtc; |
818 | struct tps65910_power *power; | 831 | struct tps65910_power *power; |
819 | 832 | ||
820 | /* GPIO Handling */ | 833 | /* Device node parsed board data */ |
821 | struct gpio_chip gpio; | 834 | struct tps65910_board *of_plat_data; |
822 | 835 | ||
823 | /* IRQ Handling */ | 836 | /* IRQ Handling */ |
824 | struct mutex irq_lock; | 837 | struct mutex irq_lock; |
@@ -826,6 +839,7 @@ struct tps65910 { | |||
826 | int irq_base; | 839 | int irq_base; |
827 | int irq_num; | 840 | int irq_num; |
828 | u32 irq_mask; | 841 | u32 irq_mask; |
842 | struct irq_domain *domain; | ||
829 | }; | 843 | }; |
830 | 844 | ||
831 | struct tps65910_platform_data { | 845 | struct tps65910_platform_data { |
@@ -833,9 +847,6 @@ struct tps65910_platform_data { | |||
833 | int irq_base; | 847 | int irq_base; |
834 | }; | 848 | }; |
835 | 849 | ||
836 | int tps65910_set_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | ||
837 | int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | ||
838 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); | ||
839 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, | 850 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, |
840 | struct tps65910_platform_data *pdata); | 851 | struct tps65910_platform_data *pdata); |
841 | int tps65910_irq_exit(struct tps65910 *tps65910); | 852 | int tps65910_irq_exit(struct tps65910 *tps65910); |
@@ -845,4 +856,28 @@ static inline int tps65910_chip_id(struct tps65910 *tps65910) | |||
845 | return tps65910->id; | 856 | return tps65910->id; |
846 | } | 857 | } |
847 | 858 | ||
859 | static inline int tps65910_reg_read(struct tps65910 *tps65910, u8 reg, | ||
860 | unsigned int *val) | ||
861 | { | ||
862 | return regmap_read(tps65910->regmap, reg, val); | ||
863 | } | ||
864 | |||
865 | static inline int tps65910_reg_write(struct tps65910 *tps65910, u8 reg, | ||
866 | unsigned int val) | ||
867 | { | ||
868 | return regmap_write(tps65910->regmap, reg, val); | ||
869 | } | ||
870 | |||
871 | static inline int tps65910_reg_set_bits(struct tps65910 *tps65910, u8 reg, | ||
872 | u8 mask) | ||
873 | { | ||
874 | return regmap_update_bits(tps65910->regmap, reg, mask, mask); | ||
875 | } | ||
876 | |||
877 | static inline int tps65910_reg_clear_bits(struct tps65910 *tps65910, u8 reg, | ||
878 | u8 mask) | ||
879 | { | ||
880 | return regmap_update_bits(tps65910->regmap, reg, mask, 0); | ||
881 | } | ||
882 | |||
848 | #endif /* __LINUX_MFD_TPS65910_H */ | 883 | #endif /* __LINUX_MFD_TPS65910_H */ |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index b15b5f03f5c4..6659487c31e7 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/mfd/core.h> | 29 | #include <linux/mfd/core.h> |
30 | #include <linux/regulator/consumer.h> | ||
30 | 31 | ||
31 | #define TWL6040_REG_ASICID 0x01 | 32 | #define TWL6040_REG_ASICID 0x01 |
32 | #define TWL6040_REG_ASICREV 0x02 | 33 | #define TWL6040_REG_ASICREV 0x02 |
@@ -203,6 +204,7 @@ struct regmap; | |||
203 | struct twl6040 { | 204 | struct twl6040 { |
204 | struct device *dev; | 205 | struct device *dev; |
205 | struct regmap *regmap; | 206 | struct regmap *regmap; |
207 | struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */ | ||
206 | struct mutex mutex; | 208 | struct mutex mutex; |
207 | struct mutex io_mutex; | 209 | struct mutex io_mutex; |
208 | struct mutex irq_mutex; | 210 | struct mutex irq_mutex; |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 4b1211859f74..4a3b83a77614 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/completion.h> | 18 | #include <linux/completion.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/irqdomain.h> | ||
20 | #include <linux/list.h> | 21 | #include <linux/list.h> |
21 | #include <linux/regmap.h> | 22 | #include <linux/regmap.h> |
22 | 23 | ||
@@ -338,6 +339,7 @@ | |||
338 | #define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */ | 339 | #define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */ |
339 | 340 | ||
340 | struct regulator_dev; | 341 | struct regulator_dev; |
342 | struct irq_domain; | ||
341 | 343 | ||
342 | #define WM831X_NUM_IRQ_REGS 5 | 344 | #define WM831X_NUM_IRQ_REGS 5 |
343 | #define WM831X_NUM_GPIO_REGS 16 | 345 | #define WM831X_NUM_GPIO_REGS 16 |
@@ -367,7 +369,7 @@ struct wm831x { | |||
367 | 369 | ||
368 | int irq; /* Our chip IRQ */ | 370 | int irq; /* Our chip IRQ */ |
369 | struct mutex irq_lock; | 371 | struct mutex irq_lock; |
370 | int irq_base; | 372 | struct irq_domain *irq_domain; |
371 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ | 373 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ |
372 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | 374 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ |
373 | 375 | ||
@@ -382,7 +384,8 @@ struct wm831x { | |||
382 | 384 | ||
383 | /* Used by the interrupt controller code to post writes */ | 385 | /* Used by the interrupt controller code to post writes */ |
384 | int gpio_update[WM831X_NUM_GPIO_REGS]; | 386 | int gpio_update[WM831X_NUM_GPIO_REGS]; |
385 | bool gpio_level[WM831X_NUM_GPIO_REGS]; | 387 | bool gpio_level_high[WM831X_NUM_GPIO_REGS]; |
388 | bool gpio_level_low[WM831X_NUM_GPIO_REGS]; | ||
386 | 389 | ||
387 | struct mutex auxadc_lock; | 390 | struct mutex auxadc_lock; |
388 | struct list_head auxadc_pending; | 391 | struct list_head auxadc_pending; |
@@ -417,6 +420,11 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq); | |||
417 | void wm831x_irq_exit(struct wm831x *wm831x); | 420 | void wm831x_irq_exit(struct wm831x *wm831x); |
418 | void wm831x_auxadc_init(struct wm831x *wm831x); | 421 | void wm831x_auxadc_init(struct wm831x *wm831x); |
419 | 422 | ||
423 | static inline int wm831x_irq(struct wm831x *wm831x, int irq) | ||
424 | { | ||
425 | return irq_create_mapping(wm831x->irq_domain, irq); | ||
426 | } | ||
427 | |||
420 | extern struct regmap_config wm831x_regmap_config; | 428 | extern struct regmap_config wm831x_regmap_config; |
421 | 429 | ||
422 | #endif | 430 | #endif |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 98fcc977e82b..9192b6404a73 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -602,6 +602,7 @@ extern const u16 wm8352_mode2_defaults[]; | |||
602 | extern const u16 wm8352_mode3_defaults[]; | 602 | extern const u16 wm8352_mode3_defaults[]; |
603 | 603 | ||
604 | struct wm8350; | 604 | struct wm8350; |
605 | struct regmap; | ||
605 | 606 | ||
606 | struct wm8350_hwmon { | 607 | struct wm8350_hwmon { |
607 | struct platform_device *pdev; | 608 | struct platform_device *pdev; |
@@ -612,13 +613,7 @@ struct wm8350 { | |||
612 | struct device *dev; | 613 | struct device *dev; |
613 | 614 | ||
614 | /* device IO */ | 615 | /* device IO */ |
615 | union { | 616 | struct regmap *regmap; |
616 | struct i2c_client *i2c_client; | ||
617 | struct spi_device *spi_device; | ||
618 | }; | ||
619 | int (*read_dev)(struct wm8350 *wm8350, char reg, int size, void *dest); | ||
620 | int (*write_dev)(struct wm8350 *wm8350, char reg, int size, | ||
621 | void *src); | ||
622 | u16 *reg_cache; | 617 | u16 *reg_cache; |
623 | 618 | ||
624 | struct mutex auxadc_mutex; | 619 | struct mutex auxadc_mutex; |
diff --git a/include/linux/mfd/wm8400-private.h b/include/linux/mfd/wm8400-private.h index 0147b6968510..2de565b94d0c 100644 --- a/include/linux/mfd/wm8400-private.h +++ b/include/linux/mfd/wm8400-private.h | |||
@@ -24,19 +24,14 @@ | |||
24 | #include <linux/mfd/wm8400.h> | 24 | #include <linux/mfd/wm8400.h> |
25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | 27 | #include <linux/regmap.h> | |
28 | struct regmap; | ||
29 | 28 | ||
30 | #define WM8400_REGISTER_COUNT 0x55 | 29 | #define WM8400_REGISTER_COUNT 0x55 |
31 | 30 | ||
32 | struct wm8400 { | 31 | struct wm8400 { |
33 | struct device *dev; | 32 | struct device *dev; |
34 | |||
35 | struct mutex io_lock; | ||
36 | struct regmap *regmap; | 33 | struct regmap *regmap; |
37 | 34 | ||
38 | u16 reg_cache[WM8400_REGISTER_COUNT]; | ||
39 | |||
40 | struct platform_device regulators[6]; | 35 | struct platform_device regulators[6]; |
41 | }; | 36 | }; |
42 | 37 | ||
@@ -930,6 +925,11 @@ struct wm8400 { | |||
930 | 925 | ||
931 | u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg); | 926 | u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg); |
932 | int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data); | 927 | int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data); |
933 | int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, u16 mask, u16 val); | 928 | |
929 | static inline int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, | ||
930 | u16 mask, u16 val) | ||
931 | { | ||
932 | return regmap_update_bits(wm8400->regmap, reg, mask, val); | ||
933 | } | ||
934 | 934 | ||
935 | #endif | 935 | #endif |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index 6695c3ec4518..1f173306bf05 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -57,6 +57,7 @@ struct wm8994 { | |||
57 | 57 | ||
58 | enum wm8994_type type; | 58 | enum wm8994_type type; |
59 | int revision; | 59 | int revision; |
60 | int cust_id; | ||
60 | 61 | ||
61 | struct device *dev; | 62 | struct device *dev; |
62 | struct regmap *regmap; | 63 | struct regmap *regmap; |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index 86e6a032a078..053548961c15 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -2212,6 +2212,9 @@ | |||
2212 | /* | 2212 | /* |
2213 | * R256 (0x100) - Chip Revision | 2213 | * R256 (0x100) - Chip Revision |
2214 | */ | 2214 | */ |
2215 | #define WM8994_CUST_ID_MASK 0xFF00 /* CUST_ID - [15:8] */ | ||
2216 | #define WM8994_CUST_ID_SHIFT 8 /* CUST_ID - [15:8] */ | ||
2217 | #define WM8994_CUST_ID_WIDTH 8 /* CUST_ID - [15:8] */ | ||
2215 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ | 2218 | #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ |
2216 | #define WM8994_CHIP_REV_SHIFT 0 /* CHIP_REV - [3:0] */ | 2219 | #define WM8994_CHIP_REV_SHIFT 0 /* CHIP_REV - [3:0] */ |
2217 | #define WM8994_CHIP_REV_WIDTH 4 /* CHIP_REV - [3:0] */ | 2220 | #define WM8994_CHIP_REV_WIDTH 4 /* CHIP_REV - [3:0] */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 3329965ed63f..ab741b0d0074 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2506,6 +2506,7 @@ | |||
2506 | #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F | 2506 | #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F |
2507 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 | 2507 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 |
2508 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 | 2508 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 |
2509 | #define PCI_DEVICE_ID_INTEL_CENTERTON_ILB 0x0c60 | ||
2509 | #define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 | 2510 | #define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 |
2510 | #define PCI_DEVICE_ID_INTEL_82573E_SOL 0x1085 | 2511 | #define PCI_DEVICE_ID_INTEL_82573E_SOL 0x1085 |
2511 | #define PCI_DEVICE_ID_INTEL_82573L_SOL 0x108F | 2512 | #define PCI_DEVICE_ID_INTEL_82573L_SOL 0x108F |