aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/platform/aclinux.h1
-rw-r--r--include/asm-generic/checksum.h4
-rw-r--r--include/asm-generic/rwsem.h132
-rw-r--r--include/crypto/algapi.h2
-rw-r--r--include/crypto/blowfish.h23
-rw-r--r--include/crypto/sha.h5
-rw-r--r--include/drm/drmP.h3
-rw-r--r--include/linux/aio.h1
-rw-r--r--include/linux/amba/pl08x.h30
-rw-r--r--include/linux/amba/pl330.h6
-rw-r--r--include/linux/backing-dev.h14
-rw-r--r--include/linux/bcma/bcma.h7
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/blk_types.h11
-rw-r--r--include/linux/blkdev.h42
-rw-r--r--include/linux/cgroup.h2
-rw-r--r--include/linux/clksrc-dbx500-prcmu.h20
-rw-r--r--include/linux/cpu.h4
-rw-r--r--include/linux/cpuidle.h3
-rw-r--r--include/linux/crypto.h11
-rw-r--r--include/linux/cryptouser.h102
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/device-mapper.h45
-rw-r--r--include/linux/device.h15
-rw-r--r--include/linux/device_cgroup.h1
-rw-r--r--include/linux/dm-ioctl.h4
-rw-r--r--include/linux/dm-kcopyd.h4
-rw-r--r--include/linux/dm-log-userspace.h18
-rw-r--r--include/linux/dma-mapping.h13
-rw-r--r--include/linux/dmaengine.h15
-rw-r--r--include/linux/edac.h350
-rw-r--r--include/linux/edac_mce.h31
-rw-r--r--include/linux/elevator.h6
-rw-r--r--include/linux/export.h89
-rw-r--r--include/linux/ext2_fs.h4
-rw-r--r--include/linux/ext3_fs.h6
-rw-r--r--include/linux/ext3_fs_sb.h4
-rw-r--r--include/linux/firmware.h2
-rw-r--r--include/linux/freezer.h11
-rw-r--r--include/linux/fs.h41
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--include/linux/gameport.h17
-rw-r--r--include/linux/genhd.h6
-rw-r--r--include/linux/hid.h9
-rw-r--r--include/linux/hwspinlock.h46
-rw-r--r--include/linux/i2c-omap.h5
-rw-r--r--include/linux/i2c.h10
-rw-r--r--include/linux/i2c/twl4030-madc.h4
-rw-r--r--include/linux/ipmi.h3
-rw-r--r--include/linux/ipmi_smi.h1
-rw-r--r--include/linux/irq.h32
-rw-r--r--include/linux/irqdesc.h1
-rw-r--r--include/linux/irqdomain.h16
-rw-r--r--include/linux/jbd.h64
-rw-r--r--include/linux/jbd2.h69
-rw-r--r--include/linux/jbd_common.h68
-rw-r--r--include/linux/jump_label.h23
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/magic.h10
-rw-r--r--include/linux/mdio-bitbang.h3
-rw-r--r--include/linux/memcontrol.h44
-rw-r--r--include/linux/mfd/ab5500/ab5500.h140
-rw-r--r--include/linux/mfd/ab8500/gpadc.h5
-rw-r--r--include/linux/mfd/abx500.h54
-rw-r--r--include/linux/mfd/db5500-prcmu.h102
-rw-r--r--include/linux/mfd/db8500-prcmu.h368
-rw-r--r--include/linux/mfd/dbx500-prcmu.h549
-rw-r--r--include/linux/mfd/intel_msic.h456
-rw-r--r--include/linux/mfd/max8997-private.h1
-rw-r--r--include/linux/mfd/mc13783.h111
-rw-r--r--include/linux/mfd/mc13xxx.h38
-rw-r--r--include/linux/mfd/pcf50633/core.h3
-rw-r--r--include/linux/mfd/tps6586x.h16
-rw-r--r--include/linux/mfd/wm831x/core.h1
-rw-r--r--include/linux/mfd/wm8994/core.h2
-rw-r--r--include/linux/mfd/wm8994/pdata.h7
-rw-r--r--include/linux/miscdevice.h3
-rw-r--r--include/linux/mlx4/device.h16
-rw-r--r--include/linux/mlx4/qp.h3
-rw-r--r--include/linux/mm.h67
-rw-r--r--include/linux/mm_types.h21
-rw-r--r--include/linux/module.h73
-rw-r--r--include/linux/moduleparam.h5
-rw-r--r--include/linux/mtd/bbm.h39
-rw-r--r--include/linux/mtd/mtd.h85
-rw-r--r--include/linux/mtd/nand.h92
-rw-r--r--include/linux/mtd/onenand.h4
-rw-r--r--include/linux/mtd/partitions.h46
-rw-r--r--include/linux/mtd/physmap.h17
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/netfilter_ipv4/Kbuild1
-rw-r--r--include/linux/netfilter_ipv4/nf_nat.h58
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/nfs_fs.h1
-rw-r--r--include/linux/of.h29
-rw-r--r--include/linux/of_irq.h3
-rw-r--r--include/linux/of_platform.h1
-rw-r--r--include/linux/opp.h4
-rw-r--r--include/linux/pci_hotplug.h10
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/pm_runtime.h1
-rw-r--r--include/linux/pps-gpio.h32
-rw-r--r--include/linux/pstore.h6
-rw-r--r--include/linux/regmap.h2
-rw-r--r--include/linux/regulator/driver.h1
-rw-r--r--include/linux/regulator/gpio-regulator.h87
-rw-r--r--include/linux/regulator/machine.h2
-rw-r--r--include/linux/rio_ids.h1
-rw-r--r--include/linux/rtc/sirfsoc_rtciobrg.h18
-rw-r--r--include/linux/sched.h7
-rw-r--r--include/linux/sem.h49
-rw-r--r--include/linux/serial_sci.h2
-rw-r--r--include/linux/serio.h20
-rw-r--r--include/linux/sh_pfc.h12
-rw-r--r--include/linux/skbuff.h4
-rw-r--r--include/linux/ssb/ssb.h7
-rw-r--r--include/linux/stop_machine.h1
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--include/linux/sunrpc/svc.h1
-rw-r--r--include/linux/sunrpc/svc_xprt.h3
-rw-r--r--include/linux/sysctl.h22
-rw-r--r--include/linux/sysdev.h1
-rw-r--r--include/linux/textsearch.h3
-rw-r--r--include/linux/topology.h4
-rw-r--r--include/linux/uio_driver.h12
-rw-r--r--include/linux/usb.h9
-rw-r--r--include/linux/utsname.h16
-rw-r--r--include/linux/uwb.h1
-rw-r--r--include/linux/uwb/umc.h7
-rw-r--r--include/linux/vermagic.h1
-rw-r--r--include/linux/videodev2.h27
-rw-r--r--include/linux/virtio.h4
-rw-r--r--include/linux/virtio_config.h3
-rw-r--r--include/linux/virtio_mmio.h111
-rw-r--r--include/linux/virtio_ring.h6
-rw-r--r--include/linux/vlynq.h3
-rw-r--r--include/linux/writeback.h33
-rw-r--r--include/media/ov772x.h26
-rw-r--r--include/media/s5k6aa.h51
-rw-r--r--include/media/saa7146.h3
-rw-r--r--include/media/soc_camera.h104
-rw-r--r--include/media/soc_camera_platform.h4
-rw-r--r--include/media/soc_mediabus.h2
-rw-r--r--include/media/v4l2-int-device.h3
-rw-r--r--include/media/v4l2-ioctl.h2
-rw-r--r--include/media/v4l2-subdev.h5
-rw-r--r--include/media/videobuf2-core.h50
-rw-r--r--include/mtd/mtd-abi.h122
-rw-r--r--include/net/bluetooth/hci_core.h24
-rw-r--r--include/net/inet_timewait_sock.h1
-rw-r--r--include/net/ip_vs.h26
-rw-r--r--include/net/lib80211.h3
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h27
-rw-r--r--include/net/netfilter/nf_nat.h26
-rw-r--r--include/net/sch_generic.h1
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tcp.h10
-rw-r--r--include/net/udp.h12
-rw-r--r--include/rdma/ib_user_verbs.h48
-rw-r--r--include/rdma/ib_verbs.h106
-rw-r--r--include/rdma/iw_cm.h4
-rw-r--r--include/rdma/rdma_cm.h1
-rw-r--r--include/rdma/rdma_user_cm.h3
-rw-r--r--include/sound/core.h2
-rw-r--r--include/target/target_core_base.h13
-rw-r--r--include/target/target_core_device.h2
-rw-r--r--include/target/target_core_fabric_ops.h11
-rw-r--r--include/target/target_core_transport.h7
-rw-r--r--include/trace/define_trace.h10
-rw-r--r--include/trace/events/ext4.h480
-rw-r--r--include/trace/events/module.h2
-rw-r--r--include/trace/events/writeback.h161
-rw-r--r--include/xen/grant_table.h1
-rw-r--r--include/xen/interface/io/blkif.h36
-rw-r--r--include/xen/interface/platform.h320
-rw-r--r--include/xen/interface/xen.h1
-rw-r--r--include/xen/xenbus.h1
179 files changed, 4709 insertions, 1496 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index f72403c4b51a..f4b2effe0333 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -55,7 +55,6 @@
55 55
56#include <linux/string.h> 56#include <linux/string.h>
57#include <linux/kernel.h> 57#include <linux/kernel.h>
58#include <linux/module.h>
59#include <linux/ctype.h> 58#include <linux/ctype.h>
60#include <linux/sched.h> 59#include <linux/sched.h>
61#include <asm/system.h> 60#include <asm/system.h>
diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h
index 4647c762d970..c084767c88bc 100644
--- a/include/asm-generic/checksum.h
+++ b/include/asm-generic/checksum.h
@@ -33,8 +33,10 @@ extern __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
33extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, 33extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
34 int len, __wsum sum, int *csum_err); 34 int len, __wsum sum, int *csum_err);
35 35
36#ifndef csum_partial_copy_nocheck
36#define csum_partial_copy_nocheck(src, dst, len, sum) \ 37#define csum_partial_copy_nocheck(src, dst, len, sum) \
37 csum_partial_copy((src), (dst), (len), (sum)) 38 csum_partial_copy((src), (dst), (len), (sum))
39#endif
38 40
39/* 41/*
40 * This is a version of ip_compute_csum() optimized for IP headers, 42 * This is a version of ip_compute_csum() optimized for IP headers,
@@ -63,12 +65,14 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
63 unsigned short proto, __wsum sum); 65 unsigned short proto, __wsum sum);
64#endif 66#endif
65 67
68#ifndef csum_tcpudp_magic
66static inline __sum16 69static inline __sum16
67csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, 70csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
68 unsigned short proto, __wsum sum) 71 unsigned short proto, __wsum sum)
69{ 72{
70 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); 73 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
71} 74}
75#endif
72 76
73/* 77/*
74 * this routine is used for miscellaneous IP-like checksums, mainly 78 * this routine is used for miscellaneous IP-like checksums, mainly
diff --git a/include/asm-generic/rwsem.h b/include/asm-generic/rwsem.h
new file mode 100644
index 000000000000..bb1e2cdeb9bf
--- /dev/null
+++ b/include/asm-generic/rwsem.h
@@ -0,0 +1,132 @@
1#ifndef _ASM_POWERPC_RWSEM_H
2#define _ASM_POWERPC_RWSEM_H
3
4#ifndef _LINUX_RWSEM_H
5#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
6#endif
7
8#ifdef __KERNEL__
9
10/*
11 * R/W semaphores for PPC using the stuff in lib/rwsem.c.
12 * Adapted largely from include/asm-i386/rwsem.h
13 * by Paul Mackerras <paulus@samba.org>.
14 */
15
16/*
17 * the semaphore definition
18 */
19#ifdef CONFIG_PPC64
20# define RWSEM_ACTIVE_MASK 0xffffffffL
21#else
22# define RWSEM_ACTIVE_MASK 0x0000ffffL
23#endif
24
25#define RWSEM_UNLOCKED_VALUE 0x00000000L
26#define RWSEM_ACTIVE_BIAS 0x00000001L
27#define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1)
28#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
29#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
30
31/*
32 * lock for reading
33 */
34static inline void __down_read(struct rw_semaphore *sem)
35{
36 if (unlikely(atomic_long_inc_return((atomic_long_t *)&sem->count) <= 0))
37 rwsem_down_read_failed(sem);
38}
39
40static inline int __down_read_trylock(struct rw_semaphore *sem)
41{
42 long tmp;
43
44 while ((tmp = sem->count) >= 0) {
45 if (tmp == cmpxchg(&sem->count, tmp,
46 tmp + RWSEM_ACTIVE_READ_BIAS)) {
47 return 1;
48 }
49 }
50 return 0;
51}
52
53/*
54 * lock for writing
55 */
56static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
57{
58 long tmp;
59
60 tmp = atomic_long_add_return(RWSEM_ACTIVE_WRITE_BIAS,
61 (atomic_long_t *)&sem->count);
62 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
63 rwsem_down_write_failed(sem);
64}
65
66static inline void __down_write(struct rw_semaphore *sem)
67{
68 __down_write_nested(sem, 0);
69}
70
71static inline int __down_write_trylock(struct rw_semaphore *sem)
72{
73 long tmp;
74
75 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
76 RWSEM_ACTIVE_WRITE_BIAS);
77 return tmp == RWSEM_UNLOCKED_VALUE;
78}
79
80/*
81 * unlock after reading
82 */
83static inline void __up_read(struct rw_semaphore *sem)
84{
85 long tmp;
86
87 tmp = atomic_long_dec_return((atomic_long_t *)&sem->count);
88 if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0))
89 rwsem_wake(sem);
90}
91
92/*
93 * unlock after writing
94 */
95static inline void __up_write(struct rw_semaphore *sem)
96{
97 if (unlikely(atomic_long_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
98 (atomic_long_t *)&sem->count) < 0))
99 rwsem_wake(sem);
100}
101
102/*
103 * implement atomic add functionality
104 */
105static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
106{
107 atomic_long_add(delta, (atomic_long_t *)&sem->count);
108}
109
110/*
111 * downgrade write lock to read lock
112 */
113static inline void __downgrade_write(struct rw_semaphore *sem)
114{
115 long tmp;
116
117 tmp = atomic_long_add_return(-RWSEM_WAITING_BIAS,
118 (atomic_long_t *)&sem->count);
119 if (tmp < 0)
120 rwsem_downgrade_wake(sem);
121}
122
123/*
124 * implement exchange and add functionality
125 */
126static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
127{
128 return atomic_long_add_return(delta, (atomic_long_t *)&sem->count);
129}
130
131#endif /* __KERNEL__ */
132#endif /* _ASM_POWERPC_RWSEM_H */
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 59c3e5bd2c06..ecc721def10c 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -15,6 +15,7 @@
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/skbuff.h>
18 19
19struct module; 20struct module;
20struct rtattr; 21struct rtattr;
@@ -26,6 +27,7 @@ struct crypto_type {
26 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); 27 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
27 int (*init_tfm)(struct crypto_tfm *tfm); 28 int (*init_tfm)(struct crypto_tfm *tfm);
28 void (*show)(struct seq_file *m, struct crypto_alg *alg); 29 void (*show)(struct seq_file *m, struct crypto_alg *alg);
30 int (*report)(struct sk_buff *skb, struct crypto_alg *alg);
29 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); 31 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask);
30 32
31 unsigned int type; 33 unsigned int type;
diff --git a/include/crypto/blowfish.h b/include/crypto/blowfish.h
new file mode 100644
index 000000000000..1450d4a27980
--- /dev/null
+++ b/include/crypto/blowfish.h
@@ -0,0 +1,23 @@
1/*
2 * Common values for blowfish algorithms
3 */
4
5#ifndef _CRYPTO_BLOWFISH_H
6#define _CRYPTO_BLOWFISH_H
7
8#include <linux/types.h>
9#include <linux/crypto.h>
10
11#define BF_BLOCK_SIZE 8
12#define BF_MIN_KEY_SIZE 4
13#define BF_MAX_KEY_SIZE 56
14
15struct bf_ctx {
16 u32 p[18];
17 u32 s[1024];
18};
19
20int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key,
21 unsigned int key_len);
22
23#endif
diff --git a/include/crypto/sha.h b/include/crypto/sha.h
index 069e85ba97e1..c6c9c1fe460c 100644
--- a/include/crypto/sha.h
+++ b/include/crypto/sha.h
@@ -82,4 +82,9 @@ struct sha512_state {
82 u8 buf[SHA512_BLOCK_SIZE]; 82 u8 buf[SHA512_BLOCK_SIZE];
83}; 83};
84 84
85struct shash_desc;
86
87extern int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
88 unsigned int len);
89
85#endif 90#endif
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index cf3b446139ea..cf399495d38f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -42,7 +42,6 @@
42 * can build the DRM (part of PI DRI). 4/21/2000 S + B */ 42 * can build the DRM (part of PI DRI). 4/21/2000 S + B */
43#include <asm/current.h> 43#include <asm/current.h>
44#endif /* __alpha__ */ 44#endif /* __alpha__ */
45#include <linux/module.h>
46#include <linux/kernel.h> 45#include <linux/kernel.h>
47#include <linux/miscdevice.h> 46#include <linux/miscdevice.h>
48#include <linux/fs.h> 47#include <linux/fs.h>
@@ -80,6 +79,8 @@
80#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 79#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
81#define __OS_HAS_MTRR (defined(CONFIG_MTRR)) 80#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
82 81
82struct module;
83
83struct drm_file; 84struct drm_file;
84struct drm_device; 85struct drm_device;
85 86
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 2dcb72bff4b6..2314ad8b3c9c 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -117,6 +117,7 @@ struct kiocb {
117 117
118 struct list_head ki_list; /* the aio core uses this 118 struct list_head ki_list; /* the aio core uses this
119 * for cancellation */ 119 * for cancellation */
120 struct list_head ki_batch; /* batch allocation */
120 121
121 /* 122 /*
122 * If the aio_resfd field of the userspace iocb is not zero, 123 * If the aio_resfd field of the userspace iocb is not zero,
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index e6e28f37d8ec..9eabffbc4e50 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -47,6 +47,9 @@ enum {
47 * @muxval: a number usually used to poke into some mux regiser to 47 * @muxval: a number usually used to poke into some mux regiser to
48 * mux in the signal to this channel 48 * mux in the signal to this channel
49 * @cctl_opt: default options for the channel control register 49 * @cctl_opt: default options for the channel control register
50 * @device_fc: Flow Controller Settings for ccfg register. Only valid for slave
51 * channels. Fill with 'true' if peripheral should be flow controller. Direction
52 * will be selected at Runtime.
50 * @addr: source/target address in physical memory for this DMA channel, 53 * @addr: source/target address in physical memory for this DMA channel,
51 * can be the address of a FIFO register for burst requests for example. 54 * can be the address of a FIFO register for burst requests for example.
52 * This can be left undefined if the PrimeCell API is used for configuring 55 * This can be left undefined if the PrimeCell API is used for configuring
@@ -65,6 +68,7 @@ struct pl08x_channel_data {
65 int max_signal; 68 int max_signal;
66 u32 muxval; 69 u32 muxval;
67 u32 cctl; 70 u32 cctl;
71 bool device_fc;
68 dma_addr_t addr; 72 dma_addr_t addr;
69 bool circular_buffer; 73 bool circular_buffer;
70 bool single; 74 bool single;
@@ -77,13 +81,11 @@ struct pl08x_channel_data {
77 * @addr: current address 81 * @addr: current address
78 * @maxwidth: the maximum width of a transfer on this bus 82 * @maxwidth: the maximum width of a transfer on this bus
79 * @buswidth: the width of this bus in bytes: 1, 2 or 4 83 * @buswidth: the width of this bus in bytes: 1, 2 or 4
80 * @fill_bytes: bytes required to fill to the next bus memory boundary
81 */ 84 */
82struct pl08x_bus_data { 85struct pl08x_bus_data {
83 dma_addr_t addr; 86 dma_addr_t addr;
84 u8 maxwidth; 87 u8 maxwidth;
85 u8 buswidth; 88 u8 buswidth;
86 size_t fill_bytes;
87}; 89};
88 90
89/** 91/**
@@ -104,17 +106,35 @@ struct pl08x_phy_chan {
104}; 106};
105 107
106/** 108/**
109 * struct pl08x_sg - structure containing data per sg
110 * @src_addr: src address of sg
111 * @dst_addr: dst address of sg
112 * @len: transfer len in bytes
113 * @node: node for txd's dsg_list
114 */
115struct pl08x_sg {
116 dma_addr_t src_addr;
117 dma_addr_t dst_addr;
118 size_t len;
119 struct list_head node;
120};
121
122/**
107 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor 123 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor
124 * @tx: async tx descriptor
125 * @node: node for txd list for channels
126 * @dsg_list: list of children sg's
127 * @direction: direction of transfer
108 * @llis_bus: DMA memory address (physical) start for the LLIs 128 * @llis_bus: DMA memory address (physical) start for the LLIs
109 * @llis_va: virtual memory address start for the LLIs 129 * @llis_va: virtual memory address start for the LLIs
130 * @cctl: control reg values for current txd
131 * @ccfg: config reg values for current txd
110 */ 132 */
111struct pl08x_txd { 133struct pl08x_txd {
112 struct dma_async_tx_descriptor tx; 134 struct dma_async_tx_descriptor tx;
113 struct list_head node; 135 struct list_head node;
136 struct list_head dsg_list;
114 enum dma_data_direction direction; 137 enum dma_data_direction direction;
115 dma_addr_t src_addr;
116 dma_addr_t dst_addr;
117 size_t len;
118 dma_addr_t llis_bus; 138 dma_addr_t llis_bus;
119 struct pl08x_lli *llis_va; 139 struct pl08x_lli *llis_va;
120 /* Default cctl value for LLIs */ 140 /* Default cctl value for LLIs */
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h
index cbee7de7dd36..d12f077a6daf 100644
--- a/include/linux/amba/pl330.h
+++ b/include/linux/amba/pl330.h
@@ -19,12 +19,8 @@ struct dma_pl330_peri {
19 * Peri_Req i/f of the DMAC that is 19 * Peri_Req i/f of the DMAC that is
20 * peripheral could be reached from. 20 * peripheral could be reached from.
21 */ 21 */
22 u8 peri_id; /* {0, 31} */ 22 u8 peri_id; /* specific dma id */
23 enum pl330_reqtype rqtype; 23 enum pl330_reqtype rqtype;
24
25 /* For M->D and D->M Channels */
26 int burst_sz; /* in power of 2 */
27 dma_addr_t fifo_addr;
28}; 24};
29 25
30struct dma_pl330_platdata { 26struct dma_pl330_platdata {
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3b2f9cb82986..b1038bd686ac 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int);
40enum bdi_stat_item { 40enum bdi_stat_item {
41 BDI_RECLAIMABLE, 41 BDI_RECLAIMABLE,
42 BDI_WRITEBACK, 42 BDI_WRITEBACK,
43 BDI_DIRTIED,
43 BDI_WRITTEN, 44 BDI_WRITTEN,
44 NR_BDI_STAT_ITEMS 45 NR_BDI_STAT_ITEMS
45}; 46};
@@ -74,10 +75,20 @@ struct backing_dev_info {
74 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; 75 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
75 76
76 unsigned long bw_time_stamp; /* last time write bw is updated */ 77 unsigned long bw_time_stamp; /* last time write bw is updated */
78 unsigned long dirtied_stamp;
77 unsigned long written_stamp; /* pages written at bw_time_stamp */ 79 unsigned long written_stamp; /* pages written at bw_time_stamp */
78 unsigned long write_bandwidth; /* the estimated write bandwidth */ 80 unsigned long write_bandwidth; /* the estimated write bandwidth */
79 unsigned long avg_write_bandwidth; /* further smoothed write bw */ 81 unsigned long avg_write_bandwidth; /* further smoothed write bw */
80 82
83 /*
84 * The base dirty throttle rate, re-calculated on every 200ms.
85 * All the bdi tasks' dirty rate will be curbed under it.
86 * @dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit
87 * in small steps and is much more smooth/stable than the latter.
88 */
89 unsigned long dirty_ratelimit;
90 unsigned long balanced_dirty_ratelimit;
91
81 struct prop_local_percpu completions; 92 struct prop_local_percpu completions;
82 int dirty_exceeded; 93 int dirty_exceeded;
83 94
@@ -107,7 +118,8 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
107int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 118int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
108void bdi_unregister(struct backing_dev_info *bdi); 119void bdi_unregister(struct backing_dev_info *bdi);
109int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); 120int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int);
110void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages); 121void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
122 enum wb_reason reason);
111void bdi_start_background_writeback(struct backing_dev_info *bdi); 123void bdi_start_background_writeback(struct backing_dev_info *bdi);
112int bdi_writeback_thread(void *data); 124int bdi_writeback_thread(void *data);
113int bdi_has_dirty_io(struct backing_dev_info *bdi); 125int bdi_has_dirty_io(struct backing_dev_info *bdi);
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 5dbd7055cb86..4d4b59de9467 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -170,10 +170,9 @@ struct bcma_driver {
170}; 170};
171extern 171extern
172int __bcma_driver_register(struct bcma_driver *drv, struct module *owner); 172int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
173static inline int bcma_driver_register(struct bcma_driver *drv) 173#define bcma_driver_register(drv) \
174{ 174 __bcma_driver_register(drv, THIS_MODULE)
175 return __bcma_driver_register(drv, THIS_MODULE); 175
176}
177extern void bcma_driver_unregister(struct bcma_driver *drv); 176extern void bcma_driver_unregister(struct bcma_driver *drv);
178 177
179struct bcma_bus { 178struct bcma_bus {
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ce33e6868a2f..a3c071c9e189 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -269,14 +269,6 @@ extern void bvec_free_bs(struct bio_set *, struct bio_vec *, unsigned int);
269extern unsigned int bvec_nr_vecs(unsigned short idx); 269extern unsigned int bvec_nr_vecs(unsigned short idx);
270 270
271/* 271/*
272 * Allow queuer to specify a completion CPU for this bio
273 */
274static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu)
275{
276 bio->bi_comp_cpu = cpu;
277}
278
279/*
280 * bio_set is used to allow other portions of the IO system to 272 * bio_set is used to allow other portions of the IO system to
281 * allocate their own private memory pools for bio and iovec structures. 273 * allocate their own private memory pools for bio and iovec structures.
282 * These memory pools in turn all allocate from the bio_slab 274 * These memory pools in turn all allocate from the bio_slab
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 71fc53bb8f1c..4053cbd4490e 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -59,8 +59,6 @@ struct bio {
59 59
60 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ 60 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
61 61
62 unsigned int bi_comp_cpu; /* completion CPU */
63
64 atomic_t bi_cnt; /* pin count */ 62 atomic_t bi_cnt; /* pin count */
65 63
66 struct bio_vec *bi_io_vec; /* the actual vec list */ 64 struct bio_vec *bi_io_vec; /* the actual vec list */
@@ -93,11 +91,10 @@ struct bio {
93#define BIO_BOUNCED 5 /* bio is a bounce bio */ 91#define BIO_BOUNCED 5 /* bio is a bounce bio */
94#define BIO_USER_MAPPED 6 /* contains user pages */ 92#define BIO_USER_MAPPED 6 /* contains user pages */
95#define BIO_EOPNOTSUPP 7 /* not supported */ 93#define BIO_EOPNOTSUPP 7 /* not supported */
96#define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ 94#define BIO_NULL_MAPPED 8 /* contains invalid user pages */
97#define BIO_NULL_MAPPED 9 /* contains invalid user pages */ 95#define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */
98#define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ 96#define BIO_QUIET 10 /* Make BIO Quiet */
99#define BIO_QUIET 11 /* Make BIO Quiet */ 97#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
100#define BIO_MAPPED_INTEGRITY 12/* integrity metadata has been remapped */
101#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) 98#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
102 99
103/* 100/*
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 7fbaa9103344..c7a6d3b5bc7b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -14,7 +14,6 @@
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <linux/mempool.h> 15#include <linux/mempool.h>
16#include <linux/bio.h> 16#include <linux/bio.h>
17#include <linux/module.h>
18#include <linux/stringify.h> 17#include <linux/stringify.h>
19#include <linux/gfp.h> 18#include <linux/gfp.h>
20#include <linux/bsg.h> 19#include <linux/bsg.h>
@@ -22,6 +21,7 @@
22 21
23#include <asm/scatterlist.h> 22#include <asm/scatterlist.h>
24 23
24struct module;
25struct scsi_ioctl_command; 25struct scsi_ioctl_command;
26 26
27struct request_queue; 27struct request_queue;
@@ -195,7 +195,7 @@ struct request_pm_state
195#include <linux/elevator.h> 195#include <linux/elevator.h>
196 196
197typedef void (request_fn_proc) (struct request_queue *q); 197typedef void (request_fn_proc) (struct request_queue *q);
198typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); 198typedef void (make_request_fn) (struct request_queue *q, struct bio *bio);
199typedef int (prep_rq_fn) (struct request_queue *, struct request *); 199typedef int (prep_rq_fn) (struct request_queue *, struct request *);
200typedef void (unprep_rq_fn) (struct request_queue *, struct request *); 200typedef void (unprep_rq_fn) (struct request_queue *, struct request *);
201 201
@@ -680,6 +680,8 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, 680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
681 struct scsi_ioctl_command __user *); 681 struct scsi_ioctl_command __user *);
682 682
683extern void blk_queue_bio(struct request_queue *q, struct bio *bio);
684
683/* 685/*
684 * A queue has just exitted congestion. Note this in the global counter of 686 * A queue has just exitted congestion. Note this in the global counter of
685 * congested queues, and wake up anyone who was waiting for requests to be 687 * congested queues, and wake up anyone who was waiting for requests to be
@@ -863,16 +865,22 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int);
863extern void blk_put_queue(struct request_queue *); 865extern void blk_put_queue(struct request_queue *);
864 866
865/* 867/*
866 * Note: Code in between changing the blk_plug list/cb_list or element of such 868 * blk_plug permits building a queue of related requests by holding the I/O
867 * lists is preemptable, but such code can't do sleep (or be very careful), 869 * fragments for a short period. This allows merging of sequential requests
868 * otherwise data is corrupted. For details, please check schedule() where 870 * into single larger request. As the requests are moved from a per-task list to
869 * blk_schedule_flush_plug() is called. 871 * the device's request_queue in a batch, this results in improved scalability
872 * as the lock contention for request_queue lock is reduced.
873 *
874 * It is ok not to disable preemption when adding the request to the plug list
875 * or when attempting a merge, because blk_schedule_flush_list() will only flush
876 * the plug list when the task sleeps by itself. For details, please see
877 * schedule() where blk_schedule_flush_plug() is called.
870 */ 878 */
871struct blk_plug { 879struct blk_plug {
872 unsigned long magic; 880 unsigned long magic; /* detect uninitialized use-cases */
873 struct list_head list; 881 struct list_head list; /* requests */
874 struct list_head cb_list; 882 struct list_head cb_list; /* md requires an unplug callback */
875 unsigned int should_sort; 883 unsigned int should_sort; /* list to be sorted before flushing? */
876}; 884};
877#define BLK_MAX_REQUEST_COUNT 16 885#define BLK_MAX_REQUEST_COUNT 16
878 886
@@ -1189,20 +1197,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req)
1189} 1197}
1190#endif 1198#endif
1191 1199
1192#ifdef CONFIG_BLK_DEV_THROTTLING
1193extern int blk_throtl_init(struct request_queue *q);
1194extern void blk_throtl_exit(struct request_queue *q);
1195extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
1196#else /* CONFIG_BLK_DEV_THROTTLING */
1197static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
1198{
1199 return 0;
1200}
1201
1202static inline int blk_throtl_init(struct request_queue *q) { return 0; }
1203static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
1204#endif /* CONFIG_BLK_DEV_THROTTLING */
1205
1206#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1200#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1207 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1201 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1208#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1202#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index da7e4bc34e8c..1b7f9d525013 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -516,7 +516,7 @@ struct cgroup_subsys {
516 struct list_head sibling; 516 struct list_head sibling;
517 /* used when use_id == true */ 517 /* used when use_id == true */
518 struct idr idr; 518 struct idr idr;
519 spinlock_t id_lock; 519 rwlock_t id_lock;
520 520
521 /* should be defined only by modular subsystems */ 521 /* should be defined only by modular subsystems */
522 struct module *module; 522 struct module *module;
diff --git a/include/linux/clksrc-dbx500-prcmu.h b/include/linux/clksrc-dbx500-prcmu.h
new file mode 100644
index 000000000000..4fb8119c49e4
--- /dev/null
+++ b/include/linux/clksrc-dbx500-prcmu.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
6 *
7 */
8#ifndef __CLKSRC_DBX500_PRCMU_H
9#define __CLKSRC_DBX500_PRCMU_H
10
11#include <linux/init.h>
12#include <linux/io.h>
13
14#ifdef CONFIG_CLKSRC_DBX500_PRCMU
15void __init clksrc_dbx500_prcmu_init(void __iomem *base);
16#else
17static inline void __init clksrc_dbx500_prcmu_init(void __iomem *base) {}
18#endif
19
20#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index b1a635acf72a..6cb60fd2ea84 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -196,13 +196,9 @@ static inline void cpu_hotplug_driver_unlock(void)
196#endif /* CONFIG_HOTPLUG_CPU */ 196#endif /* CONFIG_HOTPLUG_CPU */
197 197
198#ifdef CONFIG_PM_SLEEP_SMP 198#ifdef CONFIG_PM_SLEEP_SMP
199extern int suspend_cpu_hotplug;
200
201extern int disable_nonboot_cpus(void); 199extern int disable_nonboot_cpus(void);
202extern void enable_nonboot_cpus(void); 200extern void enable_nonboot_cpus(void);
203#else /* !CONFIG_PM_SLEEP_SMP */ 201#else /* !CONFIG_PM_SLEEP_SMP */
204#define suspend_cpu_hotplug 0
205
206static inline int disable_nonboot_cpus(void) { return 0; } 202static inline int disable_nonboot_cpus(void) { return 0; }
207static inline void enable_nonboot_cpus(void) {} 203static inline void enable_nonboot_cpus(void) {}
208#endif /* !CONFIG_PM_SLEEP_SMP */ 204#endif /* !CONFIG_PM_SLEEP_SMP */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index b51629e15cfc..583baf22cad2 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -13,7 +13,6 @@
13 13
14#include <linux/percpu.h> 14#include <linux/percpu.h>
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/module.h>
17#include <linux/kobject.h> 16#include <linux/kobject.h>
18#include <linux/completion.h> 17#include <linux/completion.h>
19 18
@@ -21,6 +20,8 @@
21#define CPUIDLE_NAME_LEN 16 20#define CPUIDLE_NAME_LEN 16
22#define CPUIDLE_DESC_LEN 32 21#define CPUIDLE_DESC_LEN 32
23 22
23struct module;
24
24struct cpuidle_device; 25struct cpuidle_device;
25 26
26 27
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index e5e468e9133d..8a94217b298e 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -18,7 +18,6 @@
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <linux/atomic.h> 20#include <linux/atomic.h>
21#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/list.h> 22#include <linux/list.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
@@ -72,6 +71,11 @@
72#define CRYPTO_ALG_TESTED 0x00000400 71#define CRYPTO_ALG_TESTED 0x00000400
73 72
74/* 73/*
74 * Set if the algorithm is an instance that is build from templates.
75 */
76#define CRYPTO_ALG_INSTANCE 0x00000800
77
78/*
75 * Transform masks and values (for crt_flags). 79 * Transform masks and values (for crt_flags).
76 */ 80 */
77#define CRYPTO_TFM_REQ_MASK 0x000fff00 81#define CRYPTO_TFM_REQ_MASK 0x000fff00
@@ -505,11 +509,6 @@ static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm)
505 return tfm->__crt_alg->cra_priority; 509 return tfm->__crt_alg->cra_priority;
506} 510}
507 511
508static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm)
509{
510 return module_name(tfm->__crt_alg->cra_module);
511}
512
513static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) 512static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
514{ 513{
515 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; 514 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
diff --git a/include/linux/cryptouser.h b/include/linux/cryptouser.h
new file mode 100644
index 000000000000..532fb58f16bf
--- /dev/null
+++ b/include/linux/cryptouser.h
@@ -0,0 +1,102 @@
1/*
2 * Crypto user configuration API.
3 *
4 * Copyright (C) 2011 secunet Security Networks AG
5 * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21/* Netlink configuration messages. */
22enum {
23 CRYPTO_MSG_BASE = 0x10,
24 CRYPTO_MSG_NEWALG = 0x10,
25 CRYPTO_MSG_DELALG,
26 CRYPTO_MSG_UPDATEALG,
27 CRYPTO_MSG_GETALG,
28 __CRYPTO_MSG_MAX
29};
30#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
31#define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
32
33#define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
34
35/* Netlink message attributes. */
36enum crypto_attr_type_t {
37 CRYPTOCFGA_UNSPEC,
38 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
39 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
40 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
41 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
42 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
43 CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
44 CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
45 CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
46 __CRYPTOCFGA_MAX
47
48#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
49};
50
51struct crypto_user_alg {
52 char cru_name[CRYPTO_MAX_ALG_NAME];
53 char cru_driver_name[CRYPTO_MAX_ALG_NAME];
54 char cru_module_name[CRYPTO_MAX_ALG_NAME];
55 __u32 cru_type;
56 __u32 cru_mask;
57 __u32 cru_refcnt;
58 __u32 cru_flags;
59};
60
61struct crypto_report_larval {
62 char type[CRYPTO_MAX_NAME];
63};
64
65struct crypto_report_hash {
66 char type[CRYPTO_MAX_NAME];
67 unsigned int blocksize;
68 unsigned int digestsize;
69};
70
71struct crypto_report_cipher {
72 char type[CRYPTO_MAX_ALG_NAME];
73 unsigned int blocksize;
74 unsigned int min_keysize;
75 unsigned int max_keysize;
76};
77
78struct crypto_report_blkcipher {
79 char type[CRYPTO_MAX_NAME];
80 char geniv[CRYPTO_MAX_NAME];
81 unsigned int blocksize;
82 unsigned int min_keysize;
83 unsigned int max_keysize;
84 unsigned int ivsize;
85};
86
87struct crypto_report_aead {
88 char type[CRYPTO_MAX_NAME];
89 char geniv[CRYPTO_MAX_NAME];
90 unsigned int blocksize;
91 unsigned int maxauthsize;
92 unsigned int ivsize;
93};
94
95struct crypto_report_comp {
96 char type[CRYPTO_MAX_NAME];
97};
98
99struct crypto_report_rng {
100 char type[CRYPTO_MAX_NAME];
101 unsigned int seedsize;
102};
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 62157c03caf7..4df926199369 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -165,6 +165,7 @@ struct dentry_operations {
165 unsigned int, const char *, const struct qstr *); 165 unsigned int, const char *, const struct qstr *);
166 int (*d_delete)(const struct dentry *); 166 int (*d_delete)(const struct dentry *);
167 void (*d_release)(struct dentry *); 167 void (*d_release)(struct dentry *);
168 void (*d_prune)(struct dentry *);
168 void (*d_iput)(struct dentry *, struct inode *); 169 void (*d_iput)(struct dentry *, struct inode *);
169 char *(*d_dname)(struct dentry *, char *, int); 170 char *(*d_dname)(struct dentry *, char *, int);
170 struct vfsmount *(*d_automount)(struct path *); 171 struct vfsmount *(*d_automount)(struct path *);
@@ -184,8 +185,9 @@ struct dentry_operations {
184#define DCACHE_OP_COMPARE 0x0002 185#define DCACHE_OP_COMPARE 0x0002
185#define DCACHE_OP_REVALIDATE 0x0004 186#define DCACHE_OP_REVALIDATE 0x0004
186#define DCACHE_OP_DELETE 0x0008 187#define DCACHE_OP_DELETE 0x0008
188#define DCACHE_OP_PRUNE 0x0010
187 189
188#define DCACHE_DISCONNECTED 0x0010 190#define DCACHE_DISCONNECTED 0x0020
189 /* This dentry is possibly not currently connected to the dcache tree, in 191 /* This dentry is possibly not currently connected to the dcache tree, in
190 * which case its parent will either be itself, or will have this flag as 192 * which case its parent will either be itself, or will have this flag as
191 * well. nfsd will not use a dentry with this bit set, but will first 193 * well. nfsd will not use a dentry with this bit set, but will first
@@ -196,8 +198,8 @@ struct dentry_operations {
196 * dentry into place and return that dentry rather than the passed one, 198 * dentry into place and return that dentry rather than the passed one,
197 * typically using d_splice_alias. */ 199 * typically using d_splice_alias. */
198 200
199#define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */ 201#define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */
200#define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */ 202#define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */
201 203
202#define DCACHE_CANT_MOUNT 0x0100 204#define DCACHE_CANT_MOUNT 0x0100
203#define DCACHE_GENOCIDE 0x0200 205#define DCACHE_GENOCIDE 0x0200
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 99e3e50b5c57..98f34b886f95 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -10,6 +10,7 @@
10 10
11#include <linux/bio.h> 11#include <linux/bio.h>
12#include <linux/blkdev.h> 12#include <linux/blkdev.h>
13#include <linux/ratelimit.h>
13 14
14struct dm_dev; 15struct dm_dev;
15struct dm_target; 16struct dm_target;
@@ -127,10 +128,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d);
127 * Information about a target type 128 * Information about a target type
128 */ 129 */
129 130
130/*
131 * Target features
132 */
133
134struct target_type { 131struct target_type {
135 uint64_t features; 132 uint64_t features;
136 const char *name; 133 const char *name;
@@ -159,6 +156,30 @@ struct target_type {
159 struct list_head list; 156 struct list_head list;
160}; 157};
161 158
159/*
160 * Target features
161 */
162
163/*
164 * Any table that contains an instance of this target must have only one.
165 */
166#define DM_TARGET_SINGLETON 0x00000001
167#define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON)
168
169/*
170 * Indicates that a target does not support read-only devices.
171 */
172#define DM_TARGET_ALWAYS_WRITEABLE 0x00000002
173#define dm_target_always_writeable(type) \
174 ((type)->features & DM_TARGET_ALWAYS_WRITEABLE)
175
176/*
177 * Any device that contains a table with an instance of this target may never
178 * have tables containing any different target type.
179 */
180#define DM_TARGET_IMMUTABLE 0x00000004
181#define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE)
182
162struct dm_target { 183struct dm_target {
163 struct dm_table *table; 184 struct dm_table *table;
164 struct target_type *type; 185 struct target_type *type;
@@ -375,6 +396,14 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
375 *---------------------------------------------------------------*/ 396 *---------------------------------------------------------------*/
376#define DM_NAME "device-mapper" 397#define DM_NAME "device-mapper"
377 398
399#ifdef CONFIG_PRINTK
400extern struct ratelimit_state dm_ratelimit_state;
401
402#define dm_ratelimit() __ratelimit(&dm_ratelimit_state)
403#else
404#define dm_ratelimit() 0
405#endif
406
378#define DMCRIT(f, arg...) \ 407#define DMCRIT(f, arg...) \
379 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 408 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
380 409
@@ -382,7 +411,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
382 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 411 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
383#define DMERR_LIMIT(f, arg...) \ 412#define DMERR_LIMIT(f, arg...) \
384 do { \ 413 do { \
385 if (printk_ratelimit()) \ 414 if (dm_ratelimit()) \
386 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ 415 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \
387 f "\n", ## arg); \ 416 f "\n", ## arg); \
388 } while (0) 417 } while (0)
@@ -391,7 +420,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
391 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 420 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
392#define DMWARN_LIMIT(f, arg...) \ 421#define DMWARN_LIMIT(f, arg...) \
393 do { \ 422 do { \
394 if (printk_ratelimit()) \ 423 if (dm_ratelimit()) \
395 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ 424 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \
396 f "\n", ## arg); \ 425 f "\n", ## arg); \
397 } while (0) 426 } while (0)
@@ -400,7 +429,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
400 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 429 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
401#define DMINFO_LIMIT(f, arg...) \ 430#define DMINFO_LIMIT(f, arg...) \
402 do { \ 431 do { \
403 if (printk_ratelimit()) \ 432 if (dm_ratelimit()) \
404 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ 433 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \
405 "\n", ## arg); \ 434 "\n", ## arg); \
406 } while (0) 435 } while (0)
@@ -410,7 +439,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
410 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) 439 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
411# define DMDEBUG_LIMIT(f, arg...) \ 440# define DMDEBUG_LIMIT(f, arg...) \
412 do { \ 441 do { \
413 if (printk_ratelimit()) \ 442 if (dm_ratelimit()) \
414 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ 443 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \
415 "\n", ## arg); \ 444 "\n", ## arg); \
416 } while (0) 445 } while (0)
diff --git a/include/linux/device.h b/include/linux/device.h
index e88abeecfadf..ffbcf95cd97d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -20,7 +20,7 @@
20#include <linux/lockdep.h> 20#include <linux/lockdep.h>
21#include <linux/compiler.h> 21#include <linux/compiler.h>
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/module.h> 23#include <linux/mutex.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <linux/atomic.h> 25#include <linux/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
@@ -29,6 +29,7 @@ struct device;
29struct device_private; 29struct device_private;
30struct device_driver; 30struct device_driver;
31struct driver_private; 31struct driver_private;
32struct module;
32struct class; 33struct class;
33struct subsys_private; 34struct subsys_private;
34struct bus_type; 35struct bus_type;
@@ -723,10 +724,14 @@ extern int dev_set_drvdata(struct device *dev, void *data);
723 */ 724 */
724extern struct device *__root_device_register(const char *name, 725extern struct device *__root_device_register(const char *name,
725 struct module *owner); 726 struct module *owner);
726static inline struct device *root_device_register(const char *name) 727
727{ 728/*
728 return __root_device_register(name, THIS_MODULE); 729 * This is a macro to avoid include problems with THIS_MODULE,
729} 730 * just as per what is done for device_schedule_callback() above.
731 */
732#define root_device_register(name) \
733 __root_device_register(name, THIS_MODULE)
734
730extern void root_device_unregister(struct device *root); 735extern void root_device_unregister(struct device *root);
731 736
732static inline void *dev_get_platdata(const struct device *dev) 737static inline void *dev_get_platdata(const struct device *dev)
diff --git a/include/linux/device_cgroup.h b/include/linux/device_cgroup.h
index 7aad1f440867..8b64221b432b 100644
--- a/include/linux/device_cgroup.h
+++ b/include/linux/device_cgroup.h
@@ -1,4 +1,3 @@
1#include <linux/module.h>
2#include <linux/fs.h> 1#include <linux/fs.h>
3 2
4#ifdef CONFIG_CGROUP_DEVICE 3#ifdef CONFIG_CGROUP_DEVICE
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 0cb8eff76bd6..75fd5573516e 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 21 270#define DM_VERSION_MINOR 22
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2011-07-06)" 272#define DM_VERSION_EXTRA "-ioctl (2011-10-19)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h
index 5e54458e920f..47d9d376e4e7 100644
--- a/include/linux/dm-kcopyd.h
+++ b/include/linux/dm-kcopyd.h
@@ -57,5 +57,9 @@ void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
57 dm_kcopyd_notify_fn fn, void *context); 57 dm_kcopyd_notify_fn fn, void *context);
58void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err); 58void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err);
59 59
60int dm_kcopyd_zero(struct dm_kcopyd_client *kc,
61 unsigned num_dests, struct dm_io_region *dests,
62 unsigned flags, dm_kcopyd_notify_fn fn, void *context);
63
60#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
61#endif /* _LINUX_DM_KCOPYD_H */ 65#endif /* _LINUX_DM_KCOPYD_H */
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h
index eeace7d3ff15..0678c2adc421 100644
--- a/include/linux/dm-log-userspace.h
+++ b/include/linux/dm-log-userspace.h
@@ -52,15 +52,20 @@
52 * Payload-to-userspace: 52 * Payload-to-userspace:
53 * A single string containing all the argv arguments separated by ' 's 53 * A single string containing all the argv arguments separated by ' 's
54 * Payload-to-kernel: 54 * Payload-to-kernel:
55 * None. ('data_size' in the dm_ulog_request struct should be 0.) 55 * A NUL-terminated string that is the name of the device that is used
56 * as the backing store for the log data. 'dm_get_device' will be called
57 * on this device. ('dm_put_device' will be called on this device
58 * automatically after calling DM_ULOG_DTR.) If there is no device needed
59 * for log data, 'data_size' in the dm_ulog_request struct should be 0.
56 * 60 *
57 * The UUID contained in the dm_ulog_request structure is the reference that 61 * The UUID contained in the dm_ulog_request structure is the reference that
58 * will be used by all request types to a specific log. The constructor must 62 * will be used by all request types to a specific log. The constructor must
59 * record this assotiation with instance created. 63 * record this association with the instance created.
60 * 64 *
61 * When the request has been processed, user-space must return the 65 * When the request has been processed, user-space must return the
62 * dm_ulog_request to the kernel - setting the 'error' field and 66 * dm_ulog_request to the kernel - setting the 'error' field, filling the
63 * 'data_size' appropriately. 67 * data field with the log device if necessary, and setting 'data_size'
68 * appropriately.
64 */ 69 */
65#define DM_ULOG_CTR 1 70#define DM_ULOG_CTR 1
66 71
@@ -377,8 +382,11 @@
377 * dm_ulog_request or a change in the way requests are 382 * dm_ulog_request or a change in the way requests are
378 * issued/handled. Changes are outlined here: 383 * issued/handled. Changes are outlined here:
379 * version 1: Initial implementation 384 * version 1: Initial implementation
385 * version 2: DM_ULOG_CTR allowed to return a string containing a
386 * device name that is to be registered with DM via
387 * 'dm_get_device'.
380 */ 388 */
381#define DM_ULOG_REQUEST_VERSION 1 389#define DM_ULOG_REQUEST_VERSION 2
382 390
383struct dm_ulog_request { 391struct dm_ulog_request {
384 /* 392 /*
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 347fdc32177a..e13117cbd2f7 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_DMA_MAPPING_H 1#ifndef _LINUX_DMA_MAPPING_H
2#define _LINUX_DMA_MAPPING_H 2#define _LINUX_DMA_MAPPING_H
3 3
4#include <linux/string.h>
4#include <linux/device.h> 5#include <linux/device.h>
5#include <linux/err.h> 6#include <linux/err.h>
6#include <linux/dma-attrs.h> 7#include <linux/dma-attrs.h>
@@ -41,6 +42,9 @@ struct dma_map_ops {
41 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); 42 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
42 int (*dma_supported)(struct device *dev, u64 mask); 43 int (*dma_supported)(struct device *dev, u64 mask);
43 int (*set_dma_mask)(struct device *dev, u64 mask); 44 int (*set_dma_mask)(struct device *dev, u64 mask);
45#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
46 u64 (*get_required_mask)(struct device *dev);
47#endif
44 int is_phys; 48 int is_phys;
45}; 49};
46 50
@@ -117,6 +121,15 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
117 return -EIO; 121 return -EIO;
118} 122}
119 123
124static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
125 dma_addr_t *dma_handle, gfp_t flag)
126{
127 void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
128 if (ret)
129 memset(ret, 0, size);
130 return ret;
131}
132
120#ifdef CONFIG_HAS_DMA 133#ifdef CONFIG_HAS_DMA
121static inline int dma_get_cache_alignment(void) 134static inline int dma_get_cache_alignment(void)
122{ 135{
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 8fbf40e0713c..75f53f874b24 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -24,8 +24,9 @@
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-direction.h> 26#include <linux/dma-direction.h>
27 27#include <linux/scatterlist.h>
28struct scatterlist; 28#include <linux/bitmap.h>
29#include <asm/page.h>
29 30
30/** 31/**
31 * typedef dma_cookie_t - an opaque DMA cookie 32 * typedef dma_cookie_t - an opaque DMA cookie
@@ -519,6 +520,16 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
519 (unsigned long)config); 520 (unsigned long)config);
520} 521}
521 522
523static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
524 struct dma_chan *chan, void *buf, size_t len,
525 enum dma_data_direction dir, unsigned long flags)
526{
527 struct scatterlist sg;
528 sg_init_one(&sg, buf, len);
529
530 return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags);
531}
532
522static inline int dmaengine_terminate_all(struct dma_chan *chan) 533static inline int dmaengine_terminate_all(struct dma_chan *chan)
523{ 534{
524 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); 535 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 4a73257b47d0..055b248bdd53 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -42,4 +42,354 @@ static inline void opstate_init(void)
42 return; 42 return;
43} 43}
44 44
45#define EDAC_MC_LABEL_LEN 31
46#define MC_PROC_NAME_MAX_LEN 7
47
48/* memory devices */
49enum dev_type {
50 DEV_UNKNOWN = 0,
51 DEV_X1,
52 DEV_X2,
53 DEV_X4,
54 DEV_X8,
55 DEV_X16,
56 DEV_X32, /* Do these parts exist? */
57 DEV_X64 /* Do these parts exist? */
58};
59
60#define DEV_FLAG_UNKNOWN BIT(DEV_UNKNOWN)
61#define DEV_FLAG_X1 BIT(DEV_X1)
62#define DEV_FLAG_X2 BIT(DEV_X2)
63#define DEV_FLAG_X4 BIT(DEV_X4)
64#define DEV_FLAG_X8 BIT(DEV_X8)
65#define DEV_FLAG_X16 BIT(DEV_X16)
66#define DEV_FLAG_X32 BIT(DEV_X32)
67#define DEV_FLAG_X64 BIT(DEV_X64)
68
69/* memory types */
70enum mem_type {
71 MEM_EMPTY = 0, /* Empty csrow */
72 MEM_RESERVED, /* Reserved csrow type */
73 MEM_UNKNOWN, /* Unknown csrow type */
74 MEM_FPM, /* Fast page mode */
75 MEM_EDO, /* Extended data out */
76 MEM_BEDO, /* Burst Extended data out */
77 MEM_SDR, /* Single data rate SDRAM */
78 MEM_RDR, /* Registered single data rate SDRAM */
79 MEM_DDR, /* Double data rate SDRAM */
80 MEM_RDDR, /* Registered Double data rate SDRAM */
81 MEM_RMBS, /* Rambus DRAM */
82 MEM_DDR2, /* DDR2 RAM */
83 MEM_FB_DDR2, /* fully buffered DDR2 */
84 MEM_RDDR2, /* Registered DDR2 RAM */
85 MEM_XDR, /* Rambus XDR */
86 MEM_DDR3, /* DDR3 RAM */
87 MEM_RDDR3, /* Registered DDR3 RAM */
88};
89
90#define MEM_FLAG_EMPTY BIT(MEM_EMPTY)
91#define MEM_FLAG_RESERVED BIT(MEM_RESERVED)
92#define MEM_FLAG_UNKNOWN BIT(MEM_UNKNOWN)
93#define MEM_FLAG_FPM BIT(MEM_FPM)
94#define MEM_FLAG_EDO BIT(MEM_EDO)
95#define MEM_FLAG_BEDO BIT(MEM_BEDO)
96#define MEM_FLAG_SDR BIT(MEM_SDR)
97#define MEM_FLAG_RDR BIT(MEM_RDR)
98#define MEM_FLAG_DDR BIT(MEM_DDR)
99#define MEM_FLAG_RDDR BIT(MEM_RDDR)
100#define MEM_FLAG_RMBS BIT(MEM_RMBS)
101#define MEM_FLAG_DDR2 BIT(MEM_DDR2)
102#define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2)
103#define MEM_FLAG_RDDR2 BIT(MEM_RDDR2)
104#define MEM_FLAG_XDR BIT(MEM_XDR)
105#define MEM_FLAG_DDR3 BIT(MEM_DDR3)
106#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3)
107
108/* chipset Error Detection and Correction capabilities and mode */
109enum edac_type {
110 EDAC_UNKNOWN = 0, /* Unknown if ECC is available */
111 EDAC_NONE, /* Doesn't support ECC */
112 EDAC_RESERVED, /* Reserved ECC type */
113 EDAC_PARITY, /* Detects parity errors */
114 EDAC_EC, /* Error Checking - no correction */
115 EDAC_SECDED, /* Single bit error correction, Double detection */
116 EDAC_S2ECD2ED, /* Chipkill x2 devices - do these exist? */
117 EDAC_S4ECD4ED, /* Chipkill x4 devices */
118 EDAC_S8ECD8ED, /* Chipkill x8 devices */
119 EDAC_S16ECD16ED, /* Chipkill x16 devices */
120};
121
122#define EDAC_FLAG_UNKNOWN BIT(EDAC_UNKNOWN)
123#define EDAC_FLAG_NONE BIT(EDAC_NONE)
124#define EDAC_FLAG_PARITY BIT(EDAC_PARITY)
125#define EDAC_FLAG_EC BIT(EDAC_EC)
126#define EDAC_FLAG_SECDED BIT(EDAC_SECDED)
127#define EDAC_FLAG_S2ECD2ED BIT(EDAC_S2ECD2ED)
128#define EDAC_FLAG_S4ECD4ED BIT(EDAC_S4ECD4ED)
129#define EDAC_FLAG_S8ECD8ED BIT(EDAC_S8ECD8ED)
130#define EDAC_FLAG_S16ECD16ED BIT(EDAC_S16ECD16ED)
131
132/* scrubbing capabilities */
133enum scrub_type {
134 SCRUB_UNKNOWN = 0, /* Unknown if scrubber is available */
135 SCRUB_NONE, /* No scrubber */
136 SCRUB_SW_PROG, /* SW progressive (sequential) scrubbing */
137 SCRUB_SW_SRC, /* Software scrub only errors */
138 SCRUB_SW_PROG_SRC, /* Progressive software scrub from an error */
139 SCRUB_SW_TUNABLE, /* Software scrub frequency is tunable */
140 SCRUB_HW_PROG, /* HW progressive (sequential) scrubbing */
141 SCRUB_HW_SRC, /* Hardware scrub only errors */
142 SCRUB_HW_PROG_SRC, /* Progressive hardware scrub from an error */
143 SCRUB_HW_TUNABLE /* Hardware scrub frequency is tunable */
144};
145
146#define SCRUB_FLAG_SW_PROG BIT(SCRUB_SW_PROG)
147#define SCRUB_FLAG_SW_SRC BIT(SCRUB_SW_SRC)
148#define SCRUB_FLAG_SW_PROG_SRC BIT(SCRUB_SW_PROG_SRC)
149#define SCRUB_FLAG_SW_TUN BIT(SCRUB_SW_SCRUB_TUNABLE)
150#define SCRUB_FLAG_HW_PROG BIT(SCRUB_HW_PROG)
151#define SCRUB_FLAG_HW_SRC BIT(SCRUB_HW_SRC)
152#define SCRUB_FLAG_HW_PROG_SRC BIT(SCRUB_HW_PROG_SRC)
153#define SCRUB_FLAG_HW_TUN BIT(SCRUB_HW_TUNABLE)
154
155/* FIXME - should have notify capabilities: NMI, LOG, PROC, etc */
156
157/* EDAC internal operation states */
158#define OP_ALLOC 0x100
159#define OP_RUNNING_POLL 0x201
160#define OP_RUNNING_INTERRUPT 0x202
161#define OP_RUNNING_POLL_INTR 0x203
162#define OP_OFFLINE 0x300
163
164/*
165 * There are several things to be aware of that aren't at all obvious:
166 *
167 *
168 * SOCKETS, SOCKET SETS, BANKS, ROWS, CHIP-SELECT ROWS, CHANNELS, etc..
169 *
170 * These are some of the many terms that are thrown about that don't always
171 * mean what people think they mean (Inconceivable!). In the interest of
172 * creating a common ground for discussion, terms and their definitions
173 * will be established.
174 *
175 * Memory devices: The individual chip on a memory stick. These devices
176 * commonly output 4 and 8 bits each. Grouping several
177 * of these in parallel provides 64 bits which is common
178 * for a memory stick.
179 *
180 * Memory Stick: A printed circuit board that aggregates multiple
181 * memory devices in parallel. This is the atomic
182 * memory component that is purchaseable by Joe consumer
183 * and loaded into a memory socket.
184 *
185 * Socket: A physical connector on the motherboard that accepts
186 * a single memory stick.
187 *
188 * Channel: Set of memory devices on a memory stick that must be
189 * grouped in parallel with one or more additional
190 * channels from other memory sticks. This parallel
191 * grouping of the output from multiple channels are
192 * necessary for the smallest granularity of memory access.
193 * Some memory controllers are capable of single channel -
194 * which means that memory sticks can be loaded
195 * individually. Other memory controllers are only
196 * capable of dual channel - which means that memory
197 * sticks must be loaded as pairs (see "socket set").
198 *
199 * Chip-select row: All of the memory devices that are selected together.
200 * for a single, minimum grain of memory access.
201 * This selects all of the parallel memory devices across
202 * all of the parallel channels. Common chip-select rows
203 * for single channel are 64 bits, for dual channel 128
204 * bits.
205 *
206 * Single-Ranked stick: A Single-ranked stick has 1 chip-select row of memory.
207 * Motherboards commonly drive two chip-select pins to
208 * a memory stick. A single-ranked stick, will occupy
209 * only one of those rows. The other will be unused.
210 *
211 * Double-Ranked stick: A double-ranked stick has two chip-select rows which
212 * access different sets of memory devices. The two
213 * rows cannot be accessed concurrently.
214 *
215 * Double-sided stick: DEPRECATED TERM, see Double-Ranked stick.
216 * A double-sided stick has two chip-select rows which
217 * access different sets of memory devices. The two
218 * rows cannot be accessed concurrently. "Double-sided"
219 * is irrespective of the memory devices being mounted
220 * on both sides of the memory stick.
221 *
222 * Socket set: All of the memory sticks that are required for
223 * a single memory access or all of the memory sticks
224 * spanned by a chip-select row. A single socket set
225 * has two chip-select rows and if double-sided sticks
226 * are used these will occupy those chip-select rows.
227 *
228 * Bank: This term is avoided because it is unclear when
229 * needing to distinguish between chip-select rows and
230 * socket sets.
231 *
232 * Controller pages:
233 *
234 * Physical pages:
235 *
236 * Virtual pages:
237 *
238 *
239 * STRUCTURE ORGANIZATION AND CHOICES
240 *
241 *
242 *
243 * PS - I enjoyed writing all that about as much as you enjoyed reading it.
244 */
245
246struct channel_info {
247 int chan_idx; /* channel index */
248 u32 ce_count; /* Correctable Errors for this CHANNEL */
249 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
250 struct csrow_info *csrow; /* the parent */
251};
252
253struct csrow_info {
254 unsigned long first_page; /* first page number in dimm */
255 unsigned long last_page; /* last page number in dimm */
256 unsigned long page_mask; /* used for interleaving -
257 * 0UL for non intlv
258 */
259 u32 nr_pages; /* number of pages in csrow */
260 u32 grain; /* granularity of reported error in bytes */
261 int csrow_idx; /* the chip-select row */
262 enum dev_type dtype; /* memory device type */
263 u32 ue_count; /* Uncorrectable Errors for this csrow */
264 u32 ce_count; /* Correctable Errors for this csrow */
265 enum mem_type mtype; /* memory csrow type */
266 enum edac_type edac_mode; /* EDAC mode for this csrow */
267 struct mem_ctl_info *mci; /* the parent */
268
269 struct kobject kobj; /* sysfs kobject for this csrow */
270
271 /* channel information for this csrow */
272 u32 nr_channels;
273 struct channel_info *channels;
274};
275
276struct mcidev_sysfs_group {
277 const char *name; /* group name */
278 const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */
279};
280
281struct mcidev_sysfs_group_kobj {
282 struct list_head list; /* list for all instances within a mc */
283
284 struct kobject kobj; /* kobj for the group */
285
286 const struct mcidev_sysfs_group *grp; /* group description table */
287 struct mem_ctl_info *mci; /* the parent */
288};
289
290/* mcidev_sysfs_attribute structure
291 * used for driver sysfs attributes and in mem_ctl_info
292 * sysfs top level entries
293 */
294struct mcidev_sysfs_attribute {
295 /* It should use either attr or grp */
296 struct attribute attr;
297 const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */
298
299 /* Ops for show/store values at the attribute - not used on group */
300 ssize_t (*show)(struct mem_ctl_info *,char *);
301 ssize_t (*store)(struct mem_ctl_info *, const char *,size_t);
302};
303
304/* MEMORY controller information structure
305 */
306struct mem_ctl_info {
307 struct list_head link; /* for global list of mem_ctl_info structs */
308
309 struct module *owner; /* Module owner of this control struct */
310
311 unsigned long mtype_cap; /* memory types supported by mc */
312 unsigned long edac_ctl_cap; /* Mem controller EDAC capabilities */
313 unsigned long edac_cap; /* configuration capabilities - this is
314 * closely related to edac_ctl_cap. The
315 * difference is that the controller may be
316 * capable of s4ecd4ed which would be listed
317 * in edac_ctl_cap, but if channels aren't
318 * capable of s4ecd4ed then the edac_cap would
319 * not have that capability.
320 */
321 unsigned long scrub_cap; /* chipset scrub capabilities */
322 enum scrub_type scrub_mode; /* current scrub mode */
323
324 /* Translates sdram memory scrub rate given in bytes/sec to the
325 internal representation and configures whatever else needs
326 to be configured.
327 */
328 int (*set_sdram_scrub_rate) (struct mem_ctl_info * mci, u32 bw);
329
330 /* Get the current sdram memory scrub rate from the internal
331 representation and converts it to the closest matching
332 bandwidth in bytes/sec.
333 */
334 int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci);
335
336
337 /* pointer to edac checking routine */
338 void (*edac_check) (struct mem_ctl_info * mci);
339
340 /*
341 * Remaps memory pages: controller pages to physical pages.
342 * For most MC's, this will be NULL.
343 */
344 /* FIXME - why not send the phys page to begin with? */
345 unsigned long (*ctl_page_to_phys) (struct mem_ctl_info * mci,
346 unsigned long page);
347 int mc_idx;
348 int nr_csrows;
349 struct csrow_info *csrows;
350 /*
351 * FIXME - what about controllers on other busses? - IDs must be
352 * unique. dev pointer should be sufficiently unique, but
353 * BUS:SLOT.FUNC numbers may not be unique.
354 */
355 struct device *dev;
356 const char *mod_name;
357 const char *mod_ver;
358 const char *ctl_name;
359 const char *dev_name;
360 char proc_name[MC_PROC_NAME_MAX_LEN + 1];
361 void *pvt_info;
362 u32 ue_noinfo_count; /* Uncorrectable Errors w/o info */
363 u32 ce_noinfo_count; /* Correctable Errors w/o info */
364 u32 ue_count; /* Total Uncorrectable Errors for this MC */
365 u32 ce_count; /* Total Correctable Errors for this MC */
366 unsigned long start_time; /* mci load start time (in jiffies) */
367
368 struct completion complete;
369
370 /* edac sysfs device control */
371 struct kobject edac_mci_kobj;
372
373 /* list for all grp instances within a mc */
374 struct list_head grp_kobj_list;
375
376 /* Additional top controller level attributes, but specified
377 * by the low level driver.
378 *
379 * Set by the low level driver to provide attributes at the
380 * controller level, same level as 'ue_count' and 'ce_count' above.
381 * An array of structures, NULL terminated
382 *
383 * If attributes are desired, then set to array of attributes
384 * If no attributes are desired, leave NULL
385 */
386 const struct mcidev_sysfs_attribute *mc_driver_sysfs_attributes;
387
388 /* work struct for this MC */
389 struct delayed_work work;
390
391 /* the internal state of this controller instance */
392 int op_state;
393};
394
45#endif 395#endif
diff --git a/include/linux/edac_mce.h b/include/linux/edac_mce.h
deleted file mode 100644
index f974fc035363..000000000000
--- a/include/linux/edac_mce.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* Provides edac interface to mcelog events
2 *
3 * This file may be distributed under the terms of the
4 * GNU General Public License version 2.
5 *
6 * Copyright (c) 2009 by:
7 * Mauro Carvalho Chehab <mchehab@redhat.com>
8 *
9 * Red Hat Inc. http://www.redhat.com
10 */
11
12#if defined(CONFIG_EDAC_MCE) || \
13 (defined(CONFIG_EDAC_MCE_MODULE) && defined(MODULE))
14
15#include <asm/mce.h>
16#include <linux/list.h>
17
18struct edac_mce {
19 struct list_head list;
20
21 void *priv;
22 int (*check_error)(void *priv, struct mce *mce);
23};
24
25int edac_mce_register(struct edac_mce *edac_mce);
26void edac_mce_unregister(struct edac_mce *edac_mce);
27int edac_mce_parse(struct mce *mce);
28
29#else
30#define edac_mce_parse(mce) (0)
31#endif
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index d800d5142184..1d0f7a2ff73b 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -38,6 +38,12 @@ struct elevator_ops
38 elevator_merged_fn *elevator_merged_fn; 38 elevator_merged_fn *elevator_merged_fn;
39 elevator_merge_req_fn *elevator_merge_req_fn; 39 elevator_merge_req_fn *elevator_merge_req_fn;
40 elevator_allow_merge_fn *elevator_allow_merge_fn; 40 elevator_allow_merge_fn *elevator_allow_merge_fn;
41
42 /*
43 * Used for both plugged list and elevator merging and in the
44 * former case called without queue_lock. Read comment on top of
45 * attempt_plug_merge() for details.
46 */
41 elevator_bio_merged_fn *elevator_bio_merged_fn; 47 elevator_bio_merged_fn *elevator_bio_merged_fn;
42 48
43 elevator_dispatch_fn *elevator_dispatch_fn; 49 elevator_dispatch_fn *elevator_dispatch_fn;
diff --git a/include/linux/export.h b/include/linux/export.h
new file mode 100644
index 000000000000..696c0f48afc7
--- /dev/null
+++ b/include/linux/export.h
@@ -0,0 +1,89 @@
1#ifndef _LINUX_EXPORT_H
2#define _LINUX_EXPORT_H
3/*
4 * Export symbols from the kernel to modules. Forked from module.h
5 * to reduce the amount of pointless cruft we feed to gcc when only
6 * exporting a simple symbol or two.
7 *
8 * If you feel the need to add #include <linux/foo.h> to this file
9 * then you are doing something wrong and should go away silently.
10 */
11
12/* Some toolchains use a `_' prefix for all user symbols. */
13#ifdef CONFIG_SYMBOL_PREFIX
14#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
15#else
16#define MODULE_SYMBOL_PREFIX ""
17#endif
18
19struct kernel_symbol
20{
21 unsigned long value;
22 const char *name;
23};
24
25#ifdef MODULE
26extern struct module __this_module;
27#define THIS_MODULE (&__this_module)
28#else
29#define THIS_MODULE ((struct module *)0)
30#endif
31
32#ifdef CONFIG_MODULES
33
34#ifndef __GENKSYMS__
35#ifdef CONFIG_MODVERSIONS
36/* Mark the CRC weak since genksyms apparently decides not to
37 * generate a checksums for some symbols */
38#define __CRC_SYMBOL(sym, sec) \
39 extern void *__crc_##sym __attribute__((weak)); \
40 static const unsigned long __kcrctab_##sym \
41 __used \
42 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
43 = (unsigned long) &__crc_##sym;
44#else
45#define __CRC_SYMBOL(sym, sec)
46#endif
47
48/* For every exported symbol, place a struct in the __ksymtab section */
49#define __EXPORT_SYMBOL(sym, sec) \
50 extern typeof(sym) sym; \
51 __CRC_SYMBOL(sym, sec) \
52 static const char __kstrtab_##sym[] \
53 __attribute__((section("__ksymtab_strings"), aligned(1))) \
54 = MODULE_SYMBOL_PREFIX #sym; \
55 static const struct kernel_symbol __ksymtab_##sym \
56 __used \
57 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
58 = { (unsigned long)&sym, __kstrtab_##sym }
59
60#define EXPORT_SYMBOL(sym) \
61 __EXPORT_SYMBOL(sym, "")
62
63#define EXPORT_SYMBOL_GPL(sym) \
64 __EXPORT_SYMBOL(sym, "_gpl")
65
66#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
67 __EXPORT_SYMBOL(sym, "_gpl_future")
68
69#ifdef CONFIG_UNUSED_SYMBOLS
70#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
71#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
72#else
73#define EXPORT_UNUSED_SYMBOL(sym)
74#define EXPORT_UNUSED_SYMBOL_GPL(sym)
75#endif
76
77#endif /* __GENKSYMS__ */
78
79#else /* !CONFIG_MODULES... */
80
81#define EXPORT_SYMBOL(sym)
82#define EXPORT_SYMBOL_GPL(sym)
83#define EXPORT_SYMBOL_GPL_FUTURE(sym)
84#define EXPORT_UNUSED_SYMBOL(sym)
85#define EXPORT_UNUSED_SYMBOL_GPL(sym)
86
87#endif /* CONFIG_MODULES */
88
89#endif /* _LINUX_EXPORT_H */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 53792bf36c71..ce1b719e8bd4 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -197,8 +197,8 @@ struct ext2_group_desc
197 197
198/* Flags that should be inherited by new inodes from their parent. */ 198/* Flags that should be inherited by new inodes from their parent. */
199#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ 199#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\
200 EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ 200 EXT2_SYNC_FL | EXT2_NODUMP_FL |\
201 EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ 201 EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\
202 EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ 202 EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\
203 EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) 203 EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL)
204 204
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 81965cce6bfa..dec99116a0e4 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -180,8 +180,8 @@ struct ext3_group_desc
180 180
181/* Flags that should be inherited by new inodes from their parent. */ 181/* Flags that should be inherited by new inodes from their parent. */
182#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\ 182#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\
183 EXT3_SYNC_FL | EXT3_IMMUTABLE_FL | EXT3_APPEND_FL |\ 183 EXT3_SYNC_FL | EXT3_NODUMP_FL |\
184 EXT3_NODUMP_FL | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL|\ 184 EXT3_NOATIME_FL | EXT3_COMPRBLK_FL |\
185 EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\ 185 EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\
186 EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL) 186 EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL)
187 187
@@ -381,7 +381,7 @@ struct ext3_inode {
381 * Mount flags 381 * Mount flags
382 */ 382 */
383#define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */ 383#define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */
384#define EXT3_MOUNT_OLDALLOC 0x00002 /* Don't use the new Orlov allocator */ 384/* EXT3_MOUNT_OLDALLOC was there */
385#define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */ 385#define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */
386#define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */ 386#define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */
387#define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */ 387#define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index 258088ab3c6b..64365252f1b0 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -76,10 +76,6 @@ struct ext3_sb_info {
76 struct mutex s_resize_lock; 76 struct mutex s_resize_lock;
77 unsigned long s_commit_interval; 77 unsigned long s_commit_interval;
78 struct block_device *journal_bdev; 78 struct block_device *journal_bdev;
79#ifdef CONFIG_JBD_DEBUG
80 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
81 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
82#endif
83#ifdef CONFIG_QUOTA 79#ifdef CONFIG_QUOTA
84 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 80 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
85 int s_jquota_fmt; /* Format of quota to use */ 81 int s_jquota_fmt; /* Format of quota to use */
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 21b3e7588abd..1e7c01189fa6 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_FIRMWARE_H 1#ifndef _LINUX_FIRMWARE_H
2#define _LINUX_FIRMWARE_H 2#define _LINUX_FIRMWARE_H
3 3
4#include <linux/module.h>
5#include <linux/types.h> 4#include <linux/types.h>
6#include <linux/compiler.h> 5#include <linux/compiler.h>
7#include <linux/gfp.h> 6#include <linux/gfp.h>
@@ -15,6 +14,7 @@ struct firmware {
15 struct page **pages; 14 struct page **pages;
16}; 15};
17 16
17struct module;
18struct device; 18struct device;
19 19
20struct builtin_fw { 20struct builtin_fw {
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index a49b52934c55..a5386e3ee756 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -143,14 +143,9 @@ static inline void set_freezable_with_signal(void)
143#define wait_event_freezekillable(wq, condition) \ 143#define wait_event_freezekillable(wq, condition) \
144({ \ 144({ \
145 int __retval; \ 145 int __retval; \
146 do { \ 146 freezer_do_not_count(); \
147 __retval = wait_event_killable(wq, \ 147 __retval = wait_event_killable(wq, (condition)); \
148 (condition) || freezing(current)); \ 148 freezer_count(); \
149 if (__retval && !freezing(current)) \
150 break; \
151 else if (!(condition)) \
152 __retval = -ERESTARTSYS; \
153 } while (try_to_freeze()); \
154 __retval; \ 149 __retval; \
155}) 150})
156 151
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7a049fd2aa4c..0c4df261af7e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -768,14 +768,25 @@ struct inode {
768 768
769 /* Stat data, not accessed from path walking */ 769 /* Stat data, not accessed from path walking */
770 unsigned long i_ino; 770 unsigned long i_ino;
771 unsigned int i_nlink; 771 /*
772 * Filesystems may only read i_nlink directly. They shall use the
773 * following functions for modification:
774 *
775 * (set|clear|inc|drop)_nlink
776 * inode_(inc|dec)_link_count
777 */
778 union {
779 const unsigned int i_nlink;
780 unsigned int __i_nlink;
781 };
772 dev_t i_rdev; 782 dev_t i_rdev;
773 loff_t i_size;
774 struct timespec i_atime; 783 struct timespec i_atime;
775 struct timespec i_mtime; 784 struct timespec i_mtime;
776 struct timespec i_ctime; 785 struct timespec i_ctime;
777 unsigned int i_blkbits; 786 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
787 unsigned short i_bytes;
778 blkcnt_t i_blocks; 788 blkcnt_t i_blocks;
789 loff_t i_size;
779 790
780#ifdef __NEED_I_SIZE_ORDERED 791#ifdef __NEED_I_SIZE_ORDERED
781 seqcount_t i_size_seqcount; 792 seqcount_t i_size_seqcount;
@@ -783,7 +794,6 @@ struct inode {
783 794
784 /* Misc */ 795 /* Misc */
785 unsigned long i_state; 796 unsigned long i_state;
786 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
787 struct mutex i_mutex; 797 struct mutex i_mutex;
788 798
789 unsigned long dirtied_when; /* jiffies of first dirtying */ 799 unsigned long dirtied_when; /* jiffies of first dirtying */
@@ -797,9 +807,10 @@ struct inode {
797 struct rcu_head i_rcu; 807 struct rcu_head i_rcu;
798 }; 808 };
799 atomic_t i_count; 809 atomic_t i_count;
810 unsigned int i_blkbits;
800 u64 i_version; 811 u64 i_version;
801 unsigned short i_bytes;
802 atomic_t i_dio_count; 812 atomic_t i_dio_count;
813 atomic_t i_writecount;
803 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 814 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
804 struct file_lock *i_flock; 815 struct file_lock *i_flock;
805 struct address_space i_data; 816 struct address_space i_data;
@@ -823,7 +834,6 @@ struct inode {
823#ifdef CONFIG_IMA 834#ifdef CONFIG_IMA
824 atomic_t i_readcount; /* struct files open RO */ 835 atomic_t i_readcount; /* struct files open RO */
825#endif 836#endif
826 atomic_t i_writecount;
827 void *i_private; /* fs or device private pointer */ 837 void *i_private; /* fs or device private pointer */
828}; 838};
829 839
@@ -1755,6 +1765,19 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1755} 1765}
1756 1766
1757/** 1767/**
1768 * set_nlink - directly set an inode's link count
1769 * @inode: inode
1770 * @nlink: new nlink (should be non-zero)
1771 *
1772 * This is a low-level filesystem helper to replace any
1773 * direct filesystem manipulation of i_nlink.
1774 */
1775static inline void set_nlink(struct inode *inode, unsigned int nlink)
1776{
1777 inode->__i_nlink = nlink;
1778}
1779
1780/**
1758 * inc_nlink - directly increment an inode's link count 1781 * inc_nlink - directly increment an inode's link count
1759 * @inode: inode 1782 * @inode: inode
1760 * 1783 *
@@ -1764,7 +1787,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1764 */ 1787 */
1765static inline void inc_nlink(struct inode *inode) 1788static inline void inc_nlink(struct inode *inode)
1766{ 1789{
1767 inode->i_nlink++; 1790 inode->__i_nlink++;
1768} 1791}
1769 1792
1770static inline void inode_inc_link_count(struct inode *inode) 1793static inline void inode_inc_link_count(struct inode *inode)
@@ -1786,7 +1809,7 @@ static inline void inode_inc_link_count(struct inode *inode)
1786 */ 1809 */
1787static inline void drop_nlink(struct inode *inode) 1810static inline void drop_nlink(struct inode *inode)
1788{ 1811{
1789 inode->i_nlink--; 1812 inode->__i_nlink--;
1790} 1813}
1791 1814
1792/** 1815/**
@@ -1799,7 +1822,7 @@ static inline void drop_nlink(struct inode *inode)
1799 */ 1822 */
1800static inline void clear_nlink(struct inode *inode) 1823static inline void clear_nlink(struct inode *inode)
1801{ 1824{
1802 inode->i_nlink = 0; 1825 inode->__i_nlink = 0;
1803} 1826}
1804 1827
1805static inline void inode_dec_link_count(struct inode *inode) 1828static inline void inode_dec_link_count(struct inode *inode)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index f0c0e8a47ae6..26eafcef75be 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -10,7 +10,6 @@
10#include <linux/kallsyms.h> 10#include <linux/kallsyms.h>
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <linux/bitops.h> 12#include <linux/bitops.h>
13#include <linux/module.h>
14#include <linux/ktime.h> 13#include <linux/ktime.h>
15#include <linux/sched.h> 14#include <linux/sched.h>
16#include <linux/types.h> 15#include <linux/types.h>
@@ -19,6 +18,7 @@
19 18
20#include <asm/ftrace.h> 19#include <asm/ftrace.h>
21 20
21struct module;
22struct ftrace_hash; 22struct ftrace_hash;
23 23
24#ifdef CONFIG_FUNCTION_TRACER 24#ifdef CONFIG_FUNCTION_TRACER
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 069ee4139105..b456b08d70ed 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -71,10 +71,9 @@ void gameport_close(struct gameport *gameport);
71#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 71#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
72 72
73void __gameport_register_port(struct gameport *gameport, struct module *owner); 73void __gameport_register_port(struct gameport *gameport, struct module *owner);
74static inline void gameport_register_port(struct gameport *gameport) 74/* use a define to avoid include chaining to get THIS_MODULE */
75{ 75#define gameport_register_port(gameport) \
76 __gameport_register_port(gameport, THIS_MODULE); 76 __gameport_register_port(gameport, THIS_MODULE)
77}
78 77
79void gameport_unregister_port(struct gameport *gameport); 78void gameport_unregister_port(struct gameport *gameport);
80 79
@@ -145,12 +144,12 @@ static inline void gameport_unpin_driver(struct gameport *gameport)
145 mutex_unlock(&gameport->drv_mutex); 144 mutex_unlock(&gameport->drv_mutex);
146} 145}
147 146
148int __gameport_register_driver(struct gameport_driver *drv, 147int __must_check __gameport_register_driver(struct gameport_driver *drv,
149 struct module *owner, const char *mod_name); 148 struct module *owner, const char *mod_name);
150static inline int __must_check gameport_register_driver(struct gameport_driver *drv) 149
151{ 150/* use a define to avoid include chaining to get THIS_MODULE & friends */
152 return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); 151#define gameport_register_driver(drv) \
153} 152 __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
154 153
155void gameport_unregister_driver(struct gameport_driver *drv); 154void gameport_unregister_driver(struct gameport_driver *drv);
156 155
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 6957350e122f..9de31bc98c88 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -131,6 +131,7 @@ struct hd_struct {
131#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ 131#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */
132#define GENHD_FL_NATIVE_CAPACITY 128 132#define GENHD_FL_NATIVE_CAPACITY 128
133#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256 133#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256
134#define GENHD_FL_NO_PART_SCAN 512
134 135
135enum { 136enum {
136 DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ 137 DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */
@@ -238,9 +239,10 @@ static inline int disk_max_parts(struct gendisk *disk)
238 return disk->minors; 239 return disk->minors;
239} 240}
240 241
241static inline bool disk_partitionable(struct gendisk *disk) 242static inline bool disk_part_scan_enabled(struct gendisk *disk)
242{ 243{
243 return disk_max_parts(disk) > 1; 244 return disk_max_parts(disk) > 1 &&
245 !(disk->flags & GENHD_FL_NO_PART_SCAN);
244} 246}
245 247
246static inline dev_t disk_devt(struct gendisk *disk) 248static inline dev_t disk_devt(struct gendisk *disk)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index deed5f9a1e1c..c235e4e8767c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -697,10 +697,11 @@ extern void hid_destroy_device(struct hid_device *);
697 697
698extern int __must_check __hid_register_driver(struct hid_driver *, 698extern int __must_check __hid_register_driver(struct hid_driver *,
699 struct module *, const char *mod_name); 699 struct module *, const char *mod_name);
700static inline int __must_check hid_register_driver(struct hid_driver *driver) 700
701{ 701/* use a define to avoid include chaining to get THIS_MODULE & friends */
702 return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); 702#define hid_register_driver(driver) \
703} 703 __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
704
704extern void hid_unregister_driver(struct hid_driver *); 705extern void hid_unregister_driver(struct hid_driver *);
705 706
706extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 707extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 8390efc457eb..08a2fee40659 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -20,17 +20,49 @@
20 20
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/device.h>
23 24
24/* hwspinlock mode argument */ 25/* hwspinlock mode argument */
25#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */ 26#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
26#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */ 27#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
27 28
28struct hwspinlock; 29struct hwspinlock;
30struct hwspinlock_device;
31struct hwspinlock_ops;
32
33/**
34 * struct hwspinlock_pdata - platform data for hwspinlock drivers
35 * @base_id: base id for this hwspinlock device
36 *
37 * hwspinlock devices provide system-wide hardware locks that are used
38 * by remote processors that have no other way to achieve synchronization.
39 *
40 * To achieve that, each physical lock must have a system-wide id number
41 * that is agreed upon, otherwise remote processors can't possibly assume
42 * they're using the same hardware lock.
43 *
44 * Usually boards have a single hwspinlock device, which provides several
45 * hwspinlocks, and in this case, they can be trivially numbered 0 to
46 * (num-of-locks - 1).
47 *
48 * In case boards have several hwspinlocks devices, a different base id
49 * should be used for each hwspinlock device (they can't all use 0 as
50 * a starting id!).
51 *
52 * This platform data structure should be used to provide the base id
53 * for each device (which is trivially 0 when only a single hwspinlock
54 * device exists). It can be shared between different platforms, hence
55 * its location.
56 */
57struct hwspinlock_pdata {
58 int base_id;
59};
29 60
30#if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE) 61#if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE)
31 62
32int hwspin_lock_register(struct hwspinlock *lock); 63int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
33struct hwspinlock *hwspin_lock_unregister(unsigned int id); 64 const struct hwspinlock_ops *ops, int base_id, int num_locks);
65int hwspin_lock_unregister(struct hwspinlock_device *bank);
34struct hwspinlock *hwspin_lock_request(void); 66struct hwspinlock *hwspin_lock_request(void);
35struct hwspinlock *hwspin_lock_request_specific(unsigned int id); 67struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
36int hwspin_lock_free(struct hwspinlock *hwlock); 68int hwspin_lock_free(struct hwspinlock *hwlock);
@@ -94,16 +126,6 @@ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
94 return 0; 126 return 0;
95} 127}
96 128
97static inline int hwspin_lock_register(struct hwspinlock *hwlock)
98{
99 return -ENODEV;
100}
101
102static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id)
103{
104 return NULL;
105}
106
107#endif /* !CONFIG_HWSPINLOCK */ 129#endif /* !CONFIG_HWSPINLOCK */
108 130
109/** 131/**
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 0aa0cbd676f7..92a0dc75bc74 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -32,10 +32,9 @@
32 32
33struct omap_i2c_bus_platform_data { 33struct omap_i2c_bus_platform_data {
34 u32 clkrate; 34 u32 clkrate;
35 u32 rev;
36 u32 flags;
35 void (*set_mpu_wkup_lat)(struct device *dev, long set); 37 void (*set_mpu_wkup_lat)(struct device *dev, long set);
36 int (*device_enable) (struct platform_device *pdev);
37 int (*device_shutdown) (struct platform_device *pdev);
38 int (*device_idle) (struct platform_device *pdev);
39}; 38};
40 39
41#endif 40#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 38a21c3edd2c..a81bf6d23b3e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -28,7 +28,6 @@
28 28
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#include <linux/module.h>
32#include <linux/mod_devicetable.h> 31#include <linux/mod_devicetable.h>
33#include <linux/device.h> /* for struct device */ 32#include <linux/device.h> /* for struct device */
34#include <linux/sched.h> /* for completion */ 33#include <linux/sched.h> /* for completion */
@@ -49,6 +48,8 @@ struct i2c_driver;
49union i2c_smbus_data; 48union i2c_smbus_data;
50struct i2c_board_info; 49struct i2c_board_info;
51 50
51struct module;
52
52#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 53#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
53/* 54/*
54 * The master routines are the ones normally used to transmit data to devices 55 * The master routines are the ones normally used to transmit data to devices
@@ -451,10 +452,9 @@ extern int i2c_add_numbered_adapter(struct i2c_adapter *);
451extern int i2c_register_driver(struct module *, struct i2c_driver *); 452extern int i2c_register_driver(struct module *, struct i2c_driver *);
452extern void i2c_del_driver(struct i2c_driver *); 453extern void i2c_del_driver(struct i2c_driver *);
453 454
454static inline int i2c_add_driver(struct i2c_driver *driver) 455/* use a define to avoid include chaining to get THIS_MODULE */
455{ 456#define i2c_add_driver(driver) \
456 return i2c_register_driver(THIS_MODULE, driver); 457 i2c_register_driver(THIS_MODULE, driver)
457}
458 458
459extern struct i2c_client *i2c_use_client(struct i2c_client *client); 459extern struct i2c_client *i2c_use_client(struct i2c_client *client);
460extern void i2c_release_client(struct i2c_client *client); 460extern void i2c_release_client(struct i2c_client *client);
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h
index 6427d298fbfc..530e11ba0738 100644
--- a/include/linux/i2c/twl4030-madc.h
+++ b/include/linux/i2c/twl4030-madc.h
@@ -129,6 +129,10 @@ enum sample_type {
129#define REG_BCICTL2 0x024 129#define REG_BCICTL2 0x024
130#define TWL4030_BCI_ITHSENS 0x007 130#define TWL4030_BCI_ITHSENS 0x007
131 131
132/* Register and bits for GPBR1 register */
133#define TWL4030_REG_GPBR1 0x0c
134#define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7)
135
132struct twl4030_madc_user_parms { 136struct twl4030_madc_user_parms {
133 int channel; 137 int channel;
134 int average; 138 int average;
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index ca85cf894e33..bbd156bb953b 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -220,10 +220,11 @@ struct kernel_ipmi_msg {
220 * The in-kernel interface. 220 * The in-kernel interface.
221 */ 221 */
222#include <linux/list.h> 222#include <linux/list.h>
223#include <linux/module.h>
224#include <linux/device.h> 223#include <linux/device.h>
225#include <linux/proc_fs.h> 224#include <linux/proc_fs.h>
226 225
226struct module;
227
227/* Opaque type for a IPMI message user. One of these is needed to 228/* Opaque type for a IPMI message user. One of these is needed to
228 send and receive messages. */ 229 send and receive messages. */
229typedef struct ipmi_user *ipmi_user_t; 230typedef struct ipmi_user *ipmi_user_t;
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 204f9cd26c16..3ef0d8b6aa6f 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -36,7 +36,6 @@
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/proc_fs.h> 38#include <linux/proc_fs.h>
39#include <linux/module.h>
40#include <linux/device.h> 39#include <linux/device.h>
41#include <linux/platform_device.h> 40#include <linux/platform_device.h>
42#include <linux/ipmi.h> 41#include <linux/ipmi.h>
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 59e49c80cc2c..bff29c58da23 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -23,13 +23,13 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/topology.h> 24#include <linux/topology.h>
25#include <linux/wait.h> 25#include <linux/wait.h>
26#include <linux/module.h>
27 26
28#include <asm/irq.h> 27#include <asm/irq.h>
29#include <asm/ptrace.h> 28#include <asm/ptrace.h>
30#include <asm/irq_regs.h> 29#include <asm/irq_regs.h>
31 30
32struct seq_file; 31struct seq_file;
32struct module;
33struct irq_desc; 33struct irq_desc;
34struct irq_data; 34struct irq_data;
35typedef void (*irq_flow_handler_t)(unsigned int irq, 35typedef void (*irq_flow_handler_t)(unsigned int irq,
@@ -567,29 +567,21 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
567int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, 567int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
568 struct module *owner); 568 struct module *owner);
569 569
570static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, 570/* use macros to avoid needing export.h for THIS_MODULE */
571 int node) 571#define irq_alloc_descs(irq, from, cnt, node) \
572{ 572 __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE)
573 return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
574}
575 573
576void irq_free_descs(unsigned int irq, unsigned int cnt); 574#define irq_alloc_desc(node) \
577int irq_reserve_irqs(unsigned int from, unsigned int cnt); 575 irq_alloc_descs(-1, 0, 1, node)
578 576
579static inline int irq_alloc_desc(int node) 577#define irq_alloc_desc_at(at, node) \
580{ 578 irq_alloc_descs(at, at, 1, node)
581 return irq_alloc_descs(-1, 0, 1, node);
582}
583 579
584static inline int irq_alloc_desc_at(unsigned int at, int node) 580#define irq_alloc_desc_from(from, node) \
585{ 581 irq_alloc_descs(-1, from, 1, node)
586 return irq_alloc_descs(at, at, 1, node);
587}
588 582
589static inline int irq_alloc_desc_from(unsigned int from, int node) 583void irq_free_descs(unsigned int irq, unsigned int cnt);
590{ 584int irq_reserve_irqs(unsigned int from, unsigned int cnt);
591 return irq_alloc_descs(-1, from, 1, node);
592}
593 585
594static inline void irq_free_desc(unsigned int irq) 586static inline void irq_free_desc(unsigned int irq)
595{ 587{
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 6b69c2c9dff1..f1e2527006bd 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -11,6 +11,7 @@
11struct irq_affinity_notify; 11struct irq_affinity_notify;
12struct proc_dir_entry; 12struct proc_dir_entry;
13struct timer_rand_state; 13struct timer_rand_state;
14struct module;
14/** 15/**
15 * struct irq_desc - interrupt descriptor 16 * struct irq_desc - interrupt descriptor
16 * @irq_data: per irq and chip data passed down to chip functions 17 * @irq_data: per irq and chip data passed down to chip functions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 3ad553e8eae2..99834e581b9e 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -47,6 +47,7 @@ struct irq_domain_ops {
47 * of the irq_domain is responsible for allocating the array of 47 * of the irq_domain is responsible for allocating the array of
48 * irq_desc structures. 48 * irq_desc structures.
49 * @nr_irq: Number of irqs managed by the irq domain 49 * @nr_irq: Number of irqs managed by the irq domain
50 * @hwirq_base: Starting number for hwirqs managed by the irq domain
50 * @ops: pointer to irq_domain methods 51 * @ops: pointer to irq_domain methods
51 * @priv: private data pointer for use by owner. Not touched by irq_domain 52 * @priv: private data pointer for use by owner. Not touched by irq_domain
52 * core code. 53 * core code.
@@ -57,6 +58,7 @@ struct irq_domain {
57 struct list_head list; 58 struct list_head list;
58 unsigned int irq_base; 59 unsigned int irq_base;
59 unsigned int nr_irq; 60 unsigned int nr_irq;
61 unsigned int hwirq_base;
60 const struct irq_domain_ops *ops; 62 const struct irq_domain_ops *ops;
61 void *priv; 63 void *priv;
62 struct device_node *of_node; 64 struct device_node *of_node;
@@ -72,9 +74,21 @@ struct irq_domain {
72static inline unsigned int irq_domain_to_irq(struct irq_domain *d, 74static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
73 unsigned long hwirq) 75 unsigned long hwirq)
74{ 76{
75 return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq; 77 if (d->ops->to_irq)
78 return d->ops->to_irq(d, hwirq);
79 if (WARN_ON(hwirq < d->hwirq_base))
80 return 0;
81 return d->irq_base + hwirq - d->hwirq_base;
76} 82}
77 83
84#define irq_domain_for_each_hwirq(d, hw) \
85 for (hw = d->hwirq_base; hw < d->hwirq_base + d->nr_irq; hw++)
86
87#define irq_domain_for_each_irq(d, hw, irq) \
88 for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \
89 hw < d->hwirq_base + d->nr_irq; \
90 hw++, irq = irq_domain_to_irq(d, hw))
91
78extern void irq_domain_add(struct irq_domain *domain); 92extern void irq_domain_add(struct irq_domain *domain);
79extern void irq_domain_del(struct irq_domain *domain); 93extern void irq_domain_del(struct irq_domain *domain);
80#endif /* CONFIG_IRQ_DOMAIN */ 94#endif /* CONFIG_IRQ_DOMAIN */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index e6a5e34bed4f..c7acdde3243d 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -244,6 +244,7 @@ typedef struct journal_superblock_s
244 244
245#include <linux/fs.h> 245#include <linux/fs.h>
246#include <linux/sched.h> 246#include <linux/sched.h>
247#include <linux/jbd_common.h>
247 248
248#define J_ASSERT(assert) BUG_ON(!(assert)) 249#define J_ASSERT(assert) BUG_ON(!(assert))
249 250
@@ -270,69 +271,6 @@ typedef struct journal_superblock_s
270#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) 271#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why)
271#endif 272#endif
272 273
273enum jbd_state_bits {
274 BH_JBD /* Has an attached ext3 journal_head */
275 = BH_PrivateStart,
276 BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
277 BH_Freed, /* Has been freed (truncated) */
278 BH_Revoked, /* Has been revoked from the log */
279 BH_RevokeValid, /* Revoked flag is valid */
280 BH_JBDDirty, /* Is dirty but journaled */
281 BH_State, /* Pins most journal_head state */
282 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
283 BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
284};
285
286BUFFER_FNS(JBD, jbd)
287BUFFER_FNS(JWrite, jwrite)
288BUFFER_FNS(JBDDirty, jbddirty)
289TAS_BUFFER_FNS(JBDDirty, jbddirty)
290BUFFER_FNS(Revoked, revoked)
291TAS_BUFFER_FNS(Revoked, revoked)
292BUFFER_FNS(RevokeValid, revokevalid)
293TAS_BUFFER_FNS(RevokeValid, revokevalid)
294BUFFER_FNS(Freed, freed)
295
296static inline struct buffer_head *jh2bh(struct journal_head *jh)
297{
298 return jh->b_bh;
299}
300
301static inline struct journal_head *bh2jh(struct buffer_head *bh)
302{
303 return bh->b_private;
304}
305
306static inline void jbd_lock_bh_state(struct buffer_head *bh)
307{
308 bit_spin_lock(BH_State, &bh->b_state);
309}
310
311static inline int jbd_trylock_bh_state(struct buffer_head *bh)
312{
313 return bit_spin_trylock(BH_State, &bh->b_state);
314}
315
316static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
317{
318 return bit_spin_is_locked(BH_State, &bh->b_state);
319}
320
321static inline void jbd_unlock_bh_state(struct buffer_head *bh)
322{
323 bit_spin_unlock(BH_State, &bh->b_state);
324}
325
326static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
327{
328 bit_spin_lock(BH_JournalHead, &bh->b_state);
329}
330
331static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
332{
333 bit_spin_unlock(BH_JournalHead, &bh->b_state);
334}
335
336struct jbd_revoke_table_s; 274struct jbd_revoke_table_s;
337 275
338/** 276/**
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 38f307b8c334..2092ea21e469 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -275,6 +275,7 @@ typedef struct journal_superblock_s
275 275
276#include <linux/fs.h> 276#include <linux/fs.h>
277#include <linux/sched.h> 277#include <linux/sched.h>
278#include <linux/jbd_common.h>
278 279
279#define J_ASSERT(assert) BUG_ON(!(assert)) 280#define J_ASSERT(assert) BUG_ON(!(assert))
280 281
@@ -302,70 +303,6 @@ typedef struct journal_superblock_s
302#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) 303#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why)
303#endif 304#endif
304 305
305enum jbd_state_bits {
306 BH_JBD /* Has an attached ext3 journal_head */
307 = BH_PrivateStart,
308 BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
309 BH_Freed, /* Has been freed (truncated) */
310 BH_Revoked, /* Has been revoked from the log */
311 BH_RevokeValid, /* Revoked flag is valid */
312 BH_JBDDirty, /* Is dirty but journaled */
313 BH_State, /* Pins most journal_head state */
314 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
315 BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
316 BH_JBDPrivateStart, /* First bit available for private use by FS */
317};
318
319BUFFER_FNS(JBD, jbd)
320BUFFER_FNS(JWrite, jwrite)
321BUFFER_FNS(JBDDirty, jbddirty)
322TAS_BUFFER_FNS(JBDDirty, jbddirty)
323BUFFER_FNS(Revoked, revoked)
324TAS_BUFFER_FNS(Revoked, revoked)
325BUFFER_FNS(RevokeValid, revokevalid)
326TAS_BUFFER_FNS(RevokeValid, revokevalid)
327BUFFER_FNS(Freed, freed)
328
329static inline struct buffer_head *jh2bh(struct journal_head *jh)
330{
331 return jh->b_bh;
332}
333
334static inline struct journal_head *bh2jh(struct buffer_head *bh)
335{
336 return bh->b_private;
337}
338
339static inline void jbd_lock_bh_state(struct buffer_head *bh)
340{
341 bit_spin_lock(BH_State, &bh->b_state);
342}
343
344static inline int jbd_trylock_bh_state(struct buffer_head *bh)
345{
346 return bit_spin_trylock(BH_State, &bh->b_state);
347}
348
349static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
350{
351 return bit_spin_is_locked(BH_State, &bh->b_state);
352}
353
354static inline void jbd_unlock_bh_state(struct buffer_head *bh)
355{
356 bit_spin_unlock(BH_State, &bh->b_state);
357}
358
359static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
360{
361 bit_spin_lock(BH_JournalHead, &bh->b_state);
362}
363
364static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
365{
366 bit_spin_unlock(BH_JournalHead, &bh->b_state);
367}
368
369/* Flags in jbd_inode->i_flags */ 306/* Flags in jbd_inode->i_flags */
370#define __JI_COMMIT_RUNNING 0 307#define __JI_COMMIT_RUNNING 0
371/* Commit of the inode data in progress. We use this flag to protect us from 308/* Commit of the inode data in progress. We use this flag to protect us from
@@ -1106,9 +1043,9 @@ static inline handle_t *journal_current_handle(void)
1106 */ 1043 */
1107 1044
1108extern handle_t *jbd2_journal_start(journal_t *, int nblocks); 1045extern handle_t *jbd2_journal_start(journal_t *, int nblocks);
1109extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask); 1046extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask);
1110extern int jbd2_journal_restart(handle_t *, int nblocks); 1047extern int jbd2_journal_restart(handle_t *, int nblocks);
1111extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask); 1048extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask);
1112extern int jbd2_journal_extend (handle_t *, int nblocks); 1049extern int jbd2_journal_extend (handle_t *, int nblocks);
1113extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); 1050extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
1114extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); 1051extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *);
diff --git a/include/linux/jbd_common.h b/include/linux/jbd_common.h
new file mode 100644
index 000000000000..6230f8556a4e
--- /dev/null
+++ b/include/linux/jbd_common.h
@@ -0,0 +1,68 @@
1#ifndef _LINUX_JBD_STATE_H
2#define _LINUX_JBD_STATE_H
3
4enum jbd_state_bits {
5 BH_JBD /* Has an attached ext3 journal_head */
6 = BH_PrivateStart,
7 BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
8 BH_Freed, /* Has been freed (truncated) */
9 BH_Revoked, /* Has been revoked from the log */
10 BH_RevokeValid, /* Revoked flag is valid */
11 BH_JBDDirty, /* Is dirty but journaled */
12 BH_State, /* Pins most journal_head state */
13 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
14 BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
15 BH_JBDPrivateStart, /* First bit available for private use by FS */
16};
17
18BUFFER_FNS(JBD, jbd)
19BUFFER_FNS(JWrite, jwrite)
20BUFFER_FNS(JBDDirty, jbddirty)
21TAS_BUFFER_FNS(JBDDirty, jbddirty)
22BUFFER_FNS(Revoked, revoked)
23TAS_BUFFER_FNS(Revoked, revoked)
24BUFFER_FNS(RevokeValid, revokevalid)
25TAS_BUFFER_FNS(RevokeValid, revokevalid)
26BUFFER_FNS(Freed, freed)
27
28static inline struct buffer_head *jh2bh(struct journal_head *jh)
29{
30 return jh->b_bh;
31}
32
33static inline struct journal_head *bh2jh(struct buffer_head *bh)
34{
35 return bh->b_private;
36}
37
38static inline void jbd_lock_bh_state(struct buffer_head *bh)
39{
40 bit_spin_lock(BH_State, &bh->b_state);
41}
42
43static inline int jbd_trylock_bh_state(struct buffer_head *bh)
44{
45 return bit_spin_trylock(BH_State, &bh->b_state);
46}
47
48static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
49{
50 return bit_spin_is_locked(BH_State, &bh->b_state);
51}
52
53static inline void jbd_unlock_bh_state(struct buffer_head *bh)
54{
55 bit_spin_unlock(BH_State, &bh->b_state);
56}
57
58static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
59{
60 bit_spin_lock(BH_JournalHead, &bh->b_state);
61}
62
63static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
64{
65 bit_spin_unlock(BH_JournalHead, &bh->b_state);
66}
67
68#endif
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 66f23dc5e76a..388b0d425b50 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -16,7 +16,7 @@ struct jump_label_key {
16 16
17# include <asm/jump_label.h> 17# include <asm/jump_label.h>
18# define HAVE_JUMP_LABEL 18# define HAVE_JUMP_LABEL
19#endif 19#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
20 20
21enum jump_label_type { 21enum jump_label_type {
22 JUMP_LABEL_DISABLE = 0, 22 JUMP_LABEL_DISABLE = 0,
@@ -28,9 +28,9 @@ struct module;
28#ifdef HAVE_JUMP_LABEL 28#ifdef HAVE_JUMP_LABEL
29 29
30#ifdef CONFIG_MODULES 30#ifdef CONFIG_MODULES
31#define JUMP_LABEL_INIT {{ 0 }, NULL, NULL} 31#define JUMP_LABEL_INIT {ATOMIC_INIT(0), NULL, NULL}
32#else 32#else
33#define JUMP_LABEL_INIT {{ 0 }, NULL} 33#define JUMP_LABEL_INIT {ATOMIC_INIT(0), NULL}
34#endif 34#endif
35 35
36static __always_inline bool static_branch(struct jump_label_key *key) 36static __always_inline bool static_branch(struct jump_label_key *key)
@@ -41,18 +41,20 @@ static __always_inline bool static_branch(struct jump_label_key *key)
41extern struct jump_entry __start___jump_table[]; 41extern struct jump_entry __start___jump_table[];
42extern struct jump_entry __stop___jump_table[]; 42extern struct jump_entry __stop___jump_table[];
43 43
44extern void jump_label_init(void);
44extern void jump_label_lock(void); 45extern void jump_label_lock(void);
45extern void jump_label_unlock(void); 46extern void jump_label_unlock(void);
46extern void arch_jump_label_transform(struct jump_entry *entry, 47extern void arch_jump_label_transform(struct jump_entry *entry,
47 enum jump_label_type type); 48 enum jump_label_type type);
48extern void arch_jump_label_text_poke_early(jump_label_t addr); 49extern void arch_jump_label_transform_static(struct jump_entry *entry,
50 enum jump_label_type type);
49extern int jump_label_text_reserved(void *start, void *end); 51extern int jump_label_text_reserved(void *start, void *end);
50extern void jump_label_inc(struct jump_label_key *key); 52extern void jump_label_inc(struct jump_label_key *key);
51extern void jump_label_dec(struct jump_label_key *key); 53extern void jump_label_dec(struct jump_label_key *key);
52extern bool jump_label_enabled(struct jump_label_key *key); 54extern bool jump_label_enabled(struct jump_label_key *key);
53extern void jump_label_apply_nops(struct module *mod); 55extern void jump_label_apply_nops(struct module *mod);
54 56
55#else 57#else /* !HAVE_JUMP_LABEL */
56 58
57#include <linux/atomic.h> 59#include <linux/atomic.h>
58 60
@@ -62,6 +64,10 @@ struct jump_label_key {
62 atomic_t enabled; 64 atomic_t enabled;
63}; 65};
64 66
67static __always_inline void jump_label_init(void)
68{
69}
70
65static __always_inline bool static_branch(struct jump_label_key *key) 71static __always_inline bool static_branch(struct jump_label_key *key)
66{ 72{
67 if (unlikely(atomic_read(&key->enabled))) 73 if (unlikely(atomic_read(&key->enabled)))
@@ -96,7 +102,6 @@ static inline int jump_label_apply_nops(struct module *mod)
96{ 102{
97 return 0; 103 return 0;
98} 104}
105#endif /* HAVE_JUMP_LABEL */
99 106
100#endif 107#endif /* _LINUX_JUMP_LABEL_H */
101
102#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4c0d3b2fd5fc..e8b1597b5cf2 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -371,6 +371,7 @@ extern enum system_states {
371#define TAINT_WARN 9 371#define TAINT_WARN 9
372#define TAINT_CRAP 10 372#define TAINT_CRAP 10
373#define TAINT_FIRMWARE_WORKAROUND 11 373#define TAINT_FIRMWARE_WORKAROUND 11
374#define TAINT_OOT_MODULE 12
374 375
375extern const char hex_asc[]; 376extern const char hex_asc[];
376#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] 377#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 683d69890119..11a41a8f08eb 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -73,8 +73,8 @@ struct loop_device {
73 */ 73 */
74enum { 74enum {
75 LO_FLAGS_READ_ONLY = 1, 75 LO_FLAGS_READ_ONLY = 1,
76 LO_FLAGS_USE_AOPS = 2,
77 LO_FLAGS_AUTOCLEAR = 4, 76 LO_FLAGS_AUTOCLEAR = 4,
77 LO_FLAGS_PARTSCAN = 8,
78}; 78};
79 79
80#include <asm/posix_types.h> /* for __kernel_old_dev_t */ 80#include <asm/posix_types.h> /* for __kernel_old_dev_t */
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 1e5df2af8d84..2d4beab0d5b7 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -30,11 +30,11 @@
30#define ANON_INODE_FS_MAGIC 0x09041934 30#define ANON_INODE_FS_MAGIC 0x09041934
31#define PSTOREFS_MAGIC 0x6165676C 31#define PSTOREFS_MAGIC 0x6165676C
32 32
33#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ 33#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
34#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ 34#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
35#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ 35#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2 fs, 14 char names */
36#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ 36#define MINIX2_SUPER_MAGIC2 0x2478 /* minix v2 fs, 30 char names */
37#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */ 37#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */
38 38
39#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ 39#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
40#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ 40#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
diff --git a/include/linux/mdio-bitbang.h b/include/linux/mdio-bitbang.h
index 8ea9a42a4c02..0fe00cd4c93c 100644
--- a/include/linux/mdio-bitbang.h
+++ b/include/linux/mdio-bitbang.h
@@ -2,7 +2,8 @@
2#define __LINUX_MDIO_BITBANG_H 2#define __LINUX_MDIO_BITBANG_H
3 3
4#include <linux/phy.h> 4#include <linux/phy.h>
5#include <linux/module.h> 5
6struct module;
6 7
7struct mdiobb_ctrl; 8struct mdiobb_ctrl;
8 9
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index ac797fa03ef8..b87068a1a09e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -78,8 +78,8 @@ extern void mem_cgroup_uncharge_end(void);
78extern void mem_cgroup_uncharge_page(struct page *page); 78extern void mem_cgroup_uncharge_page(struct page *page);
79extern void mem_cgroup_uncharge_cache_page(struct page *page); 79extern void mem_cgroup_uncharge_cache_page(struct page *page);
80 80
81extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 81extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask);
82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg);
83 83
84extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 84extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
85extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 85extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
@@ -88,26 +88,28 @@ extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
88static inline 88static inline
89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
90{ 90{
91 struct mem_cgroup *mem; 91 struct mem_cgroup *memcg;
92 rcu_read_lock(); 92 rcu_read_lock();
93 mem = mem_cgroup_from_task(rcu_dereference((mm)->owner)); 93 memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner));
94 rcu_read_unlock(); 94 rcu_read_unlock();
95 return cgroup == mem; 95 return cgroup == memcg;
96} 96}
97 97
98extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); 98extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg);
99 99
100extern int 100extern int
101mem_cgroup_prepare_migration(struct page *page, 101mem_cgroup_prepare_migration(struct page *page,
102 struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); 102 struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask);
103extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 103extern void mem_cgroup_end_migration(struct mem_cgroup *memcg,
104 struct page *oldpage, struct page *newpage, bool migration_ok); 104 struct page *oldpage, struct page *newpage, bool migration_ok);
105 105
106/* 106/*
107 * For memory reclaim. 107 * For memory reclaim.
108 */ 108 */
109int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); 109int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg,
110int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); 110 struct zone *zone);
111int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg,
112 struct zone *zone);
111int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); 113int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
112unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, 114unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
113 int nid, int zid, unsigned int lrumask); 115 int nid, int zid, unsigned int lrumask);
@@ -148,7 +150,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
148unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, 150unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
149 gfp_t gfp_mask, 151 gfp_t gfp_mask,
150 unsigned long *total_scanned); 152 unsigned long *total_scanned);
151u64 mem_cgroup_get_limit(struct mem_cgroup *mem); 153u64 mem_cgroup_get_limit(struct mem_cgroup *memcg);
152 154
153void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 155void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
154#ifdef CONFIG_TRANSPARENT_HUGEPAGE 156#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -244,18 +246,20 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm
244 return NULL; 246 return NULL;
245} 247}
246 248
247static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 249static inline int mm_match_cgroup(struct mm_struct *mm,
250 struct mem_cgroup *memcg)
248{ 251{
249 return 1; 252 return 1;
250} 253}
251 254
252static inline int task_in_mem_cgroup(struct task_struct *task, 255static inline int task_in_mem_cgroup(struct task_struct *task,
253 const struct mem_cgroup *mem) 256 const struct mem_cgroup *memcg)
254{ 257{
255 return 1; 258 return 1;
256} 259}
257 260
258static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) 261static inline struct cgroup_subsys_state
262 *mem_cgroup_css(struct mem_cgroup *memcg)
259{ 263{
260 return NULL; 264 return NULL;
261} 265}
@@ -267,22 +271,22 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
267 return 0; 271 return 0;
268} 272}
269 273
270static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, 274static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg,
271 struct page *oldpage, struct page *newpage, bool migration_ok) 275 struct page *oldpage, struct page *newpage, bool migration_ok)
272{ 276{
273} 277}
274 278
275static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) 279static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg)
276{ 280{
277 return 0; 281 return 0;
278} 282}
279 283
280static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, 284static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg,
281 int priority) 285 int priority)
282{ 286{
283} 287}
284 288
285static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, 289static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg,
286 int priority) 290 int priority)
287{ 291{
288} 292}
@@ -293,13 +297,13 @@ static inline bool mem_cgroup_disabled(void)
293} 297}
294 298
295static inline int 299static inline int
296mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) 300mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone)
297{ 301{
298 return 1; 302 return 1;
299} 303}
300 304
301static inline int 305static inline int
302mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) 306mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, struct zone *zone)
303{ 307{
304 return 1; 308 return 1;
305} 309}
@@ -348,7 +352,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
348} 352}
349 353
350static inline 354static inline
351u64 mem_cgroup_get_limit(struct mem_cgroup *mem) 355u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
352{ 356{
353 return 0; 357 return 0;
354} 358}
diff --git a/include/linux/mfd/ab5500/ab5500.h b/include/linux/mfd/ab5500/ab5500.h
new file mode 100644
index 000000000000..a720051ae933
--- /dev/null
+++ b/include/linux/mfd/ab5500/ab5500.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (C) ST-Ericsson 2011
3 *
4 * License Terms: GNU General Public License v2
5 */
6#ifndef MFD_AB5500_H
7#define MFD_AB5500_H
8
9#include <linux/device.h>
10
11enum ab5500_devid {
12 AB5500_DEVID_ADC,
13 AB5500_DEVID_LEDS,
14 AB5500_DEVID_POWER,
15 AB5500_DEVID_REGULATORS,
16 AB5500_DEVID_SIM,
17 AB5500_DEVID_RTC,
18 AB5500_DEVID_CHARGER,
19 AB5500_DEVID_FUELGAUGE,
20 AB5500_DEVID_VIBRATOR,
21 AB5500_DEVID_CODEC,
22 AB5500_DEVID_USB,
23 AB5500_DEVID_OTP,
24 AB5500_DEVID_VIDEO,
25 AB5500_DEVID_DBIECI,
26 AB5500_DEVID_ONSWA,
27 AB5500_NUM_DEVICES,
28};
29
30enum ab5500_banks {
31 AB5500_BANK_VIT_IO_I2C_CLK_TST_OTP = 0,
32 AB5500_BANK_VDDDIG_IO_I2C_CLK_TST = 1,
33 AB5500_BANK_VDENC = 2,
34 AB5500_BANK_SIM_USBSIM = 3,
35 AB5500_BANK_LED = 4,
36 AB5500_BANK_ADC = 5,
37 AB5500_BANK_RTC = 6,
38 AB5500_BANK_STARTUP = 7,
39 AB5500_BANK_DBI_ECI = 8,
40 AB5500_BANK_CHG = 9,
41 AB5500_BANK_FG_BATTCOM_ACC = 10,
42 AB5500_BANK_USB = 11,
43 AB5500_BANK_IT = 12,
44 AB5500_BANK_VIBRA = 13,
45 AB5500_BANK_AUDIO_HEADSETUSB = 14,
46 AB5500_NUM_BANKS = 15,
47};
48
49enum ab5500_banks_addr {
50 AB5500_ADDR_VIT_IO_I2C_CLK_TST_OTP = 0x4A,
51 AB5500_ADDR_VDDDIG_IO_I2C_CLK_TST = 0x4B,
52 AB5500_ADDR_VDENC = 0x06,
53 AB5500_ADDR_SIM_USBSIM = 0x04,
54 AB5500_ADDR_LED = 0x10,
55 AB5500_ADDR_ADC = 0x0A,
56 AB5500_ADDR_RTC = 0x0F,
57 AB5500_ADDR_STARTUP = 0x03,
58 AB5500_ADDR_DBI_ECI = 0x07,
59 AB5500_ADDR_CHG = 0x0B,
60 AB5500_ADDR_FG_BATTCOM_ACC = 0x0C,
61 AB5500_ADDR_USB = 0x05,
62 AB5500_ADDR_IT = 0x0E,
63 AB5500_ADDR_VIBRA = 0x02,
64 AB5500_ADDR_AUDIO_HEADSETUSB = 0x0D,
65};
66
67/*
68 * Interrupt register offsets
69 * Bank : 0x0E
70 */
71#define AB5500_IT_SOURCE0_REG 0x20
72#define AB5500_IT_SOURCE1_REG 0x21
73#define AB5500_IT_SOURCE2_REG 0x22
74#define AB5500_IT_SOURCE3_REG 0x23
75#define AB5500_IT_SOURCE4_REG 0x24
76#define AB5500_IT_SOURCE5_REG 0x25
77#define AB5500_IT_SOURCE6_REG 0x26
78#define AB5500_IT_SOURCE7_REG 0x27
79#define AB5500_IT_SOURCE8_REG 0x28
80#define AB5500_IT_SOURCE9_REG 0x29
81#define AB5500_IT_SOURCE10_REG 0x2A
82#define AB5500_IT_SOURCE11_REG 0x2B
83#define AB5500_IT_SOURCE12_REG 0x2C
84#define AB5500_IT_SOURCE13_REG 0x2D
85#define AB5500_IT_SOURCE14_REG 0x2E
86#define AB5500_IT_SOURCE15_REG 0x2F
87#define AB5500_IT_SOURCE16_REG 0x30
88#define AB5500_IT_SOURCE17_REG 0x31
89#define AB5500_IT_SOURCE18_REG 0x32
90#define AB5500_IT_SOURCE19_REG 0x33
91#define AB5500_IT_SOURCE20_REG 0x34
92#define AB5500_IT_SOURCE21_REG 0x35
93#define AB5500_IT_SOURCE22_REG 0x36
94#define AB5500_IT_SOURCE23_REG 0x37
95
96#define AB5500_NUM_IRQ_REGS 23
97
98/**
99 * struct ab5500
100 * @access_mutex: lock out concurrent accesses to the AB registers
101 * @dev: a pointer to the device struct for this chip driver
102 * @ab5500_irq: the analog baseband irq
103 * @irq_base: the platform configuration irq base for subdevices
104 * @chip_name: name of this chip variant
105 * @chip_id: 8 bit chip ID for this chip variant
106 * @irq_lock: a lock to protect the mask
107 * @abb_events: a local bit mask of the prcmu wakeup events
108 * @event_mask: a local copy of the mask event registers
109 * @last_event_mask: a copy of the last event_mask written to hardware
110 * @startup_events: a copy of the first reading of the event registers
111 * @startup_events_read: whether the first events have been read
112 */
113struct ab5500 {
114 struct mutex access_mutex;
115 struct device *dev;
116 unsigned int ab5500_irq;
117 unsigned int irq_base;
118 char chip_name[32];
119 u8 chip_id;
120 struct mutex irq_lock;
121 u32 abb_events;
122 u8 mask[AB5500_NUM_IRQ_REGS];
123 u8 oldmask[AB5500_NUM_IRQ_REGS];
124 u8 startup_events[AB5500_NUM_IRQ_REGS];
125 bool startup_events_read;
126#ifdef CONFIG_DEBUG_FS
127 unsigned int debug_bank;
128 unsigned int debug_address;
129#endif
130};
131
132struct ab5500_platform_data {
133 struct {unsigned int base; unsigned int count; } irq;
134 void *dev_data[AB5500_NUM_DEVICES];
135 struct abx500_init_settings *init_settings;
136 unsigned int init_settings_sz;
137 bool pm_power_off;
138};
139
140#endif /* MFD_AB5500_H */
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/ab8500/gpadc.h
index 46b954011f16..252966769d93 100644
--- a/include/linux/mfd/ab8500/gpadc.h
+++ b/include/linux/mfd/ab8500/gpadc.h
@@ -27,6 +27,9 @@
27struct ab8500_gpadc; 27struct ab8500_gpadc;
28 28
29struct ab8500_gpadc *ab8500_gpadc_get(char *name); 29struct ab8500_gpadc *ab8500_gpadc_get(char *name);
30int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input); 30int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel);
31int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel);
32int ab8500_gpadc_ad_to_voltage(struct ab8500_gpadc *gpadc,
33 u8 channel, int ad_value);
31 34
32#endif /* _AB8500_GPADC_H */ 35#endif /* _AB8500_GPADC_H */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 896b5e47f16e..9970337ff041 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * ABX500 core access functions. 7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip 8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500, and ab8500. 9 * ab3100, ab5500, and ab8500.
10 * 10 *
11 * Author: Mattias Wallin <mattias.wallin@stericsson.com> 11 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> 12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
@@ -29,17 +29,16 @@
29#define AB3100_P1G 0xc6 29#define AB3100_P1G 0xc6
30#define AB3100_R2A 0xc7 30#define AB3100_R2A 0xc7
31#define AB3100_R2B 0xc8 31#define AB3100_R2B 0xc8
32#define AB3550_P1A 0x10
33#define AB5500_1_0 0x20 32#define AB5500_1_0 0x20
34#define AB5500_2_0 0x21 33#define AB5500_1_1 0x21
35#define AB5500_2_1 0x22 34#define AB5500_2_0 0x24
36 35
37/* AB8500 CIDs*/ 36/* AB8500 CIDs*/
38#define AB8500_CUTEARLY 0x00
39#define AB8500_CUT1P0 0x10 37#define AB8500_CUT1P0 0x10
40#define AB8500_CUT1P1 0x11 38#define AB8500_CUT1P1 0x11
41#define AB8500_CUT2P0 0x20 39#define AB8500_CUT2P0 0x20
42#define AB8500_CUT3P0 0x30 40#define AB8500_CUT3P0 0x30
41#define AB8500_CUT3P3 0x33
43 42
44/* 43/*
45 * AB3100, EVENTA1, A2 and A3 event register flags 44 * AB3100, EVENTA1, A2 and A3 event register flags
@@ -143,39 +142,6 @@ int ab3100_event_register(struct ab3100 *ab3100,
143int ab3100_event_unregister(struct ab3100 *ab3100, 142int ab3100_event_unregister(struct ab3100 *ab3100,
144 struct notifier_block *nb); 143 struct notifier_block *nb);
145 144
146/* AB3550, STR register flags */
147#define AB3550_STR_ONSWA (0x01)
148#define AB3550_STR_ONSWB (0x02)
149#define AB3550_STR_ONSWC (0x04)
150#define AB3550_STR_DCIO (0x08)
151#define AB3550_STR_BOOT_MODE (0x10)
152#define AB3550_STR_SIM_OFF (0x20)
153#define AB3550_STR_BATT_REMOVAL (0x40)
154#define AB3550_STR_VBUS (0x80)
155
156/* Interrupt mask registers */
157#define AB3550_IMR1 0x29
158#define AB3550_IMR2 0x2a
159#define AB3550_IMR3 0x2b
160#define AB3550_IMR4 0x2c
161#define AB3550_IMR5 0x2d
162
163enum ab3550_devid {
164 AB3550_DEVID_ADC,
165 AB3550_DEVID_DAC,
166 AB3550_DEVID_LEDS,
167 AB3550_DEVID_POWER,
168 AB3550_DEVID_REGULATORS,
169 AB3550_DEVID_SIM,
170 AB3550_DEVID_UART,
171 AB3550_DEVID_RTC,
172 AB3550_DEVID_CHARGER,
173 AB3550_DEVID_FUELGAUGE,
174 AB3550_DEVID_VIBRATOR,
175 AB3550_DEVID_CODEC,
176 AB3550_NUM_DEVICES,
177};
178
179/** 145/**
180 * struct abx500_init_setting 146 * struct abx500_init_setting
181 * Initial value of the registers for driver to use during setup. 147 * Initial value of the registers for driver to use during setup.
@@ -186,18 +152,6 @@ struct abx500_init_settings {
186 u8 setting; 152 u8 setting;
187}; 153};
188 154
189/**
190 * struct ab3550_platform_data
191 * Data supplied to initialize board connections to the AB3550
192 */
193struct ab3550_platform_data {
194 struct {unsigned int base; unsigned int count; } irq;
195 void *dev_data[AB3550_NUM_DEVICES];
196 size_t dev_data_sz[AB3550_NUM_DEVICES];
197 struct abx500_init_settings *init_settings;
198 unsigned int init_settings_sz;
199};
200
201int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, 155int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
202 u8 value); 156 u8 value);
203int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, 157int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h
index f0977986402c..9890687f582d 100644
--- a/include/linux/mfd/db5500-prcmu.h
+++ b/include/linux/mfd/db5500-prcmu.h
@@ -5,21 +5,35 @@
5 * 5 *
6 * U5500 PRCMU API. 6 * U5500 PRCMU API.
7 */ 7 */
8#ifndef __MACH_PRCMU_U5500_H 8#ifndef __MFD_DB5500_PRCMU_H
9#define __MACH_PRCMU_U5500_H 9#define __MFD_DB5500_PRCMU_H
10 10
11#ifdef CONFIG_UX500_SOC_DB5500 11#ifdef CONFIG_MFD_DB5500_PRCMU
12 12
13void db5500_prcmu_early_init(void); 13void db5500_prcmu_early_init(void);
14 14int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state);
15int db5500_prcmu_set_display_clocks(void);
16int db5500_prcmu_disable_dsipll(void);
17int db5500_prcmu_enable_dsipll(void);
15int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); 18int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
16int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); 19int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
20void db5500_prcmu_enable_wakeups(u32 wakeups);
21int db5500_prcmu_request_clock(u8 clock, bool enable);
22void db5500_prcmu_config_abb_event_readout(u32 abb_events);
23void db5500_prcmu_get_abb_event_buffer(void __iomem **buf);
24int prcmu_resetout(u8 resoutn, u8 state);
25int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
26 bool keep_ap_pll);
27int db5500_prcmu_config_esram0_deep_sleep(u8 state);
28void db5500_prcmu_system_reset(u16 reset_code);
29u16 db5500_prcmu_get_reset_code(void);
30bool db5500_prcmu_is_ac_wake_requested(void);
31int db5500_prcmu_set_arm_opp(u8 opp);
32int db5500_prcmu_get_arm_opp(void);
17 33
18#else /* !CONFIG_UX500_SOC_DB5500 */ 34#else /* !CONFIG_UX500_SOC_DB5500 */
19 35
20static inline void db5500_prcmu_early_init(void) 36static inline void db5500_prcmu_early_init(void) {}
21{
22}
23 37
24static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) 38static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
25{ 39{
@@ -31,15 +45,75 @@ static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
31 return -ENOSYS; 45 return -ENOSYS;
32} 46}
33 47
34#endif /* CONFIG_UX500_SOC_DB5500 */ 48static inline int db5500_prcmu_request_clock(u8 clock, bool enable)
49{
50 return 0;
51}
52
53static inline int db5500_prcmu_set_display_clocks(void)
54{
55 return 0;
56}
57
58static inline int db5500_prcmu_disable_dsipll(void)
59{
60 return 0;
61}
62
63static inline int db5500_prcmu_enable_dsipll(void)
64{
65 return 0;
66}
35 67
36static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events) 68static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state)
37{ 69{
38#ifdef CONFIG_MACH_U5500_SIMULATOR
39 return 0; 70 return 0;
40#else
41 return -1;
42#endif
43} 71}
44 72
45#endif /* __MACH_PRCMU_U5500_H */ 73static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {}
74
75static inline int prcmu_resetout(u8 resoutn, u8 state)
76{
77 return 0;
78}
79
80static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state)
81{
82 return 0;
83}
84
85static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {}
86static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {}
87
88static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
89 bool keep_ap_pll)
90{
91 return 0;
92}
93
94static inline void db5500_prcmu_system_reset(u16 reset_code) {}
95
96static inline u16 db5500_prcmu_get_reset_code(void)
97{
98 return 0;
99}
100
101static inline bool db5500_prcmu_is_ac_wake_requested(void)
102{
103 return 0;
104}
105
106static inline int db5500_prcmu_set_arm_opp(u8 opp)
107{
108 return 0;
109}
110
111static inline int db5500_prcmu_get_arm_opp(void)
112{
113 return 0;
114}
115
116
117#endif /* CONFIG_MFD_DB5500_PRCMU */
118
119#endif /* __MFD_DB5500_PRCMU_H */
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index 917dbcab701c..60d27f7bfc1f 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -11,7 +11,6 @@
11#define __MFD_DB8500_PRCMU_H 11#define __MFD_DB8500_PRCMU_H
12 12
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/notifier.h>
15 14
16/* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ 15/* This portion previously known as <mach/prcmu-fw-defs_v1.h> */
17 16
@@ -133,7 +132,7 @@ enum ap_pwrst {
133 * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle 132 * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle
134 */ 133 */
135enum ap_pwrst_trans { 134enum ap_pwrst_trans {
136 NO_TRANSITION = 0x00, 135 PRCMU_AP_NO_CHANGE = 0x00,
137 APEXECUTE_TO_APSLEEP = 0x01, 136 APEXECUTE_TO_APSLEEP = 0x01,
138 APIDLE_TO_APSLEEP = 0x02, /* To be removed */ 137 APIDLE_TO_APSLEEP = 0x02, /* To be removed */
139 PRCMU_AP_SLEEP = 0x01, 138 PRCMU_AP_SLEEP = 0x01,
@@ -146,54 +145,6 @@ enum ap_pwrst_trans {
146}; 145};
147 146
148/** 147/**
149 * enum ddr_pwrst - DDR power states definition
150 * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
151 * @DDR_PWR_STATE_ON:
152 * @DDR_PWR_STATE_OFFLOWLAT:
153 * @DDR_PWR_STATE_OFFHIGHLAT:
154 */
155enum ddr_pwrst {
156 DDR_PWR_STATE_UNCHANGED = 0x00,
157 DDR_PWR_STATE_ON = 0x01,
158 DDR_PWR_STATE_OFFLOWLAT = 0x02,
159 DDR_PWR_STATE_OFFHIGHLAT = 0x03
160};
161
162/**
163 * enum arm_opp - ARM OPP states definition
164 * @ARM_OPP_INIT:
165 * @ARM_NO_CHANGE: The ARM operating point is unchanged
166 * @ARM_100_OPP: The new ARM operating point is arm100opp
167 * @ARM_50_OPP: The new ARM operating point is arm50opp
168 * @ARM_MAX_OPP: Operating point is "max" (more than 100)
169 * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
170 * @ARM_EXTCLK: The new ARM operating point is armExtClk
171 */
172enum arm_opp {
173 ARM_OPP_INIT = 0x00,
174 ARM_NO_CHANGE = 0x01,
175 ARM_100_OPP = 0x02,
176 ARM_50_OPP = 0x03,
177 ARM_MAX_OPP = 0x04,
178 ARM_MAX_FREQ100OPP = 0x05,
179 ARM_EXTCLK = 0x07
180};
181
182/**
183 * enum ape_opp - APE OPP states definition
184 * @APE_OPP_INIT:
185 * @APE_NO_CHANGE: The APE operating point is unchanged
186 * @APE_100_OPP: The new APE operating point is ape100opp
187 * @APE_50_OPP: 50%
188 */
189enum ape_opp {
190 APE_OPP_INIT = 0x00,
191 APE_NO_CHANGE = 0x01,
192 APE_100_OPP = 0x02,
193 APE_50_OPP = 0x03
194};
195
196/**
197 * enum hw_acc_state - State definition for hardware accelerator 148 * enum hw_acc_state - State definition for hardware accelerator
198 * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged 149 * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged
199 * @HW_OFF: The hardware accelerator must be switched off 150 * @HW_OFF: The hardware accelerator must be switched off
@@ -469,26 +420,6 @@ enum auto_enable {
469 420
470/* End of file previously known as prcmu-fw-defs_v1.h */ 421/* End of file previously known as prcmu-fw-defs_v1.h */
471 422
472/* PRCMU Wakeup defines */
473enum prcmu_wakeup_index {
474 PRCMU_WAKEUP_INDEX_RTC,
475 PRCMU_WAKEUP_INDEX_RTT0,
476 PRCMU_WAKEUP_INDEX_RTT1,
477 PRCMU_WAKEUP_INDEX_HSI0,
478 PRCMU_WAKEUP_INDEX_HSI1,
479 PRCMU_WAKEUP_INDEX_USB,
480 PRCMU_WAKEUP_INDEX_ABB,
481 PRCMU_WAKEUP_INDEX_ABB_FIFO,
482 PRCMU_WAKEUP_INDEX_ARM,
483 NUM_PRCMU_WAKEUP_INDICES
484};
485#define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
486
487/* PRCMU QoS APE OPP class */
488#define PRCMU_QOS_APE_OPP 1
489#define PRCMU_QOS_DDR_OPP 2
490#define PRCMU_QOS_DEFAULT_VALUE -1
491
492/** 423/**
493 * enum hw_acc_dev - enum for hw accelerators 424 * enum hw_acc_dev - enum for hw accelerators
494 * @HW_ACC_SVAMMDSP: for SVAMMDSP 425 * @HW_ACC_SVAMMDSP: for SVAMMDSP
@@ -527,64 +458,6 @@ enum hw_acc_dev {
527}; 458};
528 459
529/* 460/*
530 * Ids for all EPODs (power domains)
531 * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
532 * - EPOD_ID_SVAPIPE: power domain for SVA pipe
533 * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
534 * - EPOD_ID_SIAPIPE: power domain for SIA pipe
535 * - EPOD_ID_SGA: power domain for SGA
536 * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
537 * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
538 * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
539 * - NUM_EPOD_ID: number of power domains
540 */
541#define EPOD_ID_SVAMMDSP 0
542#define EPOD_ID_SVAPIPE 1
543#define EPOD_ID_SIAMMDSP 2
544#define EPOD_ID_SIAPIPE 3
545#define EPOD_ID_SGA 4
546#define EPOD_ID_B2R2_MCDE 5
547#define EPOD_ID_ESRAM12 6
548#define EPOD_ID_ESRAM34 7
549#define NUM_EPOD_ID 8
550
551/*
552 * state definition for EPOD (power domain)
553 * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
554 * - EPOD_STATE_OFF: The EPOD is switched off
555 * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
556 * retention
557 * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
558 * - EPOD_STATE_ON: Same as above, but with clock enabled
559 */
560#define EPOD_STATE_NO_CHANGE 0x00
561#define EPOD_STATE_OFF 0x01
562#define EPOD_STATE_RAMRET 0x02
563#define EPOD_STATE_ON_CLK_OFF 0x03
564#define EPOD_STATE_ON 0x04
565
566/*
567 * CLKOUT sources
568 */
569#define PRCMU_CLKSRC_CLK38M 0x00
570#define PRCMU_CLKSRC_ACLK 0x01
571#define PRCMU_CLKSRC_SYSCLK 0x02
572#define PRCMU_CLKSRC_LCDCLK 0x03
573#define PRCMU_CLKSRC_SDMMCCLK 0x04
574#define PRCMU_CLKSRC_TVCLK 0x05
575#define PRCMU_CLKSRC_TIMCLK 0x06
576#define PRCMU_CLKSRC_CLK009 0x07
577/* These are only valid for CLKOUT1: */
578#define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
579#define PRCMU_CLKSRC_I2CCLK 0x41
580#define PRCMU_CLKSRC_MSP02CLK 0x42
581#define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
582#define PRCMU_CLKSRC_HSIRXCLK 0x44
583#define PRCMU_CLKSRC_HSITXCLK 0x45
584#define PRCMU_CLKSRC_ARMCLKFIX 0x46
585#define PRCMU_CLKSRC_HDMICLK 0x47
586
587/*
588 * Definitions for autonomous power management configuration. 461 * Definitions for autonomous power management configuration.
589 */ 462 */
590 463
@@ -620,88 +493,12 @@ struct prcmu_auto_pm_config {
620 u8 sva_policy; 493 u8 sva_policy;
621}; 494};
622 495
623/**
624 * enum ddr_opp - DDR OPP states definition
625 * @DDR_100_OPP: The new DDR operating point is ddr100opp
626 * @DDR_50_OPP: The new DDR operating point is ddr50opp
627 * @DDR_25_OPP: The new DDR operating point is ddr25opp
628 */
629enum ddr_opp {
630 DDR_100_OPP = 0x00,
631 DDR_50_OPP = 0x01,
632 DDR_25_OPP = 0x02,
633};
634
635/*
636 * Clock identifiers.
637 */
638enum prcmu_clock {
639 PRCMU_SGACLK,
640 PRCMU_UARTCLK,
641 PRCMU_MSP02CLK,
642 PRCMU_MSP1CLK,
643 PRCMU_I2CCLK,
644 PRCMU_SDMMCCLK,
645 PRCMU_SLIMCLK,
646 PRCMU_PER1CLK,
647 PRCMU_PER2CLK,
648 PRCMU_PER3CLK,
649 PRCMU_PER5CLK,
650 PRCMU_PER6CLK,
651 PRCMU_PER7CLK,
652 PRCMU_LCDCLK,
653 PRCMU_BMLCLK,
654 PRCMU_HSITXCLK,
655 PRCMU_HSIRXCLK,
656 PRCMU_HDMICLK,
657 PRCMU_APEATCLK,
658 PRCMU_APETRACECLK,
659 PRCMU_MCDECLK,
660 PRCMU_IPI2CCLK,
661 PRCMU_DSIALTCLK,
662 PRCMU_DMACLK,
663 PRCMU_B2R2CLK,
664 PRCMU_TVCLK,
665 PRCMU_SSPCLK,
666 PRCMU_RNGCLK,
667 PRCMU_UICCCLK,
668 PRCMU_NUM_REG_CLOCKS,
669 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
670 PRCMU_TIMCLK,
671};
672
673/*
674 * Definitions for controlling ESRAM0 in deep sleep.
675 */
676#define ESRAM0_DEEP_SLEEP_STATE_OFF 1
677#define ESRAM0_DEEP_SLEEP_STATE_RET 2
678
679#ifdef CONFIG_MFD_DB8500_PRCMU
680void __init prcmu_early_init(void);
681int prcmu_set_display_clocks(void);
682int prcmu_disable_dsipll(void);
683int prcmu_enable_dsipll(void);
684#else
685static inline void __init prcmu_early_init(void) {}
686#endif
687
688#ifdef CONFIG_MFD_DB8500_PRCMU 496#ifdef CONFIG_MFD_DB8500_PRCMU
689 497
498void db8500_prcmu_early_init(void);
690int prcmu_set_rc_a2p(enum romcode_write); 499int prcmu_set_rc_a2p(enum romcode_write);
691enum romcode_read prcmu_get_rc_p2a(void); 500enum romcode_read prcmu_get_rc_p2a(void);
692enum ap_pwrst prcmu_get_xp70_current_state(void); 501enum ap_pwrst prcmu_get_xp70_current_state(void);
693int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll);
694
695void prcmu_enable_wakeups(u32 wakeups);
696static inline void prcmu_disable_wakeups(void)
697{
698 prcmu_enable_wakeups(0);
699}
700
701void prcmu_config_abb_event_readout(u32 abb_events);
702void prcmu_get_abb_event_buffer(void __iomem **buf);
703int prcmu_set_arm_opp(u8 opp);
704int prcmu_get_arm_opp(void);
705bool prcmu_has_arm_maxopp(void); 502bool prcmu_has_arm_maxopp(void);
706bool prcmu_is_u8400(void); 503bool prcmu_is_u8400(void);
707int prcmu_set_ape_opp(u8 opp); 504int prcmu_set_ape_opp(u8 opp);
@@ -710,19 +507,14 @@ int prcmu_request_ape_opp_100_voltage(bool enable);
710int prcmu_release_usb_wakeup_state(void); 507int prcmu_release_usb_wakeup_state(void);
711int prcmu_set_ddr_opp(u8 opp); 508int prcmu_set_ddr_opp(u8 opp);
712int prcmu_get_ddr_opp(void); 509int prcmu_get_ddr_opp(void);
713unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
714void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
715/* NOTE! Use regulator framework instead */ 510/* NOTE! Use regulator framework instead */
716int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); 511int prcmu_set_hwacc(u16 hw_acc_dev, u8 state);
717int prcmu_set_epod(u16 epod_id, u8 epod_state);
718void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, 512void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
719 struct prcmu_auto_pm_config *idle); 513 struct prcmu_auto_pm_config *idle);
720bool prcmu_is_auto_pm_enabled(void); 514bool prcmu_is_auto_pm_enabled(void);
721 515
722int prcmu_config_clkout(u8 clkout, u8 source, u8 div); 516int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
723int prcmu_request_clock(u8 clock, bool enable);
724int prcmu_set_clock_divider(u8 clock, u8 divider); 517int prcmu_set_clock_divider(u8 clock, u8 divider);
725int prcmu_config_esram0_deep_sleep(u8 state);
726int prcmu_config_hotdog(u8 threshold); 518int prcmu_config_hotdog(u8 threshold);
727int prcmu_config_hotmon(u8 low, u8 high); 519int prcmu_config_hotmon(u8 low, u8 high);
728int prcmu_start_temp_sense(u16 cycles32k); 520int prcmu_start_temp_sense(u16 cycles32k);
@@ -732,14 +524,36 @@ int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
732 524
733void prcmu_ac_wake_req(void); 525void prcmu_ac_wake_req(void);
734void prcmu_ac_sleep_req(void); 526void prcmu_ac_sleep_req(void);
735void prcmu_system_reset(u16 reset_code);
736void prcmu_modem_reset(void); 527void prcmu_modem_reset(void);
737bool prcmu_is_ac_wake_requested(void);
738void prcmu_enable_spi2(void); 528void prcmu_enable_spi2(void);
739void prcmu_disable_spi2(void); 529void prcmu_disable_spi2(void);
740 530
531int prcmu_config_a9wdog(u8 num, bool sleep_auto_off);
532int prcmu_enable_a9wdog(u8 id);
533int prcmu_disable_a9wdog(u8 id);
534int prcmu_kick_a9wdog(u8 id);
535int prcmu_load_a9wdog(u8 id, u32 val);
536
537void db8500_prcmu_system_reset(u16 reset_code);
538int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll);
539void db8500_prcmu_enable_wakeups(u32 wakeups);
540int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state);
541int db8500_prcmu_request_clock(u8 clock, bool enable);
542int db8500_prcmu_set_display_clocks(void);
543int db8500_prcmu_disable_dsipll(void);
544int db8500_prcmu_enable_dsipll(void);
545void db8500_prcmu_config_abb_event_readout(u32 abb_events);
546void db8500_prcmu_get_abb_event_buffer(void __iomem **buf);
547int db8500_prcmu_config_esram0_deep_sleep(u8 state);
548u16 db8500_prcmu_get_reset_code(void);
549bool db8500_prcmu_is_ac_wake_requested(void);
550int db8500_prcmu_set_arm_opp(u8 opp);
551int db8500_prcmu_get_arm_opp(void);
552
741#else /* !CONFIG_MFD_DB8500_PRCMU */ 553#else /* !CONFIG_MFD_DB8500_PRCMU */
742 554
555static inline void db8500_prcmu_early_init(void) {}
556
743static inline int prcmu_set_rc_a2p(enum romcode_write code) 557static inline int prcmu_set_rc_a2p(enum romcode_write code)
744{ 558{
745 return 0; 559 return 0;
@@ -755,34 +569,12 @@ static inline enum ap_pwrst prcmu_get_xp70_current_state(void)
755 return AP_EXECUTE; 569 return AP_EXECUTE;
756} 570}
757 571
758static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, 572static inline bool prcmu_has_arm_maxopp(void)
759 bool keep_ap_pll)
760{
761 return 0;
762}
763
764static inline void prcmu_enable_wakeups(u32 wakeups) {}
765
766static inline void prcmu_disable_wakeups(void) {}
767
768static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
769
770static inline int prcmu_set_arm_opp(u8 opp)
771{
772 return 0;
773}
774
775static inline int prcmu_get_arm_opp(void)
776{
777 return ARM_100_OPP;
778}
779
780static bool prcmu_has_arm_maxopp(void)
781{ 573{
782 return false; 574 return false;
783} 575}
784 576
785static bool prcmu_is_u8400(void) 577static inline bool prcmu_is_u8400(void)
786{ 578{
787 return false; 579 return false;
788} 580}
@@ -817,13 +609,6 @@ static inline int prcmu_get_ddr_opp(void)
817 return DDR_100_OPP; 609 return DDR_100_OPP;
818} 610}
819 611
820static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
821{
822 return 0;
823}
824
825static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
826
827static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) 612static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state)
828{ 613{
829 return 0; 614 return 0;
@@ -844,21 +629,11 @@ static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
844 return 0; 629 return 0;
845} 630}
846 631
847static inline int prcmu_request_clock(u8 clock, bool enable)
848{
849 return 0;
850}
851
852static inline int prcmu_set_clock_divider(u8 clock, u8 divider) 632static inline int prcmu_set_clock_divider(u8 clock, u8 divider)
853{ 633{
854 return 0; 634 return 0;
855} 635}
856 636
857int prcmu_config_esram0_deep_sleep(u8 state)
858{
859 return 0;
860}
861
862static inline int prcmu_config_hotdog(u8 threshold) 637static inline int prcmu_config_hotdog(u8 threshold)
863{ 638{
864 return 0; 639 return 0;
@@ -893,86 +668,107 @@ static inline void prcmu_ac_wake_req(void) {}
893 668
894static inline void prcmu_ac_sleep_req(void) {} 669static inline void prcmu_ac_sleep_req(void) {}
895 670
896static inline void prcmu_system_reset(u16 reset_code) {}
897
898static inline void prcmu_modem_reset(void) {} 671static inline void prcmu_modem_reset(void) {}
899 672
900static inline bool prcmu_is_ac_wake_requested(void) 673static inline int prcmu_enable_spi2(void)
901{ 674{
902 return false; 675 return 0;
903} 676}
904 677
905#ifndef CONFIG_UX500_SOC_DB5500 678static inline int prcmu_disable_spi2(void)
906static inline int prcmu_set_display_clocks(void)
907{ 679{
908 return 0; 680 return 0;
909} 681}
910 682
911static inline int prcmu_disable_dsipll(void) 683static inline void db8500_prcmu_system_reset(u16 reset_code) {}
684
685static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
686 bool keep_ap_pll)
912{ 687{
913 return 0; 688 return 0;
914} 689}
915 690
916static inline int prcmu_enable_dsipll(void) 691static inline void db8500_prcmu_enable_wakeups(u32 wakeups) {}
692
693static inline int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state)
917{ 694{
918 return 0; 695 return 0;
919} 696}
920#endif
921 697
922static inline int prcmu_enable_spi2(void) 698static inline int db8500_prcmu_request_clock(u8 clock, bool enable)
923{ 699{
924 return 0; 700 return 0;
925} 701}
926 702
927static inline int prcmu_disable_spi2(void) 703static inline int db8500_prcmu_set_display_clocks(void)
928{ 704{
929 return 0; 705 return 0;
930} 706}
931 707
932#endif /* !CONFIG_MFD_DB8500_PRCMU */ 708static inline int db8500_prcmu_disable_dsipll(void)
709{
710 return 0;
711}
712
713static inline int db8500_prcmu_enable_dsipll(void)
714{
715 return 0;
716}
717
718static inline int db8500_prcmu_config_esram0_deep_sleep(u8 state)
719{
720 return 0;
721}
722
723static inline void db8500_prcmu_config_abb_event_readout(u32 abb_events) {}
933 724
934#ifdef CONFIG_UX500_PRCMU_QOS_POWER 725static inline void db8500_prcmu_get_abb_event_buffer(void __iomem **buf) {}
935int prcmu_qos_requirement(int pm_qos_class); 726
936int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); 727static inline u16 db8500_prcmu_get_reset_code(void)
937int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
938void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
939int prcmu_qos_add_notifier(int prcmu_qos_class,
940 struct notifier_block *notifier);
941int prcmu_qos_remove_notifier(int prcmu_qos_class,
942 struct notifier_block *notifier);
943#else
944static inline int prcmu_qos_requirement(int prcmu_qos_class)
945{ 728{
946 return 0; 729 return 0;
947} 730}
948 731
949static inline int prcmu_qos_add_requirement(int prcmu_qos_class, 732static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off)
950 char *name, s32 value)
951{ 733{
952 return 0; 734 return 0;
953} 735}
954 736
955static inline int prcmu_qos_update_requirement(int prcmu_qos_class, 737static inline int prcmu_enable_a9wdog(u8 id)
956 char *name, s32 new_value)
957{ 738{
958 return 0; 739 return 0;
959} 740}
960 741
961static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) 742static inline int prcmu_disable_a9wdog(u8 id)
962{ 743{
744 return 0;
963} 745}
964 746
965static inline int prcmu_qos_add_notifier(int prcmu_qos_class, 747static inline int prcmu_kick_a9wdog(u8 id)
966 struct notifier_block *notifier)
967{ 748{
968 return 0; 749 return 0;
969} 750}
970static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, 751
971 struct notifier_block *notifier) 752static inline int prcmu_load_a9wdog(u8 id, u32 val)
972{ 753{
973 return 0; 754 return 0;
974} 755}
975 756
976#endif 757static inline bool db8500_prcmu_is_ac_wake_requested(void)
758{
759 return 0;
760}
761
762static inline int db8500_prcmu_set_arm_opp(u8 opp)
763{
764 return 0;
765}
766
767static inline int db8500_prcmu_get_arm_opp(void)
768{
769 return 0;
770}
771
772#endif /* !CONFIG_MFD_DB8500_PRCMU */
977 773
978#endif /* __MFD_DB8500_PRCMU_H */ 774#endif /* __MFD_DB8500_PRCMU_H */
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
new file mode 100644
index 000000000000..bac942f959c1
--- /dev/null
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -0,0 +1,549 @@
1/*
2 * Copyright (C) ST Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 *
6 * STE Ux500 PRCMU API
7 */
8#ifndef __MACH_PRCMU_H
9#define __MACH_PRCMU_H
10
11#include <linux/interrupt.h>
12#include <linux/notifier.h>
13#include <asm/mach-types.h>
14
15/* PRCMU Wakeup defines */
16enum prcmu_wakeup_index {
17 PRCMU_WAKEUP_INDEX_RTC,
18 PRCMU_WAKEUP_INDEX_RTT0,
19 PRCMU_WAKEUP_INDEX_RTT1,
20 PRCMU_WAKEUP_INDEX_HSI0,
21 PRCMU_WAKEUP_INDEX_HSI1,
22 PRCMU_WAKEUP_INDEX_USB,
23 PRCMU_WAKEUP_INDEX_ABB,
24 PRCMU_WAKEUP_INDEX_ABB_FIFO,
25 PRCMU_WAKEUP_INDEX_ARM,
26 PRCMU_WAKEUP_INDEX_CD_IRQ,
27 NUM_PRCMU_WAKEUP_INDICES
28};
29#define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
30
31/* EPOD (power domain) IDs */
32
33/*
34 * DB8500 EPODs
35 * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
36 * - EPOD_ID_SVAPIPE: power domain for SVA pipe
37 * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
38 * - EPOD_ID_SIAPIPE: power domain for SIA pipe
39 * - EPOD_ID_SGA: power domain for SGA
40 * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
41 * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
42 * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
43 * - NUM_EPOD_ID: number of power domains
44 *
45 * TODO: These should be prefixed.
46 */
47#define EPOD_ID_SVAMMDSP 0
48#define EPOD_ID_SVAPIPE 1
49#define EPOD_ID_SIAMMDSP 2
50#define EPOD_ID_SIAPIPE 3
51#define EPOD_ID_SGA 4
52#define EPOD_ID_B2R2_MCDE 5
53#define EPOD_ID_ESRAM12 6
54#define EPOD_ID_ESRAM34 7
55#define NUM_EPOD_ID 8
56
57/*
58 * DB5500 EPODs
59 */
60#define DB5500_EPOD_ID_BASE 0x0100
61#define DB5500_EPOD_ID_SGA (DB5500_EPOD_ID_BASE + 0)
62#define DB5500_EPOD_ID_HVA (DB5500_EPOD_ID_BASE + 1)
63#define DB5500_EPOD_ID_SIA (DB5500_EPOD_ID_BASE + 2)
64#define DB5500_EPOD_ID_DISP (DB5500_EPOD_ID_BASE + 3)
65#define DB5500_EPOD_ID_ESRAM12 (DB5500_EPOD_ID_BASE + 6)
66#define DB5500_NUM_EPOD_ID 7
67
68/*
69 * state definition for EPOD (power domain)
70 * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
71 * - EPOD_STATE_OFF: The EPOD is switched off
72 * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
73 * retention
74 * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
75 * - EPOD_STATE_ON: Same as above, but with clock enabled
76 */
77#define EPOD_STATE_NO_CHANGE 0x00
78#define EPOD_STATE_OFF 0x01
79#define EPOD_STATE_RAMRET 0x02
80#define EPOD_STATE_ON_CLK_OFF 0x03
81#define EPOD_STATE_ON 0x04
82
83/*
84 * CLKOUT sources
85 */
86#define PRCMU_CLKSRC_CLK38M 0x00
87#define PRCMU_CLKSRC_ACLK 0x01
88#define PRCMU_CLKSRC_SYSCLK 0x02
89#define PRCMU_CLKSRC_LCDCLK 0x03
90#define PRCMU_CLKSRC_SDMMCCLK 0x04
91#define PRCMU_CLKSRC_TVCLK 0x05
92#define PRCMU_CLKSRC_TIMCLK 0x06
93#define PRCMU_CLKSRC_CLK009 0x07
94/* These are only valid for CLKOUT1: */
95#define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
96#define PRCMU_CLKSRC_I2CCLK 0x41
97#define PRCMU_CLKSRC_MSP02CLK 0x42
98#define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
99#define PRCMU_CLKSRC_HSIRXCLK 0x44
100#define PRCMU_CLKSRC_HSITXCLK 0x45
101#define PRCMU_CLKSRC_ARMCLKFIX 0x46
102#define PRCMU_CLKSRC_HDMICLK 0x47
103
104/*
105 * Clock identifiers.
106 */
107enum prcmu_clock {
108 PRCMU_SGACLK,
109 PRCMU_UARTCLK,
110 PRCMU_MSP02CLK,
111 PRCMU_MSP1CLK,
112 PRCMU_I2CCLK,
113 PRCMU_SDMMCCLK,
114 PRCMU_SLIMCLK,
115 PRCMU_PER1CLK,
116 PRCMU_PER2CLK,
117 PRCMU_PER3CLK,
118 PRCMU_PER5CLK,
119 PRCMU_PER6CLK,
120 PRCMU_PER7CLK,
121 PRCMU_LCDCLK,
122 PRCMU_BMLCLK,
123 PRCMU_HSITXCLK,
124 PRCMU_HSIRXCLK,
125 PRCMU_HDMICLK,
126 PRCMU_APEATCLK,
127 PRCMU_APETRACECLK,
128 PRCMU_MCDECLK,
129 PRCMU_IPI2CCLK,
130 PRCMU_DSIALTCLK,
131 PRCMU_DMACLK,
132 PRCMU_B2R2CLK,
133 PRCMU_TVCLK,
134 PRCMU_SSPCLK,
135 PRCMU_RNGCLK,
136 PRCMU_UICCCLK,
137 PRCMU_PWMCLK,
138 PRCMU_IRDACLK,
139 PRCMU_IRRCCLK,
140 PRCMU_SIACLK,
141 PRCMU_SVACLK,
142 PRCMU_NUM_REG_CLOCKS,
143 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
144 PRCMU_TIMCLK,
145 PRCMU_PLLSOC0,
146 PRCMU_PLLSOC1,
147 PRCMU_PLLDDR,
148};
149
150/**
151 * enum ape_opp - APE OPP states definition
152 * @APE_OPP_INIT:
153 * @APE_NO_CHANGE: The APE operating point is unchanged
154 * @APE_100_OPP: The new APE operating point is ape100opp
155 * @APE_50_OPP: 50%
156 */
157enum ape_opp {
158 APE_OPP_INIT = 0x00,
159 APE_NO_CHANGE = 0x01,
160 APE_100_OPP = 0x02,
161 APE_50_OPP = 0x03
162};
163
164/**
165 * enum arm_opp - ARM OPP states definition
166 * @ARM_OPP_INIT:
167 * @ARM_NO_CHANGE: The ARM operating point is unchanged
168 * @ARM_100_OPP: The new ARM operating point is arm100opp
169 * @ARM_50_OPP: The new ARM operating point is arm50opp
170 * @ARM_MAX_OPP: Operating point is "max" (more than 100)
171 * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
172 * @ARM_EXTCLK: The new ARM operating point is armExtClk
173 */
174enum arm_opp {
175 ARM_OPP_INIT = 0x00,
176 ARM_NO_CHANGE = 0x01,
177 ARM_100_OPP = 0x02,
178 ARM_50_OPP = 0x03,
179 ARM_MAX_OPP = 0x04,
180 ARM_MAX_FREQ100OPP = 0x05,
181 ARM_EXTCLK = 0x07
182};
183
184/**
185 * enum ddr_opp - DDR OPP states definition
186 * @DDR_100_OPP: The new DDR operating point is ddr100opp
187 * @DDR_50_OPP: The new DDR operating point is ddr50opp
188 * @DDR_25_OPP: The new DDR operating point is ddr25opp
189 */
190enum ddr_opp {
191 DDR_100_OPP = 0x00,
192 DDR_50_OPP = 0x01,
193 DDR_25_OPP = 0x02,
194};
195
196/*
197 * Definitions for controlling ESRAM0 in deep sleep.
198 */
199#define ESRAM0_DEEP_SLEEP_STATE_OFF 1
200#define ESRAM0_DEEP_SLEEP_STATE_RET 2
201
202/**
203 * enum ddr_pwrst - DDR power states definition
204 * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
205 * @DDR_PWR_STATE_ON:
206 * @DDR_PWR_STATE_OFFLOWLAT:
207 * @DDR_PWR_STATE_OFFHIGHLAT:
208 */
209enum ddr_pwrst {
210 DDR_PWR_STATE_UNCHANGED = 0x00,
211 DDR_PWR_STATE_ON = 0x01,
212 DDR_PWR_STATE_OFFLOWLAT = 0x02,
213 DDR_PWR_STATE_OFFHIGHLAT = 0x03
214};
215
216#include <linux/mfd/db8500-prcmu.h>
217#include <linux/mfd/db5500-prcmu.h>
218
219#if defined(CONFIG_UX500_SOC_DB8500) || defined(CONFIG_UX500_SOC_DB5500)
220
221static inline void __init prcmu_early_init(void)
222{
223 if (machine_is_u5500())
224 return db5500_prcmu_early_init();
225 else
226 return db8500_prcmu_early_init();
227}
228
229static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
230 bool keep_ap_pll)
231{
232 if (machine_is_u5500())
233 return db5500_prcmu_set_power_state(state, keep_ulp_clk,
234 keep_ap_pll);
235 else
236 return db8500_prcmu_set_power_state(state, keep_ulp_clk,
237 keep_ap_pll);
238}
239
240static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
241{
242 if (machine_is_u5500())
243 return -EINVAL;
244 else
245 return db8500_prcmu_set_epod(epod_id, epod_state);
246}
247
248static inline void prcmu_enable_wakeups(u32 wakeups)
249{
250 if (machine_is_u5500())
251 db5500_prcmu_enable_wakeups(wakeups);
252 else
253 db8500_prcmu_enable_wakeups(wakeups);
254}
255
256static inline void prcmu_disable_wakeups(void)
257{
258 prcmu_enable_wakeups(0);
259}
260
261static inline void prcmu_config_abb_event_readout(u32 abb_events)
262{
263 if (machine_is_u5500())
264 db5500_prcmu_config_abb_event_readout(abb_events);
265 else
266 db8500_prcmu_config_abb_event_readout(abb_events);
267}
268
269static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
270{
271 if (machine_is_u5500())
272 db5500_prcmu_get_abb_event_buffer(buf);
273 else
274 db8500_prcmu_get_abb_event_buffer(buf);
275}
276
277int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
278int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
279
280int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
281
282static inline int prcmu_request_clock(u8 clock, bool enable)
283{
284 if (machine_is_u5500())
285 return db5500_prcmu_request_clock(clock, enable);
286 else
287 return db8500_prcmu_request_clock(clock, enable);
288}
289
290int prcmu_set_ape_opp(u8 opp);
291int prcmu_get_ape_opp(void);
292int prcmu_set_ddr_opp(u8 opp);
293int prcmu_get_ddr_opp(void);
294
295static inline int prcmu_set_arm_opp(u8 opp)
296{
297 if (machine_is_u5500())
298 return -EINVAL;
299 else
300 return db8500_prcmu_set_arm_opp(opp);
301}
302
303static inline int prcmu_get_arm_opp(void)
304{
305 if (machine_is_u5500())
306 return -EINVAL;
307 else
308 return db8500_prcmu_get_arm_opp();
309}
310
311static inline void prcmu_system_reset(u16 reset_code)
312{
313 if (machine_is_u5500())
314 return db5500_prcmu_system_reset(reset_code);
315 else
316 return db8500_prcmu_system_reset(reset_code);
317}
318
319static inline u16 prcmu_get_reset_code(void)
320{
321 if (machine_is_u5500())
322 return db5500_prcmu_get_reset_code();
323 else
324 return db8500_prcmu_get_reset_code();
325}
326
327void prcmu_ac_wake_req(void);
328void prcmu_ac_sleep_req(void);
329void prcmu_modem_reset(void);
330static inline bool prcmu_is_ac_wake_requested(void)
331{
332 if (machine_is_u5500())
333 return db5500_prcmu_is_ac_wake_requested();
334 else
335 return db8500_prcmu_is_ac_wake_requested();
336}
337
338static inline int prcmu_set_display_clocks(void)
339{
340 if (machine_is_u5500())
341 return db5500_prcmu_set_display_clocks();
342 else
343 return db8500_prcmu_set_display_clocks();
344}
345
346static inline int prcmu_disable_dsipll(void)
347{
348 if (machine_is_u5500())
349 return db5500_prcmu_disable_dsipll();
350 else
351 return db8500_prcmu_disable_dsipll();
352}
353
354static inline int prcmu_enable_dsipll(void)
355{
356 if (machine_is_u5500())
357 return db5500_prcmu_enable_dsipll();
358 else
359 return db8500_prcmu_enable_dsipll();
360}
361
362static inline int prcmu_config_esram0_deep_sleep(u8 state)
363{
364 if (machine_is_u5500())
365 return -EINVAL;
366 else
367 return db8500_prcmu_config_esram0_deep_sleep(state);
368}
369#else
370
371static inline void __init prcmu_early_init(void) {}
372
373static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
374 bool keep_ap_pll)
375{
376 return 0;
377}
378
379static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
380{
381 return 0;
382}
383
384static inline void prcmu_enable_wakeups(u32 wakeups) {}
385
386static inline void prcmu_disable_wakeups(void) {}
387
388static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
389{
390 return -ENOSYS;
391}
392
393static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
394{
395 return -ENOSYS;
396}
397
398static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
399{
400 return 0;
401}
402
403static inline int prcmu_request_clock(u8 clock, bool enable)
404{
405 return 0;
406}
407
408static inline int prcmu_set_ape_opp(u8 opp)
409{
410 return 0;
411}
412
413static inline int prcmu_get_ape_opp(void)
414{
415 return APE_100_OPP;
416}
417
418static inline int prcmu_set_arm_opp(u8 opp)
419{
420 return 0;
421}
422
423static inline int prcmu_get_arm_opp(void)
424{
425 return ARM_100_OPP;
426}
427
428static inline int prcmu_set_ddr_opp(u8 opp)
429{
430 return 0;
431}
432
433static inline int prcmu_get_ddr_opp(void)
434{
435 return DDR_100_OPP;
436}
437
438static inline void prcmu_system_reset(u16 reset_code) {}
439
440static inline u16 prcmu_get_reset_code(void)
441{
442 return 0;
443}
444
445static inline void prcmu_ac_wake_req(void) {}
446
447static inline void prcmu_ac_sleep_req(void) {}
448
449static inline void prcmu_modem_reset(void) {}
450
451static inline bool prcmu_is_ac_wake_requested(void)
452{
453 return false;
454}
455
456static inline int prcmu_set_display_clocks(void)
457{
458 return 0;
459}
460
461static inline int prcmu_disable_dsipll(void)
462{
463 return 0;
464}
465
466static inline int prcmu_enable_dsipll(void)
467{
468 return 0;
469}
470
471static inline int prcmu_config_esram0_deep_sleep(u8 state)
472{
473 return 0;
474}
475
476static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
477
478static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
479{
480 *buf = NULL;
481}
482
483#endif
484
485/* PRCMU QoS APE OPP class */
486#define PRCMU_QOS_APE_OPP 1
487#define PRCMU_QOS_DDR_OPP 2
488#define PRCMU_QOS_DEFAULT_VALUE -1
489
490#ifdef CONFIG_UX500_PRCMU_QOS_POWER
491
492unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
493void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
494void prcmu_qos_force_opp(int, s32);
495int prcmu_qos_requirement(int pm_qos_class);
496int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value);
497int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
498void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
499int prcmu_qos_add_notifier(int prcmu_qos_class,
500 struct notifier_block *notifier);
501int prcmu_qos_remove_notifier(int prcmu_qos_class,
502 struct notifier_block *notifier);
503
504#else
505
506static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
507{
508 return 0;
509}
510
511static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
512
513static inline void prcmu_qos_force_opp(int prcmu_qos_class, s32 i) {}
514
515static inline int prcmu_qos_requirement(int prcmu_qos_class)
516{
517 return 0;
518}
519
520static inline int prcmu_qos_add_requirement(int prcmu_qos_class,
521 char *name, s32 value)
522{
523 return 0;
524}
525
526static inline int prcmu_qos_update_requirement(int prcmu_qos_class,
527 char *name, s32 new_value)
528{
529 return 0;
530}
531
532static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name)
533{
534}
535
536static inline int prcmu_qos_add_notifier(int prcmu_qos_class,
537 struct notifier_block *notifier)
538{
539 return 0;
540}
541static inline int prcmu_qos_remove_notifier(int prcmu_qos_class,
542 struct notifier_block *notifier)
543{
544 return 0;
545}
546
547#endif
548
549#endif /* __MACH_PRCMU_H */
diff --git a/include/linux/mfd/intel_msic.h b/include/linux/mfd/intel_msic.h
new file mode 100644
index 000000000000..439a7a617bc9
--- /dev/null
+++ b/include/linux/mfd/intel_msic.h
@@ -0,0 +1,456 @@
1/*
2 * include/linux/mfd/intel_msic.h - Core interface for Intel MSIC
3 *
4 * Copyright (C) 2011, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MFD_INTEL_MSIC_H__
13#define __LINUX_MFD_INTEL_MSIC_H__
14
15/* ID */
16#define INTEL_MSIC_ID0 0x000 /* RO */
17#define INTEL_MSIC_ID1 0x001 /* RO */
18
19/* IRQ */
20#define INTEL_MSIC_IRQLVL1 0x002
21#define INTEL_MSIC_ADC1INT 0x003
22#define INTEL_MSIC_CCINT 0x004
23#define INTEL_MSIC_PWRSRCINT 0x005
24#define INTEL_MSIC_PWRSRCINT1 0x006
25#define INTEL_MSIC_CHRINT 0x007
26#define INTEL_MSIC_CHRINT1 0x008
27#define INTEL_MSIC_RTCIRQ 0x009
28#define INTEL_MSIC_GPIO0LVIRQ 0x00a
29#define INTEL_MSIC_GPIO1LVIRQ 0x00b
30#define INTEL_MSIC_GPIOHVIRQ 0x00c
31#define INTEL_MSIC_VRINT 0x00d
32#define INTEL_MSIC_OCAUDIO 0x00e
33#define INTEL_MSIC_ACCDET 0x00f
34#define INTEL_MSIC_RESETIRQ1 0x010
35#define INTEL_MSIC_RESETIRQ2 0x011
36#define INTEL_MSIC_MADC1INT 0x012
37#define INTEL_MSIC_MCCINT 0x013
38#define INTEL_MSIC_MPWRSRCINT 0x014
39#define INTEL_MSIC_MPWRSRCINT1 0x015
40#define INTEL_MSIC_MCHRINT 0x016
41#define INTEL_MSIC_MCHRINT1 0x017
42#define INTEL_MSIC_RTCIRQMASK 0x018
43#define INTEL_MSIC_GPIO0LVIRQMASK 0x019
44#define INTEL_MSIC_GPIO1LVIRQMASK 0x01a
45#define INTEL_MSIC_GPIOHVIRQMASK 0x01b
46#define INTEL_MSIC_VRINTMASK 0x01c
47#define INTEL_MSIC_OCAUDIOMASK 0x01d
48#define INTEL_MSIC_ACCDETMASK 0x01e
49#define INTEL_MSIC_RESETIRQ1MASK 0x01f
50#define INTEL_MSIC_RESETIRQ2MASK 0x020
51#define INTEL_MSIC_IRQLVL1MSK 0x021
52#define INTEL_MSIC_PBCONFIG 0x03e
53#define INTEL_MSIC_PBSTATUS 0x03f /* RO */
54
55/* GPIO */
56#define INTEL_MSIC_GPIO0LV7CTLO 0x040
57#define INTEL_MSIC_GPIO0LV6CTLO 0x041
58#define INTEL_MSIC_GPIO0LV5CTLO 0x042
59#define INTEL_MSIC_GPIO0LV4CTLO 0x043
60#define INTEL_MSIC_GPIO0LV3CTLO 0x044
61#define INTEL_MSIC_GPIO0LV2CTLO 0x045
62#define INTEL_MSIC_GPIO0LV1CTLO 0x046
63#define INTEL_MSIC_GPIO0LV0CTLO 0x047
64#define INTEL_MSIC_GPIO1LV7CTLOS 0x048
65#define INTEL_MSIC_GPIO1LV6CTLO 0x049
66#define INTEL_MSIC_GPIO1LV5CTLO 0x04a
67#define INTEL_MSIC_GPIO1LV4CTLO 0x04b
68#define INTEL_MSIC_GPIO1LV3CTLO 0x04c
69#define INTEL_MSIC_GPIO1LV2CTLO 0x04d
70#define INTEL_MSIC_GPIO1LV1CTLO 0x04e
71#define INTEL_MSIC_GPIO1LV0CTLO 0x04f
72#define INTEL_MSIC_GPIO0LV7CTLI 0x050
73#define INTEL_MSIC_GPIO0LV6CTLI 0x051
74#define INTEL_MSIC_GPIO0LV5CTLI 0x052
75#define INTEL_MSIC_GPIO0LV4CTLI 0x053
76#define INTEL_MSIC_GPIO0LV3CTLI 0x054
77#define INTEL_MSIC_GPIO0LV2CTLI 0x055
78#define INTEL_MSIC_GPIO0LV1CTLI 0x056
79#define INTEL_MSIC_GPIO0LV0CTLI 0x057
80#define INTEL_MSIC_GPIO1LV7CTLIS 0x058
81#define INTEL_MSIC_GPIO1LV6CTLI 0x059
82#define INTEL_MSIC_GPIO1LV5CTLI 0x05a
83#define INTEL_MSIC_GPIO1LV4CTLI 0x05b
84#define INTEL_MSIC_GPIO1LV3CTLI 0x05c
85#define INTEL_MSIC_GPIO1LV2CTLI 0x05d
86#define INTEL_MSIC_GPIO1LV1CTLI 0x05e
87#define INTEL_MSIC_GPIO1LV0CTLI 0x05f
88#define INTEL_MSIC_PWM0CLKDIV1 0x061
89#define INTEL_MSIC_PWM0CLKDIV0 0x062
90#define INTEL_MSIC_PWM1CLKDIV1 0x063
91#define INTEL_MSIC_PWM1CLKDIV0 0x064
92#define INTEL_MSIC_PWM2CLKDIV1 0x065
93#define INTEL_MSIC_PWM2CLKDIV0 0x066
94#define INTEL_MSIC_PWM0DUTYCYCLE 0x067
95#define INTEL_MSIC_PWM1DUTYCYCLE 0x068
96#define INTEL_MSIC_PWM2DUTYCYCLE 0x069
97#define INTEL_MSIC_GPIO0HV3CTLO 0x06d
98#define INTEL_MSIC_GPIO0HV2CTLO 0x06e
99#define INTEL_MSIC_GPIO0HV1CTLO 0x06f
100#define INTEL_MSIC_GPIO0HV0CTLO 0x070
101#define INTEL_MSIC_GPIO1HV3CTLO 0x071
102#define INTEL_MSIC_GPIO1HV2CTLO 0x072
103#define INTEL_MSIC_GPIO1HV1CTLO 0x073
104#define INTEL_MSIC_GPIO1HV0CTLO 0x074
105#define INTEL_MSIC_GPIO0HV3CTLI 0x075
106#define INTEL_MSIC_GPIO0HV2CTLI 0x076
107#define INTEL_MSIC_GPIO0HV1CTLI 0x077
108#define INTEL_MSIC_GPIO0HV0CTLI 0x078
109#define INTEL_MSIC_GPIO1HV3CTLI 0x079
110#define INTEL_MSIC_GPIO1HV2CTLI 0x07a
111#define INTEL_MSIC_GPIO1HV1CTLI 0x07b
112#define INTEL_MSIC_GPIO1HV0CTLI 0x07c
113
114/* SVID */
115#define INTEL_MSIC_SVIDCTRL0 0x080
116#define INTEL_MSIC_SVIDCTRL1 0x081
117#define INTEL_MSIC_SVIDCTRL2 0x082
118#define INTEL_MSIC_SVIDTXLASTPKT3 0x083 /* RO */
119#define INTEL_MSIC_SVIDTXLASTPKT2 0x084 /* RO */
120#define INTEL_MSIC_SVIDTXLASTPKT1 0x085 /* RO */
121#define INTEL_MSIC_SVIDTXLASTPKT0 0x086 /* RO */
122#define INTEL_MSIC_SVIDPKTOUTBYTE3 0x087
123#define INTEL_MSIC_SVIDPKTOUTBYTE2 0x088
124#define INTEL_MSIC_SVIDPKTOUTBYTE1 0x089
125#define INTEL_MSIC_SVIDPKTOUTBYTE0 0x08a
126#define INTEL_MSIC_SVIDRXVPDEBUG1 0x08b
127#define INTEL_MSIC_SVIDRXVPDEBUG0 0x08c
128#define INTEL_MSIC_SVIDRXLASTPKT3 0x08d /* RO */
129#define INTEL_MSIC_SVIDRXLASTPKT2 0x08e /* RO */
130#define INTEL_MSIC_SVIDRXLASTPKT1 0x08f /* RO */
131#define INTEL_MSIC_SVIDRXLASTPKT0 0x090 /* RO */
132#define INTEL_MSIC_SVIDRXCHKSTATUS3 0x091 /* RO */
133#define INTEL_MSIC_SVIDRXCHKSTATUS2 0x092 /* RO */
134#define INTEL_MSIC_SVIDRXCHKSTATUS1 0x093 /* RO */
135#define INTEL_MSIC_SVIDRXCHKSTATUS0 0x094 /* RO */
136
137/* VREG */
138#define INTEL_MSIC_VCCLATCH 0x0c0
139#define INTEL_MSIC_VNNLATCH 0x0c1
140#define INTEL_MSIC_VCCCNT 0x0c2
141#define INTEL_MSIC_SMPSRAMP 0x0c3
142#define INTEL_MSIC_VNNCNT 0x0c4
143#define INTEL_MSIC_VNNAONCNT 0x0c5
144#define INTEL_MSIC_VCC122AONCNT 0x0c6
145#define INTEL_MSIC_V180AONCNT 0x0c7
146#define INTEL_MSIC_V500CNT 0x0c8
147#define INTEL_MSIC_VIHFCNT 0x0c9
148#define INTEL_MSIC_LDORAMP1 0x0ca
149#define INTEL_MSIC_LDORAMP2 0x0cb
150#define INTEL_MSIC_VCC108AONCNT 0x0cc
151#define INTEL_MSIC_VCC108ASCNT 0x0cd
152#define INTEL_MSIC_VCC108CNT 0x0ce
153#define INTEL_MSIC_VCCA100ASCNT 0x0cf
154#define INTEL_MSIC_VCCA100CNT 0x0d0
155#define INTEL_MSIC_VCC180AONCNT 0x0d1
156#define INTEL_MSIC_VCC180CNT 0x0d2
157#define INTEL_MSIC_VCC330CNT 0x0d3
158#define INTEL_MSIC_VUSB330CNT 0x0d4
159#define INTEL_MSIC_VCCSDIOCNT 0x0d5
160#define INTEL_MSIC_VPROG1CNT 0x0d6
161#define INTEL_MSIC_VPROG2CNT 0x0d7
162#define INTEL_MSIC_VEMMCSCNT 0x0d8
163#define INTEL_MSIC_VEMMC1CNT 0x0d9
164#define INTEL_MSIC_VEMMC2CNT 0x0da
165#define INTEL_MSIC_VAUDACNT 0x0db
166#define INTEL_MSIC_VHSPCNT 0x0dc
167#define INTEL_MSIC_VHSNCNT 0x0dd
168#define INTEL_MSIC_VHDMICNT 0x0de
169#define INTEL_MSIC_VOTGCNT 0x0df
170#define INTEL_MSIC_V1P35CNT 0x0e0
171#define INTEL_MSIC_V330AONCNT 0x0e1
172
173/* RESET */
174#define INTEL_MSIC_CHIPCNTRL 0x100 /* WO */
175#define INTEL_MSIC_ERCONFIG 0x101
176
177/* BURST */
178#define INTEL_MSIC_BATCURRENTLIMIT12 0x102
179#define INTEL_MSIC_BATTIMELIMIT12 0x103
180#define INTEL_MSIC_BATTIMELIMIT3 0x104
181#define INTEL_MSIC_BATTIMEDB 0x105
182#define INTEL_MSIC_BRSTCONFIGOUTPUTS 0x106
183#define INTEL_MSIC_BRSTCONFIGACTIONS 0x107
184#define INTEL_MSIC_BURSTCONTROLSTATUS 0x108
185
186/* RTC */
187#define INTEL_MSIC_RTCB1 0x140 /* RO */
188#define INTEL_MSIC_RTCB2 0x141 /* RO */
189#define INTEL_MSIC_RTCB3 0x142 /* RO */
190#define INTEL_MSIC_RTCB4 0x143 /* RO */
191#define INTEL_MSIC_RTCOB1 0x144
192#define INTEL_MSIC_RTCOB2 0x145
193#define INTEL_MSIC_RTCOB3 0x146
194#define INTEL_MSIC_RTCOB4 0x147
195#define INTEL_MSIC_RTCAB1 0x148
196#define INTEL_MSIC_RTCAB2 0x149
197#define INTEL_MSIC_RTCAB3 0x14a
198#define INTEL_MSIC_RTCAB4 0x14b
199#define INTEL_MSIC_RTCWAB1 0x14c
200#define INTEL_MSIC_RTCWAB2 0x14d
201#define INTEL_MSIC_RTCWAB3 0x14e
202#define INTEL_MSIC_RTCWAB4 0x14f
203#define INTEL_MSIC_RTCSC1 0x150
204#define INTEL_MSIC_RTCSC2 0x151
205#define INTEL_MSIC_RTCSC3 0x152
206#define INTEL_MSIC_RTCSC4 0x153
207#define INTEL_MSIC_RTCSTATUS 0x154 /* RO */
208#define INTEL_MSIC_RTCCONFIG1 0x155
209#define INTEL_MSIC_RTCCONFIG2 0x156
210
211/* CHARGER */
212#define INTEL_MSIC_BDTIMER 0x180
213#define INTEL_MSIC_BATTRMV 0x181
214#define INTEL_MSIC_VBUSDET 0x182
215#define INTEL_MSIC_VBUSDET1 0x183
216#define INTEL_MSIC_ADPHVDET 0x184
217#define INTEL_MSIC_ADPLVDET 0x185
218#define INTEL_MSIC_ADPDETDBDM 0x186
219#define INTEL_MSIC_LOWBATTDET 0x187
220#define INTEL_MSIC_CHRCTRL 0x188
221#define INTEL_MSIC_CHRCVOLTAGE 0x189
222#define INTEL_MSIC_CHRCCURRENT 0x18a
223#define INTEL_MSIC_SPCHARGER 0x18b
224#define INTEL_MSIC_CHRTTIME 0x18c
225#define INTEL_MSIC_CHRCTRL1 0x18d
226#define INTEL_MSIC_PWRSRCLMT 0x18e
227#define INTEL_MSIC_CHRSTWDT 0x18f
228#define INTEL_MSIC_WDTWRITE 0x190 /* WO */
229#define INTEL_MSIC_CHRSAFELMT 0x191
230#define INTEL_MSIC_SPWRSRCINT 0x192 /* RO */
231#define INTEL_MSIC_SPWRSRCINT1 0x193 /* RO */
232#define INTEL_MSIC_CHRLEDPWM 0x194
233#define INTEL_MSIC_CHRLEDCTRL 0x195
234
235/* ADC */
236#define INTEL_MSIC_ADC1CNTL1 0x1c0
237#define INTEL_MSIC_ADC1CNTL2 0x1c1
238#define INTEL_MSIC_ADC1CNTL3 0x1c2
239#define INTEL_MSIC_ADC1OFFSETH 0x1c3 /* RO */
240#define INTEL_MSIC_ADC1OFFSETL 0x1c4 /* RO */
241#define INTEL_MSIC_ADC1ADDR0 0x1c5
242#define INTEL_MSIC_ADC1ADDR1 0x1c6
243#define INTEL_MSIC_ADC1ADDR2 0x1c7
244#define INTEL_MSIC_ADC1ADDR3 0x1c8
245#define INTEL_MSIC_ADC1ADDR4 0x1c9
246#define INTEL_MSIC_ADC1ADDR5 0x1ca
247#define INTEL_MSIC_ADC1ADDR6 0x1cb
248#define INTEL_MSIC_ADC1ADDR7 0x1cc
249#define INTEL_MSIC_ADC1ADDR8 0x1cd
250#define INTEL_MSIC_ADC1ADDR9 0x1ce
251#define INTEL_MSIC_ADC1ADDR10 0x1cf
252#define INTEL_MSIC_ADC1ADDR11 0x1d0
253#define INTEL_MSIC_ADC1ADDR12 0x1d1
254#define INTEL_MSIC_ADC1ADDR13 0x1d2
255#define INTEL_MSIC_ADC1ADDR14 0x1d3
256#define INTEL_MSIC_ADC1SNS0H 0x1d4 /* RO */
257#define INTEL_MSIC_ADC1SNS0L 0x1d5 /* RO */
258#define INTEL_MSIC_ADC1SNS1H 0x1d6 /* RO */
259#define INTEL_MSIC_ADC1SNS1L 0x1d7 /* RO */
260#define INTEL_MSIC_ADC1SNS2H 0x1d8 /* RO */
261#define INTEL_MSIC_ADC1SNS2L 0x1d9 /* RO */
262#define INTEL_MSIC_ADC1SNS3H 0x1da /* RO */
263#define INTEL_MSIC_ADC1SNS3L 0x1db /* RO */
264#define INTEL_MSIC_ADC1SNS4H 0x1dc /* RO */
265#define INTEL_MSIC_ADC1SNS4L 0x1dd /* RO */
266#define INTEL_MSIC_ADC1SNS5H 0x1de /* RO */
267#define INTEL_MSIC_ADC1SNS5L 0x1df /* RO */
268#define INTEL_MSIC_ADC1SNS6H 0x1e0 /* RO */
269#define INTEL_MSIC_ADC1SNS6L 0x1e1 /* RO */
270#define INTEL_MSIC_ADC1SNS7H 0x1e2 /* RO */
271#define INTEL_MSIC_ADC1SNS7L 0x1e3 /* RO */
272#define INTEL_MSIC_ADC1SNS8H 0x1e4 /* RO */
273#define INTEL_MSIC_ADC1SNS8L 0x1e5 /* RO */
274#define INTEL_MSIC_ADC1SNS9H 0x1e6 /* RO */
275#define INTEL_MSIC_ADC1SNS9L 0x1e7 /* RO */
276#define INTEL_MSIC_ADC1SNS10H 0x1e8 /* RO */
277#define INTEL_MSIC_ADC1SNS10L 0x1e9 /* RO */
278#define INTEL_MSIC_ADC1SNS11H 0x1ea /* RO */
279#define INTEL_MSIC_ADC1SNS11L 0x1eb /* RO */
280#define INTEL_MSIC_ADC1SNS12H 0x1ec /* RO */
281#define INTEL_MSIC_ADC1SNS12L 0x1ed /* RO */
282#define INTEL_MSIC_ADC1SNS13H 0x1ee /* RO */
283#define INTEL_MSIC_ADC1SNS13L 0x1ef /* RO */
284#define INTEL_MSIC_ADC1SNS14H 0x1f0 /* RO */
285#define INTEL_MSIC_ADC1SNS14L 0x1f1 /* RO */
286#define INTEL_MSIC_ADC1BV0H 0x1f2 /* RO */
287#define INTEL_MSIC_ADC1BV0L 0x1f3 /* RO */
288#define INTEL_MSIC_ADC1BV1H 0x1f4 /* RO */
289#define INTEL_MSIC_ADC1BV1L 0x1f5 /* RO */
290#define INTEL_MSIC_ADC1BV2H 0x1f6 /* RO */
291#define INTEL_MSIC_ADC1BV2L 0x1f7 /* RO */
292#define INTEL_MSIC_ADC1BV3H 0x1f8 /* RO */
293#define INTEL_MSIC_ADC1BV3L 0x1f9 /* RO */
294#define INTEL_MSIC_ADC1BI0H 0x1fa /* RO */
295#define INTEL_MSIC_ADC1BI0L 0x1fb /* RO */
296#define INTEL_MSIC_ADC1BI1H 0x1fc /* RO */
297#define INTEL_MSIC_ADC1BI1L 0x1fd /* RO */
298#define INTEL_MSIC_ADC1BI2H 0x1fe /* RO */
299#define INTEL_MSIC_ADC1BI2L 0x1ff /* RO */
300#define INTEL_MSIC_ADC1BI3H 0x200 /* RO */
301#define INTEL_MSIC_ADC1BI3L 0x201 /* RO */
302#define INTEL_MSIC_CCCNTL 0x202
303#define INTEL_MSIC_CCOFFSETH 0x203 /* RO */
304#define INTEL_MSIC_CCOFFSETL 0x204 /* RO */
305#define INTEL_MSIC_CCADCHA 0x205 /* RO */
306#define INTEL_MSIC_CCADCLA 0x206 /* RO */
307
308/* AUDIO */
309#define INTEL_MSIC_AUDPLLCTRL 0x240
310#define INTEL_MSIC_DMICBUF0123 0x241
311#define INTEL_MSIC_DMICBUF45 0x242
312#define INTEL_MSIC_DMICGPO 0x244
313#define INTEL_MSIC_DMICMUX 0x245
314#define INTEL_MSIC_DMICCLK 0x246
315#define INTEL_MSIC_MICBIAS 0x247
316#define INTEL_MSIC_ADCCONFIG 0x248
317#define INTEL_MSIC_MICAMP1 0x249
318#define INTEL_MSIC_MICAMP2 0x24a
319#define INTEL_MSIC_NOISEMUX 0x24b
320#define INTEL_MSIC_AUDIOMUX12 0x24c
321#define INTEL_MSIC_AUDIOMUX34 0x24d
322#define INTEL_MSIC_AUDIOSINC 0x24e
323#define INTEL_MSIC_AUDIOTXEN 0x24f
324#define INTEL_MSIC_HSEPRXCTRL 0x250
325#define INTEL_MSIC_IHFRXCTRL 0x251
326#define INTEL_MSIC_VOICETXVOL 0x252
327#define INTEL_MSIC_SIDETONEVOL 0x253
328#define INTEL_MSIC_MUSICSHARVOL 0x254
329#define INTEL_MSIC_VOICETXCTRL 0x255
330#define INTEL_MSIC_HSMIXER 0x256
331#define INTEL_MSIC_DACCONFIG 0x257
332#define INTEL_MSIC_SOFTMUTE 0x258
333#define INTEL_MSIC_HSLVOLCTRL 0x259
334#define INTEL_MSIC_HSRVOLCTRL 0x25a
335#define INTEL_MSIC_IHFLVOLCTRL 0x25b
336#define INTEL_MSIC_IHFRVOLCTRL 0x25c
337#define INTEL_MSIC_DRIVEREN 0x25d
338#define INTEL_MSIC_LINEOUTCTRL 0x25e
339#define INTEL_MSIC_VIB1CTRL1 0x25f
340#define INTEL_MSIC_VIB1CTRL2 0x260
341#define INTEL_MSIC_VIB1CTRL3 0x261
342#define INTEL_MSIC_VIB1SPIPCM_1 0x262
343#define INTEL_MSIC_VIB1SPIPCM_2 0x263
344#define INTEL_MSIC_VIB1CTRL5 0x264
345#define INTEL_MSIC_VIB2CTRL1 0x265
346#define INTEL_MSIC_VIB2CTRL2 0x266
347#define INTEL_MSIC_VIB2CTRL3 0x267
348#define INTEL_MSIC_VIB2SPIPCM_1 0x268
349#define INTEL_MSIC_VIB2SPIPCM_2 0x269
350#define INTEL_MSIC_VIB2CTRL5 0x26a
351#define INTEL_MSIC_BTNCTRL1 0x26b
352#define INTEL_MSIC_BTNCTRL2 0x26c
353#define INTEL_MSIC_PCM1TXSLOT01 0x26d
354#define INTEL_MSIC_PCM1TXSLOT23 0x26e
355#define INTEL_MSIC_PCM1TXSLOT45 0x26f
356#define INTEL_MSIC_PCM1RXSLOT0123 0x270
357#define INTEL_MSIC_PCM1RXSLOT045 0x271
358#define INTEL_MSIC_PCM2TXSLOT01 0x272
359#define INTEL_MSIC_PCM2TXSLOT23 0x273
360#define INTEL_MSIC_PCM2TXSLOT45 0x274
361#define INTEL_MSIC_PCM2RXSLOT01 0x275
362#define INTEL_MSIC_PCM2RXSLOT23 0x276
363#define INTEL_MSIC_PCM2RXSLOT45 0x277
364#define INTEL_MSIC_PCM1CTRL1 0x278
365#define INTEL_MSIC_PCM1CTRL2 0x279
366#define INTEL_MSIC_PCM1CTRL3 0x27a
367#define INTEL_MSIC_PCM2CTRL1 0x27b
368#define INTEL_MSIC_PCM2CTRL2 0x27c
369
370/* HDMI */
371#define INTEL_MSIC_HDMIPUEN 0x280
372#define INTEL_MSIC_HDMISTATUS 0x281 /* RO */
373
374/* Physical address of the start of the MSIC interrupt tree in SRAM */
375#define INTEL_MSIC_IRQ_PHYS_BASE 0xffff7fc0
376
377/**
378 * struct intel_msic_gpio_pdata - platform data for the MSIC GPIO driver
379 * @gpio_base: base number for the GPIOs
380 */
381struct intel_msic_gpio_pdata {
382 unsigned gpio_base;
383};
384
385/**
386 * struct intel_msic_ocd_pdata - platform data for the MSIC OCD driver
387 * @gpio: GPIO number used for OCD interrupts
388 *
389 * The MSIC MFD driver converts @gpio into an IRQ number and passes it to
390 * the OCD driver as %IORESOURCE_IRQ.
391 */
392struct intel_msic_ocd_pdata {
393 unsigned gpio;
394};
395
396/* MSIC embedded blocks (subdevices) */
397enum intel_msic_block {
398 INTEL_MSIC_BLOCK_TOUCH,
399 INTEL_MSIC_BLOCK_ADC,
400 INTEL_MSIC_BLOCK_BATTERY,
401 INTEL_MSIC_BLOCK_GPIO,
402 INTEL_MSIC_BLOCK_AUDIO,
403 INTEL_MSIC_BLOCK_HDMI,
404 INTEL_MSIC_BLOCK_THERMAL,
405 INTEL_MSIC_BLOCK_POWER_BTN,
406 INTEL_MSIC_BLOCK_OCD,
407
408 INTEL_MSIC_BLOCK_LAST,
409};
410
411/**
412 * struct intel_msic_platform_data - platform data for the MSIC driver
413 * @irq: array of interrupt numbers, one per device. If @irq is set to %0
414 * for a given block, the corresponding platform device is not
415 * created. For devices which don't have an interrupt, use %0xff
416 * (this is same as in SFI spec).
417 * @gpio: platform data for the MSIC GPIO driver
418 * @ocd: platform data for the MSIC OCD driver
419 *
420 * Once the MSIC driver is initialized, the register interface is ready to
421 * use. All the platform devices for subdevices are created after the
422 * register interface is ready so that we can guarantee its availability to
423 * the subdevice drivers.
424 *
425 * Interrupt numbers are passed to the subdevices via %IORESOURCE_IRQ
426 * resources of the created platform device.
427 */
428struct intel_msic_platform_data {
429 int irq[INTEL_MSIC_BLOCK_LAST];
430 struct intel_msic_gpio_pdata *gpio;
431 struct intel_msic_ocd_pdata *ocd;
432};
433
434struct intel_msic;
435
436extern int intel_msic_reg_read(unsigned short reg, u8 *val);
437extern int intel_msic_reg_write(unsigned short reg, u8 val);
438extern int intel_msic_reg_update(unsigned short reg, u8 val, u8 mask);
439extern int intel_msic_bulk_read(unsigned short *reg, u8 *buf, size_t count);
440extern int intel_msic_bulk_write(unsigned short *reg, u8 *buf, size_t count);
441
442/*
443 * pdev_to_intel_msic - gets an MSIC instance from the platform device
444 * @pdev: platform device pointer
445 *
446 * The client drivers need to have pointer to the MSIC instance if they
447 * want to call intel_msic_irq_read(). This macro can be used for
448 * convenience to get the MSIC pointer from @pdev where needed. This is
449 * _only_ valid for devices which are managed by the MSIC.
450 */
451#define pdev_to_intel_msic(pdev) (dev_get_drvdata(pdev->dev.parent))
452
453extern int intel_msic_irq_read(struct intel_msic *msic, unsigned short reg,
454 u8 *val);
455
456#endif /* __LINUX_MFD_INTEL_MSIC_H__ */
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 5ff2400ad46c..3f4deb62d6b0 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -326,7 +326,6 @@ struct max8997_dev {
326 int irq; 326 int irq;
327 int ono; 327 int ono;
328 int irq_base; 328 int irq_base;
329 bool wakeup;
330 struct mutex irqlock; 329 struct mutex irqlock;
331 int irq_masks_cur[MAX8997_IRQ_GROUP_NR]; 330 int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
332 int irq_masks_cache[MAX8997_IRQ_GROUP_NR]; 331 int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 7d0f3d6a0002..a8eeda773a7b 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -12,117 +12,6 @@
12 12
13#include <linux/mfd/mc13xxx.h> 13#include <linux/mfd/mc13xxx.h>
14 14
15struct mc13783;
16
17struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783);
18
19static inline void mc13783_lock(struct mc13783 *mc13783)
20{
21 mc13xxx_lock(mc13783_to_mc13xxx(mc13783));
22}
23
24static inline void mc13783_unlock(struct mc13783 *mc13783)
25{
26 mc13xxx_unlock(mc13783_to_mc13xxx(mc13783));
27}
28
29static inline int mc13783_reg_read(struct mc13783 *mc13783,
30 unsigned int offset, u32 *val)
31{
32 return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val);
33}
34
35static inline int mc13783_reg_write(struct mc13783 *mc13783,
36 unsigned int offset, u32 val)
37{
38 return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val);
39}
40
41static inline int mc13783_reg_rmw(struct mc13783 *mc13783,
42 unsigned int offset, u32 mask, u32 val)
43{
44 return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val);
45}
46
47static inline int mc13783_get_flags(struct mc13783 *mc13783)
48{
49 return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783));
50}
51
52static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq,
53 irq_handler_t handler, const char *name, void *dev)
54{
55 return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq,
56 handler, name, dev);
57}
58
59static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
60 irq_handler_t handler, const char *name, void *dev)
61{
62 return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq,
63 handler, name, dev);
64}
65
66static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev)
67{
68 return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev);
69}
70
71static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
72{
73 return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq);
74}
75
76static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq)
77{
78 return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq);
79}
80static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq,
81 int *enabled, int *pending)
82{
83 return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783),
84 irq, enabled, pending);
85}
86
87static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
88{
89 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq);
90}
91
92#define MC13783_ADC0 43
93#define MC13783_ADC0_ADREFEN (1 << 10)
94#define MC13783_ADC0_ADREFMODE (1 << 11)
95#define MC13783_ADC0_TSMOD0 (1 << 12)
96#define MC13783_ADC0_TSMOD1 (1 << 13)
97#define MC13783_ADC0_TSMOD2 (1 << 14)
98#define MC13783_ADC0_ADINC1 (1 << 16)
99#define MC13783_ADC0_ADINC2 (1 << 17)
100
101#define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \
102 MC13783_ADC0_TSMOD1 | \
103 MC13783_ADC0_TSMOD2)
104
105#define mc13783_regulator_init_data mc13xxx_regulator_init_data
106#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
107#define mc13783_led_platform_data mc13xxx_led_platform_data
108#define mc13783_leds_platform_data mc13xxx_leds_platform_data
109
110#define mc13783_platform_data mc13xxx_platform_data
111#define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN
112#define MC13783_USE_CODEC MC13XXX_USE_CODEC
113#define MC13783_USE_ADC MC13XXX_USE_ADC
114#define MC13783_USE_RTC MC13XXX_USE_RTC
115#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR
116#define MC13783_USE_LED MC13XXX_USE_LED
117
118#define MC13783_ADC_MODE_TS 1
119#define MC13783_ADC_MODE_SINGLE_CHAN 2
120#define MC13783_ADC_MODE_MULT_CHAN 3
121
122int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
123 unsigned int channel, unsigned int *sample);
124
125
126#define MC13783_REG_SW1A 0 15#define MC13783_REG_SW1A 0
127#define MC13783_REG_SW1B 1 16#define MC13783_REG_SW1B 1
128#define MC13783_REG_SW2A 2 17#define MC13783_REG_SW2A 2
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index c064beaaccb7..3816c2fac0ad 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -37,6 +37,9 @@ int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq);
37 37
38int mc13xxx_get_flags(struct mc13xxx *mc13xxx); 38int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
39 39
40int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
41 unsigned int mode, unsigned int channel, unsigned int *sample);
42
40#define MC13XXX_IRQ_ADCDONE 0 43#define MC13XXX_IRQ_ADCDONE 0
41#define MC13XXX_IRQ_ADCBISDONE 1 44#define MC13XXX_IRQ_ADCBISDONE 1
42#define MC13XXX_IRQ_TS 2 45#define MC13XXX_IRQ_TS 2
@@ -137,17 +140,48 @@ struct mc13xxx_leds_platform_data {
137 char tc3_period; 140 char tc3_period;
138}; 141};
139 142
143struct mc13xxx_buttons_platform_data {
144#define MC13783_BUTTON_DBNC_0MS 0
145#define MC13783_BUTTON_DBNC_30MS 1
146#define MC13783_BUTTON_DBNC_150MS 2
147#define MC13783_BUTTON_DBNC_750MS 3
148#define MC13783_BUTTON_ENABLE (1 << 2)
149#define MC13783_BUTTON_POL_INVERT (1 << 3)
150#define MC13783_BUTTON_RESET_EN (1 << 4)
151 int b1on_flags;
152 unsigned short b1on_key;
153 int b2on_flags;
154 unsigned short b2on_key;
155 int b3on_flags;
156 unsigned short b3on_key;
157};
158
140struct mc13xxx_platform_data { 159struct mc13xxx_platform_data {
141#define MC13XXX_USE_TOUCHSCREEN (1 << 0) 160#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
142#define MC13XXX_USE_CODEC (1 << 1) 161#define MC13XXX_USE_CODEC (1 << 1)
143#define MC13XXX_USE_ADC (1 << 2) 162#define MC13XXX_USE_ADC (1 << 2)
144#define MC13XXX_USE_RTC (1 << 3) 163#define MC13XXX_USE_RTC (1 << 3)
145#define MC13XXX_USE_REGULATOR (1 << 4)
146#define MC13XXX_USE_LED (1 << 5)
147 unsigned int flags; 164 unsigned int flags;
148 165
149 struct mc13xxx_regulator_platform_data regulators; 166 struct mc13xxx_regulator_platform_data regulators;
150 struct mc13xxx_leds_platform_data *leds; 167 struct mc13xxx_leds_platform_data *leds;
168 struct mc13xxx_buttons_platform_data *buttons;
151}; 169};
152 170
171#define MC13XXX_ADC_MODE_TS 1
172#define MC13XXX_ADC_MODE_SINGLE_CHAN 2
173#define MC13XXX_ADC_MODE_MULT_CHAN 3
174
175#define MC13XXX_ADC0 43
176#define MC13XXX_ADC0_ADREFEN (1 << 10)
177#define MC13XXX_ADC0_TSMOD0 (1 << 12)
178#define MC13XXX_ADC0_TSMOD1 (1 << 13)
179#define MC13XXX_ADC0_TSMOD2 (1 << 14)
180#define MC13XXX_ADC0_ADINC1 (1 << 16)
181#define MC13XXX_ADC0_ADINC2 (1 << 17)
182
183#define MC13XXX_ADC0_TSMOD_MASK (MC13XXX_ADC0_TSMOD0 | \
184 MC13XXX_ADC0_TSMOD1 | \
185 MC13XXX_ADC0_TSMOD2)
186
153#endif /* ifndef __LINUX_MFD_MC13XXX_H */ 187#endif /* ifndef __LINUX_MFD_MC13XXX_H */
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 50d4a047118d..a80840752b4c 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -21,6 +21,7 @@
21#include <linux/mfd/pcf50633/backlight.h> 21#include <linux/mfd/pcf50633/backlight.h>
22 22
23struct pcf50633; 23struct pcf50633;
24struct regmap;
24 25
25#define PCF50633_NUM_REGULATORS 11 26#define PCF50633_NUM_REGULATORS 11
26 27
@@ -134,7 +135,7 @@ enum {
134 135
135struct pcf50633 { 136struct pcf50633 {
136 struct device *dev; 137 struct device *dev;
137 struct i2c_client *i2c_client; 138 struct regmap *regmap;
138 139
139 struct pcf50633_platform_data *pdata; 140 struct pcf50633_platform_data *pdata;
140 int irq; 141 int irq;
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index b6bab1b04e25..b19176eab44d 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -1,6 +1,18 @@
1#ifndef __LINUX_MFD_TPS6586X_H 1#ifndef __LINUX_MFD_TPS6586X_H
2#define __LINUX_MFD_TPS6586X_H 2#define __LINUX_MFD_TPS6586X_H
3 3
4#define TPS6586X_SLEW_RATE_INSTANTLY 0x00
5#define TPS6586X_SLEW_RATE_110UV 0x01
6#define TPS6586X_SLEW_RATE_220UV 0x02
7#define TPS6586X_SLEW_RATE_440UV 0x03
8#define TPS6586X_SLEW_RATE_880UV 0x04
9#define TPS6586X_SLEW_RATE_1760UV 0x05
10#define TPS6586X_SLEW_RATE_3520UV 0x06
11#define TPS6586X_SLEW_RATE_7040UV 0x07
12
13#define TPS6586X_SLEW_RATE_SET 0x08
14#define TPS6586X_SLEW_RATE_MASK 0x07
15
4enum { 16enum {
5 TPS6586X_ID_SM_0, 17 TPS6586X_ID_SM_0,
6 TPS6586X_ID_SM_1, 18 TPS6586X_ID_SM_1,
@@ -48,6 +60,10 @@ enum {
48 TPS6586X_INT_RTC_ALM2, 60 TPS6586X_INT_RTC_ALM2,
49}; 61};
50 62
63struct tps6586x_settings {
64 int slew_rate;
65};
66
51struct tps6586x_subdev_info { 67struct tps6586x_subdev_info {
52 int id; 68 int id;
53 const char *name; 69 const char *name;
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index ed8fe0d04097..4b1211859f74 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -382,6 +382,7 @@ struct wm831x {
382 382
383 /* Used by the interrupt controller code to post writes */ 383 /* Used by the interrupt controller code to post writes */
384 int gpio_update[WM831X_NUM_GPIO_REGS]; 384 int gpio_update[WM831X_NUM_GPIO_REGS];
385 bool gpio_level[WM831X_NUM_GPIO_REGS];
385 386
386 struct mutex auxadc_lock; 387 struct mutex auxadc_lock;
387 struct list_head auxadc_pending; 388 struct list_head auxadc_pending;
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index 626809147624..f44bdb7273bd 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -59,6 +59,8 @@ struct wm8994 {
59 struct device *dev; 59 struct device *dev;
60 struct regmap *regmap; 60 struct regmap *regmap;
61 61
62 bool ldo_ena_always_driven;
63
62 int gpio_base; 64 int gpio_base;
63 int irq_base; 65 int irq_base;
64 66
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 97cf4f27d647..ea32f306dca6 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -167,6 +167,13 @@ struct wm8994_pdata {
167 167
168 /* WM8958 microphone bias configuration */ 168 /* WM8958 microphone bias configuration */
169 int micbias[2]; 169 int micbias[2];
170
171 /* Disable the internal pull downs on the LDOs if they are
172 * always driven (eg, connected to an always on supply or
173 * GPIO that always drives an output. If they float power
174 * consumption will rise.
175 */
176 bool ldo_ena_always_driven;
170}; 177};
171 178
172#endif 179#endif
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index c309b1ecdc1c..c41d7270c6c6 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_MISCDEVICE_H 1#ifndef _LINUX_MISCDEVICE_H
2#define _LINUX_MISCDEVICE_H 2#define _LINUX_MISCDEVICE_H
3#include <linux/module.h>
4#include <linux/major.h> 3#include <linux/major.h>
4#include <linux/list.h>
5#include <linux/types.h>
5 6
6/* 7/*
7 * These allocations are managed by device@lanana.org. If you use an 8 * These allocations are managed by device@lanana.org. If you use an
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 2366f94a095a..84b0b1848f17 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -61,6 +61,7 @@ enum {
61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2, 63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
64 MLX4_DEV_CAP_FLAG_XRC = 1LL << 3,
64 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6, 65 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6,
65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7, 66 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7,
66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, 67 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
@@ -83,6 +84,12 @@ enum {
83 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48 84 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48
84}; 85};
85 86
87#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
88
89enum {
90 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0
91};
92
86enum { 93enum {
87 MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, 94 MLX4_BMME_FLAG_LOCAL_INV = 1 << 6,
88 MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, 95 MLX4_BMME_FLAG_REMOTE_INV = 1 << 7,
@@ -257,6 +264,8 @@ struct mlx4_caps {
257 int num_qp_per_mgm; 264 int num_qp_per_mgm;
258 int num_pds; 265 int num_pds;
259 int reserved_pds; 266 int reserved_pds;
267 int max_xrcds;
268 int reserved_xrcds;
260 int mtt_entry_sz; 269 int mtt_entry_sz;
261 u32 max_msg_sz; 270 u32 max_msg_sz;
262 u32 page_size_cap; 271 u32 page_size_cap;
@@ -277,6 +286,7 @@ struct mlx4_caps {
277 u32 port_mask; 286 u32 port_mask;
278 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 287 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
279 u32 max_counters; 288 u32 max_counters;
289 u8 ext_port_cap[MLX4_MAX_PORTS + 1];
280}; 290};
281 291
282struct mlx4_buf_list { 292struct mlx4_buf_list {
@@ -500,6 +510,8 @@ static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset)
500 510
501int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); 511int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn);
502void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); 512void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn);
513int mlx4_xrcd_alloc(struct mlx4_dev *dev, u32 *xrcdn);
514void mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn);
503 515
504int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); 516int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar);
505void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); 517void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar);
@@ -539,8 +551,8 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt);
539int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp); 551int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp);
540void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); 552void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp);
541 553
542int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, 554int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcdn,
543 u64 db_rec, struct mlx4_srq *srq); 555 struct mlx4_mtt *mtt, u64 db_rec, struct mlx4_srq *srq);
544void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); 556void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq);
545int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); 557int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark);
546int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark); 558int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 4001c8249dbb..48cc4cb97858 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -75,6 +75,7 @@ enum {
75 MLX4_QP_ST_UC = 0x1, 75 MLX4_QP_ST_UC = 0x1,
76 MLX4_QP_ST_RD = 0x2, 76 MLX4_QP_ST_RD = 0x2,
77 MLX4_QP_ST_UD = 0x3, 77 MLX4_QP_ST_UD = 0x3,
78 MLX4_QP_ST_XRC = 0x6,
78 MLX4_QP_ST_MLX = 0x7 79 MLX4_QP_ST_MLX = 0x7
79}; 80};
80 81
@@ -137,7 +138,7 @@ struct mlx4_qp_context {
137 __be32 ssn; 138 __be32 ssn;
138 __be32 params2; 139 __be32 params2;
139 __be32 rnr_nextrecvpsn; 140 __be32 rnr_nextrecvpsn;
140 __be32 srcd; 141 __be32 xrcd;
141 __be32 cqn_recv; 142 __be32 cqn_recv;
142 __be64 db_rec_addr; 143 __be64 db_rec_addr;
143 __be32 qkey; 144 __be32 qkey;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3b3e3b8bb706..3dc3a8c2c485 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -356,36 +356,50 @@ static inline struct page *compound_head(struct page *page)
356 return page; 356 return page;
357} 357}
358 358
359/*
360 * The atomic page->_mapcount, starts from -1: so that transitions
361 * both from it and to it can be tracked, using atomic_inc_and_test
362 * and atomic_add_negative(-1).
363 */
364static inline void reset_page_mapcount(struct page *page)
365{
366 atomic_set(&(page)->_mapcount, -1);
367}
368
369static inline int page_mapcount(struct page *page)
370{
371 return atomic_read(&(page)->_mapcount) + 1;
372}
373
359static inline int page_count(struct page *page) 374static inline int page_count(struct page *page)
360{ 375{
361 return atomic_read(&compound_head(page)->_count); 376 return atomic_read(&compound_head(page)->_count);
362} 377}
363 378
379static inline void get_huge_page_tail(struct page *page)
380{
381 /*
382 * __split_huge_page_refcount() cannot run
383 * from under us.
384 */
385 VM_BUG_ON(page_mapcount(page) < 0);
386 VM_BUG_ON(atomic_read(&page->_count) != 0);
387 atomic_inc(&page->_mapcount);
388}
389
390extern bool __get_page_tail(struct page *page);
391
364static inline void get_page(struct page *page) 392static inline void get_page(struct page *page)
365{ 393{
394 if (unlikely(PageTail(page)))
395 if (likely(__get_page_tail(page)))
396 return;
366 /* 397 /*
367 * Getting a normal page or the head of a compound page 398 * Getting a normal page or the head of a compound page
368 * requires to already have an elevated page->_count. Only if 399 * requires to already have an elevated page->_count.
369 * we're getting a tail page, the elevated page->_count is
370 * required only in the head page, so for tail pages the
371 * bugcheck only verifies that the page->_count isn't
372 * negative.
373 */ 400 */
374 VM_BUG_ON(atomic_read(&page->_count) < !PageTail(page)); 401 VM_BUG_ON(atomic_read(&page->_count) <= 0);
375 atomic_inc(&page->_count); 402 atomic_inc(&page->_count);
376 /*
377 * Getting a tail page will elevate both the head and tail
378 * page->_count(s).
379 */
380 if (unlikely(PageTail(page))) {
381 /*
382 * This is safe only because
383 * __split_huge_page_refcount can't run under
384 * get_page().
385 */
386 VM_BUG_ON(atomic_read(&page->first_page->_count) <= 0);
387 atomic_inc(&page->first_page->_count);
388 }
389} 403}
390 404
391static inline struct page *virt_to_head_page(const void *x) 405static inline struct page *virt_to_head_page(const void *x)
@@ -804,21 +818,6 @@ static inline pgoff_t page_index(struct page *page)
804} 818}
805 819
806/* 820/*
807 * The atomic page->_mapcount, like _count, starts from -1:
808 * so that transitions both from it and to it can be tracked,
809 * using atomic_inc_and_test and atomic_add_negative(-1).
810 */
811static inline void reset_page_mapcount(struct page *page)
812{
813 atomic_set(&(page)->_mapcount, -1);
814}
815
816static inline int page_mapcount(struct page *page)
817{
818 return atomic_read(&(page)->_mapcount) + 1;
819}
820
821/*
822 * Return true if this page is mapped into pagetables. 821 * Return true if this page is mapped into pagetables.
823 */ 822 */
824static inline int page_mapped(struct page *page) 823static inline int page_mapped(struct page *page)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 3e01a19a91e8..5b42f1b34eb7 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -62,10 +62,23 @@ struct page {
62 struct { 62 struct {
63 63
64 union { 64 union {
65 atomic_t _mapcount; /* Count of ptes mapped in mms, 65 /*
66 * to show when page is mapped 66 * Count of ptes mapped in
67 * & limit reverse map searches. 67 * mms, to show when page is
68 */ 68 * mapped & limit reverse map
69 * searches.
70 *
71 * Used also for tail pages
72 * refcounting instead of
73 * _count. Tail pages cannot
74 * be mapped and keeping the
75 * tail page _count zero at
76 * all times guarantees
77 * get_page_unless_zero() will
78 * never succeed on tail
79 * pages.
80 */
81 atomic_t _mapcount;
69 82
70 struct { 83 struct {
71 unsigned inuse:16; 84 unsigned inuse:16;
diff --git a/include/linux/module.h b/include/linux/module.h
index 863921637d9f..3cb7839a60b9 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -16,6 +16,7 @@
16#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/tracepoint.h> 18#include <linux/tracepoint.h>
19#include <linux/export.h>
19 20
20#include <linux/percpu.h> 21#include <linux/percpu.h>
21#include <asm/module.h> 22#include <asm/module.h>
@@ -25,21 +26,8 @@
25/* Not Yet Implemented */ 26/* Not Yet Implemented */
26#define MODULE_SUPPORTED_DEVICE(name) 27#define MODULE_SUPPORTED_DEVICE(name)
27 28
28/* Some toolchains use a `_' prefix for all user symbols. */
29#ifdef CONFIG_SYMBOL_PREFIX
30#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
31#else
32#define MODULE_SYMBOL_PREFIX ""
33#endif
34
35#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN 29#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
36 30
37struct kernel_symbol
38{
39 unsigned long value;
40 const char *name;
41};
42
43struct modversion_info 31struct modversion_info
44{ 32{
45 unsigned long crc; 33 unsigned long crc;
@@ -98,11 +86,8 @@ void trim_init_extable(struct module *m);
98extern const struct gtype##_id __mod_##gtype##_table \ 86extern const struct gtype##_id __mod_##gtype##_table \
99 __attribute__ ((unused, alias(__stringify(name)))) 87 __attribute__ ((unused, alias(__stringify(name))))
100 88
101extern struct module __this_module;
102#define THIS_MODULE (&__this_module)
103#else /* !MODULE */ 89#else /* !MODULE */
104#define MODULE_GENERIC_TABLE(gtype,name) 90#define MODULE_GENERIC_TABLE(gtype,name)
105#define THIS_MODULE ((struct module *)0)
106#endif 91#endif
107 92
108/* Generic info of form tag = "info" */ 93/* Generic info of form tag = "info" */
@@ -150,11 +135,6 @@ extern struct module __this_module;
150/* What your module does. */ 135/* What your module does. */
151#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 136#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
152 137
153/* One for each parameter, describing how to use it. Some files do
154 multiple of these per line, so can't just use MODULE_INFO. */
155#define MODULE_PARM_DESC(_parm, desc) \
156 __MODULE_INFO(parm, _parm, #_parm ":" desc)
157
158#define MODULE_DEVICE_TABLE(type,name) \ 138#define MODULE_DEVICE_TABLE(type,name) \
159 MODULE_GENERIC_TABLE(type##_device,name) 139 MODULE_GENERIC_TABLE(type##_device,name)
160 140
@@ -218,52 +198,6 @@ struct module_use {
218 struct module *source, *target; 198 struct module *source, *target;
219}; 199};
220 200
221#ifndef __GENKSYMS__
222#ifdef CONFIG_MODVERSIONS
223/* Mark the CRC weak since genksyms apparently decides not to
224 * generate a checksums for some symbols */
225#define __CRC_SYMBOL(sym, sec) \
226 extern void *__crc_##sym __attribute__((weak)); \
227 static const unsigned long __kcrctab_##sym \
228 __used \
229 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
230 = (unsigned long) &__crc_##sym;
231#else
232#define __CRC_SYMBOL(sym, sec)
233#endif
234
235/* For every exported symbol, place a struct in the __ksymtab section */
236#define __EXPORT_SYMBOL(sym, sec) \
237 extern typeof(sym) sym; \
238 __CRC_SYMBOL(sym, sec) \
239 static const char __kstrtab_##sym[] \
240 __attribute__((section("__ksymtab_strings"), aligned(1))) \
241 = MODULE_SYMBOL_PREFIX #sym; \
242 static const struct kernel_symbol __ksymtab_##sym \
243 __used \
244 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
245 = { (unsigned long)&sym, __kstrtab_##sym }
246
247#define EXPORT_SYMBOL(sym) \
248 __EXPORT_SYMBOL(sym, "")
249
250#define EXPORT_SYMBOL_GPL(sym) \
251 __EXPORT_SYMBOL(sym, "_gpl")
252
253#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
254 __EXPORT_SYMBOL(sym, "_gpl_future")
255
256
257#ifdef CONFIG_UNUSED_SYMBOLS
258#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
259#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
260#else
261#define EXPORT_UNUSED_SYMBOL(sym)
262#define EXPORT_UNUSED_SYMBOL_GPL(sym)
263#endif
264
265#endif
266
267enum module_state 201enum module_state
268{ 202{
269 MODULE_STATE_LIVE, 203 MODULE_STATE_LIVE,
@@ -581,11 +515,6 @@ int unregister_module_notifier(struct notifier_block * nb);
581extern void print_modules(void); 515extern void print_modules(void);
582 516
583#else /* !CONFIG_MODULES... */ 517#else /* !CONFIG_MODULES... */
584#define EXPORT_SYMBOL(sym)
585#define EXPORT_SYMBOL_GPL(sym)
586#define EXPORT_SYMBOL_GPL_FUTURE(sym)
587#define EXPORT_UNUSED_SYMBOL(sym)
588#define EXPORT_UNUSED_SYMBOL_GPL(sym)
589 518
590/* Given an address, look for it in the exception tables. */ 519/* Given an address, look for it in the exception tables. */
591static inline const struct exception_table_entry * 520static inline const struct exception_table_entry *
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index fffb10bd5514..7939f636c8ba 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -31,6 +31,11 @@ static const char __module_cat(name,__LINE__)[] \
31#define __MODULE_PARM_TYPE(name, _type) \ 31#define __MODULE_PARM_TYPE(name, _type) \
32 __MODULE_INFO(parmtype, name##type, #name ":" _type) 32 __MODULE_INFO(parmtype, name##type, #name ":" _type)
33 33
34/* One for each parameter, describing how to use it. Some files do
35 multiple of these per line, so can't just use MODULE_INFO. */
36#define MODULE_PARM_DESC(_parm, desc) \
37 __MODULE_INFO(parm, _parm, #_parm ":" desc)
38
34struct kernel_param; 39struct kernel_param;
35 40
36struct kernel_param_ops { 41struct kernel_param_ops {
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 57cc0e63714f..c4eec228eef9 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -86,24 +86,39 @@ struct nand_bbt_descr {
86#define NAND_BBT_VERSION 0x00000100 86#define NAND_BBT_VERSION 0x00000100
87/* Create a bbt if none exists */ 87/* Create a bbt if none exists */
88#define NAND_BBT_CREATE 0x00000200 88#define NAND_BBT_CREATE 0x00000200
89/*
90 * Create an empty BBT with no vendor information. Vendor's information may be
91 * unavailable, for example, if the NAND controller has a different data and OOB
92 * layout or if this information is already purged. Must be used in conjunction
93 * with NAND_BBT_CREATE.
94 */
95#define NAND_BBT_CREATE_EMPTY 0x00000400
89/* Search good / bad pattern through all pages of a block */ 96/* Search good / bad pattern through all pages of a block */
90#define NAND_BBT_SCANALLPAGES 0x00000400 97#define NAND_BBT_SCANALLPAGES 0x00000800
91/* Scan block empty during good / bad block scan */ 98/* Scan block empty during good / bad block scan */
92#define NAND_BBT_SCANEMPTY 0x00000800 99#define NAND_BBT_SCANEMPTY 0x00001000
93/* Write bbt if neccecary */ 100/* Write bbt if neccecary */
94#define NAND_BBT_WRITE 0x00001000 101#define NAND_BBT_WRITE 0x00002000
95/* Read and write back block contents when writing bbt */ 102/* Read and write back block contents when writing bbt */
96#define NAND_BBT_SAVECONTENT 0x00002000 103#define NAND_BBT_SAVECONTENT 0x00004000
97/* Search good / bad pattern on the first and the second page */ 104/* Search good / bad pattern on the first and the second page */
98#define NAND_BBT_SCAN2NDPAGE 0x00004000 105#define NAND_BBT_SCAN2NDPAGE 0x00008000
99/* Search good / bad pattern on the last page of the eraseblock */ 106/* Search good / bad pattern on the last page of the eraseblock */
100#define NAND_BBT_SCANLASTPAGE 0x00008000 107#define NAND_BBT_SCANLASTPAGE 0x00010000
101/* Chip stores bad block marker on BOTH 1st and 6th bytes of OOB */ 108/*
102#define NAND_BBT_SCANBYTE1AND6 0x00100000 109 * Use a flash based bad block table. By default, OOB identifier is saved in
103/* The nand_bbt_descr was created dynamicaly and must be freed */ 110 * OOB area. This option is passed to the default bad block table function.
104#define NAND_BBT_DYNAMICSTRUCT 0x00200000 111 */
105/* The bad block table does not OOB for marker */ 112#define NAND_BBT_USE_FLASH 0x00020000
106#define NAND_BBT_NO_OOB 0x00400000 113/* Do not store flash based bad block table in OOB area; store it in-band */
114#define NAND_BBT_NO_OOB 0x00040000
115
116/*
117 * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
118 * was allocated dynamicaly and must be freed in nand_release(). Has no meaning
119 * in nand_chip.bbt_options.
120 */
121#define NAND_BBT_DYNAMICSTRUCT 0x80000000
107 122
108/* The maximum number of blocks to scan for a bbt */ 123/* The maximum number of blocks to scan for a bbt */
109#define NAND_BBT_SCAN_MAXBLOCKS 4 124#define NAND_BBT_SCAN_MAXBLOCKS 4
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 2541fb848daa..9f5b312af783 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -21,7 +21,6 @@
21#define __MTD_MTD_H__ 21#define __MTD_MTD_H__
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/module.h>
25#include <linux/uio.h> 24#include <linux/uio.h>
26#include <linux/notifier.h> 25#include <linux/notifier.h>
27#include <linux/device.h> 26#include <linux/device.h>
@@ -33,17 +32,19 @@
33#define MTD_CHAR_MAJOR 90 32#define MTD_CHAR_MAJOR 90
34#define MTD_BLOCK_MAJOR 31 33#define MTD_BLOCK_MAJOR 31
35 34
36#define MTD_ERASE_PENDING 0x01 35#define MTD_ERASE_PENDING 0x01
37#define MTD_ERASING 0x02 36#define MTD_ERASING 0x02
38#define MTD_ERASE_SUSPEND 0x04 37#define MTD_ERASE_SUSPEND 0x04
39#define MTD_ERASE_DONE 0x08 38#define MTD_ERASE_DONE 0x08
40#define MTD_ERASE_FAILED 0x10 39#define MTD_ERASE_FAILED 0x10
41 40
42#define MTD_FAIL_ADDR_UNKNOWN -1LL 41#define MTD_FAIL_ADDR_UNKNOWN -1LL
43 42
44/* If the erase fails, fail_addr might indicate exactly which block failed. If 43/*
45 fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not 44 * If the erase fails, fail_addr might indicate exactly which block failed. If
46 specific to any particular block. */ 45 * fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level
46 * or was not specific to any particular block.
47 */
47struct erase_info { 48struct erase_info {
48 struct mtd_info *mtd; 49 struct mtd_info *mtd;
49 uint64_t addr; 50 uint64_t addr;
@@ -60,26 +61,12 @@ struct erase_info {
60}; 61};
61 62
62struct mtd_erase_region_info { 63struct mtd_erase_region_info {
63 uint64_t offset; /* At which this region starts, from the beginning of the MTD */ 64 uint64_t offset; /* At which this region starts, from the beginning of the MTD */
64 uint32_t erasesize; /* For this region */ 65 uint32_t erasesize; /* For this region */
65 uint32_t numblocks; /* Number of blocks of erasesize in this region */ 66 uint32_t numblocks; /* Number of blocks of erasesize in this region */
66 unsigned long *lockmap; /* If keeping bitmap of locks */ 67 unsigned long *lockmap; /* If keeping bitmap of locks */
67}; 68};
68 69
69/*
70 * oob operation modes
71 *
72 * MTD_OOB_PLACE: oob data are placed at the given offset
73 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
74 * which are defined by the ecclayout
75 * MTD_OOB_RAW: mode to read oob and data without doing ECC checking
76 */
77typedef enum {
78 MTD_OOB_PLACE,
79 MTD_OOB_AUTO,
80 MTD_OOB_RAW,
81} mtd_oob_mode_t;
82
83/** 70/**
84 * struct mtd_oob_ops - oob operation operands 71 * struct mtd_oob_ops - oob operation operands
85 * @mode: operation mode 72 * @mode: operation mode
@@ -91,7 +78,7 @@ typedef enum {
91 * @ooblen: number of oob bytes to write/read 78 * @ooblen: number of oob bytes to write/read
92 * @oobretlen: number of oob bytes written/read 79 * @oobretlen: number of oob bytes written/read
93 * @ooboffs: offset of oob data in the oob area (only relevant when 80 * @ooboffs: offset of oob data in the oob area (only relevant when
94 * mode = MTD_OOB_PLACE) 81 * mode = MTD_OPS_PLACE_OOB or MTD_OPS_RAW)
95 * @datbuf: data buffer - if NULL only oob data are read/written 82 * @datbuf: data buffer - if NULL only oob data are read/written
96 * @oobbuf: oob data buffer 83 * @oobbuf: oob data buffer
97 * 84 *
@@ -100,7 +87,7 @@ typedef enum {
100 * OOB area. 87 * OOB area.
101 */ 88 */
102struct mtd_oob_ops { 89struct mtd_oob_ops {
103 mtd_oob_mode_t mode; 90 unsigned int mode;
104 size_t len; 91 size_t len;
105 size_t retlen; 92 size_t retlen;
106 size_t ooblen; 93 size_t ooblen;
@@ -125,6 +112,8 @@ struct nand_ecclayout {
125 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE]; 112 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE];
126}; 113};
127 114
115struct module; /* only needed for owner field in mtd_info */
116
128struct mtd_info { 117struct mtd_info {
129 u_char type; 118 u_char type;
130 uint32_t flags; 119 uint32_t flags;
@@ -172,7 +161,7 @@ struct mtd_info {
172 const char *name; 161 const char *name;
173 int index; 162 int index;
174 163
175 /* ecc layout structure pointer - read only ! */ 164 /* ECC layout structure pointer - read only! */
176 struct nand_ecclayout *ecclayout; 165 struct nand_ecclayout *ecclayout;
177 166
178 /* Data for variable erase regions. If numeraseregions is zero, 167 /* Data for variable erase regions. If numeraseregions is zero,
@@ -323,10 +312,15 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
323 /* Kernel-side ioctl definitions */ 312 /* Kernel-side ioctl definitions */
324 313
325struct mtd_partition; 314struct mtd_partition;
326 315struct mtd_part_parser_data;
327extern int mtd_device_register(struct mtd_info *master, 316
328 const struct mtd_partition *parts, 317extern int mtd_device_parse_register(struct mtd_info *mtd,
329 int nr_parts); 318 const char **part_probe_types,
319 struct mtd_part_parser_data *parser_data,
320 const struct mtd_partition *defparts,
321 int defnr_parts);
322#define mtd_device_register(master, parts, nr_parts) \
323 mtd_device_parse_register(master, NULL, NULL, parts, nr_parts)
330extern int mtd_device_unregister(struct mtd_info *master); 324extern int mtd_device_unregister(struct mtd_info *master);
331extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); 325extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
332extern int __get_mtd_device(struct mtd_info *mtd); 326extern int __get_mtd_device(struct mtd_info *mtd);
@@ -355,27 +349,16 @@ void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
355 349
356void mtd_erase_callback(struct erase_info *instr); 350void mtd_erase_callback(struct erase_info *instr);
357 351
358/* 352static inline int mtd_is_bitflip(int err) {
359 * Debugging macro and defines 353 return err == -EUCLEAN;
360 */ 354}
361#define MTD_DEBUG_LEVEL0 (0) /* Quiet */ 355
362#define MTD_DEBUG_LEVEL1 (1) /* Audible */ 356static inline int mtd_is_eccerr(int err) {
363#define MTD_DEBUG_LEVEL2 (2) /* Loud */ 357 return err == -EBADMSG;
364#define MTD_DEBUG_LEVEL3 (3) /* Noisy */ 358}
365 359
366#ifdef CONFIG_MTD_DEBUG 360static inline int mtd_is_bitflip_or_eccerr(int err) {
367#define DEBUG(n, args...) \ 361 return mtd_is_bitflip(err) || mtd_is_eccerr(err);
368 do { \ 362}
369 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
370 printk(KERN_INFO args); \
371 } while(0)
372#else /* CONFIG_MTD_DEBUG */
373#define DEBUG(n, args...) \
374 do { \
375 if (0) \
376 printk(KERN_INFO args); \
377 } while(0)
378
379#endif /* CONFIG_MTD_DEBUG */
380 363
381#endif /* __MTD_MTD_H__ */ 364#endif /* __MTD_MTD_H__ */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index c2b9ac4fbc4a..904131bab501 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -42,10 +42,10 @@ extern void nand_release(struct mtd_info *mtd);
42/* Internal helper for board drivers which need to override command function */ 42/* Internal helper for board drivers which need to override command function */
43extern void nand_wait_ready(struct mtd_info *mtd); 43extern void nand_wait_ready(struct mtd_info *mtd);
44 44
45/* locks all blockes present in the device */ 45/* locks all blocks present in the device */
46extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); 46extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
47 47
48/* unlocks specified locked blockes */ 48/* unlocks specified locked blocks */
49extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); 49extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
50 50
51/* The maximum number of NAND chips in an array */ 51/* The maximum number of NAND chips in an array */
@@ -150,7 +150,7 @@ typedef enum {
150#define NAND_ECC_READ 0 150#define NAND_ECC_READ 0
151/* Reset Hardware ECC for write */ 151/* Reset Hardware ECC for write */
152#define NAND_ECC_WRITE 1 152#define NAND_ECC_WRITE 1
153/* Enable Hardware ECC before syndrom is read back from flash */ 153/* Enable Hardware ECC before syndrome is read back from flash */
154#define NAND_ECC_READSYN 2 154#define NAND_ECC_READSYN 2
155 155
156/* Bit mask for flags passed to do_nand_read_ecc */ 156/* Bit mask for flags passed to do_nand_read_ecc */
@@ -163,7 +163,7 @@ typedef enum {
163 */ 163 */
164/* Chip can not auto increment pages */ 164/* Chip can not auto increment pages */
165#define NAND_NO_AUTOINCR 0x00000001 165#define NAND_NO_AUTOINCR 0x00000001
166/* Buswitdh is 16 bit */ 166/* Buswidth is 16 bit */
167#define NAND_BUSWIDTH_16 0x00000002 167#define NAND_BUSWIDTH_16 0x00000002
168/* Device supports partial programming without padding */ 168/* Device supports partial programming without padding */
169#define NAND_NO_PADDING 0x00000004 169#define NAND_NO_PADDING 0x00000004
@@ -219,27 +219,15 @@ typedef enum {
219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
220 220
221/* Non chip related options */ 221/* Non chip related options */
222/*
223 * Use a flash based bad block table. OOB identifier is saved in OOB area.
224 * This option is passed to the default bad block table function.
225 */
226#define NAND_USE_FLASH_BBT 0x00010000
227/* This option skips the bbt scan during initialization. */ 222/* This option skips the bbt scan during initialization. */
228#define NAND_SKIP_BBTSCAN 0x00020000 223#define NAND_SKIP_BBTSCAN 0x00010000
229/* 224/*
230 * This option is defined if the board driver allocates its own buffers 225 * This option is defined if the board driver allocates its own buffers
231 * (e.g. because it needs them DMA-coherent). 226 * (e.g. because it needs them DMA-coherent).
232 */ 227 */
233#define NAND_OWN_BUFFERS 0x00040000 228#define NAND_OWN_BUFFERS 0x00020000
234/* Chip may not exist, so silence any errors in scan */ 229/* Chip may not exist, so silence any errors in scan */
235#define NAND_SCAN_SILENT_NODEV 0x00080000 230#define NAND_SCAN_SILENT_NODEV 0x00040000
236/*
237 * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch
238 * the OOB area.
239 */
240#define NAND_USE_FLASH_BBT_NO_OOB 0x00800000
241/* Create an empty BBT with no vendor information if the BBT is available */
242#define NAND_CREATE_EMPTY_BBT 0x01000000
243 231
244/* Options set by nand scan */ 232/* Options set by nand scan */
245/* Nand scan has allocated controller struct */ 233/* Nand scan has allocated controller struct */
@@ -331,27 +319,29 @@ struct nand_hw_control {
331}; 319};
332 320
333/** 321/**
334 * struct nand_ecc_ctrl - Control structure for ecc 322 * struct nand_ecc_ctrl - Control structure for ECC
335 * @mode: ecc mode 323 * @mode: ECC mode
336 * @steps: number of ecc steps per page 324 * @steps: number of ECC steps per page
337 * @size: data bytes per ecc step 325 * @size: data bytes per ECC step
338 * @bytes: ecc bytes per step 326 * @bytes: ECC bytes per step
339 * @total: total number of ecc bytes per page 327 * @total: total number of ECC bytes per page
340 * @prepad: padding information for syndrome based ecc generators 328 * @prepad: padding information for syndrome based ECC generators
341 * @postpad: padding information for syndrome based ecc generators 329 * @postpad: padding information for syndrome based ECC generators
342 * @layout: ECC layout control struct pointer 330 * @layout: ECC layout control struct pointer
343 * @priv: pointer to private ecc control data 331 * @priv: pointer to private ECC control data
344 * @hwctl: function to control hardware ecc generator. Must only 332 * @hwctl: function to control hardware ECC generator. Must only
345 * be provided if an hardware ECC is available 333 * be provided if an hardware ECC is available
346 * @calculate: function for ecc calculation or readback from ecc hardware 334 * @calculate: function for ECC calculation or readback from ECC hardware
347 * @correct: function for ecc correction, matching to ecc generator (sw/hw) 335 * @correct: function for ECC correction, matching to ECC generator (sw/hw)
348 * @read_page_raw: function to read a raw page without ECC 336 * @read_page_raw: function to read a raw page without ECC
349 * @write_page_raw: function to write a raw page without ECC 337 * @write_page_raw: function to write a raw page without ECC
350 * @read_page: function to read a page according to the ecc generator 338 * @read_page: function to read a page according to the ECC generator
351 * requirements. 339 * requirements.
352 * @read_subpage: function to read parts of the page covered by ECC. 340 * @read_subpage: function to read parts of the page covered by ECC.
353 * @write_page: function to write a page according to the ecc generator 341 * @write_page: function to write a page according to the ECC generator
354 * requirements. 342 * requirements.
343 * @write_oob_raw: function to write chip OOB data without ECC
344 * @read_oob_raw: function to read chip OOB data without ECC
355 * @read_oob: function to read chip OOB data 345 * @read_oob: function to read chip OOB data
356 * @write_oob: function to write chip OOB data 346 * @write_oob: function to write chip OOB data
357 */ 347 */
@@ -380,6 +370,10 @@ struct nand_ecc_ctrl {
380 uint32_t offs, uint32_t len, uint8_t *buf); 370 uint32_t offs, uint32_t len, uint8_t *buf);
381 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 371 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
382 const uint8_t *buf); 372 const uint8_t *buf);
373 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
374 int page);
375 int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
376 int page, int sndcmd);
383 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, 377 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page,
384 int sndcmd); 378 int sndcmd);
385 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, 379 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
@@ -388,8 +382,8 @@ struct nand_ecc_ctrl {
388 382
389/** 383/**
390 * struct nand_buffers - buffer structure for read/write 384 * struct nand_buffers - buffer structure for read/write
391 * @ecccalc: buffer for calculated ecc 385 * @ecccalc: buffer for calculated ECC
392 * @ecccode: buffer for ecc read from flash 386 * @ecccode: buffer for ECC read from flash
393 * @databuf: buffer for data - dynamically sized 387 * @databuf: buffer for data - dynamically sized
394 * 388 *
395 * Do not change the order of buffers. databuf and oobrbuf must be in 389 * Do not change the order of buffers. databuf and oobrbuf must be in
@@ -422,7 +416,7 @@ struct nand_buffers {
422 * mtd->oobsize, mtd->writesize and so on. 416 * mtd->oobsize, mtd->writesize and so on.
423 * @id_data contains the 8 bytes values of NAND_CMD_READID. 417 * @id_data contains the 8 bytes values of NAND_CMD_READID.
424 * Return with the bus width. 418 * Return with the bus width.
425 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing 419 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accessing
426 * device ready/busy line. If set to NULL no access to 420 * device ready/busy line. If set to NULL no access to
427 * ready/busy is available and the ready/busy information 421 * ready/busy is available and the ready/busy information
428 * is read from the chip status register. 422 * is read from the chip status register.
@@ -430,17 +424,17 @@ struct nand_buffers {
430 * commands to the chip. 424 * commands to the chip.
431 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on 425 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
432 * ready. 426 * ready.
433 * @ecc: [BOARDSPECIFIC] ecc control ctructure 427 * @ecc: [BOARDSPECIFIC] ECC control structure
434 * @buffers: buffer structure for read/write 428 * @buffers: buffer structure for read/write
435 * @hwcontrol: platform-specific hardware control structure 429 * @hwcontrol: platform-specific hardware control structure
436 * @ops: oob operation operands
437 * @erase_cmd: [INTERN] erase command write function, selectable due 430 * @erase_cmd: [INTERN] erase command write function, selectable due
438 * to AND support. 431 * to AND support.
439 * @scan_bbt: [REPLACEABLE] function to scan bad block table 432 * @scan_bbt: [REPLACEABLE] function to scan bad block table
440 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring 433 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring
441 * data from array to read regs (tR). 434 * data from array to read regs (tR).
442 * @state: [INTERN] the current state of the NAND device 435 * @state: [INTERN] the current state of the NAND device
443 * @oob_poi: poison value buffer 436 * @oob_poi: "poison value buffer," used for laying out OOB data
437 * before writing
444 * @page_shift: [INTERN] number of address bits in a page (column 438 * @page_shift: [INTERN] number of address bits in a page (column
445 * address bits). 439 * address bits).
446 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 440 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
@@ -449,6 +443,9 @@ struct nand_buffers {
449 * @options: [BOARDSPECIFIC] various chip options. They can partly 443 * @options: [BOARDSPECIFIC] various chip options. They can partly
450 * be set to inform nand_scan about special functionality. 444 * be set to inform nand_scan about special functionality.
451 * See the defines for further explanation. 445 * See the defines for further explanation.
446 * @bbt_options: [INTERN] bad block specific options. All options used
447 * here must come from bbm.h. By default, these options
448 * will be copied to the appropriate nand_bbt_descr's.
452 * @badblockpos: [INTERN] position of the bad block marker in the oob 449 * @badblockpos: [INTERN] position of the bad block marker in the oob
453 * area. 450 * area.
454 * @badblockbits: [INTERN] number of bits to left-shift the bad block 451 * @badblockbits: [INTERN] number of bits to left-shift the bad block
@@ -464,7 +461,7 @@ struct nand_buffers {
464 * non 0 if ONFI supported. 461 * non 0 if ONFI supported.
465 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is 462 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
466 * supported, 0 otherwise. 463 * supported, 0 otherwise.
467 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 464 * @ecclayout: [REPLACEABLE] the default ECC placement scheme
468 * @bbt: [INTERN] bad block table pointer 465 * @bbt: [INTERN] bad block table pointer
469 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash 466 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash
470 * lookup. 467 * lookup.
@@ -472,9 +469,9 @@ struct nand_buffers {
472 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial 469 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial
473 * bad block scan. 470 * bad block scan.
474 * @controller: [REPLACEABLE] a pointer to a hardware controller 471 * @controller: [REPLACEABLE] a pointer to a hardware controller
475 * structure which is shared among multiple independend 472 * structure which is shared among multiple independent
476 * devices. 473 * devices.
477 * @priv: [OPTIONAL] pointer to private chip date 474 * @priv: [OPTIONAL] pointer to private chip data
478 * @errstat: [OPTIONAL] hardware specific function to perform 475 * @errstat: [OPTIONAL] hardware specific function to perform
479 * additional error status checks (determine if errors are 476 * additional error status checks (determine if errors are
480 * correctable). 477 * correctable).
@@ -509,6 +506,7 @@ struct nand_chip {
509 506
510 int chip_delay; 507 int chip_delay;
511 unsigned int options; 508 unsigned int options;
509 unsigned int bbt_options;
512 510
513 int page_shift; 511 int page_shift;
514 int phys_erase_shift; 512 int phys_erase_shift;
@@ -536,8 +534,6 @@ struct nand_chip {
536 struct nand_buffers *buffers; 534 struct nand_buffers *buffers;
537 struct nand_hw_control hwcontrol; 535 struct nand_hw_control hwcontrol;
538 536
539 struct mtd_oob_ops ops;
540
541 uint8_t *bbt; 537 uint8_t *bbt;
542 struct nand_bbt_descr *bbt_td; 538 struct nand_bbt_descr *bbt_td;
543 struct nand_bbt_descr *bbt_md; 539 struct nand_bbt_descr *bbt_md;
@@ -611,10 +607,9 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
611 * @partitions: mtd partition list 607 * @partitions: mtd partition list
612 * @chip_delay: R/B delay value in us 608 * @chip_delay: R/B delay value in us
613 * @options: Option flags, e.g. 16bit buswidth 609 * @options: Option flags, e.g. 16bit buswidth
614 * @ecclayout: ecc layout info structure 610 * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH
611 * @ecclayout: ECC layout info structure
615 * @part_probe_types: NULL-terminated array of probe types 612 * @part_probe_types: NULL-terminated array of probe types
616 * @set_parts: platform specific function to set partitions
617 * @priv: hardware controller specific settings
618 */ 613 */
619struct platform_nand_chip { 614struct platform_nand_chip {
620 int nr_chips; 615 int nr_chips;
@@ -624,9 +619,8 @@ struct platform_nand_chip {
624 struct nand_ecclayout *ecclayout; 619 struct nand_ecclayout *ecclayout;
625 int chip_delay; 620 int chip_delay;
626 unsigned int options; 621 unsigned int options;
622 unsigned int bbt_options;
627 const char **part_probe_types; 623 const char **part_probe_types;
628 void (*set_parts)(uint64_t size, struct platform_nand_chip *chip);
629 void *priv;
630}; 624};
631 625
632/* Keep gcc happy */ 626/* Keep gcc happy */
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 52b6f187bf49..4596503c9da9 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -184,6 +184,9 @@ struct onenand_chip {
184#define ONENAND_IS_CACHE_PROGRAM(this) \ 184#define ONENAND_IS_CACHE_PROGRAM(this) \
185 (this->options & ONENAND_HAS_CACHE_PROGRAM) 185 (this->options & ONENAND_HAS_CACHE_PROGRAM)
186 186
187#define ONENAND_IS_NOP_1(this) \
188 (this->options & ONENAND_HAS_NOP_1)
189
187/* Check byte access in OneNAND */ 190/* Check byte access in OneNAND */
188#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) 191#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
189 192
@@ -195,6 +198,7 @@ struct onenand_chip {
195#define ONENAND_HAS_2PLANE (0x0004) 198#define ONENAND_HAS_2PLANE (0x0004)
196#define ONENAND_HAS_4KB_PAGE (0x0008) 199#define ONENAND_HAS_4KB_PAGE (0x0008)
197#define ONENAND_HAS_CACHE_PROGRAM (0x0010) 200#define ONENAND_HAS_CACHE_PROGRAM (0x0010)
201#define ONENAND_HAS_NOP_1 (0x0020)
198#define ONENAND_SKIP_UNLOCK_CHECK (0x0100) 202#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
199#define ONENAND_PAGEBUF_ALLOC (0x1000) 203#define ONENAND_PAGEBUF_ALLOC (0x1000)
200#define ONENAND_OOBBUF_ALLOC (0x2000) 204#define ONENAND_OOBBUF_ALLOC (0x2000)
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 3a6f0372fc96..2475228c1158 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -24,7 +24,9 @@
24 * will extend to the end of the master MTD device. 24 * will extend to the end of the master MTD device.
25 * offset: absolute starting position within the master MTD device; if 25 * offset: absolute starting position within the master MTD device; if
26 * defined as MTDPART_OFS_APPEND, the partition will start where the 26 * defined as MTDPART_OFS_APPEND, the partition will start where the
27 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. 27 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block;
28 * if MTDPART_OFS_RETAIN, consume as much as possible, leaving size
29 * after the end of partition.
28 * mask_flags: contains flags that have to be masked (removed) from the 30 * mask_flags: contains flags that have to be masked (removed) from the
29 * master MTD flag set for the corresponding MTD partition. 31 * master MTD flag set for the corresponding MTD partition.
30 * For example, to force a read-only partition, simply adding 32 * For example, to force a read-only partition, simply adding
@@ -42,12 +44,25 @@ struct mtd_partition {
42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */ 44 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */
43}; 45};
44 46
47#define MTDPART_OFS_RETAIN (-3)
45#define MTDPART_OFS_NXTBLK (-2) 48#define MTDPART_OFS_NXTBLK (-2)
46#define MTDPART_OFS_APPEND (-1) 49#define MTDPART_OFS_APPEND (-1)
47#define MTDPART_SIZ_FULL (0) 50#define MTDPART_SIZ_FULL (0)
48 51
49 52
50struct mtd_info; 53struct mtd_info;
54struct device_node;
55
56/**
57 * struct mtd_part_parser_data - used to pass data to MTD partition parsers.
58 * @origin: for RedBoot, start address of MTD device
59 * @of_node: for OF parsers, device node containing partitioning information
60 */
61struct mtd_part_parser_data {
62 unsigned long origin;
63 struct device_node *of_node;
64};
65
51 66
52/* 67/*
53 * Functions dealing with the various ways of partitioning the space 68 * Functions dealing with the various ways of partitioning the space
@@ -57,37 +72,12 @@ struct mtd_part_parser {
57 struct list_head list; 72 struct list_head list;
58 struct module *owner; 73 struct module *owner;
59 const char *name; 74 const char *name;
60 int (*parse_fn)(struct mtd_info *, struct mtd_partition **, unsigned long); 75 int (*parse_fn)(struct mtd_info *, struct mtd_partition **,
76 struct mtd_part_parser_data *);
61}; 77};
62 78
63extern int register_mtd_parser(struct mtd_part_parser *parser); 79extern int register_mtd_parser(struct mtd_part_parser *parser);
64extern int deregister_mtd_parser(struct mtd_part_parser *parser); 80extern int deregister_mtd_parser(struct mtd_part_parser *parser);
65extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
66 struct mtd_partition **pparts, unsigned long origin);
67
68#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
69
70struct device;
71struct device_node;
72
73#ifdef CONFIG_MTD_OF_PARTS
74int __devinit of_mtd_parse_partitions(struct device *dev,
75 struct device_node *node,
76 struct mtd_partition **pparts);
77#else
78static inline int of_mtd_parse_partitions(struct device *dev,
79 struct device_node *node,
80 struct mtd_partition **pparts)
81{
82 return 0;
83}
84#endif
85
86#ifdef CONFIG_MTD_CMDLINE_PARTS
87static inline int mtd_has_cmdlinepart(void) { return 1; }
88#else
89static inline int mtd_has_cmdlinepart(void) { return 0; }
90#endif
91 81
92int mtd_is_partition(struct mtd_info *mtd); 82int mtd_is_partition(struct mtd_info *mtd);
93int mtd_add_partition(struct mtd_info *master, char *name, 83int mtd_add_partition(struct mtd_info *master, char *name,
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index e5f21d293c70..04e018160e2b 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -32,21 +32,4 @@ struct physmap_flash_data {
32 struct mtd_partition *parts; 32 struct mtd_partition *parts;
33}; 33};
34 34
35/*
36 * Board needs to specify the exact mapping during their setup time.
37 */
38void physmap_configure(unsigned long addr, unsigned long size,
39 int bankwidth, void (*set_vpp)(struct map_info *, int) );
40
41/*
42 * Machines that wish to do flash partition may want to call this function in
43 * their setup routine.
44 *
45 * physmap_set_partitions(mypartitions, num_parts);
46 *
47 * Note that one can always override this hard-coded partition with
48 * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
49 */
50void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
51
52#endif /* __LINUX_MTD_PHYSMAP__ */ 35#endif /* __LINUX_MTD_PHYSMAP__ */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 409328d1cbbb..ffc02135c483 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -67,6 +67,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
67#define LOOKUP_EMPTY 0x4000 67#define LOOKUP_EMPTY 0x4000
68 68
69extern int user_path_at(int, const char __user *, unsigned, struct path *); 69extern int user_path_at(int, const char __user *, unsigned, struct path *);
70extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
70 71
71#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) 72#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path)
72#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) 73#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path)
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index f9930c87fff3..c3b45480ecf7 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -12,3 +12,4 @@ header-y += ipt_ah.h
12header-y += ipt_ecn.h 12header-y += ipt_ecn.h
13header-y += ipt_realm.h 13header-y += ipt_realm.h
14header-y += ipt_ttl.h 14header-y += ipt_ttl.h
15header-y += nf_nat.h
diff --git a/include/linux/netfilter_ipv4/nf_nat.h b/include/linux/netfilter_ipv4/nf_nat.h
new file mode 100644
index 000000000000..7a861d09fc86
--- /dev/null
+++ b/include/linux/netfilter_ipv4/nf_nat.h
@@ -0,0 +1,58 @@
1#ifndef _LINUX_NF_NAT_H
2#define _LINUX_NF_NAT_H
3
4#include <linux/types.h>
5
6#define IP_NAT_RANGE_MAP_IPS 1
7#define IP_NAT_RANGE_PROTO_SPECIFIED 2
8#define IP_NAT_RANGE_PROTO_RANDOM 4
9#define IP_NAT_RANGE_PERSISTENT 8
10
11/* The protocol-specific manipulable parts of the tuple. */
12union nf_conntrack_man_proto {
13 /* Add other protocols here. */
14 __be16 all;
15
16 struct {
17 __be16 port;
18 } tcp;
19 struct {
20 __be16 port;
21 } udp;
22 struct {
23 __be16 id;
24 } icmp;
25 struct {
26 __be16 port;
27 } dccp;
28 struct {
29 __be16 port;
30 } sctp;
31 struct {
32 __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
33 } gre;
34};
35
36/* Single range specification. */
37struct nf_nat_range {
38 /* Set to OR of flags above. */
39 unsigned int flags;
40
41 /* Inclusive: network order. */
42 __be32 min_ip, max_ip;
43
44 /* Inclusive: network order */
45 union nf_conntrack_man_proto min, max;
46};
47
48/* For backwards compat: don't use in modern code. */
49struct nf_nat_multi_range_compat {
50 unsigned int rangesize; /* Must be 1. */
51
52 /* hangs off end. */
53 struct nf_nat_range range[1];
54};
55
56#define nf_nat_multi_range nf_nat_multi_range_compat
57
58#endif
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 8180cd9d73d5..8374d2967362 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -25,6 +25,7 @@
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ 25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
26#define NETLINK_ECRYPTFS 19 26#define NETLINK_ECRYPTFS 19
27#define NETLINK_RDMA 20 27#define NETLINK_RDMA 20
28#define NETLINK_CRYPTO 21 /* Crypto layer */
28 29
29#define MAX_LINKS 32 30#define MAX_LINKS 32
30 31
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 60a137b7f171..ab2c6343361a 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -229,6 +229,7 @@ struct nfs_inode {
229#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ 229#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
230#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */ 230#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */
231#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ 231#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */
232#define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */
232 233
233static inline struct nfs_inode *NFS_I(const struct inode *inode) 234static inline struct nfs_inode *NFS_I(const struct inode *inode)
234{ 235{
diff --git a/include/linux/of.h b/include/linux/of.h
index 5dbe263462a9..4948552d60f5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -23,6 +23,7 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24 24
25#include <asm/byteorder.h> 25#include <asm/byteorder.h>
26#include <asm/errno.h>
26 27
27typedef u32 phandle; 28typedef u32 phandle;
28typedef u32 ihandle; 29typedef u32 ihandle;
@@ -207,6 +208,11 @@ extern int of_property_read_u64(const struct device_node *np,
207extern int of_property_read_string(struct device_node *np, 208extern int of_property_read_string(struct device_node *np,
208 const char *propname, 209 const char *propname,
209 const char **out_string); 210 const char **out_string);
211extern int of_property_read_string_index(struct device_node *np,
212 const char *propname,
213 int index, const char **output);
214extern int of_property_count_strings(struct device_node *np,
215 const char *propname);
210extern int of_device_is_compatible(const struct device_node *device, 216extern int of_device_is_compatible(const struct device_node *device,
211 const char *); 217 const char *);
212extern int of_device_is_available(const struct device_node *device); 218extern int of_device_is_available(const struct device_node *device);
@@ -283,6 +289,19 @@ static inline int of_property_read_string(struct device_node *np,
283 return -ENOSYS; 289 return -ENOSYS;
284} 290}
285 291
292static inline int of_property_read_string_index(struct device_node *np,
293 const char *propname, int index,
294 const char **out_string)
295{
296 return -ENOSYS;
297}
298
299static inline int of_property_count_strings(struct device_node *np,
300 const char *propname)
301{
302 return -ENOSYS;
303}
304
286static inline const void *of_get_property(const struct device_node *node, 305static inline const void *of_get_property(const struct device_node *node,
287 const char *name, 306 const char *name,
288 int *lenp) 307 int *lenp)
@@ -303,6 +322,16 @@ static inline struct device_node *of_parse_phandle(struct device_node *np,
303 return NULL; 322 return NULL;
304} 323}
305 324
325static inline int of_alias_get_id(struct device_node *np, const char *stem)
326{
327 return -ENOSYS;
328}
329
330static inline int of_machine_is_compatible(const char *compat)
331{
332 return 0;
333}
334
306#define of_match_ptr(_ptr) NULL 335#define of_match_ptr(_ptr) NULL
307#define of_match_node(_matches, _node) NULL 336#define of_match_node(_matches, _node) NULL
308#endif /* CONFIG_OF */ 337#endif /* CONFIG_OF */
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index cd2e61ce4e83..d0307eed20c9 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -33,6 +33,8 @@ struct of_irq {
33 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ 33 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */
34}; 34};
35 35
36typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
37
36/* 38/*
37 * Workarounds only applied to 32bit powermac machines 39 * Workarounds only applied to 32bit powermac machines
38 */ 40 */
@@ -73,6 +75,7 @@ extern int of_irq_to_resource_table(struct device_node *dev,
73 struct resource *res, int nr_irqs); 75 struct resource *res, int nr_irqs);
74extern struct device_node *of_irq_find_parent(struct device_node *child); 76extern struct device_node *of_irq_find_parent(struct device_node *child);
75 77
78extern void of_irq_init(const struct of_device_id *matches);
76 79
77#endif /* CONFIG_OF_IRQ */ 80#endif /* CONFIG_OF_IRQ */
78#endif /* CONFIG_OF */ 81#endif /* CONFIG_OF */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 5a6f458a4bb7..040ce2f6e8de 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#ifdef CONFIG_OF_DEVICE 14#ifdef CONFIG_OF_DEVICE
15#include <linux/module.h>
16#include <linux/device.h> 15#include <linux/device.h>
17#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
18#include <linux/pm.h> 17#include <linux/pm.h>
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 87a9208f8aec..ee94b33080c2 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -97,11 +97,11 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
97 return 0; 97 return 0;
98} 98}
99 99
100struct srcu_notifier_head *opp_get_notifier(struct device *dev) 100static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev)
101{ 101{
102 return ERR_PTR(-EINVAL); 102 return ERR_PTR(-EINVAL);
103} 103}
104#endif /* CONFIG_PM */ 104#endif /* CONFIG_PM_OPP */
105 105
106#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 106#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
107int opp_init_cpufreq_table(struct device *dev, 107int opp_init_cpufreq_table(struct device *dev,
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 5d09cbafa7db..45fc162cbdc0 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -132,13 +132,9 @@ extern int pci_hp_deregister(struct hotplug_slot *slot);
132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
133 struct hotplug_slot_info *info); 133 struct hotplug_slot_info *info);
134 134
135static inline int pci_hp_register(struct hotplug_slot *slot, 135/* use a define to avoid include chaining to get THIS_MODULE & friends */
136 struct pci_bus *pbus, 136#define pci_hp_register(slot, pbus, devnr, name) \
137 int devnr, const char *name) 137 __pci_hp_register(slot, pbus, devnr, name, THIS_MODULE, KBUILD_MODNAME)
138{
139 return __pci_hp_register(slot, pbus, devnr, name,
140 THIS_MODULE, KBUILD_MODNAME);
141}
142 138
143/* PCI Setting Record (Type 0) */ 139/* PCI Setting Record (Type 0) */
144struct hpp_type0 { 140struct hpp_type0 {
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1679ff6931f9..3fdf251389de 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2873,3 +2873,5 @@
2873 2873
2874#define PCI_VENDOR_ID_XEN 0x5853 2874#define PCI_VENDOR_ID_XEN 0x5853
2875#define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 2875#define PCI_DEVICE_ID_XEN_PLATFORM 0x0001
2876
2877#define PCI_VENDOR_ID_OCZ 0x1b85
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 70b284024d9e..d8d903619642 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -10,6 +10,7 @@
10#define _LINUX_PM_RUNTIME_H 10#define _LINUX_PM_RUNTIME_H
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/notifier.h>
13#include <linux/pm.h> 14#include <linux/pm.h>
14 15
15#include <linux/jiffies.h> 16#include <linux/jiffies.h>
diff --git a/include/linux/pps-gpio.h b/include/linux/pps-gpio.h
new file mode 100644
index 000000000000..0035abe41b9a
--- /dev/null
+++ b/include/linux/pps-gpio.h
@@ -0,0 +1,32 @@
1/*
2 * pps-gpio.h -- PPS client for GPIOs
3 *
4 *
5 * Copyright (C) 2011 James Nuss <jamesnuss@nanometrics.ca>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#ifndef _PPS_GPIO_H
23#define _PPS_GPIO_H
24
25struct pps_gpio_platform_data {
26 bool assert_falling_edge;
27 bool capture_clear;
28 unsigned int gpio_pin;
29 const char *gpio_label;
30};
31
32#endif
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index cc03bbf5c4b8..ea567321ae3c 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -32,15 +32,15 @@ enum pstore_type_id {
32struct pstore_info { 32struct pstore_info {
33 struct module *owner; 33 struct module *owner;
34 char *name; 34 char *name;
35 struct mutex buf_mutex; /* serialize access to 'buf' */ 35 spinlock_t buf_lock; /* serialize access to 'buf' */
36 char *buf; 36 char *buf;
37 size_t bufsize; 37 size_t bufsize;
38 int (*open)(struct pstore_info *psi); 38 int (*open)(struct pstore_info *psi);
39 int (*close)(struct pstore_info *psi); 39 int (*close)(struct pstore_info *psi);
40 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 40 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
41 struct timespec *time, struct pstore_info *psi); 41 struct timespec *time, struct pstore_info *psi);
42 u64 (*write)(enum pstore_type_id type, unsigned int part, 42 int (*write)(enum pstore_type_id type, u64 *id,
43 size_t size, struct pstore_info *psi); 43 unsigned int part, size_t size, struct pstore_info *psi);
44 int (*erase)(enum pstore_type_id type, u64 id, 44 int (*erase)(enum pstore_type_id type, u64 id,
45 struct pstore_info *psi); 45 struct pstore_info *psi);
46 void *data; 46 void *data;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 3daac2d8dc37..690276a642cf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -15,8 +15,8 @@
15 15
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/module.h>
19 18
19struct module;
20struct i2c_client; 20struct i2c_client;
21struct spi_device; 21struct spi_device;
22 22
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 12a1aa04b720..52c89ae32f64 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -16,6 +16,7 @@
16#define __LINUX_REGULATOR_DRIVER_H_ 16#define __LINUX_REGULATOR_DRIVER_H_
17 17
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/notifier.h>
19#include <linux/regulator/consumer.h> 20#include <linux/regulator/consumer.h>
20 21
21struct regulator_dev; 22struct regulator_dev;
diff --git a/include/linux/regulator/gpio-regulator.h b/include/linux/regulator/gpio-regulator.h
new file mode 100644
index 000000000000..19fbd267406d
--- /dev/null
+++ b/include/linux/regulator/gpio-regulator.h
@@ -0,0 +1,87 @@
1/*
2 * gpio-regulator.h
3 *
4 * Copyright 2011 Heiko Stuebner <heiko@sntech.de>
5 *
6 * based on fixed.h
7 *
8 * Copyright 2008 Wolfson Microelectronics PLC.
9 *
10 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
11 *
12 * Copyright (c) 2009 Nokia Corporation
13 * Roger Quadros <ext-roger.quadros@nokia.com>
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of the
18 * License, or (at your option) any later version.
19 */
20
21#ifndef __REGULATOR_GPIO_H
22#define __REGULATOR_GPIO_H
23
24struct regulator_init_data;
25
26enum regulator_type;
27
28/**
29 * struct gpio_regulator_state - state description
30 * @value: microvolts or microamps
31 * @gpios: bitfield of gpio target-states for the value
32 *
33 * This structure describes a supported setting of the regulator
34 * and the necessary gpio-state to achieve it.
35 *
36 * The n-th bit in the bitfield describes the state of the n-th GPIO
37 * from the gpios-array defined in gpio_regulator_config below.
38 */
39struct gpio_regulator_state {
40 int value;
41 int gpios;
42};
43
44/**
45 * struct gpio_regulator_config - config structure
46 * @supply_name: Name of the regulator supply
47 * @enable_gpio: GPIO to use for enable control
48 * set to -EINVAL if not used
49 * @enable_high: Polarity of enable GPIO
50 * 1 = Active high, 0 = Active low
51 * @enabled_at_boot: Whether regulator has been enabled at
52 * boot or not. 1 = Yes, 0 = No
53 * This is used to keep the regulator at
54 * the default state
55 * @startup_delay: Start-up time in microseconds
56 * @gpios: Array containing the gpios needed to control
57 * the setting of the regulator
58 * @nr_gpios: Number of gpios
59 * @states: Array of gpio_regulator_state entries describing
60 * the gpio state for specific voltages
61 * @nr_states: Number of states available
62 * @regulator_type: either REGULATOR_CURRENT or REGULATOR_VOLTAGE
63 * @init_data: regulator_init_data
64 *
65 * This structure contains gpio-voltage regulator configuration
66 * information that must be passed by platform code to the
67 * gpio-voltage regulator driver.
68 */
69struct gpio_regulator_config {
70 const char *supply_name;
71
72 int enable_gpio;
73 unsigned enable_high:1;
74 unsigned enabled_at_boot:1;
75 unsigned startup_delay;
76
77 struct gpio *gpios;
78 int nr_gpios;
79
80 struct gpio_regulator_state *states;
81 int nr_states;
82
83 enum regulator_type type;
84 struct regulator_init_data *init_data;
85};
86
87#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index ce3127a75c88..f3f13fd5868f 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -95,7 +95,7 @@ struct regulator_state {
95 */ 95 */
96struct regulation_constraints { 96struct regulation_constraints {
97 97
98 char *name; 98 const char *name;
99 99
100 /* voltage output range (inclusive) - for voltage control */ 100 /* voltage output range (inclusive) - for voltage control */
101 int min_uV; 101 int min_uV;
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index 0cee0152aca9..b66d13d1bdc0 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -39,5 +39,6 @@
39#define RIO_DID_IDTCPS1616 0x0379 39#define RIO_DID_IDTCPS1616 0x0379
40#define RIO_DID_IDTVPS1616 0x0377 40#define RIO_DID_IDTVPS1616 0x0377
41#define RIO_DID_IDTSPS1616 0x0378 41#define RIO_DID_IDTSPS1616 0x0378
42#define RIO_DID_TSI721 0x80ab
42 43
43#endif /* LINUX_RIO_IDS_H */ 44#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rtc/sirfsoc_rtciobrg.h b/include/linux/rtc/sirfsoc_rtciobrg.h
new file mode 100644
index 000000000000..2c92e1c8e055
--- /dev/null
+++ b/include/linux/rtc/sirfsoc_rtciobrg.h
@@ -0,0 +1,18 @@
1/*
2 * RTC I/O Bridge interfaces for CSR SiRFprimaII
3 * ARM access the registers of SYSRTC, GPSRTC and PWRC through this module
4 *
5 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
6 *
7 * Licensed under GPLv2 or later.
8 */
9#ifndef _SIRFSOC_RTC_IOBRG_H_
10#define _SIRFSOC_RTC_IOBRG_H_
11
12extern void sirfsoc_rtc_iobrg_besyncing(void);
13
14extern u32 sirfsoc_rtc_iobrg_readl(u32 addr);
15
16extern void sirfsoc_rtc_iobrg_writel(u32 val, u32 addr);
17
18#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e8acce717d2a..68daf4f27e2c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1522,6 +1522,13 @@ struct task_struct {
1522 int make_it_fail; 1522 int make_it_fail;
1523#endif 1523#endif
1524 struct prop_local_single dirties; 1524 struct prop_local_single dirties;
1525 /*
1526 * when (nr_dirtied >= nr_dirtied_pause), it's time to call
1527 * balance_dirty_pages() for some dirty throttling pause
1528 */
1529 int nr_dirtied;
1530 int nr_dirtied_pause;
1531
1525#ifdef CONFIG_LATENCYTOP 1532#ifdef CONFIG_LATENCYTOP
1526 int latency_record_count; 1533 int latency_record_count;
1527 struct latency_record latency_record[LT_SAVECOUNT]; 1534 struct latency_record latency_record[LT_SAVECOUNT];
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 1feb2de2ee57..10d6b226afc5 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -83,13 +83,6 @@ struct seminfo {
83 83
84struct task_struct; 84struct task_struct;
85 85
86/* One semaphore structure for each semaphore in the system. */
87struct sem {
88 int semval; /* current value */
89 int sempid; /* pid of last operation */
90 struct list_head sem_pending; /* pending single-sop operations */
91};
92
93/* One sem_array data structure for each set of semaphores in the system. */ 86/* One sem_array data structure for each set of semaphores in the system. */
94struct sem_array { 87struct sem_array {
95 struct kern_ipc_perm ____cacheline_aligned_in_smp 88 struct kern_ipc_perm ____cacheline_aligned_in_smp
@@ -103,51 +96,21 @@ struct sem_array {
103 int complex_count; /* pending complex operations */ 96 int complex_count; /* pending complex operations */
104}; 97};
105 98
106/* One queue for each sleeping process in the system. */ 99#ifdef CONFIG_SYSVIPC
107struct sem_queue {
108 struct list_head simple_list; /* queue of pending operations */
109 struct list_head list; /* queue of pending operations */
110 struct task_struct *sleeper; /* this process */
111 struct sem_undo *undo; /* undo structure */
112 int pid; /* process id of requesting process */
113 int status; /* completion status of operation */
114 struct sembuf *sops; /* array of pending operations */
115 int nsops; /* number of operations */
116 int alter; /* does the operation alter the array? */
117};
118
119/* Each task has a list of undo requests. They are executed automatically
120 * when the process exits.
121 */
122struct sem_undo {
123 struct list_head list_proc; /* per-process list: all undos from one process. */
124 /* rcu protected */
125 struct rcu_head rcu; /* rcu struct for sem_undo() */
126 struct sem_undo_list *ulp; /* sem_undo_list for the process */
127 struct list_head list_id; /* per semaphore array list: all undos for one array */
128 int semid; /* semaphore set identifier */
129 short * semadj; /* array of adjustments, one per semaphore */
130};
131
132/* sem_undo_list controls shared access to the list of sem_undo structures
133 * that may be shared among all a CLONE_SYSVSEM task group.
134 */
135struct sem_undo_list {
136 atomic_t refcnt;
137 spinlock_t lock;
138 struct list_head list_proc;
139};
140 100
141struct sysv_sem { 101struct sysv_sem {
142 struct sem_undo_list *undo_list; 102 struct sem_undo_list *undo_list;
143}; 103};
144 104
145#ifdef CONFIG_SYSVIPC
146
147extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); 105extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
148extern void exit_sem(struct task_struct *tsk); 106extern void exit_sem(struct task_struct *tsk);
149 107
150#else 108#else
109
110struct sysv_sem {
111 /* empty */
112};
113
151static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) 114static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
152{ 115{
153 return 0; 116 return 0;
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 8bffe9ae2ca0..0efa1f10bc2b 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -131,8 +131,6 @@ struct plat_sci_port {
131 131
132 struct plat_sci_port_ops *ops; 132 struct plat_sci_port_ops *ops;
133 133
134 struct device *dma_dev;
135
136 unsigned int dma_slave_tx; 134 unsigned int dma_slave_tx;
137 unsigned int dma_slave_rx; 135 unsigned int dma_slave_rx;
138}; 136};
diff --git a/include/linux/serio.h b/include/linux/serio.h
index be7dfb0f12d0..ca82861b0e46 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -79,19 +79,21 @@ void serio_reconnect(struct serio *serio);
79irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags); 79irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags);
80 80
81void __serio_register_port(struct serio *serio, struct module *owner); 81void __serio_register_port(struct serio *serio, struct module *owner);
82static inline void serio_register_port(struct serio *serio) 82
83{ 83/* use a define to avoid include chaining to get THIS_MODULE */
84 __serio_register_port(serio, THIS_MODULE); 84#define serio_register_port(serio) \
85} 85 __serio_register_port(serio, THIS_MODULE)
86 86
87void serio_unregister_port(struct serio *serio); 87void serio_unregister_port(struct serio *serio);
88void serio_unregister_child_port(struct serio *serio); 88void serio_unregister_child_port(struct serio *serio);
89 89
90int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name); 90int __must_check __serio_register_driver(struct serio_driver *drv,
91static inline int __must_check serio_register_driver(struct serio_driver *drv) 91 struct module *owner, const char *mod_name);
92{ 92
93 return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); 93/* use a define to avoid include chaining to get THIS_MODULE & friends */
94} 94#define serio_register_driver(drv) \
95 __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
96
95void serio_unregister_driver(struct serio_driver *drv); 97void serio_unregister_driver(struct serio_driver *drv);
96 98
97static inline int serio_write(struct serio *serio, unsigned char data) 99static inline int serio_write(struct serio *serio, unsigned char data)
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 30cae70874f4..bc8c9208f7e2 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -61,6 +61,14 @@ struct pinmux_data_reg {
61 .reg = r, .reg_width = r_width, \ 61 .reg = r, .reg_width = r_width, \
62 .enum_ids = (pinmux_enum_t [r_width]) \ 62 .enum_ids = (pinmux_enum_t [r_width]) \
63 63
64struct pinmux_irq {
65 int irq;
66 pinmux_enum_t *enum_ids;
67};
68
69#define PINMUX_IRQ(irq_nr, ids...) \
70 { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } } \
71
64struct pinmux_range { 72struct pinmux_range {
65 pinmux_enum_t begin; 73 pinmux_enum_t begin;
66 pinmux_enum_t end; 74 pinmux_enum_t end;
@@ -87,7 +95,9 @@ struct pinmux_info {
87 pinmux_enum_t *gpio_data; 95 pinmux_enum_t *gpio_data;
88 unsigned int gpio_data_size; 96 unsigned int gpio_data_size;
89 97
90 unsigned long *gpio_in_use; 98 struct pinmux_irq *gpio_irq;
99 unsigned int gpio_irq_size;
100
91 struct gpio_chip chip; 101 struct gpio_chip chip;
92}; 102};
93 103
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6a6b352326d7..fe864885c1ed 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1806,12 +1806,12 @@ static inline void skb_frag_set_page(struct sk_buff *skb, int f,
1806 1806
1807/** 1807/**
1808 * skb_frag_dma_map - maps a paged fragment via the DMA API 1808 * skb_frag_dma_map - maps a paged fragment via the DMA API
1809 * @device: the device to map the fragment to 1809 * @dev: the device to map the fragment to
1810 * @frag: the paged fragment to map 1810 * @frag: the paged fragment to map
1811 * @offset: the offset within the fragment (starting at the 1811 * @offset: the offset within the fragment (starting at the
1812 * fragment's own offset) 1812 * fragment's own offset)
1813 * @size: the number of bytes to map 1813 * @size: the number of bytes to map
1814 * @direction: the direction of the mapping (%PCI_DMA_*) 1814 * @dir: the direction of the mapping (%PCI_DMA_*)
1815 * 1815 *
1816 * Maps the page associated with @frag to @device. 1816 * Maps the page associated with @frag to @device.
1817 */ 1817 */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index f10ed7b4a714..061e560251b4 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -231,10 +231,9 @@ struct ssb_driver {
231#define drv_to_ssb_drv(_drv) container_of(_drv, struct ssb_driver, drv) 231#define drv_to_ssb_drv(_drv) container_of(_drv, struct ssb_driver, drv)
232 232
233extern int __ssb_driver_register(struct ssb_driver *drv, struct module *owner); 233extern int __ssb_driver_register(struct ssb_driver *drv, struct module *owner);
234static inline int ssb_driver_register(struct ssb_driver *drv) 234#define ssb_driver_register(drv) \
235{ 235 __ssb_driver_register(drv, THIS_MODULE)
236 return __ssb_driver_register(drv, THIS_MODULE); 236
237}
238extern void ssb_driver_unregister(struct ssb_driver *drv); 237extern void ssb_driver_unregister(struct ssb_driver *drv);
239 238
240 239
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 2d04ea916760..c170edc3bf5f 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/cpu.h> 4#include <linux/cpu.h>
5#include <linux/cpumask.h> 5#include <linux/cpumask.h>
6#include <linux/smp.h>
6#include <linux/list.h> 7#include <linux/list.h>
7#include <asm/system.h> 8#include <asm/system.h>
8 9
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 492486a74484..3d8f9c44e27d 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -136,6 +136,8 @@ void rpc_shutdown_client(struct rpc_clnt *);
136void rpc_release_client(struct rpc_clnt *); 136void rpc_release_client(struct rpc_clnt *);
137void rpc_task_release_client(struct rpc_task *); 137void rpc_task_release_client(struct rpc_task *);
138 138
139int rpcb_create_local(void);
140void rpcb_put_local(void);
139int rpcb_register(u32, u32, int, unsigned short); 141int rpcb_register(u32, u32, int, unsigned short);
140int rpcb_v4_register(const u32 program, const u32 version, 142int rpcb_v4_register(const u32 program, const u32 version,
141 const struct sockaddr *address, 143 const struct sockaddr *address,
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index d8d5d93071b3..35b37b1e9299 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -413,6 +413,7 @@ struct svc_procedure {
413/* 413/*
414 * Function prototypes. 414 * Function prototypes.
415 */ 415 */
416void svc_rpcb_cleanup(struct svc_serv *serv);
416struct svc_serv *svc_create(struct svc_program *, unsigned int, 417struct svc_serv *svc_create(struct svc_program *, unsigned int,
417 void (*shutdown)(struct svc_serv *)); 418 void (*shutdown)(struct svc_serv *));
418struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, 419struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 7ad9751a0d87..8620f79658d4 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -8,7 +8,8 @@
8#define SUNRPC_SVC_XPRT_H 8#define SUNRPC_SVC_XPRT_H
9 9
10#include <linux/sunrpc/svc.h> 10#include <linux/sunrpc/svc.h>
11#include <linux/module.h> 11
12struct module;
12 13
13struct svc_xprt_ops { 14struct svc_xprt_ops {
14 struct svc_xprt *(*xpo_create)(struct svc_serv *, 15 struct svc_xprt *(*xpo_create)(struct svc_serv *,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 9a1ec10fd504..703cfa33a3ca 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -931,6 +931,7 @@ enum
931#ifdef __KERNEL__ 931#ifdef __KERNEL__
932#include <linux/list.h> 932#include <linux/list.h>
933#include <linux/rcupdate.h> 933#include <linux/rcupdate.h>
934#include <linux/wait.h>
934 935
935/* For the /proc/sys support */ 936/* For the /proc/sys support */
936struct ctl_table; 937struct ctl_table;
@@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int,
1011 * cover common cases. 1012 * cover common cases.
1012 */ 1013 */
1013 1014
1015/* Support for userspace poll() to watch for changes */
1016struct ctl_table_poll {
1017 atomic_t event;
1018 wait_queue_head_t wait;
1019};
1020
1021static inline void *proc_sys_poll_event(struct ctl_table_poll *poll)
1022{
1023 return (void *)(unsigned long)atomic_read(&poll->event);
1024}
1025
1026void proc_sys_poll_notify(struct ctl_table_poll *poll);
1027
1028#define __CTL_TABLE_POLL_INITIALIZER(name) { \
1029 .event = ATOMIC_INIT(0), \
1030 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) }
1031
1032#define DEFINE_CTL_TABLE_POLL(name) \
1033 struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)
1034
1014/* A sysctl table is an array of struct ctl_table: */ 1035/* A sysctl table is an array of struct ctl_table: */
1015struct ctl_table 1036struct ctl_table
1016{ 1037{
@@ -1021,6 +1042,7 @@ struct ctl_table
1021 struct ctl_table *child; 1042 struct ctl_table *child;
1022 struct ctl_table *parent; /* Automatically set */ 1043 struct ctl_table *parent; /* Automatically set */
1023 proc_handler *proc_handler; /* Callback for text formatting */ 1044 proc_handler *proc_handler; /* Callback for text formatting */
1045 struct ctl_table_poll *poll;
1024 void *extra1; 1046 void *extra1;
1025 void *extra2; 1047 void *extra2;
1026}; 1048};
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index d35e783a598c..20f63d3e6144 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -22,7 +22,6 @@
22#define _SYSDEV_H_ 22#define _SYSDEV_H_
23 23
24#include <linux/kobject.h> 24#include <linux/kobject.h>
25#include <linux/module.h>
26#include <linux/pm.h> 25#include <linux/pm.h>
27 26
28 27
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index d9a85d616385..cfaee869146f 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -4,10 +4,11 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/module.h>
8#include <linux/err.h> 7#include <linux/err.h>
9#include <linux/slab.h> 8#include <linux/slab.h>
10 9
10struct module;
11
11struct ts_config; 12struct ts_config;
12 13
13#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */ 14#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index fc839bfa7935..e26db031303b 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -201,6 +201,10 @@ int arch_update_cpu_topology(void);
201 .balance_interval = 64, \ 201 .balance_interval = 64, \
202} 202}
203 203
204#ifndef SD_NODES_PER_DOMAIN
205#define SD_NODES_PER_DOMAIN 16
206#endif
207
204#ifdef CONFIG_SCHED_BOOK 208#ifdef CONFIG_SCHED_BOOK
205#ifndef SD_BOOK_INIT 209#ifndef SD_BOOK_INIT
206#error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!! 210#error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!!
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index fd99ff9298c6..1ad4724458de 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -14,10 +14,10 @@
14#ifndef _UIO_DRIVER_H_ 14#ifndef _UIO_DRIVER_H_
15#define _UIO_DRIVER_H_ 15#define _UIO_DRIVER_H_
16 16
17#include <linux/module.h>
18#include <linux/fs.h> 17#include <linux/fs.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20 19
20struct module;
21struct uio_map; 21struct uio_map;
22 22
23/** 23/**
@@ -101,11 +101,11 @@ extern int __must_check
101 __uio_register_device(struct module *owner, 101 __uio_register_device(struct module *owner,
102 struct device *parent, 102 struct device *parent,
103 struct uio_info *info); 103 struct uio_info *info);
104static inline int __must_check 104
105 uio_register_device(struct device *parent, struct uio_info *info) 105/* use a define to avoid include chaining to get THIS_MODULE */
106{ 106#define uio_register_device(parent, info) \
107 return __uio_register_device(THIS_MODULE, parent, info); 107 __uio_register_device(THIS_MODULE, parent, info)
108} 108
109extern void uio_unregister_device(struct uio_info *info); 109extern void uio_unregister_device(struct uio_info *info);
110extern void uio_event_notify(struct uio_info *info); 110extern void uio_event_notify(struct uio_info *info);
111 111
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 6f49a1b39fa6..d3d0c1374334 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -946,10 +946,11 @@ struct usb_class_driver {
946 */ 946 */
947extern int usb_register_driver(struct usb_driver *, struct module *, 947extern int usb_register_driver(struct usb_driver *, struct module *,
948 const char *); 948 const char *);
949static inline int usb_register(struct usb_driver *driver) 949
950{ 950/* use a define to avoid include chaining to get THIS_MODULE & friends */
951 return usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); 951#define usb_register(driver) \
952} 952 usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
953
953extern void usb_deregister(struct usb_driver *); 954extern void usb_deregister(struct usb_driver *);
954 955
955extern int usb_register_device_driver(struct usb_device_driver *, 956extern int usb_register_device_driver(struct usb_device_driver *,
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 4e5b0213fdc1..c714ed75eae2 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -37,6 +37,14 @@ struct new_utsname {
37#include <linux/nsproxy.h> 37#include <linux/nsproxy.h>
38#include <linux/err.h> 38#include <linux/err.h>
39 39
40enum uts_proc {
41 UTS_PROC_OSTYPE,
42 UTS_PROC_OSRELEASE,
43 UTS_PROC_VERSION,
44 UTS_PROC_HOSTNAME,
45 UTS_PROC_DOMAINNAME,
46};
47
40struct user_namespace; 48struct user_namespace;
41extern struct user_namespace init_user_ns; 49extern struct user_namespace init_user_ns;
42 50
@@ -80,6 +88,14 @@ static inline struct uts_namespace *copy_utsname(unsigned long flags,
80} 88}
81#endif 89#endif
82 90
91#ifdef CONFIG_PROC_SYSCTL
92extern void uts_proc_notify(enum uts_proc proc);
93#else
94static inline void uts_proc_notify(enum uts_proc proc)
95{
96}
97#endif
98
83static inline struct new_utsname *utsname(void) 99static inline struct new_utsname *utsname(void)
84{ 100{
85 return &current->nsproxy->uts_ns->name; 101 return &current->nsproxy->uts_ns->name;
diff --git a/include/linux/uwb.h b/include/linux/uwb.h
index b0c564ec2160..7dbbee9741b7 100644
--- a/include/linux/uwb.h
+++ b/include/linux/uwb.h
@@ -33,6 +33,7 @@
33#include <linux/wait.h> 33#include <linux/wait.h>
34#include <linux/workqueue.h> 34#include <linux/workqueue.h>
35#include <linux/uwb/spec.h> 35#include <linux/uwb/spec.h>
36#include <asm/page.h>
36 37
37struct uwb_dev; 38struct uwb_dev;
38struct uwb_beca_e; 39struct uwb_beca_e;
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h
index 7b4842028ca7..891d1d5f3947 100644
--- a/include/linux/uwb/umc.h
+++ b/include/linux/uwb/umc.h
@@ -111,10 +111,9 @@ int __must_check __umc_driver_register(struct umc_driver *umc_drv,
111 * umc_driver_register - register a UMC capabiltity driver. 111 * umc_driver_register - register a UMC capabiltity driver.
112 * @umc_drv: pointer to the driver. 112 * @umc_drv: pointer to the driver.
113 */ 113 */
114static inline int __must_check umc_driver_register(struct umc_driver *umc_drv) 114#define umc_driver_register(umc_drv) \
115{ 115 __umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME)
116 return __umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME); 116
117}
118void umc_driver_unregister(struct umc_driver *umc_drv); 117void umc_driver_unregister(struct umc_driver *umc_drv);
119 118
120/* 119/*
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
index cf97b5b9d1fe..6f8fbcf10dfb 100644
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -1,5 +1,4 @@
1#include <generated/utsrelease.h> 1#include <generated/utsrelease.h>
2#include <linux/module.h>
3 2
4/* Simply sanity version stamp for modules. */ 3/* Simply sanity version stamp for modules. */
5#ifdef CONFIG_SMP 4#ifdef CONFIG_SMP
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 225560c1a10f..4b752d5ee80e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -653,6 +653,10 @@ struct v4l2_buffer {
653#define V4L2_BUF_FLAG_ERROR 0x0040 653#define V4L2_BUF_FLAG_ERROR 0x0040
654#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 654#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
655#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ 655#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
656#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
657/* Cache handling flags */
658#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
659#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
656 660
657/* 661/*
658 * O V E R L A Y P R E V I E W 662 * O V E R L A Y P R E V I E W
@@ -1165,6 +1169,7 @@ enum v4l2_power_line_frequency {
1165 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, 1169 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
1166 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1, 1170 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
1167 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2, 1171 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
1172 V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
1168}; 1173};
1169#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) 1174#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
1170#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) 1175#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
@@ -2138,6 +2143,23 @@ struct v4l2_dbg_chip_ident {
2138 __u32 revision; /* chip revision, chip specific */ 2143 __u32 revision; /* chip revision, chip specific */
2139} __attribute__ ((packed)); 2144} __attribute__ ((packed));
2140 2145
2146/**
2147 * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
2148 * @index: on return, index of the first created buffer
2149 * @count: entry: number of requested buffers,
2150 * return: number of created buffers
2151 * @memory: buffer memory type
2152 * @format: frame format, for which buffers are requested
2153 * @reserved: future extensions
2154 */
2155struct v4l2_create_buffers {
2156 __u32 index;
2157 __u32 count;
2158 enum v4l2_memory memory;
2159 struct v4l2_format format;
2160 __u32 reserved[8];
2161};
2162
2141/* 2163/*
2142 * I O C T L C O D E S F O R V I D E O D E V I C E S 2164 * I O C T L C O D E S F O R V I D E O D E V I C E S
2143 * 2165 *
@@ -2228,6 +2250,11 @@ struct v4l2_dbg_chip_ident {
2228#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription) 2250#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
2229#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription) 2251#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
2230 2252
2253/* Experimental, the below two ioctls may change over the next couple of kernel
2254 versions */
2255#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
2256#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
2257
2231/* Reminder: when adding new ioctls please add support for them to 2258/* Reminder: when adding new ioctls please add support for them to
2232 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 2259 drivers/media/video/v4l2-compat-ioctl32.c as well! */
2233 2260
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 851ebf1a4476..4c069d8bd740 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -131,10 +131,10 @@ void unregister_virtio_device(struct virtio_device *dev);
131 * virtio_driver - operations for a virtio I/O driver 131 * virtio_driver - operations for a virtio I/O driver
132 * @driver: underlying device driver (populate name and owner). 132 * @driver: underlying device driver (populate name and owner).
133 * @id_table: the ids serviced by this driver. 133 * @id_table: the ids serviced by this driver.
134 * @feature_table: an array of feature numbers supported by this device. 134 * @feature_table: an array of feature numbers supported by this driver.
135 * @feature_table_size: number of entries in the feature table array. 135 * @feature_table_size: number of entries in the feature table array.
136 * @probe: the function to call when a device is found. Returns 0 or -errno. 136 * @probe: the function to call when a device is found. Returns 0 or -errno.
137 * @remove: the function when a device is removed. 137 * @remove: the function to call when a device is removed.
138 * @config_changed: optional function to call when the device configuration 138 * @config_changed: optional function to call when the device configuration
139 * changes; may be called in interrupt context. 139 * changes; may be called in interrupt context.
140 */ 140 */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 39c88c5ad19d..add4790b21fe 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -155,6 +155,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
155#define virtio_config_val(vdev, fbit, offset, v) \ 155#define virtio_config_val(vdev, fbit, offset, v) \
156 virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) 156 virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))
157 157
158#define virtio_config_val_len(vdev, fbit, offset, v, len) \
159 virtio_config_buf((vdev), (fbit), (offset), (v), (len))
160
158static inline int virtio_config_buf(struct virtio_device *vdev, 161static inline int virtio_config_buf(struct virtio_device *vdev,
159 unsigned int fbit, 162 unsigned int fbit,
160 unsigned int offset, 163 unsigned int offset,
diff --git a/include/linux/virtio_mmio.h b/include/linux/virtio_mmio.h
new file mode 100644
index 000000000000..27c7edefbc86
--- /dev/null
+++ b/include/linux/virtio_mmio.h
@@ -0,0 +1,111 @@
1/*
2 * Virtio platform device driver
3 *
4 * Copyright 2011, ARM Ltd.
5 *
6 * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007
7 *
8 * This header is BSD licensed so anyone can use the definitions to implement
9 * compatible drivers/servers.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of IBM nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#ifndef _LINUX_VIRTIO_MMIO_H
36#define _LINUX_VIRTIO_MMIO_H
37
38/*
39 * Control registers
40 */
41
42/* Magic value ("virt" string) - Read Only */
43#define VIRTIO_MMIO_MAGIC_VALUE 0x000
44
45/* Virtio device version - Read Only */
46#define VIRTIO_MMIO_VERSION 0x004
47
48/* Virtio device ID - Read Only */
49#define VIRTIO_MMIO_DEVICE_ID 0x008
50
51/* Virtio vendor ID - Read Only */
52#define VIRTIO_MMIO_VENDOR_ID 0x00c
53
54/* Bitmask of the features supported by the host
55 * (32 bits per set) - Read Only */
56#define VIRTIO_MMIO_HOST_FEATURES 0x010
57
58/* Host features set selector - Write Only */
59#define VIRTIO_MMIO_HOST_FEATURES_SEL 0x014
60
61/* Bitmask of features activated by the guest
62 * (32 bits per set) - Write Only */
63#define VIRTIO_MMIO_GUEST_FEATURES 0x020
64
65/* Activated features set selector - Write Only */
66#define VIRTIO_MMIO_GUEST_FEATURES_SET 0x024
67
68/* Guest's memory page size in bytes - Write Only */
69#define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028
70
71/* Queue selector - Write Only */
72#define VIRTIO_MMIO_QUEUE_SEL 0x030
73
74/* Maximum size of the currently selected queue - Read Only */
75#define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034
76
77/* Queue size for the currently selected queue - Write Only */
78#define VIRTIO_MMIO_QUEUE_NUM 0x038
79
80/* Used Ring alignment for the currently selected queue - Write Only */
81#define VIRTIO_MMIO_QUEUE_ALIGN 0x03c
82
83/* Guest's PFN for the currently selected queue - Read Write */
84#define VIRTIO_MMIO_QUEUE_PFN 0x040
85
86/* Queue notifier - Write Only */
87#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050
88
89/* Interrupt status - Read Only */
90#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060
91
92/* Interrupt acknowledge - Write Only */
93#define VIRTIO_MMIO_INTERRUPT_ACK 0x064
94
95/* Device status register - Read Write */
96#define VIRTIO_MMIO_STATUS 0x070
97
98/* The config space is defined by each driver as
99 * the per-driver configuration space - Read Write */
100#define VIRTIO_MMIO_CONFIG 0x100
101
102
103
104/*
105 * Interrupt flags (re: interrupt status & acknowledge registers)
106 */
107
108#define VIRTIO_MMIO_INT_VRING (1 << 0)
109#define VIRTIO_MMIO_INT_CONFIG (1 << 1)
110
111#endif
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 4a32cb6da425..36be0f6e18a9 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -135,13 +135,13 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
135 vr->num = num; 135 vr->num = num;
136 vr->desc = p; 136 vr->desc = p;
137 vr->avail = p + num*sizeof(struct vring_desc); 137 vr->avail = p + num*sizeof(struct vring_desc);
138 vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1) 138 vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
139 & ~(align - 1)); 139 + align-1) & ~(align - 1));
140} 140}
141 141
142static inline unsigned vring_size(unsigned int num, unsigned long align) 142static inline unsigned vring_size(unsigned int num, unsigned long align)
143{ 143{
144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) 144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
145 + align - 1) & ~(align - 1)) 145 + align - 1) & ~(align - 1))
146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num; 146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
147} 147}
diff --git a/include/linux/vlynq.h b/include/linux/vlynq.h
index 8f6a95882b09..017d4a53d55e 100644
--- a/include/linux/vlynq.h
+++ b/include/linux/vlynq.h
@@ -20,9 +20,10 @@
20#define __VLYNQ_H__ 20#define __VLYNQ_H__
21 21
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/module.h>
24#include <linux/types.h> 23#include <linux/types.h>
25 24
25struct module;
26
26#define VLYNQ_NUM_IRQS 32 27#define VLYNQ_NUM_IRQS 32
27 28
28struct vlynq_mapping { 29struct vlynq_mapping {
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 2b8963ff0f35..a378c295851f 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -39,6 +39,23 @@ enum writeback_sync_modes {
39}; 39};
40 40
41/* 41/*
42 * why some writeback work was initiated
43 */
44enum wb_reason {
45 WB_REASON_BACKGROUND,
46 WB_REASON_TRY_TO_FREE_PAGES,
47 WB_REASON_SYNC,
48 WB_REASON_PERIODIC,
49 WB_REASON_LAPTOP_TIMER,
50 WB_REASON_FREE_MORE_MEM,
51 WB_REASON_FS_FREE_SPACE,
52 WB_REASON_FORKER_THREAD,
53
54 WB_REASON_MAX,
55};
56extern const char *wb_reason_name[];
57
58/*
42 * A control structure which tells the writeback code what to do. These are 59 * A control structure which tells the writeback code what to do. These are
43 * always on the stack, and hence need no locking. They are always initialised 60 * always on the stack, and hence need no locking. They are always initialised
44 * in a manner such that unspecified fields are set to zero. 61 * in a manner such that unspecified fields are set to zero.
@@ -69,14 +86,17 @@ struct writeback_control {
69 */ 86 */
70struct bdi_writeback; 87struct bdi_writeback;
71int inode_wait(void *); 88int inode_wait(void *);
72void writeback_inodes_sb(struct super_block *); 89void writeback_inodes_sb(struct super_block *, enum wb_reason reason);
73void writeback_inodes_sb_nr(struct super_block *, unsigned long nr); 90void writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
74int writeback_inodes_sb_if_idle(struct super_block *); 91 enum wb_reason reason);
75int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); 92int writeback_inodes_sb_if_idle(struct super_block *, enum wb_reason reason);
93int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr,
94 enum wb_reason reason);
76void sync_inodes_sb(struct super_block *); 95void sync_inodes_sb(struct super_block *);
77long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages); 96long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages,
97 enum wb_reason reason);
78long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 98long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
79void wakeup_flusher_threads(long nr_pages); 99void wakeup_flusher_threads(long nr_pages, enum wb_reason reason);
80 100
81/* writeback.h requires fs.h; it, too, is not included from here. */ 101/* writeback.h requires fs.h; it, too, is not included from here. */
82static inline void wait_on_inode(struct inode *inode) 102static inline void wait_on_inode(struct inode *inode)
@@ -143,6 +163,7 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
143 163
144void __bdi_update_bandwidth(struct backing_dev_info *bdi, 164void __bdi_update_bandwidth(struct backing_dev_info *bdi,
145 unsigned long thresh, 165 unsigned long thresh,
166 unsigned long bg_thresh,
146 unsigned long dirty, 167 unsigned long dirty,
147 unsigned long bdi_thresh, 168 unsigned long bdi_thresh,
148 unsigned long bdi_dirty, 169 unsigned long bdi_dirty,
diff --git a/include/media/ov772x.h b/include/media/ov772x.h
index 548bf1155c83..00dbb7c4feae 100644
--- a/include/media/ov772x.h
+++ b/include/media/ov772x.h
@@ -12,12 +12,9 @@
12#ifndef __OV772X_H__ 12#ifndef __OV772X_H__
13#define __OV772X_H__ 13#define __OV772X_H__
14 14
15#include <media/soc_camera.h>
16
17/* for flags */ 15/* for flags */
18#define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */ 16#define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */
19#define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */ 17#define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */
20#define OV772X_FLAG_8BIT (1 << 2) /* default 10 bit */
21 18
22/* 19/*
23 * for Edge ctrl 20 * for Edge ctrl
@@ -32,22 +29,23 @@ struct ov772x_edge_ctrl {
32 unsigned char lower; 29 unsigned char lower;
33}; 30};
34 31
35#define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */ 32#define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */
36#define EDGE_STRENGTH_MASK 0x1F 33#define OV772X_EDGE_STRENGTH_MASK 0x1F
37#define EDGE_THRESHOLD_MASK 0x0F 34#define OV772X_EDGE_THRESHOLD_MASK 0x0F
38#define EDGE_UPPER_MASK 0xFF 35#define OV772X_EDGE_UPPER_MASK 0xFF
39#define EDGE_LOWER_MASK 0xFF 36#define OV772X_EDGE_LOWER_MASK 0xFF
40 37
41#define OV772X_AUTO_EDGECTRL(u, l) \ 38#define OV772X_AUTO_EDGECTRL(u, l) \
42{ \ 39{ \
43 .upper = (u & EDGE_UPPER_MASK), \ 40 .upper = (u & OV772X_EDGE_UPPER_MASK), \
44 .lower = (l & EDGE_LOWER_MASK), \ 41 .lower = (l & OV772X_EDGE_LOWER_MASK), \
45} 42}
46 43
47#define OV772X_MANUAL_EDGECTRL(s, t) \ 44#define OV772X_MANUAL_EDGECTRL(s, t) \
48{ \ 45{ \
49 .strength = (s & EDGE_STRENGTH_MASK) | OV772X_MANUAL_EDGE_CTRL,\ 46 .strength = (s & OV772X_EDGE_STRENGTH_MASK) | \
50 .threshold = (t & EDGE_THRESHOLD_MASK), \ 47 OV772X_MANUAL_EDGE_CTRL, \
48 .threshold = (t & OV772X_EDGE_THRESHOLD_MASK), \
51} 49}
52 50
53/* 51/*
diff --git a/include/media/s5k6aa.h b/include/media/s5k6aa.h
new file mode 100644
index 000000000000..ba34f7055e55
--- /dev/null
+++ b/include/media/s5k6aa.h
@@ -0,0 +1,51 @@
1/*
2 * S5K6AAFX camera sensor driver header
3 *
4 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef S5K6AA_H
13#define S5K6AA_H
14
15#include <media/v4l2-mediabus.h>
16
17/**
18 * struct s5k6aa_gpio - data structure describing a GPIO
19 * @gpio: GPIO number
20 * @level: indicates active state of the @gpio
21 */
22struct s5k6aa_gpio {
23 int gpio;
24 int level;
25};
26
27/**
28 * struct s5k6aa_platform_data - s5k6aa driver platform data
29 * @set_power: an additional callback to the board code, called
30 * after enabling the regulators and before switching
31 * the sensor off
32 * @mclk_frequency: sensor's master clock frequency in Hz
33 * @gpio_reset: GPIO driving RESET pin
34 * @gpio_stby: GPIO driving STBY pin
35 * @nlanes: maximum number of MIPI-CSI lanes used
36 * @horiz_flip: default horizontal image flip value, non zero to enable
37 * @vert_flip: default vertical image flip value, non zero to enable
38 */
39
40struct s5k6aa_platform_data {
41 int (*set_power)(int enable);
42 unsigned long mclk_frequency;
43 struct s5k6aa_gpio gpio_reset;
44 struct s5k6aa_gpio gpio_stby;
45 enum v4l2_mbus_type bus_type;
46 u8 nlanes;
47 u8 horiz_flip;
48 u8 vert_flip;
49};
50
51#endif /* S5K6AA_H */
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index 5017500eda1b..0f037e8edf9a 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -1,7 +1,6 @@
1#ifndef __SAA7146__ 1#ifndef __SAA7146__
2#define __SAA7146__ 2#define __SAA7146__
3 3
4#include <linux/module.h> /* for module-version */
5#include <linux/delay.h> /* for delay-stuff */ 4#include <linux/delay.h> /* for delay-stuff */
6#include <linux/slab.h> /* for kmalloc/kfree */ 5#include <linux/slab.h> /* for kmalloc/kfree */
7#include <linux/pci.h> /* for pci-config-stuff, vendor ids etc. */ 6#include <linux/pci.h> /* for pci-config-stuff, vendor ids etc. */
@@ -55,6 +54,8 @@ do { \
55#define SAA7146_ISR_CLEAR(x,y) \ 54#define SAA7146_ISR_CLEAR(x,y) \
56 saa7146_write(x, ISR, (y)); 55 saa7146_write(x, ISR, (y));
57 56
57struct module;
58
58struct saa7146_dev; 59struct saa7146_dev;
59struct saa7146_extension; 60struct saa7146_extension;
60struct saa7146_vv; 61struct saa7146_vv;
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 7582952dceae..b1377b931eb7 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -12,12 +12,14 @@
12#ifndef SOC_CAMERA_H 12#ifndef SOC_CAMERA_H
13#define SOC_CAMERA_H 13#define SOC_CAMERA_H
14 14
15#include <linux/bitops.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/mutex.h> 17#include <linux/mutex.h>
17#include <linux/pm.h> 18#include <linux/pm.h>
18#include <linux/videodev2.h> 19#include <linux/videodev2.h>
19#include <media/videobuf-core.h> 20#include <media/videobuf-core.h>
20#include <media/videobuf2-core.h> 21#include <media/videobuf2-core.h>
22#include <media/v4l2-ctrls.h>
21#include <media/v4l2-device.h> 23#include <media/v4l2-device.h>
22 24
23struct file; 25struct file;
@@ -37,8 +39,8 @@ struct soc_camera_device {
37 unsigned char iface; /* Host number */ 39 unsigned char iface; /* Host number */
38 unsigned char devnum; /* Device number per host */ 40 unsigned char devnum; /* Device number per host */
39 struct soc_camera_sense *sense; /* See comment in struct definition */ 41 struct soc_camera_sense *sense; /* See comment in struct definition */
40 struct soc_camera_ops *ops;
41 struct video_device *vdev; 42 struct video_device *vdev;
43 struct v4l2_ctrl_handler ctrl_handler;
42 const struct soc_camera_format_xlate *current_fmt; 44 const struct soc_camera_format_xlate *current_fmt;
43 struct soc_camera_format_xlate *user_formats; 45 struct soc_camera_format_xlate *user_formats;
44 int num_user_formats; 46 int num_user_formats;
@@ -93,14 +95,10 @@ struct soc_camera_host_ops {
93 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); 95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
94 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
95 int (*set_bus_param)(struct soc_camera_device *, __u32); 97 int (*set_bus_param)(struct soc_camera_device *, __u32);
96 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
97 int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *);
98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); 100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);
101 unsigned int (*poll)(struct file *, poll_table *); 101 unsigned int (*poll)(struct file *, poll_table *);
102 const struct v4l2_queryctrl *controls;
103 int num_controls;
104}; 102};
105 103
106#define SOCAM_SENSOR_INVERT_PCLK (1 << 0) 104#define SOCAM_SENSOR_INVERT_PCLK (1 << 0)
@@ -193,13 +191,6 @@ struct soc_camera_format_xlate {
193 const struct soc_mbus_pixelfmt *host_fmt; 191 const struct soc_mbus_pixelfmt *host_fmt;
194}; 192};
195 193
196struct soc_camera_ops {
197 unsigned long (*query_bus_param)(struct soc_camera_device *);
198 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
199 const struct v4l2_queryctrl *controls;
200 int num_controls;
201};
202
203#define SOCAM_SENSE_PCLK_CHANGED (1 << 0) 194#define SOCAM_SENSE_PCLK_CHANGED (1 << 0)
204 195
205/** 196/**
@@ -226,65 +217,18 @@ struct soc_camera_sense {
226 unsigned long pixel_clock; 217 unsigned long pixel_clock;
227}; 218};
228 219
229static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( 220#define SOCAM_DATAWIDTH(x) BIT((x) - 1)
230 struct soc_camera_ops *ops, int id) 221#define SOCAM_DATAWIDTH_4 SOCAM_DATAWIDTH(4)
231{ 222#define SOCAM_DATAWIDTH_8 SOCAM_DATAWIDTH(8)
232 int i; 223#define SOCAM_DATAWIDTH_9 SOCAM_DATAWIDTH(9)
233 224#define SOCAM_DATAWIDTH_10 SOCAM_DATAWIDTH(10)
234 for (i = 0; i < ops->num_controls; i++) 225#define SOCAM_DATAWIDTH_15 SOCAM_DATAWIDTH(15)
235 if (ops->controls[i].id == id) 226#define SOCAM_DATAWIDTH_16 SOCAM_DATAWIDTH(16)
236 return &ops->controls[i];
237
238 return NULL;
239}
240
241#define SOCAM_MASTER (1 << 0)
242#define SOCAM_SLAVE (1 << 1)
243#define SOCAM_HSYNC_ACTIVE_HIGH (1 << 2)
244#define SOCAM_HSYNC_ACTIVE_LOW (1 << 3)
245#define SOCAM_VSYNC_ACTIVE_HIGH (1 << 4)
246#define SOCAM_VSYNC_ACTIVE_LOW (1 << 5)
247#define SOCAM_DATAWIDTH_4 (1 << 6)
248#define SOCAM_DATAWIDTH_8 (1 << 7)
249#define SOCAM_DATAWIDTH_9 (1 << 8)
250#define SOCAM_DATAWIDTH_10 (1 << 9)
251#define SOCAM_DATAWIDTH_15 (1 << 10)
252#define SOCAM_DATAWIDTH_16 (1 << 11)
253#define SOCAM_PCLK_SAMPLE_RISING (1 << 12)
254#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13)
255#define SOCAM_DATA_ACTIVE_HIGH (1 << 14)
256#define SOCAM_DATA_ACTIVE_LOW (1 << 15)
257#define SOCAM_MIPI_1LANE (1 << 16)
258#define SOCAM_MIPI_2LANE (1 << 17)
259#define SOCAM_MIPI_3LANE (1 << 18)
260#define SOCAM_MIPI_4LANE (1 << 19)
261#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
262 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
263 227
264#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ 228#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \
265 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ 229 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \
266 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16) 230 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16)
267 231
268static inline unsigned long soc_camera_bus_param_compatible(
269 unsigned long camera_flags, unsigned long bus_flags)
270{
271 unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode;
272 unsigned long mipi;
273
274 common_flags = camera_flags & bus_flags;
275
276 hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW);
277 vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW);
278 pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING);
279 data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW);
280 mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE);
281 buswidth = common_flags & SOCAM_DATAWIDTH_MASK;
282 mipi = common_flags & SOCAM_MIPI;
283
284 return ((!hsync || !vsync || !pclk || !data || !mode || !buswidth) && !mipi) ? 0 :
285 common_flags;
286}
287
288static inline void soc_camera_limit_side(int *start, int *length, 232static inline void soc_camera_limit_side(int *start, int *length,
289 unsigned int start_min, 233 unsigned int start_min,
290 unsigned int length_min, unsigned int length_max) 234 unsigned int length_min, unsigned int length_max)
@@ -300,23 +244,37 @@ static inline void soc_camera_limit_side(int *start, int *length,
300 *start = start_min + length_max - *length; 244 *start = start_min + length_max - *length;
301} 245}
302 246
303extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, 247unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl,
304 unsigned long flags); 248 unsigned long flags);
249unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl,
250 const struct v4l2_mbus_config *cfg);
305 251
306/* This is only temporary here - until v4l2-subdev begins to link to video_device */ 252/* This is only temporary here - until v4l2-subdev begins to link to video_device */
307#include <linux/i2c.h> 253#include <linux/i2c.h>
308static inline struct video_device *soc_camera_i2c_to_vdev(struct i2c_client *client) 254static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client)
255{
256 struct v4l2_subdev *sd = i2c_get_clientdata(client);
257 struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id;
258 return icd ? icd->vdev : NULL;
259}
260
261static inline struct soc_camera_link *soc_camera_i2c_to_link(const struct i2c_client *client)
262{
263 return client->dev.platform_data;
264}
265
266static inline struct v4l2_subdev *soc_camera_vdev_to_subdev(const struct video_device *vdev)
309{ 267{
310 struct soc_camera_device *icd = client->dev.platform_data; 268 struct soc_camera_device *icd = dev_get_drvdata(vdev->parent);
311 return icd->vdev; 269 return soc_camera_to_subdev(icd);
312} 270}
313 271
314static inline struct soc_camera_device *soc_camera_from_vb2q(struct vb2_queue *vq) 272static inline struct soc_camera_device *soc_camera_from_vb2q(const struct vb2_queue *vq)
315{ 273{
316 return container_of(vq, struct soc_camera_device, vb2_vidq); 274 return container_of(vq, struct soc_camera_device, vb2_vidq);
317} 275}
318 276
319static inline struct soc_camera_device *soc_camera_from_vbq(struct videobuf_queue *vq) 277static inline struct soc_camera_device *soc_camera_from_vbq(const struct videobuf_queue *vq)
320{ 278{
321 return container_of(vq, struct soc_camera_device, vb_vidq); 279 return container_of(vq, struct soc_camera_device, vb_vidq);
322} 280}
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 74f0fa15ca47..8aa4200a0b1d 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/videodev2.h> 14#include <linux/videodev2.h>
15#include <media/soc_camera.h> 15#include <media/soc_camera.h>
16#include <media/v4l2-mediabus.h>
16 17
17struct device; 18struct device;
18 19
@@ -20,7 +21,8 @@ struct soc_camera_platform_info {
20 const char *format_name; 21 const char *format_name;
21 unsigned long format_depth; 22 unsigned long format_depth;
22 struct v4l2_mbus_framefmt format; 23 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 24 unsigned long mbus_param;
25 enum v4l2_mbus_type mbus_type;
24 struct soc_camera_device *icd; 26 struct soc_camera_device *icd;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 27 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26}; 28};
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index fae432544b41..73f1e7eb60f3 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -82,5 +82,7 @@ const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
82s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); 82s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf);
83int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, 83int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf,
84 unsigned int *numerator, unsigned int *denominator); 84 unsigned int *numerator, unsigned int *denominator);
85unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
86 unsigned int flags);
85 87
86#endif 88#endif
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index fbf585561570..e6aa2318367b 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -25,7 +25,6 @@
25#ifndef V4L2_INT_DEVICE_H 25#ifndef V4L2_INT_DEVICE_H
26#define V4L2_INT_DEVICE_H 26#define V4L2_INT_DEVICE_H
27 27
28#include <linux/module.h>
29#include <media/v4l2-common.h> 28#include <media/v4l2-common.h>
30 29
31#define V4L2NAMESIZE 32 30#define V4L2NAMESIZE 32
@@ -41,6 +40,8 @@ enum v4l2_int_type {
41 v4l2_int_type_slave 40 v4l2_int_type_slave
42}; 41};
43 42
43struct module;
44
44struct v4l2_int_device; 45struct v4l2_int_device;
45 46
46struct v4l2_int_master { 47struct v4l2_int_master {
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index dd9f1e7b8ff7..4d1c74ad4c84 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -122,6 +122,8 @@ struct v4l2_ioctl_ops {
122 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); 122 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
123 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); 123 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
124 124
125 int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b);
126 int (*vidioc_prepare_buf)(struct file *file, void *fh, struct v4l2_buffer *b);
125 127
126 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); 128 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
127 int (*vidioc_g_fbuf) (struct file *file, void *fh, 129 int (*vidioc_g_fbuf) (struct file *file, void *fh,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 257da1a30f66..f0f3358d1b1b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -158,6 +158,7 @@ struct v4l2_subdev_core_ops {
158 int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); 158 int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
159 int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); 159 int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
160 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); 160 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
161 int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm);
161 int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); 162 int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
162 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); 163 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
163#ifdef CONFIG_VIDEO_ADV_DEBUG 164#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -534,13 +535,13 @@ struct v4l2_subdev {
534 void *dev_priv; 535 void *dev_priv;
535 void *host_priv; 536 void *host_priv;
536 /* subdev device node */ 537 /* subdev device node */
537 struct video_device devnode; 538 struct video_device *devnode;
538}; 539};
539 540
540#define media_entity_to_v4l2_subdev(ent) \ 541#define media_entity_to_v4l2_subdev(ent) \
541 container_of(ent, struct v4l2_subdev, entity) 542 container_of(ent, struct v4l2_subdev, entity)
542#define vdev_to_v4l2_subdev(vdev) \ 543#define vdev_to_v4l2_subdev(vdev) \
543 container_of(vdev, struct v4l2_subdev, devnode) 544 video_get_drvdata(vdev)
544 545
545/* 546/*
546 * Used for storing subdev information per file handle 547 * Used for storing subdev information per file handle
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index ea55c08eddfb..a15d1f1b319e 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -105,6 +105,7 @@ enum vb2_fileio_flags {
105/** 105/**
106 * enum vb2_buffer_state - current video buffer state 106 * enum vb2_buffer_state - current video buffer state
107 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control 107 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control
108 * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver
108 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver 109 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver
109 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used 110 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used
110 * in a hardware operation 111 * in a hardware operation
@@ -116,6 +117,7 @@ enum vb2_fileio_flags {
116 */ 117 */
117enum vb2_buffer_state { 118enum vb2_buffer_state {
118 VB2_BUF_STATE_DEQUEUED, 119 VB2_BUF_STATE_DEQUEUED,
120 VB2_BUF_STATE_PREPARED,
119 VB2_BUF_STATE_QUEUED, 121 VB2_BUF_STATE_QUEUED,
120 VB2_BUF_STATE_ACTIVE, 122 VB2_BUF_STATE_ACTIVE,
121 VB2_BUF_STATE_DONE, 123 VB2_BUF_STATE_DONE,
@@ -167,13 +169,21 @@ struct vb2_buffer {
167/** 169/**
168 * struct vb2_ops - driver-specific callbacks 170 * struct vb2_ops - driver-specific callbacks
169 * 171 *
170 * @queue_setup: called from a VIDIOC_REQBUFS handler, before 172 * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS
171 * memory allocation; driver should return the required 173 * handlers before memory allocation, or, if
172 * number of buffers in num_buffers, the required number 174 * *num_planes != 0, after the allocation to verify a
173 * of planes per buffer in num_planes; the size of each 175 * smaller number of buffers. Driver should return
174 * plane should be set in the sizes[] array and optional 176 * the required number of buffers in *num_buffers, the
175 * per-plane allocator specific context in alloc_ctxs[] 177 * required number of planes per buffer in *num_planes; the
176 * array 178 * size of each plane should be set in the sizes[] array
179 * and optional per-plane allocator specific context in the
180 * alloc_ctxs[] array. When called from VIDIOC_REQBUFS,
181 * fmt == NULL, the driver has to use the currently
182 * configured format and *num_buffers is the total number
183 * of buffers, that are being allocated. When called from
184 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the
185 * target frame format. In this case *num_buffers are being
186 * allocated additionally to q->num_buffers.
177 * @wait_prepare: release any locks taken while calling vb2 functions; 187 * @wait_prepare: release any locks taken while calling vb2 functions;
178 * it is called before an ioctl needs to wait for a new 188 * it is called before an ioctl needs to wait for a new
179 * buffer to arrive; required to avoid a deadlock in 189 * buffer to arrive; required to avoid a deadlock in
@@ -186,11 +196,11 @@ struct vb2_buffer {
186 * perform additional buffer-related initialization; 196 * perform additional buffer-related initialization;
187 * initialization failure (return != 0) will prevent 197 * initialization failure (return != 0) will prevent
188 * queue setup from completing successfully; optional 198 * queue setup from completing successfully; optional
189 * @buf_prepare: called every time the buffer is queued from userspace; 199 * @buf_prepare: called every time the buffer is queued from userspace
190 * drivers may perform any initialization required before 200 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may
191 * each hardware operation in this callback; 201 * perform any initialization required before each hardware
192 * if an error is returned, the buffer will not be queued 202 * operation in this callback; if an error is returned, the
193 * in driver; optional 203 * buffer will not be queued in driver; optional
194 * @buf_finish: called before every dequeue of the buffer back to 204 * @buf_finish: called before every dequeue of the buffer back to
195 * userspace; drivers may perform any operations required 205 * userspace; drivers may perform any operations required
196 * before userspace accesses the buffer; optional 206 * before userspace accesses the buffer; optional
@@ -216,9 +226,9 @@ struct vb2_buffer {
216 * pre-queued buffers before calling STREAMON 226 * pre-queued buffers before calling STREAMON
217 */ 227 */
218struct vb2_ops { 228struct vb2_ops {
219 int (*queue_setup)(struct vb2_queue *q, unsigned int *num_buffers, 229 int (*queue_setup)(struct vb2_queue *q, const struct v4l2_format *fmt,
220 unsigned int *num_planes, unsigned int sizes[], 230 unsigned int *num_buffers, unsigned int *num_planes,
221 void *alloc_ctxs[]); 231 unsigned int sizes[], void *alloc_ctxs[]);
222 232
223 void (*wait_prepare)(struct vb2_queue *q); 233 void (*wait_prepare)(struct vb2_queue *q);
224 void (*wait_finish)(struct vb2_queue *q); 234 void (*wait_finish)(struct vb2_queue *q);
@@ -298,6 +308,9 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q);
298int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b); 308int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);
299int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req); 309int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req);
300 310
311int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create);
312int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b);
313
301int vb2_queue_init(struct vb2_queue *q); 314int vb2_queue_init(struct vb2_queue *q);
302 315
303void vb2_queue_release(struct vb2_queue *q); 316void vb2_queue_release(struct vb2_queue *q);
@@ -309,6 +322,13 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type);
309int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type); 322int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type);
310 323
311int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma); 324int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma);
325#ifndef CONFIG_MMU
326unsigned long vb2_get_unmapped_area(struct vb2_queue *q,
327 unsigned long addr,
328 unsigned long len,
329 unsigned long pgoff,
330 unsigned long flags);
331#endif
312unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait); 332unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait);
313size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, 333size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
314 loff_t *ppos, int nonblock); 334 loff_t *ppos, int nonblock);
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 2f7d45bcbd24..1a7e1d20adf9 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -45,6 +45,51 @@ struct mtd_oob_buf64 {
45 __u64 usr_ptr; 45 __u64 usr_ptr;
46}; 46};
47 47
48/**
49 * MTD operation modes
50 *
51 * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default)
52 * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas
53 * which are defined by the internal ecclayout
54 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;
55 * this mode implies %MTD_OPS_PLACE_OOB
56 *
57 * These modes can be passed to ioctl(MEMWRITE) and are also used internally.
58 * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.
59 * %MTD_FILE_MODE_RAW.
60 */
61enum {
62 MTD_OPS_PLACE_OOB = 0,
63 MTD_OPS_AUTO_OOB = 1,
64 MTD_OPS_RAW = 2,
65};
66
67/**
68 * struct mtd_write_req - data structure for requesting a write operation
69 *
70 * @start: start address
71 * @len: length of data buffer
72 * @ooblen: length of OOB buffer
73 * @usr_data: user-provided data buffer
74 * @usr_oob: user-provided OOB buffer
75 * @mode: MTD mode (see "MTD operation modes")
76 * @padding: reserved, must be set to 0
77 *
78 * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
79 * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
80 * write data-only, set @usr_oob == NULL. However, setting both @usr_data and
81 * @usr_oob to NULL is not allowed.
82 */
83struct mtd_write_req {
84 __u64 start;
85 __u64 len;
86 __u64 ooblen;
87 __u64 usr_data;
88 __u64 usr_oob;
89 __u8 mode;
90 __u8 padding[7];
91};
92
48#define MTD_ABSENT 0 93#define MTD_ABSENT 0
49#define MTD_RAM 1 94#define MTD_RAM 1
50#define MTD_ROM 2 95#define MTD_ROM 2
@@ -59,13 +104,13 @@ struct mtd_oob_buf64 {
59#define MTD_NO_ERASE 0x1000 /* No erase necessary */ 104#define MTD_NO_ERASE 0x1000 /* No erase necessary */
60#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */ 105#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */
61 106
62// Some common devices / combinations of capabilities 107/* Some common devices / combinations of capabilities */
63#define MTD_CAP_ROM 0 108#define MTD_CAP_ROM 0
64#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) 109#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
65#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) 110#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
66#define MTD_CAP_NANDFLASH (MTD_WRITEABLE) 111#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
67 112
68/* ECC byte placement */ 113/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
69#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) 114#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
70#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) 115#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
71#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme 116#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
@@ -80,21 +125,18 @@ struct mtd_oob_buf64 {
80struct mtd_info_user { 125struct mtd_info_user {
81 __u8 type; 126 __u8 type;
82 __u32 flags; 127 __u32 flags;
83 __u32 size; // Total size of the MTD 128 __u32 size; /* Total size of the MTD */
84 __u32 erasesize; 129 __u32 erasesize;
85 __u32 writesize; 130 __u32 writesize;
86 __u32 oobsize; // Amount of OOB data per block (e.g. 16) 131 __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */
87 /* The below two fields are obsolete and broken, do not use them 132 __u64 padding; /* Old obsolete field; do not use */
88 * (TODO: remove at some point) */
89 __u32 ecctype;
90 __u32 eccsize;
91}; 133};
92 134
93struct region_info_user { 135struct region_info_user {
94 __u32 offset; /* At which this region starts, 136 __u32 offset; /* At which this region starts,
95 * from the beginning of the MTD */ 137 * from the beginning of the MTD */
96 __u32 erasesize; /* For this region */ 138 __u32 erasesize; /* For this region */
97 __u32 numblocks; /* Number of blocks in this region */ 139 __u32 numblocks; /* Number of blocks in this region */
98 __u32 regionindex; 140 __u32 regionindex;
99}; 141};
100 142
@@ -104,29 +146,61 @@ struct otp_info {
104 __u32 locked; 146 __u32 locked;
105}; 147};
106 148
149/*
150 * Note, the following ioctl existed in the past and was removed:
151 * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
152 * Try to avoid adding a new ioctl with the same ioctl number.
153 */
154
155/* Get basic MTD characteristics info (better to use sysfs) */
107#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 156#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
157/* Erase segment of MTD */
108#define MEMERASE _IOW('M', 2, struct erase_info_user) 158#define MEMERASE _IOW('M', 2, struct erase_info_user)
159/* Write out-of-band data from MTD */
109#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) 160#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
161/* Read out-of-band data from MTD */
110#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) 162#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
163/* Lock a chip (for MTD that supports it) */
111#define MEMLOCK _IOW('M', 5, struct erase_info_user) 164#define MEMLOCK _IOW('M', 5, struct erase_info_user)
165/* Unlock a chip (for MTD that supports it) */
112#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) 166#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
167/* Get the number of different erase regions */
113#define MEMGETREGIONCOUNT _IOR('M', 7, int) 168#define MEMGETREGIONCOUNT _IOR('M', 7, int)
169/* Get information about the erase region for a specific index */
114#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) 170#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
115#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) 171/* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
116#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) 172#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
173/* Check if an eraseblock is bad */
117#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) 174#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
175/* Mark an eraseblock as bad */
118#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) 176#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
177/* Set OTP (One-Time Programmable) mode (factory vs. user) */
119#define OTPSELECT _IOR('M', 13, int) 178#define OTPSELECT _IOR('M', 13, int)
179/* Get number of OTP (One-Time Programmable) regions */
120#define OTPGETREGIONCOUNT _IOW('M', 14, int) 180#define OTPGETREGIONCOUNT _IOW('M', 14, int)
181/* Get all OTP (One-Time Programmable) info about MTD */
121#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 182#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
183/* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
122#define OTPLOCK _IOR('M', 16, struct otp_info) 184#define OTPLOCK _IOR('M', 16, struct otp_info)
185/* Get ECC layout (deprecated) */
123#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) 186#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
187/* Get statistics about corrected/uncorrected errors */
124#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 188#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
189/* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */
125#define MTDFILEMODE _IO('M', 19) 190#define MTDFILEMODE _IO('M', 19)
191/* Erase segment of MTD (supports 64-bit address) */
126#define MEMERASE64 _IOW('M', 20, struct erase_info_user64) 192#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
193/* Write data to OOB (64-bit version) */
127#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) 194#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
195/* Read data from OOB (64-bit version) */
128#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) 196#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
197/* Check if chip is locked (for MTD that supports it) */
129#define MEMISLOCKED _IOR('M', 23, struct erase_info_user) 198#define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
199/*
200 * Most generic write interface; can write in-band and/or out-of-band in various
201 * modes (see "struct mtd_write_req")
202 */
203#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
130 204
131/* 205/*
132 * Obsolete legacy interface. Keep it in order not to break userspace 206 * Obsolete legacy interface. Keep it in order not to break userspace
@@ -177,13 +251,27 @@ struct mtd_ecc_stats {
177}; 251};
178 252
179/* 253/*
180 * Read/write file modes for access to MTD 254 * MTD file modes - for read/write access to MTD
255 *
256 * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled
257 * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode
258 * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode
259 * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled
260 *
261 * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained
262 * separately for each open file descriptor.
263 *
264 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
265 * raw access to the flash, without error correction or autoplacement schemes.
266 * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode
267 * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is
268 * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).
181 */ 269 */
182enum mtd_file_modes { 270enum mtd_file_modes {
183 MTD_MODE_NORMAL = MTD_OTP_OFF, 271 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
184 MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY, 272 MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
185 MTD_MODE_OTP_USER = MTD_OTP_USER, 273 MTD_FILE_MODE_OTP_USER = MTD_OTP_USER,
186 MTD_MODE_RAW, 274 MTD_FILE_MODE_RAW,
187}; 275};
188 276
189#endif /* __MTD_ABI_H__ */ 277#endif /* __MTD_ABI_H__ */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 5b924423cf20..3779ea362257 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -513,11 +513,15 @@ static inline void __hci_dev_put(struct hci_dev *d)
513 d->destruct(d); 513 d->destruct(d);
514} 514}
515 515
516static inline void hci_dev_put(struct hci_dev *d) 516/*
517{ 517 * hci_dev_put and hci_dev_hold are macros to avoid dragging all the
518 __hci_dev_put(d); 518 * overhead of all the modular infrastructure into this header.
519 module_put(d->owner); 519 */
520} 520#define hci_dev_put(d) \
521do { \
522 __hci_dev_put(d); \
523 module_put(d->owner); \
524} while (0)
521 525
522static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d) 526static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
523{ 527{
@@ -525,12 +529,10 @@ static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
525 return d; 529 return d;
526} 530}
527 531
528static inline struct hci_dev *hci_dev_hold(struct hci_dev *d) 532#define hci_dev_hold(d) \
529{ 533({ \
530 if (try_module_get(d->owner)) 534 try_module_get(d->owner) ? __hci_dev_hold(d) : NULL; \
531 return __hci_dev_hold(d); 535})
532 return NULL;
533}
534 536
535#define hci_dev_lock(d) spin_lock(&d->lock) 537#define hci_dev_lock(d) spin_lock(&d->lock)
536#define hci_dev_unlock(d) spin_unlock(&d->lock) 538#define hci_dev_unlock(d) spin_unlock(&d->lock)
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index f91a1fb5da7c..e8c25b981205 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -18,7 +18,6 @@
18 18
19#include <linux/kmemcheck.h> 19#include <linux/kmemcheck.h>
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/module.h>
22#include <linux/timer.h> 21#include <linux/timer.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/workqueue.h> 23#include <linux/workqueue.h>
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 8fa4430f99c1..873d5be7926c 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -425,9 +425,9 @@ struct ip_vs_protocol {
425 425
426 const char *(*state_name)(int state); 426 const char *(*state_name)(int state);
427 427
428 int (*state_transition)(struct ip_vs_conn *cp, int direction, 428 void (*state_transition)(struct ip_vs_conn *cp, int direction,
429 const struct sk_buff *skb, 429 const struct sk_buff *skb,
430 struct ip_vs_proto_data *pd); 430 struct ip_vs_proto_data *pd);
431 431
432 int (*register_app)(struct net *net, struct ip_vs_app *inc); 432 int (*register_app)(struct net *net, struct ip_vs_app *inc);
433 433
@@ -1126,17 +1126,16 @@ int unregister_ip_vs_pe(struct ip_vs_pe *pe);
1126struct ip_vs_pe *ip_vs_pe_getbyname(const char *name); 1126struct ip_vs_pe *ip_vs_pe_getbyname(const char *name);
1127struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name); 1127struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name);
1128 1128
1129static inline void ip_vs_pe_get(const struct ip_vs_pe *pe) 1129/*
1130{ 1130 * Use a #define to avoid all of module.h just for these trivial ops
1131 if (pe && pe->module) 1131 */
1132#define ip_vs_pe_get(pe) \
1133 if (pe && pe->module) \
1132 __module_get(pe->module); 1134 __module_get(pe->module);
1133}
1134 1135
1135static inline void ip_vs_pe_put(const struct ip_vs_pe *pe) 1136#define ip_vs_pe_put(pe) \
1136{ 1137 if (pe && pe->module) \
1137 if (pe && pe->module)
1138 module_put(pe->module); 1138 module_put(pe->module);
1139}
1140 1139
1141/* 1140/*
1142 * IPVS protocol functions (from ip_vs_proto.c) 1141 * IPVS protocol functions (from ip_vs_proto.c)
@@ -1378,7 +1377,7 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
1378 1377
1379extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, 1378extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
1380 int outin); 1379 int outin);
1381extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp); 1380extern int ip_vs_confirm_conntrack(struct sk_buff *skb);
1382extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, 1381extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct,
1383 struct ip_vs_conn *cp, u_int8_t proto, 1382 struct ip_vs_conn *cp, u_int8_t proto,
1384 const __be16 port, int from_rs); 1383 const __be16 port, int from_rs);
@@ -1396,8 +1395,7 @@ static inline void ip_vs_update_conntrack(struct sk_buff *skb,
1396{ 1395{
1397} 1396}
1398 1397
1399static inline int ip_vs_confirm_conntrack(struct sk_buff *skb, 1398static inline int ip_vs_confirm_conntrack(struct sk_buff *skb)
1400 struct ip_vs_conn *cp)
1401{ 1399{
1402 return NF_ACCEPT; 1400 return NF_ACCEPT;
1403} 1401}
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
index 2ec896bb72b2..d178c26a5558 100644
--- a/include/net/lib80211.h
+++ b/include/net/lib80211.h
@@ -25,7 +25,6 @@
25 25
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/module.h>
29#include <linux/atomic.h> 28#include <linux/atomic.h>
30#include <linux/if.h> 29#include <linux/if.h>
31#include <linux/skbuff.h> 30#include <linux/skbuff.h>
@@ -42,6 +41,8 @@ enum {
42 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0), 41 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
43}; 42};
44 43
44struct module;
45
45struct lib80211_crypto_ops { 46struct lib80211_crypto_ops {
46 const char *name; 47 const char *name;
47 struct list_head list; 48 struct list_head list;
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 0b7f05e4a927..8a2b0ae7dbd2 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -313,6 +313,8 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK; 313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK;
314} 314}
315 315
316struct kernel_param;
317
316extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); 318extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
317extern unsigned int nf_conntrack_htable_size; 319extern unsigned int nf_conntrack_htable_size;
318extern unsigned int nf_conntrack_max; 320extern unsigned int nf_conntrack_max;
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 7ca6bdd5bae6..2f8fb77bfdd1 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/netfilter/x_tables.h> 13#include <linux/netfilter/x_tables.h>
14#include <linux/netfilter/nf_conntrack_tuple_common.h> 14#include <linux/netfilter/nf_conntrack_tuple_common.h>
15#include <linux/netfilter_ipv4/nf_nat.h>
15#include <linux/list_nulls.h> 16#include <linux/list_nulls.h>
16 17
17/* A `tuple' is a structure containing the information to uniquely 18/* A `tuple' is a structure containing the information to uniquely
@@ -24,32 +25,6 @@
24 25
25#define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) 26#define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all)
26 27
27/* The protocol-specific manipulable parts of the tuple: always in
28 network order! */
29union nf_conntrack_man_proto {
30 /* Add other protocols here. */
31 __be16 all;
32
33 struct {
34 __be16 port;
35 } tcp;
36 struct {
37 __be16 port;
38 } udp;
39 struct {
40 __be16 id;
41 } icmp;
42 struct {
43 __be16 port;
44 } dccp;
45 struct {
46 __be16 port;
47 } sctp;
48 struct {
49 __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
50 } gre;
51};
52
53/* The manipulable part of the tuple. */ 28/* The manipulable part of the tuple. */
54struct nf_conntrack_man { 29struct nf_conntrack_man {
55 union nf_inet_addr u3; 30 union nf_inet_addr u3;
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index 0346b0070864..b8872df7285f 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -1,6 +1,7 @@
1#ifndef _NF_NAT_H 1#ifndef _NF_NAT_H
2#define _NF_NAT_H 2#define _NF_NAT_H
3#include <linux/netfilter_ipv4.h> 3#include <linux/netfilter_ipv4.h>
4#include <linux/netfilter_ipv4/nf_nat.h>
4#include <net/netfilter/nf_conntrack_tuple.h> 5#include <net/netfilter/nf_conntrack_tuple.h>
5 6
6#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 7#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16
@@ -14,11 +15,6 @@ enum nf_nat_manip_type {
14#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ 15#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
15 (hooknum) != NF_INET_LOCAL_IN) 16 (hooknum) != NF_INET_LOCAL_IN)
16 17
17#define IP_NAT_RANGE_MAP_IPS 1
18#define IP_NAT_RANGE_PROTO_SPECIFIED 2
19#define IP_NAT_RANGE_PROTO_RANDOM 4
20#define IP_NAT_RANGE_PERSISTENT 8
21
22/* NAT sequence number modifications */ 18/* NAT sequence number modifications */
23struct nf_nat_seq { 19struct nf_nat_seq {
24 /* position of the last TCP sequence number modification (if any) */ 20 /* position of the last TCP sequence number modification (if any) */
@@ -28,26 +24,6 @@ struct nf_nat_seq {
28 int16_t offset_before, offset_after; 24 int16_t offset_before, offset_after;
29}; 25};
30 26
31/* Single range specification. */
32struct nf_nat_range {
33 /* Set to OR of flags above. */
34 unsigned int flags;
35
36 /* Inclusive: network order. */
37 __be32 min_ip, max_ip;
38
39 /* Inclusive: network order */
40 union nf_conntrack_man_proto min, max;
41};
42
43/* For backwards compat: don't use in modern code. */
44struct nf_nat_multi_range_compat {
45 unsigned int rangesize; /* Must be 1. */
46
47 /* hangs off end. */
48 struct nf_nat_range range[1];
49};
50
51#include <linux/list.h> 27#include <linux/list.h>
52#include <linux/netfilter/nf_conntrack_pptp.h> 28#include <linux/netfilter/nf_conntrack_pptp.h>
53#include <net/netfilter/nf_conntrack_extend.h> 29#include <net/netfilter/nf_conntrack_extend.h>
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 2eb207ea4eaf..f6bb08b73ca4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -4,7 +4,6 @@
4#include <linux/netdevice.h> 4#include <linux/netdevice.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/rcupdate.h> 6#include <linux/rcupdate.h>
7#include <linux/module.h>
8#include <linux/pkt_sched.h> 7#include <linux/pkt_sched.h>
9#include <linux/pkt_cls.h> 8#include <linux/pkt_cls.h>
10#include <net/gen_stats.h> 9#include <net/gen_stats.h>
diff --git a/include/net/sock.h b/include/net/sock.h
index c6658bef7f32..abb6e0f0c3c3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -46,7 +46,6 @@
46#include <linux/list_nulls.h> 46#include <linux/list_nulls.h>
47#include <linux/timer.h> 47#include <linux/timer.h>
48#include <linux/cache.h> 48#include <linux/cache.h>
49#include <linux/module.h>
50#include <linux/lockdep.h> 49#include <linux/lockdep.h>
51#include <linux/netdevice.h> 50#include <linux/netdevice.h>
52#include <linux/skbuff.h> /* struct sk_buff */ 51#include <linux/skbuff.h> /* struct sk_buff */
@@ -729,6 +728,7 @@ struct request_sock_ops;
729struct timewait_sock_ops; 728struct timewait_sock_ops;
730struct inet_hashinfo; 729struct inet_hashinfo;
731struct raw_hashinfo; 730struct raw_hashinfo;
731struct module;
732 732
733/* Networking protocol blocks we attach to sockets. 733/* Networking protocol blocks we attach to sockets.
734 * socket layer -> transport layer interface 734 * socket layer -> transport layer interface
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e147f42d643d..bb18c4d69aba 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1403,11 +1403,13 @@ enum tcp_seq_states {
1403 TCP_SEQ_STATE_TIME_WAIT, 1403 TCP_SEQ_STATE_TIME_WAIT,
1404}; 1404};
1405 1405
1406int tcp_seq_open(struct inode *inode, struct file *file);
1407
1406struct tcp_seq_afinfo { 1408struct tcp_seq_afinfo {
1407 char *name; 1409 char *name;
1408 sa_family_t family; 1410 sa_family_t family;
1409 struct file_operations seq_fops; 1411 const struct file_operations *seq_fops;
1410 struct seq_operations seq_ops; 1412 struct seq_operations seq_ops;
1411}; 1413};
1412 1414
1413struct tcp_iter_state { 1415struct tcp_iter_state {
diff --git a/include/net/udp.h b/include/net/udp.h
index 67ea6fcb3ec0..3b285f402f48 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -230,12 +230,14 @@ extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *sadd
230#endif 230#endif
231 231
232/* /proc */ 232/* /proc */
233int udp_seq_open(struct inode *inode, struct file *file);
234
233struct udp_seq_afinfo { 235struct udp_seq_afinfo {
234 char *name; 236 char *name;
235 sa_family_t family; 237 sa_family_t family;
236 struct udp_table *udp_table; 238 struct udp_table *udp_table;
237 struct file_operations seq_fops; 239 const struct file_operations *seq_fops;
238 struct seq_operations seq_ops; 240 struct seq_operations seq_ops;
239}; 241};
240 242
241struct udp_iter_state { 243struct udp_iter_state {
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index fe5b05177a2c..81aba3a73aa3 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -81,7 +81,11 @@ enum {
81 IB_USER_VERBS_CMD_MODIFY_SRQ, 81 IB_USER_VERBS_CMD_MODIFY_SRQ,
82 IB_USER_VERBS_CMD_QUERY_SRQ, 82 IB_USER_VERBS_CMD_QUERY_SRQ,
83 IB_USER_VERBS_CMD_DESTROY_SRQ, 83 IB_USER_VERBS_CMD_DESTROY_SRQ,
84 IB_USER_VERBS_CMD_POST_SRQ_RECV 84 IB_USER_VERBS_CMD_POST_SRQ_RECV,
85 IB_USER_VERBS_CMD_OPEN_XRCD,
86 IB_USER_VERBS_CMD_CLOSE_XRCD,
87 IB_USER_VERBS_CMD_CREATE_XSRQ,
88 IB_USER_VERBS_CMD_OPEN_QP
85}; 89};
86 90
87/* 91/*
@@ -222,6 +226,21 @@ struct ib_uverbs_dealloc_pd {
222 __u32 pd_handle; 226 __u32 pd_handle;
223}; 227};
224 228
229struct ib_uverbs_open_xrcd {
230 __u64 response;
231 __u32 fd;
232 __u32 oflags;
233 __u64 driver_data[0];
234};
235
236struct ib_uverbs_open_xrcd_resp {
237 __u32 xrcd_handle;
238};
239
240struct ib_uverbs_close_xrcd {
241 __u32 xrcd_handle;
242};
243
225struct ib_uverbs_reg_mr { 244struct ib_uverbs_reg_mr {
226 __u64 response; 245 __u64 response;
227 __u64 start; 246 __u64 start;
@@ -404,6 +423,17 @@ struct ib_uverbs_create_qp {
404 __u64 driver_data[0]; 423 __u64 driver_data[0];
405}; 424};
406 425
426struct ib_uverbs_open_qp {
427 __u64 response;
428 __u64 user_handle;
429 __u32 pd_handle;
430 __u32 qpn;
431 __u8 qp_type;
432 __u8 reserved[7];
433 __u64 driver_data[0];
434};
435
436/* also used for open response */
407struct ib_uverbs_create_qp_resp { 437struct ib_uverbs_create_qp_resp {
408 __u32 qp_handle; 438 __u32 qp_handle;
409 __u32 qpn; 439 __u32 qpn;
@@ -648,11 +678,25 @@ struct ib_uverbs_create_srq {
648 __u64 driver_data[0]; 678 __u64 driver_data[0];
649}; 679};
650 680
681struct ib_uverbs_create_xsrq {
682 __u64 response;
683 __u64 user_handle;
684 __u32 srq_type;
685 __u32 pd_handle;
686 __u32 max_wr;
687 __u32 max_sge;
688 __u32 srq_limit;
689 __u32 reserved;
690 __u32 xrcd_handle;
691 __u32 cq_handle;
692 __u64 driver_data[0];
693};
694
651struct ib_uverbs_create_srq_resp { 695struct ib_uverbs_create_srq_resp {
652 __u32 srq_handle; 696 __u32 srq_handle;
653 __u32 max_wr; 697 __u32 max_wr;
654 __u32 max_sge; 698 __u32 max_sge;
655 __u32 reserved; 699 __u32 srqn;
656}; 700};
657 701
658struct ib_uverbs_modify_srq { 702struct ib_uverbs_modify_srq {
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 228be3e220d9..bf5daafe8ecc 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -112,6 +112,7 @@ enum ib_device_cap_flags {
112 */ 112 */
113 IB_DEVICE_UD_IP_CSUM = (1<<18), 113 IB_DEVICE_UD_IP_CSUM = (1<<18),
114 IB_DEVICE_UD_TSO = (1<<19), 114 IB_DEVICE_UD_TSO = (1<<19),
115 IB_DEVICE_XRC = (1<<20),
115 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), 116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21),
116 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), 117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22),
117}; 118};
@@ -207,6 +208,7 @@ enum ib_port_cap_flags {
207 IB_PORT_SM_DISABLED = 1 << 10, 208 IB_PORT_SM_DISABLED = 1 << 10,
208 IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11, 209 IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11,
209 IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12, 210 IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
211 IB_PORT_EXTENDED_SPEEDS_SUP = 1 << 14,
210 IB_PORT_CM_SUP = 1 << 16, 212 IB_PORT_CM_SUP = 1 << 16,
211 IB_PORT_SNMP_TUNNEL_SUP = 1 << 17, 213 IB_PORT_SNMP_TUNNEL_SUP = 1 << 17,
212 IB_PORT_REINIT_SUP = 1 << 18, 214 IB_PORT_REINIT_SUP = 1 << 18,
@@ -415,7 +417,15 @@ enum ib_rate {
415 IB_RATE_40_GBPS = 7, 417 IB_RATE_40_GBPS = 7,
416 IB_RATE_60_GBPS = 8, 418 IB_RATE_60_GBPS = 8,
417 IB_RATE_80_GBPS = 9, 419 IB_RATE_80_GBPS = 9,
418 IB_RATE_120_GBPS = 10 420 IB_RATE_120_GBPS = 10,
421 IB_RATE_14_GBPS = 11,
422 IB_RATE_56_GBPS = 12,
423 IB_RATE_112_GBPS = 13,
424 IB_RATE_168_GBPS = 14,
425 IB_RATE_25_GBPS = 15,
426 IB_RATE_100_GBPS = 16,
427 IB_RATE_200_GBPS = 17,
428 IB_RATE_300_GBPS = 18
419}; 429};
420 430
421/** 431/**
@@ -427,6 +437,13 @@ enum ib_rate {
427int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; 437int ib_rate_to_mult(enum ib_rate rate) __attribute_const__;
428 438
429/** 439/**
440 * ib_rate_to_mbps - Convert the IB rate enum to Mbps.
441 * For example, IB_RATE_2_5_GBPS will be converted to 2500.
442 * @rate: rate to convert.
443 */
444int ib_rate_to_mbps(enum ib_rate rate) __attribute_const__;
445
446/**
430 * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate 447 * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate
431 * enum. 448 * enum.
432 * @mult: multiple to convert. 449 * @mult: multiple to convert.
@@ -522,6 +539,11 @@ enum ib_cq_notify_flags {
522 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2, 539 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2,
523}; 540};
524 541
542enum ib_srq_type {
543 IB_SRQT_BASIC,
544 IB_SRQT_XRC
545};
546
525enum ib_srq_attr_mask { 547enum ib_srq_attr_mask {
526 IB_SRQ_MAX_WR = 1 << 0, 548 IB_SRQ_MAX_WR = 1 << 0,
527 IB_SRQ_LIMIT = 1 << 1, 549 IB_SRQ_LIMIT = 1 << 1,
@@ -537,6 +559,14 @@ struct ib_srq_init_attr {
537 void (*event_handler)(struct ib_event *, void *); 559 void (*event_handler)(struct ib_event *, void *);
538 void *srq_context; 560 void *srq_context;
539 struct ib_srq_attr attr; 561 struct ib_srq_attr attr;
562 enum ib_srq_type srq_type;
563
564 union {
565 struct {
566 struct ib_xrcd *xrcd;
567 struct ib_cq *cq;
568 } xrc;
569 } ext;
540}; 570};
541 571
542struct ib_qp_cap { 572struct ib_qp_cap {
@@ -565,7 +595,11 @@ enum ib_qp_type {
565 IB_QPT_UC, 595 IB_QPT_UC,
566 IB_QPT_UD, 596 IB_QPT_UD,
567 IB_QPT_RAW_IPV6, 597 IB_QPT_RAW_IPV6,
568 IB_QPT_RAW_ETHERTYPE 598 IB_QPT_RAW_ETHERTYPE,
599 /* Save 8 for RAW_PACKET */
600 IB_QPT_XRC_INI = 9,
601 IB_QPT_XRC_TGT,
602 IB_QPT_MAX
569}; 603};
570 604
571enum ib_qp_create_flags { 605enum ib_qp_create_flags {
@@ -579,6 +613,7 @@ struct ib_qp_init_attr {
579 struct ib_cq *send_cq; 613 struct ib_cq *send_cq;
580 struct ib_cq *recv_cq; 614 struct ib_cq *recv_cq;
581 struct ib_srq *srq; 615 struct ib_srq *srq;
616 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
582 struct ib_qp_cap cap; 617 struct ib_qp_cap cap;
583 enum ib_sig_type sq_sig_type; 618 enum ib_sig_type sq_sig_type;
584 enum ib_qp_type qp_type; 619 enum ib_qp_type qp_type;
@@ -586,6 +621,13 @@ struct ib_qp_init_attr {
586 u8 port_num; /* special QP types only */ 621 u8 port_num; /* special QP types only */
587}; 622};
588 623
624struct ib_qp_open_attr {
625 void (*event_handler)(struct ib_event *, void *);
626 void *qp_context;
627 u32 qp_num;
628 enum ib_qp_type qp_type;
629};
630
589enum ib_rnr_timeout { 631enum ib_rnr_timeout {
590 IB_RNR_TIMER_655_36 = 0, 632 IB_RNR_TIMER_655_36 = 0,
591 IB_RNR_TIMER_000_01 = 1, 633 IB_RNR_TIMER_000_01 = 1,
@@ -770,6 +812,7 @@ struct ib_send_wr {
770 u32 rkey; 812 u32 rkey;
771 } fast_reg; 813 } fast_reg;
772 } wr; 814 } wr;
815 u32 xrc_remote_srq_num; /* XRC TGT QPs only */
773}; 816};
774 817
775struct ib_recv_wr { 818struct ib_recv_wr {
@@ -831,6 +874,7 @@ struct ib_ucontext {
831 struct list_head qp_list; 874 struct list_head qp_list;
832 struct list_head srq_list; 875 struct list_head srq_list;
833 struct list_head ah_list; 876 struct list_head ah_list;
877 struct list_head xrcd_list;
834 int closing; 878 int closing;
835}; 879};
836 880
@@ -858,6 +902,15 @@ struct ib_pd {
858 atomic_t usecnt; /* count all resources */ 902 atomic_t usecnt; /* count all resources */
859}; 903};
860 904
905struct ib_xrcd {
906 struct ib_device *device;
907 atomic_t usecnt; /* count all exposed resources */
908 struct inode *inode;
909
910 struct mutex tgt_qp_mutex;
911 struct list_head tgt_qp_list;
912};
913
861struct ib_ah { 914struct ib_ah {
862 struct ib_device *device; 915 struct ib_device *device;
863 struct ib_pd *pd; 916 struct ib_pd *pd;
@@ -882,7 +935,16 @@ struct ib_srq {
882 struct ib_uobject *uobject; 935 struct ib_uobject *uobject;
883 void (*event_handler)(struct ib_event *, void *); 936 void (*event_handler)(struct ib_event *, void *);
884 void *srq_context; 937 void *srq_context;
938 enum ib_srq_type srq_type;
885 atomic_t usecnt; 939 atomic_t usecnt;
940
941 union {
942 struct {
943 struct ib_xrcd *xrcd;
944 struct ib_cq *cq;
945 u32 srq_num;
946 } xrc;
947 } ext;
886}; 948};
887 949
888struct ib_qp { 950struct ib_qp {
@@ -891,6 +953,11 @@ struct ib_qp {
891 struct ib_cq *send_cq; 953 struct ib_cq *send_cq;
892 struct ib_cq *recv_cq; 954 struct ib_cq *recv_cq;
893 struct ib_srq *srq; 955 struct ib_srq *srq;
956 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
957 struct list_head xrcd_list;
958 atomic_t usecnt; /* count times opened */
959 struct list_head open_list;
960 struct ib_qp *real_qp;
894 struct ib_uobject *uobject; 961 struct ib_uobject *uobject;
895 void (*event_handler)(struct ib_event *, void *); 962 void (*event_handler)(struct ib_event *, void *);
896 void *qp_context; 963 void *qp_context;
@@ -1149,6 +1216,10 @@ struct ib_device {
1149 struct ib_grh *in_grh, 1216 struct ib_grh *in_grh,
1150 struct ib_mad *in_mad, 1217 struct ib_mad *in_mad,
1151 struct ib_mad *out_mad); 1218 struct ib_mad *out_mad);
1219 struct ib_xrcd * (*alloc_xrcd)(struct ib_device *device,
1220 struct ib_ucontext *ucontext,
1221 struct ib_udata *udata);
1222 int (*dealloc_xrcd)(struct ib_xrcd *xrcd);
1152 1223
1153 struct ib_dma_mapping_ops *dma_ops; 1224 struct ib_dma_mapping_ops *dma_ops;
1154 1225
@@ -1443,6 +1514,25 @@ int ib_query_qp(struct ib_qp *qp,
1443int ib_destroy_qp(struct ib_qp *qp); 1514int ib_destroy_qp(struct ib_qp *qp);
1444 1515
1445/** 1516/**
1517 * ib_open_qp - Obtain a reference to an existing sharable QP.
1518 * @xrcd - XRC domain
1519 * @qp_open_attr: Attributes identifying the QP to open.
1520 *
1521 * Returns a reference to a sharable QP.
1522 */
1523struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
1524 struct ib_qp_open_attr *qp_open_attr);
1525
1526/**
1527 * ib_close_qp - Release an external reference to a QP.
1528 * @qp: The QP handle to release
1529 *
1530 * The opened QP handle is released by the caller. The underlying
1531 * shared QP is not destroyed until all internal references are released.
1532 */
1533int ib_close_qp(struct ib_qp *qp);
1534
1535/**
1446 * ib_post_send - Posts a list of work requests to the send queue of 1536 * ib_post_send - Posts a list of work requests to the send queue of
1447 * the specified QP. 1537 * the specified QP.
1448 * @qp: The QP to post the work request on. 1538 * @qp: The QP to post the work request on.
@@ -2060,4 +2150,16 @@ int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
2060 */ 2150 */
2061int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid); 2151int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
2062 2152
2153/**
2154 * ib_alloc_xrcd - Allocates an XRC domain.
2155 * @device: The device on which to allocate the XRC domain.
2156 */
2157struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device);
2158
2159/**
2160 * ib_dealloc_xrcd - Deallocates an XRC domain.
2161 * @xrcd: The XRC domain to deallocate.
2162 */
2163int ib_dealloc_xrcd(struct ib_xrcd *xrcd);
2164
2063#endif /* IB_VERBS_H */ 2165#endif /* IB_VERBS_H */
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
index 2d0191c90f9e..1a046b1595cc 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
@@ -52,8 +52,10 @@ struct iw_cm_event {
52 struct sockaddr_in local_addr; 52 struct sockaddr_in local_addr;
53 struct sockaddr_in remote_addr; 53 struct sockaddr_in remote_addr;
54 void *private_data; 54 void *private_data;
55 u8 private_data_len;
56 void *provider_data; 55 void *provider_data;
56 u8 private_data_len;
57 u8 ord;
58 u8 ird;
57}; 59};
58 60
59/** 61/**
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index 26977c149c41..51988f808181 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -65,6 +65,7 @@ enum rdma_cm_event_type {
65enum rdma_port_space { 65enum rdma_port_space {
66 RDMA_PS_SDP = 0x0001, 66 RDMA_PS_SDP = 0x0001,
67 RDMA_PS_IPOIB = 0x0002, 67 RDMA_PS_IPOIB = 0x0002,
68 RDMA_PS_IB = 0x013F,
68 RDMA_PS_TCP = 0x0106, 69 RDMA_PS_TCP = 0x0106,
69 RDMA_PS_UDP = 0x0111, 70 RDMA_PS_UDP = 0x0111,
70}; 71};
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h
index fc82c1896f75..5348a000c8f3 100644
--- a/include/rdma/rdma_user_cm.h
+++ b/include/rdma/rdma_user_cm.h
@@ -77,7 +77,8 @@ struct rdma_ucm_create_id {
77 __u64 uid; 77 __u64 uid;
78 __u64 response; 78 __u64 response;
79 __u16 ps; 79 __u16 ps;
80 __u8 reserved[6]; 80 __u8 qp_type;
81 __u8 reserved[5];
81}; 82};
82 83
83struct rdma_ucm_create_id_resp { 84struct rdma_ucm_create_id_resp {
diff --git a/include/sound/core.h b/include/sound/core.h
index 91d513879a78..3be5ab782b99 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/module.h>
26#include <linux/sched.h> /* wake_up() */ 25#include <linux/sched.h> /* wake_up() */
27#include <linux/mutex.h> /* struct mutex */ 26#include <linux/mutex.h> /* struct mutex */
28#include <linux/rwsem.h> /* struct rw_semaphore */ 27#include <linux/rwsem.h> /* struct rw_semaphore */
@@ -43,6 +42,7 @@
43#ifdef CONFIG_PCI 42#ifdef CONFIG_PCI
44struct pci_dev; 43struct pci_dev;
45#endif 44#endif
45struct module;
46 46
47/* device allocation stuff */ 47/* device allocation stuff */
48 48
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 35aa786f93da..7f5fed3c89e1 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -89,7 +89,6 @@ enum transport_state_table {
89 TRANSPORT_PROCESS_TMR = 9, 89 TRANSPORT_PROCESS_TMR = 9,
90 TRANSPORT_ISTATE_PROCESSING = 11, 90 TRANSPORT_ISTATE_PROCESSING = 11,
91 TRANSPORT_NEW_CMD_MAP = 16, 91 TRANSPORT_NEW_CMD_MAP = 16,
92 TRANSPORT_FREE_CMD_INTR = 17,
93 TRANSPORT_COMPLETE_QF_WP = 18, 92 TRANSPORT_COMPLETE_QF_WP = 18,
94 TRANSPORT_COMPLETE_QF_OK = 19, 93 TRANSPORT_COMPLETE_QF_OK = 19,
95}; 94};
@@ -115,7 +114,6 @@ enum se_cmd_flags_table {
115 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, 114 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000,
116 SCF_UNUSED = 0x00100000, 115 SCF_UNUSED = 0x00100000,
117 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, 116 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
118 SCF_EMULATE_CDB_ASYNC = 0x01000000,
119}; 117};
120 118
121/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 119/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -426,6 +424,9 @@ struct se_cmd {
426 enum transport_state_table t_state; 424 enum transport_state_table t_state;
427 /* Transport specific error status */ 425 /* Transport specific error status */
428 int transport_error_status; 426 int transport_error_status;
427 /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */
428 int check_release:1;
429 int cmd_wait_set:1;
429 /* See se_cmd_flags_table */ 430 /* See se_cmd_flags_table */
430 u32 se_cmd_flags; 431 u32 se_cmd_flags;
431 u32 se_ordered_id; 432 u32 se_ordered_id;
@@ -452,8 +453,10 @@ struct se_cmd {
452 struct se_session *se_sess; 453 struct se_session *se_sess;
453 struct se_tmr_req *se_tmr_req; 454 struct se_tmr_req *se_tmr_req;
454 struct list_head se_queue_node; 455 struct list_head se_queue_node;
456 struct list_head se_cmd_list;
457 struct completion cmd_wait_comp;
455 struct target_core_fabric_ops *se_tfo; 458 struct target_core_fabric_ops *se_tfo;
456 int (*transport_emulate_cdb)(struct se_cmd *); 459 int (*execute_task)(struct se_task *);
457 void (*transport_complete_callback)(struct se_cmd *); 460 void (*transport_complete_callback)(struct se_cmd *);
458 461
459 unsigned char *t_task_cdb; 462 unsigned char *t_task_cdb;
@@ -559,12 +562,16 @@ struct se_node_acl {
559} ____cacheline_aligned; 562} ____cacheline_aligned;
560 563
561struct se_session { 564struct se_session {
565 int sess_tearing_down:1;
562 u64 sess_bin_isid; 566 u64 sess_bin_isid;
563 struct se_node_acl *se_node_acl; 567 struct se_node_acl *se_node_acl;
564 struct se_portal_group *se_tpg; 568 struct se_portal_group *se_tpg;
565 void *fabric_sess_ptr; 569 void *fabric_sess_ptr;
566 struct list_head sess_list; 570 struct list_head sess_list;
567 struct list_head sess_acl_list; 571 struct list_head sess_acl_list;
572 struct list_head sess_cmd_list;
573 struct list_head sess_wait_list;
574 spinlock_t sess_cmd_lock;
568} ____cacheline_aligned; 575} ____cacheline_aligned;
569 576
570struct se_device; 577struct se_device;
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h
index 46571912086c..2be31ff8763b 100644
--- a/include/target/target_core_device.h
+++ b/include/target/target_core_device.h
@@ -17,7 +17,7 @@ extern int core_dev_export(struct se_device *, struct se_portal_group *,
17 struct se_lun *); 17 struct se_lun *);
18extern void core_dev_unexport(struct se_device *, struct se_portal_group *, 18extern void core_dev_unexport(struct se_device *, struct se_portal_group *,
19 struct se_lun *); 19 struct se_lun *);
20extern int transport_core_report_lun_response(struct se_cmd *); 20extern int target_report_luns(struct se_task *);
21extern void se_release_device_for_hba(struct se_device *); 21extern void se_release_device_for_hba(struct se_device *);
22extern void se_release_vpd_for_dev(struct se_device *); 22extern void se_release_vpd_for_dev(struct se_device *);
23extern void se_clear_dev_ports(struct se_device *); 23extern void se_clear_dev_ports(struct se_device *);
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index 126c675f4f14..0256825f923d 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -46,9 +46,16 @@ struct target_core_fabric_ops {
46 int (*new_cmd_map)(struct se_cmd *); 46 int (*new_cmd_map)(struct se_cmd *);
47 /* 47 /*
48 * Optional to release struct se_cmd and fabric dependent allocated 48 * Optional to release struct se_cmd and fabric dependent allocated
49 * I/O descriptor in transport_cmd_check_stop() 49 * I/O descriptor in transport_cmd_check_stop().
50 *
51 * Returning 1 will signal a descriptor has been released.
52 * Returning 0 will signal a descriptor has not been released.
50 */ 53 */
51 void (*check_stop_free)(struct se_cmd *); 54 int (*check_stop_free)(struct se_cmd *);
55 /*
56 * Optional check for active I/O shutdown
57 */
58 int (*check_release_cmd)(struct se_cmd *);
52 void (*release_cmd)(struct se_cmd *); 59 void (*release_cmd)(struct se_cmd *);
53 /* 60 /*
54 * Called with spin_lock_bh(struct se_portal_group->session_lock held. 61 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
index a037a1a6fbba..c16e9431dd01 100644
--- a/include/target/target_core_transport.h
+++ b/include/target/target_core_transport.h
@@ -160,17 +160,20 @@ extern int transport_generic_handle_cdb_map(struct se_cmd *);
160extern int transport_generic_handle_data(struct se_cmd *); 160extern int transport_generic_handle_data(struct se_cmd *);
161extern void transport_new_cmd_failure(struct se_cmd *); 161extern void transport_new_cmd_failure(struct se_cmd *);
162extern int transport_generic_handle_tmr(struct se_cmd *); 162extern int transport_generic_handle_tmr(struct se_cmd *);
163extern void transport_generic_free_cmd_intr(struct se_cmd *);
164extern bool target_stop_task(struct se_task *task, unsigned long *flags); 163extern bool target_stop_task(struct se_task *task, unsigned long *flags);
165extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 164extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
166 struct scatterlist *, u32); 165 struct scatterlist *, u32);
167extern int transport_clear_lun_from_sessions(struct se_lun *); 166extern int transport_clear_lun_from_sessions(struct se_lun *);
168extern void transport_wait_for_tasks(struct se_cmd *); 167extern bool transport_wait_for_tasks(struct se_cmd *);
169extern int transport_check_aborted_status(struct se_cmd *, int); 168extern int transport_check_aborted_status(struct se_cmd *, int);
170extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 169extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
171extern void transport_send_task_abort(struct se_cmd *); 170extern void transport_send_task_abort(struct se_cmd *);
172extern void transport_release_cmd(struct se_cmd *); 171extern void transport_release_cmd(struct se_cmd *);
173extern void transport_generic_free_cmd(struct se_cmd *, int); 172extern void transport_generic_free_cmd(struct se_cmd *, int);
173extern void target_get_sess_cmd(struct se_session *, struct se_cmd *);
174extern int target_put_sess_cmd(struct se_session *, struct se_cmd *);
175extern void target_splice_sess_cmd_list(struct se_session *);
176extern void target_wait_for_sess_cmds(struct se_session *, int);
174extern void transport_generic_wait_for_cmds(struct se_cmd *, int); 177extern void transport_generic_wait_for_cmds(struct se_cmd *, int);
175extern void transport_do_task_sg_chain(struct se_cmd *); 178extern void transport_do_task_sg_chain(struct se_cmd *);
176extern void transport_generic_process_write(struct se_cmd *); 179extern void transport_generic_process_write(struct se_cmd *);
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index da39b22636f7..b0b4eb24d592 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -21,16 +21,6 @@
21#undef CREATE_TRACE_POINTS 21#undef CREATE_TRACE_POINTS
22 22
23#include <linux/stringify.h> 23#include <linux/stringify.h>
24/*
25 * module.h includes tracepoints, and because ftrace.h
26 * pulls in module.h:
27 * trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
28 * linux/ftrace.h -> linux/module.h
29 * we must include module.h here before we play with any of
30 * the TRACE_EVENT() macros, otherwise the tracepoints included
31 * by module.h may break the build.
32 */
33#include <linux/module.h>
34 24
35#undef TRACE_EVENT 25#undef TRACE_EVENT
36#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ 26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index b50a54736242..748ff7cbe555 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -9,9 +9,12 @@
9 9
10struct ext4_allocation_context; 10struct ext4_allocation_context;
11struct ext4_allocation_request; 11struct ext4_allocation_request;
12struct ext4_extent;
12struct ext4_prealloc_space; 13struct ext4_prealloc_space;
13struct ext4_inode_info; 14struct ext4_inode_info;
14struct mpage_da_data; 15struct mpage_da_data;
16struct ext4_map_blocks;
17struct ext4_extent;
15 18
16#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 19#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
17 20
@@ -1032,9 +1035,9 @@ TRACE_EVENT(ext4_forget,
1032); 1035);
1033 1036
1034TRACE_EVENT(ext4_da_update_reserve_space, 1037TRACE_EVENT(ext4_da_update_reserve_space,
1035 TP_PROTO(struct inode *inode, int used_blocks), 1038 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
1036 1039
1037 TP_ARGS(inode, used_blocks), 1040 TP_ARGS(inode, used_blocks, quota_claim),
1038 1041
1039 TP_STRUCT__entry( 1042 TP_STRUCT__entry(
1040 __field( dev_t, dev ) 1043 __field( dev_t, dev )
@@ -1045,6 +1048,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1045 __field( int, reserved_data_blocks ) 1048 __field( int, reserved_data_blocks )
1046 __field( int, reserved_meta_blocks ) 1049 __field( int, reserved_meta_blocks )
1047 __field( int, allocated_meta_blocks ) 1050 __field( int, allocated_meta_blocks )
1051 __field( int, quota_claim )
1048 ), 1052 ),
1049 1053
1050 TP_fast_assign( 1054 TP_fast_assign(
@@ -1053,19 +1057,24 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1053 __entry->mode = inode->i_mode; 1057 __entry->mode = inode->i_mode;
1054 __entry->i_blocks = inode->i_blocks; 1058 __entry->i_blocks = inode->i_blocks;
1055 __entry->used_blocks = used_blocks; 1059 __entry->used_blocks = used_blocks;
1056 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 1060 __entry->reserved_data_blocks =
1057 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1061 EXT4_I(inode)->i_reserved_data_blocks;
1058 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1062 __entry->reserved_meta_blocks =
1063 EXT4_I(inode)->i_reserved_meta_blocks;
1064 __entry->allocated_meta_blocks =
1065 EXT4_I(inode)->i_allocated_meta_blocks;
1066 __entry->quota_claim = quota_claim;
1059 ), 1067 ),
1060 1068
1061 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d " 1069 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1062 "reserved_data_blocks %d reserved_meta_blocks %d " 1070 "reserved_data_blocks %d reserved_meta_blocks %d "
1063 "allocated_meta_blocks %d", 1071 "allocated_meta_blocks %d quota_claim %d",
1064 MAJOR(__entry->dev), MINOR(__entry->dev), 1072 MAJOR(__entry->dev), MINOR(__entry->dev),
1065 (unsigned long) __entry->ino, 1073 (unsigned long) __entry->ino,
1066 __entry->mode, __entry->i_blocks, 1074 __entry->mode, __entry->i_blocks,
1067 __entry->used_blocks, __entry->reserved_data_blocks, 1075 __entry->used_blocks, __entry->reserved_data_blocks,
1068 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1076 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1077 __entry->quota_claim)
1069); 1078);
1070 1079
1071TRACE_EVENT(ext4_da_reserve_space, 1080TRACE_EVENT(ext4_da_reserve_space,
@@ -1386,6 +1395,87 @@ DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1386 TP_ARGS(inode) 1395 TP_ARGS(inode)
1387); 1396);
1388 1397
1398/* 'ux' is the uninitialized extent. */
1399TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1400 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1401 struct ext4_extent *ux),
1402
1403 TP_ARGS(inode, map, ux),
1404
1405 TP_STRUCT__entry(
1406 __field( ino_t, ino )
1407 __field( dev_t, dev )
1408 __field( ext4_lblk_t, m_lblk )
1409 __field( unsigned, m_len )
1410 __field( ext4_lblk_t, u_lblk )
1411 __field( unsigned, u_len )
1412 __field( ext4_fsblk_t, u_pblk )
1413 ),
1414
1415 TP_fast_assign(
1416 __entry->ino = inode->i_ino;
1417 __entry->dev = inode->i_sb->s_dev;
1418 __entry->m_lblk = map->m_lblk;
1419 __entry->m_len = map->m_len;
1420 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1421 __entry->u_len = ext4_ext_get_actual_len(ux);
1422 __entry->u_pblk = ext4_ext_pblock(ux);
1423 ),
1424
1425 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1426 "u_pblk %llu",
1427 MAJOR(__entry->dev), MINOR(__entry->dev),
1428 (unsigned long) __entry->ino,
1429 __entry->m_lblk, __entry->m_len,
1430 __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1431);
1432
1433/*
1434 * 'ux' is the uninitialized extent.
1435 * 'ix' is the initialized extent to which blocks are transferred.
1436 */
1437TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1438 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1439 struct ext4_extent *ux, struct ext4_extent *ix),
1440
1441 TP_ARGS(inode, map, ux, ix),
1442
1443 TP_STRUCT__entry(
1444 __field( ino_t, ino )
1445 __field( dev_t, dev )
1446 __field( ext4_lblk_t, m_lblk )
1447 __field( unsigned, m_len )
1448 __field( ext4_lblk_t, u_lblk )
1449 __field( unsigned, u_len )
1450 __field( ext4_fsblk_t, u_pblk )
1451 __field( ext4_lblk_t, i_lblk )
1452 __field( unsigned, i_len )
1453 __field( ext4_fsblk_t, i_pblk )
1454 ),
1455
1456 TP_fast_assign(
1457 __entry->ino = inode->i_ino;
1458 __entry->dev = inode->i_sb->s_dev;
1459 __entry->m_lblk = map->m_lblk;
1460 __entry->m_len = map->m_len;
1461 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1462 __entry->u_len = ext4_ext_get_actual_len(ux);
1463 __entry->u_pblk = ext4_ext_pblock(ux);
1464 __entry->i_lblk = le32_to_cpu(ix->ee_block);
1465 __entry->i_len = ext4_ext_get_actual_len(ix);
1466 __entry->i_pblk = ext4_ext_pblock(ix);
1467 ),
1468
1469 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1470 "u_lblk %u u_len %u u_pblk %llu "
1471 "i_lblk %u i_len %u i_pblk %llu ",
1472 MAJOR(__entry->dev), MINOR(__entry->dev),
1473 (unsigned long) __entry->ino,
1474 __entry->m_lblk, __entry->m_len,
1475 __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1476 __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1477);
1478
1389DECLARE_EVENT_CLASS(ext4__map_blocks_enter, 1479DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1390 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1480 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1391 unsigned int len, unsigned int flags), 1481 unsigned int len, unsigned int flags),
@@ -1589,6 +1679,382 @@ DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1589 TP_ARGS(sb, group, start, len) 1679 TP_ARGS(sb, group, start, len)
1590); 1680);
1591 1681
1682TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
1683 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1684 unsigned int allocated, ext4_fsblk_t newblock),
1685
1686 TP_ARGS(inode, map, allocated, newblock),
1687
1688 TP_STRUCT__entry(
1689 __field( ino_t, ino )
1690 __field( dev_t, dev )
1691 __field( ext4_lblk_t, lblk )
1692 __field( ext4_fsblk_t, pblk )
1693 __field( unsigned int, len )
1694 __field( int, flags )
1695 __field( unsigned int, allocated )
1696 __field( ext4_fsblk_t, newblk )
1697 ),
1698
1699 TP_fast_assign(
1700 __entry->ino = inode->i_ino;
1701 __entry->dev = inode->i_sb->s_dev;
1702 __entry->lblk = map->m_lblk;
1703 __entry->pblk = map->m_pblk;
1704 __entry->len = map->m_len;
1705 __entry->flags = map->m_flags;
1706 __entry->allocated = allocated;
1707 __entry->newblk = newblock;
1708 ),
1709
1710 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %d"
1711 "allocated %d newblock %llu",
1712 MAJOR(__entry->dev), MINOR(__entry->dev),
1713 (unsigned long) __entry->ino,
1714 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1715 __entry->len, __entry->flags,
1716 (unsigned int) __entry->allocated,
1717 (unsigned long long) __entry->newblk)
1718);
1719
1720TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1721 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1722
1723 TP_ARGS(sb, map, ret),
1724
1725 TP_STRUCT__entry(
1726 __field( dev_t, dev )
1727 __field( ext4_lblk_t, lblk )
1728 __field( ext4_fsblk_t, pblk )
1729 __field( unsigned int, len )
1730 __field( unsigned int, flags )
1731 __field( int, ret )
1732 ),
1733
1734 TP_fast_assign(
1735 __entry->dev = sb->s_dev;
1736 __entry->lblk = map->m_lblk;
1737 __entry->pblk = map->m_pblk;
1738 __entry->len = map->m_len;
1739 __entry->flags = map->m_flags;
1740 __entry->ret = ret;
1741 ),
1742
1743 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d",
1744 MAJOR(__entry->dev), MINOR(__entry->dev),
1745 __entry->lblk, (unsigned long long) __entry->pblk,
1746 __entry->len, __entry->flags, __entry->ret)
1747);
1748
1749TRACE_EVENT(ext4_ext_put_in_cache,
1750 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1751 ext4_fsblk_t start),
1752
1753 TP_ARGS(inode, lblk, len, start),
1754
1755 TP_STRUCT__entry(
1756 __field( ino_t, ino )
1757 __field( dev_t, dev )
1758 __field( ext4_lblk_t, lblk )
1759 __field( unsigned int, len )
1760 __field( ext4_fsblk_t, start )
1761 ),
1762
1763 TP_fast_assign(
1764 __entry->ino = inode->i_ino;
1765 __entry->dev = inode->i_sb->s_dev;
1766 __entry->lblk = lblk;
1767 __entry->len = len;
1768 __entry->start = start;
1769 ),
1770
1771 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1772 MAJOR(__entry->dev), MINOR(__entry->dev),
1773 (unsigned long) __entry->ino,
1774 (unsigned) __entry->lblk,
1775 __entry->len,
1776 (unsigned long long) __entry->start)
1777);
1778
1779TRACE_EVENT(ext4_ext_in_cache,
1780 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1781
1782 TP_ARGS(inode, lblk, ret),
1783
1784 TP_STRUCT__entry(
1785 __field( ino_t, ino )
1786 __field( dev_t, dev )
1787 __field( ext4_lblk_t, lblk )
1788 __field( int, ret )
1789 ),
1790
1791 TP_fast_assign(
1792 __entry->ino = inode->i_ino;
1793 __entry->dev = inode->i_sb->s_dev;
1794 __entry->lblk = lblk;
1795 __entry->ret = ret;
1796 ),
1797
1798 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1799 MAJOR(__entry->dev), MINOR(__entry->dev),
1800 (unsigned long) __entry->ino,
1801 (unsigned) __entry->lblk,
1802 __entry->ret)
1803
1804);
1805
1806TRACE_EVENT(ext4_find_delalloc_range,
1807 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1808 int reverse, int found, ext4_lblk_t found_blk),
1809
1810 TP_ARGS(inode, from, to, reverse, found, found_blk),
1811
1812 TP_STRUCT__entry(
1813 __field( ino_t, ino )
1814 __field( dev_t, dev )
1815 __field( ext4_lblk_t, from )
1816 __field( ext4_lblk_t, to )
1817 __field( int, reverse )
1818 __field( int, found )
1819 __field( ext4_lblk_t, found_blk )
1820 ),
1821
1822 TP_fast_assign(
1823 __entry->ino = inode->i_ino;
1824 __entry->dev = inode->i_sb->s_dev;
1825 __entry->from = from;
1826 __entry->to = to;
1827 __entry->reverse = reverse;
1828 __entry->found = found;
1829 __entry->found_blk = found_blk;
1830 ),
1831
1832 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1833 "(blk = %u)",
1834 MAJOR(__entry->dev), MINOR(__entry->dev),
1835 (unsigned long) __entry->ino,
1836 (unsigned) __entry->from, (unsigned) __entry->to,
1837 __entry->reverse, __entry->found,
1838 (unsigned) __entry->found_blk)
1839);
1840
1841TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1842 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1843
1844 TP_ARGS(inode, lblk, len),
1845
1846 TP_STRUCT__entry(
1847 __field( ino_t, ino )
1848 __field( dev_t, dev )
1849 __field( ext4_lblk_t, lblk )
1850 __field( unsigned int, len )
1851 ),
1852
1853 TP_fast_assign(
1854 __entry->ino = inode->i_ino;
1855 __entry->dev = inode->i_sb->s_dev;
1856 __entry->lblk = lblk;
1857 __entry->len = len;
1858 ),
1859
1860 TP_printk("dev %d,%d ino %lu lblk %u len %u",
1861 MAJOR(__entry->dev), MINOR(__entry->dev),
1862 (unsigned long) __entry->ino,
1863 (unsigned) __entry->lblk,
1864 __entry->len)
1865);
1866
1867TRACE_EVENT(ext4_ext_show_extent,
1868 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
1869 unsigned short len),
1870
1871 TP_ARGS(inode, lblk, pblk, len),
1872
1873 TP_STRUCT__entry(
1874 __field( ino_t, ino )
1875 __field( dev_t, dev )
1876 __field( ext4_lblk_t, lblk )
1877 __field( ext4_fsblk_t, pblk )
1878 __field( unsigned short, len )
1879 ),
1880
1881 TP_fast_assign(
1882 __entry->ino = inode->i_ino;
1883 __entry->dev = inode->i_sb->s_dev;
1884 __entry->lblk = lblk;
1885 __entry->pblk = pblk;
1886 __entry->len = len;
1887 ),
1888
1889 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
1890 MAJOR(__entry->dev), MINOR(__entry->dev),
1891 (unsigned long) __entry->ino,
1892 (unsigned) __entry->lblk,
1893 (unsigned long long) __entry->pblk,
1894 (unsigned short) __entry->len)
1895);
1896
1897TRACE_EVENT(ext4_remove_blocks,
1898 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
1899 ext4_lblk_t from, ext4_fsblk_t to,
1900 ext4_fsblk_t partial_cluster),
1901
1902 TP_ARGS(inode, ex, from, to, partial_cluster),
1903
1904 TP_STRUCT__entry(
1905 __field( ino_t, ino )
1906 __field( dev_t, dev )
1907 __field( ext4_lblk_t, ee_lblk )
1908 __field( ext4_fsblk_t, ee_pblk )
1909 __field( unsigned short, ee_len )
1910 __field( ext4_lblk_t, from )
1911 __field( ext4_lblk_t, to )
1912 __field( ext4_fsblk_t, partial )
1913 ),
1914
1915 TP_fast_assign(
1916 __entry->ino = inode->i_ino;
1917 __entry->dev = inode->i_sb->s_dev;
1918 __entry->ee_lblk = cpu_to_le32(ex->ee_block);
1919 __entry->ee_pblk = ext4_ext_pblock(ex);
1920 __entry->ee_len = ext4_ext_get_actual_len(ex);
1921 __entry->from = from;
1922 __entry->to = to;
1923 __entry->partial = partial_cluster;
1924 ),
1925
1926 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
1927 "from %u to %u partial_cluster %u",
1928 MAJOR(__entry->dev), MINOR(__entry->dev),
1929 (unsigned long) __entry->ino,
1930 (unsigned) __entry->ee_lblk,
1931 (unsigned long long) __entry->ee_pblk,
1932 (unsigned short) __entry->ee_len,
1933 (unsigned) __entry->from,
1934 (unsigned) __entry->to,
1935 (unsigned) __entry->partial)
1936);
1937
1938TRACE_EVENT(ext4_ext_rm_leaf,
1939 TP_PROTO(struct inode *inode, ext4_lblk_t start,
1940 struct ext4_extent *ex, ext4_fsblk_t partial_cluster),
1941
1942 TP_ARGS(inode, start, ex, partial_cluster),
1943
1944 TP_STRUCT__entry(
1945 __field( ino_t, ino )
1946 __field( dev_t, dev )
1947 __field( ext4_lblk_t, start )
1948 __field( ext4_lblk_t, ee_lblk )
1949 __field( ext4_fsblk_t, ee_pblk )
1950 __field( short, ee_len )
1951 __field( ext4_fsblk_t, partial )
1952 ),
1953
1954 TP_fast_assign(
1955 __entry->ino = inode->i_ino;
1956 __entry->dev = inode->i_sb->s_dev;
1957 __entry->start = start;
1958 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
1959 __entry->ee_pblk = ext4_ext_pblock(ex);
1960 __entry->ee_len = ext4_ext_get_actual_len(ex);
1961 __entry->partial = partial_cluster;
1962 ),
1963
1964 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
1965 "partial_cluster %u",
1966 MAJOR(__entry->dev), MINOR(__entry->dev),
1967 (unsigned long) __entry->ino,
1968 (unsigned) __entry->start,
1969 (unsigned) __entry->ee_lblk,
1970 (unsigned long long) __entry->ee_pblk,
1971 (unsigned short) __entry->ee_len,
1972 (unsigned) __entry->partial)
1973);
1974
1975TRACE_EVENT(ext4_ext_rm_idx,
1976 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
1977
1978 TP_ARGS(inode, pblk),
1979
1980 TP_STRUCT__entry(
1981 __field( ino_t, ino )
1982 __field( dev_t, dev )
1983 __field( ext4_fsblk_t, pblk )
1984 ),
1985
1986 TP_fast_assign(
1987 __entry->ino = inode->i_ino;
1988 __entry->dev = inode->i_sb->s_dev;
1989 __entry->pblk = pblk;
1990 ),
1991
1992 TP_printk("dev %d,%d ino %lu index_pblk %llu",
1993 MAJOR(__entry->dev), MINOR(__entry->dev),
1994 (unsigned long) __entry->ino,
1995 (unsigned long long) __entry->pblk)
1996);
1997
1998TRACE_EVENT(ext4_ext_remove_space,
1999 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth),
2000
2001 TP_ARGS(inode, start, depth),
2002
2003 TP_STRUCT__entry(
2004 __field( ino_t, ino )
2005 __field( dev_t, dev )
2006 __field( ext4_lblk_t, start )
2007 __field( int, depth )
2008 ),
2009
2010 TP_fast_assign(
2011 __entry->ino = inode->i_ino;
2012 __entry->dev = inode->i_sb->s_dev;
2013 __entry->start = start;
2014 __entry->depth = depth;
2015 ),
2016
2017 TP_printk("dev %d,%d ino %lu since %u depth %d",
2018 MAJOR(__entry->dev), MINOR(__entry->dev),
2019 (unsigned long) __entry->ino,
2020 (unsigned) __entry->start,
2021 __entry->depth)
2022);
2023
2024TRACE_EVENT(ext4_ext_remove_space_done,
2025 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth,
2026 ext4_lblk_t partial, unsigned short eh_entries),
2027
2028 TP_ARGS(inode, start, depth, partial, eh_entries),
2029
2030 TP_STRUCT__entry(
2031 __field( ino_t, ino )
2032 __field( dev_t, dev )
2033 __field( ext4_lblk_t, start )
2034 __field( int, depth )
2035 __field( ext4_lblk_t, partial )
2036 __field( unsigned short, eh_entries )
2037 ),
2038
2039 TP_fast_assign(
2040 __entry->ino = inode->i_ino;
2041 __entry->dev = inode->i_sb->s_dev;
2042 __entry->start = start;
2043 __entry->depth = depth;
2044 __entry->partial = partial;
2045 __entry->eh_entries = eh_entries;
2046 ),
2047
2048 TP_printk("dev %d,%d ino %lu since %u depth %d partial %u "
2049 "remaining_entries %u",
2050 MAJOR(__entry->dev), MINOR(__entry->dev),
2051 (unsigned long) __entry->ino,
2052 (unsigned) __entry->start,
2053 __entry->depth,
2054 (unsigned) __entry->partial,
2055 (unsigned short) __entry->eh_entries)
2056);
2057
1592#endif /* _TRACE_EXT4_H */ 2058#endif /* _TRACE_EXT4_H */
1593 2059
1594/* This part must be outside protection */ 2060/* This part must be outside protection */
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index 21a546d27c0c..161932737416 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Because linux/module.h has tracepoints in the header, and ftrace.h 2 * Because linux/module.h has tracepoints in the header, and ftrace.h
3 * eventually includes this file, define_trace.h includes linux/module.h 3 * used to include this file, define_trace.h includes linux/module.h
4 * But we do not want the module.h to override the TRACE_SYSTEM macro 4 * But we do not want the module.h to override the TRACE_SYSTEM macro
5 * variable that define_trace.h is processing, so we only set it 5 * variable that define_trace.h is processing, so we only set it
6 * when module events are being processed, which would happen when 6 * when module events are being processed, which would happen when
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 5f172703eb4f..b99caa8b780c 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -34,6 +34,7 @@ DECLARE_EVENT_CLASS(writeback_work_class,
34 __field(int, for_kupdate) 34 __field(int, for_kupdate)
35 __field(int, range_cyclic) 35 __field(int, range_cyclic)
36 __field(int, for_background) 36 __field(int, for_background)
37 __field(int, reason)
37 ), 38 ),
38 TP_fast_assign( 39 TP_fast_assign(
39 strncpy(__entry->name, dev_name(bdi->dev), 32); 40 strncpy(__entry->name, dev_name(bdi->dev), 32);
@@ -43,16 +44,18 @@ DECLARE_EVENT_CLASS(writeback_work_class,
43 __entry->for_kupdate = work->for_kupdate; 44 __entry->for_kupdate = work->for_kupdate;
44 __entry->range_cyclic = work->range_cyclic; 45 __entry->range_cyclic = work->range_cyclic;
45 __entry->for_background = work->for_background; 46 __entry->for_background = work->for_background;
47 __entry->reason = work->reason;
46 ), 48 ),
47 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " 49 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d "
48 "kupdate=%d range_cyclic=%d background=%d", 50 "kupdate=%d range_cyclic=%d background=%d reason=%s",
49 __entry->name, 51 __entry->name,
50 MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), 52 MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev),
51 __entry->nr_pages, 53 __entry->nr_pages,
52 __entry->sync_mode, 54 __entry->sync_mode,
53 __entry->for_kupdate, 55 __entry->for_kupdate,
54 __entry->range_cyclic, 56 __entry->range_cyclic,
55 __entry->for_background 57 __entry->for_background,
58 wb_reason_name[__entry->reason]
56 ) 59 )
57); 60);
58#define DEFINE_WRITEBACK_WORK_EVENT(name) \ 61#define DEFINE_WRITEBACK_WORK_EVENT(name) \
@@ -104,30 +107,6 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
104DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); 107DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister);
105DEFINE_WRITEBACK_EVENT(writeback_thread_start); 108DEFINE_WRITEBACK_EVENT(writeback_thread_start);
106DEFINE_WRITEBACK_EVENT(writeback_thread_stop); 109DEFINE_WRITEBACK_EVENT(writeback_thread_stop);
107DEFINE_WRITEBACK_EVENT(balance_dirty_start);
108DEFINE_WRITEBACK_EVENT(balance_dirty_wait);
109
110TRACE_EVENT(balance_dirty_written,
111
112 TP_PROTO(struct backing_dev_info *bdi, int written),
113
114 TP_ARGS(bdi, written),
115
116 TP_STRUCT__entry(
117 __array(char, name, 32)
118 __field(int, written)
119 ),
120
121 TP_fast_assign(
122 strncpy(__entry->name, dev_name(bdi->dev), 32);
123 __entry->written = written;
124 ),
125
126 TP_printk("bdi %s written %d",
127 __entry->name,
128 __entry->written
129 )
130);
131 110
132DECLARE_EVENT_CLASS(wbc_class, 111DECLARE_EVENT_CLASS(wbc_class,
133 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), 112 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),
@@ -181,27 +160,31 @@ DEFINE_WBC_EVENT(wbc_writepage);
181 160
182TRACE_EVENT(writeback_queue_io, 161TRACE_EVENT(writeback_queue_io,
183 TP_PROTO(struct bdi_writeback *wb, 162 TP_PROTO(struct bdi_writeback *wb,
184 unsigned long *older_than_this, 163 struct wb_writeback_work *work,
185 int moved), 164 int moved),
186 TP_ARGS(wb, older_than_this, moved), 165 TP_ARGS(wb, work, moved),
187 TP_STRUCT__entry( 166 TP_STRUCT__entry(
188 __array(char, name, 32) 167 __array(char, name, 32)
189 __field(unsigned long, older) 168 __field(unsigned long, older)
190 __field(long, age) 169 __field(long, age)
191 __field(int, moved) 170 __field(int, moved)
171 __field(int, reason)
192 ), 172 ),
193 TP_fast_assign( 173 TP_fast_assign(
174 unsigned long *older_than_this = work->older_than_this;
194 strncpy(__entry->name, dev_name(wb->bdi->dev), 32); 175 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
195 __entry->older = older_than_this ? *older_than_this : 0; 176 __entry->older = older_than_this ? *older_than_this : 0;
196 __entry->age = older_than_this ? 177 __entry->age = older_than_this ?
197 (jiffies - *older_than_this) * 1000 / HZ : -1; 178 (jiffies - *older_than_this) * 1000 / HZ : -1;
198 __entry->moved = moved; 179 __entry->moved = moved;
180 __entry->reason = work->reason;
199 ), 181 ),
200 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d", 182 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s",
201 __entry->name, 183 __entry->name,
202 __entry->older, /* older_than_this in jiffies */ 184 __entry->older, /* older_than_this in jiffies */
203 __entry->age, /* older_than_this in relative milliseconds */ 185 __entry->age, /* older_than_this in relative milliseconds */
204 __entry->moved) 186 __entry->moved,
187 wb_reason_name[__entry->reason])
205); 188);
206 189
207TRACE_EVENT(global_dirty_state, 190TRACE_EVENT(global_dirty_state,
@@ -250,6 +233,124 @@ TRACE_EVENT(global_dirty_state,
250 ) 233 )
251); 234);
252 235
236#define KBps(x) ((x) << (PAGE_SHIFT - 10))
237
238TRACE_EVENT(bdi_dirty_ratelimit,
239
240 TP_PROTO(struct backing_dev_info *bdi,
241 unsigned long dirty_rate,
242 unsigned long task_ratelimit),
243
244 TP_ARGS(bdi, dirty_rate, task_ratelimit),
245
246 TP_STRUCT__entry(
247 __array(char, bdi, 32)
248 __field(unsigned long, write_bw)
249 __field(unsigned long, avg_write_bw)
250 __field(unsigned long, dirty_rate)
251 __field(unsigned long, dirty_ratelimit)
252 __field(unsigned long, task_ratelimit)
253 __field(unsigned long, balanced_dirty_ratelimit)
254 ),
255
256 TP_fast_assign(
257 strlcpy(__entry->bdi, dev_name(bdi->dev), 32);
258 __entry->write_bw = KBps(bdi->write_bandwidth);
259 __entry->avg_write_bw = KBps(bdi->avg_write_bandwidth);
260 __entry->dirty_rate = KBps(dirty_rate);
261 __entry->dirty_ratelimit = KBps(bdi->dirty_ratelimit);
262 __entry->task_ratelimit = KBps(task_ratelimit);
263 __entry->balanced_dirty_ratelimit =
264 KBps(bdi->balanced_dirty_ratelimit);
265 ),
266
267 TP_printk("bdi %s: "
268 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
269 "dirty_ratelimit=%lu task_ratelimit=%lu "
270 "balanced_dirty_ratelimit=%lu",
271 __entry->bdi,
272 __entry->write_bw, /* write bandwidth */
273 __entry->avg_write_bw, /* avg write bandwidth */
274 __entry->dirty_rate, /* bdi dirty rate */
275 __entry->dirty_ratelimit, /* base ratelimit */
276 __entry->task_ratelimit, /* ratelimit with position control */
277 __entry->balanced_dirty_ratelimit /* the balanced ratelimit */
278 )
279);
280
281TRACE_EVENT(balance_dirty_pages,
282
283 TP_PROTO(struct backing_dev_info *bdi,
284 unsigned long thresh,
285 unsigned long bg_thresh,
286 unsigned long dirty,
287 unsigned long bdi_thresh,
288 unsigned long bdi_dirty,
289 unsigned long dirty_ratelimit,
290 unsigned long task_ratelimit,
291 unsigned long dirtied,
292 long pause,
293 unsigned long start_time),
294
295 TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty,
296 dirty_ratelimit, task_ratelimit,
297 dirtied, pause, start_time),
298
299 TP_STRUCT__entry(
300 __array( char, bdi, 32)
301 __field(unsigned long, limit)
302 __field(unsigned long, setpoint)
303 __field(unsigned long, dirty)
304 __field(unsigned long, bdi_setpoint)
305 __field(unsigned long, bdi_dirty)
306 __field(unsigned long, dirty_ratelimit)
307 __field(unsigned long, task_ratelimit)
308 __field(unsigned int, dirtied)
309 __field(unsigned int, dirtied_pause)
310 __field(unsigned long, paused)
311 __field( long, pause)
312 ),
313
314 TP_fast_assign(
315 unsigned long freerun = (thresh + bg_thresh) / 2;
316 strlcpy(__entry->bdi, dev_name(bdi->dev), 32);
317
318 __entry->limit = global_dirty_limit;
319 __entry->setpoint = (global_dirty_limit + freerun) / 2;
320 __entry->dirty = dirty;
321 __entry->bdi_setpoint = __entry->setpoint *
322 bdi_thresh / (thresh + 1);
323 __entry->bdi_dirty = bdi_dirty;
324 __entry->dirty_ratelimit = KBps(dirty_ratelimit);
325 __entry->task_ratelimit = KBps(task_ratelimit);
326 __entry->dirtied = dirtied;
327 __entry->dirtied_pause = current->nr_dirtied_pause;
328 __entry->pause = pause * 1000 / HZ;
329 __entry->paused = (jiffies - start_time) * 1000 / HZ;
330 ),
331
332
333 TP_printk("bdi %s: "
334 "limit=%lu setpoint=%lu dirty=%lu "
335 "bdi_setpoint=%lu bdi_dirty=%lu "
336 "dirty_ratelimit=%lu task_ratelimit=%lu "
337 "dirtied=%u dirtied_pause=%u "
338 "paused=%lu pause=%ld",
339 __entry->bdi,
340 __entry->limit,
341 __entry->setpoint,
342 __entry->dirty,
343 __entry->bdi_setpoint,
344 __entry->bdi_dirty,
345 __entry->dirty_ratelimit,
346 __entry->task_ratelimit,
347 __entry->dirtied,
348 __entry->dirtied_pause,
349 __entry->paused, /* ms */
350 __entry->pause /* ms */
351 )
352);
353
253DECLARE_EVENT_CLASS(writeback_congest_waited_template, 354DECLARE_EVENT_CLASS(writeback_congest_waited_template,
254 355
255 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), 356 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index 6b99bfbd785d..11e2dfce42f8 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -43,7 +43,6 @@
43#include <xen/interface/grant_table.h> 43#include <xen/interface/grant_table.h>
44 44
45#include <asm/xen/hypervisor.h> 45#include <asm/xen/hypervisor.h>
46#include <asm/xen/grant_table.h>
47 46
48#include <xen/features.h> 47#include <xen/features.h>
49 48
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 3d5d6db864fe..9324488f23f0 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -57,6 +57,36 @@ typedef uint64_t blkif_sector_t;
57 * "feature-flush-cache" node! 57 * "feature-flush-cache" node!
58 */ 58 */
59#define BLKIF_OP_FLUSH_DISKCACHE 3 59#define BLKIF_OP_FLUSH_DISKCACHE 3
60
61/*
62 * Recognised only if "feature-discard" is present in backend xenbus info.
63 * The "feature-discard" node contains a boolean indicating whether trim
64 * (ATA) or unmap (SCSI) - conviently called discard requests are likely
65 * to succeed or fail. Either way, a discard request
66 * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
67 * the underlying block-device hardware. The boolean simply indicates whether
68 * or not it is worthwhile for the frontend to attempt discard requests.
69 * If a backend does not recognise BLKIF_OP_DISCARD, it should *not*
70 * create the "feature-discard" node!
71 *
72 * Discard operation is a request for the underlying block device to mark
73 * extents to be erased. However, discard does not guarantee that the blocks
74 * will be erased from the device - it is just a hint to the device
75 * controller that these blocks are no longer in use. What the device
76 * controller does with that information is left to the controller.
77 * Discard operations are passed with sector_number as the
78 * sector index to begin discard operations at and nr_sectors as the number of
79 * sectors to be discarded. The specified sectors should be discarded if the
80 * underlying block device supports trim (ATA) or unmap (SCSI) operations,
81 * or a BLKIF_RSP_EOPNOTSUPP should be returned.
82 * More information about trim/unmap operations at:
83 * http://t13.org/Documents/UploadedDocuments/docs2008/
84 * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc
85 * http://www.seagate.com/staticfiles/support/disc/manuals/
86 * Interface%20manuals/100293068c.pdf
87 */
88#define BLKIF_OP_DISCARD 5
89
60/* 90/*
61 * Maximum scatter/gather segments per request. 91 * Maximum scatter/gather segments per request.
62 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. 92 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE.
@@ -74,6 +104,11 @@ struct blkif_request_rw {
74 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 104 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
75}; 105};
76 106
107struct blkif_request_discard {
108 blkif_sector_t sector_number;
109 uint64_t nr_sectors;
110};
111
77struct blkif_request { 112struct blkif_request {
78 uint8_t operation; /* BLKIF_OP_??? */ 113 uint8_t operation; /* BLKIF_OP_??? */
79 uint8_t nr_segments; /* number of segments */ 114 uint8_t nr_segments; /* number of segments */
@@ -81,6 +116,7 @@ struct blkif_request {
81 uint64_t id; /* private guest value, echoed in resp */ 116 uint64_t id; /* private guest value, echoed in resp */
82 union { 117 union {
83 struct blkif_request_rw rw; 118 struct blkif_request_rw rw;
119 struct blkif_request_discard discard;
84 } u; 120 } u;
85}; 121};
86 122
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
new file mode 100644
index 000000000000..c1684680431b
--- /dev/null
+++ b/include/xen/interface/platform.h
@@ -0,0 +1,320 @@
1/******************************************************************************
2 * platform.h
3 *
4 * Hardware platform operations. Intended for use by domain-0 kernel.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Copyright (c) 2002-2006, K Fraser
25 */
26
27#ifndef __XEN_PUBLIC_PLATFORM_H__
28#define __XEN_PUBLIC_PLATFORM_H__
29
30#include "xen.h"
31
32#define XENPF_INTERFACE_VERSION 0x03000001
33
34/*
35 * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
36 * 1 January, 1970 if the current system time was <system_time>.
37 */
38#define XENPF_settime 17
39struct xenpf_settime {
40 /* IN variables. */
41 uint32_t secs;
42 uint32_t nsecs;
43 uint64_t system_time;
44};
45DEFINE_GUEST_HANDLE_STRUCT(xenpf_settime_t);
46
47/*
48 * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type.
49 * On x86, @type is an architecture-defined MTRR memory type.
50 * On success, returns the MTRR that was used (@reg) and a handle that can
51 * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting.
52 * (x86-specific).
53 */
54#define XENPF_add_memtype 31
55struct xenpf_add_memtype {
56 /* IN variables. */
57 unsigned long mfn;
58 uint64_t nr_mfns;
59 uint32_t type;
60 /* OUT variables. */
61 uint32_t handle;
62 uint32_t reg;
63};
64DEFINE_GUEST_HANDLE_STRUCT(xenpf_add_memtype_t);
65
66/*
67 * Tear down an existing memory-range type. If @handle is remembered then it
68 * should be passed in to accurately tear down the correct setting (in case
69 * of overlapping memory regions with differing types). If it is not known
70 * then @handle should be set to zero. In all cases @reg must be set.
71 * (x86-specific).
72 */
73#define XENPF_del_memtype 32
74struct xenpf_del_memtype {
75 /* IN variables. */
76 uint32_t handle;
77 uint32_t reg;
78};
79DEFINE_GUEST_HANDLE_STRUCT(xenpf_del_memtype_t);
80
81/* Read current type of an MTRR (x86-specific). */
82#define XENPF_read_memtype 33
83struct xenpf_read_memtype {
84 /* IN variables. */
85 uint32_t reg;
86 /* OUT variables. */
87 unsigned long mfn;
88 uint64_t nr_mfns;
89 uint32_t type;
90};
91DEFINE_GUEST_HANDLE_STRUCT(xenpf_read_memtype_t);
92
93#define XENPF_microcode_update 35
94struct xenpf_microcode_update {
95 /* IN variables. */
96 GUEST_HANDLE(void) data; /* Pointer to microcode data */
97 uint32_t length; /* Length of microcode data. */
98};
99DEFINE_GUEST_HANDLE_STRUCT(xenpf_microcode_update_t);
100
101#define XENPF_platform_quirk 39
102#define QUIRK_NOIRQBALANCING 1 /* Do not restrict IO-APIC RTE targets */
103#define QUIRK_IOAPIC_BAD_REGSEL 2 /* IO-APIC REGSEL forgets its value */
104#define QUIRK_IOAPIC_GOOD_REGSEL 3 /* IO-APIC REGSEL behaves properly */
105struct xenpf_platform_quirk {
106 /* IN variables. */
107 uint32_t quirk_id;
108};
109DEFINE_GUEST_HANDLE_STRUCT(xenpf_platform_quirk_t);
110
111#define XENPF_firmware_info 50
112#define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */
113#define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */
114#define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */
115struct xenpf_firmware_info {
116 /* IN variables. */
117 uint32_t type;
118 uint32_t index;
119 /* OUT variables. */
120 union {
121 struct {
122 /* Int13, Fn48: Check Extensions Present. */
123 uint8_t device; /* %dl: bios device number */
124 uint8_t version; /* %ah: major version */
125 uint16_t interface_support; /* %cx: support bitmap */
126 /* Int13, Fn08: Legacy Get Device Parameters. */
127 uint16_t legacy_max_cylinder; /* %cl[7:6]:%ch: max cyl # */
128 uint8_t legacy_max_head; /* %dh: max head # */
129 uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector # */
130 /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */
131 /* NB. First uint16_t of buffer must be set to buffer size. */
132 GUEST_HANDLE(void) edd_params;
133 } disk_info; /* XEN_FW_DISK_INFO */
134 struct {
135 uint8_t device; /* bios device number */
136 uint32_t mbr_signature; /* offset 0x1b8 in mbr */
137 } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */
138 struct {
139 /* Int10, AX=4F15: Get EDID info. */
140 uint8_t capabilities;
141 uint8_t edid_transfer_time;
142 /* must refer to 128-byte buffer */
143 GUEST_HANDLE(uchar) edid;
144 } vbeddc_info; /* XEN_FW_VBEDDC_INFO */
145 } u;
146};
147DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t);
148
149#define XENPF_enter_acpi_sleep 51
150struct xenpf_enter_acpi_sleep {
151 /* IN variables */
152 uint16_t pm1a_cnt_val; /* PM1a control value. */
153 uint16_t pm1b_cnt_val; /* PM1b control value. */
154 uint32_t sleep_state; /* Which state to enter (Sn). */
155 uint32_t flags; /* Must be zero. */
156};
157DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t);
158
159#define XENPF_change_freq 52
160struct xenpf_change_freq {
161 /* IN variables */
162 uint32_t flags; /* Must be zero. */
163 uint32_t cpu; /* Physical cpu. */
164 uint64_t freq; /* New frequency (Hz). */
165};
166DEFINE_GUEST_HANDLE_STRUCT(xenpf_change_freq_t);
167
168/*
169 * Get idle times (nanoseconds since boot) for physical CPUs specified in the
170 * @cpumap_bitmap with range [0..@cpumap_nr_cpus-1]. The @idletime array is
171 * indexed by CPU number; only entries with the corresponding @cpumap_bitmap
172 * bit set are written to. On return, @cpumap_bitmap is modified so that any
173 * non-existent CPUs are cleared. Such CPUs have their @idletime array entry
174 * cleared.
175 */
176#define XENPF_getidletime 53
177struct xenpf_getidletime {
178 /* IN/OUT variables */
179 /* IN: CPUs to interrogate; OUT: subset of IN which are present */
180 GUEST_HANDLE(uchar) cpumap_bitmap;
181 /* IN variables */
182 /* Size of cpumap bitmap. */
183 uint32_t cpumap_nr_cpus;
184 /* Must be indexable for every cpu in cpumap_bitmap. */
185 GUEST_HANDLE(uint64_t) idletime;
186 /* OUT variables */
187 /* System time when the idletime snapshots were taken. */
188 uint64_t now;
189};
190DEFINE_GUEST_HANDLE_STRUCT(xenpf_getidletime_t);
191
192#define XENPF_set_processor_pminfo 54
193
194/* ability bits */
195#define XEN_PROCESSOR_PM_CX 1
196#define XEN_PROCESSOR_PM_PX 2
197#define XEN_PROCESSOR_PM_TX 4
198
199/* cmd type */
200#define XEN_PM_CX 0
201#define XEN_PM_PX 1
202#define XEN_PM_TX 2
203
204/* Px sub info type */
205#define XEN_PX_PCT 1
206#define XEN_PX_PSS 2
207#define XEN_PX_PPC 4
208#define XEN_PX_PSD 8
209
210struct xen_power_register {
211 uint32_t space_id;
212 uint32_t bit_width;
213 uint32_t bit_offset;
214 uint32_t access_size;
215 uint64_t address;
216};
217
218struct xen_processor_csd {
219 uint32_t domain; /* domain number of one dependent group */
220 uint32_t coord_type; /* coordination type */
221 uint32_t num; /* number of processors in same domain */
222};
223DEFINE_GUEST_HANDLE_STRUCT(xen_processor_csd);
224
225struct xen_processor_cx {
226 struct xen_power_register reg; /* GAS for Cx trigger register */
227 uint8_t type; /* cstate value, c0: 0, c1: 1, ... */
228 uint32_t latency; /* worst latency (ms) to enter/exit this cstate */
229 uint32_t power; /* average power consumption(mW) */
230 uint32_t dpcnt; /* number of dependency entries */
231 GUEST_HANDLE(xen_processor_csd) dp; /* NULL if no dependency */
232};
233DEFINE_GUEST_HANDLE_STRUCT(xen_processor_cx);
234
235struct xen_processor_flags {
236 uint32_t bm_control:1;
237 uint32_t bm_check:1;
238 uint32_t has_cst:1;
239 uint32_t power_setup_done:1;
240 uint32_t bm_rld_set:1;
241};
242
243struct xen_processor_power {
244 uint32_t count; /* number of C state entries in array below */
245 struct xen_processor_flags flags; /* global flags of this processor */
246 GUEST_HANDLE(xen_processor_cx) states; /* supported c states */
247};
248
249struct xen_pct_register {
250 uint8_t descriptor;
251 uint16_t length;
252 uint8_t space_id;
253 uint8_t bit_width;
254 uint8_t bit_offset;
255 uint8_t reserved;
256 uint64_t address;
257};
258
259struct xen_processor_px {
260 uint64_t core_frequency; /* megahertz */
261 uint64_t power; /* milliWatts */
262 uint64_t transition_latency; /* microseconds */
263 uint64_t bus_master_latency; /* microseconds */
264 uint64_t control; /* control value */
265 uint64_t status; /* success indicator */
266};
267DEFINE_GUEST_HANDLE_STRUCT(xen_processor_px);
268
269struct xen_psd_package {
270 uint64_t num_entries;
271 uint64_t revision;
272 uint64_t domain;
273 uint64_t coord_type;
274 uint64_t num_processors;
275};
276
277struct xen_processor_performance {
278 uint32_t flags; /* flag for Px sub info type */
279 uint32_t platform_limit; /* Platform limitation on freq usage */
280 struct xen_pct_register control_register;
281 struct xen_pct_register status_register;
282 uint32_t state_count; /* total available performance states */
283 GUEST_HANDLE(xen_processor_px) states;
284 struct xen_psd_package domain_info;
285 uint32_t shared_type; /* coordination type of this processor */
286};
287DEFINE_GUEST_HANDLE_STRUCT(xen_processor_performance);
288
289struct xenpf_set_processor_pminfo {
290 /* IN variables */
291 uint32_t id; /* ACPI CPU ID */
292 uint32_t type; /* {XEN_PM_CX, XEN_PM_PX} */
293 union {
294 struct xen_processor_power power;/* Cx: _CST/_CSD */
295 struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */
296 };
297};
298DEFINE_GUEST_HANDLE_STRUCT(xenpf_set_processor_pminfo);
299
300struct xen_platform_op {
301 uint32_t cmd;
302 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
303 union {
304 struct xenpf_settime settime;
305 struct xenpf_add_memtype add_memtype;
306 struct xenpf_del_memtype del_memtype;
307 struct xenpf_read_memtype read_memtype;
308 struct xenpf_microcode_update microcode;
309 struct xenpf_platform_quirk platform_quirk;
310 struct xenpf_firmware_info firmware_info;
311 struct xenpf_enter_acpi_sleep enter_acpi_sleep;
312 struct xenpf_change_freq change_freq;
313 struct xenpf_getidletime getidletime;
314 struct xenpf_set_processor_pminfo set_pminfo;
315 uint8_t pad[128];
316 } u;
317};
318DEFINE_GUEST_HANDLE_STRUCT(xen_platform_op_t);
319
320#endif /* __XEN_PUBLIC_PLATFORM_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 6acd9cefd517..6a6e91449347 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -492,6 +492,7 @@ struct dom0_vga_console_info {
492/* These flags are passed in the 'flags' field of start_info_t. */ 492/* These flags are passed in the 'flags' field of start_info_t. */
493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ 493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ 494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
495#define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */
495 496
496typedef uint64_t cpumap_t; 497typedef uint64_t cpumap_t;
497 498
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index b9f9fb5af0d8..b1b6676c1c43 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -37,6 +37,7 @@
37#include <linux/device.h> 37#include <linux/device.h>
38#include <linux/notifier.h> 38#include <linux/notifier.h>
39#include <linux/mutex.h> 39#include <linux/mutex.h>
40#include <linux/export.h>
40#include <linux/completion.h> 41#include <linux/completion.h>
41#include <linux/init.h> 42#include <linux/init.h>
42#include <linux/slab.h> 43#include <linux/slab.h>