aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-06-29 08:45:58 -0400
committerJiri Kosina <jkosina@suse.cz>2012-06-29 08:45:58 -0400
commit59f91e5dd0504dc0ebfaa0b6f3a55e6931f96266 (patch)
treeb913718405d44a921905ac71044fbde410256865 /include/linux
parent57bdfdd80077addf518a9b90c4a66890efc4f70e (diff)
parent89abfab133ef1f5902abafb744df72793213ac19 (diff)
Merge branch 'master' into for-next
Conflicts: include/linux/mmzone.h Synced with Linus' tree so that trivial patch can be applied on top of up-to-date code properly. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/bootmem.h3
-rw-r--r--include/linux/bug.h7
-rw-r--r--include/linux/compaction.h19
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/huge_mm.h2
-rw-r--r--include/linux/kernel-page-flags.h4
-rw-r--r--include/linux/memcontrol.h16
-rw-r--r--include/linux/mempolicy.h9
-rw-r--r--include/linux/mfd/abx500/ab8500.h18
-rw-r--r--include/linux/mfd/anatop.h4
-rw-r--r--include/linux/mfd/asic3.h2
-rw-r--r--include/linux/mfd/da9052/da9052.h19
-rw-r--r--include/linux/mfd/lm3533.h104
-rw-r--r--include/linux/mfd/lpc_ich.h48
-rw-r--r--include/linux/mfd/max77693-private.h227
-rw-r--r--include/linux/mfd/max77693.h36
-rw-r--r--include/linux/mfd/sta2x11-mfd.h324
-rw-r--r--include/linux/mfd/stmpe.h2
-rw-r--r--include/linux/mfd/tps65910.h49
-rw-r--r--include/linux/mfd/twl6040.h2
-rw-r--r--include/linux/mfd/wm831x/core.h12
-rw-r--r--include/linux/mfd/wm8350/core.h9
-rw-r--r--include/linux/mfd/wm8400-private.h14
-rw-r--r--include/linux/mfd/wm8994/core.h1
-rw-r--r--include/linux/mfd/wm8994/registers.h3
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/mm_types.h11
-rw-r--r--include/linux/mmdebug.h2
-rw-r--r--include/linux/mmzone.h29
-rw-r--r--include/linux/nfs4.h13
-rw-r--r--include/linux/nfs_fs.h31
-rw-r--r--include/linux/nfs_fs_sb.h17
-rw-r--r--include/linux/nfs_page.h20
-rw-r--r--include/linux/nfs_xdr.h210
-rw-r--r--include/linux/oom.h5
-rw-r--r--include/linux/pagemap.h8
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/rmap.h2
-rw-r--r--include/linux/swap.h50
40 files changed, 1124 insertions, 217 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4cd59b95858f..7185b8f15ced 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -225,6 +225,7 @@ header-y += kd.h
225header-y += kdev_t.h 225header-y += kdev_t.h
226header-y += kernel.h 226header-y += kernel.h
227header-y += kernelcapi.h 227header-y += kernelcapi.h
228header-y += kernel-page-flags.h
228header-y += keyboard.h 229header-y += keyboard.h
229header-y += keyctl.h 230header-y += keyctl.h
230header-y += l2tp.h 231header-y += l2tp.h
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 1a0cd270bb7a..324fe08ea3b1 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -135,9 +135,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
135extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, 135extern int reserve_bootmem_generic(unsigned long addr, unsigned long size,
136 int flags); 136 int flags);
137 137
138extern void *alloc_bootmem_section(unsigned long size,
139 unsigned long section_nr);
140
141#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 138#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
142extern void *alloc_remap(int nid, unsigned long size); 139extern void *alloc_remap(int nid, unsigned long size);
143#else 140#else
diff --git a/include/linux/bug.h b/include/linux/bug.h
index 72961c39576a..aaac4bba6f5c 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -30,6 +30,13 @@ struct pt_regs;
30#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) 30#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
31#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) 31#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
32 32
33/*
34 * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
35 * expression but avoids the generation of any code, even if that expression
36 * has side-effects.
37 */
38#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
39
33/** 40/**
34 * BUILD_BUG_ON - break compile if a condition is true. 41 * BUILD_BUG_ON - break compile if a condition is true.
35 * @condition: the condition which the compiler should know is false. 42 * @condition: the condition which the compiler should know is false.
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 51a90b7f2d60..e988037abd2a 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_COMPACTION_H 1#ifndef _LINUX_COMPACTION_H
2#define _LINUX_COMPACTION_H 2#define _LINUX_COMPACTION_H
3 3
4#include <linux/node.h>
5
4/* Return values for compact_zone() and try_to_compact_pages() */ 6/* Return values for compact_zone() and try_to_compact_pages() */
5/* compaction didn't start as it was not possible or direct reclaim was more suitable */ 7/* compaction didn't start as it was not possible or direct reclaim was more suitable */
6#define COMPACT_SKIPPED 0 8#define COMPACT_SKIPPED 0
@@ -11,6 +13,23 @@
11/* The full zone was compacted */ 13/* The full zone was compacted */
12#define COMPACT_COMPLETE 3 14#define COMPACT_COMPLETE 3
13 15
16/*
17 * compaction supports three modes
18 *
19 * COMPACT_ASYNC_MOVABLE uses asynchronous migration and only scans
20 * MIGRATE_MOVABLE pageblocks as migration sources and targets.
21 * COMPACT_ASYNC_UNMOVABLE uses asynchronous migration and only scans
22 * MIGRATE_MOVABLE pageblocks as migration sources.
23 * MIGRATE_UNMOVABLE pageblocks are scanned as potential migration
24 * targets and convers them to MIGRATE_MOVABLE if possible
25 * COMPACT_SYNC uses synchronous migration and scans all pageblocks
26 */
27enum compact_mode {
28 COMPACT_ASYNC_MOVABLE,
29 COMPACT_ASYNC_UNMOVABLE,
30 COMPACT_SYNC,
31};
32
14#ifdef CONFIG_COMPACTION 33#ifdef CONFIG_COMPACTION
15extern int sysctl_compact_memory; 34extern int sysctl_compact_memory;
16extern int sysctl_compaction_handler(struct ctl_table *table, int write, 35extern int sysctl_compaction_handler(struct ctl_table *table, int write,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index cdc1a9630948..038076b27ea4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1681,7 +1681,6 @@ struct inode_operations {
1681 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); 1681 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
1682 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1682 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1683 int (*removexattr) (struct dentry *, const char *); 1683 int (*removexattr) (struct dentry *, const char *);
1684 void (*truncate_range)(struct inode *, loff_t, loff_t);
1685 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, 1684 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1686 u64 len); 1685 u64 len);
1687} ____cacheline_aligned; 1686} ____cacheline_aligned;
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index c8af7a2efb52..4c59b1131187 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -59,6 +59,8 @@ extern pmd_t *page_check_address_pmd(struct page *page,
59#define HPAGE_PMD_MASK HPAGE_MASK 59#define HPAGE_PMD_MASK HPAGE_MASK
60#define HPAGE_PMD_SIZE HPAGE_SIZE 60#define HPAGE_PMD_SIZE HPAGE_SIZE
61 61
62extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
63
62#define transparent_hugepage_enabled(__vma) \ 64#define transparent_hugepage_enabled(__vma) \
63 ((transparent_hugepage_flags & \ 65 ((transparent_hugepage_flags & \
64 (1<<TRANSPARENT_HUGEPAGE_FLAG) || \ 66 (1<<TRANSPARENT_HUGEPAGE_FLAG) || \
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h
index 26a65711676f..a1bdf6966357 100644
--- a/include/linux/kernel-page-flags.h
+++ b/include/linux/kernel-page-flags.h
@@ -32,6 +32,8 @@
32#define KPF_KSM 21 32#define KPF_KSM 21
33#define KPF_THP 22 33#define KPF_THP 22
34 34
35#ifdef __KERNEL__
36
35/* kernel hacking assistances 37/* kernel hacking assistances
36 * WARNING: subject to change, never rely on them! 38 * WARNING: subject to change, never rely on them!
37 */ 39 */
@@ -44,4 +46,6 @@
44#define KPF_ARCH 38 46#define KPF_ARCH 38
45#define KPF_UNCACHED 39 47#define KPF_UNCACHED 39
46 48
49#endif /* __KERNEL__ */
50
47#endif /* LINUX_KERNEL_PAGE_FLAGS_H */ 51#endif /* LINUX_KERNEL_PAGE_FLAGS_H */
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index f94efd2f6c27..cfe9050ad8da 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -79,6 +79,8 @@ extern void mem_cgroup_uncharge_cache_page(struct page *page);
79 79
80extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, 80extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
81 int order); 81 int order);
82bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg,
83 struct mem_cgroup *memcg);
82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); 84int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg);
83 85
84extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 86extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
@@ -92,10 +94,13 @@ static inline
92int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 94int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
93{ 95{
94 struct mem_cgroup *memcg; 96 struct mem_cgroup *memcg;
97 int match;
98
95 rcu_read_lock(); 99 rcu_read_lock();
96 memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner)); 100 memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner));
101 match = __mem_cgroup_same_or_subtree(cgroup, memcg);
97 rcu_read_unlock(); 102 rcu_read_unlock();
98 return cgroup == memcg; 103 return match;
99} 104}
100 105
101extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); 106extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg);
@@ -121,8 +126,6 @@ int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg,
121int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); 126int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
122unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, 127unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
123 int nid, int zid, unsigned int lrumask); 128 int nid, int zid, unsigned int lrumask);
124struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg,
125 struct zone *zone);
126struct zone_reclaim_stat* 129struct zone_reclaim_stat*
127mem_cgroup_get_reclaim_stat_from_page(struct page *page); 130mem_cgroup_get_reclaim_stat_from_page(struct page *page);
128extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, 131extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
@@ -351,13 +354,6 @@ mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid,
351 return 0; 354 return 0;
352} 355}
353 356
354
355static inline struct zone_reclaim_stat*
356mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, struct zone *zone)
357{
358 return NULL;
359}
360
361static inline struct zone_reclaim_stat* 357static inline struct zone_reclaim_stat*
362mem_cgroup_get_reclaim_stat_from_page(struct page *page) 358mem_cgroup_get_reclaim_stat_from_page(struct page *page)
363{ 359{
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 7c727a90d70d..4aa42732e47f 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -225,8 +225,8 @@ static inline void check_highest_zone(enum zone_type k)
225 policy_zone = k; 225 policy_zone = k;
226} 226}
227 227
228int do_migrate_pages(struct mm_struct *mm, 228int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
229 const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags); 229 const nodemask_t *to, int flags);
230 230
231 231
232#ifdef CONFIG_TMPFS 232#ifdef CONFIG_TMPFS
@@ -354,9 +354,8 @@ static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk,
354 return false; 354 return false;
355} 355}
356 356
357static inline int do_migrate_pages(struct mm_struct *mm, 357static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
358 const nodemask_t *from_nodes, 358 const nodemask_t *to, int flags)
359 const nodemask_t *to_nodes, int flags)
360{ 359{
361 return 0; 360 return 0;
362} 361}
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
12struct device; 13struct 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);
281extern int __devexit ab8500_exit(struct ab8500 *ab8500); 291extern int __devexit ab8500_exit(struct ab8500 *ab8500);
282 292
293extern int ab8500_suspend(struct ab8500 *ab8500);
294
283static inline int is_ab8500(struct ab8500 *ab) 295static 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
37extern u32 anatop_get_bits(struct anatop *, u32, int, int); 37extern u32 anatop_read_reg(struct anatop *, u32);
38extern void anatop_set_bits(struct anatop *, u32, int, int, u32); 38extern 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 */
105int da9052_adc_manual_read(struct da9052 *da9052, unsigned char channel);
106int da9052_adc_read_temp(struct da9052 *da9052);
107
89/* Device I/O API */ 108/* Device I/O API */
90static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg) 109static 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
22struct device;
23struct regmap;
24
25struct 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
38struct lm3533_ctrlbank {
39 struct lm3533 *lm3533;
40 struct device *dev;
41 int id;
42};
43
44struct 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
49struct 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
56struct 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
63enum lm3533_boost_freq {
64 LM3533_BOOST_FREQ_500KHZ,
65 LM3533_BOOST_FREQ_1000KHZ,
66};
67
68enum 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
75struct 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
90extern int lm3533_ctrlbank_enable(struct lm3533_ctrlbank *cb);
91extern int lm3533_ctrlbank_disable(struct lm3533_ctrlbank *cb);
92
93extern int lm3533_ctrlbank_set_brightness(struct lm3533_ctrlbank *cb, u8 val);
94extern int lm3533_ctrlbank_get_brightness(struct lm3533_ctrlbank *cb, u8 *val);
95extern int lm3533_ctrlbank_set_max_current(struct lm3533_ctrlbank *cb,
96 u16 imax);
97extern int lm3533_ctrlbank_set_pwm(struct lm3533_ctrlbank *cb, u8 val);
98extern int lm3533_ctrlbank_get_pwm(struct lm3533_ctrlbank *cb, u8 *val);
99
100extern int lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val);
101extern int lm3533_write(struct lm3533 *lm3533, u8 reg, u8 val);
102extern 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
42struct 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 */
33enum 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 */
89enum 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 */
110enum 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
132enum 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
143enum 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
188struct 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
211enum max77693_types {
212 TYPE_MAX77693,
213};
214
215extern int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest);
216extern int max77693_bulk_read(struct regmap *map, u8 reg, int count,
217 u8 *buf);
218extern int max77693_write_reg(struct regmap *map, u8 reg, u8 value);
219extern int max77693_bulk_write(struct regmap *map, u8 reg, int count,
220 u8 *buf);
221extern int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask);
222
223extern int max77693_irq_init(struct max77693_dev *max77686);
224extern void max77693_irq_exit(struct max77693_dev *max77686);
225extern 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
33struct 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 */
38struct 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 */
185u32 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 */
214u32 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 */
119struct stmpe_keypad_platform_data { 119struct 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 */
793struct 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
831struct tps65910_platform_data { 845struct tps65910_platform_data {
@@ -833,9 +847,6 @@ struct tps65910_platform_data {
833 int irq_base; 847 int irq_base;
834}; 848};
835 849
836int tps65910_set_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
837int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
838void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
839int tps65910_irq_init(struct tps65910 *tps65910, int irq, 850int tps65910_irq_init(struct tps65910 *tps65910, int irq,
840 struct tps65910_platform_data *pdata); 851 struct tps65910_platform_data *pdata);
841int tps65910_irq_exit(struct tps65910 *tps65910); 852int 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
859static 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
865static 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
871static 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
877static 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;
203struct twl6040 { 204struct 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
340struct regulator_dev; 341struct regulator_dev;
342struct 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);
417void wm831x_irq_exit(struct wm831x *wm831x); 420void wm831x_irq_exit(struct wm831x *wm831x);
418void wm831x_auxadc_init(struct wm831x *wm831x); 421void wm831x_auxadc_init(struct wm831x *wm831x);
419 422
423static inline int wm831x_irq(struct wm831x *wm831x, int irq)
424{
425 return irq_create_mapping(wm831x->irq_domain, irq);
426}
427
420extern struct regmap_config wm831x_regmap_config; 428extern 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[];
602extern const u16 wm8352_mode3_defaults[]; 602extern const u16 wm8352_mode3_defaults[];
603 603
604struct wm8350; 604struct wm8350;
605struct regmap;
605 606
606struct wm8350_hwmon { 607struct 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>
28struct regmap;
29 28
30#define WM8400_REGISTER_COUNT 0x55 29#define WM8400_REGISTER_COUNT 0x55
31 30
32struct wm8400 { 31struct 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
931u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg); 926u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg);
932int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data); 927int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data);
933int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, u16 mask, u16 val); 928
929static 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/mm.h b/include/linux/mm.h
index 7d5c37f24c63..ce26716238c3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -321,6 +321,7 @@ static inline int is_vmalloc_or_module_addr(const void *x)
321static inline void compound_lock(struct page *page) 321static inline void compound_lock(struct page *page)
322{ 322{
323#ifdef CONFIG_TRANSPARENT_HUGEPAGE 323#ifdef CONFIG_TRANSPARENT_HUGEPAGE
324 VM_BUG_ON(PageSlab(page));
324 bit_spin_lock(PG_compound_lock, &page->flags); 325 bit_spin_lock(PG_compound_lock, &page->flags);
325#endif 326#endif
326} 327}
@@ -328,6 +329,7 @@ static inline void compound_lock(struct page *page)
328static inline void compound_unlock(struct page *page) 329static inline void compound_unlock(struct page *page)
329{ 330{
330#ifdef CONFIG_TRANSPARENT_HUGEPAGE 331#ifdef CONFIG_TRANSPARENT_HUGEPAGE
332 VM_BUG_ON(PageSlab(page));
331 bit_spin_unlock(PG_compound_lock, &page->flags); 333 bit_spin_unlock(PG_compound_lock, &page->flags);
332#endif 334#endif
333} 335}
@@ -871,8 +873,6 @@ extern void pagefault_out_of_memory(void);
871extern void show_free_areas(unsigned int flags); 873extern void show_free_areas(unsigned int flags);
872extern bool skip_free_areas_node(unsigned int flags, int nid); 874extern bool skip_free_areas_node(unsigned int flags, int nid);
873 875
874int shmem_lock(struct file *file, int lock, struct user_struct *user);
875struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
876int shmem_zero_setup(struct vm_area_struct *); 876int shmem_zero_setup(struct vm_area_struct *);
877 877
878extern int can_do_mlock(void); 878extern int can_do_mlock(void);
@@ -951,11 +951,9 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
951extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); 951extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new);
952extern void truncate_setsize(struct inode *inode, loff_t newsize); 952extern void truncate_setsize(struct inode *inode, loff_t newsize);
953extern int vmtruncate(struct inode *inode, loff_t offset); 953extern int vmtruncate(struct inode *inode, loff_t offset);
954extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end);
955void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end); 954void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
956int truncate_inode_page(struct address_space *mapping, struct page *page); 955int truncate_inode_page(struct address_space *mapping, struct page *page);
957int generic_error_remove_page(struct address_space *mapping, struct page *page); 956int generic_error_remove_page(struct address_space *mapping, struct page *page);
958
959int invalidate_inode_page(struct page *page); 957int invalidate_inode_page(struct page *page);
960 958
961#ifdef CONFIG_MMU 959#ifdef CONFIG_MMU
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 26574c726121..dad95bdd06d7 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -345,17 +345,6 @@ struct mm_struct {
345 /* Architecture-specific MM context */ 345 /* Architecture-specific MM context */
346 mm_context_t context; 346 mm_context_t context;
347 347
348 /* Swap token stuff */
349 /*
350 * Last value of global fault stamp as seen by this process.
351 * In other words, this value gives an indication of how long
352 * it has been since this task got the token.
353 * Look at mm/thrash.c
354 */
355 unsigned int faultstamp;
356 unsigned int token_priority;
357 unsigned int last_interval;
358
359 unsigned long flags; /* Must use atomic bitops to access the bits */ 348 unsigned long flags; /* Must use atomic bitops to access the bits */
360 349
361 struct core_state *core_state; /* coredumping support */ 350 struct core_state *core_state; /* coredumping support */
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index c04ecfe03f7f..580bd587d916 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -4,7 +4,7 @@
4#ifdef CONFIG_DEBUG_VM 4#ifdef CONFIG_DEBUG_VM
5#define VM_BUG_ON(cond) BUG_ON(cond) 5#define VM_BUG_ON(cond) BUG_ON(cond)
6#else 6#else
7#define VM_BUG_ON(cond) do { (void)(cond); } while (0) 7#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
8#endif 8#endif
9 9
10#ifdef CONFIG_DEBUG_VIRTUAL 10#ifdef CONFIG_DEBUG_VIRTUAL
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 54631776dff2..588c5cb2851d 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -185,8 +185,22 @@ static inline int is_unevictable_lru(enum lru_list lru)
185 return (lru == LRU_UNEVICTABLE); 185 return (lru == LRU_UNEVICTABLE);
186} 186}
187 187
188struct zone_reclaim_stat {
189 /*
190 * The pageout code in vmscan.c keeps track of how many of the
191 * mem/swap backed and file backed pages are referenced.
192 * The higher the rotated/scanned ratio, the more valuable
193 * that cache is.
194 *
195 * The anon LRU stats live in [0], file LRU stats in [1]
196 */
197 unsigned long recent_rotated[2];
198 unsigned long recent_scanned[2];
199};
200
188struct lruvec { 201struct lruvec {
189 struct list_head lists[NR_LRU_LISTS]; 202 struct list_head lists[NR_LRU_LISTS];
203 struct zone_reclaim_stat reclaim_stat;
190}; 204};
191 205
192/* Mask used at gathering information at once (see memcontrol.c) */ 206/* Mask used at gathering information at once (see memcontrol.c) */
@@ -313,19 +327,6 @@ enum zone_type {
313#error ZONES_SHIFT -- too many zones configured adjust calculation 327#error ZONES_SHIFT -- too many zones configured adjust calculation
314#endif 328#endif
315 329
316struct zone_reclaim_stat {
317 /*
318 * The pageout code in vmscan.c keeps track of how many of the
319 * mem/swap backed and file backed pages are referenced.
320 * The higher the rotated/scanned ratio, the more valuable
321 * that cache is.
322 *
323 * The anon LRU stats live in [0], file LRU stats in [1]
324 */
325 unsigned long recent_rotated[2];
326 unsigned long recent_scanned[2];
327};
328
329struct zone { 330struct zone {
330 /* Fields commonly accessed by the page allocator */ 331 /* Fields commonly accessed by the page allocator */
331 332
@@ -407,8 +408,6 @@ struct zone {
407 spinlock_t lru_lock; 408 spinlock_t lru_lock;
408 struct lruvec lruvec; 409 struct lruvec lruvec;
409 410
410 struct zone_reclaim_stat reclaim_stat;
411
412 unsigned long pages_scanned; /* since last reclaim */ 411 unsigned long pages_scanned; /* since last reclaim */
413 unsigned long flags; /* zone flags, see below */ 412 unsigned long flags; /* zone flags, see below */
414 413
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 0987146b0637..af2d2fa30eee 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -69,6 +69,10 @@
69#define NFS4_CDFC4_FORE_OR_BOTH 0x3 69#define NFS4_CDFC4_FORE_OR_BOTH 0x3
70#define NFS4_CDFC4_BACK_OR_BOTH 0x7 70#define NFS4_CDFC4_BACK_OR_BOTH 0x7
71 71
72#define NFS4_CDFS4_FORE 0x1
73#define NFS4_CDFS4_BACK 0x2
74#define NFS4_CDFS4_BOTH 0x3
75
72#define NFS4_SET_TO_SERVER_TIME 0 76#define NFS4_SET_TO_SERVER_TIME 0
73#define NFS4_SET_TO_CLIENT_TIME 1 77#define NFS4_SET_TO_CLIENT_TIME 1
74 78
@@ -526,6 +530,13 @@ enum lock_type4 {
526#define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) 530#define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23)
527#define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) 531#define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30)
528#define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) 532#define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1)
533#define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4)
534
535/* MDS threshold bitmap bits */
536#define THRESHOLD_RD (1UL << 0)
537#define THRESHOLD_WR (1UL << 1)
538#define THRESHOLD_RD_IO (1UL << 2)
539#define THRESHOLD_WR_IO (1UL << 3)
529 540
530#define NFSPROC4_NULL 0 541#define NFSPROC4_NULL 0
531#define NFSPROC4_COMPOUND 1 542#define NFSPROC4_COMPOUND 1
@@ -596,6 +607,8 @@ enum {
596 NFSPROC4_CLNT_TEST_STATEID, 607 NFSPROC4_CLNT_TEST_STATEID,
597 NFSPROC4_CLNT_FREE_STATEID, 608 NFSPROC4_CLNT_FREE_STATEID,
598 NFSPROC4_CLNT_GETDEVICELIST, 609 NFSPROC4_CLNT_GETDEVICELIST,
610 NFSPROC4_CLNT_BIND_CONN_TO_SESSION,
611 NFSPROC4_CLNT_DESTROY_CLIENTID,
599}; 612};
600 613
601/* nfs41 types */ 614/* nfs41 types */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 52a1bdb4ee2b..b23cfc120edb 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -102,6 +102,7 @@ struct nfs_open_context {
102 int error; 102 int error;
103 103
104 struct list_head list; 104 struct list_head list;
105 struct nfs4_threshold *mdsthreshold;
105}; 106};
106 107
107struct nfs_open_dir_context { 108struct nfs_open_dir_context {
@@ -179,8 +180,7 @@ struct nfs_inode {
179 __be32 cookieverf[2]; 180 __be32 cookieverf[2];
180 181
181 unsigned long npages; 182 unsigned long npages;
182 unsigned long ncommit; 183 struct nfs_mds_commit_info commit_info;
183 struct list_head commit_list;
184 184
185 /* Open contexts for shared mmap writes */ 185 /* Open contexts for shared mmap writes */
186 struct list_head open_files; 186 struct list_head open_files;
@@ -201,8 +201,10 @@ struct nfs_inode {
201 201
202 /* pNFS layout information */ 202 /* pNFS layout information */
203 struct pnfs_layout_hdr *layout; 203 struct pnfs_layout_hdr *layout;
204 atomic_t commits_outstanding;
205#endif /* CONFIG_NFS_V4*/ 204#endif /* CONFIG_NFS_V4*/
205 /* how many bytes have been written/read and how many bytes queued up */
206 __u64 write_io;
207 __u64 read_io;
206#ifdef CONFIG_NFS_FSCACHE 208#ifdef CONFIG_NFS_FSCACHE
207 struct fscache_cookie *fscache; 209 struct fscache_cookie *fscache;
208#endif 210#endif
@@ -230,7 +232,6 @@ struct nfs_inode {
230#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 232#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
231#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 233#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
232#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ 234#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
233#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */
234#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ 235#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */
235#define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */ 236#define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */
236 237
@@ -317,11 +318,6 @@ static inline int nfs_server_capable(struct inode *inode, int cap)
317 return NFS_SERVER(inode)->caps & cap; 318 return NFS_SERVER(inode)->caps & cap;
318} 319}
319 320
320static inline int NFS_USE_READDIRPLUS(struct inode *inode)
321{
322 return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags);
323}
324
325static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) 321static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
326{ 322{
327 dentry->d_time = verf; 323 dentry->d_time = verf;
@@ -552,8 +548,8 @@ extern int nfs_wb_page(struct inode *inode, struct page* page);
552extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 548extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
553#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 549#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
554extern int nfs_commit_inode(struct inode *, int); 550extern int nfs_commit_inode(struct inode *, int);
555extern struct nfs_write_data *nfs_commitdata_alloc(void); 551extern struct nfs_commit_data *nfs_commitdata_alloc(void);
556extern void nfs_commit_free(struct nfs_write_data *wdata); 552extern void nfs_commit_free(struct nfs_commit_data *data);
557#else 553#else
558static inline int 554static inline int
559nfs_commit_inode(struct inode *inode, int how) 555nfs_commit_inode(struct inode *inode, int how)
@@ -569,12 +565,6 @@ nfs_have_writebacks(struct inode *inode)
569} 565}
570 566
571/* 567/*
572 * Allocate nfs_write_data structures
573 */
574extern struct nfs_write_data *nfs_writedata_alloc(unsigned int npages);
575extern void nfs_writedata_free(struct nfs_write_data *);
576
577/*
578 * linux/fs/nfs/read.c 568 * linux/fs/nfs/read.c
579 */ 569 */
580extern int nfs_readpage(struct file *, struct page *); 570extern int nfs_readpage(struct file *, struct page *);
@@ -585,12 +575,6 @@ extern int nfs_readpage_async(struct nfs_open_context *, struct inode *,
585 struct page *); 575 struct page *);
586 576
587/* 577/*
588 * Allocate nfs_read_data structures
589 */
590extern struct nfs_read_data *nfs_readdata_alloc(unsigned int npages);
591extern void nfs_readdata_free(struct nfs_read_data *);
592
593/*
594 * linux/fs/nfs3proc.c 578 * linux/fs/nfs3proc.c
595 */ 579 */
596#ifdef CONFIG_NFS_V3_ACL 580#ifdef CONFIG_NFS_V3_ACL
@@ -654,6 +638,7 @@ nfs_fileid_to_ino_t(u64 fileid)
654#define NFSDBG_FSCACHE 0x0800 638#define NFSDBG_FSCACHE 0x0800
655#define NFSDBG_PNFS 0x1000 639#define NFSDBG_PNFS 0x1000
656#define NFSDBG_PNFS_LD 0x2000 640#define NFSDBG_PNFS_LD 0x2000
641#define NFSDBG_STATE 0x4000
657#define NFSDBG_ALL 0xFFFF 642#define NFSDBG_ALL 0xFFFF
658 643
659#ifdef __KERNEL__ 644#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 7073fc74481c..fbb78fb09bd2 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -17,7 +17,7 @@ struct nfs4_sequence_args;
17struct nfs4_sequence_res; 17struct nfs4_sequence_res;
18struct nfs_server; 18struct nfs_server;
19struct nfs4_minor_version_ops; 19struct nfs4_minor_version_ops;
20struct server_scope; 20struct nfs41_server_scope;
21struct nfs41_impl_id; 21struct nfs41_impl_id;
22 22
23/* 23/*
@@ -35,6 +35,9 @@ struct nfs_client {
35#define NFS_CS_RENEWD 3 /* - renewd started */ 35#define NFS_CS_RENEWD 3 /* - renewd started */
36#define NFS_CS_STOP_RENEW 4 /* no more state to renew */ 36#define NFS_CS_STOP_RENEW 4 /* no more state to renew */
37#define NFS_CS_CHECK_LEASE_TIME 5 /* need to check lease time */ 37#define NFS_CS_CHECK_LEASE_TIME 5 /* need to check lease time */
38 unsigned long cl_flags; /* behavior switches */
39#define NFS_CS_NORESVPORT 0 /* - use ephemeral src port */
40#define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */
38 struct sockaddr_storage cl_addr; /* server identifier */ 41 struct sockaddr_storage cl_addr; /* server identifier */
39 size_t cl_addrlen; 42 size_t cl_addrlen;
40 char * cl_hostname; /* hostname of server */ 43 char * cl_hostname; /* hostname of server */
@@ -61,9 +64,6 @@ struct nfs_client {
61 64
62 struct rpc_wait_queue cl_rpcwaitq; 65 struct rpc_wait_queue cl_rpcwaitq;
63 66
64 /* used for the setclientid verifier */
65 struct timespec cl_boot_time;
66
67 /* idmapper */ 67 /* idmapper */
68 struct idmap * cl_idmap; 68 struct idmap * cl_idmap;
69 69
@@ -79,16 +79,17 @@ struct nfs_client {
79 u32 cl_seqid; 79 u32 cl_seqid;
80 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 80 /* The flags used for obtaining the clientid during EXCHANGE_ID */
81 u32 cl_exchange_flags; 81 u32 cl_exchange_flags;
82 struct nfs4_session *cl_session; /* sharred session */ 82 struct nfs4_session *cl_session; /* shared session */
83 struct nfs41_server_owner *cl_serverowner;
84 struct nfs41_server_scope *cl_serverscope;
85 struct nfs41_impl_id *cl_implid;
83#endif /* CONFIG_NFS_V4 */ 86#endif /* CONFIG_NFS_V4 */
84 87
85#ifdef CONFIG_NFS_FSCACHE 88#ifdef CONFIG_NFS_FSCACHE
86 struct fscache_cookie *fscache; /* client index cache cookie */ 89 struct fscache_cookie *fscache; /* client index cache cookie */
87#endif 90#endif
88 91
89 struct server_scope *server_scope; /* from exchange_id */ 92 struct net *cl_net;
90 struct nfs41_impl_id *impl_id; /* from exchange_id */
91 struct net *net;
92}; 93};
93 94
94/* 95/*
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index eac30d6bec17..88d166b555e8 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -27,7 +27,6 @@ enum {
27 PG_CLEAN, 27 PG_CLEAN,
28 PG_NEED_COMMIT, 28 PG_NEED_COMMIT,
29 PG_NEED_RESCHED, 29 PG_NEED_RESCHED,
30 PG_PARTIAL_READ_FAILED,
31 PG_COMMIT_TO_DS, 30 PG_COMMIT_TO_DS,
32}; 31};
33 32
@@ -37,7 +36,6 @@ struct nfs_page {
37 struct page *wb_page; /* page to read in/write out */ 36 struct page *wb_page; /* page to read in/write out */
38 struct nfs_open_context *wb_context; /* File state context info */ 37 struct nfs_open_context *wb_context; /* File state context info */
39 struct nfs_lock_context *wb_lock_context; /* lock context info */ 38 struct nfs_lock_context *wb_lock_context; /* lock context info */
40 atomic_t wb_complete; /* i/os we're waiting for */
41 pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */ 39 pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */
42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ 40 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
43 wb_pgbase, /* Start of page data */ 41 wb_pgbase, /* Start of page data */
@@ -68,7 +66,9 @@ struct nfs_pageio_descriptor {
68 int pg_ioflags; 66 int pg_ioflags;
69 int pg_error; 67 int pg_error;
70 const struct rpc_call_ops *pg_rpc_callops; 68 const struct rpc_call_ops *pg_rpc_callops;
69 const struct nfs_pgio_completion_ops *pg_completion_ops;
71 struct pnfs_layout_segment *pg_lseg; 70 struct pnfs_layout_segment *pg_lseg;
71 struct nfs_direct_req *pg_dreq;
72}; 72};
73 73
74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
@@ -84,6 +84,7 @@ extern void nfs_release_request(struct nfs_page *req);
84extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 84extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
85 struct inode *inode, 85 struct inode *inode,
86 const struct nfs_pageio_ops *pg_ops, 86 const struct nfs_pageio_ops *pg_ops,
87 const struct nfs_pgio_completion_ops *compl_ops,
87 size_t bsize, 88 size_t bsize,
88 int how); 89 int how);
89extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 90extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
@@ -95,26 +96,17 @@ extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
95 struct nfs_page *req); 96 struct nfs_page *req);
96extern int nfs_wait_on_request(struct nfs_page *); 97extern int nfs_wait_on_request(struct nfs_page *);
97extern void nfs_unlock_request(struct nfs_page *req); 98extern void nfs_unlock_request(struct nfs_page *req);
99extern void nfs_unlock_and_release_request(struct nfs_page *req);
98 100
99/* 101/*
100 * Lock the page of an asynchronous request without getting a new reference 102 * Lock the page of an asynchronous request
101 */ 103 */
102static inline int 104static inline int
103nfs_lock_request_dontget(struct nfs_page *req)
104{
105 return !test_and_set_bit(PG_BUSY, &req->wb_flags);
106}
107
108static inline int
109nfs_lock_request(struct nfs_page *req) 105nfs_lock_request(struct nfs_page *req)
110{ 106{
111 if (test_and_set_bit(PG_BUSY, &req->wb_flags)) 107 return !test_and_set_bit(PG_BUSY, &req->wb_flags);
112 return 0;
113 kref_get(&req->wb_kref);
114 return 1;
115} 108}
116 109
117
118/** 110/**
119 * nfs_list_add_request - Insert a request into a list 111 * nfs_list_add_request - Insert a request into a list
120 * @req: request 112 * @req: request
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 7ba3551a0414..d1a7bf51c326 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -35,6 +35,15 @@ static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid
35 return a->major == b->major && a->minor == b->minor; 35 return a->major == b->major && a->minor == b->minor;
36} 36}
37 37
38struct nfs4_threshold {
39 __u32 bm;
40 __u32 l_type;
41 __u64 rd_sz;
42 __u64 wr_sz;
43 __u64 rd_io_sz;
44 __u64 wr_io_sz;
45};
46
38struct nfs_fattr { 47struct nfs_fattr {
39 unsigned int valid; /* which fields are valid */ 48 unsigned int valid; /* which fields are valid */
40 umode_t mode; 49 umode_t mode;
@@ -67,6 +76,7 @@ struct nfs_fattr {
67 unsigned long gencount; 76 unsigned long gencount;
68 struct nfs4_string *owner_name; 77 struct nfs4_string *owner_name;
69 struct nfs4_string *group_name; 78 struct nfs4_string *group_name;
79 struct nfs4_threshold *mdsthreshold; /* pNFS threshold hints */
70}; 80};
71 81
72#define NFS_ATTR_FATTR_TYPE (1U << 0) 82#define NFS_ATTR_FATTR_TYPE (1U << 0)
@@ -106,14 +116,14 @@ struct nfs_fattr {
106 | NFS_ATTR_FATTR_FILEID \ 116 | NFS_ATTR_FATTR_FILEID \
107 | NFS_ATTR_FATTR_ATIME \ 117 | NFS_ATTR_FATTR_ATIME \
108 | NFS_ATTR_FATTR_MTIME \ 118 | NFS_ATTR_FATTR_MTIME \
109 | NFS_ATTR_FATTR_CTIME) 119 | NFS_ATTR_FATTR_CTIME \
120 | NFS_ATTR_FATTR_CHANGE)
110#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \ 121#define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
111 | NFS_ATTR_FATTR_BLOCKS_USED) 122 | NFS_ATTR_FATTR_BLOCKS_USED)
112#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \ 123#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
113 | NFS_ATTR_FATTR_SPACE_USED) 124 | NFS_ATTR_FATTR_SPACE_USED)
114#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \ 125#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
115 | NFS_ATTR_FATTR_SPACE_USED \ 126 | NFS_ATTR_FATTR_SPACE_USED)
116 | NFS_ATTR_FATTR_CHANGE)
117 127
118/* 128/*
119 * Info on the file system 129 * Info on the file system
@@ -338,7 +348,6 @@ struct nfs_openargs {
338 const struct qstr * name; 348 const struct qstr * name;
339 const struct nfs_server *server; /* Needed for ID mapping */ 349 const struct nfs_server *server; /* Needed for ID mapping */
340 const u32 * bitmask; 350 const u32 * bitmask;
341 const u32 * dir_bitmask;
342 __u32 claim; 351 __u32 claim;
343 struct nfs4_sequence_args seq_args; 352 struct nfs4_sequence_args seq_args;
344}; 353};
@@ -349,7 +358,6 @@ struct nfs_openres {
349 struct nfs4_change_info cinfo; 358 struct nfs4_change_info cinfo;
350 __u32 rflags; 359 __u32 rflags;
351 struct nfs_fattr * f_attr; 360 struct nfs_fattr * f_attr;
352 struct nfs_fattr * dir_attr;
353 struct nfs_seqid * seqid; 361 struct nfs_seqid * seqid;
354 const struct nfs_server *server; 362 const struct nfs_server *server;
355 fmode_t delegation_type; 363 fmode_t delegation_type;
@@ -519,12 +527,29 @@ struct nfs_writeres {
519}; 527};
520 528
521/* 529/*
530 * Arguments to the commit call.
531 */
532struct nfs_commitargs {
533 struct nfs_fh *fh;
534 __u64 offset;
535 __u32 count;
536 const u32 *bitmask;
537 struct nfs4_sequence_args seq_args;
538};
539
540struct nfs_commitres {
541 struct nfs_fattr *fattr;
542 struct nfs_writeverf *verf;
543 const struct nfs_server *server;
544 struct nfs4_sequence_res seq_res;
545};
546
547/*
522 * Common arguments to the unlink call 548 * Common arguments to the unlink call
523 */ 549 */
524struct nfs_removeargs { 550struct nfs_removeargs {
525 const struct nfs_fh *fh; 551 const struct nfs_fh *fh;
526 struct qstr name; 552 struct qstr name;
527 const u32 * bitmask;
528 struct nfs4_sequence_args seq_args; 553 struct nfs4_sequence_args seq_args;
529}; 554};
530 555
@@ -543,7 +568,6 @@ struct nfs_renameargs {
543 const struct nfs_fh *new_dir; 568 const struct nfs_fh *new_dir;
544 const struct qstr *old_name; 569 const struct qstr *old_name;
545 const struct qstr *new_name; 570 const struct qstr *new_name;
546 const u32 *bitmask;
547 struct nfs4_sequence_args seq_args; 571 struct nfs4_sequence_args seq_args;
548}; 572};
549 573
@@ -839,7 +863,6 @@ struct nfs4_create_res {
839 struct nfs_fh * fh; 863 struct nfs_fh * fh;
840 struct nfs_fattr * fattr; 864 struct nfs_fattr * fattr;
841 struct nfs4_change_info dir_cinfo; 865 struct nfs4_change_info dir_cinfo;
842 struct nfs_fattr * dir_fattr;
843 struct nfs4_sequence_res seq_res; 866 struct nfs4_sequence_res seq_res;
844}; 867};
845 868
@@ -1061,6 +1084,21 @@ struct nfstime4 {
1061}; 1084};
1062 1085
1063#ifdef CONFIG_NFS_V4_1 1086#ifdef CONFIG_NFS_V4_1
1087
1088struct pnfs_commit_bucket {
1089 struct list_head written;
1090 struct list_head committing;
1091 struct pnfs_layout_segment *wlseg;
1092 struct pnfs_layout_segment *clseg;
1093};
1094
1095struct pnfs_ds_commit_info {
1096 int nwritten;
1097 int ncommitting;
1098 int nbuckets;
1099 struct pnfs_commit_bucket *buckets;
1100};
1101
1064#define NFS4_EXCHANGE_ID_LEN (48) 1102#define NFS4_EXCHANGE_ID_LEN (48)
1065struct nfs41_exchange_id_args { 1103struct nfs41_exchange_id_args {
1066 struct nfs_client *client; 1104 struct nfs_client *client;
@@ -1070,13 +1108,13 @@ struct nfs41_exchange_id_args {
1070 u32 flags; 1108 u32 flags;
1071}; 1109};
1072 1110
1073struct server_owner { 1111struct nfs41_server_owner {
1074 uint64_t minor_id; 1112 uint64_t minor_id;
1075 uint32_t major_id_sz; 1113 uint32_t major_id_sz;
1076 char major_id[NFS4_OPAQUE_LIMIT]; 1114 char major_id[NFS4_OPAQUE_LIMIT];
1077}; 1115};
1078 1116
1079struct server_scope { 1117struct nfs41_server_scope {
1080 uint32_t server_scope_sz; 1118 uint32_t server_scope_sz;
1081 char server_scope[NFS4_OPAQUE_LIMIT]; 1119 char server_scope[NFS4_OPAQUE_LIMIT];
1082}; 1120};
@@ -1087,10 +1125,18 @@ struct nfs41_impl_id {
1087 struct nfstime4 date; 1125 struct nfstime4 date;
1088}; 1126};
1089 1127
1128struct nfs41_bind_conn_to_session_res {
1129 struct nfs4_session *session;
1130 u32 dir;
1131 bool use_conn_in_rdma_mode;
1132};
1133
1090struct nfs41_exchange_id_res { 1134struct nfs41_exchange_id_res {
1091 struct nfs_client *client; 1135 u64 clientid;
1136 u32 seqid;
1092 u32 flags; 1137 u32 flags;
1093 struct server_scope *server_scope; 1138 struct nfs41_server_owner *server_owner;
1139 struct nfs41_server_scope *server_scope;
1094 struct nfs41_impl_id *impl_id; 1140 struct nfs41_impl_id *impl_id;
1095}; 1141};
1096 1142
@@ -1143,35 +1189,114 @@ struct nfs41_free_stateid_res {
1143 struct nfs4_sequence_res seq_res; 1189 struct nfs4_sequence_res seq_res;
1144}; 1190};
1145 1191
1192#else
1193
1194struct pnfs_ds_commit_info {
1195};
1196
1146#endif /* CONFIG_NFS_V4_1 */ 1197#endif /* CONFIG_NFS_V4_1 */
1147 1198
1148struct nfs_page; 1199struct nfs_page;
1149 1200
1150#define NFS_PAGEVEC_SIZE (8U) 1201#define NFS_PAGEVEC_SIZE (8U)
1151 1202
1203struct nfs_page_array {
1204 struct page **pagevec;
1205 unsigned int npages; /* Max length of pagevec */
1206 struct page *page_array[NFS_PAGEVEC_SIZE];
1207};
1208
1152struct nfs_read_data { 1209struct nfs_read_data {
1210 struct nfs_pgio_header *header;
1211 struct list_head list;
1153 struct rpc_task task; 1212 struct rpc_task task;
1154 struct inode *inode;
1155 struct rpc_cred *cred;
1156 struct nfs_fattr fattr; /* fattr storage */ 1213 struct nfs_fattr fattr; /* fattr storage */
1157 struct list_head pages; /* Coalesced read requests */
1158 struct list_head list; /* lists of struct nfs_read_data */
1159 struct nfs_page *req; /* multi ops per nfs_page */
1160 struct page **pagevec;
1161 unsigned int npages; /* Max length of pagevec */
1162 struct nfs_readargs args; 1214 struct nfs_readargs args;
1163 struct nfs_readres res; 1215 struct nfs_readres res;
1164 unsigned long timestamp; /* For lease renewal */ 1216 unsigned long timestamp; /* For lease renewal */
1165 struct pnfs_layout_segment *lseg;
1166 struct nfs_client *ds_clp; /* pNFS data server */
1167 const struct rpc_call_ops *mds_ops;
1168 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data); 1217 int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1169 __u64 mds_offset; 1218 __u64 mds_offset;
1219 struct nfs_page_array pages;
1220 struct nfs_client *ds_clp; /* pNFS data server */
1221};
1222
1223/* used as flag bits in nfs_pgio_header */
1224enum {
1225 NFS_IOHDR_ERROR = 0,
1226 NFS_IOHDR_EOF,
1227 NFS_IOHDR_REDO,
1228 NFS_IOHDR_NEED_COMMIT,
1229 NFS_IOHDR_NEED_RESCHED,
1230};
1231
1232struct nfs_pgio_header {
1233 struct inode *inode;
1234 struct rpc_cred *cred;
1235 struct list_head pages;
1236 struct list_head rpc_list;
1237 atomic_t refcnt;
1238 struct nfs_page *req;
1239 struct pnfs_layout_segment *lseg;
1240 loff_t io_start;
1241 const struct rpc_call_ops *mds_ops;
1242 void (*release) (struct nfs_pgio_header *hdr);
1243 const struct nfs_pgio_completion_ops *completion_ops;
1244 struct nfs_direct_req *dreq;
1245 spinlock_t lock;
1246 /* fields protected by lock */
1170 int pnfs_error; 1247 int pnfs_error;
1171 struct page *page_array[NFS_PAGEVEC_SIZE]; 1248 int error; /* merge with pnfs_error */
1249 unsigned long good_bytes; /* boundary of good data */
1250 unsigned long flags;
1251};
1252
1253struct nfs_read_header {
1254 struct nfs_pgio_header header;
1255 struct nfs_read_data rpc_data;
1172}; 1256};
1173 1257
1174struct nfs_write_data { 1258struct nfs_write_data {
1259 struct nfs_pgio_header *header;
1260 struct list_head list;
1261 struct rpc_task task;
1262 struct nfs_fattr fattr;
1263 struct nfs_writeverf verf;
1264 struct nfs_writeargs args; /* argument struct */
1265 struct nfs_writeres res; /* result struct */
1266 unsigned long timestamp; /* For lease renewal */
1267 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1268 __u64 mds_offset; /* Filelayout dense stripe */
1269 struct nfs_page_array pages;
1270 struct nfs_client *ds_clp; /* pNFS data server */
1271};
1272
1273struct nfs_write_header {
1274 struct nfs_pgio_header header;
1275 struct nfs_write_data rpc_data;
1276};
1277
1278struct nfs_mds_commit_info {
1279 atomic_t rpcs_out;
1280 unsigned long ncommit;
1281 struct list_head list;
1282};
1283
1284struct nfs_commit_data;
1285struct nfs_inode;
1286struct nfs_commit_completion_ops {
1287 void (*error_cleanup) (struct nfs_inode *nfsi);
1288 void (*completion) (struct nfs_commit_data *data);
1289};
1290
1291struct nfs_commit_info {
1292 spinlock_t *lock;
1293 struct nfs_mds_commit_info *mds;
1294 struct pnfs_ds_commit_info *ds;
1295 struct nfs_direct_req *dreq; /* O_DIRECT request */
1296 const struct nfs_commit_completion_ops *completion_ops;
1297};
1298
1299struct nfs_commit_data {
1175 struct rpc_task task; 1300 struct rpc_task task;
1176 struct inode *inode; 1301 struct inode *inode;
1177 struct rpc_cred *cred; 1302 struct rpc_cred *cred;
@@ -1179,22 +1304,22 @@ struct nfs_write_data {
1179 struct nfs_writeverf verf; 1304 struct nfs_writeverf verf;
1180 struct list_head pages; /* Coalesced requests we wish to flush */ 1305 struct list_head pages; /* Coalesced requests we wish to flush */
1181 struct list_head list; /* lists of struct nfs_write_data */ 1306 struct list_head list; /* lists of struct nfs_write_data */
1182 struct nfs_page *req; /* multi ops per nfs_page */ 1307 struct nfs_direct_req *dreq; /* O_DIRECT request */
1183 struct page **pagevec; 1308 struct nfs_commitargs args; /* argument struct */
1184 unsigned int npages; /* Max length of pagevec */ 1309 struct nfs_commitres res; /* result struct */
1185 struct nfs_writeargs args; /* argument struct */ 1310 struct nfs_open_context *context;
1186 struct nfs_writeres res; /* result struct */
1187 struct pnfs_layout_segment *lseg; 1311 struct pnfs_layout_segment *lseg;
1188 struct nfs_client *ds_clp; /* pNFS data server */ 1312 struct nfs_client *ds_clp; /* pNFS data server */
1189 int ds_commit_index; 1313 int ds_commit_index;
1190 const struct rpc_call_ops *mds_ops; 1314 const struct rpc_call_ops *mds_ops;
1191 int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); 1315 const struct nfs_commit_completion_ops *completion_ops;
1192#ifdef CONFIG_NFS_V4 1316 int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
1193 unsigned long timestamp; /* For lease renewal */ 1317};
1194#endif 1318
1195 __u64 mds_offset; /* Filelayout dense stripe */ 1319struct nfs_pgio_completion_ops {
1196 int pnfs_error; 1320 void (*error_cleanup)(struct list_head *head);
1197 struct page *page_array[NFS_PAGEVEC_SIZE]; 1321 void (*init_hdr)(struct nfs_pgio_header *hdr);
1322 void (*completion)(struct nfs_pgio_header *hdr);
1198}; 1323};
1199 1324
1200struct nfs_unlinkdata { 1325struct nfs_unlinkdata {
@@ -1234,11 +1359,13 @@ struct nfs_rpc_ops {
1234 1359
1235 int (*getroot) (struct nfs_server *, struct nfs_fh *, 1360 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1236 struct nfs_fsinfo *); 1361 struct nfs_fsinfo *);
1362 struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,
1363 struct nfs_fh *, struct nfs_fattr *);
1237 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1364 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1238 struct nfs_fattr *); 1365 struct nfs_fattr *);
1239 int (*setattr) (struct dentry *, struct nfs_fattr *, 1366 int (*setattr) (struct dentry *, struct nfs_fattr *,
1240 struct iattr *); 1367 struct iattr *);
1241 int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *, 1368 int (*lookup) (struct inode *, struct qstr *,
1242 struct nfs_fh *, struct nfs_fattr *); 1369 struct nfs_fh *, struct nfs_fattr *);
1243 int (*access) (struct inode *, struct nfs_access_entry *); 1370 int (*access) (struct inode *, struct nfs_access_entry *);
1244 int (*readlink)(struct inode *, struct page *, unsigned int, 1371 int (*readlink)(struct inode *, struct page *, unsigned int,
@@ -1277,8 +1404,9 @@ struct nfs_rpc_ops {
1277 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1404 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1278 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); 1405 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
1279 int (*write_done) (struct rpc_task *, struct nfs_write_data *); 1406 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1280 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); 1407 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
1281 int (*commit_done) (struct rpc_task *, struct nfs_write_data *); 1408 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1409 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
1282 int (*lock)(struct file *, int, struct file_lock *); 1410 int (*lock)(struct file *, int, struct file_lock *);
1283 int (*lock_check_bounds)(const struct file_lock *); 1411 int (*lock_check_bounds)(const struct file_lock *);
1284 void (*clear_acl_cache)(struct inode *); 1412 void (*clear_acl_cache)(struct inode *);
@@ -1287,9 +1415,9 @@ struct nfs_rpc_ops {
1287 struct nfs_open_context *ctx, 1415 struct nfs_open_context *ctx,
1288 int open_flags, 1416 int open_flags,
1289 struct iattr *iattr); 1417 struct iattr *iattr);
1290 int (*init_client) (struct nfs_client *, const struct rpc_timeout *, 1418 struct nfs_client *
1291 const char *, rpc_authflavor_t, int); 1419 (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1292 int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); 1420 const char *, rpc_authflavor_t);
1293}; 1421};
1294 1422
1295/* 1423/*
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 3d7647536b03..e4c29bc72e70 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -43,8 +43,9 @@ enum oom_constraint {
43extern void compare_swap_oom_score_adj(int old_val, int new_val); 43extern void compare_swap_oom_score_adj(int old_val, int new_val);
44extern int test_set_oom_score_adj(int new_val); 44extern int test_set_oom_score_adj(int new_val);
45 45
46extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *memcg, 46extern unsigned long oom_badness(struct task_struct *p,
47 const nodemask_t *nodemask, unsigned long totalpages); 47 struct mem_cgroup *memcg, const nodemask_t *nodemask,
48 unsigned long totalpages);
48extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); 49extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
49extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); 50extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
50 51
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index efa26b4da8d2..7cfad3bbb0cc 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -460,11 +460,11 @@ static inline int fault_in_pages_readable(const char __user *uaddr, int size)
460 */ 460 */
461static inline int fault_in_multipages_writeable(char __user *uaddr, int size) 461static inline int fault_in_multipages_writeable(char __user *uaddr, int size)
462{ 462{
463 int ret; 463 int ret = 0;
464 char __user *end = uaddr + size - 1; 464 char __user *end = uaddr + size - 1;
465 465
466 if (unlikely(size == 0)) 466 if (unlikely(size == 0))
467 return 0; 467 return ret;
468 468
469 /* 469 /*
470 * Writing zeroes into userspace here is OK, because we know that if 470 * Writing zeroes into userspace here is OK, because we know that if
@@ -489,11 +489,11 @@ static inline int fault_in_multipages_readable(const char __user *uaddr,
489 int size) 489 int size)
490{ 490{
491 volatile char c; 491 volatile char c;
492 int ret; 492 int ret = 0;
493 const char __user *end = uaddr + size - 1; 493 const char __user *end = uaddr + size - 1;
494 494
495 if (unlikely(size == 0)) 495 if (unlikely(size == 0))
496 return 0; 496 return ret;
497 497
498 while (uaddr <= end) { 498 while (uaddr <= end) {
499 ret = __get_user(c, uaddr); 499 ret = __get_user(c, uaddr);
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
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index fd07c4542cee..3fce545df394 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -173,8 +173,6 @@ enum ttu_flags {
173}; 173};
174#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) 174#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK)
175 175
176bool is_vma_temporary_stack(struct vm_area_struct *vma);
177
178int try_to_unmap(struct page *, enum ttu_flags flags); 176int try_to_unmap(struct page *, enum ttu_flags flags);
179int try_to_unmap_one(struct page *, struct vm_area_struct *, 177int try_to_unmap_one(struct page *, struct vm_area_struct *,
180 unsigned long address, enum ttu_flags flags); 178 unsigned long address, enum ttu_flags flags);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index b1fd5c7925fe..49c0fa9ef5cf 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -351,31 +351,14 @@ extern int swap_type_of(dev_t, sector_t, struct block_device **);
351extern unsigned int count_swap_pages(int, int); 351extern unsigned int count_swap_pages(int, int);
352extern sector_t map_swap_page(struct page *, struct block_device **); 352extern sector_t map_swap_page(struct page *, struct block_device **);
353extern sector_t swapdev_block(int, pgoff_t); 353extern sector_t swapdev_block(int, pgoff_t);
354extern int page_swapcount(struct page *);
354extern int reuse_swap_page(struct page *); 355extern int reuse_swap_page(struct page *);
355extern int try_to_free_swap(struct page *); 356extern int try_to_free_swap(struct page *);
356struct backing_dev_info; 357struct backing_dev_info;
357 358
358/* linux/mm/thrash.c */
359extern struct mm_struct *swap_token_mm;
360extern void grab_swap_token(struct mm_struct *);
361extern void __put_swap_token(struct mm_struct *);
362extern void disable_swap_token(struct mem_cgroup *memcg);
363
364static inline int has_swap_token(struct mm_struct *mm)
365{
366 return (mm == swap_token_mm);
367}
368
369static inline void put_swap_token(struct mm_struct *mm)
370{
371 if (has_swap_token(mm))
372 __put_swap_token(mm);
373}
374
375#ifdef CONFIG_CGROUP_MEM_RES_CTLR 359#ifdef CONFIG_CGROUP_MEM_RES_CTLR
376extern void 360extern void
377mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 361mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
378extern int mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep);
379#else 362#else
380static inline void 363static inline void
381mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) 364mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
@@ -462,6 +445,11 @@ static inline void delete_from_swap_cache(struct page *page)
462{ 445{
463} 446}
464 447
448static inline int page_swapcount(struct page *page)
449{
450 return 0;
451}
452
465#define reuse_swap_page(page) (page_mapcount(page) == 1) 453#define reuse_swap_page(page) (page_mapcount(page) == 1)
466 454
467static inline int try_to_free_swap(struct page *page) 455static inline int try_to_free_swap(struct page *page)
@@ -476,37 +464,11 @@ static inline swp_entry_t get_swap_page(void)
476 return entry; 464 return entry;
477} 465}
478 466
479/* linux/mm/thrash.c */
480static inline void put_swap_token(struct mm_struct *mm)
481{
482}
483
484static inline void grab_swap_token(struct mm_struct *mm)
485{
486}
487
488static inline int has_swap_token(struct mm_struct *mm)
489{
490 return 0;
491}
492
493static inline void disable_swap_token(struct mem_cgroup *memcg)
494{
495}
496
497static inline void 467static inline void
498mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) 468mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
499{ 469{
500} 470}
501 471
502#ifdef CONFIG_CGROUP_MEM_RES_CTLR
503static inline int
504mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep)
505{
506 return 0;
507}
508#endif
509
510#endif /* CONFIG_SWAP */ 472#endif /* CONFIG_SWAP */
511#endif /* __KERNEL__*/ 473#endif /* __KERNEL__*/
512#endif /* _LINUX_SWAP_H */ 474#endif /* _LINUX_SWAP_H */