aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/tlb.h7
-rw-r--r--include/drm/drm_pciids.h13
-rw-r--r--include/linux/acpi.h9
-rw-r--r--include/linux/amba/serial.h3
-rw-r--r--include/linux/ata.h2
-rw-r--r--include/linux/blktrace_api.h1
-rw-r--r--include/linux/capability.h2
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/debug_locks.h4
-rw-r--r--include/linux/devfreq.h16
-rw-r--r--include/linux/device.h19
-rw-r--r--include/linux/edac.h7
-rw-r--r--include/linux/efi.h9
-rw-r--r--include/linux/freezer.h3
-rw-r--r--include/linux/fs_struct.h2
-rw-r--r--include/linux/ftrace.h11
-rw-r--r--include/linux/ftrace_event.h111
-rw-r--r--include/linux/hash.h3
-rw-r--r--include/linux/hyperv.h69
-rw-r--r--include/linux/iio/adc/ad_sigma_delta.h6
-rw-r--r--include/linux/iio/common/st_sensors.h5
-rw-r--r--include/linux/iio/iio.h79
-rw-r--r--include/linux/iio/imu/adis.h34
-rw-r--r--include/linux/iio/trigger.h26
-rw-r--r--include/linux/ipack.h42
-rw-r--r--include/linux/irq_work.h2
-rw-r--r--include/linux/kernel.h71
-rw-r--r--include/linux/kexec.h2
-rw-r--r--include/linux/kvm_host.h2
-rw-r--r--include/linux/kvm_types.h1
-rw-r--r--include/linux/libata.h1
-rw-r--r--include/linux/mei_cl_bus.h44
-rw-r--r--include/linux/mfd/abx500/ab8500.h11
-rw-r--r--include/linux/mfd/arizona/core.h3
-rw-r--r--include/linux/mfd/arizona/pdata.h21
-rw-r--r--include/linux/mfd/arizona/registers.h4
-rw-r--r--include/linux/mfd/max77693-private.h23
-rw-r--r--include/linux/mfd/palmas.h24
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/mman.h4
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/mod_devicetable.h9
-rw-r--r--include/linux/mount.h2
-rw-r--r--include/linux/msi.h23
-rw-r--r--include/linux/mtd/nand.h7
-rw-r--r--include/linux/mutex.h3
-rw-r--r--include/linux/mxsfb.h7
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h30
-rw-r--r--include/linux/nvme.h28
-rw-r--r--include/linux/pci-acpi.h29
-rw-r--r--include/linux/pci-aspm.h20
-rw-r--r--include/linux/pci-ats.h26
-rw-r--r--include/linux/pci.h118
-rw-r--r--include/linux/pci_hotplug.h12
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/pcieport_if.h4
-rw-r--r--include/linux/pinctrl/pinconf.h6
-rw-r--r--include/linux/pinctrl/pinctrl.h6
-rw-r--r--include/linux/platform_data/dwc3-omap.h4
-rw-r--r--include/linux/platform_data/emif_plat.h1
-rw-r--r--include/linux/platform_data/mv_usb.h2
-rw-r--r--include/linux/platform_data/ntc_thermistor.h10
-rw-r--r--include/linux/platform_data/serial-sccnxp.h4
-rw-r--r--include/linux/platform_data/spi-s3c64xx.h3
-rw-r--r--include/linux/platform_data/video-vt8500lcdfb.h31
-rw-r--r--include/linux/platform_data/video_s3c.h54
-rw-r--r--include/linux/platform_device.h25
-rw-r--r--include/linux/preempt.h22
-rw-r--r--include/linux/printk.h6
-rw-r--r--include/linux/proc_fs.h2
-rw-r--r--include/linux/regmap.h1
-rw-r--r--include/linux/regulator/ab8500.h217
-rw-r--r--include/linux/regulator/consumer.h14
-rw-r--r--include/linux/regulator/driver.h9
-rw-r--r--include/linux/regulator/max8952.h10
-rw-r--r--include/linux/ring_buffer.h6
-rw-r--r--include/linux/sched.h6
-rw-r--r--include/linux/security.h12
-rw-r--r--include/linux/serial_s3c.h260
-rw-r--r--include/linux/signal.h4
-rw-r--r--include/linux/skbuff.h20
-rw-r--r--include/linux/spi/spi-tegra.h40
-rw-r--r--include/linux/spi/spi.h8
-rw-r--r--include/linux/spinlock_up.h29
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h2
-rw-r--r--include/linux/ssbi.h38
-rw-r--r--include/linux/swiotlb.h1
-rw-r--r--include/linux/thermal.h2
-rw-r--r--include/linux/trace_clock.h1
-rw-r--r--include/linux/tty.h41
-rw-r--r--include/linux/tty_ldisc.h132
-rw-r--r--include/linux/ucs2_string.h14
-rw-r--r--include/linux/udp.h1
-rw-r--r--include/linux/usb.h13
-rw-r--r--include/linux/usb/cdc-wdm.h2
-rw-r--r--include/linux/usb/cdc_ncm.h1
-rw-r--r--include/linux/usb/ch9.h9
-rw-r--r--include/linux/usb/composite.h3
-rw-r--r--include/linux/usb/dwc3-omap.h6
-rw-r--r--include/linux/usb/gadget.h11
-rw-r--r--include/linux/usb/gadget_configfs.h110
-rw-r--r--include/linux/usb/hcd.h8
-rw-r--r--include/linux/usb/musb-ux500.h31
-rw-r--r--include/linux/usb/nop-usb-xceiv.h5
-rw-r--r--include/linux/usb/otg.h9
-rw-r--r--include/linux/usb/phy.h33
-rw-r--r--include/linux/usb/renesas_usbhs.h6
-rw-r--r--include/linux/usb/serial.h10
-rw-r--r--include/linux/usb/tegra_usb_phy.h10
-rw-r--r--include/linux/usb/ulpi.h8
-rw-r--r--include/linux/user_namespace.h4
-rw-r--r--include/net/addrconf.h1
-rw-r--r--include/net/dst.h6
-rw-r--r--include/net/flow_keys.h1
-rw-r--r--include/net/inet_frag.h9
-rw-r--r--include/net/ip_fib.h12
-rw-r--r--include/net/ip_vs.h12
-rw-r--r--include/net/ipip.h16
-rw-r--r--include/net/irda/irlmp.h3
-rw-r--r--include/net/iucv/af_iucv.h8
-rw-r--r--include/net/scm.h4
-rw-r--r--include/pcmcia/ds.h12
-rw-r--r--include/scsi/libfc.h3
-rw-r--r--[-rwxr-xr-x]include/sound/max98090.h0
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/trace/events/block.h8
-rw-r--r--include/trace/events/regmap.h48
-rw-r--r--include/trace/events/sched.h2
-rw-r--r--include/trace/ftrace.h49
-rw-r--r--include/uapi/linux/connector.h5
-rw-r--r--include/uapi/linux/fuse.h436
-rw-r--r--include/uapi/linux/packet_diag.h4
-rw-r--r--include/uapi/linux/pci_regs.h30
-rw-r--r--include/uapi/linux/unix_diag.h4
-rw-r--r--include/uapi/linux/usb/cdc-wdm.h21
-rw-r--r--include/uapi/linux/usb/ch9.h4
-rw-r--r--include/video/atmel_lcdc.h2
-rw-r--r--include/video/auo_k190xfb.h3
-rw-r--r--include/video/display_timing.h57
-rw-r--r--include/video/videomode.h18
-rw-r--r--include/xen/events.h3
-rw-r--r--include/xen/interface/io/blkif.h10
-rw-r--r--include/xen/interface/physdev.h6
144 files changed, 2240 insertions, 909 deletions
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 25f01d0bc149..b1b1fa6ffffe 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -99,7 +99,12 @@ struct mmu_gather {
99 unsigned int need_flush : 1, /* Did free PTEs */ 99 unsigned int need_flush : 1, /* Did free PTEs */
100 fast_mode : 1; /* No batching */ 100 fast_mode : 1; /* No batching */
101 101
102 unsigned int fullmm; 102 /* we are in the middle of an operation to clear
103 * a full mm and can make some optimizations */
104 unsigned int fullmm : 1,
105 /* we have performed an operation which
106 * requires a complete flush of the tlb */
107 need_flush_all : 1;
103 108
104 struct mmu_gather_batch *active; 109 struct mmu_gather_batch *active;
105 struct mmu_gather_batch local; 110 struct mmu_gather_batch local;
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index a386b0b654cc..918e8fe2f5e9 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -581,7 +581,11 @@
581 {0x1002, 0x9908, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 581 {0x1002, 0x9908, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
582 {0x1002, 0x9909, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 582 {0x1002, 0x9909, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
583 {0x1002, 0x990A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 583 {0x1002, 0x990A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
584 {0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 584 {0x1002, 0x990B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
585 {0x1002, 0x990C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
586 {0x1002, 0x990D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
587 {0x1002, 0x990E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
588 {0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
585 {0x1002, 0x9910, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 589 {0x1002, 0x9910, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
586 {0x1002, 0x9913, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 590 {0x1002, 0x9913, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
587 {0x1002, 0x9917, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 591 {0x1002, 0x9917, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
@@ -592,6 +596,13 @@
592 {0x1002, 0x9992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 596 {0x1002, 0x9992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
593 {0x1002, 0x9993, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 597 {0x1002, 0x9993, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
594 {0x1002, 0x9994, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 598 {0x1002, 0x9994, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
599 {0x1002, 0x9995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
600 {0x1002, 0x9996, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
601 {0x1002, 0x9997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
602 {0x1002, 0x9998, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
603 {0x1002, 0x9999, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
604 {0x1002, 0x999A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
605 {0x1002, 0x999B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
595 {0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 606 {0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
596 {0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 607 {0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
597 {0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 608 {0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index bcbdd7484e58..03053aca5b32 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -152,15 +152,6 @@ void acpi_penalize_isa_irq(int irq, int active);
152 152
153void acpi_pci_irq_disable (struct pci_dev *dev); 153void acpi_pci_irq_disable (struct pci_dev *dev);
154 154
155struct acpi_pci_driver {
156 struct list_head node;
157 int (*add)(struct acpi_pci_root *root);
158 void (*remove)(struct acpi_pci_root *root);
159};
160
161int acpi_pci_register_driver(struct acpi_pci_driver *driver);
162void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
163
164extern int ec_read(u8 addr, u8 *val); 155extern int ec_read(u8 addr, u8 *val);
165extern int ec_write(u8 addr, u8 val); 156extern int ec_write(u8 addr, u8 val);
166extern int ec_transaction(u8 command, 157extern int ec_transaction(u8 command,
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index f612c783170f..62d9303c2837 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -203,6 +203,9 @@ struct amba_pl011_data {
203 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 203 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
204 void *dma_rx_param; 204 void *dma_rx_param;
205 void *dma_tx_param; 205 void *dma_tx_param;
206 bool dma_rx_poll_enable;
207 unsigned int dma_rx_poll_rate;
208 unsigned int dma_rx_poll_timeout;
206 void (*init) (void); 209 void (*init) (void);
207 void (*exit) (void); 210 void (*exit) (void);
208}; 211};
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 8f7a3d68371a..ee0bd9524055 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -954,7 +954,7 @@ static inline int atapi_cdb_len(const u16 *dev_id)
954 } 954 }
955} 955}
956 956
957static inline bool atapi_command_packet_set(const u16 *dev_id) 957static inline int atapi_command_packet_set(const u16 *dev_id)
958{ 958{
959 return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; 959 return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f;
960} 960}
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 0ea61e07a91c..7c2e030e72f1 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -12,7 +12,6 @@
12 12
13struct blk_trace { 13struct blk_trace {
14 int trace_state; 14 int trace_state;
15 bool rq_based;
16 struct rchan *rchan; 15 struct rchan *rchan;
17 unsigned long __percpu *sequence; 16 unsigned long __percpu *sequence;
18 unsigned char __percpu *msg_data; 17 unsigned char __percpu *msg_data;
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 98503b792369..d9a4f7f40f32 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -35,6 +35,7 @@ struct cpu_vfs_cap_data {
35#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) 35#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t))
36 36
37 37
38struct file;
38struct inode; 39struct inode;
39struct dentry; 40struct dentry;
40struct user_namespace; 41struct user_namespace;
@@ -211,6 +212,7 @@ extern bool capable(int cap);
211extern bool ns_capable(struct user_namespace *ns, int cap); 212extern bool ns_capable(struct user_namespace *ns, int cap);
212extern bool nsown_capable(int cap); 213extern bool nsown_capable(int cap);
213extern bool inode_capable(const struct inode *inode, int cap); 214extern bool inode_capable(const struct inode *inode, int cap);
215extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
214 216
215/* audit system wants to get cap info from files as well */ 217/* audit system wants to get cap info from files as well */
216extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); 218extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 76a87fb57ac2..377cd8c3395e 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -141,11 +141,11 @@ typedef struct {
141} compat_sigset_t; 141} compat_sigset_t;
142 142
143struct compat_sigaction { 143struct compat_sigaction {
144#ifndef __ARCH_HAS_ODD_SIGACTION 144#ifndef __ARCH_HAS_IRIX_SIGACTION
145 compat_uptr_t sa_handler; 145 compat_uptr_t sa_handler;
146 compat_ulong_t sa_flags; 146 compat_ulong_t sa_flags;
147#else 147#else
148 compat_ulong_t sa_flags; 148 compat_uint_t sa_flags;
149 compat_uptr_t sa_handler; 149 compat_uptr_t sa_handler;
150#endif 150#endif
151#ifdef __ARCH_HAS_SA_RESTORER 151#ifdef __ARCH_HAS_SA_RESTORER
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index a975de1ff59f..3bd46f766751 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -51,7 +51,7 @@ struct task_struct;
51extern void debug_show_all_locks(void); 51extern void debug_show_all_locks(void);
52extern void debug_show_held_locks(struct task_struct *task); 52extern void debug_show_held_locks(struct task_struct *task);
53extern void debug_check_no_locks_freed(const void *from, unsigned long len); 53extern void debug_check_no_locks_freed(const void *from, unsigned long len);
54extern void debug_check_no_locks_held(void); 54extern void debug_check_no_locks_held(struct task_struct *task);
55#else 55#else
56static inline void debug_show_all_locks(void) 56static inline void debug_show_all_locks(void)
57{ 57{
@@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len)
67} 67}
68 68
69static inline void 69static inline void
70debug_check_no_locks_held(void) 70debug_check_no_locks_held(struct task_struct *task)
71{ 71{
72} 72}
73#endif 73#endif
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index e83ef39b3bea..fe8c4476f7e4 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -213,7 +213,7 @@ struct devfreq_simple_ondemand_data {
213#endif 213#endif
214 214
215#else /* !CONFIG_PM_DEVFREQ */ 215#else /* !CONFIG_PM_DEVFREQ */
216static struct devfreq *devfreq_add_device(struct device *dev, 216static inline struct devfreq *devfreq_add_device(struct device *dev,
217 struct devfreq_dev_profile *profile, 217 struct devfreq_dev_profile *profile,
218 const char *governor_name, 218 const char *governor_name,
219 void *data) 219 void *data)
@@ -221,34 +221,34 @@ static struct devfreq *devfreq_add_device(struct device *dev,
221 return NULL; 221 return NULL;
222} 222}
223 223
224static int devfreq_remove_device(struct devfreq *devfreq) 224static inline int devfreq_remove_device(struct devfreq *devfreq)
225{ 225{
226 return 0; 226 return 0;
227} 227}
228 228
229static int devfreq_suspend_device(struct devfreq *devfreq) 229static inline int devfreq_suspend_device(struct devfreq *devfreq)
230{ 230{
231 return 0; 231 return 0;
232} 232}
233 233
234static int devfreq_resume_device(struct devfreq *devfreq) 234static inline int devfreq_resume_device(struct devfreq *devfreq)
235{ 235{
236 return 0; 236 return 0;
237} 237}
238 238
239static struct opp *devfreq_recommended_opp(struct device *dev, 239static inline struct opp *devfreq_recommended_opp(struct device *dev,
240 unsigned long *freq, u32 flags) 240 unsigned long *freq, u32 flags)
241{ 241{
242 return -EINVAL; 242 return ERR_PTR(-EINVAL);
243} 243}
244 244
245static int devfreq_register_opp_notifier(struct device *dev, 245static inline int devfreq_register_opp_notifier(struct device *dev,
246 struct devfreq *devfreq) 246 struct devfreq *devfreq)
247{ 247{
248 return -EINVAL; 248 return -EINVAL;
249} 249}
250 250
251static int devfreq_unregister_opp_notifier(struct device *dev, 251static inline int devfreq_unregister_opp_notifier(struct device *dev,
252 struct devfreq *devfreq) 252 struct devfreq *devfreq)
253{ 253{
254 return -EINVAL; 254 return -EINVAL;
diff --git a/include/linux/device.h b/include/linux/device.h
index 9d6464ea99c6..88615ccaf23a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -25,6 +25,7 @@
25#include <linux/pm.h> 25#include <linux/pm.h>
26#include <linux/atomic.h> 26#include <linux/atomic.h>
27#include <linux/ratelimit.h> 27#include <linux/ratelimit.h>
28#include <linux/uidgid.h>
28#include <asm/device.h> 29#include <asm/device.h>
29 30
30struct device; 31struct device;
@@ -111,17 +112,11 @@ struct bus_type {
111 struct iommu_ops *iommu_ops; 112 struct iommu_ops *iommu_ops;
112 113
113 struct subsys_private *p; 114 struct subsys_private *p;
115 struct lock_class_key lock_key;
114}; 116};
115 117
116/* This is a #define to keep the compiler from merging different 118extern int __must_check bus_register(struct bus_type *bus);
117 * instances of the __key variable */ 119
118#define bus_register(subsys) \
119({ \
120 static struct lock_class_key __key; \
121 __bus_register(subsys, &__key); \
122})
123extern int __must_check __bus_register(struct bus_type *bus,
124 struct lock_class_key *key);
125extern void bus_unregister(struct bus_type *bus); 120extern void bus_unregister(struct bus_type *bus);
126 121
127extern int __must_check bus_rescan_devices(struct bus_type *bus); 122extern int __must_check bus_rescan_devices(struct bus_type *bus);
@@ -471,7 +466,8 @@ struct device_type {
471 const char *name; 466 const char *name;
472 const struct attribute_group **groups; 467 const struct attribute_group **groups;
473 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 468 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
474 char *(*devnode)(struct device *dev, umode_t *mode); 469 char *(*devnode)(struct device *dev, umode_t *mode,
470 kuid_t *uid, kgid_t *gid);
475 void (*release)(struct device *dev); 471 void (*release)(struct device *dev);
476 472
477 const struct dev_pm_ops *pm; 473 const struct dev_pm_ops *pm;
@@ -849,7 +845,8 @@ extern int device_rename(struct device *dev, const char *new_name);
849extern int device_move(struct device *dev, struct device *new_parent, 845extern int device_move(struct device *dev, struct device *new_parent,
850 enum dpm_order dpm_order); 846 enum dpm_order dpm_order);
851extern const char *device_get_devnode(struct device *dev, 847extern const char *device_get_devnode(struct device *dev,
852 umode_t *mode, const char **tmp); 848 umode_t *mode, kuid_t *uid, kgid_t *gid,
849 const char **tmp);
853extern void *dev_get_drvdata(const struct device *dev); 850extern void *dev_get_drvdata(const struct device *dev);
854extern int dev_set_drvdata(struct device *dev, void *data); 851extern int dev_set_drvdata(struct device *dev, void *data);
855 852
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 4fd4999ccb5b..0b763276f619 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -561,7 +561,6 @@ struct csrow_info {
561 561
562 u32 ue_count; /* Uncorrectable Errors for this csrow */ 562 u32 ue_count; /* Uncorrectable Errors for this csrow */
563 u32 ce_count; /* Correctable Errors for this csrow */ 563 u32 ce_count; /* Correctable Errors for this csrow */
564 u32 nr_pages; /* combined pages count of all channels */
565 564
566 struct mem_ctl_info *mci; /* the parent */ 565 struct mem_ctl_info *mci; /* the parent */
567 566
@@ -676,11 +675,11 @@ struct mem_ctl_info {
676 * sees memory sticks ("dimms"), and the ones that sees memory ranks. 675 * sees memory sticks ("dimms"), and the ones that sees memory ranks.
677 * All old memory controllers enumerate memories per rank, but most 676 * All old memory controllers enumerate memories per rank, but most
678 * of the recent drivers enumerate memories per DIMM, instead. 677 * of the recent drivers enumerate memories per DIMM, instead.
679 * When the memory controller is per rank, mem_is_per_rank is true. 678 * When the memory controller is per rank, csbased is true.
680 */ 679 */
681 unsigned n_layers; 680 unsigned n_layers;
682 struct edac_mc_layer *layers; 681 struct edac_mc_layer *layers;
683 bool mem_is_per_rank; 682 bool csbased;
684 683
685 /* 684 /*
686 * DIMM info. Will eventually remove the entire csrows_info some day 685 * DIMM info. Will eventually remove the entire csrows_info some day
@@ -741,8 +740,6 @@ struct mem_ctl_info {
741 u32 fake_inject_ue; 740 u32 fake_inject_ue;
742 u16 fake_inject_count; 741 u16 fake_inject_count;
743#endif 742#endif
744 __u8 csbased : 1, /* csrow-based memory controller */
745 __resv : 7;
746}; 743};
747 744
748#endif 745#endif
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 9bf2f1fcae27..3d7df3d32c66 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -333,6 +333,7 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
333 unsigned long count, 333 unsigned long count,
334 u64 *max_size, 334 u64 *max_size,
335 int *reset_type); 335 int *reset_type);
336typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size);
336 337
337/* 338/*
338 * EFI Configuration Table and GUID definitions 339 * EFI Configuration Table and GUID definitions
@@ -575,9 +576,15 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos
575#ifdef CONFIG_X86 576#ifdef CONFIG_X86
576extern void efi_late_init(void); 577extern void efi_late_init(void);
577extern void efi_free_boot_services(void); 578extern void efi_free_boot_services(void);
579extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size);
578#else 580#else
579static inline void efi_late_init(void) {} 581static inline void efi_late_init(void) {}
580static inline void efi_free_boot_services(void) {} 582static inline void efi_free_boot_services(void) {}
583
584static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
585{
586 return EFI_SUCCESS;
587}
581#endif 588#endif
582extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); 589extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr);
583extern u64 efi_get_iobase (void); 590extern u64 efi_get_iobase (void);
@@ -731,7 +738,7 @@ struct efivar_operations {
731 efi_get_variable_t *get_variable; 738 efi_get_variable_t *get_variable;
732 efi_get_next_variable_t *get_next_variable; 739 efi_get_next_variable_t *get_next_variable;
733 efi_set_variable_t *set_variable; 740 efi_set_variable_t *set_variable;
734 efi_query_variable_info_t *query_variable_info; 741 efi_query_variable_store_t *query_variable_store;
735}; 742};
736 743
737struct efivars { 744struct efivars {
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 043a5cf8b5ba..e70df40d84f6 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -3,7 +3,6 @@
3#ifndef FREEZER_H_INCLUDED 3#ifndef FREEZER_H_INCLUDED
4#define FREEZER_H_INCLUDED 4#define FREEZER_H_INCLUDED
5 5
6#include <linux/debug_locks.h>
7#include <linux/sched.h> 6#include <linux/sched.h>
8#include <linux/wait.h> 7#include <linux/wait.h>
9#include <linux/atomic.h> 8#include <linux/atomic.h>
@@ -49,8 +48,6 @@ extern void thaw_kernel_threads(void);
49 48
50static inline bool try_to_freeze(void) 49static inline bool try_to_freeze(void)
51{ 50{
52 if (!(current->flags & PF_NOFREEZE))
53 debug_check_no_locks_held();
54 might_sleep(); 51 might_sleep();
55 if (likely(!freezing(current))) 52 if (likely(!freezing(current)))
56 return false; 53 return false;
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 729eded4b24f..2b93a9a5a1e6 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -50,4 +50,6 @@ static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
50 spin_unlock(&fs->lock); 50 spin_unlock(&fs->lock);
51} 51}
52 52
53extern bool current_chrooted(void);
54
53#endif /* _LINUX_FS_STRUCT_H */ 55#endif /* _LINUX_FS_STRUCT_H */
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index e5ca8ef50e9b..f83e17a40e8b 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -89,6 +89,7 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
89 * that the call back has its own recursion protection. If it does 89 * that the call back has its own recursion protection. If it does
90 * not set this, then the ftrace infrastructure will add recursion 90 * not set this, then the ftrace infrastructure will add recursion
91 * protection for the caller. 91 * protection for the caller.
92 * STUB - The ftrace_ops is just a place holder.
92 */ 93 */
93enum { 94enum {
94 FTRACE_OPS_FL_ENABLED = 1 << 0, 95 FTRACE_OPS_FL_ENABLED = 1 << 0,
@@ -98,6 +99,7 @@ enum {
98 FTRACE_OPS_FL_SAVE_REGS = 1 << 4, 99 FTRACE_OPS_FL_SAVE_REGS = 1 << 4,
99 FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5, 100 FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5,
100 FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6, 101 FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6,
102 FTRACE_OPS_FL_STUB = 1 << 7,
101}; 103};
102 104
103struct ftrace_ops { 105struct ftrace_ops {
@@ -259,8 +261,10 @@ struct ftrace_probe_ops {
259 void (*func)(unsigned long ip, 261 void (*func)(unsigned long ip,
260 unsigned long parent_ip, 262 unsigned long parent_ip,
261 void **data); 263 void **data);
262 int (*callback)(unsigned long ip, void **data); 264 int (*init)(struct ftrace_probe_ops *ops,
263 void (*free)(void **data); 265 unsigned long ip, void **data);
266 void (*free)(struct ftrace_probe_ops *ops,
267 unsigned long ip, void **data);
264 int (*print)(struct seq_file *m, 268 int (*print)(struct seq_file *m,
265 unsigned long ip, 269 unsigned long ip,
266 struct ftrace_probe_ops *ops, 270 struct ftrace_probe_ops *ops,
@@ -394,7 +398,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
394 size_t cnt, loff_t *ppos); 398 size_t cnt, loff_t *ppos);
395ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, 399ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
396 size_t cnt, loff_t *ppos); 400 size_t cnt, loff_t *ppos);
397loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence);
398int ftrace_regex_release(struct inode *inode, struct file *file); 401int ftrace_regex_release(struct inode *inode, struct file *file);
399 402
400void __init 403void __init
@@ -567,6 +570,8 @@ static inline int
567ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } 570ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
568#endif /* CONFIG_DYNAMIC_FTRACE */ 571#endif /* CONFIG_DYNAMIC_FTRACE */
569 572
573loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence);
574
570/* totally disable ftrace - can not re-enable after this */ 575/* totally disable ftrace - can not re-enable after this */
571void ftrace_kill(void); 576void ftrace_kill(void);
572 577
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 13a54d0bdfa8..34e00fb49bec 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -8,6 +8,7 @@
8#include <linux/perf_event.h> 8#include <linux/perf_event.h>
9 9
10struct trace_array; 10struct trace_array;
11struct trace_buffer;
11struct tracer; 12struct tracer;
12struct dentry; 13struct dentry;
13 14
@@ -38,6 +39,12 @@ const char *ftrace_print_symbols_seq_u64(struct trace_seq *p,
38const char *ftrace_print_hex_seq(struct trace_seq *p, 39const char *ftrace_print_hex_seq(struct trace_seq *p,
39 const unsigned char *buf, int len); 40 const unsigned char *buf, int len);
40 41
42struct trace_iterator;
43struct trace_event;
44
45int ftrace_raw_output_prep(struct trace_iterator *iter,
46 struct trace_event *event);
47
41/* 48/*
42 * The trace entry - the most basic unit of tracing. This is what 49 * The trace entry - the most basic unit of tracing. This is what
43 * is printed in the end as a single line in the trace output, such as: 50 * is printed in the end as a single line in the trace output, such as:
@@ -61,6 +68,7 @@ struct trace_entry {
61struct trace_iterator { 68struct trace_iterator {
62 struct trace_array *tr; 69 struct trace_array *tr;
63 struct tracer *trace; 70 struct tracer *trace;
71 struct trace_buffer *trace_buffer;
64 void *private; 72 void *private;
65 int cpu_file; 73 int cpu_file;
66 struct mutex mutex; 74 struct mutex mutex;
@@ -95,8 +103,6 @@ enum trace_iter_flags {
95}; 103};
96 104
97 105
98struct trace_event;
99
100typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, 106typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
101 int flags, struct trace_event *event); 107 int flags, struct trace_event *event);
102 108
@@ -128,6 +134,13 @@ enum print_line_t {
128void tracing_generic_entry_update(struct trace_entry *entry, 134void tracing_generic_entry_update(struct trace_entry *entry,
129 unsigned long flags, 135 unsigned long flags,
130 int pc); 136 int pc);
137struct ftrace_event_file;
138
139struct ring_buffer_event *
140trace_event_buffer_lock_reserve(struct ring_buffer **current_buffer,
141 struct ftrace_event_file *ftrace_file,
142 int type, unsigned long len,
143 unsigned long flags, int pc);
131struct ring_buffer_event * 144struct ring_buffer_event *
132trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, 145trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,
133 int type, unsigned long len, 146 int type, unsigned long len,
@@ -182,53 +195,49 @@ extern int ftrace_event_reg(struct ftrace_event_call *event,
182 enum trace_reg type, void *data); 195 enum trace_reg type, void *data);
183 196
184enum { 197enum {
185 TRACE_EVENT_FL_ENABLED_BIT,
186 TRACE_EVENT_FL_FILTERED_BIT, 198 TRACE_EVENT_FL_FILTERED_BIT,
187 TRACE_EVENT_FL_RECORDED_CMD_BIT,
188 TRACE_EVENT_FL_CAP_ANY_BIT, 199 TRACE_EVENT_FL_CAP_ANY_BIT,
189 TRACE_EVENT_FL_NO_SET_FILTER_BIT, 200 TRACE_EVENT_FL_NO_SET_FILTER_BIT,
190 TRACE_EVENT_FL_IGNORE_ENABLE_BIT, 201 TRACE_EVENT_FL_IGNORE_ENABLE_BIT,
202 TRACE_EVENT_FL_WAS_ENABLED_BIT,
191}; 203};
192 204
205/*
206 * Event flags:
207 * FILTERED - The event has a filter attached
208 * CAP_ANY - Any user can enable for perf
209 * NO_SET_FILTER - Set when filter has error and is to be ignored
210 * IGNORE_ENABLE - For ftrace internal events, do not enable with debugfs file
211 * WAS_ENABLED - Set and stays set when an event was ever enabled
212 * (used for module unloading, if a module event is enabled,
213 * it is best to clear the buffers that used it).
214 */
193enum { 215enum {
194 TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT),
195 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), 216 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
196 TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT),
197 TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), 217 TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT),
198 TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), 218 TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT),
199 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), 219 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT),
220 TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT),
200}; 221};
201 222
202struct ftrace_event_call { 223struct ftrace_event_call {
203 struct list_head list; 224 struct list_head list;
204 struct ftrace_event_class *class; 225 struct ftrace_event_class *class;
205 char *name; 226 char *name;
206 struct dentry *dir;
207 struct trace_event event; 227 struct trace_event event;
208 const char *print_fmt; 228 const char *print_fmt;
209 struct event_filter *filter; 229 struct event_filter *filter;
230 struct list_head *files;
210 void *mod; 231 void *mod;
211 void *data; 232 void *data;
212
213 /* 233 /*
214 * 32 bit flags: 234 * bit 0: filter_active
215 * bit 1: enabled 235 * bit 1: allow trace by non root (cap any)
216 * bit 2: filter_active 236 * bit 2: failed to apply filter
217 * bit 3: enabled cmd record 237 * bit 3: ftrace internal event (do not enable)
218 * bit 4: allow trace by non root (cap any) 238 * bit 4: Event was enabled by module
219 * bit 5: failed to apply filter
220 * bit 6: ftrace internal event (do not enable)
221 *
222 * Changes to flags must hold the event_mutex.
223 *
224 * Note: Reads of flags do not hold the event_mutex since
225 * they occur in critical sections. But the way flags
226 * is currently used, these changes do no affect the code
227 * except that when a change is made, it may have a slight
228 * delay in propagating the changes to other CPUs due to
229 * caching and such.
230 */ 239 */
231 unsigned int flags; 240 int flags; /* static flags of different events */
232 241
233#ifdef CONFIG_PERF_EVENTS 242#ifdef CONFIG_PERF_EVENTS
234 int perf_refcount; 243 int perf_refcount;
@@ -236,6 +245,56 @@ struct ftrace_event_call {
236#endif 245#endif
237}; 246};
238 247
248struct trace_array;
249struct ftrace_subsystem_dir;
250
251enum {
252 FTRACE_EVENT_FL_ENABLED_BIT,
253 FTRACE_EVENT_FL_RECORDED_CMD_BIT,
254 FTRACE_EVENT_FL_SOFT_MODE_BIT,
255 FTRACE_EVENT_FL_SOFT_DISABLED_BIT,
256};
257
258/*
259 * Ftrace event file flags:
260 * ENABLED - The event is enabled
261 * RECORDED_CMD - The comms should be recorded at sched_switch
262 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED
263 * SOFT_DISABLED - When set, do not trace the event (even though its
264 * tracepoint may be enabled)
265 */
266enum {
267 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT),
268 FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT),
269 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT),
270 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT),
271};
272
273struct ftrace_event_file {
274 struct list_head list;
275 struct ftrace_event_call *event_call;
276 struct dentry *dir;
277 struct trace_array *tr;
278 struct ftrace_subsystem_dir *system;
279
280 /*
281 * 32 bit flags:
282 * bit 0: enabled
283 * bit 1: enabled cmd record
284 * bit 2: enable/disable with the soft disable bit
285 * bit 3: soft disabled
286 *
287 * Note: The bits must be set atomically to prevent races
288 * from other writers. Reads of flags do not need to be in
289 * sync as they occur in critical sections. But the way flags
290 * is currently used, these changes do not affect the code
291 * except that when a change is made, it may have a slight
292 * delay in propagating the changes to other CPUs due to
293 * caching and such. Which is mostly OK ;-)
294 */
295 unsigned long flags;
296};
297
239#define __TRACE_EVENT_FLAGS(name, value) \ 298#define __TRACE_EVENT_FLAGS(name, value) \
240 static int __init trace_init_flags_##name(void) \ 299 static int __init trace_init_flags_##name(void) \
241 { \ 300 { \
@@ -274,7 +333,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,
274extern int trace_add_event_call(struct ftrace_event_call *call); 333extern int trace_add_event_call(struct ftrace_event_call *call);
275extern void trace_remove_event_call(struct ftrace_event_call *call); 334extern void trace_remove_event_call(struct ftrace_event_call *call);
276 335
277#define is_signed_type(type) (((type)(-1)) < (type)0) 336#define is_signed_type(type) (((type)(-1)) < (type)1)
278 337
279int trace_set_clr_event(const char *system, const char *event, int set); 338int trace_set_clr_event(const char *system, const char *event, int set);
280 339
diff --git a/include/linux/hash.h b/include/linux/hash.h
index 61c97ae22e01..f09a0ae4d858 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <linux/compiler.h>
18 19
19/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 20/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
20#define GOLDEN_RATIO_PRIME_32 0x9e370001UL 21#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
@@ -31,7 +32,7 @@
31#error Wordsize not 32 or 64 32#error Wordsize not 32 or 64
32#endif 33#endif
33 34
34static inline u64 hash_64(u64 val, unsigned int bits) 35static __always_inline u64 hash_64(u64 val, unsigned int bits)
35{ 36{
36 u64 hash = val; 37 u64 hash = val;
37 38
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index df77ba9a8166..95d0850584da 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -27,6 +27,63 @@
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30
31/*
32 * Implementation of host controlled snapshot of the guest.
33 */
34
35#define VSS_OP_REGISTER 128
36
37enum hv_vss_op {
38 VSS_OP_CREATE = 0,
39 VSS_OP_DELETE,
40 VSS_OP_HOT_BACKUP,
41 VSS_OP_GET_DM_INFO,
42 VSS_OP_BU_COMPLETE,
43 /*
44 * Following operations are only supported with IC version >= 5.0
45 */
46 VSS_OP_FREEZE, /* Freeze the file systems in the VM */
47 VSS_OP_THAW, /* Unfreeze the file systems */
48 VSS_OP_AUTO_RECOVER,
49 VSS_OP_COUNT /* Number of operations, must be last */
50};
51
52
53/*
54 * Header for all VSS messages.
55 */
56struct hv_vss_hdr {
57 __u8 operation;
58 __u8 reserved[7];
59} __attribute__((packed));
60
61
62/*
63 * Flag values for the hv_vss_check_feature. Linux supports only
64 * one value.
65 */
66#define VSS_HBU_NO_AUTO_RECOVERY 0x00000005
67
68struct hv_vss_check_feature {
69 __u32 flags;
70} __attribute__((packed));
71
72struct hv_vss_check_dm_info {
73 __u32 flags;
74} __attribute__((packed));
75
76struct hv_vss_msg {
77 union {
78 struct hv_vss_hdr vss_hdr;
79 int error;
80 };
81 union {
82 struct hv_vss_check_feature vss_cf;
83 struct hv_vss_check_dm_info dm_info;
84 };
85} __attribute__((packed));
86
30/* 87/*
31 * An implementation of HyperV key value pair (KVP) functionality for Linux. 88 * An implementation of HyperV key value pair (KVP) functionality for Linux.
32 * 89 *
@@ -1253,6 +1310,14 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver);
1253 } 1310 }
1254 1311
1255/* 1312/*
1313 * VSS (Backup/Restore) GUID
1314 */
1315#define HV_VSS_GUID \
1316 .guid = { \
1317 0x29, 0x2e, 0xfa, 0x35, 0x23, 0xea, 0x36, 0x42, \
1318 0x96, 0xae, 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40 \
1319 }
1320/*
1256 * Common header for Hyper-V ICs 1321 * Common header for Hyper-V ICs
1257 */ 1322 */
1258 1323
@@ -1356,6 +1421,10 @@ int hv_kvp_init(struct hv_util_service *);
1356void hv_kvp_deinit(void); 1421void hv_kvp_deinit(void);
1357void hv_kvp_onchannelcallback(void *); 1422void hv_kvp_onchannelcallback(void *);
1358 1423
1424int hv_vss_init(struct hv_util_service *);
1425void hv_vss_deinit(void);
1426void hv_vss_onchannelcallback(void *);
1427
1359/* 1428/*
1360 * Negotiated version with the Host. 1429 * Negotiated version with the Host.
1361 */ 1430 */
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h
index 2e4eab9868a3..e7fdec4db9da 100644
--- a/include/linux/iio/adc/ad_sigma_delta.h
+++ b/include/linux/iio/adc/ad_sigma_delta.h
@@ -133,9 +133,9 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
133 .channel2 = (_channel2), \ 133 .channel2 = (_channel2), \
134 .address = (_address), \ 134 .address = (_address), \
135 .extend_name = (_extend_name), \ 135 .extend_name = (_extend_name), \
136 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ 136 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
137 IIO_CHAN_INFO_SCALE_SHARED_BIT | \ 137 BIT(IIO_CHAN_INFO_OFFSET), \
138 IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ 138 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
139 .scan_index = (_si), \ 139 .scan_index = (_si), \
140 .scan_type = { \ 140 .scan_type = { \
141 .sign = 'u', \ 141 .sign = 'u', \
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 8bd12be0b02f..172c5b23cb84 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -15,6 +15,7 @@
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/irqreturn.h> 16#include <linux/irqreturn.h>
17#include <linux/iio/trigger.h> 17#include <linux/iio/trigger.h>
18#include <linux/bitops.h>
18 19
19#define ST_SENSORS_TX_MAX_LENGTH 2 20#define ST_SENSORS_TX_MAX_LENGTH 2
20#define ST_SENSORS_RX_MAX_LENGTH 6 21#define ST_SENSORS_RX_MAX_LENGTH 6
@@ -45,8 +46,8 @@
45{ \ 46{ \
46 .type = device_type, \ 47 .type = device_type, \
47 .modified = 1, \ 48 .modified = 1, \
48 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ 49 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
49 IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ 50 BIT(IIO_CHAN_INFO_SCALE), \
50 .scan_index = index, \ 51 .scan_index = index, \
51 .channel2 = mod, \ 52 .channel2 = mod, \
52 .address = addr, \ 53 .address = addr, \
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index da8c776ba0bd..8d171f427632 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -38,76 +38,6 @@ enum iio_chan_info_enum {
38 IIO_CHAN_INFO_HYSTERESIS, 38 IIO_CHAN_INFO_HYSTERESIS,
39}; 39};
40 40
41#define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2)
42#define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1)
43#define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \
44 IIO_CHAN_INFO_SEPARATE_BIT(type))
45
46#define IIO_CHAN_INFO_RAW_SEPARATE_BIT \
47 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW)
48#define IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT \
49 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PROCESSED)
50#define IIO_CHAN_INFO_SCALE_SEPARATE_BIT \
51 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SCALE)
52#define IIO_CHAN_INFO_SCALE_SHARED_BIT \
53 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SCALE)
54#define IIO_CHAN_INFO_OFFSET_SEPARATE_BIT \
55 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_OFFSET)
56#define IIO_CHAN_INFO_OFFSET_SHARED_BIT \
57 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_OFFSET)
58#define IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT \
59 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_CALIBSCALE)
60#define IIO_CHAN_INFO_CALIBSCALE_SHARED_BIT \
61 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_CALIBSCALE)
62#define IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT \
63 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_CALIBBIAS)
64#define IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT \
65 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_CALIBBIAS)
66#define IIO_CHAN_INFO_PEAK_SEPARATE_BIT \
67 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PEAK)
68#define IIO_CHAN_INFO_PEAK_SHARED_BIT \
69 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PEAK)
70#define IIO_CHAN_INFO_PEAKSCALE_SEPARATE_BIT \
71 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PEAKSCALE)
72#define IIO_CHAN_INFO_PEAKSCALE_SHARED_BIT \
73 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PEAKSCALE)
74#define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT \
75 IIO_CHAN_INFO_SEPARATE_BIT( \
76 IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW)
77#define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SHARED_BIT \
78 IIO_CHAN_INFO_SHARED_BIT( \
79 IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW)
80#define IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT \
81 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_AVERAGE_RAW)
82#define IIO_CHAN_INFO_AVERAGE_RAW_SHARED_BIT \
83 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_AVERAGE_RAW)
84#define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT \
85 IIO_CHAN_INFO_SHARED_BIT( \
86 IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY)
87#define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT \
88 IIO_CHAN_INFO_SEPARATE_BIT( \
89 IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY)
90#define IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT \
91 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SAMP_FREQ)
92#define IIO_CHAN_INFO_SAMP_FREQ_SHARED_BIT \
93 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SAMP_FREQ)
94#define IIO_CHAN_INFO_FREQUENCY_SEPARATE_BIT \
95 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_FREQUENCY)
96#define IIO_CHAN_INFO_FREQUENCY_SHARED_BIT \
97 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_FREQUENCY)
98#define IIO_CHAN_INFO_PHASE_SEPARATE_BIT \
99 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PHASE)
100#define IIO_CHAN_INFO_PHASE_SHARED_BIT \
101 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PHASE)
102#define IIO_CHAN_INFO_HARDWAREGAIN_SEPARATE_BIT \
103 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN)
104#define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \
105 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN)
106#define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT \
107 IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS)
108#define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT \
109 IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS)
110
111enum iio_endian { 41enum iio_endian {
112 IIO_CPU, 42 IIO_CPU,
113 IIO_BE, 43 IIO_BE,
@@ -218,6 +148,10 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,
218 * endianness: little or big endian 148 * endianness: little or big endian
219 * @info_mask: What information is to be exported about this channel. 149 * @info_mask: What information is to be exported about this channel.
220 * This includes calibbias, scale etc. 150 * This includes calibbias, scale etc.
151 * @info_mask_separate: What information is to be exported that is specific to
152 * this channel.
153 * @info_mask_shared_by_type: What information is to be exported that is shared
154* by all channels of the same type.
221 * @event_mask: What events can this channel produce. 155 * @event_mask: What events can this channel produce.
222 * @ext_info: Array of extended info attributes for this channel. 156 * @ext_info: Array of extended info attributes for this channel.
223 * The array is NULL terminated, the last element should 157 * The array is NULL terminated, the last element should
@@ -253,6 +187,8 @@ struct iio_chan_spec {
253 enum iio_endian endianness; 187 enum iio_endian endianness;
254 } scan_type; 188 } scan_type;
255 long info_mask; 189 long info_mask;
190 long info_mask_separate;
191 long info_mask_shared_by_type;
256 long event_mask; 192 long event_mask;
257 const struct iio_chan_spec_ext_info *ext_info; 193 const struct iio_chan_spec_ext_info *ext_info;
258 const char *extend_name; 194 const char *extend_name;
@@ -275,7 +211,8 @@ struct iio_chan_spec {
275static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, 211static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
276 enum iio_chan_info_enum type) 212 enum iio_chan_info_enum type)
277{ 213{
278 return chan->info_mask & IIO_CHAN_INFO_BITS(type); 214 return (chan->info_mask_separate & type) |
215 (chan->info_mask_shared_by_type & type);
279} 216}
280 217
281#define IIO_ST(si, rb, sb, sh) \ 218#define IIO_ST(si, rb, sb, sh) \
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h
index ff781dca2e9a..b665dc7f017b 100644
--- a/include/linux/iio/imu/adis.h
+++ b/include/linux/iio/imu/adis.h
@@ -162,8 +162,8 @@ int adis_single_conversion(struct iio_dev *indio_dev,
162 .indexed = 1, \ 162 .indexed = 1, \
163 .channel = (chan), \ 163 .channel = (chan), \
164 .extend_name = name, \ 164 .extend_name = name, \
165 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ 165 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
166 IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ 166 BIT(IIO_CHAN_INFO_SCALE), \
167 .address = (addr), \ 167 .address = (addr), \
168 .scan_index = (si), \ 168 .scan_index = (si), \
169 .scan_type = { \ 169 .scan_type = { \
@@ -184,9 +184,9 @@ int adis_single_conversion(struct iio_dev *indio_dev,
184 .type = IIO_TEMP, \ 184 .type = IIO_TEMP, \
185 .indexed = 1, \ 185 .indexed = 1, \
186 .channel = 0, \ 186 .channel = 0, \
187 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ 187 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
188 IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \ 188 BIT(IIO_CHAN_INFO_SCALE) | \
189 IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ 189 BIT(IIO_CHAN_INFO_OFFSET), \
190 .address = (addr), \ 190 .address = (addr), \
191 .scan_index = (si), \ 191 .scan_index = (si), \
192 .scan_type = { \ 192 .scan_type = { \
@@ -197,13 +197,13 @@ int adis_single_conversion(struct iio_dev *indio_dev,
197 }, \ 197 }, \
198} 198}
199 199
200#define ADIS_MOD_CHAN(_type, mod, addr, si, info, bits) { \ 200#define ADIS_MOD_CHAN(_type, mod, addr, si, info_sep, bits) { \
201 .type = (_type), \ 201 .type = (_type), \
202 .modified = 1, \ 202 .modified = 1, \
203 .channel2 = IIO_MOD_ ## mod, \ 203 .channel2 = IIO_MOD_ ## mod, \
204 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ 204 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
205 IIO_CHAN_INFO_SCALE_SHARED_BIT | \ 205 info_sep, \
206 info, \ 206 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
207 .address = (addr), \ 207 .address = (addr), \
208 .scan_index = (si), \ 208 .scan_index = (si), \
209 .scan_type = { \ 209 .scan_type = { \
@@ -214,17 +214,17 @@ int adis_single_conversion(struct iio_dev *indio_dev,
214 }, \ 214 }, \
215} 215}
216 216
217#define ADIS_ACCEL_CHAN(mod, addr, si, info, bits) \ 217#define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, bits) \
218 ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info, bits) 218 ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, bits)
219 219
220#define ADIS_GYRO_CHAN(mod, addr, si, info, bits) \ 220#define ADIS_GYRO_CHAN(mod, addr, si, info_sep, bits) \
221 ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info, bits) 221 ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info_sep, bits)
222 222
223#define ADIS_INCLI_CHAN(mod, addr, si, info, bits) \ 223#define ADIS_INCLI_CHAN(mod, addr, si, info_sep, bits) \
224 ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info, bits) 224 ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info_sep, bits)
225 225
226#define ADIS_ROT_CHAN(mod, addr, si, info, bits) \ 226#define ADIS_ROT_CHAN(mod, addr, si, info_sep, bits) \
227 ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info, bits) 227 ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info_sep, bits)
228 228
229#ifdef CONFIG_IIO_ADIS_LIB_BUFFER 229#ifdef CONFIG_IIO_ADIS_LIB_BUFFER
230 230
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index c66e0a96f6e8..3869c525b052 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -44,7 +44,6 @@ struct iio_trigger_ops {
44 * @id: [INTERN] unique id number 44 * @id: [INTERN] unique id number
45 * @name: [DRIVER] unique name 45 * @name: [DRIVER] unique name
46 * @dev: [DRIVER] associated device (if relevant) 46 * @dev: [DRIVER] associated device (if relevant)
47 * @private_data: [DRIVER] device specific data
48 * @list: [INTERN] used in maintenance of global trigger list 47 * @list: [INTERN] used in maintenance of global trigger list
49 * @alloc_list: [DRIVER] used for driver specific trigger list 48 * @alloc_list: [DRIVER] used for driver specific trigger list
50 * @use_count: use count for the trigger 49 * @use_count: use count for the trigger
@@ -60,7 +59,6 @@ struct iio_trigger {
60 const char *name; 59 const char *name;
61 struct device dev; 60 struct device dev;
62 61
63 void *private_data;
64 struct list_head list; 62 struct list_head list;
65 struct list_head alloc_list; 63 struct list_head alloc_list;
66 int use_count; 64 int use_count;
@@ -92,6 +90,30 @@ static inline void iio_trigger_get(struct iio_trigger *trig)
92} 90}
93 91
94/** 92/**
93 * iio_device_set_drvdata() - Set trigger driver data
94 * @trig: IIO trigger structure
95 * @data: Driver specific data
96 *
97 * Allows to attach an arbitrary pointer to an IIO trigger, which can later be
98 * retrieved by iio_trigger_get_drvdata().
99 */
100static inline void iio_trigger_set_drvdata(struct iio_trigger *trig, void *data)
101{
102 dev_set_drvdata(&trig->dev, data);
103}
104
105/**
106 * iio_trigger_get_drvdata() - Get trigger driver data
107 * @trig: IIO trigger structure
108 *
109 * Returns the data previously set with iio_trigger_set_drvdata()
110 */
111static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig)
112{
113 return dev_get_drvdata(&trig->dev);
114}
115
116/**
95 * iio_trigger_register() - register a trigger with the IIO core 117 * iio_trigger_register() - register a trigger with the IIO core
96 * @trig_info: trigger to be registered 118 * @trig_info: trigger to be registered
97 **/ 119 **/
diff --git a/include/linux/ipack.h b/include/linux/ipack.h
index fea12cbb2aeb..1888e06ddf64 100644
--- a/include/linux/ipack.h
+++ b/include/linux/ipack.h
@@ -207,19 +207,41 @@ int ipack_driver_register(struct ipack_driver *edrv, struct module *owner,
207void ipack_driver_unregister(struct ipack_driver *edrv); 207void ipack_driver_unregister(struct ipack_driver *edrv);
208 208
209/** 209/**
210 * ipack_device_register -- register an IPack device with the kernel 210 * ipack_device_init -- initialize an IPack device
211 * @dev: the new device to register. 211 * @dev: the new device to initialize.
212 * 212 *
213 * Register a new IPack device ("module" in IndustryPack jargon). The call 213 * Initialize a new IPack device ("module" in IndustryPack jargon). The call
214 * is done by the carrier driver. The carrier should populate the fields 214 * is done by the carrier driver. The carrier should populate the fields
215 * bus and slot as well as the region array of @dev prior to calling this 215 * bus and slot as well as the region array of @dev prior to calling this
216 * function. The rest of the fields will be allocated and populated 216 * function. The rest of the fields will be allocated and populated
217 * during registration. 217 * during initalization.
218 * 218 *
219 * Return zero on success or error code on failure. 219 * Return zero on success or error code on failure.
220 *
221 * NOTE: _Never_ directly free @dev after calling this function, even
222 * if it returned an error! Always use ipack_put_device() to give up the
223 * reference initialized in this function instead.
224 */
225int ipack_device_init(struct ipack_device *dev);
226
227/**
228 * ipack_device_add -- Add an IPack device
229 * @dev: the new device to add.
230 *
231 * Add a new IPack device. The call is done by the carrier driver
232 * after calling ipack_device_init().
233 *
234 * Return zero on success or error code on failure.
235 *
236 * NOTE: _Never_ directly free @dev after calling this function, even
237 * if it returned an error! Always use ipack_put_device() to give up the
238 * reference initialized in this function instead.
220 */ 239 */
221int ipack_device_register(struct ipack_device *dev); 240int ipack_device_add(struct ipack_device *dev);
222void ipack_device_unregister(struct ipack_device *dev); 241void ipack_device_del(struct ipack_device *dev);
242
243void ipack_get_device(struct ipack_device *dev);
244void ipack_put_device(struct ipack_device *dev);
223 245
224/** 246/**
225 * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table 247 * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index f5dbce50466e..66017028dcb3 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -37,7 +37,7 @@ void irq_work_sync(struct irq_work *work);
37#ifdef CONFIG_IRQ_WORK 37#ifdef CONFIG_IRQ_WORK
38bool irq_work_needs_cpu(void); 38bool irq_work_needs_cpu(void);
39#else 39#else
40static bool irq_work_needs_cpu(void) { return false; } 40static inline bool irq_work_needs_cpu(void) { return false; }
41#endif 41#endif
42 42
43#endif /* _LINUX_IRQ_WORK_H */ 43#endif /* _LINUX_IRQ_WORK_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 80d36874689b..2dac79c39199 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -390,7 +390,6 @@ extern struct pid *session_of_pgrp(struct pid *pgrp);
390unsigned long int_sqrt(unsigned long); 390unsigned long int_sqrt(unsigned long);
391 391
392extern void bust_spinlocks(int yes); 392extern void bust_spinlocks(int yes);
393extern void wake_up_klogd(void);
394extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ 393extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
395extern int panic_timeout; 394extern int panic_timeout;
396extern int panic_on_oops; 395extern int panic_on_oops;
@@ -487,6 +486,8 @@ enum ftrace_dump_mode {
487void tracing_on(void); 486void tracing_on(void);
488void tracing_off(void); 487void tracing_off(void);
489int tracing_is_on(void); 488int tracing_is_on(void);
489void tracing_snapshot(void);
490void tracing_snapshot_alloc(void);
490 491
491extern void tracing_start(void); 492extern void tracing_start(void);
492extern void tracing_stop(void); 493extern void tracing_stop(void);
@@ -516,10 +517,32 @@ do { \
516 * 517 *
517 * This is intended as a debugging tool for the developer only. 518 * This is intended as a debugging tool for the developer only.
518 * Please refrain from leaving trace_printks scattered around in 519 * Please refrain from leaving trace_printks scattered around in
519 * your code. 520 * your code. (Extra memory is used for special buffers that are
521 * allocated when trace_printk() is used)
522 *
523 * A little optization trick is done here. If there's only one
524 * argument, there's no need to scan the string for printf formats.
525 * The trace_puts() will suffice. But how can we take advantage of
526 * using trace_puts() when trace_printk() has only one argument?
527 * By stringifying the args and checking the size we can tell
528 * whether or not there are args. __stringify((__VA_ARGS__)) will
529 * turn into "()\0" with a size of 3 when there are no args, anything
530 * else will be bigger. All we need to do is define a string to this,
531 * and then take its size and compare to 3. If it's bigger, use
532 * do_trace_printk() otherwise, optimize it to trace_puts(). Then just
533 * let gcc optimize the rest.
520 */ 534 */
521 535
522#define trace_printk(fmt, args...) \ 536#define trace_printk(fmt, ...) \
537do { \
538 char _______STR[] = __stringify((__VA_ARGS__)); \
539 if (sizeof(_______STR) > 3) \
540 do_trace_printk(fmt, ##__VA_ARGS__); \
541 else \
542 trace_puts(fmt); \
543} while (0)
544
545#define do_trace_printk(fmt, args...) \
523do { \ 546do { \
524 static const char *trace_printk_fmt \ 547 static const char *trace_printk_fmt \
525 __attribute__((section("__trace_printk_fmt"))) = \ 548 __attribute__((section("__trace_printk_fmt"))) = \
@@ -539,7 +562,45 @@ int __trace_bprintk(unsigned long ip, const char *fmt, ...);
539extern __printf(2, 3) 562extern __printf(2, 3)
540int __trace_printk(unsigned long ip, const char *fmt, ...); 563int __trace_printk(unsigned long ip, const char *fmt, ...);
541 564
542extern void trace_dump_stack(void); 565/**
566 * trace_puts - write a string into the ftrace buffer
567 * @str: the string to record
568 *
569 * Note: __trace_bputs is an internal function for trace_puts and
570 * the @ip is passed in via the trace_puts macro.
571 *
572 * This is similar to trace_printk() but is made for those really fast
573 * paths that a developer wants the least amount of "Heisenbug" affects,
574 * where the processing of the print format is still too much.
575 *
576 * This function allows a kernel developer to debug fast path sections
577 * that printk is not appropriate for. By scattering in various
578 * printk like tracing in the code, a developer can quickly see
579 * where problems are occurring.
580 *
581 * This is intended as a debugging tool for the developer only.
582 * Please refrain from leaving trace_puts scattered around in
583 * your code. (Extra memory is used for special buffers that are
584 * allocated when trace_puts() is used)
585 *
586 * Returns: 0 if nothing was written, positive # if string was.
587 * (1 when __trace_bputs is used, strlen(str) when __trace_puts is used)
588 */
589
590extern int __trace_bputs(unsigned long ip, const char *str);
591extern int __trace_puts(unsigned long ip, const char *str, int size);
592#define trace_puts(str) ({ \
593 static const char *trace_printk_fmt \
594 __attribute__((section("__trace_printk_fmt"))) = \
595 __builtin_constant_p(str) ? str : NULL; \
596 \
597 if (__builtin_constant_p(str)) \
598 __trace_bputs(_THIS_IP_, trace_printk_fmt); \
599 else \
600 __trace_puts(_THIS_IP_, str, strlen(str)); \
601})
602
603extern void trace_dump_stack(int skip);
543 604
544/* 605/*
545 * The double __builtin_constant_p is because gcc will give us an error 606 * The double __builtin_constant_p is because gcc will give us an error
@@ -574,6 +635,8 @@ static inline void trace_dump_stack(void) { }
574static inline void tracing_on(void) { } 635static inline void tracing_on(void) { }
575static inline void tracing_off(void) { } 636static inline void tracing_off(void) { }
576static inline int tracing_is_on(void) { return 0; } 637static inline int tracing_is_on(void) { return 0; }
638static inline void tracing_snapshot(void) { }
639static inline void tracing_snapshot_alloc(void) { }
577 640
578static inline __printf(1, 2) 641static inline __printf(1, 2)
579int trace_printk(const char *fmt, ...) 642int trace_printk(const char *fmt, ...)
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index d2e6927bbaae..d78d28a733b1 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -200,6 +200,8 @@ extern size_t vmcoreinfo_max_size;
200 200
201int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, 201int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
202 unsigned long long *crash_size, unsigned long long *crash_base); 202 unsigned long long *crash_size, unsigned long long *crash_base);
203int parse_crashkernel_high(char *cmdline, unsigned long long system_ram,
204 unsigned long long *crash_size, unsigned long long *crash_base);
203int parse_crashkernel_low(char *cmdline, unsigned long long system_ram, 205int parse_crashkernel_low(char *cmdline, unsigned long long system_ram,
204 unsigned long long *crash_size, unsigned long long *crash_base); 206 unsigned long long *crash_size, unsigned long long *crash_base);
205int crash_shrink_memory(unsigned long new_size); 207int crash_shrink_memory(unsigned long new_size);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index cad77fe09d77..c13958251927 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -518,7 +518,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,
518int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, 518int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
519 void *data, unsigned long len); 519 void *data, unsigned long len);
520int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, 520int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
521 gpa_t gpa); 521 gpa_t gpa, unsigned long len);
522int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); 522int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);
523int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); 523int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);
524struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); 524struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h
index fa7cc7244cbd..b0bcce0ddc95 100644
--- a/include/linux/kvm_types.h
+++ b/include/linux/kvm_types.h
@@ -71,6 +71,7 @@ struct gfn_to_hva_cache {
71 u64 generation; 71 u64 generation;
72 gpa_t gpa; 72 gpa_t gpa;
73 unsigned long hva; 73 unsigned long hva;
74 unsigned long len;
74 struct kvm_memory_slot *memslot; 75 struct kvm_memory_slot *memslot;
75}; 76};
76 77
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 91c9d109e5f1..eae7a053dc51 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -398,6 +398,7 @@ enum {
398 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ 398 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
399 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ 399 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */
400 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ 400 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
401 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */
401 402
402 /* DMA mask for user DMA control: User visible values; DO NOT 403 /* DMA mask for user DMA control: User visible values; DO NOT
403 renumber */ 404 renumber */
diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h
new file mode 100644
index 000000000000..d14af7b722ef
--- /dev/null
+++ b/include/linux/mei_cl_bus.h
@@ -0,0 +1,44 @@
1#ifndef _LINUX_MEI_CL_BUS_H
2#define _LINUX_MEI_CL_BUS_H
3
4#include <linux/device.h>
5#include <linux/uuid.h>
6
7struct mei_cl_device;
8
9struct mei_cl_driver {
10 struct device_driver driver;
11 const char *name;
12
13 const struct mei_cl_device_id *id_table;
14
15 int (*probe)(struct mei_cl_device *dev,
16 const struct mei_cl_device_id *id);
17 int (*remove)(struct mei_cl_device *dev);
18};
19
20int __mei_cl_driver_register(struct mei_cl_driver *driver,
21 struct module *owner);
22#define mei_cl_driver_register(driver) \
23 __mei_cl_driver_register(driver, THIS_MODULE)
24
25void mei_cl_driver_unregister(struct mei_cl_driver *driver);
26
27int mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length);
28int mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length);
29
30typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device,
31 u32 events, void *context);
32int mei_cl_register_event_cb(struct mei_cl_device *device,
33 mei_cl_event_cb_t read_cb, void *context);
34
35#define MEI_CL_EVENT_RX 0
36#define MEI_CL_EVENT_TX 1
37
38void *mei_cl_get_drvdata(const struct mei_cl_device *device);
39void mei_cl_set_drvdata(struct mei_cl_device *device, void *data);
40
41int mei_cl_enable_device(struct mei_cl_device *device);
42int mei_cl_disable_device(struct mei_cl_device *device);
43
44#endif /* _LINUX_MEI_CL_BUS_H */
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 9db0bda446a0..84f449475c25 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -364,8 +364,7 @@ struct ab8500 {
364 const int *irq_reg_offset; 364 const int *irq_reg_offset;
365}; 365};
366 366
367struct regulator_reg_init; 367struct ab8500_regulator_platform_data;
368struct regulator_init_data;
369struct ab8500_gpio_platform_data; 368struct ab8500_gpio_platform_data;
370struct ab8500_codec_platform_data; 369struct ab8500_codec_platform_data;
371struct ab8500_sysctrl_platform_data; 370struct ab8500_sysctrl_platform_data;
@@ -375,19 +374,13 @@ struct ab8500_sysctrl_platform_data;
375 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used 374 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used
376 * @pm_power_off: Should machine pm power off hook be registered or not 375 * @pm_power_off: Should machine pm power off hook be registered or not
377 * @init: board-specific initialization after detection of ab8500 376 * @init: board-specific initialization after detection of ab8500
378 * @num_regulator_reg_init: number of regulator init registers
379 * @regulator_reg_init: regulator init registers
380 * @num_regulator: number of regulators
381 * @regulator: machine-specific constraints for regulators 377 * @regulator: machine-specific constraints for regulators
382 */ 378 */
383struct ab8500_platform_data { 379struct ab8500_platform_data {
384 int irq_base; 380 int irq_base;
385 bool pm_power_off; 381 bool pm_power_off;
386 void (*init) (struct ab8500 *); 382 void (*init) (struct ab8500 *);
387 int num_regulator_reg_init; 383 struct ab8500_regulator_platform_data *regulator;
388 struct ab8500_regulator_reg_init *regulator_reg_init;
389 int num_regulator;
390 struct regulator_init_data *regulator;
391 struct abx500_gpio_platform_data *gpio; 384 struct abx500_gpio_platform_data *gpio;
392 struct ab8500_codec_platform_data *codec; 385 struct ab8500_codec_platform_data *codec;
393 struct ab8500_sysctrl_platform_data *sysctrl; 386 struct ab8500_sysctrl_platform_data *sysctrl;
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index a710255528d7..cc281368dc55 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -100,6 +100,9 @@ struct arizona {
100 struct regmap_irq_chip_data *aod_irq_chip; 100 struct regmap_irq_chip_data *aod_irq_chip;
101 struct regmap_irq_chip_data *irq_chip; 101 struct regmap_irq_chip_data *irq_chip;
102 102
103 bool hpdet_magic;
104 unsigned int hp_ena;
105
103 struct mutex clk_lock; 106 struct mutex clk_lock;
104 int clk32k_ref; 107 int clk32k_ref;
105 108
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 455c51d22d6b..a0f940987a3e 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -86,6 +86,11 @@ struct arizona_micd_config {
86 bool gpio; 86 bool gpio;
87}; 87};
88 88
89struct arizona_micd_range {
90 int max; /** Ohms */
91 int key; /** Key to report to input layer */
92};
93
89struct arizona_pdata { 94struct arizona_pdata {
90 int reset; /** GPIO controlling /RESET, if any */ 95 int reset; /** GPIO controlling /RESET, if any */
91 int ldoena; /** GPIO controlling LODENA, if any */ 96 int ldoena; /** GPIO controlling LODENA, if any */
@@ -117,12 +122,21 @@ struct arizona_pdata {
117 /** GPIO5 is used for jack detection */ 122 /** GPIO5 is used for jack detection */
118 bool jd_gpio5; 123 bool jd_gpio5;
119 124
125 /** Internal pull on GPIO5 is disabled when used for jack detection */
126 bool jd_gpio5_nopull;
127
120 /** Use the headphone detect circuit to identify the accessory */ 128 /** Use the headphone detect circuit to identify the accessory */
121 bool hpdet_acc_id; 129 bool hpdet_acc_id;
122 130
131 /** Check for line output with HPDET method */
132 bool hpdet_acc_id_line;
133
123 /** GPIO used for mic isolation with HPDET */ 134 /** GPIO used for mic isolation with HPDET */
124 int hpdet_id_gpio; 135 int hpdet_id_gpio;
125 136
137 /** Extra debounce timeout used during initial mic detection (ms) */
138 int micd_detect_debounce;
139
126 /** GPIO for mic detection polarity */ 140 /** GPIO for mic detection polarity */
127 int micd_pol_gpio; 141 int micd_pol_gpio;
128 142
@@ -135,9 +149,16 @@ struct arizona_pdata {
135 /** Mic detect debounce level */ 149 /** Mic detect debounce level */
136 int micd_dbtime; 150 int micd_dbtime;
137 151
152 /** Mic detect timeout (ms) */
153 int micd_timeout;
154
138 /** Force MICBIAS on for mic detect */ 155 /** Force MICBIAS on for mic detect */
139 bool micd_force_micbias; 156 bool micd_force_micbias;
140 157
158 /** Mic detect level parameters */
159 const struct arizona_micd_range *micd_ranges;
160 int num_micd_ranges;
161
141 /** Headset polarity configurations */ 162 /** Headset polarity configurations */
142 struct arizona_micd_config *micd_configs; 163 struct arizona_micd_config *micd_configs;
143 int num_micd_configs; 164 int num_micd_configs;
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 340355136069..f43aa7c8d040 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -124,6 +124,10 @@
124#define ARIZONA_MIC_DETECT_1 0x2A3 124#define ARIZONA_MIC_DETECT_1 0x2A3
125#define ARIZONA_MIC_DETECT_2 0x2A4 125#define ARIZONA_MIC_DETECT_2 0x2A4
126#define ARIZONA_MIC_DETECT_3 0x2A5 126#define ARIZONA_MIC_DETECT_3 0x2A5
127#define ARIZONA_MIC_DETECT_LEVEL_1 0x2A6
128#define ARIZONA_MIC_DETECT_LEVEL_2 0x2A7
129#define ARIZONA_MIC_DETECT_LEVEL_3 0x2A8
130#define ARIZONA_MIC_DETECT_LEVEL_4 0x2A9
127#define ARIZONA_MIC_NOISE_MIX_CONTROL_1 0x2C3 131#define ARIZONA_MIC_NOISE_MIX_CONTROL_1 0x2C3
128#define ARIZONA_ISOLATION_CONTROL 0x2CB 132#define ARIZONA_ISOLATION_CONTROL 0x2CB
129#define ARIZONA_JACK_DETECT_ANALOGUE 0x2D3 133#define ARIZONA_JACK_DETECT_ANALOGUE 0x2D3
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 5b18ecde69b5..1aa4f13cdfa6 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -106,6 +106,29 @@ enum max77693_muic_reg {
106 MAX77693_MUIC_REG_END, 106 MAX77693_MUIC_REG_END,
107}; 107};
108 108
109/* MAX77693 INTMASK1~2 Register */
110#define INTMASK1_ADC1K_SHIFT 3
111#define INTMASK1_ADCERR_SHIFT 2
112#define INTMASK1_ADCLOW_SHIFT 1
113#define INTMASK1_ADC_SHIFT 0
114#define INTMASK1_ADC1K_MASK (1 << INTMASK1_ADC1K_SHIFT)
115#define INTMASK1_ADCERR_MASK (1 << INTMASK1_ADCERR_SHIFT)
116#define INTMASK1_ADCLOW_MASK (1 << INTMASK1_ADCLOW_SHIFT)
117#define INTMASK1_ADC_MASK (1 << INTMASK1_ADC_SHIFT)
118
119#define INTMASK2_VIDRM_SHIFT 5
120#define INTMASK2_VBVOLT_SHIFT 4
121#define INTMASK2_DXOVP_SHIFT 3
122#define INTMASK2_DCDTMR_SHIFT 2
123#define INTMASK2_CHGDETRUN_SHIFT 1
124#define INTMASK2_CHGTYP_SHIFT 0
125#define INTMASK2_VIDRM_MASK (1 << INTMASK2_VIDRM_SHIFT)
126#define INTMASK2_VBVOLT_MASK (1 << INTMASK2_VBVOLT_SHIFT)
127#define INTMASK2_DXOVP_MASK (1 << INTMASK2_DXOVP_SHIFT)
128#define INTMASK2_DCDTMR_MASK (1 << INTMASK2_DCDTMR_SHIFT)
129#define INTMASK2_CHGDETRUN_MASK (1 << INTMASK2_CHGDETRUN_SHIFT)
130#define INTMASK2_CHGTYP_MASK (1 << INTMASK2_CHGTYP_SHIFT)
131
109/* MAX77693 MUIC - STATUS1~3 Register */ 132/* MAX77693 MUIC - STATUS1~3 Register */
110#define STATUS1_ADC_SHIFT (0) 133#define STATUS1_ADC_SHIFT (0)
111#define STATUS1_ADCLOW_SHIFT (5) 134#define STATUS1_ADCLOW_SHIFT (5)
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 3bbda22721ea..ecddc5173c7c 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -109,19 +109,6 @@ struct palmas_reg_init {
109 */ 109 */
110 int mode_sleep; 110 int mode_sleep;
111 111
112 /* tstep is the timestep loaded to the TSTEP register
113 *
114 * For SMPS
115 *
116 * 0: Jump (no slope control)
117 * 1: 10mV/us
118 * 2: 5mV/us
119 * 3: 2.5mV/us
120 *
121 * For LDO unused
122 */
123 int tstep;
124
125 /* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE 112 /* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE
126 * register. Set this is the default voltage set in OTP needs 113 * register. Set this is the default voltage set in OTP needs
127 * to be overridden. 114 * to be overridden.
@@ -154,6 +141,12 @@ enum palmas_regulators {
154 PALMAS_REG_LDO9, 141 PALMAS_REG_LDO9,
155 PALMAS_REG_LDOLN, 142 PALMAS_REG_LDOLN,
156 PALMAS_REG_LDOUSB, 143 PALMAS_REG_LDOUSB,
144 /* External regulators */
145 PALMAS_REG_REGEN1,
146 PALMAS_REG_REGEN2,
147 PALMAS_REG_REGEN3,
148 PALMAS_REG_SYSEN1,
149 PALMAS_REG_SYSEN2,
157 /* Total number of regulators */ 150 /* Total number of regulators */
158 PALMAS_NUM_REGS, 151 PALMAS_NUM_REGS,
159}; 152};
@@ -171,6 +164,9 @@ struct palmas_pmic_platform_data {
171 164
172 /* use LDO6 for vibrator control */ 165 /* use LDO6 for vibrator control */
173 int ldo6_vibrator; 166 int ldo6_vibrator;
167
168 /* Enable tracking mode of LDO8 */
169 bool enable_ldo8_tracking;
174}; 170};
175 171
176struct palmas_usb_platform_data { 172struct palmas_usb_platform_data {
@@ -331,6 +327,8 @@ struct palmas_pmic {
331 int smps457; 327 int smps457;
332 328
333 int range[PALMAS_REG_SMPS10]; 329 int range[PALMAS_REG_SMPS10];
330 unsigned int ramp_delay[PALMAS_REG_SMPS10];
331 unsigned int current_reg_mode[PALMAS_REG_SMPS10];
334}; 332};
335 333
336struct palmas_resource { 334struct palmas_resource {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7acc9dc73c9f..e2091b88d24c 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -87,7 +87,6 @@ extern unsigned int kobjsize(const void *objp);
87#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ 87#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
88#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ 88#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
89 89
90#define VM_POPULATE 0x00001000
91#define VM_LOCKED 0x00002000 90#define VM_LOCKED 0x00002000
92#define VM_IO 0x00004000 /* Memory mapped I/O or similar */ 91#define VM_IO 0x00004000 /* Memory mapped I/O or similar */
93 92
@@ -1612,6 +1611,8 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
1612 unsigned long pfn); 1611 unsigned long pfn);
1613int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, 1612int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
1614 unsigned long pfn); 1613 unsigned long pfn);
1614int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
1615
1615 1616
1616struct page *follow_page_mask(struct vm_area_struct *vma, 1617struct page *follow_page_mask(struct vm_area_struct *vma,
1617 unsigned long address, unsigned int foll_flags, 1618 unsigned long address, unsigned int foll_flags,
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 61c7a87e5d2b..9aa863da287f 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -79,8 +79,6 @@ calc_vm_flag_bits(unsigned long flags)
79{ 79{
80 return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | 80 return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) |
81 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | 81 _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) |
82 ((flags & MAP_LOCKED) ? (VM_LOCKED | VM_POPULATE) : 0) | 82 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED );
83 (((flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE) ?
84 VM_POPULATE : 0);
85} 83}
86#endif /* _LINUX_MMAN_H */ 84#endif /* _LINUX_MMAN_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index ede274957e05..c74092eebf5c 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -527,7 +527,7 @@ static inline int zone_is_oom_locked(const struct zone *zone)
527 return test_bit(ZONE_OOM_LOCKED, &zone->flags); 527 return test_bit(ZONE_OOM_LOCKED, &zone->flags);
528} 528}
529 529
530static inline unsigned zone_end_pfn(const struct zone *zone) 530static inline unsigned long zone_end_pfn(const struct zone *zone)
531{ 531{
532 return zone->zone_start_pfn + zone->spanned_pages; 532 return zone->zone_start_pfn + zone->spanned_pages;
533} 533}
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 779cf7c4a3d1..b508016fb76d 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -9,6 +9,7 @@
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/uuid.h>
12typedef unsigned long kernel_ulong_t; 13typedef unsigned long kernel_ulong_t;
13#endif 14#endif
14 15
@@ -568,4 +569,12 @@ struct ipack_device_id {
568 __u32 device; /* Device ID or IPACK_ANY_ID */ 569 __u32 device; /* Device ID or IPACK_ANY_ID */
569}; 570};
570 571
572#define MEI_CL_MODULE_PREFIX "mei:"
573#define MEI_CL_NAME_SIZE 32
574
575struct mei_cl_device_id {
576 char name[MEI_CL_NAME_SIZE];
577 kernel_ulong_t driver_info;
578};
579
571#endif /* LINUX_MOD_DEVICETABLE_H */ 580#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/mount.h b/include/linux/mount.h
index d7029f4a191a..73005f9957ea 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -47,6 +47,8 @@ struct mnt_namespace;
47 47
48#define MNT_INTERNAL 0x4000 48#define MNT_INTERNAL 0x4000
49 49
50#define MNT_LOCK_READONLY 0x400000
51
50struct vfsmount { 52struct vfsmount {
51 struct dentry *mnt_root; /* root of the mounted tree */ 53 struct dentry *mnt_root; /* root of the mounted tree */
52 struct super_block *mnt_sb; /* pointer to superblock */ 54 struct super_block *mnt_sb; /* pointer to superblock */
diff --git a/include/linux/msi.h b/include/linux/msi.h
index ce93a341337d..20c2d6dd5d25 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -13,14 +13,14 @@ struct msi_msg {
13/* Helper functions */ 13/* Helper functions */
14struct irq_data; 14struct irq_data;
15struct msi_desc; 15struct msi_desc;
16extern void mask_msi_irq(struct irq_data *data); 16void mask_msi_irq(struct irq_data *data);
17extern void unmask_msi_irq(struct irq_data *data); 17void unmask_msi_irq(struct irq_data *data);
18extern void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); 18void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
19extern void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); 19void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
20extern void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); 20void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
21extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); 21void read_msi_msg(unsigned int irq, struct msi_msg *msg);
22extern void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); 22void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg);
23extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); 23void write_msi_msg(unsigned int irq, struct msi_msg *msg);
24 24
25struct msi_desc { 25struct msi_desc {
26 struct { 26 struct {
@@ -54,9 +54,8 @@ struct msi_desc {
54 */ 54 */
55int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); 55int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
56void arch_teardown_msi_irq(unsigned int irq); 56void arch_teardown_msi_irq(unsigned int irq);
57extern int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); 57int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
58extern void arch_teardown_msi_irqs(struct pci_dev *dev); 58void arch_teardown_msi_irqs(struct pci_dev *dev);
59extern int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); 59int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
60
61 60
62#endif /* LINUX_MSI_H */ 61#endif /* LINUX_MSI_H */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 7ccb3c59ed60..ef52d9c91459 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -187,6 +187,13 @@ typedef enum {
187 * This happens with the Renesas AG-AND chips, possibly others. 187 * This happens with the Renesas AG-AND chips, possibly others.
188 */ 188 */
189#define BBT_AUTO_REFRESH 0x00000080 189#define BBT_AUTO_REFRESH 0x00000080
190/*
191 * Chip requires ready check on read (for auto-incremented sequential read).
192 * True only for small page devices; large page devices do not support
193 * autoincrement.
194 */
195#define NAND_NEED_READRDY 0x00000100
196
190/* Chip does not allow subpage writes */ 197/* Chip does not allow subpage writes */
191#define NAND_NO_SUBPAGE_WRITE 0x00000200 198#define NAND_NO_SUBPAGE_WRITE 0x00000200
192 199
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 9121595a8ebf..433da8a1a426 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -53,6 +53,9 @@ struct mutex {
53#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) 53#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP)
54 struct task_struct *owner; 54 struct task_struct *owner;
55#endif 55#endif
56#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
57 void *spin_mlock; /* Spinner MCS lock */
58#endif
56#ifdef CONFIG_DEBUG_MUTEXES 59#ifdef CONFIG_DEBUG_MUTEXES
57 const char *name; 60 const char *name;
58 void *magic; 61 void *magic;
diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h
index f14943d55315..f80af8674342 100644
--- a/include/linux/mxsfb.h
+++ b/include/linux/mxsfb.h
@@ -24,8 +24,8 @@
24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */ 24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ 25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
26 26
27#define FB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6) 27#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
28#define FB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */ 28#define MXSFB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */
29 29
30struct mxsfb_platform_data { 30struct mxsfb_platform_data {
31 struct fb_videomode *mode_list; 31 struct fb_videomode *mode_list;
@@ -44,6 +44,9 @@ struct mxsfb_platform_data {
44 * allocated. If specified,fb_size must also be specified. 44 * allocated. If specified,fb_size must also be specified.
45 * fb_phys must be unused by Linux. 45 * fb_phys must be unused by Linux.
46 */ 46 */
47 u32 sync; /* sync mask, contains MXSFB specifics not
48 * carried in fb_info->var.sync
49 */
47}; 50};
48 51
49#endif /* __LINUX_MXSFB_H */ 52#endif /* __LINUX_MXSFB_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b3d00fa4b314..6151e903eef0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -210,9 +210,9 @@ struct netdev_hw_addr {
210#define NETDEV_HW_ADDR_T_SLAVE 3 210#define NETDEV_HW_ADDR_T_SLAVE 3
211#define NETDEV_HW_ADDR_T_UNICAST 4 211#define NETDEV_HW_ADDR_T_UNICAST 4
212#define NETDEV_HW_ADDR_T_MULTICAST 5 212#define NETDEV_HW_ADDR_T_MULTICAST 5
213 bool synced;
214 bool global_use; 213 bool global_use;
215 int refcount; 214 int refcount;
215 int synced;
216 struct rcu_head rcu_head; 216 struct rcu_head rcu_head;
217}; 217};
218 218
@@ -895,7 +895,7 @@ struct netdev_fcoe_hbainfo {
895 * 895 *
896 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) 896 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh)
897 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, 897 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
898 * struct net_device *dev) 898 * struct net_device *dev, u32 filter_mask)
899 * 899 *
900 * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); 900 * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);
901 * Called to change device carrier. Soft-devices (like dummy, team, etc) 901 * Called to change device carrier. Soft-devices (like dummy, team, etc)
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index 01d25e6fc792..0214c4c146fa 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -291,6 +291,7 @@ ip_set_hash_destroy(struct ip_set *set)
291#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) 291#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
292#define type_pf_data_next TOKEN(TYPE, PF, _data_next) 292#define type_pf_data_next TOKEN(TYPE, PF, _data_next)
293#define type_pf_data_flags TOKEN(TYPE, PF, _data_flags) 293#define type_pf_data_flags TOKEN(TYPE, PF, _data_flags)
294#define type_pf_data_reset_flags TOKEN(TYPE, PF, _data_reset_flags)
294#ifdef IP_SET_HASH_WITH_NETS 295#ifdef IP_SET_HASH_WITH_NETS
295#define type_pf_data_match TOKEN(TYPE, PF, _data_match) 296#define type_pf_data_match TOKEN(TYPE, PF, _data_match)
296#else 297#else
@@ -385,9 +386,9 @@ type_pf_resize(struct ip_set *set, bool retried)
385 struct ip_set_hash *h = set->data; 386 struct ip_set_hash *h = set->data;
386 struct htable *t, *orig = h->table; 387 struct htable *t, *orig = h->table;
387 u8 htable_bits = orig->htable_bits; 388 u8 htable_bits = orig->htable_bits;
388 const struct type_pf_elem *data; 389 struct type_pf_elem *data;
389 struct hbucket *n, *m; 390 struct hbucket *n, *m;
390 u32 i, j; 391 u32 i, j, flags = 0;
391 int ret; 392 int ret;
392 393
393retry: 394retry:
@@ -412,9 +413,16 @@ retry:
412 n = hbucket(orig, i); 413 n = hbucket(orig, i);
413 for (j = 0; j < n->pos; j++) { 414 for (j = 0; j < n->pos; j++) {
414 data = ahash_data(n, j); 415 data = ahash_data(n, j);
416#ifdef IP_SET_HASH_WITH_NETS
417 flags = 0;
418 type_pf_data_reset_flags(data, &flags);
419#endif
415 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 420 m = hbucket(t, HKEY(data, h->initval, htable_bits));
416 ret = type_pf_elem_add(m, data, AHASH_MAX(h), 0); 421 ret = type_pf_elem_add(m, data, AHASH_MAX(h), flags);
417 if (ret < 0) { 422 if (ret < 0) {
423#ifdef IP_SET_HASH_WITH_NETS
424 type_pf_data_flags(data, flags);
425#endif
418 read_unlock_bh(&set->lock); 426 read_unlock_bh(&set->lock);
419 ahash_destroy(t); 427 ahash_destroy(t);
420 if (ret == -EAGAIN) 428 if (ret == -EAGAIN)
@@ -836,9 +844,9 @@ type_pf_tresize(struct ip_set *set, bool retried)
836 struct ip_set_hash *h = set->data; 844 struct ip_set_hash *h = set->data;
837 struct htable *t, *orig = h->table; 845 struct htable *t, *orig = h->table;
838 u8 htable_bits = orig->htable_bits; 846 u8 htable_bits = orig->htable_bits;
839 const struct type_pf_elem *data; 847 struct type_pf_elem *data;
840 struct hbucket *n, *m; 848 struct hbucket *n, *m;
841 u32 i, j; 849 u32 i, j, flags = 0;
842 int ret; 850 int ret;
843 851
844 /* Try to cleanup once */ 852 /* Try to cleanup once */
@@ -873,10 +881,17 @@ retry:
873 n = hbucket(orig, i); 881 n = hbucket(orig, i);
874 for (j = 0; j < n->pos; j++) { 882 for (j = 0; j < n->pos; j++) {
875 data = ahash_tdata(n, j); 883 data = ahash_tdata(n, j);
884#ifdef IP_SET_HASH_WITH_NETS
885 flags = 0;
886 type_pf_data_reset_flags(data, &flags);
887#endif
876 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 888 m = hbucket(t, HKEY(data, h->initval, htable_bits));
877 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, 889 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), flags,
878 ip_set_timeout_get(type_pf_data_timeout(data))); 890 ip_set_timeout_get(type_pf_data_timeout(data)));
879 if (ret < 0) { 891 if (ret < 0) {
892#ifdef IP_SET_HASH_WITH_NETS
893 type_pf_data_flags(data, flags);
894#endif
880 read_unlock_bh(&set->lock); 895 read_unlock_bh(&set->lock);
881 ahash_destroy(t); 896 ahash_destroy(t);
882 if (ret == -EAGAIN) 897 if (ret == -EAGAIN)
@@ -1187,6 +1202,7 @@ type_pf_gc_init(struct ip_set *set)
1187#undef type_pf_data_tlist 1202#undef type_pf_data_tlist
1188#undef type_pf_data_next 1203#undef type_pf_data_next
1189#undef type_pf_data_flags 1204#undef type_pf_data_flags
1205#undef type_pf_data_reset_flags
1190#undef type_pf_data_match 1206#undef type_pf_data_match
1191 1207
1192#undef type_pf_elem 1208#undef type_pf_elem
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index c25cccaa555a..4fa3b0b9b071 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -137,6 +137,34 @@ enum {
137 NVME_LBAF_RP_DEGRADED = 3, 137 NVME_LBAF_RP_DEGRADED = 3,
138}; 138};
139 139
140struct nvme_smart_log {
141 __u8 critical_warning;
142 __u8 temperature[2];
143 __u8 avail_spare;
144 __u8 spare_thresh;
145 __u8 percent_used;
146 __u8 rsvd6[26];
147 __u8 data_units_read[16];
148 __u8 data_units_written[16];
149 __u8 host_reads[16];
150 __u8 host_writes[16];
151 __u8 ctrl_busy_time[16];
152 __u8 power_cycles[16];
153 __u8 power_on_hours[16];
154 __u8 unsafe_shutdowns[16];
155 __u8 media_errors[16];
156 __u8 num_err_log_entries[16];
157 __u8 rsvd192[320];
158};
159
160enum {
161 NVME_SMART_CRIT_SPARE = 1 << 0,
162 NVME_SMART_CRIT_TEMPERATURE = 1 << 1,
163 NVME_SMART_CRIT_RELIABILITY = 1 << 2,
164 NVME_SMART_CRIT_MEDIA = 1 << 3,
165 NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4,
166};
167
140struct nvme_lba_range_type { 168struct nvme_lba_range_type {
141 __u8 type; 169 __u8 type;
142 __u8 attributes; 170 __u8 attributes;
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 9a22b5efb384..81b31613eb25 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -41,8 +41,37 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
41 41
42 return DEVICE_ACPI_HANDLE(dev); 42 return DEVICE_ACPI_HANDLE(dev);
43} 43}
44
45void acpi_pci_add_bus(struct pci_bus *bus);
46void acpi_pci_remove_bus(struct pci_bus *bus);
47
48#ifdef CONFIG_ACPI_PCI_SLOT
49void acpi_pci_slot_init(void);
50void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle);
51void acpi_pci_slot_remove(struct pci_bus *bus);
52#else
53static inline void acpi_pci_slot_init(void) { }
54static inline void acpi_pci_slot_enumerate(struct pci_bus *bus,
55 acpi_handle handle) { }
56static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }
44#endif 57#endif
45 58
59#ifdef CONFIG_HOTPLUG_PCI_ACPI
60void acpiphp_init(void);
61void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle);
62void acpiphp_remove_slots(struct pci_bus *bus);
63#else
64static inline void acpiphp_init(void) { }
65static inline void acpiphp_enumerate_slots(struct pci_bus *bus,
66 acpi_handle handle) { }
67static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
68#endif
69
70#else /* CONFIG_ACPI */
71static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
72static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }
73#endif /* CONFIG_ACPI */
74
46#ifdef CONFIG_ACPI_APEI 75#ifdef CONFIG_ACPI_APEI
47extern bool aer_acpi_firmware_first(void); 76extern bool aer_acpi_firmware_first(void);
48#else 77#else
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
index c8320144fe79..8af4610c2e41 100644
--- a/include/linux/pci-aspm.h
+++ b/include/linux/pci-aspm.h
@@ -23,14 +23,14 @@
23#define PCIE_LINK_STATE_CLKPM 4 23#define PCIE_LINK_STATE_CLKPM 4
24 24
25#ifdef CONFIG_PCIEASPM 25#ifdef CONFIG_PCIEASPM
26extern void pcie_aspm_init_link_state(struct pci_dev *pdev); 26void pcie_aspm_init_link_state(struct pci_dev *pdev);
27extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); 27void pcie_aspm_exit_link_state(struct pci_dev *pdev);
28extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); 28void pcie_aspm_pm_state_change(struct pci_dev *pdev);
29extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); 29void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
30extern void pci_disable_link_state(struct pci_dev *pdev, int state); 30void pci_disable_link_state(struct pci_dev *pdev, int state);
31extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); 31void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
32extern void pcie_clear_aspm(struct pci_bus *bus); 32void pcie_clear_aspm(struct pci_bus *bus);
33extern void pcie_no_aspm(void); 33void pcie_no_aspm(void);
34#else 34#else
35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) 35static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
36{ 36{
@@ -56,8 +56,8 @@ static inline void pcie_no_aspm(void)
56#endif 56#endif
57 57
58#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ 58#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
59extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); 59void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
60extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); 60void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
61#else 61#else
62static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) 62static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
63{ 63{
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 7ef68724f0f0..68bcefd7fca0 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -14,9 +14,9 @@ struct pci_ats {
14 14
15#ifdef CONFIG_PCI_ATS 15#ifdef CONFIG_PCI_ATS
16 16
17extern int pci_enable_ats(struct pci_dev *dev, int ps); 17int pci_enable_ats(struct pci_dev *dev, int ps);
18extern void pci_disable_ats(struct pci_dev *dev); 18void pci_disable_ats(struct pci_dev *dev);
19extern int pci_ats_queue_depth(struct pci_dev *dev); 19int pci_ats_queue_depth(struct pci_dev *dev);
20 20
21/** 21/**
22 * pci_ats_enabled - query the ATS status 22 * pci_ats_enabled - query the ATS status
@@ -54,12 +54,12 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
54 54
55#ifdef CONFIG_PCI_PRI 55#ifdef CONFIG_PCI_PRI
56 56
57extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); 57int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58extern void pci_disable_pri(struct pci_dev *pdev); 58void pci_disable_pri(struct pci_dev *pdev);
59extern bool pci_pri_enabled(struct pci_dev *pdev); 59bool pci_pri_enabled(struct pci_dev *pdev);
60extern int pci_reset_pri(struct pci_dev *pdev); 60int pci_reset_pri(struct pci_dev *pdev);
61extern bool pci_pri_stopped(struct pci_dev *pdev); 61bool pci_pri_stopped(struct pci_dev *pdev);
62extern int pci_pri_status(struct pci_dev *pdev); 62int pci_pri_status(struct pci_dev *pdev);
63 63
64#else /* CONFIG_PCI_PRI */ 64#else /* CONFIG_PCI_PRI */
65 65
@@ -95,10 +95,10 @@ static inline int pci_pri_status(struct pci_dev *pdev)
95 95
96#ifdef CONFIG_PCI_PASID 96#ifdef CONFIG_PCI_PASID
97 97
98extern int pci_enable_pasid(struct pci_dev *pdev, int features); 98int pci_enable_pasid(struct pci_dev *pdev, int features);
99extern void pci_disable_pasid(struct pci_dev *pdev); 99void pci_disable_pasid(struct pci_dev *pdev);
100extern int pci_pasid_features(struct pci_dev *pdev); 100int pci_pasid_features(struct pci_dev *pdev);
101extern int pci_max_pasids(struct pci_dev *pdev); 101int pci_max_pasids(struct pci_dev *pdev);
102 102
103#else /* CONFIG_PCI_PASID */ 103#else /* CONFIG_PCI_PASID */
104 104
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2461033a7987..e73dfa308b87 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -35,6 +35,21 @@
35/* Include the ID list */ 35/* Include the ID list */
36#include <linux/pci_ids.h> 36#include <linux/pci_ids.h>
37 37
38/*
39 * The PCI interface treats multi-function devices as independent
40 * devices. The slot/function address of each device is encoded
41 * in a single byte as follows:
42 *
43 * 7:3 = slot
44 * 2:0 = function
45 * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h
46 * In the interest of not exposing interfaces to user-space unnecessarily,
47 * the following kernel only defines are being added here.
48 */
49#define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn)
50/* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */
51#define PCI_BUS_NUM(x) (((x) >> 8) & 0xff)
52
38/* pci_slot represents a physical slot */ 53/* pci_slot represents a physical slot */
39struct pci_slot { 54struct pci_slot {
40 struct pci_bus *bus; /* The bus this slot is on */ 55 struct pci_bus *bus; /* The bus this slot is on */
@@ -232,6 +247,8 @@ struct pci_dev {
232 u8 revision; /* PCI revision, low byte of class word */ 247 u8 revision; /* PCI revision, low byte of class word */
233 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 248 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
234 u8 pcie_cap; /* PCI-E capability offset */ 249 u8 pcie_cap; /* PCI-E capability offset */
250 u8 msi_cap; /* MSI capability offset */
251 u8 msix_cap; /* MSI-X capability offset */
235 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ 252 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */
236 u8 rom_base_reg; /* which config register controls the ROM */ 253 u8 rom_base_reg; /* which config register controls the ROM */
237 u8 pin; /* which interrupt pin this device uses */ 254 u8 pin; /* which interrupt pin this device uses */
@@ -249,8 +266,7 @@ struct pci_dev {
249 pci_power_t current_state; /* Current operating state. In ACPI-speak, 266 pci_power_t current_state; /* Current operating state. In ACPI-speak,
250 this is D0-D3, D0 being fully functional, 267 this is D0-D3, D0 being fully functional,
251 and D3 being off. */ 268 and D3 being off. */
252 int pm_cap; /* PM capability offset in the 269 u8 pm_cap; /* PM capability offset */
253 configuration space */
254 unsigned int pme_support:5; /* Bitmask of states from which PME# 270 unsigned int pme_support:5; /* Bitmask of states from which PME#
255 can be generated */ 271 can be generated */
256 unsigned int pme_interrupt:1; 272 unsigned int pme_interrupt:1;
@@ -348,7 +364,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
348 return dev; 364 return dev;
349} 365}
350 366
351extern struct pci_dev *alloc_pci_dev(void); 367struct pci_dev *alloc_pci_dev(void);
352 368
353#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 369#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
354#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 370#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -504,10 +520,10 @@ struct pci_ops {
504 * ACPI needs to be able to access PCI config space before we've done a 520 * ACPI needs to be able to access PCI config space before we've done a
505 * PCI bus scan and created pci_bus structures. 521 * PCI bus scan and created pci_bus structures.
506 */ 522 */
507extern int raw_pci_read(unsigned int domain, unsigned int bus, 523int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
508 unsigned int devfn, int reg, int len, u32 *val); 524 int reg, int len, u32 *val);
509extern int raw_pci_write(unsigned int domain, unsigned int bus, 525int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
510 unsigned int devfn, int reg, int len, u32 val); 526 int reg, int len, u32 val);
511 527
512struct pci_bus_region { 528struct pci_bus_region {
513 resource_size_t start; 529 resource_size_t start;
@@ -658,7 +674,7 @@ struct pci_driver {
658/* these external functions are only available when PCI support is enabled */ 674/* these external functions are only available when PCI support is enabled */
659#ifdef CONFIG_PCI 675#ifdef CONFIG_PCI
660 676
661extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); 677void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
662 678
663enum pcie_bus_config_types { 679enum pcie_bus_config_types {
664 PCIE_BUS_TUNE_OFF, 680 PCIE_BUS_TUNE_OFF,
@@ -675,9 +691,11 @@ extern struct bus_type pci_bus_type;
675 * code, or pci core code. */ 691 * code, or pci core code. */
676extern struct list_head pci_root_buses; /* list of all known PCI buses */ 692extern struct list_head pci_root_buses; /* list of all known PCI buses */
677/* Some device drivers need know if pci is initiated */ 693/* Some device drivers need know if pci is initiated */
678extern int no_pci_devices(void); 694int no_pci_devices(void);
679 695
680void pcibios_resource_survey_bus(struct pci_bus *bus); 696void pcibios_resource_survey_bus(struct pci_bus *bus);
697void pcibios_add_bus(struct pci_bus *bus);
698void pcibios_remove_bus(struct pci_bus *bus);
681void pcibios_fixup_bus(struct pci_bus *); 699void pcibios_fixup_bus(struct pci_bus *);
682int __must_check pcibios_enable_device(struct pci_dev *, int mask); 700int __must_check pcibios_enable_device(struct pci_dev *, int mask);
683/* Architecture specific versions may override this (weak) */ 701/* Architecture specific versions may override this (weak) */
@@ -699,7 +717,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
699void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 717void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
700 struct pci_bus_region *region); 718 struct pci_bus_region *region);
701void pcibios_scan_specific_bus(int busn); 719void pcibios_scan_specific_bus(int busn);
702extern struct pci_bus *pci_find_bus(int domain, int busnr); 720struct pci_bus *pci_find_bus(int domain, int busnr);
703void pci_bus_add_devices(const struct pci_bus *bus); 721void pci_bus_add_devices(const struct pci_bus *bus);
704struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 722struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
705 struct pci_ops *ops, void *sysdata); 723 struct pci_ops *ops, void *sysdata);
@@ -732,14 +750,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev,
732u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); 750u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);
733int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 751int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
734u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); 752u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
735extern struct pci_dev *pci_dev_get(struct pci_dev *dev); 753struct pci_dev *pci_dev_get(struct pci_dev *dev);
736extern void pci_dev_put(struct pci_dev *dev); 754void pci_dev_put(struct pci_dev *dev);
737extern void pci_remove_bus(struct pci_bus *b); 755void pci_remove_bus(struct pci_bus *b);
738extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 756void pci_stop_and_remove_bus_device(struct pci_dev *dev);
739void pci_stop_root_bus(struct pci_bus *bus); 757void pci_stop_root_bus(struct pci_bus *bus);
740void pci_remove_root_bus(struct pci_bus *bus); 758void pci_remove_root_bus(struct pci_bus *bus);
741void pci_setup_cardbus(struct pci_bus *bus); 759void pci_setup_cardbus(struct pci_bus *bus);
742extern void pci_sort_breadthfirst(void); 760void pci_sort_breadthfirst(void);
743#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 761#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
744#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) 762#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
745#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) 763#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
@@ -916,6 +934,7 @@ void pci_disable_rom(struct pci_dev *pdev);
916void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); 934void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
917void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); 935void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
918size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); 936size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size);
937void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size);
919 938
920/* Power management related routines */ 939/* Power management related routines */
921int pci_save_state(struct pci_dev *dev); 940int pci_save_state(struct pci_dev *dev);
@@ -1141,18 +1160,17 @@ static inline int pci_msi_enabled(void)
1141 return 0; 1160 return 0;
1142} 1161}
1143#else 1162#else
1144extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); 1163int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1145extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); 1164int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1146extern void pci_msi_shutdown(struct pci_dev *dev); 1165void pci_msi_shutdown(struct pci_dev *dev);
1147extern void pci_disable_msi(struct pci_dev *dev); 1166void pci_disable_msi(struct pci_dev *dev);
1148extern int pci_msix_table_size(struct pci_dev *dev); 1167int pci_msix_table_size(struct pci_dev *dev);
1149extern int pci_enable_msix(struct pci_dev *dev, 1168int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1150 struct msix_entry *entries, int nvec); 1169void pci_msix_shutdown(struct pci_dev *dev);
1151extern void pci_msix_shutdown(struct pci_dev *dev); 1170void pci_disable_msix(struct pci_dev *dev);
1152extern void pci_disable_msix(struct pci_dev *dev); 1171void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1153extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1172void pci_restore_msi_state(struct pci_dev *dev);
1154extern void pci_restore_msi_state(struct pci_dev *dev); 1173int pci_msi_enabled(void);
1155extern int pci_msi_enabled(void);
1156#endif 1174#endif
1157 1175
1158#ifdef CONFIG_PCIEPORTBUS 1176#ifdef CONFIG_PCIEPORTBUS
@@ -1167,8 +1185,8 @@ extern bool pcie_ports_auto;
1167static inline int pcie_aspm_enabled(void) { return 0; } 1185static inline int pcie_aspm_enabled(void) { return 0; }
1168static inline bool pcie_aspm_support_enabled(void) { return false; } 1186static inline bool pcie_aspm_support_enabled(void) { return false; }
1169#else 1187#else
1170extern int pcie_aspm_enabled(void); 1188int pcie_aspm_enabled(void);
1171extern bool pcie_aspm_support_enabled(void); 1189bool pcie_aspm_support_enabled(void);
1172#endif 1190#endif
1173 1191
1174#ifdef CONFIG_PCIEAER 1192#ifdef CONFIG_PCIEAER
@@ -1186,8 +1204,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1186} 1204}
1187static inline void pcie_ecrc_get_policy(char *str) {}; 1205static inline void pcie_ecrc_get_policy(char *str) {};
1188#else 1206#else
1189extern void pcie_set_ecrc_checking(struct pci_dev *dev); 1207void pcie_set_ecrc_checking(struct pci_dev *dev);
1190extern void pcie_ecrc_get_policy(char *str); 1208void pcie_ecrc_get_policy(char *str);
1191#endif 1209#endif
1192 1210
1193#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1211#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1198,9 +1216,9 @@ int ht_create_irq(struct pci_dev *dev, int idx);
1198void ht_destroy_irq(unsigned int irq); 1216void ht_destroy_irq(unsigned int irq);
1199#endif /* CONFIG_HT_IRQ */ 1217#endif /* CONFIG_HT_IRQ */
1200 1218
1201extern void pci_cfg_access_lock(struct pci_dev *dev); 1219void pci_cfg_access_lock(struct pci_dev *dev);
1202extern bool pci_cfg_access_trylock(struct pci_dev *dev); 1220bool pci_cfg_access_trylock(struct pci_dev *dev);
1203extern void pci_cfg_access_unlock(struct pci_dev *dev); 1221void pci_cfg_access_unlock(struct pci_dev *dev);
1204 1222
1205/* 1223/*
1206 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 1224 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
@@ -1225,7 +1243,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)
1225/* some architectures require additional setup to direct VGA traffic */ 1243/* some architectures require additional setup to direct VGA traffic */
1226typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, 1244typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,
1227 unsigned int command_bits, u32 flags); 1245 unsigned int command_bits, u32 flags);
1228extern void pci_register_set_vga_state(arch_set_vga_state_t func); 1246void pci_register_set_vga_state(arch_set_vga_state_t func);
1229 1247
1230#else /* CONFIG_PCI is not enabled */ 1248#else /* CONFIG_PCI is not enabled */
1231 1249
@@ -1627,8 +1645,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1627int pcibios_add_device(struct pci_dev *dev); 1645int pcibios_add_device(struct pci_dev *dev);
1628 1646
1629#ifdef CONFIG_PCI_MMCONFIG 1647#ifdef CONFIG_PCI_MMCONFIG
1630extern void __init pci_mmcfg_early_init(void); 1648void __init pci_mmcfg_early_init(void);
1631extern void __init pci_mmcfg_late_init(void); 1649void __init pci_mmcfg_late_init(void);
1632#else 1650#else
1633static inline void pci_mmcfg_early_init(void) { } 1651static inline void pci_mmcfg_early_init(void) { }
1634static inline void pci_mmcfg_late_init(void) { } 1652static inline void pci_mmcfg_late_init(void) { }
@@ -1639,12 +1657,12 @@ int pci_ext_cfg_avail(void);
1639void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1657void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1640 1658
1641#ifdef CONFIG_PCI_IOV 1659#ifdef CONFIG_PCI_IOV
1642extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1660int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1643extern void pci_disable_sriov(struct pci_dev *dev); 1661void pci_disable_sriov(struct pci_dev *dev);
1644extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1662irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1645extern int pci_num_vf(struct pci_dev *dev); 1663int pci_num_vf(struct pci_dev *dev);
1646extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); 1664int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1647extern int pci_sriov_get_totalvfs(struct pci_dev *dev); 1665int pci_sriov_get_totalvfs(struct pci_dev *dev);
1648#else 1666#else
1649static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1667static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1650{ 1668{
@@ -1672,8 +1690,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1672#endif 1690#endif
1673 1691
1674#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1692#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1675extern void pci_hp_create_module_link(struct pci_slot *pci_slot); 1693void pci_hp_create_module_link(struct pci_slot *pci_slot);
1676extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1694void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1677#endif 1695#endif
1678 1696
1679/** 1697/**
@@ -1817,13 +1835,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1817/* PCI <-> OF binding helpers */ 1835/* PCI <-> OF binding helpers */
1818#ifdef CONFIG_OF 1836#ifdef CONFIG_OF
1819struct device_node; 1837struct device_node;
1820extern void pci_set_of_node(struct pci_dev *dev); 1838void pci_set_of_node(struct pci_dev *dev);
1821extern void pci_release_of_node(struct pci_dev *dev); 1839void pci_release_of_node(struct pci_dev *dev);
1822extern void pci_set_bus_of_node(struct pci_bus *bus); 1840void pci_set_bus_of_node(struct pci_bus *bus);
1823extern void pci_release_bus_of_node(struct pci_bus *bus); 1841void pci_release_bus_of_node(struct pci_bus *bus);
1824 1842
1825/* Arch may override this (weak) */ 1843/* Arch may override this (weak) */
1826extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); 1844struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
1827 1845
1828static inline struct device_node * 1846static inline struct device_node *
1829pci_device_to_OF_node(const struct pci_dev *pdev) 1847pci_device_to_OF_node(const struct pci_dev *pdev)
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 45fc162cbdc0..8db71dcd6337 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -125,12 +125,12 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)
125 return pci_slot_name(slot->pci_slot); 125 return pci_slot_name(slot->pci_slot);
126} 126}
127 127
128extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, 128int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, int nr,
129 int nr, const char *name, 129 const char *name, struct module *owner,
130 struct module *owner, const char *mod_name); 130 const char *mod_name);
131extern int pci_hp_deregister(struct hotplug_slot *slot); 131int pci_hp_deregister(struct hotplug_slot *slot);
132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 132int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot,
133 struct hotplug_slot_info *info); 133 struct hotplug_slot_info *info);
134 134
135/* use a define to avoid include chaining to get THIS_MODULE & friends */ 135/* use a define to avoid include chaining to get THIS_MODULE & friends */
136#define pci_hp_register(slot, pbus, devnr, name) \ 136#define pci_hp_register(slot, pbus, devnr, name) \
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f11c1c2609d5..a80f9e6ce9e5 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1604,6 +1604,7 @@
1604#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 1604#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334
1605 1605
1606#define PCI_VENDOR_ID_MARVELL 0x11ab 1606#define PCI_VENDOR_ID_MARVELL 0x11ab
1607#define PCI_VENDOR_ID_MARVELL_EXT 0x1b4b
1607#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 1608#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146
1608#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 1609#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
1609#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 1610#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h
index e6f91b1406d8..9572669eea97 100644
--- a/include/linux/pcieport_if.h
+++ b/include/linux/pcieport_if.h
@@ -62,7 +62,7 @@ struct pcie_port_service_driver {
62#define to_service_driver(d) \ 62#define to_service_driver(d) \
63 container_of(d, struct pcie_port_service_driver, driver) 63 container_of(d, struct pcie_port_service_driver, driver)
64 64
65extern int pcie_port_service_register(struct pcie_port_service_driver *new); 65int pcie_port_service_register(struct pcie_port_service_driver *new);
66extern void pcie_port_service_unregister(struct pcie_port_service_driver *new); 66void pcie_port_service_unregister(struct pcie_port_service_driver *new);
67 67
68#endif /* _PCIEPORT_IF_H_ */ 68#endif /* _PCIEPORT_IF_H_ */
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h
index e7a720104a47..1ad4f31ef6b8 100644
--- a/include/linux/pinctrl/pinconf.h
+++ b/include/linux/pinctrl/pinconf.h
@@ -14,6 +14,8 @@
14 14
15#ifdef CONFIG_PINCONF 15#ifdef CONFIG_PINCONF
16 16
17#include <linux/pinctrl/machine.h>
18
17struct pinctrl_dev; 19struct pinctrl_dev;
18struct seq_file; 20struct seq_file;
19 21
@@ -28,6 +30,7 @@ struct seq_file;
28 * @pin_config_set: configure an individual pin 30 * @pin_config_set: configure an individual pin
29 * @pin_config_group_get: get configurations for an entire pin group 31 * @pin_config_group_get: get configurations for an entire pin group
30 * @pin_config_group_set: configure all pins in a group 32 * @pin_config_group_set: configure all pins in a group
33 * @pin_config_group_dbg_set: optional debugfs to modify a pin configuration
31 * @pin_config_dbg_show: optional debugfs display hook that will provide 34 * @pin_config_dbg_show: optional debugfs display hook that will provide
32 * per-device info for a certain pin in debugfs 35 * per-device info for a certain pin in debugfs
33 * @pin_config_group_dbg_show: optional debugfs display hook that will provide 36 * @pin_config_group_dbg_show: optional debugfs display hook that will provide
@@ -51,6 +54,9 @@ struct pinconf_ops {
51 int (*pin_config_group_set) (struct pinctrl_dev *pctldev, 54 int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
52 unsigned selector, 55 unsigned selector,
53 unsigned long config); 56 unsigned long config);
57 int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev,
58 const char *arg,
59 unsigned long *config);
54 void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev, 60 void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,
55 struct seq_file *s, 61 struct seq_file *s,
56 unsigned offset); 62 unsigned offset);
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 778804df293f..2c2a9e8d8578 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -118,9 +118,9 @@ struct pinctrl_desc {
118 const char *name; 118 const char *name;
119 struct pinctrl_pin_desc const *pins; 119 struct pinctrl_pin_desc const *pins;
120 unsigned int npins; 120 unsigned int npins;
121 struct pinctrl_ops *pctlops; 121 const struct pinctrl_ops *pctlops;
122 struct pinmux_ops *pmxops; 122 const struct pinmux_ops *pmxops;
123 struct pinconf_ops *confops; 123 const struct pinconf_ops *confops;
124 struct module *owner; 124 struct module *owner;
125}; 125};
126 126
diff --git a/include/linux/platform_data/dwc3-omap.h b/include/linux/platform_data/dwc3-omap.h
index ada401244e0b..1d36ca874cc8 100644
--- a/include/linux/platform_data/dwc3-omap.h
+++ b/include/linux/platform_data/dwc3-omap.h
@@ -41,7 +41,3 @@ enum dwc3_omap_utmi_mode {
41 DWC3_OMAP_UTMI_MODE_HW, 41 DWC3_OMAP_UTMI_MODE_HW,
42 DWC3_OMAP_UTMI_MODE_SW, 42 DWC3_OMAP_UTMI_MODE_SW,
43}; 43};
44
45struct dwc3_omap_data {
46 enum dwc3_omap_utmi_mode utmi_mode;
47};
diff --git a/include/linux/platform_data/emif_plat.h b/include/linux/platform_data/emif_plat.h
index 03378ca84061..5c19a2a647c4 100644
--- a/include/linux/platform_data/emif_plat.h
+++ b/include/linux/platform_data/emif_plat.h
@@ -40,6 +40,7 @@
40/* Custom config requests */ 40/* Custom config requests */
41#define EMIF_CUSTOM_CONFIG_LPMODE 0x00000001 41#define EMIF_CUSTOM_CONFIG_LPMODE 0x00000001
42#define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002 42#define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002
43#define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART 0x00000004
43 44
44#ifndef __ASSEMBLY__ 45#ifndef __ASSEMBLY__
45/** 46/**
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
index 944b01dd103e..98b7925f1a2d 100644
--- a/include/linux/platform_data/mv_usb.h
+++ b/include/linux/platform_data/mv_usb.h
@@ -34,8 +34,6 @@ struct mv_usb_addon_irq {
34}; 34};
35 35
36struct mv_usb_platform_data { 36struct mv_usb_platform_data {
37 unsigned int clknum;
38 char **clkname;
39 struct mv_usb_addon_irq *id; /* Only valid for OTG. ID pin change*/ 37 struct mv_usb_addon_irq *id; /* Only valid for OTG. ID pin change*/
40 struct mv_usb_addon_irq *vbus; /* valid for OTG/UDC. VBUS change*/ 38 struct mv_usb_addon_irq *vbus; /* valid for OTG/UDC. VBUS change*/
41 39
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
index 88734e871e3a..c7285b575462 100644
--- a/include/linux/platform_data/ntc_thermistor.h
+++ b/include/linux/platform_data/ntc_thermistor.h
@@ -21,6 +21,8 @@
21#ifndef _LINUX_NTC_H 21#ifndef _LINUX_NTC_H
22#define _LINUX_NTC_H 22#define _LINUX_NTC_H
23 23
24struct iio_channel;
25
24enum ntc_thermistor_type { 26enum ntc_thermistor_type {
25 TYPE_NCPXXWB473, 27 TYPE_NCPXXWB473,
26 TYPE_NCPXXWL333, 28 TYPE_NCPXXWL333,
@@ -39,13 +41,17 @@ struct ntc_thermistor_platform_data {
39 * described at Documentation/hwmon/ntc_thermistor 41 * described at Documentation/hwmon/ntc_thermistor
40 * 42 *
41 * pullup/down_ohm: 0 for infinite / not-connected 43 * pullup/down_ohm: 0 for infinite / not-connected
44 *
45 * chan: iio_channel pointer to communicate with the ADC which the
46 * thermistor is using for conversion of the analog values.
42 */ 47 */
43 int (*read_uV)(void); 48 int (*read_uv)(struct ntc_thermistor_platform_data *);
44 unsigned int pullup_uV; 49 unsigned int pullup_uv;
45 50
46 unsigned int pullup_ohm; 51 unsigned int pullup_ohm;
47 unsigned int pulldown_ohm; 52 unsigned int pulldown_ohm;
48 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; 53 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
54 struct iio_channel *chan;
49 55
50 int (*read_ohm)(void); 56 int (*read_ohm)(void);
51}; 57};
diff --git a/include/linux/platform_data/serial-sccnxp.h b/include/linux/platform_data/serial-sccnxp.h
index 215574d1e81d..bdc510d03245 100644
--- a/include/linux/platform_data/serial-sccnxp.h
+++ b/include/linux/platform_data/serial-sccnxp.h
@@ -86,10 +86,6 @@ struct sccnxp_pdata {
86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; 86 const u32 mctrl_cfg[SCCNXP_MAX_UARTS];
87 /* Timer value for polling mode (usecs) */ 87 /* Timer value for polling mode (usecs) */
88 const unsigned int poll_time_us; 88 const unsigned int poll_time_us;
89 /* Called during startup */
90 void (*init)(void);
91 /* Called before finish */
92 void (*exit)(void);
93}; 89};
94 90
95#endif 91#endif
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h
index ceba18d23a5a..8447f634c7f5 100644
--- a/include/linux/platform_data/spi-s3c64xx.h
+++ b/include/linux/platform_data/spi-s3c64xx.h
@@ -11,6 +11,8 @@
11#ifndef __S3C64XX_PLAT_SPI_H 11#ifndef __S3C64XX_PLAT_SPI_H
12#define __S3C64XX_PLAT_SPI_H 12#define __S3C64XX_PLAT_SPI_H
13 13
14#include <linux/dmaengine.h>
15
14struct platform_device; 16struct platform_device;
15 17
16/** 18/**
@@ -38,6 +40,7 @@ struct s3c64xx_spi_info {
38 int src_clk_nr; 40 int src_clk_nr;
39 int num_cs; 41 int num_cs;
40 int (*cfg_gpio)(void); 42 int (*cfg_gpio)(void);
43 dma_filter_fn filter;
41}; 44};
42 45
43/** 46/**
diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h
deleted file mode 100644
index 7f399c370fe0..000000000000
--- a/include/linux/platform_data/video-vt8500lcdfb.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * VT8500/WM8505 Frame Buffer platform data definitions
3 *
4 * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _VT8500FB_H
17#define _VT8500FB_H
18
19#include <linux/fb.h>
20
21struct vt8500fb_platform_data {
22 struct fb_videomode mode;
23 u32 xres_virtual;
24 u32 yres_virtual;
25 u32 bpp;
26 unsigned long video_mem_phys;
27 void *video_mem_virt;
28 unsigned long video_mem_len;
29};
30
31#endif /* _VT8500FB_H */
diff --git a/include/linux/platform_data/video_s3c.h b/include/linux/platform_data/video_s3c.h
new file mode 100644
index 000000000000..48883995f47f
--- /dev/null
+++ b/include/linux/platform_data/video_s3c.h
@@ -0,0 +1,54 @@
1#ifndef __PLATFORM_DATA_VIDEO_S3C
2#define __PLATFORM_DATA_VIDEO_S3C
3
4/* S3C_FB_MAX_WIN
5 * Set to the maximum number of windows that any of the supported hardware
6 * can use. Since the platform data uses this for an array size, having it
7 * set to the maximum of any version of the hardware can do is safe.
8 */
9#define S3C_FB_MAX_WIN (5)
10
11/**
12 * struct s3c_fb_pd_win - per window setup data
13 * @xres : The window X size.
14 * @yres : The window Y size.
15 * @virtual_x: The virtual X size.
16 * @virtual_y: The virtual Y size.
17 */
18struct s3c_fb_pd_win {
19 unsigned short default_bpp;
20 unsigned short max_bpp;
21 unsigned short xres;
22 unsigned short yres;
23 unsigned short virtual_x;
24 unsigned short virtual_y;
25};
26
27/**
28 * struct s3c_fb_platdata - S3C driver platform specific information
29 * @setup_gpio: Setup the external GPIO pins to the right state to transfer
30 * the data from the display system to the connected display
31 * device.
32 * @vidcon0: The base vidcon0 values to control the panel data format.
33 * @vidcon1: The base vidcon1 values to control the panel data output.
34 * @vtiming: Video timing when connected to a RGB type panel.
35 * @win: The setup data for each hardware window, or NULL for unused.
36 * @display_mode: The LCD output display mode.
37 *
38 * The platform data supplies the video driver with all the information
39 * it requires to work with the display(s) attached to the machine. It
40 * controls the initial mode, the number of display windows (0 is always
41 * the base framebuffer) that are initialised etc.
42 *
43 */
44struct s3c_fb_platdata {
45 void (*setup_gpio)(void);
46
47 struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN];
48 struct fb_videomode *vtiming;
49
50 u32 vidcon0;
51 u32 vidcon1;
52};
53
54#endif
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index c082c71f7225..9abf1db6aea6 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -20,12 +20,12 @@
20struct mfd_cell; 20struct mfd_cell;
21 21
22struct platform_device { 22struct platform_device {
23 const char * name; 23 const char *name;
24 int id; 24 int id;
25 bool id_auto; 25 bool id_auto;
26 struct device dev; 26 struct device dev;
27 u32 num_resources; 27 u32 num_resources;
28 struct resource * resource; 28 struct resource *resource;
29 29
30 const struct platform_device_id *id_entry; 30 const struct platform_device_id *id_entry;
31 31
@@ -47,9 +47,12 @@ extern struct bus_type platform_bus_type;
47extern struct device platform_bus; 47extern struct device platform_bus;
48 48
49extern void arch_setup_pdev_archdata(struct platform_device *); 49extern void arch_setup_pdev_archdata(struct platform_device *);
50extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); 50extern struct resource *platform_get_resource(struct platform_device *,
51 unsigned int, unsigned int);
51extern int platform_get_irq(struct platform_device *, unsigned int); 52extern int platform_get_irq(struct platform_device *, unsigned int);
52extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); 53extern struct resource *platform_get_resource_byname(struct platform_device *,
54 unsigned int,
55 const char *);
53extern int platform_get_irq_byname(struct platform_device *, const char *); 56extern int platform_get_irq_byname(struct platform_device *, const char *);
54extern int platform_add_devices(struct platform_device **, int); 57extern int platform_add_devices(struct platform_device **, int);
55 58
@@ -161,7 +164,8 @@ extern struct platform_device *platform_device_alloc(const char *name, int id);
161extern int platform_device_add_resources(struct platform_device *pdev, 164extern int platform_device_add_resources(struct platform_device *pdev,
162 const struct resource *res, 165 const struct resource *res,
163 unsigned int num); 166 unsigned int num);
164extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); 167extern int platform_device_add_data(struct platform_device *pdev,
168 const void *data, size_t size);
165extern int platform_device_add(struct platform_device *pdev); 169extern int platform_device_add(struct platform_device *pdev);
166extern void platform_device_del(struct platform_device *pdev); 170extern void platform_device_del(struct platform_device *pdev);
167extern void platform_device_put(struct platform_device *pdev); 171extern void platform_device_put(struct platform_device *pdev);
@@ -190,7 +194,8 @@ static inline void *platform_get_drvdata(const struct platform_device *pdev)
190 return dev_get_drvdata(&pdev->dev); 194 return dev_get_drvdata(&pdev->dev);
191} 195}
192 196
193static inline void platform_set_drvdata(struct platform_device *pdev, void *data) 197static inline void platform_set_drvdata(struct platform_device *pdev,
198 void *data)
194{ 199{
195 dev_set_drvdata(&pdev->dev, data); 200 dev_set_drvdata(&pdev->dev, data);
196} 201}
@@ -222,10 +227,10 @@ static void __exit __platform_driver##_exit(void) \
222} \ 227} \
223module_exit(__platform_driver##_exit); 228module_exit(__platform_driver##_exit);
224 229
225extern struct platform_device *platform_create_bundle(struct platform_driver *driver, 230extern struct platform_device *platform_create_bundle(
226 int (*probe)(struct platform_device *), 231 struct platform_driver *driver, int (*probe)(struct platform_device *),
227 struct resource *res, unsigned int n_res, 232 struct resource *res, unsigned int n_res,
228 const void *data, size_t size); 233 const void *data, size_t size);
229 234
230/* early platform driver interface */ 235/* early platform driver interface */
231struct early_platform_driver { 236struct early_platform_driver {
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 5a710b9c578e..87a03c746f17 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -93,14 +93,20 @@ do { \
93 93
94#else /* !CONFIG_PREEMPT_COUNT */ 94#else /* !CONFIG_PREEMPT_COUNT */
95 95
96#define preempt_disable() do { } while (0) 96/*
97#define sched_preempt_enable_no_resched() do { } while (0) 97 * Even if we don't have any preemption, we need preempt disable/enable
98#define preempt_enable_no_resched() do { } while (0) 98 * to be barriers, so that we don't have things like get_user/put_user
99#define preempt_enable() do { } while (0) 99 * that can cause faults and scheduling migrate into our preempt-protected
100 100 * region.
101#define preempt_disable_notrace() do { } while (0) 101 */
102#define preempt_enable_no_resched_notrace() do { } while (0) 102#define preempt_disable() barrier()
103#define preempt_enable_notrace() do { } while (0) 103#define sched_preempt_enable_no_resched() barrier()
104#define preempt_enable_no_resched() barrier()
105#define preempt_enable() barrier()
106
107#define preempt_disable_notrace() barrier()
108#define preempt_enable_no_resched_notrace() barrier()
109#define preempt_enable_notrace() barrier()
104 110
105#endif /* CONFIG_PREEMPT_COUNT */ 111#endif /* CONFIG_PREEMPT_COUNT */
106 112
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 1249a54d17e0..822171fcb1c8 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -134,6 +134,8 @@ extern int printk_delay_msec;
134extern int dmesg_restrict; 134extern int dmesg_restrict;
135extern int kptr_restrict; 135extern int kptr_restrict;
136 136
137extern void wake_up_klogd(void);
138
137void log_buf_kexec_setup(void); 139void log_buf_kexec_setup(void);
138void __init setup_log_buf(int early); 140void __init setup_log_buf(int early);
139#else 141#else
@@ -162,6 +164,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,
162 return false; 164 return false;
163} 165}
164 166
167static inline void wake_up_klogd(void)
168{
169}
170
165static inline void log_buf_kexec_setup(void) 171static inline void log_buf_kexec_setup(void)
166{ 172{
167} 173}
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 8307f2f94d86..94dfb2aa5533 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -117,6 +117,7 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
117 const struct file_operations *proc_fops, 117 const struct file_operations *proc_fops,
118 void *data); 118 void *data);
119extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); 119extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
120extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent);
120 121
121struct pid_namespace; 122struct pid_namespace;
122 123
@@ -202,6 +203,7 @@ static inline struct proc_dir_entry *proc_create_data(const char *name,
202 return NULL; 203 return NULL;
203} 204}
204#define remove_proc_entry(name, parent) do {} while (0) 205#define remove_proc_entry(name, parent) do {} while (0)
206#define remove_proc_subtree(name, parent) do {} while (0)
205 207
206static inline struct proc_dir_entry *proc_symlink(const char *name, 208static inline struct proc_dir_entry *proc_symlink(const char *name,
207 struct proc_dir_entry *parent,const char *dest) {return NULL;} 209 struct proc_dir_entry *parent,const char *dest) {return NULL;}
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index bf77dfdabef9..02d84e24b7c2 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -389,6 +389,7 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg,
389 bool *change); 389 bool *change);
390int regmap_get_val_bytes(struct regmap *map); 390int regmap_get_val_bytes(struct regmap *map);
391int regmap_async_complete(struct regmap *map); 391int regmap_async_complete(struct regmap *map);
392bool regmap_can_raw_write(struct regmap *map);
392 393
393int regcache_sync(struct regmap *map); 394int regcache_sync(struct regmap *map);
394int regcache_sync_region(struct regmap *map, unsigned int min, 395int regcache_sync_region(struct regmap *map, unsigned int min,
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index 7bd73bbdfd1b..7c5ff0c55773 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -5,11 +5,14 @@
5 * 5 *
6 * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson 6 * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson
7 * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson 7 * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson
8 * Daniel Willerud <daniel.willerud@stericsson.com> for ST-Ericsson
8 */ 9 */
9 10
10#ifndef __LINUX_MFD_AB8500_REGULATOR_H 11#ifndef __LINUX_MFD_AB8500_REGULATOR_H
11#define __LINUX_MFD_AB8500_REGULATOR_H 12#define __LINUX_MFD_AB8500_REGULATOR_H
12 13
14#include <linux/platform_device.h>
15
13/* AB8500 regulators */ 16/* AB8500 regulators */
14enum ab8500_regulator_id { 17enum ab8500_regulator_id {
15 AB8500_LDO_AUX1, 18 AB8500_LDO_AUX1,
@@ -17,7 +20,6 @@ enum ab8500_regulator_id {
17 AB8500_LDO_AUX3, 20 AB8500_LDO_AUX3,
18 AB8500_LDO_INTCORE, 21 AB8500_LDO_INTCORE,
19 AB8500_LDO_TVOUT, 22 AB8500_LDO_TVOUT,
20 AB8500_LDO_USB,
21 AB8500_LDO_AUDIO, 23 AB8500_LDO_AUDIO,
22 AB8500_LDO_ANAMIC1, 24 AB8500_LDO_ANAMIC1,
23 AB8500_LDO_ANAMIC2, 25 AB8500_LDO_ANAMIC2,
@@ -26,7 +28,28 @@ enum ab8500_regulator_id {
26 AB8500_NUM_REGULATORS, 28 AB8500_NUM_REGULATORS,
27}; 29};
28 30
29/* AB9450 regulators */ 31/* AB8505 regulators */
32enum ab8505_regulator_id {
33 AB8505_LDO_AUX1,
34 AB8505_LDO_AUX2,
35 AB8505_LDO_AUX3,
36 AB8505_LDO_AUX4,
37 AB8505_LDO_AUX5,
38 AB8505_LDO_AUX6,
39 AB8505_LDO_INTCORE,
40 AB8505_LDO_ADC,
41 AB8505_LDO_USB,
42 AB8505_LDO_AUDIO,
43 AB8505_LDO_ANAMIC1,
44 AB8505_LDO_ANAMIC2,
45 AB8505_LDO_AUX8,
46 AB8505_LDO_ANA,
47 AB8505_SYSCLKREQ_2,
48 AB8505_SYSCLKREQ_4,
49 AB8505_NUM_REGULATORS,
50};
51
52/* AB9540 regulators */
30enum ab9540_regulator_id { 53enum ab9540_regulator_id {
31 AB9540_LDO_AUX1, 54 AB9540_LDO_AUX1,
32 AB9540_LDO_AUX2, 55 AB9540_LDO_AUX2,
@@ -45,16 +68,39 @@ enum ab9540_regulator_id {
45 AB9540_NUM_REGULATORS, 68 AB9540_NUM_REGULATORS,
46}; 69};
47 70
48/* AB8500 and AB9540 register initialization */ 71/* AB8540 regulators */
72enum ab8540_regulator_id {
73 AB8540_LDO_AUX1,
74 AB8540_LDO_AUX2,
75 AB8540_LDO_AUX3,
76 AB8540_LDO_AUX4,
77 AB8540_LDO_AUX5,
78 AB8540_LDO_AUX6,
79 AB8540_LDO_INTCORE,
80 AB8540_LDO_TVOUT,
81 AB8540_LDO_AUDIO,
82 AB8540_LDO_ANAMIC1,
83 AB8540_LDO_ANAMIC2,
84 AB8540_LDO_DMIC,
85 AB8540_LDO_ANA,
86 AB8540_LDO_SDIO,
87 AB8540_SYSCLKREQ_2,
88 AB8540_SYSCLKREQ_4,
89 AB8540_NUM_REGULATORS,
90};
91
92/* AB8500, AB8505, and AB9540 register initialization */
49struct ab8500_regulator_reg_init { 93struct ab8500_regulator_reg_init {
50 int id; 94 int id;
95 u8 mask;
51 u8 value; 96 u8 value;
52}; 97};
53 98
54#define INIT_REGULATOR_REGISTER(_id, _value) \ 99#define INIT_REGULATOR_REGISTER(_id, _mask, _value) \
55 { \ 100 { \
56 .id = _id, \ 101 .id = _id, \
57 .value = _value, \ 102 .mask = _mask, \
103 .value = _value, \
58 } 104 }
59 105
60/* AB8500 registers */ 106/* AB8500 registers */
@@ -86,10 +132,58 @@ enum ab8500_regulator_reg {
86 AB8500_REGUCTRL2SPARE, 132 AB8500_REGUCTRL2SPARE,
87 AB8500_REGUCTRLDISCH, 133 AB8500_REGUCTRLDISCH,
88 AB8500_REGUCTRLDISCH2, 134 AB8500_REGUCTRLDISCH2,
89 AB8500_VSMPS1SEL1,
90 AB8500_NUM_REGULATOR_REGISTERS, 135 AB8500_NUM_REGULATOR_REGISTERS,
91}; 136};
92 137
138/* AB8505 registers */
139enum ab8505_regulator_reg {
140 AB8505_REGUREQUESTCTRL1,
141 AB8505_REGUREQUESTCTRL2,
142 AB8505_REGUREQUESTCTRL3,
143 AB8505_REGUREQUESTCTRL4,
144 AB8505_REGUSYSCLKREQ1HPVALID1,
145 AB8505_REGUSYSCLKREQ1HPVALID2,
146 AB8505_REGUHWHPREQ1VALID1,
147 AB8505_REGUHWHPREQ1VALID2,
148 AB8505_REGUHWHPREQ2VALID1,
149 AB8505_REGUHWHPREQ2VALID2,
150 AB8505_REGUSWHPREQVALID1,
151 AB8505_REGUSWHPREQVALID2,
152 AB8505_REGUSYSCLKREQVALID1,
153 AB8505_REGUSYSCLKREQVALID2,
154 AB8505_REGUVAUX4REQVALID,
155 AB8505_REGUMISC1,
156 AB8505_VAUDIOSUPPLY,
157 AB8505_REGUCTRL1VAMIC,
158 AB8505_VSMPSAREGU,
159 AB8505_VSMPSBREGU,
160 AB8505_VSAFEREGU, /* NOTE! PRCMU register */
161 AB8505_VPLLVANAREGU,
162 AB8505_EXTSUPPLYREGU,
163 AB8505_VAUX12REGU,
164 AB8505_VRF1VAUX3REGU,
165 AB8505_VSMPSASEL1,
166 AB8505_VSMPSASEL2,
167 AB8505_VSMPSASEL3,
168 AB8505_VSMPSBSEL1,
169 AB8505_VSMPSBSEL2,
170 AB8505_VSMPSBSEL3,
171 AB8505_VSAFESEL1, /* NOTE! PRCMU register */
172 AB8505_VSAFESEL2, /* NOTE! PRCMU register */
173 AB8505_VSAFESEL3, /* NOTE! PRCMU register */
174 AB8505_VAUX1SEL,
175 AB8505_VAUX2SEL,
176 AB8505_VRF1VAUX3SEL,
177 AB8505_VAUX4REQCTRL,
178 AB8505_VAUX4REGU,
179 AB8505_VAUX4SEL,
180 AB8505_REGUCTRLDISCH,
181 AB8505_REGUCTRLDISCH2,
182 AB8505_REGUCTRLDISCH3,
183 AB8505_CTRLVAUX5,
184 AB8505_CTRLVAUX6,
185 AB8505_NUM_REGULATOR_REGISTERS,
186};
93 187
94/* AB9540 registers */ 188/* AB9540 registers */
95enum ab9540_regulator_reg { 189enum ab9540_regulator_reg {
@@ -139,4 +233,111 @@ enum ab9540_regulator_reg {
139 AB9540_NUM_REGULATOR_REGISTERS, 233 AB9540_NUM_REGULATOR_REGISTERS,
140}; 234};
141 235
236/* AB8540 registers */
237enum ab8540_regulator_reg {
238 AB8540_REGUREQUESTCTRL1,
239 AB8540_REGUREQUESTCTRL2,
240 AB8540_REGUREQUESTCTRL3,
241 AB8540_REGUREQUESTCTRL4,
242 AB8540_REGUSYSCLKREQ1HPVALID1,
243 AB8540_REGUSYSCLKREQ1HPVALID2,
244 AB8540_REGUHWHPREQ1VALID1,
245 AB8540_REGUHWHPREQ1VALID2,
246 AB8540_REGUHWHPREQ2VALID1,
247 AB8540_REGUHWHPREQ2VALID2,
248 AB8540_REGUSWHPREQVALID1,
249 AB8540_REGUSWHPREQVALID2,
250 AB8540_REGUSYSCLKREQVALID1,
251 AB8540_REGUSYSCLKREQVALID2,
252 AB8540_REGUVAUX4REQVALID,
253 AB8540_REGUVAUX5REQVALID,
254 AB8540_REGUVAUX6REQVALID,
255 AB8540_REGUVCLKBREQVALID,
256 AB8540_REGUVRF1REQVALID,
257 AB8540_REGUMISC1,
258 AB8540_VAUDIOSUPPLY,
259 AB8540_REGUCTRL1VAMIC,
260 AB8540_VHSIC,
261 AB8540_VSDIO,
262 AB8540_VSMPS1REGU,
263 AB8540_VSMPS2REGU,
264 AB8540_VSMPS3REGU,
265 AB8540_VPLLVANAREGU,
266 AB8540_EXTSUPPLYREGU,
267 AB8540_VAUX12REGU,
268 AB8540_VRF1VAUX3REGU,
269 AB8540_VSMPS1SEL1,
270 AB8540_VSMPS1SEL2,
271 AB8540_VSMPS1SEL3,
272 AB8540_VSMPS2SEL1,
273 AB8540_VSMPS2SEL2,
274 AB8540_VSMPS2SEL3,
275 AB8540_VSMPS3SEL1,
276 AB8540_VSMPS3SEL2,
277 AB8540_VAUX1SEL,
278 AB8540_VAUX2SEL,
279 AB8540_VRF1VAUX3SEL,
280 AB8540_REGUCTRL2SPARE,
281 AB8540_VAUX4REQCTRL,
282 AB8540_VAUX4REGU,
283 AB8540_VAUX4SEL,
284 AB8540_VAUX5REQCTRL,
285 AB8540_VAUX5REGU,
286 AB8540_VAUX5SEL,
287 AB8540_VAUX6REQCTRL,
288 AB8540_VAUX6REGU,
289 AB8540_VAUX6SEL,
290 AB8540_VCLKBREQCTRL,
291 AB8540_VCLKBREGU,
292 AB8540_VCLKBSEL,
293 AB8540_VRF1REQCTRL,
294 AB8540_REGUCTRLDISCH,
295 AB8540_REGUCTRLDISCH2,
296 AB8540_REGUCTRLDISCH3,
297 AB8540_REGUCTRLDISCH4,
298 AB8540_VSIMSYSCLKCTRL,
299 AB8540_VANAVPLLSEL,
300 AB8540_NUM_REGULATOR_REGISTERS,
301};
302
303/* AB8500 external regulators */
304struct ab8500_ext_regulator_cfg {
305 bool hwreq; /* requires hw mode or high power mode */
306};
307
308enum ab8500_ext_regulator_id {
309 AB8500_EXT_SUPPLY1,
310 AB8500_EXT_SUPPLY2,
311 AB8500_EXT_SUPPLY3,
312 AB8500_NUM_EXT_REGULATORS,
313};
314
315/* AB8500 regulator platform data */
316struct ab8500_regulator_platform_data {
317 int num_reg_init;
318 struct ab8500_regulator_reg_init *reg_init;
319 int num_regulator;
320 struct regulator_init_data *regulator;
321 int num_ext_regulator;
322 struct regulator_init_data *ext_regulator;
323};
324
325#ifdef CONFIG_REGULATOR_AB8500_DEBUG
326int ab8500_regulator_debug_init(struct platform_device *pdev);
327int ab8500_regulator_debug_exit(struct platform_device *pdev);
328#else
329static inline int ab8500_regulator_debug_init(struct platform_device *pdev)
330{
331 return 0;
332}
333static inline int ab8500_regulator_debug_exit(struct platform_device *pdev)
334{
335 return 0;
336}
337#endif
338
339/* AB8500 external regulator functions. */
340int ab8500_ext_regulator_init(struct platform_device *pdev);
341void ab8500_ext_regulator_exit(struct platform_device *pdev);
342
142#endif 343#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 7bc732ce6e50..145022a83085 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -141,18 +141,18 @@ void regulator_put(struct regulator *regulator);
141void devm_regulator_put(struct regulator *regulator); 141void devm_regulator_put(struct regulator *regulator);
142 142
143/* regulator output control and status */ 143/* regulator output control and status */
144int regulator_enable(struct regulator *regulator); 144int __must_check regulator_enable(struct regulator *regulator);
145int regulator_disable(struct regulator *regulator); 145int regulator_disable(struct regulator *regulator);
146int regulator_force_disable(struct regulator *regulator); 146int regulator_force_disable(struct regulator *regulator);
147int regulator_is_enabled(struct regulator *regulator); 147int regulator_is_enabled(struct regulator *regulator);
148int regulator_disable_deferred(struct regulator *regulator, int ms); 148int regulator_disable_deferred(struct regulator *regulator, int ms);
149 149
150int regulator_bulk_get(struct device *dev, int num_consumers, 150int __must_check regulator_bulk_get(struct device *dev, int num_consumers,
151 struct regulator_bulk_data *consumers); 151 struct regulator_bulk_data *consumers);
152int devm_regulator_bulk_get(struct device *dev, int num_consumers, 152int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers,
153 struct regulator_bulk_data *consumers); 153 struct regulator_bulk_data *consumers);
154int regulator_bulk_enable(int num_consumers, 154int __must_check regulator_bulk_enable(int num_consumers,
155 struct regulator_bulk_data *consumers); 155 struct regulator_bulk_data *consumers);
156int regulator_bulk_disable(int num_consumers, 156int regulator_bulk_disable(int num_consumers,
157 struct regulator_bulk_data *consumers); 157 struct regulator_bulk_data *consumers);
158int regulator_bulk_force_disable(int num_consumers, 158int regulator_bulk_force_disable(int num_consumers,
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 7df93f52db08..6700cc94bdd1 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -22,6 +22,7 @@
22struct regmap; 22struct regmap;
23struct regulator_dev; 23struct regulator_dev;
24struct regulator_init_data; 24struct regulator_init_data;
25struct regulator_enable_gpio;
25 26
26enum regulator_status { 27enum regulator_status {
27 REGULATOR_STATUS_OFF, 28 REGULATOR_STATUS_OFF,
@@ -199,6 +200,8 @@ enum regulator_type {
199 * output when using regulator_set_voltage_sel_regmap 200 * output when using regulator_set_voltage_sel_regmap
200 * @enable_reg: Register for control when using regmap enable/disable ops 201 * @enable_reg: Register for control when using regmap enable/disable ops
201 * @enable_mask: Mask for control when using regmap enable/disable ops 202 * @enable_mask: Mask for control when using regmap enable/disable ops
203 * @enable_is_inverted: A flag to indicate set enable_mask bits to disable
204 * when using regulator_enable_regmap and friends APIs.
202 * @bypass_reg: Register for control when using regmap set_bypass 205 * @bypass_reg: Register for control when using regmap set_bypass
203 * @bypass_mask: Mask for control when using regmap set_bypass 206 * @bypass_mask: Mask for control when using regmap set_bypass
204 * 207 *
@@ -228,6 +231,7 @@ struct regulator_desc {
228 unsigned int apply_bit; 231 unsigned int apply_bit;
229 unsigned int enable_reg; 232 unsigned int enable_reg;
230 unsigned int enable_mask; 233 unsigned int enable_mask;
234 bool enable_is_inverted;
231 unsigned int bypass_reg; 235 unsigned int bypass_reg;
232 unsigned int bypass_mask; 236 unsigned int bypass_mask;
233 237
@@ -302,8 +306,7 @@ struct regulator_dev {
302 306
303 struct dentry *debugfs; 307 struct dentry *debugfs;
304 308
305 int ena_gpio; 309 struct regulator_enable_gpio *ena_pin;
306 unsigned int ena_gpio_invert:1;
307 unsigned int ena_gpio_state:1; 310 unsigned int ena_gpio_state:1;
308}; 311};
309 312
@@ -329,6 +332,8 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev,
329 int min_uV, int max_uV); 332 int min_uV, int max_uV);
330int regulator_map_voltage_iterate(struct regulator_dev *rdev, 333int regulator_map_voltage_iterate(struct regulator_dev *rdev,
331 int min_uV, int max_uV); 334 int min_uV, int max_uV);
335int regulator_map_voltage_ascend(struct regulator_dev *rdev,
336 int min_uV, int max_uV);
332int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev); 337int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev);
333int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel); 338int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel);
334int regulator_is_enabled_regmap(struct regulator_dev *rdev); 339int regulator_is_enabled_regmap(struct regulator_dev *rdev);
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h
index 45e42855ad05..4dbb63a1d4ab 100644
--- a/include/linux/regulator/max8952.h
+++ b/include/linux/regulator/max8952.h
@@ -122,13 +122,13 @@ struct max8952_platform_data {
122 int gpio_vid1; 122 int gpio_vid1;
123 int gpio_en; 123 int gpio_en;
124 124
125 u8 default_mode; 125 u32 default_mode;
126 u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ 126 u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
127 127
128 u8 sync_freq; 128 u32 sync_freq;
129 u8 ramp_speed; 129 u32 ramp_speed;
130 130
131 struct regulator_init_data reg_data; 131 struct regulator_init_data *reg_data;
132}; 132};
133 133
134 134
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 1342e69542f3..d69cf637a15a 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -4,6 +4,7 @@
4#include <linux/kmemcheck.h> 4#include <linux/kmemcheck.h>
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/seq_file.h> 6#include <linux/seq_file.h>
7#include <linux/poll.h>
7 8
8struct ring_buffer; 9struct ring_buffer;
9struct ring_buffer_iter; 10struct ring_buffer_iter;
@@ -96,6 +97,11 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k
96 __ring_buffer_alloc((size), (flags), &__key); \ 97 __ring_buffer_alloc((size), (flags), &__key); \
97}) 98})
98 99
100void ring_buffer_wait(struct ring_buffer *buffer, int cpu);
101int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
102 struct file *filp, poll_table *poll_table);
103
104
99#define RING_BUFFER_ALL_CPUS -1 105#define RING_BUFFER_ALL_CPUS -1
100 106
101void ring_buffer_free(struct ring_buffer *buffer); 107void ring_buffer_free(struct ring_buffer *buffer);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d35d2b6ddbfb..2d02c76a01be 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -163,9 +163,10 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
163#define TASK_DEAD 64 163#define TASK_DEAD 64
164#define TASK_WAKEKILL 128 164#define TASK_WAKEKILL 128
165#define TASK_WAKING 256 165#define TASK_WAKING 256
166#define TASK_STATE_MAX 512 166#define TASK_PARKED 512
167#define TASK_STATE_MAX 1024
167 168
168#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" 169#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP"
169 170
170extern char ___assert_task_state[1 - 2*!!( 171extern char ___assert_task_state[1 - 2*!!(
171 sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; 172 sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
@@ -320,7 +321,6 @@ extern signed long schedule_timeout_killable(signed long timeout);
320extern signed long schedule_timeout_uninterruptible(signed long timeout); 321extern signed long schedule_timeout_uninterruptible(signed long timeout);
321asmlinkage void schedule(void); 322asmlinkage void schedule(void);
322extern void schedule_preempt_disabled(void); 323extern void schedule_preempt_disabled(void);
323extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner);
324 324
325struct nsproxy; 325struct nsproxy;
326struct user_namespace; 326struct user_namespace;
diff --git a/include/linux/security.h b/include/linux/security.h
index eee7478cda70..032c366ef1c6 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1012,6 +1012,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1012 * This hook can be used by the module to update any security state 1012 * This hook can be used by the module to update any security state
1013 * associated with the TUN device's security structure. 1013 * associated with the TUN device's security structure.
1014 * @security pointer to the TUN devices's security structure. 1014 * @security pointer to the TUN devices's security structure.
1015 * @skb_owned_by:
1016 * This hook sets the packet's owning sock.
1017 * @skb is the packet.
1018 * @sk the sock which owns the packet.
1015 * 1019 *
1016 * Security hooks for XFRM operations. 1020 * Security hooks for XFRM operations.
1017 * 1021 *
@@ -1638,6 +1642,7 @@ struct security_operations {
1638 int (*tun_dev_attach_queue) (void *security); 1642 int (*tun_dev_attach_queue) (void *security);
1639 int (*tun_dev_attach) (struct sock *sk, void *security); 1643 int (*tun_dev_attach) (struct sock *sk, void *security);
1640 int (*tun_dev_open) (void *security); 1644 int (*tun_dev_open) (void *security);
1645 void (*skb_owned_by) (struct sk_buff *skb, struct sock *sk);
1641#endif /* CONFIG_SECURITY_NETWORK */ 1646#endif /* CONFIG_SECURITY_NETWORK */
1642 1647
1643#ifdef CONFIG_SECURITY_NETWORK_XFRM 1648#ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -2588,6 +2593,8 @@ int security_tun_dev_attach_queue(void *security);
2588int security_tun_dev_attach(struct sock *sk, void *security); 2593int security_tun_dev_attach(struct sock *sk, void *security);
2589int security_tun_dev_open(void *security); 2594int security_tun_dev_open(void *security);
2590 2595
2596void security_skb_owned_by(struct sk_buff *skb, struct sock *sk);
2597
2591#else /* CONFIG_SECURITY_NETWORK */ 2598#else /* CONFIG_SECURITY_NETWORK */
2592static inline int security_unix_stream_connect(struct sock *sock, 2599static inline int security_unix_stream_connect(struct sock *sock,
2593 struct sock *other, 2600 struct sock *other,
@@ -2779,6 +2786,11 @@ static inline int security_tun_dev_open(void *security)
2779{ 2786{
2780 return 0; 2787 return 0;
2781} 2788}
2789
2790static inline void security_skb_owned_by(struct sk_buff *skb, struct sock *sk)
2791{
2792}
2793
2782#endif /* CONFIG_SECURITY_NETWORK */ 2794#endif /* CONFIG_SECURITY_NETWORK */
2783 2795
2784#ifdef CONFIG_SECURITY_NETWORK_XFRM 2796#ifdef CONFIG_SECURITY_NETWORK_XFRM
diff --git a/include/linux/serial_s3c.h b/include/linux/serial_s3c.h
new file mode 100644
index 000000000000..907d9d1d56cf
--- /dev/null
+++ b/include/linux/serial_s3c.h
@@ -0,0 +1,260 @@
1/*
2 * Internal header file for Samsung S3C2410 serial ports (UART0-2)
3 *
4 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
5 *
6 * Additional defines, Copyright 2003 Simtec Electronics (linux@simtec.co.uk)
7 *
8 * Adapted from:
9 *
10 * Internal header file for MX1ADS serial ports (UART1 & 2)
11 *
12 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27*/
28
29#ifndef __ASM_ARM_REGS_SERIAL_H
30#define __ASM_ARM_REGS_SERIAL_H
31
32#define S3C2410_URXH (0x24)
33#define S3C2410_UTXH (0x20)
34#define S3C2410_ULCON (0x00)
35#define S3C2410_UCON (0x04)
36#define S3C2410_UFCON (0x08)
37#define S3C2410_UMCON (0x0C)
38#define S3C2410_UBRDIV (0x28)
39#define S3C2410_UTRSTAT (0x10)
40#define S3C2410_UERSTAT (0x14)
41#define S3C2410_UFSTAT (0x18)
42#define S3C2410_UMSTAT (0x1C)
43
44#define S3C2410_LCON_CFGMASK ((0xF<<3)|(0x3))
45
46#define S3C2410_LCON_CS5 (0x0)
47#define S3C2410_LCON_CS6 (0x1)
48#define S3C2410_LCON_CS7 (0x2)
49#define S3C2410_LCON_CS8 (0x3)
50#define S3C2410_LCON_CSMASK (0x3)
51
52#define S3C2410_LCON_PNONE (0x0)
53#define S3C2410_LCON_PEVEN (0x5 << 3)
54#define S3C2410_LCON_PODD (0x4 << 3)
55#define S3C2410_LCON_PMASK (0x7 << 3)
56
57#define S3C2410_LCON_STOPB (1<<2)
58#define S3C2410_LCON_IRM (1<<6)
59
60#define S3C2440_UCON_CLKMASK (3<<10)
61#define S3C2440_UCON_CLKSHIFT (10)
62#define S3C2440_UCON_PCLK (0<<10)
63#define S3C2440_UCON_UCLK (1<<10)
64#define S3C2440_UCON_PCLK2 (2<<10)
65#define S3C2440_UCON_FCLK (3<<10)
66#define S3C2443_UCON_EPLL (3<<10)
67
68#define S3C6400_UCON_CLKMASK (3<<10)
69#define S3C6400_UCON_CLKSHIFT (10)
70#define S3C6400_UCON_PCLK (0<<10)
71#define S3C6400_UCON_PCLK2 (2<<10)
72#define S3C6400_UCON_UCLK0 (1<<10)
73#define S3C6400_UCON_UCLK1 (3<<10)
74
75#define S3C2440_UCON2_FCLK_EN (1<<15)
76#define S3C2440_UCON0_DIVMASK (15 << 12)
77#define S3C2440_UCON1_DIVMASK (15 << 12)
78#define S3C2440_UCON2_DIVMASK (7 << 12)
79#define S3C2440_UCON_DIVSHIFT (12)
80
81#define S3C2412_UCON_CLKMASK (3<<10)
82#define S3C2412_UCON_CLKSHIFT (10)
83#define S3C2412_UCON_UCLK (1<<10)
84#define S3C2412_UCON_USYSCLK (3<<10)
85#define S3C2412_UCON_PCLK (0<<10)
86#define S3C2412_UCON_PCLK2 (2<<10)
87
88#define S3C2410_UCON_CLKMASK (1 << 10)
89#define S3C2410_UCON_CLKSHIFT (10)
90#define S3C2410_UCON_UCLK (1<<10)
91#define S3C2410_UCON_SBREAK (1<<4)
92
93#define S3C2410_UCON_TXILEVEL (1<<9)
94#define S3C2410_UCON_RXILEVEL (1<<8)
95#define S3C2410_UCON_TXIRQMODE (1<<2)
96#define S3C2410_UCON_RXIRQMODE (1<<0)
97#define S3C2410_UCON_RXFIFO_TOI (1<<7)
98#define S3C2443_UCON_RXERR_IRQEN (1<<6)
99#define S3C2443_UCON_LOOPBACK (1<<5)
100
101#define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
102 S3C2410_UCON_RXILEVEL | \
103 S3C2410_UCON_TXIRQMODE | \
104 S3C2410_UCON_RXIRQMODE | \
105 S3C2410_UCON_RXFIFO_TOI)
106
107#define S3C2410_UFCON_FIFOMODE (1<<0)
108#define S3C2410_UFCON_TXTRIG0 (0<<6)
109#define S3C2410_UFCON_RXTRIG8 (1<<4)
110#define S3C2410_UFCON_RXTRIG12 (2<<4)
111
112/* S3C2440 FIFO trigger levels */
113#define S3C2440_UFCON_RXTRIG1 (0<<4)
114#define S3C2440_UFCON_RXTRIG8 (1<<4)
115#define S3C2440_UFCON_RXTRIG16 (2<<4)
116#define S3C2440_UFCON_RXTRIG32 (3<<4)
117
118#define S3C2440_UFCON_TXTRIG0 (0<<6)
119#define S3C2440_UFCON_TXTRIG16 (1<<6)
120#define S3C2440_UFCON_TXTRIG32 (2<<6)
121#define S3C2440_UFCON_TXTRIG48 (3<<6)
122
123#define S3C2410_UFCON_RESETBOTH (3<<1)
124#define S3C2410_UFCON_RESETTX (1<<2)
125#define S3C2410_UFCON_RESETRX (1<<1)
126
127#define S3C2410_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
128 S3C2410_UFCON_TXTRIG0 | \
129 S3C2410_UFCON_RXTRIG8 )
130
131#define S3C2410_UMCOM_AFC (1<<4)
132#define S3C2410_UMCOM_RTS_LOW (1<<0)
133
134#define S3C2412_UMCON_AFC_63 (0<<5) /* same as s3c2443 */
135#define S3C2412_UMCON_AFC_56 (1<<5)
136#define S3C2412_UMCON_AFC_48 (2<<5)
137#define S3C2412_UMCON_AFC_40 (3<<5)
138#define S3C2412_UMCON_AFC_32 (4<<5)
139#define S3C2412_UMCON_AFC_24 (5<<5)
140#define S3C2412_UMCON_AFC_16 (6<<5)
141#define S3C2412_UMCON_AFC_8 (7<<5)
142
143#define S3C2410_UFSTAT_TXFULL (1<<9)
144#define S3C2410_UFSTAT_RXFULL (1<<8)
145#define S3C2410_UFSTAT_TXMASK (15<<4)
146#define S3C2410_UFSTAT_TXSHIFT (4)
147#define S3C2410_UFSTAT_RXMASK (15<<0)
148#define S3C2410_UFSTAT_RXSHIFT (0)
149
150/* UFSTAT S3C2443 same as S3C2440 */
151#define S3C2440_UFSTAT_TXFULL (1<<14)
152#define S3C2440_UFSTAT_RXFULL (1<<6)
153#define S3C2440_UFSTAT_TXSHIFT (8)
154#define S3C2440_UFSTAT_RXSHIFT (0)
155#define S3C2440_UFSTAT_TXMASK (63<<8)
156#define S3C2440_UFSTAT_RXMASK (63)
157
158#define S3C2410_UTRSTAT_TXE (1<<2)
159#define S3C2410_UTRSTAT_TXFE (1<<1)
160#define S3C2410_UTRSTAT_RXDR (1<<0)
161
162#define S3C2410_UERSTAT_OVERRUN (1<<0)
163#define S3C2410_UERSTAT_FRAME (1<<2)
164#define S3C2410_UERSTAT_BREAK (1<<3)
165#define S3C2443_UERSTAT_PARITY (1<<1)
166
167#define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \
168 S3C2410_UERSTAT_FRAME | \
169 S3C2410_UERSTAT_BREAK)
170
171#define S3C2410_UMSTAT_CTS (1<<0)
172#define S3C2410_UMSTAT_DeltaCTS (1<<2)
173
174#define S3C2443_DIVSLOT (0x2C)
175
176/* S3C64XX interrupt registers. */
177#define S3C64XX_UINTP 0x30
178#define S3C64XX_UINTSP 0x34
179#define S3C64XX_UINTM 0x38
180
181#define S3C64XX_UINTM_RXD (0)
182#define S3C64XX_UINTM_TXD (2)
183#define S3C64XX_UINTM_RXD_MSK (1 << S3C64XX_UINTM_RXD)
184#define S3C64XX_UINTM_TXD_MSK (1 << S3C64XX_UINTM_TXD)
185
186/* Following are specific to S5PV210 */
187#define S5PV210_UCON_CLKMASK (1<<10)
188#define S5PV210_UCON_CLKSHIFT (10)
189#define S5PV210_UCON_PCLK (0<<10)
190#define S5PV210_UCON_UCLK (1<<10)
191
192#define S5PV210_UFCON_TXTRIG0 (0<<8)
193#define S5PV210_UFCON_TXTRIG4 (1<<8)
194#define S5PV210_UFCON_TXTRIG8 (2<<8)
195#define S5PV210_UFCON_TXTRIG16 (3<<8)
196#define S5PV210_UFCON_TXTRIG32 (4<<8)
197#define S5PV210_UFCON_TXTRIG64 (5<<8)
198#define S5PV210_UFCON_TXTRIG128 (6<<8)
199#define S5PV210_UFCON_TXTRIG256 (7<<8)
200
201#define S5PV210_UFCON_RXTRIG1 (0<<4)
202#define S5PV210_UFCON_RXTRIG4 (1<<4)
203#define S5PV210_UFCON_RXTRIG8 (2<<4)
204#define S5PV210_UFCON_RXTRIG16 (3<<4)
205#define S5PV210_UFCON_RXTRIG32 (4<<4)
206#define S5PV210_UFCON_RXTRIG64 (5<<4)
207#define S5PV210_UFCON_RXTRIG128 (6<<4)
208#define S5PV210_UFCON_RXTRIG256 (7<<4)
209
210#define S5PV210_UFSTAT_TXFULL (1<<24)
211#define S5PV210_UFSTAT_RXFULL (1<<8)
212#define S5PV210_UFSTAT_TXMASK (255<<16)
213#define S5PV210_UFSTAT_TXSHIFT (16)
214#define S5PV210_UFSTAT_RXMASK (255<<0)
215#define S5PV210_UFSTAT_RXSHIFT (0)
216
217#define S3C2410_UCON_CLKSEL0 (1 << 0)
218#define S3C2410_UCON_CLKSEL1 (1 << 1)
219#define S3C2410_UCON_CLKSEL2 (1 << 2)
220#define S3C2410_UCON_CLKSEL3 (1 << 3)
221
222/* Default values for s5pv210 UCON and UFCON uart registers */
223#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
224 S3C2410_UCON_RXILEVEL | \
225 S3C2410_UCON_TXIRQMODE | \
226 S3C2410_UCON_RXIRQMODE | \
227 S3C2410_UCON_RXFIFO_TOI | \
228 S3C2443_UCON_RXERR_IRQEN)
229
230#define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
231 S5PV210_UFCON_TXTRIG4 | \
232 S5PV210_UFCON_RXTRIG4)
233
234#ifndef __ASSEMBLY__
235
236/* configuration structure for per-machine configurations for the
237 * serial port
238 *
239 * the pointer is setup by the machine specific initialisation from the
240 * arch/arm/mach-s3c2410/ directory.
241*/
242
243struct s3c2410_uartcfg {
244 unsigned char hwport; /* hardware port number */
245 unsigned char unused;
246 unsigned short flags;
247 upf_t uart_flags; /* default uart flags */
248 unsigned int clk_sel;
249
250 unsigned int has_fracval;
251
252 unsigned long ucon; /* value of ucon for port */
253 unsigned long ulcon; /* value of ulcon for port */
254 unsigned long ufcon; /* value of ufcon for port */
255};
256
257#endif /* __ASSEMBLY__ */
258
259#endif /* __ASM_ARM_REGS_SERIAL_H */
260
diff --git a/include/linux/signal.h b/include/linux/signal.h
index a2dcb94ea49d..9475c5cb28bc 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -250,11 +250,11 @@ extern int show_unhandled_signals;
250extern int sigsuspend(sigset_t *); 250extern int sigsuspend(sigset_t *);
251 251
252struct sigaction { 252struct sigaction {
253#ifndef __ARCH_HAS_ODD_SIGACTION 253#ifndef __ARCH_HAS_IRIX_SIGACTION
254 __sighandler_t sa_handler; 254 __sighandler_t sa_handler;
255 unsigned long sa_flags; 255 unsigned long sa_flags;
256#else 256#else
257 unsigned long sa_flags; 257 unsigned int sa_flags;
258 __sighandler_t sa_handler; 258 __sighandler_t sa_handler;
259#endif 259#endif
260#ifdef __ARCH_HAS_SA_RESTORER 260#ifdef __ARCH_HAS_SA_RESTORER
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 821c7f45d2a7..b8292d8cc9fa 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -500,7 +500,7 @@ struct sk_buff {
500 union { 500 union {
501 __u32 mark; 501 __u32 mark;
502 __u32 dropcount; 502 __u32 dropcount;
503 __u32 avail_size; 503 __u32 reserved_tailroom;
504 }; 504 };
505 505
506 sk_buff_data_t inner_transport_header; 506 sk_buff_data_t inner_transport_header;
@@ -1288,11 +1288,13 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
1288 * do not lose pfmemalloc information as the pages would not be 1288 * do not lose pfmemalloc information as the pages would not be
1289 * allocated using __GFP_MEMALLOC. 1289 * allocated using __GFP_MEMALLOC.
1290 */ 1290 */
1291 if (page->pfmemalloc && !page->mapping)
1292 skb->pfmemalloc = true;
1293 frag->page.p = page; 1291 frag->page.p = page;
1294 frag->page_offset = off; 1292 frag->page_offset = off;
1295 skb_frag_size_set(frag, size); 1293 skb_frag_size_set(frag, size);
1294
1295 page = compound_head(page);
1296 if (page->pfmemalloc && !page->mapping)
1297 skb->pfmemalloc = true;
1296} 1298}
1297 1299
1298/** 1300/**
@@ -1447,7 +1449,10 @@ static inline int skb_tailroom(const struct sk_buff *skb)
1447 */ 1449 */
1448static inline int skb_availroom(const struct sk_buff *skb) 1450static inline int skb_availroom(const struct sk_buff *skb)
1449{ 1451{
1450 return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len; 1452 if (skb_is_nonlinear(skb))
1453 return 0;
1454
1455 return skb->end - skb->tail - skb->reserved_tailroom;
1451} 1456}
1452 1457
1453/** 1458/**
@@ -2638,6 +2643,13 @@ static inline void nf_reset(struct sk_buff *skb)
2638#endif 2643#endif
2639} 2644}
2640 2645
2646static inline void nf_reset_trace(struct sk_buff *skb)
2647{
2648#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
2649 skb->nf_trace = 0;
2650#endif
2651}
2652
2641/* Note: This doesn't put any conntrack and bridge info in dst. */ 2653/* Note: This doesn't put any conntrack and bridge info in dst. */
2642static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) 2654static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src)
2643{ 2655{
diff --git a/include/linux/spi/spi-tegra.h b/include/linux/spi/spi-tegra.h
deleted file mode 100644
index 786932c62edb..000000000000
--- a/include/linux/spi/spi-tegra.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * spi-tegra.h: SPI interface for Nvidia Tegra20 SLINK controller.
3 *
4 * Copyright (C) 2011 NVIDIA Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _LINUX_SPI_TEGRA_H
22#define _LINUX_SPI_TEGRA_H
23
24struct tegra_spi_platform_data {
25 int dma_req_sel;
26 unsigned int spi_max_frequency;
27};
28
29/*
30 * Controller data from device to pass some info like
31 * hw based chip select can be used or not and if yes
32 * then CS hold and setup time.
33 */
34struct tegra_spi_device_controller_data {
35 bool is_hw_based_cs;
36 int cs_setup_clk_count;
37 int cs_hold_clk_count;
38};
39
40#endif /* _LINUX_SPI_TEGRA_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 38c2b925923d..733eb5ee31c5 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -228,6 +228,11 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
228 * every chipselect is connected to a slave. 228 * every chipselect is connected to a slave.
229 * @dma_alignment: SPI controller constraint on DMA buffers alignment. 229 * @dma_alignment: SPI controller constraint on DMA buffers alignment.
230 * @mode_bits: flags understood by this controller driver 230 * @mode_bits: flags understood by this controller driver
231 * @bits_per_word_mask: A mask indicating which values of bits_per_word are
232 * supported by the driver. Bit n indicates that a bits_per_word n+1 is
233 * suported. If set, the SPI core will reject any transfer with an
234 * unsupported bits_per_word. If not set, this value is simply ignored,
235 * and it's up to the individual driver to perform any validation.
231 * @flags: other constraints relevant to this driver 236 * @flags: other constraints relevant to this driver
232 * @bus_lock_spinlock: spinlock for SPI bus locking 237 * @bus_lock_spinlock: spinlock for SPI bus locking
233 * @bus_lock_mutex: mutex for SPI bus locking 238 * @bus_lock_mutex: mutex for SPI bus locking
@@ -301,6 +306,9 @@ struct spi_master {
301 /* spi_device.mode flags understood by this controller driver */ 306 /* spi_device.mode flags understood by this controller driver */
302 u16 mode_bits; 307 u16 mode_bits;
303 308
309 /* bitmask of supported bits_per_word for transfers */
310 u32 bits_per_word_mask;
311
304 /* other constraints relevant to this driver */ 312 /* other constraints relevant to this driver */
305 u16 flags; 313 u16 flags;
306#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ 314#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h
index a26e2fb604e6..e2369c167dbd 100644
--- a/include/linux/spinlock_up.h
+++ b/include/linux/spinlock_up.h
@@ -16,7 +16,10 @@
16 * In the debug case, 1 means unlocked, 0 means locked. (the values 16 * In the debug case, 1 means unlocked, 0 means locked. (the values
17 * are inverted, to catch initialization bugs) 17 * are inverted, to catch initialization bugs)
18 * 18 *
19 * No atomicity anywhere, we are on UP. 19 * No atomicity anywhere, we are on UP. However, we still need
20 * the compiler barriers, because we do not want the compiler to
21 * move potentially faulting instructions (notably user accesses)
22 * into the locked sequence, resulting in non-atomic execution.
20 */ 23 */
21 24
22#ifdef CONFIG_DEBUG_SPINLOCK 25#ifdef CONFIG_DEBUG_SPINLOCK
@@ -25,6 +28,7 @@
25static inline void arch_spin_lock(arch_spinlock_t *lock) 28static inline void arch_spin_lock(arch_spinlock_t *lock)
26{ 29{
27 lock->slock = 0; 30 lock->slock = 0;
31 barrier();
28} 32}
29 33
30static inline void 34static inline void
@@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags)
32{ 36{
33 local_irq_save(flags); 37 local_irq_save(flags);
34 lock->slock = 0; 38 lock->slock = 0;
39 barrier();
35} 40}
36 41
37static inline int arch_spin_trylock(arch_spinlock_t *lock) 42static inline int arch_spin_trylock(arch_spinlock_t *lock)
@@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
39 char oldval = lock->slock; 44 char oldval = lock->slock;
40 45
41 lock->slock = 0; 46 lock->slock = 0;
47 barrier();
42 48
43 return oldval > 0; 49 return oldval > 0;
44} 50}
45 51
46static inline void arch_spin_unlock(arch_spinlock_t *lock) 52static inline void arch_spin_unlock(arch_spinlock_t *lock)
47{ 53{
54 barrier();
48 lock->slock = 1; 55 lock->slock = 1;
49} 56}
50 57
51/* 58/*
52 * Read-write spinlocks. No debug version. 59 * Read-write spinlocks. No debug version.
53 */ 60 */
54#define arch_read_lock(lock) do { (void)(lock); } while (0) 61#define arch_read_lock(lock) do { barrier(); (void)(lock); } while (0)
55#define arch_write_lock(lock) do { (void)(lock); } while (0) 62#define arch_write_lock(lock) do { barrier(); (void)(lock); } while (0)
56#define arch_read_trylock(lock) ({ (void)(lock); 1; }) 63#define arch_read_trylock(lock) ({ barrier(); (void)(lock); 1; })
57#define arch_write_trylock(lock) ({ (void)(lock); 1; }) 64#define arch_write_trylock(lock) ({ barrier(); (void)(lock); 1; })
58#define arch_read_unlock(lock) do { (void)(lock); } while (0) 65#define arch_read_unlock(lock) do { barrier(); (void)(lock); } while (0)
59#define arch_write_unlock(lock) do { (void)(lock); } while (0) 66#define arch_write_unlock(lock) do { barrier(); (void)(lock); } while (0)
60 67
61#else /* DEBUG_SPINLOCK */ 68#else /* DEBUG_SPINLOCK */
62#define arch_spin_is_locked(lock) ((void)(lock), 0) 69#define arch_spin_is_locked(lock) ((void)(lock), 0)
63/* for sched.c and kernel_lock.c: */ 70/* for sched.c and kernel_lock.c: */
64# define arch_spin_lock(lock) do { (void)(lock); } while (0) 71# define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0)
65# define arch_spin_lock_flags(lock, flags) do { (void)(lock); } while (0) 72# define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0)
66# define arch_spin_unlock(lock) do { (void)(lock); } while (0) 73# define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0)
67# define arch_spin_trylock(lock) ({ (void)(lock); 1; }) 74# define arch_spin_trylock(lock) ({ barrier(); (void)(lock); 1; })
68#endif /* DEBUG_SPINLOCK */ 75#endif /* DEBUG_SPINLOCK */
69 76
70#define arch_spin_is_contended(lock) (((void)(lock), 0)) 77#define arch_spin_is_contended(lock) (((void)(lock), 0))
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index 9e492be5244b..6fcfe99bd999 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -219,6 +219,7 @@
219#define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */ 219#define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */
220#define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ 220#define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */
221#define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 221#define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16
222#define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400
222#define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ 223#define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */
223#define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ 224#define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */
224#define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */ 225#define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */
@@ -667,5 +668,6 @@ enum ssb_pmu_ldo_volt_id {
667void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc, 668void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc,
668 enum ssb_pmu_ldo_volt_id id, u32 voltage); 669 enum ssb_pmu_ldo_volt_id id, u32 voltage);
669void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); 670void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on);
671void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid);
670 672
671#endif /* LINUX_SSB_CHIPCO_H_ */ 673#endif /* LINUX_SSB_CHIPCO_H_ */
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h
new file mode 100644
index 000000000000..44ef5da21470
--- /dev/null
+++ b/include/linux/ssbi.h
@@ -0,0 +1,38 @@
1/* Copyright (C) 2010 Google, Inc.
2 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
3 * Author: Dima Zavin <dima@android.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef _LINUX_SSBI_H
16#define _LINUX_SSBI_H
17
18#include <linux/types.h>
19
20struct ssbi_slave_info {
21 const char *name;
22 void *platform_data;
23};
24
25enum ssbi_controller_type {
26 MSM_SBI_CTRL_SSBI = 0,
27 MSM_SBI_CTRL_SSBI2,
28 MSM_SBI_CTRL_PMIC_ARBITER,
29};
30
31struct ssbi_platform_data {
32 struct ssbi_slave_info slave;
33 enum ssbi_controller_type controller_type;
34};
35
36int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len);
37int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
38#endif
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 2de42f9401d2..a5ffd32642fd 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -25,6 +25,7 @@ extern int swiotlb_force;
25extern void swiotlb_init(int verbose); 25extern void swiotlb_init(int verbose);
26int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); 26int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
27extern unsigned long swiotlb_nr_tbl(void); 27extern unsigned long swiotlb_nr_tbl(void);
28unsigned long swiotlb_size_or_default(void);
28extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); 29extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs);
29 30
30/* 31/*
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index f0bd7f90a90d..e3c0ae9bb1fa 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -44,7 +44,7 @@
44/* Adding event notification support elements */ 44/* Adding event notification support elements */
45#define THERMAL_GENL_FAMILY_NAME "thermal_event" 45#define THERMAL_GENL_FAMILY_NAME "thermal_event"
46#define THERMAL_GENL_VERSION 0x01 46#define THERMAL_GENL_VERSION 0x01
47#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" 47#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_grp"
48 48
49/* Default Thermal Governor */ 49/* Default Thermal Governor */
50#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) 50#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h
index d563f37e1a1d..1d7ca2739272 100644
--- a/include/linux/trace_clock.h
+++ b/include/linux/trace_clock.h
@@ -16,6 +16,7 @@
16 16
17extern u64 notrace trace_clock_local(void); 17extern u64 notrace trace_clock_local(void);
18extern u64 notrace trace_clock(void); 18extern u64 notrace trace_clock(void);
19extern u64 notrace trace_clock_jiffies(void);
19extern u64 notrace trace_clock_global(void); 20extern u64 notrace trace_clock_global(void);
20extern u64 notrace trace_clock_counter(void); 21extern u64 notrace trace_clock_counter(void);
21 22
diff --git a/include/linux/tty.h b/include/linux/tty.h
index c75d886b0307..367a9dfc4ea2 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -255,9 +255,9 @@ struct tty_struct {
255 int count; 255 int count;
256 struct winsize winsize; /* termios mutex */ 256 struct winsize winsize; /* termios mutex */
257 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; 257 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1;
258 unsigned char warned:1;
259 unsigned char ctrl_status; /* ctrl_lock */ 258 unsigned char ctrl_status; /* ctrl_lock */
260 unsigned int receive_room; /* Bytes free for queue */ 259 unsigned int receive_room; /* Bytes free for queue */
260 int flow_change;
261 261
262 struct tty_struct *link; 262 struct tty_struct *link;
263 struct fasync_struct *fasync; 263 struct fasync_struct *fasync;
@@ -315,9 +315,25 @@ struct tty_file_private {
315#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 315#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
316#define TTY_HUPPED 18 /* Post driver->hangup() */ 316#define TTY_HUPPED 18 /* Post driver->hangup() */
317#define TTY_HUPPING 21 /* ->hangup() in progress */ 317#define TTY_HUPPING 21 /* ->hangup() in progress */
318#define TTY_LDISC_HALTED 22 /* Line discipline is halted */
318 319
319#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 320#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
320 321
322/* Values for tty->flow_change */
323#define TTY_THROTTLE_SAFE 1
324#define TTY_UNTHROTTLE_SAFE 2
325
326static inline void __tty_set_flow_change(struct tty_struct *tty, int val)
327{
328 tty->flow_change = val;
329}
330
331static inline void tty_set_flow_change(struct tty_struct *tty, int val)
332{
333 tty->flow_change = val;
334 smp_mb();
335}
336
321#ifdef CONFIG_TTY 337#ifdef CONFIG_TTY
322extern void console_init(void); 338extern void console_init(void);
323extern void tty_kref_put(struct tty_struct *tty); 339extern void tty_kref_put(struct tty_struct *tty);
@@ -400,6 +416,8 @@ extern int tty_write_room(struct tty_struct *tty);
400extern void tty_driver_flush_buffer(struct tty_struct *tty); 416extern void tty_driver_flush_buffer(struct tty_struct *tty);
401extern void tty_throttle(struct tty_struct *tty); 417extern void tty_throttle(struct tty_struct *tty);
402extern void tty_unthrottle(struct tty_struct *tty); 418extern void tty_unthrottle(struct tty_struct *tty);
419extern int tty_throttle_safe(struct tty_struct *tty);
420extern int tty_unthrottle_safe(struct tty_struct *tty);
403extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); 421extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
404extern void tty_driver_remove_tty(struct tty_driver *driver, 422extern void tty_driver_remove_tty(struct tty_driver *driver,
405 struct tty_struct *tty); 423 struct tty_struct *tty);
@@ -419,13 +437,28 @@ extern void tty_flush_to_ldisc(struct tty_struct *tty);
419extern void tty_buffer_free_all(struct tty_port *port); 437extern void tty_buffer_free_all(struct tty_port *port);
420extern void tty_buffer_flush(struct tty_struct *tty); 438extern void tty_buffer_flush(struct tty_struct *tty);
421extern void tty_buffer_init(struct tty_port *port); 439extern void tty_buffer_init(struct tty_port *port);
422extern speed_t tty_get_baud_rate(struct tty_struct *tty);
423extern speed_t tty_termios_baud_rate(struct ktermios *termios); 440extern speed_t tty_termios_baud_rate(struct ktermios *termios);
424extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 441extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
425extern void tty_termios_encode_baud_rate(struct ktermios *termios, 442extern void tty_termios_encode_baud_rate(struct ktermios *termios,
426 speed_t ibaud, speed_t obaud); 443 speed_t ibaud, speed_t obaud);
427extern void tty_encode_baud_rate(struct tty_struct *tty, 444extern void tty_encode_baud_rate(struct tty_struct *tty,
428 speed_t ibaud, speed_t obaud); 445 speed_t ibaud, speed_t obaud);
446
447/**
448 * tty_get_baud_rate - get tty bit rates
449 * @tty: tty to query
450 *
451 * Returns the baud rate as an integer for this terminal. The
452 * termios lock must be held by the caller and the terminal bit
453 * flags may be updated.
454 *
455 * Locking: none
456 */
457static inline speed_t tty_get_baud_rate(struct tty_struct *tty)
458{
459 return tty_termios_baud_rate(&tty->termios);
460}
461
429extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); 462extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
430extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); 463extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b);
431extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); 464extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
@@ -502,6 +535,8 @@ extern int tty_port_carrier_raised(struct tty_port *port);
502extern void tty_port_raise_dtr_rts(struct tty_port *port); 535extern void tty_port_raise_dtr_rts(struct tty_port *port);
503extern void tty_port_lower_dtr_rts(struct tty_port *port); 536extern void tty_port_lower_dtr_rts(struct tty_port *port);
504extern void tty_port_hangup(struct tty_port *port); 537extern void tty_port_hangup(struct tty_port *port);
538extern void tty_port_tty_hangup(struct tty_port *port, bool check_clocal);
539extern void tty_port_tty_wakeup(struct tty_port *port);
505extern int tty_port_block_til_ready(struct tty_port *port, 540extern int tty_port_block_til_ready(struct tty_port *port,
506 struct tty_struct *tty, struct file *filp); 541 struct tty_struct *tty, struct file *filp);
507extern int tty_port_close_start(struct tty_port *port, 542extern int tty_port_close_start(struct tty_port *port,
@@ -526,8 +561,6 @@ extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty);
526extern void tty_ldisc_init(struct tty_struct *tty); 561extern void tty_ldisc_init(struct tty_struct *tty);
527extern void tty_ldisc_deinit(struct tty_struct *tty); 562extern void tty_ldisc_deinit(struct tty_struct *tty);
528extern void tty_ldisc_begin(void); 563extern void tty_ldisc_begin(void);
529/* This last one is just for the tty layer internals and shouldn't be used elsewhere */
530extern void tty_ldisc_enable(struct tty_struct *tty);
531 564
532 565
533/* n_tty.c */ 566/* n_tty.c */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 455a0d7bf220..58390c73df8b 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -9,89 +9,89 @@
9 * 9 *
10 * int (*open)(struct tty_struct *); 10 * int (*open)(struct tty_struct *);
11 * 11 *
12 * This function is called when the line discipline is associated 12 * This function is called when the line discipline is associated
13 * with the tty. The line discipline can use this as an 13 * with the tty. The line discipline can use this as an
14 * opportunity to initialize any state needed by the ldisc routines. 14 * opportunity to initialize any state needed by the ldisc routines.
15 * 15 *
16 * void (*close)(struct tty_struct *); 16 * void (*close)(struct tty_struct *);
17 * 17 *
18 * This function is called when the line discipline is being 18 * This function is called when the line discipline is being
19 * shutdown, either because the tty is being closed or because 19 * shutdown, either because the tty is being closed or because
20 * the tty is being changed to use a new line discipline 20 * the tty is being changed to use a new line discipline
21 * 21 *
22 * void (*flush_buffer)(struct tty_struct *tty); 22 * void (*flush_buffer)(struct tty_struct *tty);
23 * 23 *
24 * This function instructs the line discipline to clear its 24 * This function instructs the line discipline to clear its
25 * buffers of any input characters it may have queued to be 25 * buffers of any input characters it may have queued to be
26 * delivered to the user mode process. 26 * delivered to the user mode process.
27 * 27 *
28 * ssize_t (*chars_in_buffer)(struct tty_struct *tty); 28 * ssize_t (*chars_in_buffer)(struct tty_struct *tty);
29 * 29 *
30 * This function returns the number of input characters the line 30 * This function returns the number of input characters the line
31 * discipline may have queued up to be delivered to the user mode 31 * discipline may have queued up to be delivered to the user mode
32 * process. 32 * process.
33 * 33 *
34 * ssize_t (*read)(struct tty_struct * tty, struct file * file, 34 * ssize_t (*read)(struct tty_struct * tty, struct file * file,
35 * unsigned char * buf, size_t nr); 35 * unsigned char * buf, size_t nr);
36 * 36 *
37 * This function is called when the user requests to read from 37 * This function is called when the user requests to read from
38 * the tty. The line discipline will return whatever characters 38 * the tty. The line discipline will return whatever characters
39 * it has buffered up for the user. If this function is not 39 * it has buffered up for the user. If this function is not
40 * defined, the user will receive an EIO error. 40 * defined, the user will receive an EIO error.
41 * 41 *
42 * ssize_t (*write)(struct tty_struct * tty, struct file * file, 42 * ssize_t (*write)(struct tty_struct * tty, struct file * file,
43 * const unsigned char * buf, size_t nr); 43 * const unsigned char * buf, size_t nr);
44 * 44 *
45 * This function is called when the user requests to write to the 45 * This function is called when the user requests to write to the
46 * tty. The line discipline will deliver the characters to the 46 * tty. The line discipline will deliver the characters to the
47 * low-level tty device for transmission, optionally performing 47 * low-level tty device for transmission, optionally performing
48 * some processing on the characters first. If this function is 48 * some processing on the characters first. If this function is
49 * not defined, the user will receive an EIO error. 49 * not defined, the user will receive an EIO error.
50 * 50 *
51 * int (*ioctl)(struct tty_struct * tty, struct file * file, 51 * int (*ioctl)(struct tty_struct * tty, struct file * file,
52 * unsigned int cmd, unsigned long arg); 52 * unsigned int cmd, unsigned long arg);
53 * 53 *
54 * This function is called when the user requests an ioctl which 54 * This function is called when the user requests an ioctl which
55 * is not handled by the tty layer or the low-level tty driver. 55 * is not handled by the tty layer or the low-level tty driver.
56 * It is intended for ioctls which affect line discpline 56 * It is intended for ioctls which affect line discpline
57 * operation. Note that the search order for ioctls is (1) tty 57 * operation. Note that the search order for ioctls is (1) tty
58 * layer, (2) tty low-level driver, (3) line discpline. So a 58 * layer, (2) tty low-level driver, (3) line discpline. So a
59 * low-level driver can "grab" an ioctl request before the line 59 * low-level driver can "grab" an ioctl request before the line
60 * discpline has a chance to see it. 60 * discpline has a chance to see it.
61 * 61 *
62 * long (*compat_ioctl)(struct tty_struct * tty, struct file * file, 62 * long (*compat_ioctl)(struct tty_struct * tty, struct file * file,
63 * unsigned int cmd, unsigned long arg); 63 * unsigned int cmd, unsigned long arg);
64 * 64 *
65 * Process ioctl calls from 32-bit process on 64-bit system 65 * Process ioctl calls from 32-bit process on 64-bit system
66 * 66 *
67 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); 67 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
68 * 68 *
69 * This function notifies the line discpline that a change has 69 * This function notifies the line discpline that a change has
70 * been made to the termios structure. 70 * been made to the termios structure.
71 * 71 *
72 * int (*poll)(struct tty_struct * tty, struct file * file, 72 * int (*poll)(struct tty_struct * tty, struct file * file,
73 * poll_table *wait); 73 * poll_table *wait);
74 * 74 *
75 * This function is called when a user attempts to select/poll on a 75 * This function is called when a user attempts to select/poll on a
76 * tty device. It is solely the responsibility of the line 76 * tty device. It is solely the responsibility of the line
77 * discipline to handle poll requests. 77 * discipline to handle poll requests.
78 * 78 *
79 * void (*receive_buf)(struct tty_struct *, const unsigned char *cp, 79 * void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
80 * char *fp, int count); 80 * char *fp, int count);
81 * 81 *
82 * This function is called by the low-level tty driver to send 82 * This function is called by the low-level tty driver to send
83 * characters received by the hardware to the line discpline for 83 * characters received by the hardware to the line discpline for
84 * processing. <cp> is a pointer to the buffer of input 84 * processing. <cp> is a pointer to the buffer of input
85 * character received by the device. <fp> is a pointer to a 85 * character received by the device. <fp> is a pointer to a
86 * pointer of flag bytes which indicate whether a character was 86 * pointer of flag bytes which indicate whether a character was
87 * received with a parity error, etc. 87 * received with a parity error, etc.
88 * 88 *
89 * void (*write_wakeup)(struct tty_struct *); 89 * void (*write_wakeup)(struct tty_struct *);
90 * 90 *
91 * This function is called by the low-level tty driver to signal 91 * This function is called by the low-level tty driver to signal
92 * that line discpline should try to send more characters to the 92 * that line discpline should try to send more characters to the
93 * low-level driver for transmission. If the line discpline does 93 * low-level driver for transmission. If the line discpline does
94 * not have any more data to send, it can just return. 94 * not have any more data to send, it can just return.
95 * 95 *
96 * int (*hangup)(struct tty_struct *) 96 * int (*hangup)(struct tty_struct *)
97 * 97 *
@@ -115,7 +115,7 @@ struct tty_ldisc_ops {
115 char *name; 115 char *name;
116 int num; 116 int num;
117 int flags; 117 int flags;
118 118
119 /* 119 /*
120 * The following routines are called from above. 120 * The following routines are called from above.
121 */ 121 */
@@ -123,19 +123,19 @@ struct tty_ldisc_ops {
123 void (*close)(struct tty_struct *); 123 void (*close)(struct tty_struct *);
124 void (*flush_buffer)(struct tty_struct *tty); 124 void (*flush_buffer)(struct tty_struct *tty);
125 ssize_t (*chars_in_buffer)(struct tty_struct *tty); 125 ssize_t (*chars_in_buffer)(struct tty_struct *tty);
126 ssize_t (*read)(struct tty_struct * tty, struct file * file, 126 ssize_t (*read)(struct tty_struct *tty, struct file *file,
127 unsigned char __user * buf, size_t nr); 127 unsigned char __user *buf, size_t nr);
128 ssize_t (*write)(struct tty_struct * tty, struct file * file, 128 ssize_t (*write)(struct tty_struct *tty, struct file *file,
129 const unsigned char * buf, size_t nr); 129 const unsigned char *buf, size_t nr);
130 int (*ioctl)(struct tty_struct * tty, struct file * file, 130 int (*ioctl)(struct tty_struct *tty, struct file *file,
131 unsigned int cmd, unsigned long arg); 131 unsigned int cmd, unsigned long arg);
132 long (*compat_ioctl)(struct tty_struct * tty, struct file * file, 132 long (*compat_ioctl)(struct tty_struct *tty, struct file *file,
133 unsigned int cmd, unsigned long arg); 133 unsigned int cmd, unsigned long arg);
134 void (*set_termios)(struct tty_struct *tty, struct ktermios * old); 134 void (*set_termios)(struct tty_struct *tty, struct ktermios *old);
135 unsigned int (*poll)(struct tty_struct *, struct file *, 135 unsigned int (*poll)(struct tty_struct *, struct file *,
136 struct poll_table_struct *); 136 struct poll_table_struct *);
137 int (*hangup)(struct tty_struct *tty); 137 int (*hangup)(struct tty_struct *tty);
138 138
139 /* 139 /*
140 * The following routines are called from below. 140 * The following routines are called from below.
141 */ 141 */
@@ -145,7 +145,7 @@ struct tty_ldisc_ops {
145 void (*dcd_change)(struct tty_struct *, unsigned int); 145 void (*dcd_change)(struct tty_struct *, unsigned int);
146 146
147 struct module *owner; 147 struct module *owner;
148 148
149 int refcount; 149 int refcount;
150}; 150};
151 151
diff --git a/include/linux/ucs2_string.h b/include/linux/ucs2_string.h
new file mode 100644
index 000000000000..cbb20afdbc01
--- /dev/null
+++ b/include/linux/ucs2_string.h
@@ -0,0 +1,14 @@
1#ifndef _LINUX_UCS2_STRING_H_
2#define _LINUX_UCS2_STRING_H_
3
4#include <linux/types.h> /* for size_t */
5#include <linux/stddef.h> /* for NULL */
6
7typedef u16 ucs2_char_t;
8
9unsigned long ucs2_strnlen(const ucs2_char_t *s, size_t maxlength);
10unsigned long ucs2_strlen(const ucs2_char_t *s);
11unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength);
12int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len);
13
14#endif /* _LINUX_UCS2_STRING_H_ */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 9d81de123c90..42278bbf7a88 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -68,6 +68,7 @@ struct udp_sock {
68 * For encapsulation sockets. 68 * For encapsulation sockets.
69 */ 69 */
70 int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); 70 int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
71 void (*encap_destroy)(struct sock *sk);
71}; 72};
72 73
73static inline struct udp_sock *udp_sk(const struct sock *sk) 74static inline struct udp_sock *udp_sk(const struct sock *sk)
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 4d22d0f6167a..a0bee5a28d1a 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -469,14 +469,12 @@ struct usb3_lpm_parameters {
469 * @lpm_capable: device supports LPM 469 * @lpm_capable: device supports LPM
470 * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM 470 * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
471 * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled 471 * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled
472 * @usb3_lpm_enabled: USB3 hardware LPM enabled
472 * @string_langid: language ID for strings 473 * @string_langid: language ID for strings
473 * @product: iProduct string, if present (static) 474 * @product: iProduct string, if present (static)
474 * @manufacturer: iManufacturer string, if present (static) 475 * @manufacturer: iManufacturer string, if present (static)
475 * @serial: iSerialNumber string, if present (static) 476 * @serial: iSerialNumber string, if present (static)
476 * @filelist: usbfs files that are open to this device 477 * @filelist: usbfs files that are open to this device
477 * @usb_classdev: USB class device that was created for usbfs device
478 * access from userspace
479 * @usbfs_dentry: usbfs dentry entry for the device
480 * @maxchild: number of ports if hub 478 * @maxchild: number of ports if hub
481 * @quirks: quirks of the whole device 479 * @quirks: quirks of the whole device
482 * @urbnum: number of URBs submitted for the whole device 480 * @urbnum: number of URBs submitted for the whole device
@@ -619,7 +617,7 @@ static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index)
619#endif 617#endif
620 618
621/* USB autosuspend and autoresume */ 619/* USB autosuspend and autoresume */
622#ifdef CONFIG_USB_SUSPEND 620#ifdef CONFIG_PM_RUNTIME
623extern void usb_enable_autosuspend(struct usb_device *udev); 621extern void usb_enable_autosuspend(struct usb_device *udev);
624extern void usb_disable_autosuspend(struct usb_device *udev); 622extern void usb_disable_autosuspend(struct usb_device *udev);
625 623
@@ -978,7 +976,12 @@ struct usbdrv_wrap {
978 * the "usbfs" filesystem. This lets devices provide ways to 976 * the "usbfs" filesystem. This lets devices provide ways to
979 * expose information to user space regardless of where they 977 * expose information to user space regardless of where they
980 * do (or don't) show up otherwise in the filesystem. 978 * do (or don't) show up otherwise in the filesystem.
981 * @suspend: Called when the device is going to be suspended by the system. 979 * @suspend: Called when the device is going to be suspended by the
980 * system either from system sleep or runtime suspend context. The
981 * return value will be ignored in system sleep context, so do NOT
982 * try to continue using the device if suspend fails in this case.
983 * Instead, let the resume or reset-resume routine recover from
984 * the failure.
982 * @resume: Called when the device is being resumed by the system. 985 * @resume: Called when the device is being resumed by the system.
983 * @reset_resume: Called when the suspended device has been reset instead 986 * @reset_resume: Called when the suspended device has been reset instead
984 * of being resumed. 987 * of being resumed.
diff --git a/include/linux/usb/cdc-wdm.h b/include/linux/usb/cdc-wdm.h
index 719c332620fa..0b3f4295c025 100644
--- a/include/linux/usb/cdc-wdm.h
+++ b/include/linux/usb/cdc-wdm.h
@@ -11,6 +11,8 @@
11#ifndef __LINUX_USB_CDC_WDM_H 11#ifndef __LINUX_USB_CDC_WDM_H
12#define __LINUX_USB_CDC_WDM_H 12#define __LINUX_USB_CDC_WDM_H
13 13
14#include <uapi/linux/usb/cdc-wdm.h>
15
14extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf, 16extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf,
15 struct usb_endpoint_descriptor *ep, 17 struct usb_endpoint_descriptor *ep,
16 int bufsize, 18 int bufsize,
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 3b8f9d4fc3fe..cc25b70af33c 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -127,6 +127,7 @@ struct cdc_ncm_ctx {
127 u16 connected; 127 u16 connected;
128}; 128};
129 129
130extern u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf);
130extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); 131extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);
131extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); 132extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
132extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); 133extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign);
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 9c210f2283df..27603bcbb9b9 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -43,4 +43,13 @@
43 */ 43 */
44extern const char *usb_speed_string(enum usb_device_speed speed); 44extern const char *usb_speed_string(enum usb_device_speed speed);
45 45
46
47/**
48 * usb_state_string - Returns human readable name for the state.
49 * @state: The state to return a human-readable name for. If it's not
50 * any of the states devices in usb_device_state_string enum,
51 * the string UNKNOWN will be returned.
52 */
53extern const char *usb_state_string(enum usb_device_state state);
54
46#endif /* __LINUX_USB_CH9_H */ 55#endif /* __LINUX_USB_CH9_H */
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 8860594d6364..5e61589fc166 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -39,6 +39,7 @@
39#include <linux/usb/ch9.h> 39#include <linux/usb/ch9.h>
40#include <linux/usb/gadget.h> 40#include <linux/usb/gadget.h>
41#include <linux/log2.h> 41#include <linux/log2.h>
42#include <linux/configfs.h>
42 43
43/* 44/*
44 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they 45 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they
@@ -464,6 +465,8 @@ struct usb_function_driver {
464}; 465};
465 466
466struct usb_function_instance { 467struct usb_function_instance {
468 struct config_group group;
469 struct list_head cfs_list;
467 struct usb_function_driver *fd; 470 struct usb_function_driver *fd;
468 void (*free_func_inst)(struct usb_function_instance *inst); 471 void (*free_func_inst)(struct usb_function_instance *inst);
469}; 472};
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h
index 51eae14477f7..5615f4d82724 100644
--- a/include/linux/usb/dwc3-omap.h
+++ b/include/linux/usb/dwc3-omap.h
@@ -19,11 +19,11 @@ enum omap_dwc3_vbus_id_status {
19}; 19};
20 20
21#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) 21#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE))
22extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); 22extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status);
23#else 23#else
24static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) 24static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)
25{ 25{
26 return; 26 return -ENODEV;
27} 27}
28#endif 28#endif
29 29
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 2e297e80d59a..c454a88abf2e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -482,6 +482,7 @@ struct usb_gadget_ops {
482 * @speed: Speed of current connection to USB host. 482 * @speed: Speed of current connection to USB host.
483 * @max_speed: Maximal speed the UDC can handle. UDC must support this 483 * @max_speed: Maximal speed the UDC can handle. UDC must support this
484 * and all slower speeds. 484 * and all slower speeds.
485 * @state: the state we are now (attached, suspended, configured, etc)
485 * @sg_supported: true if we can handle scatter-gather 486 * @sg_supported: true if we can handle scatter-gather
486 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the 487 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
487 * gadget driver must provide a USB OTG descriptor. 488 * gadget driver must provide a USB OTG descriptor.
@@ -525,6 +526,7 @@ struct usb_gadget {
525 struct list_head ep_list; /* of usb_ep */ 526 struct list_head ep_list; /* of usb_ep */
526 enum usb_device_speed speed; 527 enum usb_device_speed speed;
527 enum usb_device_speed max_speed; 528 enum usb_device_speed max_speed;
529 enum usb_device_state state;
528 unsigned sg_supported:1; 530 unsigned sg_supported:1;
529 unsigned is_otg:1; 531 unsigned is_otg:1;
530 unsigned is_a_peripheral:1; 532 unsigned is_a_peripheral:1;
@@ -872,6 +874,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver);
872 */ 874 */
873int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); 875int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
874 876
877extern int usb_add_gadget_udc_release(struct device *parent,
878 struct usb_gadget *gadget, void (*release)(struct device *dev));
875extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); 879extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
876extern void usb_del_gadget_udc(struct usb_gadget *gadget); 880extern void usb_del_gadget_udc(struct usb_gadget *gadget);
877extern int udc_attach_driver(const char *name, 881extern int udc_attach_driver(const char *name,
@@ -959,6 +963,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget,
959 963
960/*-------------------------------------------------------------------------*/ 964/*-------------------------------------------------------------------------*/
961 965
966/* utility to set gadget state properly */
967
968extern void usb_gadget_set_state(struct usb_gadget *gadget,
969 enum usb_device_state state);
970
971/*-------------------------------------------------------------------------*/
972
962/* utility wrapping a simple endpoint selection policy */ 973/* utility wrapping a simple endpoint selection policy */
963 974
964extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, 975extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,
diff --git a/include/linux/usb/gadget_configfs.h b/include/linux/usb/gadget_configfs.h
new file mode 100644
index 000000000000..d74c0ae989d5
--- /dev/null
+++ b/include/linux/usb/gadget_configfs.h
@@ -0,0 +1,110 @@
1#ifndef __GADGET_CONFIGFS__
2#define __GADGET_CONFIGFS__
3
4#include <linux/configfs.h>
5
6int check_user_usb_string(const char *name,
7 struct usb_gadget_strings *stringtab_dev);
8
9#define GS_STRINGS_W(__struct, __name) \
10 static ssize_t __struct##_##__name##_store(struct __struct *gs, \
11 const char *page, size_t len) \
12{ \
13 int ret; \
14 \
15 ret = usb_string_copy(page, &gs->__name); \
16 if (ret) \
17 return ret; \
18 return len; \
19}
20
21#define GS_STRINGS_R(__struct, __name) \
22 static ssize_t __struct##_##__name##_show(struct __struct *gs, \
23 char *page) \
24{ \
25 return sprintf(page, "%s\n", gs->__name ?: ""); \
26}
27
28#define GS_STRING_ITEM_ATTR(struct_name, name) \
29 static struct struct_name##_attribute struct_name##_##name = \
30 __CONFIGFS_ATTR(name, S_IRUGO | S_IWUSR, \
31 struct_name##_##name##_show, \
32 struct_name##_##name##_store)
33
34#define GS_STRINGS_RW(struct_name, _name) \
35 GS_STRINGS_R(struct_name, _name) \
36 GS_STRINGS_W(struct_name, _name) \
37 GS_STRING_ITEM_ATTR(struct_name, _name)
38
39#define USB_CONFIG_STRING_RW_OPS(struct_in) \
40 CONFIGFS_ATTR_OPS(struct_in); \
41 \
42static struct configfs_item_operations struct_in##_langid_item_ops = { \
43 .release = struct_in##_attr_release, \
44 .show_attribute = struct_in##_attr_show, \
45 .store_attribute = struct_in##_attr_store, \
46}; \
47 \
48static struct config_item_type struct_in##_langid_type = { \
49 .ct_item_ops = &struct_in##_langid_item_ops, \
50 .ct_attrs = struct_in##_langid_attrs, \
51 .ct_owner = THIS_MODULE, \
52}
53
54#define USB_CONFIG_STRINGS_LANG(struct_in, struct_member) \
55 static struct config_group *struct_in##_strings_make( \
56 struct config_group *group, \
57 const char *name) \
58 { \
59 struct struct_member *gi; \
60 struct struct_in *gs; \
61 struct struct_in *new; \
62 int langs = 0; \
63 int ret; \
64 \
65 new = kzalloc(sizeof(*new), GFP_KERNEL); \
66 if (!new) \
67 return ERR_PTR(-ENOMEM); \
68 \
69 ret = check_user_usb_string(name, &new->stringtab_dev); \
70 if (ret) \
71 goto err; \
72 config_group_init_type_name(&new->group, name, \
73 &struct_in##_langid_type); \
74 \
75 gi = container_of(group, struct struct_member, strings_group); \
76 ret = -EEXIST; \
77 list_for_each_entry(gs, &gi->string_list, list) { \
78 if (gs->stringtab_dev.language == new->stringtab_dev.language) \
79 goto err; \
80 langs++; \
81 } \
82 ret = -EOVERFLOW; \
83 if (langs >= MAX_USB_STRING_LANGS) \
84 goto err; \
85 \
86 list_add_tail(&new->list, &gi->string_list); \
87 return &new->group; \
88err: \
89 kfree(new); \
90 return ERR_PTR(ret); \
91} \
92 \
93static void struct_in##_strings_drop( \
94 struct config_group *group, \
95 struct config_item *item) \
96{ \
97 config_item_put(item); \
98} \
99 \
100static struct configfs_group_operations struct_in##_strings_ops = { \
101 .make_group = &struct_in##_strings_make, \
102 .drop_item = &struct_in##_strings_drop, \
103}; \
104 \
105static struct config_item_type struct_in##_strings_type = { \
106 .ct_group_ops = &struct_in##_strings_ops, \
107 .ct_owner = THIS_MODULE, \
108}
109
110#endif
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 0a78df5f6cfd..f5f5c7dfda90 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -84,7 +84,7 @@ struct usb_hcd {
84 84
85 struct timer_list rh_timer; /* drives root-hub polling */ 85 struct timer_list rh_timer; /* drives root-hub polling */
86 struct urb *status_urb; /* the current status urb */ 86 struct urb *status_urb; /* the current status urb */
87#ifdef CONFIG_USB_SUSPEND 87#ifdef CONFIG_PM_RUNTIME
88 struct work_struct wakeup_work; /* for remote wakeup */ 88 struct work_struct wakeup_work; /* for remote wakeup */
89#endif 89#endif
90 90
@@ -357,6 +357,7 @@ struct hc_driver {
357 */ 357 */
358 int (*disable_usb3_lpm_timeout)(struct usb_hcd *, 358 int (*disable_usb3_lpm_timeout)(struct usb_hcd *,
359 struct usb_device *, enum usb3_link_state state); 359 struct usb_device *, enum usb3_link_state state);
360 int (*find_raw_port_number)(struct usb_hcd *, int);
360}; 361};
361 362
362extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); 363extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
@@ -396,6 +397,7 @@ extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd);
396extern int usb_add_hcd(struct usb_hcd *hcd, 397extern int usb_add_hcd(struct usb_hcd *hcd,
397 unsigned int irqnum, unsigned long irqflags); 398 unsigned int irqnum, unsigned long irqflags);
398extern void usb_remove_hcd(struct usb_hcd *hcd); 399extern void usb_remove_hcd(struct usb_hcd *hcd);
400extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1);
399 401
400struct platform_device; 402struct platform_device;
401extern void usb_hcd_platform_shutdown(struct platform_device *dev); 403extern void usb_hcd_platform_shutdown(struct platform_device *dev);
@@ -591,14 +593,14 @@ extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
591extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); 593extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);
592#endif /* CONFIG_PM */ 594#endif /* CONFIG_PM */
593 595
594#ifdef CONFIG_USB_SUSPEND 596#ifdef CONFIG_PM_RUNTIME
595extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); 597extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
596#else 598#else
597static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) 599static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
598{ 600{
599 return; 601 return;
600} 602}
601#endif /* CONFIG_USB_SUSPEND */ 603#endif /* CONFIG_PM_RUNTIME */
602 604
603/*-------------------------------------------------------------------------*/ 605/*-------------------------------------------------------------------------*/
604 606
diff --git a/include/linux/usb/musb-ux500.h b/include/linux/usb/musb-ux500.h
new file mode 100644
index 000000000000..1e2c7130f6e1
--- /dev/null
+++ b/include/linux/usb/musb-ux500.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2013 ST-Ericsson AB
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; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef __MUSB_UX500_H__
16#define __MUSB_UX500_H__
17
18enum ux500_musb_vbus_id_status {
19 UX500_MUSB_NONE = 0,
20 UX500_MUSB_VBUS,
21 UX500_MUSB_ID,
22 UX500_MUSB_CHARGER,
23 UX500_MUSB_ENUMERATED,
24 UX500_MUSB_RIDA,
25 UX500_MUSB_RIDB,
26 UX500_MUSB_RIDC,
27 UX500_MUSB_PREPARE,
28 UX500_MUSB_CLEAN,
29};
30
31#endif /* __MUSB_UX500_H__ */
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h
index 28884c717411..148d35171aac 100644
--- a/include/linux/usb/nop-usb-xceiv.h
+++ b/include/linux/usb/nop-usb-xceiv.h
@@ -5,6 +5,11 @@
5 5
6struct nop_usb_xceiv_platform_data { 6struct nop_usb_xceiv_platform_data {
7 enum usb_phy_type type; 7 enum usb_phy_type type;
8 unsigned long clk_rate;
9
10 /* if set fails with -EPROBE_DEFER if can't get regulator */
11 unsigned int needs_vcc:1;
12 unsigned int needs_reset:1;
8}; 13};
9 14
10#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) 15#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index e8a5fe87c6bd..291e01ba32e5 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -36,14 +36,7 @@ struct usb_otg {
36 36
37}; 37};
38 38
39#ifdef CONFIG_USB_OTG_UTILS 39extern const char *usb_otg_state_string(enum usb_otg_state state);
40extern const char *otg_state_string(enum usb_otg_state state);
41#else
42static inline const char *otg_state_string(enum usb_otg_state state)
43{
44 return NULL;
45}
46#endif
47 40
48/* Context: can sleep */ 41/* Context: can sleep */
49static inline int 42static inline int
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 15847cbdb512..6b5978f57633 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -91,6 +91,9 @@ struct usb_phy {
91 int (*init)(struct usb_phy *x); 91 int (*init)(struct usb_phy *x);
92 void (*shutdown)(struct usb_phy *x); 92 void (*shutdown)(struct usb_phy *x);
93 93
94 /* enable/disable VBUS */
95 int (*set_vbus)(struct usb_phy *x, int on);
96
94 /* effective for B devices, ignored for A-peripheral */ 97 /* effective for B devices, ignored for A-peripheral */
95 int (*set_power)(struct usb_phy *x, 98 int (*set_power)(struct usb_phy *x,
96 unsigned mA); 99 unsigned mA);
@@ -160,8 +163,26 @@ usb_phy_shutdown(struct usb_phy *x)
160 x->shutdown(x); 163 x->shutdown(x);
161} 164}
162 165
166static inline int
167usb_phy_vbus_on(struct usb_phy *x)
168{
169 if (!x->set_vbus)
170 return 0;
171
172 return x->set_vbus(x, true);
173}
174
175static inline int
176usb_phy_vbus_off(struct usb_phy *x)
177{
178 if (!x->set_vbus)
179 return 0;
180
181 return x->set_vbus(x, false);
182}
183
163/* for usb host and peripheral controller drivers */ 184/* for usb host and peripheral controller drivers */
164#ifdef CONFIG_USB_OTG_UTILS 185#if IS_ENABLED(CONFIG_USB_PHY)
165extern struct usb_phy *usb_get_phy(enum usb_phy_type type); 186extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
166extern struct usb_phy *devm_usb_get_phy(struct device *dev, 187extern struct usb_phy *devm_usb_get_phy(struct device *dev,
167 enum usb_phy_type type); 188 enum usb_phy_type type);
@@ -176,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index,
176#else 197#else
177static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) 198static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
178{ 199{
179 return NULL; 200 return ERR_PTR(-ENXIO);
180} 201}
181 202
182static inline struct usb_phy *devm_usb_get_phy(struct device *dev, 203static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
183 enum usb_phy_type type) 204 enum usb_phy_type type)
184{ 205{
185 return NULL; 206 return ERR_PTR(-ENXIO);
186} 207}
187 208
188static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) 209static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
189{ 210{
190 return NULL; 211 return ERR_PTR(-ENXIO);
191} 212}
192 213
193static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) 214static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
194{ 215{
195 return NULL; 216 return ERR_PTR(-ENXIO);
196} 217}
197 218
198static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, 219static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
199 const char *phandle, u8 index) 220 const char *phandle, u8 index)
200{ 221{
201 return NULL; 222 return ERR_PTR(-ENXIO);
202} 223}
203 224
204static inline void usb_put_phy(struct usb_phy *x) 225static inline void usb_put_phy(struct usb_phy *x)
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index c5d36c65c33b..e452ba6ec6bd 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -62,14 +62,14 @@ struct renesas_usbhs_platform_callback {
62 * Hardware exit function for platform. 62 * Hardware exit function for platform.
63 * it is called when driver was removed 63 * it is called when driver was removed
64 */ 64 */
65 void (*hardware_exit)(struct platform_device *pdev); 65 int (*hardware_exit)(struct platform_device *pdev);
66 66
67 /* 67 /*
68 * option: 68 * option:
69 * 69 *
70 * for board specific clock control 70 * for board specific clock control
71 */ 71 */
72 void (*power_ctrl)(struct platform_device *pdev, 72 int (*power_ctrl)(struct platform_device *pdev,
73 void __iomem *base, int enable); 73 void __iomem *base, int enable);
74 74
75 /* 75 /*
@@ -77,7 +77,7 @@ struct renesas_usbhs_platform_callback {
77 * 77 *
78 * Phy reset for platform 78 * Phy reset for platform
79 */ 79 */
80 void (*phy_reset)(struct platform_device *pdev); 80 int (*phy_reset)(struct platform_device *pdev);
81 81
82 /* 82 /*
83 * get USB ID function 83 * get USB ID function
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index ef9be7e1e190..b9b0f7b4e43b 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/kref.h> 16#include <linux/kref.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/serial.h>
18#include <linux/sysrq.h> 19#include <linux/sysrq.h>
19#include <linux/kfifo.h> 20#include <linux/kfifo.h>
20 21
@@ -61,6 +62,7 @@
61 * @bulk_out_buffers: pointers to the bulk out buffers for this port 62 * @bulk_out_buffers: pointers to the bulk out buffers for this port
62 * @write_urbs: pointers to the bulk out urbs for this port 63 * @write_urbs: pointers to the bulk out urbs for this port
63 * @write_urbs_free: status bitmap the for bulk out urbs 64 * @write_urbs_free: status bitmap the for bulk out urbs
65 * @icount: interrupt counters
64 * @tx_bytes: number of bytes currently in host stack queues 66 * @tx_bytes: number of bytes currently in host stack queues
65 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this 67 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this
66 * port. 68 * port.
@@ -108,6 +110,7 @@ struct usb_serial_port {
108 unsigned long write_urbs_free; 110 unsigned long write_urbs_free;
109 __u8 bulk_out_endpointAddress; 111 __u8 bulk_out_endpointAddress;
110 112
113 struct async_icount icount;
111 int tx_bytes; 114 int tx_bytes;
112 115
113 unsigned long flags; 116 unsigned long flags;
@@ -270,6 +273,7 @@ struct usb_serial_driver {
270 int (*tiocmget)(struct tty_struct *tty); 273 int (*tiocmget)(struct tty_struct *tty);
271 int (*tiocmset)(struct tty_struct *tty, 274 int (*tiocmset)(struct tty_struct *tty,
272 unsigned int set, unsigned int clear); 275 unsigned int set, unsigned int clear);
276 int (*tiocmiwait)(struct tty_struct *tty, unsigned long arg);
273 int (*get_icount)(struct tty_struct *tty, 277 int (*get_icount)(struct tty_struct *tty,
274 struct serial_icounter_struct *icount); 278 struct serial_icounter_struct *icount);
275 /* Called by the tty layer for port level work. There may or may not 279 /* Called by the tty layer for port level work. There may or may not
@@ -327,8 +331,10 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb);
327extern void usb_serial_generic_write_bulk_callback(struct urb *urb); 331extern void usb_serial_generic_write_bulk_callback(struct urb *urb);
328extern void usb_serial_generic_throttle(struct tty_struct *tty); 332extern void usb_serial_generic_throttle(struct tty_struct *tty);
329extern void usb_serial_generic_unthrottle(struct tty_struct *tty); 333extern void usb_serial_generic_unthrottle(struct tty_struct *tty);
330extern void usb_serial_generic_disconnect(struct usb_serial *serial); 334extern int usb_serial_generic_tiocmiwait(struct tty_struct *tty,
331extern void usb_serial_generic_release(struct usb_serial *serial); 335 unsigned long arg);
336extern int usb_serial_generic_get_icount(struct tty_struct *tty,
337 struct serial_icounter_struct *icount);
332extern int usb_serial_generic_register(void); 338extern int usb_serial_generic_register(void);
333extern void usb_serial_generic_deregister(void); 339extern void usb_serial_generic_deregister(void);
334extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, 340extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port,
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h
index 9ebebe906925..1b7519a8c0bf 100644
--- a/include/linux/usb/tegra_usb_phy.h
+++ b/include/linux/usb/tegra_usb_phy.h
@@ -61,10 +61,14 @@ struct tegra_usb_phy {
61 struct device *dev; 61 struct device *dev;
62 bool is_legacy_phy; 62 bool is_legacy_phy;
63 bool is_ulpi_phy; 63 bool is_ulpi_phy;
64 void (*set_pts)(struct usb_phy *x, u8 pts_val);
65 void (*set_phcd)(struct usb_phy *x, bool enable);
64}; 66};
65 67
66struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, 68struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
67 void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); 69 void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode,
70 void (*set_pts)(struct usb_phy *x, u8 pts_val),
71 void (*set_phcd)(struct usb_phy *x, bool enable));
68 72
69void tegra_usb_phy_preresume(struct usb_phy *phy); 73void tegra_usb_phy_preresume(struct usb_phy *phy);
70 74
@@ -75,8 +79,4 @@ void tegra_ehci_phy_restore_start(struct usb_phy *phy,
75 79
76void tegra_ehci_phy_restore_end(struct usb_phy *phy); 80void tegra_ehci_phy_restore_end(struct usb_phy *phy);
77 81
78void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val);
79
80void tegra_ehci_set_phcd(struct usb_phy *x, bool enable);
81
82#endif /* __TEGRA_USB_PHY_H */ 82#endif /* __TEGRA_USB_PHY_H */
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h
index 6f033a415ecb..5c295c26ad37 100644
--- a/include/linux/usb/ulpi.h
+++ b/include/linux/usb/ulpi.h
@@ -181,8 +181,16 @@
181 181
182/*-------------------------------------------------------------------------*/ 182/*-------------------------------------------------------------------------*/
183 183
184#if IS_ENABLED(CONFIG_USB_ULPI)
184struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, 185struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
185 unsigned int flags); 186 unsigned int flags);
187#else
188static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
189 unsigned int flags)
190{
191 return NULL;
192}
193#endif
186 194
187#ifdef CONFIG_USB_ULPI_VIEWPORT 195#ifdef CONFIG_USB_ULPI_VIEWPORT
188/* access ops for controllers with a viewport register */ 196/* access ops for controllers with a viewport register */
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index 4ce009324933..b6b215f13b45 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -26,6 +26,8 @@ struct user_namespace {
26 kuid_t owner; 26 kuid_t owner;
27 kgid_t group; 27 kgid_t group;
28 unsigned int proc_inum; 28 unsigned int proc_inum;
29 bool may_mount_sysfs;
30 bool may_mount_proc;
29}; 31};
30 32
31extern struct user_namespace init_user_ns; 33extern struct user_namespace init_user_ns;
@@ -82,4 +84,6 @@ static inline void put_user_ns(struct user_namespace *ns)
82 84
83#endif 85#endif
84 86
87void update_mnt_policy(struct user_namespace *userns);
88
85#endif /* _LINUX_USER_H */ 89#endif /* _LINUX_USER_H */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 40be2a0d8ae1..84a6440f1f19 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -199,6 +199,7 @@ extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
199/* Device notifier */ 199/* Device notifier */
200extern int register_inet6addr_notifier(struct notifier_block *nb); 200extern int register_inet6addr_notifier(struct notifier_block *nb);
201extern int unregister_inet6addr_notifier(struct notifier_block *nb); 201extern int unregister_inet6addr_notifier(struct notifier_block *nb);
202extern int inet6addr_notifier_call_chain(unsigned long val, void *v);
202 203
203extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, 204extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
204 struct ipv6_devconf *devconf); 205 struct ipv6_devconf *devconf);
diff --git a/include/net/dst.h b/include/net/dst.h
index 853cda11e518..1f8fd109e225 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -413,13 +413,15 @@ static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,
413 413
414static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) 414static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
415{ 415{
416 return dst->ops->neigh_lookup(dst, NULL, daddr); 416 struct neighbour *n = dst->ops->neigh_lookup(dst, NULL, daddr);
417 return IS_ERR(n) ? NULL : n;
417} 418}
418 419
419static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, 420static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst,
420 struct sk_buff *skb) 421 struct sk_buff *skb)
421{ 422{
422 return dst->ops->neigh_lookup(dst, skb, NULL); 423 struct neighbour *n = dst->ops->neigh_lookup(dst, skb, NULL);
424 return IS_ERR(n) ? NULL : n;
423} 425}
424 426
425static inline void dst_link_failure(struct sk_buff *skb) 427static inline void dst_link_failure(struct sk_buff *skb)
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h
index 80461c1ae9ef..bb8271d487b7 100644
--- a/include/net/flow_keys.h
+++ b/include/net/flow_keys.h
@@ -9,6 +9,7 @@ struct flow_keys {
9 __be32 ports; 9 __be32 ports;
10 __be16 port16[2]; 10 __be16 port16[2];
11 }; 11 };
12 u16 thoff;
12 u8 ip_proto; 13 u8 ip_proto;
13}; 14};
14 15
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 76c3fe5ecc2e..0a1dcc2fa2f5 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -43,6 +43,13 @@ struct inet_frag_queue {
43 43
44#define INETFRAGS_HASHSZ 64 44#define INETFRAGS_HASHSZ 64
45 45
46/* averaged:
47 * max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ /
48 * rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or
49 * struct frag_queue))
50 */
51#define INETFRAGS_MAXDEPTH 128
52
46struct inet_frags { 53struct inet_frags {
47 struct hlist_head hash[INETFRAGS_HASHSZ]; 54 struct hlist_head hash[INETFRAGS_HASHSZ];
48 /* This rwlock is a global lock (seperate per IPv4, IPv6 and 55 /* This rwlock is a global lock (seperate per IPv4, IPv6 and
@@ -76,6 +83,8 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force);
76struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, 83struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
77 struct inet_frags *f, void *key, unsigned int hash) 84 struct inet_frags *f, void *key, unsigned int hash)
78 __releases(&f->lock); 85 __releases(&f->lock);
86void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
87 const char *prefix);
79 88
80static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) 89static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
81{ 90{
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 9497be1ad4c0..e49db91593a9 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -152,18 +152,16 @@ struct fib_result_nl {
152}; 152};
153 153
154#ifdef CONFIG_IP_ROUTE_MULTIPATH 154#ifdef CONFIG_IP_ROUTE_MULTIPATH
155
156#define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) 155#define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel])
157
158#define FIB_TABLE_HASHSZ 2
159
160#else /* CONFIG_IP_ROUTE_MULTIPATH */ 156#else /* CONFIG_IP_ROUTE_MULTIPATH */
161
162#define FIB_RES_NH(res) ((res).fi->fib_nh[0]) 157#define FIB_RES_NH(res) ((res).fi->fib_nh[0])
158#endif /* CONFIG_IP_ROUTE_MULTIPATH */
163 159
160#ifdef CONFIG_IP_MULTIPLE_TABLES
164#define FIB_TABLE_HASHSZ 256 161#define FIB_TABLE_HASHSZ 256
165 162#else
166#endif /* CONFIG_IP_ROUTE_MULTIPATH */ 163#define FIB_TABLE_HASHSZ 2
164#endif
167 165
168extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); 166extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh);
169 167
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 68c69d54d392..fce8e6b66d55 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -976,6 +976,7 @@ struct netns_ipvs {
976 int sysctl_sync_retries; 976 int sysctl_sync_retries;
977 int sysctl_nat_icmp_send; 977 int sysctl_nat_icmp_send;
978 int sysctl_pmtu_disc; 978 int sysctl_pmtu_disc;
979 int sysctl_backup_only;
979 980
980 /* ip_vs_lblc */ 981 /* ip_vs_lblc */
981 int sysctl_lblc_expiration; 982 int sysctl_lblc_expiration;
@@ -1067,6 +1068,12 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs)
1067 return ipvs->sysctl_pmtu_disc; 1068 return ipvs->sysctl_pmtu_disc;
1068} 1069}
1069 1070
1071static inline int sysctl_backup_only(struct netns_ipvs *ipvs)
1072{
1073 return ipvs->sync_state & IP_VS_STATE_BACKUP &&
1074 ipvs->sysctl_backup_only;
1075}
1076
1070#else 1077#else
1071 1078
1072static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) 1079static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs)
@@ -1114,6 +1121,11 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs)
1114 return 1; 1121 return 1;
1115} 1122}
1116 1123
1124static inline int sysctl_backup_only(struct netns_ipvs *ipvs)
1125{
1126 return 0;
1127}
1128
1117#endif 1129#endif
1118 1130
1119/* 1131/*
diff --git a/include/net/ipip.h b/include/net/ipip.h
index fd19625ff99d..982141c15200 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -77,15 +77,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb,
77{ 77{
78 struct iphdr *iph = ip_hdr(skb); 78 struct iphdr *iph = ip_hdr(skb);
79 79
80 if (iph->frag_off & htons(IP_DF)) 80 /* Use inner packet iph-id if possible. */
81 iph->id = 0; 81 if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
82 else { 82 iph->id = old_iph->id;
83 /* Use inner packet iph-id if possible. */ 83 else
84 if (skb->protocol == htons(ETH_P_IP) && old_iph->id) 84 __ip_select_ident(iph, dst,
85 iph->id = old_iph->id; 85 (skb_shinfo(skb)->gso_segs ?: 1) - 1);
86 else
87 __ip_select_ident(iph, dst,
88 (skb_shinfo(skb)->gso_segs ?: 1) - 1);
89 }
90} 86}
91#endif 87#endif
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index f74109144d3f..f132924cc9da 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -256,7 +256,8 @@ static inline __u32 irlmp_get_daddr(const struct lsap_cb *self)
256 return (self && self->lap) ? self->lap->daddr : 0; 256 return (self && self->lap) ? self->lap->daddr : 0;
257} 257}
258 258
259extern const char *irlmp_reasons[]; 259const char *irlmp_reason_str(LM_REASON reason);
260
260extern int sysctl_discovery_timeout; 261extern int sysctl_discovery_timeout;
261extern int sysctl_discovery_slots; 262extern int sysctl_discovery_slots;
262extern int sysctl_discovery; 263extern int sysctl_discovery;
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index cc7c19732389..714cc9a54a4c 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -130,6 +130,14 @@ struct iucv_sock {
130 enum iucv_tx_notify n); 130 enum iucv_tx_notify n);
131}; 131};
132 132
133struct iucv_skb_cb {
134 u32 class; /* target class of message */
135 u32 tag; /* tag associated with message */
136 u32 offset; /* offset for skb receival */
137};
138
139#define IUCV_SKB_CB(__skb) ((struct iucv_skb_cb *)&((__skb)->cb[0]))
140
133/* iucv socket options (SOL_IUCV) */ 141/* iucv socket options (SOL_IUCV) */
134#define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */ 142#define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */
135#define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */ 143#define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */
diff --git a/include/net/scm.h b/include/net/scm.h
index 975cca01048b..b11708105681 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -56,8 +56,8 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm,
56 scm->pid = get_pid(pid); 56 scm->pid = get_pid(pid);
57 scm->cred = cred ? get_cred(cred) : NULL; 57 scm->cred = cred ? get_cred(cred) : NULL;
58 scm->creds.pid = pid_vnr(pid); 58 scm->creds.pid = pid_vnr(pid);
59 scm->creds.uid = cred ? cred->euid : INVALID_UID; 59 scm->creds.uid = cred ? cred->uid : INVALID_UID;
60 scm->creds.gid = cred ? cred->egid : INVALID_GID; 60 scm->creds.gid = cred ? cred->gid : INVALID_GID;
61} 61}
62 62
63static __inline__ void scm_destroy_cred(struct scm_cookie *scm) 63static __inline__ void scm_destroy_cred(struct scm_cookie *scm)
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 3bbbd78e1439..2d56e428506c 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -65,6 +65,18 @@ struct pcmcia_driver {
65int pcmcia_register_driver(struct pcmcia_driver *driver); 65int pcmcia_register_driver(struct pcmcia_driver *driver);
66void pcmcia_unregister_driver(struct pcmcia_driver *driver); 66void pcmcia_unregister_driver(struct pcmcia_driver *driver);
67 67
68/**
69 * module_pcmcia_driver() - Helper macro for registering a pcmcia driver
70 * @__pcmcia_driver: pcmcia_driver struct
71 *
72 * Helper macro for pcmcia drivers which do not do anything special in module
73 * init/exit. This eliminates a lot of boilerplate. Each module may only use
74 * this macro once, and calling it replaces module_init() and module_exit().
75 */
76#define module_pcmcia_driver(__pcmcia_driver) \
77 module_driver(__pcmcia_driver, pcmcia_register_driver, \
78 pcmcia_unregister_driver)
79
68/* for struct resource * array embedded in struct pcmcia_device */ 80/* for struct resource * array embedded in struct pcmcia_device */
69enum { 81enum {
70 PCMCIA_IOPORT_0, 82 PCMCIA_IOPORT_0,
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 399162b50a8d..e1379b4e8faf 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -1074,7 +1074,8 @@ void fc_rport_terminate_io(struct fc_rport *);
1074/* 1074/*
1075 * DISCOVERY LAYER 1075 * DISCOVERY LAYER
1076 *****************************/ 1076 *****************************/
1077int fc_disc_init(struct fc_lport *); 1077void fc_disc_init(struct fc_lport *);
1078void fc_disc_config(struct fc_lport *, void *);
1078 1079
1079static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc) 1080static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc)
1080{ 1081{
diff --git a/include/sound/max98090.h b/include/sound/max98090.h
index 95efb13f8478..95efb13f8478 100755..100644
--- a/include/sound/max98090.h
+++ b/include/sound/max98090.h
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index e1ef63d4a5c4..44a30b108683 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -488,6 +488,7 @@ struct snd_soc_dapm_path {
488 /* status */ 488 /* status */
489 u32 connect:1; /* source and sink widgets are connected */ 489 u32 connect:1; /* source and sink widgets are connected */
490 u32 walked:1; /* path has been walked */ 490 u32 walked:1; /* path has been walked */
491 u32 walking:1; /* path is in the process of being walked */
491 u32 weak:1; /* path ignored for power management */ 492 u32 weak:1; /* path ignored for power management */
492 493
493 int (*connected)(struct snd_soc_dapm_widget *source, 494 int (*connected)(struct snd_soc_dapm_widget *source,
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 9961726523d0..9c1467357b03 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -257,6 +257,7 @@ TRACE_EVENT(block_bio_bounce,
257 257
258/** 258/**
259 * block_bio_complete - completed all work on the block operation 259 * block_bio_complete - completed all work on the block operation
260 * @q: queue holding the block operation
260 * @bio: block operation completed 261 * @bio: block operation completed
261 * @error: io error value 262 * @error: io error value
262 * 263 *
@@ -265,9 +266,9 @@ TRACE_EVENT(block_bio_bounce,
265 */ 266 */
266TRACE_EVENT(block_bio_complete, 267TRACE_EVENT(block_bio_complete,
267 268
268 TP_PROTO(struct bio *bio, int error), 269 TP_PROTO(struct request_queue *q, struct bio *bio, int error),
269 270
270 TP_ARGS(bio, error), 271 TP_ARGS(q, bio, error),
271 272
272 TP_STRUCT__entry( 273 TP_STRUCT__entry(
273 __field( dev_t, dev ) 274 __field( dev_t, dev )
@@ -278,8 +279,7 @@ TRACE_EVENT(block_bio_complete,
278 ), 279 ),
279 280
280 TP_fast_assign( 281 TP_fast_assign(
281 __entry->dev = bio->bi_bdev ? 282 __entry->dev = bio->bi_bdev->bd_dev;
282 bio->bi_bdev->bd_dev : 0;
283 __entry->sector = bio->bi_sector; 283 __entry->sector = bio->bi_sector;
284 __entry->nr_sector = bio->bi_size >> 9; 284 __entry->nr_sector = bio->bi_size >> 9;
285 __entry->error = error; 285 __entry->error = error;
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
index 41a7dbd570e2..a43a2f67bd8e 100644
--- a/include/trace/events/regmap.h
+++ b/include/trace/events/regmap.h
@@ -175,6 +175,54 @@ DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
175 175
176); 176);
177 177
178DECLARE_EVENT_CLASS(regmap_async,
179
180 TP_PROTO(struct device *dev),
181
182 TP_ARGS(dev),
183
184 TP_STRUCT__entry(
185 __string( name, dev_name(dev) )
186 ),
187
188 TP_fast_assign(
189 __assign_str(name, dev_name(dev));
190 ),
191
192 TP_printk("%s", __get_str(name))
193);
194
195DEFINE_EVENT(regmap_block, regmap_async_write_start,
196
197 TP_PROTO(struct device *dev, unsigned int reg, int count),
198
199 TP_ARGS(dev, reg, count)
200);
201
202DEFINE_EVENT(regmap_async, regmap_async_io_complete,
203
204 TP_PROTO(struct device *dev),
205
206 TP_ARGS(dev)
207
208);
209
210DEFINE_EVENT(regmap_async, regmap_async_complete_start,
211
212 TP_PROTO(struct device *dev),
213
214 TP_ARGS(dev)
215
216);
217
218DEFINE_EVENT(regmap_async, regmap_async_complete_done,
219
220 TP_PROTO(struct device *dev),
221
222 TP_ARGS(dev)
223
224);
225
178#endif /* _TRACE_REGMAP_H */ 226#endif /* _TRACE_REGMAP_H */
179 227
180/* This part must be outside protection */ 228/* This part must be outside protection */
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 5a8671e8a67f..e5586caff67a 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -147,7 +147,7 @@ TRACE_EVENT(sched_switch,
147 __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|", 147 __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|",
148 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, 148 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" },
149 { 16, "Z" }, { 32, "X" }, { 64, "x" }, 149 { 16, "Z" }, { 32, "X" }, { 64, "x" },
150 { 128, "W" }) : "R", 150 { 128, "K" }, { 256, "W" }, { 512, "P" }) : "R",
151 __entry->prev_state & TASK_STATE_MAX ? "+" : "", 151 __entry->prev_state & TASK_STATE_MAX ? "+" : "",
152 __entry->next_comm, __entry->next_pid, __entry->next_prio) 152 __entry->next_comm, __entry->next_pid, __entry->next_prio)
153); 153);
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 40dc5e8fe340..19edd7facaa1 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -227,29 +227,18 @@ static notrace enum print_line_t \
227ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ 227ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
228 struct trace_event *trace_event) \ 228 struct trace_event *trace_event) \
229{ \ 229{ \
230 struct ftrace_event_call *event; \
231 struct trace_seq *s = &iter->seq; \ 230 struct trace_seq *s = &iter->seq; \
231 struct trace_seq __maybe_unused *p = &iter->tmp_seq; \
232 struct ftrace_raw_##call *field; \ 232 struct ftrace_raw_##call *field; \
233 struct trace_entry *entry; \
234 struct trace_seq *p = &iter->tmp_seq; \
235 int ret; \ 233 int ret; \
236 \ 234 \
237 event = container_of(trace_event, struct ftrace_event_call, \ 235 field = (typeof(field))iter->ent; \
238 event); \
239 \
240 entry = iter->ent; \
241 \
242 if (entry->type != event->event.type) { \
243 WARN_ON_ONCE(1); \
244 return TRACE_TYPE_UNHANDLED; \
245 } \
246 \
247 field = (typeof(field))entry; \
248 \ 236 \
249 trace_seq_init(p); \ 237 ret = ftrace_raw_output_prep(iter, trace_event); \
250 ret = trace_seq_printf(s, "%s: ", event->name); \
251 if (ret) \ 238 if (ret) \
252 ret = trace_seq_printf(s, print); \ 239 return ret; \
240 \
241 ret = trace_seq_printf(s, print); \
253 if (!ret) \ 242 if (!ret) \
254 return TRACE_TYPE_PARTIAL_LINE; \ 243 return TRACE_TYPE_PARTIAL_LINE; \
255 \ 244 \
@@ -335,7 +324,7 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \
335 324
336#undef DECLARE_EVENT_CLASS 325#undef DECLARE_EVENT_CLASS
337#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ 326#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
338static int notrace \ 327static int notrace __init \
339ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ 328ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
340{ \ 329{ \
341 struct ftrace_raw_##call field; \ 330 struct ftrace_raw_##call field; \
@@ -414,7 +403,8 @@ static inline notrace int ftrace_get_offsets_##call( \
414 * 403 *
415 * static void ftrace_raw_event_<call>(void *__data, proto) 404 * static void ftrace_raw_event_<call>(void *__data, proto)
416 * { 405 * {
417 * struct ftrace_event_call *event_call = __data; 406 * struct ftrace_event_file *ftrace_file = __data;
407 * struct ftrace_event_call *event_call = ftrace_file->event_call;
418 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; 408 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
419 * struct ring_buffer_event *event; 409 * struct ring_buffer_event *event;
420 * struct ftrace_raw_<call> *entry; <-- defined in stage 1 410 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
@@ -423,12 +413,16 @@ static inline notrace int ftrace_get_offsets_##call( \
423 * int __data_size; 413 * int __data_size;
424 * int pc; 414 * int pc;
425 * 415 *
416 * if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT,
417 * &ftrace_file->flags))
418 * return;
419 *
426 * local_save_flags(irq_flags); 420 * local_save_flags(irq_flags);
427 * pc = preempt_count(); 421 * pc = preempt_count();
428 * 422 *
429 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); 423 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
430 * 424 *
431 * event = trace_current_buffer_lock_reserve(&buffer, 425 * event = trace_event_buffer_lock_reserve(&buffer, ftrace_file,
432 * event_<call>->event.type, 426 * event_<call>->event.type,
433 * sizeof(*entry) + __data_size, 427 * sizeof(*entry) + __data_size,
434 * irq_flags, pc); 428 * irq_flags, pc);
@@ -440,7 +434,7 @@ static inline notrace int ftrace_get_offsets_##call( \
440 * __array macros. 434 * __array macros.
441 * 435 *
442 * if (!filter_current_check_discard(buffer, event_call, entry, event)) 436 * if (!filter_current_check_discard(buffer, event_call, entry, event))
443 * trace_current_buffer_unlock_commit(buffer, 437 * trace_nowake_buffer_unlock_commit(buffer,
444 * event, irq_flags, pc); 438 * event, irq_flags, pc);
445 * } 439 * }
446 * 440 *
@@ -518,7 +512,8 @@ static inline notrace int ftrace_get_offsets_##call( \
518static notrace void \ 512static notrace void \
519ftrace_raw_event_##call(void *__data, proto) \ 513ftrace_raw_event_##call(void *__data, proto) \
520{ \ 514{ \
521 struct ftrace_event_call *event_call = __data; \ 515 struct ftrace_event_file *ftrace_file = __data; \
516 struct ftrace_event_call *event_call = ftrace_file->event_call; \
522 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 517 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
523 struct ring_buffer_event *event; \ 518 struct ring_buffer_event *event; \
524 struct ftrace_raw_##call *entry; \ 519 struct ftrace_raw_##call *entry; \
@@ -527,12 +522,16 @@ ftrace_raw_event_##call(void *__data, proto) \
527 int __data_size; \ 522 int __data_size; \
528 int pc; \ 523 int pc; \
529 \ 524 \
525 if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, \
526 &ftrace_file->flags)) \
527 return; \
528 \
530 local_save_flags(irq_flags); \ 529 local_save_flags(irq_flags); \
531 pc = preempt_count(); \ 530 pc = preempt_count(); \
532 \ 531 \
533 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 532 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
534 \ 533 \
535 event = trace_current_buffer_lock_reserve(&buffer, \ 534 event = trace_event_buffer_lock_reserve(&buffer, ftrace_file, \
536 event_call->event.type, \ 535 event_call->event.type, \
537 sizeof(*entry) + __data_size, \ 536 sizeof(*entry) + __data_size, \
538 irq_flags, pc); \ 537 irq_flags, pc); \
@@ -581,7 +580,7 @@ static inline void ftrace_test_probe_##call(void) \
581#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 580#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
582_TRACE_PERF_PROTO(call, PARAMS(proto)); \ 581_TRACE_PERF_PROTO(call, PARAMS(proto)); \
583static const char print_fmt_##call[] = print; \ 582static const char print_fmt_##call[] = print; \
584static struct ftrace_event_class __used event_class_##call = { \ 583static struct ftrace_event_class __used __refdata event_class_##call = { \
585 .system = __stringify(TRACE_SYSTEM), \ 584 .system = __stringify(TRACE_SYSTEM), \
586 .define_fields = ftrace_define_fields_##call, \ 585 .define_fields = ftrace_define_fields_##call, \
587 .fields = LIST_HEAD_INIT(event_class_##call.fields),\ 586 .fields = LIST_HEAD_INIT(event_class_##call.fields),\
@@ -705,5 +704,3 @@ static inline void perf_test_probe_##call(void) \
705#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 704#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
706#endif /* CONFIG_PERF_EVENTS */ 705#endif /* CONFIG_PERF_EVENTS */
707 706
708#undef _TRACE_PROFILE_INIT
709
diff --git a/include/uapi/linux/connector.h b/include/uapi/linux/connector.h
index 8761a0349c74..4cb283505e45 100644
--- a/include/uapi/linux/connector.h
+++ b/include/uapi/linux/connector.h
@@ -44,8 +44,11 @@
44#define CN_VAL_DRBD 0x1 44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */ 45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46#define CN_KVP_VAL 0x1 /* queries from the kernel */ 46#define CN_KVP_VAL 0x1 /* queries from the kernel */
47#define CN_VSS_IDX 0xA /* HyperV VSS */
48#define CN_VSS_VAL 0x1 /* queries from the kernel */
47 49
48#define CN_NETLINK_USERS 10 /* Highest index + 1 */ 50
51#define CN_NETLINK_USERS 11 /* Highest index + 1 */
49 52
50/* 53/*
51 * Maximum connector's message size. 54 * Maximum connector's message size.
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index 4c43b4448792..706d035fa748 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -95,15 +95,10 @@
95#ifndef _LINUX_FUSE_H 95#ifndef _LINUX_FUSE_H
96#define _LINUX_FUSE_H 96#define _LINUX_FUSE_H
97 97
98#ifdef __linux__ 98#ifdef __KERNEL__
99#include <linux/types.h> 99#include <linux/types.h>
100#else 100#else
101#include <stdint.h> 101#include <stdint.h>
102#define __u64 uint64_t
103#define __s64 int64_t
104#define __u32 uint32_t
105#define __s32 int32_t
106#define __u16 uint16_t
107#endif 102#endif
108 103
109/* 104/*
@@ -139,42 +134,42 @@
139 userspace works under 64bit kernels */ 134 userspace works under 64bit kernels */
140 135
141struct fuse_attr { 136struct fuse_attr {
142 __u64 ino; 137 uint64_t ino;
143 __u64 size; 138 uint64_t size;
144 __u64 blocks; 139 uint64_t blocks;
145 __u64 atime; 140 uint64_t atime;
146 __u64 mtime; 141 uint64_t mtime;
147 __u64 ctime; 142 uint64_t ctime;
148 __u32 atimensec; 143 uint32_t atimensec;
149 __u32 mtimensec; 144 uint32_t mtimensec;
150 __u32 ctimensec; 145 uint32_t ctimensec;
151 __u32 mode; 146 uint32_t mode;
152 __u32 nlink; 147 uint32_t nlink;
153 __u32 uid; 148 uint32_t uid;
154 __u32 gid; 149 uint32_t gid;
155 __u32 rdev; 150 uint32_t rdev;
156 __u32 blksize; 151 uint32_t blksize;
157 __u32 padding; 152 uint32_t padding;
158}; 153};
159 154
160struct fuse_kstatfs { 155struct fuse_kstatfs {
161 __u64 blocks; 156 uint64_t blocks;
162 __u64 bfree; 157 uint64_t bfree;
163 __u64 bavail; 158 uint64_t bavail;
164 __u64 files; 159 uint64_t files;
165 __u64 ffree; 160 uint64_t ffree;
166 __u32 bsize; 161 uint32_t bsize;
167 __u32 namelen; 162 uint32_t namelen;
168 __u32 frsize; 163 uint32_t frsize;
169 __u32 padding; 164 uint32_t padding;
170 __u32 spare[6]; 165 uint32_t spare[6];
171}; 166};
172 167
173struct fuse_file_lock { 168struct fuse_file_lock {
174 __u64 start; 169 uint64_t start;
175 __u64 end; 170 uint64_t end;
176 __u32 type; 171 uint32_t type;
177 __u32 pid; /* tgid */ 172 uint32_t pid; /* tgid */
178}; 173};
179 174
180/** 175/**
@@ -364,143 +359,143 @@ enum fuse_notify_code {
364#define FUSE_COMPAT_ENTRY_OUT_SIZE 120 359#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
365 360
366struct fuse_entry_out { 361struct fuse_entry_out {
367 __u64 nodeid; /* Inode ID */ 362 uint64_t nodeid; /* Inode ID */
368 __u64 generation; /* Inode generation: nodeid:gen must 363 uint64_t generation; /* Inode generation: nodeid:gen must
369 be unique for the fs's lifetime */ 364 be unique for the fs's lifetime */
370 __u64 entry_valid; /* Cache timeout for the name */ 365 uint64_t entry_valid; /* Cache timeout for the name */
371 __u64 attr_valid; /* Cache timeout for the attributes */ 366 uint64_t attr_valid; /* Cache timeout for the attributes */
372 __u32 entry_valid_nsec; 367 uint32_t entry_valid_nsec;
373 __u32 attr_valid_nsec; 368 uint32_t attr_valid_nsec;
374 struct fuse_attr attr; 369 struct fuse_attr attr;
375}; 370};
376 371
377struct fuse_forget_in { 372struct fuse_forget_in {
378 __u64 nlookup; 373 uint64_t nlookup;
379}; 374};
380 375
381struct fuse_forget_one { 376struct fuse_forget_one {
382 __u64 nodeid; 377 uint64_t nodeid;
383 __u64 nlookup; 378 uint64_t nlookup;
384}; 379};
385 380
386struct fuse_batch_forget_in { 381struct fuse_batch_forget_in {
387 __u32 count; 382 uint32_t count;
388 __u32 dummy; 383 uint32_t dummy;
389}; 384};
390 385
391struct fuse_getattr_in { 386struct fuse_getattr_in {
392 __u32 getattr_flags; 387 uint32_t getattr_flags;
393 __u32 dummy; 388 uint32_t dummy;
394 __u64 fh; 389 uint64_t fh;
395}; 390};
396 391
397#define FUSE_COMPAT_ATTR_OUT_SIZE 96 392#define FUSE_COMPAT_ATTR_OUT_SIZE 96
398 393
399struct fuse_attr_out { 394struct fuse_attr_out {
400 __u64 attr_valid; /* Cache timeout for the attributes */ 395 uint64_t attr_valid; /* Cache timeout for the attributes */
401 __u32 attr_valid_nsec; 396 uint32_t attr_valid_nsec;
402 __u32 dummy; 397 uint32_t dummy;
403 struct fuse_attr attr; 398 struct fuse_attr attr;
404}; 399};
405 400
406#define FUSE_COMPAT_MKNOD_IN_SIZE 8 401#define FUSE_COMPAT_MKNOD_IN_SIZE 8
407 402
408struct fuse_mknod_in { 403struct fuse_mknod_in {
409 __u32 mode; 404 uint32_t mode;
410 __u32 rdev; 405 uint32_t rdev;
411 __u32 umask; 406 uint32_t umask;
412 __u32 padding; 407 uint32_t padding;
413}; 408};
414 409
415struct fuse_mkdir_in { 410struct fuse_mkdir_in {
416 __u32 mode; 411 uint32_t mode;
417 __u32 umask; 412 uint32_t umask;
418}; 413};
419 414
420struct fuse_rename_in { 415struct fuse_rename_in {
421 __u64 newdir; 416 uint64_t newdir;
422}; 417};
423 418
424struct fuse_link_in { 419struct fuse_link_in {
425 __u64 oldnodeid; 420 uint64_t oldnodeid;
426}; 421};
427 422
428struct fuse_setattr_in { 423struct fuse_setattr_in {
429 __u32 valid; 424 uint32_t valid;
430 __u32 padding; 425 uint32_t padding;
431 __u64 fh; 426 uint64_t fh;
432 __u64 size; 427 uint64_t size;
433 __u64 lock_owner; 428 uint64_t lock_owner;
434 __u64 atime; 429 uint64_t atime;
435 __u64 mtime; 430 uint64_t mtime;
436 __u64 unused2; 431 uint64_t unused2;
437 __u32 atimensec; 432 uint32_t atimensec;
438 __u32 mtimensec; 433 uint32_t mtimensec;
439 __u32 unused3; 434 uint32_t unused3;
440 __u32 mode; 435 uint32_t mode;
441 __u32 unused4; 436 uint32_t unused4;
442 __u32 uid; 437 uint32_t uid;
443 __u32 gid; 438 uint32_t gid;
444 __u32 unused5; 439 uint32_t unused5;
445}; 440};
446 441
447struct fuse_open_in { 442struct fuse_open_in {
448 __u32 flags; 443 uint32_t flags;
449 __u32 unused; 444 uint32_t unused;
450}; 445};
451 446
452struct fuse_create_in { 447struct fuse_create_in {
453 __u32 flags; 448 uint32_t flags;
454 __u32 mode; 449 uint32_t mode;
455 __u32 umask; 450 uint32_t umask;
456 __u32 padding; 451 uint32_t padding;
457}; 452};
458 453
459struct fuse_open_out { 454struct fuse_open_out {
460 __u64 fh; 455 uint64_t fh;
461 __u32 open_flags; 456 uint32_t open_flags;
462 __u32 padding; 457 uint32_t padding;
463}; 458};
464 459
465struct fuse_release_in { 460struct fuse_release_in {
466 __u64 fh; 461 uint64_t fh;
467 __u32 flags; 462 uint32_t flags;
468 __u32 release_flags; 463 uint32_t release_flags;
469 __u64 lock_owner; 464 uint64_t lock_owner;
470}; 465};
471 466
472struct fuse_flush_in { 467struct fuse_flush_in {
473 __u64 fh; 468 uint64_t fh;
474 __u32 unused; 469 uint32_t unused;
475 __u32 padding; 470 uint32_t padding;
476 __u64 lock_owner; 471 uint64_t lock_owner;
477}; 472};
478 473
479struct fuse_read_in { 474struct fuse_read_in {
480 __u64 fh; 475 uint64_t fh;
481 __u64 offset; 476 uint64_t offset;
482 __u32 size; 477 uint32_t size;
483 __u32 read_flags; 478 uint32_t read_flags;
484 __u64 lock_owner; 479 uint64_t lock_owner;
485 __u32 flags; 480 uint32_t flags;
486 __u32 padding; 481 uint32_t padding;
487}; 482};
488 483
489#define FUSE_COMPAT_WRITE_IN_SIZE 24 484#define FUSE_COMPAT_WRITE_IN_SIZE 24
490 485
491struct fuse_write_in { 486struct fuse_write_in {
492 __u64 fh; 487 uint64_t fh;
493 __u64 offset; 488 uint64_t offset;
494 __u32 size; 489 uint32_t size;
495 __u32 write_flags; 490 uint32_t write_flags;
496 __u64 lock_owner; 491 uint64_t lock_owner;
497 __u32 flags; 492 uint32_t flags;
498 __u32 padding; 493 uint32_t padding;
499}; 494};
500 495
501struct fuse_write_out { 496struct fuse_write_out {
502 __u32 size; 497 uint32_t size;
503 __u32 padding; 498 uint32_t padding;
504}; 499};
505 500
506#define FUSE_COMPAT_STATFS_SIZE 48 501#define FUSE_COMPAT_STATFS_SIZE 48
@@ -510,32 +505,32 @@ struct fuse_statfs_out {
510}; 505};
511 506
512struct fuse_fsync_in { 507struct fuse_fsync_in {
513 __u64 fh; 508 uint64_t fh;
514 __u32 fsync_flags; 509 uint32_t fsync_flags;
515 __u32 padding; 510 uint32_t padding;
516}; 511};
517 512
518struct fuse_setxattr_in { 513struct fuse_setxattr_in {
519 __u32 size; 514 uint32_t size;
520 __u32 flags; 515 uint32_t flags;
521}; 516};
522 517
523struct fuse_getxattr_in { 518struct fuse_getxattr_in {
524 __u32 size; 519 uint32_t size;
525 __u32 padding; 520 uint32_t padding;
526}; 521};
527 522
528struct fuse_getxattr_out { 523struct fuse_getxattr_out {
529 __u32 size; 524 uint32_t size;
530 __u32 padding; 525 uint32_t padding;
531}; 526};
532 527
533struct fuse_lk_in { 528struct fuse_lk_in {
534 __u64 fh; 529 uint64_t fh;
535 __u64 owner; 530 uint64_t owner;
536 struct fuse_file_lock lk; 531 struct fuse_file_lock lk;
537 __u32 lk_flags; 532 uint32_t lk_flags;
538 __u32 padding; 533 uint32_t padding;
539}; 534};
540 535
541struct fuse_lk_out { 536struct fuse_lk_out {
@@ -543,134 +538,135 @@ struct fuse_lk_out {
543}; 538};
544 539
545struct fuse_access_in { 540struct fuse_access_in {
546 __u32 mask; 541 uint32_t mask;
547 __u32 padding; 542 uint32_t padding;
548}; 543};
549 544
550struct fuse_init_in { 545struct fuse_init_in {
551 __u32 major; 546 uint32_t major;
552 __u32 minor; 547 uint32_t minor;
553 __u32 max_readahead; 548 uint32_t max_readahead;
554 __u32 flags; 549 uint32_t flags;
555}; 550};
556 551
557struct fuse_init_out { 552struct fuse_init_out {
558 __u32 major; 553 uint32_t major;
559 __u32 minor; 554 uint32_t minor;
560 __u32 max_readahead; 555 uint32_t max_readahead;
561 __u32 flags; 556 uint32_t flags;
562 __u16 max_background; 557 uint16_t max_background;
563 __u16 congestion_threshold; 558 uint16_t congestion_threshold;
564 __u32 max_write; 559 uint32_t max_write;
565}; 560};
566 561
567#define CUSE_INIT_INFO_MAX 4096 562#define CUSE_INIT_INFO_MAX 4096
568 563
569struct cuse_init_in { 564struct cuse_init_in {
570 __u32 major; 565 uint32_t major;
571 __u32 minor; 566 uint32_t minor;
572 __u32 unused; 567 uint32_t unused;
573 __u32 flags; 568 uint32_t flags;
574}; 569};
575 570
576struct cuse_init_out { 571struct cuse_init_out {
577 __u32 major; 572 uint32_t major;
578 __u32 minor; 573 uint32_t minor;
579 __u32 unused; 574 uint32_t unused;
580 __u32 flags; 575 uint32_t flags;
581 __u32 max_read; 576 uint32_t max_read;
582 __u32 max_write; 577 uint32_t max_write;
583 __u32 dev_major; /* chardev major */ 578 uint32_t dev_major; /* chardev major */
584 __u32 dev_minor; /* chardev minor */ 579 uint32_t dev_minor; /* chardev minor */
585 __u32 spare[10]; 580 uint32_t spare[10];
586}; 581};
587 582
588struct fuse_interrupt_in { 583struct fuse_interrupt_in {
589 __u64 unique; 584 uint64_t unique;
590}; 585};
591 586
592struct fuse_bmap_in { 587struct fuse_bmap_in {
593 __u64 block; 588 uint64_t block;
594 __u32 blocksize; 589 uint32_t blocksize;
595 __u32 padding; 590 uint32_t padding;
596}; 591};
597 592
598struct fuse_bmap_out { 593struct fuse_bmap_out {
599 __u64 block; 594 uint64_t block;
600}; 595};
601 596
602struct fuse_ioctl_in { 597struct fuse_ioctl_in {
603 __u64 fh; 598 uint64_t fh;
604 __u32 flags; 599 uint32_t flags;
605 __u32 cmd; 600 uint32_t cmd;
606 __u64 arg; 601 uint64_t arg;
607 __u32 in_size; 602 uint32_t in_size;
608 __u32 out_size; 603 uint32_t out_size;
609}; 604};
610 605
611struct fuse_ioctl_iovec { 606struct fuse_ioctl_iovec {
612 __u64 base; 607 uint64_t base;
613 __u64 len; 608 uint64_t len;
614}; 609};
615 610
616struct fuse_ioctl_out { 611struct fuse_ioctl_out {
617 __s32 result; 612 int32_t result;
618 __u32 flags; 613 uint32_t flags;
619 __u32 in_iovs; 614 uint32_t in_iovs;
620 __u32 out_iovs; 615 uint32_t out_iovs;
621}; 616};
622 617
623struct fuse_poll_in { 618struct fuse_poll_in {
624 __u64 fh; 619 uint64_t fh;
625 __u64 kh; 620 uint64_t kh;
626 __u32 flags; 621 uint32_t flags;
627 __u32 events; 622 uint32_t events;
628}; 623};
629 624
630struct fuse_poll_out { 625struct fuse_poll_out {
631 __u32 revents; 626 uint32_t revents;
632 __u32 padding; 627 uint32_t padding;
633}; 628};
634 629
635struct fuse_notify_poll_wakeup_out { 630struct fuse_notify_poll_wakeup_out {
636 __u64 kh; 631 uint64_t kh;
637}; 632};
638 633
639struct fuse_fallocate_in { 634struct fuse_fallocate_in {
640 __u64 fh; 635 uint64_t fh;
641 __u64 offset; 636 uint64_t offset;
642 __u64 length; 637 uint64_t length;
643 __u32 mode; 638 uint32_t mode;
644 __u32 padding; 639 uint32_t padding;
645}; 640};
646 641
647struct fuse_in_header { 642struct fuse_in_header {
648 __u32 len; 643 uint32_t len;
649 __u32 opcode; 644 uint32_t opcode;
650 __u64 unique; 645 uint64_t unique;
651 __u64 nodeid; 646 uint64_t nodeid;
652 __u32 uid; 647 uint32_t uid;
653 __u32 gid; 648 uint32_t gid;
654 __u32 pid; 649 uint32_t pid;
655 __u32 padding; 650 uint32_t padding;
656}; 651};
657 652
658struct fuse_out_header { 653struct fuse_out_header {
659 __u32 len; 654 uint32_t len;
660 __s32 error; 655 int32_t error;
661 __u64 unique; 656 uint64_t unique;
662}; 657};
663 658
664struct fuse_dirent { 659struct fuse_dirent {
665 __u64 ino; 660 uint64_t ino;
666 __u64 off; 661 uint64_t off;
667 __u32 namelen; 662 uint32_t namelen;
668 __u32 type; 663 uint32_t type;
669 char name[]; 664 char name[];
670}; 665};
671 666
672#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) 667#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
673#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) 668#define FUSE_DIRENT_ALIGN(x) \
669 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
674#define FUSE_DIRENT_SIZE(d) \ 670#define FUSE_DIRENT_SIZE(d) \
675 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 671 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
676 672
@@ -685,47 +681,47 @@ struct fuse_direntplus {
685 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen) 681 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
686 682
687struct fuse_notify_inval_inode_out { 683struct fuse_notify_inval_inode_out {
688 __u64 ino; 684 uint64_t ino;
689 __s64 off; 685 int64_t off;
690 __s64 len; 686 int64_t len;
691}; 687};
692 688
693struct fuse_notify_inval_entry_out { 689struct fuse_notify_inval_entry_out {
694 __u64 parent; 690 uint64_t parent;
695 __u32 namelen; 691 uint32_t namelen;
696 __u32 padding; 692 uint32_t padding;
697}; 693};
698 694
699struct fuse_notify_delete_out { 695struct fuse_notify_delete_out {
700 __u64 parent; 696 uint64_t parent;
701 __u64 child; 697 uint64_t child;
702 __u32 namelen; 698 uint32_t namelen;
703 __u32 padding; 699 uint32_t padding;
704}; 700};
705 701
706struct fuse_notify_store_out { 702struct fuse_notify_store_out {
707 __u64 nodeid; 703 uint64_t nodeid;
708 __u64 offset; 704 uint64_t offset;
709 __u32 size; 705 uint32_t size;
710 __u32 padding; 706 uint32_t padding;
711}; 707};
712 708
713struct fuse_notify_retrieve_out { 709struct fuse_notify_retrieve_out {
714 __u64 notify_unique; 710 uint64_t notify_unique;
715 __u64 nodeid; 711 uint64_t nodeid;
716 __u64 offset; 712 uint64_t offset;
717 __u32 size; 713 uint32_t size;
718 __u32 padding; 714 uint32_t padding;
719}; 715};
720 716
721/* Matches the size of fuse_write_in */ 717/* Matches the size of fuse_write_in */
722struct fuse_notify_retrieve_in { 718struct fuse_notify_retrieve_in {
723 __u64 dummy1; 719 uint64_t dummy1;
724 __u64 offset; 720 uint64_t offset;
725 __u32 size; 721 uint32_t size;
726 __u32 dummy2; 722 uint32_t dummy2;
727 __u64 dummy3; 723 uint64_t dummy3;
728 __u64 dummy4; 724 uint64_t dummy4;
729}; 725};
730 726
731#endif /* _LINUX_FUSE_H */ 727#endif /* _LINUX_FUSE_H */
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h
index 93f5fa94a431..afafd703ad92 100644
--- a/include/uapi/linux/packet_diag.h
+++ b/include/uapi/linux/packet_diag.h
@@ -33,9 +33,11 @@ enum {
33 PACKET_DIAG_TX_RING, 33 PACKET_DIAG_TX_RING,
34 PACKET_DIAG_FANOUT, 34 PACKET_DIAG_FANOUT,
35 35
36 PACKET_DIAG_MAX, 36 __PACKET_DIAG_MAX,
37}; 37};
38 38
39#define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
40
39struct packet_diag_info { 41struct packet_diag_info {
40 __u32 pdi_index; 42 __u32 pdi_index;
41 __u32 pdi_version; 43 __u32 pdi_version;
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index ebfadc56d1b4..864e324da80d 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -292,12 +292,12 @@
292 292
293/* Message Signalled Interrupts registers */ 293/* Message Signalled Interrupts registers */
294 294
295#define PCI_MSI_FLAGS 2 /* Various flags */ 295#define PCI_MSI_FLAGS 2 /* Message Control */
296#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */ 296#define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */
297#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */ 297#define PCI_MSI_FLAGS_QMASK 0x000e /* Maximum queue size available */
298#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */ 298#define PCI_MSI_FLAGS_QSIZE 0x0070 /* Message queue size configured */
299#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */ 299#define PCI_MSI_FLAGS_64BIT 0x0080 /* 64-bit addresses allowed */
300#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */ 300#define PCI_MSI_FLAGS_MASKBIT 0x0100 /* Per-vector masking capable */
301#define PCI_MSI_RFU 3 /* Rest of capability flags */ 301#define PCI_MSI_RFU 3 /* Rest of capability flags */
302#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ 302#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
@@ -309,13 +309,17 @@
309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */ 309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
310 310
311/* MSI-X registers */ 311/* MSI-X registers */
312#define PCI_MSIX_FLAGS 2 312#define PCI_MSIX_FLAGS 2 /* Message Control */
313#define PCI_MSIX_FLAGS_QSIZE 0x7FF 313#define PCI_MSIX_FLAGS_QSIZE 0x07FF /* Table size */
314#define PCI_MSIX_FLAGS_ENABLE (1 << 15) 314#define PCI_MSIX_FLAGS_MASKALL 0x4000 /* Mask all vectors for this function */
315#define PCI_MSIX_FLAGS_MASKALL (1 << 14) 315#define PCI_MSIX_FLAGS_ENABLE 0x8000 /* MSI-X enable */
316#define PCI_MSIX_TABLE 4 316#define PCI_MSIX_TABLE 4 /* Table offset */
317#define PCI_MSIX_PBA 8 317#define PCI_MSIX_TABLE_BIR 0x00000007 /* BAR index */
318#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 318#define PCI_MSIX_TABLE_OFFSET 0xfffffff8 /* Offset into specified BAR */
319#define PCI_MSIX_PBA 8 /* Pending Bit Array offset */
320#define PCI_MSIX_PBA_BIR 0x00000007 /* BAR index */
321#define PCI_MSIX_PBA_OFFSET 0xfffffff8 /* Offset into specified BAR */
322#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) /* deprecated */
319#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */ 323#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
320 324
321/* MSI-X entry's format */ 325/* MSI-X entry's format */
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b8a24941db21..b9e2a6a7446f 100644
--- a/include/uapi/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
@@ -39,9 +39,11 @@ enum {
39 UNIX_DIAG_MEMINFO, 39 UNIX_DIAG_MEMINFO,
40 UNIX_DIAG_SHUTDOWN, 40 UNIX_DIAG_SHUTDOWN,
41 41
42 UNIX_DIAG_MAX, 42 __UNIX_DIAG_MAX,
43}; 43};
44 44
45#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)
46
45struct unix_diag_vfs { 47struct unix_diag_vfs {
46 __u32 udiag_vfs_ino; 48 __u32 udiag_vfs_ino;
47 __u32 udiag_vfs_dev; 49 __u32 udiag_vfs_dev;
diff --git a/include/uapi/linux/usb/cdc-wdm.h b/include/uapi/linux/usb/cdc-wdm.h
new file mode 100644
index 000000000000..f03134feebd6
--- /dev/null
+++ b/include/uapi/linux/usb/cdc-wdm.h
@@ -0,0 +1,21 @@
1/*
2 * USB CDC Device Management userspace API definitions
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * version 2 as published by the Free Software Foundation.
7 */
8
9#ifndef _UAPI__LINUX_USB_CDC_WDM_H
10#define _UAPI__LINUX_USB_CDC_WDM_H
11
12/*
13 * This IOCTL is used to retrieve the wMaxCommand for the device,
14 * defining the message limit for both reading and writing.
15 *
16 * For CDC WDM functions this will be the wMaxCommand field of the
17 * Device Management Functional Descriptor.
18 */
19#define IOCTL_WDM_MAX_COMMAND _IOR('H', 0xA0, __u16)
20
21#endif /* _UAPI__LINUX_USB_CDC_WDM_H */
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
index f738e25377ff..aa33fd1b2d4f 100644
--- a/include/uapi/linux/usb/ch9.h
+++ b/include/uapi/linux/usb/ch9.h
@@ -138,7 +138,7 @@
138 138
139/* 139/*
140 * New Feature Selectors as added by USB 3.0 140 * New Feature Selectors as added by USB 3.0
141 * See USB 3.0 spec Table 9-6 141 * See USB 3.0 spec Table 9-7
142 */ 142 */
143#define USB_DEVICE_U1_ENABLE 48 /* dev may initiate U1 transition */ 143#define USB_DEVICE_U1_ENABLE 48 /* dev may initiate U1 transition */
144#define USB_DEVICE_U2_ENABLE 49 /* dev may initiate U2 transition */ 144#define USB_DEVICE_U2_ENABLE 49 /* dev may initiate U2 transition */
@@ -147,7 +147,7 @@
147 147
148#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 148#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
149/* 149/*
150 * Suspend Options, Table 9-7 USB 3.0 spec 150 * Suspend Options, Table 9-8 USB 3.0 spec
151 */ 151 */
152#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) 152#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0))
153#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) 153#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1))
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 28447f1594fa..8deb22672ada 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -30,7 +30,6 @@
30 */ 30 */
31#define ATMEL_LCDC_WIRING_BGR 0 31#define ATMEL_LCDC_WIRING_BGR 0
32#define ATMEL_LCDC_WIRING_RGB 1 32#define ATMEL_LCDC_WIRING_RGB 1
33#define ATMEL_LCDC_WIRING_RGB555 2
34 33
35 34
36 /* LCD Controller info data structure, stored in device platform_data */ 35 /* LCD Controller info data structure, stored in device platform_data */
@@ -62,6 +61,7 @@ struct atmel_lcdfb_info {
62 void (*atmel_lcdfb_power_control)(int on); 61 void (*atmel_lcdfb_power_control)(int on);
63 struct fb_monspecs *default_monspecs; 62 struct fb_monspecs *default_monspecs;
64 u32 pseudo_palette[16]; 63 u32 pseudo_palette[16];
64 bool have_intensity_bit;
65}; 65};
66 66
67#define ATMEL_LCDC_DMABADDR1 0x00 67#define ATMEL_LCDC_DMABADDR1 0x00
diff --git a/include/video/auo_k190xfb.h b/include/video/auo_k190xfb.h
index 609efe8c686e..ac329ee1d753 100644
--- a/include/video/auo_k190xfb.h
+++ b/include/video/auo_k190xfb.h
@@ -22,6 +22,8 @@
22 */ 22 */
23#define AUOK190X_RESOLUTION_800_600 0 23#define AUOK190X_RESOLUTION_800_600 0
24#define AUOK190X_RESOLUTION_1024_768 1 24#define AUOK190X_RESOLUTION_1024_768 1
25#define AUOK190X_RESOLUTION_600_800 4
26#define AUOK190X_RESOLUTION_768_1024 5
25 27
26/* 28/*
27 * struct used by auok190x. board specific stuff comes from *board 29 * struct used by auok190x. board specific stuff comes from *board
@@ -98,7 +100,6 @@ struct auok190x_board {
98 int gpio_nbusy; 100 int gpio_nbusy;
99 101
100 int resolution; 102 int resolution;
101 int rotation;
102 int quirks; 103 int quirks;
103 int fps; 104 int fps;
104}; 105};
diff --git a/include/video/display_timing.h b/include/video/display_timing.h
index 71e9a383a981..5d0259b08e01 100644
--- a/include/video/display_timing.h
+++ b/include/video/display_timing.h
@@ -12,19 +12,22 @@
12#include <linux/bitops.h> 12#include <linux/bitops.h>
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15/* VESA display monitor timing parameters */ 15enum display_flags {
16#define VESA_DMT_HSYNC_LOW BIT(0) 16 DISPLAY_FLAGS_HSYNC_LOW = BIT(0),
17#define VESA_DMT_HSYNC_HIGH BIT(1) 17 DISPLAY_FLAGS_HSYNC_HIGH = BIT(1),
18#define VESA_DMT_VSYNC_LOW BIT(2) 18 DISPLAY_FLAGS_VSYNC_LOW = BIT(2),
19#define VESA_DMT_VSYNC_HIGH BIT(3) 19 DISPLAY_FLAGS_VSYNC_HIGH = BIT(3),
20 20
21/* display specific flags */ 21 /* data enable flag */
22#define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */ 22 DISPLAY_FLAGS_DE_LOW = BIT(4),
23#define DISPLAY_FLAGS_DE_HIGH BIT(1) 23 DISPLAY_FLAGS_DE_HIGH = BIT(5),
24#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */ 24 /* drive data on pos. edge */
25#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */ 25 DISPLAY_FLAGS_PIXDATA_POSEDGE = BIT(6),
26#define DISPLAY_FLAGS_INTERLACED BIT(4) 26 /* drive data on neg. edge */
27#define DISPLAY_FLAGS_DOUBLESCAN BIT(5) 27 DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7),
28 DISPLAY_FLAGS_INTERLACED = BIT(8),
29 DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
30};
28 31
29/* 32/*
30 * A single signal can be specified via a range of minimal and maximal values 33 * A single signal can be specified via a range of minimal and maximal values
@@ -36,12 +39,6 @@ struct timing_entry {
36 u32 max; 39 u32 max;
37}; 40};
38 41
39enum timing_entry_index {
40 TE_MIN = 0,
41 TE_TYP = 1,
42 TE_MAX = 2,
43};
44
45/* 42/*
46 * Single "mode" entry. This describes one set of signal timings a display can 43 * Single "mode" entry. This describes one set of signal timings a display can
47 * have in one setting. This struct can later be converted to struct videomode 44 * have in one setting. This struct can later be converted to struct videomode
@@ -72,8 +69,7 @@ struct display_timing {
72 struct timing_entry vback_porch; /* ver. back porch */ 69 struct timing_entry vback_porch; /* ver. back porch */
73 struct timing_entry vsync_len; /* ver. sync len */ 70 struct timing_entry vsync_len; /* ver. sync len */
74 71
75 unsigned int dmt_flags; /* VESA DMT flags */ 72 enum display_flags flags; /* display flags */
76 unsigned int data_flags; /* video data flags */
77}; 73};
78 74
79/* 75/*
@@ -89,25 +85,6 @@ struct display_timings {
89 struct display_timing **timings; 85 struct display_timing **timings;
90}; 86};
91 87
92/* get value specified by index from struct timing_entry */
93static inline u32 display_timing_get_value(const struct timing_entry *te,
94 enum timing_entry_index index)
95{
96 switch (index) {
97 case TE_MIN:
98 return te->min;
99 break;
100 case TE_TYP:
101 return te->typ;
102 break;
103 case TE_MAX:
104 return te->max;
105 break;
106 default:
107 return te->typ;
108 }
109}
110
111/* get one entry from struct display_timings */ 88/* get one entry from struct display_timings */
112static inline struct display_timing *display_timings_get(const struct 89static inline struct display_timing *display_timings_get(const struct
113 display_timings *disp, 90 display_timings *disp,
diff --git a/include/video/videomode.h b/include/video/videomode.h
index a42156234dd4..3f1049d870d5 100644
--- a/include/video/videomode.h
+++ b/include/video/videomode.h
@@ -29,20 +29,30 @@ struct videomode {
29 u32 vback_porch; 29 u32 vback_porch;
30 u32 vsync_len; 30 u32 vsync_len;
31 31
32 unsigned int dmt_flags; /* VESA DMT flags */ 32 enum display_flags flags; /* display flags */
33 unsigned int data_flags; /* video data flags */
34}; 33};
35 34
36/** 35/**
37 * videomode_from_timing - convert display timing to videomode 36 * videomode_from_timing - convert display timing to videomode
37 * @dt: display_timing structure
38 * @vm: return value
39 *
40 * DESCRIPTION:
41 * This function converts a struct display_timing to a struct videomode.
42 */
43void videomode_from_timing(const struct display_timing *dt,
44 struct videomode *vm);
45
46/**
47 * videomode_from_timings - convert one display timings entry to videomode
38 * @disp: structure with all possible timing entries 48 * @disp: structure with all possible timing entries
39 * @vm: return value 49 * @vm: return value
40 * @index: index into the list of display timings in devicetree 50 * @index: index into the list of display timings in devicetree
41 * 51 *
42 * DESCRIPTION: 52 * DESCRIPTION:
43 * This function converts a struct display_timing to a struct videomode. 53 * This function converts one struct display_timing entry to a struct videomode.
44 */ 54 */
45int videomode_from_timing(const struct display_timings *disp, 55int videomode_from_timings(const struct display_timings *disp,
46 struct videomode *vm, unsigned int index); 56 struct videomode *vm, unsigned int index);
47 57
48#endif 58#endif
diff --git a/include/xen/events.h b/include/xen/events.h
index c6bfe01acf6b..b2b27c6a0f7b 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -90,8 +90,7 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi,
90int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc); 90int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc);
91/* Bind an PSI pirq to an irq. */ 91/* Bind an PSI pirq to an irq. */
92int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, 92int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
93 int pirq, int vector, const char *name, 93 int pirq, const char *name, domid_t domid);
94 domid_t domid);
95#endif 94#endif
96 95
97/* De-allocates the above mentioned physical interrupt. */ 96/* De-allocates the above mentioned physical interrupt. */
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 01c3d62436ef..ffd4652de91c 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -138,11 +138,21 @@ struct blkif_request_discard {
138 uint8_t _pad3; 138 uint8_t _pad3;
139} __attribute__((__packed__)); 139} __attribute__((__packed__));
140 140
141struct blkif_request_other {
142 uint8_t _pad1;
143 blkif_vdev_t _pad2; /* only for read/write requests */
144#ifdef CONFIG_X86_64
145 uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/
146#endif
147 uint64_t id; /* private guest value, echoed in resp */
148} __attribute__((__packed__));
149
141struct blkif_request { 150struct blkif_request {
142 uint8_t operation; /* BLKIF_OP_??? */ 151 uint8_t operation; /* BLKIF_OP_??? */
143 union { 152 union {
144 struct blkif_request_rw rw; 153 struct blkif_request_rw rw;
145 struct blkif_request_discard discard; 154 struct blkif_request_discard discard;
155 struct blkif_request_other other;
146 } u; 156 } u;
147} __attribute__((__packed__)); 157} __attribute__((__packed__));
148 158
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index 1844d31f4552..7000bb1f6e96 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -251,6 +251,12 @@ struct physdev_pci_device_add {
251 251
252#define PHYSDEVOP_pci_device_remove 26 252#define PHYSDEVOP_pci_device_remove 26
253#define PHYSDEVOP_restore_msi_ext 27 253#define PHYSDEVOP_restore_msi_ext 27
254/*
255 * Dom0 should use these two to announce MMIO resources assigned to
256 * MSI-X capable devices won't (prepare) or may (release) change.
257 */
258#define PHYSDEVOP_prepare_msix 30
259#define PHYSDEVOP_release_msix 31
254struct physdev_pci_device { 260struct physdev_pci_device {
255 /* IN */ 261 /* IN */
256 uint16_t seg; 262 uint16_t seg;