aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-04-15 16:02:24 -0400
committerJens Axboe <axboe@fb.com>2014-04-15 16:02:24 -0400
commitf89e0dd9d1a72fdf6b8958bcadfa6abf84f3cae0 (patch)
tree6d4ca8c67dc22d1c81053392078588f9ab3804b5 /include/linux
parent21f9fcd81593e201172160853b8647336fb81f4f (diff)
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
Merge tag 'v3.15-rc1' into for-3.16/core
We don't like this, but things have diverged with the blk-mq fixes in 3.15-rc1. So merge it in.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi_dma.h5
-rw-r--r--include/linux/audit.h14
-rw-r--r--include/linux/binfmts.h1
-rw-r--r--include/linux/bio.h5
-rw-r--r--include/linux/blk_types.h2
-rw-r--r--include/linux/blkdev.h17
-rw-r--r--include/linux/buffer_head.h4
-rw-r--r--include/linux/ceph/ceph_features.h12
-rw-r--r--include/linux/ceph/ceph_fs.h5
-rw-r--r--include/linux/ceph/osd_client.h11
-rw-r--r--include/linux/ceph/osdmap.h50
-rw-r--r--include/linux/ceph/rados.h18
-rw-r--r--include/linux/compiler-clang.h12
-rw-r--r--include/linux/compiler.h7
-rw-r--r--include/linux/cpu.h47
-rw-r--r--include/linux/cpufreq.h9
-rw-r--r--include/linux/crash_dump.h1
-rw-r--r--include/linux/crush/crush.h7
-rw-r--r--include/linux/dmaengine.h14
-rw-r--r--include/linux/dw_dmac.h5
-rw-r--r--include/linux/f2fs_fs.h2
-rw-r--r--include/linux/fdtable.h2
-rw-r--r--include/linux/fs.h97
-rw-r--r--include/linux/ftrace_event.h22
-rw-r--r--include/linux/hdmi.h12
-rw-r--r--include/linux/host1x.h1
-rw-r--r--include/linux/i2c.h1
-rw-r--r--include/linux/i2c/bfin_twi.h145
-rw-r--r--include/linux/i2c/twl.h12
-rw-r--r--include/linux/i2c/twl4030-madc.h2
-rw-r--r--include/linux/idr.h63
-rw-r--r--include/linux/io.h2
-rw-r--r--include/linux/isapnp.h4
-rw-r--r--include/linux/kernel.h9
-rw-r--r--include/linux/lglock.h16
-rw-r--r--include/linux/memcontrol.h23
-rw-r--r--include/linux/mempolicy.h3
-rw-r--r--include/linux/mfd/arizona/registers.h84
-rw-r--r--include/linux/mfd/bcm590xx.h31
-rw-r--r--include/linux/mfd/da9052/da9052.h1
-rw-r--r--include/linux/mfd/da9063/core.h6
-rw-r--r--include/linux/mfd/da9063/registers.h120
-rw-r--r--include/linux/mfd/lpc_ich.h25
-rw-r--r--include/linux/mfd/max14577-private.h8
-rw-r--r--include/linux/mfd/max14577.h5
-rw-r--r--include/linux/mfd/mc13xxx.h6
-rw-r--r--include/linux/mfd/pm8xxx/irq.h59
-rw-r--r--include/linux/mfd/pm8xxx/pm8921.h30
-rw-r--r--include/linux/mfd/rtsx_common.h1
-rw-r--r--include/linux/mfd/rtsx_pci.h8
-rw-r--r--include/linux/mfd/rtsx_usb.h628
-rw-r--r--include/linux/mfd/tps65218.h284
-rw-r--r--include/linux/mm.h18
-rw-r--r--include/linux/mm_types.h7
-rw-r--r--include/linux/mmc/core.h4
-rw-r--r--include/linux/mmc/host.h13
-rw-r--r--include/linux/mmc/sdhci-spear.h8
-rw-r--r--include/linux/mmc/sdhci.h2
-rw-r--r--include/linux/mmc/slot-gpio.h6
-rw-r--r--include/linux/mmdebug.h4
-rw-r--r--include/linux/mod_devicetable.h5
-rw-r--r--include/linux/module.h19
-rw-r--r--include/linux/moduleparam.h10
-rw-r--r--include/linux/mount.h3
-rw-r--r--include/linux/mtd/mtd.h16
-rw-r--r--include/linux/mtd/nand.h135
-rw-r--r--include/linux/nbd.h3
-rw-r--r--include/linux/netdev_features.h2
-rw-r--r--include/linux/netdevice.h24
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nfs_xdr.h3
-rw-r--r--include/linux/ntb.h19
-rw-r--r--include/linux/nvme.h21
-rw-r--r--include/linux/of_mtd.h12
-rw-r--r--include/linux/percpu.h350
-rw-r--r--include/linux/perf_event.h16
-rw-r--r--include/linux/pipe_fs_i.h19
-rw-r--r--include/linux/platform_data/dma-rcar-audmapp.h34
-rw-r--r--include/linux/platform_data/elm.h10
-rw-r--r--include/linux/platform_data/i2c-s3c2410.h9
-rw-r--r--include/linux/platform_data/leds-s3c24xx.h9
-rw-r--r--include/linux/platform_data/mmc-msm_sdcc.h7
-rw-r--r--include/linux/platform_data/mmc-mvsdio.h6
-rw-r--r--include/linux/platform_data/mtd-nand-s3c2410.h8
-rw-r--r--include/linux/res_counter.h6
-rw-r--r--include/linux/rio.h5
-rw-r--r--include/linux/sched.h35
-rw-r--r--include/linux/slab.h17
-rw-r--r--include/linux/slub_def.h3
-rw-r--r--include/linux/ssbi.h20
-rw-r--r--include/linux/sunrpc/bc_xprt.h3
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--include/linux/sunrpc/svcsock.h3
-rw-r--r--include/linux/sunrpc/xprt.h13
-rw-r--r--include/linux/syscalls.h11
-rw-r--r--include/linux/sysfs.h3
-rw-r--r--include/linux/topology.h4
-rw-r--r--include/linux/tracepoint.h49
-rw-r--r--include/linux/uio.h52
-rw-r--r--include/linux/vmacache.h38
-rw-r--r--include/linux/vmstat.h8
-rw-r--r--include/linux/wait.h11
-rw-r--r--include/linux/writeback.h2
103 files changed, 2320 insertions, 727 deletions
diff --git a/include/linux/acpi_dma.h b/include/linux/acpi_dma.h
index fb0298082916..329436d38e66 100644
--- a/include/linux/acpi_dma.h
+++ b/include/linux/acpi_dma.h
@@ -16,6 +16,7 @@
16 16
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/err.h>
19#include <linux/dmaengine.h> 20#include <linux/dmaengine.h>
20 21
21/** 22/**
@@ -103,12 +104,12 @@ static inline void devm_acpi_dma_controller_free(struct device *dev)
103static inline struct dma_chan *acpi_dma_request_slave_chan_by_index( 104static inline struct dma_chan *acpi_dma_request_slave_chan_by_index(
104 struct device *dev, size_t index) 105 struct device *dev, size_t index)
105{ 106{
106 return NULL; 107 return ERR_PTR(-ENODEV);
107} 108}
108static inline struct dma_chan *acpi_dma_request_slave_chan_by_name( 109static inline struct dma_chan *acpi_dma_request_slave_chan_by_name(
109 struct device *dev, const char *name) 110 struct device *dev, const char *name)
110{ 111{
111 return NULL; 112 return ERR_PTR(-ENODEV);
112} 113}
113 114
114#define acpi_dma_simple_xlate NULL 115#define acpi_dma_simple_xlate NULL
diff --git a/include/linux/audit.h b/include/linux/audit.h
index ec1464df4c60..22cfddb75566 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -79,6 +79,14 @@ extern int is_audit_feature_set(int which);
79extern int __init audit_register_class(int class, unsigned *list); 79extern int __init audit_register_class(int class, unsigned *list);
80extern int audit_classify_syscall(int abi, unsigned syscall); 80extern int audit_classify_syscall(int abi, unsigned syscall);
81extern int audit_classify_arch(int arch); 81extern int audit_classify_arch(int arch);
82/* only for compat system calls */
83extern unsigned compat_write_class[];
84extern unsigned compat_read_class[];
85extern unsigned compat_dir_class[];
86extern unsigned compat_chattr_class[];
87extern unsigned compat_signal_class[];
88
89extern int __weak audit_classify_compat_syscall(int abi, unsigned syscall);
82 90
83/* audit_names->type values */ 91/* audit_names->type values */
84#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */ 92#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */
@@ -94,6 +102,12 @@ struct filename;
94 102
95extern void audit_log_session_info(struct audit_buffer *ab); 103extern void audit_log_session_info(struct audit_buffer *ab);
96 104
105#ifdef CONFIG_AUDIT_COMPAT_GENERIC
106#define audit_is_compat(arch) (!((arch) & __AUDIT_ARCH_64BIT))
107#else
108#define audit_is_compat(arch) false
109#endif
110
97#ifdef CONFIG_AUDITSYSCALL 111#ifdef CONFIG_AUDITSYSCALL
98/* These are defined in auditsc.c */ 112/* These are defined in auditsc.c */
99 /* Public API */ 113 /* Public API */
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index b4a745d7d9a9..61f29e5ea840 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -44,7 +44,6 @@ struct linux_binprm {
44 unsigned interp_flags; 44 unsigned interp_flags;
45 unsigned interp_data; 45 unsigned interp_data;
46 unsigned long loader, exec; 46 unsigned long loader, exec;
47 char tcomm[TASK_COMM_LEN];
48}; 47};
49 48
50#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 49#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5aa372a7380c..bba550826921 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -388,7 +388,7 @@ struct sg_iovec;
388struct rq_map_data; 388struct rq_map_data;
389extern struct bio *bio_map_user_iov(struct request_queue *, 389extern struct bio *bio_map_user_iov(struct request_queue *,
390 struct block_device *, 390 struct block_device *,
391 struct sg_iovec *, int, int, gfp_t); 391 const struct sg_iovec *, int, int, gfp_t);
392extern void bio_unmap_user(struct bio *); 392extern void bio_unmap_user(struct bio *);
393extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, 393extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
394 gfp_t); 394 gfp_t);
@@ -414,7 +414,8 @@ extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
414extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, 414extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
415 unsigned long, unsigned int, int, gfp_t); 415 unsigned long, unsigned int, int, gfp_t);
416extern struct bio *bio_copy_user_iov(struct request_queue *, 416extern struct bio *bio_copy_user_iov(struct request_queue *,
417 struct rq_map_data *, struct sg_iovec *, 417 struct rq_map_data *,
418 const struct sg_iovec *,
418 int, int, gfp_t); 419 int, int, gfp_t);
419extern int bio_uncopy_user(struct bio *); 420extern int bio_uncopy_user(struct bio *);
420void zero_fill_bio(struct bio *bio); 421void zero_fill_bio(struct bio *bio);
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index bbc3a6c88fce..aa0eaa2d0bd8 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -189,6 +189,7 @@ enum rq_flag_bits {
189 __REQ_KERNEL, /* direct IO to kernel pages */ 189 __REQ_KERNEL, /* direct IO to kernel pages */
190 __REQ_PM, /* runtime pm request */ 190 __REQ_PM, /* runtime pm request */
191 __REQ_END, /* last of chain of requests */ 191 __REQ_END, /* last of chain of requests */
192 __REQ_HASHED, /* on IO scheduler merge hash */
192 __REQ_NR_BITS, /* stops here */ 193 __REQ_NR_BITS, /* stops here */
193}; 194};
194 195
@@ -241,5 +242,6 @@ enum rq_flag_bits {
241#define REQ_KERNEL (1ULL << __REQ_KERNEL) 242#define REQ_KERNEL (1ULL << __REQ_KERNEL)
242#define REQ_PM (1ULL << __REQ_PM) 243#define REQ_PM (1ULL << __REQ_PM)
243#define REQ_END (1ULL << __REQ_END) 244#define REQ_END (1ULL << __REQ_END)
245#define REQ_HASHED (1ULL << __REQ_HASHED)
244 246
245#endif /* __LINUX_BLK_TYPES_H */ 247#endif /* __LINUX_BLK_TYPES_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5a31307c5ded..86a8df13a5fe 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -118,7 +118,18 @@ struct request {
118 struct bio *bio; 118 struct bio *bio;
119 struct bio *biotail; 119 struct bio *biotail;
120 120
121 struct hlist_node hash; /* merge hash */ 121 /*
122 * The hash is used inside the scheduler, and killed once the
123 * request reaches the dispatch list. The ipi_list is only used
124 * to queue the request for softirq completion, which is long
125 * after the request has been unhashed (and even removed from
126 * the dispatch list).
127 */
128 union {
129 struct hlist_node hash; /* merge hash */
130 struct list_head ipi_list;
131 };
132
122 /* 133 /*
123 * The rb_node is only used inside the io scheduler, requests 134 * The rb_node is only used inside the io scheduler, requests
124 * are pruned when moved to the dispatch queue. So let the 135 * are pruned when moved to the dispatch queue. So let the
@@ -824,8 +835,8 @@ extern int blk_rq_map_user(struct request_queue *, struct request *,
824extern int blk_rq_unmap_user(struct bio *); 835extern int blk_rq_unmap_user(struct bio *);
825extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); 836extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
826extern int blk_rq_map_user_iov(struct request_queue *, struct request *, 837extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
827 struct rq_map_data *, struct sg_iovec *, int, 838 struct rq_map_data *, const struct sg_iovec *,
828 unsigned int, gfp_t); 839 int, unsigned int, gfp_t);
829extern int blk_execute_rq(struct request_queue *, struct gendisk *, 840extern int blk_execute_rq(struct request_queue *, struct gendisk *,
830 struct request *, int); 841 struct request *, int);
831extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, 842extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index d77797a52b7b..c40302f909ce 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -210,8 +210,8 @@ int block_write_full_page(struct page *page, get_block_t *get_block,
210int block_write_full_page_endio(struct page *page, get_block_t *get_block, 210int block_write_full_page_endio(struct page *page, get_block_t *get_block,
211 struct writeback_control *wbc, bh_end_io_t *handler); 211 struct writeback_control *wbc, bh_end_io_t *handler);
212int block_read_full_page(struct page*, get_block_t*); 212int block_read_full_page(struct page*, get_block_t*);
213int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, 213int block_is_partially_uptodate(struct page *page, unsigned long from,
214 unsigned long from); 214 unsigned long count);
215int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len, 215int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
216 unsigned flags, struct page **pagep, get_block_t *get_block); 216 unsigned flags, struct page **pagep, get_block_t *get_block);
217int __block_write_begin(struct page *page, loff_t pos, unsigned len, 217int __block_write_begin(struct page *page, loff_t pos, unsigned len,
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index 138448f766b4..d12659ce550d 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -43,6 +43,13 @@
43#define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */ 43#define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */
44#define CEPH_FEATURE_EXPORT_PEER (1ULL<<37) 44#define CEPH_FEATURE_EXPORT_PEER (1ULL<<37)
45#define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38) 45#define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38)
46#define CEPH_FEATURE_OSD_TMAP2OMAP (1ULL<<38) /* overlap with EC */
47/* The process supports new-style OSDMap encoding. Monitors also use
48 this bit to determine if peers support NAK messages. */
49#define CEPH_FEATURE_OSDMAP_ENC (1ULL<<39)
50#define CEPH_FEATURE_MDS_INLINE_DATA (1ULL<<40)
51#define CEPH_FEATURE_CRUSH_TUNABLES3 (1ULL<<41)
52#define CEPH_FEATURE_OSD_PRIMARY_AFFINITY (1ULL<<41) /* overlap w/ tunables3 */
46 53
47/* 54/*
48 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature 55 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
@@ -82,7 +89,10 @@ static inline u64 ceph_sanitize_features(u64 features)
82 CEPH_FEATURE_OSDHASHPSPOOL | \ 89 CEPH_FEATURE_OSDHASHPSPOOL | \
83 CEPH_FEATURE_OSD_CACHEPOOL | \ 90 CEPH_FEATURE_OSD_CACHEPOOL | \
84 CEPH_FEATURE_CRUSH_V2 | \ 91 CEPH_FEATURE_CRUSH_V2 | \
85 CEPH_FEATURE_EXPORT_PEER) 92 CEPH_FEATURE_EXPORT_PEER | \
93 CEPH_FEATURE_OSDMAP_ENC | \
94 CEPH_FEATURE_CRUSH_TUNABLES3 | \
95 CEPH_FEATURE_OSD_PRIMARY_AFFINITY)
86 96
87#define CEPH_FEATURES_REQUIRED_DEFAULT \ 97#define CEPH_FEATURES_REQUIRED_DEFAULT \
88 (CEPH_FEATURE_NOSRCADDR | \ 98 (CEPH_FEATURE_NOSRCADDR | \
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 25bfb0eff772..5f6db18d72e8 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -332,6 +332,7 @@ enum {
332 CEPH_MDS_OP_LOOKUPHASH = 0x00102, 332 CEPH_MDS_OP_LOOKUPHASH = 0x00102,
333 CEPH_MDS_OP_LOOKUPPARENT = 0x00103, 333 CEPH_MDS_OP_LOOKUPPARENT = 0x00103,
334 CEPH_MDS_OP_LOOKUPINO = 0x00104, 334 CEPH_MDS_OP_LOOKUPINO = 0x00104,
335 CEPH_MDS_OP_LOOKUPNAME = 0x00105,
335 336
336 CEPH_MDS_OP_SETXATTR = 0x01105, 337 CEPH_MDS_OP_SETXATTR = 0x01105,
337 CEPH_MDS_OP_RMXATTR = 0x01106, 338 CEPH_MDS_OP_RMXATTR = 0x01106,
@@ -420,8 +421,8 @@ union ceph_mds_request_args {
420 struct { 421 struct {
421 __u8 rule; /* currently fcntl or flock */ 422 __u8 rule; /* currently fcntl or flock */
422 __u8 type; /* shared, exclusive, remove*/ 423 __u8 type; /* shared, exclusive, remove*/
424 __le64 owner; /* owner of the lock */
423 __le64 pid; /* process id requesting the lock */ 425 __le64 pid; /* process id requesting the lock */
424 __le64 pid_namespace;
425 __le64 start; /* initial location to lock */ 426 __le64 start; /* initial location to lock */
426 __le64 length; /* num bytes to lock from start */ 427 __le64 length; /* num bytes to lock from start */
427 __u8 wait; /* will caller wait for lock to become available? */ 428 __u8 wait; /* will caller wait for lock to become available? */
@@ -532,8 +533,8 @@ struct ceph_filelock {
532 __le64 start;/* file offset to start lock at */ 533 __le64 start;/* file offset to start lock at */
533 __le64 length; /* num bytes to lock; 0 for all following start */ 534 __le64 length; /* num bytes to lock; 0 for all following start */
534 __le64 client; /* which client holds the lock */ 535 __le64 client; /* which client holds the lock */
536 __le64 owner; /* owner the lock */
535 __le64 pid; /* process id holding the lock on the client */ 537 __le64 pid; /* process id holding the lock on the client */
536 __le64 pid_namespace;
537 __u8 type; /* shared lock, exclusive lock, or unlock */ 538 __u8 type; /* shared lock, exclusive lock, or unlock */
538} __attribute__ ((packed)); 539} __attribute__ ((packed));
539 540
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index fd47e872ebcc..94ec69672164 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -43,7 +43,7 @@ struct ceph_osd {
43}; 43};
44 44
45 45
46#define CEPH_OSD_MAX_OP 2 46#define CEPH_OSD_MAX_OP 3
47 47
48enum ceph_osd_data_type { 48enum ceph_osd_data_type {
49 CEPH_OSD_DATA_TYPE_NONE = 0, 49 CEPH_OSD_DATA_TYPE_NONE = 0,
@@ -76,6 +76,7 @@ struct ceph_osd_data {
76 76
77struct ceph_osd_req_op { 77struct ceph_osd_req_op {
78 u16 op; /* CEPH_OSD_OP_* */ 78 u16 op; /* CEPH_OSD_OP_* */
79 u32 flags; /* CEPH_OSD_OP_FLAG_* */
79 u32 payload_len; 80 u32 payload_len;
80 union { 81 union {
81 struct ceph_osd_data raw_data_in; 82 struct ceph_osd_data raw_data_in;
@@ -102,6 +103,10 @@ struct ceph_osd_req_op {
102 u32 timeout; 103 u32 timeout;
103 __u8 flag; 104 __u8 flag;
104 } watch; 105 } watch;
106 struct {
107 u64 expected_object_size;
108 u64 expected_write_size;
109 } alloc_hint;
105 }; 110 };
106}; 111};
107 112
@@ -293,6 +298,10 @@ extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req,
293extern void osd_req_op_watch_init(struct ceph_osd_request *osd_req, 298extern void osd_req_op_watch_init(struct ceph_osd_request *osd_req,
294 unsigned int which, u16 opcode, 299 unsigned int which, u16 opcode,
295 u64 cookie, u64 version, int flag); 300 u64 cookie, u64 version, int flag);
301extern void osd_req_op_alloc_hint_init(struct ceph_osd_request *osd_req,
302 unsigned int which,
303 u64 expected_object_size,
304 u64 expected_write_size);
296 305
297extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, 306extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
298 struct ceph_snap_context *snapc, 307 struct ceph_snap_context *snapc,
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index 49ff69f0746b..561ea896c657 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -41,6 +41,18 @@ struct ceph_pg_pool_info {
41 char *name; 41 char *name;
42}; 42};
43 43
44static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool)
45{
46 switch (pool->type) {
47 case CEPH_POOL_TYPE_REP:
48 return true;
49 case CEPH_POOL_TYPE_EC:
50 return false;
51 default:
52 BUG_ON(1);
53 }
54}
55
44struct ceph_object_locator { 56struct ceph_object_locator {
45 s64 pool; 57 s64 pool;
46}; 58};
@@ -60,8 +72,16 @@ struct ceph_object_id {
60struct ceph_pg_mapping { 72struct ceph_pg_mapping {
61 struct rb_node node; 73 struct rb_node node;
62 struct ceph_pg pgid; 74 struct ceph_pg pgid;
63 int len; 75
64 int osds[]; 76 union {
77 struct {
78 int len;
79 int osds[];
80 } pg_temp;
81 struct {
82 int osd;
83 } primary_temp;
84 };
65}; 85};
66 86
67struct ceph_osdmap { 87struct ceph_osdmap {
@@ -78,12 +98,19 @@ struct ceph_osdmap {
78 struct ceph_entity_addr *osd_addr; 98 struct ceph_entity_addr *osd_addr;
79 99
80 struct rb_root pg_temp; 100 struct rb_root pg_temp;
101 struct rb_root primary_temp;
102
103 u32 *osd_primary_affinity;
104
81 struct rb_root pg_pools; 105 struct rb_root pg_pools;
82 u32 pool_max; 106 u32 pool_max;
83 107
84 /* the CRUSH map specifies the mapping of placement groups to 108 /* the CRUSH map specifies the mapping of placement groups to
85 * the list of osds that store+replicate them. */ 109 * the list of osds that store+replicate them. */
86 struct crush_map *crush; 110 struct crush_map *crush;
111
112 struct mutex crush_scratch_mutex;
113 int crush_scratch_ary[CEPH_PG_MAX_SIZE * 3];
87}; 114};
88 115
89static inline void ceph_oid_set_name(struct ceph_object_id *oid, 116static inline void ceph_oid_set_name(struct ceph_object_id *oid,
@@ -110,9 +137,21 @@ static inline void ceph_oid_copy(struct ceph_object_id *dest,
110 dest->name_len = src->name_len; 137 dest->name_len = src->name_len;
111} 138}
112 139
140static inline int ceph_osd_exists(struct ceph_osdmap *map, int osd)
141{
142 return osd >= 0 && osd < map->max_osd &&
143 (map->osd_state[osd] & CEPH_OSD_EXISTS);
144}
145
113static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd) 146static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd)
114{ 147{
115 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP); 148 return ceph_osd_exists(map, osd) &&
149 (map->osd_state[osd] & CEPH_OSD_UP);
150}
151
152static inline int ceph_osd_is_down(struct ceph_osdmap *map, int osd)
153{
154 return !ceph_osd_is_up(map, osd);
116} 155}
117 156
118static inline bool ceph_osdmap_flag(struct ceph_osdmap *map, int flag) 157static inline bool ceph_osdmap_flag(struct ceph_osdmap *map, int flag)
@@ -121,6 +160,7 @@ static inline bool ceph_osdmap_flag(struct ceph_osdmap *map, int flag)
121} 160}
122 161
123extern char *ceph_osdmap_state_str(char *str, int len, int state); 162extern char *ceph_osdmap_state_str(char *str, int len, int state);
163extern u32 ceph_get_primary_affinity(struct ceph_osdmap *map, int osd);
124 164
125static inline struct ceph_entity_addr *ceph_osd_addr(struct ceph_osdmap *map, 165static inline struct ceph_entity_addr *ceph_osd_addr(struct ceph_osdmap *map,
126 int osd) 166 int osd)
@@ -153,7 +193,7 @@ static inline int ceph_decode_pgid(void **p, void *end, struct ceph_pg *pgid)
153 return 0; 193 return 0;
154} 194}
155 195
156extern struct ceph_osdmap *osdmap_decode(void **p, void *end); 196extern struct ceph_osdmap *ceph_osdmap_decode(void **p, void *end);
157extern struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, 197extern struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
158 struct ceph_osdmap *map, 198 struct ceph_osdmap *map,
159 struct ceph_messenger *msgr); 199 struct ceph_messenger *msgr);
@@ -172,7 +212,7 @@ extern int ceph_oloc_oid_to_pg(struct ceph_osdmap *osdmap,
172 212
173extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, 213extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap,
174 struct ceph_pg pgid, 214 struct ceph_pg pgid,
175 int *acting); 215 int *osds, int *primary);
176extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, 216extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
177 struct ceph_pg pgid); 217 struct ceph_pg pgid);
178 218
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 96292df4041b..f20e0d8a2155 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -81,8 +81,9 @@ struct ceph_pg_v1 {
81 */ 81 */
82#define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */ 82#define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */
83 83
84#define CEPH_PG_TYPE_REP 1 84#define CEPH_POOL_TYPE_REP 1
85#define CEPH_PG_TYPE_RAID4 2 85#define CEPH_POOL_TYPE_RAID4 2 /* never implemented */
86#define CEPH_POOL_TYPE_EC 3
86 87
87/* 88/*
88 * stable_mod func is used to control number of placement groups. 89 * stable_mod func is used to control number of placement groups.
@@ -133,6 +134,10 @@ extern const char *ceph_osd_state_name(int s);
133#define CEPH_OSD_IN 0x10000 134#define CEPH_OSD_IN 0x10000
134#define CEPH_OSD_OUT 0 135#define CEPH_OSD_OUT 0
135 136
137/* osd primary-affinity. fixed point value: 0x10000 == baseline */
138#define CEPH_OSD_MAX_PRIMARY_AFFINITY 0x10000
139#define CEPH_OSD_DEFAULT_PRIMARY_AFFINITY 0x10000
140
136 141
137/* 142/*
138 * osd map flag bits 143 * osd map flag bits
@@ -227,6 +232,9 @@ enum {
227 CEPH_OSD_OP_OMAPRMKEYS = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 24, 232 CEPH_OSD_OP_OMAPRMKEYS = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 24,
228 CEPH_OSD_OP_OMAP_CMP = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 25, 233 CEPH_OSD_OP_OMAP_CMP = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 25,
229 234
235 /* hints */
236 CEPH_OSD_OP_SETALLOCHINT = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 35,
237
230 /** multi **/ 238 /** multi **/
231 CEPH_OSD_OP_CLONERANGE = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_MULTI | 1, 239 CEPH_OSD_OP_CLONERANGE = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_MULTI | 1,
232 CEPH_OSD_OP_ASSERT_SRC_VERSION = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_MULTI | 2, 240 CEPH_OSD_OP_ASSERT_SRC_VERSION = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_MULTI | 2,
@@ -382,7 +390,7 @@ enum {
382 */ 390 */
383struct ceph_osd_op { 391struct ceph_osd_op {
384 __le16 op; /* CEPH_OSD_OP_* */ 392 __le16 op; /* CEPH_OSD_OP_* */
385 __le32 flags; /* CEPH_OSD_FLAG_* */ 393 __le32 flags; /* CEPH_OSD_OP_FLAG_* */
386 union { 394 union {
387 struct { 395 struct {
388 __le64 offset, length; 396 __le64 offset, length;
@@ -416,6 +424,10 @@ struct ceph_osd_op {
416 __le64 offset, length; 424 __le64 offset, length;
417 __le64 src_offset; 425 __le64 src_offset;
418 } __attribute__ ((packed)) clonerange; 426 } __attribute__ ((packed)) clonerange;
427 struct {
428 __le64 expected_object_size;
429 __le64 expected_write_size;
430 } __attribute__ ((packed)) alloc_hint;
419 }; 431 };
420 __le32 payload_len; 432 __le32 payload_len;
421} __attribute__ ((packed)); 433} __attribute__ ((packed));
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
new file mode 100644
index 000000000000..d1e49d52b640
--- /dev/null
+++ b/include/linux/compiler-clang.h
@@ -0,0 +1,12 @@
1#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
3#endif
4
5/* Some compiler specific definitions are overwritten here
6 * for Clang compiler
7 */
8
9#ifdef uninitialized_var
10#undef uninitialized_var
11#define uninitialized_var(x) x = *(&(x))
12#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 2472740d7ab2..ee7239ea1583 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -63,6 +63,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
63# include <linux/compiler-intel.h> 63# include <linux/compiler-intel.h>
64#endif 64#endif
65 65
66/* Clang compiler defines __GNUC__. So we will overwrite implementations
67 * coming from above header files here
68 */
69#ifdef __clang__
70#include <linux/compiler-clang.h>
71#endif
72
66/* 73/*
67 * Generic compiler-dependent macros required for kernel 74 * Generic compiler-dependent macros required for kernel
68 * build go below this comment. Actual compiler/compiler version 75 * build go below this comment. Actual compiler/compiler version
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 03e962e23eaf..81887120395c 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -115,26 +115,46 @@ enum {
115 { .notifier_call = fn, .priority = pri }; \ 115 { .notifier_call = fn, .priority = pri }; \
116 register_cpu_notifier(&fn##_nb); \ 116 register_cpu_notifier(&fn##_nb); \
117} 117}
118
119#define __cpu_notifier(fn, pri) { \
120 static struct notifier_block fn##_nb = \
121 { .notifier_call = fn, .priority = pri }; \
122 __register_cpu_notifier(&fn##_nb); \
123}
118#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ 124#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */
119#define cpu_notifier(fn, pri) do { (void)(fn); } while (0) 125#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
126#define __cpu_notifier(fn, pri) do { (void)(fn); } while (0)
120#endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ 127#endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */
128
121#ifdef CONFIG_HOTPLUG_CPU 129#ifdef CONFIG_HOTPLUG_CPU
122extern int register_cpu_notifier(struct notifier_block *nb); 130extern int register_cpu_notifier(struct notifier_block *nb);
131extern int __register_cpu_notifier(struct notifier_block *nb);
123extern void unregister_cpu_notifier(struct notifier_block *nb); 132extern void unregister_cpu_notifier(struct notifier_block *nb);
133extern void __unregister_cpu_notifier(struct notifier_block *nb);
124#else 134#else
125 135
126#ifndef MODULE 136#ifndef MODULE
127extern int register_cpu_notifier(struct notifier_block *nb); 137extern int register_cpu_notifier(struct notifier_block *nb);
138extern int __register_cpu_notifier(struct notifier_block *nb);
128#else 139#else
129static inline int register_cpu_notifier(struct notifier_block *nb) 140static inline int register_cpu_notifier(struct notifier_block *nb)
130{ 141{
131 return 0; 142 return 0;
132} 143}
144
145static inline int __register_cpu_notifier(struct notifier_block *nb)
146{
147 return 0;
148}
133#endif 149#endif
134 150
135static inline void unregister_cpu_notifier(struct notifier_block *nb) 151static inline void unregister_cpu_notifier(struct notifier_block *nb)
136{ 152{
137} 153}
154
155static inline void __unregister_cpu_notifier(struct notifier_block *nb)
156{
157}
138#endif 158#endif
139 159
140int cpu_up(unsigned int cpu); 160int cpu_up(unsigned int cpu);
@@ -142,19 +162,32 @@ void notify_cpu_starting(unsigned int cpu);
142extern void cpu_maps_update_begin(void); 162extern void cpu_maps_update_begin(void);
143extern void cpu_maps_update_done(void); 163extern void cpu_maps_update_done(void);
144 164
165#define cpu_notifier_register_begin cpu_maps_update_begin
166#define cpu_notifier_register_done cpu_maps_update_done
167
145#else /* CONFIG_SMP */ 168#else /* CONFIG_SMP */
146 169
147#define cpu_notifier(fn, pri) do { (void)(fn); } while (0) 170#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
171#define __cpu_notifier(fn, pri) do { (void)(fn); } while (0)
148 172
149static inline int register_cpu_notifier(struct notifier_block *nb) 173static inline int register_cpu_notifier(struct notifier_block *nb)
150{ 174{
151 return 0; 175 return 0;
152} 176}
153 177
178static inline int __register_cpu_notifier(struct notifier_block *nb)
179{
180 return 0;
181}
182
154static inline void unregister_cpu_notifier(struct notifier_block *nb) 183static inline void unregister_cpu_notifier(struct notifier_block *nb)
155{ 184{
156} 185}
157 186
187static inline void __unregister_cpu_notifier(struct notifier_block *nb)
188{
189}
190
158static inline void cpu_maps_update_begin(void) 191static inline void cpu_maps_update_begin(void)
159{ 192{
160} 193}
@@ -163,6 +196,14 @@ static inline void cpu_maps_update_done(void)
163{ 196{
164} 197}
165 198
199static inline void cpu_notifier_register_begin(void)
200{
201}
202
203static inline void cpu_notifier_register_done(void)
204{
205}
206
166#endif /* CONFIG_SMP */ 207#endif /* CONFIG_SMP */
167extern struct bus_type cpu_subsys; 208extern struct bus_type cpu_subsys;
168 209
@@ -176,8 +217,11 @@ extern void put_online_cpus(void);
176extern void cpu_hotplug_disable(void); 217extern void cpu_hotplug_disable(void);
177extern void cpu_hotplug_enable(void); 218extern void cpu_hotplug_enable(void);
178#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) 219#define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri)
220#define __hotcpu_notifier(fn, pri) __cpu_notifier(fn, pri)
179#define register_hotcpu_notifier(nb) register_cpu_notifier(nb) 221#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
222#define __register_hotcpu_notifier(nb) __register_cpu_notifier(nb)
180#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) 223#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
224#define __unregister_hotcpu_notifier(nb) __unregister_cpu_notifier(nb)
181void clear_tasks_mm_cpumask(int cpu); 225void clear_tasks_mm_cpumask(int cpu);
182int cpu_down(unsigned int cpu); 226int cpu_down(unsigned int cpu);
183 227
@@ -190,9 +234,12 @@ static inline void cpu_hotplug_done(void) {}
190#define cpu_hotplug_disable() do { } while (0) 234#define cpu_hotplug_disable() do { } while (0)
191#define cpu_hotplug_enable() do { } while (0) 235#define cpu_hotplug_enable() do { } while (0)
192#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) 236#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
237#define __hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
193/* These aren't inline functions due to a GCC bug. */ 238/* These aren't inline functions due to a GCC bug. */
194#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; }) 239#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
240#define __register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
195#define unregister_hotcpu_notifier(nb) ({ (void)(nb); }) 241#define unregister_hotcpu_notifier(nb) ({ (void)(nb); })
242#define __unregister_hotcpu_notifier(nb) ({ (void)(nb); })
196#endif /* CONFIG_HOTPLUG_CPU */ 243#endif /* CONFIG_HOTPLUG_CPU */
197 244
198#ifdef CONFIG_PM_SLEEP_SMP 245#ifdef CONFIG_PM_SLEEP_SMP
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c48e595f623e..5ae5100c1f24 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -455,11 +455,14 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
455 * FREQUENCY TABLE HELPERS * 455 * FREQUENCY TABLE HELPERS *
456 *********************************************************************/ 456 *********************************************************************/
457 457
458#define CPUFREQ_ENTRY_INVALID ~0 458/* Special Values of .frequency field */
459#define CPUFREQ_TABLE_END ~1 459#define CPUFREQ_ENTRY_INVALID ~0
460#define CPUFREQ_BOOST_FREQ ~2 460#define CPUFREQ_TABLE_END ~1
461/* Special Values of .flags field */
462#define CPUFREQ_BOOST_FREQ (1 << 0)
461 463
462struct cpufreq_frequency_table { 464struct cpufreq_frequency_table {
465 unsigned int flags;
463 unsigned int driver_data; /* driver specific data, not used by core */ 466 unsigned int driver_data; /* driver specific data, not used by core */
464 unsigned int frequency; /* kHz - doesn't need to be in ascending 467 unsigned int frequency; /* kHz - doesn't need to be in ascending
465 * order */ 468 * order */
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 7032518f8542..72ab536ad3de 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -25,6 +25,7 @@ extern int __weak remap_oldmem_pfn_range(struct vm_area_struct *vma,
25 25
26extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, 26extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
27 unsigned long, int); 27 unsigned long, int);
28void vmcore_cleanup(void);
28 29
29/* Architecture code defines this if there are other possible ELF 30/* Architecture code defines this if there are other possible ELF
30 * machine types, e.g. on bi-arch capable hardware. */ 31 * machine types, e.g. on bi-arch capable hardware. */
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index acaa5615d634..4fad5f8ee01d 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -51,6 +51,7 @@ enum {
51 CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */ 51 CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */
52 CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10, 52 CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10,
53 CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11, 53 CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11,
54 CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12
54}; 55};
55 56
56/* 57/*
@@ -173,6 +174,12 @@ struct crush_map {
173 * apply to a collision: in that case we will retry as we used 174 * apply to a collision: in that case we will retry as we used
174 * to. */ 175 * to. */
175 __u32 chooseleaf_descend_once; 176 __u32 chooseleaf_descend_once;
177
178 /* if non-zero, feed r into chooseleaf, bit-shifted right by (r-1)
179 * bits. a value of 1 is best for new clusters. for legacy clusters
180 * that want to limit reshuffling, a value of 3 or 4 will make the
181 * mappings line up a bit better with previous mappings. */
182 __u8 chooseleaf_vary_r;
176}; 183};
177 184
178 185
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index c5c92d59e531..8300fb87b84a 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -341,15 +341,11 @@ enum dma_slave_buswidth {
341 * and this struct will then be passed in as an argument to the 341 * and this struct will then be passed in as an argument to the
342 * DMA engine device_control() function. 342 * DMA engine device_control() function.
343 * 343 *
344 * The rationale for adding configuration information to this struct 344 * The rationale for adding configuration information to this struct is as
345 * is as follows: if it is likely that most DMA slave controllers in 345 * follows: if it is likely that more than one DMA slave controllers in
346 * the world will support the configuration option, then make it 346 * the world will support the configuration option, then make it generic.
347 * generic. If not: if it is fixed so that it be sent in static from 347 * If not: if it is fixed so that it be sent in static from the platform
348 * the platform data, then prefer to do that. Else, if it is neither 348 * data, then prefer to do that.
349 * fixed at runtime, nor generic enough (such as bus mastership on
350 * some CPU family and whatnot) then create a custom slave config
351 * struct and pass that, then make this config a member of that
352 * struct, if applicable.
353 */ 349 */
354struct dma_slave_config { 350struct dma_slave_config {
355 enum dma_transfer_direction direction; 351 enum dma_transfer_direction direction;
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index 481ab2345d6b..68b4024184de 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -1,6 +1,5 @@
1/* 1/*
2 * Driver for the Synopsys DesignWare DMA Controller (aka DMACA on 2 * Driver for the Synopsys DesignWare DMA Controller
3 * AVR32 systems.)
4 * 3 *
5 * Copyright (C) 2007 Atmel Corporation 4 * Copyright (C) 2007 Atmel Corporation
6 * Copyright (C) 2010-2011 ST Microelectronics 5 * Copyright (C) 2010-2011 ST Microelectronics
@@ -44,8 +43,6 @@ struct dw_dma_slave {
44 * @nr_masters: Number of AHB masters supported by the controller 43 * @nr_masters: Number of AHB masters supported by the controller
45 * @data_width: Maximum data width supported by hardware per AHB master 44 * @data_width: Maximum data width supported by hardware per AHB master
46 * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits) 45 * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits)
47 * @sd: slave specific data. Used for configuring channels
48 * @sd_count: count of slave data structures passed.
49 */ 46 */
50struct dw_dma_platform_data { 47struct dw_dma_platform_data {
51 unsigned int nr_channels; 48 unsigned int nr_channels;
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index da74d878dc4f..df53e1753a76 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -183,7 +183,7 @@ struct f2fs_inode {
183 __le32 i_pino; /* parent inode number */ 183 __le32 i_pino; /* parent inode number */
184 __le32 i_namelen; /* file name length */ 184 __le32 i_namelen; /* file name length */
185 __u8 i_name[F2FS_NAME_LEN]; /* file name for SPOR */ 185 __u8 i_name[F2FS_NAME_LEN]; /* file name for SPOR */
186 __u8 i_reserved2; /* for backward compatibility */ 186 __u8 i_dir_level; /* dentry_level for large dir */
187 187
188 struct f2fs_extent i_ext; /* caching a largest extent */ 188 struct f2fs_extent i_ext; /* caching a largest extent */
189 189
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 70e8e21c0a30..230f87bdf5ad 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -63,8 +63,6 @@ struct file_operations;
63struct vfsmount; 63struct vfsmount;
64struct dentry; 64struct dentry;
65 65
66extern void __init files_defer_init(void);
67
68#define rcu_dereference_check_fdtable(files, fdtfd) \ 66#define rcu_dereference_check_fdtable(files, fdtfd) \
69 rcu_dereference_check((fdtfd), lockdep_is_held(&(files)->file_lock)) 67 rcu_dereference_check((fdtfd), lockdep_is_held(&(files)->file_lock))
70 68
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 81048f9bc783..7a9c5bca2b76 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -48,6 +48,7 @@ struct cred;
48struct swap_info_struct; 48struct swap_info_struct;
49struct seq_file; 49struct seq_file;
50struct workqueue_struct; 50struct workqueue_struct;
51struct iov_iter;
51 52
52extern void __init inode_init(void); 53extern void __init inode_init(void);
53extern void __init inode_init_early(void); 54extern void __init inode_init_early(void);
@@ -125,6 +126,8 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
125 126
126/* File needs atomic accesses to f_pos */ 127/* File needs atomic accesses to f_pos */
127#define FMODE_ATOMIC_POS ((__force fmode_t)0x8000) 128#define FMODE_ATOMIC_POS ((__force fmode_t)0x8000)
129/* Write access to underlying fs */
130#define FMODE_WRITER ((__force fmode_t)0x10000)
128 131
129/* File was opened by fanotify and shouldn't generate fanotify events */ 132/* File was opened by fanotify and shouldn't generate fanotify events */
130#define FMODE_NONOTIFY ((__force fmode_t)0x1000000) 133#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
@@ -293,38 +296,6 @@ struct page;
293struct address_space; 296struct address_space;
294struct writeback_control; 297struct writeback_control;
295 298
296struct iov_iter {
297 const struct iovec *iov;
298 unsigned long nr_segs;
299 size_t iov_offset;
300 size_t count;
301};
302
303size_t iov_iter_copy_from_user_atomic(struct page *page,
304 struct iov_iter *i, unsigned long offset, size_t bytes);
305size_t iov_iter_copy_from_user(struct page *page,
306 struct iov_iter *i, unsigned long offset, size_t bytes);
307void iov_iter_advance(struct iov_iter *i, size_t bytes);
308int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
309size_t iov_iter_single_seg_count(const struct iov_iter *i);
310
311static inline void iov_iter_init(struct iov_iter *i,
312 const struct iovec *iov, unsigned long nr_segs,
313 size_t count, size_t written)
314{
315 i->iov = iov;
316 i->nr_segs = nr_segs;
317 i->iov_offset = 0;
318 i->count = count + written;
319
320 iov_iter_advance(i, written);
321}
322
323static inline size_t iov_iter_count(struct iov_iter *i)
324{
325 return i->count;
326}
327
328/* 299/*
329 * "descriptor" for what we're up to with a read. 300 * "descriptor" for what we're up to with a read.
330 * This allows us to use the same read code yet 301 * This allows us to use the same read code yet
@@ -383,7 +354,7 @@ struct address_space_operations {
383 int (*migratepage) (struct address_space *, 354 int (*migratepage) (struct address_space *,
384 struct page *, struct page *, enum migrate_mode); 355 struct page *, struct page *, enum migrate_mode);
385 int (*launder_page) (struct page *); 356 int (*launder_page) (struct page *);
386 int (*is_partially_uptodate) (struct page *, read_descriptor_t *, 357 int (*is_partially_uptodate) (struct page *, unsigned long,
387 unsigned long); 358 unsigned long);
388 void (*is_dirty_writeback) (struct page *, bool *, bool *); 359 void (*is_dirty_writeback) (struct page *, bool *, bool *);
389 int (*error_remove_page)(struct address_space *, struct page *); 360 int (*error_remove_page)(struct address_space *, struct page *);
@@ -770,9 +741,6 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
770 index < ra->start + ra->size); 741 index < ra->start + ra->size);
771} 742}
772 743
773#define FILE_MNT_WRITE_TAKEN 1
774#define FILE_MNT_WRITE_RELEASED 2
775
776struct file { 744struct file {
777 union { 745 union {
778 struct llist_node fu_llist; 746 struct llist_node fu_llist;
@@ -810,9 +778,6 @@ struct file {
810 struct list_head f_tfile_llink; 778 struct list_head f_tfile_llink;
811#endif /* #ifdef CONFIG_EPOLL */ 779#endif /* #ifdef CONFIG_EPOLL */
812 struct address_space *f_mapping; 780 struct address_space *f_mapping;
813#ifdef CONFIG_DEBUG_WRITECOUNT
814 unsigned long f_mnt_write_state;
815#endif
816} __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */ 781} __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
817 782
818struct file_handle { 783struct file_handle {
@@ -830,49 +795,6 @@ static inline struct file *get_file(struct file *f)
830#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) 795#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
831#define file_count(x) atomic_long_read(&(x)->f_count) 796#define file_count(x) atomic_long_read(&(x)->f_count)
832 797
833#ifdef CONFIG_DEBUG_WRITECOUNT
834static inline void file_take_write(struct file *f)
835{
836 WARN_ON(f->f_mnt_write_state != 0);
837 f->f_mnt_write_state = FILE_MNT_WRITE_TAKEN;
838}
839static inline void file_release_write(struct file *f)
840{
841 f->f_mnt_write_state |= FILE_MNT_WRITE_RELEASED;
842}
843static inline void file_reset_write(struct file *f)
844{
845 f->f_mnt_write_state = 0;
846}
847static inline void file_check_state(struct file *f)
848{
849 /*
850 * At this point, either both or neither of these bits
851 * should be set.
852 */
853 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN);
854 WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_RELEASED);
855}
856static inline int file_check_writeable(struct file *f)
857{
858 if (f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN)
859 return 0;
860 printk(KERN_WARNING "writeable file with no "
861 "mnt_want_write()\n");
862 WARN_ON(1);
863 return -EINVAL;
864}
865#else /* !CONFIG_DEBUG_WRITECOUNT */
866static inline void file_take_write(struct file *filp) {}
867static inline void file_release_write(struct file *filp) {}
868static inline void file_reset_write(struct file *filp) {}
869static inline void file_check_state(struct file *filp) {}
870static inline int file_check_writeable(struct file *filp)
871{
872 return 0;
873}
874#endif /* CONFIG_DEBUG_WRITECOUNT */
875
876#define MAX_NON_LFS ((1UL<<31) - 1) 798#define MAX_NON_LFS ((1UL<<31) - 1)
877 799
878/* Page cache limit. The filesystems should put that into their s_maxbytes 800/* Page cache limit. The filesystems should put that into their s_maxbytes
@@ -2481,16 +2403,13 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *);
2481extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 2403extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
2482extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr, 2404extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr,
2483 unsigned long size, pgoff_t pgoff); 2405 unsigned long size, pgoff_t pgoff);
2484extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
2485int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 2406int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
2486extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); 2407extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
2487extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, 2408extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long);
2488 loff_t *);
2489extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); 2409extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
2490extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, 2410extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
2491 unsigned long *, loff_t, loff_t *, size_t, size_t); 2411 unsigned long *, loff_t, size_t, size_t);
2492extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, 2412extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t);
2493 unsigned long, loff_t, loff_t *, size_t, ssize_t);
2494extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); 2413extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
2495extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 2414extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
2496extern int generic_segment_checks(const struct iovec *iov, 2415extern int generic_segment_checks(const struct iovec *iov,
@@ -2582,7 +2501,7 @@ extern const struct file_operations generic_ro_fops;
2582 2501
2583#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) 2502#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
2584 2503
2585extern int vfs_readlink(struct dentry *, char __user *, int, const char *); 2504extern int readlink_copy(char __user *, int, const char *);
2586extern int page_readlink(struct dentry *, char __user *, int); 2505extern int page_readlink(struct dentry *, char __user *, int);
2587extern void *page_follow_link_light(struct dentry *, struct nameidata *); 2506extern void *page_follow_link_light(struct dentry *, struct nameidata *);
2588extern void page_put_link(struct dentry *, struct nameidata *, void *); 2507extern void page_put_link(struct dentry *, struct nameidata *, void *);
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index cdc30111d2f8..d16da3e53bc7 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -7,6 +7,7 @@
7#include <linux/percpu.h> 7#include <linux/percpu.h>
8#include <linux/hardirq.h> 8#include <linux/hardirq.h>
9#include <linux/perf_event.h> 9#include <linux/perf_event.h>
10#include <linux/tracepoint.h>
10 11
11struct trace_array; 12struct trace_array;
12struct trace_buffer; 13struct trace_buffer;
@@ -232,6 +233,7 @@ enum {
232 TRACE_EVENT_FL_IGNORE_ENABLE_BIT, 233 TRACE_EVENT_FL_IGNORE_ENABLE_BIT,
233 TRACE_EVENT_FL_WAS_ENABLED_BIT, 234 TRACE_EVENT_FL_WAS_ENABLED_BIT,
234 TRACE_EVENT_FL_USE_CALL_FILTER_BIT, 235 TRACE_EVENT_FL_USE_CALL_FILTER_BIT,
236 TRACE_EVENT_FL_TRACEPOINT_BIT,
235}; 237};
236 238
237/* 239/*
@@ -244,6 +246,7 @@ enum {
244 * (used for module unloading, if a module event is enabled, 246 * (used for module unloading, if a module event is enabled,
245 * it is best to clear the buffers that used it). 247 * it is best to clear the buffers that used it).
246 * USE_CALL_FILTER - For ftrace internal events, don't use file filter 248 * USE_CALL_FILTER - For ftrace internal events, don't use file filter
249 * TRACEPOINT - Event is a tracepoint
247 */ 250 */
248enum { 251enum {
249 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), 252 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
@@ -252,12 +255,17 @@ enum {
252 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), 255 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT),
253 TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), 256 TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT),
254 TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT), 257 TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT),
258 TRACE_EVENT_FL_TRACEPOINT = (1 << TRACE_EVENT_FL_TRACEPOINT_BIT),
255}; 259};
256 260
257struct ftrace_event_call { 261struct ftrace_event_call {
258 struct list_head list; 262 struct list_head list;
259 struct ftrace_event_class *class; 263 struct ftrace_event_class *class;
260 char *name; 264 union {
265 char *name;
266 /* Set TRACE_EVENT_FL_TRACEPOINT flag when using "tp" */
267 struct tracepoint *tp;
268 };
261 struct trace_event event; 269 struct trace_event event;
262 const char *print_fmt; 270 const char *print_fmt;
263 struct event_filter *filter; 271 struct event_filter *filter;
@@ -271,6 +279,7 @@ struct ftrace_event_call {
271 * bit 3: ftrace internal event (do not enable) 279 * bit 3: ftrace internal event (do not enable)
272 * bit 4: Event was enabled by module 280 * bit 4: Event was enabled by module
273 * bit 5: use call filter rather than file filter 281 * bit 5: use call filter rather than file filter
282 * bit 6: Event is a tracepoint
274 */ 283 */
275 int flags; /* static flags of different events */ 284 int flags; /* static flags of different events */
276 285
@@ -283,6 +292,15 @@ struct ftrace_event_call {
283#endif 292#endif
284}; 293};
285 294
295static inline const char *
296ftrace_event_name(struct ftrace_event_call *call)
297{
298 if (call->flags & TRACE_EVENT_FL_TRACEPOINT)
299 return call->tp ? call->tp->name : NULL;
300 else
301 return call->name;
302}
303
286struct trace_array; 304struct trace_array;
287struct ftrace_subsystem_dir; 305struct ftrace_subsystem_dir;
288 306
@@ -353,7 +371,7 @@ struct ftrace_event_file {
353#define __TRACE_EVENT_FLAGS(name, value) \ 371#define __TRACE_EVENT_FLAGS(name, value) \
354 static int __init trace_init_flags_##name(void) \ 372 static int __init trace_init_flags_##name(void) \
355 { \ 373 { \
356 event_##name.flags = value; \ 374 event_##name.flags |= value; \
357 return 0; \ 375 return 0; \
358 } \ 376 } \
359 early_initcall(trace_init_flags_##name); 377 early_initcall(trace_init_flags_##name);
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 9231be9e90a2..11c0182a153b 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -262,6 +262,18 @@ union hdmi_vendor_any_infoframe {
262 struct hdmi_vendor_infoframe hdmi; 262 struct hdmi_vendor_infoframe hdmi;
263}; 263};
264 264
265/**
266 * union hdmi_infoframe - overall union of all abstract infoframe representations
267 * @any: generic infoframe
268 * @avi: avi infoframe
269 * @spd: spd infoframe
270 * @vendor: union of all vendor infoframes
271 * @audio: audio infoframe
272 *
273 * This is used by the generic pack function. This works since all infoframes
274 * have the same header which also indicates which type of infoframe should be
275 * packed.
276 */
265union hdmi_infoframe { 277union hdmi_infoframe {
266 struct hdmi_any_infoframe any; 278 struct hdmi_any_infoframe any;
267 struct hdmi_avi_infoframe avi; 279 struct hdmi_avi_infoframe avi;
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index 3af847273277..d2b52999e771 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -136,6 +136,7 @@ u32 host1x_syncpt_id(struct host1x_syncpt *sp);
136u32 host1x_syncpt_read_min(struct host1x_syncpt *sp); 136u32 host1x_syncpt_read_min(struct host1x_syncpt *sp);
137u32 host1x_syncpt_read_max(struct host1x_syncpt *sp); 137u32 host1x_syncpt_read_max(struct host1x_syncpt *sp);
138int host1x_syncpt_incr(struct host1x_syncpt *sp); 138int host1x_syncpt_incr(struct host1x_syncpt *sp);
139u32 host1x_syncpt_incr_max(struct host1x_syncpt *sp, u32 incrs);
139int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, 140int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
140 u32 *value); 141 u32 *value);
141struct host1x_syncpt *host1x_syncpt_request(struct device *dev, 142struct host1x_syncpt *host1x_syncpt_request(struct device *dev,
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index deddeb8c337c..b556e0ab946f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -487,6 +487,7 @@ void i2c_unlock_adapter(struct i2c_adapter *);
487#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ 487#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
488#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ 488#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */
489#define I2C_CLASS_SPD (1<<7) /* Memory modules */ 489#define I2C_CLASS_SPD (1<<7) /* Memory modules */
490#define I2C_CLASS_DEPRECATED (1<<8) /* Warn users that adapter will stop using classes */
490 491
491/* Internal numbers to terminate lists */ 492/* Internal numbers to terminate lists */
492#define I2C_CLIENT_END 0xfffeU 493#define I2C_CLIENT_END 0xfffeU
diff --git a/include/linux/i2c/bfin_twi.h b/include/linux/i2c/bfin_twi.h
new file mode 100644
index 000000000000..135a4e0876ae
--- /dev/null
+++ b/include/linux/i2c/bfin_twi.h
@@ -0,0 +1,145 @@
1/*
2 * i2c-bfin-twi.h - interface to ADI TWI controller
3 *
4 * Copyright 2005-2014 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __I2C_BFIN_TWI_H__
10#define __I2C_BFIN_TWI_H__
11
12#include <linux/types.h>
13#include <linux/i2c.h>
14
15/*
16 * ADI twi registers layout
17 */
18struct bfin_twi_regs {
19 u16 clkdiv;
20 u16 dummy1;
21 u16 control;
22 u16 dummy2;
23 u16 slave_ctl;
24 u16 dummy3;
25 u16 slave_stat;
26 u16 dummy4;
27 u16 slave_addr;
28 u16 dummy5;
29 u16 master_ctl;
30 u16 dummy6;
31 u16 master_stat;
32 u16 dummy7;
33 u16 master_addr;
34 u16 dummy8;
35 u16 int_stat;
36 u16 dummy9;
37 u16 int_mask;
38 u16 dummy10;
39 u16 fifo_ctl;
40 u16 dummy11;
41 u16 fifo_stat;
42 u16 dummy12;
43 u32 __pad[20];
44 u16 xmt_data8;
45 u16 dummy13;
46 u16 xmt_data16;
47 u16 dummy14;
48 u16 rcv_data8;
49 u16 dummy15;
50 u16 rcv_data16;
51 u16 dummy16;
52};
53
54struct bfin_twi_iface {
55 int irq;
56 spinlock_t lock;
57 char read_write;
58 u8 command;
59 u8 *transPtr;
60 int readNum;
61 int writeNum;
62 int cur_mode;
63 int manual_stop;
64 int result;
65 struct i2c_adapter adap;
66 struct completion complete;
67 struct i2c_msg *pmsg;
68 int msg_num;
69 int cur_msg;
70 u16 saved_clkdiv;
71 u16 saved_control;
72 struct bfin_twi_regs __iomem *regs_base;
73};
74
75/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ********************/
76/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
77#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
78#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
79
80/* TWI_PRESCALE Masks */
81#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
82#define TWI_ENA 0x0080 /* TWI Enable */
83#define SCCB 0x0200 /* SCCB Compatibility Enable */
84
85/* TWI_SLAVE_CTL Masks */
86#define SEN 0x0001 /* Slave Enable */
87#define SADD_LEN 0x0002 /* Slave Address Length */
88#define STDVAL 0x0004 /* Slave Transmit Data Valid */
89#define NAK 0x0008 /* NAK Generated At Conclusion Of Transfer */
90#define GEN 0x0010 /* General Call Address Matching Enabled */
91
92/* TWI_SLAVE_STAT Masks */
93#define SDIR 0x0001 /* Slave Transfer Direction (RX/TX*) */
94#define GCALL 0x0002 /* General Call Indicator */
95
96/* TWI_MASTER_CTL Masks */
97#define MEN 0x0001 /* Master Mode Enable */
98#define MADD_LEN 0x0002 /* Master Address Length */
99#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
100#define FAST 0x0008 /* Use Fast Mode Timing Specs */
101#define STOP 0x0010 /* Issue Stop Condition */
102#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
103#define DCNT 0x3FC0 /* Data Bytes To Transfer */
104#define SDAOVR 0x4000 /* Serial Data Override */
105#define SCLOVR 0x8000 /* Serial Clock Override */
106
107/* TWI_MASTER_STAT Masks */
108#define MPROG 0x0001 /* Master Transfer In Progress */
109#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
110#define ANAK 0x0004 /* Address Not Acknowledged */
111#define DNAK 0x0008 /* Data Not Acknowledged */
112#define BUFRDERR 0x0010 /* Buffer Read Error */
113#define BUFWRERR 0x0020 /* Buffer Write Error */
114#define SDASEN 0x0040 /* Serial Data Sense */
115#define SCLSEN 0x0080 /* Serial Clock Sense */
116#define BUSBUSY 0x0100 /* Bus Busy Indicator */
117
118/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
119#define SINIT 0x0001 /* Slave Transfer Initiated */
120#define SCOMP 0x0002 /* Slave Transfer Complete */
121#define SERR 0x0004 /* Slave Transfer Error */
122#define SOVF 0x0008 /* Slave Overflow */
123#define MCOMP 0x0010 /* Master Transfer Complete */
124#define MERR 0x0020 /* Master Transfer Error */
125#define XMTSERV 0x0040 /* Transmit FIFO Service */
126#define RCVSERV 0x0080 /* Receive FIFO Service */
127
128/* TWI_FIFO_CTRL Masks */
129#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
130#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
131#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
132#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
133
134/* TWI_FIFO_STAT Masks */
135#define XMTSTAT 0x0003 /* Transmit FIFO Status */
136#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
137#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
138#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
139
140#define RCVSTAT 0x000C /* Receive FIFO Status */
141#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
142#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
143#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
144
145#endif
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index ade1c06d4ceb..d2b16704624c 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -195,6 +195,18 @@ static inline int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg) {
195 return twl_i2c_read(mod_no, val, reg, 1); 195 return twl_i2c_read(mod_no, val, reg, 1);
196} 196}
197 197
198static inline int twl_i2c_write_u16(u8 mod_no, u16 val, u8 reg) {
199 val = cpu_to_le16(val);
200 return twl_i2c_write(mod_no, (u8*) &val, reg, 2);
201}
202
203static inline int twl_i2c_read_u16(u8 mod_no, u16 *val, u8 reg) {
204 int ret;
205 ret = twl_i2c_read(mod_no, (u8*) val, reg, 2);
206 *val = le16_to_cpu(*val);
207 return ret;
208}
209
198int twl_get_type(void); 210int twl_get_type(void);
199int twl_get_version(void); 211int twl_get_version(void);
200int twl_get_hfclk_rate(void); 212int twl_get_hfclk_rate(void);
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h
index 01f595107048..1c0134dd3271 100644
--- a/include/linux/i2c/twl4030-madc.h
+++ b/include/linux/i2c/twl4030-madc.h
@@ -44,7 +44,7 @@ struct twl4030_madc_conversion_method {
44 44
45struct twl4030_madc_request { 45struct twl4030_madc_request {
46 unsigned long channels; 46 unsigned long channels;
47 u16 do_avg; 47 bool do_avg;
48 u16 method; 48 u16 method;
49 u16 type; 49 u16 type;
50 bool active; 50 bool active;
diff --git a/include/linux/idr.h b/include/linux/idr.h
index f669585c4fc5..6af3400b9b2f 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -133,69 +133,6 @@ static inline void *idr_find(struct idr *idr, int id)
133 for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id) 133 for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id)
134 134
135/* 135/*
136 * Don't use the following functions. These exist only to suppress
137 * deprecated warnings on EXPORT_SYMBOL()s.
138 */
139int __idr_pre_get(struct idr *idp, gfp_t gfp_mask);
140int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
141void __idr_remove_all(struct idr *idp);
142
143/**
144 * idr_pre_get - reserve resources for idr allocation
145 * @idp: idr handle
146 * @gfp_mask: memory allocation flags
147 *
148 * Part of old alloc interface. This is going away. Use
149 * idr_preload[_end]() and idr_alloc() instead.
150 */
151static inline int __deprecated idr_pre_get(struct idr *idp, gfp_t gfp_mask)
152{
153 return __idr_pre_get(idp, gfp_mask);
154}
155
156/**
157 * idr_get_new_above - allocate new idr entry above or equal to a start id
158 * @idp: idr handle
159 * @ptr: pointer you want associated with the id
160 * @starting_id: id to start search at
161 * @id: pointer to the allocated handle
162 *
163 * Part of old alloc interface. This is going away. Use
164 * idr_preload[_end]() and idr_alloc() instead.
165 */
166static inline int __deprecated idr_get_new_above(struct idr *idp, void *ptr,
167 int starting_id, int *id)
168{
169 return __idr_get_new_above(idp, ptr, starting_id, id);
170}
171
172/**
173 * idr_get_new - allocate new idr entry
174 * @idp: idr handle
175 * @ptr: pointer you want associated with the id
176 * @id: pointer to the allocated handle
177 *
178 * Part of old alloc interface. This is going away. Use
179 * idr_preload[_end]() and idr_alloc() instead.
180 */
181static inline int __deprecated idr_get_new(struct idr *idp, void *ptr, int *id)
182{
183 return __idr_get_new_above(idp, ptr, 0, id);
184}
185
186/**
187 * idr_remove_all - remove all ids from the given idr tree
188 * @idp: idr handle
189 *
190 * If you're trying to destroy @idp, calling idr_destroy() is enough.
191 * This is going away. Don't use.
192 */
193static inline void __deprecated idr_remove_all(struct idr *idp)
194{
195 __idr_remove_all(idp);
196}
197
198/*
199 * IDA - IDR based id allocator, use when translation from id to 136 * IDA - IDR based id allocator, use when translation from id to
200 * pointer isn't necessary. 137 * pointer isn't necessary.
201 * 138 *
diff --git a/include/linux/io.h b/include/linux/io.h
index 8a18e75600cc..b76e6e545806 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -41,7 +41,7 @@ static inline int ioremap_page_range(unsigned long addr, unsigned long end,
41/* 41/*
42 * Managed iomap interface 42 * Managed iomap interface
43 */ 43 */
44#ifdef CONFIG_HAS_IOPORT 44#ifdef CONFIG_HAS_IOPORT_MAP
45void __iomem * devm_ioport_map(struct device *dev, unsigned long port, 45void __iomem * devm_ioport_map(struct device *dev, unsigned long port,
46 unsigned int nr); 46 unsigned int nr);
47void devm_ioport_unmap(struct device *dev, void __iomem *addr); 47void devm_ioport_unmap(struct device *dev, void __iomem *addr);
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index e2d28b026a8c..3c77bf9b1efd 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -56,10 +56,6 @@
56#define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \ 56#define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \
57 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) } 57 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) }
58 58
59/* export used IDs outside module */
60#define ISAPNP_CARD_TABLE(name) \
61 MODULE_GENERIC_TABLE(isapnp_card, name)
62
63struct isapnp_card_id { 59struct isapnp_card_id {
64 unsigned long driver_data; /* data private to the driver */ 60 unsigned long driver_data; /* data private to the driver */
65 unsigned short card_vendor, card_device; 61 unsigned short card_vendor, card_device;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 08fb02477641..4c52907a6d8b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -469,6 +469,7 @@ extern enum system_states {
469#define TAINT_CRAP 10 469#define TAINT_CRAP 10
470#define TAINT_FIRMWARE_WORKAROUND 11 470#define TAINT_FIRMWARE_WORKAROUND 11
471#define TAINT_OOT_MODULE 12 471#define TAINT_OOT_MODULE 12
472#define TAINT_UNSIGNED_MODULE 13
472 473
473extern const char hex_asc[]; 474extern const char hex_asc[];
474#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] 475#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
@@ -841,4 +842,12 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
841# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 842# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
842#endif 843#endif
843 844
845/* Permissions on a sysfs file: you didn't miss the 0 prefix did you? */
846#define VERIFY_OCTAL_PERMISSIONS(perms) \
847 (BUILD_BUG_ON_ZERO((perms) < 0) + \
848 BUILD_BUG_ON_ZERO((perms) > 0777) + \
849 /* User perms >= group perms >= other perms */ \
850 BUILD_BUG_ON_ZERO(((perms) >> 6) < (((perms) >> 3) & 7)) + \
851 BUILD_BUG_ON_ZERO((((perms) >> 3) & 7) < ((perms) & 7)) + \
852 (perms))
844#endif 853#endif
diff --git a/include/linux/lglock.h b/include/linux/lglock.h
index 96549abe8842..0081f000e34b 100644
--- a/include/linux/lglock.h
+++ b/include/linux/lglock.h
@@ -25,6 +25,8 @@
25#include <linux/cpu.h> 25#include <linux/cpu.h>
26#include <linux/notifier.h> 26#include <linux/notifier.h>
27 27
28#ifdef CONFIG_SMP
29
28#ifdef CONFIG_DEBUG_LOCK_ALLOC 30#ifdef CONFIG_DEBUG_LOCK_ALLOC
29#define LOCKDEP_INIT_MAP lockdep_init_map 31#define LOCKDEP_INIT_MAP lockdep_init_map
30#else 32#else
@@ -57,4 +59,18 @@ void lg_local_unlock_cpu(struct lglock *lg, int cpu);
57void lg_global_lock(struct lglock *lg); 59void lg_global_lock(struct lglock *lg);
58void lg_global_unlock(struct lglock *lg); 60void lg_global_unlock(struct lglock *lg);
59 61
62#else
63/* When !CONFIG_SMP, map lglock to spinlock */
64#define lglock spinlock
65#define DEFINE_LGLOCK(name) DEFINE_SPINLOCK(name)
66#define DEFINE_STATIC_LGLOCK(name) static DEFINE_SPINLOCK(name)
67#define lg_lock_init(lg, name) spin_lock_init(lg)
68#define lg_local_lock spin_lock
69#define lg_local_unlock spin_unlock
70#define lg_local_lock_cpu(lg, cpu) spin_lock(lg)
71#define lg_local_unlock_cpu(lg, cpu) spin_unlock(lg)
72#define lg_global_lock spin_lock
73#define lg_global_unlock spin_unlock
74#endif
75
60#endif 76#endif
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index eccfb4a4b379..b569b8be5c5a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -65,7 +65,7 @@ struct mem_cgroup_reclaim_cookie {
65 * (Of course, if memcg does memory allocation in future, GFP_KERNEL is sane.) 65 * (Of course, if memcg does memory allocation in future, GFP_KERNEL is sane.)
66 */ 66 */
67 67
68extern int mem_cgroup_newpage_charge(struct page *page, struct mm_struct *mm, 68extern int mem_cgroup_charge_anon(struct page *page, struct mm_struct *mm,
69 gfp_t gfp_mask); 69 gfp_t gfp_mask);
70/* for swap handling */ 70/* for swap handling */
71extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm, 71extern int mem_cgroup_try_charge_swapin(struct mm_struct *mm,
@@ -74,7 +74,7 @@ extern void mem_cgroup_commit_charge_swapin(struct page *page,
74 struct mem_cgroup *memcg); 74 struct mem_cgroup *memcg);
75extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *memcg); 75extern void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *memcg);
76 76
77extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, 77extern int mem_cgroup_charge_file(struct page *page, struct mm_struct *mm,
78 gfp_t gfp_mask); 78 gfp_t gfp_mask);
79 79
80struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); 80struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *);
@@ -94,7 +94,6 @@ bool task_in_mem_cgroup(struct task_struct *task,
94 94
95extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 95extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
96extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 96extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
97extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
98 97
99extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); 98extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg);
100extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css); 99extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css);
@@ -234,13 +233,13 @@ void mem_cgroup_print_bad_page(struct page *page);
234#else /* CONFIG_MEMCG */ 233#else /* CONFIG_MEMCG */
235struct mem_cgroup; 234struct mem_cgroup;
236 235
237static inline int mem_cgroup_newpage_charge(struct page *page, 236static inline int mem_cgroup_charge_anon(struct page *page,
238 struct mm_struct *mm, gfp_t gfp_mask) 237 struct mm_struct *mm, gfp_t gfp_mask)
239{ 238{
240 return 0; 239 return 0;
241} 240}
242 241
243static inline int mem_cgroup_cache_charge(struct page *page, 242static inline int mem_cgroup_charge_file(struct page *page,
244 struct mm_struct *mm, gfp_t gfp_mask) 243 struct mm_struct *mm, gfp_t gfp_mask)
245{ 244{
246 return 0; 245 return 0;
@@ -294,11 +293,6 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
294 return NULL; 293 return NULL;
295} 294}
296 295
297static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
298{
299 return NULL;
300}
301
302static inline bool mm_match_cgroup(struct mm_struct *mm, 296static inline bool mm_match_cgroup(struct mm_struct *mm,
303 struct mem_cgroup *memcg) 297 struct mem_cgroup *memcg)
304{ 298{
@@ -497,6 +491,9 @@ void __memcg_kmem_commit_charge(struct page *page,
497void __memcg_kmem_uncharge_pages(struct page *page, int order); 491void __memcg_kmem_uncharge_pages(struct page *page, int order);
498 492
499int memcg_cache_id(struct mem_cgroup *memcg); 493int memcg_cache_id(struct mem_cgroup *memcg);
494
495char *memcg_create_cache_name(struct mem_cgroup *memcg,
496 struct kmem_cache *root_cache);
500int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s, 497int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s,
501 struct kmem_cache *root_cache); 498 struct kmem_cache *root_cache);
502void memcg_free_cache_params(struct kmem_cache *s); 499void memcg_free_cache_params(struct kmem_cache *s);
@@ -510,7 +507,7 @@ struct kmem_cache *
510__memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp); 507__memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp);
511 508
512void mem_cgroup_destroy_cache(struct kmem_cache *cachep); 509void mem_cgroup_destroy_cache(struct kmem_cache *cachep);
513void kmem_cache_destroy_memcg_children(struct kmem_cache *s); 510int __kmem_cache_destroy_memcg_children(struct kmem_cache *s);
514 511
515/** 512/**
516 * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. 513 * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed.
@@ -664,10 +661,6 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp)
664{ 661{
665 return cachep; 662 return cachep;
666} 663}
667
668static inline void kmem_cache_destroy_memcg_children(struct kmem_cache *s)
669{
670}
671#endif /* CONFIG_MEMCG_KMEM */ 664#endif /* CONFIG_MEMCG_KMEM */
672#endif /* _LINUX_MEMCONTROL_H */ 665#endif /* _LINUX_MEMCONTROL_H */
673 666
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 5f1ea756aace..3c1b968da0ca 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -143,7 +143,6 @@ extern void numa_policy_init(void);
143extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new, 143extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new,
144 enum mpol_rebind_step step); 144 enum mpol_rebind_step step);
145extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); 145extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
146extern void mpol_fix_fork_child_flag(struct task_struct *p);
147 146
148extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, 147extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
149 unsigned long addr, gfp_t gfp_flags, 148 unsigned long addr, gfp_t gfp_flags,
@@ -151,7 +150,7 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
151extern bool init_nodemask_of_mempolicy(nodemask_t *mask); 150extern bool init_nodemask_of_mempolicy(nodemask_t *mask);
152extern bool mempolicy_nodemask_intersects(struct task_struct *tsk, 151extern bool mempolicy_nodemask_intersects(struct task_struct *tsk,
153 const nodemask_t *mask); 152 const nodemask_t *mask);
154extern unsigned slab_node(void); 153extern unsigned int mempolicy_slab_node(void);
155 154
156extern enum zone_type policy_zone; 155extern enum zone_type policy_zone;
157 156
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 3ddaa634b19d..7b35c21170d5 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -1034,6 +1034,27 @@
1034#define ARIZONA_DSP1_STATUS_1 0x1104 1034#define ARIZONA_DSP1_STATUS_1 0x1104
1035#define ARIZONA_DSP1_STATUS_2 0x1105 1035#define ARIZONA_DSP1_STATUS_2 0x1105
1036#define ARIZONA_DSP1_STATUS_3 0x1106 1036#define ARIZONA_DSP1_STATUS_3 0x1106
1037#define ARIZONA_DSP1_STATUS_4 0x1107
1038#define ARIZONA_DSP1_WDMA_BUFFER_1 0x1110
1039#define ARIZONA_DSP1_WDMA_BUFFER_2 0x1111
1040#define ARIZONA_DSP1_WDMA_BUFFER_3 0x1112
1041#define ARIZONA_DSP1_WDMA_BUFFER_4 0x1113
1042#define ARIZONA_DSP1_WDMA_BUFFER_5 0x1114
1043#define ARIZONA_DSP1_WDMA_BUFFER_6 0x1115
1044#define ARIZONA_DSP1_WDMA_BUFFER_7 0x1116
1045#define ARIZONA_DSP1_WDMA_BUFFER_8 0x1117
1046#define ARIZONA_DSP1_RDMA_BUFFER_1 0x1120
1047#define ARIZONA_DSP1_RDMA_BUFFER_2 0x1121
1048#define ARIZONA_DSP1_RDMA_BUFFER_3 0x1122
1049#define ARIZONA_DSP1_RDMA_BUFFER_4 0x1123
1050#define ARIZONA_DSP1_RDMA_BUFFER_5 0x1124
1051#define ARIZONA_DSP1_RDMA_BUFFER_6 0x1125
1052#define ARIZONA_DSP1_WDMA_CONFIG_1 0x1130
1053#define ARIZONA_DSP1_WDMA_CONFIG_2 0x1131
1054#define ARIZONA_DSP1_WDMA_OFFSET_1 0x1132
1055#define ARIZONA_DSP1_RDMA_CONFIG_1 0x1134
1056#define ARIZONA_DSP1_RDMA_OFFSET_1 0x1135
1057#define ARIZONA_DSP1_EXTERNAL_START_SELECT_1 0x1138
1037#define ARIZONA_DSP1_SCRATCH_0 0x1140 1058#define ARIZONA_DSP1_SCRATCH_0 0x1140
1038#define ARIZONA_DSP1_SCRATCH_1 0x1141 1059#define ARIZONA_DSP1_SCRATCH_1 0x1141
1039#define ARIZONA_DSP1_SCRATCH_2 0x1142 1060#define ARIZONA_DSP1_SCRATCH_2 0x1142
@@ -1043,6 +1064,27 @@
1043#define ARIZONA_DSP2_STATUS_1 0x1204 1064#define ARIZONA_DSP2_STATUS_1 0x1204
1044#define ARIZONA_DSP2_STATUS_2 0x1205 1065#define ARIZONA_DSP2_STATUS_2 0x1205
1045#define ARIZONA_DSP2_STATUS_3 0x1206 1066#define ARIZONA_DSP2_STATUS_3 0x1206
1067#define ARIZONA_DSP2_STATUS_4 0x1207
1068#define ARIZONA_DSP2_WDMA_BUFFER_1 0x1210
1069#define ARIZONA_DSP2_WDMA_BUFFER_2 0x1211
1070#define ARIZONA_DSP2_WDMA_BUFFER_3 0x1212
1071#define ARIZONA_DSP2_WDMA_BUFFER_4 0x1213
1072#define ARIZONA_DSP2_WDMA_BUFFER_5 0x1214
1073#define ARIZONA_DSP2_WDMA_BUFFER_6 0x1215
1074#define ARIZONA_DSP2_WDMA_BUFFER_7 0x1216
1075#define ARIZONA_DSP2_WDMA_BUFFER_8 0x1217
1076#define ARIZONA_DSP2_RDMA_BUFFER_1 0x1220
1077#define ARIZONA_DSP2_RDMA_BUFFER_2 0x1221
1078#define ARIZONA_DSP2_RDMA_BUFFER_3 0x1222
1079#define ARIZONA_DSP2_RDMA_BUFFER_4 0x1223
1080#define ARIZONA_DSP2_RDMA_BUFFER_5 0x1224
1081#define ARIZONA_DSP2_RDMA_BUFFER_6 0x1225
1082#define ARIZONA_DSP2_WDMA_CONFIG_1 0x1230
1083#define ARIZONA_DSP2_WDMA_CONFIG_2 0x1231
1084#define ARIZONA_DSP2_WDMA_OFFSET_1 0x1232
1085#define ARIZONA_DSP2_RDMA_CONFIG_1 0x1234
1086#define ARIZONA_DSP2_RDMA_OFFSET_1 0x1235
1087#define ARIZONA_DSP2_EXTERNAL_START_SELECT_1 0x1238
1046#define ARIZONA_DSP2_SCRATCH_0 0x1240 1088#define ARIZONA_DSP2_SCRATCH_0 0x1240
1047#define ARIZONA_DSP2_SCRATCH_1 0x1241 1089#define ARIZONA_DSP2_SCRATCH_1 0x1241
1048#define ARIZONA_DSP2_SCRATCH_2 0x1242 1090#define ARIZONA_DSP2_SCRATCH_2 0x1242
@@ -1052,6 +1094,27 @@
1052#define ARIZONA_DSP3_STATUS_1 0x1304 1094#define ARIZONA_DSP3_STATUS_1 0x1304
1053#define ARIZONA_DSP3_STATUS_2 0x1305 1095#define ARIZONA_DSP3_STATUS_2 0x1305
1054#define ARIZONA_DSP3_STATUS_3 0x1306 1096#define ARIZONA_DSP3_STATUS_3 0x1306
1097#define ARIZONA_DSP3_STATUS_4 0x1307
1098#define ARIZONA_DSP3_WDMA_BUFFER_1 0x1310
1099#define ARIZONA_DSP3_WDMA_BUFFER_2 0x1311
1100#define ARIZONA_DSP3_WDMA_BUFFER_3 0x1312
1101#define ARIZONA_DSP3_WDMA_BUFFER_4 0x1313
1102#define ARIZONA_DSP3_WDMA_BUFFER_5 0x1314
1103#define ARIZONA_DSP3_WDMA_BUFFER_6 0x1315
1104#define ARIZONA_DSP3_WDMA_BUFFER_7 0x1316
1105#define ARIZONA_DSP3_WDMA_BUFFER_8 0x1317
1106#define ARIZONA_DSP3_RDMA_BUFFER_1 0x1320
1107#define ARIZONA_DSP3_RDMA_BUFFER_2 0x1321
1108#define ARIZONA_DSP3_RDMA_BUFFER_3 0x1322
1109#define ARIZONA_DSP3_RDMA_BUFFER_4 0x1323
1110#define ARIZONA_DSP3_RDMA_BUFFER_5 0x1324
1111#define ARIZONA_DSP3_RDMA_BUFFER_6 0x1325
1112#define ARIZONA_DSP3_WDMA_CONFIG_1 0x1330
1113#define ARIZONA_DSP3_WDMA_CONFIG_2 0x1331
1114#define ARIZONA_DSP3_WDMA_OFFSET_1 0x1332
1115#define ARIZONA_DSP3_RDMA_CONFIG_1 0x1334
1116#define ARIZONA_DSP3_RDMA_OFFSET_1 0x1335
1117#define ARIZONA_DSP3_EXTERNAL_START_SELECT_1 0x1338
1055#define ARIZONA_DSP3_SCRATCH_0 0x1340 1118#define ARIZONA_DSP3_SCRATCH_0 0x1340
1056#define ARIZONA_DSP3_SCRATCH_1 0x1341 1119#define ARIZONA_DSP3_SCRATCH_1 0x1341
1057#define ARIZONA_DSP3_SCRATCH_2 0x1342 1120#define ARIZONA_DSP3_SCRATCH_2 0x1342
@@ -1061,6 +1124,27 @@
1061#define ARIZONA_DSP4_STATUS_1 0x1404 1124#define ARIZONA_DSP4_STATUS_1 0x1404
1062#define ARIZONA_DSP4_STATUS_2 0x1405 1125#define ARIZONA_DSP4_STATUS_2 0x1405
1063#define ARIZONA_DSP4_STATUS_3 0x1406 1126#define ARIZONA_DSP4_STATUS_3 0x1406
1127#define ARIZONA_DSP4_STATUS_4 0x1407
1128#define ARIZONA_DSP4_WDMA_BUFFER_1 0x1410
1129#define ARIZONA_DSP4_WDMA_BUFFER_2 0x1411
1130#define ARIZONA_DSP4_WDMA_BUFFER_3 0x1412
1131#define ARIZONA_DSP4_WDMA_BUFFER_4 0x1413
1132#define ARIZONA_DSP4_WDMA_BUFFER_5 0x1414
1133#define ARIZONA_DSP4_WDMA_BUFFER_6 0x1415
1134#define ARIZONA_DSP4_WDMA_BUFFER_7 0x1416
1135#define ARIZONA_DSP4_WDMA_BUFFER_8 0x1417
1136#define ARIZONA_DSP4_RDMA_BUFFER_1 0x1420
1137#define ARIZONA_DSP4_RDMA_BUFFER_2 0x1421
1138#define ARIZONA_DSP4_RDMA_BUFFER_3 0x1422
1139#define ARIZONA_DSP4_RDMA_BUFFER_4 0x1423
1140#define ARIZONA_DSP4_RDMA_BUFFER_5 0x1424
1141#define ARIZONA_DSP4_RDMA_BUFFER_6 0x1425
1142#define ARIZONA_DSP4_WDMA_CONFIG_1 0x1430
1143#define ARIZONA_DSP4_WDMA_CONFIG_2 0x1431
1144#define ARIZONA_DSP4_WDMA_OFFSET_1 0x1432
1145#define ARIZONA_DSP4_RDMA_CONFIG_1 0x1434
1146#define ARIZONA_DSP4_RDMA_OFFSET_1 0x1435
1147#define ARIZONA_DSP4_EXTERNAL_START_SELECT_1 0x1438
1064#define ARIZONA_DSP4_SCRATCH_0 0x1440 1148#define ARIZONA_DSP4_SCRATCH_0 0x1440
1065#define ARIZONA_DSP4_SCRATCH_1 0x1441 1149#define ARIZONA_DSP4_SCRATCH_1 0x1441
1066#define ARIZONA_DSP4_SCRATCH_2 0x1442 1150#define ARIZONA_DSP4_SCRATCH_2 0x1442
diff --git a/include/linux/mfd/bcm590xx.h b/include/linux/mfd/bcm590xx.h
new file mode 100644
index 000000000000..434df2d4e587
--- /dev/null
+++ b/include/linux/mfd/bcm590xx.h
@@ -0,0 +1,31 @@
1/*
2 * Broadcom BCM590xx PMU
3 *
4 * Copyright 2014 Linaro Limited
5 * Author: Matt Porter <mporter@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#ifndef __LINUX_MFD_BCM590XX_H
15#define __LINUX_MFD_BCM590XX_H
16
17#include <linux/device.h>
18#include <linux/i2c.h>
19#include <linux/regmap.h>
20
21/* max register address */
22#define BCM590XX_MAX_REGISTER 0xe7
23
24struct bcm590xx {
25 struct device *dev;
26 struct i2c_client *i2c_client;
27 struct regmap *regmap;
28 unsigned int id;
29};
30
31#endif /* __LINUX_MFD_BCM590XX_H */
diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h
index 21e21b81cc75..bba65f51a0b5 100644
--- a/include/linux/mfd/da9052/da9052.h
+++ b/include/linux/mfd/da9052/da9052.h
@@ -83,6 +83,7 @@ enum da9052_chip_id {
83 DA9053_AA, 83 DA9053_AA,
84 DA9053_BA, 84 DA9053_BA,
85 DA9053_BB, 85 DA9053_BB,
86 DA9053_BC,
86}; 87};
87 88
88struct da9052_pdata; 89struct da9052_pdata;
diff --git a/include/linux/mfd/da9063/core.h b/include/linux/mfd/da9063/core.h
index 2d2a0af675fd..00a9aac5d1e8 100644
--- a/include/linux/mfd/da9063/core.h
+++ b/include/linux/mfd/da9063/core.h
@@ -33,6 +33,10 @@ enum da9063_models {
33 PMIC_DA9063 = 0x61, 33 PMIC_DA9063 = 0x61,
34}; 34};
35 35
36enum da9063_variant_codes {
37 PMIC_DA9063_BB = 0x5
38};
39
36/* Interrupts */ 40/* Interrupts */
37enum da9063_irqs { 41enum da9063_irqs {
38 DA9063_IRQ_ONKEY = 0, 42 DA9063_IRQ_ONKEY = 0,
@@ -72,7 +76,7 @@ struct da9063 {
72 /* Device */ 76 /* Device */
73 struct device *dev; 77 struct device *dev;
74 unsigned short model; 78 unsigned short model;
75 unsigned short revision; 79 unsigned char variant_code;
76 unsigned int flags; 80 unsigned int flags;
77 81
78 /* Control interface */ 82 /* Control interface */
diff --git a/include/linux/mfd/da9063/registers.h b/include/linux/mfd/da9063/registers.h
index 5834813fb5f3..09a85c699da1 100644
--- a/include/linux/mfd/da9063/registers.h
+++ b/include/linux/mfd/da9063/registers.h
@@ -17,11 +17,7 @@
17#define _DA9063_REG_H 17#define _DA9063_REG_H
18 18
19#define DA9063_I2C_PAGE_SEL_SHIFT 1 19#define DA9063_I2C_PAGE_SEL_SHIFT 1
20
21#define DA9063_EVENT_REG_NUM 4 20#define DA9063_EVENT_REG_NUM 4
22#define DA9210_EVENT_REG_NUM 2
23#define DA9063_EXT_EVENT_REG_NUM (DA9063_EVENT_REG_NUM + \
24 DA9210_EVENT_REG_NUM)
25 21
26/* Page selection I2C or SPI always in the begining of any page. */ 22/* Page selection I2C or SPI always in the begining of any page. */
27/* Page 0 : I2C access 0x000 - 0x0FF SPI access 0x000 - 0x07F */ 23/* Page 0 : I2C access 0x000 - 0x0FF SPI access 0x000 - 0x07F */
@@ -61,9 +57,9 @@
61#define DA9063_REG_GPIO_10_11 0x1A 57#define DA9063_REG_GPIO_10_11 0x1A
62#define DA9063_REG_GPIO_12_13 0x1B 58#define DA9063_REG_GPIO_12_13 0x1B
63#define DA9063_REG_GPIO_14_15 0x1C 59#define DA9063_REG_GPIO_14_15 0x1C
64#define DA9063_REG_GPIO_MODE_0_7 0x1D 60#define DA9063_REG_GPIO_MODE0_7 0x1D
65#define DA9063_REG_GPIO_MODE_8_15 0x1E 61#define DA9063_REG_GPIO_MODE8_15 0x1E
66#define DA9063_REG_GPIO_SWITCH_CONT 0x1F 62#define DA9063_REG_SWITCH_CONT 0x1F
67 63
68/* Regulator Control Registers */ 64/* Regulator Control Registers */
69#define DA9063_REG_BCORE2_CONT 0x20 65#define DA9063_REG_BCORE2_CONT 0x20
@@ -83,7 +79,7 @@
83#define DA9063_REG_LDO9_CONT 0x2E 79#define DA9063_REG_LDO9_CONT 0x2E
84#define DA9063_REG_LDO10_CONT 0x2F 80#define DA9063_REG_LDO10_CONT 0x2F
85#define DA9063_REG_LDO11_CONT 0x30 81#define DA9063_REG_LDO11_CONT 0x30
86#define DA9063_REG_VIB 0x31 82#define DA9063_REG_SUPPLIES 0x31
87#define DA9063_REG_DVC_1 0x32 83#define DA9063_REG_DVC_1 0x32
88#define DA9063_REG_DVC_2 0x33 84#define DA9063_REG_DVC_2 0x33
89 85
@@ -97,9 +93,9 @@
97#define DA9063_REG_ADCIN1_RES 0x3A 93#define DA9063_REG_ADCIN1_RES 0x3A
98#define DA9063_REG_ADCIN2_RES 0x3B 94#define DA9063_REG_ADCIN2_RES 0x3B
99#define DA9063_REG_ADCIN3_RES 0x3C 95#define DA9063_REG_ADCIN3_RES 0x3C
100#define DA9063_REG_MON1_RES 0x3D 96#define DA9063_REG_MON_A8_RES 0x3D
101#define DA9063_REG_MON2_RES 0x3E 97#define DA9063_REG_MON_A9_RES 0x3E
102#define DA9063_REG_MON3_RES 0x3F 98#define DA9063_REG_MON_A10_RES 0x3F
103 99
104/* RTC Calendar and Alarm Registers */ 100/* RTC Calendar and Alarm Registers */
105#define DA9063_REG_COUNT_S 0x40 101#define DA9063_REG_COUNT_S 0x40
@@ -108,15 +104,16 @@
108#define DA9063_REG_COUNT_D 0x43 104#define DA9063_REG_COUNT_D 0x43
109#define DA9063_REG_COUNT_MO 0x44 105#define DA9063_REG_COUNT_MO 0x44
110#define DA9063_REG_COUNT_Y 0x45 106#define DA9063_REG_COUNT_Y 0x45
111#define DA9063_REG_ALARM_MI 0x46 107#define DA9063_REG_ALARM_S 0x46
112#define DA9063_REG_ALARM_H 0x47 108#define DA9063_REG_ALARM_MI 0x47
113#define DA9063_REG_ALARM_D 0x48 109#define DA9063_REG_ALARM_H 0x48
114#define DA9063_REG_ALARM_MO 0x49 110#define DA9063_REG_ALARM_D 0x49
115#define DA9063_REG_ALARM_Y 0x4A 111#define DA9063_REG_ALARM_MO 0x4A
116#define DA9063_REG_SECOND_A 0x4B 112#define DA9063_REG_ALARM_Y 0x4B
117#define DA9063_REG_SECOND_B 0x4C 113#define DA9063_REG_SECOND_A 0x4C
118#define DA9063_REG_SECOND_C 0x4D 114#define DA9063_REG_SECOND_B 0x4D
119#define DA9063_REG_SECOND_D 0x4E 115#define DA9063_REG_SECOND_C 0x4E
116#define DA9063_REG_SECOND_D 0x4F
120 117
121/* Sequencer Control Registers */ 118/* Sequencer Control Registers */
122#define DA9063_REG_SEQ 0x81 119#define DA9063_REG_SEQ 0x81
@@ -226,35 +223,37 @@
226#define DA9063_REG_CONFIG_J 0x10F 223#define DA9063_REG_CONFIG_J 0x10F
227#define DA9063_REG_CONFIG_K 0x110 224#define DA9063_REG_CONFIG_K 0x110
228#define DA9063_REG_CONFIG_L 0x111 225#define DA9063_REG_CONFIG_L 0x111
229#define DA9063_REG_MON_REG_1 0x112 226#define DA9063_REG_CONFIG_M 0x112
230#define DA9063_REG_MON_REG_2 0x113 227#define DA9063_REG_CONFIG_N 0x113
231#define DA9063_REG_MON_REG_3 0x114 228
232#define DA9063_REG_MON_REG_4 0x115 229#define DA9063_REG_MON_REG_1 0x114
233#define DA9063_REG_MON_REG_5 0x116 230#define DA9063_REG_MON_REG_2 0x115
234#define DA9063_REG_MON_REG_6 0x117 231#define DA9063_REG_MON_REG_3 0x116
235#define DA9063_REG_TRIM_CLDR 0x118 232#define DA9063_REG_MON_REG_4 0x117
236 233#define DA9063_REG_MON_REG_5 0x11E
234#define DA9063_REG_MON_REG_6 0x11F
235#define DA9063_REG_TRIM_CLDR 0x120
237/* General Purpose Registers */ 236/* General Purpose Registers */
238#define DA9063_REG_GP_ID_0 0x119 237#define DA9063_REG_GP_ID_0 0x121
239#define DA9063_REG_GP_ID_1 0x11A 238#define DA9063_REG_GP_ID_1 0x122
240#define DA9063_REG_GP_ID_2 0x11B 239#define DA9063_REG_GP_ID_2 0x123
241#define DA9063_REG_GP_ID_3 0x11C 240#define DA9063_REG_GP_ID_3 0x124
242#define DA9063_REG_GP_ID_4 0x11D 241#define DA9063_REG_GP_ID_4 0x125
243#define DA9063_REG_GP_ID_5 0x11E 242#define DA9063_REG_GP_ID_5 0x126
244#define DA9063_REG_GP_ID_6 0x11F 243#define DA9063_REG_GP_ID_6 0x127
245#define DA9063_REG_GP_ID_7 0x120 244#define DA9063_REG_GP_ID_7 0x128
246#define DA9063_REG_GP_ID_8 0x121 245#define DA9063_REG_GP_ID_8 0x129
247#define DA9063_REG_GP_ID_9 0x122 246#define DA9063_REG_GP_ID_9 0x12A
248#define DA9063_REG_GP_ID_10 0x123 247#define DA9063_REG_GP_ID_10 0x12B
249#define DA9063_REG_GP_ID_11 0x124 248#define DA9063_REG_GP_ID_11 0x12C
250#define DA9063_REG_GP_ID_12 0x125 249#define DA9063_REG_GP_ID_12 0x12D
251#define DA9063_REG_GP_ID_13 0x126 250#define DA9063_REG_GP_ID_13 0x12E
252#define DA9063_REG_GP_ID_14 0x127 251#define DA9063_REG_GP_ID_14 0x12F
253#define DA9063_REG_GP_ID_15 0x128 252#define DA9063_REG_GP_ID_15 0x130
254#define DA9063_REG_GP_ID_16 0x129 253#define DA9063_REG_GP_ID_16 0x131
255#define DA9063_REG_GP_ID_17 0x12A 254#define DA9063_REG_GP_ID_17 0x132
256#define DA9063_REG_GP_ID_18 0x12B 255#define DA9063_REG_GP_ID_18 0x133
257#define DA9063_REG_GP_ID_19 0x12C 256#define DA9063_REG_GP_ID_19 0x134
258 257
259/* Chip ID and variant */ 258/* Chip ID and variant */
260#define DA9063_REG_CHIP_ID 0x181 259#define DA9063_REG_CHIP_ID 0x181
@@ -405,8 +404,10 @@
405/* DA9063_REG_CONTROL_B (addr=0x0F) */ 404/* DA9063_REG_CONTROL_B (addr=0x0F) */
406#define DA9063_CHG_SEL 0x01 405#define DA9063_CHG_SEL 0x01
407#define DA9063_WATCHDOG_PD 0x02 406#define DA9063_WATCHDOG_PD 0x02
407#define DA9063_RESET_BLINKING 0x04
408#define DA9063_NRES_MODE 0x08 408#define DA9063_NRES_MODE 0x08
409#define DA9063_NONKEY_LOCK 0x10 409#define DA9063_NONKEY_LOCK 0x10
410#define DA9063_BUCK_SLOWSTART 0x80
410 411
411/* DA9063_REG_CONTROL_C (addr=0x10) */ 412/* DA9063_REG_CONTROL_C (addr=0x10) */
412#define DA9063_DEBOUNCING_MASK 0x07 413#define DA9063_DEBOUNCING_MASK 0x07
@@ -466,6 +467,7 @@
466#define DA9063_GPADC_PAUSE 0x02 467#define DA9063_GPADC_PAUSE 0x02
467#define DA9063_PMIF_DIS 0x04 468#define DA9063_PMIF_DIS 0x04
468#define DA9063_HS2WIRE_DIS 0x08 469#define DA9063_HS2WIRE_DIS 0x08
470#define DA9063_CLDR_PAUSE 0x10
469#define DA9063_BBAT_DIS 0x20 471#define DA9063_BBAT_DIS 0x20
470#define DA9063_OUT_32K_PAUSE 0x40 472#define DA9063_OUT_32K_PAUSE 0x40
471#define DA9063_PMCONT_DIS 0x80 473#define DA9063_PMCONT_DIS 0x80
@@ -660,7 +662,7 @@
660#define DA9063_GPIO15_TYPE_GPO 0x04 662#define DA9063_GPIO15_TYPE_GPO 0x04
661#define DA9063_GPIO15_NO_WAKEUP 0x80 663#define DA9063_GPIO15_NO_WAKEUP 0x80
662 664
663/* DA9063_REG_GPIO_MODE_0_7 (addr=0x1D) */ 665/* DA9063_REG_GPIO_MODE0_7 (addr=0x1D) */
664#define DA9063_GPIO0_MODE 0x01 666#define DA9063_GPIO0_MODE 0x01
665#define DA9063_GPIO1_MODE 0x02 667#define DA9063_GPIO1_MODE 0x02
666#define DA9063_GPIO2_MODE 0x04 668#define DA9063_GPIO2_MODE 0x04
@@ -670,7 +672,7 @@
670#define DA9063_GPIO6_MODE 0x40 672#define DA9063_GPIO6_MODE 0x40
671#define DA9063_GPIO7_MODE 0x80 673#define DA9063_GPIO7_MODE 0x80
672 674
673/* DA9063_REG_GPIO_MODE_8_15 (addr=0x1E) */ 675/* DA9063_REG_GPIO_MODE8_15 (addr=0x1E) */
674#define DA9063_GPIO8_MODE 0x01 676#define DA9063_GPIO8_MODE 0x01
675#define DA9063_GPIO9_MODE 0x02 677#define DA9063_GPIO9_MODE 0x02
676#define DA9063_GPIO10_MODE 0x04 678#define DA9063_GPIO10_MODE 0x04
@@ -702,12 +704,12 @@
702#define DA9063_SWITCH_SR_5MV 0x10 704#define DA9063_SWITCH_SR_5MV 0x10
703#define DA9063_SWITCH_SR_10MV 0x20 705#define DA9063_SWITCH_SR_10MV 0x20
704#define DA9063_SWITCH_SR_50MV 0x30 706#define DA9063_SWITCH_SR_50MV 0x30
705#define DA9063_SWITCH_SR_DIS 0x40 707#define DA9063_CORE_SW_INTERNAL 0x40
706#define DA9063_CP_EN_MODE 0x80 708#define DA9063_CP_EN_MODE 0x80
707 709
708/* DA9063_REGL_Bxxxx_CONT common bits (addr=0x20-0x25) */ 710/* DA9063_REGL_Bxxxx_CONT common bits (addr=0x20-0x25) */
709#define DA9063_BUCK_EN 0x01 711#define DA9063_BUCK_EN 0x01
710#define DA9063_BUCK_GPI_MASK 0x06 712#define DA9063_BUCK_GPI_MASK 0x06
711#define DA9063_BUCK_GPI_OFF 0x00 713#define DA9063_BUCK_GPI_OFF 0x00
712#define DA9063_BUCK_GPI_GPIO1 0x02 714#define DA9063_BUCK_GPI_GPIO1 0x02
713#define DA9063_BUCK_GPI_GPIO2 0x04 715#define DA9063_BUCK_GPI_GPIO2 0x04
@@ -841,25 +843,27 @@
841#define DA9063_COUNT_YEAR_MASK 0x3F 843#define DA9063_COUNT_YEAR_MASK 0x3F
842#define DA9063_MONITOR 0x40 844#define DA9063_MONITOR 0x40
843 845
844/* DA9063_REG_ALARM_MI (addr=0x46) */ 846/* DA9063_REG_ALARM_S (addr=0x46) */
847#define DA9063_ALARM_S_MASK 0x3F
845#define DA9063_ALARM_STATUS_ALARM 0x80 848#define DA9063_ALARM_STATUS_ALARM 0x80
846#define DA9063_ALARM_STATUS_TICK 0x40 849#define DA9063_ALARM_STATUS_TICK 0x40
850/* DA9063_REG_ALARM_MI (addr=0x47) */
847#define DA9063_ALARM_MIN_MASK 0x3F 851#define DA9063_ALARM_MIN_MASK 0x3F
848 852
849/* DA9063_REG_ALARM_H (addr=0x47) */ 853/* DA9063_REG_ALARM_H (addr=0x48) */
850#define DA9063_ALARM_HOUR_MASK 0x1F 854#define DA9063_ALARM_HOUR_MASK 0x1F
851 855
852/* DA9063_REG_ALARM_D (addr=0x48) */ 856/* DA9063_REG_ALARM_D (addr=0x49) */
853#define DA9063_ALARM_DAY_MASK 0x1F 857#define DA9063_ALARM_DAY_MASK 0x1F
854 858
855/* DA9063_REG_ALARM_MO (addr=0x49) */ 859/* DA9063_REG_ALARM_MO (addr=0x4A) */
856#define DA9063_TICK_WAKE 0x20 860#define DA9063_TICK_WAKE 0x20
857#define DA9063_TICK_TYPE 0x10 861#define DA9063_TICK_TYPE 0x10
858#define DA9063_TICK_TYPE_SEC 0x00 862#define DA9063_TICK_TYPE_SEC 0x00
859#define DA9063_TICK_TYPE_MIN 0x10 863#define DA9063_TICK_TYPE_MIN 0x10
860#define DA9063_ALARM_MONTH_MASK 0x0F 864#define DA9063_ALARM_MONTH_MASK 0x0F
861 865
862/* DA9063_REG_ALARM_Y (addr=0x4A) */ 866/* DA9063_REG_ALARM_Y (addr=0x4B) */
863#define DA9063_TICK_ON 0x80 867#define DA9063_TICK_ON 0x80
864#define DA9063_ALARM_ON 0x40 868#define DA9063_ALARM_ON 0x40
865#define DA9063_ALARM_YEAR_MASK 0x3F 869#define DA9063_ALARM_YEAR_MASK 0x3F
@@ -906,7 +910,7 @@
906 910
907/* DA9063_REG_Bxxxx_CFG common bits (addr=0x9D-0xA2) */ 911/* DA9063_REG_Bxxxx_CFG common bits (addr=0x9D-0xA2) */
908#define DA9063_BUCK_FB_MASK 0x07 912#define DA9063_BUCK_FB_MASK 0x07
909#define DA9063_BUCK_PD_DIS_SHIFT 5 913#define DA9063_BUCK_PD_DIS_MASK 0x20
910#define DA9063_BUCK_MODE_MASK 0xC0 914#define DA9063_BUCK_MODE_MASK 0xC0
911#define DA9063_BUCK_MODE_MANUAL 0x00 915#define DA9063_BUCK_MODE_MANUAL 0x00
912#define DA9063_BUCK_MODE_SLEEP 0x40 916#define DA9063_BUCK_MODE_SLEEP 0x40
diff --git a/include/linux/mfd/lpc_ich.h b/include/linux/mfd/lpc_ich.h
index 3e1df644c407..8feac782fa83 100644
--- a/include/linux/mfd/lpc_ich.h
+++ b/include/linux/mfd/lpc_ich.h
@@ -21,23 +21,26 @@
21#define LPC_ICH_H 21#define LPC_ICH_H
22 22
23/* Watchdog resources */ 23/* Watchdog resources */
24#define ICH_RES_IO_TCO 0 24#define ICH_RES_IO_TCO 0
25#define ICH_RES_IO_SMI 1 25#define ICH_RES_IO_SMI 1
26#define ICH_RES_MEM_OFF 2 26#define ICH_RES_MEM_OFF 2
27#define ICH_RES_MEM_GCS 0 27#define ICH_RES_MEM_GCS_PMC 0
28 28
29/* GPIO resources */ 29/* GPIO resources */
30#define ICH_RES_GPIO 0 30#define ICH_RES_GPIO 0
31#define ICH_RES_GPE0 1 31#define ICH_RES_GPE0 1
32 32
33/* GPIO compatibility */ 33/* GPIO compatibility */
34#define ICH_I3100_GPIO 0x401 34enum {
35#define ICH_V5_GPIO 0x501 35 ICH_I3100_GPIO,
36#define ICH_V6_GPIO 0x601 36 ICH_V5_GPIO,
37#define ICH_V7_GPIO 0x701 37 ICH_V6_GPIO,
38#define ICH_V9_GPIO 0x801 38 ICH_V7_GPIO,
39#define ICH_V10CORP_GPIO 0xa01 39 ICH_V9_GPIO,
40#define ICH_V10CONS_GPIO 0xa11 40 ICH_V10CORP_GPIO,
41 ICH_V10CONS_GPIO,
42 AVOTON_GPIO,
43};
41 44
42struct lpc_ich_info { 45struct lpc_ich_info {
43 char name[32]; 46 char name[32];
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h
index a3d0185196d3..c9b332fb0d5d 100644
--- a/include/linux/mfd/max14577-private.h
+++ b/include/linux/mfd/max14577-private.h
@@ -248,14 +248,6 @@ enum max14577_charger_reg {
248/* MAX14577 regulator SFOUT LDO voltage, fixed, uV */ 248/* MAX14577 regulator SFOUT LDO voltage, fixed, uV */
249#define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000 249#define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000
250 250
251enum max14577_irq_source {
252 MAX14577_IRQ_INT1 = 0,
253 MAX14577_IRQ_INT2,
254 MAX14577_IRQ_INT3,
255
256 MAX14577_IRQ_REGS_NUM,
257};
258
259enum max14577_irq { 251enum max14577_irq {
260 /* INT1 */ 252 /* INT1 */
261 MAX14577_IRQ_INT1_ADC, 253 MAX14577_IRQ_INT1_ADC,
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h
index 247b021dfaaf..736d39c3ec0d 100644
--- a/include/linux/mfd/max14577.h
+++ b/include/linux/mfd/max14577.h
@@ -25,13 +25,8 @@
25#ifndef __MAX14577_H__ 25#ifndef __MAX14577_H__
26#define __MAX14577_H__ 26#define __MAX14577_H__
27 27
28#include <linux/mfd/max14577-private.h>
29#include <linux/regulator/consumer.h> 28#include <linux/regulator/consumer.h>
30 29
31/*
32 * MAX14577 Regulator
33 */
34
35/* MAX14577 regulator IDs */ 30/* MAX14577 regulator IDs */
36enum max14577_regulators { 31enum max14577_regulators {
37 MAX14577_SAFEOUT = 0, 32 MAX14577_SAFEOUT = 0,
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index ac39d910e70b..a326c850f046 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -104,6 +104,9 @@ enum {
104 MC13892_LED_R, 104 MC13892_LED_R,
105 MC13892_LED_G, 105 MC13892_LED_G,
106 MC13892_LED_B, 106 MC13892_LED_B,
107 /* MC34708 LED IDs */
108 MC34708_LED_R,
109 MC34708_LED_G,
107}; 110};
108 111
109struct mc13xxx_led_platform_data { 112struct mc13xxx_led_platform_data {
@@ -163,6 +166,9 @@ struct mc13xxx_leds_platform_data {
163#define MC13892_LED_C2_CURRENT_G(x) (((x) & 0x7) << 21) 166#define MC13892_LED_C2_CURRENT_G(x) (((x) & 0x7) << 21)
164/* MC13892 LED Control 3 */ 167/* MC13892 LED Control 3 */
165#define MC13892_LED_C3_CURRENT_B(x) (((x) & 0x7) << 9) 168#define MC13892_LED_C3_CURRENT_B(x) (((x) & 0x7) << 9)
169/* MC34708 LED Control 0 */
170#define MC34708_LED_C0_CURRENT_R(x) (((x) & 0x3) << 9)
171#define MC34708_LED_C0_CURRENT_G(x) (((x) & 0x3) << 21)
166 u32 led_control[MAX_LED_CONTROL_REGS]; 172 u32 led_control[MAX_LED_CONTROL_REGS];
167}; 173};
168 174
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h
deleted file mode 100644
index f83d6b43ecbb..000000000000
--- a/include/linux/mfd/pm8xxx/irq.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13/*
14 * Qualcomm PMIC irq 8xxx driver header file
15 *
16 */
17
18#ifndef __MFD_PM8XXX_IRQ_H
19#define __MFD_PM8XXX_IRQ_H
20
21#include <linux/errno.h>
22#include <linux/err.h>
23
24struct pm8xxx_irq_core_data {
25 u32 rev;
26 int nirqs;
27};
28
29struct pm8xxx_irq_platform_data {
30 int irq_base;
31 struct pm8xxx_irq_core_data irq_cdata;
32 int devirq;
33 int irq_trigger_flag;
34};
35
36struct pm_irq_chip;
37
38#ifdef CONFIG_MFD_PM8XXX_IRQ
39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
40struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
41 const struct pm8xxx_irq_platform_data *pdata);
42int pm8xxx_irq_exit(struct pm_irq_chip *chip);
43#else
44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
45{
46 return -ENXIO;
47}
48static inline struct pm_irq_chip *pm8xxx_irq_init(
49 const struct device *dev,
50 const struct pm8xxx_irq_platform_data *pdata)
51{
52 return ERR_PTR(-ENXIO);
53}
54static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
55{
56 return -ENXIO;
57}
58#endif /* CONFIG_MFD_PM8XXX_IRQ */
59#endif /* __MFD_PM8XXX_IRQ_H */
diff --git a/include/linux/mfd/pm8xxx/pm8921.h b/include/linux/mfd/pm8xxx/pm8921.h
deleted file mode 100644
index 00fa3de7659d..000000000000
--- a/include/linux/mfd/pm8xxx/pm8921.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13/*
14 * Qualcomm PMIC 8921 driver header file
15 *
16 */
17
18#ifndef __MFD_PM8921_H
19#define __MFD_PM8921_H
20
21#include <linux/mfd/pm8xxx/irq.h>
22
23#define PM8921_NR_IRQS 256
24
25struct pm8921_platform_data {
26 int irq_base;
27 struct pm8xxx_irq_platform_data *irq_pdata;
28};
29
30#endif
diff --git a/include/linux/mfd/rtsx_common.h b/include/linux/mfd/rtsx_common.h
index 443176ee1ab0..7c36cc55d2c7 100644
--- a/include/linux/mfd/rtsx_common.h
+++ b/include/linux/mfd/rtsx_common.h
@@ -45,6 +45,7 @@ struct platform_device;
45struct rtsx_slot { 45struct rtsx_slot {
46 struct platform_device *p_dev; 46 struct platform_device *p_dev;
47 void (*card_event)(struct platform_device *p_dev); 47 void (*card_event)(struct platform_device *p_dev);
48 void (*done_transfer)(struct platform_device *p_dev);
48}; 49};
49 50
50#endif 51#endif
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index 0ce772105508..8d6bbd609ad9 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -144,7 +144,7 @@
144#define HOST_TO_DEVICE 0 144#define HOST_TO_DEVICE 0
145#define DEVICE_TO_HOST 1 145#define DEVICE_TO_HOST 1
146 146
147#define MAX_PHASE 31 147#define RTSX_PHASE_MAX 32
148#define RX_TUNING_CNT 3 148#define RX_TUNING_CNT 3
149 149
150/* SG descriptor */ 150/* SG descriptor */
@@ -943,6 +943,12 @@ void rtsx_pci_send_cmd_no_wait(struct rtsx_pcr *pcr);
943int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout); 943int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout);
944int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist, 944int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist,
945 int num_sg, bool read, int timeout); 945 int num_sg, bool read, int timeout);
946int rtsx_pci_dma_map_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist,
947 int num_sg, bool read);
948int rtsx_pci_dma_unmap_sg(struct rtsx_pcr *pcr, struct scatterlist *sglist,
949 int num_sg, bool read);
950int rtsx_pci_dma_transfer(struct rtsx_pcr *pcr, struct scatterlist *sglist,
951 int sg_count, bool read);
946int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len); 952int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
947int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len); 953int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
948int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card); 954int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card);
diff --git a/include/linux/mfd/rtsx_usb.h b/include/linux/mfd/rtsx_usb.h
new file mode 100644
index 000000000000..c446e4fd6b5c
--- /dev/null
+++ b/include/linux/mfd/rtsx_usb.h
@@ -0,0 +1,628 @@
1/* Driver for Realtek RTS5139 USB card reader
2 *
3 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, see <http://www.gnu.org/licenses/>.
16 *
17 * Author:
18 * Roger Tseng <rogerable@realtek.com>
19 */
20
21#ifndef __RTSX_USB_H
22#define __RTSX_USB_H
23
24#include <linux/usb.h>
25
26/* related module names */
27#define RTSX_USB_SD_CARD 0
28#define RTSX_USB_MS_CARD 1
29
30/* endpoint numbers */
31#define EP_BULK_OUT 1
32#define EP_BULK_IN 2
33#define EP_INTR_IN 3
34
35/* USB vendor requests */
36#define RTSX_USB_REQ_REG_OP 0x00
37#define RTSX_USB_REQ_POLL 0x02
38
39/* miscellaneous parameters */
40#define MIN_DIV_N 60
41#define MAX_DIV_N 120
42
43#define MAX_PHASE 15
44#define RX_TUNING_CNT 3
45
46#define QFN24 0
47#define LQFP48 1
48#define CHECK_PKG(ucr, pkg) ((ucr)->package == (pkg))
49
50/* data structures */
51struct rtsx_ucr {
52 u16 vendor_id;
53 u16 product_id;
54
55 int package;
56 u8 ic_version;
57 bool is_rts5179;
58
59 unsigned int cur_clk;
60
61 u8 *cmd_buf;
62 unsigned int cmd_idx;
63 u8 *rsp_buf;
64
65 struct usb_device *pusb_dev;
66 struct usb_interface *pusb_intf;
67 struct usb_sg_request current_sg;
68 unsigned char *iobuf;
69 dma_addr_t iobuf_dma;
70
71 struct timer_list sg_timer;
72 struct mutex dev_mutex;
73};
74
75/* buffer size */
76#define IOBUF_SIZE 1024
77
78/* prototypes of exported functions */
79extern int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status);
80
81extern int rtsx_usb_read_register(struct rtsx_ucr *ucr, u16 addr, u8 *data);
82extern int rtsx_usb_write_register(struct rtsx_ucr *ucr, u16 addr, u8 mask,
83 u8 data);
84
85extern int rtsx_usb_ep0_write_register(struct rtsx_ucr *ucr, u16 addr, u8 mask,
86 u8 data);
87extern int rtsx_usb_ep0_read_register(struct rtsx_ucr *ucr, u16 addr,
88 u8 *data);
89
90extern void rtsx_usb_add_cmd(struct rtsx_ucr *ucr, u8 cmd_type,
91 u16 reg_addr, u8 mask, u8 data);
92extern int rtsx_usb_send_cmd(struct rtsx_ucr *ucr, u8 flag, int timeout);
93extern int rtsx_usb_get_rsp(struct rtsx_ucr *ucr, int rsp_len, int timeout);
94extern int rtsx_usb_transfer_data(struct rtsx_ucr *ucr, unsigned int pipe,
95 void *buf, unsigned int len, int use_sg,
96 unsigned int *act_len, int timeout);
97
98extern int rtsx_usb_read_ppbuf(struct rtsx_ucr *ucr, u8 *buf, int buf_len);
99extern int rtsx_usb_write_ppbuf(struct rtsx_ucr *ucr, u8 *buf, int buf_len);
100extern int rtsx_usb_switch_clock(struct rtsx_ucr *ucr, unsigned int card_clock,
101 u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
102extern int rtsx_usb_card_exclusive_check(struct rtsx_ucr *ucr, int card);
103
104/* card status */
105#define SD_CD 0x01
106#define MS_CD 0x02
107#define XD_CD 0x04
108#define CD_MASK (SD_CD | MS_CD | XD_CD)
109#define SD_WP 0x08
110
111/* reader command field offset & parameters */
112#define READ_REG_CMD 0
113#define WRITE_REG_CMD 1
114#define CHECK_REG_CMD 2
115
116#define PACKET_TYPE 4
117#define CNT_H 5
118#define CNT_L 6
119#define STAGE_FLAG 7
120#define CMD_OFFSET 8
121#define SEQ_WRITE_DATA_OFFSET 12
122
123#define BATCH_CMD 0
124#define SEQ_READ 1
125#define SEQ_WRITE 2
126
127#define STAGE_R 0x01
128#define STAGE_DI 0x02
129#define STAGE_DO 0x04
130#define STAGE_MS_STATUS 0x08
131#define STAGE_XD_STATUS 0x10
132#define MODE_C 0x00
133#define MODE_CR (STAGE_R)
134#define MODE_CDIR (STAGE_R | STAGE_DI)
135#define MODE_CDOR (STAGE_R | STAGE_DO)
136
137#define EP0_OP_SHIFT 14
138#define EP0_READ_REG_CMD 2
139#define EP0_WRITE_REG_CMD 3
140
141#define rtsx_usb_cmd_hdr_tag(ucr) \
142 do { \
143 ucr->cmd_buf[0] = 'R'; \
144 ucr->cmd_buf[1] = 'T'; \
145 ucr->cmd_buf[2] = 'C'; \
146 ucr->cmd_buf[3] = 'R'; \
147 } while (0)
148
149static inline void rtsx_usb_init_cmd(struct rtsx_ucr *ucr)
150{
151 rtsx_usb_cmd_hdr_tag(ucr);
152 ucr->cmd_idx = 0;
153 ucr->cmd_buf[PACKET_TYPE] = BATCH_CMD;
154}
155
156/* internal register address */
157#define FPDCTL 0xFC00
158#define SSC_DIV_N_0 0xFC07
159#define SSC_CTL1 0xFC09
160#define SSC_CTL2 0xFC0A
161#define CFG_MODE 0xFC0E
162#define CFG_MODE_1 0xFC0F
163#define RCCTL 0xFC14
164#define SOF_WDOG 0xFC28
165#define SYS_DUMMY0 0xFC30
166
167#define MS_BLKEND 0xFD30
168#define MS_READ_START 0xFD31
169#define MS_READ_COUNT 0xFD32
170#define MS_WRITE_START 0xFD33
171#define MS_WRITE_COUNT 0xFD34
172#define MS_COMMAND 0xFD35
173#define MS_OLD_BLOCK_0 0xFD36
174#define MS_OLD_BLOCK_1 0xFD37
175#define MS_NEW_BLOCK_0 0xFD38
176#define MS_NEW_BLOCK_1 0xFD39
177#define MS_LOG_BLOCK_0 0xFD3A
178#define MS_LOG_BLOCK_1 0xFD3B
179#define MS_BUS_WIDTH 0xFD3C
180#define MS_PAGE_START 0xFD3D
181#define MS_PAGE_LENGTH 0xFD3E
182#define MS_CFG 0xFD40
183#define MS_TPC 0xFD41
184#define MS_TRANS_CFG 0xFD42
185#define MS_TRANSFER 0xFD43
186#define MS_INT_REG 0xFD44
187#define MS_BYTE_CNT 0xFD45
188#define MS_SECTOR_CNT_L 0xFD46
189#define MS_SECTOR_CNT_H 0xFD47
190#define MS_DBUS_H 0xFD48
191
192#define CARD_DMA1_CTL 0xFD5C
193#define CARD_PULL_CTL1 0xFD60
194#define CARD_PULL_CTL2 0xFD61
195#define CARD_PULL_CTL3 0xFD62
196#define CARD_PULL_CTL4 0xFD63
197#define CARD_PULL_CTL5 0xFD64
198#define CARD_PULL_CTL6 0xFD65
199#define CARD_EXIST 0xFD6F
200#define CARD_INT_PEND 0xFD71
201
202#define LDO_POWER_CFG 0xFD7B
203
204#define SD_CFG1 0xFDA0
205#define SD_CFG2 0xFDA1
206#define SD_CFG3 0xFDA2
207#define SD_STAT1 0xFDA3
208#define SD_STAT2 0xFDA4
209#define SD_BUS_STAT 0xFDA5
210#define SD_PAD_CTL 0xFDA6
211#define SD_SAMPLE_POINT_CTL 0xFDA7
212#define SD_PUSH_POINT_CTL 0xFDA8
213#define SD_CMD0 0xFDA9
214#define SD_CMD1 0xFDAA
215#define SD_CMD2 0xFDAB
216#define SD_CMD3 0xFDAC
217#define SD_CMD4 0xFDAD
218#define SD_CMD5 0xFDAE
219#define SD_BYTE_CNT_L 0xFDAF
220#define SD_BYTE_CNT_H 0xFDB0
221#define SD_BLOCK_CNT_L 0xFDB1
222#define SD_BLOCK_CNT_H 0xFDB2
223#define SD_TRANSFER 0xFDB3
224#define SD_CMD_STATE 0xFDB5
225#define SD_DATA_STATE 0xFDB6
226#define SD_VPCLK0_CTL 0xFC2A
227#define SD_VPCLK1_CTL 0xFC2B
228#define SD_DCMPS0_CTL 0xFC2C
229#define SD_DCMPS1_CTL 0xFC2D
230
231#define CARD_DMA1_CTL 0xFD5C
232
233#define HW_VERSION 0xFC01
234
235#define SSC_CLK_FPGA_SEL 0xFC02
236#define CLK_DIV 0xFC03
237#define SFSM_ED 0xFC04
238
239#define CD_DEGLITCH_WIDTH 0xFC20
240#define CD_DEGLITCH_EN 0xFC21
241#define AUTO_DELINK_EN 0xFC23
242
243#define FPGA_PULL_CTL 0xFC1D
244#define CARD_CLK_SOURCE 0xFC2E
245
246#define CARD_SHARE_MODE 0xFD51
247#define CARD_DRIVE_SEL 0xFD52
248#define CARD_STOP 0xFD53
249#define CARD_OE 0xFD54
250#define CARD_AUTO_BLINK 0xFD55
251#define CARD_GPIO 0xFD56
252#define SD30_DRIVE_SEL 0xFD57
253
254#define CARD_DATA_SOURCE 0xFD5D
255#define CARD_SELECT 0xFD5E
256
257#define CARD_CLK_EN 0xFD79
258#define CARD_PWR_CTL 0xFD7A
259
260#define OCPCTL 0xFD80
261#define OCPPARA1 0xFD81
262#define OCPPARA2 0xFD82
263#define OCPSTAT 0xFD83
264
265#define HS_USB_STAT 0xFE01
266#define HS_VCONTROL 0xFE26
267#define HS_VSTAIN 0xFE27
268#define HS_VLOADM 0xFE28
269#define HS_VSTAOUT 0xFE29
270
271#define MC_IRQ 0xFF00
272#define MC_IRQEN 0xFF01
273#define MC_FIFO_CTL 0xFF02
274#define MC_FIFO_BC0 0xFF03
275#define MC_FIFO_BC1 0xFF04
276#define MC_FIFO_STAT 0xFF05
277#define MC_FIFO_MODE 0xFF06
278#define MC_FIFO_RD_PTR0 0xFF07
279#define MC_FIFO_RD_PTR1 0xFF08
280#define MC_DMA_CTL 0xFF10
281#define MC_DMA_TC0 0xFF11
282#define MC_DMA_TC1 0xFF12
283#define MC_DMA_TC2 0xFF13
284#define MC_DMA_TC3 0xFF14
285#define MC_DMA_RST 0xFF15
286
287#define RBUF_SIZE_MASK 0xFBFF
288#define RBUF_BASE 0xF000
289#define PPBUF_BASE1 0xF800
290#define PPBUF_BASE2 0xFA00
291
292/* internal register value macros */
293#define POWER_OFF 0x03
294#define PARTIAL_POWER_ON 0x02
295#define POWER_ON 0x00
296#define POWER_MASK 0x03
297#define LDO3318_PWR_MASK 0x0C
298#define LDO_ON 0x00
299#define LDO_SUSPEND 0x08
300#define LDO_OFF 0x0C
301#define DV3318_AUTO_PWR_OFF 0x10
302#define FORCE_LDO_POWERB 0x60
303
304/* LDO_POWER_CFG */
305#define TUNE_SD18_MASK 0x1C
306#define TUNE_SD18_1V7 0x00
307#define TUNE_SD18_1V8 (0x01 << 2)
308#define TUNE_SD18_1V9 (0x02 << 2)
309#define TUNE_SD18_2V0 (0x03 << 2)
310#define TUNE_SD18_2V7 (0x04 << 2)
311#define TUNE_SD18_2V8 (0x05 << 2)
312#define TUNE_SD18_2V9 (0x06 << 2)
313#define TUNE_SD18_3V3 (0x07 << 2)
314
315/* CLK_DIV */
316#define CLK_CHANGE 0x80
317#define CLK_DIV_1 0x00
318#define CLK_DIV_2 0x01
319#define CLK_DIV_4 0x02
320#define CLK_DIV_8 0x03
321
322#define SSC_POWER_MASK 0x01
323#define SSC_POWER_DOWN 0x01
324#define SSC_POWER_ON 0x00
325
326#define FPGA_VER 0x80
327#define HW_VER_MASK 0x0F
328
329#define EXTEND_DMA1_ASYNC_SIGNAL 0x02
330
331/* CFG_MODE*/
332#define XTAL_FREE 0x80
333#define CLK_MODE_MASK 0x03
334#define CLK_MODE_12M_XTAL 0x00
335#define CLK_MODE_NON_XTAL 0x01
336#define CLK_MODE_24M_OSC 0x02
337#define CLK_MODE_48M_OSC 0x03
338
339/* CFG_MODE_1*/
340#define RTS5179 0x02
341
342#define NYET_EN 0x01
343#define NYET_MSAK 0x01
344
345#define SD30_DRIVE_MASK 0x07
346#define SD20_DRIVE_MASK 0x03
347
348#define DISABLE_SD_CD 0x08
349#define DISABLE_MS_CD 0x10
350#define DISABLE_XD_CD 0x20
351#define SD_CD_DEGLITCH_EN 0x01
352#define MS_CD_DEGLITCH_EN 0x02
353#define XD_CD_DEGLITCH_EN 0x04
354
355#define CARD_SHARE_LQFP48 0x04
356#define CARD_SHARE_QFN24 0x00
357#define CARD_SHARE_LQFP_SEL 0x04
358#define CARD_SHARE_XD 0x00
359#define CARD_SHARE_SD 0x01
360#define CARD_SHARE_MS 0x02
361#define CARD_SHARE_MASK 0x03
362
363
364/* SD30_DRIVE_SEL */
365#define DRIVER_TYPE_A 0x05
366#define DRIVER_TYPE_B 0x03
367#define DRIVER_TYPE_C 0x02
368#define DRIVER_TYPE_D 0x01
369
370/* SD_BUS_STAT */
371#define SD_CLK_TOGGLE_EN 0x80
372#define SD_CLK_FORCE_STOP 0x40
373#define SD_DAT3_STATUS 0x10
374#define SD_DAT2_STATUS 0x08
375#define SD_DAT1_STATUS 0x04
376#define SD_DAT0_STATUS 0x02
377#define SD_CMD_STATUS 0x01
378
379/* SD_PAD_CTL */
380#define SD_IO_USING_1V8 0x80
381#define SD_IO_USING_3V3 0x7F
382#define TYPE_A_DRIVING 0x00
383#define TYPE_B_DRIVING 0x01
384#define TYPE_C_DRIVING 0x02
385#define TYPE_D_DRIVING 0x03
386
387/* CARD_CLK_EN */
388#define SD_CLK_EN 0x04
389#define MS_CLK_EN 0x08
390
391/* CARD_SELECT */
392#define SD_MOD_SEL 2
393#define MS_MOD_SEL 3
394
395/* CARD_SHARE_MODE */
396#define CARD_SHARE_LQFP48 0x04
397#define CARD_SHARE_QFN24 0x00
398#define CARD_SHARE_LQFP_SEL 0x04
399#define CARD_SHARE_XD 0x00
400#define CARD_SHARE_SD 0x01
401#define CARD_SHARE_MS 0x02
402#define CARD_SHARE_MASK 0x03
403
404/* SSC_CTL1 */
405#define SSC_RSTB 0x80
406#define SSC_8X_EN 0x40
407#define SSC_FIX_FRAC 0x20
408#define SSC_SEL_1M 0x00
409#define SSC_SEL_2M 0x08
410#define SSC_SEL_4M 0x10
411#define SSC_SEL_8M 0x18
412
413/* SSC_CTL2 */
414#define SSC_DEPTH_MASK 0x03
415#define SSC_DEPTH_DISALBE 0x00
416#define SSC_DEPTH_2M 0x01
417#define SSC_DEPTH_1M 0x02
418#define SSC_DEPTH_512K 0x03
419
420/* SD_VPCLK0_CTL */
421#define PHASE_CHANGE 0x80
422#define PHASE_NOT_RESET 0x40
423
424/* SD_TRANSFER */
425#define SD_TRANSFER_START 0x80
426#define SD_TRANSFER_END 0x40
427#define SD_STAT_IDLE 0x20
428#define SD_TRANSFER_ERR 0x10
429#define SD_TM_NORMAL_WRITE 0x00
430#define SD_TM_AUTO_WRITE_3 0x01
431#define SD_TM_AUTO_WRITE_4 0x02
432#define SD_TM_AUTO_READ_3 0x05
433#define SD_TM_AUTO_READ_4 0x06
434#define SD_TM_CMD_RSP 0x08
435#define SD_TM_AUTO_WRITE_1 0x09
436#define SD_TM_AUTO_WRITE_2 0x0A
437#define SD_TM_NORMAL_READ 0x0C
438#define SD_TM_AUTO_READ_1 0x0D
439#define SD_TM_AUTO_READ_2 0x0E
440#define SD_TM_AUTO_TUNING 0x0F
441
442/* SD_CFG1 */
443#define SD_CLK_DIVIDE_0 0x00
444#define SD_CLK_DIVIDE_256 0xC0
445#define SD_CLK_DIVIDE_128 0x80
446#define SD_CLK_DIVIDE_MASK 0xC0
447#define SD_BUS_WIDTH_1BIT 0x00
448#define SD_BUS_WIDTH_4BIT 0x01
449#define SD_BUS_WIDTH_8BIT 0x02
450#define SD_ASYNC_FIFO_RST 0x10
451#define SD_20_MODE 0x00
452#define SD_DDR_MODE 0x04
453#define SD_30_MODE 0x08
454
455/* SD_CFG2 */
456#define SD_CALCULATE_CRC7 0x00
457#define SD_NO_CALCULATE_CRC7 0x80
458#define SD_CHECK_CRC16 0x00
459#define SD_NO_CHECK_CRC16 0x40
460#define SD_WAIT_CRC_TO_EN 0x20
461#define SD_WAIT_BUSY_END 0x08
462#define SD_NO_WAIT_BUSY_END 0x00
463#define SD_CHECK_CRC7 0x00
464#define SD_NO_CHECK_CRC7 0x04
465#define SD_RSP_LEN_0 0x00
466#define SD_RSP_LEN_6 0x01
467#define SD_RSP_LEN_17 0x02
468#define SD_RSP_TYPE_R0 0x04
469#define SD_RSP_TYPE_R1 0x01
470#define SD_RSP_TYPE_R1b 0x09
471#define SD_RSP_TYPE_R2 0x02
472#define SD_RSP_TYPE_R3 0x05
473#define SD_RSP_TYPE_R4 0x05
474#define SD_RSP_TYPE_R5 0x01
475#define SD_RSP_TYPE_R6 0x01
476#define SD_RSP_TYPE_R7 0x01
477
478/* SD_STAT1 */
479#define SD_CRC7_ERR 0x80
480#define SD_CRC16_ERR 0x40
481#define SD_CRC_WRITE_ERR 0x20
482#define SD_CRC_WRITE_ERR_MASK 0x1C
483#define GET_CRC_TIME_OUT 0x02
484#define SD_TUNING_COMPARE_ERR 0x01
485
486/* SD_DATA_STATE */
487#define SD_DATA_IDLE 0x80
488
489/* CARD_DATA_SOURCE */
490#define PINGPONG_BUFFER 0x01
491#define RING_BUFFER 0x00
492
493/* CARD_OE */
494#define SD_OUTPUT_EN 0x04
495#define MS_OUTPUT_EN 0x08
496
497/* CARD_STOP */
498#define SD_STOP 0x04
499#define MS_STOP 0x08
500#define SD_CLR_ERR 0x40
501#define MS_CLR_ERR 0x80
502
503/* CARD_CLK_SOURCE */
504#define CRC_FIX_CLK (0x00 << 0)
505#define CRC_VAR_CLK0 (0x01 << 0)
506#define CRC_VAR_CLK1 (0x02 << 0)
507#define SD30_FIX_CLK (0x00 << 2)
508#define SD30_VAR_CLK0 (0x01 << 2)
509#define SD30_VAR_CLK1 (0x02 << 2)
510#define SAMPLE_FIX_CLK (0x00 << 4)
511#define SAMPLE_VAR_CLK0 (0x01 << 4)
512#define SAMPLE_VAR_CLK1 (0x02 << 4)
513
514/* SD_SAMPLE_POINT_CTL */
515#define DDR_FIX_RX_DAT 0x00
516#define DDR_VAR_RX_DAT 0x80
517#define DDR_FIX_RX_DAT_EDGE 0x00
518#define DDR_FIX_RX_DAT_14_DELAY 0x40
519#define DDR_FIX_RX_CMD 0x00
520#define DDR_VAR_RX_CMD 0x20
521#define DDR_FIX_RX_CMD_POS_EDGE 0x00
522#define DDR_FIX_RX_CMD_14_DELAY 0x10
523#define SD20_RX_POS_EDGE 0x00
524#define SD20_RX_14_DELAY 0x08
525#define SD20_RX_SEL_MASK 0x08
526
527/* SD_PUSH_POINT_CTL */
528#define DDR_FIX_TX_CMD_DAT 0x00
529#define DDR_VAR_TX_CMD_DAT 0x80
530#define DDR_FIX_TX_DAT_14_TSU 0x00
531#define DDR_FIX_TX_DAT_12_TSU 0x40
532#define DDR_FIX_TX_CMD_NEG_EDGE 0x00
533#define DDR_FIX_TX_CMD_14_AHEAD 0x20
534#define SD20_TX_NEG_EDGE 0x00
535#define SD20_TX_14_AHEAD 0x10
536#define SD20_TX_SEL_MASK 0x10
537#define DDR_VAR_SDCLK_POL_SWAP 0x01
538
539/* MS_CFG */
540#define SAMPLE_TIME_RISING 0x00
541#define SAMPLE_TIME_FALLING 0x80
542#define PUSH_TIME_DEFAULT 0x00
543#define PUSH_TIME_ODD 0x40
544#define NO_EXTEND_TOGGLE 0x00
545#define EXTEND_TOGGLE_CHK 0x20
546#define MS_BUS_WIDTH_1 0x00
547#define MS_BUS_WIDTH_4 0x10
548#define MS_BUS_WIDTH_8 0x18
549#define MS_2K_SECTOR_MODE 0x04
550#define MS_512_SECTOR_MODE 0x00
551#define MS_TOGGLE_TIMEOUT_EN 0x00
552#define MS_TOGGLE_TIMEOUT_DISEN 0x01
553#define MS_NO_CHECK_INT 0x02
554
555/* MS_TRANS_CFG */
556#define WAIT_INT 0x80
557#define NO_WAIT_INT 0x00
558#define NO_AUTO_READ_INT_REG 0x00
559#define AUTO_READ_INT_REG 0x40
560#define MS_CRC16_ERR 0x20
561#define MS_RDY_TIMEOUT 0x10
562#define MS_INT_CMDNK 0x08
563#define MS_INT_BREQ 0x04
564#define MS_INT_ERR 0x02
565#define MS_INT_CED 0x01
566
567/* MS_TRANSFER */
568#define MS_TRANSFER_START 0x80
569#define MS_TRANSFER_END 0x40
570#define MS_TRANSFER_ERR 0x20
571#define MS_BS_STATE 0x10
572#define MS_TM_READ_BYTES 0x00
573#define MS_TM_NORMAL_READ 0x01
574#define MS_TM_WRITE_BYTES 0x04
575#define MS_TM_NORMAL_WRITE 0x05
576#define MS_TM_AUTO_READ 0x08
577#define MS_TM_AUTO_WRITE 0x0C
578#define MS_TM_SET_CMD 0x06
579#define MS_TM_COPY_PAGE 0x07
580#define MS_TM_MULTI_READ 0x02
581#define MS_TM_MULTI_WRITE 0x03
582
583/* MC_FIFO_CTL */
584#define FIFO_FLUSH 0x01
585
586/* MC_DMA_RST */
587#define DMA_RESET 0x01
588
589/* MC_DMA_CTL */
590#define DMA_TC_EQ_0 0x80
591#define DMA_DIR_TO_CARD 0x00
592#define DMA_DIR_FROM_CARD 0x02
593#define DMA_EN 0x01
594#define DMA_128 (0 << 2)
595#define DMA_256 (1 << 2)
596#define DMA_512 (2 << 2)
597#define DMA_1024 (3 << 2)
598#define DMA_PACK_SIZE_MASK 0x0C
599
600/* CARD_INT_PEND */
601#define XD_INT 0x10
602#define MS_INT 0x08
603#define SD_INT 0x04
604
605/* LED operations*/
606static inline int rtsx_usb_turn_on_led(struct rtsx_ucr *ucr)
607{
608 return rtsx_usb_ep0_write_register(ucr, CARD_GPIO, 0x03, 0x02);
609}
610
611static inline int rtsx_usb_turn_off_led(struct rtsx_ucr *ucr)
612{
613 return rtsx_usb_ep0_write_register(ucr, CARD_GPIO, 0x03, 0x03);
614}
615
616/* HW error clearing */
617static inline void rtsx_usb_clear_fsm_err(struct rtsx_ucr *ucr)
618{
619 rtsx_usb_ep0_write_register(ucr, SFSM_ED, 0xf8, 0xf8);
620}
621
622static inline void rtsx_usb_clear_dma_err(struct rtsx_ucr *ucr)
623{
624 rtsx_usb_ep0_write_register(ucr, MC_FIFO_CTL,
625 FIFO_FLUSH, FIFO_FLUSH);
626 rtsx_usb_ep0_write_register(ucr, MC_DMA_RST, DMA_RESET, DMA_RESET);
627}
628#endif /* __RTS51139_H */
diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
new file mode 100644
index 000000000000..d2e357df5a0e
--- /dev/null
+++ b/include/linux/mfd/tps65218.h
@@ -0,0 +1,284 @@
1/*
2 * linux/mfd/tps65218.h
3 *
4 * Functions to access TPS65219 power management chip.
5 *
6 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether expressed or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License version 2 for more details.
16 */
17
18#ifndef __LINUX_MFD_TPS65218_H
19#define __LINUX_MFD_TPS65218_H
20
21#include <linux/i2c.h>
22#include <linux/regulator/driver.h>
23#include <linux/regulator/machine.h>
24#include <linux/bitops.h>
25
26/* TPS chip id list */
27#define TPS65218 0xF0
28
29/* I2C ID for TPS65218 part */
30#define TPS65218_I2C_ID 0x24
31
32/* All register addresses */
33#define TPS65218_REG_CHIPID 0x00
34#define TPS65218_REG_INT1 0x01
35#define TPS65218_REG_INT2 0x02
36#define TPS65218_REG_INT_MASK1 0x03
37#define TPS65218_REG_INT_MASK2 0x04
38#define TPS65218_REG_STATUS 0x05
39#define TPS65218_REG_CONTROL 0x06
40#define TPS65218_REG_FLAG 0x07
41
42#define TPS65218_REG_PASSWORD 0x10
43#define TPS65218_REG_ENABLE1 0x11
44#define TPS65218_REG_ENABLE2 0x12
45#define TPS65218_REG_CONFIG1 0x13
46#define TPS65218_REG_CONFIG2 0x14
47#define TPS65218_REG_CONFIG3 0x15
48#define TPS65218_REG_CONTROL_DCDC1 0x16
49#define TPS65218_REG_CONTROL_DCDC2 0x17
50#define TPS65218_REG_CONTROL_DCDC3 0x18
51#define TPS65218_REG_CONTROL_DCDC4 0x19
52#define TPS65218_REG_CONTRL_SLEW_RATE 0x1A
53#define TPS65218_REG_CONTROL_LDO1 0x1B
54#define TPS65218_REG_SEQ1 0x20
55#define TPS65218_REG_SEQ2 0x21
56#define TPS65218_REG_SEQ3 0x22
57#define TPS65218_REG_SEQ4 0x23
58#define TPS65218_REG_SEQ5 0x24
59#define TPS65218_REG_SEQ6 0x25
60#define TPS65218_REG_SEQ7 0x26
61
62/* Register field definitions */
63#define TPS65218_CHIPID_CHIP_MASK 0xF8
64#define TPS65218_CHIPID_REV_MASK 0x07
65
66#define TPS65218_INT1_VPRG BIT(5)
67#define TPS65218_INT1_AC BIT(4)
68#define TPS65218_INT1_PB BIT(3)
69#define TPS65218_INT1_HOT BIT(2)
70#define TPS65218_INT1_CC_AQC BIT(1)
71#define TPS65218_INT1_PRGC BIT(0)
72
73#define TPS65218_INT2_LS3_F BIT(5)
74#define TPS65218_INT2_LS2_F BIT(4)
75#define TPS65218_INT2_LS1_F BIT(3)
76#define TPS65218_INT2_LS3_I BIT(2)
77#define TPS65218_INT2_LS2_I BIT(1)
78#define TPS65218_INT2_LS1_I BIT(0)
79
80#define TPS65218_INT_MASK1_VPRG BIT(5)
81#define TPS65218_INT_MASK1_AC BIT(4)
82#define TPS65218_INT_MASK1_PB BIT(3)
83#define TPS65218_INT_MASK1_HOT BIT(2)
84#define TPS65218_INT_MASK1_CC_AQC BIT(1)
85#define TPS65218_INT_MASK1_PRGC BIT(0)
86
87#define TPS65218_INT_MASK2_LS3_F BIT(5)
88#define TPS65218_INT_MASK2_LS2_F BIT(4)
89#define TPS65218_INT_MASK2_LS1_F BIT(3)
90#define TPS65218_INT_MASK2_LS3_I BIT(2)
91#define TPS65218_INT_MASK2_LS2_I BIT(1)
92#define TPS65218_INT_MASK2_LS1_I BIT(0)
93
94#define TPS65218_STATUS_FSEAL BIT(7)
95#define TPS65218_STATUS_EE BIT(6)
96#define TPS65218_STATUS_AC_STATE BIT(5)
97#define TPS65218_STATUS_PB_STATE BIT(4)
98#define TPS65218_STATUS_STATE_MASK 0xC
99#define TPS65218_STATUS_CC_STAT 0x3
100
101#define TPS65218_CONTROL_OFFNPFO BIT(1)
102#define TPS65218_CONTROL_CC_AQ BIT(0)
103
104#define TPS65218_FLAG_GPO3_FLG BIT(7)
105#define TPS65218_FLAG_GPO2_FLG BIT(6)
106#define TPS65218_FLAG_GPO1_FLG BIT(5)
107#define TPS65218_FLAG_LDO1_FLG BIT(4)
108#define TPS65218_FLAG_DC4_FLG BIT(3)
109#define TPS65218_FLAG_DC3_FLG BIT(2)
110#define TPS65218_FLAG_DC2_FLG BIT(1)
111#define TPS65218_FLAG_DC1_FLG BIT(0)
112
113#define TPS65218_ENABLE1_DC6_EN BIT(5)
114#define TPS65218_ENABLE1_DC5_EN BIT(4)
115#define TPS65218_ENABLE1_DC4_EN BIT(3)
116#define TPS65218_ENABLE1_DC3_EN BIT(2)
117#define TPS65218_ENABLE1_DC2_EN BIT(1)
118#define TPS65218_ENABLE1_DC1_EN BIT(0)
119
120#define TPS65218_ENABLE2_GPIO3 BIT(6)
121#define TPS65218_ENABLE2_GPIO2 BIT(5)
122#define TPS65218_ENABLE2_GPIO1 BIT(4)
123#define TPS65218_ENABLE2_LS3_EN BIT(3)
124#define TPS65218_ENABLE2_LS2_EN BIT(2)
125#define TPS65218_ENABLE2_LS1_EN BIT(1)
126#define TPS65218_ENABLE2_LDO1_EN BIT(0)
127
128
129#define TPS65218_CONFIG1_TRST BIT(7)
130#define TPS65218_CONFIG1_GPO2_BUF BIT(6)
131#define TPS65218_CONFIG1_IO1_SEL BIT(5)
132#define TPS65218_CONFIG1_PGDLY_MASK 0x18
133#define TPS65218_CONFIG1_STRICT BIT(2)
134#define TPS65218_CONFIG1_UVLO_MASK 0x3
135
136#define TPS65218_CONFIG2_DC12_RST BIT(7)
137#define TPS65218_CONFIG2_UVLOHYS BIT(6)
138#define TPS65218_CONFIG2_LS3ILIM_MASK 0xC
139#define TPS65218_CONFIG2_LS2ILIM_MASK 0x3
140
141#define TPS65218_CONFIG3_LS3NPFO BIT(5)
142#define TPS65218_CONFIG3_LS2NPFO BIT(4)
143#define TPS65218_CONFIG3_LS1NPFO BIT(3)
144#define TPS65218_CONFIG3_LS3DCHRG BIT(2)
145#define TPS65218_CONFIG3_LS2DCHRG BIT(1)
146#define TPS65218_CONFIG3_LS1DCHRG BIT(0)
147
148#define TPS65218_CONTROL_DCDC1_PFM BIT(7)
149#define TPS65218_CONTROL_DCDC1_MASK 0x7F
150
151#define TPS65218_CONTROL_DCDC2_PFM BIT(7)
152#define TPS65218_CONTROL_DCDC2_MASK 0x3F
153
154#define TPS65218_CONTROL_DCDC3_PFM BIT(7)
155#define TPS65218_CONTROL_DCDC3_MASK 0x3F
156
157#define TPS65218_CONTROL_DCDC4_PFM BIT(7)
158#define TPS65218_CONTROL_DCDC4_MASK 0x3F
159
160#define TPS65218_SLEW_RATE_GO BIT(7)
161#define TPS65218_SLEW_RATE_GODSBL BIT(6)
162#define TPS65218_SLEW_RATE_SLEW_MASK 0x7
163
164#define TPS65218_CONTROL_LDO1_MASK 0x3F
165
166#define TPS65218_SEQ1_DLY8 BIT(7)
167#define TPS65218_SEQ1_DLY7 BIT(6)
168#define TPS65218_SEQ1_DLY6 BIT(5)
169#define TPS65218_SEQ1_DLY5 BIT(4)
170#define TPS65218_SEQ1_DLY4 BIT(3)
171#define TPS65218_SEQ1_DLY3 BIT(2)
172#define TPS65218_SEQ1_DLY2 BIT(1)
173#define TPS65218_SEQ1_DLY1 BIT(0)
174
175#define TPS65218_SEQ2_DLYFCTR BIT(7)
176#define TPS65218_SEQ2_DLY9 BIT(0)
177
178#define TPS65218_SEQ3_DC2_SEQ_MASK 0xF0
179#define TPS65218_SEQ3_DC1_SEQ_MASK 0xF
180
181#define TPS65218_SEQ4_DC4_SEQ_MASK 0xF0
182#define TPS65218_SEQ4_DC3_SEQ_MASK 0xF
183
184#define TPS65218_SEQ5_DC6_SEQ_MASK 0xF0
185#define TPS65218_SEQ5_DC5_SEQ_MASK 0xF
186
187#define TPS65218_SEQ6_LS1_SEQ_MASK 0xF0
188#define TPS65218_SEQ6_LDO1_SEQ_MASK 0xF
189
190#define TPS65218_SEQ7_GPO3_SEQ_MASK 0xF0
191#define TPS65218_SEQ7_GPO1_SEQ_MASK 0xF
192#define TPS65218_PROTECT_NONE 0
193#define TPS65218_PROTECT_L1 1
194
195enum tps65218_regulator_id {
196 /* DCDC's */
197 TPS65218_DCDC_1,
198 TPS65218_DCDC_2,
199 TPS65218_DCDC_3,
200 TPS65218_DCDC_4,
201 TPS65218_DCDC_5,
202 TPS65218_DCDC_6,
203 /* LDOs */
204 TPS65218_LDO_1,
205};
206
207#define TPS65218_MAX_REG_ID TPS65218_LDO_1
208
209/* Number of step-down converters available */
210#define TPS65218_NUM_DCDC 6
211/* Number of LDO voltage regulators available */
212#define TPS65218_NUM_LDO 1
213/* Number of total regulators available */
214#define TPS65218_NUM_REGULATOR (TPS65218_NUM_DCDC + TPS65218_NUM_LDO)
215
216/* Define the TPS65218 IRQ numbers */
217enum tps65218_irqs {
218 /* INT1 registers */
219 TPS65218_PRGC_IRQ,
220 TPS65218_CC_AQC_IRQ,
221 TPS65218_HOT_IRQ,
222 TPS65218_PB_IRQ,
223 TPS65218_AC_IRQ,
224 TPS65218_VPRG_IRQ,
225 TPS65218_INVALID1_IRQ,
226 TPS65218_INVALID2_IRQ,
227 /* INT2 registers */
228 TPS65218_LS1_I_IRQ,
229 TPS65218_LS2_I_IRQ,
230 TPS65218_LS3_I_IRQ,
231 TPS65218_LS1_F_IRQ,
232 TPS65218_LS2_F_IRQ,
233 TPS65218_LS3_F_IRQ,
234 TPS65218_INVALID3_IRQ,
235 TPS65218_INVALID4_IRQ,
236};
237
238/**
239 * struct tps_info - packages regulator constraints
240 * @id: Id of the regulator
241 * @name: Voltage regulator name
242 * @min_uV: minimum micro volts
243 * @max_uV: minimum micro volts
244 *
245 * This data is used to check the regualtor voltage limits while setting.
246 */
247struct tps_info {
248 int id;
249 const char *name;
250 int min_uV;
251 int max_uV;
252};
253
254/**
255 * struct tps65218 - tps65218 sub-driver chip access routines
256 *
257 * Device data may be used to access the TPS65218 chip
258 */
259
260struct tps65218 {
261 struct device *dev;
262 unsigned int id;
263
264 struct mutex tps_lock; /* lock guarding the data structure */
265 /* IRQ Data */
266 int irq;
267 u32 irq_mask;
268 struct regmap_irq_chip_data *irq_data;
269 struct regulator_desc desc[TPS65218_NUM_REGULATOR];
270 struct regulator_dev *rdev[TPS65218_NUM_REGULATOR];
271 struct tps_info *info[TPS65218_NUM_REGULATOR];
272 struct regmap *regmap;
273};
274
275int tps65218_reg_read(struct tps65218 *tps, unsigned int reg,
276 unsigned int *val);
277int tps65218_reg_write(struct tps65218 *tps, unsigned int reg,
278 unsigned int val, unsigned int level);
279int tps65218_set_bits(struct tps65218 *tps, unsigned int reg,
280 unsigned int mask, unsigned int val, unsigned int level);
281int tps65218_clear_bits(struct tps65218 *tps, unsigned int reg,
282 unsigned int mask, unsigned int level);
283
284#endif /* __LINUX_MFD_TPS65218_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 35300f390eb6..bf9811e1321a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -177,6 +177,9 @@ extern unsigned int kobjsize(const void *objp);
177 */ 177 */
178#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP) 178#define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP)
179 179
180/* This mask defines which mm->def_flags a process can inherit its parent */
181#define VM_INIT_DEF_MASK VM_NOHUGEPAGE
182
180/* 183/*
181 * mapping from the currently active vm_flags protection bits (the 184 * mapping from the currently active vm_flags protection bits (the
182 * low four bits) to a page protection mask.. 185 * low four bits) to a page protection mask..
@@ -210,6 +213,10 @@ struct vm_fault {
210 * is set (which is also implied by 213 * is set (which is also implied by
211 * VM_FAULT_ERROR). 214 * VM_FAULT_ERROR).
212 */ 215 */
216 /* for ->map_pages() only */
217 pgoff_t max_pgoff; /* map pages for offset from pgoff till
218 * max_pgoff inclusive */
219 pte_t *pte; /* pte entry associated with ->pgoff */
213}; 220};
214 221
215/* 222/*
@@ -221,6 +228,7 @@ struct vm_operations_struct {
221 void (*open)(struct vm_area_struct * area); 228 void (*open)(struct vm_area_struct * area);
222 void (*close)(struct vm_area_struct * area); 229 void (*close)(struct vm_area_struct * area);
223 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); 230 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
231 void (*map_pages)(struct vm_area_struct *vma, struct vm_fault *vmf);
224 232
225 /* notification that a previously read-only page is about to become 233 /* notification that a previously read-only page is about to become
226 * writable, if an error is returned it will cause a SIGBUS */ 234 * writable, if an error is returned it will cause a SIGBUS */
@@ -581,6 +589,9 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
581 pte = pte_mkwrite(pte); 589 pte = pte_mkwrite(pte);
582 return pte; 590 return pte;
583} 591}
592
593void do_set_pte(struct vm_area_struct *vma, unsigned long address,
594 struct page *page, pte_t *pte, bool write, bool anon);
584#endif 595#endif
585 596
586/* 597/*
@@ -684,7 +695,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
684#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) 695#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
685#define NODES_MASK ((1UL << NODES_WIDTH) - 1) 696#define NODES_MASK ((1UL << NODES_WIDTH) - 1)
686#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) 697#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
687#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH) - 1) 698#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_SHIFT) - 1)
688#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) 699#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
689 700
690static inline enum zone_type page_zonenum(const struct page *page) 701static inline enum zone_type page_zonenum(const struct page *page)
@@ -1193,6 +1204,7 @@ void account_page_writeback(struct page *page);
1193int set_page_dirty(struct page *page); 1204int set_page_dirty(struct page *page);
1194int set_page_dirty_lock(struct page *page); 1205int set_page_dirty_lock(struct page *page);
1195int clear_page_dirty_for_io(struct page *page); 1206int clear_page_dirty_for_io(struct page *page);
1207int get_cmdline(struct task_struct *task, char *buffer, int buflen);
1196 1208
1197/* Is the vma a continuation of the stack vma above it? */ 1209/* Is the vma a continuation of the stack vma above it? */
1198static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr) 1210static inline int vma_growsdown(struct vm_area_struct *vma, unsigned long addr)
@@ -1836,6 +1848,7 @@ extern void truncate_inode_pages_final(struct address_space *);
1836 1848
1837/* generic vm_area_ops exported for stackable file systems */ 1849/* generic vm_area_ops exported for stackable file systems */
1838extern int filemap_fault(struct vm_area_struct *, struct vm_fault *); 1850extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
1851extern void filemap_map_pages(struct vm_area_struct *vma, struct vm_fault *vmf);
1839extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); 1852extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
1840 1853
1841/* mm/page-writeback.c */ 1854/* mm/page-writeback.c */
@@ -1863,9 +1876,6 @@ void page_cache_async_readahead(struct address_space *mapping,
1863 unsigned long size); 1876 unsigned long size);
1864 1877
1865unsigned long max_sane_readahead(unsigned long nr); 1878unsigned long max_sane_readahead(unsigned long nr);
1866unsigned long ra_submit(struct file_ra_state *ra,
1867 struct address_space *mapping,
1868 struct file *filp);
1869 1879
1870/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ 1880/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */
1871extern int expand_stack(struct vm_area_struct *vma, unsigned long address); 1881extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 290901a8c1de..8967e20cbe57 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -124,6 +124,8 @@ struct page {
124 union { 124 union {
125 struct list_head lru; /* Pageout list, eg. active_list 125 struct list_head lru; /* Pageout list, eg. active_list
126 * protected by zone->lru_lock ! 126 * protected by zone->lru_lock !
127 * Can be used as a generic list
128 * by the page owner.
127 */ 129 */
128 struct { /* slub per cpu partial pages */ 130 struct { /* slub per cpu partial pages */
129 struct page *next; /* Next partial slab */ 131 struct page *next; /* Next partial slab */
@@ -136,7 +138,6 @@ struct page {
136#endif 138#endif
137 }; 139 };
138 140
139 struct list_head list; /* slobs list of pages */
140 struct slab *slab_page; /* slab fields */ 141 struct slab *slab_page; /* slab fields */
141 struct rcu_head rcu_head; /* Used by SLAB 142 struct rcu_head rcu_head; /* Used by SLAB
142 * when destroying via RCU 143 * when destroying via RCU
@@ -342,9 +343,9 @@ struct mm_rss_stat {
342 343
343struct kioctx_table; 344struct kioctx_table;
344struct mm_struct { 345struct mm_struct {
345 struct vm_area_struct * mmap; /* list of VMAs */ 346 struct vm_area_struct *mmap; /* list of VMAs */
346 struct rb_root mm_rb; 347 struct rb_root mm_rb;
347 struct vm_area_struct * mmap_cache; /* last find_vma result */ 348 u32 vmacache_seqnum; /* per-thread vmacache */
348#ifdef CONFIG_MMU 349#ifdef CONFIG_MMU
349 unsigned long (*get_unmapped_area) (struct file *filp, 350 unsigned long (*get_unmapped_area) (struct file *filp,
350 unsigned long addr, unsigned long len, 351 unsigned long addr, unsigned long len,
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 87079fc38011..f206e29f94d7 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -95,7 +95,7 @@ struct mmc_command {
95 * actively failing requests 95 * actively failing requests
96 */ 96 */
97 97
98 unsigned int cmd_timeout_ms; /* in milliseconds */ 98 unsigned int busy_timeout; /* busy detect timeout in ms */
99 /* Set this flag only for blocking sanitize request */ 99 /* Set this flag only for blocking sanitize request */
100 bool sanitize_busy; 100 bool sanitize_busy;
101 101
@@ -152,7 +152,7 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
152 struct mmc_command *, int); 152 struct mmc_command *, int);
153extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); 153extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
154extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool, 154extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool,
155 bool); 155 bool, bool);
156extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); 156extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
157extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd); 157extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd);
158 158
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 99f5709ac343..cb61ea4d6945 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -264,15 +264,12 @@ struct mmc_host {
264 u32 caps2; /* More host capabilities */ 264 u32 caps2; /* More host capabilities */
265 265
266#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ 266#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
267#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
268#define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */ 267#define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */
269#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ 268#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */
270#define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */
271#define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ 269#define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */
272#define MMC_CAP2_HS200_1_2V_SDR (1 << 6) /* can support */ 270#define MMC_CAP2_HS200_1_2V_SDR (1 << 6) /* can support */
273#define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ 271#define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
274 MMC_CAP2_HS200_1_2V_SDR) 272 MMC_CAP2_HS200_1_2V_SDR)
275#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
276#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ 273#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
277#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ 274#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
278#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ 275#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
@@ -281,7 +278,6 @@ struct mmc_host {
281#define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ 278#define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \
282 MMC_CAP2_PACKED_WR) 279 MMC_CAP2_PACKED_WR)
283#define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */ 280#define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */
284#define MMC_CAP2_SANITIZE (1 << 15) /* Support Sanitize */
285 281
286 mmc_pm_flag_t pm_caps; /* supported pm features */ 282 mmc_pm_flag_t pm_caps; /* supported pm features */
287 283
@@ -304,7 +300,7 @@ struct mmc_host {
304 unsigned int max_req_size; /* maximum number of bytes in one req */ 300 unsigned int max_req_size; /* maximum number of bytes in one req */
305 unsigned int max_blk_size; /* maximum size of one mmc block */ 301 unsigned int max_blk_size; /* maximum size of one mmc block */
306 unsigned int max_blk_count; /* maximum number of blocks in one req */ 302 unsigned int max_blk_count; /* maximum number of blocks in one req */
307 unsigned int max_discard_to; /* max. discard timeout in ms */ 303 unsigned int max_busy_timeout; /* max busy timeout in ms */
308 304
309 /* private data */ 305 /* private data */
310 spinlock_t lock; /* lock for claim and bus ops */ 306 spinlock_t lock; /* lock for claim and bus ops */
@@ -388,8 +384,6 @@ int mmc_power_restore_host(struct mmc_host *host);
388void mmc_detect_change(struct mmc_host *, unsigned long delay); 384void mmc_detect_change(struct mmc_host *, unsigned long delay);
389void mmc_request_done(struct mmc_host *, struct mmc_request *); 385void mmc_request_done(struct mmc_host *, struct mmc_request *);
390 386
391int mmc_cache_ctrl(struct mmc_host *, u8);
392
393static inline void mmc_signal_sdio_irq(struct mmc_host *host) 387static inline void mmc_signal_sdio_irq(struct mmc_host *host)
394{ 388{
395 host->ops->enable_sdio_irq(host, 0); 389 host->ops->enable_sdio_irq(host, 0);
@@ -424,12 +418,9 @@ static inline int mmc_regulator_get_supply(struct mmc_host *mmc)
424 418
425int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *); 419int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *);
426 420
427/* Module parameter */
428extern bool mmc_assume_removable;
429
430static inline int mmc_card_is_removable(struct mmc_host *host) 421static inline int mmc_card_is_removable(struct mmc_host *host)
431{ 422{
432 return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; 423 return !(host->caps & MMC_CAP_NONREMOVABLE);
433} 424}
434 425
435static inline int mmc_card_keep_power(struct mmc_host *host) 426static inline int mmc_card_keep_power(struct mmc_host *host)
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h
index e78c0e236e9d..8cc095a76cf8 100644
--- a/include/linux/mmc/sdhci-spear.h
+++ b/include/linux/mmc/sdhci-spear.h
@@ -18,17 +18,9 @@
18/* 18/*
19 * struct sdhci_plat_data: spear sdhci platform data structure 19 * struct sdhci_plat_data: spear sdhci platform data structure
20 * 20 *
21 * @card_power_gpio: gpio pin for enabling/disabling power to sdhci socket
22 * @power_active_high: if set, enable power to sdhci socket by setting
23 * card_power_gpio
24 * @power_always_enb: If set, then enable power on probe, otherwise enable only
25 * on card insertion and disable on card removal.
26 * card_int_gpio: gpio pin used for card detection 21 * card_int_gpio: gpio pin used for card detection
27 */ 22 */
28struct sdhci_plat_data { 23struct sdhci_plat_data {
29 int card_power_gpio;
30 int power_active_high;
31 int power_always_enb;
32 int card_int_gpio; 24 int card_int_gpio;
33}; 25};
34 26
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 362927c48f97..7be12b883485 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -100,6 +100,8 @@ struct sdhci_host {
100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) 100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5)
101/* Controller does not support HS200 */ 101/* Controller does not support HS200 */
102#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6) 102#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6)
103/* Controller does not support DDR50 */
104#define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7)
103 105
104 int irq; /* Device IRQ */ 106 int irq; /* Device IRQ */
105 void __iomem *ioaddr; /* Mapped address */ 107 void __iomem *ioaddr; /* Mapped address */
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
index b0c73e4cacea..d2433381e828 100644
--- a/include/linux/mmc/slot-gpio.h
+++ b/include/linux/mmc/slot-gpio.h
@@ -22,4 +22,10 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio,
22 unsigned int debounce); 22 unsigned int debounce);
23void mmc_gpio_free_cd(struct mmc_host *host); 23void mmc_gpio_free_cd(struct mmc_host *host);
24 24
25int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
26 unsigned int idx, bool override_active_level,
27 unsigned int debounce);
28void mmc_gpiod_free_cd(struct mmc_host *host);
29void mmc_gpiod_request_cd_irq(struct mmc_host *host);
30
25#endif 31#endif
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 5042c036dda9..2d57efa64cc1 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -3,8 +3,8 @@
3 3
4struct page; 4struct page;
5 5
6extern void dump_page(struct page *page, char *reason); 6extern void dump_page(struct page *page, const char *reason);
7extern void dump_page_badflags(struct page *page, char *reason, 7extern void dump_page_badflags(struct page *page, const char *reason,
8 unsigned long badflags); 8 unsigned long badflags);
9 9
10#ifdef CONFIG_DEBUG_VM 10#ifdef CONFIG_DEBUG_VM
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 9a165a213d93..44eeef0da186 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -556,6 +556,11 @@ struct amba_id {
556 * See documentation of "x86_match_cpu" for details. 556 * See documentation of "x86_match_cpu" for details.
557 */ 557 */
558 558
559/*
560 * MODULE_DEVICE_TABLE expects this struct to be called x86cpu_device_id.
561 * Although gcc seems to ignore this error, clang fails without this define.
562 */
563#define x86cpu_device_id x86_cpu_id
559struct x86_cpu_id { 564struct x86_cpu_id {
560 __u16 vendor; 565 __u16 vendor;
561 __u16 family; 566 __u16 family;
diff --git a/include/linux/module.h b/include/linux/module.h
index 5a5053975114..f520a767c86c 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -82,15 +82,6 @@ void sort_extable(struct exception_table_entry *start,
82void sort_main_extable(void); 82void sort_main_extable(void);
83void trim_init_extable(struct module *m); 83void trim_init_extable(struct module *m);
84 84
85#ifdef MODULE
86#define MODULE_GENERIC_TABLE(gtype, name) \
87extern const struct gtype##_id __mod_##gtype##_table \
88 __attribute__ ((unused, alias(__stringify(name))))
89
90#else /* !MODULE */
91#define MODULE_GENERIC_TABLE(gtype, name)
92#endif
93
94/* Generic info of form tag = "info" */ 85/* Generic info of form tag = "info" */
95#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) 86#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
96 87
@@ -141,8 +132,14 @@ extern const struct gtype##_id __mod_##gtype##_table \
141/* What your module does. */ 132/* What your module does. */
142#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 133#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
143 134
144#define MODULE_DEVICE_TABLE(type, name) \ 135#ifdef MODULE
145 MODULE_GENERIC_TABLE(type##_device, name) 136/* Creates an alias so file2alias.c can find device table. */
137#define MODULE_DEVICE_TABLE(type, name) \
138 extern const struct type##_device_id __mod_##type##__##name##_device_table \
139 __attribute__ ((unused, alias(__stringify(name))))
140#else /* !MODULE */
141#define MODULE_DEVICE_TABLE(type, name)
142#endif
146 143
147/* Version of form [<epoch>:]<version>[-<extra-version>]. 144/* Version of form [<epoch>:]<version>[-<extra-version>].
148 * Or for CVS/RCS ID version, everything but the number is stripped. 145 * Or for CVS/RCS ID version, everything but the number is stripped.
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index c3eb102a9cc8..204a67743804 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -186,14 +186,12 @@ struct kparam_array
186 parameters. */ 186 parameters. */
187#define __module_param_call(prefix, name, ops, arg, perm, level) \ 187#define __module_param_call(prefix, name, ops, arg, perm, level) \
188 /* Default value instead of permissions? */ \ 188 /* Default value instead of permissions? */ \
189 static int __param_perm_check_##name __attribute__((unused)) = \ 189 static const char __param_str_##name[] = prefix #name; \
190 BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \
191 + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \
192 static const char __param_str_##name[] = prefix #name; \
193 static struct kernel_param __moduleparam_const __param_##name \ 190 static struct kernel_param __moduleparam_const __param_##name \
194 __used \ 191 __used \
195 __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ 192 __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
196 = { __param_str_##name, ops, perm, level, { arg } } 193 = { __param_str_##name, ops, VERIFY_OCTAL_PERMISSIONS(perm), \
194 level, { arg } }
197 195
198/* Obsolete - use module_param_cb() */ 196/* Obsolete - use module_param_cb() */
199#define module_param_call(name, set, get, arg, perm) \ 197#define module_param_call(name, set, get, arg, perm) \
@@ -346,7 +344,7 @@ static inline void destroy_params(const struct kernel_param *params,
346/* The macros to do compile-time type checking stolen from Jakub 344/* The macros to do compile-time type checking stolen from Jakub
347 Jelinek, who IIRC came up with this idea for the 2.4 module init code. */ 345 Jelinek, who IIRC came up with this idea for the 2.4 module init code. */
348#define __param_check(name, p, type) \ 346#define __param_check(name, p, type) \
349 static inline type *__check_##name(void) { return(p); } 347 static inline type __always_unused *__check_##name(void) { return(p); }
350 348
351extern struct kernel_param_ops param_ops_byte; 349extern struct kernel_param_ops param_ops_byte;
352extern int param_set_byte(const char *val, const struct kernel_param *kp); 350extern int param_set_byte(const char *val, const struct kernel_param *kp);
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 371d346fa270..839bac270904 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -44,6 +44,8 @@ struct mnt_namespace;
44#define MNT_SHARED_MASK (MNT_UNBINDABLE) 44#define MNT_SHARED_MASK (MNT_UNBINDABLE)
45#define MNT_PROPAGATION_MASK (MNT_SHARED | MNT_UNBINDABLE) 45#define MNT_PROPAGATION_MASK (MNT_SHARED | MNT_UNBINDABLE)
46 46
47#define MNT_INTERNAL_FLAGS (MNT_SHARED | MNT_WRITE_HOLD | MNT_INTERNAL | \
48 MNT_DOOMED | MNT_SYNC_UMOUNT | MNT_MARKED)
47 49
48#define MNT_INTERNAL 0x4000 50#define MNT_INTERNAL 0x4000
49 51
@@ -51,6 +53,7 @@ struct mnt_namespace;
51#define MNT_LOCKED 0x800000 53#define MNT_LOCKED 0x800000
52#define MNT_DOOMED 0x1000000 54#define MNT_DOOMED 0x1000000
53#define MNT_SYNC_UMOUNT 0x2000000 55#define MNT_SYNC_UMOUNT 0x2000000
56#define MNT_MARKED 0x4000000
54 57
55struct vfsmount { 58struct vfsmount {
56 struct dentry *mnt_root; /* root of the mounted tree */ 59 struct dentry *mnt_root; /* root of the mounted tree */
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8cc0e2fb6894..a1b0b4c8fd79 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -204,12 +204,12 @@ struct mtd_info {
204 struct mtd_oob_ops *ops); 204 struct mtd_oob_ops *ops);
205 int (*_write_oob) (struct mtd_info *mtd, loff_t to, 205 int (*_write_oob) (struct mtd_info *mtd, loff_t to,
206 struct mtd_oob_ops *ops); 206 struct mtd_oob_ops *ops);
207 int (*_get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, 207 int (*_get_fact_prot_info) (struct mtd_info *mtd, size_t len,
208 size_t len); 208 size_t *retlen, struct otp_info *buf);
209 int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, 209 int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from,
210 size_t len, size_t *retlen, u_char *buf); 210 size_t len, size_t *retlen, u_char *buf);
211 int (*_get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, 211 int (*_get_user_prot_info) (struct mtd_info *mtd, size_t len,
212 size_t len); 212 size_t *retlen, struct otp_info *buf);
213 int (*_read_user_prot_reg) (struct mtd_info *mtd, loff_t from, 213 int (*_read_user_prot_reg) (struct mtd_info *mtd, loff_t from,
214 size_t len, size_t *retlen, u_char *buf); 214 size_t len, size_t *retlen, u_char *buf);
215 int (*_write_user_prot_reg) (struct mtd_info *mtd, loff_t to, 215 int (*_write_user_prot_reg) (struct mtd_info *mtd, loff_t to,
@@ -278,12 +278,12 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
278 return mtd->_write_oob(mtd, to, ops); 278 return mtd->_write_oob(mtd, to, ops);
279} 279}
280 280
281int mtd_get_fact_prot_info(struct mtd_info *mtd, struct otp_info *buf, 281int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
282 size_t len); 282 struct otp_info *buf);
283int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len, 283int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
284 size_t *retlen, u_char *buf); 284 size_t *retlen, u_char *buf);
285int mtd_get_user_prot_info(struct mtd_info *mtd, struct otp_info *buf, 285int mtd_get_user_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
286 size_t len); 286 struct otp_info *buf);
287int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len, 287int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
288 size_t *retlen, u_char *buf); 288 size_t *retlen, u_char *buf);
289int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len, 289int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len,
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 32f8612469d8..450d61ec7f06 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -52,14 +52,6 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
52#define NAND_MAX_CHIPS 8 52#define NAND_MAX_CHIPS 8
53 53
54/* 54/*
55 * This constant declares the max. oobsize / page, which
56 * is supported now. If you add a chip with bigger oobsize/page
57 * adjust this accordingly.
58 */
59#define NAND_MAX_OOBSIZE 744
60#define NAND_MAX_PAGESIZE 8192
61
62/*
63 * Constants for hardware specific CLE/ALE/NCE function 55 * Constants for hardware specific CLE/ALE/NCE function
64 * 56 *
65 * These are bits which can be or'ed to set/clear multiple 57 * These are bits which can be or'ed to set/clear multiple
@@ -350,6 +342,84 @@ struct nand_onfi_vendor_micron {
350 u8 param_revision; 342 u8 param_revision;
351} __packed; 343} __packed;
352 344
345struct jedec_ecc_info {
346 u8 ecc_bits;
347 u8 codeword_size;
348 __le16 bb_per_lun;
349 __le16 block_endurance;
350 u8 reserved[2];
351} __packed;
352
353/* JEDEC features */
354#define JEDEC_FEATURE_16_BIT_BUS (1 << 0)
355
356struct nand_jedec_params {
357 /* rev info and features block */
358 /* 'J' 'E' 'S' 'D' */
359 u8 sig[4];
360 __le16 revision;
361 __le16 features;
362 u8 opt_cmd[3];
363 __le16 sec_cmd;
364 u8 num_of_param_pages;
365 u8 reserved0[18];
366
367 /* manufacturer information block */
368 char manufacturer[12];
369 char model[20];
370 u8 jedec_id[6];
371 u8 reserved1[10];
372
373 /* memory organization block */
374 __le32 byte_per_page;
375 __le16 spare_bytes_per_page;
376 u8 reserved2[6];
377 __le32 pages_per_block;
378 __le32 blocks_per_lun;
379 u8 lun_count;
380 u8 addr_cycles;
381 u8 bits_per_cell;
382 u8 programs_per_page;
383 u8 multi_plane_addr;
384 u8 multi_plane_op_attr;
385 u8 reserved3[38];
386
387 /* electrical parameter block */
388 __le16 async_sdr_speed_grade;
389 __le16 toggle_ddr_speed_grade;
390 __le16 sync_ddr_speed_grade;
391 u8 async_sdr_features;
392 u8 toggle_ddr_features;
393 u8 sync_ddr_features;
394 __le16 t_prog;
395 __le16 t_bers;
396 __le16 t_r;
397 __le16 t_r_multi_plane;
398 __le16 t_ccs;
399 __le16 io_pin_capacitance_typ;
400 __le16 input_pin_capacitance_typ;
401 __le16 clk_pin_capacitance_typ;
402 u8 driver_strength_support;
403 __le16 t_ald;
404 u8 reserved4[36];
405
406 /* ECC and endurance block */
407 u8 guaranteed_good_blocks;
408 __le16 guaranteed_block_endurance;
409 struct jedec_ecc_info ecc_info[4];
410 u8 reserved5[29];
411
412 /* reserved */
413 u8 reserved6[148];
414
415 /* vendor */
416 __le16 vendor_rev_num;
417 u8 reserved7[88];
418
419 /* CRC for Parameter Page */
420 __le16 crc;
421} __packed;
422
353/** 423/**
354 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 424 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
355 * @lock: protection lock 425 * @lock: protection lock
@@ -418,7 +488,7 @@ struct nand_ecc_ctrl {
418 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, 488 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
419 uint8_t *buf, int oob_required, int page); 489 uint8_t *buf, int oob_required, int page);
420 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, 490 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
421 uint32_t offs, uint32_t len, uint8_t *buf); 491 uint32_t offs, uint32_t len, uint8_t *buf, int page);
422 int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip, 492 int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
423 uint32_t offset, uint32_t data_len, 493 uint32_t offset, uint32_t data_len,
424 const uint8_t *data_buf, int oob_required); 494 const uint8_t *data_buf, int oob_required);
@@ -435,17 +505,17 @@ struct nand_ecc_ctrl {
435 505
436/** 506/**
437 * struct nand_buffers - buffer structure for read/write 507 * struct nand_buffers - buffer structure for read/write
438 * @ecccalc: buffer for calculated ECC 508 * @ecccalc: buffer pointer for calculated ECC, size is oobsize.
439 * @ecccode: buffer for ECC read from flash 509 * @ecccode: buffer pointer for ECC read from flash, size is oobsize.
440 * @databuf: buffer for data - dynamically sized 510 * @databuf: buffer pointer for data, size is (page size + oobsize).
441 * 511 *
442 * Do not change the order of buffers. databuf and oobrbuf must be in 512 * Do not change the order of buffers. databuf and oobrbuf must be in
443 * consecutive order. 513 * consecutive order.
444 */ 514 */
445struct nand_buffers { 515struct nand_buffers {
446 uint8_t ecccalc[NAND_MAX_OOBSIZE]; 516 uint8_t *ecccalc;
447 uint8_t ecccode[NAND_MAX_OOBSIZE]; 517 uint8_t *ecccode;
448 uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE]; 518 uint8_t *databuf;
449}; 519};
450 520
451/** 521/**
@@ -523,8 +593,12 @@ struct nand_buffers {
523 * @subpagesize: [INTERN] holds the subpagesize 593 * @subpagesize: [INTERN] holds the subpagesize
524 * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded), 594 * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded),
525 * non 0 if ONFI supported. 595 * non 0 if ONFI supported.
596 * @jedec_version: [INTERN] holds the chip JEDEC version (BCD encoded),
597 * non 0 if JEDEC supported.
526 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is 598 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
527 * supported, 0 otherwise. 599 * supported, 0 otherwise.
600 * @jedec_params: [INTERN] holds the JEDEC parameter page when JEDEC is
601 * supported, 0 otherwise.
528 * @read_retries: [INTERN] the number of read retry modes supported 602 * @read_retries: [INTERN] the number of read retry modes supported
529 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand 603 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand
530 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand 604 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand
@@ -597,7 +671,11 @@ struct nand_chip {
597 int badblockbits; 671 int badblockbits;
598 672
599 int onfi_version; 673 int onfi_version;
600 struct nand_onfi_params onfi_params; 674 int jedec_version;
675 union {
676 struct nand_onfi_params onfi_params;
677 struct nand_jedec_params jedec_params;
678 };
601 679
602 int read_retries; 680 int read_retries;
603 681
@@ -840,4 +918,29 @@ static inline bool nand_is_slc(struct nand_chip *chip)
840{ 918{
841 return chip->bits_per_cell == 1; 919 return chip->bits_per_cell == 1;
842} 920}
921
922/**
923 * Check if the opcode's address should be sent only on the lower 8 bits
924 * @command: opcode to check
925 */
926static inline int nand_opcode_8bits(unsigned int command)
927{
928 switch (command) {
929 case NAND_CMD_READID:
930 case NAND_CMD_PARAM:
931 case NAND_CMD_GET_FEATURES:
932 case NAND_CMD_SET_FEATURES:
933 return 1;
934 default:
935 break;
936 }
937 return 0;
938}
939
940/* return the supported JEDEC features. */
941static inline int jedec_feature(struct nand_chip *chip)
942{
943 return chip->jedec_version ? le16_to_cpu(chip->jedec_params.features)
944 : 0;
945}
843#endif /* __LINUX_MTD_NAND_H */ 946#endif /* __LINUX_MTD_NAND_H */
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index ae4981ebd18e..f62f78aef4ac 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -24,8 +24,7 @@ struct request;
24struct nbd_device { 24struct nbd_device {
25 int flags; 25 int flags;
26 int harderror; /* Code of hard error */ 26 int harderror; /* Code of hard error */
27 struct socket * sock; 27 struct socket * sock; /* If == NULL, device is not ready, yet */
28 struct file * file; /* If == NULL, device is not ready, yet */
29 int magic; 28 int magic;
30 29
31 spinlock_t queue_lock; 30 spinlock_t queue_lock;
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 5a09a48f2658..c26d0ec2ef3a 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -63,6 +63,7 @@ enum {
63 NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */ 63 NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */
64 NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ 64 NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */
65 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ 65 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */
66 NETIF_F_BUSY_POLL_BIT, /* Busy poll */
66 67
67 /* 68 /*
68 * Add your fresh new feature above and remember to update 69 * Add your fresh new feature above and remember to update
@@ -118,6 +119,7 @@ enum {
118#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) 119#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX)
119#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) 120#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
120#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) 121#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
122#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
121 123
122/* Features valid for ethtool to change */ 124/* Features valid for ethtool to change */
123/* = all defined minus driver/device-class-related */ 125/* = all defined minus driver/device-class-related */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 775cc956ff78..7ed3a3aa6604 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -519,11 +519,18 @@ enum netdev_queue_state_t {
519 __QUEUE_STATE_DRV_XOFF, 519 __QUEUE_STATE_DRV_XOFF,
520 __QUEUE_STATE_STACK_XOFF, 520 __QUEUE_STATE_STACK_XOFF,
521 __QUEUE_STATE_FROZEN, 521 __QUEUE_STATE_FROZEN,
522#define QUEUE_STATE_ANY_XOFF ((1 << __QUEUE_STATE_DRV_XOFF) | \
523 (1 << __QUEUE_STATE_STACK_XOFF))
524#define QUEUE_STATE_ANY_XOFF_OR_FROZEN (QUEUE_STATE_ANY_XOFF | \
525 (1 << __QUEUE_STATE_FROZEN))
526}; 522};
523
524#define QUEUE_STATE_DRV_XOFF (1 << __QUEUE_STATE_DRV_XOFF)
525#define QUEUE_STATE_STACK_XOFF (1 << __QUEUE_STATE_STACK_XOFF)
526#define QUEUE_STATE_FROZEN (1 << __QUEUE_STATE_FROZEN)
527
528#define QUEUE_STATE_ANY_XOFF (QUEUE_STATE_DRV_XOFF | QUEUE_STATE_STACK_XOFF)
529#define QUEUE_STATE_ANY_XOFF_OR_FROZEN (QUEUE_STATE_ANY_XOFF | \
530 QUEUE_STATE_FROZEN)
531#define QUEUE_STATE_DRV_XOFF_OR_FROZEN (QUEUE_STATE_DRV_XOFF | \
532 QUEUE_STATE_FROZEN)
533
527/* 534/*
528 * __QUEUE_STATE_DRV_XOFF is used by drivers to stop the transmit queue. The 535 * __QUEUE_STATE_DRV_XOFF is used by drivers to stop the transmit queue. The
529 * netif_tx_* functions below are used to manipulate this flag. The 536 * netif_tx_* functions below are used to manipulate this flag. The
@@ -2252,11 +2259,18 @@ static inline bool netif_xmit_stopped(const struct netdev_queue *dev_queue)
2252 return dev_queue->state & QUEUE_STATE_ANY_XOFF; 2259 return dev_queue->state & QUEUE_STATE_ANY_XOFF;
2253} 2260}
2254 2261
2255static inline bool netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue) 2262static inline bool
2263netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue)
2256{ 2264{
2257 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN; 2265 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN;
2258} 2266}
2259 2267
2268static inline bool
2269netif_xmit_frozen_or_drv_stopped(const struct netdev_queue *dev_queue)
2270{
2271 return dev_queue->state & QUEUE_STATE_DRV_XOFF_OR_FROZEN;
2272}
2273
2260static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, 2274static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
2261 unsigned int bytes) 2275 unsigned int bytes)
2262{ 2276{
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0ae5807480f4..fa6918b0f829 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -92,6 +92,7 @@ struct nfs_open_context {
92}; 92};
93 93
94struct nfs_open_dir_context { 94struct nfs_open_dir_context {
95 struct list_head list;
95 struct rpc_cred *cred; 96 struct rpc_cred *cred;
96 unsigned long attr_gencount; 97 unsigned long attr_gencount;
97 __u64 dir_cookie; 98 __u64 dir_cookie;
@@ -510,7 +511,6 @@ extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
510extern void nfs_wait_on_sillyrename(struct dentry *dentry); 511extern void nfs_wait_on_sillyrename(struct dentry *dentry);
511extern void nfs_block_sillyrename(struct dentry *dentry); 512extern void nfs_block_sillyrename(struct dentry *dentry);
512extern void nfs_unblock_sillyrename(struct dentry *dentry); 513extern void nfs_unblock_sillyrename(struct dentry *dentry);
513extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry);
514 514
515/* 515/*
516 * linux/fs/nfs/write.c 516 * linux/fs/nfs/write.c
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5624e4e2763c..6fb5b2335b59 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1402,6 +1402,7 @@ struct nfs_renamedata {
1402 struct inode *new_dir; 1402 struct inode *new_dir;
1403 struct dentry *new_dentry; 1403 struct dentry *new_dentry;
1404 struct nfs_fattr new_fattr; 1404 struct nfs_fattr new_fattr;
1405 void (*complete)(struct rpc_task *, struct nfs_renamedata *);
1405}; 1406};
1406 1407
1407struct nfs_access_entry; 1408struct nfs_access_entry;
@@ -1444,8 +1445,6 @@ struct nfs_rpc_ops {
1444 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1445 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1445 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); 1446 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
1446 int (*unlink_done) (struct rpc_task *, struct inode *); 1447 int (*unlink_done) (struct rpc_task *, struct inode *);
1447 int (*rename) (struct inode *, struct qstr *,
1448 struct inode *, struct qstr *);
1449 void (*rename_setup) (struct rpc_message *msg, struct inode *dir); 1448 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1450 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *); 1449 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
1451 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); 1450 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
diff --git a/include/linux/ntb.h b/include/linux/ntb.h
index f6a15205853b..9ac1a62fc6f5 100644
--- a/include/linux/ntb.h
+++ b/include/linux/ntb.h
@@ -50,8 +50,13 @@ struct ntb_transport_qp;
50 50
51struct ntb_client { 51struct ntb_client {
52 struct device_driver driver; 52 struct device_driver driver;
53 int (*probe) (struct pci_dev *pdev); 53 int (*probe)(struct pci_dev *pdev);
54 void (*remove) (struct pci_dev *pdev); 54 void (*remove)(struct pci_dev *pdev);
55};
56
57enum {
58 NTB_LINK_DOWN = 0,
59 NTB_LINK_UP,
55}; 60};
56 61
57int ntb_register_client(struct ntb_client *drvr); 62int ntb_register_client(struct ntb_client *drvr);
@@ -60,11 +65,11 @@ int ntb_register_client_dev(char *device_name);
60void ntb_unregister_client_dev(char *device_name); 65void ntb_unregister_client_dev(char *device_name);
61 66
62struct ntb_queue_handlers { 67struct ntb_queue_handlers {
63 void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, 68 void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data,
64 void *data, int len); 69 void *data, int len);
65 void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, 70 void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data,
66 void *data, int len); 71 void *data, int len);
67 void (*event_handler) (void *data, int status); 72 void (*event_handler)(void *data, int status);
68}; 73};
69 74
70unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); 75unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp);
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 6b9aafed225f..a50173ca1d72 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -66,20 +66,25 @@ enum {
66 66
67#define NVME_VS(major, minor) (major << 16 | minor) 67#define NVME_VS(major, minor) (major << 16 | minor)
68 68
69#define NVME_IO_TIMEOUT (5 * HZ) 69extern unsigned char io_timeout;
70#define NVME_IO_TIMEOUT (io_timeout * HZ)
70 71
71/* 72/*
72 * Represents an NVM Express device. Each nvme_dev is a PCI function. 73 * Represents an NVM Express device. Each nvme_dev is a PCI function.
73 */ 74 */
74struct nvme_dev { 75struct nvme_dev {
75 struct list_head node; 76 struct list_head node;
76 struct nvme_queue **queues; 77 struct nvme_queue __rcu **queues;
78 unsigned short __percpu *io_queue;
77 u32 __iomem *dbs; 79 u32 __iomem *dbs;
78 struct pci_dev *pci_dev; 80 struct pci_dev *pci_dev;
79 struct dma_pool *prp_page_pool; 81 struct dma_pool *prp_page_pool;
80 struct dma_pool *prp_small_pool; 82 struct dma_pool *prp_small_pool;
81 int instance; 83 int instance;
82 int queue_count; 84 unsigned queue_count;
85 unsigned online_queues;
86 unsigned max_qid;
87 int q_depth;
83 u32 db_stride; 88 u32 db_stride;
84 u32 ctrl_config; 89 u32 ctrl_config;
85 struct msix_entry *entry; 90 struct msix_entry *entry;
@@ -89,6 +94,7 @@ struct nvme_dev {
89 struct miscdevice miscdev; 94 struct miscdevice miscdev;
90 work_func_t reset_workfn; 95 work_func_t reset_workfn;
91 struct work_struct reset_work; 96 struct work_struct reset_work;
97 struct notifier_block nb;
92 char name[12]; 98 char name[12];
93 char serial[20]; 99 char serial[20];
94 char model[40]; 100 char model[40];
@@ -131,6 +137,7 @@ struct nvme_iod {
131 int length; /* Of data, in bytes */ 137 int length; /* Of data, in bytes */
132 unsigned long start_time; 138 unsigned long start_time;
133 dma_addr_t first_dma; 139 dma_addr_t first_dma;
140 struct list_head node;
134 struct scatterlist sg[0]; 141 struct scatterlist sg[0];
135}; 142};
136 143
@@ -146,16 +153,12 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
146 */ 153 */
147void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod); 154void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod);
148 155
149int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd, 156int nvme_setup_prps(struct nvme_dev *, struct nvme_iod *, int , gfp_t);
150 struct nvme_iod *iod, int total_len, gfp_t gfp);
151struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, 157struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
152 unsigned long addr, unsigned length); 158 unsigned long addr, unsigned length);
153void nvme_unmap_user_pages(struct nvme_dev *dev, int write, 159void nvme_unmap_user_pages(struct nvme_dev *dev, int write,
154 struct nvme_iod *iod); 160 struct nvme_iod *iod);
155struct nvme_queue *get_nvmeq(struct nvme_dev *dev); 161int nvme_submit_io_cmd(struct nvme_dev *, struct nvme_command *, u32 *);
156void put_nvmeq(struct nvme_queue *nvmeq);
157int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd,
158 u32 *result, unsigned timeout);
159int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns); 162int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns);
160int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, 163int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *,
161 u32 *result); 164 u32 *result);
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index cb32d9c1e8dc..e266caa36402 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -13,6 +13,8 @@
13 13
14#include <linux/of.h> 14#include <linux/of.h>
15int of_get_nand_ecc_mode(struct device_node *np); 15int of_get_nand_ecc_mode(struct device_node *np);
16int of_get_nand_ecc_step_size(struct device_node *np);
17int of_get_nand_ecc_strength(struct device_node *np);
16int of_get_nand_bus_width(struct device_node *np); 18int of_get_nand_bus_width(struct device_node *np);
17bool of_get_nand_on_flash_bbt(struct device_node *np); 19bool of_get_nand_on_flash_bbt(struct device_node *np);
18 20
@@ -23,6 +25,16 @@ static inline int of_get_nand_ecc_mode(struct device_node *np)
23 return -ENOSYS; 25 return -ENOSYS;
24} 26}
25 27
28static inline int of_get_nand_ecc_step_size(struct device_node *np)
29{
30 return -ENOSYS;
31}
32
33static inline int of_get_nand_ecc_strength(struct device_node *np)
34{
35 return -ENOSYS;
36}
37
26static inline int of_get_nand_bus_width(struct device_node *np) 38static inline int of_get_nand_bus_width(struct device_node *np)
27{ 39{
28 return -ENOSYS; 40 return -ENOSYS;
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index e3817d2441b6..e7a0b95ed527 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -173,6 +173,12 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
173 173
174extern void __bad_size_call_parameter(void); 174extern void __bad_size_call_parameter(void);
175 175
176#ifdef CONFIG_DEBUG_PREEMPT
177extern void __this_cpu_preempt_check(const char *op);
178#else
179static inline void __this_cpu_preempt_check(const char *op) { }
180#endif
181
176#define __pcpu_size_call_return(stem, variable) \ 182#define __pcpu_size_call_return(stem, variable) \
177({ typeof(variable) pscr_ret__; \ 183({ typeof(variable) pscr_ret__; \
178 __verify_pcpu_ptr(&(variable)); \ 184 __verify_pcpu_ptr(&(variable)); \
@@ -243,6 +249,8 @@ do { \
243} while (0) 249} while (0)
244 250
245/* 251/*
252 * this_cpu operations (C) 2008-2013 Christoph Lameter <cl@linux.com>
253 *
246 * Optimized manipulation for memory allocated through the per cpu 254 * Optimized manipulation for memory allocated through the per cpu
247 * allocator or for addresses of per cpu variables. 255 * allocator or for addresses of per cpu variables.
248 * 256 *
@@ -296,7 +304,7 @@ do { \
296do { \ 304do { \
297 unsigned long flags; \ 305 unsigned long flags; \
298 raw_local_irq_save(flags); \ 306 raw_local_irq_save(flags); \
299 *__this_cpu_ptr(&(pcp)) op val; \ 307 *raw_cpu_ptr(&(pcp)) op val; \
300 raw_local_irq_restore(flags); \ 308 raw_local_irq_restore(flags); \
301} while (0) 309} while (0)
302 310
@@ -381,8 +389,8 @@ do { \
381 typeof(pcp) ret__; \ 389 typeof(pcp) ret__; \
382 unsigned long flags; \ 390 unsigned long flags; \
383 raw_local_irq_save(flags); \ 391 raw_local_irq_save(flags); \
384 __this_cpu_add(pcp, val); \ 392 raw_cpu_add(pcp, val); \
385 ret__ = __this_cpu_read(pcp); \ 393 ret__ = raw_cpu_read(pcp); \
386 raw_local_irq_restore(flags); \ 394 raw_local_irq_restore(flags); \
387 ret__; \ 395 ret__; \
388}) 396})
@@ -411,8 +419,8 @@ do { \
411({ typeof(pcp) ret__; \ 419({ typeof(pcp) ret__; \
412 unsigned long flags; \ 420 unsigned long flags; \
413 raw_local_irq_save(flags); \ 421 raw_local_irq_save(flags); \
414 ret__ = __this_cpu_read(pcp); \ 422 ret__ = raw_cpu_read(pcp); \
415 __this_cpu_write(pcp, nval); \ 423 raw_cpu_write(pcp, nval); \
416 raw_local_irq_restore(flags); \ 424 raw_local_irq_restore(flags); \
417 ret__; \ 425 ret__; \
418}) 426})
@@ -439,9 +447,9 @@ do { \
439 typeof(pcp) ret__; \ 447 typeof(pcp) ret__; \
440 unsigned long flags; \ 448 unsigned long flags; \
441 raw_local_irq_save(flags); \ 449 raw_local_irq_save(flags); \
442 ret__ = __this_cpu_read(pcp); \ 450 ret__ = raw_cpu_read(pcp); \
443 if (ret__ == (oval)) \ 451 if (ret__ == (oval)) \
444 __this_cpu_write(pcp, nval); \ 452 raw_cpu_write(pcp, nval); \
445 raw_local_irq_restore(flags); \ 453 raw_local_irq_restore(flags); \
446 ret__; \ 454 ret__; \
447}) 455})
@@ -476,7 +484,7 @@ do { \
476 int ret__; \ 484 int ret__; \
477 unsigned long flags; \ 485 unsigned long flags; \
478 raw_local_irq_save(flags); \ 486 raw_local_irq_save(flags); \
479 ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \ 487 ret__ = raw_cpu_generic_cmpxchg_double(pcp1, pcp2, \
480 oval1, oval2, nval1, nval2); \ 488 oval1, oval2, nval1, nval2); \
481 raw_local_irq_restore(flags); \ 489 raw_local_irq_restore(flags); \
482 ret__; \ 490 ret__; \
@@ -504,12 +512,8 @@ do { \
504#endif 512#endif
505 513
506/* 514/*
507 * Generic percpu operations for context that are safe from preemption/interrupts. 515 * Generic percpu operations for contexts where we do not want to do
508 * Either we do not care about races or the caller has the 516 * any checks for preemptiosn.
509 * responsibility of handling preemption/interrupt issues. Arch code can still
510 * override these instructions since the arch per cpu code may be more
511 * efficient and may actually get race freeness for free (that is the
512 * case for x86 for example).
513 * 517 *
514 * If there is no other protection through preempt disable and/or 518 * If there is no other protection through preempt disable and/or
515 * disabling interupts then one of these RMW operations can show unexpected 519 * disabling interupts then one of these RMW operations can show unexpected
@@ -517,211 +521,285 @@ do { \
517 * or an interrupt occurred and the same percpu variable was modified from 521 * or an interrupt occurred and the same percpu variable was modified from
518 * the interrupt context. 522 * the interrupt context.
519 */ 523 */
520#ifndef __this_cpu_read 524#ifndef raw_cpu_read
521# ifndef __this_cpu_read_1 525# ifndef raw_cpu_read_1
522# define __this_cpu_read_1(pcp) (*__this_cpu_ptr(&(pcp))) 526# define raw_cpu_read_1(pcp) (*raw_cpu_ptr(&(pcp)))
523# endif 527# endif
524# ifndef __this_cpu_read_2 528# ifndef raw_cpu_read_2
525# define __this_cpu_read_2(pcp) (*__this_cpu_ptr(&(pcp))) 529# define raw_cpu_read_2(pcp) (*raw_cpu_ptr(&(pcp)))
526# endif 530# endif
527# ifndef __this_cpu_read_4 531# ifndef raw_cpu_read_4
528# define __this_cpu_read_4(pcp) (*__this_cpu_ptr(&(pcp))) 532# define raw_cpu_read_4(pcp) (*raw_cpu_ptr(&(pcp)))
529# endif 533# endif
530# ifndef __this_cpu_read_8 534# ifndef raw_cpu_read_8
531# define __this_cpu_read_8(pcp) (*__this_cpu_ptr(&(pcp))) 535# define raw_cpu_read_8(pcp) (*raw_cpu_ptr(&(pcp)))
532# endif 536# endif
533# define __this_cpu_read(pcp) __pcpu_size_call_return(__this_cpu_read_, (pcp)) 537# define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, (pcp))
534#endif 538#endif
535 539
536#define __this_cpu_generic_to_op(pcp, val, op) \ 540#define raw_cpu_generic_to_op(pcp, val, op) \
537do { \ 541do { \
538 *__this_cpu_ptr(&(pcp)) op val; \ 542 *raw_cpu_ptr(&(pcp)) op val; \
539} while (0) 543} while (0)
540 544
541#ifndef __this_cpu_write 545
542# ifndef __this_cpu_write_1 546#ifndef raw_cpu_write
543# define __this_cpu_write_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) 547# ifndef raw_cpu_write_1
548# define raw_cpu_write_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), =)
544# endif 549# endif
545# ifndef __this_cpu_write_2 550# ifndef raw_cpu_write_2
546# define __this_cpu_write_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) 551# define raw_cpu_write_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), =)
547# endif 552# endif
548# ifndef __this_cpu_write_4 553# ifndef raw_cpu_write_4
549# define __this_cpu_write_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) 554# define raw_cpu_write_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), =)
550# endif 555# endif
551# ifndef __this_cpu_write_8 556# ifndef raw_cpu_write_8
552# define __this_cpu_write_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), =) 557# define raw_cpu_write_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), =)
553# endif 558# endif
554# define __this_cpu_write(pcp, val) __pcpu_size_call(__this_cpu_write_, (pcp), (val)) 559# define raw_cpu_write(pcp, val) __pcpu_size_call(raw_cpu_write_, (pcp), (val))
555#endif 560#endif
556 561
557#ifndef __this_cpu_add 562#ifndef raw_cpu_add
558# ifndef __this_cpu_add_1 563# ifndef raw_cpu_add_1
559# define __this_cpu_add_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) 564# define raw_cpu_add_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=)
560# endif 565# endif
561# ifndef __this_cpu_add_2 566# ifndef raw_cpu_add_2
562# define __this_cpu_add_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) 567# define raw_cpu_add_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=)
563# endif 568# endif
564# ifndef __this_cpu_add_4 569# ifndef raw_cpu_add_4
565# define __this_cpu_add_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) 570# define raw_cpu_add_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=)
566# endif 571# endif
567# ifndef __this_cpu_add_8 572# ifndef raw_cpu_add_8
568# define __this_cpu_add_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=) 573# define raw_cpu_add_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=)
569# endif 574# endif
570# define __this_cpu_add(pcp, val) __pcpu_size_call(__this_cpu_add_, (pcp), (val)) 575# define raw_cpu_add(pcp, val) __pcpu_size_call(raw_cpu_add_, (pcp), (val))
571#endif 576#endif
572 577
573#ifndef __this_cpu_sub 578#ifndef raw_cpu_sub
574# define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(typeof(pcp))(val)) 579# define raw_cpu_sub(pcp, val) raw_cpu_add((pcp), -(val))
575#endif 580#endif
576 581
577#ifndef __this_cpu_inc 582#ifndef raw_cpu_inc
578# define __this_cpu_inc(pcp) __this_cpu_add((pcp), 1) 583# define raw_cpu_inc(pcp) raw_cpu_add((pcp), 1)
579#endif 584#endif
580 585
581#ifndef __this_cpu_dec 586#ifndef raw_cpu_dec
582# define __this_cpu_dec(pcp) __this_cpu_sub((pcp), 1) 587# define raw_cpu_dec(pcp) raw_cpu_sub((pcp), 1)
583#endif 588#endif
584 589
585#ifndef __this_cpu_and 590#ifndef raw_cpu_and
586# ifndef __this_cpu_and_1 591# ifndef raw_cpu_and_1
587# define __this_cpu_and_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) 592# define raw_cpu_and_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=)
588# endif 593# endif
589# ifndef __this_cpu_and_2 594# ifndef raw_cpu_and_2
590# define __this_cpu_and_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) 595# define raw_cpu_and_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=)
591# endif 596# endif
592# ifndef __this_cpu_and_4 597# ifndef raw_cpu_and_4
593# define __this_cpu_and_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) 598# define raw_cpu_and_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=)
594# endif 599# endif
595# ifndef __this_cpu_and_8 600# ifndef raw_cpu_and_8
596# define __this_cpu_and_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=) 601# define raw_cpu_and_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=)
597# endif 602# endif
598# define __this_cpu_and(pcp, val) __pcpu_size_call(__this_cpu_and_, (pcp), (val)) 603# define raw_cpu_and(pcp, val) __pcpu_size_call(raw_cpu_and_, (pcp), (val))
599#endif 604#endif
600 605
601#ifndef __this_cpu_or 606#ifndef raw_cpu_or
602# ifndef __this_cpu_or_1 607# ifndef raw_cpu_or_1
603# define __this_cpu_or_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) 608# define raw_cpu_or_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=)
604# endif 609# endif
605# ifndef __this_cpu_or_2 610# ifndef raw_cpu_or_2
606# define __this_cpu_or_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) 611# define raw_cpu_or_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=)
607# endif 612# endif
608# ifndef __this_cpu_or_4 613# ifndef raw_cpu_or_4
609# define __this_cpu_or_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) 614# define raw_cpu_or_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=)
610# endif 615# endif
611# ifndef __this_cpu_or_8 616# ifndef raw_cpu_or_8
612# define __this_cpu_or_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=) 617# define raw_cpu_or_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=)
613# endif 618# endif
614# define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) 619# define raw_cpu_or(pcp, val) __pcpu_size_call(raw_cpu_or_, (pcp), (val))
615#endif 620#endif
616 621
617#define __this_cpu_generic_add_return(pcp, val) \ 622#define raw_cpu_generic_add_return(pcp, val) \
618({ \ 623({ \
619 __this_cpu_add(pcp, val); \ 624 raw_cpu_add(pcp, val); \
620 __this_cpu_read(pcp); \ 625 raw_cpu_read(pcp); \
621}) 626})
622 627
623#ifndef __this_cpu_add_return 628#ifndef raw_cpu_add_return
624# ifndef __this_cpu_add_return_1 629# ifndef raw_cpu_add_return_1
625# define __this_cpu_add_return_1(pcp, val) __this_cpu_generic_add_return(pcp, val) 630# define raw_cpu_add_return_1(pcp, val) raw_cpu_generic_add_return(pcp, val)
626# endif 631# endif
627# ifndef __this_cpu_add_return_2 632# ifndef raw_cpu_add_return_2
628# define __this_cpu_add_return_2(pcp, val) __this_cpu_generic_add_return(pcp, val) 633# define raw_cpu_add_return_2(pcp, val) raw_cpu_generic_add_return(pcp, val)
629# endif 634# endif
630# ifndef __this_cpu_add_return_4 635# ifndef raw_cpu_add_return_4
631# define __this_cpu_add_return_4(pcp, val) __this_cpu_generic_add_return(pcp, val) 636# define raw_cpu_add_return_4(pcp, val) raw_cpu_generic_add_return(pcp, val)
632# endif 637# endif
633# ifndef __this_cpu_add_return_8 638# ifndef raw_cpu_add_return_8
634# define __this_cpu_add_return_8(pcp, val) __this_cpu_generic_add_return(pcp, val) 639# define raw_cpu_add_return_8(pcp, val) raw_cpu_generic_add_return(pcp, val)
635# endif 640# endif
636# define __this_cpu_add_return(pcp, val) \ 641# define raw_cpu_add_return(pcp, val) \
637 __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val) 642 __pcpu_size_call_return2(raw_add_return_, pcp, val)
638#endif 643#endif
639 644
640#define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(typeof(pcp))(val)) 645#define raw_cpu_sub_return(pcp, val) raw_cpu_add_return(pcp, -(typeof(pcp))(val))
641#define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1) 646#define raw_cpu_inc_return(pcp) raw_cpu_add_return(pcp, 1)
642#define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1) 647#define raw_cpu_dec_return(pcp) raw_cpu_add_return(pcp, -1)
643 648
644#define __this_cpu_generic_xchg(pcp, nval) \ 649#define raw_cpu_generic_xchg(pcp, nval) \
645({ typeof(pcp) ret__; \ 650({ typeof(pcp) ret__; \
646 ret__ = __this_cpu_read(pcp); \ 651 ret__ = raw_cpu_read(pcp); \
647 __this_cpu_write(pcp, nval); \ 652 raw_cpu_write(pcp, nval); \
648 ret__; \ 653 ret__; \
649}) 654})
650 655
651#ifndef __this_cpu_xchg 656#ifndef raw_cpu_xchg
652# ifndef __this_cpu_xchg_1 657# ifndef raw_cpu_xchg_1
653# define __this_cpu_xchg_1(pcp, nval) __this_cpu_generic_xchg(pcp, nval) 658# define raw_cpu_xchg_1(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
654# endif 659# endif
655# ifndef __this_cpu_xchg_2 660# ifndef raw_cpu_xchg_2
656# define __this_cpu_xchg_2(pcp, nval) __this_cpu_generic_xchg(pcp, nval) 661# define raw_cpu_xchg_2(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
657# endif 662# endif
658# ifndef __this_cpu_xchg_4 663# ifndef raw_cpu_xchg_4
659# define __this_cpu_xchg_4(pcp, nval) __this_cpu_generic_xchg(pcp, nval) 664# define raw_cpu_xchg_4(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
660# endif 665# endif
661# ifndef __this_cpu_xchg_8 666# ifndef raw_cpu_xchg_8
662# define __this_cpu_xchg_8(pcp, nval) __this_cpu_generic_xchg(pcp, nval) 667# define raw_cpu_xchg_8(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
663# endif 668# endif
664# define __this_cpu_xchg(pcp, nval) \ 669# define raw_cpu_xchg(pcp, nval) \
665 __pcpu_size_call_return2(__this_cpu_xchg_, (pcp), nval) 670 __pcpu_size_call_return2(raw_cpu_xchg_, (pcp), nval)
666#endif 671#endif
667 672
668#define __this_cpu_generic_cmpxchg(pcp, oval, nval) \ 673#define raw_cpu_generic_cmpxchg(pcp, oval, nval) \
669({ \ 674({ \
670 typeof(pcp) ret__; \ 675 typeof(pcp) ret__; \
671 ret__ = __this_cpu_read(pcp); \ 676 ret__ = raw_cpu_read(pcp); \
672 if (ret__ == (oval)) \ 677 if (ret__ == (oval)) \
673 __this_cpu_write(pcp, nval); \ 678 raw_cpu_write(pcp, nval); \
674 ret__; \ 679 ret__; \
675}) 680})
676 681
677#ifndef __this_cpu_cmpxchg 682#ifndef raw_cpu_cmpxchg
678# ifndef __this_cpu_cmpxchg_1 683# ifndef raw_cpu_cmpxchg_1
679# define __this_cpu_cmpxchg_1(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) 684# define raw_cpu_cmpxchg_1(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval)
680# endif 685# endif
681# ifndef __this_cpu_cmpxchg_2 686# ifndef raw_cpu_cmpxchg_2
682# define __this_cpu_cmpxchg_2(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) 687# define raw_cpu_cmpxchg_2(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval)
683# endif 688# endif
684# ifndef __this_cpu_cmpxchg_4 689# ifndef raw_cpu_cmpxchg_4
685# define __this_cpu_cmpxchg_4(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) 690# define raw_cpu_cmpxchg_4(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval)
686# endif 691# endif
687# ifndef __this_cpu_cmpxchg_8 692# ifndef raw_cpu_cmpxchg_8
688# define __this_cpu_cmpxchg_8(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) 693# define raw_cpu_cmpxchg_8(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval)
689# endif 694# endif
690# define __this_cpu_cmpxchg(pcp, oval, nval) \ 695# define raw_cpu_cmpxchg(pcp, oval, nval) \
691 __pcpu_size_call_return2(__this_cpu_cmpxchg_, pcp, oval, nval) 696 __pcpu_size_call_return2(raw_cpu_cmpxchg_, pcp, oval, nval)
692#endif 697#endif
693 698
694#define __this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 699#define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
695({ \ 700({ \
696 int __ret = 0; \ 701 int __ret = 0; \
697 if (__this_cpu_read(pcp1) == (oval1) && \ 702 if (raw_cpu_read(pcp1) == (oval1) && \
698 __this_cpu_read(pcp2) == (oval2)) { \ 703 raw_cpu_read(pcp2) == (oval2)) { \
699 __this_cpu_write(pcp1, (nval1)); \ 704 raw_cpu_write(pcp1, (nval1)); \
700 __this_cpu_write(pcp2, (nval2)); \ 705 raw_cpu_write(pcp2, (nval2)); \
701 __ret = 1; \ 706 __ret = 1; \
702 } \ 707 } \
703 (__ret); \ 708 (__ret); \
704}) 709})
705 710
706#ifndef __this_cpu_cmpxchg_double 711#ifndef raw_cpu_cmpxchg_double
707# ifndef __this_cpu_cmpxchg_double_1 712# ifndef raw_cpu_cmpxchg_double_1
708# define __this_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 713# define raw_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \
709 __this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 714 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
710# endif 715# endif
711# ifndef __this_cpu_cmpxchg_double_2 716# ifndef raw_cpu_cmpxchg_double_2
712# define __this_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 717# define raw_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \
713 __this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 718 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
714# endif 719# endif
715# ifndef __this_cpu_cmpxchg_double_4 720# ifndef raw_cpu_cmpxchg_double_4
716# define __this_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 721# define raw_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \
717 __this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 722 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
718# endif 723# endif
719# ifndef __this_cpu_cmpxchg_double_8 724# ifndef raw_cpu_cmpxchg_double_8
720# define __this_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 725# define raw_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \
721 __this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 726 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
722# endif 727# endif
728# define raw_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
729 __pcpu_double_call_return_bool(raw_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2))
730#endif
731
732/*
733 * Generic percpu operations for context that are safe from preemption/interrupts.
734 */
735#ifndef __this_cpu_read
736# define __this_cpu_read(pcp) \
737 (__this_cpu_preempt_check("read"),__pcpu_size_call_return(raw_cpu_read_, (pcp)))
738#endif
739
740#ifndef __this_cpu_write
741# define __this_cpu_write(pcp, val) \
742do { __this_cpu_preempt_check("write"); \
743 __pcpu_size_call(raw_cpu_write_, (pcp), (val)); \
744} while (0)
745#endif
746
747#ifndef __this_cpu_add
748# define __this_cpu_add(pcp, val) \
749do { __this_cpu_preempt_check("add"); \
750 __pcpu_size_call(raw_cpu_add_, (pcp), (val)); \
751} while (0)
752#endif
753
754#ifndef __this_cpu_sub
755# define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(typeof(pcp))(val))
756#endif
757
758#ifndef __this_cpu_inc
759# define __this_cpu_inc(pcp) __this_cpu_add((pcp), 1)
760#endif
761
762#ifndef __this_cpu_dec
763# define __this_cpu_dec(pcp) __this_cpu_sub((pcp), 1)
764#endif
765
766#ifndef __this_cpu_and
767# define __this_cpu_and(pcp, val) \
768do { __this_cpu_preempt_check("and"); \
769 __pcpu_size_call(raw_cpu_and_, (pcp), (val)); \
770} while (0)
771
772#endif
773
774#ifndef __this_cpu_or
775# define __this_cpu_or(pcp, val) \
776do { __this_cpu_preempt_check("or"); \
777 __pcpu_size_call(raw_cpu_or_, (pcp), (val)); \
778} while (0)
779#endif
780
781#ifndef __this_cpu_add_return
782# define __this_cpu_add_return(pcp, val) \
783 (__this_cpu_preempt_check("add_return"),__pcpu_size_call_return2(raw_cpu_add_return_, pcp, val))
784#endif
785
786#define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(typeof(pcp))(val))
787#define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1)
788#define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1)
789
790#ifndef __this_cpu_xchg
791# define __this_cpu_xchg(pcp, nval) \
792 (__this_cpu_preempt_check("xchg"),__pcpu_size_call_return2(raw_cpu_xchg_, (pcp), nval))
793#endif
794
795#ifndef __this_cpu_cmpxchg
796# define __this_cpu_cmpxchg(pcp, oval, nval) \
797 (__this_cpu_preempt_check("cmpxchg"),__pcpu_size_call_return2(raw_cpu_cmpxchg_, pcp, oval, nval))
798#endif
799
800#ifndef __this_cpu_cmpxchg_double
723# define __this_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 801# define __this_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
724 __pcpu_double_call_return_bool(__this_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) 802 (__this_cpu_preempt_check("cmpxchg_double"),__pcpu_double_call_return_bool(raw_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)))
725#endif 803#endif
726 804
727#endif /* __LINUX_PERCPU_H */ 805#endif /* __LINUX_PERCPU_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index e56b07f5c9b6..3356abcfff18 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -835,6 +835,8 @@ do { \
835 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ 835 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
836 unsigned long cpu = smp_processor_id(); \ 836 unsigned long cpu = smp_processor_id(); \
837 unsigned long flags; \ 837 unsigned long flags; \
838 \
839 cpu_notifier_register_begin(); \
838 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ 840 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \
839 (void *)(unsigned long)cpu); \ 841 (void *)(unsigned long)cpu); \
840 local_irq_save(flags); \ 842 local_irq_save(flags); \
@@ -843,9 +845,21 @@ do { \
843 local_irq_restore(flags); \ 845 local_irq_restore(flags); \
844 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ 846 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \
845 (void *)(unsigned long)cpu); \ 847 (void *)(unsigned long)cpu); \
846 register_cpu_notifier(&fn##_nb); \ 848 __register_cpu_notifier(&fn##_nb); \
849 cpu_notifier_register_done(); \
847} while (0) 850} while (0)
848 851
852/*
853 * Bare-bones version of perf_cpu_notifier(), which doesn't invoke the
854 * callback for already online CPUs.
855 */
856#define __perf_cpu_notifier(fn) \
857do { \
858 static struct notifier_block fn##_nb = \
859 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
860 \
861 __register_cpu_notifier(&fn##_nb); \
862} while (0)
849 863
850struct perf_pmu_events_attr { 864struct perf_pmu_events_attr {
851 struct device_attribute attr; 865 struct device_attribute attr;
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 4d9389c79e61..eb8b8ac6df3c 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -83,23 +83,6 @@ struct pipe_buf_operations {
83 int can_merge; 83 int can_merge;
84 84
85 /* 85 /*
86 * ->map() returns a virtual address mapping of the pipe buffer.
87 * The last integer flag reflects whether this should be an atomic
88 * mapping or not. The atomic map is faster, however you can't take
89 * page faults before calling ->unmap() again. So if you need to eg
90 * access user data through copy_to/from_user(), then you must get
91 * a non-atomic map. ->map() uses the kmap_atomic slot for
92 * atomic maps, you have to be careful if mapping another page as
93 * source or destination for a copy.
94 */
95 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
96
97 /*
98 * Undoes ->map(), finishes the virtual mapping of the pipe buffer.
99 */
100 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *);
101
102 /*
103 * ->confirm() verifies that the data in the pipe buffer is there 86 * ->confirm() verifies that the data in the pipe buffer is there
104 * and that the contents are good. If the pages in the pipe belong 87 * and that the contents are good. If the pages in the pipe belong
105 * to a file system, we may need to wait for IO completion in this 88 * to a file system, we may need to wait for IO completion in this
@@ -150,8 +133,6 @@ struct pipe_inode_info *alloc_pipe_info(void);
150void free_pipe_info(struct pipe_inode_info *); 133void free_pipe_info(struct pipe_inode_info *);
151 134
152/* Generic pipe buffer ops functions */ 135/* Generic pipe buffer ops functions */
153void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int);
154void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *);
155void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); 136void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
156int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); 137int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
157int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 138int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
diff --git a/include/linux/platform_data/dma-rcar-audmapp.h b/include/linux/platform_data/dma-rcar-audmapp.h
new file mode 100644
index 000000000000..471fffebbeb4
--- /dev/null
+++ b/include/linux/platform_data/dma-rcar-audmapp.h
@@ -0,0 +1,34 @@
1/*
2 * This is for Renesas R-Car Audio-DMAC-peri-peri.
3 *
4 * Copyright (C) 2014 Renesas Electronics Corporation
5 * Copyright (C) 2014 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This file is based on the include/linux/sh_dma.h
8 *
9 * Header for the new SH dmaengine driver
10 *
11 * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17#ifndef SH_AUDMAPP_H
18#define SH_AUDMAPP_H
19
20#include <linux/dmaengine.h>
21
22struct audmapp_slave_config {
23 int slave_id;
24 dma_addr_t src;
25 dma_addr_t dst;
26 u32 chcr;
27};
28
29struct audmapp_pdata {
30 struct audmapp_slave_config *slave;
31 int slave_num;
32};
33
34#endif /* SH_AUDMAPP_H */
diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h
index bf0a83b7ed9d..4edb40676b3f 100644
--- a/include/linux/platform_data/elm.h
+++ b/include/linux/platform_data/elm.h
@@ -26,13 +26,6 @@ enum bch_ecc {
26/* ELM support 8 error syndrome process */ 26/* ELM support 8 error syndrome process */
27#define ERROR_VECTOR_MAX 8 27#define ERROR_VECTOR_MAX 8
28 28
29#define BCH8_ECC_OOB_BYTES 13
30#define BCH4_ECC_OOB_BYTES 7
31/* RBL requires 14 byte even though BCH8 uses only 13 byte */
32#define BCH8_SIZE (BCH8_ECC_OOB_BYTES + 1)
33/* Uses 1 extra byte to handle erased pages */
34#define BCH4_SIZE (BCH4_ECC_OOB_BYTES + 1)
35
36/** 29/**
37 * struct elm_errorvec - error vector for elm 30 * struct elm_errorvec - error vector for elm
38 * @error_reported: set true for vectors error is reported 31 * @error_reported: set true for vectors error is reported
@@ -50,5 +43,6 @@ struct elm_errorvec {
50 43
51void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc, 44void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
52 struct elm_errorvec *err_vec); 45 struct elm_errorvec *err_vec);
53int elm_config(struct device *dev, enum bch_ecc bch_type); 46int elm_config(struct device *dev, enum bch_ecc bch_type,
47 int ecc_steps, int ecc_step_size, int ecc_syndrome_size);
54#endif /* __ELM_H */ 48#endif /* __ELM_H */
diff --git a/include/linux/platform_data/i2c-s3c2410.h b/include/linux/platform_data/i2c-s3c2410.h
index 2a50048c1c44..05af66b840b9 100644
--- a/include/linux/platform_data/i2c-s3c2410.h
+++ b/include/linux/platform_data/i2c-s3c2410.h
@@ -1,5 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/iic.h 1/*
2 *
3 * Copyright 2004-2009 Simtec Electronics 2 * Copyright 2004-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
@@ -10,8 +9,8 @@
10 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
11*/ 10*/
12 11
13#ifndef __ASM_ARCH_IIC_H 12#ifndef __I2C_S3C2410_H
14#define __ASM_ARCH_IIC_H __FILE__ 13#define __I2C_S3C2410_H __FILE__
15 14
16#define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */ 15#define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */
17 16
@@ -76,4 +75,4 @@ extern void s3c_i2c7_cfg_gpio(struct platform_device *dev);
76 75
77extern struct s3c2410_platform_i2c default_i2c_data; 76extern struct s3c2410_platform_i2c default_i2c_data;
78 77
79#endif /* __ASM_ARCH_IIC_H */ 78#endif /* __I2C_S3C2410_H */
diff --git a/include/linux/platform_data/leds-s3c24xx.h b/include/linux/platform_data/leds-s3c24xx.h
index d8a7672519b6..441a6f290649 100644
--- a/include/linux/platform_data/leds-s3c24xx.h
+++ b/include/linux/platform_data/leds-s3c24xx.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/leds-gpio.h 1/*
2 *
3 * Copyright (c) 2006 Simtec Electronics 2 * Copyright (c) 2006 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 3 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -11,8 +10,8 @@
11 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
12*/ 11*/
13 12
14#ifndef __ASM_ARCH_LEDSGPIO_H 13#ifndef __LEDS_S3C24XX_H
15#define __ASM_ARCH_LEDSGPIO_H "leds-gpio.h" 14#define __LEDS_S3C24XX_H
16 15
17#define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */ 16#define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */
18#define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */ 17#define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */
@@ -25,4 +24,4 @@ struct s3c24xx_led_platdata {
25 char *def_trigger; 24 char *def_trigger;
26}; 25};
27 26
28#endif /* __ASM_ARCH_LEDSGPIO_H */ 27#endif /* __LEDS_S3C24XX_H */
diff --git a/include/linux/platform_data/mmc-msm_sdcc.h b/include/linux/platform_data/mmc-msm_sdcc.h
index ffcd9e3a6a7e..55aa873c9396 100644
--- a/include/linux/platform_data/mmc-msm_sdcc.h
+++ b/include/linux/platform_data/mmc-msm_sdcc.h
@@ -1,8 +1,5 @@
1/* 1#ifndef __MMC_MSM_SDCC_H
2 * arch/arm/include/asm/mach/mmc.h 2#define __MMC_MSM_SDCC_H
3 */
4#ifndef ASMARM_MACH_MMC_H
5#define ASMARM_MACH_MMC_H
6 3
7#include <linux/mmc/host.h> 4#include <linux/mmc/host.h>
8#include <linux/mmc/card.h> 5#include <linux/mmc/card.h>
diff --git a/include/linux/platform_data/mmc-mvsdio.h b/include/linux/platform_data/mmc-mvsdio.h
index 1190efedcb94..d02704cd3695 100644
--- a/include/linux/platform_data/mmc-mvsdio.h
+++ b/include/linux/platform_data/mmc-mvsdio.h
@@ -1,13 +1,11 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/mvsdio.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
7 */ 5 */
8 6
9#ifndef __MACH_MVSDIO_H 7#ifndef __MMC_MVSDIO_H
10#define __MACH_MVSDIO_H 8#define __MMC_MVSDIO_H
11 9
12#include <linux/mbus.h> 10#include <linux/mbus.h>
13 11
diff --git a/include/linux/platform_data/mtd-nand-s3c2410.h b/include/linux/platform_data/mtd-nand-s3c2410.h
index b64115fa93a4..36bb92172f47 100644
--- a/include/linux/platform_data/mtd-nand-s3c2410.h
+++ b/include/linux/platform_data/mtd-nand-s3c2410.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/nand.h 1/*
2 *
3 * Copyright (c) 2004 Simtec Electronics 2 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
@@ -10,6 +9,9 @@
10 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
11*/ 10*/
12 11
12#ifndef __MTD_NAND_S3C2410_H
13#define __MTD_NAND_S3C2410_H
14
13/** 15/**
14 * struct s3c2410_nand_set - define a set of one or more nand chips 16 * struct s3c2410_nand_set - define a set of one or more nand chips
15 * @disable_ecc: Entirely disable ECC - Dangerous 17 * @disable_ecc: Entirely disable ECC - Dangerous
@@ -65,3 +67,5 @@ struct s3c2410_platform_nand {
65 * it with the s3c_device_nand. This allows @nand to be __initdata. 67 * it with the s3c_device_nand. This allows @nand to be __initdata.
66*/ 68*/
67extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand); 69extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
70
71#endif /*__MTD_NAND_S3C2410_H */
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index 201a69749659..56b7bc32db4f 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -104,15 +104,13 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent);
104 * units, e.g. numbers, bytes, Kbytes, etc 104 * units, e.g. numbers, bytes, Kbytes, etc
105 * 105 *
106 * returns 0 on success and <0 if the counter->usage will exceed the 106 * returns 0 on success and <0 if the counter->usage will exceed the
107 * counter->limit _locked call expects the counter->lock to be taken 107 * counter->limit
108 * 108 *
109 * charge_nofail works the same, except that it charges the resource 109 * charge_nofail works the same, except that it charges the resource
110 * counter unconditionally, and returns < 0 if the after the current 110 * counter unconditionally, and returns < 0 if the after the current
111 * charge we are over limit. 111 * charge we are over limit.
112 */ 112 */
113 113
114int __must_check res_counter_charge_locked(struct res_counter *counter,
115 unsigned long val, bool force);
116int __must_check res_counter_charge(struct res_counter *counter, 114int __must_check res_counter_charge(struct res_counter *counter,
117 unsigned long val, struct res_counter **limit_fail_at); 115 unsigned long val, struct res_counter **limit_fail_at);
118int res_counter_charge_nofail(struct res_counter *counter, 116int res_counter_charge_nofail(struct res_counter *counter,
@@ -125,12 +123,10 @@ int res_counter_charge_nofail(struct res_counter *counter,
125 * @val: the amount of the resource 123 * @val: the amount of the resource
126 * 124 *
127 * these calls check for usage underflow and show a warning on the console 125 * these calls check for usage underflow and show a warning on the console
128 * _locked call expects the counter->lock to be taken
129 * 126 *
130 * returns the total charges still present in @counter. 127 * returns the total charges still present in @counter.
131 */ 128 */
132 129
133u64 res_counter_uncharge_locked(struct res_counter *counter, unsigned long val);
134u64 res_counter_uncharge(struct res_counter *counter, unsigned long val); 130u64 res_counter_uncharge(struct res_counter *counter, unsigned long val);
135 131
136u64 res_counter_uncharge_until(struct res_counter *counter, 132u64 res_counter_uncharge_until(struct res_counter *counter,
diff --git a/include/linux/rio.h b/include/linux/rio.h
index b71d5738e683..6bda06f21930 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -83,7 +83,7 @@
83#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ 83#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */
84 84
85extern struct bus_type rio_bus_type; 85extern struct bus_type rio_bus_type;
86extern struct device rio_bus; 86extern struct class rio_mport_class;
87 87
88struct rio_mport; 88struct rio_mport;
89struct rio_dev; 89struct rio_dev;
@@ -201,6 +201,7 @@ struct rio_dev {
201#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) 201#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
202#define to_rio_dev(n) container_of(n, struct rio_dev, dev) 202#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
203#define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0]) 203#define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0])
204#define to_rio_mport(n) container_of(n, struct rio_mport, dev)
204 205
205/** 206/**
206 * struct rio_msg - RIO message event 207 * struct rio_msg - RIO message event
@@ -248,6 +249,7 @@ enum rio_phy_type {
248 * @phy_type: RapidIO phy type 249 * @phy_type: RapidIO phy type
249 * @phys_efptr: RIO port extended features pointer 250 * @phys_efptr: RIO port extended features pointer
250 * @name: Port name string 251 * @name: Port name string
252 * @dev: device structure associated with an mport
251 * @priv: Master port private data 253 * @priv: Master port private data
252 * @dma: DMA device associated with mport 254 * @dma: DMA device associated with mport
253 * @nscan: RapidIO network enumeration/discovery operations 255 * @nscan: RapidIO network enumeration/discovery operations
@@ -272,6 +274,7 @@ struct rio_mport {
272 enum rio_phy_type phy_type; /* RapidIO phy type */ 274 enum rio_phy_type phy_type; /* RapidIO phy type */
273 u32 phys_efptr; 275 u32 phys_efptr;
274 unsigned char name[RIO_MAX_MPORT_NAME]; 276 unsigned char name[RIO_MAX_MPORT_NAME];
277 struct device dev;
275 void *priv; /* Master port private data */ 278 void *priv; /* Master port private data */
276#ifdef CONFIG_RAPIDIO_DMA_ENGINE 279#ifdef CONFIG_RAPIDIO_DMA_ENGINE
277 struct dma_device dma; 280 struct dma_device dma;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7cb07fd26680..25f54c79f757 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -132,6 +132,10 @@ struct perf_event_context;
132struct blk_plug; 132struct blk_plug;
133struct filename; 133struct filename;
134 134
135#define VMACACHE_BITS 2
136#define VMACACHE_SIZE (1U << VMACACHE_BITS)
137#define VMACACHE_MASK (VMACACHE_SIZE - 1)
138
135/* 139/*
136 * List of flags we want to share for kernel threads, 140 * List of flags we want to share for kernel threads,
137 * if only because they are not used by them anyway. 141 * if only because they are not used by them anyway.
@@ -206,8 +210,9 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq);
206#define __TASK_STOPPED 4 210#define __TASK_STOPPED 4
207#define __TASK_TRACED 8 211#define __TASK_TRACED 8
208/* in tsk->exit_state */ 212/* in tsk->exit_state */
209#define EXIT_ZOMBIE 16 213#define EXIT_DEAD 16
210#define EXIT_DEAD 32 214#define EXIT_ZOMBIE 32
215#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD)
211/* in tsk->state again */ 216/* in tsk->state again */
212#define TASK_DEAD 64 217#define TASK_DEAD 64
213#define TASK_WAKEKILL 128 218#define TASK_WAKEKILL 128
@@ -1235,6 +1240,9 @@ struct task_struct {
1235#ifdef CONFIG_COMPAT_BRK 1240#ifdef CONFIG_COMPAT_BRK
1236 unsigned brk_randomized:1; 1241 unsigned brk_randomized:1;
1237#endif 1242#endif
1243 /* per-thread vma caching */
1244 u32 vmacache_seqnum;
1245 struct vm_area_struct *vmacache[VMACACHE_SIZE];
1238#if defined(SPLIT_RSS_COUNTING) 1246#if defined(SPLIT_RSS_COUNTING)
1239 struct task_rss_stat rss_stat; 1247 struct task_rss_stat rss_stat;
1240#endif 1248#endif
@@ -1711,6 +1719,24 @@ static inline pid_t task_tgid_vnr(struct task_struct *tsk)
1711} 1719}
1712 1720
1713 1721
1722static inline int pid_alive(const struct task_struct *p);
1723static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns)
1724{
1725 pid_t pid = 0;
1726
1727 rcu_read_lock();
1728 if (pid_alive(tsk))
1729 pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns);
1730 rcu_read_unlock();
1731
1732 return pid;
1733}
1734
1735static inline pid_t task_ppid_nr(const struct task_struct *tsk)
1736{
1737 return task_ppid_nr_ns(tsk, &init_pid_ns);
1738}
1739
1714static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, 1740static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk,
1715 struct pid_namespace *ns) 1741 struct pid_namespace *ns)
1716{ 1742{
@@ -1750,7 +1776,7 @@ static inline pid_t task_pgrp_nr(struct task_struct *tsk)
1750 * 1776 *
1751 * Return: 1 if the process is alive. 0 otherwise. 1777 * Return: 1 if the process is alive. 0 otherwise.
1752 */ 1778 */
1753static inline int pid_alive(struct task_struct *p) 1779static inline int pid_alive(const struct task_struct *p)
1754{ 1780{
1755 return p->pids[PIDTYPE_PID].pid != NULL; 1781 return p->pids[PIDTYPE_PID].pid != NULL;
1756} 1782}
@@ -1844,7 +1870,6 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut,
1844#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ 1870#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
1845#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */ 1871#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */
1846#define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ 1872#define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */
1847#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
1848#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ 1873#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
1849#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ 1874#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
1850#define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */ 1875#define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */
@@ -2351,7 +2376,7 @@ extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, i
2351struct task_struct *fork_idle(int); 2376struct task_struct *fork_idle(int);
2352extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 2377extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
2353 2378
2354extern void set_task_comm(struct task_struct *tsk, char *from); 2379extern void set_task_comm(struct task_struct *tsk, const char *from);
2355extern char *get_task_comm(char *to, struct task_struct *tsk); 2380extern char *get_task_comm(char *to, struct task_struct *tsk);
2356 2381
2357#ifdef CONFIG_SMP 2382#ifdef CONFIG_SMP
diff --git a/include/linux/slab.h b/include/linux/slab.h
index b5b2df60299e..307bfbe62387 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -115,9 +115,9 @@ int slab_is_available(void);
115struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 115struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
116 unsigned long, 116 unsigned long,
117 void (*)(void *)); 117 void (*)(void *));
118struct kmem_cache * 118#ifdef CONFIG_MEMCG_KMEM
119kmem_cache_create_memcg(struct mem_cgroup *, const char *, size_t, size_t, 119void kmem_cache_create_memcg(struct mem_cgroup *, struct kmem_cache *);
120 unsigned long, void (*)(void *), struct kmem_cache *); 120#endif
121void kmem_cache_destroy(struct kmem_cache *); 121void kmem_cache_destroy(struct kmem_cache *);
122int kmem_cache_shrink(struct kmem_cache *); 122int kmem_cache_shrink(struct kmem_cache *);
123void kmem_cache_free(struct kmem_cache *, void *); 123void kmem_cache_free(struct kmem_cache *, void *);
@@ -242,6 +242,17 @@ struct kmem_cache {
242#define KMALLOC_MIN_SIZE (1 << KMALLOC_SHIFT_LOW) 242#define KMALLOC_MIN_SIZE (1 << KMALLOC_SHIFT_LOW)
243#endif 243#endif
244 244
245/*
246 * This restriction comes from byte sized index implementation.
247 * Page size is normally 2^12 bytes and, in this case, if we want to use
248 * byte sized index which can represent 2^8 entries, the size of the object
249 * should be equal or greater to 2^12 / 2^8 = 2^4 = 16.
250 * If minimum size of kmalloc is less than 16, we use it as minimum object
251 * size and give up to use byte sized index.
252 */
253#define SLAB_OBJ_MIN_SIZE (KMALLOC_MIN_SIZE < 16 ? \
254 (KMALLOC_MIN_SIZE) : 16)
255
245#ifndef CONFIG_SLOB 256#ifndef CONFIG_SLOB
246extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; 257extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
247#ifdef CONFIG_ZONE_DMA 258#ifdef CONFIG_ZONE_DMA
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index f56bfa9e4526..f2f7398848cf 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -87,6 +87,9 @@ struct kmem_cache {
87#ifdef CONFIG_MEMCG_KMEM 87#ifdef CONFIG_MEMCG_KMEM
88 struct memcg_cache_params *memcg_params; 88 struct memcg_cache_params *memcg_params;
89 int max_attr_size; /* for propagation, maximum size of a stored attr */ 89 int max_attr_size; /* for propagation, maximum size of a stored attr */
90#ifdef CONFIG_SYSFS
91 struct kset *memcg_kset;
92#endif
90#endif 93#endif
91 94
92#ifdef CONFIG_NUMA 95#ifdef CONFIG_NUMA
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h
index bcbb642a7641..087b08a4d333 100644
--- a/include/linux/ssbi.h
+++ b/include/linux/ssbi.h
@@ -20,4 +20,24 @@
20int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len); 20int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len);
21int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); 21int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
22 22
23static inline int
24ssbi_reg_read(void *context, unsigned int reg, unsigned int *val)
25{
26 int ret;
27 u8 v;
28
29 ret = ssbi_read(context, reg, &v, 1);
30 if (!ret)
31 *val = v;
32
33 return ret;
34}
35
36static inline int
37ssbi_reg_write(void *context, unsigned int reg, unsigned int val)
38{
39 u8 v = val;
40 return ssbi_write(context, reg, &v, 1);
41}
42
23#endif 43#endif
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 969c0a671dbf..2ca67b55e0fe 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -32,7 +32,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32#include <linux/sunrpc/sched.h> 32#include <linux/sunrpc/sched.h>
33 33
34#ifdef CONFIG_SUNRPC_BACKCHANNEL 34#ifdef CONFIG_SUNRPC_BACKCHANNEL
35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); 35struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid);
36void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied);
36void xprt_free_bc_request(struct rpc_rqst *req); 37void xprt_free_bc_request(struct rpc_rqst *req);
37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); 38int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
38void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); 39void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs);
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 8af2804bab16..70736b98c721 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -130,6 +130,8 @@ struct rpc_create_args {
130#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9) 130#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
131 131
132struct rpc_clnt *rpc_create(struct rpc_create_args *args); 132struct rpc_clnt *rpc_create(struct rpc_create_args *args);
133struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,
134 struct rpc_xprt *xprt);
133struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 135struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
134 const struct rpc_program *, u32); 136 const struct rpc_program *, u32);
135void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); 137void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt);
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 62fd1b756e99..2e780134f449 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -22,7 +22,7 @@ struct svc_sock {
22 22
23 /* We keep the old state_change and data_ready CB's here */ 23 /* We keep the old state_change and data_ready CB's here */
24 void (*sk_ostate)(struct sock *); 24 void (*sk_ostate)(struct sock *);
25 void (*sk_odata)(struct sock *, int bytes); 25 void (*sk_odata)(struct sock *);
26 void (*sk_owspace)(struct sock *); 26 void (*sk_owspace)(struct sock *);
27 27
28 /* private TCP part */ 28 /* private TCP part */
@@ -56,6 +56,7 @@ int svc_recv(struct svc_rqst *, long);
56int svc_send(struct svc_rqst *); 56int svc_send(struct svc_rqst *);
57void svc_drop(struct svc_rqst *); 57void svc_drop(struct svc_rqst *);
58void svc_sock_update_bufs(struct svc_serv *serv); 58void svc_sock_update_bufs(struct svc_serv *serv);
59bool svc_alien_sock(struct net *net, int fd);
59int svc_addsock(struct svc_serv *serv, const int fd, 60int svc_addsock(struct svc_serv *serv, const int fd,
60 char *name_return, const size_t len); 61 char *name_return, const size_t len);
61void svc_init_xprt_sock(void); 62void svc_init_xprt_sock(void);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 8097b9df6773..3e5efb2b236e 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -295,13 +295,24 @@ int xprt_adjust_timeout(struct rpc_rqst *req);
295void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 295void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
296void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 296void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
297void xprt_release(struct rpc_task *task); 297void xprt_release(struct rpc_task *task);
298struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
299void xprt_put(struct rpc_xprt *xprt); 298void xprt_put(struct rpc_xprt *xprt);
300struct rpc_xprt * xprt_alloc(struct net *net, size_t size, 299struct rpc_xprt * xprt_alloc(struct net *net, size_t size,
301 unsigned int num_prealloc, 300 unsigned int num_prealloc,
302 unsigned int max_req); 301 unsigned int max_req);
303void xprt_free(struct rpc_xprt *); 302void xprt_free(struct rpc_xprt *);
304 303
304/**
305 * xprt_get - return a reference to an RPC transport.
306 * @xprt: pointer to the transport
307 *
308 */
309static inline struct rpc_xprt *xprt_get(struct rpc_xprt *xprt)
310{
311 if (atomic_inc_not_zero(&xprt->count))
312 return xprt;
313 return NULL;
314}
315
305static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) 316static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
306{ 317{
307 return p + xprt->tsh_size; 318 return p + xprt->tsh_size;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2aa8b749f13d..a4a0588c5397 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -119,8 +119,10 @@ extern struct trace_event_functions exit_syscall_print_funcs;
119 static struct syscall_metadata __syscall_meta_##sname; \ 119 static struct syscall_metadata __syscall_meta_##sname; \
120 static struct ftrace_event_call __used \ 120 static struct ftrace_event_call __used \
121 event_enter_##sname = { \ 121 event_enter_##sname = { \
122 .name = "sys_enter"#sname, \
123 .class = &event_class_syscall_enter, \ 122 .class = &event_class_syscall_enter, \
123 { \
124 .name = "sys_enter"#sname, \
125 }, \
124 .event.funcs = &enter_syscall_print_funcs, \ 126 .event.funcs = &enter_syscall_print_funcs, \
125 .data = (void *)&__syscall_meta_##sname,\ 127 .data = (void *)&__syscall_meta_##sname,\
126 .flags = TRACE_EVENT_FL_CAP_ANY, \ 128 .flags = TRACE_EVENT_FL_CAP_ANY, \
@@ -133,8 +135,10 @@ extern struct trace_event_functions exit_syscall_print_funcs;
133 static struct syscall_metadata __syscall_meta_##sname; \ 135 static struct syscall_metadata __syscall_meta_##sname; \
134 static struct ftrace_event_call __used \ 136 static struct ftrace_event_call __used \
135 event_exit_##sname = { \ 137 event_exit_##sname = { \
136 .name = "sys_exit"#sname, \
137 .class = &event_class_syscall_exit, \ 138 .class = &event_class_syscall_exit, \
139 { \
140 .name = "sys_exit"#sname, \
141 }, \
138 .event.funcs = &exit_syscall_print_funcs, \ 142 .event.funcs = &exit_syscall_print_funcs, \
139 .data = (void *)&__syscall_meta_##sname,\ 143 .data = (void *)&__syscall_meta_##sname,\
140 .flags = TRACE_EVENT_FL_CAP_ANY, \ 144 .flags = TRACE_EVENT_FL_CAP_ANY, \
@@ -748,6 +752,9 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
748 int newdfd, const char __user *newname, int flags); 752 int newdfd, const char __user *newname, int flags);
749asmlinkage long sys_renameat(int olddfd, const char __user * oldname, 753asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
750 int newdfd, const char __user * newname); 754 int newdfd, const char __user * newname);
755asmlinkage long sys_renameat2(int olddfd, const char __user *oldname,
756 int newdfd, const char __user *newname,
757 unsigned int flags);
751asmlinkage long sys_futimesat(int dfd, const char __user *filename, 758asmlinkage long sys_futimesat(int dfd, const char __user *filename,
752 struct timeval __user *utimes); 759 struct timeval __user *utimes);
753asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); 760asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index e0bf210ddffd..084354b0e814 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -71,7 +71,8 @@ struct attribute_group {
71 */ 71 */
72 72
73#define __ATTR(_name, _mode, _show, _store) { \ 73#define __ATTR(_name, _mode, _show, _store) { \
74 .attr = {.name = __stringify(_name), .mode = _mode }, \ 74 .attr = {.name = __stringify(_name), \
75 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
75 .show = _show, \ 76 .show = _show, \
76 .store = _store, \ 77 .store = _store, \
77} 78}
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 12ae6ce997d6..7062330a1329 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -188,7 +188,7 @@ DECLARE_PER_CPU(int, numa_node);
188/* Returns the number of the current Node. */ 188/* Returns the number of the current Node. */
189static inline int numa_node_id(void) 189static inline int numa_node_id(void)
190{ 190{
191 return __this_cpu_read(numa_node); 191 return raw_cpu_read(numa_node);
192} 192}
193#endif 193#endif
194 194
@@ -245,7 +245,7 @@ static inline void set_numa_mem(int node)
245/* Returns the number of the nearest Node with memory */ 245/* Returns the number of the nearest Node with memory */
246static inline int numa_mem_id(void) 246static inline int numa_mem_id(void)
247{ 247{
248 return __this_cpu_read(_numa_mem_); 248 return raw_cpu_read(_numa_mem_);
249} 249}
250#endif 250#endif
251 251
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 812b2553dfd8..9d30ee469c2a 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * See Documentation/trace/tracepoints.txt. 7 * See Documentation/trace/tracepoints.txt.
8 * 8 *
9 * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> 9 * Copyright (C) 2008-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 * 10 *
11 * Heavily inspired from the Linux Kernel Markers. 11 * Heavily inspired from the Linux Kernel Markers.
12 * 12 *
@@ -21,6 +21,7 @@
21 21
22struct module; 22struct module;
23struct tracepoint; 23struct tracepoint;
24struct notifier_block;
24 25
25struct tracepoint_func { 26struct tracepoint_func {
26 void *func; 27 void *func;
@@ -35,31 +36,38 @@ struct tracepoint {
35 struct tracepoint_func __rcu *funcs; 36 struct tracepoint_func __rcu *funcs;
36}; 37};
37 38
38/*
39 * Connect a probe to a tracepoint.
40 * Internal API, should not be used directly.
41 */
42extern int tracepoint_probe_register(const char *name, void *probe, void *data);
43
44/*
45 * Disconnect a probe from a tracepoint.
46 * Internal API, should not be used directly.
47 */
48extern int 39extern int
49tracepoint_probe_unregister(const char *name, void *probe, void *data); 40tracepoint_probe_register(struct tracepoint *tp, void *probe, void *data);
41extern int
42tracepoint_probe_unregister(struct tracepoint *tp, void *probe, void *data);
43extern void
44for_each_kernel_tracepoint(void (*fct)(struct tracepoint *tp, void *priv),
45 void *priv);
50 46
51#ifdef CONFIG_MODULES 47#ifdef CONFIG_MODULES
52struct tp_module { 48struct tp_module {
53 struct list_head list; 49 struct list_head list;
54 unsigned int num_tracepoints; 50 struct module *mod;
55 struct tracepoint * const *tracepoints_ptrs;
56}; 51};
52
57bool trace_module_has_bad_taint(struct module *mod); 53bool trace_module_has_bad_taint(struct module *mod);
54extern int register_tracepoint_module_notifier(struct notifier_block *nb);
55extern int unregister_tracepoint_module_notifier(struct notifier_block *nb);
58#else 56#else
59static inline bool trace_module_has_bad_taint(struct module *mod) 57static inline bool trace_module_has_bad_taint(struct module *mod)
60{ 58{
61 return false; 59 return false;
62} 60}
61static inline
62int register_tracepoint_module_notifier(struct notifier_block *nb)
63{
64 return 0;
65}
66static inline
67int unregister_tracepoint_module_notifier(struct notifier_block *nb)
68{
69 return 0;
70}
63#endif /* CONFIG_MODULES */ 71#endif /* CONFIG_MODULES */
64 72
65/* 73/*
@@ -72,6 +80,11 @@ static inline void tracepoint_synchronize_unregister(void)
72 synchronize_sched(); 80 synchronize_sched();
73} 81}
74 82
83#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
84extern void syscall_regfunc(void);
85extern void syscall_unregfunc(void);
86#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
87
75#define PARAMS(args...) args 88#define PARAMS(args...) args
76 89
77#endif /* _LINUX_TRACEPOINT_H */ 90#endif /* _LINUX_TRACEPOINT_H */
@@ -160,14 +173,14 @@ static inline void tracepoint_synchronize_unregister(void)
160 static inline int \ 173 static inline int \
161 register_trace_##name(void (*probe)(data_proto), void *data) \ 174 register_trace_##name(void (*probe)(data_proto), void *data) \
162 { \ 175 { \
163 return tracepoint_probe_register(#name, (void *)probe, \ 176 return tracepoint_probe_register(&__tracepoint_##name, \
164 data); \ 177 (void *)probe, data); \
165 } \ 178 } \
166 static inline int \ 179 static inline int \
167 unregister_trace_##name(void (*probe)(data_proto), void *data) \ 180 unregister_trace_##name(void (*probe)(data_proto), void *data) \
168 { \ 181 { \
169 return tracepoint_probe_unregister(#name, (void *)probe, \ 182 return tracepoint_probe_unregister(&__tracepoint_##name,\
170 data); \ 183 (void *)probe, data); \
171 } \ 184 } \
172 static inline void \ 185 static inline void \
173 check_trace_callback_type_##name(void (*cb)(data_proto)) \ 186 check_trace_callback_type_##name(void (*cb)(data_proto)) \
diff --git a/include/linux/uio.h b/include/linux/uio.h
index c55ce243cc09..199bcc34241b 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -9,14 +9,23 @@
9#ifndef __LINUX_UIO_H 9#ifndef __LINUX_UIO_H
10#define __LINUX_UIO_H 10#define __LINUX_UIO_H
11 11
12#include <linux/kernel.h>
12#include <uapi/linux/uio.h> 13#include <uapi/linux/uio.h>
13 14
15struct page;
14 16
15struct kvec { 17struct kvec {
16 void *iov_base; /* and that should *never* hold a userland pointer */ 18 void *iov_base; /* and that should *never* hold a userland pointer */
17 size_t iov_len; 19 size_t iov_len;
18}; 20};
19 21
22struct iov_iter {
23 const struct iovec *iov;
24 unsigned long nr_segs;
25 size_t iov_offset;
26 size_t count;
27};
28
20/* 29/*
21 * Total number of bytes covered by an iovec. 30 * Total number of bytes covered by an iovec.
22 * 31 *
@@ -34,8 +43,51 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
34 return ret; 43 return ret;
35} 44}
36 45
46static inline struct iovec iov_iter_iovec(const struct iov_iter *iter)
47{
48 return (struct iovec) {
49 .iov_base = iter->iov->iov_base + iter->iov_offset,
50 .iov_len = min(iter->count,
51 iter->iov->iov_len - iter->iov_offset),
52 };
53}
54
55#define iov_for_each(iov, iter, start) \
56 for (iter = (start); \
57 (iter).count && \
58 ((iov = iov_iter_iovec(&(iter))), 1); \
59 iov_iter_advance(&(iter), (iov).iov_len))
60
37unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); 61unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
38 62
63size_t iov_iter_copy_from_user_atomic(struct page *page,
64 struct iov_iter *i, unsigned long offset, size_t bytes);
65size_t iov_iter_copy_from_user(struct page *page,
66 struct iov_iter *i, unsigned long offset, size_t bytes);
67void iov_iter_advance(struct iov_iter *i, size_t bytes);
68int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
69size_t iov_iter_single_seg_count(const struct iov_iter *i);
70size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes,
71 struct iov_iter *i);
72
73static inline void iov_iter_init(struct iov_iter *i,
74 const struct iovec *iov, unsigned long nr_segs,
75 size_t count, size_t written)
76{
77 i->iov = iov;
78 i->nr_segs = nr_segs;
79 i->iov_offset = 0;
80 i->count = count + written;
81
82 iov_iter_advance(i, written);
83}
84
85static inline size_t iov_iter_count(struct iov_iter *i)
86{
87 return i->count;
88}
89
39int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); 90int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
40int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len); 91int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len);
92
41#endif 93#endif
diff --git a/include/linux/vmacache.h b/include/linux/vmacache.h
new file mode 100644
index 000000000000..c3fa0fd43949
--- /dev/null
+++ b/include/linux/vmacache.h
@@ -0,0 +1,38 @@
1#ifndef __LINUX_VMACACHE_H
2#define __LINUX_VMACACHE_H
3
4#include <linux/sched.h>
5#include <linux/mm.h>
6
7/*
8 * Hash based on the page number. Provides a good hit rate for
9 * workloads with good locality and those with random accesses as well.
10 */
11#define VMACACHE_HASH(addr) ((addr >> PAGE_SHIFT) & VMACACHE_MASK)
12
13static inline void vmacache_flush(struct task_struct *tsk)
14{
15 memset(tsk->vmacache, 0, sizeof(tsk->vmacache));
16}
17
18extern void vmacache_flush_all(struct mm_struct *mm);
19extern void vmacache_update(unsigned long addr, struct vm_area_struct *newvma);
20extern struct vm_area_struct *vmacache_find(struct mm_struct *mm,
21 unsigned long addr);
22
23#ifndef CONFIG_MMU
24extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
25 unsigned long start,
26 unsigned long end);
27#endif
28
29static inline void vmacache_invalidate(struct mm_struct *mm)
30{
31 mm->vmacache_seqnum++;
32
33 /* deal with overflows */
34 if (unlikely(mm->vmacache_seqnum == 0))
35 vmacache_flush_all(mm);
36}
37
38#endif /* __LINUX_VMACACHE_H */
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index ea4476157e00..45c9cd1daf7a 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -27,9 +27,13 @@ struct vm_event_state {
27 27
28DECLARE_PER_CPU(struct vm_event_state, vm_event_states); 28DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
29 29
30/*
31 * vm counters are allowed to be racy. Use raw_cpu_ops to avoid the
32 * local_irq_disable overhead.
33 */
30static inline void __count_vm_event(enum vm_event_item item) 34static inline void __count_vm_event(enum vm_event_item item)
31{ 35{
32 __this_cpu_inc(vm_event_states.event[item]); 36 raw_cpu_inc(vm_event_states.event[item]);
33} 37}
34 38
35static inline void count_vm_event(enum vm_event_item item) 39static inline void count_vm_event(enum vm_event_item item)
@@ -39,7 +43,7 @@ static inline void count_vm_event(enum vm_event_item item)
39 43
40static inline void __count_vm_events(enum vm_event_item item, long delta) 44static inline void __count_vm_events(enum vm_event_item item, long delta)
41{ 45{
42 __this_cpu_add(vm_event_states.event[item], delta); 46 raw_cpu_add(vm_event_states.event[item], delta);
43} 47}
44 48
45static inline void count_vm_events(enum vm_event_item item, long delta) 49static inline void count_vm_events(enum vm_event_item item, long delta)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 559044c79232..e7d9d9ed14f5 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -803,17 +803,6 @@ do { \
803 __ret; \ 803 __ret; \
804}) 804})
805 805
806
807/*
808 * These are the old interfaces to sleep waiting for an event.
809 * They are racy. DO NOT use them, use the wait_event* interfaces above.
810 * We plan to remove these interfaces.
811 */
812extern void sleep_on(wait_queue_head_t *q);
813extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
814extern void interruptible_sleep_on(wait_queue_head_t *q);
815extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout);
816
817/* 806/*
818 * Waitqueues which are removed from the waitqueue_head at wakeup time 807 * Waitqueues which are removed from the waitqueue_head at wakeup time
819 */ 808 */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 021b8a319b9e..5777c13849ba 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -178,7 +178,7 @@ int write_cache_pages(struct address_space *mapping,
178 struct writeback_control *wbc, writepage_t writepage, 178 struct writeback_control *wbc, writepage_t writepage,
179 void *data); 179 void *data);
180int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 180int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
181void set_page_dirty_balance(struct page *page, int page_mkwrite); 181void set_page_dirty_balance(struct page *page);
182void writeback_set_ratelimit(void); 182void writeback_set_ratelimit(void);
183void tag_pages_for_writeback(struct address_space *mapping, 183void tag_pages_for_writeback(struct address_space *mapping,
184 pgoff_t start, pgoff_t end); 184 pgoff_t start, pgoff_t end);