aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/gpio.h6
-rw-r--r--include/asm-generic/types.h6
-rw-r--r--include/drm/drmP.h2
-rw-r--r--include/linux/amba/pl022.h4
-rw-r--r--include/linux/amba/pl330.h15
-rw-r--r--include/linux/ata_platform.h3
-rw-r--r--include/linux/audit.h8
-rw-r--r--include/linux/cgroup.h33
-rw-r--r--include/linux/clk.h22
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/configfs.h2
-rw-r--r--include/linux/cordic.h4
-rw-r--r--include/linux/cpu.h18
-rw-r--r--include/linux/debugfs.h72
-rw-r--r--include/linux/device.h114
-rw-r--r--include/linux/dma-buf.h176
-rw-r--r--include/linux/edac.h8
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/freezer.h159
-rw-r--r--include/linux/fs.h107
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/gpio-pxa.h16
-rw-r--r--include/linux/hyperv.h2
-rw-r--r--include/linux/i2c.h13
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/init_task.h9
-rw-r--r--include/linux/ipc.h2
-rw-r--r--include/linux/iscsi_boot_sysfs.h8
-rw-r--r--include/linux/jbd.h5
-rw-r--r--include/linux/kmod.h2
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kref.h77
-rw-r--r--include/linux/kthread.h1
-rw-r--r--include/linux/mbus.h13
-rw-r--r--include/linux/memory.h3
-rw-r--r--include/linux/mfd/da9052/da9052.h131
-rw-r--r--include/linux/mfd/da9052/pdata.h40
-rw-r--r--include/linux/mfd/da9052/reg.h749
-rw-r--r--include/linux/miscdevice.h2
-rw-r--r--include/linux/mnt_namespace.h31
-rw-r--r--include/linux/mount.h39
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/linux/netfilter/x_tables.h4
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nls.h5
-rw-r--r--include/linux/node.h6
-rw-r--r--include/linux/of.h44
-rw-r--r--include/linux/of_fdt.h4
-rw-r--r--include/linux/of_gpio.h10
-rw-r--r--include/linux/percpu.h190
-rw-r--r--include/linux/platform_data/macb.h17
-rw-r--r--include/linux/platform_data/mv_usb.h18
-rw-r--r--include/linux/platform_data/s3c-hsudc.h34
-rw-r--r--include/linux/platform_device.h44
-rw-r--r--include/linux/pm.h15
-rw-r--r--include/linux/pm_domain.h103
-rw-r--r--include/linux/pm_qos.h8
-rw-r--r--include/linux/pm_runtime.h5
-rw-r--r--include/linux/proc_fs.h24
-rw-r--r--include/linux/raid/md_p.h7
-rw-r--r--include/linux/raid/pq.h2
-rw-r--r--include/linux/ramfs.h2
-rw-r--r--include/linux/regmap.h59
-rw-r--r--include/linux/reiserfs_fs.h9
-rw-r--r--include/linux/reiserfs_fs_sb.h4
-rw-r--r--include/linux/relay.h2
-rw-r--r--include/linux/sched.h77
-rw-r--r--include/linux/security.h66
-rw-r--r--include/linux/seq_file.h10
-rw-r--r--include/linux/serial_8250.h5
-rw-r--r--include/linux/serial_core.h100
-rw-r--r--include/linux/sh_intc.h1
-rw-r--r--include/linux/shmem_fs.h2
-rw-r--r--include/linux/slab_def.h2
-rw-r--r--include/linux/spi/spi.h11
-rw-r--r--include/linux/sunrpc/cache.h2
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/suspend.h35
-rw-r--r--include/linux/syscalls.h24
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/sysfs.h8
-rw-r--r--include/linux/types.h3
-rw-r--r--include/linux/usb.h28
-rw-r--r--include/linux/usb/ch11.h31
-rw-r--r--include/linux/usb/ch9.h20
-rw-r--r--include/linux/usb/gadget.h26
-rw-r--r--include/linux/usb/hcd.h2
-rw-r--r--include/linux/usb/renesas_usbhs.h10
-rw-r--r--include/linux/usb/serial.h11
-rw-r--r--include/linux/wanrouter.h2
-rw-r--r--include/media/davinci/vpif_types.h71
-rw-r--r--include/net/mac80211.h2
-rw-r--r--include/net/snmp.h14
-rw-r--r--include/rdma/ib_addr.h2
-rw-r--r--include/rdma/ib_cm.h3
-rw-r--r--include/scsi/scsi_transport_iscsi.h2
-rw-r--r--include/sound/info.h2
-rw-r--r--include/sound/saif.h4
-rw-r--r--include/trace/events/regmap.h9
-rw-r--r--include/xen/balloon.h6
100 files changed, 2275 insertions, 856 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 8c8621097fa0..d466c8d8826d 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -4,6 +4,7 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/errno.h> 6#include <linux/errno.h>
7#include <linux/of.h>
7 8
8#ifdef CONFIG_GPIOLIB 9#ifdef CONFIG_GPIOLIB
9 10
@@ -128,13 +129,14 @@ struct gpio_chip {
128 */ 129 */
129 struct device_node *of_node; 130 struct device_node *of_node;
130 int of_gpio_n_cells; 131 int of_gpio_n_cells;
131 int (*of_xlate)(struct gpio_chip *gc, struct device_node *np, 132 int (*of_xlate)(struct gpio_chip *gc,
132 const void *gpio_spec, u32 *flags); 133 const struct of_phandle_args *gpiospec, u32 *flags);
133#endif 134#endif
134}; 135};
135 136
136extern const char *gpiochip_is_requested(struct gpio_chip *chip, 137extern const char *gpiochip_is_requested(struct gpio_chip *chip,
137 unsigned offset); 138 unsigned offset);
139extern struct gpio_chip *gpio_to_chip(unsigned gpio);
138extern int __must_check gpiochip_reserve(int start, int ngpio); 140extern int __must_check gpiochip_reserve(int start, int ngpio);
139 141
140/* add/remove chips */ 142/* add/remove chips */
diff --git a/include/asm-generic/types.h b/include/asm-generic/types.h
index 7a0f69e6c618..bd39806013b5 100644
--- a/include/asm-generic/types.h
+++ b/include/asm-generic/types.h
@@ -6,10 +6,4 @@
6 */ 6 */
7#include <asm-generic/int-ll64.h> 7#include <asm-generic/int-ll64.h>
8 8
9#ifndef __ASSEMBLY__
10
11typedef unsigned short umode_t;
12
13#endif /* __ASSEMBLY__ */
14
15#endif /* _ASM_GENERIC_TYPES_H */ 9#endif /* _ASM_GENERIC_TYPES_H */
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 1f9e9516e2b7..e8acca892af0 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -820,7 +820,7 @@ struct drm_driver {
820 * Specifically, the timestamp in @vblank_time should correspond as 820 * Specifically, the timestamp in @vblank_time should correspond as
821 * closely as possible to the time when the first video scanline of 821 * closely as possible to the time when the first video scanline of
822 * the video frame after the end of VBLANK will start scanning out, 822 * the video frame after the end of VBLANK will start scanning out,
823 * the time immmediately after end of the VBLANK interval. If the 823 * the time immediately after end of the VBLANK interval. If the
824 * @crtc is currently inside VBLANK, this will be a time in the future. 824 * @crtc is currently inside VBLANK, this will be a time in the future.
825 * If the @crtc is currently scanning out a frame, this will be the 825 * If the @crtc is currently scanning out a frame, this will be the
826 * past start time of the current scanout. This is meant to adhere 826 * past start time of the current scanout. This is meant to adhere
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index 4ce98f54186b..572f637299c9 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -238,6 +238,9 @@ struct dma_chan;
238 * @enable_dma: if true enables DMA driven transfers. 238 * @enable_dma: if true enables DMA driven transfers.
239 * @dma_rx_param: parameter to locate an RX DMA channel. 239 * @dma_rx_param: parameter to locate an RX DMA channel.
240 * @dma_tx_param: parameter to locate a TX DMA channel. 240 * @dma_tx_param: parameter to locate a TX DMA channel.
241 * @autosuspend_delay: delay in ms following transfer completion before the
242 * runtime power management system suspends the device. A setting of 0
243 * indicates no delay and the device will be suspended immediately.
241 */ 244 */
242struct pl022_ssp_controller { 245struct pl022_ssp_controller {
243 u16 bus_id; 246 u16 bus_id;
@@ -246,6 +249,7 @@ struct pl022_ssp_controller {
246 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 249 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
247 void *dma_rx_param; 250 void *dma_rx_param;
248 void *dma_tx_param; 251 void *dma_tx_param;
252 int autosuspend_delay;
249}; 253};
250 254
251/** 255/**
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h
index d12f077a6daf..12e023c19ac1 100644
--- a/include/linux/amba/pl330.h
+++ b/include/linux/amba/pl330.h
@@ -12,17 +12,9 @@
12#ifndef __AMBA_PL330_H_ 12#ifndef __AMBA_PL330_H_
13#define __AMBA_PL330_H_ 13#define __AMBA_PL330_H_
14 14
15#include <linux/dmaengine.h>
15#include <asm/hardware/pl330.h> 16#include <asm/hardware/pl330.h>
16 17
17struct dma_pl330_peri {
18 /*
19 * Peri_Req i/f of the DMAC that is
20 * peripheral could be reached from.
21 */
22 u8 peri_id; /* specific dma id */
23 enum pl330_reqtype rqtype;
24};
25
26struct dma_pl330_platdata { 18struct dma_pl330_platdata {
27 /* 19 /*
28 * Number of valid peripherals connected to DMAC. 20 * Number of valid peripherals connected to DMAC.
@@ -33,9 +25,12 @@ struct dma_pl330_platdata {
33 */ 25 */
34 u8 nr_valid_peri; 26 u8 nr_valid_peri;
35 /* Array of valid peripherals */ 27 /* Array of valid peripherals */
36 struct dma_pl330_peri *peri; 28 u8 *peri_id;
29 /* Operational capabilities */
30 dma_cap_mask_t cap_mask;
37 /* Bytes to allocate for MC buffer */ 31 /* Bytes to allocate for MC buffer */
38 unsigned mcbuf_sz; 32 unsigned mcbuf_sz;
39}; 33};
40 34
35extern bool pl330_filter(struct dma_chan *chan, void *param);
41#endif /* __AMBA_PL330_H_ */ 36#endif /* __AMBA_PL330_H_ */
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index 9a26c83a2c9e..b856a2a590d9 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -27,10 +27,7 @@ extern int __devexit __pata_platform_remove(struct device *dev);
27/* 27/*
28 * Marvell SATA private data 28 * Marvell SATA private data
29 */ 29 */
30struct mbus_dram_target_info;
31
32struct mv_sata_platform_data { 30struct mv_sata_platform_data {
33 struct mbus_dram_target_info *dram;
34 int n_ports; /* number of sata ports */ 31 int n_ports; /* number of sata ports */
35}; 32};
36 33
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 2f81c6f3b630..426ab9f4dd85 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -468,13 +468,13 @@ extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
468#define audit_get_sessionid(t) ((t)->sessionid) 468#define audit_get_sessionid(t) ((t)->sessionid)
469extern void audit_log_task_context(struct audit_buffer *ab); 469extern void audit_log_task_context(struct audit_buffer *ab);
470extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); 470extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
471extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); 471extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
472extern int audit_bprm(struct linux_binprm *bprm); 472extern int audit_bprm(struct linux_binprm *bprm);
473extern void audit_socketcall(int nargs, unsigned long *args); 473extern void audit_socketcall(int nargs, unsigned long *args);
474extern int audit_sockaddr(int len, void *addr); 474extern int audit_sockaddr(int len, void *addr);
475extern void __audit_fd_pair(int fd1, int fd2); 475extern void __audit_fd_pair(int fd1, int fd2);
476extern int audit_set_macxattr(const char *name); 476extern int audit_set_macxattr(const char *name);
477extern void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr); 477extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr);
478extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); 478extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout);
479extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); 479extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification);
480extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); 480extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
@@ -494,12 +494,12 @@ static inline void audit_fd_pair(int fd1, int fd2)
494 if (unlikely(!audit_dummy_context())) 494 if (unlikely(!audit_dummy_context()))
495 __audit_fd_pair(fd1, fd2); 495 __audit_fd_pair(fd1, fd2);
496} 496}
497static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) 497static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode)
498{ 498{
499 if (unlikely(!audit_dummy_context())) 499 if (unlikely(!audit_dummy_context()))
500 __audit_ipc_set_perm(qbytes, uid, gid, mode); 500 __audit_ipc_set_perm(qbytes, uid, gid, mode);
501} 501}
502static inline void audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr) 502static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
503{ 503{
504 if (unlikely(!audit_dummy_context())) 504 if (unlikely(!audit_dummy_context()))
505 __audit_mq_open(oflag, mode, attr); 505 __audit_mq_open(oflag, mode, attr);
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 1b7f9d525013..e9b602151caf 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -319,7 +319,7 @@ struct cftype {
319 * If not 0, file mode is set to this value, otherwise it will 319 * If not 0, file mode is set to this value, otherwise it will
320 * be figured out automatically 320 * be figured out automatically
321 */ 321 */
322 mode_t mode; 322 umode_t mode;
323 323
324 /* 324 /*
325 * If non-zero, defines the maximum length of string that can 325 * If non-zero, defines the maximum length of string that can
@@ -457,6 +457,28 @@ void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
457void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); 457void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
458 458
459/* 459/*
460 * Control Group taskset, used to pass around set of tasks to cgroup_subsys
461 * methods.
462 */
463struct cgroup_taskset;
464struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
465struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
466struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset);
467int cgroup_taskset_size(struct cgroup_taskset *tset);
468
469/**
470 * cgroup_taskset_for_each - iterate cgroup_taskset
471 * @task: the loop cursor
472 * @skip_cgrp: skip if task's cgroup matches this, %NULL to iterate through all
473 * @tset: taskset to iterate
474 */
475#define cgroup_taskset_for_each(task, skip_cgrp, tset) \
476 for ((task) = cgroup_taskset_first((tset)); (task); \
477 (task) = cgroup_taskset_next((tset))) \
478 if (!(skip_cgrp) || \
479 cgroup_taskset_cur_cgroup((tset)) != (skip_cgrp))
480
481/*
460 * Control Group subsystem type. 482 * Control Group subsystem type.
461 * See Documentation/cgroups/cgroups.txt for details 483 * See Documentation/cgroups/cgroups.txt for details
462 */ 484 */
@@ -467,14 +489,11 @@ struct cgroup_subsys {
467 int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 489 int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
468 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 490 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
469 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 491 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
470 struct task_struct *tsk); 492 struct cgroup_taskset *tset);
471 int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk);
472 void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 493 void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
473 struct task_struct *tsk); 494 struct cgroup_taskset *tset);
474 void (*pre_attach)(struct cgroup *cgrp);
475 void (*attach_task)(struct cgroup *cgrp, struct task_struct *tsk);
476 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 495 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
477 struct cgroup *old_cgrp, struct task_struct *tsk); 496 struct cgroup_taskset *tset);
478 void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); 497 void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
479 void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, 498 void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp,
480 struct cgroup *old_cgrp, struct task_struct *task); 499 struct cgroup *old_cgrp, struct task_struct *task);
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 7213b52b2c0e..b9d46fa154b4 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -107,6 +107,28 @@ static inline void clk_unprepare(struct clk *clk)
107} 107}
108#endif 108#endif
109 109
110/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
111static inline int clk_prepare_enable(struct clk *clk)
112{
113 int ret;
114
115 ret = clk_prepare(clk);
116 if (ret)
117 return ret;
118 ret = clk_enable(clk);
119 if (ret)
120 clk_unprepare(clk);
121
122 return ret;
123}
124
125/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
126static inline void clk_disable_unprepare(struct clk *clk)
127{
128 clk_disable(clk);
129 clk_unprepare(clk);
130}
131
110/** 132/**
111 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. 133 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
112 * This is only valid once the clock source has been enabled. 134 * This is only valid once the clock source has been enabled.
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 66ed067fb729..41c9f6515f46 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -422,9 +422,9 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
422asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, 422asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
423 unsigned int nr_segs, unsigned int flags); 423 unsigned int nr_segs, unsigned int flags);
424asmlinkage long compat_sys_open(const char __user *filename, int flags, 424asmlinkage long compat_sys_open(const char __user *filename, int flags,
425 int mode); 425 umode_t mode);
426asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 426asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
427 int flags, int mode); 427 int flags, umode_t mode);
428asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, 428asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
429 struct file_handle __user *handle, 429 struct file_handle __user *handle,
430 int flags); 430 int flags);
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 3081c58d696e..34025df61829 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -124,7 +124,7 @@ extern struct config_item *config_group_find_item(struct config_group *,
124struct configfs_attribute { 124struct configfs_attribute {
125 const char *ca_name; 125 const char *ca_name;
126 struct module *ca_owner; 126 struct module *ca_owner;
127 mode_t ca_mode; 127 umode_t ca_mode;
128}; 128};
129 129
130/* 130/*
diff --git a/include/linux/cordic.h b/include/linux/cordic.h
index f932093e20c2..cf68ca4a508c 100644
--- a/include/linux/cordic.h
+++ b/include/linux/cordic.h
@@ -35,8 +35,8 @@ struct cordic_iq {
35 * @theta: angle in degrees for which i/q coordinate is to be calculated. 35 * @theta: angle in degrees for which i/q coordinate is to be calculated.
36 * @coord: function output parameter holding the i/q coordinate. 36 * @coord: function output parameter holding the i/q coordinate.
37 * 37 *
38 * The function calculates the i/q coordinate for a given angle using 38 * The function calculates the i/q coordinate for a given angle using the
39 * cordic algorithm. The coordinate consists of a real (i) and an 39 * CORDIC algorithm. The coordinate consists of a real (i) and an
40 * imaginary (q) part. The real part is essentially the cosine of the 40 * imaginary (q) part. The real part is essentially the cosine of the
41 * angle and the imaginary part is the sine of the angle. The returned 41 * angle and the imaginary part is the sine of the angle. The returned
42 * values are scaled by 2^16 for precision. The range for theta is 42 * values are scaled by 2^16 for precision. The range for theta is
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 305c263021e7..1f6587590a1a 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -14,7 +14,7 @@
14#ifndef _LINUX_CPU_H_ 14#ifndef _LINUX_CPU_H_
15#define _LINUX_CPU_H_ 15#define _LINUX_CPU_H_
16 16
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/node.h> 18#include <linux/node.h>
19#include <linux/compiler.h> 19#include <linux/compiler.h>
20#include <linux/cpumask.h> 20#include <linux/cpumask.h>
@@ -22,20 +22,20 @@
22struct cpu { 22struct cpu {
23 int node_id; /* The node which contains the CPU */ 23 int node_id; /* The node which contains the CPU */
24 int hotpluggable; /* creates sysfs control file if hotpluggable */ 24 int hotpluggable; /* creates sysfs control file if hotpluggable */
25 struct sys_device sysdev; 25 struct device dev;
26}; 26};
27 27
28extern int register_cpu(struct cpu *cpu, int num); 28extern int register_cpu(struct cpu *cpu, int num);
29extern struct sys_device *get_cpu_sysdev(unsigned cpu); 29extern struct device *get_cpu_device(unsigned cpu);
30extern bool cpu_is_hotpluggable(unsigned cpu); 30extern bool cpu_is_hotpluggable(unsigned cpu);
31 31
32extern int cpu_add_sysdev_attr(struct sysdev_attribute *attr); 32extern int cpu_add_dev_attr(struct device_attribute *attr);
33extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr); 33extern void cpu_remove_dev_attr(struct device_attribute *attr);
34 34
35extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs); 35extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
36extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs); 36extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);
37 37
38extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); 38extern int sched_create_sysfs_power_savings_entries(struct device *dev);
39 39
40#ifdef CONFIG_HOTPLUG_CPU 40#ifdef CONFIG_HOTPLUG_CPU
41extern void unregister_cpu(struct cpu *cpu); 41extern void unregister_cpu(struct cpu *cpu);
@@ -161,7 +161,7 @@ static inline void cpu_maps_update_done(void)
161} 161}
162 162
163#endif /* CONFIG_SMP */ 163#endif /* CONFIG_SMP */
164extern struct sysdev_class cpu_sysdev_class; 164extern struct bus_type cpu_subsys;
165 165
166#ifdef CONFIG_HOTPLUG_CPU 166#ifdef CONFIG_HOTPLUG_CPU
167/* Stop CPUs going up and down. */ 167/* Stop CPUs going up and down. */
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index e7d9b20ddc5b..6169c26fd8c8 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -16,6 +16,7 @@
16#define _DEBUGFS_H_ 16#define _DEBUGFS_H_
17 17
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/seq_file.h>
19 20
20#include <linux/types.h> 21#include <linux/types.h>
21 22
@@ -26,6 +27,17 @@ struct debugfs_blob_wrapper {
26 unsigned long size; 27 unsigned long size;
27}; 28};
28 29
30struct debugfs_reg32 {
31 char *name;
32 unsigned long offset;
33};
34
35struct debugfs_regset32 {
36 struct debugfs_reg32 *regs;
37 int nregs;
38 void __iomem *base;
39};
40
29extern struct dentry *arch_debugfs_dir; 41extern struct dentry *arch_debugfs_dir;
30 42
31#if defined(CONFIG_DEBUG_FS) 43#if defined(CONFIG_DEBUG_FS)
@@ -34,7 +46,7 @@ extern struct dentry *arch_debugfs_dir;
34extern const struct file_operations debugfs_file_operations; 46extern const struct file_operations debugfs_file_operations;
35extern const struct inode_operations debugfs_link_operations; 47extern const struct inode_operations debugfs_link_operations;
36 48
37struct dentry *debugfs_create_file(const char *name, mode_t mode, 49struct dentry *debugfs_create_file(const char *name, umode_t mode,
38 struct dentry *parent, void *data, 50 struct dentry *parent, void *data,
39 const struct file_operations *fops); 51 const struct file_operations *fops);
40 52
@@ -49,31 +61,38 @@ void debugfs_remove_recursive(struct dentry *dentry);
49struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, 61struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
50 struct dentry *new_dir, const char *new_name); 62 struct dentry *new_dir, const char *new_name);
51 63
52struct dentry *debugfs_create_u8(const char *name, mode_t mode, 64struct dentry *debugfs_create_u8(const char *name, umode_t mode,
53 struct dentry *parent, u8 *value); 65 struct dentry *parent, u8 *value);
54struct dentry *debugfs_create_u16(const char *name, mode_t mode, 66struct dentry *debugfs_create_u16(const char *name, umode_t mode,
55 struct dentry *parent, u16 *value); 67 struct dentry *parent, u16 *value);
56struct dentry *debugfs_create_u32(const char *name, mode_t mode, 68struct dentry *debugfs_create_u32(const char *name, umode_t mode,
57 struct dentry *parent, u32 *value); 69 struct dentry *parent, u32 *value);
58struct dentry *debugfs_create_u64(const char *name, mode_t mode, 70struct dentry *debugfs_create_u64(const char *name, umode_t mode,
59 struct dentry *parent, u64 *value); 71 struct dentry *parent, u64 *value);
60struct dentry *debugfs_create_x8(const char *name, mode_t mode, 72struct dentry *debugfs_create_x8(const char *name, umode_t mode,
61 struct dentry *parent, u8 *value); 73 struct dentry *parent, u8 *value);
62struct dentry *debugfs_create_x16(const char *name, mode_t mode, 74struct dentry *debugfs_create_x16(const char *name, umode_t mode,
63 struct dentry *parent, u16 *value); 75 struct dentry *parent, u16 *value);
64struct dentry *debugfs_create_x32(const char *name, mode_t mode, 76struct dentry *debugfs_create_x32(const char *name, umode_t mode,
65 struct dentry *parent, u32 *value); 77 struct dentry *parent, u32 *value);
66struct dentry *debugfs_create_x64(const char *name, mode_t mode, 78struct dentry *debugfs_create_x64(const char *name, umode_t mode,
67 struct dentry *parent, u64 *value); 79 struct dentry *parent, u64 *value);
68struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 80struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
69 struct dentry *parent, size_t *value); 81 struct dentry *parent, size_t *value);
70struct dentry *debugfs_create_bool(const char *name, mode_t mode, 82struct dentry *debugfs_create_bool(const char *name, umode_t mode,
71 struct dentry *parent, u32 *value); 83 struct dentry *parent, u32 *value);
72 84
73struct dentry *debugfs_create_blob(const char *name, mode_t mode, 85struct dentry *debugfs_create_blob(const char *name, umode_t mode,
74 struct dentry *parent, 86 struct dentry *parent,
75 struct debugfs_blob_wrapper *blob); 87 struct debugfs_blob_wrapper *blob);
76 88
89struct dentry *debugfs_create_regset32(const char *name, mode_t mode,
90 struct dentry *parent,
91 struct debugfs_regset32 *regset);
92
93int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
94 int nregs, void __iomem *base, char *prefix);
95
77bool debugfs_initialized(void); 96bool debugfs_initialized(void);
78 97
79#else 98#else
@@ -86,7 +105,7 @@ bool debugfs_initialized(void);
86 * want to duplicate the design decision mistakes of procfs and devfs again. 105 * want to duplicate the design decision mistakes of procfs and devfs again.
87 */ 106 */
88 107
89static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, 108static inline struct dentry *debugfs_create_file(const char *name, umode_t mode,
90 struct dentry *parent, void *data, 109 struct dentry *parent, void *data,
91 const struct file_operations *fops) 110 const struct file_operations *fops)
92{ 111{
@@ -118,76 +137,83 @@ static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentr
118 return ERR_PTR(-ENODEV); 137 return ERR_PTR(-ENODEV);
119} 138}
120 139
121static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, 140static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode,
122 struct dentry *parent, 141 struct dentry *parent,
123 u8 *value) 142 u8 *value)
124{ 143{
125 return ERR_PTR(-ENODEV); 144 return ERR_PTR(-ENODEV);
126} 145}
127 146
128static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, 147static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,
129 struct dentry *parent, 148 struct dentry *parent,
130 u16 *value) 149 u16 *value)
131{ 150{
132 return ERR_PTR(-ENODEV); 151 return ERR_PTR(-ENODEV);
133} 152}
134 153
135static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, 154static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
136 struct dentry *parent, 155 struct dentry *parent,
137 u32 *value) 156 u32 *value)
138{ 157{
139 return ERR_PTR(-ENODEV); 158 return ERR_PTR(-ENODEV);
140} 159}
141 160
142static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode, 161static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,
143 struct dentry *parent, 162 struct dentry *parent,
144 u64 *value) 163 u64 *value)
145{ 164{
146 return ERR_PTR(-ENODEV); 165 return ERR_PTR(-ENODEV);
147} 166}
148 167
149static inline struct dentry *debugfs_create_x8(const char *name, mode_t mode, 168static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode,
150 struct dentry *parent, 169 struct dentry *parent,
151 u8 *value) 170 u8 *value)
152{ 171{
153 return ERR_PTR(-ENODEV); 172 return ERR_PTR(-ENODEV);
154} 173}
155 174
156static inline struct dentry *debugfs_create_x16(const char *name, mode_t mode, 175static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode,
157 struct dentry *parent, 176 struct dentry *parent,
158 u16 *value) 177 u16 *value)
159{ 178{
160 return ERR_PTR(-ENODEV); 179 return ERR_PTR(-ENODEV);
161} 180}
162 181
163static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode, 182static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
164 struct dentry *parent, 183 struct dentry *parent,
165 u32 *value) 184 u32 *value)
166{ 185{
167 return ERR_PTR(-ENODEV); 186 return ERR_PTR(-ENODEV);
168} 187}
169 188
170static inline struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 189static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
171 struct dentry *parent, 190 struct dentry *parent,
172 size_t *value) 191 size_t *value)
173{ 192{
174 return ERR_PTR(-ENODEV); 193 return ERR_PTR(-ENODEV);
175} 194}
176 195
177static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, 196static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
178 struct dentry *parent, 197 struct dentry *parent,
179 u32 *value) 198 u32 *value)
180{ 199{
181 return ERR_PTR(-ENODEV); 200 return ERR_PTR(-ENODEV);
182} 201}
183 202
184static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode, 203static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode,
185 struct dentry *parent, 204 struct dentry *parent,
186 struct debugfs_blob_wrapper *blob) 205 struct debugfs_blob_wrapper *blob)
187{ 206{
188 return ERR_PTR(-ENODEV); 207 return ERR_PTR(-ENODEV);
189} 208}
190 209
210static inline struct dentry *debugfs_create_regset32(const char *name,
211 mode_t mode, struct dentry *parent,
212 struct debugfs_regset32 *regset)
213{
214 return ERR_PTR(-ENODEV);
215}
216
191static inline bool debugfs_initialized(void) 217static inline bool debugfs_initialized(void)
192{ 218{
193 return false; 219 return false;
diff --git a/include/linux/device.h b/include/linux/device.h
index 3136ede5a1e1..5b3adb8f9588 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -53,6 +53,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
53 * struct bus_type - The bus type of the device 53 * struct bus_type - The bus type of the device
54 * 54 *
55 * @name: The name of the bus. 55 * @name: The name of the bus.
56 * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id).
57 * @dev_root: Default device to use as the parent.
56 * @bus_attrs: Default attributes of the bus. 58 * @bus_attrs: Default attributes of the bus.
57 * @dev_attrs: Default attributes of the devices on the bus. 59 * @dev_attrs: Default attributes of the devices on the bus.
58 * @drv_attrs: Default attributes of the device drivers on the bus. 60 * @drv_attrs: Default attributes of the device drivers on the bus.
@@ -86,6 +88,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
86 */ 88 */
87struct bus_type { 89struct bus_type {
88 const char *name; 90 const char *name;
91 const char *dev_name;
92 struct device *dev_root;
89 struct bus_attribute *bus_attrs; 93 struct bus_attribute *bus_attrs;
90 struct device_attribute *dev_attrs; 94 struct device_attribute *dev_attrs;
91 struct driver_attribute *drv_attrs; 95 struct driver_attribute *drv_attrs;
@@ -106,12 +110,30 @@ struct bus_type {
106 struct subsys_private *p; 110 struct subsys_private *p;
107}; 111};
108 112
109extern int __must_check bus_register(struct bus_type *bus); 113/* This is a #define to keep the compiler from merging different
114 * instances of the __key variable */
115#define bus_register(subsys) \
116({ \
117 static struct lock_class_key __key; \
118 __bus_register(subsys, &__key); \
119})
120extern int __must_check __bus_register(struct bus_type *bus,
121 struct lock_class_key *key);
110extern void bus_unregister(struct bus_type *bus); 122extern void bus_unregister(struct bus_type *bus);
111 123
112extern int __must_check bus_rescan_devices(struct bus_type *bus); 124extern int __must_check bus_rescan_devices(struct bus_type *bus);
113 125
114/* iterator helpers for buses */ 126/* iterator helpers for buses */
127struct subsys_dev_iter {
128 struct klist_iter ki;
129 const struct device_type *type;
130};
131void subsys_dev_iter_init(struct subsys_dev_iter *iter,
132 struct bus_type *subsys,
133 struct device *start,
134 const struct device_type *type);
135struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
136void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
115 137
116int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, 138int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
117 int (*fn)(struct device *dev, void *data)); 139 int (*fn)(struct device *dev, void *data));
@@ -121,10 +143,10 @@ struct device *bus_find_device(struct bus_type *bus, struct device *start,
121struct device *bus_find_device_by_name(struct bus_type *bus, 143struct device *bus_find_device_by_name(struct bus_type *bus,
122 struct device *start, 144 struct device *start,
123 const char *name); 145 const char *name);
124 146struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
147 struct device *hint);
125int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, 148int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
126 void *data, int (*fn)(struct device_driver *, void *)); 149 void *data, int (*fn)(struct device_driver *, void *));
127
128void bus_sort_breadthfirst(struct bus_type *bus, 150void bus_sort_breadthfirst(struct bus_type *bus,
129 int (*compare)(const struct device *a, 151 int (*compare)(const struct device *a,
130 const struct device *b)); 152 const struct device *b));
@@ -256,6 +278,33 @@ struct device *driver_find_device(struct device_driver *drv,
256 int (*match)(struct device *dev, void *data)); 278 int (*match)(struct device *dev, void *data));
257 279
258/** 280/**
281 * struct subsys_interface - interfaces to device functions
282 * @name name of the device function
283 * @subsystem subsytem of the devices to attach to
284 * @node the list of functions registered at the subsystem
285 * @add device hookup to device function handler
286 * @remove device hookup to device function handler
287 *
288 * Simple interfaces attached to a subsystem. Multiple interfaces can
289 * attach to a subsystem and its devices. Unlike drivers, they do not
290 * exclusively claim or control devices. Interfaces usually represent
291 * a specific functionality of a subsystem/class of devices.
292 */
293struct subsys_interface {
294 const char *name;
295 struct bus_type *subsys;
296 struct list_head node;
297 int (*add_dev)(struct device *dev, struct subsys_interface *sif);
298 int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
299};
300
301int subsys_interface_register(struct subsys_interface *sif);
302void subsys_interface_unregister(struct subsys_interface *sif);
303
304int subsys_system_register(struct bus_type *subsys,
305 const struct attribute_group **groups);
306
307/**
259 * struct class - device classes 308 * struct class - device classes
260 * @name: Name of the class. 309 * @name: Name of the class.
261 * @owner: The module owner. 310 * @owner: The module owner.
@@ -294,7 +343,7 @@ struct class {
294 struct kobject *dev_kobj; 343 struct kobject *dev_kobj;
295 344
296 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); 345 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
297 char *(*devnode)(struct device *dev, mode_t *mode); 346 char *(*devnode)(struct device *dev, umode_t *mode);
298 347
299 void (*class_release)(struct class *class); 348 void (*class_release)(struct class *class);
300 void (*dev_release)(struct device *dev); 349 void (*dev_release)(struct device *dev);
@@ -423,7 +472,7 @@ struct device_type {
423 const char *name; 472 const char *name;
424 const struct attribute_group **groups; 473 const struct attribute_group **groups;
425 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 474 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
426 char *(*devnode)(struct device *dev, mode_t *mode); 475 char *(*devnode)(struct device *dev, umode_t *mode);
427 void (*release)(struct device *dev); 476 void (*release)(struct device *dev);
428 477
429 const struct dev_pm_ops *pm; 478 const struct dev_pm_ops *pm;
@@ -438,11 +487,31 @@ struct device_attribute {
438 const char *buf, size_t count); 487 const char *buf, size_t count);
439}; 488};
440 489
441#define DEVICE_ATTR(_name, _mode, _show, _store) \ 490struct dev_ext_attribute {
442struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 491 struct device_attribute attr;
492 void *var;
493};
494
495ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr,
496 char *buf);
497ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr,
498 const char *buf, size_t count);
499ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
500 char *buf);
501ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
502 const char *buf, size_t count);
443 503
444extern int __must_check device_create_file(struct device *device, 504#define DEVICE_ATTR(_name, _mode, _show, _store) \
445 const struct device_attribute *entry); 505 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
506#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
507 struct dev_ext_attribute dev_attr_##_name = \
508 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
509#define DEVICE_INT_ATTR(_name, _mode, _var) \
510 struct dev_ext_attribute dev_attr_##_name = \
511 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
512
513extern int device_create_file(struct device *device,
514 const struct device_attribute *entry);
446extern void device_remove_file(struct device *dev, 515extern void device_remove_file(struct device *dev,
447 const struct device_attribute *attr); 516 const struct device_attribute *attr);
448extern int __must_check device_create_bin_file(struct device *dev, 517extern int __must_check device_create_bin_file(struct device *dev,
@@ -490,6 +559,9 @@ extern int devres_release_group(struct device *dev, void *id);
490extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); 559extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
491extern void devm_kfree(struct device *dev, void *p); 560extern void devm_kfree(struct device *dev, void *p);
492 561
562void __iomem *devm_request_and_ioremap(struct device *dev,
563 struct resource *res);
564
493struct device_dma_parameters { 565struct device_dma_parameters {
494 /* 566 /*
495 * a low level driver may set these to teach IOMMU code about 567 * a low level driver may set these to teach IOMMU code about
@@ -600,6 +672,7 @@ struct device {
600 struct device_node *of_node; /* associated device tree node */ 672 struct device_node *of_node; /* associated device tree node */
601 673
602 dev_t devt; /* dev_t, creates the sysfs "dev" */ 674 dev_t devt; /* dev_t, creates the sysfs "dev" */
675 u32 id; /* device instance */
603 676
604 spinlock_t devres_lock; 677 spinlock_t devres_lock;
605 struct list_head devres_head; 678 struct list_head devres_head;
@@ -720,7 +793,7 @@ extern int device_rename(struct device *dev, const char *new_name);
720extern int device_move(struct device *dev, struct device *new_parent, 793extern int device_move(struct device *dev, struct device *new_parent,
721 enum dpm_order dpm_order); 794 enum dpm_order dpm_order);
722extern const char *device_get_devnode(struct device *dev, 795extern const char *device_get_devnode(struct device *dev,
723 mode_t *mode, const char **tmp); 796 umode_t *mode, const char **tmp);
724extern void *dev_get_drvdata(const struct device *dev); 797extern void *dev_get_drvdata(const struct device *dev);
725extern int dev_set_drvdata(struct device *dev, void *data); 798extern int dev_set_drvdata(struct device *dev, void *data);
726 799
@@ -924,4 +997,25 @@ extern long sysfs_deprecated;
924#define sysfs_deprecated 0 997#define sysfs_deprecated 0
925#endif 998#endif
926 999
1000/**
1001 * module_driver() - Helper macro for drivers that don't do anything
1002 * special in module init/exit. This eliminates a lot of boilerplate.
1003 * Each module may only use this macro once, and calling it replaces
1004 * module_init() and module_exit().
1005 *
1006 * Use this macro to construct bus specific macros for registering
1007 * drivers, and do not use it on its own.
1008 */
1009#define module_driver(__driver, __register, __unregister) \
1010static int __init __driver##_init(void) \
1011{ \
1012 return __register(&(__driver)); \
1013} \
1014module_init(__driver##_init); \
1015static void __exit __driver##_exit(void) \
1016{ \
1017 __unregister(&(__driver)); \
1018} \
1019module_exit(__driver##_exit);
1020
927#endif /* _DEVICE_H_ */ 1021#endif /* _DEVICE_H_ */
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
new file mode 100644
index 000000000000..f8ac076afa52
--- /dev/null
+++ b/include/linux/dma-buf.h
@@ -0,0 +1,176 @@
1/*
2 * Header file for dma buffer sharing framework.
3 *
4 * Copyright(C) 2011 Linaro Limited. All rights reserved.
5 * Author: Sumit Semwal <sumit.semwal@ti.com>
6 *
7 * Many thanks to linaro-mm-sig list, and specially
8 * Arnd Bergmann <arnd@arndb.de>, Rob Clark <rob@ti.com> and
9 * Daniel Vetter <daniel@ffwll.ch> for their support in creation and
10 * refining of this idea.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License version 2 as published by
14 * the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License along with
22 * this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24#ifndef __DMA_BUF_H__
25#define __DMA_BUF_H__
26
27#include <linux/file.h>
28#include <linux/err.h>
29#include <linux/device.h>
30#include <linux/scatterlist.h>
31#include <linux/list.h>
32#include <linux/dma-mapping.h>
33
34struct dma_buf;
35struct dma_buf_attachment;
36
37/**
38 * struct dma_buf_ops - operations possible on struct dma_buf
39 * @attach: [optional] allows different devices to 'attach' themselves to the
40 * given buffer. It might return -EBUSY to signal that backing storage
41 * is already allocated and incompatible with the requirements
42 * of requesting device.
43 * @detach: [optional] detach a given device from this buffer.
44 * @map_dma_buf: returns list of scatter pages allocated, increases usecount
45 * of the buffer. Requires atleast one attach to be called
46 * before. Returned sg list should already be mapped into
47 * _device_ address space. This call may sleep. May also return
48 * -EINTR. Should return -EINVAL if attach hasn't been called yet.
49 * @unmap_dma_buf: decreases usecount of buffer, might deallocate scatter
50 * pages.
51 * @release: release this buffer; to be called after the last dma_buf_put.
52 */
53struct dma_buf_ops {
54 int (*attach)(struct dma_buf *, struct device *,
55 struct dma_buf_attachment *);
56
57 void (*detach)(struct dma_buf *, struct dma_buf_attachment *);
58
59 /* For {map,unmap}_dma_buf below, any specific buffer attributes
60 * required should get added to device_dma_parameters accessible
61 * via dev->dma_params.
62 */
63 struct sg_table * (*map_dma_buf)(struct dma_buf_attachment *,
64 enum dma_data_direction);
65 void (*unmap_dma_buf)(struct dma_buf_attachment *,
66 struct sg_table *);
67 /* TODO: Add try_map_dma_buf version, to return immed with -EBUSY
68 * if the call would block.
69 */
70
71 /* after final dma_buf_put() */
72 void (*release)(struct dma_buf *);
73
74};
75
76/**
77 * struct dma_buf - shared buffer object
78 * @size: size of the buffer
79 * @file: file pointer used for sharing buffers across, and for refcounting.
80 * @attachments: list of dma_buf_attachment that denotes all devices attached.
81 * @ops: dma_buf_ops associated with this buffer object.
82 * @priv: exporter specific private data for this buffer object.
83 */
84struct dma_buf {
85 size_t size;
86 struct file *file;
87 struct list_head attachments;
88 const struct dma_buf_ops *ops;
89 /* mutex to serialize list manipulation and other ops */
90 struct mutex lock;
91 void *priv;
92};
93
94/**
95 * struct dma_buf_attachment - holds device-buffer attachment data
96 * @dmabuf: buffer for this attachment.
97 * @dev: device attached to the buffer.
98 * @node: list of dma_buf_attachment.
99 * @priv: exporter specific attachment data.
100 *
101 * This structure holds the attachment information between the dma_buf buffer
102 * and its user device(s). The list contains one attachment struct per device
103 * attached to the buffer.
104 */
105struct dma_buf_attachment {
106 struct dma_buf *dmabuf;
107 struct device *dev;
108 struct list_head node;
109 void *priv;
110};
111
112#ifdef CONFIG_DMA_SHARED_BUFFER
113struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
114 struct device *dev);
115void dma_buf_detach(struct dma_buf *dmabuf,
116 struct dma_buf_attachment *dmabuf_attach);
117struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops,
118 size_t size, int flags);
119int dma_buf_fd(struct dma_buf *dmabuf);
120struct dma_buf *dma_buf_get(int fd);
121void dma_buf_put(struct dma_buf *dmabuf);
122
123struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *,
124 enum dma_data_direction);
125void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *);
126#else
127
128static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
129 struct device *dev)
130{
131 return ERR_PTR(-ENODEV);
132}
133
134static inline void dma_buf_detach(struct dma_buf *dmabuf,
135 struct dma_buf_attachment *dmabuf_attach)
136{
137 return;
138}
139
140static inline struct dma_buf *dma_buf_export(void *priv,
141 struct dma_buf_ops *ops,
142 size_t size, int flags)
143{
144 return ERR_PTR(-ENODEV);
145}
146
147static inline int dma_buf_fd(struct dma_buf *dmabuf)
148{
149 return -ENODEV;
150}
151
152static inline struct dma_buf *dma_buf_get(int fd)
153{
154 return ERR_PTR(-ENODEV);
155}
156
157static inline void dma_buf_put(struct dma_buf *dmabuf)
158{
159 return;
160}
161
162static inline struct sg_table *dma_buf_map_attachment(
163 struct dma_buf_attachment *attach, enum dma_data_direction write)
164{
165 return ERR_PTR(-ENODEV);
166}
167
168static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
169 struct sg_table *sg)
170{
171 return;
172}
173
174#endif /* CONFIG_DMA_SHARED_BUFFER */
175
176#endif /* __DMA_BUF_H__ */
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 055b248bdd53..1cd3947987e5 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -13,7 +13,7 @@
13#define _LINUX_EDAC_H_ 13#define _LINUX_EDAC_H_
14 14
15#include <linux/atomic.h> 15#include <linux/atomic.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17 17
18#define EDAC_OPSTATE_INVAL -1 18#define EDAC_OPSTATE_INVAL -1
19#define EDAC_OPSTATE_POLL 0 19#define EDAC_OPSTATE_POLL 0
@@ -23,12 +23,12 @@
23extern int edac_op_state; 23extern int edac_op_state;
24extern int edac_err_assert; 24extern int edac_err_assert;
25extern atomic_t edac_handlers; 25extern atomic_t edac_handlers;
26extern struct sysdev_class edac_class; 26extern struct bus_type edac_subsys;
27 27
28extern int edac_handler_set(void); 28extern int edac_handler_set(void);
29extern void edac_atomic_assert_error(void); 29extern void edac_atomic_assert_error(void);
30extern struct sysdev_class *edac_get_sysfs_class(void); 30extern struct bus_type *edac_get_sysfs_subsys(void);
31extern void edac_put_sysfs_class(void); 31extern void edac_put_sysfs_subsys(void);
32 32
33static inline void opstate_init(void) 33static inline void opstate_init(void)
34{ 34{
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index dec99116a0e4..f957085d40ed 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -884,7 +884,7 @@ extern int ext3fs_dirhash(const char *name, int len, struct
884 884
885/* ialloc.c */ 885/* ialloc.c */
886extern struct inode * ext3_new_inode (handle_t *, struct inode *, 886extern struct inode * ext3_new_inode (handle_t *, struct inode *,
887 const struct qstr *, int); 887 const struct qstr *, umode_t);
888extern void ext3_free_inode (handle_t *, struct inode *); 888extern void ext3_free_inode (handle_t *, struct inode *);
889extern struct inode * ext3_orphan_get (struct super_block *, unsigned long); 889extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
890extern unsigned long ext3_count_free_inodes (struct super_block *); 890extern unsigned long ext3_count_free_inodes (struct super_block *);
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index a5386e3ee756..0ab54e16a91f 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -5,71 +5,58 @@
5 5
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/wait.h> 7#include <linux/wait.h>
8#include <linux/atomic.h>
8 9
9#ifdef CONFIG_FREEZER 10#ifdef CONFIG_FREEZER
11extern atomic_t system_freezing_cnt; /* nr of freezing conds in effect */
12extern bool pm_freezing; /* PM freezing in effect */
13extern bool pm_nosig_freezing; /* PM nosig freezing in effect */
14
10/* 15/*
11 * Check if a process has been frozen 16 * Check if a process has been frozen
12 */ 17 */
13static inline int frozen(struct task_struct *p) 18static inline bool frozen(struct task_struct *p)
14{ 19{
15 return p->flags & PF_FROZEN; 20 return p->flags & PF_FROZEN;
16} 21}
17 22
18/* 23extern bool freezing_slow_path(struct task_struct *p);
19 * Check if there is a request to freeze a process
20 */
21static inline int freezing(struct task_struct *p)
22{
23 return test_tsk_thread_flag(p, TIF_FREEZE);
24}
25
26/*
27 * Request that a process be frozen
28 */
29static inline void set_freeze_flag(struct task_struct *p)
30{
31 set_tsk_thread_flag(p, TIF_FREEZE);
32}
33 24
34/* 25/*
35 * Sometimes we may need to cancel the previous 'freeze' request 26 * Check if there is a request to freeze a process
36 */ 27 */
37static inline void clear_freeze_flag(struct task_struct *p) 28static inline bool freezing(struct task_struct *p)
38{
39 clear_tsk_thread_flag(p, TIF_FREEZE);
40}
41
42static inline bool should_send_signal(struct task_struct *p)
43{ 29{
44 return !(p->flags & PF_FREEZER_NOSIG); 30 if (likely(!atomic_read(&system_freezing_cnt)))
31 return false;
32 return freezing_slow_path(p);
45} 33}
46 34
47/* Takes and releases task alloc lock using task_lock() */ 35/* Takes and releases task alloc lock using task_lock() */
48extern int thaw_process(struct task_struct *p); 36extern void __thaw_task(struct task_struct *t);
49 37
50extern void refrigerator(void); 38extern bool __refrigerator(bool check_kthr_stop);
51extern int freeze_processes(void); 39extern int freeze_processes(void);
52extern int freeze_kernel_threads(void); 40extern int freeze_kernel_threads(void);
53extern void thaw_processes(void); 41extern void thaw_processes(void);
54 42
55static inline int try_to_freeze(void) 43static inline bool try_to_freeze(void)
56{ 44{
57 if (freezing(current)) { 45 might_sleep();
58 refrigerator(); 46 if (likely(!freezing(current)))
59 return 1; 47 return false;
60 } else 48 return __refrigerator(false);
61 return 0;
62} 49}
63 50
64extern bool freeze_task(struct task_struct *p, bool sig_only); 51extern bool freeze_task(struct task_struct *p);
65extern void cancel_freezing(struct task_struct *p); 52extern bool set_freezable(void);
66 53
67#ifdef CONFIG_CGROUP_FREEZER 54#ifdef CONFIG_CGROUP_FREEZER
68extern int cgroup_freezing_or_frozen(struct task_struct *task); 55extern bool cgroup_freezing(struct task_struct *task);
69#else /* !CONFIG_CGROUP_FREEZER */ 56#else /* !CONFIG_CGROUP_FREEZER */
70static inline int cgroup_freezing_or_frozen(struct task_struct *task) 57static inline bool cgroup_freezing(struct task_struct *task)
71{ 58{
72 return 0; 59 return false;
73} 60}
74#endif /* !CONFIG_CGROUP_FREEZER */ 61#endif /* !CONFIG_CGROUP_FREEZER */
75 62
@@ -80,33 +67,27 @@ static inline int cgroup_freezing_or_frozen(struct task_struct *task)
80 * appropriately in case the child has exited before the freezing of tasks is 67 * appropriately in case the child has exited before the freezing of tasks is
81 * complete. However, we don't want kernel threads to be frozen in unexpected 68 * complete. However, we don't want kernel threads to be frozen in unexpected
82 * places, so we allow them to block freeze_processes() instead or to set 69 * places, so we allow them to block freeze_processes() instead or to set
83 * PF_NOFREEZE if needed and PF_FREEZER_SKIP is only set for userland vfork 70 * PF_NOFREEZE if needed. Fortunately, in the ____call_usermodehelper() case the
84 * parents. Fortunately, in the ____call_usermodehelper() case the parent won't 71 * parent won't really block freeze_processes(), since ____call_usermodehelper()
85 * really block freeze_processes(), since ____call_usermodehelper() (the child) 72 * (the child) does a little before exec/exit and it can't be frozen before
86 * does a little before exec/exit and it can't be frozen before waking up the 73 * waking up the parent.
87 * parent.
88 */ 74 */
89 75
90/* 76
91 * If the current task is a user space one, tell the freezer not to count it as 77/* Tell the freezer not to count the current task as freezable. */
92 * freezable.
93 */
94static inline void freezer_do_not_count(void) 78static inline void freezer_do_not_count(void)
95{ 79{
96 if (current->mm) 80 current->flags |= PF_FREEZER_SKIP;
97 current->flags |= PF_FREEZER_SKIP;
98} 81}
99 82
100/* 83/*
101 * If the current task is a user space one, tell the freezer to count it as 84 * Tell the freezer to count the current task as freezable again and try to
102 * freezable again and try to freeze it. 85 * freeze it.
103 */ 86 */
104static inline void freezer_count(void) 87static inline void freezer_count(void)
105{ 88{
106 if (current->mm) { 89 current->flags &= ~PF_FREEZER_SKIP;
107 current->flags &= ~PF_FREEZER_SKIP; 90 try_to_freeze();
108 try_to_freeze();
109 }
110} 91}
111 92
112/* 93/*
@@ -118,21 +99,29 @@ static inline int freezer_should_skip(struct task_struct *p)
118} 99}
119 100
120/* 101/*
121 * Tell the freezer that the current task should be frozen by it 102 * These macros are intended to be used whenever you want allow a task that's
103 * sleeping in TASK_UNINTERRUPTIBLE or TASK_KILLABLE state to be frozen. Note
104 * that neither return any clear indication of whether a freeze event happened
105 * while in this function.
122 */ 106 */
123static inline void set_freezable(void)
124{
125 current->flags &= ~PF_NOFREEZE;
126}
127 107
128/* 108/* Like schedule(), but should not block the freezer. */
129 * Tell the freezer that the current task should be frozen by it and that it 109#define freezable_schedule() \
130 * should send a fake signal to the task to freeze it. 110({ \
131 */ 111 freezer_do_not_count(); \
132static inline void set_freezable_with_signal(void) 112 schedule(); \
133{ 113 freezer_count(); \
134 current->flags &= ~(PF_NOFREEZE | PF_FREEZER_NOSIG); 114})
135} 115
116/* Like schedule_timeout_killable(), but should not block the freezer. */
117#define freezable_schedule_timeout_killable(timeout) \
118({ \
119 long __retval; \
120 freezer_do_not_count(); \
121 __retval = schedule_timeout_killable(timeout); \
122 freezer_count(); \
123 __retval; \
124})
136 125
137/* 126/*
138 * Freezer-friendly wrappers around wait_event_interruptible(), 127 * Freezer-friendly wrappers around wait_event_interruptible(),
@@ -152,47 +141,51 @@ static inline void set_freezable_with_signal(void)
152#define wait_event_freezable(wq, condition) \ 141#define wait_event_freezable(wq, condition) \
153({ \ 142({ \
154 int __retval; \ 143 int __retval; \
155 do { \ 144 for (;;) { \
156 __retval = wait_event_interruptible(wq, \ 145 __retval = wait_event_interruptible(wq, \
157 (condition) || freezing(current)); \ 146 (condition) || freezing(current)); \
158 if (__retval && !freezing(current)) \ 147 if (__retval || (condition)) \
159 break; \ 148 break; \
160 else if (!(condition)) \ 149 try_to_freeze(); \
161 __retval = -ERESTARTSYS; \ 150 } \
162 } while (try_to_freeze()); \
163 __retval; \ 151 __retval; \
164}) 152})
165 153
166
167#define wait_event_freezable_timeout(wq, condition, timeout) \ 154#define wait_event_freezable_timeout(wq, condition, timeout) \
168({ \ 155({ \
169 long __retval = timeout; \ 156 long __retval = timeout; \
170 do { \ 157 for (;;) { \
171 __retval = wait_event_interruptible_timeout(wq, \ 158 __retval = wait_event_interruptible_timeout(wq, \
172 (condition) || freezing(current), \ 159 (condition) || freezing(current), \
173 __retval); \ 160 __retval); \
174 } while (try_to_freeze()); \ 161 if (__retval <= 0 || (condition)) \
162 break; \
163 try_to_freeze(); \
164 } \
175 __retval; \ 165 __retval; \
176}) 166})
167
177#else /* !CONFIG_FREEZER */ 168#else /* !CONFIG_FREEZER */
178static inline int frozen(struct task_struct *p) { return 0; } 169static inline bool frozen(struct task_struct *p) { return false; }
179static inline int freezing(struct task_struct *p) { return 0; } 170static inline bool freezing(struct task_struct *p) { return false; }
180static inline void set_freeze_flag(struct task_struct *p) {} 171static inline void __thaw_task(struct task_struct *t) {}
181static inline void clear_freeze_flag(struct task_struct *p) {}
182static inline int thaw_process(struct task_struct *p) { return 1; }
183 172
184static inline void refrigerator(void) {} 173static inline bool __refrigerator(bool check_kthr_stop) { return false; }
185static inline int freeze_processes(void) { return -ENOSYS; } 174static inline int freeze_processes(void) { return -ENOSYS; }
186static inline int freeze_kernel_threads(void) { return -ENOSYS; } 175static inline int freeze_kernel_threads(void) { return -ENOSYS; }
187static inline void thaw_processes(void) {} 176static inline void thaw_processes(void) {}
188 177
189static inline int try_to_freeze(void) { return 0; } 178static inline bool try_to_freeze(void) { return false; }
190 179
191static inline void freezer_do_not_count(void) {} 180static inline void freezer_do_not_count(void) {}
192static inline void freezer_count(void) {} 181static inline void freezer_count(void) {}
193static inline int freezer_should_skip(struct task_struct *p) { return 0; } 182static inline int freezer_should_skip(struct task_struct *p) { return 0; }
194static inline void set_freezable(void) {} 183static inline void set_freezable(void) {}
195static inline void set_freezable_with_signal(void) {} 184
185#define freezable_schedule() schedule()
186
187#define freezable_schedule_timeout_killable(timeout) \
188 schedule_timeout_killable(timeout)
196 189
197#define wait_event_freezable(wq, condition) \ 190#define wait_event_freezable(wq, condition) \
198 wait_event_interruptible(wq, condition) 191 wait_event_interruptible(wq, condition)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e0bc4ffb8e7f..7aacf31418fe 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1428,6 +1428,7 @@ struct super_block {
1428#else 1428#else
1429 struct list_head s_files; 1429 struct list_head s_files;
1430#endif 1430#endif
1431 struct list_head s_mounts; /* list of mounts; _not_ for fs use */
1431 /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ 1432 /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */
1432 struct list_head s_dentry_lru; /* unused dentry lru */ 1433 struct list_head s_dentry_lru; /* unused dentry lru */
1433 int s_nr_dentry_unused; /* # of dentry on lru */ 1434 int s_nr_dentry_unused; /* # of dentry on lru */
@@ -1440,7 +1441,7 @@ struct super_block {
1440 struct block_device *s_bdev; 1441 struct block_device *s_bdev;
1441 struct backing_dev_info *s_bdi; 1442 struct backing_dev_info *s_bdi;
1442 struct mtd_info *s_mtd; 1443 struct mtd_info *s_mtd;
1443 struct list_head s_instances; 1444 struct hlist_node s_instances;
1444 struct quota_info s_dquot; /* Diskquota specific options */ 1445 struct quota_info s_dquot; /* Diskquota specific options */
1445 1446
1446 int s_frozen; 1447 int s_frozen;
@@ -1481,6 +1482,12 @@ struct super_block {
1481 int cleancache_poolid; 1482 int cleancache_poolid;
1482 1483
1483 struct shrinker s_shrink; /* per-sb shrinker handle */ 1484 struct shrinker s_shrink; /* per-sb shrinker handle */
1485
1486 /* Number of inodes with nlink == 0 but still referenced */
1487 atomic_long_t s_remove_count;
1488
1489 /* Being remounted read-only */
1490 int s_readonly_remount;
1484}; 1491};
1485 1492
1486/* superblock cache pruning functions */ 1493/* superblock cache pruning functions */
@@ -1516,9 +1523,9 @@ extern void unlock_super(struct super_block *);
1516/* 1523/*
1517 * VFS helper functions.. 1524 * VFS helper functions..
1518 */ 1525 */
1519extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1526extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *);
1520extern int vfs_mkdir(struct inode *, struct dentry *, int); 1527extern int vfs_mkdir(struct inode *, struct dentry *, umode_t);
1521extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1528extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
1522extern int vfs_symlink(struct inode *, struct dentry *, const char *); 1529extern int vfs_symlink(struct inode *, struct dentry *, const char *);
1523extern int vfs_link(struct dentry *, struct inode *, struct dentry *); 1530extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
1524extern int vfs_rmdir(struct inode *, struct dentry *); 1531extern int vfs_rmdir(struct inode *, struct dentry *);
@@ -1534,7 +1541,7 @@ extern void dentry_unhash(struct dentry *dentry);
1534 * VFS file helper functions. 1541 * VFS file helper functions.
1535 */ 1542 */
1536extern void inode_init_owner(struct inode *inode, const struct inode *dir, 1543extern void inode_init_owner(struct inode *inode, const struct inode *dir,
1537 mode_t mode); 1544 umode_t mode);
1538/* 1545/*
1539 * VFS FS_IOC_FIEMAP helper definitions. 1546 * VFS FS_IOC_FIEMAP helper definitions.
1540 */ 1547 */
@@ -1619,13 +1626,13 @@ struct inode_operations {
1619 int (*readlink) (struct dentry *, char __user *,int); 1626 int (*readlink) (struct dentry *, char __user *,int);
1620 void (*put_link) (struct dentry *, struct nameidata *, void *); 1627 void (*put_link) (struct dentry *, struct nameidata *, void *);
1621 1628
1622 int (*create) (struct inode *,struct dentry *,int, struct nameidata *); 1629 int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *);
1623 int (*link) (struct dentry *,struct inode *,struct dentry *); 1630 int (*link) (struct dentry *,struct inode *,struct dentry *);
1624 int (*unlink) (struct inode *,struct dentry *); 1631 int (*unlink) (struct inode *,struct dentry *);
1625 int (*symlink) (struct inode *,struct dentry *,const char *); 1632 int (*symlink) (struct inode *,struct dentry *,const char *);
1626 int (*mkdir) (struct inode *,struct dentry *,int); 1633 int (*mkdir) (struct inode *,struct dentry *,umode_t);
1627 int (*rmdir) (struct inode *,struct dentry *); 1634 int (*rmdir) (struct inode *,struct dentry *);
1628 int (*mknod) (struct inode *,struct dentry *,int,dev_t); 1635 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
1629 int (*rename) (struct inode *, struct dentry *, 1636 int (*rename) (struct inode *, struct dentry *,
1630 struct inode *, struct dentry *); 1637 struct inode *, struct dentry *);
1631 void (*truncate) (struct inode *); 1638 void (*truncate) (struct inode *);
@@ -1672,10 +1679,10 @@ struct super_operations {
1672 int (*remount_fs) (struct super_block *, int *, char *); 1679 int (*remount_fs) (struct super_block *, int *, char *);
1673 void (*umount_begin) (struct super_block *); 1680 void (*umount_begin) (struct super_block *);
1674 1681
1675 int (*show_options)(struct seq_file *, struct vfsmount *); 1682 int (*show_options)(struct seq_file *, struct dentry *);
1676 int (*show_devname)(struct seq_file *, struct vfsmount *); 1683 int (*show_devname)(struct seq_file *, struct dentry *);
1677 int (*show_path)(struct seq_file *, struct vfsmount *); 1684 int (*show_path)(struct seq_file *, struct dentry *);
1678 int (*show_stats)(struct seq_file *, struct vfsmount *); 1685 int (*show_stats)(struct seq_file *, struct dentry *);
1679#ifdef CONFIG_QUOTA 1686#ifdef CONFIG_QUOTA
1680 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1687 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
1681 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1688 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
@@ -1764,31 +1771,10 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1764 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1771 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1765} 1772}
1766 1773
1767/** 1774extern void inc_nlink(struct inode *inode);
1768 * set_nlink - directly set an inode's link count 1775extern void drop_nlink(struct inode *inode);
1769 * @inode: inode 1776extern void clear_nlink(struct inode *inode);
1770 * @nlink: new nlink (should be non-zero) 1777extern void set_nlink(struct inode *inode, unsigned int nlink);
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/**
1781 * inc_nlink - directly increment an inode's link count
1782 * @inode: inode
1783 *
1784 * This is a low-level filesystem helper to replace any
1785 * direct filesystem manipulation of i_nlink. Currently,
1786 * it is only here for parity with dec_nlink().
1787 */
1788static inline void inc_nlink(struct inode *inode)
1789{
1790 inode->__i_nlink++;
1791}
1792 1778
1793static inline void inode_inc_link_count(struct inode *inode) 1779static inline void inode_inc_link_count(struct inode *inode)
1794{ 1780{
@@ -1796,35 +1782,6 @@ static inline void inode_inc_link_count(struct inode *inode)
1796 mark_inode_dirty(inode); 1782 mark_inode_dirty(inode);
1797} 1783}
1798 1784
1799/**
1800 * drop_nlink - directly drop an inode's link count
1801 * @inode: inode
1802 *
1803 * This is a low-level filesystem helper to replace any
1804 * direct filesystem manipulation of i_nlink. In cases
1805 * where we are attempting to track writes to the
1806 * filesystem, a decrement to zero means an imminent
1807 * write when the file is truncated and actually unlinked
1808 * on the filesystem.
1809 */
1810static inline void drop_nlink(struct inode *inode)
1811{
1812 inode->__i_nlink--;
1813}
1814
1815/**
1816 * clear_nlink - directly zero an inode's link count
1817 * @inode: inode
1818 *
1819 * This is a low-level filesystem helper to replace any
1820 * direct filesystem manipulation of i_nlink. See
1821 * drop_nlink() for why we care about i_nlink hitting zero.
1822 */
1823static inline void clear_nlink(struct inode *inode)
1824{
1825 inode->__i_nlink = 0;
1826}
1827
1828static inline void inode_dec_link_count(struct inode *inode) 1785static inline void inode_dec_link_count(struct inode *inode)
1829{ 1786{
1830 drop_nlink(inode); 1787 drop_nlink(inode);
@@ -1864,7 +1821,7 @@ struct file_system_type {
1864 void (*kill_sb) (struct super_block *); 1821 void (*kill_sb) (struct super_block *);
1865 struct module *owner; 1822 struct module *owner;
1866 struct file_system_type * next; 1823 struct file_system_type * next;
1867 struct list_head fs_supers; 1824 struct hlist_head fs_supers;
1868 1825
1869 struct lock_class_key s_lock_key; 1826 struct lock_class_key s_lock_key;
1870 struct lock_class_key s_umount_key; 1827 struct lock_class_key s_umount_key;
@@ -1939,7 +1896,7 @@ extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
1939extern int vfs_statfs(struct path *, struct kstatfs *); 1896extern int vfs_statfs(struct path *, struct kstatfs *);
1940extern int user_statfs(const char __user *, struct kstatfs *); 1897extern int user_statfs(const char __user *, struct kstatfs *);
1941extern int fd_statfs(int, struct kstatfs *); 1898extern int fd_statfs(int, struct kstatfs *);
1942extern int statfs_by_dentry(struct dentry *, struct kstatfs *); 1899extern int vfs_ustat(dev_t, struct kstatfs *);
1943extern int freeze_super(struct super_block *super); 1900extern int freeze_super(struct super_block *super);
1944extern int thaw_super(struct super_block *super); 1901extern int thaw_super(struct super_block *super);
1945extern bool our_mnt(struct vfsmount *mnt); 1902extern bool our_mnt(struct vfsmount *mnt);
@@ -2054,8 +2011,8 @@ extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
2054extern int do_fallocate(struct file *file, int mode, loff_t offset, 2011extern int do_fallocate(struct file *file, int mode, loff_t offset,
2055 loff_t len); 2012 loff_t len);
2056extern long do_sys_open(int dfd, const char __user *filename, int flags, 2013extern long do_sys_open(int dfd, const char __user *filename, int flags,
2057 int mode); 2014 umode_t mode);
2058extern struct file *filp_open(const char *, int, int); 2015extern struct file *filp_open(const char *, int, umode_t);
2059extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2016extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2060 const char *, int); 2017 const char *, int);
2061extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, 2018extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
@@ -2092,6 +2049,7 @@ extern void bd_forget(struct inode *inode);
2092extern void bdput(struct block_device *); 2049extern void bdput(struct block_device *);
2093extern void invalidate_bdev(struct block_device *); 2050extern void invalidate_bdev(struct block_device *);
2094extern int sync_blockdev(struct block_device *bdev); 2051extern int sync_blockdev(struct block_device *bdev);
2052extern void kill_bdev(struct block_device *);
2095extern struct super_block *freeze_bdev(struct block_device *); 2053extern struct super_block *freeze_bdev(struct block_device *);
2096extern void emergency_thaw_all(void); 2054extern void emergency_thaw_all(void);
2097extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); 2055extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
@@ -2099,6 +2057,7 @@ extern int fsync_bdev(struct block_device *);
2099#else 2057#else
2100static inline void bd_forget(struct inode *inode) {} 2058static inline void bd_forget(struct inode *inode) {}
2101static inline int sync_blockdev(struct block_device *bdev) { return 0; } 2059static inline int sync_blockdev(struct block_device *bdev) { return 0; }
2060static inline void kill_bdev(struct block_device *bdev) {}
2102static inline void invalidate_bdev(struct block_device *bdev) {} 2061static inline void invalidate_bdev(struct block_device *bdev) {}
2103 2062
2104static inline struct super_block *freeze_bdev(struct block_device *sb) 2063static inline struct super_block *freeze_bdev(struct block_device *sb)
@@ -2191,8 +2150,6 @@ extern const struct file_operations read_pipefifo_fops;
2191extern const struct file_operations write_pipefifo_fops; 2150extern const struct file_operations write_pipefifo_fops;
2192extern const struct file_operations rdwr_pipefifo_fops; 2151extern const struct file_operations rdwr_pipefifo_fops;
2193 2152
2194extern int fs_may_remount_ro(struct super_block *);
2195
2196#ifdef CONFIG_BLOCK 2153#ifdef CONFIG_BLOCK
2197/* 2154/*
2198 * return READ, READA, or WRITE 2155 * return READ, READA, or WRITE
@@ -2415,6 +2372,7 @@ extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2415 unsigned long nr_segs, loff_t pos); 2372 unsigned long nr_segs, loff_t pos);
2416extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, 2373extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2417 int datasync); 2374 int datasync);
2375extern void block_sync_page(struct page *page);
2418 2376
2419/* fs/splice.c */ 2377/* fs/splice.c */
2420extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2378extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2531,7 +2489,6 @@ extern void put_filesystem(struct file_system_type *fs);
2531extern struct file_system_type *get_fs_type(const char *name); 2489extern struct file_system_type *get_fs_type(const char *name);
2532extern struct super_block *get_super(struct block_device *); 2490extern struct super_block *get_super(struct block_device *);
2533extern struct super_block *get_active_super(struct block_device *bdev); 2491extern struct super_block *get_active_super(struct block_device *bdev);
2534extern struct super_block *user_get_super(dev_t);
2535extern void drop_super(struct super_block *sb); 2492extern void drop_super(struct super_block *sb);
2536extern void iterate_supers(void (*)(struct super_block *, void *), void *); 2493extern void iterate_supers(void (*)(struct super_block *, void *), void *);
2537extern void iterate_supers_type(struct file_system_type *, 2494extern void iterate_supers_type(struct file_system_type *,
@@ -2590,7 +2547,7 @@ extern void setattr_copy(struct inode *inode, const struct iattr *attr);
2590 2547
2591extern void file_update_time(struct file *file); 2548extern void file_update_time(struct file *file);
2592 2549
2593extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt); 2550extern int generic_show_options(struct seq_file *m, struct dentry *root);
2594extern void save_mount_options(struct super_block *sb, char *options); 2551extern void save_mount_options(struct super_block *sb, char *options);
2595extern void replace_mount_options(struct super_block *sb, char *options); 2552extern void replace_mount_options(struct super_block *sb, char *options);
2596 2553
@@ -2691,7 +2648,7 @@ int __init get_filesystem_list(char *buf);
2691#define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ 2648#define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \
2692 (flag & __FMODE_NONOTIFY))) 2649 (flag & __FMODE_NONOTIFY)))
2693 2650
2694static inline int is_sxid(mode_t mode) 2651static inline int is_sxid(umode_t mode)
2695{ 2652{
2696 return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP)); 2653 return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP));
2697} 2654}
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 6d18f3531f18..fe23ee768589 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -163,7 +163,7 @@ struct gendisk {
163 * disks that can't be partitioned. */ 163 * disks that can't be partitioned. */
164 164
165 char disk_name[DISK_NAME_LEN]; /* name of major driver */ 165 char disk_name[DISK_NAME_LEN]; /* name of major driver */
166 char *(*devnode)(struct gendisk *gd, mode_t *mode); 166 char *(*devnode)(struct gendisk *gd, umode_t *mode);
167 167
168 unsigned int events; /* supported events */ 168 unsigned int events; /* supported events */
169 unsigned int async_events; /* async events, subset of all */ 169 unsigned int async_events; /* async events, subset of all */
diff --git a/include/linux/gpio-pxa.h b/include/linux/gpio-pxa.h
new file mode 100644
index 000000000000..05071ee34c3f
--- /dev/null
+++ b/include/linux/gpio-pxa.h
@@ -0,0 +1,16 @@
1#ifndef __GPIO_PXA_H
2#define __GPIO_PXA_H
3
4#define GPIO_bit(x) (1 << ((x) & 0x1f))
5
6#define gpio_to_bank(gpio) ((gpio) >> 5)
7
8/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
9 * Those cases currently cause holes in the GPIO number space, the
10 * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
11 */
12extern int pxa_last_gpio;
13
14extern int pxa_irq_to_gpio(int irq);
15
16#endif /* __GPIO_PXA_H */
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 12ec328481de..62b908e0e591 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -35,7 +35,7 @@
35#include <linux/mod_devicetable.h> 35#include <linux/mod_devicetable.h>
36 36
37 37
38#define MAX_PAGE_BUFFER_COUNT 16 38#define MAX_PAGE_BUFFER_COUNT 18
39#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ 39#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
40 40
41#pragma pack(push, 1) 41#pragma pack(push, 1)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 07d103a06d64..8e25a9167f13 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -482,6 +482,19 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
482{ 482{
483 return adap->nr; 483 return adap->nr;
484} 484}
485
486/**
487 * module_i2c_driver() - Helper macro for registering a I2C driver
488 * @__i2c_driver: i2c_driver struct
489 *
490 * Helper macro for I2C drivers which do not do anything special in module
491 * init/exit. This eliminates a lot of boilerplate. Each module may only
492 * use this macro once, and calling it replaces module_init() and module_exit()
493 */
494#define module_i2c_driver(__i2c_driver) \
495 module_driver(__i2c_driver, i2c_add_driver, \
496 i2c_del_driver)
497
485#endif /* I2C */ 498#endif /* I2C */
486#endif /* __KERNEL__ */ 499#endif /* __KERNEL__ */
487 500
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 42557851b12e..501370b61ee5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -920,7 +920,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
920 920
921typedef struct { 921typedef struct {
922 const char *name; 922 const char *name;
923 mode_t mode; 923 umode_t mode;
924 const struct file_operations *proc_fops; 924 const struct file_operations *proc_fops;
925} ide_proc_entry_t; 925} ide_proc_entry_t;
926 926
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 32574eef9394..9c66b1ada9d7 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -23,11 +23,10 @@ extern struct files_struct init_files;
23extern struct fs_struct init_fs; 23extern struct fs_struct init_fs;
24 24
25#ifdef CONFIG_CGROUPS 25#ifdef CONFIG_CGROUPS
26#define INIT_THREADGROUP_FORK_LOCK(sig) \ 26#define INIT_GROUP_RWSEM(sig) \
27 .threadgroup_fork_lock = \ 27 .group_rwsem = __RWSEM_INITIALIZER(sig.group_rwsem),
28 __RWSEM_INITIALIZER(sig.threadgroup_fork_lock),
29#else 28#else
30#define INIT_THREADGROUP_FORK_LOCK(sig) 29#define INIT_GROUP_RWSEM(sig)
31#endif 30#endif
32 31
33#define INIT_SIGNALS(sig) { \ 32#define INIT_SIGNALS(sig) { \
@@ -46,7 +45,7 @@ extern struct fs_struct init_fs;
46 }, \ 45 }, \
47 .cred_guard_mutex = \ 46 .cred_guard_mutex = \
48 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ 47 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
49 INIT_THREADGROUP_FORK_LOCK(sig) \ 48 INIT_GROUP_RWSEM(sig) \
50} 49}
51 50
52extern struct nsproxy init_nsproxy; 51extern struct nsproxy init_nsproxy;
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 3b1594d662b0..30e816148df4 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -93,7 +93,7 @@ struct kern_ipc_perm
93 gid_t gid; 93 gid_t gid;
94 uid_t cuid; 94 uid_t cuid;
95 gid_t cgid; 95 gid_t cgid;
96 mode_t mode; 96 umode_t mode;
97 unsigned long seq; 97 unsigned long seq;
98 void *security; 98 void *security;
99}; 99};
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h
index f0a2f8b0aa13..2a8b1659bf35 100644
--- a/include/linux/iscsi_boot_sysfs.h
+++ b/include/linux/iscsi_boot_sysfs.h
@@ -91,7 +91,7 @@ struct iscsi_boot_kobj {
91 * The enum of the type. This can be any value of the above 91 * The enum of the type. This can be any value of the above
92 * properties. 92 * properties.
93 */ 93 */
94 mode_t (*is_visible) (void *data, int type); 94 umode_t (*is_visible) (void *data, int type);
95 95
96 /* 96 /*
97 * Driver specific release function. 97 * Driver specific release function.
@@ -110,20 +110,20 @@ struct iscsi_boot_kobj *
110iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, 110iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
111 void *data, 111 void *data,
112 ssize_t (*show) (void *data, int type, char *buf), 112 ssize_t (*show) (void *data, int type, char *buf),
113 mode_t (*is_visible) (void *data, int type), 113 umode_t (*is_visible) (void *data, int type),
114 void (*release) (void *data)); 114 void (*release) (void *data));
115 115
116struct iscsi_boot_kobj * 116struct iscsi_boot_kobj *
117iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, 117iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
118 void *data, 118 void *data,
119 ssize_t (*show) (void *data, int type, char *buf), 119 ssize_t (*show) (void *data, int type, char *buf),
120 mode_t (*is_visible) (void *data, int type), 120 umode_t (*is_visible) (void *data, int type),
121 void (*release) (void *data)); 121 void (*release) (void *data));
122struct iscsi_boot_kobj * 122struct iscsi_boot_kobj *
123iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, 123iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
124 void *data, 124 void *data,
125 ssize_t (*show) (void *data, int type, char *buf), 125 ssize_t (*show) (void *data, int type, char *buf),
126 mode_t (*is_visible) (void *data, int type), 126 umode_t (*is_visible) (void *data, int type),
127 void (*release) (void *data)); 127 void (*release) (void *data));
128 128
129struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); 129struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name);
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index c7acdde3243d..d211732b9e99 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -497,7 +497,6 @@ struct transaction_s
497 * @j_format_version: Version of the superblock format 497 * @j_format_version: Version of the superblock format
498 * @j_state_lock: Protect the various scalars in the journal 498 * @j_state_lock: Protect the various scalars in the journal
499 * @j_barrier_count: Number of processes waiting to create a barrier lock 499 * @j_barrier_count: Number of processes waiting to create a barrier lock
500 * @j_barrier: The barrier lock itself
501 * @j_running_transaction: The current running transaction.. 500 * @j_running_transaction: The current running transaction..
502 * @j_committing_transaction: the transaction we are pushing to disk 501 * @j_committing_transaction: the transaction we are pushing to disk
503 * @j_checkpoint_transactions: a linked circular list of all transactions 502 * @j_checkpoint_transactions: a linked circular list of all transactions
@@ -580,9 +579,6 @@ struct journal_s
580 */ 579 */
581 int j_barrier_count; 580 int j_barrier_count;
582 581
583 /* The barrier lock itself */
584 struct mutex j_barrier;
585
586 /* 582 /*
587 * Transactions: The current running transaction... 583 * Transactions: The current running transaction...
588 * [j_state_lock] [caller holding open handle] 584 * [j_state_lock] [caller holding open handle]
@@ -913,6 +909,7 @@ extern int journal_set_revoke(journal_t *, unsigned int, tid_t);
913extern int journal_test_revoke(journal_t *, unsigned int, tid_t); 909extern int journal_test_revoke(journal_t *, unsigned int, tid_t);
914extern void journal_clear_revoke(journal_t *); 910extern void journal_clear_revoke(journal_t *);
915extern void journal_switch_revoke_table(journal_t *journal); 911extern void journal_switch_revoke_table(journal_t *journal);
912extern void journal_clear_buffer_revoked_flags(journal_t *journal);
916 913
917/* 914/*
918 * The log thread user interface: 915 * The log thread user interface:
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index b16f65390734..722f477c4ef7 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -117,5 +117,7 @@ extern void usermodehelper_init(void);
117extern int usermodehelper_disable(void); 117extern int usermodehelper_disable(void);
118extern void usermodehelper_enable(void); 118extern void usermodehelper_enable(void);
119extern bool usermodehelper_is_disabled(void); 119extern bool usermodehelper_is_disabled(void);
120extern void read_lock_usermodehelper(void);
121extern void read_unlock_usermodehelper(void);
120 122
121#endif /* __LINUX_KMOD_H__ */ 123#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index ad81e1c51487..fc615a97e2d3 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -191,8 +191,6 @@ static inline struct kobj_type *get_ktype(struct kobject *kobj)
191} 191}
192 192
193extern struct kobject *kset_find_obj(struct kset *, const char *); 193extern struct kobject *kset_find_obj(struct kset *, const char *);
194extern struct kobject *kset_find_obj_hinted(struct kset *, const char *,
195 struct kobject *);
196 194
197/* The global /sys/kernel/ kobject for people to chain off of */ 195/* The global /sys/kernel/ kobject for people to chain off of */
198extern struct kobject *kernel_kobj; 196extern struct kobject *kernel_kobj;
diff --git a/include/linux/kref.h b/include/linux/kref.h
index d4a62ab2ee5e..abc0120b09b7 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -15,16 +15,81 @@
15#ifndef _KREF_H_ 15#ifndef _KREF_H_
16#define _KREF_H_ 16#define _KREF_H_
17 17
18#include <linux/types.h> 18#include <linux/bug.h>
19#include <linux/atomic.h>
19 20
20struct kref { 21struct kref {
21 atomic_t refcount; 22 atomic_t refcount;
22}; 23};
23 24
24void kref_init(struct kref *kref); 25/**
25void kref_get(struct kref *kref); 26 * kref_init - initialize object.
26int kref_put(struct kref *kref, void (*release) (struct kref *kref)); 27 * @kref: object in question.
27int kref_sub(struct kref *kref, unsigned int count, 28 */
28 void (*release) (struct kref *kref)); 29static inline void kref_init(struct kref *kref)
30{
31 atomic_set(&kref->refcount, 1);
32}
33
34/**
35 * kref_get - increment refcount for object.
36 * @kref: object.
37 */
38static inline void kref_get(struct kref *kref)
39{
40 WARN_ON(!atomic_read(&kref->refcount));
41 atomic_inc(&kref->refcount);
42}
29 43
44/**
45 * kref_sub - subtract a number of refcounts for object.
46 * @kref: object.
47 * @count: Number of recounts to subtract.
48 * @release: pointer to the function that will clean up the object when the
49 * last reference to the object is released.
50 * This pointer is required, and it is not acceptable to pass kfree
51 * in as this function. If the caller does pass kfree to this
52 * function, you will be publicly mocked mercilessly by the kref
53 * maintainer, and anyone else who happens to notice it. You have
54 * been warned.
55 *
56 * Subtract @count from the refcount, and if 0, call release().
57 * Return 1 if the object was removed, otherwise return 0. Beware, if this
58 * function returns 0, you still can not count on the kref from remaining in
59 * memory. Only use the return value if you want to see if the kref is now
60 * gone, not present.
61 */
62static inline int kref_sub(struct kref *kref, unsigned int count,
63 void (*release)(struct kref *kref))
64{
65 WARN_ON(release == NULL);
66
67 if (atomic_sub_and_test((int) count, &kref->refcount)) {
68 release(kref);
69 return 1;
70 }
71 return 0;
72}
73
74/**
75 * kref_put - decrement refcount for object.
76 * @kref: object.
77 * @release: pointer to the function that will clean up the object when the
78 * last reference to the object is released.
79 * This pointer is required, and it is not acceptable to pass kfree
80 * in as this function. If the caller does pass kfree to this
81 * function, you will be publicly mocked mercilessly by the kref
82 * maintainer, and anyone else who happens to notice it. You have
83 * been warned.
84 *
85 * Decrement the refcount, and if 0, call release().
86 * Return 1 if the object was removed, otherwise return 0. Beware, if this
87 * function returns 0, you still can not count on the kref from remaining in
88 * memory. Only use the return value if you want to see if the kref is now
89 * gone, not present.
90 */
91static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref))
92{
93 return kref_sub(kref, 1, release);
94}
30#endif /* _KREF_H_ */ 95#endif /* _KREF_H_ */
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 5cac19b3a266..0714b24c0e45 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -35,6 +35,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
35void kthread_bind(struct task_struct *k, unsigned int cpu); 35void kthread_bind(struct task_struct *k, unsigned int cpu);
36int kthread_stop(struct task_struct *k); 36int kthread_stop(struct task_struct *k);
37int kthread_should_stop(void); 37int kthread_should_stop(void);
38bool kthread_freezable_should_stop(bool *was_frozen);
38void *kthread_data(struct task_struct *k); 39void *kthread_data(struct task_struct *k);
39 40
40int kthreadd(void *unused); 41int kthreadd(void *unused);
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index c11ff2932549..efa1a6d7aca8 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -32,5 +32,16 @@ struct mbus_dram_target_info
32 } cs[4]; 32 } cs[4];
33}; 33};
34 34
35 35/*
36 * The Marvell mbus is to be found only on SOCs from the Orion family
37 * at the moment. Provide a dummy stub for other architectures.
38 */
39#ifdef CONFIG_PLAT_ORION
40extern const struct mbus_dram_target_info *mv_mbus_dram_info(void);
41#else
42static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
43{
44 return NULL;
45}
46#endif
36#endif 47#endif
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 935699b30b7c..1ac7f6e405f9 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -15,7 +15,6 @@
15#ifndef _LINUX_MEMORY_H_ 15#ifndef _LINUX_MEMORY_H_
16#define _LINUX_MEMORY_H_ 16#define _LINUX_MEMORY_H_
17 17
18#include <linux/sysdev.h>
19#include <linux/node.h> 18#include <linux/node.h>
20#include <linux/compiler.h> 19#include <linux/compiler.h>
21#include <linux/mutex.h> 20#include <linux/mutex.h>
@@ -38,7 +37,7 @@ struct memory_block {
38 int phys_device; /* to which fru does this belong? */ 37 int phys_device; /* to which fru does this belong? */
39 void *hw; /* optional pointer to fw/hw data */ 38 void *hw; /* optional pointer to fw/hw data */
40 int (*phys_callback)(struct memory_block *); 39 int (*phys_callback)(struct memory_block *);
41 struct sys_device sysdev; 40 struct device dev;
42}; 41};
43 42
44int arch_get_memory_phys_device(unsigned long start_pfn); 43int arch_get_memory_phys_device(unsigned long start_pfn);
diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h
new file mode 100644
index 000000000000..5702d1be13b4
--- /dev/null
+++ b/include/linux/mfd/da9052/da9052.h
@@ -0,0 +1,131 @@
1/*
2 * da9052 declarations for DA9052 PMICs.
3 *
4 * Copyright(c) 2011 Dialog Semiconductor Ltd.
5 *
6 * Author: David Dajun Chen <dchen@diasemi.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24#ifndef __MFD_DA9052_DA9052_H
25#define __MFD_DA9052_DA9052_H
26
27#include <linux/interrupt.h>
28#include <linux/regmap.h>
29#include <linux/slab.h>
30#include <linux/completion.h>
31#include <linux/list.h>
32#include <linux/mfd/core.h>
33
34#include <linux/mfd/da9052/reg.h>
35
36#define DA9052_IRQ_DCIN 0
37#define DA9052_IRQ_VBUS 1
38#define DA9052_IRQ_DCINREM 2
39#define DA9052_IRQ_VBUSREM 3
40#define DA9052_IRQ_VDDLOW 4
41#define DA9052_IRQ_ALARM 5
42#define DA9052_IRQ_SEQRDY 6
43#define DA9052_IRQ_COMP1V2 7
44#define DA9052_IRQ_NONKEY 8
45#define DA9052_IRQ_IDFLOAT 9
46#define DA9052_IRQ_IDGND 10
47#define DA9052_IRQ_CHGEND 11
48#define DA9052_IRQ_TBAT 12
49#define DA9052_IRQ_ADC_EOM 13
50#define DA9052_IRQ_PENDOWN 14
51#define DA9052_IRQ_TSIREADY 15
52#define DA9052_IRQ_GPI0 16
53#define DA9052_IRQ_GPI1 17
54#define DA9052_IRQ_GPI2 18
55#define DA9052_IRQ_GPI3 19
56#define DA9052_IRQ_GPI4 20
57#define DA9052_IRQ_GPI5 21
58#define DA9052_IRQ_GPI6 22
59#define DA9052_IRQ_GPI7 23
60#define DA9052_IRQ_GPI8 24
61#define DA9052_IRQ_GPI9 25
62#define DA9052_IRQ_GPI10 26
63#define DA9052_IRQ_GPI11 27
64#define DA9052_IRQ_GPI12 28
65#define DA9052_IRQ_GPI13 29
66#define DA9052_IRQ_GPI14 30
67#define DA9052_IRQ_GPI15 31
68
69enum da9052_chip_id {
70 DA9052,
71 DA9053_AA,
72 DA9053_BA,
73 DA9053_BB,
74};
75
76struct da9052_pdata;
77
78struct da9052 {
79 struct mutex io_lock;
80
81 struct device *dev;
82 struct regmap *regmap;
83
84 int irq_base;
85 u8 chip_id;
86
87 int chip_irq;
88};
89
90/* Device I/O API */
91static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg)
92{
93 int val, ret;
94
95 ret = regmap_read(da9052->regmap, reg, &val);
96 if (ret < 0)
97 return ret;
98 return val;
99}
100
101static inline int da9052_reg_write(struct da9052 *da9052, unsigned char reg,
102 unsigned char val)
103{
104 return regmap_write(da9052->regmap, reg, val);
105}
106
107static inline int da9052_group_read(struct da9052 *da9052, unsigned char reg,
108 unsigned reg_cnt, unsigned char *val)
109{
110 return regmap_bulk_read(da9052->regmap, reg, val, reg_cnt);
111}
112
113static inline int da9052_group_write(struct da9052 *da9052, unsigned char reg,
114 unsigned reg_cnt, unsigned char *val)
115{
116 return regmap_raw_write(da9052->regmap, reg, val, reg_cnt);
117}
118
119static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg,
120 unsigned char bit_mask,
121 unsigned char reg_val)
122{
123 return regmap_update_bits(da9052->regmap, reg, bit_mask, reg_val);
124}
125
126int da9052_device_init(struct da9052 *da9052, u8 chip_id);
127void da9052_device_exit(struct da9052 *da9052);
128
129extern struct regmap_config da9052_regmap_config;
130
131#endif /* __MFD_DA9052_DA9052_H */
diff --git a/include/linux/mfd/da9052/pdata.h b/include/linux/mfd/da9052/pdata.h
new file mode 100644
index 000000000000..62c5c3c2992e
--- /dev/null
+++ b/include/linux/mfd/da9052/pdata.h
@@ -0,0 +1,40 @@
1/*
2 * Platform data declarations for DA9052 PMICs.
3 *
4 * Copyright(c) 2011 Dialog Semiconductor Ltd.
5 *
6 * Author: David Dajun Chen <dchen@diasemi.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24#ifndef __MFD_DA9052_PDATA_H__
25#define __MFD_DA9052_PDATA_H__
26
27#define DA9052_MAX_REGULATORS 14
28
29struct da9052;
30
31struct da9052_pdata {
32 struct led_platform_data *pled;
33 int (*init) (struct da9052 *da9052);
34 int irq_base;
35 int gpio_base;
36 int use_for_apm;
37 struct regulator_init_data *regulators[DA9052_MAX_REGULATORS];
38};
39
40#endif
diff --git a/include/linux/mfd/da9052/reg.h b/include/linux/mfd/da9052/reg.h
new file mode 100644
index 000000000000..b97f7309d7f6
--- /dev/null
+++ b/include/linux/mfd/da9052/reg.h
@@ -0,0 +1,749 @@
1/*
2 * Register declarations for DA9052 PMICs.
3 *
4 * Copyright(c) 2011 Dialog Semiconductor Ltd.
5 *
6 * Author: David Dajun Chen <dchen@diasemi.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24#ifndef __LINUX_MFD_DA9052_REG_H
25#define __LINUX_MFD_DA9052_REG_H
26
27/* PAGE REGISTERS */
28#define DA9052_PAGE0_CON_REG 0
29#define DA9052_PAGE1_CON_REG 128
30
31/* STATUS REGISTERS */
32#define DA9052_STATUS_A_REG 1
33#define DA9052_STATUS_B_REG 2
34#define DA9052_STATUS_C_REG 3
35#define DA9052_STATUS_D_REG 4
36
37/* EVENT REGISTERS */
38#define DA9052_EVENT_A_REG 5
39#define DA9052_EVENT_B_REG 6
40#define DA9052_EVENT_C_REG 7
41#define DA9052_EVENT_D_REG 8
42#define DA9052_FAULTLOG_REG 9
43
44/* IRQ REGISTERS */
45#define DA9052_IRQ_MASK_A_REG 10
46#define DA9052_IRQ_MASK_B_REG 11
47#define DA9052_IRQ_MASK_C_REG 12
48#define DA9052_IRQ_MASK_D_REG 13
49
50/* CONTROL REGISTERS */
51#define DA9052_CONTROL_A_REG 14
52#define DA9052_CONTROL_B_REG 15
53#define DA9052_CONTROL_C_REG 16
54#define DA9052_CONTROL_D_REG 17
55
56#define DA9052_PDDIS_REG 18
57#define DA9052_INTERFACE_REG 19
58#define DA9052_RESET_REG 20
59
60/* GPIO REGISTERS */
61#define DA9052_GPIO_0_1_REG 21
62#define DA9052_GPIO_2_3_REG 22
63#define DA9052_GPIO_4_5_REG 23
64#define DA9052_GPIO_6_7_REG 24
65#define DA9052_GPIO_14_15_REG 28
66
67/* POWER SEQUENCER CONTROL REGISTERS */
68#define DA9052_ID_0_1_REG 29
69#define DA9052_ID_2_3_REG 30
70#define DA9052_ID_4_5_REG 31
71#define DA9052_ID_6_7_REG 32
72#define DA9052_ID_8_9_REG 33
73#define DA9052_ID_10_11_REG 34
74#define DA9052_ID_12_13_REG 35
75#define DA9052_ID_14_15_REG 36
76#define DA9052_ID_16_17_REG 37
77#define DA9052_ID_18_19_REG 38
78#define DA9052_ID_20_21_REG 39
79#define DA9052_SEQ_STATUS_REG 40
80#define DA9052_SEQ_A_REG 41
81#define DA9052_SEQ_B_REG 42
82#define DA9052_SEQ_TIMER_REG 43
83
84/* LDO AND BUCK REGISTERS */
85#define DA9052_BUCKA_REG 44
86#define DA9052_BUCKB_REG 45
87#define DA9052_BUCKCORE_REG 46
88#define DA9052_BUCKPRO_REG 47
89#define DA9052_BUCKMEM_REG 48
90#define DA9052_BUCKPERI_REG 49
91#define DA9052_LDO1_REG 50
92#define DA9052_LDO2_REG 51
93#define DA9052_LDO3_REG 52
94#define DA9052_LDO4_REG 53
95#define DA9052_LDO5_REG 54
96#define DA9052_LDO6_REG 55
97#define DA9052_LDO7_REG 56
98#define DA9052_LDO8_REG 57
99#define DA9052_LDO9_REG 58
100#define DA9052_LDO10_REG 59
101#define DA9052_SUPPLY_REG 60
102#define DA9052_PULLDOWN_REG 61
103#define DA9052_CHGBUCK_REG 62
104#define DA9052_WAITCONT_REG 63
105#define DA9052_ISET_REG 64
106#define DA9052_BATCHG_REG 65
107
108/* BATTERY CONTROL REGISTRS */
109#define DA9052_CHG_CONT_REG 66
110#define DA9052_INPUT_CONT_REG 67
111#define DA9052_CHG_TIME_REG 68
112#define DA9052_BBAT_CONT_REG 69
113
114/* LED CONTROL REGISTERS */
115#define DA9052_BOOST_REG 70
116#define DA9052_LED_CONT_REG 71
117#define DA9052_LEDMIN123_REG 72
118#define DA9052_LED1_CONF_REG 73
119#define DA9052_LED2_CONF_REG 74
120#define DA9052_LED3_CONF_REG 75
121#define DA9052_LED1CONT_REG 76
122#define DA9052_LED2CONT_REG 77
123#define DA9052_LED3CONT_REG 78
124#define DA9052_LED_CONT_4_REG 79
125#define DA9052_LED_CONT_5_REG 80
126
127/* ADC CONTROL REGISTERS */
128#define DA9052_ADC_MAN_REG 81
129#define DA9052_ADC_CONT_REG 82
130#define DA9052_ADC_RES_L_REG 83
131#define DA9052_ADC_RES_H_REG 84
132#define DA9052_VDD_RES_REG 85
133#define DA9052_VDD_MON_REG 86
134
135#define DA9052_ICHG_AV_REG 87
136#define DA9052_ICHG_THD_REG 88
137#define DA9052_ICHG_END_REG 89
138#define DA9052_TBAT_RES_REG 90
139#define DA9052_TBAT_HIGHP_REG 91
140#define DA9052_TBAT_HIGHN_REG 92
141#define DA9052_TBAT_LOW_REG 93
142#define DA9052_T_OFFSET_REG 94
143
144#define DA9052_ADCIN4_RES_REG 95
145#define DA9052_AUTO4_HIGH_REG 96
146#define DA9052_AUTO4_LOW_REG 97
147#define DA9052_ADCIN5_RES_REG 98
148#define DA9052_AUTO5_HIGH_REG 99
149#define DA9052_AUTO5_LOW_REG 100
150#define DA9052_ADCIN6_RES_REG 101
151#define DA9052_AUTO6_HIGH_REG 102
152#define DA9052_AUTO6_LOW_REG 103
153
154#define DA9052_TJUNC_RES_REG 104
155
156/* TSI CONTROL REGISTERS */
157#define DA9052_TSI_CONT_A_REG 105
158#define DA9052_TSI_CONT_B_REG 106
159#define DA9052_TSI_X_MSB_REG 107
160#define DA9052_TSI_Y_MSB_REG 108
161#define DA9052_TSI_LSB_REG 109
162#define DA9052_TSI_Z_MSB_REG 110
163
164/* RTC COUNT REGISTERS */
165#define DA9052_COUNT_S_REG 111
166#define DA9052_COUNT_MI_REG 112
167#define DA9052_COUNT_H_REG 113
168#define DA9052_COUNT_D_REG 114
169#define DA9052_COUNT_MO_REG 115
170#define DA9052_COUNT_Y_REG 116
171
172/* RTC CONTROL REGISTERS */
173#define DA9052_ALARM_MI_REG 117
174#define DA9052_ALARM_H_REG 118
175#define DA9052_ALARM_D_REG 119
176#define DA9052_ALARM_MO_REG 120
177#define DA9052_ALARM_Y_REG 121
178#define DA9052_SECOND_A_REG 122
179#define DA9052_SECOND_B_REG 123
180#define DA9052_SECOND_C_REG 124
181#define DA9052_SECOND_D_REG 125
182
183/* PAGE CONFIGURATION BIT */
184#define DA9052_PAGE_CONF 0X80
185
186/* STATUS REGISTER A BITS */
187#define DA9052_STATUSA_VDATDET 0X80
188#define DA9052_STATUSA_VBUSSEL 0X40
189#define DA9052_STATUSA_DCINSEL 0X20
190#define DA9052_STATUSA_VBUSDET 0X10
191#define DA9052_STATUSA_DCINDET 0X08
192#define DA9052_STATUSA_IDGND 0X04
193#define DA9052_STATUSA_IDFLOAT 0X02
194#define DA9052_STATUSA_NONKEY 0X01
195
196/* STATUS REGISTER B BITS */
197#define DA9052_STATUSB_COMPDET 0X80
198#define DA9052_STATUSB_SEQUENCING 0X40
199#define DA9052_STATUSB_GPFB2 0X20
200#define DA9052_STATUSB_CHGTO 0X10
201#define DA9052_STATUSB_CHGEND 0X08
202#define DA9052_STATUSB_CHGLIM 0X04
203#define DA9052_STATUSB_CHGPRE 0X02
204#define DA9052_STATUSB_CHGATT 0X01
205
206/* STATUS REGISTER C BITS */
207#define DA9052_STATUSC_GPI7 0X80
208#define DA9052_STATUSC_GPI6 0X40
209#define DA9052_STATUSC_GPI5 0X20
210#define DA9052_STATUSC_GPI4 0X10
211#define DA9052_STATUSC_GPI3 0X08
212#define DA9052_STATUSC_GPI2 0X04
213#define DA9052_STATUSC_GPI1 0X02
214#define DA9052_STATUSC_GPI0 0X01
215
216/* STATUS REGISTER D BITS */
217#define DA9052_STATUSD_GPI15 0X80
218#define DA9052_STATUSD_GPI14 0X40
219#define DA9052_STATUSD_GPI13 0X20
220#define DA9052_STATUSD_GPI12 0X10
221#define DA9052_STATUSD_GPI11 0X08
222#define DA9052_STATUSD_GPI10 0X04
223#define DA9052_STATUSD_GPI9 0X02
224#define DA9052_STATUSD_GPI8 0X01
225
226/* EVENT REGISTER A BITS */
227#define DA9052_EVENTA_ECOMP1V2 0X80
228#define DA9052_EVENTA_ESEQRDY 0X40
229#define DA9052_EVENTA_EALRAM 0X20
230#define DA9052_EVENTA_EVDDLOW 0X10
231#define DA9052_EVENTA_EVBUSREM 0X08
232#define DA9052_EVENTA_EDCINREM 0X04
233#define DA9052_EVENTA_EVBUSDET 0X02
234#define DA9052_EVENTA_EDCINDET 0X01
235
236/* EVENT REGISTER B BITS */
237#define DA9052_EVENTB_ETSIREADY 0X80
238#define DA9052_EVENTB_EPENDOWN 0X40
239#define DA9052_EVENTB_EADCEOM 0X20
240#define DA9052_EVENTB_ETBAT 0X10
241#define DA9052_EVENTB_ECHGEND 0X08
242#define DA9052_EVENTB_EIDGND 0X04
243#define DA9052_EVENTB_EIDFLOAT 0X02
244#define DA9052_EVENTB_ENONKEY 0X01
245
246/* EVENT REGISTER C BITS */
247#define DA9052_EVENTC_EGPI7 0X80
248#define DA9052_EVENTC_EGPI6 0X40
249#define DA9052_EVENTC_EGPI5 0X20
250#define DA9052_EVENTC_EGPI4 0X10
251#define DA9052_EVENTC_EGPI3 0X08
252#define DA9052_EVENTC_EGPI2 0X04
253#define DA9052_EVENTC_EGPI1 0X02
254#define DA9052_EVENTC_EGPI0 0X01
255
256/* EVENT REGISTER D BITS */
257#define DA9052_EVENTD_EGPI15 0X80
258#define DA9052_EVENTD_EGPI14 0X40
259#define DA9052_EVENTD_EGPI13 0X20
260#define DA9052_EVENTD_EGPI12 0X10
261#define DA9052_EVENTD_EGPI11 0X08
262#define DA9052_EVENTD_EGPI10 0X04
263#define DA9052_EVENTD_EGPI9 0X02
264#define DA9052_EVENTD_EGPI8 0X01
265
266/* IRQ MASK REGISTERS BITS */
267#define DA9052_M_NONKEY 0X0100
268
269/* TSI EVENT REGISTERS BITS */
270#define DA9052_E_PEN_DOWN 0X4000
271#define DA9052_E_TSI_READY 0X8000
272
273/* FAULT LOG REGISTER BITS */
274#define DA9052_FAULTLOG_WAITSET 0X80
275#define DA9052_FAULTLOG_NSDSET 0X40
276#define DA9052_FAULTLOG_KEYSHUT 0X20
277#define DA9052_FAULTLOG_TEMPOVER 0X08
278#define DA9052_FAULTLOG_VDDSTART 0X04
279#define DA9052_FAULTLOG_VDDFAULT 0X02
280#define DA9052_FAULTLOG_TWDERROR 0X01
281
282/* CONTROL REGISTER A BITS */
283#define DA9052_CONTROLA_GPIV 0X80
284#define DA9052_CONTROLA_PMOTYPE 0X20
285#define DA9052_CONTROLA_PMOV 0X10
286#define DA9052_CONTROLA_PMIV 0X08
287#define DA9052_CONTROLA_PMIFV 0X08
288#define DA9052_CONTROLA_PWR1EN 0X04
289#define DA9052_CONTROLA_PWREN 0X02
290#define DA9052_CONTROLA_SYSEN 0X01
291
292/* CONTROL REGISTER B BITS */
293#define DA9052_CONTROLB_SHUTDOWN 0X80
294#define DA9052_CONTROLB_DEEPSLEEP 0X40
295#define DA9052_CONTROL_B_WRITEMODE 0X20
296#define DA9052_CONTROLB_BBATEN 0X10
297#define DA9052_CONTROLB_OTPREADEN 0X08
298#define DA9052_CONTROLB_AUTOBOOT 0X04
299#define DA9052_CONTROLB_ACTDIODE 0X02
300#define DA9052_CONTROLB_BUCKMERGE 0X01
301
302/* CONTROL REGISTER C BITS */
303#define DA9052_CONTROLC_BLINKDUR 0X80
304#define DA9052_CONTROLC_BLINKFRQ 0X60
305#define DA9052_CONTROLC_DEBOUNCING 0X1C
306#define DA9052_CONTROLC_PMFB2PIN 0X02
307#define DA9052_CONTROLC_PMFB1PIN 0X01
308
309/* CONTROL REGISTER D BITS */
310#define DA9052_CONTROLD_WATCHDOG 0X80
311#define DA9052_CONTROLD_ACCDETEN 0X40
312#define DA9052_CONTROLD_GPI1415SD 0X20
313#define DA9052_CONTROLD_NONKEYSD 0X10
314#define DA9052_CONTROLD_KEEPACTEN 0X08
315#define DA9052_CONTROLD_TWDSCALE 0X07
316
317/* POWER DOWN DISABLE REGISTER BITS */
318#define DA9052_PDDIS_PMCONTPD 0X80
319#define DA9052_PDDIS_OUT32KPD 0X40
320#define DA9052_PDDIS_CHGBBATPD 0X20
321#define DA9052_PDDIS_CHGPD 0X10
322#define DA9052_PDDIS_HS2WIREPD 0X08
323#define DA9052_PDDIS_PMIFPD 0X04
324#define DA9052_PDDIS_GPADCPD 0X02
325#define DA9052_PDDIS_GPIOPD 0X01
326
327/* CONTROL REGISTER D BITS */
328#define DA9052_INTERFACE_IFBASEADDR 0XE0
329#define DA9052_INTERFACE_NCSPOL 0X10
330#define DA9052_INTERFACE_RWPOL 0X08
331#define DA9052_INTERFACE_CPHA 0X04
332#define DA9052_INTERFACE_CPOL 0X02
333#define DA9052_INTERFACE_IFTYPE 0X01
334
335/* CONTROL REGISTER D BITS */
336#define DA9052_RESET_RESETEVENT 0XC0
337#define DA9052_RESET_RESETTIMER 0X3F
338
339/* GPIO REGISTERS */
340/* GPIO CONTROL REGISTER BITS */
341#define DA9052_GPIO_EVEN_PORT_PIN 0X03
342#define DA9052_GPIO_EVEN_PORT_TYPE 0X04
343#define DA9052_GPIO_EVEN_PORT_MODE 0X08
344
345#define DA9052_GPIO_ODD_PORT_PIN 0X30
346#define DA9052_GPIO_ODD_PORT_TYPE 0X40
347#define DA9052_GPIO_ODD_PORT_MODE 0X80
348
349/*POWER SEQUENCER REGISTER BITS */
350/* SEQ CONTROL REGISTER BITS FOR ID 0 AND 1 */
351#define DA9052_ID01_LDO1STEP 0XF0
352#define DA9052_ID01_SYSPRE 0X04
353#define DA9052_ID01_DEFSUPPLY 0X02
354#define DA9052_ID01_NRESMODE 0X01
355
356/* SEQ CONTROL REGISTER BITS FOR ID 2 AND 3 */
357#define DA9052_ID23_LDO3STEP 0XF0
358#define DA9052_ID23_LDO2STEP 0X0F
359
360/* SEQ CONTROL REGISTER BITS FOR ID 4 AND 5 */
361#define DA9052_ID45_LDO5STEP 0XF0
362#define DA9052_ID45_LDO4STEP 0X0F
363
364/* SEQ CONTROL REGISTER BITS FOR ID 6 AND 7 */
365#define DA9052_ID67_LDO7STEP 0XF0
366#define DA9052_ID67_LDO6STEP 0X0F
367
368/* SEQ CONTROL REGISTER BITS FOR ID 8 AND 9 */
369#define DA9052_ID89_LDO9STEP 0XF0
370#define DA9052_ID89_LDO8STEP 0X0F
371
372/* SEQ CONTROL REGISTER BITS FOR ID 10 AND 11 */
373#define DA9052_ID1011_PDDISSTEP 0XF0
374#define DA9052_ID1011_LDO10STEP 0X0F
375
376/* SEQ CONTROL REGISTER BITS FOR ID 12 AND 13 */
377#define DA9052_ID1213_VMEMSWSTEP 0XF0
378#define DA9052_ID1213_VPERISWSTEP 0X0F
379
380/* SEQ CONTROL REGISTER BITS FOR ID 14 AND 15 */
381#define DA9052_ID1415_BUCKPROSTEP 0XF0
382#define DA9052_ID1415_BUCKCORESTEP 0X0F
383
384/* SEQ CONTROL REGISTER BITS FOR ID 16 AND 17 */
385#define DA9052_ID1617_BUCKPERISTEP 0XF0
386#define DA9052_ID1617_BUCKMEMSTEP 0X0F
387
388/* SEQ CONTROL REGISTER BITS FOR ID 18 AND 19 */
389#define DA9052_ID1819_GPRISE2STEP 0XF0
390#define DA9052_ID1819_GPRISE1STEP 0X0F
391
392/* SEQ CONTROL REGISTER BITS FOR ID 20 AND 21 */
393#define DA9052_ID2021_GPFALL2STEP 0XF0
394#define DA9052_ID2021_GPFALL1STEP 0X0F
395
396/* POWER SEQ STATUS REGISTER BITS */
397#define DA9052_SEQSTATUS_SEQPOINTER 0XF0
398#define DA9052_SEQSTATUS_WAITSTEP 0X0F
399
400/* POWER SEQ A REGISTER BITS */
401#define DA9052_SEQA_POWEREND 0XF0
402#define DA9052_SEQA_SYSTEMEND 0X0F
403
404/* POWER SEQ B REGISTER BITS */
405#define DA9052_SEQB_PARTDOWN 0XF0
406#define DA9052_SEQB_MAXCOUNT 0X0F
407
408/* POWER SEQ TIMER REGISTER BITS */
409#define DA9052_SEQTIMER_SEQDUMMY 0XF0
410#define DA9052_SEQTIMER_SEQTIME 0X0F
411
412/*POWER SUPPLY CONTROL REGISTER BITS */
413/* BUCK REGISTER A BITS */
414#define DA9052_BUCKA_BPROILIM 0XC0
415#define DA9052_BUCKA_BPROMODE 0X30
416#define DA9052_BUCKA_BCOREILIM 0X0C
417#define DA9052_BUCKA_BCOREMODE 0X03
418
419/* BUCK REGISTER B BITS */
420#define DA9052_BUCKB_BERIILIM 0XC0
421#define DA9052_BUCKB_BPERIMODE 0X30
422#define DA9052_BUCKB_BMEMILIM 0X0C
423#define DA9052_BUCKB_BMEMMODE 0X03
424
425/* BUCKCORE REGISTER BITS */
426#define DA9052_BUCKCORE_BCORECONF 0X80
427#define DA9052_BUCKCORE_BCOREEN 0X40
428#define DA9052_BUCKCORE_VBCORE 0X3F
429
430/* BUCKPRO REGISTER BITS */
431#define DA9052_BUCKPRO_BPROCONF 0X80
432#define DA9052_BUCKPRO_BPROEN 0X40
433#define DA9052_BUCKPRO_VBPRO 0X3F
434
435/* BUCKMEM REGISTER BITS */
436#define DA9052_BUCKMEM_BMEMCONF 0X80
437#define DA9052_BUCKMEM_BMEMEN 0X40
438#define DA9052_BUCKMEM_VBMEM 0X3F
439
440/* BUCKPERI REGISTER BITS */
441#define DA9052_BUCKPERI_BPERICONF 0X80
442#define DA9052_BUCKPERI_BPERIEN 0X40
443#define DA9052_BUCKPERI_BPERIHS 0X20
444#define DA9052_BUCKPERI_VBPERI 0X1F
445
446/* LDO1 REGISTER BITS */
447#define DA9052_LDO1_LDO1CONF 0X80
448#define DA9052_LDO1_LDO1EN 0X40
449#define DA9052_LDO1_VLDO1 0X1F
450
451/* LDO2 REGISTER BITS */
452#define DA9052_LDO2_LDO2CONF 0X80
453#define DA9052_LDO2_LDO2EN 0X40
454#define DA9052_LDO2_VLDO2 0X3F
455
456/* LDO3 REGISTER BITS */
457#define DA9052_LDO3_LDO3CONF 0X80
458#define DA9052_LDO3_LDO3EN 0X40
459#define DA9052_LDO3_VLDO3 0X3F
460
461/* LDO4 REGISTER BITS */
462#define DA9052_LDO4_LDO4CONF 0X80
463#define DA9052_LDO4_LDO4EN 0X40
464#define DA9052_LDO4_VLDO4 0X3F
465
466/* LDO5 REGISTER BITS */
467#define DA9052_LDO5_LDO5CONF 0X80
468#define DA9052_LDO5_LDO5EN 0X40
469#define DA9052_LDO5_VLDO5 0X3F
470
471/* LDO6 REGISTER BITS */
472#define DA9052_LDO6_LDO6CONF 0X80
473#define DA9052_LDO6_LDO6EN 0X40
474#define DA9052_LDO6_VLDO6 0X3F
475
476/* LDO7 REGISTER BITS */
477#define DA9052_LDO7_LDO7CONF 0X80
478#define DA9052_LDO7_LDO7EN 0X40
479#define DA9052_LDO7_VLDO7 0X3F
480
481/* LDO8 REGISTER BITS */
482#define DA9052_LDO8_LDO8CONF 0X80
483#define DA9052_LDO8_LDO8EN 0X40
484#define DA9052_LDO8_VLDO8 0X3F
485
486/* LDO9 REGISTER BITS */
487#define DA9052_LDO9_LDO9CONF 0X80
488#define DA9052_LDO9_LDO9EN 0X40
489#define DA9052_LDO9_VLDO9 0X3F
490
491/* LDO10 REGISTER BITS */
492#define DA9052_LDO10_LDO10CONF 0X80
493#define DA9052_LDO10_LDO10EN 0X40
494#define DA9052_LDO10_VLDO10 0X3F
495
496/* SUPPLY REGISTER BITS */
497#define DA9052_SUPPLY_VLOCK 0X80
498#define DA9052_SUPPLY_VMEMSWEN 0X40
499#define DA9052_SUPPLY_VPERISWEN 0X20
500#define DA9052_SUPPLY_VLDO3GO 0X10
501#define DA9052_SUPPLY_VLDO2GO 0X08
502#define DA9052_SUPPLY_VBMEMGO 0X04
503#define DA9052_SUPPLY_VBPROGO 0X02
504#define DA9052_SUPPLY_VBCOREGO 0X01
505
506/* PULLDOWN REGISTER BITS */
507#define DA9052_PULLDOWN_LDO5PDDIS 0X20
508#define DA9052_PULLDOWN_LDO2PDDIS 0X10
509#define DA9052_PULLDOWN_LDO1PDDIS 0X08
510#define DA9052_PULLDOWN_MEMPDDIS 0X04
511#define DA9052_PULLDOWN_PROPDDIS 0X02
512#define DA9052_PULLDOWN_COREPDDIS 0X01
513
514/* BAT CHARGER REGISTER BITS */
515/* CHARGER BUCK REGISTER BITS */
516#define DA9052_CHGBUCK_CHGTEMP 0X80
517#define DA9052_CHGBUCK_CHGUSBILIM 0X40
518#define DA9052_CHGBUCK_CHGBUCKLP 0X20
519#define DA9052_CHGBUCK_CHGBUCKEN 0X10
520#define DA9052_CHGBUCK_ISETBUCK 0X0F
521
522/* WAIT COUNTER REGISTER BITS */
523#define DA9052_WAITCONT_WAITDIR 0X80
524#define DA9052_WAITCONT_RTCCLOCK 0X40
525#define DA9052_WAITCONT_WAITMODE 0X20
526#define DA9052_WAITCONT_EN32KOUT 0X10
527#define DA9052_WAITCONT_DELAYTIME 0X0F
528
529/* ISET CONTROL REGISTER BITS */
530#define DA9052_ISET_ISETDCIN 0XF0
531#define DA9052_ISET_ISETVBUS 0X0F
532
533/* BATTERY CHARGER CONTROL REGISTER BITS */
534#define DA9052_BATCHG_ICHGPRE 0XC0
535#define DA9052_BATCHG_ICHGBAT 0X3F
536
537/* CHARGER COUNTER REGISTER BITS */
538#define DA9052_CHG_CONT_VCHG_BAT 0XF8
539#define DA9052_CHG_CONT_TCTR 0X07
540
541/* INPUT CONTROL REGISTER BITS */
542#define DA9052_INPUT_CONT_TCTR_MODE 0X80
543#define DA9052_INPUT_CONT_VBUS_SUSP 0X10
544#define DA9052_INPUT_CONT_DCIN_SUSP 0X08
545
546/* CHARGING TIME REGISTER BITS */
547#define DA9052_CHGTIME_CHGTIME 0XFF
548
549/* BACKUP BATTERY CONTROL REGISTER BITS */
550#define DA9052_BBATCONT_BCHARGERISET 0XF0
551#define DA9052_BBATCONT_BCHARGERVSET 0X0F
552
553/* LED REGISTERS BITS */
554/* LED BOOST REGISTER BITS */
555#define DA9052_BOOST_EBFAULT 0X80
556#define DA9052_BOOST_MBFAULT 0X40
557#define DA9052_BOOST_BOOSTFRQ 0X20
558#define DA9052_BOOST_BOOSTILIM 0X10
559#define DA9052_BOOST_LED3INEN 0X08
560#define DA9052_BOOST_LED2INEN 0X04
561#define DA9052_BOOST_LED1INEN 0X02
562#define DA9052_BOOST_BOOSTEN 0X01
563
564/* LED CONTROL REGISTER BITS */
565#define DA9052_LEDCONT_SELLEDMODE 0X80
566#define DA9052_LEDCONT_LED3ICONT 0X40
567#define DA9052_LEDCONT_LED3RAMP 0X20
568#define DA9052_LEDCONT_LED3EN 0X10
569#define DA9052_LEDCONT_LED2RAMP 0X08
570#define DA9052_LEDCONT_LED2EN 0X04
571#define DA9052_LEDCONT_LED1RAMP 0X02
572#define DA9052_LEDCONT_LED1EN 0X01
573
574/* LEDMIN123 REGISTER BIT */
575#define DA9052_LEDMIN123_LEDMINCURRENT 0XFF
576
577/* LED1CONF REGISTER BIT */
578#define DA9052_LED1CONF_LED1CURRENT 0XFF
579
580/* LED2CONF REGISTER BIT */
581#define DA9052_LED2CONF_LED2CURRENT 0XFF
582
583/* LED3CONF REGISTER BIT */
584#define DA9052_LED3CONF_LED3CURRENT 0XFF
585
586/* LED COUNT REGISTER BIT */
587#define DA9052_LED_CONT_DIM 0X80
588
589/* ADC MAN REGISTERS BITS */
590#define DA9052_ADC_MAN_MAN_CONV 0X10
591#define DA9052_ADC_MAN_MUXSEL_VDDOUT 0X00
592#define DA9052_ADC_MAN_MUXSEL_ICH 0X01
593#define DA9052_ADC_MAN_MUXSEL_TBAT 0X02
594#define DA9052_ADC_MAN_MUXSEL_VBAT 0X03
595#define DA9052_ADC_MAN_MUXSEL_AD4 0X04
596#define DA9052_ADC_MAN_MUXSEL_AD5 0X05
597#define DA9052_ADC_MAN_MUXSEL_AD6 0X06
598#define DA9052_ADC_MAN_MUXSEL_VBBAT 0X09
599
600/* ADC CONTROL REGSISTERS BITS */
601#define DA9052_ADCCONT_COMP1V2EN 0X80
602#define DA9052_ADCCONT_ADCMODE 0X40
603#define DA9052_ADCCONT_TBATISRCEN 0X20
604#define DA9052_ADCCONT_AD4ISRCEN 0X10
605#define DA9052_ADCCONT_AUTOAD6EN 0X08
606#define DA9052_ADCCONT_AUTOAD5EN 0X04
607#define DA9052_ADCCONT_AUTOAD4EN 0X02
608#define DA9052_ADCCONT_AUTOVDDEN 0X01
609
610/* ADC 10 BIT MANUAL CONVERSION RESULT LOW REGISTER */
611#define DA9052_ADC_RES_LSB 0X03
612
613/* ADC 10 BIT MANUAL CONVERSION RESULT HIGH REGISTER */
614#define DA9052_ADCRESH_ADCRESMSB 0XFF
615
616/* VDD RES REGSISTER BIT*/
617#define DA9052_VDDRES_VDDOUTRES 0XFF
618
619/* VDD MON REGSISTER BIT */
620#define DA9052_VDDMON_VDDOUTMON 0XFF
621
622/* ICHG_AV REGSISTER BIT */
623#define DA9052_ICHGAV_ICHGAV 0XFF
624
625/* ICHG_THD REGSISTER BIT */
626#define DA9052_ICHGTHD_ICHGTHD 0XFF
627
628/* ICHG_END REGSISTER BIT */
629#define DA9052_ICHGEND_ICHGEND 0XFF
630
631/* TBAT_RES REGSISTER BIT */
632#define DA9052_TBATRES_TBATRES 0XFF
633
634/* TBAT_HIGHP REGSISTER BIT */
635#define DA9052_TBATHIGHP_TBATHIGHP 0XFF
636
637/* TBAT_HIGHN REGSISTER BIT */
638#define DA9052_TBATHIGHN_TBATHIGHN 0XFF
639
640/* TBAT_LOW REGSISTER BIT */
641#define DA9052_TBATLOW_TBATLOW 0XFF
642
643/* T_OFFSET REGSISTER BIT */
644#define DA9052_TOFFSET_TOFFSET 0XFF
645
646/* ADCIN4_RES REGSISTER BIT */
647#define DA9052_ADCIN4RES_ADCIN4RES 0XFF
648
649/* ADCIN4_HIGH REGSISTER BIT */
650#define DA9052_AUTO4HIGH_AUTO4HIGH 0XFF
651
652/* ADCIN4_LOW REGSISTER BIT */
653#define DA9052_AUTO4LOW_AUTO4LOW 0XFF
654
655/* ADCIN5_RES REGSISTER BIT */
656#define DA9052_ADCIN5RES_ADCIN5RES 0XFF
657
658/* ADCIN5_HIGH REGSISTER BIT */
659#define DA9052_AUTO5HIGH_AUTOHIGH 0XFF
660
661/* ADCIN5_LOW REGSISTER BIT */
662#define DA9052_AUTO5LOW_AUTO5LOW 0XFF
663
664/* ADCIN6_RES REGSISTER BIT */
665#define DA9052_ADCIN6RES_ADCIN6RES 0XFF
666
667/* ADCIN6_HIGH REGSISTER BIT */
668#define DA9052_AUTO6HIGH_AUTO6HIGH 0XFF
669
670/* ADCIN6_LOW REGSISTER BIT */
671#define DA9052_AUTO6LOW_AUTO6LOW 0XFF
672
673/* TJUNC_RES REGSISTER BIT*/
674#define DA9052_TJUNCRES_TJUNCRES 0XFF
675
676/* TSI REGISTER */
677/* TSI CONTROL REGISTER A BITS */
678#define DA9052_TSICONTA_TSIDELAY 0XC0
679#define DA9052_TSICONTA_TSISKIP 0X38
680#define DA9052_TSICONTA_TSIMODE 0X04
681#define DA9052_TSICONTA_PENDETEN 0X02
682#define DA9052_TSICONTA_AUTOTSIEN 0X01
683
684/* TSI CONTROL REGISTER B BITS */
685#define DA9052_TSICONTB_ADCREF 0X80
686#define DA9052_TSICONTB_TSIMAN 0X40
687#define DA9052_TSICONTB_TSIMUX 0X30
688#define DA9052_TSICONTB_TSISEL3 0X08
689#define DA9052_TSICONTB_TSISEL2 0X04
690#define DA9052_TSICONTB_TSISEL1 0X02
691#define DA9052_TSICONTB_TSISEL0 0X01
692
693/* TSI X CO-ORDINATE MSB RESULT REGISTER BITS */
694#define DA9052_TSIXMSB_TSIXM 0XFF
695
696/* TSI Y CO-ORDINATE MSB RESULT REGISTER BITS */
697#define DA9052_TSIYMSB_TSIYM 0XFF
698
699/* TSI CO-ORDINATE LSB RESULT REGISTER BITS */
700#define DA9052_TSILSB_PENDOWN 0X40
701#define DA9052_TSILSB_TSIZL 0X30
702#define DA9052_TSILSB_TSIYL 0X0C
703#define DA9052_TSILSB_TSIXL 0X03
704
705/* TSI Z MEASUREMENT MSB RESULT REGISTER BIT */
706#define DA9052_TSIZMSB_TSIZM 0XFF
707
708/* RTC REGISTER */
709/* RTC TIMER SECONDS REGISTER BITS */
710#define DA9052_COUNTS_MONITOR 0X40
711#define DA9052_RTC_SEC 0X3F
712
713/* RTC TIMER MINUTES REGISTER BIT */
714#define DA9052_RTC_MIN 0X3F
715
716/* RTC TIMER HOUR REGISTER BIT */
717#define DA9052_RTC_HOUR 0X1F
718
719/* RTC TIMER DAYS REGISTER BIT */
720#define DA9052_RTC_DAY 0X1F
721
722/* RTC TIMER MONTHS REGISTER BIT */
723#define DA9052_RTC_MONTH 0X0F
724
725/* RTC TIMER YEARS REGISTER BIT */
726#define DA9052_RTC_YEAR 0X3F
727
728/* RTC ALARM MINUTES REGISTER BITS */
729#define DA9052_ALARMM_I_TICK_TYPE 0X80
730#define DA9052_ALARMMI_ALARMTYPE 0X40
731
732/* RTC ALARM YEARS REGISTER BITS */
733#define DA9052_ALARM_Y_TICK_ON 0X80
734#define DA9052_ALARM_Y_ALARM_ON 0X40
735
736/* RTC SECONDS REGISTER A BITS */
737#define DA9052_SECONDA_SECONDSA 0XFF
738
739/* RTC SECONDS REGISTER B BITS */
740#define DA9052_SECONDB_SECONDSB 0XFF
741
742/* RTC SECONDS REGISTER C BITS */
743#define DA9052_SECONDC_SECONDSC 0XFF
744
745/* RTC SECONDS REGISTER D BITS */
746#define DA9052_SECONDD_SECONDSD 0XFF
747
748#endif
749/* __LINUX_MFD_DA9052_REG_H */
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index c41d7270c6c6..32085249e9cb 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -54,7 +54,7 @@ struct miscdevice {
54 struct device *parent; 54 struct device *parent;
55 struct device *this_device; 55 struct device *this_device;
56 const char *nodename; 56 const char *nodename;
57 mode_t mode; 57 umode_t mode;
58}; 58};
59 59
60extern int misc_register(struct miscdevice * misc); 60extern int misc_register(struct miscdevice * misc);
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 29304855652d..5a8e3903d770 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -2,39 +2,16 @@
2#define _NAMESPACE_H_ 2#define _NAMESPACE_H_
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/path.h> 5struct mnt_namespace;
6#include <linux/seq_file.h>
7#include <linux/wait.h>
8
9struct mnt_namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
13 wait_queue_head_t poll;
14 int event;
15};
16
17struct proc_mounts {
18 struct seq_file m; /* must be the first element */
19 struct mnt_namespace *ns;
20 struct path root;
21};
22
23struct fs_struct; 6struct fs_struct;
24 7
25extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt);
26extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, 8extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
27 struct fs_struct *); 9 struct fs_struct *);
28extern void put_mnt_ns(struct mnt_namespace *ns); 10extern void put_mnt_ns(struct mnt_namespace *ns);
29static inline void get_mnt_ns(struct mnt_namespace *ns)
30{
31 atomic_inc(&ns->count);
32}
33 11
34extern const struct seq_operations mounts_op; 12extern const struct file_operations proc_mounts_operations;
35extern const struct seq_operations mountinfo_op; 13extern const struct file_operations proc_mountinfo_operations;
36extern const struct seq_operations mountstats_op; 14extern const struct file_operations proc_mountstats_operations;
37extern int mnt_had_events(struct proc_mounts *);
38 15
39#endif 16#endif
40#endif 17#endif
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 33fe53d78110..d7029f4a191a 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -47,45 +47,10 @@ struct mnt_namespace;
47 47
48#define MNT_INTERNAL 0x4000 48#define MNT_INTERNAL 0x4000
49 49
50struct mnt_pcp {
51 int mnt_count;
52 int mnt_writers;
53};
54
55struct vfsmount { 50struct vfsmount {
56 struct list_head mnt_hash;
57 struct vfsmount *mnt_parent; /* fs we are mounted on */
58 struct dentry *mnt_mountpoint; /* dentry of mountpoint */
59 struct dentry *mnt_root; /* root of the mounted tree */ 51 struct dentry *mnt_root; /* root of the mounted tree */
60 struct super_block *mnt_sb; /* pointer to superblock */ 52 struct super_block *mnt_sb; /* pointer to superblock */
61#ifdef CONFIG_SMP
62 struct mnt_pcp __percpu *mnt_pcp;
63 atomic_t mnt_longterm; /* how many of the refs are longterm */
64#else
65 int mnt_count;
66 int mnt_writers;
67#endif
68 struct list_head mnt_mounts; /* list of children, anchored here */
69 struct list_head mnt_child; /* and going through their mnt_child */
70 int mnt_flags; 53 int mnt_flags;
71 /* 4 bytes hole on 64bits arches without fsnotify */
72#ifdef CONFIG_FSNOTIFY
73 __u32 mnt_fsnotify_mask;
74 struct hlist_head mnt_fsnotify_marks;
75#endif
76 const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
77 struct list_head mnt_list;
78 struct list_head mnt_expire; /* link in fs-specific expiry list */
79 struct list_head mnt_share; /* circular list of shared mounts */
80 struct list_head mnt_slave_list;/* list of slave mounts */
81 struct list_head mnt_slave; /* slave list entry */
82 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
83 struct mnt_namespace *mnt_ns; /* containing namespace */
84 int mnt_id; /* mount identifier */
85 int mnt_group_id; /* peer group identifier */
86 int mnt_expiry_mark; /* true if marked for expiry */
87 int mnt_pinned;
88 int mnt_ghosts;
89}; 54};
90 55
91struct file; /* forward dec */ 56struct file; /* forward dec */
@@ -94,15 +59,13 @@ extern int mnt_want_write(struct vfsmount *mnt);
94extern int mnt_want_write_file(struct file *file); 59extern int mnt_want_write_file(struct file *file);
95extern int mnt_clone_write(struct vfsmount *mnt); 60extern int mnt_clone_write(struct vfsmount *mnt);
96extern void mnt_drop_write(struct vfsmount *mnt); 61extern void mnt_drop_write(struct vfsmount *mnt);
62extern void mnt_drop_write_file(struct file *file);
97extern void mntput(struct vfsmount *mnt); 63extern void mntput(struct vfsmount *mnt);
98extern struct vfsmount *mntget(struct vfsmount *mnt); 64extern struct vfsmount *mntget(struct vfsmount *mnt);
99extern void mnt_pin(struct vfsmount *mnt); 65extern void mnt_pin(struct vfsmount *mnt);
100extern void mnt_unpin(struct vfsmount *mnt); 66extern void mnt_unpin(struct vfsmount *mnt);
101extern int __mnt_is_readonly(struct vfsmount *mnt); 67extern int __mnt_is_readonly(struct vfsmount *mnt);
102 68
103extern struct vfsmount *do_kern_mount(const char *fstype, int flags,
104 const char *name, void *data);
105
106struct file_system_type; 69struct file_system_type;
107extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, 70extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
108 int flags, const char *name, 71 int flags, const char *name,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d0522bb2d4a0..0eac07c95255 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2155,7 +2155,7 @@ extern void netdev_run_todo(void);
2155 */ 2155 */
2156static inline void dev_put(struct net_device *dev) 2156static inline void dev_put(struct net_device *dev)
2157{ 2157{
2158 irqsafe_cpu_dec(*dev->pcpu_refcnt); 2158 this_cpu_dec(*dev->pcpu_refcnt);
2159} 2159}
2160 2160
2161/** 2161/**
@@ -2166,7 +2166,7 @@ static inline void dev_put(struct net_device *dev)
2166 */ 2166 */
2167static inline void dev_hold(struct net_device *dev) 2167static inline void dev_hold(struct net_device *dev)
2168{ 2168{
2169 irqsafe_cpu_inc(*dev->pcpu_refcnt); 2169 this_cpu_inc(*dev->pcpu_refcnt);
2170} 2170}
2171 2171
2172/* Carrier loss detection, dial on demand. The functions netif_carrier_on 2172/* Carrier loss detection, dial on demand. The functions netif_carrier_on
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 32cddf78b13e..8d674a786744 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -471,7 +471,7 @@ DECLARE_PER_CPU(seqcount_t, xt_recseq);
471 * 471 *
472 * Begin packet processing : all readers must wait the end 472 * Begin packet processing : all readers must wait the end
473 * 1) Must be called with preemption disabled 473 * 1) Must be called with preemption disabled
474 * 2) softirqs must be disabled too (or we should use irqsafe_cpu_add()) 474 * 2) softirqs must be disabled too (or we should use this_cpu_add())
475 * Returns : 475 * Returns :
476 * 1 if no recursion on this cpu 476 * 1 if no recursion on this cpu
477 * 0 if recursion detected 477 * 0 if recursion detected
@@ -503,7 +503,7 @@ static inline unsigned int xt_write_recseq_begin(void)
503 * 503 *
504 * End packet processing : all readers can proceed 504 * End packet processing : all readers can proceed
505 * 1) Must be called with preemption disabled 505 * 1) Must be called with preemption disabled
506 * 2) softirqs must be disabled too (or we should use irqsafe_cpu_add()) 506 * 2) softirqs must be disabled too (or we should use this_cpu_add())
507 */ 507 */
508static inline void xt_write_recseq_end(unsigned int addend) 508static inline void xt_write_recseq_end(unsigned int addend)
509{ 509{
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 92ecf5585fac..8c29950d2fa5 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -373,7 +373,7 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
373extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 373extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
374extern void put_nfs_open_context(struct nfs_open_context *ctx); 374extern void put_nfs_open_context(struct nfs_open_context *ctx);
375extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 375extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
376extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode); 376extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode);
377extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 377extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
378extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 378extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
379extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 379extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
diff --git a/include/linux/nls.h b/include/linux/nls.h
index d47beef08dfd..5dc635f8d79e 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -43,7 +43,7 @@ enum utf16_endian {
43 UTF16_BIG_ENDIAN 43 UTF16_BIG_ENDIAN
44}; 44};
45 45
46/* nls.c */ 46/* nls_base.c */
47extern int register_nls(struct nls_table *); 47extern int register_nls(struct nls_table *);
48extern int unregister_nls(struct nls_table *); 48extern int unregister_nls(struct nls_table *);
49extern struct nls_table *load_nls(char *); 49extern struct nls_table *load_nls(char *);
@@ -52,7 +52,8 @@ extern struct nls_table *load_nls_default(void);
52 52
53extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); 53extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu);
54extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); 54extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen);
55extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs); 55extern int utf8s_to_utf16s(const u8 *s, int len,
56 enum utf16_endian endian, wchar_t *pwcs, int maxlen);
56extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, 57extern int utf16s_to_utf8s(const wchar_t *pwcs, int len,
57 enum utf16_endian endian, u8 *s, int maxlen); 58 enum utf16_endian endian, u8 *s, int maxlen);
58 59
diff --git a/include/linux/node.h b/include/linux/node.h
index 92370e22343c..624e53cecc02 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -14,12 +14,12 @@
14#ifndef _LINUX_NODE_H_ 14#ifndef _LINUX_NODE_H_
15#define _LINUX_NODE_H_ 15#define _LINUX_NODE_H_
16 16
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/cpumask.h> 18#include <linux/cpumask.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20 20
21struct node { 21struct node {
22 struct sys_device sysdev; 22 struct device dev;
23 23
24#if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS) 24#if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS)
25 struct work_struct node_work; 25 struct work_struct node_work;
@@ -80,6 +80,6 @@ static inline void register_hugetlbfs_with_node(node_registration_func_t reg,
80} 80}
81#endif 81#endif
82 82
83#define to_node(sys_device) container_of(sys_device, struct node, sysdev) 83#define to_node(device) container_of(device, struct node, dev)
84 84
85#endif /* _LINUX_NODE_H_ */ 85#endif /* _LINUX_NODE_H_ */
diff --git a/include/linux/of.h b/include/linux/of.h
index 4948552d60f5..a75a831e2057 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -65,6 +65,27 @@ struct device_node {
65#endif 65#endif
66}; 66};
67 67
68#define MAX_PHANDLE_ARGS 8
69struct of_phandle_args {
70 struct device_node *np;
71 int args_count;
72 uint32_t args[MAX_PHANDLE_ARGS];
73};
74
75#if defined(CONFIG_SPARC) || !defined(CONFIG_OF)
76/* Dummy ref counting routines - to be implemented later */
77static inline struct device_node *of_node_get(struct device_node *node)
78{
79 return node;
80}
81static inline void of_node_put(struct device_node *node)
82{
83}
84#else
85extern struct device_node *of_node_get(struct device_node *node);
86extern void of_node_put(struct device_node *node);
87#endif
88
68#ifdef CONFIG_OF 89#ifdef CONFIG_OF
69 90
70/* Pointer for first entry in chain of all nodes. */ 91/* Pointer for first entry in chain of all nodes. */
@@ -95,21 +116,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
95 116
96extern struct device_node *of_find_all_nodes(struct device_node *prev); 117extern struct device_node *of_find_all_nodes(struct device_node *prev);
97 118
98#if defined(CONFIG_SPARC)
99/* Dummy ref counting routines - to be implemented later */
100static inline struct device_node *of_node_get(struct device_node *node)
101{
102 return node;
103}
104static inline void of_node_put(struct device_node *node)
105{
106}
107
108#else
109extern struct device_node *of_node_get(struct device_node *node);
110extern void of_node_put(struct device_node *node);
111#endif
112
113/* 119/*
114 * OF address retrieval & translation 120 * OF address retrieval & translation
115 */ 121 */
@@ -219,8 +225,8 @@ extern int of_device_is_available(const struct device_node *device);
219extern const void *of_get_property(const struct device_node *node, 225extern const void *of_get_property(const struct device_node *node,
220 const char *name, 226 const char *name,
221 int *lenp); 227 int *lenp);
222#define for_each_property(pp, properties) \ 228#define for_each_property_of_node(dn, pp) \
223 for (pp = properties; pp != NULL; pp = pp->next) 229 for (pp = dn->properties; pp != NULL; pp = pp->next)
224 230
225extern int of_n_addr_cells(struct device_node *np); 231extern int of_n_addr_cells(struct device_node *np);
226extern int of_n_size_cells(struct device_node *np); 232extern int of_n_size_cells(struct device_node *np);
@@ -230,9 +236,9 @@ extern int of_modalias_node(struct device_node *node, char *modalias, int len);
230extern struct device_node *of_parse_phandle(struct device_node *np, 236extern struct device_node *of_parse_phandle(struct device_node *np,
231 const char *phandle_name, 237 const char *phandle_name,
232 int index); 238 int index);
233extern int of_parse_phandles_with_args(struct device_node *np, 239extern int of_parse_phandle_with_args(struct device_node *np,
234 const char *list_name, const char *cells_name, int index, 240 const char *list_name, const char *cells_name, int index,
235 struct device_node **out_node, const void **out_args); 241 struct of_phandle_args *out_args);
236 242
237extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); 243extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
238extern int of_alias_get_id(struct device_node *np, const char *stem); 244extern int of_alias_get_id(struct device_node *np, const char *stem);
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index c84d900fbbb3..ed136ad698ce 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -71,7 +71,7 @@ extern int of_fdt_is_compatible(struct boot_param_header *blob,
71 unsigned long node, 71 unsigned long node,
72 const char *compat); 72 const char *compat);
73extern int of_fdt_match(struct boot_param_header *blob, unsigned long node, 73extern int of_fdt_match(struct boot_param_header *blob, unsigned long node,
74 const char **compat); 74 const char *const *compat);
75extern void of_fdt_unflatten_tree(unsigned long *blob, 75extern void of_fdt_unflatten_tree(unsigned long *blob,
76 struct device_node **mynodes); 76 struct device_node **mynodes);
77 77
@@ -88,7 +88,7 @@ extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname,
88extern void *of_get_flat_dt_prop(unsigned long node, const char *name, 88extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
89 unsigned long *size); 89 unsigned long *size);
90extern int of_flat_dt_is_compatible(unsigned long node, const char *name); 90extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
91extern int of_flat_dt_match(unsigned long node, const char **matches); 91extern int of_flat_dt_match(unsigned long node, const char *const *matches);
92extern unsigned long of_get_flat_dt_root(void); 92extern unsigned long of_get_flat_dt_root(void);
93 93
94extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, 94extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 52280a2b5e63..b254052a49d7 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -18,6 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/of.h>
21 22
22struct device_node; 23struct device_node;
23 24
@@ -57,8 +58,9 @@ extern int of_mm_gpiochip_add(struct device_node *np,
57extern void of_gpiochip_add(struct gpio_chip *gc); 58extern void of_gpiochip_add(struct gpio_chip *gc);
58extern void of_gpiochip_remove(struct gpio_chip *gc); 59extern void of_gpiochip_remove(struct gpio_chip *gc);
59extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); 60extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
60extern int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np, 61extern int of_gpio_simple_xlate(struct gpio_chip *gc,
61 const void *gpio_spec, u32 *flags); 62 const struct of_phandle_args *gpiospec,
63 u32 *flags);
62 64
63#else /* CONFIG_OF_GPIO */ 65#else /* CONFIG_OF_GPIO */
64 66
@@ -75,8 +77,8 @@ static inline unsigned int of_gpio_count(struct device_node *np)
75} 77}
76 78
77static inline int of_gpio_simple_xlate(struct gpio_chip *gc, 79static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
78 struct device_node *np, 80 const struct of_phandle_args *gpiospec,
79 const void *gpio_spec, u32 *flags) 81 u32 *flags)
80{ 82{
81 return -ENOSYS; 83 return -ENOSYS;
82} 84}
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 9ca008f0c542..32cd1f67462e 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -172,10 +172,10 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
172 * equal char, int or long. percpu_read() evaluates to a lvalue and 172 * equal char, int or long. percpu_read() evaluates to a lvalue and
173 * all others to void. 173 * all others to void.
174 * 174 *
175 * These operations are guaranteed to be atomic w.r.t. preemption. 175 * These operations are guaranteed to be atomic.
176 * The generic versions use plain get/put_cpu_var(). Archs are 176 * The generic versions disable interrupts. Archs are
177 * encouraged to implement single-instruction alternatives which don't 177 * encouraged to implement single-instruction alternatives which don't
178 * require preemption protection. 178 * require protection.
179 */ 179 */
180#ifndef percpu_read 180#ifndef percpu_read
181# define percpu_read(var) \ 181# define percpu_read(var) \
@@ -347,9 +347,10 @@ do { \
347 347
348#define _this_cpu_generic_to_op(pcp, val, op) \ 348#define _this_cpu_generic_to_op(pcp, val, op) \
349do { \ 349do { \
350 preempt_disable(); \ 350 unsigned long flags; \
351 local_irq_save(flags); \
351 *__this_cpu_ptr(&(pcp)) op val; \ 352 *__this_cpu_ptr(&(pcp)) op val; \
352 preempt_enable(); \ 353 local_irq_restore(flags); \
353} while (0) 354} while (0)
354 355
355#ifndef this_cpu_write 356#ifndef this_cpu_write
@@ -447,10 +448,11 @@ do { \
447#define _this_cpu_generic_add_return(pcp, val) \ 448#define _this_cpu_generic_add_return(pcp, val) \
448({ \ 449({ \
449 typeof(pcp) ret__; \ 450 typeof(pcp) ret__; \
450 preempt_disable(); \ 451 unsigned long flags; \
452 local_irq_save(flags); \
451 __this_cpu_add(pcp, val); \ 453 __this_cpu_add(pcp, val); \
452 ret__ = __this_cpu_read(pcp); \ 454 ret__ = __this_cpu_read(pcp); \
453 preempt_enable(); \ 455 local_irq_restore(flags); \
454 ret__; \ 456 ret__; \
455}) 457})
456 458
@@ -476,10 +478,11 @@ do { \
476 478
477#define _this_cpu_generic_xchg(pcp, nval) \ 479#define _this_cpu_generic_xchg(pcp, nval) \
478({ typeof(pcp) ret__; \ 480({ typeof(pcp) ret__; \
479 preempt_disable(); \ 481 unsigned long flags; \
482 local_irq_save(flags); \
480 ret__ = __this_cpu_read(pcp); \ 483 ret__ = __this_cpu_read(pcp); \
481 __this_cpu_write(pcp, nval); \ 484 __this_cpu_write(pcp, nval); \
482 preempt_enable(); \ 485 local_irq_restore(flags); \
483 ret__; \ 486 ret__; \
484}) 487})
485 488
@@ -501,12 +504,14 @@ do { \
501#endif 504#endif
502 505
503#define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ 506#define _this_cpu_generic_cmpxchg(pcp, oval, nval) \
504({ typeof(pcp) ret__; \ 507({ \
505 preempt_disable(); \ 508 typeof(pcp) ret__; \
509 unsigned long flags; \
510 local_irq_save(flags); \
506 ret__ = __this_cpu_read(pcp); \ 511 ret__ = __this_cpu_read(pcp); \
507 if (ret__ == (oval)) \ 512 if (ret__ == (oval)) \
508 __this_cpu_write(pcp, nval); \ 513 __this_cpu_write(pcp, nval); \
509 preempt_enable(); \ 514 local_irq_restore(flags); \
510 ret__; \ 515 ret__; \
511}) 516})
512 517
@@ -538,10 +543,11 @@ do { \
538#define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 543#define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
539({ \ 544({ \
540 int ret__; \ 545 int ret__; \
541 preempt_disable(); \ 546 unsigned long flags; \
547 local_irq_save(flags); \
542 ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \ 548 ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \
543 oval1, oval2, nval1, nval2); \ 549 oval1, oval2, nval1, nval2); \
544 preempt_enable(); \ 550 local_irq_restore(flags); \
545 ret__; \ 551 ret__; \
546}) 552})
547 553
@@ -567,9 +573,9 @@ do { \
567#endif 573#endif
568 574
569/* 575/*
570 * Generic percpu operations that do not require preemption handling. 576 * Generic percpu operations for context that are safe from preemption/interrupts.
571 * Either we do not care about races or the caller has the 577 * Either we do not care about races or the caller has the
572 * responsibility of handling preemptions issues. Arch code can still 578 * responsibility of handling preemption/interrupt issues. Arch code can still
573 * override these instructions since the arch per cpu code may be more 579 * override these instructions since the arch per cpu code may be more
574 * efficient and may actually get race freeness for free (that is the 580 * efficient and may actually get race freeness for free (that is the
575 * case for x86 for example). 581 * case for x86 for example).
@@ -802,156 +808,4 @@ do { \
802 __pcpu_double_call_return_bool(__this_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) 808 __pcpu_double_call_return_bool(__this_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2))
803#endif 809#endif
804 810
805/*
806 * IRQ safe versions of the per cpu RMW operations. Note that these operations
807 * are *not* safe against modification of the same variable from another
808 * processors (which one gets when using regular atomic operations)
809 * They are guaranteed to be atomic vs. local interrupts and
810 * preemption only.
811 */
812#define irqsafe_cpu_generic_to_op(pcp, val, op) \
813do { \
814 unsigned long flags; \
815 local_irq_save(flags); \
816 *__this_cpu_ptr(&(pcp)) op val; \
817 local_irq_restore(flags); \
818} while (0)
819
820#ifndef irqsafe_cpu_add
821# ifndef irqsafe_cpu_add_1
822# define irqsafe_cpu_add_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
823# endif
824# ifndef irqsafe_cpu_add_2
825# define irqsafe_cpu_add_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
826# endif
827# ifndef irqsafe_cpu_add_4
828# define irqsafe_cpu_add_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
829# endif
830# ifndef irqsafe_cpu_add_8
831# define irqsafe_cpu_add_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
832# endif
833# define irqsafe_cpu_add(pcp, val) __pcpu_size_call(irqsafe_cpu_add_, (pcp), (val))
834#endif
835
836#ifndef irqsafe_cpu_sub
837# define irqsafe_cpu_sub(pcp, val) irqsafe_cpu_add((pcp), -(val))
838#endif
839
840#ifndef irqsafe_cpu_inc
841# define irqsafe_cpu_inc(pcp) irqsafe_cpu_add((pcp), 1)
842#endif
843
844#ifndef irqsafe_cpu_dec
845# define irqsafe_cpu_dec(pcp) irqsafe_cpu_sub((pcp), 1)
846#endif
847
848#ifndef irqsafe_cpu_and
849# ifndef irqsafe_cpu_and_1
850# define irqsafe_cpu_and_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
851# endif
852# ifndef irqsafe_cpu_and_2
853# define irqsafe_cpu_and_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
854# endif
855# ifndef irqsafe_cpu_and_4
856# define irqsafe_cpu_and_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
857# endif
858# ifndef irqsafe_cpu_and_8
859# define irqsafe_cpu_and_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
860# endif
861# define irqsafe_cpu_and(pcp, val) __pcpu_size_call(irqsafe_cpu_and_, (val))
862#endif
863
864#ifndef irqsafe_cpu_or
865# ifndef irqsafe_cpu_or_1
866# define irqsafe_cpu_or_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
867# endif
868# ifndef irqsafe_cpu_or_2
869# define irqsafe_cpu_or_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
870# endif
871# ifndef irqsafe_cpu_or_4
872# define irqsafe_cpu_or_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
873# endif
874# ifndef irqsafe_cpu_or_8
875# define irqsafe_cpu_or_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
876# endif
877# define irqsafe_cpu_or(pcp, val) __pcpu_size_call(irqsafe_cpu_or_, (val))
878#endif
879
880#ifndef irqsafe_cpu_xor
881# ifndef irqsafe_cpu_xor_1
882# define irqsafe_cpu_xor_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
883# endif
884# ifndef irqsafe_cpu_xor_2
885# define irqsafe_cpu_xor_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
886# endif
887# ifndef irqsafe_cpu_xor_4
888# define irqsafe_cpu_xor_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
889# endif
890# ifndef irqsafe_cpu_xor_8
891# define irqsafe_cpu_xor_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
892# endif
893# define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val))
894#endif
895
896#define irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) \
897({ \
898 typeof(pcp) ret__; \
899 unsigned long flags; \
900 local_irq_save(flags); \
901 ret__ = __this_cpu_read(pcp); \
902 if (ret__ == (oval)) \
903 __this_cpu_write(pcp, nval); \
904 local_irq_restore(flags); \
905 ret__; \
906})
907
908#ifndef irqsafe_cpu_cmpxchg
909# ifndef irqsafe_cpu_cmpxchg_1
910# define irqsafe_cpu_cmpxchg_1(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval)
911# endif
912# ifndef irqsafe_cpu_cmpxchg_2
913# define irqsafe_cpu_cmpxchg_2(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval)
914# endif
915# ifndef irqsafe_cpu_cmpxchg_4
916# define irqsafe_cpu_cmpxchg_4(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval)
917# endif
918# ifndef irqsafe_cpu_cmpxchg_8
919# define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval)
920# endif
921# define irqsafe_cpu_cmpxchg(pcp, oval, nval) \
922 __pcpu_size_call_return2(irqsafe_cpu_cmpxchg_, (pcp), oval, nval)
923#endif
924
925#define irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
926({ \
927 int ret__; \
928 unsigned long flags; \
929 local_irq_save(flags); \
930 ret__ = __this_cpu_generic_cmpxchg_double(pcp1, pcp2, \
931 oval1, oval2, nval1, nval2); \
932 local_irq_restore(flags); \
933 ret__; \
934})
935
936#ifndef irqsafe_cpu_cmpxchg_double
937# ifndef irqsafe_cpu_cmpxchg_double_1
938# define irqsafe_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \
939 irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
940# endif
941# ifndef irqsafe_cpu_cmpxchg_double_2
942# define irqsafe_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \
943 irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
944# endif
945# ifndef irqsafe_cpu_cmpxchg_double_4
946# define irqsafe_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \
947 irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
948# endif
949# ifndef irqsafe_cpu_cmpxchg_double_8
950# define irqsafe_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \
951 irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
952# endif
953# define irqsafe_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
954 __pcpu_double_call_return_bool(irqsafe_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2))
955#endif
956
957#endif /* __LINUX_PERCPU_H */ 811#endif /* __LINUX_PERCPU_H */
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h
new file mode 100644
index 000000000000..b081c7245ec8
--- /dev/null
+++ b/include/linux/platform_data/macb.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __MACB_PDATA_H__
9#define __MACB_PDATA_H__
10
11struct macb_platform_data {
12 u32 phy_mask;
13 int phy_irq_pin; /* PHY IRQ */
14 u8 is_rmii; /* using RMII interface? */
15};
16
17#endif /* __MACB_PDATA_H__ */
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
index e9d9149ddf38..d94804aca764 100644
--- a/include/linux/platform_data/mv_usb.h
+++ b/include/linux/platform_data/mv_usb.h
@@ -42,9 +42,23 @@ struct mv_usb_platform_data {
42 /* only valid for HCD. OTG or Host only*/ 42 /* only valid for HCD. OTG or Host only*/
43 unsigned int mode; 43 unsigned int mode;
44 44
45 int (*phy_init)(unsigned int regbase); 45 /* This flag is used for that needs id pin checked by otg */
46 void (*phy_deinit)(unsigned int regbase); 46 unsigned int disable_otg_clock_gating:1;
47 /* Force a_bus_req to be asserted */
48 unsigned int otg_force_a_bus_req:1;
49
50 int (*phy_init)(void __iomem *regbase);
51 void (*phy_deinit)(void __iomem *regbase);
47 int (*set_vbus)(unsigned int vbus); 52 int (*set_vbus)(unsigned int vbus);
53 int (*private_init)(void __iomem *opregs, void __iomem *phyregs);
48}; 54};
49 55
56#ifndef CONFIG_HAVE_CLK
57/* Dummy stub for clk framework */
58#define clk_get(dev, id) NULL
59#define clk_put(clock) do {} while (0)
60#define clk_enable(clock) do {} while (0)
61#define clk_disable(clock) do {} while (0)
62#endif
63
50#endif 64#endif
diff --git a/include/linux/platform_data/s3c-hsudc.h b/include/linux/platform_data/s3c-hsudc.h
new file mode 100644
index 000000000000..6fa109339bf9
--- /dev/null
+++ b/include/linux/platform_data/s3c-hsudc.h
@@ -0,0 +1,34 @@
1/*
2 * S3C24XX USB 2.0 High-speed USB controller gadget driver
3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * The S3C24XX USB 2.0 high-speed USB controller supports upto 9 endpoints.
8 * Each endpoint can be configured as either in or out endpoint. Endpoints
9 * can be configured for Bulk or Interrupt transfer mode.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#ifndef __LINUX_USB_S3C_HSUDC_H
17#define __LINUX_USB_S3C_HSUDC_H
18
19/**
20 * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller.
21 * @epnum: Number of endpoints to be instantiated by the controller driver.
22 * @gpio_init: Platform specific USB related GPIO initialization.
23 * @gpio_uninit: Platform specific USB releted GPIO uninitialzation.
24 *
25 * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget
26 * controllers.
27 */
28struct s3c24xx_hsudc_platdata {
29 unsigned int epnum;
30 void (*gpio_init)(void);
31 void (*gpio_uninit)(void);
32};
33
34#endif /* __LINUX_USB_S3C_HSUDC_H */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 2a23f7d1a825..60e9994ef405 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -63,7 +63,7 @@ struct platform_device_info {
63 u64 dma_mask; 63 u64 dma_mask;
64}; 64};
65extern struct platform_device *platform_device_register_full( 65extern struct platform_device *platform_device_register_full(
66 struct platform_device_info *pdevinfo); 66 const struct platform_device_info *pdevinfo);
67 67
68/** 68/**
69 * platform_device_register_resndata - add a platform-level device with 69 * platform_device_register_resndata - add a platform-level device with
@@ -196,16 +196,8 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data
196 * calling it replaces module_init() and module_exit() 196 * calling it replaces module_init() and module_exit()
197 */ 197 */
198#define module_platform_driver(__platform_driver) \ 198#define module_platform_driver(__platform_driver) \
199static int __init __platform_driver##_init(void) \ 199 module_driver(__platform_driver, platform_driver_register, \
200{ \ 200 platform_driver_unregister)
201 return platform_driver_register(&(__platform_driver)); \
202} \
203module_init(__platform_driver##_init); \
204static void __exit __platform_driver##_exit(void) \
205{ \
206 platform_driver_unregister(&(__platform_driver)); \
207} \
208module_exit(__platform_driver##_exit);
209 201
210extern struct platform_device *platform_create_bundle(struct platform_driver *driver, 202extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
211 int (*probe)(struct platform_device *), 203 int (*probe)(struct platform_device *),
@@ -264,62 +256,34 @@ static inline char *early_platform_driver_setup_func(void) \
264} 256}
265#endif /* MODULE */ 257#endif /* MODULE */
266 258
267#ifdef CONFIG_PM_SLEEP
268extern int platform_pm_prepare(struct device *dev);
269extern void platform_pm_complete(struct device *dev);
270#else
271#define platform_pm_prepare NULL
272#define platform_pm_complete NULL
273#endif
274
275#ifdef CONFIG_SUSPEND 259#ifdef CONFIG_SUSPEND
276extern int platform_pm_suspend(struct device *dev); 260extern int platform_pm_suspend(struct device *dev);
277extern int platform_pm_suspend_noirq(struct device *dev);
278extern int platform_pm_resume(struct device *dev); 261extern int platform_pm_resume(struct device *dev);
279extern int platform_pm_resume_noirq(struct device *dev);
280#else 262#else
281#define platform_pm_suspend NULL 263#define platform_pm_suspend NULL
282#define platform_pm_resume NULL 264#define platform_pm_resume NULL
283#define platform_pm_suspend_noirq NULL
284#define platform_pm_resume_noirq NULL
285#endif 265#endif
286 266
287#ifdef CONFIG_HIBERNATE_CALLBACKS 267#ifdef CONFIG_HIBERNATE_CALLBACKS
288extern int platform_pm_freeze(struct device *dev); 268extern int platform_pm_freeze(struct device *dev);
289extern int platform_pm_freeze_noirq(struct device *dev);
290extern int platform_pm_thaw(struct device *dev); 269extern int platform_pm_thaw(struct device *dev);
291extern int platform_pm_thaw_noirq(struct device *dev);
292extern int platform_pm_poweroff(struct device *dev); 270extern int platform_pm_poweroff(struct device *dev);
293extern int platform_pm_poweroff_noirq(struct device *dev);
294extern int platform_pm_restore(struct device *dev); 271extern int platform_pm_restore(struct device *dev);
295extern int platform_pm_restore_noirq(struct device *dev);
296#else 272#else
297#define platform_pm_freeze NULL 273#define platform_pm_freeze NULL
298#define platform_pm_thaw NULL 274#define platform_pm_thaw NULL
299#define platform_pm_poweroff NULL 275#define platform_pm_poweroff NULL
300#define platform_pm_restore NULL 276#define platform_pm_restore NULL
301#define platform_pm_freeze_noirq NULL
302#define platform_pm_thaw_noirq NULL
303#define platform_pm_poweroff_noirq NULL
304#define platform_pm_restore_noirq NULL
305#endif 277#endif
306 278
307#ifdef CONFIG_PM_SLEEP 279#ifdef CONFIG_PM_SLEEP
308#define USE_PLATFORM_PM_SLEEP_OPS \ 280#define USE_PLATFORM_PM_SLEEP_OPS \
309 .prepare = platform_pm_prepare, \
310 .complete = platform_pm_complete, \
311 .suspend = platform_pm_suspend, \ 281 .suspend = platform_pm_suspend, \
312 .resume = platform_pm_resume, \ 282 .resume = platform_pm_resume, \
313 .freeze = platform_pm_freeze, \ 283 .freeze = platform_pm_freeze, \
314 .thaw = platform_pm_thaw, \ 284 .thaw = platform_pm_thaw, \
315 .poweroff = platform_pm_poweroff, \ 285 .poweroff = platform_pm_poweroff, \
316 .restore = platform_pm_restore, \ 286 .restore = platform_pm_restore,
317 .suspend_noirq = platform_pm_suspend_noirq, \
318 .resume_noirq = platform_pm_resume_noirq, \
319 .freeze_noirq = platform_pm_freeze_noirq, \
320 .thaw_noirq = platform_pm_thaw_noirq, \
321 .poweroff_noirq = platform_pm_poweroff_noirq, \
322 .restore_noirq = platform_pm_restore_noirq,
323#else 287#else
324#define USE_PLATFORM_PM_SLEEP_OPS 288#define USE_PLATFORM_PM_SLEEP_OPS
325#endif 289#endif
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 3f3ed83a9aa5..e4982ac3fbbc 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -300,19 +300,6 @@ const struct dev_pm_ops name = { \
300 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ 300 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
301} 301}
302 302
303/*
304 * Use this for subsystems (bus types, device types, device classes) that don't
305 * need any special suspend/resume handling in addition to invoking the PM
306 * callbacks provided by device drivers supporting both the system sleep PM and
307 * runtime PM, make the pm member point to generic_subsys_pm_ops.
308 */
309#ifdef CONFIG_PM
310extern struct dev_pm_ops generic_subsys_pm_ops;
311#define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops)
312#else
313#define GENERIC_SUBSYS_PM_OPS NULL
314#endif
315
316/** 303/**
317 * PM_EVENT_ messages 304 * PM_EVENT_ messages
318 * 305 *
@@ -521,6 +508,8 @@ struct dev_pm_info {
521 unsigned long active_jiffies; 508 unsigned long active_jiffies;
522 unsigned long suspended_jiffies; 509 unsigned long suspended_jiffies;
523 unsigned long accounting_timestamp; 510 unsigned long accounting_timestamp;
511 ktime_t suspend_time;
512 s64 max_time_suspended_ns;
524#endif 513#endif
525 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ 514 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
526 struct pm_qos_constraints *constraints; 515 struct pm_qos_constraints *constraints;
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 65633e5a2bc0..a03a0ad998b8 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -10,6 +10,7 @@
10#define _LINUX_PM_DOMAIN_H 10#define _LINUX_PM_DOMAIN_H
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/err.h>
13 14
14enum gpd_status { 15enum gpd_status {
15 GPD_STATE_ACTIVE = 0, /* PM domain is active */ 16 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -21,6 +22,23 @@ enum gpd_status {
21 22
22struct dev_power_governor { 23struct dev_power_governor {
23 bool (*power_down_ok)(struct dev_pm_domain *domain); 24 bool (*power_down_ok)(struct dev_pm_domain *domain);
25 bool (*stop_ok)(struct device *dev);
26};
27
28struct gpd_dev_ops {
29 int (*start)(struct device *dev);
30 int (*stop)(struct device *dev);
31 int (*save_state)(struct device *dev);
32 int (*restore_state)(struct device *dev);
33 int (*suspend)(struct device *dev);
34 int (*suspend_late)(struct device *dev);
35 int (*resume_early)(struct device *dev);
36 int (*resume)(struct device *dev);
37 int (*freeze)(struct device *dev);
38 int (*freeze_late)(struct device *dev);
39 int (*thaw_early)(struct device *dev);
40 int (*thaw)(struct device *dev);
41 bool (*active_wakeup)(struct device *dev);
24}; 42};
25 43
26struct generic_pm_domain { 44struct generic_pm_domain {
@@ -32,6 +50,7 @@ struct generic_pm_domain {
32 struct mutex lock; 50 struct mutex lock;
33 struct dev_power_governor *gov; 51 struct dev_power_governor *gov;
34 struct work_struct power_off_work; 52 struct work_struct power_off_work;
53 char *name;
35 unsigned int in_progress; /* Number of devices being suspended now */ 54 unsigned int in_progress; /* Number of devices being suspended now */
36 atomic_t sd_count; /* Number of subdomains with power "on" */ 55 atomic_t sd_count; /* Number of subdomains with power "on" */
37 enum gpd_status status; /* Current state of the domain */ 56 enum gpd_status status; /* Current state of the domain */
@@ -44,10 +63,13 @@ struct generic_pm_domain {
44 bool suspend_power_off; /* Power status before system suspend */ 63 bool suspend_power_off; /* Power status before system suspend */
45 bool dev_irq_safe; /* Device callbacks are IRQ-safe */ 64 bool dev_irq_safe; /* Device callbacks are IRQ-safe */
46 int (*power_off)(struct generic_pm_domain *domain); 65 int (*power_off)(struct generic_pm_domain *domain);
66 s64 power_off_latency_ns;
47 int (*power_on)(struct generic_pm_domain *domain); 67 int (*power_on)(struct generic_pm_domain *domain);
48 int (*start_device)(struct device *dev); 68 s64 power_on_latency_ns;
49 int (*stop_device)(struct device *dev); 69 struct gpd_dev_ops dev_ops;
50 bool (*active_wakeup)(struct device *dev); 70 s64 break_even_ns; /* Power break even for the entire domain. */
71 s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
72 ktime_t power_off_time;
51}; 73};
52 74
53static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) 75static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
@@ -62,8 +84,18 @@ struct gpd_link {
62 struct list_head slave_node; 84 struct list_head slave_node;
63}; 85};
64 86
87struct gpd_timing_data {
88 s64 stop_latency_ns;
89 s64 start_latency_ns;
90 s64 save_state_latency_ns;
91 s64 restore_state_latency_ns;
92 s64 break_even_ns;
93};
94
65struct generic_pm_domain_data { 95struct generic_pm_domain_data {
66 struct pm_domain_data base; 96 struct pm_domain_data base;
97 struct gpd_dev_ops ops;
98 struct gpd_timing_data td;
67 bool need_restore; 99 bool need_restore;
68}; 100};
69 101
@@ -73,18 +105,54 @@ static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *
73} 105}
74 106
75#ifdef CONFIG_PM_GENERIC_DOMAINS 107#ifdef CONFIG_PM_GENERIC_DOMAINS
76extern int pm_genpd_add_device(struct generic_pm_domain *genpd, 108static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
77 struct device *dev); 109{
110 return to_gpd_data(dev->power.subsys_data->domain_data);
111}
112
113extern struct dev_power_governor simple_qos_governor;
114
115extern struct generic_pm_domain *dev_to_genpd(struct device *dev);
116extern int __pm_genpd_add_device(struct generic_pm_domain *genpd,
117 struct device *dev,
118 struct gpd_timing_data *td);
119
120static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
121 struct device *dev)
122{
123 return __pm_genpd_add_device(genpd, dev, NULL);
124}
125
78extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 126extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
79 struct device *dev); 127 struct device *dev);
80extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 128extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
81 struct generic_pm_domain *new_subdomain); 129 struct generic_pm_domain *new_subdomain);
82extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 130extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
83 struct generic_pm_domain *target); 131 struct generic_pm_domain *target);
132extern int pm_genpd_add_callbacks(struct device *dev,
133 struct gpd_dev_ops *ops,
134 struct gpd_timing_data *td);
135extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
84extern void pm_genpd_init(struct generic_pm_domain *genpd, 136extern void pm_genpd_init(struct generic_pm_domain *genpd,
85 struct dev_power_governor *gov, bool is_off); 137 struct dev_power_governor *gov, bool is_off);
138
86extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 139extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
140
141extern bool default_stop_ok(struct device *dev);
142
143extern struct dev_power_governor pm_domain_always_on_gov;
87#else 144#else
145
146static inline struct generic_pm_domain *dev_to_genpd(struct device *dev)
147{
148 return ERR_PTR(-ENOSYS);
149}
150static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
151 struct device *dev,
152 struct gpd_timing_data *td)
153{
154 return -ENOSYS;
155}
88static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 156static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
89 struct device *dev) 157 struct device *dev)
90{ 158{
@@ -105,14 +173,35 @@ static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
105{ 173{
106 return -ENOSYS; 174 return -ENOSYS;
107} 175}
108static inline void pm_genpd_init(struct generic_pm_domain *genpd, 176static inline int pm_genpd_add_callbacks(struct device *dev,
109 struct dev_power_governor *gov, bool is_off) {} 177 struct gpd_dev_ops *ops,
178 struct gpd_timing_data *td)
179{
180 return -ENOSYS;
181}
182static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
183{
184 return -ENOSYS;
185}
186static inline void pm_genpd_init(struct generic_pm_domain *genpd, bool is_off)
187{
188}
110static inline int pm_genpd_poweron(struct generic_pm_domain *genpd) 189static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
111{ 190{
112 return -ENOSYS; 191 return -ENOSYS;
113} 192}
193static inline bool default_stop_ok(struct device *dev)
194{
195 return false;
196}
197#define pm_domain_always_on_gov NULL
114#endif 198#endif
115 199
200static inline int pm_genpd_remove_callbacks(struct device *dev)
201{
202 return __pm_genpd_remove_callbacks(dev, true);
203}
204
116#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME 205#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
117extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd); 206extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
118extern void pm_genpd_poweroff_unused(void); 207extern void pm_genpd_poweroff_unused(void);
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 83b0ea302a80..e5bbcbaa6f57 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -78,6 +78,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
78int pm_qos_request_active(struct pm_qos_request *req); 78int pm_qos_request_active(struct pm_qos_request *req);
79s32 pm_qos_read_value(struct pm_qos_constraints *c); 79s32 pm_qos_read_value(struct pm_qos_constraints *c);
80 80
81s32 __dev_pm_qos_read_value(struct device *dev);
81s32 dev_pm_qos_read_value(struct device *dev); 82s32 dev_pm_qos_read_value(struct device *dev);
82int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, 83int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
83 s32 value); 84 s32 value);
@@ -91,6 +92,8 @@ int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
91int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier); 92int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
92void dev_pm_qos_constraints_init(struct device *dev); 93void dev_pm_qos_constraints_init(struct device *dev);
93void dev_pm_qos_constraints_destroy(struct device *dev); 94void dev_pm_qos_constraints_destroy(struct device *dev);
95int dev_pm_qos_add_ancestor_request(struct device *dev,
96 struct dev_pm_qos_request *req, s32 value);
94#else 97#else
95static inline int pm_qos_update_target(struct pm_qos_constraints *c, 98static inline int pm_qos_update_target(struct pm_qos_constraints *c,
96 struct plist_node *node, 99 struct plist_node *node,
@@ -119,6 +122,8 @@ static inline int pm_qos_request_active(struct pm_qos_request *req)
119static inline s32 pm_qos_read_value(struct pm_qos_constraints *c) 122static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
120 { return 0; } 123 { return 0; }
121 124
125static inline s32 __dev_pm_qos_read_value(struct device *dev)
126 { return 0; }
122static inline s32 dev_pm_qos_read_value(struct device *dev) 127static inline s32 dev_pm_qos_read_value(struct device *dev)
123 { return 0; } 128 { return 0; }
124static inline int dev_pm_qos_add_request(struct device *dev, 129static inline int dev_pm_qos_add_request(struct device *dev,
@@ -150,6 +155,9 @@ static inline void dev_pm_qos_constraints_destroy(struct device *dev)
150{ 155{
151 dev->power.power_state = PMSG_INVALID; 156 dev->power.power_state = PMSG_INVALID;
152} 157}
158static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
159 struct dev_pm_qos_request *req, s32 value)
160 { return 0; }
153#endif 161#endif
154 162
155#endif 163#endif
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index d3085e72a0ee..609daae7a014 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -45,6 +45,8 @@ extern void pm_runtime_irq_safe(struct device *dev);
45extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); 45extern void __pm_runtime_use_autosuspend(struct device *dev, bool use);
46extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); 46extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
47extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); 47extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
48extern void pm_runtime_update_max_time_suspended(struct device *dev,
49 s64 delta_ns);
48 50
49static inline bool pm_children_suspended(struct device *dev) 51static inline bool pm_children_suspended(struct device *dev)
50{ 52{
@@ -148,6 +150,9 @@ static inline void pm_runtime_set_autosuspend_delay(struct device *dev,
148static inline unsigned long pm_runtime_autosuspend_expiration( 150static inline unsigned long pm_runtime_autosuspend_expiration(
149 struct device *dev) { return 0; } 151 struct device *dev) { return 0; }
150 152
153static inline void pm_runtime_update_max_time_suspended(struct device *dev,
154 s64 delta_ns) {}
155
151#endif /* !CONFIG_PM_RUNTIME */ 156#endif /* !CONFIG_PM_RUNTIME */
152 157
153static inline int pm_runtime_idle(struct device *dev) 158static inline int pm_runtime_idle(struct device *dev)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 643b96c7a94f..6d9e575519cc 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -50,7 +50,7 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer,
50 50
51struct proc_dir_entry { 51struct proc_dir_entry {
52 unsigned int low_ino; 52 unsigned int low_ino;
53 mode_t mode; 53 umode_t mode;
54 nlink_t nlink; 54 nlink_t nlink;
55 uid_t uid; 55 uid_t uid;
56 gid_t gid; 56 gid_t gid;
@@ -106,9 +106,9 @@ extern void proc_root_init(void);
106 106
107void proc_flush_task(struct task_struct *task); 107void proc_flush_task(struct task_struct *task);
108 108
109extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 109extern struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
110 struct proc_dir_entry *parent); 110 struct proc_dir_entry *parent);
111struct proc_dir_entry *proc_create_data(const char *name, mode_t mode, 111struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
112 struct proc_dir_entry *parent, 112 struct proc_dir_entry *parent,
113 const struct file_operations *proc_fops, 113 const struct file_operations *proc_fops,
114 void *data); 114 void *data);
@@ -146,17 +146,17 @@ extern void proc_device_tree_update_prop(struct proc_dir_entry *pde,
146extern struct proc_dir_entry *proc_symlink(const char *, 146extern struct proc_dir_entry *proc_symlink(const char *,
147 struct proc_dir_entry *, const char *); 147 struct proc_dir_entry *, const char *);
148extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); 148extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
149extern struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, 149extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
150 struct proc_dir_entry *parent); 150 struct proc_dir_entry *parent);
151 151
152static inline struct proc_dir_entry *proc_create(const char *name, mode_t mode, 152static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
153 struct proc_dir_entry *parent, const struct file_operations *proc_fops) 153 struct proc_dir_entry *parent, const struct file_operations *proc_fops)
154{ 154{
155 return proc_create_data(name, mode, parent, proc_fops, NULL); 155 return proc_create_data(name, mode, parent, proc_fops, NULL);
156} 156}
157 157
158static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 158static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
159 mode_t mode, struct proc_dir_entry *base, 159 umode_t mode, struct proc_dir_entry *base,
160 read_proc_t *read_proc, void * data) 160 read_proc_t *read_proc, void * data)
161{ 161{
162 struct proc_dir_entry *res=create_proc_entry(name,mode,base); 162 struct proc_dir_entry *res=create_proc_entry(name,mode,base);
@@ -168,7 +168,7 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
168} 168}
169 169
170extern struct proc_dir_entry *proc_net_fops_create(struct net *net, 170extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
171 const char *name, mode_t mode, const struct file_operations *fops); 171 const char *name, umode_t mode, const struct file_operations *fops);
172extern void proc_net_remove(struct net *net, const char *name); 172extern void proc_net_remove(struct net *net, const char *name);
173extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, 173extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
174 struct proc_dir_entry *parent); 174 struct proc_dir_entry *parent);
@@ -185,15 +185,15 @@ static inline void proc_flush_task(struct task_struct *task)
185} 185}
186 186
187static inline struct proc_dir_entry *create_proc_entry(const char *name, 187static inline struct proc_dir_entry *create_proc_entry(const char *name,
188 mode_t mode, struct proc_dir_entry *parent) { return NULL; } 188 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
189static inline struct proc_dir_entry *proc_create(const char *name, 189static inline struct proc_dir_entry *proc_create(const char *name,
190 mode_t mode, struct proc_dir_entry *parent, 190 umode_t mode, struct proc_dir_entry *parent,
191 const struct file_operations *proc_fops) 191 const struct file_operations *proc_fops)
192{ 192{
193 return NULL; 193 return NULL;
194} 194}
195static inline struct proc_dir_entry *proc_create_data(const char *name, 195static inline struct proc_dir_entry *proc_create_data(const char *name,
196 mode_t mode, struct proc_dir_entry *parent, 196 umode_t mode, struct proc_dir_entry *parent,
197 const struct file_operations *proc_fops, void *data) 197 const struct file_operations *proc_fops, void *data)
198{ 198{
199 return NULL; 199 return NULL;
@@ -205,10 +205,10 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
205static inline struct proc_dir_entry *proc_mkdir(const char *name, 205static inline struct proc_dir_entry *proc_mkdir(const char *name,
206 struct proc_dir_entry *parent) {return NULL;} 206 struct proc_dir_entry *parent) {return NULL;}
207static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, 207static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
208 mode_t mode, struct proc_dir_entry *parent) { return NULL; } 208 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
209 209
210static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 210static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
211 mode_t mode, struct proc_dir_entry *base, 211 umode_t mode, struct proc_dir_entry *base,
212 read_proc_t *read_proc, void * data) { return NULL; } 212 read_proc_t *read_proc, void * data) { return NULL; }
213 213
214struct tty_driver; 214struct tty_driver;
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 9e65d9e20662..6f6df86f1ae5 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -277,7 +277,10 @@ struct mdp_superblock_1 {
277 */ 277 */
278#define MD_FEATURE_RESHAPE_ACTIVE 4 278#define MD_FEATURE_RESHAPE_ACTIVE 4
279#define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */ 279#define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */
280 280#define MD_FEATURE_REPLACEMENT 16 /* This device is replacing an
281#define MD_FEATURE_ALL (1|2|4|8) 281 * active device with same 'role'.
282 * 'recovery_offset' is also set.
283 */
284#define MD_FEATURE_ALL (1|2|4|8|16)
282 285
283#endif 286#endif
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index 2b59cc824395..53272e9860a7 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -132,7 +132,7 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb,
132 PROT_READ|PROT_WRITE, \ 132 PROT_READ|PROT_WRITE, \
133 MAP_PRIVATE|MAP_ANONYMOUS,\ 133 MAP_PRIVATE|MAP_ANONYMOUS,\
134 0, 0)) 134 0, 0))
135# define free_pages(x, y) munmap((void *)(x), (y)*PAGE_SIZE) 135# define free_pages(x, y) munmap((void *)(x), PAGE_SIZE << (y))
136 136
137static inline void cpu_relax(void) 137static inline void cpu_relax(void)
138{ 138{
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 3a8f0c9b2933..5bf5500db83d 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -2,7 +2,7 @@
2#define _LINUX_RAMFS_H 2#define _LINUX_RAMFS_H
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, 4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
5 int mode, dev_t dev); 5 umode_t mode, dev_t dev);
6extern struct dentry *ramfs_mount(struct file_system_type *fs_type, 6extern struct dentry *ramfs_mount(struct file_system_type *fs_type,
7 int flags, const char *dev_name, void *data); 7 int flags, const char *dev_name, void *data);
8 8
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 690276a642cf..eb93921cdd30 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -23,9 +23,8 @@ struct spi_device;
23/* An enum of all the supported cache types */ 23/* An enum of all the supported cache types */
24enum regcache_type { 24enum regcache_type {
25 REGCACHE_NONE, 25 REGCACHE_NONE,
26 REGCACHE_INDEXED,
27 REGCACHE_RBTREE, 26 REGCACHE_RBTREE,
28 REGCACHE_LZO 27 REGCACHE_COMPRESSED
29}; 28};
30 29
31/** 30/**
@@ -83,7 +82,7 @@ struct regmap_config {
83 bool (*precious_reg)(struct device *dev, unsigned int reg); 82 bool (*precious_reg)(struct device *dev, unsigned int reg);
84 83
85 unsigned int max_register; 84 unsigned int max_register;
86 struct reg_default *reg_defaults; 85 const struct reg_default *reg_defaults;
87 unsigned int num_reg_defaults; 86 unsigned int num_reg_defaults;
88 enum regcache_type cache_type; 87 enum regcache_type cache_type;
89 const void *reg_defaults_raw; 88 const void *reg_defaults_raw;
@@ -129,6 +128,8 @@ struct regmap *regmap_init_spi(struct spi_device *dev,
129 const struct regmap_config *config); 128 const struct regmap_config *config);
130 129
131void regmap_exit(struct regmap *map); 130void regmap_exit(struct regmap *map);
131int regmap_reinit_cache(struct regmap *map,
132 const struct regmap_config *config);
132int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); 133int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
133int regmap_raw_write(struct regmap *map, unsigned int reg, 134int regmap_raw_write(struct regmap *map, unsigned int reg,
134 const void *val, size_t val_len); 135 const void *val, size_t val_len);
@@ -139,9 +140,61 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
139 size_t val_count); 140 size_t val_count);
140int regmap_update_bits(struct regmap *map, unsigned int reg, 141int regmap_update_bits(struct regmap *map, unsigned int reg,
141 unsigned int mask, unsigned int val); 142 unsigned int mask, unsigned int val);
143int regmap_update_bits_check(struct regmap *map, unsigned int reg,
144 unsigned int mask, unsigned int val,
145 bool *change);
142 146
143int regcache_sync(struct regmap *map); 147int regcache_sync(struct regmap *map);
144void regcache_cache_only(struct regmap *map, bool enable); 148void regcache_cache_only(struct regmap *map, bool enable);
145void regcache_cache_bypass(struct regmap *map, bool enable); 149void regcache_cache_bypass(struct regmap *map, bool enable);
150void regcache_mark_dirty(struct regmap *map);
151
152/**
153 * Description of an IRQ for the generic regmap irq_chip.
154 *
155 * @reg_offset: Offset of the status/mask register within the bank
156 * @mask: Mask used to flag/control the register.
157 */
158struct regmap_irq {
159 unsigned int reg_offset;
160 unsigned int mask;
161};
162
163/**
164 * Description of a generic regmap irq_chip. This is not intended to
165 * handle every possible interrupt controller, but it should handle a
166 * substantial proportion of those that are found in the wild.
167 *
168 * @name: Descriptive name for IRQ controller.
169 *
170 * @status_base: Base status register address.
171 * @mask_base: Base mask register address.
172 * @ack_base: Base ack address. If zero then the chip is clear on read.
173 *
174 * @num_regs: Number of registers in each control bank.
175 * @irqs: Descriptors for individual IRQs. Interrupt numbers are
176 * assigned based on the index in the array of the interrupt.
177 * @num_irqs: Number of descriptors.
178 */
179struct regmap_irq_chip {
180 const char *name;
181
182 unsigned int status_base;
183 unsigned int mask_base;
184 unsigned int ack_base;
185
186 int num_regs;
187
188 const struct regmap_irq *irqs;
189 int num_irqs;
190};
191
192struct regmap_irq_chip_data;
193
194int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
195 int irq_base, struct regmap_irq_chip *chip,
196 struct regmap_irq_chip_data **data);
197void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
198int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
146 199
147#endif 200#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 96d465f8d3e6..2213ddcce20c 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1759,13 +1759,14 @@ struct reiserfs_journal_header {
1759 REISERFS_QUOTA_TRANS_BLOCKS(sb))) 1759 REISERFS_QUOTA_TRANS_BLOCKS(sb)))
1760 1760
1761#ifdef CONFIG_QUOTA 1761#ifdef CONFIG_QUOTA
1762#define REISERFS_QUOTA_OPTS ((1 << REISERFS_USRQUOTA) | (1 << REISERFS_GRPQUOTA))
1762/* We need to update data and inode (atime) */ 1763/* We need to update data and inode (atime) */
1763#define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0) 1764#define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? 2 : 0)
1764/* 1 balancing, 1 bitmap, 1 data per write + stat data update */ 1765/* 1 balancing, 1 bitmap, 1 data per write + stat data update */
1765#define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \ 1766#define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? \
1766(DQUOT_INIT_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_INIT_REWRITE+1) : 0) 1767(DQUOT_INIT_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_INIT_REWRITE+1) : 0)
1767/* same as with INIT */ 1768/* same as with INIT */
1768#define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \ 1769#define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? \
1769(DQUOT_DEL_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_DEL_REWRITE+1) : 0) 1770(DQUOT_DEL_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_DEL_REWRITE+1) : 0)
1770#else 1771#else
1771#define REISERFS_QUOTA_TRANS_BLOCKS(s) 0 1772#define REISERFS_QUOTA_TRANS_BLOCKS(s) 0
@@ -2056,7 +2057,7 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key);
2056 2057
2057struct reiserfs_security_handle; 2058struct reiserfs_security_handle;
2058int reiserfs_new_inode(struct reiserfs_transaction_handle *th, 2059int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
2059 struct inode *dir, int mode, 2060 struct inode *dir, umode_t mode,
2060 const char *symname, loff_t i_size, 2061 const char *symname, loff_t i_size,
2061 struct dentry *dentry, struct inode *inode, 2062 struct dentry *dentry, struct inode *inode,
2062 struct reiserfs_security_handle *security); 2063 struct reiserfs_security_handle *security);
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 52c83b6a758a..8c9e85c64b46 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -417,6 +417,7 @@ struct reiserfs_sb_info {
417 char *s_qf_names[MAXQUOTAS]; 417 char *s_qf_names[MAXQUOTAS];
418 int s_jquota_fmt; 418 int s_jquota_fmt;
419#endif 419#endif
420 char *s_jdev; /* Stored jdev for mount option showing */
420#ifdef CONFIG_REISERFS_CHECK 421#ifdef CONFIG_REISERFS_CHECK
421 422
422 struct tree_balance *cur_tb; /* 423 struct tree_balance *cur_tb; /*
@@ -482,7 +483,8 @@ enum reiserfs_mount_options {
482 REISERFS_ERROR_RO, 483 REISERFS_ERROR_RO,
483 REISERFS_ERROR_CONTINUE, 484 REISERFS_ERROR_CONTINUE,
484 485
485 REISERFS_QUOTA, /* Some quota option specified */ 486 REISERFS_USRQUOTA, /* User quota option specified */
487 REISERFS_GRPQUOTA, /* Group quota option specified */
486 488
487 REISERFS_TEST1, 489 REISERFS_TEST1,
488 REISERFS_TEST2, 490 REISERFS_TEST2,
diff --git a/include/linux/relay.h b/include/linux/relay.h
index 14a86bc7102b..a822fd71fd64 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -144,7 +144,7 @@ struct rchan_callbacks
144 */ 144 */
145 struct dentry *(*create_buf_file)(const char *filename, 145 struct dentry *(*create_buf_file)(const char *filename,
146 struct dentry *parent, 146 struct dentry *parent,
147 int mode, 147 umode_t mode,
148 struct rchan_buf *buf, 148 struct rchan_buf *buf,
149 int *is_global); 149 int *is_global);
150 150
diff --git a/include/linux/sched.h b/include/linux/sched.h
index cf0eb342bcba..f044f66018f2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -220,7 +220,7 @@ extern char ___assert_task_state[1 - 2*!!(
220 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) 220 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
221#define task_contributes_to_load(task) \ 221#define task_contributes_to_load(task) \
222 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ 222 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
223 (task->flags & PF_FREEZING) == 0) 223 (task->flags & PF_FROZEN) == 0)
224 224
225#define __set_task_state(tsk, state_value) \ 225#define __set_task_state(tsk, state_value) \
226 do { (tsk)->state = (state_value); } while (0) 226 do { (tsk)->state = (state_value); } while (0)
@@ -637,13 +637,15 @@ struct signal_struct {
637#endif 637#endif
638#ifdef CONFIG_CGROUPS 638#ifdef CONFIG_CGROUPS
639 /* 639 /*
640 * The threadgroup_fork_lock prevents threads from forking with 640 * group_rwsem prevents new tasks from entering the threadgroup and
641 * CLONE_THREAD while held for writing. Use this for fork-sensitive 641 * member tasks from exiting,a more specifically, setting of
642 * threadgroup-wide operations. It's taken for reading in fork.c in 642 * PF_EXITING. fork and exit paths are protected with this rwsem
643 * copy_process(). 643 * using threadgroup_change_begin/end(). Users which require
644 * Currently only needed write-side by cgroups. 644 * threadgroup to remain stable should use threadgroup_[un]lock()
645 * which also takes care of exec path. Currently, cgroup is the
646 * only user.
645 */ 647 */
646 struct rw_semaphore threadgroup_fork_lock; 648 struct rw_semaphore group_rwsem;
647#endif 649#endif
648 650
649 int oom_adj; /* OOM kill score adjustment (bit shift) */ 651 int oom_adj; /* OOM kill score adjustment (bit shift) */
@@ -1787,7 +1789,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1787#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1789#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1788#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */ 1790#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
1789#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1791#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1790#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1791#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1792#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
1792#define PF_FROZEN 0x00010000 /* frozen for system suspend */ 1793#define PF_FROZEN 0x00010000 /* frozen for system suspend */
1793#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ 1794#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
@@ -1803,7 +1804,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1803#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 1804#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
1804#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ 1805#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
1805#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ 1806#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
1806#define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */
1807 1807
1808/* 1808/*
1809 * Only the _current_ task can read/write to tsk->flags, but other 1809 * Only the _current_ task can read/write to tsk->flags, but other
@@ -2396,29 +2396,62 @@ static inline void unlock_task_sighand(struct task_struct *tsk,
2396 spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); 2396 spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
2397} 2397}
2398 2398
2399/* See the declaration of threadgroup_fork_lock in signal_struct. */
2400#ifdef CONFIG_CGROUPS 2399#ifdef CONFIG_CGROUPS
2401static inline void threadgroup_fork_read_lock(struct task_struct *tsk) 2400static inline void threadgroup_change_begin(struct task_struct *tsk)
2402{ 2401{
2403 down_read(&tsk->signal->threadgroup_fork_lock); 2402 down_read(&tsk->signal->group_rwsem);
2404} 2403}
2405static inline void threadgroup_fork_read_unlock(struct task_struct *tsk) 2404static inline void threadgroup_change_end(struct task_struct *tsk)
2406{ 2405{
2407 up_read(&tsk->signal->threadgroup_fork_lock); 2406 up_read(&tsk->signal->group_rwsem);
2408} 2407}
2409static inline void threadgroup_fork_write_lock(struct task_struct *tsk) 2408
2409/**
2410 * threadgroup_lock - lock threadgroup
2411 * @tsk: member task of the threadgroup to lock
2412 *
2413 * Lock the threadgroup @tsk belongs to. No new task is allowed to enter
2414 * and member tasks aren't allowed to exit (as indicated by PF_EXITING) or
2415 * perform exec. This is useful for cases where the threadgroup needs to
2416 * stay stable across blockable operations.
2417 *
2418 * fork and exit paths explicitly call threadgroup_change_{begin|end}() for
2419 * synchronization. While held, no new task will be added to threadgroup
2420 * and no existing live task will have its PF_EXITING set.
2421 *
2422 * During exec, a task goes and puts its thread group through unusual
2423 * changes. After de-threading, exclusive access is assumed to resources
2424 * which are usually shared by tasks in the same group - e.g. sighand may
2425 * be replaced with a new one. Also, the exec'ing task takes over group
2426 * leader role including its pid. Exclude these changes while locked by
2427 * grabbing cred_guard_mutex which is used to synchronize exec path.
2428 */
2429static inline void threadgroup_lock(struct task_struct *tsk)
2410{ 2430{
2411 down_write(&tsk->signal->threadgroup_fork_lock); 2431 /*
2432 * exec uses exit for de-threading nesting group_rwsem inside
2433 * cred_guard_mutex. Grab cred_guard_mutex first.
2434 */
2435 mutex_lock(&tsk->signal->cred_guard_mutex);
2436 down_write(&tsk->signal->group_rwsem);
2412} 2437}
2413static inline void threadgroup_fork_write_unlock(struct task_struct *tsk) 2438
2439/**
2440 * threadgroup_unlock - unlock threadgroup
2441 * @tsk: member task of the threadgroup to unlock
2442 *
2443 * Reverse threadgroup_lock().
2444 */
2445static inline void threadgroup_unlock(struct task_struct *tsk)
2414{ 2446{
2415 up_write(&tsk->signal->threadgroup_fork_lock); 2447 up_write(&tsk->signal->group_rwsem);
2448 mutex_unlock(&tsk->signal->cred_guard_mutex);
2416} 2449}
2417#else 2450#else
2418static inline void threadgroup_fork_read_lock(struct task_struct *tsk) {} 2451static inline void threadgroup_change_begin(struct task_struct *tsk) {}
2419static inline void threadgroup_fork_read_unlock(struct task_struct *tsk) {} 2452static inline void threadgroup_change_end(struct task_struct *tsk) {}
2420static inline void threadgroup_fork_write_lock(struct task_struct *tsk) {} 2453static inline void threadgroup_lock(struct task_struct *tsk) {}
2421static inline void threadgroup_fork_write_unlock(struct task_struct *tsk) {} 2454static inline void threadgroup_unlock(struct task_struct *tsk) {}
2422#endif 2455#endif
2423 2456
2424#ifndef __HAVE_THREAD_FUNCTIONS 2457#ifndef __HAVE_THREAD_FUNCTIONS
diff --git a/include/linux/security.h b/include/linux/security.h
index e8c619d39291..98112cf93884 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -186,7 +186,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
186 * Security module identifier. 186 * Security module identifier.
187 * 187 *
188 * @name: 188 * @name:
189 * A string that acts as a unique identifeir for the LSM with max number 189 * A string that acts as a unique identifier for the LSM with max number
190 * of characters = SECURITY_NAME_MAX. 190 * of characters = SECURITY_NAME_MAX.
191 * 191 *
192 * Security hooks for program execution operations. 192 * Security hooks for program execution operations.
@@ -275,7 +275,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
275 * @copy copied data which will be passed to the security module. 275 * @copy copied data which will be passed to the security module.
276 * Returns 0 if the copy was successful. 276 * Returns 0 if the copy was successful.
277 * @sb_remount: 277 * @sb_remount:
278 * Extracts security system specifc mount options and verifys no changes 278 * Extracts security system specific mount options and verifies no changes
279 * are being made to those options. 279 * are being made to those options.
280 * @sb superblock being remounted 280 * @sb superblock being remounted
281 * @data contains the filesystem-specific data. 281 * @data contains the filesystem-specific data.
@@ -380,15 +380,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
380 * Return 0 if permission is granted. 380 * Return 0 if permission is granted.
381 * @inode_mkdir: 381 * @inode_mkdir:
382 * Check permissions to create a new directory in the existing directory 382 * Check permissions to create a new directory in the existing directory
383 * associated with inode strcture @dir. 383 * associated with inode structure @dir.
384 * @dir containst the inode structure of parent of the directory to be created. 384 * @dir contains the inode structure of parent of the directory to be created.
385 * @dentry contains the dentry structure of new directory. 385 * @dentry contains the dentry structure of new directory.
386 * @mode contains the mode of new directory. 386 * @mode contains the mode of new directory.
387 * Return 0 if permission is granted. 387 * Return 0 if permission is granted.
388 * @path_mkdir: 388 * @path_mkdir:
389 * Check permissions to create a new directory in the existing directory 389 * Check permissions to create a new directory in the existing directory
390 * associated with path strcture @path. 390 * associated with path structure @path.
391 * @dir containst the path structure of parent of the directory 391 * @dir contains the path structure of parent of the directory
392 * to be created. 392 * to be created.
393 * @dentry contains the dentry structure of new directory. 393 * @dentry contains the dentry structure of new directory.
394 * @mode contains the mode of new directory. 394 * @mode contains the mode of new directory.
@@ -578,7 +578,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
578 * @file contains the file structure. 578 * @file contains the file structure.
579 * @cmd contains the operation to perform. 579 * @cmd contains the operation to perform.
580 * @arg contains the operational arguments. 580 * @arg contains the operational arguments.
581 * Check permission for an ioctl operation on @file. Note that @arg can 581 * Check permission for an ioctl operation on @file. Note that @arg
582 * sometimes represents a user space pointer; in other cases, it may be a 582 * sometimes represents a user space pointer; in other cases, it may be a
583 * simple integer value. When @arg represents a user space pointer, it 583 * simple integer value. When @arg represents a user space pointer, it
584 * should never be used by the security module. 584 * should never be used by the security module.
@@ -606,7 +606,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
606 * Return 0 if permission is granted. 606 * Return 0 if permission is granted.
607 * @file_fcntl: 607 * @file_fcntl:
608 * Check permission before allowing the file operation specified by @cmd 608 * Check permission before allowing the file operation specified by @cmd
609 * from being performed on the file @file. Note that @arg can sometimes 609 * from being performed on the file @file. Note that @arg sometimes
610 * represents a user space pointer; in other cases, it may be a simple 610 * represents a user space pointer; in other cases, it may be a simple
611 * integer value. When @arg represents a user space pointer, it should 611 * integer value. When @arg represents a user space pointer, it should
612 * never be used by the security module. 612 * never be used by the security module.
@@ -793,7 +793,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
793 * information can be saved using the eff_cap field of the 793 * information can be saved using the eff_cap field of the
794 * netlink_skb_parms structure. Also may be used to provide fine 794 * netlink_skb_parms structure. Also may be used to provide fine
795 * grained control over message transmission. 795 * grained control over message transmission.
796 * @sk associated sock of task sending the message., 796 * @sk associated sock of task sending the message.
797 * @skb contains the sk_buff structure for the netlink message. 797 * @skb contains the sk_buff structure for the netlink message.
798 * Return 0 if the information was successfully saved and message 798 * Return 0 if the information was successfully saved and message
799 * is allowed to be transmitted. 799 * is allowed to be transmitted.
@@ -1080,9 +1080,9 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1080 * should free it. 1080 * should free it.
1081 * @key points to the key to be queried. 1081 * @key points to the key to be queried.
1082 * @_buffer points to a pointer that should be set to point to the 1082 * @_buffer points to a pointer that should be set to point to the
1083 * resulting string (if no label or an error occurs). 1083 * resulting string (if no label or an error occurs).
1084 * Return the length of the string (including terminating NUL) or -ve if 1084 * Return the length of the string (including terminating NUL) or -ve if
1085 * an error. 1085 * an error.
1086 * May also return 0 (and a NULL buffer pointer) if there is no label. 1086 * May also return 0 (and a NULL buffer pointer) if there is no label.
1087 * 1087 *
1088 * Security hooks affecting all System V IPC operations. 1088 * Security hooks affecting all System V IPC operations.
@@ -1268,7 +1268,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1268 * credentials. 1268 * credentials.
1269 * @tsk contains the task_struct for the process. 1269 * @tsk contains the task_struct for the process.
1270 * @cred contains the credentials to use. 1270 * @cred contains the credentials to use.
1271 * @ns contains the user namespace we want the capability in 1271 * @ns contains the user namespace we want the capability in
1272 * @cap contains the capability <include/linux/capability.h>. 1272 * @cap contains the capability <include/linux/capability.h>.
1273 * @audit: Whether to write an audit message or not 1273 * @audit: Whether to write an audit message or not
1274 * Return 0 if the capability is granted for @tsk. 1274 * Return 0 if the capability is granted for @tsk.
@@ -1370,7 +1370,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1370 * @ctxlen contains the length of @ctx. 1370 * @ctxlen contains the length of @ctx.
1371 * 1371 *
1372 * @inode_getsecctx: 1372 * @inode_getsecctx:
1373 * Returns a string containing all relavent security context information 1373 * Returns a string containing all relevant security context information
1374 * 1374 *
1375 * @inode we wish to get the security context of. 1375 * @inode we wish to get the security context of.
1376 * @ctx is a pointer in which to place the allocated security context. 1376 * @ctx is a pointer in which to place the allocated security context.
@@ -1424,9 +1424,9 @@ struct security_operations {
1424 1424
1425#ifdef CONFIG_SECURITY_PATH 1425#ifdef CONFIG_SECURITY_PATH
1426 int (*path_unlink) (struct path *dir, struct dentry *dentry); 1426 int (*path_unlink) (struct path *dir, struct dentry *dentry);
1427 int (*path_mkdir) (struct path *dir, struct dentry *dentry, int mode); 1427 int (*path_mkdir) (struct path *dir, struct dentry *dentry, umode_t mode);
1428 int (*path_rmdir) (struct path *dir, struct dentry *dentry); 1428 int (*path_rmdir) (struct path *dir, struct dentry *dentry);
1429 int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, 1429 int (*path_mknod) (struct path *dir, struct dentry *dentry, umode_t mode,
1430 unsigned int dev); 1430 unsigned int dev);
1431 int (*path_truncate) (struct path *path); 1431 int (*path_truncate) (struct path *path);
1432 int (*path_symlink) (struct path *dir, struct dentry *dentry, 1432 int (*path_symlink) (struct path *dir, struct dentry *dentry,
@@ -1435,8 +1435,7 @@ struct security_operations {
1435 struct dentry *new_dentry); 1435 struct dentry *new_dentry);
1436 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1436 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1437 struct path *new_dir, struct dentry *new_dentry); 1437 struct path *new_dir, struct dentry *new_dentry);
1438 int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, 1438 int (*path_chmod) (struct path *path, umode_t mode);
1439 mode_t mode);
1440 int (*path_chown) (struct path *path, uid_t uid, gid_t gid); 1439 int (*path_chown) (struct path *path, uid_t uid, gid_t gid);
1441 int (*path_chroot) (struct path *path); 1440 int (*path_chroot) (struct path *path);
1442#endif 1441#endif
@@ -1447,16 +1446,16 @@ struct security_operations {
1447 const struct qstr *qstr, char **name, 1446 const struct qstr *qstr, char **name,
1448 void **value, size_t *len); 1447 void **value, size_t *len);
1449 int (*inode_create) (struct inode *dir, 1448 int (*inode_create) (struct inode *dir,
1450 struct dentry *dentry, int mode); 1449 struct dentry *dentry, umode_t mode);
1451 int (*inode_link) (struct dentry *old_dentry, 1450 int (*inode_link) (struct dentry *old_dentry,
1452 struct inode *dir, struct dentry *new_dentry); 1451 struct inode *dir, struct dentry *new_dentry);
1453 int (*inode_unlink) (struct inode *dir, struct dentry *dentry); 1452 int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
1454 int (*inode_symlink) (struct inode *dir, 1453 int (*inode_symlink) (struct inode *dir,
1455 struct dentry *dentry, const char *old_name); 1454 struct dentry *dentry, const char *old_name);
1456 int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode); 1455 int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, umode_t mode);
1457 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry); 1456 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry);
1458 int (*inode_mknod) (struct inode *dir, struct dentry *dentry, 1457 int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
1459 int mode, dev_t dev); 1458 umode_t mode, dev_t dev);
1460 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, 1459 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
1461 struct inode *new_dir, struct dentry *new_dentry); 1460 struct inode *new_dir, struct dentry *new_dentry);
1462 int (*inode_readlink) (struct dentry *dentry); 1461 int (*inode_readlink) (struct dentry *dentry);
@@ -1716,15 +1715,15 @@ int security_inode_init_security(struct inode *inode, struct inode *dir,
1716int security_old_inode_init_security(struct inode *inode, struct inode *dir, 1715int security_old_inode_init_security(struct inode *inode, struct inode *dir,
1717 const struct qstr *qstr, char **name, 1716 const struct qstr *qstr, char **name,
1718 void **value, size_t *len); 1717 void **value, size_t *len);
1719int security_inode_create(struct inode *dir, struct dentry *dentry, int mode); 1718int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);
1720int security_inode_link(struct dentry *old_dentry, struct inode *dir, 1719int security_inode_link(struct dentry *old_dentry, struct inode *dir,
1721 struct dentry *new_dentry); 1720 struct dentry *new_dentry);
1722int security_inode_unlink(struct inode *dir, struct dentry *dentry); 1721int security_inode_unlink(struct inode *dir, struct dentry *dentry);
1723int security_inode_symlink(struct inode *dir, struct dentry *dentry, 1722int security_inode_symlink(struct inode *dir, struct dentry *dentry,
1724 const char *old_name); 1723 const char *old_name);
1725int security_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode); 1724int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
1726int security_inode_rmdir(struct inode *dir, struct dentry *dentry); 1725int security_inode_rmdir(struct inode *dir, struct dentry *dentry);
1727int security_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev); 1726int security_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev);
1728int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, 1727int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
1729 struct inode *new_dir, struct dentry *new_dentry); 1728 struct inode *new_dir, struct dentry *new_dentry);
1730int security_inode_readlink(struct dentry *dentry); 1729int security_inode_readlink(struct dentry *dentry);
@@ -2061,7 +2060,7 @@ static inline int security_old_inode_init_security(struct inode *inode,
2061 2060
2062static inline int security_inode_create(struct inode *dir, 2061static inline int security_inode_create(struct inode *dir,
2063 struct dentry *dentry, 2062 struct dentry *dentry,
2064 int mode) 2063 umode_t mode)
2065{ 2064{
2066 return 0; 2065 return 0;
2067} 2066}
@@ -2855,9 +2854,9 @@ static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi
2855 2854
2856#ifdef CONFIG_SECURITY_PATH 2855#ifdef CONFIG_SECURITY_PATH
2857int security_path_unlink(struct path *dir, struct dentry *dentry); 2856int security_path_unlink(struct path *dir, struct dentry *dentry);
2858int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode); 2857int security_path_mkdir(struct path *dir, struct dentry *dentry, umode_t mode);
2859int security_path_rmdir(struct path *dir, struct dentry *dentry); 2858int security_path_rmdir(struct path *dir, struct dentry *dentry);
2860int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, 2859int security_path_mknod(struct path *dir, struct dentry *dentry, umode_t mode,
2861 unsigned int dev); 2860 unsigned int dev);
2862int security_path_truncate(struct path *path); 2861int security_path_truncate(struct path *path);
2863int security_path_symlink(struct path *dir, struct dentry *dentry, 2862int security_path_symlink(struct path *dir, struct dentry *dentry,
@@ -2866,8 +2865,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
2866 struct dentry *new_dentry); 2865 struct dentry *new_dentry);
2867int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2866int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2868 struct path *new_dir, struct dentry *new_dentry); 2867 struct path *new_dir, struct dentry *new_dentry);
2869int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 2868int security_path_chmod(struct path *path, umode_t mode);
2870 mode_t mode);
2871int security_path_chown(struct path *path, uid_t uid, gid_t gid); 2869int security_path_chown(struct path *path, uid_t uid, gid_t gid);
2872int security_path_chroot(struct path *path); 2870int security_path_chroot(struct path *path);
2873#else /* CONFIG_SECURITY_PATH */ 2871#else /* CONFIG_SECURITY_PATH */
@@ -2877,7 +2875,7 @@ static inline int security_path_unlink(struct path *dir, struct dentry *dentry)
2877} 2875}
2878 2876
2879static inline int security_path_mkdir(struct path *dir, struct dentry *dentry, 2877static inline int security_path_mkdir(struct path *dir, struct dentry *dentry,
2880 int mode) 2878 umode_t mode)
2881{ 2879{
2882 return 0; 2880 return 0;
2883} 2881}
@@ -2888,7 +2886,7 @@ static inline int security_path_rmdir(struct path *dir, struct dentry *dentry)
2888} 2886}
2889 2887
2890static inline int security_path_mknod(struct path *dir, struct dentry *dentry, 2888static inline int security_path_mknod(struct path *dir, struct dentry *dentry,
2891 int mode, unsigned int dev) 2889 umode_t mode, unsigned int dev)
2892{ 2890{
2893 return 0; 2891 return 0;
2894} 2892}
@@ -2919,9 +2917,7 @@ static inline int security_path_rename(struct path *old_dir,
2919 return 0; 2917 return 0;
2920} 2918}
2921 2919
2922static inline int security_path_chmod(struct dentry *dentry, 2920static inline int security_path_chmod(struct path *path, umode_t mode)
2923 struct vfsmount *mnt,
2924 mode_t mode)
2925{ 2921{
2926 return 0; 2922 return 0;
2927} 2923}
@@ -3010,7 +3006,7 @@ static inline void security_audit_rule_free(void *lsmrule)
3010 3006
3011#ifdef CONFIG_SECURITYFS 3007#ifdef CONFIG_SECURITYFS
3012 3008
3013extern struct dentry *securityfs_create_file(const char *name, mode_t mode, 3009extern struct dentry *securityfs_create_file(const char *name, umode_t mode,
3014 struct dentry *parent, void *data, 3010 struct dentry *parent, void *data,
3015 const struct file_operations *fops); 3011 const struct file_operations *fops);
3016extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); 3012extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
@@ -3025,7 +3021,7 @@ static inline struct dentry *securityfs_create_dir(const char *name,
3025} 3021}
3026 3022
3027static inline struct dentry *securityfs_create_file(const char *name, 3023static inline struct dentry *securityfs_create_file(const char *name,
3028 mode_t mode, 3024 umode_t mode,
3029 struct dentry *parent, 3025 struct dentry *parent,
3030 void *data, 3026 void *data,
3031 const struct file_operations *fops) 3027 const struct file_operations *fops)
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 0b69a4684216..44f1514b00ba 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -74,7 +74,7 @@ static inline void seq_commit(struct seq_file *m, int num)
74 } 74 }
75} 75}
76 76
77char *mangle_path(char *s, char *p, char *esc); 77char *mangle_path(char *s, const char *p, const char *esc);
78int seq_open(struct file *, const struct seq_operations *); 78int seq_open(struct file *, const struct seq_operations *);
79ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); 79ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);
80loff_t seq_lseek(struct file *, loff_t, int); 80loff_t seq_lseek(struct file *, loff_t, int);
@@ -86,10 +86,10 @@ int seq_write(struct seq_file *seq, const void *data, size_t len);
86 86
87__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...); 87__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
88 88
89int seq_path(struct seq_file *, struct path *, char *); 89int seq_path(struct seq_file *, const struct path *, const char *);
90int seq_dentry(struct seq_file *, struct dentry *, char *); 90int seq_dentry(struct seq_file *, struct dentry *, const char *);
91int seq_path_root(struct seq_file *m, struct path *path, struct path *root, 91int seq_path_root(struct seq_file *m, const struct path *path,
92 char *esc); 92 const struct path *root, const char *esc);
93int seq_bitmap(struct seq_file *m, const unsigned long *bits, 93int seq_bitmap(struct seq_file *m, const unsigned long *bits,
94 unsigned int nr_bits); 94 unsigned int nr_bits);
95static inline int seq_cpumask(struct seq_file *m, const struct cpumask *mask) 95static inline int seq_cpumask(struct seq_file *m, const struct cpumask *mask)
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 1f05bbeac01e..8f012f8ac8e9 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -66,6 +66,7 @@ enum {
66 * dependent on the 8250 driver. 66 * dependent on the 8250 driver.
67 */ 67 */
68struct uart_port; 68struct uart_port;
69struct uart_8250_port;
69 70
70int serial8250_register_port(struct uart_port *); 71int serial8250_register_port(struct uart_port *);
71void serial8250_unregister_port(int line); 72void serial8250_unregister_port(int line);
@@ -81,7 +82,11 @@ extern void serial8250_do_set_termios(struct uart_port *port,
81 struct ktermios *termios, struct ktermios *old); 82 struct ktermios *termios, struct ktermios *old);
82extern void serial8250_do_pm(struct uart_port *port, unsigned int state, 83extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
83 unsigned int oldstate); 84 unsigned int oldstate);
85extern int fsl8250_handle_irq(struct uart_port *port);
84int serial8250_handle_irq(struct uart_port *port, unsigned int iir); 86int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
87unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr);
88void serial8250_tx_chars(struct uart_8250_port *up);
89unsigned int serial8250_modem_status(struct uart_8250_port *up);
85 90
86extern void serial8250_set_isa_configurator(void (*v) 91extern void serial8250_set_isa_configurator(void (*v)
87 (int port, struct uart_port *up, 92 (int port, struct uart_port *up,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index eadf33d0abba..b67305e3ad57 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -351,6 +351,7 @@ struct uart_port {
351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
353#define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) 353#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
354#define UPF_IIR_ONCE ((__force upf_t) (1 << 26))
354/* The exact UART type is known and should not be probed. */ 355/* The exact UART type is known and should not be probed. */
355#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) 356#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
356#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 357#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
@@ -483,10 +484,19 @@ static inline int uart_tx_stopped(struct uart_port *port)
483/* 484/*
484 * The following are helper functions for the low level drivers. 485 * The following are helper functions for the low level drivers.
485 */ 486 */
487
488extern void uart_handle_dcd_change(struct uart_port *uport,
489 unsigned int status);
490extern void uart_handle_cts_change(struct uart_port *uport,
491 unsigned int status);
492
493extern void uart_insert_char(struct uart_port *port, unsigned int status,
494 unsigned int overrun, unsigned int ch, unsigned int flag);
495
496#ifdef SUPPORT_SYSRQ
486static inline int 497static inline int
487uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) 498uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
488{ 499{
489#ifdef SUPPORT_SYSRQ
490 if (port->sysrq) { 500 if (port->sysrq) {
491 if (ch && time_before(jiffies, port->sysrq)) { 501 if (ch && time_before(jiffies, port->sysrq)) {
492 handle_sysrq(ch); 502 handle_sysrq(ch);
@@ -495,11 +505,10 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
495 } 505 }
496 port->sysrq = 0; 506 port->sysrq = 0;
497 } 507 }
498#endif
499 return 0; 508 return 0;
500} 509}
501#ifndef SUPPORT_SYSRQ 510#else
502#define uart_handle_sysrq_char(port,ch) uart_handle_sysrq_char(port, 0) 511#define uart_handle_sysrq_char(port,ch) ({ (void)port; 0; })
503#endif 512#endif
504 513
505/* 514/*
@@ -522,89 +531,6 @@ static inline int uart_handle_break(struct uart_port *port)
522 return 0; 531 return 0;
523} 532}
524 533
525/**
526 * uart_handle_dcd_change - handle a change of carrier detect state
527 * @uport: uart_port structure for the open port
528 * @status: new carrier detect status, nonzero if active
529 */
530static inline void
531uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
532{
533 struct uart_state *state = uport->state;
534 struct tty_port *port = &state->port;
535 struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
536 struct pps_event_time ts;
537
538 if (ld && ld->ops->dcd_change)
539 pps_get_ts(&ts);
540
541 uport->icount.dcd++;
542#ifdef CONFIG_HARD_PPS
543 if ((uport->flags & UPF_HARDPPS_CD) && status)
544 hardpps();
545#endif
546
547 if (port->flags & ASYNC_CHECK_CD) {
548 if (status)
549 wake_up_interruptible(&port->open_wait);
550 else if (port->tty)
551 tty_hangup(port->tty);
552 }
553
554 if (ld && ld->ops->dcd_change)
555 ld->ops->dcd_change(port->tty, status, &ts);
556 if (ld)
557 tty_ldisc_deref(ld);
558}
559
560/**
561 * uart_handle_cts_change - handle a change of clear-to-send state
562 * @uport: uart_port structure for the open port
563 * @status: new clear to send status, nonzero if active
564 */
565static inline void
566uart_handle_cts_change(struct uart_port *uport, unsigned int status)
567{
568 struct tty_port *port = &uport->state->port;
569 struct tty_struct *tty = port->tty;
570
571 uport->icount.cts++;
572
573 if (port->flags & ASYNC_CTS_FLOW) {
574 if (tty->hw_stopped) {
575 if (status) {
576 tty->hw_stopped = 0;
577 uport->ops->start_tx(uport);
578 uart_write_wakeup(uport);
579 }
580 } else {
581 if (!status) {
582 tty->hw_stopped = 1;
583 uport->ops->stop_tx(uport);
584 }
585 }
586 }
587}
588
589#include <linux/tty_flip.h>
590
591static inline void
592uart_insert_char(struct uart_port *port, unsigned int status,
593 unsigned int overrun, unsigned int ch, unsigned int flag)
594{
595 struct tty_struct *tty = port->state->port.tty;
596
597 if ((status & port->ignore_status_mask & ~overrun) == 0)
598 tty_insert_flip_char(tty, ch, flag);
599
600 /*
601 * Overrun is special. Since it's reported immediately,
602 * it doesn't affect the current character.
603 */
604 if (status & ~port->ignore_status_mask & overrun)
605 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
606}
607
608/* 534/*
609 * UART_ENABLE_MS - determine if port should enable modem status irqs 535 * UART_ENABLE_MS - determine if port should enable modem status irqs
610 */ 536 */
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 5812fefbcedf..b160645f5599 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -95,6 +95,7 @@ struct intc_desc {
95 unsigned int num_resources; 95 unsigned int num_resources;
96 intc_enum force_enable; 96 intc_enum force_enable;
97 intc_enum force_disable; 97 intc_enum force_disable;
98 bool skip_syscore_suspend;
98 struct intc_hw_desc hw; 99 struct intc_hw_desc hw;
99}; 100};
100 101
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 9291ac3cc627..e4c711c6f321 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -30,7 +30,7 @@ struct shmem_sb_info {
30 spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ 30 spinlock_t stat_lock; /* Serialize shmem_sb_info changes */
31 uid_t uid; /* Mount uid for root directory */ 31 uid_t uid; /* Mount uid for root directory */
32 gid_t gid; /* Mount gid for root directory */ 32 gid_t gid; /* Mount gid for root directory */
33 mode_t mode; /* Mount mode for root directory */ 33 umode_t mode; /* Mount mode for root directory */
34 struct mempolicy *mpol; /* default memory policy for mappings */ 34 struct mempolicy *mpol; /* default memory policy for mappings */
35}; 35};
36 36
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index d00e0bacda93..fbd1117fdfde 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -15,8 +15,6 @@
15#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ 15#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17 17
18#include <trace/events/kmem.h>
19
20/* 18/*
21 * struct kmem_cache 19 * struct kmem_cache
22 * 20 *
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index bb4f5fbbbd8e..176fce9cc6b1 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -200,6 +200,17 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
200 driver_unregister(&sdrv->driver); 200 driver_unregister(&sdrv->driver);
201} 201}
202 202
203/**
204 * module_spi_driver() - Helper macro for registering a SPI driver
205 * @__spi_driver: spi_driver struct
206 *
207 * Helper macro for SPI drivers which do not do anything special in module
208 * init/exit. This eliminates a lot of boilerplate. Each module may only
209 * use this macro once, and calling it replaces module_init() and module_exit()
210 */
211#define module_spi_driver(__spi_driver) \
212 module_driver(__spi_driver, spi_register_driver, \
213 spi_unregister_driver)
203 214
204/** 215/**
205 * struct spi_master - interface to SPI master controller 216 * struct spi_master - interface to SPI master controller
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 5efd8cef389e..57531f8e5956 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -203,7 +203,7 @@ extern void cache_unregister(struct cache_detail *cd);
203extern void cache_unregister_net(struct cache_detail *cd, struct net *net); 203extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
204 204
205extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, 205extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *,
206 mode_t, struct cache_detail *); 206 umode_t, struct cache_detail *);
207extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); 207extern void sunrpc_cache_unregister_pipefs(struct cache_detail *);
208 208
209extern void qword_add(char **bpp, int *lp, char *str); 209extern void qword_add(char **bpp, int *lp, char *str);
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index e4ea43058d8f..2bb03d77375a 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -55,7 +55,7 @@ extern int rpc_remove_client_dir(struct dentry *);
55struct cache_detail; 55struct cache_detail;
56extern struct dentry *rpc_create_cache_dir(struct dentry *, 56extern struct dentry *rpc_create_cache_dir(struct dentry *,
57 struct qstr *, 57 struct qstr *,
58 mode_t umode, 58 umode_t umode,
59 struct cache_detail *); 59 struct cache_detail *);
60extern void rpc_remove_cache_dir(struct dentry *); 60extern void rpc_remove_cache_dir(struct dentry *);
61 61
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 57a692432f8a..95040cc33107 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -6,6 +6,7 @@
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/pm.h> 7#include <linux/pm.h>
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/freezer.h>
9#include <asm/errno.h> 10#include <asm/errno.h>
10 11
11#ifdef CONFIG_VT 12#ifdef CONFIG_VT
@@ -331,6 +332,8 @@ static inline bool system_entering_hibernation(void) { return false; }
331#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */ 332#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
332#define PM_POST_RESTORE 0x0006 /* Restore failed */ 333#define PM_POST_RESTORE 0x0006 /* Restore failed */
333 334
335extern struct mutex pm_mutex;
336
334#ifdef CONFIG_PM_SLEEP 337#ifdef CONFIG_PM_SLEEP
335void save_processor_state(void); 338void save_processor_state(void);
336void restore_processor_state(void); 339void restore_processor_state(void);
@@ -351,6 +354,19 @@ extern bool events_check_enabled;
351extern bool pm_wakeup_pending(void); 354extern bool pm_wakeup_pending(void);
352extern bool pm_get_wakeup_count(unsigned int *count); 355extern bool pm_get_wakeup_count(unsigned int *count);
353extern bool pm_save_wakeup_count(unsigned int count); 356extern bool pm_save_wakeup_count(unsigned int count);
357
358static inline void lock_system_sleep(void)
359{
360 freezer_do_not_count();
361 mutex_lock(&pm_mutex);
362}
363
364static inline void unlock_system_sleep(void)
365{
366 mutex_unlock(&pm_mutex);
367 freezer_count();
368}
369
354#else /* !CONFIG_PM_SLEEP */ 370#else /* !CONFIG_PM_SLEEP */
355 371
356static inline int register_pm_notifier(struct notifier_block *nb) 372static inline int register_pm_notifier(struct notifier_block *nb)
@@ -366,28 +382,11 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
366#define pm_notifier(fn, pri) do { (void)(fn); } while (0) 382#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
367 383
368static inline bool pm_wakeup_pending(void) { return false; } 384static inline bool pm_wakeup_pending(void) { return false; }
369#endif /* !CONFIG_PM_SLEEP */
370
371extern struct mutex pm_mutex;
372 385
373#ifndef CONFIG_HIBERNATE_CALLBACKS
374static inline void lock_system_sleep(void) {} 386static inline void lock_system_sleep(void) {}
375static inline void unlock_system_sleep(void) {} 387static inline void unlock_system_sleep(void) {}
376 388
377#else 389#endif /* !CONFIG_PM_SLEEP */
378
379/* Let some subsystems like memory hotadd exclude hibernation */
380
381static inline void lock_system_sleep(void)
382{
383 mutex_lock(&pm_mutex);
384}
385
386static inline void unlock_system_sleep(void)
387{
388 mutex_unlock(&pm_mutex);
389}
390#endif
391 390
392#ifdef CONFIG_ARCH_SAVE_PAGE_KEYS 391#ifdef CONFIG_ARCH_SAVE_PAGE_KEYS
393/* 392/*
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 86a24b1166d1..515669fa3c1d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -475,7 +475,7 @@ asmlinkage long sys_mincore(unsigned long start, size_t len,
475asmlinkage long sys_pivot_root(const char __user *new_root, 475asmlinkage long sys_pivot_root(const char __user *new_root,
476 const char __user *put_old); 476 const char __user *put_old);
477asmlinkage long sys_chroot(const char __user *filename); 477asmlinkage long sys_chroot(const char __user *filename);
478asmlinkage long sys_mknod(const char __user *filename, int mode, 478asmlinkage long sys_mknod(const char __user *filename, umode_t mode,
479 unsigned dev); 479 unsigned dev);
480asmlinkage long sys_link(const char __user *oldname, 480asmlinkage long sys_link(const char __user *oldname,
481 const char __user *newname); 481 const char __user *newname);
@@ -483,8 +483,8 @@ asmlinkage long sys_symlink(const char __user *old, const char __user *new);
483asmlinkage long sys_unlink(const char __user *pathname); 483asmlinkage long sys_unlink(const char __user *pathname);
484asmlinkage long sys_rename(const char __user *oldname, 484asmlinkage long sys_rename(const char __user *oldname,
485 const char __user *newname); 485 const char __user *newname);
486asmlinkage long sys_chmod(const char __user *filename, mode_t mode); 486asmlinkage long sys_chmod(const char __user *filename, umode_t mode);
487asmlinkage long sys_fchmod(unsigned int fd, mode_t mode); 487asmlinkage long sys_fchmod(unsigned int fd, umode_t mode);
488 488
489asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); 489asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
490#if BITS_PER_LONG == 32 490#if BITS_PER_LONG == 32
@@ -517,9 +517,9 @@ asmlinkage long sys_sendfile64(int out_fd, int in_fd,
517 loff_t __user *offset, size_t count); 517 loff_t __user *offset, size_t count);
518asmlinkage long sys_readlink(const char __user *path, 518asmlinkage long sys_readlink(const char __user *path,
519 char __user *buf, int bufsiz); 519 char __user *buf, int bufsiz);
520asmlinkage long sys_creat(const char __user *pathname, int mode); 520asmlinkage long sys_creat(const char __user *pathname, umode_t mode);
521asmlinkage long sys_open(const char __user *filename, 521asmlinkage long sys_open(const char __user *filename,
522 int flags, int mode); 522 int flags, umode_t mode);
523asmlinkage long sys_close(unsigned int fd); 523asmlinkage long sys_close(unsigned int fd);
524asmlinkage long sys_access(const char __user *filename, int mode); 524asmlinkage long sys_access(const char __user *filename, int mode);
525asmlinkage long sys_vhangup(void); 525asmlinkage long sys_vhangup(void);
@@ -582,7 +582,7 @@ asmlinkage long sys_preadv(unsigned long fd, const struct iovec __user *vec,
582asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec, 582asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec,
583 unsigned long vlen, unsigned long pos_l, unsigned long pos_h); 583 unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
584asmlinkage long sys_getcwd(char __user *buf, unsigned long size); 584asmlinkage long sys_getcwd(char __user *buf, unsigned long size);
585asmlinkage long sys_mkdir(const char __user *pathname, int mode); 585asmlinkage long sys_mkdir(const char __user *pathname, umode_t mode);
586asmlinkage long sys_chdir(const char __user *filename); 586asmlinkage long sys_chdir(const char __user *filename);
587asmlinkage long sys_fchdir(unsigned int fd); 587asmlinkage long sys_fchdir(unsigned int fd);
588asmlinkage long sys_rmdir(const char __user *pathname); 588asmlinkage long sys_rmdir(const char __user *pathname);
@@ -679,7 +679,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
679asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, 679asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
680 unsigned long third, void __user *ptr, long fifth); 680 unsigned long third, void __user *ptr, long fifth);
681 681
682asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); 682asmlinkage long sys_mq_open(const char __user *name, int oflag, umode_t mode, struct mq_attr __user *attr);
683asmlinkage long sys_mq_unlink(const char __user *name); 683asmlinkage long sys_mq_unlink(const char __user *name);
684asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); 684asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout);
685asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); 685asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout);
@@ -753,11 +753,11 @@ asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd);
753asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, 753asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
754 __u32 __user *ustatus); 754 __u32 __user *ustatus);
755asmlinkage long sys_spu_create(const char __user *name, 755asmlinkage long sys_spu_create(const char __user *name,
756 unsigned int flags, mode_t mode, int fd); 756 unsigned int flags, umode_t mode, int fd);
757 757
758asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, 758asmlinkage long sys_mknodat(int dfd, const char __user * filename, umode_t mode,
759 unsigned dev); 759 unsigned dev);
760asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, int mode); 760asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, umode_t mode);
761asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag); 761asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag);
762asmlinkage long sys_symlinkat(const char __user * oldname, 762asmlinkage long sys_symlinkat(const char __user * oldname,
763 int newdfd, const char __user * newname); 763 int newdfd, const char __user * newname);
@@ -769,11 +769,11 @@ asmlinkage long sys_futimesat(int dfd, const char __user *filename,
769 struct timeval __user *utimes); 769 struct timeval __user *utimes);
770asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); 770asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
771asmlinkage long sys_fchmodat(int dfd, const char __user * filename, 771asmlinkage long sys_fchmodat(int dfd, const char __user * filename,
772 mode_t mode); 772 umode_t mode);
773asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, 773asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
774 gid_t group, int flag); 774 gid_t group, int flag);
775asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, 775asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
776 int mode); 776 umode_t mode);
777asmlinkage long sys_newfstatat(int dfd, const char __user *filename, 777asmlinkage long sys_newfstatat(int dfd, const char __user *filename,
778 struct stat __user *statbuf, int flag); 778 struct stat __user *statbuf, int flag);
779asmlinkage long sys_fstatat64(int dfd, const char __user *filename, 779asmlinkage long sys_fstatat64(int dfd, const char __user *filename,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 703cfa33a3ca..bb9127dd814b 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -1038,7 +1038,7 @@ struct ctl_table
1038 const char *procname; /* Text ID for /proc/sys, or zero */ 1038 const char *procname; /* Text ID for /proc/sys, or zero */
1039 void *data; 1039 void *data;
1040 int maxlen; 1040 int maxlen;
1041 mode_t mode; 1041 umode_t mode;
1042 struct ctl_table *child; 1042 struct ctl_table *child;
1043 struct ctl_table *parent; /* Automatically set */ 1043 struct ctl_table *parent; /* Automatically set */
1044 proc_handler *proc_handler; /* Callback for text formatting */ 1044 proc_handler *proc_handler; /* Callback for text formatting */
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index dac0859e6440..0010009b2f00 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -25,7 +25,7 @@ enum kobj_ns_type;
25 25
26struct attribute { 26struct attribute {
27 const char *name; 27 const char *name;
28 mode_t mode; 28 umode_t mode;
29#ifdef CONFIG_DEBUG_LOCK_ALLOC 29#ifdef CONFIG_DEBUG_LOCK_ALLOC
30 struct lock_class_key *key; 30 struct lock_class_key *key;
31 struct lock_class_key skey; 31 struct lock_class_key skey;
@@ -55,7 +55,7 @@ do { \
55 55
56struct attribute_group { 56struct attribute_group {
57 const char *name; 57 const char *name;
58 mode_t (*is_visible)(struct kobject *, 58 umode_t (*is_visible)(struct kobject *,
59 struct attribute *, int); 59 struct attribute *, int);
60 struct attribute **attrs; 60 struct attribute **attrs;
61}; 61};
@@ -133,7 +133,7 @@ int __must_check sysfs_create_file(struct kobject *kobj,
133int __must_check sysfs_create_files(struct kobject *kobj, 133int __must_check sysfs_create_files(struct kobject *kobj,
134 const struct attribute **attr); 134 const struct attribute **attr);
135int __must_check sysfs_chmod_file(struct kobject *kobj, 135int __must_check sysfs_chmod_file(struct kobject *kobj,
136 const struct attribute *attr, mode_t mode); 136 const struct attribute *attr, umode_t mode);
137void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); 137void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
138void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); 138void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
139 139
@@ -221,7 +221,7 @@ static inline int sysfs_create_files(struct kobject *kobj,
221} 221}
222 222
223static inline int sysfs_chmod_file(struct kobject *kobj, 223static inline int sysfs_chmod_file(struct kobject *kobj,
224 const struct attribute *attr, mode_t mode) 224 const struct attribute *attr, umode_t mode)
225{ 225{
226 return 0; 226 return 0;
227} 227}
diff --git a/include/linux/types.h b/include/linux/types.h
index 57a97234bec1..e5fa50345516 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -24,6 +24,7 @@ typedef __kernel_fd_set fd_set;
24typedef __kernel_dev_t dev_t; 24typedef __kernel_dev_t dev_t;
25typedef __kernel_ino_t ino_t; 25typedef __kernel_ino_t ino_t;
26typedef __kernel_mode_t mode_t; 26typedef __kernel_mode_t mode_t;
27typedef unsigned short umode_t;
27typedef __kernel_nlink_t nlink_t; 28typedef __kernel_nlink_t nlink_t;
28typedef __kernel_off_t off_t; 29typedef __kernel_off_t off_t;
29typedef __kernel_pid_t pid_t; 30typedef __kernel_pid_t pid_t;
@@ -188,7 +189,7 @@ typedef __u32 __bitwise __wsum;
188 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid 189 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
189 * common 32/64-bit compat problems. 190 * common 32/64-bit compat problems.
190 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other 191 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
191 * architectures) and to 8-byte boundaries on 64-bit architetures. The new 192 * architectures) and to 8-byte boundaries on 64-bit architectures. The new
192 * aligned_64 type enforces 8-byte alignment so that structs containing 193 * aligned_64 type enforces 8-byte alignment so that structs containing
193 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures. 194 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
194 * No conversions are necessary between 32-bit user-space and a 64-bit kernel. 195 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d3d0c1374334..27a4e16d2bf1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -935,7 +935,7 @@ extern struct bus_type usb_bus_type;
935 */ 935 */
936struct usb_class_driver { 936struct usb_class_driver {
937 char *name; 937 char *name;
938 char *(*devnode)(struct device *dev, mode_t *mode); 938 char *(*devnode)(struct device *dev, umode_t *mode);
939 const struct file_operations *fops; 939 const struct file_operations *fops;
940 int minor_base; 940 int minor_base;
941}; 941};
@@ -953,6 +953,18 @@ extern int usb_register_driver(struct usb_driver *, struct module *,
953 953
954extern void usb_deregister(struct usb_driver *); 954extern void usb_deregister(struct usb_driver *);
955 955
956/**
957 * module_usb_driver() - Helper macro for registering a USB driver
958 * @__usb_driver: usb_driver struct
959 *
960 * Helper macro for USB drivers which do not do anything special in module
961 * init/exit. This eliminates a lot of boilerplate. Each module may only
962 * use this macro once, and calling it replaces module_init() and module_exit()
963 */
964#define module_usb_driver(__usb_driver) \
965 module_driver(__usb_driver, usb_register, \
966 usb_deregister)
967
956extern int usb_register_device_driver(struct usb_device_driver *, 968extern int usb_register_device_driver(struct usb_device_driver *,
957 struct module *); 969 struct module *);
958extern void usb_deregister_device_driver(struct usb_device_driver *); 970extern void usb_deregister_device_driver(struct usb_device_driver *);
@@ -1221,6 +1233,7 @@ struct urb {
1221 void *transfer_buffer; /* (in) associated data buffer */ 1233 void *transfer_buffer; /* (in) associated data buffer */
1222 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ 1234 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
1223 struct scatterlist *sg; /* (in) scatter gather buffer list */ 1235 struct scatterlist *sg; /* (in) scatter gather buffer list */
1236 int num_mapped_sgs; /* (internal) mapped sg entries */
1224 int num_sgs; /* (in) number of entries in the sg list */ 1237 int num_sgs; /* (in) number of entries in the sg list */
1225 u32 transfer_buffer_length; /* (in) data buffer length */ 1238 u32 transfer_buffer_length; /* (in) data buffer length */
1226 u32 actual_length; /* (return) actual transfer length */ 1239 u32 actual_length; /* (return) actual transfer length */
@@ -1598,6 +1611,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1598 1611
1599/* ----------------------------------------------------------------------- */ 1612/* ----------------------------------------------------------------------- */
1600 1613
1614/* translate USB error codes to codes user space understands */
1615static inline int usb_translate_errors(int error_code)
1616{
1617 switch (error_code) {
1618 case 0:
1619 case -ENOMEM:
1620 case -ENODEV:
1621 return error_code;
1622 default:
1623 return -EIO;
1624 }
1625}
1626
1601/* Events from the usb core */ 1627/* Events from the usb core */
1602#define USB_DEVICE_ADD 0x0001 1628#define USB_DEVICE_ADD 0x0001
1603#define USB_DEVICE_REMOVE 0x0002 1629#define USB_DEVICE_REMOVE 0x0002
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
index 4ebaf0824179..31fdb4c6ee3d 100644
--- a/include/linux/usb/ch11.h
+++ b/include/linux/usb/ch11.h
@@ -26,7 +26,6 @@
26#define HUB_RESET_TT 9 26#define HUB_RESET_TT 9
27#define HUB_GET_TT_STATE 10 27#define HUB_GET_TT_STATE 10
28#define HUB_STOP_TT 11 28#define HUB_STOP_TT 11
29#define HUB_SET_DEPTH 12
30 29
31/* 30/*
32 * Hub class additional requests defined by USB 3.0 spec 31 * Hub class additional requests defined by USB 3.0 spec
@@ -165,11 +164,20 @@ struct usb_port_status {
165 * wHubCharacteristics (masks) 164 * wHubCharacteristics (masks)
166 * See USB 2.0 spec Table 11-13, offset 3 165 * See USB 2.0 spec Table 11-13, offset 3
167 */ 166 */
168#define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */ 167#define HUB_CHAR_LPSM 0x0003 /* Logical Power Switching Mode mask */
169#define HUB_CHAR_COMPOUND 0x0004 /* D2 */ 168#define HUB_CHAR_COMMON_LPSM 0x0000 /* All ports power control at once */
170#define HUB_CHAR_OCPM 0x0018 /* D4 .. D3 */ 169#define HUB_CHAR_INDV_PORT_LPSM 0x0001 /* per-port power control */
171#define HUB_CHAR_TTTT 0x0060 /* D6 .. D5 */ 170#define HUB_CHAR_NO_LPSM 0x0002 /* no power switching */
172#define HUB_CHAR_PORTIND 0x0080 /* D7 */ 171
172#define HUB_CHAR_COMPOUND 0x0004 /* hub is part of a compound device */
173
174#define HUB_CHAR_OCPM 0x0018 /* Over-Current Protection Mode mask */
175#define HUB_CHAR_COMMON_OCPM 0x0000 /* All ports Over-Current reporting */
176#define HUB_CHAR_INDV_PORT_OCPM 0x0008 /* per-port Over-current reporting */
177#define HUB_CHAR_NO_OCPM 0x0010 /* No Over-current Protection support */
178
179#define HUB_CHAR_TTTT 0x0060 /* TT Think Time mask */
180#define HUB_CHAR_PORTIND 0x0080 /* per-port indicators (LEDs) */
173 181
174struct usb_hub_status { 182struct usb_hub_status {
175 __le16 wHubStatus; 183 __le16 wHubStatus;
@@ -198,6 +206,17 @@ struct usb_hub_status {
198#define USB_DT_HUB_NONVAR_SIZE 7 206#define USB_DT_HUB_NONVAR_SIZE 7
199#define USB_DT_SS_HUB_SIZE 12 207#define USB_DT_SS_HUB_SIZE 12
200 208
209/*
210 * Hub Device descriptor
211 * USB Hub class device protocols
212 */
213
214#define USB_HUB_PR_FS 0 /* Full speed hub */
215#define USB_HUB_PR_HS_NO_TT 0 /* Hi-speed hub without TT */
216#define USB_HUB_PR_HS_SINGLE_TT 1 /* Hi-speed hub with single TT */
217#define USB_HUB_PR_HS_MULTI_TT 2 /* Hi-speed hub with multiple TT */
218#define USB_HUB_PR_SS 3 /* Super speed hub */
219
201struct usb_hub_descriptor { 220struct usb_hub_descriptor {
202 __u8 bDescLength; 221 __u8 bDescLength;
203 __u8 bDescriptorType; 222 __u8 bDescriptorType;
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index d5da6c68c250..61b29057b054 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -605,8 +605,26 @@ struct usb_ss_ep_comp_descriptor {
605} __attribute__ ((packed)); 605} __attribute__ ((packed));
606 606
607#define USB_DT_SS_EP_COMP_SIZE 6 607#define USB_DT_SS_EP_COMP_SIZE 6
608
608/* Bits 4:0 of bmAttributes if this is a bulk endpoint */ 609/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
609#define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f)) 610static inline int
611usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
612{
613 int max_streams;
614
615 if (!comp)
616 return 0;
617
618 max_streams = comp->bmAttributes & 0x1f;
619
620 if (!max_streams)
621 return 0;
622
623 max_streams = 1 << max_streams;
624
625 return max_streams;
626}
627
610/* Bits 1:0 of bmAttributes if this is an isoc endpoint */ 628/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
611#define USB_SS_MULT(p) (1 + ((p) & 0x3)) 629#define USB_SS_MULT(p) (1 + ((p) & 0x3))
612 630
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 1d3a67523ffc..da653b5c7134 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/scatterlist.h>
23#include <linux/types.h> 24#include <linux/types.h>
24#include <linux/usb/ch9.h> 25#include <linux/usb/ch9.h>
25 26
@@ -32,6 +33,9 @@ struct usb_ep;
32 * @dma: DMA address corresponding to 'buf'. If you don't set this 33 * @dma: DMA address corresponding to 'buf'. If you don't set this
33 * field, and the usb controller needs one, it is responsible 34 * field, and the usb controller needs one, it is responsible
34 * for mapping and unmapping the buffer. 35 * for mapping and unmapping the buffer.
36 * @sg: a scatterlist for SG-capable controllers.
37 * @num_sgs: number of SG entries
38 * @num_mapped_sgs: number of SG entries mapped to DMA (internal)
35 * @length: Length of that data 39 * @length: Length of that data
36 * @stream_id: The stream id, when USB3.0 bulk streams are being used 40 * @stream_id: The stream id, when USB3.0 bulk streams are being used
37 * @no_interrupt: If true, hints that no completion irq is needed. 41 * @no_interrupt: If true, hints that no completion irq is needed.
@@ -88,6 +92,10 @@ struct usb_request {
88 unsigned length; 92 unsigned length;
89 dma_addr_t dma; 93 dma_addr_t dma;
90 94
95 struct scatterlist *sg;
96 unsigned num_sgs;
97 unsigned num_mapped_sgs;
98
91 unsigned stream_id:16; 99 unsigned stream_id:16;
92 unsigned no_interrupt:1; 100 unsigned no_interrupt:1;
93 unsigned zero:1; 101 unsigned zero:1;
@@ -164,7 +172,7 @@ struct usb_ep {
164 unsigned maxpacket:16; 172 unsigned maxpacket:16;
165 unsigned max_streams:16; 173 unsigned max_streams:16;
166 unsigned mult:2; 174 unsigned mult:2;
167 unsigned maxburst:4; 175 unsigned maxburst:5;
168 u8 address; 176 u8 address;
169 const struct usb_endpoint_descriptor *desc; 177 const struct usb_endpoint_descriptor *desc;
170 const struct usb_ss_ep_comp_descriptor *comp_desc; 178 const struct usb_ss_ep_comp_descriptor *comp_desc;
@@ -477,8 +485,9 @@ struct usb_gadget_ops {
477 * driver setup() requests 485 * driver setup() requests
478 * @ep_list: List of other endpoints supported by the device. 486 * @ep_list: List of other endpoints supported by the device.
479 * @speed: Speed of current connection to USB host. 487 * @speed: Speed of current connection to USB host.
480 * @is_dualspeed: True if the controller supports both high and full speed 488 * @max_speed: Maximal speed the UDC can handle. UDC must support this
481 * operation. If it does, the gadget driver must also support both. 489 * and all slower speeds.
490 * @sg_supported: true if we can handle scatter-gather
482 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the 491 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
483 * gadget driver must provide a USB OTG descriptor. 492 * gadget driver must provide a USB OTG descriptor.
484 * @is_a_peripheral: False unless is_otg, the "A" end of a USB cable 493 * @is_a_peripheral: False unless is_otg, the "A" end of a USB cable
@@ -518,7 +527,8 @@ struct usb_gadget {
518 struct usb_ep *ep0; 527 struct usb_ep *ep0;
519 struct list_head ep_list; /* of usb_ep */ 528 struct list_head ep_list; /* of usb_ep */
520 enum usb_device_speed speed; 529 enum usb_device_speed speed;
521 unsigned is_dualspeed:1; 530 enum usb_device_speed max_speed;
531 unsigned sg_supported:1;
522 unsigned is_otg:1; 532 unsigned is_otg:1;
523 unsigned is_a_peripheral:1; 533 unsigned is_a_peripheral:1;
524 unsigned b_hnp_enable:1; 534 unsigned b_hnp_enable:1;
@@ -549,7 +559,7 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
549static inline int gadget_is_dualspeed(struct usb_gadget *g) 559static inline int gadget_is_dualspeed(struct usb_gadget *g)
550{ 560{
551#ifdef CONFIG_USB_GADGET_DUALSPEED 561#ifdef CONFIG_USB_GADGET_DUALSPEED
552 /* runtime test would check "g->is_dualspeed" ... that might be 562 /* runtime test would check "g->max_speed" ... that might be
553 * useful to work around hardware bugs, but is mostly pointless 563 * useful to work around hardware bugs, but is mostly pointless
554 */ 564 */
555 return 1; 565 return 1;
@@ -567,7 +577,7 @@ static inline int gadget_is_superspeed(struct usb_gadget *g)
567{ 577{
568#ifdef CONFIG_USB_GADGET_SUPERSPEED 578#ifdef CONFIG_USB_GADGET_SUPERSPEED
569 /* 579 /*
570 * runtime test would check "g->is_superspeed" ... that might be 580 * runtime test would check "g->max_speed" ... that might be
571 * useful to work around hardware bugs, but is mostly pointless 581 * useful to work around hardware bugs, but is mostly pointless
572 */ 582 */
573 return 1; 583 return 1;
@@ -760,7 +770,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
760/** 770/**
761 * struct usb_gadget_driver - driver for usb 'slave' devices 771 * struct usb_gadget_driver - driver for usb 'slave' devices
762 * @function: String describing the gadget's function 772 * @function: String describing the gadget's function
763 * @speed: Highest speed the driver handles. 773 * @max_speed: Highest speed the driver handles.
764 * @setup: Invoked for ep0 control requests that aren't handled by 774 * @setup: Invoked for ep0 control requests that aren't handled by
765 * the hardware level driver. Most calls must be handled by 775 * the hardware level driver. Most calls must be handled by
766 * the gadget driver, including descriptor and configuration 776 * the gadget driver, including descriptor and configuration
@@ -824,7 +834,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
824 */ 834 */
825struct usb_gadget_driver { 835struct usb_gadget_driver {
826 char *function; 836 char *function;
827 enum usb_device_speed speed; 837 enum usb_device_speed max_speed;
828 void (*unbind)(struct usb_gadget *); 838 void (*unbind)(struct usb_gadget *);
829 int (*setup)(struct usb_gadget *, 839 int (*setup)(struct usb_gadget *,
830 const struct usb_ctrlrequest *); 840 const struct usb_ctrlrequest *);
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 03354d557b79..b2f62f3a32af 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -99,7 +99,6 @@ struct usb_hcd {
99 */ 99 */
100 unsigned long flags; 100 unsigned long flags;
101#define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ 101#define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */
102#define HCD_FLAG_SAW_IRQ 1
103#define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ 102#define HCD_FLAG_POLL_RH 2 /* poll for rh status? */
104#define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ 103#define HCD_FLAG_POLL_PENDING 3 /* status has changed? */
105#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ 104#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
@@ -110,7 +109,6 @@ struct usb_hcd {
110 * be slightly faster than test_bit(). 109 * be slightly faster than test_bit().
111 */ 110 */
112#define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) 111#define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))
113#define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ))
114#define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) 112#define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
115#define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) 113#define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
116#define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) 114#define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index e5a40c318548..0d3f98879256 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -67,6 +67,14 @@ struct renesas_usbhs_platform_callback {
67 /* 67 /*
68 * option: 68 * option:
69 * 69 *
70 * for board specific clock control
71 */
72 void (*power_ctrl)(struct platform_device *pdev,
73 void __iomem *base, int enable);
74
75 /*
76 * option:
77 *
70 * Phy reset for platform 78 * Phy reset for platform
71 */ 79 */
72 void (*phy_reset)(struct platform_device *pdev); 80 void (*phy_reset)(struct platform_device *pdev);
@@ -118,7 +126,7 @@ struct renesas_usbhs_driver_param {
118 * 126 *
119 * delay time from notify_hotplug callback 127 * delay time from notify_hotplug callback
120 */ 128 */
121 int detection_delay; 129 int detection_delay; /* msec */
122 130
123 /* 131 /*
124 * option: 132 * option:
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index b29f70b2ecae..4267a9c717ba 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -58,11 +58,13 @@ enum port_dev_state {
58 * @read_urb: pointer to the bulk in struct urb for this port. 58 * @read_urb: pointer to the bulk in struct urb for this port.
59 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this 59 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this
60 * port. 60 * port.
61 * @bulk_in_buffers: pointers to the bulk in buffers for this port
62 * @read_urbs: pointers to the bulk in urbs for this port
63 * @read_urbs_free: status bitmap the for bulk in urbs
61 * @bulk_out_buffer: pointer to the bulk out buffer for this port. 64 * @bulk_out_buffer: pointer to the bulk out buffer for this port.
62 * @bulk_out_size: the size of the bulk_out_buffer, in bytes. 65 * @bulk_out_size: the size of the bulk_out_buffer, in bytes.
63 * @write_urb: pointer to the bulk out struct urb for this port. 66 * @write_urb: pointer to the bulk out struct urb for this port.
64 * @write_fifo: kfifo used to buffer outgoing data 67 * @write_fifo: kfifo used to buffer outgoing data
65 * @write_urb_busy: port`s writing status
66 * @bulk_out_buffers: pointers to the bulk out buffers for this port 68 * @bulk_out_buffers: pointers to the bulk out buffers for this port
67 * @write_urbs: pointers to the bulk out urbs for this port 69 * @write_urbs: pointers to the bulk out urbs for this port
68 * @write_urbs_free: status bitmap the for bulk out urbs 70 * @write_urbs_free: status bitmap the for bulk out urbs
@@ -99,11 +101,14 @@ struct usb_serial_port {
99 struct urb *read_urb; 101 struct urb *read_urb;
100 __u8 bulk_in_endpointAddress; 102 __u8 bulk_in_endpointAddress;
101 103
104 unsigned char *bulk_in_buffers[2];
105 struct urb *read_urbs[2];
106 unsigned long read_urbs_free;
107
102 unsigned char *bulk_out_buffer; 108 unsigned char *bulk_out_buffer;
103 int bulk_out_size; 109 int bulk_out_size;
104 struct urb *write_urb; 110 struct urb *write_urb;
105 struct kfifo write_fifo; 111 struct kfifo write_fifo;
106 int write_urb_busy;
107 112
108 unsigned char *bulk_out_buffers[2]; 113 unsigned char *bulk_out_buffers[2];
109 struct urb *write_urbs[2]; 114 struct urb *write_urbs[2];
@@ -340,7 +345,7 @@ extern void usb_serial_generic_disconnect(struct usb_serial *serial);
340extern void usb_serial_generic_release(struct usb_serial *serial); 345extern void usb_serial_generic_release(struct usb_serial *serial);
341extern int usb_serial_generic_register(int debug); 346extern int usb_serial_generic_register(int debug);
342extern void usb_serial_generic_deregister(void); 347extern void usb_serial_generic_deregister(void);
343extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, 348extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port,
344 gfp_t mem_flags); 349 gfp_t mem_flags);
345extern void usb_serial_generic_process_read_urb(struct urb *urb); 350extern void usb_serial_generic_process_read_urb(struct urb *urb);
346extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, 351extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port,
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index e0aa39612eba..3157cc1fada6 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -309,7 +309,7 @@ typedef struct wandev_conf
309#define WANOPT_EVEN 2 309#define WANOPT_EVEN 2
310 310
311/* CHDLC Protocol Options */ 311/* CHDLC Protocol Options */
312/* DF Commmented out for now. 312/* DF Commented out for now.
313 313
314#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT 314#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT
315#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT 315#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
new file mode 100644
index 000000000000..9929b05cff3a
--- /dev/null
+++ b/include/media/davinci/vpif_types.h
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2011 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPIF_TYPES_H
18#define _VPIF_TYPES_H
19
20#define VPIF_CAPTURE_MAX_CHANNELS 2
21
22enum vpif_if_type {
23 VPIF_IF_BT656,
24 VPIF_IF_BT1120,
25 VPIF_IF_RAW_BAYER
26};
27
28struct vpif_interface {
29 enum vpif_if_type if_type;
30 unsigned hd_pol:1;
31 unsigned vd_pol:1;
32 unsigned fid_pol:1;
33};
34
35struct vpif_subdev_info {
36 const char *name;
37 struct i2c_board_info board_info;
38 u32 input;
39 u32 output;
40 unsigned can_route:1;
41 struct vpif_interface vpif_if;
42};
43
44struct vpif_display_config {
45 int (*set_clock)(int, int);
46 struct vpif_subdev_info *subdevinfo;
47 int subdev_count;
48 const char **output;
49 int output_count;
50 const char *card_name;
51};
52
53struct vpif_input {
54 struct v4l2_input input;
55 const char *subdev_name;
56};
57
58struct vpif_capture_chan_config {
59 const struct vpif_input *inputs;
60 int input_count;
61};
62
63struct vpif_capture_config {
64 int (*setup_input_channel_mode)(int);
65 int (*setup_input_path)(int, const char *);
66 struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS];
67 struct vpif_subdev_info *subdev_info;
68 int subdev_count;
69 const char *card_name;
70};
71#endif /* _VPIF_TYPES_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2a7523edd9b5..d49928ba5d09 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1439,7 +1439,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1439 * DOC: Beacon filter support 1439 * DOC: Beacon filter support
1440 * 1440 *
1441 * Some hardware have beacon filter support to reduce host cpu wakeups 1441 * Some hardware have beacon filter support to reduce host cpu wakeups
1442 * which will reduce system power consumption. It usuallly works so that 1442 * which will reduce system power consumption. It usually works so that
1443 * the firmware creates a checksum of the beacon but omits all constantly 1443 * the firmware creates a checksum of the beacon but omits all constantly
1444 * changing elements (TSF, TIM etc). Whenever the checksum changes the 1444 * changing elements (TSF, TIM etc). Whenever the checksum changes the
1445 * beacon is forwarded to the host, otherwise it will be just dropped. That 1445 * beacon is forwarded to the host, otherwise it will be just dropped. That
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 2f65e1686fc8..0147b901e79c 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -129,33 +129,33 @@ struct linux_xfrm_mib {
129 __this_cpu_inc(mib[0]->mibs[field]) 129 __this_cpu_inc(mib[0]->mibs[field])
130 130
131#define SNMP_INC_STATS_USER(mib, field) \ 131#define SNMP_INC_STATS_USER(mib, field) \
132 irqsafe_cpu_inc(mib[0]->mibs[field]) 132 this_cpu_inc(mib[0]->mibs[field])
133 133
134#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \ 134#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \
135 atomic_long_inc(&mib->mibs[field]) 135 atomic_long_inc(&mib->mibs[field])
136 136
137#define SNMP_INC_STATS(mib, field) \ 137#define SNMP_INC_STATS(mib, field) \
138 irqsafe_cpu_inc(mib[0]->mibs[field]) 138 this_cpu_inc(mib[0]->mibs[field])
139 139
140#define SNMP_DEC_STATS(mib, field) \ 140#define SNMP_DEC_STATS(mib, field) \
141 irqsafe_cpu_dec(mib[0]->mibs[field]) 141 this_cpu_dec(mib[0]->mibs[field])
142 142
143#define SNMP_ADD_STATS_BH(mib, field, addend) \ 143#define SNMP_ADD_STATS_BH(mib, field, addend) \
144 __this_cpu_add(mib[0]->mibs[field], addend) 144 __this_cpu_add(mib[0]->mibs[field], addend)
145 145
146#define SNMP_ADD_STATS_USER(mib, field, addend) \ 146#define SNMP_ADD_STATS_USER(mib, field, addend) \
147 irqsafe_cpu_add(mib[0]->mibs[field], addend) 147 this_cpu_add(mib[0]->mibs[field], addend)
148 148
149#define SNMP_ADD_STATS(mib, field, addend) \ 149#define SNMP_ADD_STATS(mib, field, addend) \
150 irqsafe_cpu_add(mib[0]->mibs[field], addend) 150 this_cpu_add(mib[0]->mibs[field], addend)
151/* 151/*
152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" 152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr"
153 * to make @ptr a non-percpu pointer. 153 * to make @ptr a non-percpu pointer.
154 */ 154 */
155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \ 155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \
156 do { \ 156 do { \
157 irqsafe_cpu_inc(mib[0]->mibs[basefield##PKTS]); \ 157 this_cpu_inc(mib[0]->mibs[basefield##PKTS]); \
158 irqsafe_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \ 158 this_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \
159 } while (0) 159 } while (0)
160#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ 160#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \
161 do { \ 161 do { \
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index 639a4491fc0d..99965395c5f3 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -281,7 +281,7 @@ static inline u16 rdma_get_vlan_id(union ib_gid *dgid)
281static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device *dev) 281static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device *dev)
282{ 282{
283 return dev->priv_flags & IFF_802_1Q_VLAN ? 283 return dev->priv_flags & IFF_802_1Q_VLAN ?
284 vlan_dev_real_dev(dev) : 0; 284 vlan_dev_real_dev(dev) : NULL;
285} 285}
286 286
287#endif /* IB_ADDR_H */ 287#endif /* IB_ADDR_H */
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index c8f94e8db69c..83f77ac33957 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -38,6 +38,9 @@
38#include <rdma/ib_mad.h> 38#include <rdma/ib_mad.h>
39#include <rdma/ib_sa.h> 39#include <rdma/ib_sa.h>
40 40
41/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */
42extern struct class cm_class;
43
41enum ib_cm_state { 44enum ib_cm_state {
42 IB_CM_IDLE, 45 IB_CM_IDLE,
43 IB_CM_LISTEN, 46 IB_CM_LISTEN,
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 5994bcc1b017..87f34c3d447d 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -142,7 +142,7 @@ struct iscsi_transport {
142 int (*get_iface_param) (struct iscsi_iface *iface, 142 int (*get_iface_param) (struct iscsi_iface *iface,
143 enum iscsi_param_type param_type, 143 enum iscsi_param_type param_type,
144 int param, char *buf); 144 int param, char *buf);
145 mode_t (*attr_is_visible)(int param_type, int param); 145 umode_t (*attr_is_visible)(int param_type, int param);
146 int (*bsg_request)(struct bsg_job *job); 146 int (*bsg_request)(struct bsg_job *job);
147}; 147};
148 148
diff --git a/include/sound/info.h b/include/sound/info.h
index 5492cc40dc57..9ca1a493d370 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -72,7 +72,7 @@ struct snd_info_entry_ops {
72 72
73struct snd_info_entry { 73struct snd_info_entry {
74 const char *name; 74 const char *name;
75 mode_t mode; 75 umode_t mode;
76 long size; 76 long size;
77 unsigned short content; 77 unsigned short content;
78 union { 78 union {
diff --git a/include/sound/saif.h b/include/sound/saif.h
index d0e0de7984ec..f22f3e16edf4 100644
--- a/include/sound/saif.h
+++ b/include/sound/saif.h
@@ -10,7 +10,7 @@
10#define __SOUND_SAIF_H__ 10#define __SOUND_SAIF_H__
11 11
12struct mxs_saif_platform_data { 12struct mxs_saif_platform_data {
13 int (*init) (void); 13 bool master_mode; /* if true use master mode */
14 int (*get_master_id) (unsigned int saif_id); 14 int master_id; /* id of the master if in slave mode */
15}; 15};
16#endif 16#endif
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
index 1e3193b8fcc8..12fbf43524e9 100644
--- a/include/trace/events/regmap.h
+++ b/include/trace/events/regmap.h
@@ -55,6 +55,15 @@ DEFINE_EVENT(regmap_reg, regmap_reg_read,
55 55
56); 56);
57 57
58DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
59
60 TP_PROTO(struct device *dev, unsigned int reg,
61 unsigned int val),
62
63 TP_ARGS(dev, reg, val)
64
65);
66
58DECLARE_EVENT_CLASS(regmap_block, 67DECLARE_EVENT_CLASS(regmap_block,
59 68
60 TP_PROTO(struct device *dev, unsigned int reg, int count), 69 TP_PROTO(struct device *dev, unsigned int reg, int count),
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index d29c153705bc..cc2e1a7e44ec 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -29,11 +29,11 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages,
29 bool highmem); 29 bool highmem);
30void free_xenballooned_pages(int nr_pages, struct page **pages); 30void free_xenballooned_pages(int nr_pages, struct page **pages);
31 31
32struct sys_device; 32struct device;
33#ifdef CONFIG_XEN_SELFBALLOONING 33#ifdef CONFIG_XEN_SELFBALLOONING
34extern int register_xen_selfballooning(struct sys_device *sysdev); 34extern int register_xen_selfballooning(struct device *dev);
35#else 35#else
36static inline int register_xen_selfballooning(struct sys_device *sysdev) 36static inline int register_xen_selfballooning(struct device *dev)
37{ 37{
38 return -ENOSYS; 38 return -ENOSYS;
39} 39}