aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-09-15 09:08:05 -0400
committerJiri Kosina <jkosina@suse.cz>2011-09-15 09:08:18 -0400
commite060c38434b2caa78efe7cedaff4191040b65a15 (patch)
tree407361230bf6733f63d8e788e4b5e6566ee04818 /include
parent10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff)
parentcc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff)
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches based on more recent version of the tree.
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_drivers.h2
-rw-r--r--include/acpi/acpixf.h3
-rw-r--r--include/acpi/apei.h5
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--include/acpi/processor.h2
-rw-r--r--include/acpi/video.h2
-rw-r--r--include/asm-generic/atomic.h59
-rw-r--r--include/asm-generic/bitops/ext2-atomic-setbit.h11
-rw-r--r--include/asm-generic/bitops/ext2-atomic.h4
-rw-r--r--include/asm-generic/local.h2
-rw-r--r--include/asm-generic/local64.h2
-rw-r--r--include/asm-generic/memory_model.h4
-rw-r--r--include/asm-generic/pci-bridge.h62
-rw-r--r--include/asm-generic/unistd.h2
-rw-r--r--include/drm/drmP.h11
-rw-r--r--include/drm/drm_crtc.h3
-rw-r--r--include/drm/i915_drm.h2
-rw-r--r--include/drm/radeon_drm.h1
-rw-r--r--include/drm/ttm/ttm_bo_api.h3
-rw-r--r--include/drm/ttm/ttm_bo_driver.h6
-rw-r--r--include/drm/ttm/ttm_lock.h2
-rw-r--r--include/drm/ttm/ttm_memory.h2
-rw-r--r--include/drm/ttm/ttm_object.h4
-rw-r--r--include/drm/ttm/ttm_page_alloc.h2
-rw-r--r--include/keys/encrypted-type.h13
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/aer.h3
-rw-r--r--include/linux/aio.h2
-rw-r--r--include/linux/amba/pl08x.h9
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/atomic.h28
-rw-r--r--include/linux/backing-dev.h10
-rw-r--r--include/linux/basic_mmio_gpio.h15
-rw-r--r--include/linux/bit_spinlock.h2
-rw-r--r--include/linux/bitmap.h2
-rw-r--r--include/linux/blk_types.h7
-rw-r--r--include/linux/blkdev.h5
-rw-r--r--include/linux/blktrace_api.h5
-rw-r--r--include/linux/bsg-lib.h73
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/ceph/messenger.h1
-rw-r--r--include/linux/compat.h1
-rw-r--r--include/linux/configfs.h2
-rw-r--r--include/linux/connector.h4
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/cpuidle.h4
-rw-r--r--include/linux/cpumask.h14
-rw-r--r--include/linux/cred.h17
-rw-r--r--include/linux/crypto.h2
-rw-r--r--include/linux/cryptohash.h7
-rw-r--r--include/linux/cs5535.h60
-rw-r--r--include/linux/dcache.h32
-rw-r--r--include/linux/debug_locks.h2
-rw-r--r--include/linux/device-mapper.h43
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/dm-ioctl.h4
-rw-r--r--include/linux/dm-kcopyd.h15
-rw-r--r--include/linux/dma-mapping.h21
-rw-r--r--include/linux/dvb/audio.h2
-rw-r--r--include/linux/ecryptfs.h113
-rw-r--r--include/linux/edac.h2
-rw-r--r--include/linux/efi.h6
-rw-r--r--include/linux/ext2_fs.h1
-rw-r--r--include/linux/ext3_fs.h7
-rw-r--r--include/linux/fault-inject.h37
-rw-r--r--include/linux/fdtable.h2
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/linux/firewire.h2
-rw-r--r--include/linux/fs.h76
-rw-r--r--include/linux/fsnotify_backend.h2
-rw-r--r--include/linux/fuse.h9
-rw-r--r--include/linux/genalloc.h34
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/hash.h2
-rw-r--r--include/linux/i2c-omap.h27
-rw-r--r--include/linux/i2c/twl.h25
-rw-r--r--include/linux/idr.h4
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/input.h8
-rw-r--r--include/linux/input/kxtj9.h70
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/ioport.h1
-rw-r--r--include/linux/ipc_namespace.h7
-rw-r--r--include/linux/irq.h17
-rw-r--r--include/linux/irqdesc.h1
-rw-r--r--include/linux/irqdomain.h91
-rw-r--r--include/linux/jbd.h1
-rw-r--r--include/linux/jbd2.h6
-rw-r--r--include/linux/journal-head.h2
-rw-r--r--include/linux/jump_label.h2
-rw-r--r--include/linux/kconfig.h32
-rw-r--r--include/linux/kdb.h2
-rw-r--r--include/linux/kernel.h8
-rw-r--r--include/linux/key.h2
-rw-r--r--include/linux/kgdb.h2
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/llist.h126
-rw-r--r--include/linux/loop.h5
-rw-r--r--include/linux/memcontrol.h15
-rw-r--r--include/linux/mfd/aat2870.h181
-rw-r--r--include/linux/mfd/ab8500.h8
-rw-r--r--include/linux/mfd/max8997.h7
-rw-r--r--include/linux/mfd/max8998.h12
-rw-r--r--include/linux/mfd/stmpe.h3
-rw-r--r--include/linux/mfd/tps65910.h1
-rw-r--r--include/linux/mfd/tps65912.h327
-rw-r--r--include/linux/mfd/twl4030-audio.h (renamed from include/linux/mfd/twl4030-codec.h)16
-rw-r--r--include/linux/mfd/twl6040.h228
-rw-r--r--include/linux/mfd/wm831x/core.h119
-rw-r--r--include/linux/mfd/wm831x/pdata.h3
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/device.h2
-rw-r--r--include/linux/mm.h19
-rw-r--r--include/linux/mm_types.h89
-rw-r--r--include/linux/mman.h2
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/mmzone.h8
-rw-r--r--include/linux/mount.h2
-rw-r--r--include/linux/mutex.h2
-rw-r--r--include/linux/netdevice.h9
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs.h2
-rw-r--r--include/linux/nfs4.h4
-rw-r--r--include/linux/nfs_fs.h7
-rw-r--r--include/linux/nfs_fs_sb.h11
-rw-r--r--include/linux/nfs_page.h17
-rw-r--r--include/linux/nfs_xdr.h61
-rw-r--r--include/linux/nodemask.h13
-rw-r--r--include/linux/of.h22
-rw-r--r--include/linux/of_gpio.h9
-rw-r--r--include/linux/of_irq.h4
-rw-r--r--include/linux/of_net.h1
-rw-r--r--include/linux/oprofile.h2
-rw-r--r--include/linux/page-flags.h5
-rw-r--r--include/linux/pci.h24
-rw-r--r--include/linux/pci_ids.h10
-rw-r--r--include/linux/perf_event.h26
-rw-r--r--include/linux/personality.h1
-rw-r--r--include/linux/phy.h6
-rw-r--r--include/linux/platform_data/ntc_thermistor.h53
-rw-r--r--include/linux/pm_domain.h10
-rw-r--r--include/linux/pnfs_osd_xdr.h31
-rw-r--r--include/linux/posix_acl.h82
-rw-r--r--include/linux/power/bq20z75.h3
-rw-r--r--include/linux/power/max17042_battery.h91
-rw-r--r--include/linux/proc_fs.h8
-rw-r--r--include/linux/pstore.h9
-rw-r--r--include/linux/pwm_backlight.h1
-rw-r--r--include/linux/quota.h10
-rw-r--r--include/linux/radix-tree.h37
-rw-r--r--include/linux/raid/md_p.h14
-rw-r--r--include/linux/ramoops.h2
-rw-r--r--include/linux/random.h12
-rw-r--r--include/linux/regulator/consumer.h3
-rw-r--r--include/linux/regulator/driver.h4
-rw-r--r--include/linux/rio_regs.h18
-rw-r--r--include/linux/rtc.h3
-rw-r--r--include/linux/rwsem.h2
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/serial_sci.h75
-rw-r--r--include/linux/sh_clk.h4
-rw-r--r--include/linux/sh_dma.h8
-rw-r--r--include/linux/shm.h7
-rw-r--r--include/linux/shmem_fs.h17
-rw-r--r--include/linux/skbuff.h2
-rw-r--r--include/linux/slub_def.h3
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/linux/sonet.h2
-rw-r--r--include/linux/spinlock.h2
-rw-r--r--include/linux/sunrpc/auth.h2
-rw-r--r--include/linux/sunrpc/bc_xprt.h6
-rw-r--r--include/linux/sunrpc/cache.h2
-rw-r--r--include/linux/sunrpc/sched.h4
-rw-r--r--include/linux/sunrpc/svc.h4
-rw-r--r--include/linux/sunrpc/timer.h2
-rw-r--r--include/linux/sunrpc/xprt.h34
-rw-r--r--include/linux/swap.h17
-rw-r--r--include/linux/swapops.h23
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/sysfs.h2
-rw-r--r--include/linux/thermal.h22
-rw-r--r--include/linux/ti_wilink_st.h27
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/tty_driver.h3
-rw-r--r--include/linux/videodev2.h254
-rw-r--r--include/linux/vmstat.h2
-rw-r--r--include/linux/vt_kern.h2
-rw-r--r--include/linux/watchdog.h78
-rw-r--r--include/linux/wm97xx.h13
-rw-r--r--include/linux/workqueue.h2
-rw-r--r--include/linux/writeback.h44
-rw-r--r--include/media/adp1653.h126
-rw-r--r--include/media/atmel-isi.h119
-rw-r--r--include/media/davinci/vpbe.h184
-rw-r--r--include/media/davinci/vpbe_display.h147
-rw-r--r--include/media/davinci/vpbe_osd.h394
-rw-r--r--include/media/davinci/vpbe_types.h91
-rw-r--r--include/media/davinci/vpbe_venc.h45
-rw-r--r--include/media/mmp-camera.h9
-rw-r--r--include/media/ov7670.h20
-rw-r--r--include/media/rc-core.h2
-rw-r--r--include/media/rc-map.h3
-rw-r--r--include/media/sh_mobile_ceu.h10
-rw-r--r--include/media/sh_mobile_csi2.h8
-rw-r--r--include/media/soc_camera.h44
-rw-r--r--include/media/soc_camera_platform.h15
-rw-r--r--include/media/timb_radio.h9
-rw-r--r--include/media/tuner.h2
-rw-r--r--include/media/v4l2-chip-ident.h4
-rw-r--r--include/media/v4l2-ctrls.h72
-rw-r--r--include/media/v4l2-event.h84
-rw-r--r--include/media/v4l2-fh.h13
-rw-r--r--include/media/v4l2-mediabus.h63
-rw-r--r--include/media/v4l2-subdev.h24
-rw-r--r--include/net/9p/9p.h29
-rw-r--r--include/net/ax25.h2
-rw-r--r--include/net/cfg80211.h5
-rw-r--r--include/net/cipso_ipv4.h4
-rw-r--r--include/net/dst.h17
-rw-r--r--include/net/flow.h2
-rw-r--r--include/net/inet_hashtables.h2
-rw-r--r--include/net/inet_sock.h2
-rw-r--r--include/net/inet_timewait_sock.h2
-rw-r--r--include/net/inetpeer.h2
-rw-r--r--include/net/ip_vs.h2
-rw-r--r--include/net/lib80211.h2
-rw-r--r--include/net/llc.h2
-rw-r--r--include/net/neighbour.h2
-rw-r--r--include/net/net_namespace.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netlabel.h4
-rw-r--r--include/net/netns/conntrack.h2
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/secure_seq.h20
-rw-r--r--include/pcmcia/device_id.h9
-rw-r--r--include/pcmcia/ds.h2
-rw-r--r--include/rdma/ib_sa.h2
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--include/rxrpc/types.h2
-rw-r--r--include/scsi/fc_frame.h1
-rw-r--r--include/scsi/iscsi_proto.h60
-rw-r--r--include/scsi/osd_ore.h125
-rw-r--r--include/scsi/scsi_device.h2
-rw-r--r--include/sound/pcm.h35
-rw-r--r--include/sound/pcm_params.h16
-rw-r--r--include/sound/soc-dapm.h6
-rw-r--r--include/sound/tea575x-tuner.h8
-rw-r--r--include/sound/tlv320aic3x.h2
-rw-r--r--include/sound/wm8996.h (renamed from include/sound/wm8915.h)28
-rw-r--r--include/target/target_core_fabric_ops.h6
-rw-r--r--include/trace/events/block.h20
-rw-r--r--include/trace/events/btrfs.h6
-rw-r--r--include/trace/events/ext3.h864
-rw-r--r--include/trace/events/ext4.h93
-rw-r--r--include/trace/events/jbd.h203
-rw-r--r--include/trace/events/jbd2.h36
-rw-r--r--include/trace/events/writeback.h183
-rw-r--r--include/trace/events/xen.h2
-rw-r--r--include/video/omapdss.h26
260 files changed, 6252 insertions, 794 deletions
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 3090471b2a5e..e49c36d38d7e 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -128,7 +128,7 @@ extern int is_dock_device(acpi_handle handle);
128extern int register_dock_notifier(struct notifier_block *nb); 128extern int register_dock_notifier(struct notifier_block *nb);
129extern void unregister_dock_notifier(struct notifier_block *nb); 129extern void unregister_dock_notifier(struct notifier_block *nb);
130extern int register_hotplug_dock_device(acpi_handle handle, 130extern int register_hotplug_dock_device(acpi_handle handle,
131 struct acpi_dock_ops *ops, 131 const struct acpi_dock_ops *ops,
132 void *context); 132 void *context);
133extern void unregister_hotplug_dock_device(acpi_handle handle); 133extern void unregister_hotplug_dock_device(acpi_handle handle);
134#else 134#else
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 2ed0a8486c19..f554a9313b43 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -47,7 +47,7 @@
47 47
48/* Current ACPICA subsystem version in YYYYMMDD format */ 48/* Current ACPICA subsystem version in YYYYMMDD format */
49 49
50#define ACPI_CA_VERSION 0x20110413 50#define ACPI_CA_VERSION 0x20110623
51 51
52#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
@@ -69,6 +69,7 @@ extern u32 acpi_gbl_trace_flags;
69extern u32 acpi_gbl_enable_aml_debug_object; 69extern u32 acpi_gbl_enable_aml_debug_object;
70extern u8 acpi_gbl_copy_dsdt_locally; 70extern u8 acpi_gbl_copy_dsdt_locally;
71extern u8 acpi_gbl_truncate_io_addresses; 71extern u8 acpi_gbl_truncate_io_addresses;
72extern u8 acpi_gbl_disable_auto_repair;
72 73
73extern u32 acpi_current_gpe_count; 74extern u32 acpi_current_gpe_count;
74extern struct acpi_table_fadt acpi_gbl_FADT; 75extern struct acpi_table_fadt acpi_gbl_FADT;
diff --git a/include/acpi/apei.h b/include/acpi/apei.h
index e67b523a50e1..51a527d24a8a 100644
--- a/include/acpi/apei.h
+++ b/include/acpi/apei.h
@@ -18,6 +18,11 @@
18 18
19extern int hest_disable; 19extern int hest_disable;
20extern int erst_disable; 20extern int erst_disable;
21#ifdef CONFIG_ACPI_APEI_GHES
22extern int ghes_disable;
23#else
24#define ghes_disable 1
25#endif
21 26
22#ifdef CONFIG_ACPI_APEI 27#ifdef CONFIG_ACPI_APEI
23void __init acpi_hest_init(void); 28void __init acpi_hest_init(void);
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 2ce1be9f6291..f72403c4b51a 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -59,7 +59,7 @@
59#include <linux/ctype.h> 59#include <linux/ctype.h>
60#include <linux/sched.h> 60#include <linux/sched.h>
61#include <asm/system.h> 61#include <asm/system.h>
62#include <asm/atomic.h> 62#include <linux/atomic.h>
63#include <asm/div64.h> 63#include <asm/div64.h>
64#include <asm/acpi.h> 64#include <asm/acpi.h>
65#include <linux/slab.h> 65#include <linux/slab.h>
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index ba4928cae473..67055f180330 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -337,7 +337,7 @@ extern struct cpuidle_driver acpi_idle_driver;
337 337
338/* in processor_thermal.c */ 338/* in processor_thermal.c */
339int acpi_processor_get_limit_info(struct acpi_processor *pr); 339int acpi_processor_get_limit_info(struct acpi_processor *pr);
340extern struct thermal_cooling_device_ops processor_cooling_ops; 340extern const struct thermal_cooling_device_ops processor_cooling_ops;
341#ifdef CONFIG_CPU_FREQ 341#ifdef CONFIG_CPU_FREQ
342void acpi_thermal_cpufreq_init(void); 342void acpi_thermal_cpufreq_init(void);
343void acpi_thermal_cpufreq_exit(void); 343void acpi_thermal_cpufreq_exit(void);
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 0e98e679d3a7..61109f2609fc 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -5,6 +5,8 @@
5 5
6struct acpi_device; 6struct acpi_device;
7 7
8#define ACPI_VIDEO_CLASS "video"
9
8#define ACPI_VIDEO_DISPLAY_CRT 1 10#define ACPI_VIDEO_DISPLAY_CRT 1
9#define ACPI_VIDEO_DISPLAY_TV 2 11#define ACPI_VIDEO_DISPLAY_TV 2
10#define ACPI_VIDEO_DISPLAY_DVI 3 12#define ACPI_VIDEO_DISPLAY_DVI 3
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index e994197f84b7..e37963c1df4d 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -1,5 +1,7 @@
1/* 1/*
2 * Generic C implementation of atomic counter operations 2 * Generic C implementation of atomic counter operations. Usable on
3 * UP systems only. Do not include in machine independent code.
4 *
3 * Originally implemented for MN10300. 5 * Originally implemented for MN10300.
4 * 6 *
5 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 7 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
@@ -14,7 +16,11 @@
14#define __ASM_GENERIC_ATOMIC_H 16#define __ASM_GENERIC_ATOMIC_H
15 17
16#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
17#error not SMP safe 19/* Force people to define core atomics */
20# if !defined(atomic_add_return) || !defined(atomic_sub_return) || \
21 !defined(atomic_clear_mask) || !defined(atomic_set_mask)
22# error "SMP requires a little arch-specific magic"
23# endif
18#endif 24#endif
19 25
20/* 26/*
@@ -32,7 +38,9 @@
32 * 38 *
33 * Atomically reads the value of @v. 39 * Atomically reads the value of @v.
34 */ 40 */
41#ifndef atomic_read
35#define atomic_read(v) (*(volatile int *)&(v)->counter) 42#define atomic_read(v) (*(volatile int *)&(v)->counter)
43#endif
36 44
37/** 45/**
38 * atomic_set - set atomic variable 46 * atomic_set - set atomic variable
@@ -53,6 +61,7 @@
53 * 61 *
54 * Atomically adds @i to @v and returns the result 62 * Atomically adds @i to @v and returns the result
55 */ 63 */
64#ifndef atomic_add_return
56static inline int atomic_add_return(int i, atomic_t *v) 65static inline int atomic_add_return(int i, atomic_t *v)
57{ 66{
58 unsigned long flags; 67 unsigned long flags;
@@ -66,6 +75,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
66 75
67 return temp; 76 return temp;
68} 77}
78#endif
69 79
70/** 80/**
71 * atomic_sub_return - subtract integer from atomic variable 81 * atomic_sub_return - subtract integer from atomic variable
@@ -74,6 +84,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
74 * 84 *
75 * Atomically subtracts @i from @v and returns the result 85 * Atomically subtracts @i from @v and returns the result
76 */ 86 */
87#ifndef atomic_sub_return
77static inline int atomic_sub_return(int i, atomic_t *v) 88static inline int atomic_sub_return(int i, atomic_t *v)
78{ 89{
79 unsigned long flags; 90 unsigned long flags;
@@ -87,6 +98,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
87 98
88 return temp; 99 return temp;
89} 100}
101#endif
90 102
91static inline int atomic_add_negative(int i, atomic_t *v) 103static inline int atomic_add_negative(int i, atomic_t *v)
92{ 104{
@@ -117,8 +129,8 @@ static inline void atomic_dec(atomic_t *v)
117#define atomic_inc_return(v) atomic_add_return(1, (v)) 129#define atomic_inc_return(v) atomic_add_return(1, (v))
118 130
119#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) 131#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
120#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 132#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
121#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) 133#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
122 134
123#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v))) 135#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
124#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 136#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
@@ -129,26 +141,51 @@ static inline void atomic_dec(atomic_t *v)
129 141
130#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 142#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
131 143
132static inline int atomic_add_unless(atomic_t *v, int a, int u) 144static inline int __atomic_add_unless(atomic_t *v, int a, int u)
133{ 145{
134 int c, old; 146 int c, old;
135 c = atomic_read(v); 147 c = atomic_read(v);
136 while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c) 148 while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c)
137 c = old; 149 c = old;
138 return c != u; 150 return c;
139} 151}
140 152
141#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 153/**
142 154 * atomic_clear_mask - Atomically clear bits in atomic variable
143static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) 155 * @mask: Mask of the bits to be cleared
156 * @v: pointer of type atomic_t
157 *
158 * Atomically clears the bits set in @mask from @v
159 */
160#ifndef atomic_clear_mask
161static inline void atomic_clear_mask(unsigned long mask, atomic_t *v)
144{ 162{
145 unsigned long flags; 163 unsigned long flags;
146 164
147 mask = ~mask; 165 mask = ~mask;
148 raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */ 166 raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
149 *addr &= mask; 167 v->counter &= mask;
150 raw_local_irq_restore(flags); 168 raw_local_irq_restore(flags);
151} 169}
170#endif
171
172/**
173 * atomic_set_mask - Atomically set bits in atomic variable
174 * @mask: Mask of the bits to be set
175 * @v: pointer of type atomic_t
176 *
177 * Atomically sets the bits set in @mask in @v
178 */
179#ifndef atomic_set_mask
180static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
181{
182 unsigned long flags;
183
184 raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
185 v->counter |= mask;
186 raw_local_irq_restore(flags);
187}
188#endif
152 189
153/* Assume that atomic operations are already serializing */ 190/* Assume that atomic operations are already serializing */
154#define smp_mb__before_atomic_dec() barrier() 191#define smp_mb__before_atomic_dec() barrier()
@@ -156,7 +193,5 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
156#define smp_mb__before_atomic_inc() barrier() 193#define smp_mb__before_atomic_inc() barrier()
157#define smp_mb__after_atomic_inc() barrier() 194#define smp_mb__after_atomic_inc() barrier()
158 195
159#include <asm-generic/atomic-long.h>
160
161#endif /* __KERNEL__ */ 196#endif /* __KERNEL__ */
162#endif /* __ASM_GENERIC_ATOMIC_H */ 197#endif /* __ASM_GENERIC_ATOMIC_H */
diff --git a/include/asm-generic/bitops/ext2-atomic-setbit.h b/include/asm-generic/bitops/ext2-atomic-setbit.h
new file mode 100644
index 000000000000..5a0997857b34
--- /dev/null
+++ b/include/asm-generic/bitops/ext2-atomic-setbit.h
@@ -0,0 +1,11 @@
1#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_
2#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_
3
4/*
5 * Atomic bitops based version of ext2 atomic bitops
6 */
7
8#define ext2_set_bit_atomic(l, nr, addr) test_and_set_bit_le(nr, addr)
9#define ext2_clear_bit_atomic(l, nr, addr) test_and_clear_bit_le(nr, addr)
10
11#endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_ */
diff --git a/include/asm-generic/bitops/ext2-atomic.h b/include/asm-generic/bitops/ext2-atomic.h
index ecf1c9d8a7cc..87f0f109d7f1 100644
--- a/include/asm-generic/bitops/ext2-atomic.h
+++ b/include/asm-generic/bitops/ext2-atomic.h
@@ -1,6 +1,10 @@
1#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ 1#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
2#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ 2#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
3 3
4/*
5 * Spinlock based version of ext2 atomic bitops
6 */
7
4#define ext2_set_bit_atomic(lock, nr, addr) \ 8#define ext2_set_bit_atomic(lock, nr, addr) \
5 ({ \ 9 ({ \
6 int ret; \ 10 int ret; \
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index c8a5d68541d7..9ceb03b4f466 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -2,7 +2,7 @@
2#define _ASM_GENERIC_LOCAL_H 2#define _ASM_GENERIC_LOCAL_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <asm/atomic.h> 5#include <linux/atomic.h>
6#include <asm/types.h> 6#include <asm/types.h>
7 7
8/* 8/*
diff --git a/include/asm-generic/local64.h b/include/asm-generic/local64.h
index 02ac760c1a8b..5980002b8b7b 100644
--- a/include/asm-generic/local64.h
+++ b/include/asm-generic/local64.h
@@ -55,7 +55,7 @@ typedef struct {
55 55
56#else /* BITS_PER_LONG != 64 */ 56#else /* BITS_PER_LONG != 64 */
57 57
58#include <asm/atomic.h> 58#include <linux/atomic.h>
59 59
60/* Don't use typedef: don't want them to be mixed with atomic_t's. */ 60/* Don't use typedef: don't want them to be mixed with atomic_t's. */
61typedef struct { 61typedef struct {
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index fb2d63f13f4c..aea9e45efce6 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -39,7 +39,7 @@
39}) 39})
40 40
41#define __page_to_pfn(pg) \ 41#define __page_to_pfn(pg) \
42({ struct page *__pg = (pg); \ 42({ const struct page *__pg = (pg); \
43 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ 43 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \
44 (unsigned long)(__pg - __pgdat->node_mem_map) + \ 44 (unsigned long)(__pg - __pgdat->node_mem_map) + \
45 __pgdat->node_start_pfn; \ 45 __pgdat->node_start_pfn; \
@@ -57,7 +57,7 @@
57 * section[i].section_mem_map == mem_map's address - start_pfn; 57 * section[i].section_mem_map == mem_map's address - start_pfn;
58 */ 58 */
59#define __page_to_pfn(pg) \ 59#define __page_to_pfn(pg) \
60({ struct page *__pg = (pg); \ 60({ const struct page *__pg = (pg); \
61 int __sec = page_to_section(__pg); \ 61 int __sec = page_to_section(__pg); \
62 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ 62 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \
63}) 63})
diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h
new file mode 100644
index 000000000000..4a5aca2a2c94
--- /dev/null
+++ b/include/asm-generic/pci-bridge.h
@@ -0,0 +1,62 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version
5 * 2 of the License, or (at your option) any later version.
6 */
7#ifndef _ASM_GENERIC_PCI_BRIDGE_H
8#define _ASM_GENERIC_PCI_BRIDGE_H
9
10#ifdef __KERNEL__
11
12enum {
13 /* Force re-assigning all resources (ignore firmware
14 * setup completely)
15 */
16 PCI_REASSIGN_ALL_RSRC = 0x00000001,
17
18 /* Re-assign all bus numbers */
19 PCI_REASSIGN_ALL_BUS = 0x00000002,
20
21 /* Do not try to assign, just use existing setup */
22 PCI_PROBE_ONLY = 0x00000004,
23
24 /* Don't bother with ISA alignment unless the bridge has
25 * ISA forwarding enabled
26 */
27 PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
28
29 /* Enable domain numbers in /proc */
30 PCI_ENABLE_PROC_DOMAINS = 0x00000010,
31 /* ... except for domain 0 */
32 PCI_COMPAT_DOMAIN_0 = 0x00000020,
33};
34
35#ifdef CONFIG_PCI
36extern unsigned int pci_flags;
37
38static inline void pci_set_flags(int flags)
39{
40 pci_flags = flags;
41}
42
43static inline void pci_add_flags(int flags)
44{
45 pci_flags |= flags;
46}
47
48static inline int pci_has_flag(int flag)
49{
50 return pci_flags & flag;
51}
52#else
53static inline void pci_set_flags(int flags) { }
54static inline void pci_add_flags(int flags) { }
55static inline int pci_has_flag(int flag)
56{
57 return 0;
58}
59#endif /* CONFIG_PCI */
60
61#endif /* __KERNEL__ */
62#endif /* _ASM_GENERIC_PCI_BRIDGE_H */
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index 4f76959397fa..f4c38d8c6674 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -143,7 +143,7 @@ __SYSCALL(__NR_pivot_root, sys_pivot_root)
143 143
144/* fs/nfsctl.c */ 144/* fs/nfsctl.c */
145#define __NR_nfsservctl 42 145#define __NR_nfsservctl 42
146__SC_COMP(__NR_nfsservctl, sys_nfsservctl, compat_sys_nfsservctl) 146__SYSCALL(__NR_nfsservctl, sys_ni_syscall)
147 147
148/* fs/open.c */ 148/* fs/open.c */
149#define __NR3264_statfs 43 149#define __NR3264_statfs 43
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 738b3a5faa12..9b7c2bb4bb44 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -886,6 +886,8 @@ struct drm_driver {
886 */ 886 */
887 int (*gem_init_object) (struct drm_gem_object *obj); 887 int (*gem_init_object) (struct drm_gem_object *obj);
888 void (*gem_free_object) (struct drm_gem_object *obj); 888 void (*gem_free_object) (struct drm_gem_object *obj);
889 int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
890 void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
889 891
890 /* vga arb irq handler */ 892 /* vga arb irq handler */
891 void (*vgaarb_irq)(struct drm_device *dev, bool state); 893 void (*vgaarb_irq)(struct drm_device *dev, bool state);
@@ -1539,6 +1541,8 @@ struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1539 size_t size); 1541 size_t size);
1540int drm_gem_object_init(struct drm_device *dev, 1542int drm_gem_object_init(struct drm_device *dev,
1541 struct drm_gem_object *obj, size_t size); 1543 struct drm_gem_object *obj, size_t size);
1544int drm_gem_private_object_init(struct drm_device *dev,
1545 struct drm_gem_object *obj, size_t size);
1542void drm_gem_object_handle_free(struct drm_gem_object *obj); 1546void drm_gem_object_handle_free(struct drm_gem_object *obj);
1543void drm_gem_vm_open(struct vm_area_struct *vma); 1547void drm_gem_vm_open(struct vm_area_struct *vma);
1544void drm_gem_vm_close(struct vm_area_struct *vma); 1548void drm_gem_vm_close(struct vm_area_struct *vma);
@@ -1672,13 +1676,6 @@ static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
1672 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP); 1676 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
1673} 1677}
1674 1678
1675
1676static __inline__ int drm_pci_device_is_pcie(struct drm_device *dev)
1677{
1678 return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP);
1679}
1680
1681
1682extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); 1679extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
1683extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); 1680extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
1684extern int drm_get_pci_dev(struct pci_dev *pdev, 1681extern int drm_get_pci_dev(struct pci_dev *pdev,
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 33d12f87f0e0..44335e57eaaa 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -205,6 +205,8 @@ struct drm_display_info {
205 enum subpixel_order subpixel_order; 205 enum subpixel_order subpixel_order;
206 u32 color_formats; 206 u32 color_formats;
207 207
208 u8 cea_rev;
209
208 char *raw_edid; /* if any */ 210 char *raw_edid; /* if any */
209}; 211};
210 212
@@ -802,6 +804,7 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
802extern int drm_add_modes_noedid(struct drm_connector *connector, 804extern int drm_add_modes_noedid(struct drm_connector *connector,
803 int hdisplay, int vdisplay); 805 int hdisplay, int vdisplay);
804 806
807extern int drm_edid_header_is_valid(const u8 *raw_edid);
805extern bool drm_edid_is_valid(struct edid *edid); 808extern bool drm_edid_is_valid(struct edid *edid);
806struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, 809struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
807 int hsize, int vsize, int fresh); 810 int hsize, int vsize, int fresh);
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index c4d6dbfa3ff4..28c0d114cb52 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -237,7 +237,7 @@ typedef struct _drm_i915_sarea {
237#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) 237#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
238#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) 238#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id)
239#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) 239#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
240#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_IOCTL_I915_OVERLAY_ATTRS, struct drm_intel_overlay_put_image) 240#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
241#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) 241#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
242 242
243/* Allow drivers to submit batchbuffers directly to hardware, relying 243/* Allow drivers to submit batchbuffers directly to hardware, relying
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index 787f7b6fd622..b65be6054a18 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -911,6 +911,7 @@ struct drm_radeon_cs {
911#define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */ 911#define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */
912#define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */ 912#define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */
913#define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */ 913#define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */
914#define RADEON_INFO_BACKEND_MAP 0x0d /* pipe to backend map, needed by mesa */
914 915
915struct drm_radeon_info { 916struct drm_radeon_info {
916 uint32_t request; 917 uint32_t request;
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 62a0e4c4ceee..42e346985186 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -662,9 +662,6 @@ extern int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
662 662
663extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map); 663extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
664 664
665#if 0
666#endif
667
668/** 665/**
669 * ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object. 666 * ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object.
670 * 667 *
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 09af2d746d1c..94eb1434316e 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -78,7 +78,7 @@ struct ttm_backend_func {
78 * 78 *
79 * Bind the backend pages into the aperture in the location 79 * Bind the backend pages into the aperture in the location
80 * indicated by @bo_mem. This function should be able to handle 80 * indicated by @bo_mem. This function should be able to handle
81 * differences between aperture- and system page sizes. 81 * differences between aperture and system page sizes.
82 */ 82 */
83 int (*bind) (struct ttm_backend *backend, struct ttm_mem_reg *bo_mem); 83 int (*bind) (struct ttm_backend *backend, struct ttm_mem_reg *bo_mem);
84 84
@@ -88,7 +88,7 @@ struct ttm_backend_func {
88 * @backend: Pointer to a struct ttm_backend. 88 * @backend: Pointer to a struct ttm_backend.
89 * 89 *
90 * Unbind previously bound backend pages. This function should be 90 * Unbind previously bound backend pages. This function should be
91 * able to handle differences between aperture- and system page sizes. 91 * able to handle differences between aperture and system page sizes.
92 */ 92 */
93 int (*unbind) (struct ttm_backend *backend); 93 int (*unbind) (struct ttm_backend *backend);
94 94
@@ -786,7 +786,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
786 * ttm_bo_device_init 786 * ttm_bo_device_init
787 * 787 *
788 * @bdev: A pointer to a struct ttm_bo_device to initialize. 788 * @bdev: A pointer to a struct ttm_bo_device to initialize.
789 * @mem_global: A pointer to an initialized struct ttm_mem_global. 789 * @glob: A pointer to an initialized struct ttm_bo_global.
790 * @driver: A pointer to a struct ttm_bo_driver set up by the caller. 790 * @driver: A pointer to a struct ttm_bo_driver set up by the caller.
791 * @file_page_offset: Offset into the device address space that is available 791 * @file_page_offset: Offset into the device address space that is available
792 * for buffer data. This ensures compatibility with other users of the 792 * for buffer data. This ensures compatibility with other users of the
diff --git a/include/drm/ttm/ttm_lock.h b/include/drm/ttm/ttm_lock.h
index 81ba0b0b891a..2e7f0c941b5d 100644
--- a/include/drm/ttm/ttm_lock.h
+++ b/include/drm/ttm/ttm_lock.h
@@ -51,7 +51,7 @@
51 51
52#include "ttm/ttm_object.h" 52#include "ttm/ttm_object.h"
53#include <linux/wait.h> 53#include <linux/wait.h>
54#include <asm/atomic.h> 54#include <linux/atomic.h>
55 55
56/** 56/**
57 * struct ttm_lock 57 * struct ttm_lock
diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h
index b199170b3c2c..26c1f78d136f 100644
--- a/include/drm/ttm/ttm_memory.h
+++ b/include/drm/ttm/ttm_memory.h
@@ -41,7 +41,7 @@
41 * @do_shrink: The callback function. 41 * @do_shrink: The callback function.
42 * 42 *
43 * Arguments to the do_shrink functions are intended to be passed using 43 * Arguments to the do_shrink functions are intended to be passed using
44 * inheritance. That is, the argument class derives from struct ttm_mem_srink, 44 * inheritance. That is, the argument class derives from struct ttm_mem_shrink,
45 * and can be accessed using container_of(). 45 * and can be accessed using container_of().
46 */ 46 */
47 47
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h
index 0d9db099978b..e46054e5255b 100644
--- a/include/drm/ttm/ttm_object.h
+++ b/include/drm/ttm/ttm_object.h
@@ -111,7 +111,7 @@ struct ttm_object_device;
111 * 111 *
112 * @ref_obj_release: A function to be called when a reference object 112 * @ref_obj_release: A function to be called when a reference object
113 * with another ttm_ref_type than TTM_REF_USAGE is deleted. 113 * with another ttm_ref_type than TTM_REF_USAGE is deleted.
114 * this function may, for example, release a lock held by a user-space 114 * This function may, for example, release a lock held by a user-space
115 * process. 115 * process.
116 * 116 *
117 * This struct is intended to be used as a base struct for objects that 117 * This struct is intended to be used as a base struct for objects that
@@ -172,7 +172,7 @@ extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file
172/** 172/**
173 * ttm_base_object_unref 173 * ttm_base_object_unref
174 * 174 *
175 * @p_base: Pointer to a pointer referncing a struct ttm_base_object. 175 * @p_base: Pointer to a pointer referencing a struct ttm_base_object.
176 * 176 *
177 * Decrements the base object refcount and clears the pointer pointed to by 177 * Decrements the base object refcount and clears the pointer pointed to by
178 * p_base. 178 * p_base.
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 8062890f725e..129de12353f1 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -32,7 +32,7 @@
32/** 32/**
33 * Get count number of pages from pool to pages list. 33 * Get count number of pages from pool to pages list.
34 * 34 *
35 * @pages: heado of empty linked list where pages are filled. 35 * @pages: head of empty linked list where pages are filled.
36 * @flags: ttm flags for page allocation. 36 * @flags: ttm flags for page allocation.
37 * @cstate: ttm caching state for the page. 37 * @cstate: ttm caching state for the page.
38 * @count: number of pages to allocate. 38 * @count: number of pages to allocate.
diff --git a/include/keys/encrypted-type.h b/include/keys/encrypted-type.h
index 95855017a32b..1d4541370a64 100644
--- a/include/keys/encrypted-type.h
+++ b/include/keys/encrypted-type.h
@@ -1,6 +1,11 @@
1/* 1/*
2 * Copyright (C) 2010 IBM Corporation 2 * Copyright (C) 2010 IBM Corporation
3 * Author: Mimi Zohar <zohar@us.ibm.com> 3 * Copyright (C) 2010 Politecnico di Torino, Italy
4 * TORSEC group -- http://security.polito.it
5 *
6 * Authors:
7 * Mimi Zohar <zohar@us.ibm.com>
8 * Roberto Sassu <roberto.sassu@polito.it>
4 * 9 *
5 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
@@ -15,13 +20,17 @@
15 20
16struct encrypted_key_payload { 21struct encrypted_key_payload {
17 struct rcu_head rcu; 22 struct rcu_head rcu;
23 char *format; /* datablob: format */
18 char *master_desc; /* datablob: master key name */ 24 char *master_desc; /* datablob: master key name */
19 char *datalen; /* datablob: decrypted key length */ 25 char *datalen; /* datablob: decrypted key length */
20 u8 *iv; /* datablob: iv */ 26 u8 *iv; /* datablob: iv */
21 u8 *encrypted_data; /* datablob: encrypted data */ 27 u8 *encrypted_data; /* datablob: encrypted data */
22 unsigned short datablob_len; /* length of datablob */ 28 unsigned short datablob_len; /* length of datablob */
23 unsigned short decrypted_datalen; /* decrypted data length */ 29 unsigned short decrypted_datalen; /* decrypted data length */
24 u8 decrypted_data[0]; /* decrypted data + datablob + hmac */ 30 unsigned short payload_datalen; /* payload data length */
31 unsigned short encrypted_key_format; /* encrypted key format */
32 u8 *decrypted_data; /* decrypted data */
33 u8 payload_data[0]; /* payload data + datablob + hmac */
25}; 34};
26 35
27extern struct key_type key_type_encrypted; 36extern struct key_type key_type_encrypted;
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 1deb2a73c2da..6001b4da39dd 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -238,7 +238,6 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size);
238extern int pnpacpi_disabled; 238extern int pnpacpi_disabled;
239 239
240#define PXM_INVAL (-1) 240#define PXM_INVAL (-1)
241#define NID_INVAL (-1)
242 241
243int acpi_check_resource_conflict(const struct resource *res); 242int acpi_check_resource_conflict(const struct resource *res);
244 243
@@ -280,6 +279,8 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
280#define OSC_SB_CPUHP_OST_SUPPORT 8 279#define OSC_SB_CPUHP_OST_SUPPORT 8
281#define OSC_SB_APEI_SUPPORT 16 280#define OSC_SB_APEI_SUPPORT 16
282 281
282extern bool osc_sb_apei_support_acked;
283
283/* PCI defined _OSC bits */ 284/* PCI defined _OSC bits */
284/* _OSC DW1 Definition (OS Support Fields) */ 285/* _OSC DW1 Definition (OS Support Fields) */
285#define OSC_EXT_PCI_CONFIG_SUPPORT 1 286#define OSC_EXT_PCI_CONFIG_SUPPORT 1
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 8414de22a779..544abdb2238c 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -51,5 +51,8 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
51 51
52extern void cper_print_aer(const char *prefix, int cper_severity, 52extern void cper_print_aer(const char *prefix, int cper_severity,
53 struct aer_capability_regs *aer); 53 struct aer_capability_regs *aer);
54extern int cper_severity_to_aer(int cper_severity);
55extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
56 int severity);
54#endif //_AER_H_ 57#endif //_AER_H_
55 58
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 7a8db4155281..2dcb72bff4b6 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -7,7 +7,7 @@
7#include <linux/uio.h> 7#include <linux/uio.h>
8#include <linux/rcupdate.h> 8#include <linux/rcupdate.h>
9 9
10#include <asm/atomic.h> 10#include <linux/atomic.h>
11 11
12#define AIO_MAXSEGS 4 12#define AIO_MAXSEGS 4
13#define AIO_KIOGRP_NR_ATOMIC 8 13#define AIO_KIOGRP_NR_ATOMIC 8
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 3111385b8ca7..e6e28f37d8ec 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -172,8 +172,11 @@ struct pl08x_dma_chan {
172 int phychan_hold; 172 int phychan_hold;
173 struct tasklet_struct tasklet; 173 struct tasklet_struct tasklet;
174 char *name; 174 char *name;
175 struct pl08x_channel_data *cd; 175 const struct pl08x_channel_data *cd;
176 dma_addr_t runtime_addr; 176 dma_addr_t src_addr;
177 dma_addr_t dst_addr;
178 u32 src_cctl;
179 u32 dst_cctl;
177 enum dma_data_direction runtime_direction; 180 enum dma_data_direction runtime_direction;
178 dma_cookie_t lc; 181 dma_cookie_t lc;
179 struct list_head pend_list; 182 struct list_head pend_list;
@@ -202,7 +205,7 @@ struct pl08x_dma_chan {
202 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 205 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
203 */ 206 */
204struct pl08x_platform_data { 207struct pl08x_platform_data {
205 struct pl08x_channel_data *slave_channels; 208 const struct pl08x_channel_data *slave_channels;
206 unsigned int num_slave_channels; 209 unsigned int num_slave_channels;
207 struct pl08x_channel_data memcpy_channel; 210 struct pl08x_channel_data memcpy_channel;
208 int (*get_signal)(struct pl08x_dma_chan *); 211 int (*get_signal)(struct pl08x_dma_chan *);
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 381f4cec8260..49a83ca900ba 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -220,7 +220,7 @@ struct atm_cirange {
220#include <linux/skbuff.h> /* struct sk_buff */ 220#include <linux/skbuff.h> /* struct sk_buff */
221#include <linux/uio.h> 221#include <linux/uio.h>
222#include <net/sock.h> 222#include <net/sock.h>
223#include <asm/atomic.h> 223#include <linux/atomic.h>
224 224
225#ifdef CONFIG_PROC_FS 225#ifdef CONFIG_PROC_FS
226#include <linux/proc_fs.h> 226#include <linux/proc_fs.h>
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index bc6615d4132b..42b77b5446d2 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -1,8 +1,32 @@
1/* Atomic operations usable in machine independent code */
1#ifndef _LINUX_ATOMIC_H 2#ifndef _LINUX_ATOMIC_H
2#define _LINUX_ATOMIC_H 3#define _LINUX_ATOMIC_H
3#include <asm/atomic.h> 4#include <asm/atomic.h>
4 5
5/** 6/**
7 * atomic_add_unless - add unless the number is already a given value
8 * @v: pointer of type atomic_t
9 * @a: the amount to add to v...
10 * @u: ...unless v is equal to u.
11 *
12 * Atomically adds @a to @v, so long as @v was not already @u.
13 * Returns non-zero if @v was not @u, and zero otherwise.
14 */
15static inline int atomic_add_unless(atomic_t *v, int a, int u)
16{
17 return __atomic_add_unless(v, a, u) != u;
18}
19
20/**
21 * atomic_inc_not_zero - increment unless the number is zero
22 * @v: pointer of type atomic_t
23 *
24 * Atomically increments @v by 1, so long as @v is non-zero.
25 * Returns non-zero if @v was non-zero, and zero otherwise.
26 */
27#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
28
29/**
6 * atomic_inc_not_zero_hint - increment if not null 30 * atomic_inc_not_zero_hint - increment if not null
7 * @v: pointer of type atomic_t 31 * @v: pointer of type atomic_t
8 * @hint: probable value of the atomic before the increment 32 * @hint: probable value of the atomic before the increment
@@ -73,4 +97,8 @@ static inline void atomic_or(int i, atomic_t *v)
73} 97}
74#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */ 98#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */
75 99
100#include <asm-generic/atomic-long.h>
101#ifdef CONFIG_GENERIC_ATOMIC64
102#include <asm-generic/atomic64.h>
103#endif
76#endif /* _LINUX_ATOMIC_H */ 104#endif /* _LINUX_ATOMIC_H */
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 96f4094b706d..3b2f9cb82986 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -16,7 +16,7 @@
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/writeback.h> 18#include <linux/writeback.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21struct page; 21struct page;
22struct device; 22struct device;
@@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int);
40enum bdi_stat_item { 40enum bdi_stat_item {
41 BDI_RECLAIMABLE, 41 BDI_RECLAIMABLE,
42 BDI_WRITEBACK, 42 BDI_WRITEBACK,
43 BDI_WRITTEN,
43 NR_BDI_STAT_ITEMS 44 NR_BDI_STAT_ITEMS
44}; 45};
45 46
@@ -57,6 +58,7 @@ struct bdi_writeback {
57 struct list_head b_dirty; /* dirty inodes */ 58 struct list_head b_dirty; /* dirty inodes */
58 struct list_head b_io; /* parked for writeback */ 59 struct list_head b_io; /* parked for writeback */
59 struct list_head b_more_io; /* parked for more writeback */ 60 struct list_head b_more_io; /* parked for more writeback */
61 spinlock_t list_lock; /* protects the b_* lists */
60}; 62};
61 63
62struct backing_dev_info { 64struct backing_dev_info {
@@ -71,6 +73,11 @@ struct backing_dev_info {
71 73
72 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; 74 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
73 75
76 unsigned long bw_time_stamp; /* last time write bw is updated */
77 unsigned long written_stamp; /* pages written at bw_time_stamp */
78 unsigned long write_bandwidth; /* the estimated write bandwidth */
79 unsigned long avg_write_bandwidth; /* further smoothed write bw */
80
74 struct prop_local_percpu completions; 81 struct prop_local_percpu completions;
75 int dirty_exceeded; 82 int dirty_exceeded;
76 83
@@ -106,6 +113,7 @@ int bdi_writeback_thread(void *data);
106int bdi_has_dirty_io(struct backing_dev_info *bdi); 113int bdi_has_dirty_io(struct backing_dev_info *bdi);
107void bdi_arm_supers_timer(void); 114void bdi_arm_supers_timer(void);
108void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); 115void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
116void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2);
109 117
110extern spinlock_t bdi_lock; 118extern spinlock_t bdi_lock;
111extern struct list_head bdi_list; 119extern struct list_head bdi_list;
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
index 98999cf107ce..feb912196745 100644
--- a/include/linux/basic_mmio_gpio.h
+++ b/include/linux/basic_mmio_gpio.h
@@ -63,15 +63,10 @@ static inline struct bgpio_chip *to_bgpio_chip(struct gpio_chip *gc)
63 return container_of(gc, struct bgpio_chip, gc); 63 return container_of(gc, struct bgpio_chip, gc);
64} 64}
65 65
66int __devexit bgpio_remove(struct bgpio_chip *bgc); 66int bgpio_remove(struct bgpio_chip *bgc);
67int __devinit bgpio_init(struct bgpio_chip *bgc, 67int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
68 struct device *dev, 68 unsigned long sz, void __iomem *dat, void __iomem *set,
69 unsigned long sz, 69 void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
70 void __iomem *dat, 70 bool big_endian);
71 void __iomem *set,
72 void __iomem *clr,
73 void __iomem *dirout,
74 void __iomem *dirin,
75 bool big_endian);
76 71
77#endif /* __BASIC_MMIO_GPIO_H */ 72#endif /* __BASIC_MMIO_GPIO_H */
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index 564d997e2168..ac4d9f8b52e9 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/preempt.h> 5#include <linux/preempt.h>
6#include <asm/atomic.h> 6#include <linux/atomic.h>
7 7
8/* 8/*
9 * bit-based spin_lock() 9 * bit-based spin_lock()
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index dcafe0bf0005..7ad634501e48 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -144,7 +144,9 @@ extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
144extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); 144extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
145extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); 145extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
146extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); 146extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits);
147extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits);
147 148
149#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG))
148#define BITMAP_LAST_WORD_MASK(nbits) \ 150#define BITMAP_LAST_WORD_MASK(nbits) \
149( \ 151( \
150 ((nbits) % BITS_PER_LONG) ? \ 152 ((nbits) % BITS_PER_LONG) ? \
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 6395692b2e7a..32f0076e844b 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -125,7 +125,11 @@ enum rq_flag_bits {
125 __REQ_SYNC, /* request is sync (sync write or read) */ 125 __REQ_SYNC, /* request is sync (sync write or read) */
126 __REQ_META, /* metadata io request */ 126 __REQ_META, /* metadata io request */
127 __REQ_DISCARD, /* request to discard sectors */ 127 __REQ_DISCARD, /* request to discard sectors */
128 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
129
128 __REQ_NOIDLE, /* don't anticipate more IO after this one */ 130 __REQ_NOIDLE, /* don't anticipate more IO after this one */
131 __REQ_FUA, /* forced unit access */
132 __REQ_FLUSH, /* request for cache flush */
129 133
130 /* bio only flags */ 134 /* bio only flags */
131 __REQ_RAHEAD, /* read ahead, can fail anytime */ 135 __REQ_RAHEAD, /* read ahead, can fail anytime */
@@ -135,7 +139,6 @@ enum rq_flag_bits {
135 /* request only flags */ 139 /* request only flags */
136 __REQ_SORTED, /* elevator knows about this request */ 140 __REQ_SORTED, /* elevator knows about this request */
137 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 141 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
138 __REQ_FUA, /* forced unit access */
139 __REQ_NOMERGE, /* don't touch this for merging */ 142 __REQ_NOMERGE, /* don't touch this for merging */
140 __REQ_STARTED, /* drive already may have started this one */ 143 __REQ_STARTED, /* drive already may have started this one */
141 __REQ_DONTPREP, /* don't call prep for this one */ 144 __REQ_DONTPREP, /* don't call prep for this one */
@@ -146,11 +149,9 @@ enum rq_flag_bits {
146 __REQ_PREEMPT, /* set for "ide_preempt" requests */ 149 __REQ_PREEMPT, /* set for "ide_preempt" requests */
147 __REQ_ALLOCED, /* request came from our alloc pool */ 150 __REQ_ALLOCED, /* request came from our alloc pool */
148 __REQ_COPY_USER, /* contains copies of user pages */ 151 __REQ_COPY_USER, /* contains copies of user pages */
149 __REQ_FLUSH, /* request for cache flush */
150 __REQ_FLUSH_SEQ, /* request for flush sequence */ 152 __REQ_FLUSH_SEQ, /* request for flush sequence */
151 __REQ_IO_STAT, /* account I/O stat */ 153 __REQ_IO_STAT, /* account I/O stat */
152 __REQ_MIXED_MERGE, /* merge of different types, fail separately */ 154 __REQ_MIXED_MERGE, /* merge of different types, fail separately */
153 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
154 __REQ_NR_BITS, /* stops here */ 155 __REQ_NR_BITS, /* stops here */
155}; 156};
156 157
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0e67c45b3bc9..84b15d54f8c2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -30,6 +30,7 @@ struct request_pm_state;
30struct blk_trace; 30struct blk_trace;
31struct request; 31struct request;
32struct sg_io_hdr; 32struct sg_io_hdr;
33struct bsg_job;
33 34
34#define BLKDEV_MIN_RQ 4 35#define BLKDEV_MIN_RQ 4
35#define BLKDEV_MAX_RQ 128 /* Default maximum */ 36#define BLKDEV_MAX_RQ 128 /* Default maximum */
@@ -117,6 +118,7 @@ struct request {
117 struct { 118 struct {
118 unsigned int seq; 119 unsigned int seq;
119 struct list_head list; 120 struct list_head list;
121 rq_end_io_fn *saved_end_io;
120 } flush; 122 } flush;
121 }; 123 };
122 124
@@ -209,6 +211,7 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
209typedef void (softirq_done_fn)(struct request *); 211typedef void (softirq_done_fn)(struct request *);
210typedef int (dma_drain_needed_fn)(struct request *); 212typedef int (dma_drain_needed_fn)(struct request *);
211typedef int (lld_busy_fn) (struct request_queue *q); 213typedef int (lld_busy_fn) (struct request_queue *q);
214typedef int (bsg_job_fn) (struct bsg_job *);
212 215
213enum blk_eh_timer_return { 216enum blk_eh_timer_return {
214 BLK_EH_NOT_HANDLED, 217 BLK_EH_NOT_HANDLED,
@@ -375,6 +378,8 @@ struct request_queue {
375 struct mutex sysfs_lock; 378 struct mutex sysfs_lock;
376 379
377#if defined(CONFIG_BLK_DEV_BSG) 380#if defined(CONFIG_BLK_DEV_BSG)
381 bsg_job_fn *bsg_job_fn;
382 int bsg_job_size;
378 struct bsg_class_device bsg_dev; 383 struct bsg_class_device bsg_dev;
379#endif 384#endif
380 385
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 8c7c2de7631a..8e9e4bc6d73b 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -14,7 +14,7 @@
14enum blktrace_cat { 14enum blktrace_cat {
15 BLK_TC_READ = 1 << 0, /* reads */ 15 BLK_TC_READ = 1 << 0, /* reads */
16 BLK_TC_WRITE = 1 << 1, /* writes */ 16 BLK_TC_WRITE = 1 << 1, /* writes */
17 BLK_TC_BARRIER = 1 << 2, /* barrier */ 17 BLK_TC_FLUSH = 1 << 2, /* flush */
18 BLK_TC_SYNC = 1 << 3, /* sync IO */ 18 BLK_TC_SYNC = 1 << 3, /* sync IO */
19 BLK_TC_SYNCIO = BLK_TC_SYNC, 19 BLK_TC_SYNCIO = BLK_TC_SYNC,
20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ 20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
@@ -28,8 +28,9 @@ enum blktrace_cat {
28 BLK_TC_META = 1 << 12, /* metadata */ 28 BLK_TC_META = 1 << 12, /* metadata */
29 BLK_TC_DISCARD = 1 << 13, /* discard requests */ 29 BLK_TC_DISCARD = 1 << 13, /* discard requests */
30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ 30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
31 BLK_TC_FUA = 1 << 15, /* fua requests */
31 32
32 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 33 BLK_TC_END = 1 << 15, /* we've run out of bits! */
33}; 34};
34 35
35#define BLK_TC_SHIFT (16) 36#define BLK_TC_SHIFT (16)
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h
new file mode 100644
index 000000000000..f55ab8cdc106
--- /dev/null
+++ b/include/linux/bsg-lib.h
@@ -0,0 +1,73 @@
1/*
2 * BSG helper library
3 *
4 * Copyright (C) 2008 James Smart, Emulex Corporation
5 * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2011 Mike Christie
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef _BLK_BSG_
24#define _BLK_BSG_
25
26#include <linux/blkdev.h>
27
28struct request;
29struct device;
30struct scatterlist;
31struct request_queue;
32
33struct bsg_buffer {
34 unsigned int payload_len;
35 int sg_cnt;
36 struct scatterlist *sg_list;
37};
38
39struct bsg_job {
40 struct device *dev;
41 struct request *req;
42
43 /* Transport/driver specific request/reply structs */
44 void *request;
45 void *reply;
46
47 unsigned int request_len;
48 unsigned int reply_len;
49 /*
50 * On entry : reply_len indicates the buffer size allocated for
51 * the reply.
52 *
53 * Upon completion : the message handler must set reply_len
54 * to indicates the size of the reply to be returned to the
55 * caller.
56 */
57
58 /* DMA payloads for the request/response */
59 struct bsg_buffer request_payload;
60 struct bsg_buffer reply_payload;
61
62 void *dd_data; /* Used for driver-specific storage */
63};
64
65void bsg_job_done(struct bsg_job *job, int result,
66 unsigned int reply_payload_rcv_len);
67int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
68 bsg_job_fn *job_fn, int dd_job_size);
69void bsg_request_fn(struct request_queue *q);
70void bsg_remove_queue(struct request_queue *q);
71void bsg_goose_queue(struct request_queue *q);
72
73#endif
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 503c8a6b3079..458f497738a4 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -12,7 +12,7 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <linux/pagemap.h> 13#include <linux/pagemap.h>
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <asm/atomic.h> 15#include <linux/atomic.h>
16 16
17#ifdef CONFIG_BLOCK 17#ifdef CONFIG_BLOCK
18 18
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 291aa6e18d31..ca768ae729b4 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -93,6 +93,7 @@ struct ceph_msg {
93 bool more_to_follow; 93 bool more_to_follow;
94 bool needs_out_seq; 94 bool needs_out_seq;
95 int front_max; 95 int front_max;
96 unsigned long ack_stamp; /* tx: when we were acked */
96 97
97 struct ceph_msgpool *pool; 98 struct ceph_msgpool *pool;
98}; 99};
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 8779405e15a8..c6e7523bf765 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -438,7 +438,6 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
438 struct compat_timespec __user *tsp, 438 struct compat_timespec __user *tsp,
439 const compat_sigset_t __user *sigmask, 439 const compat_sigset_t __user *sigmask,
440 compat_size_t sigsetsize); 440 compat_size_t sigsetsize);
441asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
442asmlinkage long compat_sys_signalfd4(int ufd, 441asmlinkage long compat_sys_signalfd4(int ufd,
443 const compat_sigset_t __user *sigmask, 442 const compat_sigset_t __user *sigmask,
444 compat_size_t sigsetsize, int flags); 443 compat_size_t sigsetsize, int flags);
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 645778ad899b..3081c58d696e 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -42,7 +42,7 @@
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/err.h> 43#include <linux/err.h>
44 44
45#include <asm/atomic.h> 45#include <linux/atomic.h>
46 46
47#define CONFIGFS_ITEM_NAME_LEN 20 47#define CONFIGFS_ITEM_NAME_LEN 20
48 48
diff --git a/include/linux/connector.h b/include/linux/connector.h
index f696bccd48cb..3c9c54fd5690 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * connector.h 2 * connector.h
3 * 3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -75,7 +75,7 @@ struct cn_msg {
75 75
76#ifdef __KERNEL__ 76#ifdef __KERNEL__
77 77
78#include <asm/atomic.h> 78#include <linux/atomic.h>
79 79
80#include <linux/list.h> 80#include <linux/list.h>
81#include <linux/workqueue.h> 81#include <linux/workqueue.h>
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 11be48e0d168..6216115c7789 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -324,11 +324,16 @@ static inline unsigned int cpufreq_get(unsigned int cpu)
324/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ 324/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
325#ifdef CONFIG_CPU_FREQ 325#ifdef CONFIG_CPU_FREQ
326unsigned int cpufreq_quick_get(unsigned int cpu); 326unsigned int cpufreq_quick_get(unsigned int cpu);
327unsigned int cpufreq_quick_get_max(unsigned int cpu);
327#else 328#else
328static inline unsigned int cpufreq_quick_get(unsigned int cpu) 329static inline unsigned int cpufreq_quick_get(unsigned int cpu)
329{ 330{
330 return 0; 331 return 0;
331} 332}
333static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
334{
335 return 0;
336}
332#endif 337#endif
333 338
334 339
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 36719ead50e8..b51629e15cfc 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -122,6 +122,8 @@ struct cpuidle_driver {
122}; 122};
123 123
124#ifdef CONFIG_CPU_IDLE 124#ifdef CONFIG_CPU_IDLE
125extern void disable_cpuidle(void);
126extern int cpuidle_idle_call(void);
125 127
126extern int cpuidle_register_driver(struct cpuidle_driver *drv); 128extern int cpuidle_register_driver(struct cpuidle_driver *drv);
127struct cpuidle_driver *cpuidle_get_driver(void); 129struct cpuidle_driver *cpuidle_get_driver(void);
@@ -135,6 +137,8 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev);
135extern void cpuidle_disable_device(struct cpuidle_device *dev); 137extern void cpuidle_disable_device(struct cpuidle_device *dev);
136 138
137#else 139#else
140static inline void disable_cpuidle(void) { }
141static inline int cpuidle_idle_call(void) { return -ENODEV; }
138 142
139static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 143static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
140{return -ENODEV; } 144{return -ENODEV; }
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index b24ac56477b4..4f7a63237471 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -617,6 +617,20 @@ static inline size_t cpumask_size(void)
617 * ... use 'tmpmask' like a normal struct cpumask * ... 617 * ... use 'tmpmask' like a normal struct cpumask * ...
618 * 618 *
619 * free_cpumask_var(tmpmask); 619 * free_cpumask_var(tmpmask);
620 *
621 *
622 * However, one notable exception is there. alloc_cpumask_var() allocates
623 * only nr_cpumask_bits bits (in the other hand, real cpumask_t always has
624 * NR_CPUS bits). Therefore you don't have to dereference cpumask_var_t.
625 *
626 * cpumask_var_t tmpmask;
627 * if (!alloc_cpumask_var(&tmpmask, GFP_KERNEL))
628 * return -ENOMEM;
629 *
630 * var = *tmpmask;
631 *
632 * This code makes NR_CPUS length memcopy and brings to a memory corruption.
633 * cpumask_copy() provide safe copy functionality.
620 */ 634 */
621#ifdef CONFIG_CPUMASK_OFFSTACK 635#ifdef CONFIG_CPUMASK_OFFSTACK
622typedef struct cpumask *cpumask_var_t; 636typedef struct cpumask *cpumask_var_t;
diff --git a/include/linux/cred.h b/include/linux/cred.h
index f240f2fa0197..40308969ed00 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -16,7 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/key.h> 17#include <linux/key.h>
18#include <linux/selinux.h> 18#include <linux/selinux.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21struct user_struct; 21struct user_struct;
22struct cred; 22struct cred;
@@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred)
265/** 265/**
266 * current_cred - Access the current task's subjective credentials 266 * current_cred - Access the current task's subjective credentials
267 * 267 *
268 * Access the subjective credentials of the current task. 268 * Access the subjective credentials of the current task. RCU-safe,
269 * since nobody else can modify it.
269 */ 270 */
270#define current_cred() \ 271#define current_cred() \
271 (current->cred) 272 rcu_dereference_protected(current->cred, 1)
272 273
273/** 274/**
274 * __task_cred - Access a task's objective credentials 275 * __task_cred - Access a task's objective credentials
@@ -306,8 +307,8 @@ static inline void put_cred(const struct cred *_cred)
306#define get_current_user() \ 307#define get_current_user() \
307({ \ 308({ \
308 struct user_struct *__u; \ 309 struct user_struct *__u; \
309 struct cred *__cred; \ 310 const struct cred *__cred; \
310 __cred = (struct cred *) current_cred(); \ 311 __cred = current_cred(); \
311 __u = get_uid(__cred->user); \ 312 __u = get_uid(__cred->user); \
312 __u; \ 313 __u; \
313}) 314})
@@ -321,8 +322,8 @@ static inline void put_cred(const struct cred *_cred)
321#define get_current_groups() \ 322#define get_current_groups() \
322({ \ 323({ \
323 struct group_info *__groups; \ 324 struct group_info *__groups; \
324 struct cred *__cred; \ 325 const struct cred *__cred; \
325 __cred = (struct cred *) current_cred(); \ 326 __cred = current_cred(); \
326 __groups = get_group_info(__cred->group_info); \ 327 __groups = get_group_info(__cred->group_info); \
327 __groups; \ 328 __groups; \
328}) 329})
@@ -341,7 +342,7 @@ static inline void put_cred(const struct cred *_cred)
341 342
342#define current_cred_xxx(xxx) \ 343#define current_cred_xxx(xxx) \
343({ \ 344({ \
344 current->cred->xxx; \ 345 current_cred()->xxx; \
345}) 346})
346 347
347#define current_uid() (current_cred_xxx(uid)) 348#define current_uid() (current_cred_xxx(uid))
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index a6a7a1c83f54..e5e468e9133d 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -17,7 +17,7 @@
17#ifndef _LINUX_CRYPTO_H 17#ifndef _LINUX_CRYPTO_H
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/list.h> 23#include <linux/list.h>
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h
index ec78a4bbe1d5..2cd9f1cf9fa3 100644
--- a/include/linux/cryptohash.h
+++ b/include/linux/cryptohash.h
@@ -3,11 +3,16 @@
3 3
4#define SHA_DIGEST_WORDS 5 4#define SHA_DIGEST_WORDS 5
5#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) 5#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
6#define SHA_WORKSPACE_WORDS 80 6#define SHA_WORKSPACE_WORDS 16
7 7
8void sha_init(__u32 *buf); 8void sha_init(__u32 *buf);
9void sha_transform(__u32 *digest, const char *data, __u32 *W); 9void sha_transform(__u32 *digest, const char *data, __u32 *W);
10 10
11#define MD5_DIGEST_WORDS 4
12#define MD5_MESSAGE_BYTES 64
13
14void md5_transform(__u32 *hash, __u32 const *in);
15
11__u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); 16__u32 half_md4_transform(__u32 buf[4], __u32 const in[8]);
12 17
13#endif 18#endif
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
index 6fe2114f8ad2..c077aec3a6ff 100644
--- a/include/linux/cs5535.h
+++ b/include/linux/cs5535.h
@@ -11,6 +11,8 @@
11#ifndef _CS5535_H 11#ifndef _CS5535_H
12#define _CS5535_H 12#define _CS5535_H
13 13
14#include <asm/msr.h>
15
14/* MSRs */ 16/* MSRs */
15#define MSR_GLIU_P2D_RO0 0x10000029 17#define MSR_GLIU_P2D_RO0 0x10000029
16 18
@@ -38,17 +40,75 @@
38#define MSR_MFGPT_NR 0x51400029 40#define MSR_MFGPT_NR 0x51400029
39#define MSR_MFGPT_SETUP 0x5140002B 41#define MSR_MFGPT_SETUP 0x5140002B
40 42
43#define MSR_RTC_DOMA_OFFSET 0x51400055
44#define MSR_RTC_MONA_OFFSET 0x51400056
45#define MSR_RTC_CEN_OFFSET 0x51400057
46
41#define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */ 47#define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */
42 48
43#define MSR_GX_GLD_MSR_CONFIG 0xC0002001 49#define MSR_GX_GLD_MSR_CONFIG 0xC0002001
44#define MSR_GX_MSR_PADSEL 0xC0002011 50#define MSR_GX_MSR_PADSEL 0xC0002011
45 51
52static inline int cs5535_pic_unreqz_select_high(unsigned int group,
53 unsigned int irq)
54{
55 uint32_t lo, hi;
56
57 rdmsr(MSR_PIC_ZSEL_HIGH, lo, hi);
58 lo &= ~(0xF << (group * 4));
59 lo |= (irq & 0xF) << (group * 4);
60 wrmsr(MSR_PIC_ZSEL_HIGH, lo, hi);
61 return 0;
62}
63
64/* PIC registers */
65#define CS5536_PIC_INT_SEL1 0x4d0
66#define CS5536_PIC_INT_SEL2 0x4d1
67
46/* resource sizes */ 68/* resource sizes */
47#define LBAR_GPIO_SIZE 0xFF 69#define LBAR_GPIO_SIZE 0xFF
48#define LBAR_MFGPT_SIZE 0x40 70#define LBAR_MFGPT_SIZE 0x40
49#define LBAR_ACPI_SIZE 0x40 71#define LBAR_ACPI_SIZE 0x40
50#define LBAR_PMS_SIZE 0x80 72#define LBAR_PMS_SIZE 0x80
51 73
74/*
75 * PMC registers (PMS block)
76 * It is only safe to access these registers as dword accesses.
77 * See CS5536 Specification Update erratas 17 & 18
78 */
79#define CS5536_PM_SCLK 0x10
80#define CS5536_PM_IN_SLPCTL 0x20
81#define CS5536_PM_WKXD 0x34
82#define CS5536_PM_WKD 0x30
83#define CS5536_PM_SSC 0x54
84
85/*
86 * PM registers (ACPI block)
87 * It is only safe to access these registers as dword accesses.
88 * See CS5536 Specification Update erratas 17 & 18
89 */
90#define CS5536_PM1_STS 0x00
91#define CS5536_PM1_EN 0x02
92#define CS5536_PM1_CNT 0x08
93#define CS5536_PM_GPE0_STS 0x18
94#define CS5536_PM_GPE0_EN 0x1c
95
96/* CS5536_PM1_STS bits */
97#define CS5536_WAK_FLAG (1 << 15)
98#define CS5536_PWRBTN_FLAG (1 << 8)
99
100/* CS5536_PM1_EN bits */
101#define CS5536_PM_PWRBTN (1 << 8)
102#define CS5536_PM_RTC (1 << 10)
103
104/* CS5536_PM_GPE0_STS bits */
105#define CS5536_GPIOM7_PME_FLAG (1 << 31)
106#define CS5536_GPIOM6_PME_FLAG (1 << 30)
107
108/* CS5536_PM_GPE0_EN bits */
109#define CS5536_GPIOM7_PME_EN (1 << 31)
110#define CS5536_GPIOM6_PME_EN (1 << 30)
111
52/* VSA2 magic values */ 112/* VSA2 magic values */
53#define VSA_VRC_INDEX 0xAC1C 113#define VSA_VRC_INDEX 0xAC1C
54#define VSA_VRC_DATA 0xAC1E 114#define VSA_VRC_DATA 0xAC1E
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 3f22d8d6d8a3..62157c03caf7 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_DCACHE_H 1#ifndef __LINUX_DCACHE_H
2#define __LINUX_DCACHE_H 2#define __LINUX_DCACHE_H
3 3
4#include <asm/atomic.h> 4#include <linux/atomic.h>
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/rculist.h> 6#include <linux/rculist.h>
7#include <linux/rculist_bl.h> 7#include <linux/rculist_bl.h>
@@ -180,12 +180,12 @@ struct dentry_operations {
180 */ 180 */
181 181
182/* d_flags entries */ 182/* d_flags entries */
183#define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ 183#define DCACHE_OP_HASH 0x0001
184#define DCACHE_NFSFS_RENAMED 0x0002 184#define DCACHE_OP_COMPARE 0x0002
185 /* this dentry has been "silly renamed" and has to be deleted on the last 185#define DCACHE_OP_REVALIDATE 0x0004
186 * dput() */ 186#define DCACHE_OP_DELETE 0x0008
187 187
188#define DCACHE_DISCONNECTED 0x0004 188#define DCACHE_DISCONNECTED 0x0010
189 /* This dentry is possibly not currently connected to the dcache tree, in 189 /* This dentry is possibly not currently connected to the dcache tree, in
190 * which case its parent will either be itself, or will have this flag as 190 * which case its parent will either be itself, or will have this flag as
191 * well. nfsd will not use a dentry with this bit set, but will first 191 * well. nfsd will not use a dentry with this bit set, but will first
@@ -196,22 +196,18 @@ struct dentry_operations {
196 * dentry into place and return that dentry rather than the passed one, 196 * dentry into place and return that dentry rather than the passed one,
197 * typically using d_splice_alias. */ 197 * typically using d_splice_alias. */
198 198
199#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ 199#define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */
200#define DCACHE_RCUACCESS 0x0010 /* Entry has ever been RCU-visible */ 200#define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */
201#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020
202 /* Parent inode is watched by inotify */
203
204#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
205#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080
206 /* Parent inode is watched by some fsnotify listener */
207 201
208#define DCACHE_CANT_MOUNT 0x0100 202#define DCACHE_CANT_MOUNT 0x0100
209#define DCACHE_GENOCIDE 0x0200 203#define DCACHE_GENOCIDE 0x0200
210 204
211#define DCACHE_OP_HASH 0x1000 205#define DCACHE_NFSFS_RENAMED 0x1000
212#define DCACHE_OP_COMPARE 0x2000 206 /* this dentry has been "silly renamed" and has to be deleted on the last
213#define DCACHE_OP_REVALIDATE 0x4000 207 * dput() */
214#define DCACHE_OP_DELETE 0x8000 208#define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */
209#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000
210 /* Parent inode is watched by some fsnotify listener */
215 211
216#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ 212#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
217#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ 213#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 2833452ea01c..5033fb88c107 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -2,7 +2,7 @@
2#define __LINUX_DEBUG_LOCKING_H 2#define __LINUX_DEBUG_LOCKING_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <asm/atomic.h> 5#include <linux/atomic.h>
6#include <asm/system.h> 6#include <asm/system.h>
7 7
8struct task_struct; 8struct task_struct;
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 4427e0454051..3fa1f3d90ce0 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -208,6 +208,49 @@ struct dm_target_callbacks {
208int dm_register_target(struct target_type *t); 208int dm_register_target(struct target_type *t);
209void dm_unregister_target(struct target_type *t); 209void dm_unregister_target(struct target_type *t);
210 210
211/*
212 * Target argument parsing.
213 */
214struct dm_arg_set {
215 unsigned argc;
216 char **argv;
217};
218
219/*
220 * The minimum and maximum value of a numeric argument, together with
221 * the error message to use if the number is found to be outside that range.
222 */
223struct dm_arg {
224 unsigned min;
225 unsigned max;
226 char *error;
227};
228
229/*
230 * Validate the next argument, either returning it as *value or, if invalid,
231 * returning -EINVAL and setting *error.
232 */
233int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set,
234 unsigned *value, char **error);
235
236/*
237 * Process the next argument as the start of a group containing between
238 * arg->min and arg->max further arguments. Either return the size as
239 * *num_args or, if invalid, return -EINVAL and set *error.
240 */
241int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set,
242 unsigned *num_args, char **error);
243
244/*
245 * Return the current argument and shift to the next.
246 */
247const char *dm_shift_arg(struct dm_arg_set *as);
248
249/*
250 * Move through num_args arguments.
251 */
252void dm_consume_args(struct dm_arg_set *as, unsigned num_args);
253
211/*----------------------------------------------------------------- 254/*-----------------------------------------------------------------
212 * Functions for creating and manipulating mapped devices. 255 * Functions for creating and manipulating mapped devices.
213 * Drop the reference with dm_put when you finish with the object. 256 * Drop the reference with dm_put when you finish with the object.
diff --git a/include/linux/device.h b/include/linux/device.h
index 160d4ddb2499..c20dfbfc49b4 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -22,7 +22,7 @@
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <asm/atomic.h> 25#include <linux/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
27 27
28struct device; 28struct device;
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 3708455ee6c3..0cb8eff76bd6 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 20 270#define DM_VERSION_MINOR 21
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2011-02-02)" 272#define DM_VERSION_EXTRA "-ioctl (2011-07-06)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h
index 298d587e349b..5e54458e920f 100644
--- a/include/linux/dm-kcopyd.h
+++ b/include/linux/dm-kcopyd.h
@@ -42,5 +42,20 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from,
42 unsigned num_dests, struct dm_io_region *dests, 42 unsigned num_dests, struct dm_io_region *dests,
43 unsigned flags, dm_kcopyd_notify_fn fn, void *context); 43 unsigned flags, dm_kcopyd_notify_fn fn, void *context);
44 44
45/*
46 * Prepare a callback and submit it via the kcopyd thread.
47 *
48 * dm_kcopyd_prepare_callback allocates a callback structure and returns it.
49 * It must not be called from interrupt context.
50 * The returned value should be passed into dm_kcopyd_do_callback.
51 *
52 * dm_kcopyd_do_callback submits the callback.
53 * It may be called from interrupt context.
54 * The callback is issued from the kcopyd thread.
55 */
56void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
57 dm_kcopyd_notify_fn fn, void *context);
58void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err);
59
45#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
46#endif /* _LINUX_DM_KCOPYD_H */ 61#endif /* _LINUX_DM_KCOPYD_H */
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 1a167c48d84d..347fdc32177a 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -46,27 +46,6 @@ struct dma_map_ops {
46 46
47#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) 47#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
48 48
49typedef u64 DMA_nnBIT_MASK __deprecated;
50
51/*
52 * NOTE: do not use the below macros in new code and do not add new definitions
53 * here.
54 *
55 * Instead, just open-code DMA_BIT_MASK(n) within your driver
56 */
57#define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64)
58#define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48)
59#define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47)
60#define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40)
61#define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39)
62#define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35)
63#define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32)
64#define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31)
65#define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30)
66#define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29)
67#define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28)
68#define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24)
69
70#define DMA_MASK_NONE 0x0ULL 49#define DMA_MASK_NONE 0x0ULL
71 50
72static inline int valid_dma_direction(int dma_direction) 51static inline int valid_dma_direction(int dma_direction)
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h
index fec66bd24f22..d47bccd604e4 100644
--- a/include/linux/dvb/audio.h
+++ b/include/linux/dvb/audio.h
@@ -67,7 +67,7 @@ typedef struct audio_status {
67 67
68 68
69typedef 69typedef
70struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ 70struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */
71 int vocal1; /* into left and right t at 70% each */ 71 int vocal1; /* into left and right t at 70% each */
72 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ 72 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
73 int melody; /* mixed into the left channel and */ 73 int melody; /* mixed into the left channel and */
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h
new file mode 100644
index 000000000000..2224a8c0cb64
--- /dev/null
+++ b/include/linux/ecryptfs.h
@@ -0,0 +1,113 @@
1#ifndef _LINUX_ECRYPTFS_H
2#define _LINUX_ECRYPTFS_H
3
4/* Version verification for shared data structures w/ userspace */
5#define ECRYPTFS_VERSION_MAJOR 0x00
6#define ECRYPTFS_VERSION_MINOR 0x04
7#define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03
8/* These flags indicate which features are supported by the kernel
9 * module; userspace tools such as the mount helper read
10 * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine
11 * how to behave. */
12#define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001
13#define ECRYPTFS_VERSIONING_PUBKEY 0x00000002
14#define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004
15#define ECRYPTFS_VERSIONING_POLICY 0x00000008
16#define ECRYPTFS_VERSIONING_XATTR 0x00000010
17#define ECRYPTFS_VERSIONING_MULTKEY 0x00000020
18#define ECRYPTFS_VERSIONING_DEVMISC 0x00000040
19#define ECRYPTFS_VERSIONING_HMAC 0x00000080
20#define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100
21#define ECRYPTFS_VERSIONING_GCM 0x00000200
22#define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \
23 | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \
24 | ECRYPTFS_VERSIONING_PUBKEY \
25 | ECRYPTFS_VERSIONING_XATTR \
26 | ECRYPTFS_VERSIONING_MULTKEY \
27 | ECRYPTFS_VERSIONING_DEVMISC \
28 | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION)
29#define ECRYPTFS_MAX_PASSWORD_LENGTH 64
30#define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH
31#define ECRYPTFS_SALT_SIZE 8
32#define ECRYPTFS_SALT_SIZE_HEX (ECRYPTFS_SALT_SIZE*2)
33/* The original signature size is only for what is stored on disk; all
34 * in-memory representations are expanded hex, so it better adapted to
35 * be passed around or referenced on the command line */
36#define ECRYPTFS_SIG_SIZE 8
37#define ECRYPTFS_SIG_SIZE_HEX (ECRYPTFS_SIG_SIZE*2)
38#define ECRYPTFS_PASSWORD_SIG_SIZE ECRYPTFS_SIG_SIZE_HEX
39#define ECRYPTFS_MAX_KEY_BYTES 64
40#define ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES 512
41#define ECRYPTFS_FILE_VERSION 0x03
42#define ECRYPTFS_MAX_PKI_NAME_BYTES 16
43
44#define RFC2440_CIPHER_DES3_EDE 0x02
45#define RFC2440_CIPHER_CAST_5 0x03
46#define RFC2440_CIPHER_BLOWFISH 0x04
47#define RFC2440_CIPHER_AES_128 0x07
48#define RFC2440_CIPHER_AES_192 0x08
49#define RFC2440_CIPHER_AES_256 0x09
50#define RFC2440_CIPHER_TWOFISH 0x0a
51#define RFC2440_CIPHER_CAST_6 0x0b
52
53#define RFC2440_CIPHER_RSA 0x01
54
55/**
56 * For convenience, we may need to pass around the encrypted session
57 * key between kernel and userspace because the authentication token
58 * may not be extractable. For example, the TPM may not release the
59 * private key, instead requiring the encrypted data and returning the
60 * decrypted data.
61 */
62struct ecryptfs_session_key {
63#define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_DECRYPT 0x00000001
64#define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_ENCRYPT 0x00000002
65#define ECRYPTFS_CONTAINS_DECRYPTED_KEY 0x00000004
66#define ECRYPTFS_CONTAINS_ENCRYPTED_KEY 0x00000008
67 u32 flags;
68 u32 encrypted_key_size;
69 u32 decrypted_key_size;
70 u8 encrypted_key[ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES];
71 u8 decrypted_key[ECRYPTFS_MAX_KEY_BYTES];
72};
73
74struct ecryptfs_password {
75 u32 password_bytes;
76 s32 hash_algo;
77 u32 hash_iterations;
78 u32 session_key_encryption_key_bytes;
79#define ECRYPTFS_PERSISTENT_PASSWORD 0x01
80#define ECRYPTFS_SESSION_KEY_ENCRYPTION_KEY_SET 0x02
81 u32 flags;
82 /* Iterated-hash concatenation of salt and passphrase */
83 u8 session_key_encryption_key[ECRYPTFS_MAX_KEY_BYTES];
84 u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1];
85 /* Always in expanded hex */
86 u8 salt[ECRYPTFS_SALT_SIZE];
87};
88
89enum ecryptfs_token_types {ECRYPTFS_PASSWORD, ECRYPTFS_PRIVATE_KEY};
90
91struct ecryptfs_private_key {
92 u32 key_size;
93 u32 data_len;
94 u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1];
95 char pki_type[ECRYPTFS_MAX_PKI_NAME_BYTES + 1];
96 u8 data[];
97};
98
99/* May be a password or a private key */
100struct ecryptfs_auth_tok {
101 u16 version; /* 8-bit major and 8-bit minor */
102 u16 token_type;
103#define ECRYPTFS_ENCRYPT_ONLY 0x00000001
104 u32 flags;
105 struct ecryptfs_session_key session_key;
106 u8 reserved[32];
107 union {
108 struct ecryptfs_password password;
109 struct ecryptfs_private_key private_key;
110 } token;
111} __attribute__ ((packed));
112
113#endif /* _LINUX_ECRYPTFS_H */
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 36c66443bdfd..4a73257b47d0 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -12,7 +12,7 @@
12#ifndef _LINUX_EDAC_H_ 12#ifndef _LINUX_EDAC_H_
13#define _LINUX_EDAC_H_ 13#define _LINUX_EDAC_H_
14 14
15#include <asm/atomic.h> 15#include <linux/atomic.h>
16#include <linux/sysdev.h> 16#include <linux/sysdev.h>
17 17
18#define EDAC_OPSTATE_INVAL -1 18#define EDAC_OPSTATE_INVAL -1
diff --git a/include/linux/efi.h b/include/linux/efi.h
index ec2572693925..2362a0bc7f0d 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -19,6 +19,7 @@
19#include <linux/rtc.h> 19#include <linux/rtc.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/pfn.h> 21#include <linux/pfn.h>
22#include <linux/pstore.h>
22 23
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/system.h> 25#include <asm/system.h>
@@ -232,6 +233,9 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
232#define UV_SYSTEM_TABLE_GUID \ 233#define UV_SYSTEM_TABLE_GUID \
233 EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 ) 234 EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 )
234 235
236#define LINUX_EFI_CRASH_GUID \
237 EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 )
238
235typedef struct { 239typedef struct {
236 efi_guid_t guid; 240 efi_guid_t guid;
237 unsigned long table; 241 unsigned long table;
@@ -458,6 +462,8 @@ struct efivars {
458 struct kset *kset; 462 struct kset *kset;
459 struct bin_attribute *new_var, *del_var; 463 struct bin_attribute *new_var, *del_var;
460 const struct efivar_operations *ops; 464 const struct efivar_operations *ops;
465 struct efivar_entry *walk_entry;
466 struct pstore_info efi_pstore_info;
461}; 467};
462 468
463int register_efivars(struct efivars *efivars, 469int register_efivars(struct efivars *efivars,
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 2dfa7076e8b6..53792bf36c71 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/magic.h> 20#include <linux/magic.h>
21#include <linux/fs.h>
21 22
22/* 23/*
23 * The second extended filesystem constants/structures 24 * The second extended filesystem constants/structures
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 0c473fd79acb..67a803aee619 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -418,12 +418,11 @@ struct ext3_inode {
418#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS 418#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
419#endif 419#endif
420 420
421#define ext3_set_bit __test_and_set_bit_le 421#define ext3_set_bit __set_bit_le
422#define ext3_set_bit_atomic ext2_set_bit_atomic 422#define ext3_set_bit_atomic ext2_set_bit_atomic
423#define ext3_clear_bit __test_and_clear_bit_le 423#define ext3_clear_bit __clear_bit_le
424#define ext3_clear_bit_atomic ext2_clear_bit_atomic 424#define ext3_clear_bit_atomic ext2_clear_bit_atomic
425#define ext3_test_bit test_bit_le 425#define ext3_test_bit test_bit_le
426#define ext3_find_first_zero_bit find_first_zero_bit_le
427#define ext3_find_next_zero_bit find_next_zero_bit_le 426#define ext3_find_next_zero_bit find_next_zero_bit_le
428 427
429/* 428/*
@@ -913,7 +912,7 @@ extern void ext3_dirty_inode(struct inode *, int);
913extern int ext3_change_inode_journal_flag(struct inode *, int); 912extern int ext3_change_inode_journal_flag(struct inode *, int);
914extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); 913extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *);
915extern int ext3_can_truncate(struct inode *inode); 914extern int ext3_can_truncate(struct inode *inode);
916extern void ext3_truncate (struct inode *); 915extern void ext3_truncate(struct inode *inode);
917extern void ext3_set_inode_flags(struct inode *); 916extern void ext3_set_inode_flags(struct inode *);
918extern void ext3_get_inode_flags(struct ext3_inode_info *); 917extern void ext3_get_inode_flags(struct ext3_inode_info *);
919extern void ext3_set_aops(struct inode *inode); 918extern void ext3_set_aops(struct inode *inode);
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
index 7b64ad40e4ce..c6f996f2abb6 100644
--- a/include/linux/fault-inject.h
+++ b/include/linux/fault-inject.h
@@ -5,7 +5,7 @@
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/debugfs.h> 7#include <linux/debugfs.h>
8#include <asm/atomic.h> 8#include <linux/atomic.h>
9 9
10/* 10/*
11 * For explanation of the elements of this struct, see 11 * For explanation of the elements of this struct, see
@@ -25,26 +25,6 @@ struct fault_attr {
25 unsigned long reject_end; 25 unsigned long reject_end;
26 26
27 unsigned long count; 27 unsigned long count;
28
29#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
30
31 struct {
32 struct dentry *dir;
33
34 struct dentry *probability_file;
35 struct dentry *interval_file;
36 struct dentry *times_file;
37 struct dentry *space_file;
38 struct dentry *verbose_file;
39 struct dentry *task_filter_file;
40 struct dentry *stacktrace_depth_file;
41 struct dentry *require_start_file;
42 struct dentry *require_end_file;
43 struct dentry *reject_start_file;
44 struct dentry *reject_end_file;
45 } dentries;
46
47#endif
48}; 28};
49 29
50#define FAULT_ATTR_INITIALIZER { \ 30#define FAULT_ATTR_INITIALIZER { \
@@ -57,24 +37,19 @@ struct fault_attr {
57 37
58#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER 38#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
59int setup_fault_attr(struct fault_attr *attr, char *str); 39int setup_fault_attr(struct fault_attr *attr, char *str);
60void should_fail_srandom(unsigned long entropy);
61bool should_fail(struct fault_attr *attr, ssize_t size); 40bool should_fail(struct fault_attr *attr, ssize_t size);
62 41
63#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS 42#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
64 43
65int init_fault_attr_dentries(struct fault_attr *attr, const char *name); 44struct dentry *fault_create_debugfs_attr(const char *name,
66void cleanup_fault_attr_dentries(struct fault_attr *attr); 45 struct dentry *parent, struct fault_attr *attr);
67 46
68#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ 47#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
69 48
70static inline int init_fault_attr_dentries(struct fault_attr *attr, 49static inline struct dentry *fault_create_debugfs_attr(const char *name,
71 const char *name) 50 struct dentry *parent, struct fault_attr *attr)
72{
73 return -ENODEV;
74}
75
76static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
77{ 51{
52 return ERR_PTR(-ENODEV);
78} 53}
79 54
80#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ 55#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index df7e3cf82e97..82163c4b32c9 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15 15
16#include <asm/atomic.h> 16#include <linux/atomic.h>
17 17
18/* 18/*
19 * The default fd array needs to be at least BITS_PER_LONG, 19 * The default fd array needs to be at least BITS_PER_LONG,
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 9ee3f9fb0b4a..741956fa5bfd 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -9,7 +9,7 @@
9#include <linux/types.h> 9#include <linux/types.h>
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13#endif 13#endif
14 14
15/* 15/*
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 5e6f42789afe..84ccf8e04fa6 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -14,7 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/workqueue.h> 15#include <linux/workqueue.h>
16 16
17#include <asm/atomic.h> 17#include <linux/atomic.h>
18#include <asm/byteorder.h> 18#include <asm/byteorder.h>
19 19
20#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) 20#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5f523eb9bb8d..c2bd68f2277a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -738,22 +738,54 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
738struct posix_acl; 738struct posix_acl;
739#define ACL_NOT_CACHED ((void *)(-1)) 739#define ACL_NOT_CACHED ((void *)(-1))
740 740
741#define IOP_FASTPERM 0x0001
742#define IOP_LOOKUP 0x0002
743#define IOP_NOFOLLOW 0x0004
744
745/*
746 * Keep mostly read-only and often accessed (especially for
747 * the RCU path lookup and 'stat' data) fields at the beginning
748 * of the 'struct inode'
749 */
741struct inode { 750struct inode {
742 /* RCU path lookup touches following: */
743 umode_t i_mode; 751 umode_t i_mode;
752 unsigned short i_opflags;
744 uid_t i_uid; 753 uid_t i_uid;
745 gid_t i_gid; 754 gid_t i_gid;
755 unsigned int i_flags;
756
757#ifdef CONFIG_FS_POSIX_ACL
758 struct posix_acl *i_acl;
759 struct posix_acl *i_default_acl;
760#endif
761
746 const struct inode_operations *i_op; 762 const struct inode_operations *i_op;
747 struct super_block *i_sb; 763 struct super_block *i_sb;
764 struct address_space *i_mapping;
748 765
749 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
750 unsigned int i_flags;
751 unsigned long i_state;
752#ifdef CONFIG_SECURITY 766#ifdef CONFIG_SECURITY
753 void *i_security; 767 void *i_security;
754#endif 768#endif
755 struct mutex i_mutex;
756 769
770 /* Stat data, not accessed from path walking */
771 unsigned long i_ino;
772 unsigned int i_nlink;
773 dev_t i_rdev;
774 loff_t i_size;
775 struct timespec i_atime;
776 struct timespec i_mtime;
777 struct timespec i_ctime;
778 unsigned int i_blkbits;
779 blkcnt_t i_blocks;
780
781#ifdef __NEED_I_SIZE_ORDERED
782 seqcount_t i_size_seqcount;
783#endif
784
785 /* Misc */
786 unsigned long i_state;
787 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
788 struct mutex i_mutex;
757 789
758 unsigned long dirtied_when; /* jiffies of first dirtying */ 790 unsigned long dirtied_when; /* jiffies of first dirtying */
759 791
@@ -765,25 +797,12 @@ struct inode {
765 struct list_head i_dentry; 797 struct list_head i_dentry;
766 struct rcu_head i_rcu; 798 struct rcu_head i_rcu;
767 }; 799 };
768 unsigned long i_ino;
769 atomic_t i_count; 800 atomic_t i_count;
770 unsigned int i_nlink;
771 dev_t i_rdev;
772 unsigned int i_blkbits;
773 u64 i_version; 801 u64 i_version;
774 loff_t i_size;
775#ifdef __NEED_I_SIZE_ORDERED
776 seqcount_t i_size_seqcount;
777#endif
778 struct timespec i_atime;
779 struct timespec i_mtime;
780 struct timespec i_ctime;
781 blkcnt_t i_blocks;
782 unsigned short i_bytes; 802 unsigned short i_bytes;
783 atomic_t i_dio_count; 803 atomic_t i_dio_count;
784 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 804 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
785 struct file_lock *i_flock; 805 struct file_lock *i_flock;
786 struct address_space *i_mapping;
787 struct address_space i_data; 806 struct address_space i_data;
788#ifdef CONFIG_QUOTA 807#ifdef CONFIG_QUOTA
789 struct dquot *i_dquot[MAXQUOTAS]; 808 struct dquot *i_dquot[MAXQUOTAS];
@@ -806,10 +825,6 @@ struct inode {
806 atomic_t i_readcount; /* struct files open RO */ 825 atomic_t i_readcount; /* struct files open RO */
807#endif 826#endif
808 atomic_t i_writecount; 827 atomic_t i_writecount;
809#ifdef CONFIG_FS_POSIX_ACL
810 struct posix_acl *i_acl;
811 struct posix_acl *i_default_acl;
812#endif
813 void *i_private; /* fs or device private pointer */ 828 void *i_private; /* fs or device private pointer */
814}; 829};
815 830
@@ -2303,6 +2318,11 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
2303extern struct inode * iget_locked(struct super_block *, unsigned long); 2318extern struct inode * iget_locked(struct super_block *, unsigned long);
2304extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2319extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2305extern int insert_inode_locked(struct inode *); 2320extern int insert_inode_locked(struct inode *);
2321#ifdef CONFIG_DEBUG_LOCK_ALLOC
2322extern void lockdep_annotate_inode_mutex_key(struct inode *inode);
2323#else
2324static inline void lockdep_annotate_inode_mutex_key(struct inode *inode) { };
2325#endif
2306extern void unlock_new_inode(struct inode *); 2326extern void unlock_new_inode(struct inode *);
2307extern unsigned int get_next_ino(void); 2327extern unsigned int get_next_ino(void);
2308 2328
@@ -2310,17 +2330,25 @@ extern void __iget(struct inode * inode);
2310extern void iget_failed(struct inode *); 2330extern void iget_failed(struct inode *);
2311extern void end_writeback(struct inode *); 2331extern void end_writeback(struct inode *);
2312extern void __destroy_inode(struct inode *); 2332extern void __destroy_inode(struct inode *);
2313extern struct inode *new_inode(struct super_block *); 2333extern struct inode *new_inode_pseudo(struct super_block *sb);
2334extern struct inode *new_inode(struct super_block *sb);
2314extern void free_inode_nonrcu(struct inode *inode); 2335extern void free_inode_nonrcu(struct inode *inode);
2315extern int should_remove_suid(struct dentry *); 2336extern int should_remove_suid(struct dentry *);
2316extern int file_remove_suid(struct file *); 2337extern int file_remove_suid(struct file *);
2317 2338
2318extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2339extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2319extern void remove_inode_hash(struct inode *);
2320static inline void insert_inode_hash(struct inode *inode) 2340static inline void insert_inode_hash(struct inode *inode)
2321{ 2341{
2322 __insert_inode_hash(inode, inode->i_ino); 2342 __insert_inode_hash(inode, inode->i_ino);
2323} 2343}
2344
2345extern void __remove_inode_hash(struct inode *);
2346static inline void remove_inode_hash(struct inode *inode)
2347{
2348 if (!inode_unhashed(inode))
2349 __remove_inode_hash(inode);
2350}
2351
2324extern void inode_sb_list_add(struct inode *inode); 2352extern void inode_sb_list_add(struct inode *inode);
2325 2353
2326#ifdef CONFIG_BLOCK 2354#ifdef CONFIG_BLOCK
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 69ad89b50489..91d0e0a34ef3 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -16,7 +16,7 @@
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21/* 21/*
22 * IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily 22 * IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index d464de53db43..464cff526860 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -47,6 +47,9 @@
47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct 47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec' 48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
49 * - add FUSE_IOCTL_32BIT flag 49 * - add FUSE_IOCTL_32BIT flag
50 *
51 * 7.17
52 * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
50 */ 53 */
51 54
52#ifndef _LINUX_FUSE_H 55#ifndef _LINUX_FUSE_H
@@ -78,7 +81,7 @@
78#define FUSE_KERNEL_VERSION 7 81#define FUSE_KERNEL_VERSION 7
79 82
80/** Minor version number of this interface */ 83/** Minor version number of this interface */
81#define FUSE_KERNEL_MINOR_VERSION 16 84#define FUSE_KERNEL_MINOR_VERSION 17
82 85
83/** The node ID of the root inode */ 86/** The node ID of the root inode */
84#define FUSE_ROOT_ID 1 87#define FUSE_ROOT_ID 1
@@ -153,8 +156,10 @@ struct fuse_file_lock {
153/** 156/**
154 * INIT request/reply flags 157 * INIT request/reply flags
155 * 158 *
159 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
156 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." 160 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
157 * FUSE_DONT_MASK: don't apply umask to file mode on create operations 161 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
162 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
158 */ 163 */
159#define FUSE_ASYNC_READ (1 << 0) 164#define FUSE_ASYNC_READ (1 << 0)
160#define FUSE_POSIX_LOCKS (1 << 1) 165#define FUSE_POSIX_LOCKS (1 << 1)
@@ -163,6 +168,7 @@ struct fuse_file_lock {
163#define FUSE_EXPORT_SUPPORT (1 << 4) 168#define FUSE_EXPORT_SUPPORT (1 << 4)
164#define FUSE_BIG_WRITES (1 << 5) 169#define FUSE_BIG_WRITES (1 << 5)
165#define FUSE_DONT_MASK (1 << 6) 170#define FUSE_DONT_MASK (1 << 6)
171#define FUSE_FLOCK_LOCKS (1 << 10)
166 172
167/** 173/**
168 * CUSE INIT request/reply flags 174 * CUSE INIT request/reply flags
@@ -175,6 +181,7 @@ struct fuse_file_lock {
175 * Release flags 181 * Release flags
176 */ 182 */
177#define FUSE_RELEASE_FLUSH (1 << 0) 183#define FUSE_RELEASE_FLUSH (1 << 0)
184#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
178 185
179/** 186/**
180 * Getattr flags 187 * Getattr flags
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 5bbebda78b02..5e98eeb2af3b 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -1,8 +1,26 @@
1/* 1/*
2 * Basic general purpose allocator for managing special purpose memory 2 * Basic general purpose allocator for managing special purpose
3 * not managed by the regular kmalloc/kfree interface. 3 * memory, for example, memory that is not managed by the regular
4 * Uses for this includes on-device special memory, uncached memory 4 * kmalloc/kfree interface. Uses for this includes on-device special
5 * etc. 5 * memory, uncached memory etc.
6 *
7 * It is safe to use the allocator in NMI handlers and other special
8 * unblockable contexts that could otherwise deadlock on locks. This
9 * is implemented by using atomic operations and retries on any
10 * conflicts. The disadvantage is that there may be livelocks in
11 * extreme cases. For better scalability, one allocator can be used
12 * for each CPU.
13 *
14 * The lockless operation only works if there is enough memory
15 * available. If new memory is added to the pool a lock has to be
16 * still taken. So any user relying on locklessness has to ensure
17 * that sufficient memory is preallocated.
18 *
19 * The basic atomic operation of this allocator is cmpxchg on long.
20 * On architectures that don't have NMI-safe cmpxchg implementation,
21 * the allocator can NOT be used in NMI handler. So code uses the
22 * allocator in NMI handler should depend on
23 * CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
6 * 24 *
7 * This source code is licensed under the GNU General Public License, 25 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details. 26 * Version 2. See the file COPYING for more details.
@@ -15,7 +33,7 @@
15 * General purpose special memory pool descriptor. 33 * General purpose special memory pool descriptor.
16 */ 34 */
17struct gen_pool { 35struct gen_pool {
18 rwlock_t lock; 36 spinlock_t lock;
19 struct list_head chunks; /* list of chunks in this pool */ 37 struct list_head chunks; /* list of chunks in this pool */
20 int min_alloc_order; /* minimum allocation order */ 38 int min_alloc_order; /* minimum allocation order */
21}; 39};
@@ -24,8 +42,8 @@ struct gen_pool {
24 * General purpose special memory pool chunk descriptor. 42 * General purpose special memory pool chunk descriptor.
25 */ 43 */
26struct gen_pool_chunk { 44struct gen_pool_chunk {
27 spinlock_t lock;
28 struct list_head next_chunk; /* next chunk in pool */ 45 struct list_head next_chunk; /* next chunk in pool */
46 atomic_t avail;
29 phys_addr_t phys_addr; /* physical starting address of memory chunk */ 47 phys_addr_t phys_addr; /* physical starting address of memory chunk */
30 unsigned long start_addr; /* starting address of memory chunk */ 48 unsigned long start_addr; /* starting address of memory chunk */
31 unsigned long end_addr; /* ending address of memory chunk */ 49 unsigned long end_addr; /* ending address of memory chunk */
@@ -56,4 +74,8 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr,
56extern void gen_pool_destroy(struct gen_pool *); 74extern void gen_pool_destroy(struct gen_pool *);
57extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); 75extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
58extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); 76extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
77extern void gen_pool_for_each_chunk(struct gen_pool *,
78 void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
79extern size_t gen_pool_avail(struct gen_pool *);
80extern size_t gen_pool_size(struct gen_pool *);
59#endif /* __GENALLOC_H__ */ 81#endif /* __GENALLOC_H__ */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index cb4089254f01..3a76faf6a3ee 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -92,7 +92,7 @@ struct vm_area_struct;
92 */ 92 */
93#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) 93#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
94 94
95#define __GFP_BITS_SHIFT 23 /* Room for 23 __GFP_FOO bits */ 95#define __GFP_BITS_SHIFT 24 /* Room for N __GFP_FOO bits */
96#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 96#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
97 97
98/* This equals 0, but use constants in case they ever change */ 98/* This equals 0, but use constants in case they ever change */
diff --git a/include/linux/hash.h b/include/linux/hash.h
index 06d25c189cc5..b80506bdd733 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int bits)
63 return hash >> (32 - bits); 63 return hash >> (32 - bits);
64} 64}
65 65
66static inline unsigned long hash_ptr(void *ptr, unsigned int bits) 66static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
67{ 67{
68 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
69} 69}
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 7472449cbb74..0aa0cbd676f7 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -3,6 +3,33 @@
3 3
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5 5
6/*
7 * Version 2 of the I2C peripheral unit has a different register
8 * layout and extra registers. The ID register in the V2 peripheral
9 * unit on the OMAP4430 reports the same ID as the V1 peripheral
10 * unit on the OMAP3530, so we must inform the driver which IP
11 * version we know it is running on from platform / cpu-specific
12 * code using these constants in the hwmod class definition.
13 */
14
15#define OMAP_I2C_IP_VERSION_1 1
16#define OMAP_I2C_IP_VERSION_2 2
17
18/* struct omap_i2c_bus_platform_data .flags meanings */
19
20#define OMAP_I2C_FLAG_NO_FIFO BIT(0)
21#define OMAP_I2C_FLAG_SIMPLE_CLOCK BIT(1)
22#define OMAP_I2C_FLAG_16BIT_DATA_REG BIT(2)
23#define OMAP_I2C_FLAG_RESET_REGS_POSTIDLE BIT(3)
24#define OMAP_I2C_FLAG_APPLY_ERRATA_I207 BIT(4)
25#define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK BIT(5)
26#define OMAP_I2C_FLAG_FORCE_19200_INT_CLK BIT(6)
27/* how the CPU address bus must be translated for I2C unit access */
28#define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
29#define OMAP_I2C_FLAG_BUS_SHIFT_1 BIT(7)
30#define OMAP_I2C_FLAG_BUS_SHIFT_2 BIT(8)
31#define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7
32
6struct omap_i2c_bus_platform_data { 33struct omap_i2c_bus_platform_data {
7 u32 clkrate; 34 u32 clkrate;
8 void (*set_mpu_wkup_lat)(struct device *dev, long set); 35 void (*set_mpu_wkup_lat)(struct device *dev, long set);
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index ba4f88624fcd..114c0f6fc63d 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -657,28 +657,41 @@ struct twl4030_power_data {
657extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 657extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
658extern int twl4030_remove_script(u8 flags); 658extern int twl4030_remove_script(u8 flags);
659 659
660struct twl4030_codec_audio_data { 660struct twl4030_codec_data {
661 unsigned int digimic_delay; /* in ms */ 661 unsigned int digimic_delay; /* in ms */
662 unsigned int ramp_delay_value; 662 unsigned int ramp_delay_value;
663 unsigned int offset_cncl_path; 663 unsigned int offset_cncl_path;
664 unsigned int check_defaults:1; 664 unsigned int check_defaults:1;
665 unsigned int reset_registers:1; 665 unsigned int reset_registers:1;
666 unsigned int hs_extmute:1; 666 unsigned int hs_extmute:1;
667 u16 hs_left_step;
668 u16 hs_right_step;
669 u16 hf_left_step;
670 u16 hf_right_step;
667 void (*set_hs_extmute)(int mute); 671 void (*set_hs_extmute)(int mute);
668}; 672};
669 673
670struct twl4030_codec_vibra_data { 674struct twl4030_vibra_data {
671 unsigned int coexist; 675 unsigned int coexist;
676
677 /* twl6040 */
678 unsigned int vibldrv_res; /* left driver resistance */
679 unsigned int vibrdrv_res; /* right driver resistance */
680 unsigned int viblmotor_res; /* left motor resistance */
681 unsigned int vibrmotor_res; /* right motor resistance */
682 int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */
683 int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */
672}; 684};
673 685
674struct twl4030_codec_data { 686struct twl4030_audio_data {
675 unsigned int audio_mclk; 687 unsigned int audio_mclk;
676 struct twl4030_codec_audio_data *audio; 688 struct twl4030_codec_data *codec;
677 struct twl4030_codec_vibra_data *vibra; 689 struct twl4030_vibra_data *vibra;
678 690
679 /* twl6040 */ 691 /* twl6040 */
680 int audpwron_gpio; /* audio power-on gpio */ 692 int audpwron_gpio; /* audio power-on gpio */
681 int naudint_irq; /* audio interrupt */ 693 int naudint_irq; /* audio interrupt */
694 unsigned int irq_base;
682}; 695};
683 696
684struct twl4030_platform_data { 697struct twl4030_platform_data {
@@ -690,7 +703,7 @@ struct twl4030_platform_data {
690 struct twl4030_keypad_data *keypad; 703 struct twl4030_keypad_data *keypad;
691 struct twl4030_usb_data *usb; 704 struct twl4030_usb_data *usb;
692 struct twl4030_power_data *power; 705 struct twl4030_power_data *power;
693 struct twl4030_codec_data *codec; 706 struct twl4030_audio_data *audio;
694 707
695 /* Common LDO regulators for TWL4030/TWL6030 */ 708 /* Common LDO regulators for TWL4030/TWL6030 */
696 struct regulator_init_data *vdac; 709 struct regulator_init_data *vdac;
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 13a801f3d028..255491cf522e 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -146,6 +146,10 @@ void ida_remove(struct ida *ida, int id);
146void ida_destroy(struct ida *ida); 146void ida_destroy(struct ida *ida);
147void ida_init(struct ida *ida); 147void ida_init(struct ida *ida);
148 148
149int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
150 gfp_t gfp_mask);
151void ida_simple_remove(struct ida *ida, unsigned int id);
152
149void __init idr_init_cache(void); 153void __init idr_init_cache(void);
150 154
151#endif /* __IDR_H__ */ 155#endif /* __IDR_H__ */
diff --git a/include/linux/if.h b/include/linux/if.h
index 3bc63e6a02f7..03489ca92ded 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -76,6 +76,8 @@
76#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */ 76#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */
77#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch 77#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch
78 * datapath port */ 78 * datapath port */
79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
80 * skbs on transmit */
79 81
80#define IF_GET_IFACE 0x0001 /* for querying only */ 82#define IF_GET_IFACE 0x0001 /* for querying only */
81#define IF_GET_PROTO 0x0002 83#define IF_GET_PROTO 0x0002
diff --git a/include/linux/input.h b/include/linux/input.h
index 771d6d85667d..a637e7814334 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -119,9 +119,9 @@ struct input_keymap_entry {
119#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 119#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
120#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ 120#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
121 121
122#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 122#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) /* get event bits */
123#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 123#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) /* get abs value/limits */
124#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ 124#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) /* set abs value/limits */
125 125
126#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ 126#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
127#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ 127#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
@@ -438,6 +438,8 @@ struct input_keymap_entry {
438#define KEY_WIMAX 246 438#define KEY_WIMAX 246
439#define KEY_RFKILL 247 /* Key that controls all radios */ 439#define KEY_RFKILL 247 /* Key that controls all radios */
440 440
441#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
442
441/* Code 255 is reserved for special needs of AT keyboard driver */ 443/* Code 255 is reserved for special needs of AT keyboard driver */
442 444
443#define BTN_MISC 0x100 445#define BTN_MISC 0x100
diff --git a/include/linux/input/kxtj9.h b/include/linux/input/kxtj9.h
new file mode 100644
index 000000000000..f6bac89537b8
--- /dev/null
+++ b/include/linux/input/kxtj9.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2011 Kionix, Inc.
3 * Written by Chris Hudson <chudson@kionix.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 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 * 02111-1307, USA
18 */
19
20#ifndef __KXTJ9_H__
21#define __KXTJ9_H__
22
23#define KXTJ9_I2C_ADDR 0x0F
24
25struct kxtj9_platform_data {
26 unsigned int min_interval; /* minimum poll interval (in milli-seconds) */
27
28 /*
29 * By default, x is axis 0, y is axis 1, z is axis 2; these can be
30 * changed to account for sensor orientation within the host device.
31 */
32 u8 axis_map_x;
33 u8 axis_map_y;
34 u8 axis_map_z;
35
36 /*
37 * Each axis can be negated to account for sensor orientation within
38 * the host device.
39 */
40 bool negate_x;
41 bool negate_y;
42 bool negate_z;
43
44 /* CTRL_REG1: set resolution, g-range, data ready enable */
45 /* Output resolution: 8-bit valid or 12-bit valid */
46 #define RES_8BIT 0
47 #define RES_12BIT (1 << 6)
48 u8 res_12bit;
49 /* Output g-range: +/-2g, 4g, or 8g */
50 #define KXTJ9_G_2G 0
51 #define KXTJ9_G_4G (1 << 3)
52 #define KXTJ9_G_8G (1 << 4)
53 u8 g_range;
54
55 /* DATA_CTRL_REG: controls the output data rate of the part */
56 #define ODR12_5F 0
57 #define ODR25F 1
58 #define ODR50F 2
59 #define ODR100F 3
60 #define ODR200F 4
61 #define ODR400F 5
62 #define ODR800F 6
63 u8 data_odr_init;
64
65 int (*init)(void);
66 void (*exit)(void);
67 int (*power_on)(void);
68 int (*power_off)(void);
69};
70#endif /* __KXTJ9_H__ */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index f6efed0039ed..a103732b7588 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -17,7 +17,7 @@
17#include <linux/kref.h> 17#include <linux/kref.h>
18#include <linux/workqueue.h> 18#include <linux/workqueue.h>
19 19
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21#include <asm/ptrace.h> 21#include <asm/ptrace.h>
22#include <asm/system.h> 22#include <asm/system.h>
23#include <trace/events/irq.h> 23#include <trace/events/irq.h>
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index c2ebfe66177c..9d57a71775b5 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -162,6 +162,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
162 resource_size_t, 162 resource_size_t,
163 resource_size_t), 163 resource_size_t),
164 void *alignf_data); 164 void *alignf_data);
165struct resource *lookup_resource(struct resource *root, resource_size_t start);
165int adjust_resource(struct resource *res, resource_size_t start, 166int adjust_resource(struct resource *res, resource_size_t start,
166 resource_size_t size); 167 resource_size_t size);
167resource_size_t resource_alignment(struct resource *res); 168resource_size_t resource_alignment(struct resource *res);
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index a6d1655f9607..8a297a5e794c 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -44,6 +44,11 @@ struct ipc_namespace {
44 size_t shm_ctlall; 44 size_t shm_ctlall;
45 int shm_ctlmni; 45 int shm_ctlmni;
46 int shm_tot; 46 int shm_tot;
47 /*
48 * Defines whether IPC_RMID is forced for _all_ shm segments regardless
49 * of shmctl()
50 */
51 int shm_rmid_forced;
47 52
48 struct notifier_block ipcns_nb; 53 struct notifier_block ipcns_nb;
49 54
@@ -72,6 +77,7 @@ extern int register_ipcns_notifier(struct ipc_namespace *);
72extern int cond_register_ipcns_notifier(struct ipc_namespace *); 77extern int cond_register_ipcns_notifier(struct ipc_namespace *);
73extern void unregister_ipcns_notifier(struct ipc_namespace *); 78extern void unregister_ipcns_notifier(struct ipc_namespace *);
74extern int ipcns_notify(unsigned long); 79extern int ipcns_notify(unsigned long);
80extern void shm_destroy_orphaned(struct ipc_namespace *ns);
75#else /* CONFIG_SYSVIPC */ 81#else /* CONFIG_SYSVIPC */
76static inline int register_ipcns_notifier(struct ipc_namespace *ns) 82static inline int register_ipcns_notifier(struct ipc_namespace *ns)
77{ return 0; } 83{ return 0; }
@@ -79,6 +85,7 @@ static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns)
79{ return 0; } 85{ return 0; }
80static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } 86static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { }
81static inline int ipcns_notify(unsigned long l) { return 0; } 87static inline int ipcns_notify(unsigned long l) { return 0; }
88static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {}
82#endif /* CONFIG_SYSVIPC */ 89#endif /* CONFIG_SYSVIPC */
83 90
84#ifdef CONFIG_POSIX_MQUEUE 91#ifdef CONFIG_POSIX_MQUEUE
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 5f695041090c..59517300a315 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -23,6 +23,7 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/topology.h> 24#include <linux/topology.h>
25#include <linux/wait.h> 25#include <linux/wait.h>
26#include <linux/module.h>
26 27
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/ptrace.h> 29#include <asm/ptrace.h>
@@ -108,14 +109,18 @@ enum {
108}; 109};
109 110
110struct msi_desc; 111struct msi_desc;
112struct irq_domain;
111 113
112/** 114/**
113 * struct irq_data - per irq and irq chip data passed down to chip functions 115 * struct irq_data - per irq and irq chip data passed down to chip functions
114 * @irq: interrupt number 116 * @irq: interrupt number
117 * @hwirq: hardware interrupt number, local to the interrupt domain
115 * @node: node index useful for balancing 118 * @node: node index useful for balancing
116 * @state_use_accessors: status information for irq chip functions. 119 * @state_use_accessors: status information for irq chip functions.
117 * Use accessor functions to deal with it 120 * Use accessor functions to deal with it
118 * @chip: low level interrupt hardware access 121 * @chip: low level interrupt hardware access
122 * @domain: Interrupt translation domain; responsible for mapping
123 * between hwirq number and linux irq number.
119 * @handler_data: per-IRQ data for the irq_chip methods 124 * @handler_data: per-IRQ data for the irq_chip methods
120 * @chip_data: platform-specific per-chip private data for the chip 125 * @chip_data: platform-specific per-chip private data for the chip
121 * methods, to allow shared chip implementations 126 * methods, to allow shared chip implementations
@@ -128,9 +133,11 @@ struct msi_desc;
128 */ 133 */
129struct irq_data { 134struct irq_data {
130 unsigned int irq; 135 unsigned int irq;
136 unsigned long hwirq;
131 unsigned int node; 137 unsigned int node;
132 unsigned int state_use_accessors; 138 unsigned int state_use_accessors;
133 struct irq_chip *chip; 139 struct irq_chip *chip;
140 struct irq_domain *domain;
134 void *handler_data; 141 void *handler_data;
135 void *chip_data; 142 void *chip_data;
136 struct msi_desc *msi_desc; 143 struct msi_desc *msi_desc;
@@ -541,7 +548,15 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
541 return d->msi_desc; 548 return d->msi_desc;
542} 549}
543 550
544int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); 551int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
552 struct module *owner);
553
554static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
555 int node)
556{
557 return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
558}
559
545void irq_free_descs(unsigned int irq, unsigned int cnt); 560void irq_free_descs(unsigned int irq, unsigned int cnt);
546int irq_reserve_irqs(unsigned int from, unsigned int cnt); 561int irq_reserve_irqs(unsigned int from, unsigned int cnt);
547 562
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 2d921b35212c..150134ac709a 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -66,6 +66,7 @@ struct irq_desc {
66#ifdef CONFIG_PROC_FS 66#ifdef CONFIG_PROC_FS
67 struct proc_dir_entry *dir; 67 struct proc_dir_entry *dir;
68#endif 68#endif
69 struct module *owner;
69 const char *name; 70 const char *name;
70} ____cacheline_internodealigned_in_smp; 71} ____cacheline_internodealigned_in_smp;
71 72
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
new file mode 100644
index 000000000000..e807ad687a07
--- /dev/null
+++ b/include/linux/irqdomain.h
@@ -0,0 +1,91 @@
1/*
2 * irq_domain - IRQ translation domains
3 *
4 * Translation infrastructure between hw and linux irq numbers. This is
5 * helpful for interrupt controllers to implement mapping between hardware
6 * irq numbers and the Linux irq number space.
7 *
8 * irq_domains also have a hook for translating device tree interrupt
9 * representation into a hardware irq number that can be mapped back to a
10 * Linux irq number without any extra platform support code.
11 *
12 * irq_domain is expected to be embedded in an interrupt controller's private
13 * data structure.
14 */
15#ifndef _LINUX_IRQDOMAIN_H
16#define _LINUX_IRQDOMAIN_H
17
18#include <linux/irq.h>
19#include <linux/mod_devicetable.h>
20
21#ifdef CONFIG_IRQ_DOMAIN
22struct device_node;
23struct irq_domain;
24
25/**
26 * struct irq_domain_ops - Methods for irq_domain objects
27 * @to_irq: (optional) given a local hardware irq number, return the linux
28 * irq number. If to_irq is not implemented, then the irq_domain
29 * will use this translation: irq = (domain->irq_base + hwirq)
30 * @dt_translate: Given a device tree node and interrupt specifier, decode
31 * the hardware irq number and linux irq type value.
32 */
33struct irq_domain_ops {
34 unsigned int (*to_irq)(struct irq_domain *d, unsigned long hwirq);
35
36#ifdef CONFIG_OF
37 int (*dt_translate)(struct irq_domain *d, struct device_node *node,
38 const u32 *intspec, unsigned int intsize,
39 unsigned long *out_hwirq, unsigned int *out_type);
40#endif /* CONFIG_OF */
41};
42
43/**
44 * struct irq_domain - Hardware interrupt number translation object
45 * @list: Element in global irq_domain list.
46 * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator
47 * of the irq_domain is responsible for allocating the array of
48 * irq_desc structures.
49 * @nr_irq: Number of irqs managed by the irq domain
50 * @ops: pointer to irq_domain methods
51 * @priv: private data pointer for use by owner. Not touched by irq_domain
52 * core code.
53 * @of_node: (optional) Pointer to device tree nodes associated with the
54 * irq_domain. Used when decoding device tree interrupt specifiers.
55 */
56struct irq_domain {
57 struct list_head list;
58 unsigned int irq_base;
59 unsigned int nr_irq;
60 const struct irq_domain_ops *ops;
61 void *priv;
62 struct device_node *of_node;
63};
64
65/**
66 * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number
67 *
68 * Returns the linux irq number associated with a hardware irq. By default,
69 * the mapping is irq == domain->irq_base + hwirq, but this mapping can
70 * be overridden if the irq_domain implements a .to_irq() hook.
71 */
72static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
73 unsigned long hwirq)
74{
75 return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq;
76}
77
78extern void irq_domain_add(struct irq_domain *domain);
79extern void irq_domain_del(struct irq_domain *domain);
80#endif /* CONFIG_IRQ_DOMAIN */
81
82#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
83extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
84extern void irq_domain_generate_simple(const struct of_device_id *match,
85 u64 phys_base, unsigned int irq_start);
86#else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
87static inline void irq_domain_generate_simple(const struct of_device_id *match,
88 u64 phys_base, unsigned int irq_start) { }
89#endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
90
91#endif /* _LINUX_IRQDOMAIN_H */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index e06965081ba5..e6a5e34bed4f 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -940,7 +940,6 @@ extern int journal_force_commit(journal_t *);
940 */ 940 */
941struct journal_head *journal_add_journal_head(struct buffer_head *bh); 941struct journal_head *journal_add_journal_head(struct buffer_head *bh);
942struct journal_head *journal_grab_journal_head(struct buffer_head *bh); 942struct journal_head *journal_grab_journal_head(struct buffer_head *bh);
943void journal_remove_journal_head(struct buffer_head *bh);
944void journal_put_journal_head(struct journal_head *jh); 943void journal_put_journal_head(struct journal_head *jh);
945 944
946/* 945/*
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index d087c2e7b2aa..38f307b8c334 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1329,12 +1329,6 @@ extern int jbd_blocks_per_page(struct inode *inode);
1329#define BUFFER_TRACE2(bh, bh2, info) do {} while (0) 1329#define BUFFER_TRACE2(bh, bh2, info) do {} while (0)
1330#define JBUFFER_TRACE(jh, info) do {} while (0) 1330#define JBUFFER_TRACE(jh, info) do {} while (0)
1331 1331
1332/*
1333 * jbd2_dev_to_name is a utility function used by the jbd2 and ext4
1334 * tracing infrastructure to map a dev_t to a device name.
1335 */
1336extern const char *jbd2_dev_to_name(dev_t device);
1337
1338#endif /* __KERNEL__ */ 1332#endif /* __KERNEL__ */
1339 1333
1340#endif /* _LINUX_JBD2_H */ 1334#endif /* _LINUX_JBD2_H */
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h
index 44e95d0a721f..423cb6d78ee0 100644
--- a/include/linux/journal-head.h
+++ b/include/linux/journal-head.h
@@ -45,7 +45,7 @@ struct journal_head {
45 * has been cowed 45 * has been cowed
46 * [jbd_lock_bh_state()] 46 * [jbd_lock_bh_state()]
47 */ 47 */
48 unsigned b_cow_tid; 48 tid_t b_cow_tid;
49 49
50 /* 50 /*
51 * Copy of the buffer data frozen for writing to the log. 51 * Copy of the buffer data frozen for writing to the log.
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 83e745f3ead7..66f23dc5e76a 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -54,7 +54,7 @@ extern void jump_label_apply_nops(struct module *mod);
54 54
55#else 55#else
56 56
57#include <asm/atomic.h> 57#include <linux/atomic.h>
58 58
59#define JUMP_LABEL_INIT {ATOMIC_INIT(0)} 59#define JUMP_LABEL_INIT {ATOMIC_INIT(0)}
60 60
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
new file mode 100644
index 000000000000..067eda0e4b32
--- /dev/null
+++ b/include/linux/kconfig.h
@@ -0,0 +1,32 @@
1#ifndef __LINUX_KCONFIG_H
2#define __LINUX_KCONFIG_H
3
4#include <generated/autoconf.h>
5
6/*
7 * Helper macros to use CONFIG_ options in C expressions. Note that
8 * these only work with boolean and tristate options.
9 */
10
11/*
12 * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
13 * 0 otherwise.
14 *
15 */
16#define IS_ENABLED(option) \
17 (__enabled_ ## option || __enabled_ ## option ## _MODULE)
18
19/*
20 * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
21 * otherwise. For boolean options, this is equivalent to
22 * IS_ENABLED(CONFIG_FOO).
23 */
24#define IS_BUILTIN(option) __enabled_ ## option
25
26/*
27 * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
28 * otherwise.
29 */
30#define IS_MODULE(option) __enabled_ ## option ## _MODULE
31
32#endif /* __LINUX_KCONFIG_H */
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index aadff7cc2b84..529d9a0c75a5 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -16,7 +16,7 @@
16#ifdef CONFIG_KGDB_KDB 16#ifdef CONFIG_KGDB_KDB
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21#define KDB_POLL_FUNC_MAX 5 21#define KDB_POLL_FUNC_MAX 5
22extern int kdb_poll_idx; 22extern int kdb_poll_idx;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 9a43ad792cfc..46ac9a50528d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -56,6 +56,14 @@
56 56
57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
59#define DIV_ROUND_UP_ULL(ll,d) \
60 ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
61
62#if BITS_PER_LONG == 32
63# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
64#else
65# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
66#endif
59 67
60/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ 68/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
61#define roundup(x, y) ( \ 69#define roundup(x, y) ( \
diff --git a/include/linux/key.h b/include/linux/key.h
index 6ea4eebd3467..183a6af7715d 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -21,7 +21,7 @@
21#include <linux/rcupdate.h> 21#include <linux/rcupdate.h>
22#include <linux/sysctl.h> 22#include <linux/sysctl.h>
23#include <linux/rwsem.h> 23#include <linux/rwsem.h>
24#include <asm/atomic.h> 24#include <linux/atomic.h>
25 25
26#ifdef __KERNEL__ 26#ifdef __KERNEL__
27 27
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 10ca03d0a250..fa391835508d 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -16,7 +16,7 @@
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/linkage.h> 17#include <linux/linkage.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20#ifdef CONFIG_HAVE_ARCH_KGDB 20#ifdef CONFIG_HAVE_ARCH_KGDB
21#include <asm/kgdb.h> 21#include <asm/kgdb.h>
22#endif 22#endif
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 9229b64ee3aa..668729cc0fe9 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -25,7 +25,7 @@
25#include <linux/kobject_ns.h> 25#include <linux/kobject_ns.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <asm/atomic.h> 28#include <linux/atomic.h>
29 29
30#define UEVENT_HELPER_PATH_LEN 256 30#define UEVENT_HELPER_PATH_LEN 256
31#define UEVENT_NUM_ENVP 32 /* number of env pointers */ 31#define UEVENT_NUM_ENVP 32 /* number of env pointers */
diff --git a/include/linux/llist.h b/include/linux/llist.h
new file mode 100644
index 000000000000..aa0c8b5b3cd0
--- /dev/null
+++ b/include/linux/llist.h
@@ -0,0 +1,126 @@
1#ifndef LLIST_H
2#define LLIST_H
3/*
4 * Lock-less NULL terminated single linked list
5 *
6 * If there are multiple producers and multiple consumers, llist_add
7 * can be used in producers and llist_del_all can be used in
8 * consumers. They can work simultaneously without lock. But
9 * llist_del_first can not be used here. Because llist_del_first
10 * depends on list->first->next does not changed if list->first is not
11 * changed during its operation, but llist_del_first, llist_add,
12 * llist_add (or llist_del_all, llist_add, llist_add) sequence in
13 * another consumer may violate that.
14 *
15 * If there are multiple producers and one consumer, llist_add can be
16 * used in producers and llist_del_all or llist_del_first can be used
17 * in the consumer.
18 *
19 * This can be summarized as follow:
20 *
21 * | add | del_first | del_all
22 * add | - | - | -
23 * del_first | | L | L
24 * del_all | | | -
25 *
26 * Where "-" stands for no lock is needed, while "L" stands for lock
27 * is needed.
28 *
29 * The list entries deleted via llist_del_all can be traversed with
30 * traversing function such as llist_for_each etc. But the list
31 * entries can not be traversed safely before deleted from the list.
32 * The order of deleted entries is from the newest to the oldest added
33 * one. If you want to traverse from the oldest to the newest, you
34 * must reverse the order by yourself before traversing.
35 *
36 * The basic atomic operation of this list is cmpxchg on long. On
37 * architectures that don't have NMI-safe cmpxchg implementation, the
38 * list can NOT be used in NMI handler. So code uses the list in NMI
39 * handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
40 */
41
42struct llist_head {
43 struct llist_node *first;
44};
45
46struct llist_node {
47 struct llist_node *next;
48};
49
50#define LLIST_HEAD_INIT(name) { NULL }
51#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
52
53/**
54 * init_llist_head - initialize lock-less list head
55 * @head: the head for your lock-less list
56 */
57static inline void init_llist_head(struct llist_head *list)
58{
59 list->first = NULL;
60}
61
62/**
63 * llist_entry - get the struct of this entry
64 * @ptr: the &struct llist_node pointer.
65 * @type: the type of the struct this is embedded in.
66 * @member: the name of the llist_node within the struct.
67 */
68#define llist_entry(ptr, type, member) \
69 container_of(ptr, type, member)
70
71/**
72 * llist_for_each - iterate over some deleted entries of a lock-less list
73 * @pos: the &struct llist_node to use as a loop cursor
74 * @node: the first entry of deleted list entries
75 *
76 * In general, some entries of the lock-less list can be traversed
77 * safely only after being deleted from list, so start with an entry
78 * instead of list head.
79 *
80 * If being used on entries deleted from lock-less list directly, the
81 * traverse order is from the newest to the oldest added entry. If
82 * you want to traverse from the oldest to the newest, you must
83 * reverse the order by yourself before traversing.
84 */
85#define llist_for_each(pos, node) \
86 for ((pos) = (node); pos; (pos) = (pos)->next)
87
88/**
89 * llist_for_each_entry - iterate over some deleted entries of lock-less list of given type
90 * @pos: the type * to use as a loop cursor.
91 * @node: the fist entry of deleted list entries.
92 * @member: the name of the llist_node with the struct.
93 *
94 * In general, some entries of the lock-less list can be traversed
95 * safely only after being removed from list, so start with an entry
96 * instead of list head.
97 *
98 * If being used on entries deleted from lock-less list directly, the
99 * traverse order is from the newest to the oldest added entry. If
100 * you want to traverse from the oldest to the newest, you must
101 * reverse the order by yourself before traversing.
102 */
103#define llist_for_each_entry(pos, node, member) \
104 for ((pos) = llist_entry((node), typeof(*(pos)), member); \
105 &(pos)->member != NULL; \
106 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
107
108/**
109 * llist_empty - tests whether a lock-less list is empty
110 * @head: the list to test
111 *
112 * Not guaranteed to be accurate or up to date. Just a quick way to
113 * test whether the list is empty without deleting something from the
114 * list.
115 */
116static inline int llist_empty(const struct llist_head *head)
117{
118 return ACCESS_ONCE(head->first) == NULL;
119}
120
121void llist_add(struct llist_node *new, struct llist_head *head);
122void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
123 struct llist_head *head);
124struct llist_node *llist_del_first(struct llist_head *head);
125struct llist_node *llist_del_all(struct llist_head *head);
126#endif /* LLIST_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 66c194e2d9b9..683d69890119 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -64,7 +64,6 @@ struct loop_device {
64 64
65 struct request_queue *lo_queue; 65 struct request_queue *lo_queue;
66 struct gendisk *lo_disk; 66 struct gendisk *lo_disk;
67 struct list_head lo_list;
68}; 67};
69 68
70#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
@@ -161,4 +160,8 @@ int loop_unregister_transfer(int number);
161#define LOOP_CHANGE_FD 0x4C06 160#define LOOP_CHANGE_FD 0x4C06
162#define LOOP_SET_CAPACITY 0x4C07 161#define LOOP_SET_CAPACITY 0x4C07
163 162
163/* /dev/loop-control interface */
164#define LOOP_CTL_ADD 0x4C80
165#define LOOP_CTL_REMOVE 0x4C81
166#define LOOP_CTL_GET_FREE 0x4C82
164#endif 167#endif
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 50940da6adf3..343bd7661f2a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -76,8 +76,6 @@ extern void mem_cgroup_uncharge_end(void);
76 76
77extern void mem_cgroup_uncharge_page(struct page *page); 77extern void mem_cgroup_uncharge_page(struct page *page);
78extern void mem_cgroup_uncharge_cache_page(struct page *page); 78extern void mem_cgroup_uncharge_cache_page(struct page *page);
79extern int mem_cgroup_shmem_charge_fallback(struct page *page,
80 struct mm_struct *mm, gfp_t gfp_mask);
81 79
82extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 80extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
83int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 81int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
@@ -111,8 +109,7 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
111int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); 109int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg);
112int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); 110int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
113unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, 111unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
114 struct zone *zone, 112 int nid, int zid, unsigned int lrumask);
115 enum lru_list lru);
116struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, 113struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg,
117 struct zone *zone); 114 struct zone *zone);
118struct zone_reclaim_stat* 115struct zone_reclaim_stat*
@@ -207,12 +204,6 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page)
207{ 204{
208} 205}
209 206
210static inline int mem_cgroup_shmem_charge_fallback(struct page *page,
211 struct mm_struct *mm, gfp_t gfp_mask)
212{
213 return 0;
214}
215
216static inline void mem_cgroup_add_lru_list(struct page *page, int lru) 207static inline void mem_cgroup_add_lru_list(struct page *page, int lru)
217{ 208{
218} 209}
@@ -313,8 +304,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg)
313} 304}
314 305
315static inline unsigned long 306static inline unsigned long
316mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone, 307mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid,
317 enum lru_list lru) 308 unsigned int lru_mask)
318{ 309{
319 return 0; 310 return 0;
320} 311}
diff --git a/include/linux/mfd/aat2870.h b/include/linux/mfd/aat2870.h
new file mode 100644
index 000000000000..f7316c29bdec
--- /dev/null
+++ b/include/linux/mfd/aat2870.h
@@ -0,0 +1,181 @@
1/*
2 * linux/include/linux/mfd/aat2870.h
3 *
4 * Copyright (c) 2011, NVIDIA Corporation.
5 * Author: Jin Park <jinyoungp@nvidia.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */
21
22#ifndef __LINUX_MFD_AAT2870_H
23#define __LINUX_MFD_AAT2870_H
24
25#include <linux/debugfs.h>
26#include <linux/i2c.h>
27
28/* Register offsets */
29#define AAT2870_BL_CH_EN 0x00
30#define AAT2870_BLM 0x01
31#define AAT2870_BLS 0x02
32#define AAT2870_BL1 0x03
33#define AAT2870_BL2 0x04
34#define AAT2870_BL3 0x05
35#define AAT2870_BL4 0x06
36#define AAT2870_BL5 0x07
37#define AAT2870_BL6 0x08
38#define AAT2870_BL7 0x09
39#define AAT2870_BL8 0x0A
40#define AAT2870_FLR 0x0B
41#define AAT2870_FM 0x0C
42#define AAT2870_FS 0x0D
43#define AAT2870_ALS_CFG0 0x0E
44#define AAT2870_ALS_CFG1 0x0F
45#define AAT2870_ALS_CFG2 0x10
46#define AAT2870_AMB 0x11
47#define AAT2870_ALS0 0x12
48#define AAT2870_ALS1 0x13
49#define AAT2870_ALS2 0x14
50#define AAT2870_ALS3 0x15
51#define AAT2870_ALS4 0x16
52#define AAT2870_ALS5 0x17
53#define AAT2870_ALS6 0x18
54#define AAT2870_ALS7 0x19
55#define AAT2870_ALS8 0x1A
56#define AAT2870_ALS9 0x1B
57#define AAT2870_ALSA 0x1C
58#define AAT2870_ALSB 0x1D
59#define AAT2870_ALSC 0x1E
60#define AAT2870_ALSD 0x1F
61#define AAT2870_ALSE 0x20
62#define AAT2870_ALSF 0x21
63#define AAT2870_SUB_SET 0x22
64#define AAT2870_SUB_CTRL 0x23
65#define AAT2870_LDO_AB 0x24
66#define AAT2870_LDO_CD 0x25
67#define AAT2870_LDO_EN 0x26
68#define AAT2870_REG_NUM 0x27
69
70/* Device IDs */
71enum aat2870_id {
72 AAT2870_ID_BL,
73 AAT2870_ID_LDOA,
74 AAT2870_ID_LDOB,
75 AAT2870_ID_LDOC,
76 AAT2870_ID_LDOD
77};
78
79/* Backlight channels */
80#define AAT2870_BL_CH1 0x01
81#define AAT2870_BL_CH2 0x02
82#define AAT2870_BL_CH3 0x04
83#define AAT2870_BL_CH4 0x08
84#define AAT2870_BL_CH5 0x10
85#define AAT2870_BL_CH6 0x20
86#define AAT2870_BL_CH7 0x40
87#define AAT2870_BL_CH8 0x80
88#define AAT2870_BL_CH_ALL 0xFF
89
90/* Backlight current magnitude (mA) */
91enum aat2870_current {
92 AAT2870_CURRENT_0_45 = 1,
93 AAT2870_CURRENT_0_90,
94 AAT2870_CURRENT_1_80,
95 AAT2870_CURRENT_2_70,
96 AAT2870_CURRENT_3_60,
97 AAT2870_CURRENT_4_50,
98 AAT2870_CURRENT_5_40,
99 AAT2870_CURRENT_6_30,
100 AAT2870_CURRENT_7_20,
101 AAT2870_CURRENT_8_10,
102 AAT2870_CURRENT_9_00,
103 AAT2870_CURRENT_9_90,
104 AAT2870_CURRENT_10_8,
105 AAT2870_CURRENT_11_7,
106 AAT2870_CURRENT_12_6,
107 AAT2870_CURRENT_13_5,
108 AAT2870_CURRENT_14_4,
109 AAT2870_CURRENT_15_3,
110 AAT2870_CURRENT_16_2,
111 AAT2870_CURRENT_17_1,
112 AAT2870_CURRENT_18_0,
113 AAT2870_CURRENT_18_9,
114 AAT2870_CURRENT_19_8,
115 AAT2870_CURRENT_20_7,
116 AAT2870_CURRENT_21_6,
117 AAT2870_CURRENT_22_5,
118 AAT2870_CURRENT_23_4,
119 AAT2870_CURRENT_24_3,
120 AAT2870_CURRENT_25_2,
121 AAT2870_CURRENT_26_1,
122 AAT2870_CURRENT_27_0,
123 AAT2870_CURRENT_27_9
124};
125
126struct aat2870_register {
127 bool readable;
128 bool writeable;
129 u8 value;
130};
131
132struct aat2870_data {
133 struct device *dev;
134 struct i2c_client *client;
135
136 struct mutex io_lock;
137 struct aat2870_register *reg_cache; /* register cache */
138 int en_pin; /* enable GPIO pin (if < 0, ignore this value) */
139 bool is_enable;
140
141 /* init and uninit for platform specified */
142 int (*init)(struct aat2870_data *aat2870);
143 void (*uninit)(struct aat2870_data *aat2870);
144
145 /* i2c io funcntions */
146 int (*read)(struct aat2870_data *aat2870, u8 addr, u8 *val);
147 int (*write)(struct aat2870_data *aat2870, u8 addr, u8 val);
148 int (*update)(struct aat2870_data *aat2870, u8 addr, u8 mask, u8 val);
149
150 /* for debugfs */
151 struct dentry *dentry_root;
152 struct dentry *dentry_reg;
153};
154
155struct aat2870_subdev_info {
156 int id;
157 const char *name;
158 void *platform_data;
159};
160
161struct aat2870_platform_data {
162 int en_pin; /* enable GPIO pin (if < 0, ignore this value) */
163
164 struct aat2870_subdev_info *subdevs;
165 int num_subdevs;
166
167 /* init and uninit for platform specified */
168 int (*init)(struct aat2870_data *aat2870);
169 void (*uninit)(struct aat2870_data *aat2870);
170};
171
172struct aat2870_bl_platform_data {
173 /* backlight channels, default is AAT2870_BL_CH_ALL */
174 int channels;
175 /* backlight current magnitude, default is AAT2870_CURRENT_27_9 */
176 int max_current;
177 /* maximum brightness, default is 255 */
178 int max_brightness;
179};
180
181#endif /* __LINUX_MFD_AAT2870_H */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
index b31843075198..838c6b487cc5 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/ab8500.h
@@ -28,6 +28,7 @@
28#define AB8500_INTERRUPT 0xE 28#define AB8500_INTERRUPT 0xE
29#define AB8500_RTC 0xF 29#define AB8500_RTC 0xF
30#define AB8500_MISC 0x10 30#define AB8500_MISC 0x10
31#define AB8500_DEVELOPMENT 0x11
31#define AB8500_DEBUG 0x12 32#define AB8500_DEBUG 0x12
32#define AB8500_PROD_TEST 0x13 33#define AB8500_PROD_TEST 0x13
33#define AB8500_OTP_EMUL 0x15 34#define AB8500_OTP_EMUL 0x15
@@ -74,13 +75,6 @@
74#define AB8500_INT_ACC_DETECT_21DB_F 37 75#define AB8500_INT_ACC_DETECT_21DB_F 37
75#define AB8500_INT_ACC_DETECT_21DB_R 38 76#define AB8500_INT_ACC_DETECT_21DB_R 38
76#define AB8500_INT_GP_SW_ADC_CONV_END 39 77#define AB8500_INT_GP_SW_ADC_CONV_END 39
77#define AB8500_INT_ACC_DETECT_1DB_F 33
78#define AB8500_INT_ACC_DETECT_1DB_R 34
79#define AB8500_INT_ACC_DETECT_22DB_F 35
80#define AB8500_INT_ACC_DETECT_22DB_R 36
81#define AB8500_INT_ACC_DETECT_21DB_F 37
82#define AB8500_INT_ACC_DETECT_21DB_R 38
83#define AB8500_INT_GP_SW_ADC_CONV_END 39
84#define AB8500_INT_GPIO6R 40 78#define AB8500_INT_GPIO6R 40
85#define AB8500_INT_GPIO7R 41 79#define AB8500_INT_GPIO7R 41
86#define AB8500_INT_GPIO8R 42 80#define AB8500_INT_GPIO8R 42
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index 60931d089422..0bbd13dbe336 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -107,11 +107,16 @@ struct max8997_platform_data {
107 unsigned int buck5_voltage[8]; 107 unsigned int buck5_voltage[8];
108 bool buck5_gpiodvs; 108 bool buck5_gpiodvs;
109 109
110 /* ---- Charger control ---- */
111 /* eoc stands for 'end of charge' */
112 int eoc_mA; /* 50 ~ 200mA by 10mA step */
113 /* charge Full Timeout */
114 int timeout; /* 0 (no timeout), 5, 6, 7 hours */
115
110 /* MUIC: Not implemented */ 116 /* MUIC: Not implemented */
111 /* HAPTIC: Not implemented */ 117 /* HAPTIC: Not implemented */
112 /* RTC: Not implemented */ 118 /* RTC: Not implemented */
113 /* Flash: Not implemented */ 119 /* Flash: Not implemented */
114 /* Charger control: Not implemented */
115}; 120};
116 121
117#endif /* __LINUX_MFD_MAX8998_H */ 122#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index 61daa167b576..f4f0dfa4698a 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -87,6 +87,15 @@ struct max8998_regulator_data {
87 * @wakeup: Allow to wake up from suspend 87 * @wakeup: Allow to wake up from suspend
88 * @rtc_delay: LP3974 RTC chip bug that requires delay after a register 88 * @rtc_delay: LP3974 RTC chip bug that requires delay after a register
89 * write before reading it. 89 * write before reading it.
90 * @eoc: End of Charge Level in percent: 10% ~ 45% by 5% step
91 * If it equals 0, leave it unchanged.
92 * Otherwise, it is a invalid value.
93 * @restart: Restart Level in mV: 100, 150, 200, and -1 for disable.
94 * If it equals 0, leave it unchanged.
95 * Otherwise, it is a invalid value.
96 * @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable.
97 * If it equals 0, leave it unchanged.
98 * Otherwise, leave it unchanged.
90 */ 99 */
91struct max8998_platform_data { 100struct max8998_platform_data {
92 struct max8998_regulator_data *regulators; 101 struct max8998_regulator_data *regulators;
@@ -107,6 +116,9 @@ struct max8998_platform_data {
107 int buck2_default_idx; 116 int buck2_default_idx;
108 bool wakeup; 117 bool wakeup;
109 bool rtc_delay; 118 bool rtc_delay;
119 int eoc;
120 int restart;
121 int timeout;
110}; 122};
111 123
112#endif /* __LINUX_MFD_MAX8998_H */ 124#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index e762c270d8d4..be1af7c42e57 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -57,6 +57,7 @@ struct stmpe_variant_info;
57 * @irq_lock: IRQ bus lock 57 * @irq_lock: IRQ bus lock
58 * @dev: device, mostly for dev_dbg() 58 * @dev: device, mostly for dev_dbg()
59 * @i2c: i2c client 59 * @i2c: i2c client
60 * @partnum: part number
60 * @variant: the detected STMPE model number 61 * @variant: the detected STMPE model number
61 * @regs: list of addresses of registers which are at different addresses on 62 * @regs: list of addresses of registers which are at different addresses on
62 * different variants. Indexed by one of STMPE_IDX_*. 63 * different variants. Indexed by one of STMPE_IDX_*.
@@ -121,6 +122,8 @@ struct stmpe_keypad_platform_data {
121 * @norequest_mask: bitmask specifying which GPIOs should _not_ be 122 * @norequest_mask: bitmask specifying which GPIOs should _not_ be
122 * requestable due to different usage (e.g. touch, keypad) 123 * requestable due to different usage (e.g. touch, keypad)
123 * STMPE_GPIO_NOREQ_* macros can be used here. 124 * STMPE_GPIO_NOREQ_* macros can be used here.
125 * @setup: board specific setup callback.
126 * @remove: board specific remove callback
124 */ 127 */
125struct stmpe_gpio_platform_data { 128struct stmpe_gpio_platform_data {
126 int gpio_base; 129 int gpio_base;
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 73572c65d04f..82b4c8801a4f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -791,6 +791,7 @@ int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
791void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); 791void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
792int tps65910_irq_init(struct tps65910 *tps65910, int irq, 792int tps65910_irq_init(struct tps65910 *tps65910, int irq,
793 struct tps65910_platform_data *pdata); 793 struct tps65910_platform_data *pdata);
794int tps65910_irq_exit(struct tps65910 *tps65910);
794 795
795static inline int tps65910_chip_id(struct tps65910 *tps65910) 796static inline int tps65910_chip_id(struct tps65910 *tps65910)
796{ 797{
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
new file mode 100644
index 000000000000..aaceab402ec5
--- /dev/null
+++ b/include/linux/mfd/tps65912.h
@@ -0,0 +1,327 @@
1/*
2 * tps65912.h -- TI TPS6591x
3 *
4 * Copyright 2011 Texas Instruments Inc.
5 *
6 * Author: Margarita Olaya <magi@slimlogic.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __LINUX_MFD_TPS65912_H
16#define __LINUX_MFD_TPS65912_H
17
18/* TPS regulator type list */
19#define REGULATOR_LDO 0
20#define REGULATOR_DCDC 1
21
22/*
23 * List of registers for TPS65912
24 */
25
26#define TPS65912_DCDC1_CTRL 0x00
27#define TPS65912_DCDC2_CTRL 0x01
28#define TPS65912_DCDC3_CTRL 0x02
29#define TPS65912_DCDC4_CTRL 0x03
30#define TPS65912_DCDC1_OP 0x04
31#define TPS65912_DCDC1_AVS 0x05
32#define TPS65912_DCDC1_LIMIT 0x06
33#define TPS65912_DCDC2_OP 0x07
34#define TPS65912_DCDC2_AVS 0x08
35#define TPS65912_DCDC2_LIMIT 0x09
36#define TPS65912_DCDC3_OP 0x0A
37#define TPS65912_DCDC3_AVS 0x0B
38#define TPS65912_DCDC3_LIMIT 0x0C
39#define TPS65912_DCDC4_OP 0x0D
40#define TPS65912_DCDC4_AVS 0x0E
41#define TPS65912_DCDC4_LIMIT 0x0F
42#define TPS65912_LDO1_OP 0x10
43#define TPS65912_LDO1_AVS 0x11
44#define TPS65912_LDO1_LIMIT 0x12
45#define TPS65912_LDO2_OP 0x13
46#define TPS65912_LDO2_AVS 0x14
47#define TPS65912_LDO2_LIMIT 0x15
48#define TPS65912_LDO3_OP 0x16
49#define TPS65912_LDO3_AVS 0x17
50#define TPS65912_LDO3_LIMIT 0x18
51#define TPS65912_LDO4_OP 0x19
52#define TPS65912_LDO4_AVS 0x1A
53#define TPS65912_LDO4_LIMIT 0x1B
54#define TPS65912_LDO5 0x1C
55#define TPS65912_LDO6 0x1D
56#define TPS65912_LDO7 0x1E
57#define TPS65912_LDO8 0x1F
58#define TPS65912_LDO9 0x20
59#define TPS65912_LDO10 0x21
60#define TPS65912_THRM 0x22
61#define TPS65912_CLK32OUT 0x23
62#define TPS65912_DEVCTRL 0x24
63#define TPS65912_DEVCTRL2 0x25
64#define TPS65912_I2C_SPI_CFG 0x26
65#define TPS65912_KEEP_ON 0x27
66#define TPS65912_KEEP_ON2 0x28
67#define TPS65912_SET_OFF1 0x29
68#define TPS65912_SET_OFF2 0x2A
69#define TPS65912_DEF_VOLT 0x2B
70#define TPS65912_DEF_VOLT_MAPPING 0x2C
71#define TPS65912_DISCHARGE 0x2D
72#define TPS65912_DISCHARGE2 0x2E
73#define TPS65912_EN1_SET1 0x2F
74#define TPS65912_EN1_SET2 0x30
75#define TPS65912_EN2_SET1 0x31
76#define TPS65912_EN2_SET2 0x32
77#define TPS65912_EN3_SET1 0x33
78#define TPS65912_EN3_SET2 0x34
79#define TPS65912_EN4_SET1 0x35
80#define TPS65912_EN4_SET2 0x36
81#define TPS65912_PGOOD 0x37
82#define TPS65912_PGOOD2 0x38
83#define TPS65912_INT_STS 0x39
84#define TPS65912_INT_MSK 0x3A
85#define TPS65912_INT_STS2 0x3B
86#define TPS65912_INT_MSK2 0x3C
87#define TPS65912_INT_STS3 0x3D
88#define TPS65912_INT_MSK3 0x3E
89#define TPS65912_INT_STS4 0x3F
90#define TPS65912_INT_MSK4 0x40
91#define TPS65912_GPIO1 0x41
92#define TPS65912_GPIO2 0x42
93#define TPS65912_GPIO3 0x43
94#define TPS65912_GPIO4 0x44
95#define TPS65912_GPIO5 0x45
96#define TPS65912_VMON 0x46
97#define TPS65912_LEDA_CTRL1 0x47
98#define TPS65912_LEDA_CTRL2 0x48
99#define TPS65912_LEDA_CTRL3 0x49
100#define TPS65912_LEDA_CTRL4 0x4A
101#define TPS65912_LEDA_CTRL5 0x4B
102#define TPS65912_LEDA_CTRL6 0x4C
103#define TPS65912_LEDA_CTRL7 0x4D
104#define TPS65912_LEDA_CTRL8 0x4E
105#define TPS65912_LEDB_CTRL1 0x4F
106#define TPS65912_LEDB_CTRL2 0x50
107#define TPS65912_LEDB_CTRL3 0x51
108#define TPS65912_LEDB_CTRL4 0x52
109#define TPS65912_LEDB_CTRL5 0x53
110#define TPS65912_LEDB_CTRL6 0x54
111#define TPS65912_LEDB_CTRL7 0x55
112#define TPS65912_LEDB_CTRL8 0x56
113#define TPS65912_LEDC_CTRL1 0x57
114#define TPS65912_LEDC_CTRL2 0x58
115#define TPS65912_LEDC_CTRL3 0x59
116#define TPS65912_LEDC_CTRL4 0x5A
117#define TPS65912_LEDC_CTRL5 0x5B
118#define TPS65912_LEDC_CTRL6 0x5C
119#define TPS65912_LEDC_CTRL7 0x5D
120#define TPS65912_LEDC_CTRL8 0x5E
121#define TPS65912_LED_RAMP_UP_TIME 0x5F
122#define TPS65912_LED_RAMP_DOWN_TIME 0x60
123#define TPS65912_LED_SEQ_EN 0x61
124#define TPS65912_LOADSWITCH 0x62
125#define TPS65912_SPARE 0x63
126#define TPS65912_VERNUM 0x64
127#define TPS6591X_MAX_REGISTER 0x64
128
129/* IRQ Definitions */
130#define TPS65912_IRQ_PWRHOLD_F 0
131#define TPS65912_IRQ_VMON 1
132#define TPS65912_IRQ_PWRON 2
133#define TPS65912_IRQ_PWRON_LP 3
134#define TPS65912_IRQ_PWRHOLD_R 4
135#define TPS65912_IRQ_HOTDIE 5
136#define TPS65912_IRQ_GPIO1_R 6
137#define TPS65912_IRQ_GPIO1_F 7
138#define TPS65912_IRQ_GPIO2_R 8
139#define TPS65912_IRQ_GPIO2_F 9
140#define TPS65912_IRQ_GPIO3_R 10
141#define TPS65912_IRQ_GPIO3_F 11
142#define TPS65912_IRQ_GPIO4_R 12
143#define TPS65912_IRQ_GPIO4_F 13
144#define TPS65912_IRQ_GPIO5_R 14
145#define TPS65912_IRQ_GPIO5_F 15
146#define TPS65912_IRQ_PGOOD_DCDC1 16
147#define TPS65912_IRQ_PGOOD_DCDC2 17
148#define TPS65912_IRQ_PGOOD_DCDC3 18
149#define TPS65912_IRQ_PGOOD_DCDC4 19
150#define TPS65912_IRQ_PGOOD_LDO1 20
151#define TPS65912_IRQ_PGOOD_LDO2 21
152#define TPS65912_IRQ_PGOOD_LDO3 22
153#define TPS65912_IRQ_PGOOD_LDO4 23
154#define TPS65912_IRQ_PGOOD_LDO5 24
155#define TPS65912_IRQ_PGOOD_LDO6 25
156#define TPS65912_IRQ_PGOOD_LDO7 26
157#define TPS65912_IRQ_PGOOD_LD08 27
158#define TPS65912_IRQ_PGOOD_LDO9 28
159#define TPS65912_IRQ_PGOOD_LDO10 29
160
161#define TPS65912_NUM_IRQ 30
162
163/* GPIO 1 and 2 Register Definitions */
164#define GPIO_SLEEP_MASK 0x80
165#define GPIO_SLEEP_SHIFT 7
166#define GPIO_DEB_MASK 0x10
167#define GPIO_DEB_SHIFT 4
168#define GPIO_CFG_MASK 0x04
169#define GPIO_CFG_SHIFT 2
170#define GPIO_STS_MASK 0x02
171#define GPIO_STS_SHIFT 1
172#define GPIO_SET_MASK 0x01
173#define GPIO_SET_SHIFT 0
174
175/* GPIO 3 Register Definitions */
176#define GPIO3_SLEEP_MASK 0x80
177#define GPIO3_SLEEP_SHIFT 7
178#define GPIO3_SEL_MASK 0x40
179#define GPIO3_SEL_SHIFT 6
180#define GPIO3_ODEN_MASK 0x20
181#define GPIO3_ODEN_SHIFT 5
182#define GPIO3_DEB_MASK 0x10
183#define GPIO3_DEB_SHIFT 4
184#define GPIO3_PDEN_MASK 0x08
185#define GPIO3_PDEN_SHIFT 3
186#define GPIO3_CFG_MASK 0x04
187#define GPIO3_CFG_SHIFT 2
188#define GPIO3_STS_MASK 0x02
189#define GPIO3_STS_SHIFT 1
190#define GPIO3_SET_MASK 0x01
191#define GPIO3_SET_SHIFT 0
192
193/* GPIO 4 Register Definitions */
194#define GPIO4_SLEEP_MASK 0x80
195#define GPIO4_SLEEP_SHIFT 7
196#define GPIO4_SEL_MASK 0x40
197#define GPIO4_SEL_SHIFT 6
198#define GPIO4_ODEN_MASK 0x20
199#define GPIO4_ODEN_SHIFT 5
200#define GPIO4_DEB_MASK 0x10
201#define GPIO4_DEB_SHIFT 4
202#define GPIO4_PDEN_MASK 0x08
203#define GPIO4_PDEN_SHIFT 3
204#define GPIO4_CFG_MASK 0x04
205#define GPIO4_CFG_SHIFT 2
206#define GPIO4_STS_MASK 0x02
207#define GPIO4_STS_SHIFT 1
208#define GPIO4_SET_MASK 0x01
209#define GPIO4_SET_SHIFT 0
210
211/* Register THERM (0x80) register.RegisterDescription */
212#define THERM_THERM_HD_MASK 0x20
213#define THERM_THERM_HD_SHIFT 5
214#define THERM_THERM_TS_MASK 0x10
215#define THERM_THERM_TS_SHIFT 4
216#define THERM_THERM_HDSEL_MASK 0x0C
217#define THERM_THERM_HDSEL_SHIFT 2
218#define THERM_RSVD1_MASK 0x02
219#define THERM_RSVD1_SHIFT 1
220#define THERM_THERM_STATE_MASK 0x01
221#define THERM_THERM_STATE_SHIFT 0
222
223/* Register DCDCCTRL1 register.RegisterDescription */
224#define DCDCCTRL_VCON_ENABLE_MASK 0x80
225#define DCDCCTRL_VCON_ENABLE_SHIFT 7
226#define DCDCCTRL_VCON_RANGE1_MASK 0x40
227#define DCDCCTRL_VCON_RANGE1_SHIFT 6
228#define DCDCCTRL_VCON_RANGE0_MASK 0x20
229#define DCDCCTRL_VCON_RANGE0_SHIFT 5
230#define DCDCCTRL_TSTEP2_MASK 0x10
231#define DCDCCTRL_TSTEP2_SHIFT 4
232#define DCDCCTRL_TSTEP1_MASK 0x08
233#define DCDCCTRL_TSTEP1_SHIFT 3
234#define DCDCCTRL_TSTEP0_MASK 0x04
235#define DCDCCTRL_TSTEP0_SHIFT 2
236#define DCDCCTRL_DCDC1_MODE_MASK 0x02
237#define DCDCCTRL_DCDC1_MODE_SHIFT 1
238
239/* Register DCDCCTRL2 and DCDCCTRL3 register.RegisterDescription */
240#define DCDCCTRL_TSTEP2_MASK 0x10
241#define DCDCCTRL_TSTEP2_SHIFT 4
242#define DCDCCTRL_TSTEP1_MASK 0x08
243#define DCDCCTRL_TSTEP1_SHIFT 3
244#define DCDCCTRL_TSTEP0_MASK 0x04
245#define DCDCCTRL_TSTEP0_SHIFT 2
246#define DCDCCTRL_DCDC_MODE_MASK 0x02
247#define DCDCCTRL_DCDC_MODE_SHIFT 1
248#define DCDCCTRL_RSVD0_MASK 0x01
249#define DCDCCTRL_RSVD0_SHIFT 0
250
251/* Register DCDCCTRL4 register.RegisterDescription */
252#define DCDCCTRL_RAMP_TIME_MASK 0x01
253#define DCDCCTRL_RAMP_TIME_SHIFT 0
254
255/* Register DCDCx_AVS */
256#define DCDC_AVS_ENABLE_MASK 0x80
257#define DCDC_AVS_ENABLE_SHIFT 7
258#define DCDC_AVS_ECO_MASK 0x40
259#define DCDC_AVS_ECO_SHIFT 6
260
261/* Register DCDCx_LIMIT */
262#define DCDC_LIMIT_RANGE_MASK 0xC0
263#define DCDC_LIMIT_RANGE_SHIFT 6
264#define DCDC_LIMIT_MAX_SEL_MASK 0x3F
265#define DCDC_LIMIT_MAX_SEL_SHIFT 0
266
267/**
268 * struct tps65912_board
269 * Board platform dat may be used to initialize regulators.
270 */
271struct tps65912_board {
272 int is_dcdc1_avs;
273 int is_dcdc2_avs;
274 int is_dcdc3_avs;
275 int is_dcdc4_avs;
276 int irq;
277 int irq_base;
278 int gpio_base;
279 struct regulator_init_data *tps65912_pmic_init_data;
280};
281
282/**
283 * struct tps65912 - tps65912 sub-driver chip access routines
284 */
285
286struct tps65912 {
287 struct device *dev;
288 /* for read/write acces */
289 struct mutex io_mutex;
290
291 /* For device IO interfaces: I2C or SPI */
292 void *control_data;
293
294 int (*read)(struct tps65912 *tps65912, u8 reg, int size, void *dest);
295 int (*write)(struct tps65912 *tps65912, u8 reg, int size, void *src);
296
297 /* Client devices */
298 struct tps65912_pmic *pmic;
299
300 /* GPIO Handling */
301 struct gpio_chip gpio;
302
303 /* IRQ Handling */
304 struct mutex irq_lock;
305 int chip_irq;
306 int irq_base;
307 int irq_num;
308 u32 irq_mask;
309};
310
311struct tps65912_platform_data {
312 int irq;
313 int irq_base;
314};
315
316unsigned int tps_chip(void);
317
318int tps65912_set_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
319int tps65912_clear_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
320int tps65912_reg_read(struct tps65912 *tps65912, u8 reg);
321int tps65912_reg_write(struct tps65912 *tps65912, u8 reg, u8 val);
322int tps65912_device_init(struct tps65912 *tps65912);
323void tps65912_device_exit(struct tps65912 *tps65912);
324int tps65912_irq_init(struct tps65912 *tps65912, int irq,
325 struct tps65912_platform_data *pdata);
326
327#endif /* __LINUX_MFD_TPS65912_H */
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-audio.h
index 5cc16bbd1da1..3d22b72df076 100644
--- a/include/linux/mfd/twl4030-codec.h
+++ b/include/linux/mfd/twl4030-audio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * MFD driver for twl4030 codec submodule 2 * MFD driver for twl4030 audio submodule
3 * 3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> 4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 * 5 *
@@ -259,14 +259,14 @@
259#define TWL4030_VIBRA_DIR_SEL 0x20 259#define TWL4030_VIBRA_DIR_SEL 0x20
260 260
261/* TWL4030 codec resource IDs */ 261/* TWL4030 codec resource IDs */
262enum twl4030_codec_res { 262enum twl4030_audio_res {
263 TWL4030_CODEC_RES_POWER = 0, 263 TWL4030_AUDIO_RES_POWER = 0,
264 TWL4030_CODEC_RES_APLL, 264 TWL4030_AUDIO_RES_APLL,
265 TWL4030_CODEC_RES_MAX, 265 TWL4030_AUDIO_RES_MAX,
266}; 266};
267 267
268int twl4030_codec_disable_resource(enum twl4030_codec_res id); 268int twl4030_audio_disable_resource(enum twl4030_audio_res id);
269int twl4030_codec_enable_resource(enum twl4030_codec_res id); 269int twl4030_audio_enable_resource(enum twl4030_audio_res id);
270unsigned int twl4030_codec_get_mclk(void); 270unsigned int twl4030_audio_get_mclk(void);
271 271
272#endif /* End of __TWL4030_CODEC_H__ */ 272#endif /* End of __TWL4030_CODEC_H__ */
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
new file mode 100644
index 000000000000..4c806f6d663e
--- /dev/null
+++ b/include/linux/mfd/twl6040.h
@@ -0,0 +1,228 @@
1/*
2 * MFD driver for twl6040
3 *
4 * Authors: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
5 * Misael Lopez Cruz <misael.lopez@ti.com>
6 *
7 * Copyright: (C) 2011 Texas Instruments, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __TWL6040_CODEC_H__
26#define __TWL6040_CODEC_H__
27
28#include <linux/interrupt.h>
29#include <linux/mfd/core.h>
30
31#define TWL6040_REG_ASICID 0x01
32#define TWL6040_REG_ASICREV 0x02
33#define TWL6040_REG_INTID 0x03
34#define TWL6040_REG_INTMR 0x04
35#define TWL6040_REG_NCPCTL 0x05
36#define TWL6040_REG_LDOCTL 0x06
37#define TWL6040_REG_HPPLLCTL 0x07
38#define TWL6040_REG_LPPLLCTL 0x08
39#define TWL6040_REG_LPPLLDIV 0x09
40#define TWL6040_REG_AMICBCTL 0x0A
41#define TWL6040_REG_DMICBCTL 0x0B
42#define TWL6040_REG_MICLCTL 0x0C
43#define TWL6040_REG_MICRCTL 0x0D
44#define TWL6040_REG_MICGAIN 0x0E
45#define TWL6040_REG_LINEGAIN 0x0F
46#define TWL6040_REG_HSLCTL 0x10
47#define TWL6040_REG_HSRCTL 0x11
48#define TWL6040_REG_HSGAIN 0x12
49#define TWL6040_REG_EARCTL 0x13
50#define TWL6040_REG_HFLCTL 0x14
51#define TWL6040_REG_HFLGAIN 0x15
52#define TWL6040_REG_HFRCTL 0x16
53#define TWL6040_REG_HFRGAIN 0x17
54#define TWL6040_REG_VIBCTLL 0x18
55#define TWL6040_REG_VIBDATL 0x19
56#define TWL6040_REG_VIBCTLR 0x1A
57#define TWL6040_REG_VIBDATR 0x1B
58#define TWL6040_REG_HKCTL1 0x1C
59#define TWL6040_REG_HKCTL2 0x1D
60#define TWL6040_REG_GPOCTL 0x1E
61#define TWL6040_REG_ALB 0x1F
62#define TWL6040_REG_DLB 0x20
63#define TWL6040_REG_TRIM1 0x28
64#define TWL6040_REG_TRIM2 0x29
65#define TWL6040_REG_TRIM3 0x2A
66#define TWL6040_REG_HSOTRIM 0x2B
67#define TWL6040_REG_HFOTRIM 0x2C
68#define TWL6040_REG_ACCCTL 0x2D
69#define TWL6040_REG_STATUS 0x2E
70
71#define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1)
72
73#define TWL6040_VIOREGNUM 18
74#define TWL6040_VDDREGNUM 21
75
76/* INTID (0x03) fields */
77
78#define TWL6040_THINT 0x01
79#define TWL6040_PLUGINT 0x02
80#define TWL6040_UNPLUGINT 0x04
81#define TWL6040_HOOKINT 0x08
82#define TWL6040_HFINT 0x10
83#define TWL6040_VIBINT 0x20
84#define TWL6040_READYINT 0x40
85
86/* INTMR (0x04) fields */
87
88#define TWL6040_THMSK 0x01
89#define TWL6040_PLUGMSK 0x02
90#define TWL6040_HOOKMSK 0x08
91#define TWL6040_HFMSK 0x10
92#define TWL6040_VIBMSK 0x20
93#define TWL6040_READYMSK 0x40
94#define TWL6040_ALLINT_MSK 0x7B
95
96/* NCPCTL (0x05) fields */
97
98#define TWL6040_NCPENA 0x01
99#define TWL6040_NCPOPEN 0x40
100
101/* LDOCTL (0x06) fields */
102
103#define TWL6040_LSLDOENA 0x01
104#define TWL6040_HSLDOENA 0x04
105#define TWL6040_REFENA 0x40
106#define TWL6040_OSCENA 0x80
107
108/* HPPLLCTL (0x07) fields */
109
110#define TWL6040_HPLLENA 0x01
111#define TWL6040_HPLLRST 0x02
112#define TWL6040_HPLLBP 0x04
113#define TWL6040_HPLLSQRENA 0x08
114#define TWL6040_MCLK_12000KHZ (0 << 5)
115#define TWL6040_MCLK_19200KHZ (1 << 5)
116#define TWL6040_MCLK_26000KHZ (2 << 5)
117#define TWL6040_MCLK_38400KHZ (3 << 5)
118#define TWL6040_MCLK_MSK 0x60
119
120/* LPPLLCTL (0x08) fields */
121
122#define TWL6040_LPLLENA 0x01
123#define TWL6040_LPLLRST 0x02
124#define TWL6040_LPLLSEL 0x04
125#define TWL6040_LPLLFIN 0x08
126#define TWL6040_HPLLSEL 0x10
127
128/* HSLCTL (0x10) fields */
129
130#define TWL6040_HSDACMODEL 0x02
131#define TWL6040_HSDRVMODEL 0x08
132
133/* HSRCTL (0x11) fields */
134
135#define TWL6040_HSDACMODER 0x02
136#define TWL6040_HSDRVMODER 0x08
137
138/* VIBCTLL (0x18) fields */
139
140#define TWL6040_VIBENAL 0x01
141#define TWL6040_VIBCTRLL 0x04
142#define TWL6040_VIBCTRLLP 0x08
143#define TWL6040_VIBCTRLLN 0x10
144
145/* VIBDATL (0x19) fields */
146
147#define TWL6040_VIBDAT_MAX 0x64
148
149/* VIBCTLR (0x1A) fields */
150
151#define TWL6040_VIBENAR 0x01
152#define TWL6040_VIBCTRLR 0x04
153#define TWL6040_VIBCTRLRP 0x08
154#define TWL6040_VIBCTRLRN 0x10
155
156/* GPOCTL (0x1E) fields */
157
158#define TWL6040_GPO1 0x01
159#define TWL6040_GPO2 0x02
160#define TWL6040_GPO3 0x03
161
162/* ACCCTL (0x2D) fields */
163
164#define TWL6040_I2CSEL 0x01
165#define TWL6040_RESETSPLIT 0x04
166#define TWL6040_INTCLRMODE 0x08
167
168/* STATUS (0x2E) fields */
169
170#define TWL6040_PLUGCOMP 0x02
171#define TWL6040_VIBLOCDET 0x10
172#define TWL6040_VIBROCDET 0x20
173#define TWL6040_TSHUTDET 0x40
174
175#define TWL6040_CELLS 2
176
177#define TWL6040_REV_ES1_0 0x00
178#define TWL6040_REV_ES1_1 0x01
179#define TWL6040_REV_ES1_2 0x02
180
181#define TWL6040_IRQ_TH 0
182#define TWL6040_IRQ_PLUG 1
183#define TWL6040_IRQ_HOOK 2
184#define TWL6040_IRQ_HF 3
185#define TWL6040_IRQ_VIB 4
186#define TWL6040_IRQ_READY 5
187
188/* PLL selection */
189#define TWL6040_SYSCLK_SEL_LPPLL 0
190#define TWL6040_SYSCLK_SEL_HPPLL 1
191
192struct twl6040 {
193 struct device *dev;
194 struct mutex mutex;
195 struct mutex io_mutex;
196 struct mutex irq_mutex;
197 struct mfd_cell cells[TWL6040_CELLS];
198 struct completion ready;
199
200 int audpwron;
201 int power_count;
202 int rev;
203
204 int pll;
205 unsigned int sysclk;
206
207 unsigned int irq;
208 unsigned int irq_base;
209 u8 irq_masks_cur;
210 u8 irq_masks_cache;
211};
212
213int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg);
214int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg,
215 u8 val);
216int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg,
217 u8 mask);
218int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg,
219 u8 mask);
220int twl6040_power(struct twl6040 *twl6040, int on);
221int twl6040_set_pll(struct twl6040 *twl6040, int pll_id,
222 unsigned int freq_in, unsigned int freq_out);
223int twl6040_get_pll(struct twl6040 *twl6040);
224unsigned int twl6040_get_sysclk(struct twl6040 *twl6040);
225int twl6040_irq_init(struct twl6040 *twl6040);
226void twl6040_irq_exit(struct twl6040 *twl6040);
227
228#endif /* End of __TWL6040_CODEC_H__ */
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 0d515ee1c247..8dda8ded5cda 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/completion.h> 18#include <linux/completion.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/list.h>
20 21
21/* 22/*
22 * Register values. 23 * Register values.
@@ -234,9 +235,111 @@
234#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */ 235#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */
235#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */ 236#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */
236 237
238/*
239 * R16528 (0x4090) - Clock Control 1
240 */
241#define WM831X_CLKOUT_ENA 0x8000 /* CLKOUT_ENA */
242#define WM831X_CLKOUT_ENA_MASK 0x8000 /* CLKOUT_ENA */
243#define WM831X_CLKOUT_ENA_SHIFT 15 /* CLKOUT_ENA */
244#define WM831X_CLKOUT_ENA_WIDTH 1 /* CLKOUT_ENA */
245#define WM831X_CLKOUT_OD 0x2000 /* CLKOUT_OD */
246#define WM831X_CLKOUT_OD_MASK 0x2000 /* CLKOUT_OD */
247#define WM831X_CLKOUT_OD_SHIFT 13 /* CLKOUT_OD */
248#define WM831X_CLKOUT_OD_WIDTH 1 /* CLKOUT_OD */
249#define WM831X_CLKOUT_SLOT_MASK 0x0700 /* CLKOUT_SLOT - [10:8] */
250#define WM831X_CLKOUT_SLOT_SHIFT 8 /* CLKOUT_SLOT - [10:8] */
251#define WM831X_CLKOUT_SLOT_WIDTH 3 /* CLKOUT_SLOT - [10:8] */
252#define WM831X_CLKOUT_SLPSLOT_MASK 0x0070 /* CLKOUT_SLPSLOT - [6:4] */
253#define WM831X_CLKOUT_SLPSLOT_SHIFT 4 /* CLKOUT_SLPSLOT - [6:4] */
254#define WM831X_CLKOUT_SLPSLOT_WIDTH 3 /* CLKOUT_SLPSLOT - [6:4] */
255#define WM831X_CLKOUT_SRC 0x0001 /* CLKOUT_SRC */
256#define WM831X_CLKOUT_SRC_MASK 0x0001 /* CLKOUT_SRC */
257#define WM831X_CLKOUT_SRC_SHIFT 0 /* CLKOUT_SRC */
258#define WM831X_CLKOUT_SRC_WIDTH 1 /* CLKOUT_SRC */
259
260/*
261 * R16529 (0x4091) - Clock Control 2
262 */
263#define WM831X_XTAL_INH 0x8000 /* XTAL_INH */
264#define WM831X_XTAL_INH_MASK 0x8000 /* XTAL_INH */
265#define WM831X_XTAL_INH_SHIFT 15 /* XTAL_INH */
266#define WM831X_XTAL_INH_WIDTH 1 /* XTAL_INH */
267#define WM831X_XTAL_ENA 0x2000 /* XTAL_ENA */
268#define WM831X_XTAL_ENA_MASK 0x2000 /* XTAL_ENA */
269#define WM831X_XTAL_ENA_SHIFT 13 /* XTAL_ENA */
270#define WM831X_XTAL_ENA_WIDTH 1 /* XTAL_ENA */
271#define WM831X_XTAL_BKUPENA 0x1000 /* XTAL_BKUPENA */
272#define WM831X_XTAL_BKUPENA_MASK 0x1000 /* XTAL_BKUPENA */
273#define WM831X_XTAL_BKUPENA_SHIFT 12 /* XTAL_BKUPENA */
274#define WM831X_XTAL_BKUPENA_WIDTH 1 /* XTAL_BKUPENA */
275#define WM831X_FLL_AUTO 0x0080 /* FLL_AUTO */
276#define WM831X_FLL_AUTO_MASK 0x0080 /* FLL_AUTO */
277#define WM831X_FLL_AUTO_SHIFT 7 /* FLL_AUTO */
278#define WM831X_FLL_AUTO_WIDTH 1 /* FLL_AUTO */
279#define WM831X_FLL_AUTO_FREQ_MASK 0x0007 /* FLL_AUTO_FREQ - [2:0] */
280#define WM831X_FLL_AUTO_FREQ_SHIFT 0 /* FLL_AUTO_FREQ - [2:0] */
281#define WM831X_FLL_AUTO_FREQ_WIDTH 3 /* FLL_AUTO_FREQ - [2:0] */
282
283/*
284 * R16530 (0x4092) - FLL Control 1
285 */
286#define WM831X_FLL_FRAC 0x0004 /* FLL_FRAC */
287#define WM831X_FLL_FRAC_MASK 0x0004 /* FLL_FRAC */
288#define WM831X_FLL_FRAC_SHIFT 2 /* FLL_FRAC */
289#define WM831X_FLL_FRAC_WIDTH 1 /* FLL_FRAC */
290#define WM831X_FLL_OSC_ENA 0x0002 /* FLL_OSC_ENA */
291#define WM831X_FLL_OSC_ENA_MASK 0x0002 /* FLL_OSC_ENA */
292#define WM831X_FLL_OSC_ENA_SHIFT 1 /* FLL_OSC_ENA */
293#define WM831X_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */
294#define WM831X_FLL_ENA 0x0001 /* FLL_ENA */
295#define WM831X_FLL_ENA_MASK 0x0001 /* FLL_ENA */
296#define WM831X_FLL_ENA_SHIFT 0 /* FLL_ENA */
297#define WM831X_FLL_ENA_WIDTH 1 /* FLL_ENA */
298
299/*
300 * R16531 (0x4093) - FLL Control 2
301 */
302#define WM831X_FLL_OUTDIV_MASK 0x3F00 /* FLL_OUTDIV - [13:8] */
303#define WM831X_FLL_OUTDIV_SHIFT 8 /* FLL_OUTDIV - [13:8] */
304#define WM831X_FLL_OUTDIV_WIDTH 6 /* FLL_OUTDIV - [13:8] */
305#define WM831X_FLL_CTRL_RATE_MASK 0x0070 /* FLL_CTRL_RATE - [6:4] */
306#define WM831X_FLL_CTRL_RATE_SHIFT 4 /* FLL_CTRL_RATE - [6:4] */
307#define WM831X_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [6:4] */
308#define WM831X_FLL_FRATIO_MASK 0x0007 /* FLL_FRATIO - [2:0] */
309#define WM831X_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [2:0] */
310#define WM831X_FLL_FRATIO_WIDTH 3 /* FLL_FRATIO - [2:0] */
311
312/*
313 * R16532 (0x4094) - FLL Control 3
314 */
315#define WM831X_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */
316#define WM831X_FLL_K_SHIFT 0 /* FLL_K - [15:0] */
317#define WM831X_FLL_K_WIDTH 16 /* FLL_K - [15:0] */
318
319/*
320 * R16533 (0x4095) - FLL Control 4
321 */
322#define WM831X_FLL_N_MASK 0x7FE0 /* FLL_N - [14:5] */
323#define WM831X_FLL_N_SHIFT 5 /* FLL_N - [14:5] */
324#define WM831X_FLL_N_WIDTH 10 /* FLL_N - [14:5] */
325#define WM831X_FLL_GAIN_MASK 0x000F /* FLL_GAIN - [3:0] */
326#define WM831X_FLL_GAIN_SHIFT 0 /* FLL_GAIN - [3:0] */
327#define WM831X_FLL_GAIN_WIDTH 4 /* FLL_GAIN - [3:0] */
328
329/*
330 * R16534 (0x4096) - FLL Control 5
331 */
332#define WM831X_FLL_CLK_REF_DIV_MASK 0x0018 /* FLL_CLK_REF_DIV - [4:3] */
333#define WM831X_FLL_CLK_REF_DIV_SHIFT 3 /* FLL_CLK_REF_DIV - [4:3] */
334#define WM831X_FLL_CLK_REF_DIV_WIDTH 2 /* FLL_CLK_REF_DIV - [4:3] */
335#define WM831X_FLL_CLK_SRC_MASK 0x0003 /* FLL_CLK_SRC - [1:0] */
336#define WM831X_FLL_CLK_SRC_SHIFT 0 /* FLL_CLK_SRC - [1:0] */
337#define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */
338
237struct regulator_dev; 339struct regulator_dev;
238 340
239#define WM831X_NUM_IRQ_REGS 5 341#define WM831X_NUM_IRQ_REGS 5
342#define WM831X_NUM_GPIO_REGS 16
240 343
241enum wm831x_parent { 344enum wm831x_parent {
242 WM8310 = 0x8310, 345 WM8310 = 0x8310,
@@ -248,6 +351,12 @@ enum wm831x_parent {
248 WM8326 = 0x8326, 351 WM8326 = 0x8326,
249}; 352};
250 353
354struct wm831x;
355enum wm831x_auxadc;
356
357typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,
358 enum wm831x_auxadc input);
359
251struct wm831x { 360struct wm831x {
252 struct mutex io_lock; 361 struct mutex io_lock;
253 362
@@ -261,7 +370,7 @@ struct wm831x {
261 370
262 int irq; /* Our chip IRQ */ 371 int irq; /* Our chip IRQ */
263 struct mutex irq_lock; 372 struct mutex irq_lock;
264 unsigned int irq_base; 373 int irq_base;
265 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ 374 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
266 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 375 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
267 376
@@ -272,8 +381,13 @@ struct wm831x {
272 381
273 int num_gpio; 382 int num_gpio;
274 383
384 /* Used by the interrupt controller code to post writes */
385 int gpio_update[WM831X_NUM_GPIO_REGS];
386
275 struct mutex auxadc_lock; 387 struct mutex auxadc_lock;
276 struct completion auxadc_done; 388 struct list_head auxadc_pending;
389 u16 auxadc_active;
390 wm831x_auxadc_read_fn auxadc_read;
277 391
278 /* The WM831x has a security key blocking access to certain 392 /* The WM831x has a security key blocking access to certain
279 * registers. The mutex is taken by the accessors for locking 393 * registers. The mutex is taken by the accessors for locking
@@ -300,5 +414,6 @@ void wm831x_device_exit(struct wm831x *wm831x);
300int wm831x_device_suspend(struct wm831x *wm831x); 414int wm831x_device_suspend(struct wm831x *wm831x);
301int wm831x_irq_init(struct wm831x *wm831x, int irq); 415int wm831x_irq_init(struct wm831x *wm831x, int irq);
302void wm831x_irq_exit(struct wm831x *wm831x); 416void wm831x_irq_exit(struct wm831x *wm831x);
417void wm831x_auxadc_init(struct wm831x *wm831x);
303 418
304#endif 419#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index ff42d700293f..0ba24599fe51 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -120,6 +120,9 @@ struct wm831x_pdata {
120 /** Put the /IRQ line into CMOS mode */ 120 /** Put the /IRQ line into CMOS mode */
121 bool irq_cmos; 121 bool irq_cmos;
122 122
123 /** Disable the touchscreen */
124 bool disable_touch;
125
123 int irq_base; 126 int irq_base;
124 int gpio_base; 127 int gpio_base;
125 int gpio_defaults[WM831X_GPIO_NUM]; 128 int gpio_defaults[WM831X_GPIO_NUM];
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 18fd13028ba1..c309b1ecdc1c 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -40,6 +40,7 @@
40#define BTRFS_MINOR 234 40#define BTRFS_MINOR 234
41#define AUTOFS_MINOR 235 41#define AUTOFS_MINOR 235
42#define MAPPER_CTRL_MINOR 236 42#define MAPPER_CTRL_MINOR 236
43#define LOOP_CTRL_MINOR 237
43#define MISC_DYNAMIC_MINOR 255 44#define MISC_DYNAMIC_MINOR 255
44 45
45struct device; 46struct device;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 387329e02303..53ef894bfa05 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -37,7 +37,7 @@
37#include <linux/completion.h> 37#include <linux/completion.h>
38#include <linux/radix-tree.h> 38#include <linux/radix-tree.h>
39 39
40#include <asm/atomic.h> 40#include <linux/atomic.h>
41 41
42#define MAX_MSIX_P_PORT 17 42#define MAX_MSIX_P_PORT 17
43#define MAX_MSIX 64 43#define MAX_MSIX 64
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3172a1c0f08e..7438071b44aa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -685,7 +685,7 @@ static inline void set_page_section(struct page *page, unsigned long section)
685 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; 685 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
686} 686}
687 687
688static inline unsigned long page_to_section(struct page *page) 688static inline unsigned long page_to_section(const struct page *page)
689{ 689{
690 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; 690 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
691} 691}
@@ -720,7 +720,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
720 720
721static __always_inline void *lowmem_page_address(const struct page *page) 721static __always_inline void *lowmem_page_address(const struct page *page)
722{ 722{
723 return __va(PFN_PHYS(page_to_pfn((struct page *)page))); 723 return __va(PFN_PHYS(page_to_pfn(page)));
724} 724}
725 725
726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -737,7 +737,7 @@ static __always_inline void *lowmem_page_address(const struct page *page)
737#endif 737#endif
738 738
739#if defined(HASHED_PAGE_VIRTUAL) 739#if defined(HASHED_PAGE_VIRTUAL)
740void *page_address(struct page *page); 740void *page_address(const struct page *page);
741void set_page_address(struct page *page, void *virtual); 741void set_page_address(struct page *page, void *virtual);
742void page_address_init(void); 742void page_address_init(void);
743#endif 743#endif
@@ -962,6 +962,8 @@ int invalidate_inode_page(struct page *page);
962#ifdef CONFIG_MMU 962#ifdef CONFIG_MMU
963extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, 963extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
964 unsigned long address, unsigned int flags); 964 unsigned long address, unsigned int flags);
965extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
966 unsigned long address, unsigned int fault_flags);
965#else 967#else
966static inline int handle_mm_fault(struct mm_struct *mm, 968static inline int handle_mm_fault(struct mm_struct *mm,
967 struct vm_area_struct *vma, unsigned long address, 969 struct vm_area_struct *vma, unsigned long address,
@@ -971,6 +973,14 @@ static inline int handle_mm_fault(struct mm_struct *mm,
971 BUG(); 973 BUG();
972 return VM_FAULT_SIGBUS; 974 return VM_FAULT_SIGBUS;
973} 975}
976static inline int fixup_user_fault(struct task_struct *tsk,
977 struct mm_struct *mm, unsigned long address,
978 unsigned int fault_flags)
979{
980 /* should never happen if there's no MMU */
981 BUG();
982 return -EFAULT;
983}
974#endif 984#endif
975 985
976extern int make_pages_present(unsigned long addr, unsigned long end); 986extern int make_pages_present(unsigned long addr, unsigned long end);
@@ -988,8 +998,6 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
988int get_user_pages_fast(unsigned long start, int nr_pages, int write, 998int get_user_pages_fast(unsigned long start, int nr_pages, int write,
989 struct page **pages); 999 struct page **pages);
990struct page *get_dump_page(unsigned long addr); 1000struct page *get_dump_page(unsigned long addr);
991extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
992 unsigned long address, unsigned int fault_flags);
993 1001
994extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 1002extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
995extern void do_invalidatepage(struct page *page, unsigned long offset); 1003extern void do_invalidatepage(struct page *page, unsigned long offset);
@@ -1600,6 +1608,7 @@ enum mf_flags {
1600}; 1608};
1601extern void memory_failure(unsigned long pfn, int trapno); 1609extern void memory_failure(unsigned long pfn, int trapno);
1602extern int __memory_failure(unsigned long pfn, int trapno, int flags); 1610extern int __memory_failure(unsigned long pfn, int trapno, int flags);
1611extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
1603extern int unpoison_memory(unsigned long pfn); 1612extern int unpoison_memory(unsigned long pfn);
1604extern int sysctl_memory_failure_early_kill; 1613extern int sysctl_memory_failure_early_kill;
1605extern int sysctl_memory_failure_recovery; 1614extern int sysctl_memory_failure_recovery;
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 027935c86c68..774b8952deb4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -30,23 +30,61 @@ struct address_space;
30 * moment. Note that we have no way to track which tasks are using 30 * moment. Note that we have no way to track which tasks are using
31 * a page, though if it is a pagecache page, rmap structures can tell us 31 * a page, though if it is a pagecache page, rmap structures can tell us
32 * who is mapping it. 32 * who is mapping it.
33 *
34 * The objects in struct page are organized in double word blocks in
35 * order to allows us to use atomic double word operations on portions
36 * of struct page. That is currently only used by slub but the arrangement
37 * allows the use of atomic double word operations on the flags/mapping
38 * and lru list pointers also.
33 */ 39 */
34struct page { 40struct page {
41 /* First double word block */
35 unsigned long flags; /* Atomic flags, some possibly 42 unsigned long flags; /* Atomic flags, some possibly
36 * updated asynchronously */ 43 * updated asynchronously */
37 atomic_t _count; /* Usage count, see below. */ 44 struct address_space *mapping; /* If low bit clear, points to
38 union { 45 * inode address_space, or NULL.
39 atomic_t _mapcount; /* Count of ptes mapped in mms, 46 * If page mapped as anonymous
40 * to show when page is mapped 47 * memory, low bit is set, and
41 * & limit reverse map searches. 48 * it points to anon_vma object:
49 * see PAGE_MAPPING_ANON below.
42 */ 50 */
43 struct { /* SLUB */ 51 /* Second double word */
44 u16 inuse; 52 struct {
45 u16 objects; 53 union {
54 pgoff_t index; /* Our offset within mapping. */
55 void *freelist; /* slub first free object */
56 };
57
58 union {
59 /* Used for cmpxchg_double in slub */
60 unsigned long counters;
61
62 struct {
63
64 union {
65 atomic_t _mapcount; /* Count of ptes mapped in mms,
66 * to show when page is mapped
67 * & limit reverse map searches.
68 */
69
70 struct {
71 unsigned inuse:16;
72 unsigned objects:15;
73 unsigned frozen:1;
74 };
75 };
76 atomic_t _count; /* Usage count, see below. */
77 };
46 }; 78 };
47 }; 79 };
80
81 /* Third double word block */
82 struct list_head lru; /* Pageout list, eg. active_list
83 * protected by zone->lru_lock !
84 */
85
86 /* Remainder is not double word aligned */
48 union { 87 union {
49 struct {
50 unsigned long private; /* Mapping-private opaque data: 88 unsigned long private; /* Mapping-private opaque data:
51 * usually used for buffer_heads 89 * usually used for buffer_heads
52 * if PagePrivate set; used for 90 * if PagePrivate set; used for
@@ -54,27 +92,13 @@ struct page {
54 * indicates order in the buddy 92 * indicates order in the buddy
55 * system if PG_buddy is set. 93 * system if PG_buddy is set.
56 */ 94 */
57 struct address_space *mapping; /* If low bit clear, points to
58 * inode address_space, or NULL.
59 * If page mapped as anonymous
60 * memory, low bit is set, and
61 * it points to anon_vma object:
62 * see PAGE_MAPPING_ANON below.
63 */
64 };
65#if USE_SPLIT_PTLOCKS 95#if USE_SPLIT_PTLOCKS
66 spinlock_t ptl; 96 spinlock_t ptl;
67#endif 97#endif
68 struct kmem_cache *slab; /* SLUB: Pointer to slab */ 98 struct kmem_cache *slab; /* SLUB: Pointer to slab */
69 struct page *first_page; /* Compound tail pages */ 99 struct page *first_page; /* Compound tail pages */
70 };
71 union {
72 pgoff_t index; /* Our offset within mapping. */
73 void *freelist; /* SLUB: freelist req. slab lock */
74 }; 100 };
75 struct list_head lru; /* Pageout list, eg. active_list 101
76 * protected by zone->lru_lock !
77 */
78 /* 102 /*
79 * On machines where all RAM is mapped into kernel address space, 103 * On machines where all RAM is mapped into kernel address space,
80 * we can simply calculate the virtual address. On machines with 104 * we can simply calculate the virtual address. On machines with
@@ -100,7 +124,16 @@ struct page {
100 */ 124 */
101 void *shadow; 125 void *shadow;
102#endif 126#endif
103}; 127}
128/*
129 * If another subsystem starts using the double word pairing for atomic
130 * operations on struct page then it must change the #if to ensure
131 * proper alignment of the page struct.
132 */
133#if defined(CONFIG_SLUB) && defined(CONFIG_CMPXCHG_LOCAL)
134 __attribute__((__aligned__(2*sizeof(unsigned long))))
135#endif
136;
104 137
105typedef unsigned long __nocast vm_flags_t; 138typedef unsigned long __nocast vm_flags_t;
106 139
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 9872d6ca58ae..8b74e9b1d0ad 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -14,7 +14,7 @@
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/percpu_counter.h> 15#include <linux/percpu_counter.h>
16 16
17#include <asm/atomic.h> 17#include <linux/atomic.h>
18 18
19extern int sysctl_overcommit_memory; 19extern int sysctl_overcommit_memory;
20extern int sysctl_overcommit_ratio; 20extern int sysctl_overcommit_ratio;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0f83858147a6..1d09562ccf73 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -56,8 +56,6 @@ struct mmc_ios {
56#define MMC_TIMING_UHS_SDR104 4 56#define MMC_TIMING_UHS_SDR104 4
57#define MMC_TIMING_UHS_DDR50 5 57#define MMC_TIMING_UHS_DDR50 5
58 58
59 unsigned char ddr; /* dual data rate used */
60
61#define MMC_SDR_MODE 0 59#define MMC_SDR_MODE 0
62#define MMC_1_2V_DDR_MODE 1 60#define MMC_1_2V_DDR_MODE 1
63#define MMC_1_8V_DDR_MODE 2 61#define MMC_1_8V_DDR_MODE 2
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 9f7c3ebcbbad..be1ac8d7789b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -16,7 +16,7 @@
16#include <linux/nodemask.h> 16#include <linux/nodemask.h>
17#include <linux/pageblock-flags.h> 17#include <linux/pageblock-flags.h>
18#include <generated/bounds.h> 18#include <generated/bounds.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20#include <asm/page.h> 20#include <asm/page.h>
21 21
22/* Free memory management - zoned buddy allocator. */ 22/* Free memory management - zoned buddy allocator. */
@@ -158,6 +158,12 @@ static inline int is_unevictable_lru(enum lru_list l)
158 return (l == LRU_UNEVICTABLE); 158 return (l == LRU_UNEVICTABLE);
159} 159}
160 160
161/* Mask used at gathering information at once (see memcontrol.c) */
162#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))
163#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
164#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
165#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
166
161enum zone_watermarks { 167enum zone_watermarks {
162 WMARK_MIN, 168 WMARK_MIN,
163 WMARK_LOW, 169 WMARK_LOW,
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 604f122a2326..33fe53d78110 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -14,7 +14,7 @@
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/seqlock.h> 16#include <linux/seqlock.h>
17#include <asm/atomic.h> 17#include <linux/atomic.h>
18 18
19struct super_block; 19struct super_block;
20struct vfsmount; 20struct vfsmount;
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 7f87217e9d1f..9121595a8ebf 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -15,7 +15,7 @@
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <linux/lockdep.h> 16#include <linux/lockdep.h>
17 17
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19 19
20/* 20/*
21 * Simple, straightforward mutexes with strict semantics: 21 * Simple, straightforward mutexes with strict semantics:
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ea6f4aa479d4..ddee79bb8f15 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -34,7 +34,7 @@
34#include <linux/pm_qos_params.h> 34#include <linux/pm_qos_params.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <asm/atomic.h> 37#include <linux/atomic.h>
38#include <asm/cache.h> 38#include <asm/cache.h>
39#include <asm/byteorder.h> 39#include <asm/byteorder.h>
40 40
@@ -1132,7 +1132,7 @@ struct net_device {
1132 spinlock_t addr_list_lock; 1132 spinlock_t addr_list_lock;
1133 struct netdev_hw_addr_list uc; /* Unicast mac addresses */ 1133 struct netdev_hw_addr_list uc; /* Unicast mac addresses */
1134 struct netdev_hw_addr_list mc; /* Multicast mac addresses */ 1134 struct netdev_hw_addr_list mc; /* Multicast mac addresses */
1135 int uc_promisc; 1135 bool uc_promisc;
1136 unsigned int promiscuity; 1136 unsigned int promiscuity;
1137 unsigned int allmulti; 1137 unsigned int allmulti;
1138 1138
@@ -1679,9 +1679,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
1679static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, 1679static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
1680 unsigned int offset) 1680 unsigned int offset)
1681{ 1681{
1682 if (!pskb_may_pull(skb, hlen))
1683 return NULL;
1684
1682 NAPI_GRO_CB(skb)->frag0 = NULL; 1685 NAPI_GRO_CB(skb)->frag0 = NULL;
1683 NAPI_GRO_CB(skb)->frag0_len = 0; 1686 NAPI_GRO_CB(skb)->frag0_len = 0;
1684 return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; 1687 return skb->data + offset;
1685} 1688}
1686 1689
1687static inline void *skb_gro_mac_header(struct sk_buff *skb) 1690static inline void *skb_gro_mac_header(struct sk_buff *skb)
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e17c5dbdcb8..180540a84d37 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -29,7 +29,7 @@
29#define MAX_LINKS 32 29#define MAX_LINKS 32
30 30
31struct sockaddr_nl { 31struct sockaddr_nl {
32 sa_family_t nl_family; /* AF_NETLINK */ 32 __kernel_sa_family_t nl_family; /* AF_NETLINK */
33 unsigned short nl_pad; /* zero */ 33 unsigned short nl_pad; /* zero */
34 __u32 nl_pid; /* port ID */ 34 __u32 nl_pid; /* port ID */
35 __u32 nl_groups; /* multicast groups mask */ 35 __u32 nl_groups; /* multicast groups mask */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index f387919bbc59..8c6ee44914cb 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -29,6 +29,8 @@
29#define NFS_MNT_VERSION 1 29#define NFS_MNT_VERSION 1
30#define NFS_MNT3_VERSION 3 30#define NFS_MNT3_VERSION 3
31 31
32#define NFS_PIPE_DIRNAME "/nfs"
33
32/* 34/*
33 * NFS stats. The good thing with these values is that NFSv3 errors are 35 * NFS stats. The good thing with these values is that NFSv3 errors are
34 * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which 36 * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 504b289ba680..76f99e8714f3 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -563,6 +563,10 @@ enum {
563 NFSPROC4_CLNT_GETDEVICEINFO, 563 NFSPROC4_CLNT_GETDEVICEINFO,
564 NFSPROC4_CLNT_LAYOUTCOMMIT, 564 NFSPROC4_CLNT_LAYOUTCOMMIT,
565 NFSPROC4_CLNT_LAYOUTRETURN, 565 NFSPROC4_CLNT_LAYOUTRETURN,
566 NFSPROC4_CLNT_SECINFO_NO_NAME,
567 NFSPROC4_CLNT_TEST_STATEID,
568 NFSPROC4_CLNT_FREE_STATEID,
569 NFSPROC4_CLNT_GETDEVICELIST,
566}; 570};
567 571
568/* nfs41 types */ 572/* nfs41 types */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8b579beb6358..eaac770f886e 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -99,9 +99,10 @@ struct nfs_open_context {
99 99
100struct nfs_open_dir_context { 100struct nfs_open_dir_context {
101 struct rpc_cred *cred; 101 struct rpc_cred *cred;
102 unsigned long attr_gencount;
102 __u64 dir_cookie; 103 __u64 dir_cookie;
103 __u64 dup_cookie; 104 __u64 dup_cookie;
104 int duped; 105 signed char duped;
105}; 106};
106 107
107/* 108/*
@@ -568,12 +569,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type);
568extern int nfs3_proc_setacl(struct inode *inode, int type, 569extern int nfs3_proc_setacl(struct inode *inode, int type,
569 struct posix_acl *acl); 570 struct posix_acl *acl);
570extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, 571extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
571 mode_t mode); 572 umode_t mode);
572extern void nfs3_forget_cached_acls(struct inode *inode); 573extern void nfs3_forget_cached_acls(struct inode *inode);
573#else 574#else
574static inline int nfs3_proc_set_default_acl(struct inode *dir, 575static inline int nfs3_proc_set_default_acl(struct inode *dir,
575 struct inode *inode, 576 struct inode *inode,
576 mode_t mode) 577 umode_t mode)
577{ 578{
578 return 0; 579 return 0;
579} 580}
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 87694ca86914..b5479df8378d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -7,7 +7,7 @@
7#include <linux/nfs_xdr.h> 7#include <linux/nfs_xdr.h>
8#include <linux/sunrpc/xprt.h> 8#include <linux/sunrpc/xprt.h>
9 9
10#include <asm/atomic.h> 10#include <linux/atomic.h>
11 11
12struct nfs4_session; 12struct nfs4_session;
13struct nfs_iostats; 13struct nfs_iostats;
@@ -16,6 +16,7 @@ struct nfs4_sequence_args;
16struct nfs4_sequence_res; 16struct nfs4_sequence_res;
17struct nfs_server; 17struct nfs_server;
18struct nfs4_minor_version_ops; 18struct nfs4_minor_version_ops;
19struct server_scope;
19 20
20/* 21/*
21 * The nfs_client identifies our client state to the server. 22 * The nfs_client identifies our client state to the server.
@@ -77,12 +78,13 @@ struct nfs_client {
77 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 78 /* The flags used for obtaining the clientid during EXCHANGE_ID */
78 u32 cl_exchange_flags; 79 u32 cl_exchange_flags;
79 struct nfs4_session *cl_session; /* sharred session */ 80 struct nfs4_session *cl_session; /* sharred session */
80 struct list_head cl_layouts;
81#endif /* CONFIG_NFS_V4 */ 81#endif /* CONFIG_NFS_V4 */
82 82
83#ifdef CONFIG_NFS_FSCACHE 83#ifdef CONFIG_NFS_FSCACHE
84 struct fscache_cookie *fscache; /* client index cache cookie */ 84 struct fscache_cookie *fscache; /* client index cache cookie */
85#endif 85#endif
86
87 struct server_scope *server_scope; /* from exchange_id */
86}; 88};
87 89
88/* 90/*
@@ -129,8 +131,9 @@ struct nfs_server {
129 struct fscache_cookie *fscache; /* superblock cookie */ 131 struct fscache_cookie *fscache; /* superblock cookie */
130#endif 132#endif
131 133
134 u32 pnfs_blksize; /* layout_blksize attr */
132#ifdef CONFIG_NFS_V4 135#ifdef CONFIG_NFS_V4
133 u32 attr_bitmask[2];/* V4 bitmask representing the set 136 u32 attr_bitmask[3];/* V4 bitmask representing the set
134 of attributes supported on this 137 of attributes supported on this
135 filesystem */ 138 filesystem */
136 u32 cache_consistency_bitmask[2]; 139 u32 cache_consistency_bitmask[2];
@@ -143,12 +146,14 @@ struct nfs_server {
143 filesystem */ 146 filesystem */
144 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ 147 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */
145 struct rpc_wait_queue roc_rpcwaitq; 148 struct rpc_wait_queue roc_rpcwaitq;
149 void *pnfs_ld_data; /* per mount point data */
146 150
147 /* the following fields are protected by nfs_client->cl_lock */ 151 /* the following fields are protected by nfs_client->cl_lock */
148 struct rb_root state_owners; 152 struct rb_root state_owners;
149 struct rb_root openowner_id; 153 struct rb_root openowner_id;
150 struct rb_root lockowner_id; 154 struct rb_root lockowner_id;
151#endif 155#endif
156 struct list_head layouts;
152 struct list_head delegations; 157 struct list_head delegations;
153 void (*destroy)(struct nfs_server *); 158 void (*destroy)(struct nfs_server *);
154 159
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 25311b3bedf8..e2791a27a901 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -55,20 +55,28 @@ struct nfs_page {
55 struct nfs_writeverf wb_verf; /* Commit cookie */ 55 struct nfs_writeverf wb_verf; /* Commit cookie */
56}; 56};
57 57
58struct nfs_pageio_descriptor;
59struct nfs_pageio_ops {
60 void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *);
61 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
62 int (*pg_doio)(struct nfs_pageio_descriptor *);
63};
64
58struct nfs_pageio_descriptor { 65struct nfs_pageio_descriptor {
59 struct list_head pg_list; 66 struct list_head pg_list;
60 unsigned long pg_bytes_written; 67 unsigned long pg_bytes_written;
61 size_t pg_count; 68 size_t pg_count;
62 size_t pg_bsize; 69 size_t pg_bsize;
63 unsigned int pg_base; 70 unsigned int pg_base;
64 char pg_moreio; 71 unsigned char pg_moreio : 1,
72 pg_recoalesce : 1;
65 73
66 struct inode *pg_inode; 74 struct inode *pg_inode;
67 int (*pg_doio)(struct nfs_pageio_descriptor *); 75 const struct nfs_pageio_ops *pg_ops;
68 int pg_ioflags; 76 int pg_ioflags;
69 int pg_error; 77 int pg_error;
78 const struct rpc_call_ops *pg_rpc_callops;
70 struct pnfs_layout_segment *pg_lseg; 79 struct pnfs_layout_segment *pg_lseg;
71 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
72}; 80};
73 81
74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 82#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
@@ -85,7 +93,7 @@ extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
85 pgoff_t idx_start, unsigned int npages, int tag); 93 pgoff_t idx_start, unsigned int npages, int tag);
86extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 94extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
87 struct inode *inode, 95 struct inode *inode,
88 int (*doio)(struct nfs_pageio_descriptor *desc), 96 const struct nfs_pageio_ops *pg_ops,
89 size_t bsize, 97 size_t bsize,
90 int how); 98 int how);
91extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 99extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
@@ -100,7 +108,6 @@ extern void nfs_unlock_request(struct nfs_page *req);
100extern int nfs_set_page_tag_locked(struct nfs_page *req); 108extern int nfs_set_page_tag_locked(struct nfs_page *req);
101extern void nfs_clear_page_tag_locked(struct nfs_page *req); 109extern void nfs_clear_page_tag_locked(struct nfs_page *req);
102 110
103
104/* 111/*
105 * Lock the page of an asynchronous request without getting a new reference 112 * Lock the page of an asynchronous request without getting a new reference
106 */ 113 */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 00848d86ffb2..abd615d74a29 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -122,6 +122,7 @@ struct nfs_fsinfo {
122 struct timespec time_delta; /* server time granularity */ 122 struct timespec time_delta; /* server time granularity */
123 __u32 lease_time; /* in seconds */ 123 __u32 lease_time; /* in seconds */
124 __u32 layouttype; /* supported pnfs layout driver */ 124 __u32 layouttype; /* supported pnfs layout driver */
125 __u32 blksize; /* preferred pnfs io block size */
125}; 126};
126 127
127struct nfs_fsstat { 128struct nfs_fsstat {
@@ -235,6 +236,17 @@ struct nfs4_layoutget {
235 gfp_t gfp_flags; 236 gfp_t gfp_flags;
236}; 237};
237 238
239struct nfs4_getdevicelist_args {
240 const struct nfs_fh *fh;
241 u32 layoutclass;
242 struct nfs4_sequence_args seq_args;
243};
244
245struct nfs4_getdevicelist_res {
246 struct pnfs_devicelist *devlist;
247 struct nfs4_sequence_res seq_res;
248};
249
238struct nfs4_getdeviceinfo_args { 250struct nfs4_getdeviceinfo_args {
239 struct pnfs_device *pdev; 251 struct pnfs_device *pdev;
240 struct nfs4_sequence_args seq_args; 252 struct nfs4_sequence_args seq_args;
@@ -257,21 +269,23 @@ struct nfs4_layoutcommit_res {
257 struct nfs_fattr *fattr; 269 struct nfs_fattr *fattr;
258 const struct nfs_server *server; 270 const struct nfs_server *server;
259 struct nfs4_sequence_res seq_res; 271 struct nfs4_sequence_res seq_res;
272 int status;
260}; 273};
261 274
262struct nfs4_layoutcommit_data { 275struct nfs4_layoutcommit_data {
263 struct rpc_task task; 276 struct rpc_task task;
264 struct nfs_fattr fattr; 277 struct nfs_fattr fattr;
265 struct pnfs_layout_segment *lseg; 278 struct list_head lseg_list;
266 struct rpc_cred *cred; 279 struct rpc_cred *cred;
267 struct nfs4_layoutcommit_args args; 280 struct nfs4_layoutcommit_args args;
268 struct nfs4_layoutcommit_res res; 281 struct nfs4_layoutcommit_res res;
269}; 282};
270 283
271struct nfs4_layoutreturn_args { 284struct nfs4_layoutreturn_args {
272 __u32 layout_type; 285 struct pnfs_layout_hdr *layout;
273 struct inode *inode; 286 struct inode *inode;
274 nfs4_stateid stateid; 287 nfs4_stateid stateid;
288 __u32 layout_type;
275 struct nfs4_sequence_args seq_args; 289 struct nfs4_sequence_args seq_args;
276}; 290};
277 291
@@ -759,6 +773,11 @@ struct nfs3_getaclres {
759 struct posix_acl * acl_default; 773 struct posix_acl * acl_default;
760}; 774};
761 775
776struct nfs4_string {
777 unsigned int len;
778 char *data;
779};
780
762#ifdef CONFIG_NFS_V4 781#ifdef CONFIG_NFS_V4
763 782
764typedef u64 clientid4; 783typedef u64 clientid4;
@@ -942,18 +961,13 @@ struct nfs4_server_caps_arg {
942}; 961};
943 962
944struct nfs4_server_caps_res { 963struct nfs4_server_caps_res {
945 u32 attr_bitmask[2]; 964 u32 attr_bitmask[3];
946 u32 acl_bitmask; 965 u32 acl_bitmask;
947 u32 has_links; 966 u32 has_links;
948 u32 has_symlinks; 967 u32 has_symlinks;
949 struct nfs4_sequence_res seq_res; 968 struct nfs4_sequence_res seq_res;
950}; 969};
951 970
952struct nfs4_string {
953 unsigned int len;
954 char *data;
955};
956
957#define NFS4_PATHNAME_MAXCOMPONENTS 512 971#define NFS4_PATHNAME_MAXCOMPONENTS 512
958struct nfs4_pathname { 972struct nfs4_pathname {
959 unsigned int ncomponents; 973 unsigned int ncomponents;
@@ -1060,6 +1074,7 @@ struct server_scope {
1060struct nfs41_exchange_id_res { 1074struct nfs41_exchange_id_res {
1061 struct nfs_client *client; 1075 struct nfs_client *client;
1062 u32 flags; 1076 u32 flags;
1077 struct server_scope *server_scope;
1063}; 1078};
1064 1079
1065struct nfs41_create_session_args { 1080struct nfs41_create_session_args {
@@ -1083,6 +1098,34 @@ struct nfs41_reclaim_complete_args {
1083struct nfs41_reclaim_complete_res { 1098struct nfs41_reclaim_complete_res {
1084 struct nfs4_sequence_res seq_res; 1099 struct nfs4_sequence_res seq_res;
1085}; 1100};
1101
1102#define SECINFO_STYLE_CURRENT_FH 0
1103#define SECINFO_STYLE_PARENT 1
1104struct nfs41_secinfo_no_name_args {
1105 int style;
1106 struct nfs4_sequence_args seq_args;
1107};
1108
1109struct nfs41_test_stateid_args {
1110 nfs4_stateid *stateid;
1111 struct nfs4_sequence_args seq_args;
1112};
1113
1114struct nfs41_test_stateid_res {
1115 unsigned int status;
1116 struct nfs4_sequence_res seq_res;
1117};
1118
1119struct nfs41_free_stateid_args {
1120 nfs4_stateid *stateid;
1121 struct nfs4_sequence_args seq_args;
1122};
1123
1124struct nfs41_free_stateid_res {
1125 unsigned int status;
1126 struct nfs4_sequence_res seq_res;
1127};
1128
1086#endif /* CONFIG_NFS_V4_1 */ 1129#endif /* CONFIG_NFS_V4_1 */
1087 1130
1088struct nfs_page; 1131struct nfs_page;
@@ -1096,6 +1139,7 @@ struct nfs_read_data {
1096 struct rpc_cred *cred; 1139 struct rpc_cred *cred;
1097 struct nfs_fattr fattr; /* fattr storage */ 1140 struct nfs_fattr fattr; /* fattr storage */
1098 struct list_head pages; /* Coalesced read requests */ 1141 struct list_head pages; /* Coalesced read requests */
1142 struct list_head list; /* lists of struct nfs_read_data */
1099 struct nfs_page *req; /* multi ops per nfs_page */ 1143 struct nfs_page *req; /* multi ops per nfs_page */
1100 struct page **pagevec; 1144 struct page **pagevec;
1101 unsigned int npages; /* Max length of pagevec */ 1145 unsigned int npages; /* Max length of pagevec */
@@ -1119,6 +1163,7 @@ struct nfs_write_data {
1119 struct nfs_fattr fattr; 1163 struct nfs_fattr fattr;
1120 struct nfs_writeverf verf; 1164 struct nfs_writeverf verf;
1121 struct list_head pages; /* Coalesced requests we wish to flush */ 1165 struct list_head pages; /* Coalesced requests we wish to flush */
1166 struct list_head list; /* lists of struct nfs_write_data */
1122 struct nfs_page *req; /* multi ops per nfs_page */ 1167 struct nfs_page *req; /* multi ops per nfs_page */
1123 struct page **pagevec; 1168 struct page **pagevec;
1124 unsigned int npages; /* Max length of pagevec */ 1169 unsigned int npages; /* Max length of pagevec */
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index dba35e413371..7afc36334d52 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -66,6 +66,8 @@
66 * int num_online_nodes() Number of online Nodes 66 * int num_online_nodes() Number of online Nodes
67 * int num_possible_nodes() Number of all possible Nodes 67 * int num_possible_nodes() Number of all possible Nodes
68 * 68 *
69 * int node_random(mask) Random node with set bit in mask
70 *
69 * int node_online(node) Is some node online? 71 * int node_online(node) Is some node online?
70 * int node_possible(node) Is some node possible? 72 * int node_possible(node) Is some node possible?
71 * 73 *
@@ -430,6 +432,7 @@ static inline void node_set_offline(int nid)
430 node_clear_state(nid, N_ONLINE); 432 node_clear_state(nid, N_ONLINE);
431 nr_online_nodes = num_node_state(N_ONLINE); 433 nr_online_nodes = num_node_state(N_ONLINE);
432} 434}
435
433#else 436#else
434 437
435static inline int node_state(int node, enum node_states state) 438static inline int node_state(int node, enum node_states state)
@@ -460,6 +463,16 @@ static inline int num_node_state(enum node_states state)
460 463
461#define node_set_online(node) node_set_state((node), N_ONLINE) 464#define node_set_online(node) node_set_state((node), N_ONLINE)
462#define node_set_offline(node) node_clear_state((node), N_ONLINE) 465#define node_set_offline(node) node_clear_state((node), N_ONLINE)
466
467#endif
468
469#if defined(CONFIG_NUMA) && (MAX_NUMNODES > 1)
470extern int node_random(const nodemask_t *maskp);
471#else
472static inline int node_random(const nodemask_t *mask)
473{
474 return 0;
475}
463#endif 476#endif
464 477
465#define node_online_map node_states[N_ONLINE] 478#define node_online_map node_states[N_ONLINE]
diff --git a/include/linux/of.h b/include/linux/of.h
index bd716f8908de..9180dc5cb00b 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -196,12 +196,13 @@ extern struct property *of_find_property(const struct device_node *np,
196 const char *name, 196 const char *name,
197 int *lenp); 197 int *lenp);
198extern int of_property_read_u32_array(const struct device_node *np, 198extern int of_property_read_u32_array(const struct device_node *np,
199 char *propname, 199 const char *propname,
200 u32 *out_values, 200 u32 *out_values,
201 size_t sz); 201 size_t sz);
202 202
203extern int of_property_read_string(struct device_node *np, char *propname, 203extern int of_property_read_string(struct device_node *np,
204 const char **out_string); 204 const char *propname,
205 const char **out_string);
205extern int of_device_is_compatible(const struct device_node *device, 206extern int of_device_is_compatible(const struct device_node *device,
206 const char *); 207 const char *);
207extern int of_device_is_available(const struct device_node *device); 208extern int of_device_is_available(const struct device_node *device);
@@ -242,21 +243,30 @@ static inline bool of_have_populated_dt(void)
242} 243}
243 244
244static inline int of_property_read_u32_array(const struct device_node *np, 245static inline int of_property_read_u32_array(const struct device_node *np,
245 char *propname, u32 *out_values, size_t sz) 246 const char *propname,
247 u32 *out_values, size_t sz)
246{ 248{
247 return -ENOSYS; 249 return -ENOSYS;
248} 250}
249 251
250static inline int of_property_read_string(struct device_node *np, 252static inline int of_property_read_string(struct device_node *np,
251 char *propname, const char **out_string) 253 const char *propname,
254 const char **out_string)
252{ 255{
253 return -ENOSYS; 256 return -ENOSYS;
254} 257}
255 258
259static inline const void *of_get_property(const struct device_node *node,
260 const char *name,
261 int *lenp)
262{
263 return NULL;
264}
265
256#endif /* CONFIG_OF */ 266#endif /* CONFIG_OF */
257 267
258static inline int of_property_read_u32(const struct device_node *np, 268static inline int of_property_read_u32(const struct device_node *np,
259 char *propname, 269 const char *propname,
260 u32 *out_value) 270 u32 *out_value)
261{ 271{
262 return of_property_read_u32_array(np, propname, out_value, 1); 272 return of_property_read_u32_array(np, propname, out_value, 1);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index aec8025c786a..52280a2b5e63 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -57,6 +57,8 @@ extern int of_mm_gpiochip_add(struct device_node *np,
57extern void of_gpiochip_add(struct gpio_chip *gc); 57extern void of_gpiochip_add(struct gpio_chip *gc);
58extern void of_gpiochip_remove(struct gpio_chip *gc); 58extern void of_gpiochip_remove(struct gpio_chip *gc);
59extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); 59extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
60extern int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
61 const void *gpio_spec, u32 *flags);
60 62
61#else /* CONFIG_OF_GPIO */ 63#else /* CONFIG_OF_GPIO */
62 64
@@ -72,6 +74,13 @@ static inline unsigned int of_gpio_count(struct device_node *np)
72 return 0; 74 return 0;
73} 75}
74 76
77static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
78 struct device_node *np,
79 const void *gpio_spec, u32 *flags)
80{
81 return -ENOSYS;
82}
83
75static inline void of_gpiochip_add(struct gpio_chip *gc) { } 84static inline void of_gpiochip_add(struct gpio_chip *gc) { }
76static inline void of_gpiochip_remove(struct gpio_chip *gc) { } 85static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
77 86
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index e6955f5d1f08..cd2e61ce4e83 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -63,6 +63,9 @@ extern int of_irq_map_one(struct device_node *device, int index,
63extern unsigned int irq_create_of_mapping(struct device_node *controller, 63extern unsigned int irq_create_of_mapping(struct device_node *controller,
64 const u32 *intspec, 64 const u32 *intspec,
65 unsigned int intsize); 65 unsigned int intsize);
66#ifdef CONFIG_IRQ_DOMAIN
67extern void irq_dispose_mapping(unsigned int irq);
68#endif
66extern int of_irq_to_resource(struct device_node *dev, int index, 69extern int of_irq_to_resource(struct device_node *dev, int index,
67 struct resource *r); 70 struct resource *r);
68extern int of_irq_count(struct device_node *dev); 71extern int of_irq_count(struct device_node *dev);
@@ -70,6 +73,7 @@ extern int of_irq_to_resource_table(struct device_node *dev,
70 struct resource *res, int nr_irqs); 73 struct resource *res, int nr_irqs);
71extern struct device_node *of_irq_find_parent(struct device_node *child); 74extern struct device_node *of_irq_find_parent(struct device_node *child);
72 75
76
73#endif /* CONFIG_OF_IRQ */ 77#endif /* CONFIG_OF_IRQ */
74#endif /* CONFIG_OF */ 78#endif /* CONFIG_OF */
75#endif /* __OF_IRQ_H */ 79#endif /* __OF_IRQ_H */
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index e913081fb52a..f47464188710 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -9,6 +9,7 @@
9 9
10#ifdef CONFIG_OF_NET 10#ifdef CONFIG_OF_NET
11#include <linux/of.h> 11#include <linux/of.h>
12extern const int of_get_phy_mode(struct device_node *np);
12extern const void *of_get_mac_address(struct device_node *np); 13extern const void *of_get_mac_address(struct device_node *np);
13#endif 14#endif
14 15
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 7f5cfd3b37dd..49c8727eeb57 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/printk.h> 20#include <linux/printk.h>
21#include <asm/atomic.h> 21#include <linux/atomic.h>
22 22
23/* Each escaped entry is prefixed by ESCAPE_CODE 23/* Each escaped entry is prefixed by ESCAPE_CODE
24 * then one of the following codes, then the 24 * then one of the following codes, then the
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 3e5a1b189a41..e90a673be67e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -124,9 +124,6 @@ enum pageflags {
124 124
125 /* SLOB */ 125 /* SLOB */
126 PG_slob_free = PG_private, 126 PG_slob_free = PG_private,
127
128 /* SLUB */
129 PG_slub_frozen = PG_active,
130}; 127};
131 128
132#ifndef __GENERATING_BOUNDS_H 129#ifndef __GENERATING_BOUNDS_H
@@ -212,8 +209,6 @@ PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked)
212 209
213__PAGEFLAG(SlobFree, slob_free) 210__PAGEFLAG(SlobFree, slob_free)
214 211
215__PAGEFLAG(SlubFrozen, slub_frozen)
216
217/* 212/*
218 * Private page markings that may be used by the filesystem that owns the page 213 * Private page markings that may be used by the filesystem that owns the page
219 * for its own purposes. 214 * for its own purposes.
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4e4203a96312..8c230cbcbb48 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -49,7 +49,7 @@
49#include <linux/compiler.h> 49#include <linux/compiler.h>
50#include <linux/errno.h> 50#include <linux/errno.h>
51#include <linux/kobject.h> 51#include <linux/kobject.h>
52#include <asm/atomic.h> 52#include <linux/atomic.h>
53#include <linux/device.h> 53#include <linux/device.h>
54#include <linux/io.h> 54#include <linux/io.h>
55#include <linux/irqreturn.h> 55#include <linux/irqreturn.h>
@@ -251,7 +251,8 @@ struct pci_dev {
251 u8 revision; /* PCI revision, low byte of class word */ 251 u8 revision; /* PCI revision, low byte of class word */
252 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 252 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
253 u8 pcie_cap; /* PCI-E capability offset */ 253 u8 pcie_cap; /* PCI-E capability offset */
254 u8 pcie_type; /* PCI-E device/port type */ 254 u8 pcie_type:4; /* PCI-E device/port type */
255 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */
255 u8 rom_base_reg; /* which config register controls the ROM */ 256 u8 rom_base_reg; /* which config register controls the ROM */
256 u8 pin; /* which interrupt pin this device uses */ 257 u8 pin; /* which interrupt pin this device uses */
257 258
@@ -617,6 +618,16 @@ struct pci_driver {
617/* these external functions are only available when PCI support is enabled */ 618/* these external functions are only available when PCI support is enabled */
618#ifdef CONFIG_PCI 619#ifdef CONFIG_PCI
619 620
621extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
622
623enum pcie_bus_config_types {
624 PCIE_BUS_PERFORMANCE,
625 PCIE_BUS_SAFE,
626 PCIE_BUS_PEER2PEER,
627};
628
629extern enum pcie_bus_config_types pcie_bus_config;
630
620extern struct bus_type pci_bus_type; 631extern struct bus_type pci_bus_type;
621 632
622/* Do NOT directly access these two variables, unless you are arch specific pci 633/* Do NOT directly access these two variables, unless you are arch specific pci
@@ -796,10 +807,13 @@ int pcix_get_mmrbc(struct pci_dev *dev);
796int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 807int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
797int pcie_get_readrq(struct pci_dev *dev); 808int pcie_get_readrq(struct pci_dev *dev);
798int pcie_set_readrq(struct pci_dev *dev, int rq); 809int pcie_set_readrq(struct pci_dev *dev, int rq);
810int pcie_get_mps(struct pci_dev *dev);
811int pcie_set_mps(struct pci_dev *dev, int mps);
799int __pci_reset_function(struct pci_dev *dev); 812int __pci_reset_function(struct pci_dev *dev);
800int pci_reset_function(struct pci_dev *dev); 813int pci_reset_function(struct pci_dev *dev);
801void pci_update_resource(struct pci_dev *dev, int resno); 814void pci_update_resource(struct pci_dev *dev, int resno);
802int __must_check pci_assign_resource(struct pci_dev *dev, int i); 815int __must_check pci_assign_resource(struct pci_dev *dev, int i);
816int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align);
803int pci_select_bars(struct pci_dev *dev, unsigned long flags); 817int pci_select_bars(struct pci_dev *dev, unsigned long flags);
804 818
805/* ROM control related routines */ 819/* ROM control related routines */
@@ -843,8 +857,8 @@ void pci_enable_ido(struct pci_dev *dev, unsigned long type);
843void pci_disable_ido(struct pci_dev *dev, unsigned long type); 857void pci_disable_ido(struct pci_dev *dev, unsigned long type);
844 858
845enum pci_obff_signal_type { 859enum pci_obff_signal_type {
846 PCI_EXP_OBFF_SIGNAL_L0, 860 PCI_EXP_OBFF_SIGNAL_L0 = 0,
847 PCI_EXP_OBFF_SIGNAL_ALWAYS, 861 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
848}; 862};
849int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 863int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
850void pci_disable_obff(struct pci_dev *dev); 864void pci_disable_obff(struct pci_dev *dev);
@@ -879,7 +893,7 @@ void pdev_enable_device(struct pci_dev *);
879void pdev_sort_resources(struct pci_dev *, struct resource_list *); 893void pdev_sort_resources(struct pci_dev *, struct resource_list *);
880int pci_enable_resources(struct pci_dev *, int mask); 894int pci_enable_resources(struct pci_dev *, int mask);
881void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 895void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
882 int (*)(struct pci_dev *, u8, u8)); 896 int (*)(const struct pci_dev *, u8, u8));
883#define HAVE_PCI_REQ_REGIONS 2 897#define HAVE_PCI_REQ_REGIONS 2
884int __must_check pci_request_regions(struct pci_dev *, const char *); 898int __must_check pci_request_regions(struct pci_dev *, const char *);
885int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); 899int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b00c4ec5056e..ae96bbe54518 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2709,6 +2709,16 @@
2709#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 2709#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
2710#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 2710#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00
2711#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f 2711#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f
2712#define PCI_DEVICE_ID_INTEL_IOAT_SNB0 0x3c20
2713#define PCI_DEVICE_ID_INTEL_IOAT_SNB1 0x3c21
2714#define PCI_DEVICE_ID_INTEL_IOAT_SNB2 0x3c22
2715#define PCI_DEVICE_ID_INTEL_IOAT_SNB3 0x3c23
2716#define PCI_DEVICE_ID_INTEL_IOAT_SNB4 0x3c24
2717#define PCI_DEVICE_ID_INTEL_IOAT_SNB5 0x3c25
2718#define PCI_DEVICE_ID_INTEL_IOAT_SNB6 0x3c26
2719#define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27
2720#define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e
2721#define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f
2712#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2722#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2713#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2723#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2714#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2724#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 3f2711ccf910..c816075c01ce 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -509,7 +509,7 @@ struct perf_guest_info_callbacks {
509#include <linux/cpu.h> 509#include <linux/cpu.h>
510#include <linux/irq_work.h> 510#include <linux/irq_work.h>
511#include <linux/jump_label.h> 511#include <linux/jump_label.h>
512#include <asm/atomic.h> 512#include <linux/atomic.h>
513#include <asm/local.h> 513#include <asm/local.h>
514 514
515#define PERF_MAX_STACK_DEPTH 255 515#define PERF_MAX_STACK_DEPTH 255
@@ -944,8 +944,10 @@ extern void perf_pmu_unregister(struct pmu *pmu);
944 944
945extern int perf_num_counters(void); 945extern int perf_num_counters(void);
946extern const char *perf_pmu_name(void); 946extern const char *perf_pmu_name(void);
947extern void __perf_event_task_sched_in(struct task_struct *task); 947extern void __perf_event_task_sched_in(struct task_struct *prev,
948extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); 948 struct task_struct *task);
949extern void __perf_event_task_sched_out(struct task_struct *prev,
950 struct task_struct *next);
949extern int perf_event_init_task(struct task_struct *child); 951extern int perf_event_init_task(struct task_struct *child);
950extern void perf_event_exit_task(struct task_struct *child); 952extern void perf_event_exit_task(struct task_struct *child);
951extern void perf_event_free_task(struct task_struct *task); 953extern void perf_event_free_task(struct task_struct *task);
@@ -1059,17 +1061,20 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
1059 1061
1060extern struct jump_label_key perf_sched_events; 1062extern struct jump_label_key perf_sched_events;
1061 1063
1062static inline void perf_event_task_sched_in(struct task_struct *task) 1064static inline void perf_event_task_sched_in(struct task_struct *prev,
1065 struct task_struct *task)
1063{ 1066{
1064 if (static_branch(&perf_sched_events)) 1067 if (static_branch(&perf_sched_events))
1065 __perf_event_task_sched_in(task); 1068 __perf_event_task_sched_in(prev, task);
1066} 1069}
1067 1070
1068static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) 1071static inline void perf_event_task_sched_out(struct task_struct *prev,
1072 struct task_struct *next)
1069{ 1073{
1070 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); 1074 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
1071 1075
1072 __perf_event_task_sched_out(task, next); 1076 if (static_branch(&perf_sched_events))
1077 __perf_event_task_sched_out(prev, next);
1073} 1078}
1074 1079
1075extern void perf_event_mmap(struct vm_area_struct *vma); 1080extern void perf_event_mmap(struct vm_area_struct *vma);
@@ -1139,10 +1144,11 @@ extern void perf_event_disable(struct perf_event *event);
1139extern void perf_event_task_tick(void); 1144extern void perf_event_task_tick(void);
1140#else 1145#else
1141static inline void 1146static inline void
1142perf_event_task_sched_in(struct task_struct *task) { } 1147perf_event_task_sched_in(struct task_struct *prev,
1148 struct task_struct *task) { }
1143static inline void 1149static inline void
1144perf_event_task_sched_out(struct task_struct *task, 1150perf_event_task_sched_out(struct task_struct *prev,
1145 struct task_struct *next) { } 1151 struct task_struct *next) { }
1146static inline int perf_event_init_task(struct task_struct *child) { return 0; } 1152static inline int perf_event_init_task(struct task_struct *child) { return 0; }
1147static inline void perf_event_exit_task(struct task_struct *child) { } 1153static inline void perf_event_exit_task(struct task_struct *child) { }
1148static inline void perf_event_free_task(struct task_struct *task) { } 1154static inline void perf_event_free_task(struct task_struct *task) { }
diff --git a/include/linux/personality.h b/include/linux/personality.h
index eec3bae164d4..8fc7dd1a57ff 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -22,6 +22,7 @@ extern int __set_personality(unsigned int);
22 * These occupy the top three bytes. 22 * These occupy the top three bytes.
23 */ 23 */
24enum { 24enum {
25 UNAME26 = 0x0020000,
25 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */ 26 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
26 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors 27 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
27 * (signal handling) 28 * (signal handling)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 7da5fa845959..54fc4138955f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -26,7 +26,7 @@
26#include <linux/workqueue.h> 26#include <linux/workqueue.h>
27#include <linux/mod_devicetable.h> 27#include <linux/mod_devicetable.h>
28 28
29#include <asm/atomic.h> 29#include <linux/atomic.h>
30 30
31#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 31#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
32 SUPPORTED_10baseT_Full | \ 32 SUPPORTED_10baseT_Full | \
@@ -53,6 +53,7 @@
53 53
54/* Interface Mode definitions */ 54/* Interface Mode definitions */
55typedef enum { 55typedef enum {
56 PHY_INTERFACE_MODE_NA,
56 PHY_INTERFACE_MODE_MII, 57 PHY_INTERFACE_MODE_MII,
57 PHY_INTERFACE_MODE_GMII, 58 PHY_INTERFACE_MODE_GMII,
58 PHY_INTERFACE_MODE_SGMII, 59 PHY_INTERFACE_MODE_SGMII,
@@ -62,7 +63,8 @@ typedef enum {
62 PHY_INTERFACE_MODE_RGMII_ID, 63 PHY_INTERFACE_MODE_RGMII_ID,
63 PHY_INTERFACE_MODE_RGMII_RXID, 64 PHY_INTERFACE_MODE_RGMII_RXID,
64 PHY_INTERFACE_MODE_RGMII_TXID, 65 PHY_INTERFACE_MODE_RGMII_TXID,
65 PHY_INTERFACE_MODE_RTBI 66 PHY_INTERFACE_MODE_RTBI,
67 PHY_INTERFACE_MODE_SMII,
66} phy_interface_t; 68} phy_interface_t;
67 69
68 70
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
new file mode 100644
index 000000000000..abd286215279
--- /dev/null
+++ b/include/linux/platform_data/ntc_thermistor.h
@@ -0,0 +1,53 @@
1/*
2 * ntc_thermistor.h - NTC Thermistors
3 *
4 * Copyright (C) 2010 Samsung Electronics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _LINUX_NTC_H
22#define _LINUX_NTC_H
23
24enum ntc_thermistor_type {
25 TYPE_NCPXXWB473,
26 TYPE_NCPXXWL333,
27};
28
29struct ntc_thermistor_platform_data {
30 /*
31 * One (not both) of read_uV and read_ohm should be provided and only
32 * one of the two should be provided.
33 * Both functions should return negative value for an error case.
34 *
35 * pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use
36 * read_uV()
37 *
38 * How to setup pullup_ohm, pulldown_ohm, and connect is
39 * described at Documentation/hwmon/ntc
40 *
41 * pullup/down_ohm: 0 for infinite / not-connected
42 */
43 int (*read_uV)(void);
44 unsigned int pullup_uV;
45
46 unsigned int pullup_ohm;
47 unsigned int pulldown_ohm;
48 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
49
50 int (*read_ohm)(void);
51};
52
53#endif /* _LINUX_NTC_H */
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 21097cb086fe..f9ec1736a116 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -72,8 +72,6 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
72extern void pm_genpd_init(struct generic_pm_domain *genpd, 72extern void pm_genpd_init(struct generic_pm_domain *genpd,
73 struct dev_power_governor *gov, bool is_off); 73 struct dev_power_governor *gov, bool is_off);
74extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 74extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
75extern void pm_genpd_poweroff_unused(void);
76extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
77#else 75#else
78static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 76static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
79 struct device *dev) 77 struct device *dev)
@@ -101,8 +99,14 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
101{ 99{
102 return -ENOSYS; 100 return -ENOSYS;
103} 101}
104static inline void pm_genpd_poweroff_unused(void) {} 102#endif
103
104#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
105extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
106extern void pm_genpd_poweroff_unused(void);
107#else
105static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {} 108static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
109static inline void pm_genpd_poweroff_unused(void) {}
106#endif 110#endif
107 111
108#endif /* _LINUX_PM_DOMAIN_H */ 112#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pnfs_osd_xdr.h b/include/linux/pnfs_osd_xdr.h
index 76efbdd01622..435dd5fa7453 100644
--- a/include/linux/pnfs_osd_xdr.h
+++ b/include/linux/pnfs_osd_xdr.h
@@ -41,9 +41,6 @@
41 41
42#include <linux/nfs_fs.h> 42#include <linux/nfs_fs.h>
43#include <linux/nfs_page.h> 43#include <linux/nfs_page.h>
44#include <scsi/osd_protocol.h>
45
46#define PNFS_OSD_OSDNAME_MAXSIZE 256
47 44
48/* 45/*
49 * draft-ietf-nfsv4-minorversion-22 46 * draft-ietf-nfsv4-minorversion-22
@@ -99,12 +96,6 @@ struct pnfs_osd_objid {
99#define _DEVID_HI(oid_device_id) \ 96#define _DEVID_HI(oid_device_id) \
100 (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) 97 (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1)
101 98
102static inline int
103pnfs_osd_objid_xdr_sz(void)
104{
105 return (NFS4_DEVICEID4_SIZE / 4) + 2 + 2;
106}
107
108enum pnfs_osd_version { 99enum pnfs_osd_version {
109 PNFS_OSD_MISSING = 0, 100 PNFS_OSD_MISSING = 0,
110 PNFS_OSD_VERSION_1 = 1, 101 PNFS_OSD_VERSION_1 = 1,
@@ -189,8 +180,6 @@ struct pnfs_osd_targetid {
189 struct nfs4_string oti_scsi_device_id; 180 struct nfs4_string oti_scsi_device_id;
190}; 181};
191 182
192enum { PNFS_OSD_TARGETID_MAX = 1 + PNFS_OSD_OSDNAME_MAXSIZE / 4 };
193
194/* struct netaddr4 { 183/* struct netaddr4 {
195 * // see struct rpcb in RFC1833 184 * // see struct rpcb in RFC1833
196 * string r_netid<>; // network id 185 * string r_netid<>; // network id
@@ -207,12 +196,6 @@ struct pnfs_osd_targetaddr {
207 struct pnfs_osd_net_addr ota_netaddr; 196 struct pnfs_osd_net_addr ota_netaddr;
208}; 197};
209 198
210enum {
211 NETWORK_ID_MAX = 16 / 4,
212 UNIVERSAL_ADDRESS_MAX = 64 / 4,
213 PNFS_OSD_TARGETADDR_MAX = 3 + NETWORK_ID_MAX + UNIVERSAL_ADDRESS_MAX,
214};
215
216struct pnfs_osd_deviceaddr { 199struct pnfs_osd_deviceaddr {
217 struct pnfs_osd_targetid oda_targetid; 200 struct pnfs_osd_targetid oda_targetid;
218 struct pnfs_osd_targetaddr oda_targetaddr; 201 struct pnfs_osd_targetaddr oda_targetaddr;
@@ -222,15 +205,6 @@ struct pnfs_osd_deviceaddr {
222 struct nfs4_string oda_osdname; 205 struct nfs4_string oda_osdname;
223}; 206};
224 207
225enum {
226 ODA_OSDNAME_MAX = PNFS_OSD_OSDNAME_MAXSIZE / 4,
227 PNFS_OSD_DEVICEADDR_MAX =
228 PNFS_OSD_TARGETID_MAX + PNFS_OSD_TARGETADDR_MAX +
229 2 /*oda_lun*/ +
230 1 + OSD_SYSTEMID_LEN +
231 1 + ODA_OSDNAME_MAX,
232};
233
234/* LAYOUTCOMMIT: layoutupdate */ 208/* LAYOUTCOMMIT: layoutupdate */
235 209
236/* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { 210/* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) {
@@ -279,7 +253,7 @@ struct pnfs_osd_ioerr {
279 u32 oer_errno; 253 u32 oer_errno;
280}; 254};
281 255
282/* OSD XDR API */ 256/* OSD XDR Client API */
283/* Layout helpers */ 257/* Layout helpers */
284/* Layout decoding is done in two parts: 258/* Layout decoding is done in two parts:
285 * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part 259 * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part
@@ -337,8 +311,7 @@ extern int
337pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, 311pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr,
338 struct pnfs_osd_layoutupdate *lou); 312 struct pnfs_osd_layoutupdate *lou);
339 313
340/* osd_ioerror encoding/decoding (layout_return) */ 314/* osd_ioerror encoding (layout_return) */
341/* Client */
342extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); 315extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr);
343extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); 316extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr);
344 317
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 9a53b99818e2..b7681102a4b9 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -9,6 +9,7 @@
9#define __LINUX_POSIX_ACL_H 9#define __LINUX_POSIX_ACL_H
10 10
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/rcupdate.h>
12 13
13#define ACL_UNDEFINED_ID (-1) 14#define ACL_UNDEFINED_ID (-1)
14 15
@@ -38,7 +39,10 @@ struct posix_acl_entry {
38}; 39};
39 40
40struct posix_acl { 41struct posix_acl {
41 atomic_t a_refcount; 42 union {
43 atomic_t a_refcount;
44 struct rcu_head a_rcu;
45 };
42 unsigned int a_count; 46 unsigned int a_count;
43 struct posix_acl_entry a_entries[0]; 47 struct posix_acl_entry a_entries[0];
44}; 48};
@@ -65,7 +69,7 @@ static inline void
65posix_acl_release(struct posix_acl *acl) 69posix_acl_release(struct posix_acl *acl)
66{ 70{
67 if (acl && atomic_dec_and_test(&acl->a_refcount)) 71 if (acl && atomic_dec_and_test(&acl->a_refcount))
68 kfree(acl); 72 kfree_rcu(acl, a_rcu);
69} 73}
70 74
71 75
@@ -75,29 +79,31 @@ extern void posix_acl_init(struct posix_acl *, int);
75extern struct posix_acl *posix_acl_alloc(int, gfp_t); 79extern struct posix_acl *posix_acl_alloc(int, gfp_t);
76extern int posix_acl_valid(const struct posix_acl *); 80extern int posix_acl_valid(const struct posix_acl *);
77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 81extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
78extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); 82extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t);
79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 83extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *);
80extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *); 84extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
81extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t); 85extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t);
82 86
83extern struct posix_acl *get_posix_acl(struct inode *, int); 87extern struct posix_acl *get_posix_acl(struct inode *, int);
84extern int set_posix_acl(struct inode *, int, struct posix_acl *); 88extern int set_posix_acl(struct inode *, int, struct posix_acl *);
85 89
86#ifdef CONFIG_FS_POSIX_ACL 90#ifdef CONFIG_FS_POSIX_ACL
87static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) 91static inline struct posix_acl **acl_by_type(struct inode *inode, int type)
88{ 92{
89 struct posix_acl **p, *acl;
90 switch (type) { 93 switch (type) {
91 case ACL_TYPE_ACCESS: 94 case ACL_TYPE_ACCESS:
92 p = &inode->i_acl; 95 return &inode->i_acl;
93 break;
94 case ACL_TYPE_DEFAULT: 96 case ACL_TYPE_DEFAULT:
95 p = &inode->i_default_acl; 97 return &inode->i_default_acl;
96 break;
97 default: 98 default:
98 return ERR_PTR(-EINVAL); 99 BUG();
99 } 100 }
100 acl = ACCESS_ONCE(*p); 101}
102
103static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
104{
105 struct posix_acl **p = acl_by_type(inode, type);
106 struct posix_acl *acl = ACCESS_ONCE(*p);
101 if (acl) { 107 if (acl) {
102 spin_lock(&inode->i_lock); 108 spin_lock(&inode->i_lock);
103 acl = *p; 109 acl = *p;
@@ -108,41 +114,20 @@ static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
108 return acl; 114 return acl;
109} 115}
110 116
111static inline int negative_cached_acl(struct inode *inode, int type) 117static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type)
112{ 118{
113 struct posix_acl **p, *acl; 119 return rcu_dereference(*acl_by_type(inode, type));
114 switch (type) {
115 case ACL_TYPE_ACCESS:
116 p = &inode->i_acl;
117 break;
118 case ACL_TYPE_DEFAULT:
119 p = &inode->i_default_acl;
120 break;
121 default:
122 BUG();
123 }
124 acl = ACCESS_ONCE(*p);
125 if (acl)
126 return 0;
127 return 1;
128} 120}
129 121
130static inline void set_cached_acl(struct inode *inode, 122static inline void set_cached_acl(struct inode *inode,
131 int type, 123 int type,
132 struct posix_acl *acl) 124 struct posix_acl *acl)
133{ 125{
134 struct posix_acl *old = NULL; 126 struct posix_acl **p = acl_by_type(inode, type);
127 struct posix_acl *old;
135 spin_lock(&inode->i_lock); 128 spin_lock(&inode->i_lock);
136 switch (type) { 129 old = *p;
137 case ACL_TYPE_ACCESS: 130 rcu_assign_pointer(*p, posix_acl_dup(acl));
138 old = inode->i_acl;
139 inode->i_acl = posix_acl_dup(acl);
140 break;
141 case ACL_TYPE_DEFAULT:
142 old = inode->i_default_acl;
143 inode->i_default_acl = posix_acl_dup(acl);
144 break;
145 }
146 spin_unlock(&inode->i_lock); 131 spin_unlock(&inode->i_lock);
147 if (old != ACL_NOT_CACHED) 132 if (old != ACL_NOT_CACHED)
148 posix_acl_release(old); 133 posix_acl_release(old);
@@ -150,18 +135,11 @@ static inline void set_cached_acl(struct inode *inode,
150 135
151static inline void forget_cached_acl(struct inode *inode, int type) 136static inline void forget_cached_acl(struct inode *inode, int type)
152{ 137{
153 struct posix_acl *old = NULL; 138 struct posix_acl **p = acl_by_type(inode, type);
139 struct posix_acl *old;
154 spin_lock(&inode->i_lock); 140 spin_lock(&inode->i_lock);
155 switch (type) { 141 old = *p;
156 case ACL_TYPE_ACCESS: 142 *p = ACL_NOT_CACHED;
157 old = inode->i_acl;
158 inode->i_acl = ACL_NOT_CACHED;
159 break;
160 case ACL_TYPE_DEFAULT:
161 old = inode->i_default_acl;
162 inode->i_default_acl = ACL_NOT_CACHED;
163 break;
164 }
165 spin_unlock(&inode->i_lock); 143 spin_unlock(&inode->i_lock);
166 if (old != ACL_NOT_CACHED) 144 if (old != ACL_NOT_CACHED)
167 posix_acl_release(old); 145 posix_acl_release(old);
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/bq20z75.h
index b0843b68af92..1398eb004e83 100644
--- a/include/linux/power/bq20z75.h
+++ b/include/linux/power/bq20z75.h
@@ -29,11 +29,14 @@
29 * @battery_detect: GPIO which is used to detect battery presence 29 * @battery_detect: GPIO which is used to detect battery presence
30 * @battery_detect_present: gpio state when battery is present (0 / 1) 30 * @battery_detect_present: gpio state when battery is present (0 / 1)
31 * @i2c_retry_count: # of times to retry on i2c IO failure 31 * @i2c_retry_count: # of times to retry on i2c IO failure
32 * @poll_retry_count: # of times to retry looking for new status after
33 * external change notification
32 */ 34 */
33struct bq20z75_platform_data { 35struct bq20z75_platform_data {
34 int battery_detect; 36 int battery_detect;
35 int battery_detect_present; 37 int battery_detect_present;
36 int i2c_retry_count; 38 int i2c_retry_count;
39 int poll_retry_count;
37}; 40};
38 41
39#endif 42#endif
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h
index 7995deb8bfc1..fe99211fb2b8 100644
--- a/include/linux/power/max17042_battery.h
+++ b/include/linux/power/max17042_battery.h
@@ -23,8 +23,99 @@
23#ifndef __MAX17042_BATTERY_H_ 23#ifndef __MAX17042_BATTERY_H_
24#define __MAX17042_BATTERY_H_ 24#define __MAX17042_BATTERY_H_
25 25
26#define MAX17042_STATUS_BattAbsent (1 << 3)
27#define MAX17042_BATTERY_FULL (100)
28#define MAX17042_DEFAULT_SNS_RESISTOR (10000)
29
30enum max17042_register {
31 MAX17042_STATUS = 0x00,
32 MAX17042_VALRT_Th = 0x01,
33 MAX17042_TALRT_Th = 0x02,
34 MAX17042_SALRT_Th = 0x03,
35 MAX17042_AtRate = 0x04,
36 MAX17042_RepCap = 0x05,
37 MAX17042_RepSOC = 0x06,
38 MAX17042_Age = 0x07,
39 MAX17042_TEMP = 0x08,
40 MAX17042_VCELL = 0x09,
41 MAX17042_Current = 0x0A,
42 MAX17042_AvgCurrent = 0x0B,
43 MAX17042_Qresidual = 0x0C,
44 MAX17042_SOC = 0x0D,
45 MAX17042_AvSOC = 0x0E,
46 MAX17042_RemCap = 0x0F,
47 MAX17402_FullCAP = 0x10,
48 MAX17042_TTE = 0x11,
49 MAX17042_V_empty = 0x12,
50
51 MAX17042_RSLOW = 0x14,
52
53 MAX17042_AvgTA = 0x16,
54 MAX17042_Cycles = 0x17,
55 MAX17042_DesignCap = 0x18,
56 MAX17042_AvgVCELL = 0x19,
57 MAX17042_MinMaxTemp = 0x1A,
58 MAX17042_MinMaxVolt = 0x1B,
59 MAX17042_MinMaxCurr = 0x1C,
60 MAX17042_CONFIG = 0x1D,
61 MAX17042_ICHGTerm = 0x1E,
62 MAX17042_AvCap = 0x1F,
63 MAX17042_ManName = 0x20,
64 MAX17042_DevName = 0x21,
65 MAX17042_DevChem = 0x22,
66
67 MAX17042_TempNom = 0x24,
68 MAX17042_TempCold = 0x25,
69 MAX17042_TempHot = 0x26,
70 MAX17042_AIN = 0x27,
71 MAX17042_LearnCFG = 0x28,
72 MAX17042_SHFTCFG = 0x29,
73 MAX17042_RelaxCFG = 0x2A,
74 MAX17042_MiscCFG = 0x2B,
75 MAX17042_TGAIN = 0x2C,
76 MAx17042_TOFF = 0x2D,
77 MAX17042_CGAIN = 0x2E,
78 MAX17042_COFF = 0x2F,
79
80 MAX17042_Q_empty = 0x33,
81 MAX17042_T_empty = 0x34,
82
83 MAX17042_RCOMP0 = 0x38,
84 MAX17042_TempCo = 0x39,
85 MAX17042_Rx = 0x3A,
86 MAX17042_T_empty0 = 0x3B,
87 MAX17042_TaskPeriod = 0x3C,
88 MAX17042_FSTAT = 0x3D,
89
90 MAX17042_SHDNTIMER = 0x3F,
91
92 MAX17042_VFRemCap = 0x4A,
93
94 MAX17042_QH = 0x4D,
95 MAX17042_QL = 0x4E,
96};
97
98/*
99 * used for setting a register to a desired value
100 * addr : address for a register
101 * data : setting value for the register
102 */
103struct max17042_reg_data {
104 u8 addr;
105 u16 data;
106};
107
26struct max17042_platform_data { 108struct max17042_platform_data {
109 struct max17042_reg_data *init_data;
110 int num_init_data; /* Number of enties in init_data array */
27 bool enable_current_sense; 111 bool enable_current_sense;
112
113 /*
114 * R_sns in micro-ohms.
115 * default 10000 (if r_sns = 0) as it is the recommended value by
116 * the datasheet although it can be changed by board designers.
117 */
118 unsigned int r_sns;
28}; 119};
29 120
30#endif /* __MAX17042_BATTERY_H_ */ 121#endif /* __MAX17042_BATTERY_H_ */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index e7576cf9e32d..643b96c7a94f 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -5,7 +5,7 @@
5#include <linux/fs.h> 5#include <linux/fs.h>
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/magic.h> 7#include <linux/magic.h>
8#include <asm/atomic.h> 8#include <linux/atomic.h>
9 9
10struct net; 10struct net;
11struct completion; 11struct completion;
@@ -50,8 +50,6 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer,
50 50
51struct proc_dir_entry { 51struct proc_dir_entry {
52 unsigned int low_ino; 52 unsigned int low_ino;
53 unsigned int namelen;
54 const char *name;
55 mode_t mode; 53 mode_t mode;
56 nlink_t nlink; 54 nlink_t nlink;
57 uid_t uid; 55 uid_t uid;
@@ -73,9 +71,11 @@ struct proc_dir_entry {
73 write_proc_t *write_proc; 71 write_proc_t *write_proc;
74 atomic_t count; /* use count */ 72 atomic_t count; /* use count */
75 int pde_users; /* number of callers into module in progress */ 73 int pde_users; /* number of callers into module in progress */
76 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
77 struct completion *pde_unload_completion; 74 struct completion *pde_unload_completion;
78 struct list_head pde_openers; /* who did ->open, but not ->release */ 75 struct list_head pde_openers; /* who did ->open, but not ->release */
76 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
77 u8 namelen;
78 char name[];
79}; 79};
80 80
81enum kcore_type { 81enum kcore_type {
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 2455ef2683f0..cc03bbf5c4b8 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -38,9 +38,12 @@ struct pstore_info {
38 int (*open)(struct pstore_info *psi); 38 int (*open)(struct pstore_info *psi);
39 int (*close)(struct pstore_info *psi); 39 int (*close)(struct pstore_info *psi);
40 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 40 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
41 struct timespec *time); 41 struct timespec *time, struct pstore_info *psi);
42 u64 (*write)(enum pstore_type_id type, size_t size); 42 u64 (*write)(enum pstore_type_id type, unsigned int part,
43 int (*erase)(u64 id); 43 size_t size, struct pstore_info *psi);
44 int (*erase)(enum pstore_type_id type, u64 id,
45 struct pstore_info *psi);
46 void *data;
44}; 47};
45 48
46#ifdef CONFIG_PSTORE 49#ifdef CONFIG_PSTORE
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a3c9c3..63d2df43e61a 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
14 unsigned int pwm_period_ns; 14 unsigned int pwm_period_ns;
15 int (*init)(struct device *dev); 15 int (*init)(struct device *dev);
16 int (*notify)(struct device *dev, int brightness); 16 int (*notify)(struct device *dev, int brightness);
17 void (*notify_after)(struct device *dev, int brightness);
17 void (*exit)(struct device *dev); 18 void (*exit)(struct device *dev);
18 int (*check_fb)(struct device *dev, struct fb_info *info); 19 int (*check_fb)(struct device *dev, struct fb_info *info);
19}; 20};
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 9a85412e0db6..cb7855699037 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -180,7 +180,7 @@ enum {
180#include <linux/dqblk_v1.h> 180#include <linux/dqblk_v1.h>
181#include <linux/dqblk_v2.h> 181#include <linux/dqblk_v2.h>
182 182
183#include <asm/atomic.h> 183#include <linux/atomic.h>
184 184
185typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 185typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
186typedef long long qsize_t; /* Type in which we store sizes */ 186typedef long long qsize_t; /* Type in which we store sizes */
@@ -415,13 +415,5 @@ struct quota_module_name {
415 {QFMT_VFS_V0, "quota_v2"},\ 415 {QFMT_VFS_V0, "quota_v2"},\
416 {0, NULL}} 416 {0, NULL}}
417 417
418#else
419
420# /* nodep */ include <sys/cdefs.h>
421
422__BEGIN_DECLS
423long quotactl __P ((unsigned int, const char *, int, caddr_t));
424__END_DECLS
425
426#endif /* __KERNEL__ */ 418#endif /* __KERNEL__ */
427#endif /* _QUOTA_ */ 419#endif /* _QUOTA_ */
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 23241c2fecce..9d4539c52e53 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -39,7 +39,15 @@
39 * when it is shrunk, before we rcu free the node. See shrink code for 39 * when it is shrunk, before we rcu free the node. See shrink code for
40 * details. 40 * details.
41 */ 41 */
42#define RADIX_TREE_INDIRECT_PTR 1 42#define RADIX_TREE_INDIRECT_PTR 1
43/*
44 * A common use of the radix tree is to store pointers to struct pages;
45 * but shmem/tmpfs needs also to store swap entries in the same tree:
46 * those are marked as exceptional entries to distinguish them.
47 * EXCEPTIONAL_ENTRY tests the bit, EXCEPTIONAL_SHIFT shifts content past it.
48 */
49#define RADIX_TREE_EXCEPTIONAL_ENTRY 2
50#define RADIX_TREE_EXCEPTIONAL_SHIFT 2
43 51
44#define radix_tree_indirect_to_ptr(ptr) \ 52#define radix_tree_indirect_to_ptr(ptr) \
45 radix_tree_indirect_to_ptr((void __force *)(ptr)) 53 radix_tree_indirect_to_ptr((void __force *)(ptr))
@@ -174,6 +182,28 @@ static inline int radix_tree_deref_retry(void *arg)
174} 182}
175 183
176/** 184/**
185 * radix_tree_exceptional_entry - radix_tree_deref_slot gave exceptional entry?
186 * @arg: value returned by radix_tree_deref_slot
187 * Returns: 0 if well-aligned pointer, non-0 if exceptional entry.
188 */
189static inline int radix_tree_exceptional_entry(void *arg)
190{
191 /* Not unlikely because radix_tree_exception often tested first */
192 return (unsigned long)arg & RADIX_TREE_EXCEPTIONAL_ENTRY;
193}
194
195/**
196 * radix_tree_exception - radix_tree_deref_slot returned either exception?
197 * @arg: value returned by radix_tree_deref_slot
198 * Returns: 0 if well-aligned pointer, non-0 if either kind of exception.
199 */
200static inline int radix_tree_exception(void *arg)
201{
202 return unlikely((unsigned long)arg &
203 (RADIX_TREE_INDIRECT_PTR | RADIX_TREE_EXCEPTIONAL_ENTRY));
204}
205
206/**
177 * radix_tree_replace_slot - replace item in a slot 207 * radix_tree_replace_slot - replace item in a slot
178 * @pslot: pointer to slot, returned by radix_tree_lookup_slot 208 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
179 * @item: new item to store in the slot. 209 * @item: new item to store in the slot.
@@ -194,8 +224,8 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long);
194unsigned int 224unsigned int
195radix_tree_gang_lookup(struct radix_tree_root *root, void **results, 225radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
196 unsigned long first_index, unsigned int max_items); 226 unsigned long first_index, unsigned int max_items);
197unsigned int 227unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
198radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results, 228 void ***results, unsigned long *indices,
199 unsigned long first_index, unsigned int max_items); 229 unsigned long first_index, unsigned int max_items);
200unsigned long radix_tree_next_hole(struct radix_tree_root *root, 230unsigned long radix_tree_next_hole(struct radix_tree_root *root,
201 unsigned long index, unsigned long max_scan); 231 unsigned long index, unsigned long max_scan);
@@ -222,6 +252,7 @@ unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
222 unsigned long nr_to_tag, 252 unsigned long nr_to_tag,
223 unsigned int fromtag, unsigned int totag); 253 unsigned int fromtag, unsigned int totag);
224int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); 254int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
255unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);
225 256
226static inline void radix_tree_preload_end(void) 257static inline void radix_tree_preload_end(void)
227{ 258{
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 75cbf4f62fe8..9e65d9e20662 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -245,10 +245,16 @@ struct mdp_superblock_1 {
245 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 245 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
246 __u8 devflags; /* per-device flags. Only one defined...*/ 246 __u8 devflags; /* per-device flags. Only one defined...*/
247#define WriteMostly1 1 /* mask for writemostly flag in above */ 247#define WriteMostly1 1 /* mask for writemostly flag in above */
248 __u8 pad2[64-57]; /* set to 0 when writing */ 248 /* Bad block log. If there are any bad blocks the feature flag is set.
249 * If offset and size are non-zero, that space is reserved and available
250 */
251 __u8 bblog_shift; /* shift from sectors to block size */
252 __le16 bblog_size; /* number of sectors reserved for list */
253 __le32 bblog_offset; /* sector offset from superblock to bblog,
254 * signed - not unsigned */
249 255
250 /* array state information - 64 bytes */ 256 /* array state information - 64 bytes */
251 __le64 utime; /* 40 bits second, 24 btes microseconds */ 257 __le64 utime; /* 40 bits second, 24 bits microseconds */
252 __le64 events; /* incremented when superblock updated */ 258 __le64 events; /* incremented when superblock updated */
253 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ 259 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
254 __le32 sb_csum; /* checksum up to devs[max_dev] */ 260 __le32 sb_csum; /* checksum up to devs[max_dev] */
@@ -270,8 +276,8 @@ struct mdp_superblock_1 {
270 * must be honoured 276 * must be honoured
271 */ 277 */
272#define MD_FEATURE_RESHAPE_ACTIVE 4 278#define MD_FEATURE_RESHAPE_ACTIVE 4
279#define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */
273 280
274#define MD_FEATURE_ALL (1|2|4) 281#define MD_FEATURE_ALL (1|2|4|8)
275 282
276#endif 283#endif
277
diff --git a/include/linux/ramoops.h b/include/linux/ramoops.h
index 0ae68a2c1212..484fef81cd3a 100644
--- a/include/linux/ramoops.h
+++ b/include/linux/ramoops.h
@@ -10,6 +10,8 @@
10struct ramoops_platform_data { 10struct ramoops_platform_data {
11 unsigned long mem_size; 11 unsigned long mem_size;
12 unsigned long mem_address; 12 unsigned long mem_address;
13 unsigned long record_size;
14 int dump_oops;
13}; 15};
14 16
15#endif 17#endif
diff --git a/include/linux/random.h b/include/linux/random.h
index ce29a040c8dc..d13059f3ea32 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -57,18 +57,6 @@ extern void add_interrupt_randomness(int irq);
57extern void get_random_bytes(void *buf, int nbytes); 57extern void get_random_bytes(void *buf, int nbytes);
58void generate_random_uuid(unsigned char uuid_out[16]); 58void generate_random_uuid(unsigned char uuid_out[16]);
59 59
60extern __u32 secure_ip_id(__be32 daddr);
61extern __u32 secure_ipv6_id(const __be32 daddr[4]);
62extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
63extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
64 __be16 dport);
65extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
66 __be16 sport, __be16 dport);
67extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
68 __be16 sport, __be16 dport);
69extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
70 __be16 sport, __be16 dport);
71
72#ifndef MODULE 60#ifndef MODULE
73extern const struct file_operations random_fops, urandom_fops; 61extern const struct file_operations random_fops, urandom_fops;
74#endif 62#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 9e87c1cb7270..b47771aa5718 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -122,6 +122,9 @@ struct regulator;
122struct regulator_bulk_data { 122struct regulator_bulk_data {
123 const char *supply; 123 const char *supply;
124 struct regulator *consumer; 124 struct regulator *consumer;
125
126 /* private: Internal use */
127 int ret;
125}; 128};
126 129
127#if defined(CONFIG_REGULATOR) 130#if defined(CONFIG_REGULATOR)
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 6c433b89c80d..1a80bc77517d 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -188,18 +188,16 @@ struct regulator_dev {
188 188
189 /* lists we belong to */ 189 /* lists we belong to */
190 struct list_head list; /* list of all regulators */ 190 struct list_head list; /* list of all regulators */
191 struct list_head slist; /* list of supplied regulators */
192 191
193 /* lists we own */ 192 /* lists we own */
194 struct list_head consumer_list; /* consumers we supply */ 193 struct list_head consumer_list; /* consumers we supply */
195 struct list_head supply_list; /* regulators we supply */
196 194
197 struct blocking_notifier_head notifier; 195 struct blocking_notifier_head notifier;
198 struct mutex mutex; /* consumer lock */ 196 struct mutex mutex; /* consumer lock */
199 struct module *owner; 197 struct module *owner;
200 struct device dev; 198 struct device dev;
201 struct regulation_constraints *constraints; 199 struct regulation_constraints *constraints;
202 struct regulator_dev *supply; /* for tree */ 200 struct regulator *supply; /* for tree */
203 201
204 void *reg_data; /* regulator_dev data */ 202 void *reg_data; /* regulator_dev data */
205 203
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index 9026b30238f3..218168a2b5e9 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -36,12 +36,12 @@
36#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ 36#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
37#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ 37#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
38#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */ 38#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */
39#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ 39#define RIO_PEF_INB_MBOX 0x00f00000 /* [II, <= 1.2] Mailboxes */
40#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ 40#define RIO_PEF_INB_MBOX0 0x00800000 /* [II, <= 1.2] Mailbox 0 */
41#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ 41#define RIO_PEF_INB_MBOX1 0x00400000 /* [II, <= 1.2] Mailbox 1 */
42#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */ 42#define RIO_PEF_INB_MBOX2 0x00200000 /* [II, <= 1.2] Mailbox 2 */
43#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */ 43#define RIO_PEF_INB_MBOX3 0x00100000 /* [II, <= 1.2] Mailbox 3 */
44#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */ 44#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II, <= 1.2] Doorbells */
45#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */ 45#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */
46#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */ 46#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */
47#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */ 47#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
@@ -102,7 +102,7 @@
102#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */ 102#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */
103#define RIO_RT_MAX_DESTID 0x0000ffff 103#define RIO_RT_MAX_DESTID 0x0000ffff
104 104
105#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */ 105#define RIO_MBOX_CSR 0x40 /* [II, <= 1.2] Mailbox CSR */
106#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */ 106#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
107#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */ 107#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */
108#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */ 108#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */
@@ -128,8 +128,8 @@
128#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */ 128#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */
129#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */ 129#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */
130 130
131#define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */ 131#define RIO_WRITE_PORT_CSR 0x44 /* [I, <= 1.2] Write Port CSR */
132#define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */ 132#define RIO_DOORBELL_CSR 0x44 /* [II, <= 1.2] Doorbell CSR */
133#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */ 133#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */
134#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */ 134#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */
135#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */ 135#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index b27ebea25660..93f4d035076b 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -97,6 +97,9 @@ struct rtc_pll_info {
97#define RTC_AF 0x20 /* Alarm interrupt */ 97#define RTC_AF 0x20 /* Alarm interrupt */
98#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ 98#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
99 99
100
101#define RTC_MAX_FREQ 8192
102
100#ifdef __KERNEL__ 103#ifdef __KERNEL__
101 104
102#include <linux/types.h> 105#include <linux/types.h>
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 77950dfa0a9e..6a6741440cb7 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -15,7 +15,7 @@
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16 16
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19 19
20struct rw_semaphore; 20struct rw_semaphore;
21 21
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 20b03bf94748..4ac2c0578e0f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1767,6 +1767,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1767#define PF_DUMPCORE 0x00000200 /* dumped core */ 1767#define PF_DUMPCORE 0x00000200 /* dumped core */
1768#define PF_SIGNALED 0x00000400 /* killed by a signal */ 1768#define PF_SIGNALED 0x00000400 /* killed by a signal */
1769#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1769#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1770#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
1770#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1771#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1771#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ 1772#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1772#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1773#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
diff --git a/include/linux/sem.h b/include/linux/sem.h
index f2961afa2f66..1feb2de2ee57 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -77,7 +77,7 @@ struct seminfo {
77#define SEMUSZ 20 /* sizeof struct sem_undo */ 77#define SEMUSZ 20 /* sizeof struct sem_undo */
78 78
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h> 80#include <linux/atomic.h>
81#include <linux/rcupdate.h> 81#include <linux/rcupdate.h>
82#include <linux/cache.h> 82#include <linux/cache.h>
83 83
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index a2afc9fbe186..8bffe9ae2ca0 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -8,6 +8,8 @@
8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) 8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
9 */ 9 */
10 10
11#define SCIx_NOT_SUPPORTED (-1)
12
11enum { 13enum {
12 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ 14 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
13 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ 15 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
@@ -25,6 +27,28 @@ enum {
25#define SCSCR_CKE1 (1 << 1) 27#define SCSCR_CKE1 (1 << 1)
26#define SCSCR_CKE0 (1 << 0) 28#define SCSCR_CKE0 (1 << 0)
27 29
30/* SCxSR SCI */
31#define SCI_TDRE 0x80
32#define SCI_RDRF 0x40
33#define SCI_ORER 0x20
34#define SCI_FER 0x10
35#define SCI_PER 0x08
36#define SCI_TEND 0x04
37
38#define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER)
39
40/* SCxSR SCIF */
41#define SCIF_ER 0x0080
42#define SCIF_TEND 0x0040
43#define SCIF_TDFE 0x0020
44#define SCIF_BRK 0x0010
45#define SCIF_FER 0x0008
46#define SCIF_PER 0x0004
47#define SCIF_RDF 0x0002
48#define SCIF_DR 0x0001
49
50#define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
51
28/* Offsets into the sci_port->irqs array */ 52/* Offsets into the sci_port->irqs array */
29enum { 53enum {
30 SCIx_ERI_IRQ, 54 SCIx_ERI_IRQ,
@@ -32,6 +56,24 @@ enum {
32 SCIx_TXI_IRQ, 56 SCIx_TXI_IRQ,
33 SCIx_BRI_IRQ, 57 SCIx_BRI_IRQ,
34 SCIx_NR_IRQS, 58 SCIx_NR_IRQS,
59
60 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
61};
62
63enum {
64 SCIx_PROBE_REGTYPE,
65
66 SCIx_SCI_REGTYPE,
67 SCIx_IRDA_REGTYPE,
68 SCIx_SCIFA_REGTYPE,
69 SCIx_SCIFB_REGTYPE,
70 SCIx_SH3_SCIF_REGTYPE,
71 SCIx_SH4_SCIF_REGTYPE,
72 SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
73 SCIx_SH4_SCIF_FIFODATA_REGTYPE,
74 SCIx_SH7705_SCIF_REGTYPE,
75
76 SCIx_NR_REGTYPES,
35}; 77};
36 78
37#define SCIx_IRQ_MUXED(irq) \ 79#define SCIx_IRQ_MUXED(irq) \
@@ -42,8 +84,29 @@ enum {
42 [SCIx_BRI_IRQ] = (irq), \ 84 [SCIx_BRI_IRQ] = (irq), \
43} 85}
44 86
87#define SCIx_IRQ_IS_MUXED(port) \
88 ((port)->cfg->irqs[SCIx_ERI_IRQ] == \
89 (port)->cfg->irqs[SCIx_RXI_IRQ]) || \
90 ((port)->cfg->irqs[SCIx_ERI_IRQ] && \
91 !(port)->cfg->irqs[SCIx_RXI_IRQ])
92/*
93 * SCI register subset common for all port types.
94 * Not all registers will exist on all parts.
95 */
96enum {
97 SCSMR, SCBRR, SCSCR, SCxSR,
98 SCFCR, SCFDR, SCxTDR, SCxRDR,
99 SCLSR, SCTFDR, SCRFDR, SCSPTR,
100
101 SCIx_NR_REGS,
102};
103
45struct device; 104struct device;
46 105
106struct plat_sci_port_ops {
107 void (*init_pins)(struct uart_port *, unsigned int cflag);
108};
109
47/* 110/*
48 * Platform device specific platform_data struct 111 * Platform device specific platform_data struct
49 */ 112 */
@@ -56,6 +119,18 @@ struct plat_sci_port {
56 unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 119 unsigned int scbrr_algo_id; /* SCBRR calculation algo */
57 unsigned int scscr; /* SCSCR initialization */ 120 unsigned int scscr; /* SCSCR initialization */
58 121
122 /*
123 * Platform overrides if necessary, defaults otherwise.
124 */
125 int overrun_bit;
126 unsigned int error_mask;
127
128 int port_reg;
129 unsigned char regshift;
130 unsigned char regtype;
131
132 struct plat_sci_port_ops *ops;
133
59 struct device *dma_dev; 134 struct device *dma_dev;
60 135
61 unsigned int dma_slave_tx; 136 unsigned int dma_slave_tx;
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 9a52f72527dc..3ccf18648d0a 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -147,4 +147,8 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
147int sh_clk_div6_register(struct clk *clks, int nr); 147int sh_clk_div6_register(struct clk *clks, int nr);
148int sh_clk_div6_reparent_register(struct clk *clks, int nr); 148int sh_clk_div6_reparent_register(struct clk *clks, int nr);
149 149
150#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
151#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
152#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
153
150#endif /* __SH_CLOCK_H */ 154#endif /* __SH_CLOCK_H */
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index b08cd4efa15c..cb2dd118cc0f 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -62,6 +62,12 @@ struct sh_dmae_pdata {
62 const unsigned int *ts_shift; 62 const unsigned int *ts_shift;
63 int ts_shift_num; 63 int ts_shift_num;
64 u16 dmaor_init; 64 u16 dmaor_init;
65 unsigned int chcr_offset;
66 u32 chcr_ie_bit;
67
68 unsigned int dmaor_is_32bit:1;
69 unsigned int needs_tend_set:1;
70 unsigned int no_dmars:1;
65}; 71};
66 72
67/* DMA register */ 73/* DMA register */
@@ -71,6 +77,8 @@ struct sh_dmae_pdata {
71#define CHCR 0x0C 77#define CHCR 0x0C
72#define DMAOR 0x40 78#define DMAOR 0x40
73 79
80#define TEND 0x18 /* USB-DMAC */
81
74/* DMAOR definitions */ 82/* DMAOR definitions */
75#define DMAOR_AE 0x00000004 83#define DMAOR_AE 0x00000004
76#define DMAOR_NMIF 0x00000002 84#define DMAOR_NMIF 0x00000002
diff --git a/include/linux/shm.h b/include/linux/shm.h
index eca6235a46c0..92808b86703b 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -95,6 +95,9 @@ struct shmid_kernel /* private to the kernel */
95 pid_t shm_cprid; 95 pid_t shm_cprid;
96 pid_t shm_lprid; 96 pid_t shm_lprid;
97 struct user_struct *mlock_user; 97 struct user_struct *mlock_user;
98
99 /* The task created the shm object. NULL if the task is dead. */
100 struct task_struct *shm_creator;
98}; 101};
99 102
100/* shm_mode upper byte flags */ 103/* shm_mode upper byte flags */
@@ -106,6 +109,7 @@ struct shmid_kernel /* private to the kernel */
106#ifdef CONFIG_SYSVIPC 109#ifdef CONFIG_SYSVIPC
107long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); 110long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
108extern int is_file_shm_hugepages(struct file *file); 111extern int is_file_shm_hugepages(struct file *file);
112extern void exit_shm(struct task_struct *task);
109#else 113#else
110static inline long do_shmat(int shmid, char __user *shmaddr, 114static inline long do_shmat(int shmid, char __user *shmaddr,
111 int shmflg, unsigned long *addr) 115 int shmflg, unsigned long *addr)
@@ -116,6 +120,9 @@ static inline int is_file_shm_hugepages(struct file *file)
116{ 120{
117 return 0; 121 return 0;
118} 122}
123static inline void exit_shm(struct task_struct *task)
124{
125}
119#endif 126#endif
120 127
121#endif /* __KERNEL__ */ 128#endif /* __KERNEL__ */
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index aa08fa8fd79b..9291ac3cc627 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -8,22 +8,15 @@
8 8
9/* inode in-kernel data */ 9/* inode in-kernel data */
10 10
11#define SHMEM_NR_DIRECT 16
12
13#define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t))
14
15struct shmem_inode_info { 11struct shmem_inode_info {
16 spinlock_t lock; 12 spinlock_t lock;
17 unsigned long flags; 13 unsigned long flags;
18 unsigned long alloced; /* data pages alloced to file */ 14 unsigned long alloced; /* data pages alloced to file */
19 unsigned long swapped; /* subtotal assigned to swap */
20 unsigned long next_index; /* highest alloced index + 1 */
21 struct shared_policy policy; /* NUMA memory alloc policy */
22 struct page *i_indirect; /* top indirect blocks page */
23 union { 15 union {
24 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ 16 unsigned long swapped; /* subtotal assigned to swap */
25 char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; 17 char *symlink; /* unswappable short symlink */
26 }; 18 };
19 struct shared_policy policy; /* NUMA memory alloc policy */
27 struct list_head swaplist; /* chain of maybes on swap */ 20 struct list_head swaplist; /* chain of maybes on swap */
28 struct list_head xattr_list; /* list of shmem_xattr */ 21 struct list_head xattr_list; /* list of shmem_xattr */
29 struct inode vfs_inode; 22 struct inode vfs_inode;
@@ -49,7 +42,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
49/* 42/*
50 * Functions in mm/shmem.c called directly from elsewhere: 43 * Functions in mm/shmem.c called directly from elsewhere:
51 */ 44 */
52extern int init_tmpfs(void); 45extern int shmem_init(void);
53extern int shmem_fill_super(struct super_block *sb, void *data, int silent); 46extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
54extern struct file *shmem_file_setup(const char *name, 47extern struct file *shmem_file_setup(const char *name,
55 loff_t size, unsigned long flags); 48 loff_t size, unsigned long flags);
@@ -59,8 +52,6 @@ extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
59 pgoff_t index, gfp_t gfp_mask); 52 pgoff_t index, gfp_t gfp_mask);
60extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); 53extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
61extern int shmem_unuse(swp_entry_t entry, struct page *page); 54extern int shmem_unuse(swp_entry_t entry, struct page *page);
62extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
63 struct page **pagep, swp_entry_t *ent);
64 55
65static inline struct page *shmem_read_mapping_page( 56static inline struct page *shmem_read_mapping_page(
66 struct address_space *mapping, pgoff_t index) 57 struct address_space *mapping, pgoff_t index)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a24218c9c84b..7b996ed86d5b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -20,7 +20,7 @@
20#include <linux/time.h> 20#include <linux/time.h>
21#include <linux/cache.h> 21#include <linux/cache.h>
22 22
23#include <asm/atomic.h> 23#include <linux/atomic.h>
24#include <asm/types.h> 24#include <asm/types.h>
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/net.h> 26#include <linux/net.h>
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 4b35c06dfbc5..f58d6413d230 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -24,6 +24,7 @@ enum stat_item {
24 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ 24 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */
25 ALLOC_SLAB, /* Cpu slab acquired from page allocator */ 25 ALLOC_SLAB, /* Cpu slab acquired from page allocator */
26 ALLOC_REFILL, /* Refill cpu slab from slab freelist */ 26 ALLOC_REFILL, /* Refill cpu slab from slab freelist */
27 ALLOC_NODE_MISMATCH, /* Switching cpu slab */
27 FREE_SLAB, /* Slab freed to the page allocator */ 28 FREE_SLAB, /* Slab freed to the page allocator */
28 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ 29 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */
29 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ 30 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */
@@ -31,8 +32,10 @@ enum stat_item {
31 DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ 32 DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */
32 DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ 33 DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */
33 DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ 34 DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
35 DEACTIVATE_BYPASS, /* Implicit deactivation */
34 ORDER_FALLBACK, /* Number of times fallback was necessary */ 36 ORDER_FALLBACK, /* Number of times fallback was necessary */
35 CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */ 37 CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
38 CMPXCHG_DOUBLE_FAIL, /* Number of times that cmpxchg double did not match */
36 NR_SLUB_STAT_ITEMS }; 39 NR_SLUB_STAT_ITEMS };
37 40
38struct kmem_cache_cpu { 41struct kmem_cache_cpu {
diff --git a/include/linux/socket.h b/include/linux/socket.h
index e17f82266639..d0e77f607a79 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -8,8 +8,10 @@
8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) 8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
9 /* Implementation specific desired alignment */ 9 /* Implementation specific desired alignment */
10 10
11typedef unsigned short __kernel_sa_family_t;
12
11struct __kernel_sockaddr_storage { 13struct __kernel_sockaddr_storage {
12 unsigned short ss_family; /* address family */ 14 __kernel_sa_family_t ss_family; /* address family */
13 /* Following field(s) are implementation specific */ 15 /* Following field(s) are implementation specific */
14 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; 16 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
15 /* space to achieve desired size, */ 17 /* space to achieve desired size, */
@@ -35,7 +37,7 @@ struct seq_file;
35extern void socket_seq_show(struct seq_file *seq); 37extern void socket_seq_show(struct seq_file *seq);
36#endif 38#endif
37 39
38typedef unsigned short sa_family_t; 40typedef __kernel_sa_family_t sa_family_t;
39 41
40/* 42/*
41 * 1003.1g requires sa_family_t and that sa_data is char. 43 * 1003.1g requires sa_family_t and that sa_data is char.
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
index 67ad11fcf88b..de8832dd272b 100644
--- a/include/linux/sonet.h
+++ b/include/linux/sonet.h
@@ -58,7 +58,7 @@ struct sonet_stats {
58 58
59#ifdef __KERNEL__ 59#ifdef __KERNEL__
60 60
61#include <asm/atomic.h> 61#include <linux/atomic.h>
62 62
63struct k_sonet_stats { 63struct k_sonet_stats {
64#define __HANDLE_ITEM(i) atomic_t i 64#define __HANDLE_ITEM(i) atomic_t i
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 0b22d51258e6..7df6c17b0281 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -384,7 +384,7 @@ static inline void assert_spin_locked(spinlock_t *lock)
384 * Pull the atomic_t declaration: 384 * Pull the atomic_t declaration:
385 * (asm-mips/atomic.h needs above definitions) 385 * (asm-mips/atomic.h needs above definitions)
386 */ 386 */
387#include <asm/atomic.h> 387#include <linux/atomic.h>
388/** 388/**
389 * atomic_dec_and_lock - lock on reaching reference count zero 389 * atomic_dec_and_lock - lock on reaching reference count zero
390 * @atomic: the atomic counter 390 * @atomic: the atomic counter
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 8521067ed4f7..febc4dbec2ca 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -15,7 +15,7 @@
15#include <linux/sunrpc/msg_prot.h> 15#include <linux/sunrpc/msg_prot.h>
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19#include <linux/rcupdate.h> 19#include <linux/rcupdate.h>
20 20
21/* size of the nodename buffer */ 21/* size of the nodename buffer */
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 082884295f80..f7f3ce340c08 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31#include <linux/sunrpc/xprt.h> 31#include <linux/sunrpc/xprt.h>
32#include <linux/sunrpc/sched.h> 32#include <linux/sunrpc/sched.h>
33 33
34#ifdef CONFIG_NFS_V4_1 34#ifdef CONFIG_SUNRPC_BACKCHANNEL
35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); 35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
36void xprt_free_bc_request(struct rpc_rqst *req); 36void xprt_free_bc_request(struct rpc_rqst *req);
37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); 37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
@@ -47,7 +47,7 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
47 return 1; 47 return 1;
48 return 0; 48 return 0;
49} 49}
50#else /* CONFIG_NFS_V4_1 */ 50#else /* CONFIG_SUNRPC_BACKCHANNEL */
51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, 51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
52 unsigned int min_reqs) 52 unsigned int min_reqs)
53{ 53{
@@ -62,6 +62,6 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
62static inline void xprt_free_bc_request(struct rpc_rqst *req) 62static inline void xprt_free_bc_request(struct rpc_rqst *req)
63{ 63{
64} 64}
65#endif /* CONFIG_NFS_V4_1 */ 65#endif /* CONFIG_SUNRPC_BACKCHANNEL */
66#endif /* _LINUX_SUNRPC_BC_XPRT_H */ 66#endif /* _LINUX_SUNRPC_BC_XPRT_H */
67 67
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index d1c79a906397..5efd8cef389e 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -15,7 +15,7 @@
15 15
16#include <linux/kref.h> 16#include <linux/kref.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19#include <linux/proc_fs.h> 19#include <linux/proc_fs.h>
20 20
21/* 21/*
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index fe2d8e6b923b..e7756896f3ca 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -227,6 +227,10 @@ void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
227void rpc_destroy_wait_queue(struct rpc_wait_queue *); 227void rpc_destroy_wait_queue(struct rpc_wait_queue *);
228void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, 228void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
229 rpc_action action); 229 rpc_action action);
230void rpc_sleep_on_priority(struct rpc_wait_queue *,
231 struct rpc_task *,
232 rpc_action action,
233 int priority);
230void rpc_wake_up_queued_task(struct rpc_wait_queue *, 234void rpc_wake_up_queued_task(struct rpc_wait_queue *,
231 struct rpc_task *); 235 struct rpc_task *);
232void rpc_wake_up(struct rpc_wait_queue *); 236void rpc_wake_up(struct rpc_wait_queue *);
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 2f1e5186e049..223588a976a0 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -92,7 +92,7 @@ struct svc_serv {
92 struct module * sv_module; /* optional module to count when 92 struct module * sv_module; /* optional module to count when
93 * adding threads */ 93 * adding threads */
94 svc_thread_fn sv_function; /* main function for threads */ 94 svc_thread_fn sv_function; /* main function for threads */
95#if defined(CONFIG_NFS_V4_1) 95#if defined(CONFIG_SUNRPC_BACKCHANNEL)
96 struct list_head sv_cb_list; /* queue for callback requests 96 struct list_head sv_cb_list; /* queue for callback requests
97 * that arrive over the same 97 * that arrive over the same
98 * connection */ 98 * connection */
@@ -100,7 +100,7 @@ struct svc_serv {
100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no 100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
101 * entries in the svc_cb_list */ 101 * entries in the svc_cb_list */
102 struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ 102 struct svc_xprt *sv_bc_xprt; /* callback on fore channel */
103#endif /* CONFIG_NFS_V4_1 */ 103#endif /* CONFIG_SUNRPC_BACKCHANNEL */
104}; 104};
105 105
106/* 106/*
diff --git a/include/linux/sunrpc/timer.h b/include/linux/sunrpc/timer.h
index a67fd734c73b..697d6e69d61f 100644
--- a/include/linux/sunrpc/timer.h
+++ b/include/linux/sunrpc/timer.h
@@ -9,7 +9,7 @@
9#ifndef _LINUX_SUNRPC_TIMER_H 9#ifndef _LINUX_SUNRPC_TIMER_H
10#define _LINUX_SUNRPC_TIMER_H 10#define _LINUX_SUNRPC_TIMER_H
11 11
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13 13
14struct rpc_rtt { 14struct rpc_rtt {
15 unsigned long timeo; /* default timeout value */ 15 unsigned long timeo; /* default timeout value */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 81cce3b3ee66..15518a152ac3 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -22,6 +22,7 @@
22#define RPC_MIN_SLOT_TABLE (2U) 22#define RPC_MIN_SLOT_TABLE (2U)
23#define RPC_DEF_SLOT_TABLE (16U) 23#define RPC_DEF_SLOT_TABLE (16U)
24#define RPC_MAX_SLOT_TABLE (128U) 24#define RPC_MAX_SLOT_TABLE (128U)
25#define RPC_MAX_SLOT_TABLE_LIMIT (65536U)
25 26
26/* 27/*
27 * This describes a timeout strategy 28 * This describes a timeout strategy
@@ -100,18 +101,18 @@ struct rpc_rqst {
100 ktime_t rq_xtime; /* transmit time stamp */ 101 ktime_t rq_xtime; /* transmit time stamp */
101 int rq_ntrans; 102 int rq_ntrans;
102 103
103#if defined(CONFIG_NFS_V4_1) 104#if defined(CONFIG_SUNRPC_BACKCHANNEL)
104 struct list_head rq_bc_list; /* Callback service list */ 105 struct list_head rq_bc_list; /* Callback service list */
105 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ 106 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */
106 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ 107 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */
107#endif /* CONFIG_NFS_V4_1 */ 108#endif /* CONFIG_SUNRPC_BACKCHANEL */
108}; 109};
109#define rq_svec rq_snd_buf.head 110#define rq_svec rq_snd_buf.head
110#define rq_slen rq_snd_buf.len 111#define rq_slen rq_snd_buf.len
111 112
112struct rpc_xprt_ops { 113struct rpc_xprt_ops {
113 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 114 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
114 int (*reserve_xprt)(struct rpc_task *task); 115 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
115 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 116 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
116 void (*rpcbind)(struct rpc_task *task); 117 void (*rpcbind)(struct rpc_task *task);
117 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 118 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
@@ -164,12 +165,12 @@ struct rpc_xprt {
164 165
165 struct rpc_wait_queue binding; /* requests waiting on rpcbind */ 166 struct rpc_wait_queue binding; /* requests waiting on rpcbind */
166 struct rpc_wait_queue sending; /* requests waiting to send */ 167 struct rpc_wait_queue sending; /* requests waiting to send */
167 struct rpc_wait_queue resend; /* requests waiting to resend */
168 struct rpc_wait_queue pending; /* requests in flight */ 168 struct rpc_wait_queue pending; /* requests in flight */
169 struct rpc_wait_queue backlog; /* waiting for slot */ 169 struct rpc_wait_queue backlog; /* waiting for slot */
170 struct list_head free; /* free slots */ 170 struct list_head free; /* free slots */
171 struct rpc_rqst * slot; /* slot table storage */ 171 unsigned int max_reqs; /* max number of slots */
172 unsigned int max_reqs; /* total slots */ 172 unsigned int min_reqs; /* min number of slots */
173 atomic_t num_reqs; /* total slots */
173 unsigned long state; /* transport state */ 174 unsigned long state; /* transport state */
174 unsigned char shutdown : 1, /* being shut down */ 175 unsigned char shutdown : 1, /* being shut down */
175 resvport : 1; /* use a reserved port */ 176 resvport : 1; /* use a reserved port */
@@ -200,7 +201,7 @@ struct rpc_xprt {
200 u32 xid; /* Next XID value to use */ 201 u32 xid; /* Next XID value to use */
201 struct rpc_task * snd_task; /* Task blocked in send */ 202 struct rpc_task * snd_task; /* Task blocked in send */
202 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ 203 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
203#if defined(CONFIG_NFS_V4_1) 204#if defined(CONFIG_SUNRPC_BACKCHANNEL)
204 struct svc_serv *bc_serv; /* The RPC service which will */ 205 struct svc_serv *bc_serv; /* The RPC service which will */
205 /* process the callback */ 206 /* process the callback */
206 unsigned int bc_alloc_count; /* Total number of preallocs */ 207 unsigned int bc_alloc_count; /* Total number of preallocs */
@@ -208,7 +209,7 @@ struct rpc_xprt {
208 * items */ 209 * items */
209 struct list_head bc_pa_list; /* List of preallocated 210 struct list_head bc_pa_list; /* List of preallocated
210 * backchannel rpc_rqst's */ 211 * backchannel rpc_rqst's */
211#endif /* CONFIG_NFS_V4_1 */ 212#endif /* CONFIG_SUNRPC_BACKCHANNEL */
212 struct list_head recv; 213 struct list_head recv;
213 214
214 struct { 215 struct {
@@ -228,15 +229,15 @@ struct rpc_xprt {
228 const char *address_strings[RPC_DISPLAY_MAX]; 229 const char *address_strings[RPC_DISPLAY_MAX];
229}; 230};
230 231
231#if defined(CONFIG_NFS_V4_1) 232#if defined(CONFIG_SUNRPC_BACKCHANNEL)
232/* 233/*
233 * Backchannel flags 234 * Backchannel flags
234 */ 235 */
235#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ 236#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */
236 /* buffer in use */ 237 /* buffer in use */
237#endif /* CONFIG_NFS_V4_1 */ 238#endif /* CONFIG_SUNRPC_BACKCHANNEL */
238 239
239#if defined(CONFIG_NFS_V4_1) 240#if defined(CONFIG_SUNRPC_BACKCHANNEL)
240static inline int bc_prealloc(struct rpc_rqst *req) 241static inline int bc_prealloc(struct rpc_rqst *req)
241{ 242{
242 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); 243 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
@@ -246,7 +247,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
246{ 247{
247 return 0; 248 return 0;
248} 249}
249#endif /* CONFIG_NFS_V4_1 */ 250#endif /* CONFIG_SUNRPC_BACKCHANNEL */
250 251
251struct xprt_create { 252struct xprt_create {
252 int ident; /* XPRT_TRANSPORT identifier */ 253 int ident; /* XPRT_TRANSPORT identifier */
@@ -271,8 +272,8 @@ struct xprt_class {
271struct rpc_xprt *xprt_create_transport(struct xprt_create *args); 272struct rpc_xprt *xprt_create_transport(struct xprt_create *args);
272void xprt_connect(struct rpc_task *task); 273void xprt_connect(struct rpc_task *task);
273void xprt_reserve(struct rpc_task *task); 274void xprt_reserve(struct rpc_task *task);
274int xprt_reserve_xprt(struct rpc_task *task); 275int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
275int xprt_reserve_xprt_cong(struct rpc_task *task); 276int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
276int xprt_prepare_transmit(struct rpc_task *task); 277int xprt_prepare_transmit(struct rpc_task *task);
277void xprt_transmit(struct rpc_task *task); 278void xprt_transmit(struct rpc_task *task);
278void xprt_end_transmit(struct rpc_task *task); 279void xprt_end_transmit(struct rpc_task *task);
@@ -282,7 +283,9 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
282void xprt_release(struct rpc_task *task); 283void xprt_release(struct rpc_task *task);
283struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); 284struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
284void xprt_put(struct rpc_xprt *xprt); 285void xprt_put(struct rpc_xprt *xprt);
285struct rpc_xprt * xprt_alloc(struct net *net, int size, int max_req); 286struct rpc_xprt * xprt_alloc(struct net *net, size_t size,
287 unsigned int num_prealloc,
288 unsigned int max_req);
286void xprt_free(struct rpc_xprt *); 289void xprt_free(struct rpc_xprt *);
287 290
288static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) 291static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
@@ -321,7 +324,6 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie);
321#define XPRT_CLOSING (6) 324#define XPRT_CLOSING (6)
322#define XPRT_CONNECTION_ABORT (7) 325#define XPRT_CONNECTION_ABORT (7)
323#define XPRT_CONNECTION_CLOSE (8) 326#define XPRT_CONNECTION_CLOSE (8)
324#define XPRT_INITIALIZED (9)
325 327
326static inline void xprt_set_connected(struct rpc_xprt *xprt) 328static inline void xprt_set_connected(struct rpc_xprt *xprt)
327{ 329{
diff --git a/include/linux/swap.h b/include/linux/swap.h
index a273468f8285..c71f84bb62ec 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -9,7 +9,7 @@
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/node.h> 10#include <linux/node.h>
11 11
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13#include <asm/page.h> 13#include <asm/page.h>
14 14
15struct notifier_block; 15struct notifier_block;
@@ -251,15 +251,13 @@ static inline void lru_cache_add_file(struct page *page)
251/* linux/mm/vmscan.c */ 251/* linux/mm/vmscan.c */
252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, 252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
253 gfp_t gfp_mask, nodemask_t *mask); 253 gfp_t gfp_mask, nodemask_t *mask);
254extern int __isolate_lru_page(struct page *page, int mode, int file);
254extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, 255extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
255 gfp_t gfp_mask, bool noswap, 256 gfp_t gfp_mask, bool noswap);
256 unsigned int swappiness);
257extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, 257extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
258 gfp_t gfp_mask, bool noswap, 258 gfp_t gfp_mask, bool noswap,
259 unsigned int swappiness,
260 struct zone *zone, 259 struct zone *zone,
261 unsigned long *nr_scanned); 260 unsigned long *nr_scanned);
262extern int __isolate_lru_page(struct page *page, int mode, int file);
263extern unsigned long shrink_all_memory(unsigned long nr_pages); 261extern unsigned long shrink_all_memory(unsigned long nr_pages);
264extern int vm_swappiness; 262extern int vm_swappiness;
265extern int remove_mapping(struct address_space *mapping, struct page *page); 263extern int remove_mapping(struct address_space *mapping, struct page *page);
@@ -299,7 +297,14 @@ static inline void scan_unevictable_unregister_node(struct node *node)
299 297
300extern int kswapd_run(int nid); 298extern int kswapd_run(int nid);
301extern void kswapd_stop(int nid); 299extern void kswapd_stop(int nid);
302 300#ifdef CONFIG_CGROUP_MEM_RES_CTLR
301extern int mem_cgroup_swappiness(struct mem_cgroup *mem);
302#else
303static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
304{
305 return vm_swappiness;
306}
307#endif
303#ifdef CONFIG_SWAP 308#ifdef CONFIG_SWAP
304/* linux/mm/page_io.c */ 309/* linux/mm/page_io.c */
305extern int swap_readpage(struct page *); 310extern int swap_readpage(struct page *);
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index cd42e30b7c6e..2189d3ffc85d 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -1,3 +1,8 @@
1#ifndef _LINUX_SWAPOPS_H
2#define _LINUX_SWAPOPS_H
3
4#include <linux/radix-tree.h>
5
1/* 6/*
2 * swapcache pages are stored in the swapper_space radix tree. We want to 7 * swapcache pages are stored in the swapper_space radix tree. We want to
3 * get good packing density in that tree, so the index should be dense in 8 * get good packing density in that tree, so the index should be dense in
@@ -76,6 +81,22 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry)
76 return __swp_entry_to_pte(arch_entry); 81 return __swp_entry_to_pte(arch_entry);
77} 82}
78 83
84static inline swp_entry_t radix_to_swp_entry(void *arg)
85{
86 swp_entry_t entry;
87
88 entry.val = (unsigned long)arg >> RADIX_TREE_EXCEPTIONAL_SHIFT;
89 return entry;
90}
91
92static inline void *swp_to_radix_entry(swp_entry_t entry)
93{
94 unsigned long value;
95
96 value = entry.val << RADIX_TREE_EXCEPTIONAL_SHIFT;
97 return (void *)(value | RADIX_TREE_EXCEPTIONAL_ENTRY);
98}
99
79#ifdef CONFIG_MIGRATION 100#ifdef CONFIG_MIGRATION
80static inline swp_entry_t make_migration_entry(struct page *page, int write) 101static inline swp_entry_t make_migration_entry(struct page *page, int write)
81{ 102{
@@ -169,3 +190,5 @@ static inline int non_swap_entry(swp_entry_t entry)
169 return 0; 190 return 0;
170} 191}
171#endif 192#endif
193
194#endif /* _LINUX_SWAPOPS_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 8c03b98df5f9..1ff0ec2a5e8d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -702,9 +702,6 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args);
702asmlinkage long sys_sysinfo(struct sysinfo __user *info); 702asmlinkage long sys_sysinfo(struct sysinfo __user *info);
703asmlinkage long sys_sysfs(int option, 703asmlinkage long sys_sysfs(int option,
704 unsigned long arg1, unsigned long arg2); 704 unsigned long arg1, unsigned long arg2);
705asmlinkage long sys_nfsservctl(int cmd,
706 struct nfsctl_arg __user *arg,
707 void __user *res);
708asmlinkage long sys_syslog(int type, char __user *buf, int len); 705asmlinkage long sys_syslog(int type, char __user *buf, int len);
709asmlinkage long sys_uselib(const char __user *library); 706asmlinkage long sys_uselib(const char __user *library);
710asmlinkage long sys_ni_syscall(void); 707asmlinkage long sys_ni_syscall(void);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index e2696d76a599..d7d2f2158142 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -17,7 +17,7 @@
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/lockdep.h> 18#include <linux/lockdep.h>
19#include <linux/kobject_ns.h> 19#include <linux/kobject_ns.h>
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21 21
22struct kobject; 22struct kobject;
23struct module; 23struct module;
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index d3ec89fb4122..47b4a27e6e97 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -85,22 +85,6 @@ struct thermal_cooling_device {
85 ((long)t-2732+5)/10 : ((long)t-2732-5)/10) 85 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
86#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) 86#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
87 87
88#if defined(CONFIG_THERMAL_HWMON)
89/* thermal zone devices with the same type share one hwmon device */
90struct thermal_hwmon_device {
91 char type[THERMAL_NAME_LENGTH];
92 struct device *device;
93 int count;
94 struct list_head tz_list;
95 struct list_head node;
96};
97
98struct thermal_hwmon_attr {
99 struct device_attribute attr;
100 char name[16];
101};
102#endif
103
104struct thermal_zone_device { 88struct thermal_zone_device {
105 int id; 89 int id;
106 char type[THERMAL_NAME_LENGTH]; 90 char type[THERMAL_NAME_LENGTH];
@@ -120,12 +104,6 @@ struct thermal_zone_device {
120 struct mutex lock; /* protect cooling devices list */ 104 struct mutex lock; /* protect cooling devices list */
121 struct list_head node; 105 struct list_head node;
122 struct delayed_work poll_queue; 106 struct delayed_work poll_queue;
123#if defined(CONFIG_THERMAL_HWMON)
124 struct list_head hwmon_node;
125 struct thermal_hwmon_device *hwmon;
126 struct thermal_hwmon_attr temp_input; /* hwmon sys attr */
127 struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */
128#endif
129}; 107};
130/* Adding event notification support elements */ 108/* Adding event notification support elements */
131#define THERMAL_GENL_FAMILY_NAME "thermal_event" 109#define THERMAL_GENL_FAMILY_NAME "thermal_event"
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index b004e557caa9..2ef4385da6bf 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -410,7 +410,28 @@ struct gps_event_hdr {
410 u16 plen; 410 u16 plen;
411} __attribute__ ((packed)); 411} __attribute__ ((packed));
412 412
413/* platform data */ 413/**
414 * struct ti_st_plat_data - platform data shared between ST driver and
415 * platform specific board file which adds the ST device.
416 * @nshutdown_gpio: Host's GPIO line to which chip's BT_EN is connected.
417 * @dev_name: The UART/TTY name to which chip is interfaced. (eg: /dev/ttyS1)
418 * @flow_cntrl: Should always be 1, since UART's CTS/RTS is used for PM
419 * purposes.
420 * @baud_rate: The baud rate supported by the Host UART controller, this will
421 * be shared across with the chip via a HCI VS command from User-Space Init
422 * Mgr application.
423 * @suspend:
424 * @resume: legacy PM routines hooked to platform specific board file, so as
425 * to take chip-host interface specific action.
426 * @chip_enable:
427 * @chip_disable: Platform/Interface specific mux mode setting, GPIO
428 * configuring, Host side PM disabling etc.. can be done here.
429 * @chip_asleep:
430 * @chip_awake: Chip specific deep sleep states is communicated to Host
431 * specific board-xx.c to take actions such as cut UART clocks when chip
432 * asleep or run host faster when chip awake etc..
433 *
434 */
414struct ti_st_plat_data { 435struct ti_st_plat_data {
415 long nshutdown_gpio; 436 long nshutdown_gpio;
416 unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ 437 unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */
@@ -418,6 +439,10 @@ struct ti_st_plat_data {
418 unsigned long baud_rate; 439 unsigned long baud_rate;
419 int (*suspend)(struct platform_device *, pm_message_t); 440 int (*suspend)(struct platform_device *, pm_message_t);
420 int (*resume)(struct platform_device *); 441 int (*resume)(struct platform_device *);
442 int (*chip_enable) (struct kim_data_s *);
443 int (*chip_disable) (struct kim_data_s *);
444 int (*chip_asleep) (struct kim_data_s *);
445 int (*chip_awake) (struct kim_data_s *);
421}; 446};
422 447
423#endif /* TI_WILINK_ST_H */ 448#endif /* TI_WILINK_ST_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 44bc0c5617e1..5f2ede82b3d6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -421,6 +421,8 @@ extern void tty_driver_flush_buffer(struct tty_struct *tty);
421extern void tty_throttle(struct tty_struct *tty); 421extern void tty_throttle(struct tty_struct *tty);
422extern void tty_unthrottle(struct tty_struct *tty); 422extern void tty_unthrottle(struct tty_struct *tty);
423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); 423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
424extern void tty_driver_remove_tty(struct tty_driver *driver,
425 struct tty_struct *tty);
424extern void tty_shutdown(struct tty_struct *tty); 426extern void tty_shutdown(struct tty_struct *tty);
425extern void tty_free_termios(struct tty_struct *tty); 427extern void tty_free_termios(struct tty_struct *tty);
426extern int is_current_pgrp_orphaned(void); 428extern int is_current_pgrp_orphaned(void);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 9deeac855240..ecdaeb98b293 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -47,6 +47,9 @@
47 * 47 *
48 * This routine is called synchronously when a particular tty device 48 * This routine is called synchronously when a particular tty device
49 * is closed for the last time freeing up the resources. 49 * is closed for the last time freeing up the resources.
50 * Note that tty_shutdown() is not called if ops->shutdown is defined.
51 * This means one is responsible to take care of calling ops->remove (e.g.
52 * via tty_driver_remove_tty) and releasing tty->termios.
50 * 53 *
51 * 54 *
52 * void (*cleanup)(struct tty_struct * tty); 55 * void (*cleanup)(struct tty_struct * tty);
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 8a4c309d2344..fca24cc50436 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -376,7 +376,16 @@ struct v4l2_pix_format {
376#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ 376#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
377#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ 377#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
378#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ 378#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
379#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ 379#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
380#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
381#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
382#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
383#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
384#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
385#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */
386#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
387#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
388#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
380 389
381/* Vendor-specific formats */ 390/* Vendor-specific formats */
382#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ 391#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
@@ -402,6 +411,7 @@ struct v4l2_pix_format {
402#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ 411#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
403#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ 412#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
404#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ 413#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
414#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
405 415
406/* 416/*
407 * F O R M A T E N U M E R A T I O N 417 * F O R M A T E N U M E R A T I O N
@@ -1026,6 +1036,7 @@ struct v4l2_ext_controls {
1026#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ 1036#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
1027#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ 1037#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
1028#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ 1038#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
1039#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
1029 1040
1030#define V4L2_CTRL_ID_MASK (0x0fffffff) 1041#define V4L2_CTRL_ID_MASK (0x0fffffff)
1031#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 1042#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
@@ -1039,6 +1050,7 @@ enum v4l2_ctrl_type {
1039 V4L2_CTRL_TYPE_INTEGER64 = 5, 1050 V4L2_CTRL_TYPE_INTEGER64 = 5,
1040 V4L2_CTRL_TYPE_CTRL_CLASS = 6, 1051 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
1041 V4L2_CTRL_TYPE_STRING = 7, 1052 V4L2_CTRL_TYPE_STRING = 7,
1053 V4L2_CTRL_TYPE_BITMASK = 8,
1042}; 1054};
1043 1055
1044/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 1056/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
@@ -1144,14 +1156,19 @@ enum v4l2_colorfx {
1144#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) 1156#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1145#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) 1157#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1146 1158
1159#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
1160#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
1161
1147/* last CID + 1 */ 1162/* last CID + 1 */
1148#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) 1163#define V4L2_CID_LASTP1 (V4L2_CID_BASE+41)
1164
1165/* Minimum number of buffer neede by the device */
1149 1166
1150/* MPEG-class control IDs defined by V4L2 */ 1167/* MPEG-class control IDs defined by V4L2 */
1151#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1168#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
1152#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) 1169#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
1153 1170
1154/* MPEG streams */ 1171/* MPEG streams, specific to multiplexed streams */
1155#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) 1172#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
1156enum v4l2_mpeg_stream_type { 1173enum v4l2_mpeg_stream_type {
1157 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ 1174 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
@@ -1173,7 +1190,7 @@ enum v4l2_mpeg_stream_vbi_fmt {
1173 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ 1190 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
1174}; 1191};
1175 1192
1176/* MPEG audio */ 1193/* MPEG audio controls specific to multiplexed streams */
1177#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) 1194#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
1178enum v4l2_mpeg_audio_sampling_freq { 1195enum v4l2_mpeg_audio_sampling_freq {
1179 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, 1196 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
@@ -1289,7 +1306,7 @@ enum v4l2_mpeg_audio_ac3_bitrate {
1289 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, 1306 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
1290}; 1307};
1291 1308
1292/* MPEG video */ 1309/* MPEG video controls specific to multiplexed streams */
1293#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) 1310#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
1294enum v4l2_mpeg_video_encoding { 1311enum v4l2_mpeg_video_encoding {
1295 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, 1312 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
@@ -1317,6 +1334,141 @@ enum v4l2_mpeg_video_bitrate_mode {
1317#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) 1334#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
1318#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) 1335#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
1319#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) 1336#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
1337#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
1338#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
1339#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
1340#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
1341#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
1342enum v4l2_mpeg_video_header_mode {
1343 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
1344 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
1345
1346};
1347#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
1348#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
1349#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
1350#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
1351#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
1352enum v4l2_mpeg_video_multi_slice_mode {
1353 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
1354 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
1355 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
1356};
1357#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
1358#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
1359#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
1360#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
1361#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
1362#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
1363#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
1364#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
1365#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
1366#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
1367#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
1368#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
1369#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
1370#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
1371enum v4l2_mpeg_video_h264_entropy_mode {
1372 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
1373 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
1374};
1375#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
1376#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
1377enum v4l2_mpeg_video_h264_level {
1378 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
1379 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
1380 V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
1381 V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
1382 V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
1383 V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
1384 V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
1385 V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
1386 V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
1387 V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
1388 V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
1389 V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
1390 V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
1391 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
1392 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
1393 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
1394};
1395#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
1396#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
1397#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
1398enum v4l2_mpeg_video_h264_loop_filter_mode {
1399 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
1400 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
1401 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
1402};
1403#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
1404enum v4l2_mpeg_video_h264_profile {
1405 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
1406 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
1407 V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
1408 V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
1409 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
1410 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
1411 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
1412 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
1413 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
1414 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
1415 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
1416 V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
1417 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
1418 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
1419 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
1420 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
1421 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
1422};
1423#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
1424#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
1425#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
1426#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
1427enum v4l2_mpeg_video_h264_vui_sar_idc {
1428 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
1429 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
1430 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
1431 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
1432 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
1433 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
1434 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
1435 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
1436 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
1437 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
1438 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
1439 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
1440 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
1441 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
1442 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
1443 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
1444 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
1445 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
1446};
1447#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
1448#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
1449#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
1450#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
1451#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
1452#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
1453enum v4l2_mpeg_video_mpeg4_level {
1454 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
1455 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
1456 V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
1457 V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
1458 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
1459 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
1460 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
1461 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
1462};
1463#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
1464enum v4l2_mpeg_video_mpeg4_profile {
1465 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
1466 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
1467 V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
1468 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
1469 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
1470};
1471#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
1320 1472
1321/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ 1473/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
1322#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) 1474#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
@@ -1359,6 +1511,33 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {
1359#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) 1511#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
1360#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) 1512#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
1361 1513
1514/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
1515#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
1516
1517#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
1518#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
1519#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
1520enum v4l2_mpeg_mfc51_video_frame_skip_mode {
1521 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
1522 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
1523 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
1524};
1525#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
1526enum v4l2_mpeg_mfc51_video_force_frame_type {
1527 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
1528 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
1529 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
1530};
1531#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
1532#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
1533#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
1534#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
1535#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
1536#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
1537#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
1538#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
1539#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
1540
1362/* Camera class control IDs */ 1541/* Camera class control IDs */
1363#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) 1542#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
1364#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) 1543#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
@@ -1427,6 +1606,41 @@ enum v4l2_preemphasis {
1427#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) 1606#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
1428#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) 1607#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
1429 1608
1609/* Flash and privacy (indicator) light controls */
1610#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
1611#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
1612
1613#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
1614enum v4l2_flash_led_mode {
1615 V4L2_FLASH_LED_MODE_NONE,
1616 V4L2_FLASH_LED_MODE_FLASH,
1617 V4L2_FLASH_LED_MODE_TORCH,
1618};
1619
1620#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
1621enum v4l2_flash_strobe_source {
1622 V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
1623 V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
1624};
1625
1626#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
1627#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
1628#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
1629
1630#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
1631#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
1632#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
1633#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
1634
1635#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
1636#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
1637#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
1638#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
1639#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
1640
1641#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
1642#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
1643
1430/* 1644/*
1431 * T U N I N G 1645 * T U N I N G
1432 */ 1646 */
@@ -1791,6 +2005,7 @@ struct v4l2_streamparm {
1791#define V4L2_EVENT_ALL 0 2005#define V4L2_EVENT_ALL 0
1792#define V4L2_EVENT_VSYNC 1 2006#define V4L2_EVENT_VSYNC 1
1793#define V4L2_EVENT_EOS 2 2007#define V4L2_EVENT_EOS 2
2008#define V4L2_EVENT_CTRL 3
1794#define V4L2_EVENT_PRIVATE_START 0x08000000 2009#define V4L2_EVENT_PRIVATE_START 0x08000000
1795 2010
1796/* Payload for V4L2_EVENT_VSYNC */ 2011/* Payload for V4L2_EVENT_VSYNC */
@@ -1799,21 +2014,46 @@ struct v4l2_event_vsync {
1799 __u8 field; 2014 __u8 field;
1800} __attribute__ ((packed)); 2015} __attribute__ ((packed));
1801 2016
2017/* Payload for V4L2_EVENT_CTRL */
2018#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
2019#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
2020
2021struct v4l2_event_ctrl {
2022 __u32 changes;
2023 __u32 type;
2024 union {
2025 __s32 value;
2026 __s64 value64;
2027 };
2028 __u32 flags;
2029 __s32 minimum;
2030 __s32 maximum;
2031 __s32 step;
2032 __s32 default_value;
2033};
2034
1802struct v4l2_event { 2035struct v4l2_event {
1803 __u32 type; 2036 __u32 type;
1804 union { 2037 union {
1805 struct v4l2_event_vsync vsync; 2038 struct v4l2_event_vsync vsync;
2039 struct v4l2_event_ctrl ctrl;
1806 __u8 data[64]; 2040 __u8 data[64];
1807 } u; 2041 } u;
1808 __u32 pending; 2042 __u32 pending;
1809 __u32 sequence; 2043 __u32 sequence;
1810 struct timespec timestamp; 2044 struct timespec timestamp;
1811 __u32 reserved[9]; 2045 __u32 id;
2046 __u32 reserved[8];
1812}; 2047};
1813 2048
2049#define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
2050#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
2051
1814struct v4l2_event_subscription { 2052struct v4l2_event_subscription {
1815 __u32 type; 2053 __u32 type;
1816 __u32 reserved[7]; 2054 __u32 id;
2055 __u32 flags;
2056 __u32 reserved[5];
1817}; 2057};
1818 2058
1819/* 2059/*
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index bcd942fa611c..65efb92da996 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -6,7 +6,7 @@
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/vm_event_item.h> 8#include <linux/vm_event_item.h>
9#include <asm/atomic.h> 9#include <linux/atomic.h>
10 10
11extern int sysctl_stat_interval; 11extern int sysctl_stat_interval;
12 12
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 4d05e14ea60c..c2164fad0083 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -137,7 +137,7 @@ int vty_init(const struct file_operations *console_fops);
137 137
138static inline bool vt_force_oops_output(struct vc_data *vc) 138static inline bool vt_force_oops_output(struct vc_data *vc)
139{ 139{
140 if (oops_in_progress && vc->vc_panic_force_write) 140 if (oops_in_progress && vc->vc_panic_force_write && panic_timeout >= 0)
141 return true; 141 return true;
142 return false; 142 return false;
143} 143}
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 011bcfeb9f09..111843f88b2a 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -59,6 +59,84 @@ struct watchdog_info {
59#define WATCHDOG_NOWAYOUT 0 59#define WATCHDOG_NOWAYOUT 0
60#endif 60#endif
61 61
62struct watchdog_ops;
63struct watchdog_device;
64
65/** struct watchdog_ops - The watchdog-devices operations
66 *
67 * @owner: The module owner.
68 * @start: The routine for starting the watchdog device.
69 * @stop: The routine for stopping the watchdog device.
70 * @ping: The routine that sends a keepalive ping to the watchdog device.
71 * @status: The routine that shows the status of the watchdog device.
72 * @set_timeout:The routine for setting the watchdog devices timeout value.
73 * @ioctl: The routines that handles extra ioctl calls.
74 *
75 * The watchdog_ops structure contains a list of low-level operations
76 * that control a watchdog device. It also contains the module that owns
77 * these operations. The start and stop function are mandatory, all other
78 * functions are optonal.
79 */
80struct watchdog_ops {
81 struct module *owner;
82 /* mandatory operations */
83 int (*start)(struct watchdog_device *);
84 int (*stop)(struct watchdog_device *);
85 /* optional operations */
86 int (*ping)(struct watchdog_device *);
87 unsigned int (*status)(struct watchdog_device *);
88 int (*set_timeout)(struct watchdog_device *, unsigned int);
89 long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
90};
91
92/** struct watchdog_device - The structure that defines a watchdog device
93 *
94 * @info: Pointer to a watchdog_info structure.
95 * @ops: Pointer to the list of watchdog operations.
96 * @bootstatus: Status of the watchdog device at boot.
97 * @timeout: The watchdog devices timeout value.
98 * @min_timeout:The watchdog devices minimum timeout value.
99 * @max_timeout:The watchdog devices maximum timeout value.
100 * @driver-data:Pointer to the drivers private data.
101 * @status: Field that contains the devices internal status bits.
102 *
103 * The watchdog_device structure contains all information about a
104 * watchdog timer device.
105 *
106 * The driver-data field may not be accessed directly. It must be accessed
107 * via the watchdog_set_drvdata and watchdog_get_drvdata helpers.
108 */
109struct watchdog_device {
110 const struct watchdog_info *info;
111 const struct watchdog_ops *ops;
112 unsigned int bootstatus;
113 unsigned int timeout;
114 unsigned int min_timeout;
115 unsigned int max_timeout;
116 void *driver_data;
117 unsigned long status;
118/* Bit numbers for status flags */
119#define WDOG_ACTIVE 0 /* Is the watchdog running/active */
120#define WDOG_DEV_OPEN 1 /* Opened via /dev/watchdog ? */
121#define WDOG_ALLOW_RELEASE 2 /* Did we receive the magic char ? */
122#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
123};
124
125/* Use the following functions to manipulate watchdog driver specific data */
126static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
127{
128 wdd->driver_data = data;
129}
130
131static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
132{
133 return wdd->driver_data;
134}
135
136/* drivers/watchdog/core/watchdog_core.c */
137extern int watchdog_register_device(struct watchdog_device *);
138extern void watchdog_unregister_device(struct watchdog_device *);
139
62#endif /* __KERNEL__ */ 140#endif /* __KERNEL__ */
63 141
64#endif /* ifndef _LINUX_WATCHDOG_H */ 142#endif /* ifndef _LINUX_WATCHDOG_H */
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 38e8c4d9289e..fd98bb968219 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -38,7 +38,11 @@
38#define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */ 38#define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */
39#define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */ 39#define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */
40#define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */ 40#define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */
41#define WM97XX_ADCSEL_MASK 0x7000 41#define WM97XX_AUX_ID1 0x4000
42#define WM97XX_AUX_ID2 0x5000
43#define WM97XX_AUX_ID3 0x6000
44#define WM97XX_AUX_ID4 0x7000
45#define WM97XX_ADCSEL_MASK 0x7000 /* ADC selection mask */
42#define WM97XX_COO 0x0800 /* enable coordinate mode */ 46#define WM97XX_COO 0x0800 /* enable coordinate mode */
43#define WM97XX_CTC 0x0400 /* enable continuous mode */ 47#define WM97XX_CTC 0x0400 /* enable continuous mode */
44#define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */ 48#define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */
@@ -61,13 +65,6 @@
61#define WM97XX_PRP_DET_DIG 0xc000 /* setect on, digitise on */ 65#define WM97XX_PRP_DET_DIG 0xc000 /* setect on, digitise on */
62#define WM97XX_RPR 0x2000 /* wake up on pen down */ 66#define WM97XX_RPR 0x2000 /* wake up on pen down */
63#define WM97XX_PEN_DOWN 0x8000 /* pen is down */ 67#define WM97XX_PEN_DOWN 0x8000 /* pen is down */
64#define WM97XX_ADCSRC_MASK 0x7000 /* ADC source mask */
65
66#define WM97XX_AUX_ID1 0x8001
67#define WM97XX_AUX_ID2 0x8002
68#define WM97XX_AUX_ID3 0x8003
69#define WM97XX_AUX_ID4 0x8004
70
71 68
72/* WM9712 Bits */ 69/* WM9712 Bits */
73#define WM9712_45W 0x1000 /* set for 5-wire touchscreen */ 70#define WM9712_45W 0x1000 /* set for 5-wire touchscreen */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 2be2887c6958..0d556deb497b 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -10,7 +10,7 @@
10#include <linux/bitops.h> 10#include <linux/bitops.h>
11#include <linux/lockdep.h> 11#include <linux/lockdep.h>
12#include <linux/threads.h> 12#include <linux/threads.h>
13#include <asm/atomic.h> 13#include <linux/atomic.h>
14 14
15struct workqueue_struct; 15struct workqueue_struct;
16 16
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 17e7ccc322a5..2b8963ff0f35 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -7,9 +7,28 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/fs.h> 8#include <linux/fs.h>
9 9
10struct backing_dev_info; 10/*
11 * The 1/4 region under the global dirty thresh is for smooth dirty throttling:
12 *
13 * (thresh - thresh/DIRTY_FULL_SCOPE, thresh)
14 *
15 * Further beyond, all dirtier tasks will enter a loop waiting (possibly long
16 * time) for the dirty pages to drop, unless written enough pages.
17 *
18 * The global dirty threshold is normally equal to the global dirty limit,
19 * except when the system suddenly allocates a lot of anonymous memory and
20 * knocks down the global dirty threshold quickly, in which case the global
21 * dirty limit will follow down slowly to prevent livelocking all dirtier tasks.
22 */
23#define DIRTY_SCOPE 8
24#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2)
11 25
12extern spinlock_t inode_wb_list_lock; 26/*
27 * 4MB minimal write chunk size
28 */
29#define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10))
30
31struct backing_dev_info;
13 32
14/* 33/*
15 * fs/fs-writeback.c 34 * fs/fs-writeback.c
@@ -26,11 +45,6 @@ enum writeback_sync_modes {
26 */ 45 */
27struct writeback_control { 46struct writeback_control {
28 enum writeback_sync_modes sync_mode; 47 enum writeback_sync_modes sync_mode;
29 unsigned long *older_than_this; /* If !NULL, only write back inodes
30 older than this */
31 unsigned long wb_start; /* Time writeback_inodes_wb was
32 called. This is needed to avoid
33 extra jobs and livelock */
34 long nr_to_write; /* Write this many pages, and decrement 48 long nr_to_write; /* Write this many pages, and decrement
35 this for each page written */ 49 this for each page written */
36 long pages_skipped; /* Pages which were not written */ 50 long pages_skipped; /* Pages which were not written */
@@ -43,13 +57,11 @@ struct writeback_control {
43 loff_t range_start; 57 loff_t range_start;
44 loff_t range_end; 58 loff_t range_end;
45 59
46 unsigned nonblocking:1; /* Don't get stuck on request queues */
47 unsigned encountered_congestion:1; /* An output: a queue is full */
48 unsigned for_kupdate:1; /* A kupdate writeback */ 60 unsigned for_kupdate:1; /* A kupdate writeback */
49 unsigned for_background:1; /* A background writeback */ 61 unsigned for_background:1; /* A background writeback */
62 unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */
50 unsigned for_reclaim:1; /* Invoked from the page allocator */ 63 unsigned for_reclaim:1; /* Invoked from the page allocator */
51 unsigned range_cyclic:1; /* range_start is cyclic */ 64 unsigned range_cyclic:1; /* range_start is cyclic */
52 unsigned more_io:1; /* more io to be dispatched */
53}; 65};
54 66
55/* 67/*
@@ -62,8 +74,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr);
62int writeback_inodes_sb_if_idle(struct super_block *); 74int writeback_inodes_sb_if_idle(struct super_block *);
63int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); 75int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr);
64void sync_inodes_sb(struct super_block *); 76void sync_inodes_sb(struct super_block *);
65void writeback_inodes_wb(struct bdi_writeback *wb, 77long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages);
66 struct writeback_control *wbc);
67long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 78long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
68void wakeup_flusher_threads(long nr_pages); 79void wakeup_flusher_threads(long nr_pages);
69 80
@@ -94,6 +105,8 @@ static inline void laptop_sync_completion(void) { }
94#endif 105#endif
95void throttle_vm_writeout(gfp_t gfp_mask); 106void throttle_vm_writeout(gfp_t gfp_mask);
96 107
108extern unsigned long global_dirty_limit;
109
97/* These are exported to sysctl. */ 110/* These are exported to sysctl. */
98extern int dirty_background_ratio; 111extern int dirty_background_ratio;
99extern unsigned long dirty_background_bytes; 112extern unsigned long dirty_background_bytes;
@@ -128,6 +141,13 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
128unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, 141unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
129 unsigned long dirty); 142 unsigned long dirty);
130 143
144void __bdi_update_bandwidth(struct backing_dev_info *bdi,
145 unsigned long thresh,
146 unsigned long dirty,
147 unsigned long bdi_thresh,
148 unsigned long bdi_dirty,
149 unsigned long start_time);
150
131void page_writeback_init(void); 151void page_writeback_init(void);
132void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, 152void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
133 unsigned long nr_pages_dirtied); 153 unsigned long nr_pages_dirtied);
diff --git a/include/media/adp1653.h b/include/media/adp1653.h
new file mode 100644
index 000000000000..50a1af88aed0
--- /dev/null
+++ b/include/media/adp1653.h
@@ -0,0 +1,126 @@
1/*
2 * include/media/adp1653.h
3 *
4 * Copyright (C) 2008--2011 Nokia Corporation
5 *
6 * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
7 *
8 * Contributors:
9 * Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
10 * Tuukka Toivonen <tuukkat76@gmail.com>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * version 2 as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 * 02110-1301 USA
25 *
26 */
27
28#ifndef ADP1653_H
29#define ADP1653_H
30
31#include <linux/i2c.h>
32#include <linux/mutex.h>
33#include <linux/videodev2.h>
34#include <media/v4l2-ctrls.h>
35#include <media/v4l2-subdev.h>
36
37#define ADP1653_NAME "adp1653"
38#define ADP1653_I2C_ADDR (0x60 >> 1)
39
40/* Register definitions */
41#define ADP1653_REG_OUT_SEL 0x00
42#define ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN 0x01
43#define ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX 0x0b
44#define ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN 0x0c
45#define ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX 0x1f
46#define ADP1653_REG_OUT_SEL_HPLED_SHIFT 3
47#define ADP1653_REG_OUT_SEL_ILED_MAX 0x07
48#define ADP1653_REG_OUT_SEL_ILED_SHIFT 0
49
50#define ADP1653_REG_CONFIG 0x01
51#define ADP1653_REG_CONFIG_TMR_CFG (1 << 4)
52#define ADP1653_REG_CONFIG_TMR_SET_MAX 0x0f
53#define ADP1653_REG_CONFIG_TMR_SET_SHIFT 0
54
55#define ADP1653_REG_SW_STROBE 0x02
56#define ADP1653_REG_SW_STROBE_SW_STROBE (1 << 0)
57
58#define ADP1653_REG_FAULT 0x03
59#define ADP1653_REG_FAULT_FLT_SCP (1 << 3)
60#define ADP1653_REG_FAULT_FLT_OT (1 << 2)
61#define ADP1653_REG_FAULT_FLT_TMR (1 << 1)
62#define ADP1653_REG_FAULT_FLT_OV (1 << 0)
63
64#define ADP1653_INDICATOR_INTENSITY_MIN 0
65#define ADP1653_INDICATOR_INTENSITY_STEP 2500
66#define ADP1653_INDICATOR_INTENSITY_MAX \
67 (ADP1653_REG_OUT_SEL_ILED_MAX * ADP1653_INDICATOR_INTENSITY_STEP)
68#define ADP1653_INDICATOR_INTENSITY_uA_TO_REG(a) \
69 ((a) / ADP1653_INDICATOR_INTENSITY_STEP)
70#define ADP1653_INDICATOR_INTENSITY_REG_TO_uA(a) \
71 ((a) * ADP1653_INDICATOR_INTENSITY_STEP)
72
73#define ADP1653_FLASH_INTENSITY_BASE 35
74#define ADP1653_FLASH_INTENSITY_STEP 15
75#define ADP1653_FLASH_INTENSITY_MIN \
76 (ADP1653_FLASH_INTENSITY_BASE \
77 + ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN * ADP1653_FLASH_INTENSITY_STEP)
78#define ADP1653_FLASH_INTENSITY_MAX \
79 (ADP1653_FLASH_INTENSITY_MIN + \
80 (ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX - \
81 ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN + 1) * \
82 ADP1653_FLASH_INTENSITY_STEP)
83
84#define ADP1653_FLASH_INTENSITY_mA_TO_REG(a) \
85 ((a) < ADP1653_FLASH_INTENSITY_BASE ? 0 : \
86 (((a) - ADP1653_FLASH_INTENSITY_BASE) / ADP1653_FLASH_INTENSITY_STEP))
87#define ADP1653_FLASH_INTENSITY_REG_TO_mA(a) \
88 ((a) * ADP1653_FLASH_INTENSITY_STEP + ADP1653_FLASH_INTENSITY_BASE)
89
90#define ADP1653_TORCH_INTENSITY_MIN \
91 (ADP1653_FLASH_INTENSITY_BASE \
92 + ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN * ADP1653_FLASH_INTENSITY_STEP)
93#define ADP1653_TORCH_INTENSITY_MAX \
94 (ADP1653_TORCH_INTENSITY_MIN + \
95 (ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX - \
96 ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN + 1) * \
97 ADP1653_FLASH_INTENSITY_STEP)
98
99struct adp1653_platform_data {
100 int (*power)(struct v4l2_subdev *sd, int on);
101
102 u32 max_flash_timeout; /* flash light timeout in us */
103 u32 max_flash_intensity; /* led intensity, flash mode */
104 u32 max_torch_intensity; /* led intensity, torch mode */
105 u32 max_indicator_intensity; /* indicator led intensity */
106};
107
108#define to_adp1653_flash(sd) container_of(sd, struct adp1653_flash, subdev)
109
110struct adp1653_flash {
111 struct v4l2_subdev subdev;
112 struct adp1653_platform_data *platform_data;
113
114 struct v4l2_ctrl_handler ctrls;
115 struct v4l2_ctrl *led_mode;
116 struct v4l2_ctrl *flash_timeout;
117 struct v4l2_ctrl *flash_intensity;
118 struct v4l2_ctrl *torch_intensity;
119 struct v4l2_ctrl *indicator_intensity;
120
121 struct mutex power_lock;
122 int power_count;
123 int fault;
124};
125
126#endif /* ADP1653_H */
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h
new file mode 100644
index 000000000000..26cece595121
--- /dev/null
+++ b/include/media/atmel-isi.h
@@ -0,0 +1,119 @@
1/*
2 * Register definitions for the Atmel Image Sensor Interface.
3 *
4 * Copyright (C) 2011 Atmel Corporation
5 * Josh Wu, <josh.wu@atmel.com>
6 *
7 * Based on previous work by Lars Haring, <lars.haring@atmel.com>
8 * and Sedji Gaouaou
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#ifndef __ATMEL_ISI_H__
15#define __ATMEL_ISI_H__
16
17#include <linux/types.h>
18
19/* ISI_V2 register offsets */
20#define ISI_CFG1 0x0000
21#define ISI_CFG2 0x0004
22#define ISI_PSIZE 0x0008
23#define ISI_PDECF 0x000c
24#define ISI_Y2R_SET0 0x0010
25#define ISI_Y2R_SET1 0x0014
26#define ISI_R2Y_SET0 0x0018
27#define ISI_R2Y_SET1 0x001C
28#define ISI_R2Y_SET2 0x0020
29#define ISI_CTRL 0x0024
30#define ISI_STATUS 0x0028
31#define ISI_INTEN 0x002C
32#define ISI_INTDIS 0x0030
33#define ISI_INTMASK 0x0034
34#define ISI_DMA_CHER 0x0038
35#define ISI_DMA_CHDR 0x003C
36#define ISI_DMA_CHSR 0x0040
37#define ISI_DMA_P_ADDR 0x0044
38#define ISI_DMA_P_CTRL 0x0048
39#define ISI_DMA_P_DSCR 0x004C
40#define ISI_DMA_C_ADDR 0x0050
41#define ISI_DMA_C_CTRL 0x0054
42#define ISI_DMA_C_DSCR 0x0058
43
44/* Bitfields in CFG1 */
45#define ISI_CFG1_HSYNC_POL_ACTIVE_LOW (1 << 2)
46#define ISI_CFG1_VSYNC_POL_ACTIVE_LOW (1 << 3)
47#define ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING (1 << 4)
48#define ISI_CFG1_EMB_SYNC (1 << 6)
49#define ISI_CFG1_CRC_SYNC (1 << 7)
50/* Constants for FRATE(ISI_V2) */
51#define ISI_CFG1_FRATE_CAPTURE_ALL (0 << 8)
52#define ISI_CFG1_FRATE_DIV_2 (1 << 8)
53#define ISI_CFG1_FRATE_DIV_3 (2 << 8)
54#define ISI_CFG1_FRATE_DIV_4 (3 << 8)
55#define ISI_CFG1_FRATE_DIV_5 (4 << 8)
56#define ISI_CFG1_FRATE_DIV_6 (5 << 8)
57#define ISI_CFG1_FRATE_DIV_7 (6 << 8)
58#define ISI_CFG1_FRATE_DIV_8 (7 << 8)
59#define ISI_CFG1_DISCR (1 << 11)
60#define ISI_CFG1_FULL_MODE (1 << 12)
61
62/* Bitfields in CFG2 */
63#define ISI_CFG2_GRAYSCALE (1 << 13)
64/* Constants for YCC_SWAP(ISI_V2) */
65#define ISI_CFG2_YCC_SWAP_DEFAULT (0 << 28)
66#define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28)
67#define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28)
68#define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28)
69#define ISI_CFG2_IM_VSIZE_OFFSET 0
70#define ISI_CFG2_IM_HSIZE_OFFSET 16
71#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET)
72#define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET)
73
74/* Bitfields in CTRL */
75/* Also using in SR(ISI_V2) */
76#define ISI_CTRL_EN (1 << 0)
77#define ISI_CTRL_CDC (1 << 8)
78/* Also using in SR/IER/IDR/IMR(ISI_V2) */
79#define ISI_CTRL_DIS (1 << 1)
80#define ISI_CTRL_SRST (1 << 2)
81
82/* Bitfields in SR */
83#define ISI_SR_SIP (1 << 19)
84/* Also using in SR/IER/IDR/IMR */
85#define ISI_SR_VSYNC (1 << 10)
86#define ISI_SR_PXFR_DONE (1 << 16)
87#define ISI_SR_CXFR_DONE (1 << 17)
88#define ISI_SR_P_OVR (1 << 24)
89#define ISI_SR_C_OVR (1 << 25)
90#define ISI_SR_CRC_ERR (1 << 26)
91#define ISI_SR_FR_OVR (1 << 27)
92
93/* Bitfields in DMA_C_CTRL & in DMA_P_CTRL */
94#define ISI_DMA_CTRL_FETCH (1 << 0)
95#define ISI_DMA_CTRL_WB (1 << 1)
96#define ISI_DMA_CTRL_IEN (1 << 2)
97#define ISI_DMA_CTRL_DONE (1 << 3)
98
99/* Bitfields in DMA_CHSR/CHER/CHDR */
100#define ISI_DMA_CHSR_P_CH (1 << 0)
101#define ISI_DMA_CHSR_C_CH (1 << 1)
102
103/* Definition for isi_platform_data */
104#define ISI_DATAWIDTH_8 0x01
105#define ISI_DATAWIDTH_10 0x02
106
107struct isi_platform_data {
108 u8 has_emb_sync;
109 u8 emb_crc_sync;
110 u8 hsync_act_low;
111 u8 vsync_act_low;
112 u8 pclk_act_falling;
113 u8 isi_full_mode;
114 u32 data_width_flags;
115 /* Using for ISI_CFG1 */
116 u32 frate;
117};
118
119#endif /* __ATMEL_ISI_H__ */
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
new file mode 100644
index 000000000000..8b11fb037980
--- /dev/null
+++ b/include/media/davinci/vpbe.h
@@ -0,0 +1,184 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_H
18#define _VPBE_H
19
20#include <linux/videodev2.h>
21#include <linux/i2c.h>
22
23#include <media/v4l2-dev.h>
24#include <media/v4l2-ioctl.h>
25#include <media/v4l2-device.h>
26#include <media/davinci/vpbe_osd.h>
27#include <media/davinci/vpbe_venc.h>
28#include <media/davinci/vpbe_types.h>
29
30/* OSD configuration info */
31struct osd_config_info {
32 char module_name[32];
33};
34
35struct vpbe_output {
36 struct v4l2_output output;
37 /*
38 * If output capabilities include dv_preset, list supported presets
39 * below
40 */
41 char *subdev_name;
42 /*
43 * defualt_mode identifies the default timings set at the venc or
44 * external encoder.
45 */
46 char *default_mode;
47 /*
48 * Fields below are used for supporting multiple modes. For example,
49 * LCD panel might support different modes and they are listed here.
50 * Similarly for supporting external encoders, lcd controller port
51 * requires a set of non-standard timing values to be listed here for
52 * each supported mode since venc is used in non-standard timing mode
53 * for interfacing with external encoder similar to configuring lcd
54 * panel timings
55 */
56 unsigned int num_modes;
57 struct vpbe_enc_mode_info *modes;
58 /*
59 * Bus configuration goes here for external encoders. Some encoders
60 * may require multiple interface types for each of the output. For
61 * example, SD modes would use YCC8 where as HD mode would use YCC16.
62 * Not sure if this is needed on a per mode basis instead of per
63 * output basis. If per mode is needed, we may have to move this to
64 * mode_info structure
65 */
66};
67
68/* encoder configuration info */
69struct encoder_config_info {
70 char module_name[32];
71 /* Is this an i2c device ? */
72 unsigned int is_i2c:1;
73 /* i2c subdevice board info */
74 struct i2c_board_info board_info;
75};
76
77/* structure for defining vpbe display subsystem components */
78struct vpbe_config {
79 char module_name[32];
80 /* i2c bus adapter no */
81 int i2c_adapter_id;
82 struct osd_config_info osd;
83 struct encoder_config_info venc;
84 /* external encoder information goes here */
85 int num_ext_encoders;
86 struct encoder_config_info *ext_encoders;
87 int num_outputs;
88 /* Order is venc outputs followed by LCD and then external encoders */
89 struct vpbe_output *outputs;
90};
91
92struct vpbe_device;
93
94struct vpbe_device_ops {
95 /* crop cap for the display */
96 int (*g_cropcap)(struct vpbe_device *vpbe_dev,
97 struct v4l2_cropcap *cropcap);
98
99 /* Enumerate the outputs */
100 int (*enum_outputs)(struct vpbe_device *vpbe_dev,
101 struct v4l2_output *output);
102
103 /* Set output to the given index */
104 int (*set_output)(struct vpbe_device *vpbe_dev,
105 int index);
106
107 /* Get current output */
108 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
109
110 /* Set DV preset at current output */
111 int (*s_dv_preset)(struct vpbe_device *vpbe_dev,
112 struct v4l2_dv_preset *dv_preset);
113
114 /* Get DV presets supported at the output */
115 int (*g_dv_preset)(struct vpbe_device *vpbe_dev,
116 struct v4l2_dv_preset *dv_preset);
117
118 /* Enumerate the DV Presets supported at the output */
119 int (*enum_dv_presets)(struct vpbe_device *vpbe_dev,
120 struct v4l2_dv_enum_preset *preset_info);
121
122 /* Set std at the output */
123 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
124
125 /* Get the current std at the output */
126 int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
127
128 /* initialize the device */
129 int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev);
130
131 /* De-initialize the device */
132 void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev);
133
134 /* Get the current mode info */
135 int (*get_mode_info)(struct vpbe_device *vpbe_dev,
136 struct vpbe_enc_mode_info*);
137
138 /*
139 * Set the current mode in the encoder. Alternate way of setting
140 * standard or DV preset or custom timings in the encoder
141 */
142 int (*set_mode)(struct vpbe_device *vpbe_dev,
143 struct vpbe_enc_mode_info*);
144 /* Power management operations */
145 int (*suspend)(struct vpbe_device *vpbe_dev);
146 int (*resume)(struct vpbe_device *vpbe_dev);
147};
148
149/* struct for vpbe device */
150struct vpbe_device {
151 /* V4l2 device */
152 struct v4l2_device v4l2_dev;
153 /* vpbe dispay controller cfg */
154 struct vpbe_config *cfg;
155 /* parent device */
156 struct device *pdev;
157 /* external encoder v4l2 sub devices */
158 struct v4l2_subdev **encoders;
159 /* current encoder index */
160 int current_sd_index;
161 struct mutex lock;
162 /* device initialized */
163 int initialized;
164 /* vpbe dac clock */
165 struct clk *dac_clk;
166 /* osd_device pointer */
167 struct osd_state *osd_device;
168 /*
169 * fields below are accessed by users of vpbe_device. Not the
170 * ones above
171 */
172
173 /* current output */
174 int current_out_index;
175 /* lock used by caller to do atomic operation on vpbe device */
176 /* current timings set in the controller */
177 struct vpbe_enc_mode_info current_timings;
178 /* venc sub device */
179 struct v4l2_subdev *venc;
180 /* device operations below */
181 struct vpbe_device_ops ops;
182};
183
184#endif
diff --git a/include/media/davinci/vpbe_display.h b/include/media/davinci/vpbe_display.h
new file mode 100644
index 000000000000..dbf6b37682cd
--- /dev/null
+++ b/include/media/davinci/vpbe_display.h
@@ -0,0 +1,147 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
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 as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13#ifndef VPBE_DISPLAY_H
14#define VPBE_DISPLAY_H
15
16/* Header files */
17#include <linux/videodev2.h>
18#include <media/v4l2-common.h>
19#include <media/videobuf-dma-contig.h>
20#include <media/davinci/vpbe_types.h>
21#include <media/davinci/vpbe_osd.h>
22#include <media/davinci/vpbe.h>
23
24#define VPBE_DISPLAY_MAX_DEVICES 2
25
26enum vpbe_display_device_id {
27 VPBE_DISPLAY_DEVICE_0,
28 VPBE_DISPLAY_DEVICE_1
29};
30
31#define VPBE_DISPLAY_DRV_NAME "vpbe-display"
32
33#define VPBE_DISPLAY_MAJOR_RELEASE 1
34#define VPBE_DISPLAY_MINOR_RELEASE 0
35#define VPBE_DISPLAY_BUILD 1
36#define VPBE_DISPLAY_VERSION_CODE ((VPBE_DISPLAY_MAJOR_RELEASE << 16) | \
37 (VPBE_DISPLAY_MINOR_RELEASE << 8) | \
38 VPBE_DISPLAY_BUILD)
39
40#define VPBE_DISPLAY_VALID_FIELD(field) ((V4L2_FIELD_NONE == field) || \
41 (V4L2_FIELD_ANY == field) || (V4L2_FIELD_INTERLACED == field))
42
43/* Exp ratio numerator and denominator constants */
44#define VPBE_DISPLAY_H_EXP_RATIO_N 9
45#define VPBE_DISPLAY_H_EXP_RATIO_D 8
46#define VPBE_DISPLAY_V_EXP_RATIO_N 6
47#define VPBE_DISPLAY_V_EXP_RATIO_D 5
48
49/* Zoom multiplication factor */
50#define VPBE_DISPLAY_ZOOM_4X 4
51#define VPBE_DISPLAY_ZOOM_2X 2
52
53/* Structures */
54struct display_layer_info {
55 int enable;
56 /* Layer ID used by Display Manager */
57 enum osd_layer id;
58 struct osd_layer_config config;
59 enum osd_zoom_factor h_zoom;
60 enum osd_zoom_factor v_zoom;
61 enum osd_h_exp_ratio h_exp;
62 enum osd_v_exp_ratio v_exp;
63};
64
65/* vpbe display object structure */
66struct vpbe_layer {
67 /* number of buffers in fbuffers */
68 unsigned int numbuffers;
69 /* Pointer to the vpbe_display */
70 struct vpbe_display *disp_dev;
71 /* Pointer pointing to current v4l2_buffer */
72 struct videobuf_buffer *cur_frm;
73 /* Pointer pointing to next v4l2_buffer */
74 struct videobuf_buffer *next_frm;
75 /* videobuf specific parameters
76 * Buffer queue used in video-buf
77 */
78 struct videobuf_queue buffer_queue;
79 /* Queue of filled frames */
80 struct list_head dma_queue;
81 /* Used in video-buf */
82 spinlock_t irqlock;
83 /* V4l2 specific parameters */
84 /* Identifies video device for this layer */
85 struct video_device video_dev;
86 /* This field keeps track of type of buffer exchange mechanism user
87 * has selected
88 */
89 enum v4l2_memory memory;
90 /* Used to keep track of state of the priority */
91 struct v4l2_prio_state prio;
92 /* Used to store pixel format */
93 struct v4l2_pix_format pix_fmt;
94 enum v4l2_field buf_field;
95 /* Video layer configuration params */
96 struct display_layer_info layer_info;
97 /* vpbe specific parameters
98 * enable window for display
99 */
100 unsigned char window_enable;
101 /* number of open instances of the layer */
102 unsigned int usrs;
103 /* number of users performing IO */
104 unsigned int io_usrs;
105 /* Indicates id of the field which is being displayed */
106 unsigned int field_id;
107 /* Indicates whether streaming started */
108 unsigned char started;
109 /* Identifies device object */
110 enum vpbe_display_device_id device_id;
111 /* facilitation of ioctl ops lock by v4l2*/
112 struct mutex opslock;
113 u8 layer_first_int;
114};
115
116/* vpbe device structure */
117struct vpbe_display {
118 /* layer specific parameters */
119 /* lock for isr updates to buf layers*/
120 spinlock_t dma_queue_lock;
121 /* C-Plane offset from start of y-plane */
122 unsigned int cbcr_ofst;
123 struct vpbe_layer *dev[VPBE_DISPLAY_MAX_DEVICES];
124 struct vpbe_device *vpbe_dev;
125 struct osd_state *osd_device;
126};
127
128/* File handle structure */
129struct vpbe_fh {
130 /* vpbe device structure */
131 struct vpbe_display *disp_dev;
132 /* pointer to layer object for opened device */
133 struct vpbe_layer *layer;
134 /* Indicates whether this file handle is doing IO */
135 unsigned char io_allowed;
136 /* Used to keep track priority of this instance */
137 enum v4l2_priority prio;
138};
139
140struct buf_config_params {
141 unsigned char min_numbuffers;
142 unsigned char numbuffers[VPBE_DISPLAY_MAX_DEVICES];
143 unsigned int min_bufsize[VPBE_DISPLAY_MAX_DEVICES];
144 unsigned int layer_bufsize[VPBE_DISPLAY_MAX_DEVICES];
145};
146
147#endif /* VPBE_DISPLAY_H */
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h
new file mode 100644
index 000000000000..d7e397a444e6
--- /dev/null
+++ b/include/media/davinci/vpbe_osd.h
@@ -0,0 +1,394 @@
1/*
2 * Copyright (C) 2007-2009 Texas Instruments Inc
3 * Copyright (C) 2007 MontaVista Software, Inc.
4 *
5 * Andy Lowe (alowe@mvista.com), MontaVista Software
6 * - Initial version
7 * Murali Karicheri (mkaricheri@gmail.com), Texas Instruments Ltd.
8 * - ported to sub device interface
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation version 2..
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24#ifndef _OSD_H
25#define _OSD_H
26
27#include <media/davinci/vpbe_types.h>
28
29#define VPBE_OSD_SUBDEV_NAME "vpbe-osd"
30
31/**
32 * enum osd_layer
33 * @WIN_OSD0: On-Screen Display Window 0
34 * @WIN_VID0: Video Window 0
35 * @WIN_OSD1: On-Screen Display Window 1
36 * @WIN_VID1: Video Window 1
37 *
38 * Description:
39 * An enumeration of the osd display layers.
40 */
41enum osd_layer {
42 WIN_OSD0,
43 WIN_VID0,
44 WIN_OSD1,
45 WIN_VID1,
46};
47
48/**
49 * enum osd_win_layer
50 * @OSDWIN_OSD0: On-Screen Display Window 0
51 * @OSDWIN_OSD1: On-Screen Display Window 1
52 *
53 * Description:
54 * An enumeration of the OSD Window layers.
55 */
56enum osd_win_layer {
57 OSDWIN_OSD0,
58 OSDWIN_OSD1,
59};
60
61/**
62 * enum osd_pix_format
63 * @PIXFMT_1BPP: 1-bit-per-pixel bitmap
64 * @PIXFMT_2BPP: 2-bits-per-pixel bitmap
65 * @PIXFMT_4BPP: 4-bits-per-pixel bitmap
66 * @PIXFMT_8BPP: 8-bits-per-pixel bitmap
67 * @PIXFMT_RGB565: 16-bits-per-pixel RGB565
68 * @PIXFMT_YCbCrI: YUV 4:2:2
69 * @PIXFMT_RGB888: 24-bits-per-pixel RGB888
70 * @PIXFMT_YCrCbI: YUV 4:2:2 with chroma swap
71 * @PIXFMT_NV12: YUV 4:2:0 planar
72 * @PIXFMT_OSD_ATTR: OSD Attribute Window pixel format (4bpp)
73 *
74 * Description:
75 * An enumeration of the DaVinci pixel formats.
76 */
77enum osd_pix_format {
78 PIXFMT_1BPP = 0,
79 PIXFMT_2BPP,
80 PIXFMT_4BPP,
81 PIXFMT_8BPP,
82 PIXFMT_RGB565,
83 PIXFMT_YCbCrI,
84 PIXFMT_RGB888,
85 PIXFMT_YCrCbI,
86 PIXFMT_NV12,
87 PIXFMT_OSD_ATTR,
88};
89
90/**
91 * enum osd_h_exp_ratio
92 * @H_EXP_OFF: no expansion (1/1)
93 * @H_EXP_9_OVER_8: 9/8 expansion ratio
94 * @H_EXP_3_OVER_2: 3/2 expansion ratio
95 *
96 * Description:
97 * An enumeration of the available horizontal expansion ratios.
98 */
99enum osd_h_exp_ratio {
100 H_EXP_OFF,
101 H_EXP_9_OVER_8,
102 H_EXP_3_OVER_2,
103};
104
105/**
106 * enum osd_v_exp_ratio
107 * @V_EXP_OFF: no expansion (1/1)
108 * @V_EXP_6_OVER_5: 6/5 expansion ratio
109 *
110 * Description:
111 * An enumeration of the available vertical expansion ratios.
112 */
113enum osd_v_exp_ratio {
114 V_EXP_OFF,
115 V_EXP_6_OVER_5,
116};
117
118/**
119 * enum osd_zoom_factor
120 * @ZOOM_X1: no zoom (x1)
121 * @ZOOM_X2: x2 zoom
122 * @ZOOM_X4: x4 zoom
123 *
124 * Description:
125 * An enumeration of the available zoom factors.
126 */
127enum osd_zoom_factor {
128 ZOOM_X1,
129 ZOOM_X2,
130 ZOOM_X4,
131};
132
133/**
134 * enum osd_clut
135 * @ROM_CLUT: ROM CLUT
136 * @RAM_CLUT: RAM CLUT
137 *
138 * Description:
139 * An enumeration of the available Color Lookup Tables (CLUTs).
140 */
141enum osd_clut {
142 ROM_CLUT,
143 RAM_CLUT,
144};
145
146/**
147 * enum osd_rom_clut
148 * @ROM_CLUT0: Macintosh CLUT
149 * @ROM_CLUT1: CLUT from DM270 and prior devices
150 *
151 * Description:
152 * An enumeration of the ROM Color Lookup Table (CLUT) options.
153 */
154enum osd_rom_clut {
155 ROM_CLUT0,
156 ROM_CLUT1,
157};
158
159/**
160 * enum osd_blending_factor
161 * @OSD_0_VID_8: OSD pixels are fully transparent
162 * @OSD_1_VID_7: OSD pixels contribute 1/8, video pixels contribute 7/8
163 * @OSD_2_VID_6: OSD pixels contribute 2/8, video pixels contribute 6/8
164 * @OSD_3_VID_5: OSD pixels contribute 3/8, video pixels contribute 5/8
165 * @OSD_4_VID_4: OSD pixels contribute 4/8, video pixels contribute 4/8
166 * @OSD_5_VID_3: OSD pixels contribute 5/8, video pixels contribute 3/8
167 * @OSD_6_VID_2: OSD pixels contribute 6/8, video pixels contribute 2/8
168 * @OSD_8_VID_0: OSD pixels are fully opaque
169 *
170 * Description:
171 * An enumeration of the DaVinci pixel blending factor options.
172 */
173enum osd_blending_factor {
174 OSD_0_VID_8,
175 OSD_1_VID_7,
176 OSD_2_VID_6,
177 OSD_3_VID_5,
178 OSD_4_VID_4,
179 OSD_5_VID_3,
180 OSD_6_VID_2,
181 OSD_8_VID_0,
182};
183
184/**
185 * enum osd_blink_interval
186 * @BLINK_X1: blink interval is 1 vertical refresh cycle
187 * @BLINK_X2: blink interval is 2 vertical refresh cycles
188 * @BLINK_X3: blink interval is 3 vertical refresh cycles
189 * @BLINK_X4: blink interval is 4 vertical refresh cycles
190 *
191 * Description:
192 * An enumeration of the DaVinci pixel blinking interval options.
193 */
194enum osd_blink_interval {
195 BLINK_X1,
196 BLINK_X2,
197 BLINK_X3,
198 BLINK_X4,
199};
200
201/**
202 * enum osd_cursor_h_width
203 * @H_WIDTH_1: horizontal line width is 1 pixel
204 * @H_WIDTH_4: horizontal line width is 4 pixels
205 * @H_WIDTH_8: horizontal line width is 8 pixels
206 * @H_WIDTH_12: horizontal line width is 12 pixels
207 * @H_WIDTH_16: horizontal line width is 16 pixels
208 * @H_WIDTH_20: horizontal line width is 20 pixels
209 * @H_WIDTH_24: horizontal line width is 24 pixels
210 * @H_WIDTH_28: horizontal line width is 28 pixels
211 */
212enum osd_cursor_h_width {
213 H_WIDTH_1,
214 H_WIDTH_4,
215 H_WIDTH_8,
216 H_WIDTH_12,
217 H_WIDTH_16,
218 H_WIDTH_20,
219 H_WIDTH_24,
220 H_WIDTH_28,
221};
222
223/**
224 * enum davinci_cursor_v_width
225 * @V_WIDTH_1: vertical line width is 1 line
226 * @V_WIDTH_2: vertical line width is 2 lines
227 * @V_WIDTH_4: vertical line width is 4 lines
228 * @V_WIDTH_6: vertical line width is 6 lines
229 * @V_WIDTH_8: vertical line width is 8 lines
230 * @V_WIDTH_10: vertical line width is 10 lines
231 * @V_WIDTH_12: vertical line width is 12 lines
232 * @V_WIDTH_14: vertical line width is 14 lines
233 */
234enum osd_cursor_v_width {
235 V_WIDTH_1,
236 V_WIDTH_2,
237 V_WIDTH_4,
238 V_WIDTH_6,
239 V_WIDTH_8,
240 V_WIDTH_10,
241 V_WIDTH_12,
242 V_WIDTH_14,
243};
244
245/**
246 * struct osd_cursor_config
247 * @xsize: horizontal size in pixels
248 * @ysize: vertical size in lines
249 * @xpos: horizontal offset in pixels from the left edge of the display
250 * @ypos: vertical offset in lines from the top of the display
251 * @interlaced: Non-zero if the display is interlaced, or zero otherwise
252 * @h_width: horizontal line width
253 * @v_width: vertical line width
254 * @clut: the CLUT selector (ROM or RAM) for the cursor color
255 * @clut_index: an index into the CLUT for the cursor color
256 *
257 * Description:
258 * A structure describing the configuration parameters of the hardware
259 * rectangular cursor.
260 */
261struct osd_cursor_config {
262 unsigned xsize;
263 unsigned ysize;
264 unsigned xpos;
265 unsigned ypos;
266 int interlaced;
267 enum osd_cursor_h_width h_width;
268 enum osd_cursor_v_width v_width;
269 enum osd_clut clut;
270 unsigned char clut_index;
271};
272
273/**
274 * struct osd_layer_config
275 * @pixfmt: pixel format
276 * @line_length: offset in bytes between start of each line in memory
277 * @xsize: number of horizontal pixels displayed per line
278 * @ysize: number of lines displayed
279 * @xpos: horizontal offset in pixels from the left edge of the display
280 * @ypos: vertical offset in lines from the top of the display
281 * @interlaced: Non-zero if the display is interlaced, or zero otherwise
282 *
283 * Description:
284 * A structure describing the configuration parameters of an On-Screen Display
285 * (OSD) or video layer related to how the image is stored in memory.
286 * @line_length must be a multiple of the cache line size (32 bytes).
287 */
288struct osd_layer_config {
289 enum osd_pix_format pixfmt;
290 unsigned line_length;
291 unsigned xsize;
292 unsigned ysize;
293 unsigned xpos;
294 unsigned ypos;
295 int interlaced;
296};
297
298/* parameters that apply on a per-window (OSD or video) basis */
299struct osd_window_state {
300 int is_allocated;
301 int is_enabled;
302 unsigned long fb_base_phys;
303 enum osd_zoom_factor h_zoom;
304 enum osd_zoom_factor v_zoom;
305 struct osd_layer_config lconfig;
306};
307
308/* parameters that apply on a per-OSD-window basis */
309struct osd_osdwin_state {
310 enum osd_clut clut;
311 enum osd_blending_factor blend;
312 int colorkey_blending;
313 unsigned colorkey;
314 int rec601_attenuation;
315 /* index is pixel value */
316 unsigned char palette_map[16];
317};
318
319/* hardware rectangular cursor parameters */
320struct osd_cursor_state {
321 int is_enabled;
322 struct osd_cursor_config config;
323};
324
325struct osd_state;
326
327struct vpbe_osd_ops {
328 int (*initialize)(struct osd_state *sd);
329 int (*request_layer)(struct osd_state *sd, enum osd_layer layer);
330 void (*release_layer)(struct osd_state *sd, enum osd_layer layer);
331 int (*enable_layer)(struct osd_state *sd, enum osd_layer layer,
332 int otherwin);
333 void (*disable_layer)(struct osd_state *sd, enum osd_layer layer);
334 int (*set_layer_config)(struct osd_state *sd, enum osd_layer layer,
335 struct osd_layer_config *lconfig);
336 void (*get_layer_config)(struct osd_state *sd, enum osd_layer layer,
337 struct osd_layer_config *lconfig);
338 void (*start_layer)(struct osd_state *sd, enum osd_layer layer,
339 unsigned long fb_base_phys,
340 unsigned long cbcr_ofst);
341 void (*set_left_margin)(struct osd_state *sd, u32 val);
342 void (*set_top_margin)(struct osd_state *sd, u32 val);
343 void (*set_interpolation_filter)(struct osd_state *sd, int filter);
344 int (*set_vid_expansion)(struct osd_state *sd,
345 enum osd_h_exp_ratio h_exp,
346 enum osd_v_exp_ratio v_exp);
347 void (*get_vid_expansion)(struct osd_state *sd,
348 enum osd_h_exp_ratio *h_exp,
349 enum osd_v_exp_ratio *v_exp);
350 void (*set_zoom)(struct osd_state *sd, enum osd_layer layer,
351 enum osd_zoom_factor h_zoom,
352 enum osd_zoom_factor v_zoom);
353};
354
355struct osd_state {
356 enum vpbe_version vpbe_type;
357 spinlock_t lock;
358 struct device *dev;
359 dma_addr_t osd_base_phys;
360 unsigned long osd_base;
361 unsigned long osd_size;
362 /* 1-->the isr will toggle the VID0 ping-pong buffer */
363 int pingpong;
364 int interpolation_filter;
365 int field_inversion;
366 enum osd_h_exp_ratio osd_h_exp;
367 enum osd_v_exp_ratio osd_v_exp;
368 enum osd_h_exp_ratio vid_h_exp;
369 enum osd_v_exp_ratio vid_v_exp;
370 enum osd_clut backg_clut;
371 unsigned backg_clut_index;
372 enum osd_rom_clut rom_clut;
373 int is_blinking;
374 /* attribute window blinking enabled */
375 enum osd_blink_interval blink;
376 /* YCbCrI or YCrCbI */
377 enum osd_pix_format yc_pixfmt;
378 /* columns are Y, Cb, Cr */
379 unsigned char clut_ram[256][3];
380 struct osd_cursor_state cursor;
381 /* OSD0, VID0, OSD1, VID1 */
382 struct osd_window_state win[4];
383 /* OSD0, OSD1 */
384 struct osd_osdwin_state osdwin[2];
385 /* OSD device Operations */
386 struct vpbe_osd_ops ops;
387};
388
389struct osd_platform_data {
390 enum vpbe_version vpbe_type;
391 int field_inv_wa_enable;
392};
393
394#endif
diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h
new file mode 100644
index 000000000000..727f55170e41
--- /dev/null
+++ b/include/media/davinci/vpbe_types.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_TYPES_H
18#define _VPBE_TYPES_H
19
20enum vpbe_version {
21 VPBE_VERSION_1 = 1,
22 VPBE_VERSION_2,
23 VPBE_VERSION_3,
24};
25
26/* vpbe_timing_type - Timing types used in vpbe device */
27enum vpbe_enc_timings_type {
28 VPBE_ENC_STD = 0x1,
29 VPBE_ENC_DV_PRESET = 0x2,
30 VPBE_ENC_CUSTOM_TIMINGS = 0x4,
31 /* Used when set timings through FB device interface */
32 VPBE_ENC_TIMINGS_INVALID = 0x8,
33};
34
35union vpbe_timings {
36 v4l2_std_id std_id;
37 unsigned int dv_preset;
38};
39
40/*
41 * struct vpbe_enc_mode_info
42 * @name: ptr to name string of the standard, "NTSC", "PAL" etc
43 * @std: standard or non-standard mode. 1 - standard, 0 - nonstandard
44 * @interlaced: 1 - interlaced, 0 - non interlaced/progressive
45 * @xres: x or horizontal resolution of the display
46 * @yres: y or vertical resolution of the display
47 * @fps: frame per second
48 * @left_margin: left margin of the display
49 * @right_margin: right margin of the display
50 * @upper_margin: upper margin of the display
51 * @lower_margin: lower margin of the display
52 * @hsync_len: h-sync length
53 * @vsync_len: v-sync length
54 * @flags: bit field: bit usage is documented below
55 *
56 * Description:
57 * Structure holding timing and resolution information of a standard.
58 * Used by vpbe_device to set required non-standard timing in the
59 * venc when lcd controller output is connected to a external encoder.
60 * A table of timings is maintained in vpbe device to set this in
61 * venc when external encoder is connected to lcd controller output.
62 * Encoder may provide a g_dv_timings() API to override these values
63 * as needed.
64 *
65 * Notes
66 * ------
67 * if_type should be used only by encoder manager and encoder.
68 * flags usage
69 * b0 (LSB) - hsync polarity, 0 - negative, 1 - positive
70 * b1 - vsync polarity, 0 - negative, 1 - positive
71 * b2 - field id polarity, 0 - negative, 1 - positive
72 */
73struct vpbe_enc_mode_info {
74 unsigned char *name;
75 enum vpbe_enc_timings_type timings_type;
76 union vpbe_timings timings;
77 unsigned int interlaced;
78 unsigned int xres;
79 unsigned int yres;
80 struct v4l2_fract aspect;
81 struct v4l2_fract fps;
82 unsigned int left_margin;
83 unsigned int right_margin;
84 unsigned int upper_margin;
85 unsigned int lower_margin;
86 unsigned int hsync_len;
87 unsigned int vsync_len;
88 unsigned int flags;
89};
90
91#endif
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h
new file mode 100644
index 000000000000..426c205831a2
--- /dev/null
+++ b/include/media/davinci/vpbe_venc.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_VENC_H
18#define _VPBE_VENC_H
19
20#include <media/v4l2-subdev.h>
21#include <media/davinci/vpbe_types.h>
22
23#define VPBE_VENC_SUBDEV_NAME "vpbe-venc"
24
25/* venc events */
26#define VENC_END_OF_FRAME BIT(0)
27#define VENC_FIRST_FIELD BIT(1)
28#define VENC_SECOND_FIELD BIT(2)
29
30struct venc_platform_data {
31 enum vpbe_version venc_type;
32 int (*setup_clock)(enum vpbe_enc_timings_type type,
33 unsigned int mode);
34 /* Number of LCD outputs supported */
35 int num_lcd_outputs;
36};
37
38enum venc_ioctls {
39 VENC_GET_FLD = 1,
40};
41
42/* exported functions */
43struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev,
44 const char *venc_name);
45#endif
diff --git a/include/media/mmp-camera.h b/include/media/mmp-camera.h
new file mode 100644
index 000000000000..7611963a257f
--- /dev/null
+++ b/include/media/mmp-camera.h
@@ -0,0 +1,9 @@
1/*
2 * Information for the Marvell Armada MMP camera
3 */
4
5struct mmp_camera_platform_data {
6 struct platform_device *i2c_device;
7 int sensor_power_gpio;
8 int sensor_reset_gpio;
9};
diff --git a/include/media/ov7670.h b/include/media/ov7670.h
new file mode 100644
index 000000000000..b133bc123031
--- /dev/null
+++ b/include/media/ov7670.h
@@ -0,0 +1,20 @@
1/*
2 * A V4L2 driver for OmniVision OV7670 cameras.
3 *
4 * Copyright 2010 One Laptop Per Child
5 *
6 * This file may be distributed under the terms of the GNU General
7 * Public License, version 2.
8 */
9
10#ifndef __OV7670_H
11#define __OV7670_H
12
13struct ov7670_config {
14 int min_width; /* Filter out smaller sizes */
15 int min_height; /* Filter out smaller sizes */
16 int clock_speed; /* External clock speed (MHz) */
17 bool use_smbus; /* Use smbus I/O instead of I2C */
18};
19
20#endif
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 60536c74c1ea..b1f19b77ecd4 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -117,7 +117,7 @@ struct rc_dev {
117 int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); 117 int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier);
118 int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); 118 int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle);
119 int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); 119 int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max);
120 int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); 120 int (*tx_ir)(struct rc_dev *dev, unsigned *txbuf, unsigned n);
121 void (*s_idle)(struct rc_dev *dev, bool enable); 121 void (*s_idle)(struct rc_dev *dev, bool enable);
122 int (*s_learning_mode)(struct rc_dev *dev, int enable); 122 int (*s_learning_mode)(struct rc_dev *dev, int enable);
123 int (*s_carrier_report) (struct rc_dev *dev, int enable); 123 int (*s_carrier_report) (struct rc_dev *dev, int enable);
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 4e1409ec2613..17c9759ae77b 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -18,12 +18,13 @@
18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ 20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
21#define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */
21#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 22#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
22#define RC_TYPE_OTHER (1u << 31) 23#define RC_TYPE_OTHER (1u << 31)
23 24
24#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ 25#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \
25 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ 26 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \
26 RC_TYPE_RC5_SZ | RC_TYPE_OTHER) 27 RC_TYPE_RC5_SZ | RC_TYPE_MCE_KBD | RC_TYPE_OTHER)
27 28
28struct rc_map_table { 29struct rc_map_table {
29 u32 scancode; 30 u32 scancode;
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h
index 80346a6d28a9..48413b410f15 100644
--- a/include/media/sh_mobile_ceu.h
+++ b/include/media/sh_mobile_ceu.h
@@ -7,10 +7,18 @@
7#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ 7#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */
8 8
9struct device; 9struct device;
10struct resource;
11
12struct sh_mobile_ceu_companion {
13 u32 num_resources;
14 struct resource *resource;
15 int id;
16 void *platform_data;
17};
10 18
11struct sh_mobile_ceu_info { 19struct sh_mobile_ceu_info {
12 unsigned long flags; 20 unsigned long flags;
13 struct device *csi2_dev; 21 struct sh_mobile_ceu_companion *csi2;
14}; 22};
15 23
16#endif /* __ASM_SH_MOBILE_CEU_H__ */ 24#endif /* __ASM_SH_MOBILE_CEU_H__ */
diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h
index 4d2615174461..c586c4f7f16b 100644
--- a/include/media/sh_mobile_csi2.h
+++ b/include/media/sh_mobile_csi2.h
@@ -11,6 +11,8 @@
11#ifndef SH_MIPI_CSI 11#ifndef SH_MIPI_CSI
12#define SH_MIPI_CSI 12#define SH_MIPI_CSI
13 13
14#include <linux/list.h>
15
14enum sh_csi2_phy { 16enum sh_csi2_phy {
15 SH_CSI2_PHY_MAIN, 17 SH_CSI2_PHY_MAIN,
16 SH_CSI2_PHY_SUB, 18 SH_CSI2_PHY_SUB,
@@ -33,14 +35,14 @@ struct sh_csi2_client_config {
33 struct platform_device *pdev; /* client platform device */ 35 struct platform_device *pdev; /* client platform device */
34}; 36};
35 37
38struct v4l2_device;
39
36struct sh_csi2_pdata { 40struct sh_csi2_pdata {
37 enum sh_csi2_type type; 41 enum sh_csi2_type type;
38 unsigned int flags; 42 unsigned int flags;
39 struct sh_csi2_client_config *clients; 43 struct sh_csi2_client_config *clients;
40 int num_clients; 44 int num_clients;
45 struct v4l2_device *v4l2_dev;
41}; 46};
42 47
43struct device;
44struct v4l2_device;
45
46#endif 48#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 238bd334fd83..7582952dceae 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -20,14 +20,15 @@
20#include <media/videobuf2-core.h> 20#include <media/videobuf2-core.h>
21#include <media/v4l2-device.h> 21#include <media/v4l2-device.h>
22 22
23extern struct bus_type soc_camera_bus_type;
24
25struct file; 23struct file;
24struct soc_camera_link;
26 25
27struct soc_camera_device { 26struct soc_camera_device {
28 struct list_head list; 27 struct list_head list; /* list of all registered devices */
29 struct device dev; 28 struct soc_camera_link *link;
30 struct device *pdev; /* Platform device */ 29 struct device *pdev; /* Platform device */
30 struct device *parent; /* Camera host device */
31 struct device *control; /* E.g., the i2c client */
31 s32 user_width; 32 s32 user_width;
32 s32 user_height; 33 s32 user_height;
33 u32 bytesperline; /* for padding, zero if unused */ 34 u32 bytesperline; /* for padding, zero if unused */
@@ -66,8 +67,6 @@ struct soc_camera_host_ops {
66 struct module *owner; 67 struct module *owner;
67 int (*add)(struct soc_camera_device *); 68 int (*add)(struct soc_camera_device *);
68 void (*remove)(struct soc_camera_device *); 69 void (*remove)(struct soc_camera_device *);
69 int (*suspend)(struct soc_camera_device *, pm_message_t);
70 int (*resume)(struct soc_camera_device *);
71 /* 70 /*
72 * .get_formats() is called for each client device format, but 71 * .get_formats() is called for each client device format, but
73 * .put_formats() is only called once. Further, if any of the calls to 72 * .put_formats() is only called once. Further, if any of the calls to
@@ -109,12 +108,6 @@ struct soc_camera_host_ops {
109#define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) 108#define SOCAM_SENSOR_INVERT_HSYNC (1 << 2)
110#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) 109#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3)
111#define SOCAM_SENSOR_INVERT_DATA (1 << 4) 110#define SOCAM_SENSOR_INVERT_DATA (1 << 4)
112#define SOCAM_MIPI_1LANE (1 << 5)
113#define SOCAM_MIPI_2LANE (1 << 6)
114#define SOCAM_MIPI_3LANE (1 << 7)
115#define SOCAM_MIPI_4LANE (1 << 8)
116#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
117 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
118 111
119struct i2c_board_info; 112struct i2c_board_info;
120struct regulator_bulk_data; 113struct regulator_bulk_data;
@@ -134,11 +127,11 @@ struct soc_camera_link {
134 int num_regulators; 127 int num_regulators;
135 128
136 /* 129 /*
137 * For non-I2C devices platform platform has to provide methods to 130 * For non-I2C devices platform has to provide methods to add a device
138 * add a device to the system and to remove 131 * to the system and to remove it
139 */ 132 */
140 int (*add_device)(struct soc_camera_link *, struct device *); 133 int (*add_device)(struct soc_camera_device *);
141 void (*del_device)(struct soc_camera_link *); 134 void (*del_device)(struct soc_camera_device *);
142 /* Optional callbacks to power on or off and reset the sensor */ 135 /* Optional callbacks to power on or off and reset the sensor */
143 int (*power)(struct device *, int); 136 int (*power)(struct device *, int);
144 int (*reset)(struct device *); 137 int (*reset)(struct device *);
@@ -152,12 +145,6 @@ struct soc_camera_link {
152 void (*free_bus)(struct soc_camera_link *); 145 void (*free_bus)(struct soc_camera_link *);
153}; 146};
154 147
155static inline struct soc_camera_device *to_soc_camera_dev(
156 const struct device *dev)
157{
158 return container_of(dev, struct soc_camera_device, dev);
159}
160
161static inline struct soc_camera_host *to_soc_camera_host( 148static inline struct soc_camera_host *to_soc_camera_host(
162 const struct device *dev) 149 const struct device *dev)
163{ 150{
@@ -169,13 +156,13 @@ static inline struct soc_camera_host *to_soc_camera_host(
169static inline struct soc_camera_link *to_soc_camera_link( 156static inline struct soc_camera_link *to_soc_camera_link(
170 const struct soc_camera_device *icd) 157 const struct soc_camera_device *icd)
171{ 158{
172 return icd->dev.platform_data; 159 return icd->link;
173} 160}
174 161
175static inline struct device *to_soc_camera_control( 162static inline struct device *to_soc_camera_control(
176 const struct soc_camera_device *icd) 163 const struct soc_camera_device *icd)
177{ 164{
178 return dev_get_drvdata(&icd->dev); 165 return icd->control;
179} 166}
180 167
181static inline struct v4l2_subdev *soc_camera_to_subdev( 168static inline struct v4l2_subdev *soc_camera_to_subdev(
@@ -207,11 +194,8 @@ struct soc_camera_format_xlate {
207}; 194};
208 195
209struct soc_camera_ops { 196struct soc_camera_ops {
210 int (*suspend)(struct soc_camera_device *, pm_message_t state);
211 int (*resume)(struct soc_camera_device *);
212 unsigned long (*query_bus_param)(struct soc_camera_device *); 197 unsigned long (*query_bus_param)(struct soc_camera_device *);
213 int (*set_bus_param)(struct soc_camera_device *, unsigned long); 198 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
214 int (*enum_input)(struct soc_camera_device *, struct v4l2_input *);
215 const struct v4l2_queryctrl *controls; 199 const struct v4l2_queryctrl *controls;
216 int num_controls; 200 int num_controls;
217}; 201};
@@ -270,6 +254,12 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
270#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13) 254#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13)
271#define SOCAM_DATA_ACTIVE_HIGH (1 << 14) 255#define SOCAM_DATA_ACTIVE_HIGH (1 << 14)
272#define SOCAM_DATA_ACTIVE_LOW (1 << 15) 256#define SOCAM_DATA_ACTIVE_LOW (1 << 15)
257#define SOCAM_MIPI_1LANE (1 << 16)
258#define SOCAM_MIPI_2LANE (1 << 17)
259#define SOCAM_MIPI_3LANE (1 << 18)
260#define SOCAM_MIPI_4LANE (1 << 19)
261#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
262 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
273 263
274#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ 264#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \
275 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ 265 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 6d7a4fd00fc0..74f0fa15ca47 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -21,7 +21,7 @@ struct soc_camera_platform_info {
21 unsigned long format_depth; 21 unsigned long format_depth;
22 struct v4l2_mbus_framefmt format; 22 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 23 unsigned long bus_param;
24 struct device *dev; 24 struct soc_camera_device *icd;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 25 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26}; 26};
27 27
@@ -30,8 +30,7 @@ static inline void soc_camera_platform_release(struct platform_device **pdev)
30 *pdev = NULL; 30 *pdev = NULL;
31} 31}
32 32
33static inline int soc_camera_platform_add(const struct soc_camera_link *icl, 33static inline int soc_camera_platform_add(struct soc_camera_device *icd,
34 struct device *dev,
35 struct platform_device **pdev, 34 struct platform_device **pdev,
36 struct soc_camera_link *plink, 35 struct soc_camera_link *plink,
37 void (*release)(struct device *dev), 36 void (*release)(struct device *dev),
@@ -40,7 +39,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
40 struct soc_camera_platform_info *info = plink->priv; 39 struct soc_camera_platform_info *info = plink->priv;
41 int ret; 40 int ret;
42 41
43 if (icl != plink) 42 if (icd->link != plink)
44 return -ENODEV; 43 return -ENODEV;
45 44
46 if (*pdev) 45 if (*pdev)
@@ -50,7 +49,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
50 if (!*pdev) 49 if (!*pdev)
51 return -ENOMEM; 50 return -ENOMEM;
52 51
53 info->dev = dev; 52 info->icd = icd;
54 53
55 (*pdev)->dev.platform_data = info; 54 (*pdev)->dev.platform_data = info;
56 (*pdev)->dev.release = release; 55 (*pdev)->dev.release = release;
@@ -59,17 +58,17 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
59 if (ret < 0) { 58 if (ret < 0) {
60 platform_device_put(*pdev); 59 platform_device_put(*pdev);
61 *pdev = NULL; 60 *pdev = NULL;
62 info->dev = NULL; 61 info->icd = NULL;
63 } 62 }
64 63
65 return ret; 64 return ret;
66} 65}
67 66
68static inline void soc_camera_platform_del(const struct soc_camera_link *icl, 67static inline void soc_camera_platform_del(const struct soc_camera_device *icd,
69 struct platform_device *pdev, 68 struct platform_device *pdev,
70 const struct soc_camera_link *plink) 69 const struct soc_camera_link *plink)
71{ 70{
72 if (icl != plink || !pdev) 71 if (icd->link != plink || !pdev)
73 return; 72 return;
74 73
75 platform_device_unregister(pdev); 74 platform_device_unregister(pdev);
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h
index a59a84854dc1..a40a6a348d21 100644
--- a/include/media/timb_radio.h
+++ b/include/media/timb_radio.h
@@ -23,13 +23,8 @@
23 23
24struct timb_radio_platform_data { 24struct timb_radio_platform_data {
25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ 25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */
26 struct { 26 struct i2c_board_info *tuner;
27 struct i2c_board_info *info; 27 struct i2c_board_info *dsp;
28 } tuner;
29 struct {
30 const char *module_name;
31 struct i2c_board_info *info;
32 } dsp;
33}; 28};
34 29
35#endif 30#endif
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 963e33471835..89c290b69a5c 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -127,6 +127,8 @@
127#define TUNER_PHILIPS_FMD1216MEX_MK3 78 127#define TUNER_PHILIPS_FMD1216MEX_MK3 78
128#define TUNER_PHILIPS_FM1216MK5 79 128#define TUNER_PHILIPS_FM1216MK5 79
129#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ 129#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */
130#define TUNER_XC4000 81 /* Xceive Silicon Tuner */
131
130#define TUNER_PARTSNIC_PTI_5NF05 81 132#define TUNER_PARTSNIC_PTI_5NF05 81
131#define TUNER_PHILIPS_CU1216L 82 133#define TUNER_PHILIPS_CU1216L 82
132#define TUNER_NXP_TDA18271 83 134#define TUNER_NXP_TDA18271 83
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index b3edb67a8311..63fd9d3db296 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -76,6 +76,7 @@ enum {
76 V4L2_IDENT_OV6650 = 258, 76 V4L2_IDENT_OV6650 = 258,
77 V4L2_IDENT_OV2640 = 259, 77 V4L2_IDENT_OV2640 = 259,
78 V4L2_IDENT_OV9740 = 260, 78 V4L2_IDENT_OV9740 = 260,
79 V4L2_IDENT_OV5642 = 261,
79 80
80 /* module saa7146: reserved range 300-309 */ 81 /* module saa7146: reserved range 300-309 */
81 V4L2_IDENT_SAA7146 = 300, 82 V4L2_IDENT_SAA7146 = 300,
@@ -185,8 +186,9 @@ enum {
185 /* module wm8775: just ident 8775 */ 186 /* module wm8775: just ident 8775 */
186 V4L2_IDENT_WM8775 = 8775, 187 V4L2_IDENT_WM8775 = 8775,
187 188
188 /* module cafe_ccic, just ident 8801 */ 189 /* Marvell controllers starting at 8801 */
189 V4L2_IDENT_CAFE = 8801, 190 V4L2_IDENT_CAFE = 8801,
191 V4L2_IDENT_ARMADA610 = 8802,
190 192
191 /* AKM AK8813/AK8814 */ 193 /* AKM AK8813/AK8814 */
192 V4L2_IDENT_AK8813 = 8813, 194 V4L2_IDENT_AK8813 = 8813,
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 97d063837b61..13fe4d744aba 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -27,9 +27,12 @@
27 27
28/* forward references */ 28/* forward references */
29struct v4l2_ctrl_handler; 29struct v4l2_ctrl_handler;
30struct v4l2_ctrl_helper;
30struct v4l2_ctrl; 31struct v4l2_ctrl;
31struct video_device; 32struct video_device;
32struct v4l2_subdev; 33struct v4l2_subdev;
34struct v4l2_subscribed_event;
35struct v4l2_fh;
33 36
34/** struct v4l2_ctrl_ops - The control operations that the driver has to provide. 37/** struct v4l2_ctrl_ops - The control operations that the driver has to provide.
35 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant 38 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant
@@ -51,6 +54,7 @@ struct v4l2_ctrl_ops {
51 54
52/** struct v4l2_ctrl - The control structure. 55/** struct v4l2_ctrl - The control structure.
53 * @node: The list node. 56 * @node: The list node.
57 * @ev_subs: The list of control event subscriptions.
54 * @handler: The handler that owns the control. 58 * @handler: The handler that owns the control.
55 * @cluster: Point to start of cluster array. 59 * @cluster: Point to start of cluster array.
56 * @ncontrols: Number of controls in cluster array. 60 * @ncontrols: Number of controls in cluster array.
@@ -65,6 +69,15 @@ struct v4l2_ctrl_ops {
65 * control's current value cannot be cached and needs to be 69 * control's current value cannot be cached and needs to be
66 * retrieved through the g_volatile_ctrl op. Drivers can set 70 * retrieved through the g_volatile_ctrl op. Drivers can set
67 * this flag. 71 * this flag.
72 * @is_auto: If set, then this control selects whether the other cluster
73 * members are in 'automatic' mode or 'manual' mode. This is
74 * used for autogain/gain type clusters. Drivers should never
75 * set this flag directly.
76 * @manual_mode_value: If the is_auto flag is set, then this is the value
77 * of the auto control that determines if that control is in
78 * manual mode. So if the value of the auto control equals this
79 * value, then the whole cluster is in manual mode. Drivers should
80 * never set this flag directly.
68 * @ops: The control ops. 81 * @ops: The control ops.
69 * @id: The control ID. 82 * @id: The control ID.
70 * @name: The control name. 83 * @name: The control name.
@@ -97,6 +110,7 @@ struct v4l2_ctrl_ops {
97struct v4l2_ctrl { 110struct v4l2_ctrl {
98 /* Administrative fields */ 111 /* Administrative fields */
99 struct list_head node; 112 struct list_head node;
113 struct list_head ev_subs;
100 struct v4l2_ctrl_handler *handler; 114 struct v4l2_ctrl_handler *handler;
101 struct v4l2_ctrl **cluster; 115 struct v4l2_ctrl **cluster;
102 unsigned ncontrols; 116 unsigned ncontrols;
@@ -105,6 +119,8 @@ struct v4l2_ctrl {
105 unsigned int is_new:1; 119 unsigned int is_new:1;
106 unsigned int is_private:1; 120 unsigned int is_private:1;
107 unsigned int is_volatile:1; 121 unsigned int is_volatile:1;
122 unsigned int is_auto:1;
123 unsigned int manual_mode_value:8;
108 124
109 const struct v4l2_ctrl_ops *ops; 125 const struct v4l2_ctrl_ops *ops;
110 u32 id; 126 u32 id;
@@ -134,6 +150,7 @@ struct v4l2_ctrl {
134 * @node: List node for the sorted list. 150 * @node: List node for the sorted list.
135 * @next: Single-link list node for the hash. 151 * @next: Single-link list node for the hash.
136 * @ctrl: The actual control information. 152 * @ctrl: The actual control information.
153 * @helper: Pointer to helper struct. Used internally in prepare_ext_ctrls().
137 * 154 *
138 * Each control handler has a list of these refs. The list_head is used to 155 * Each control handler has a list of these refs. The list_head is used to
139 * keep a sorted-by-control-ID list of all controls, while the next pointer 156 * keep a sorted-by-control-ID list of all controls, while the next pointer
@@ -143,6 +160,7 @@ struct v4l2_ctrl_ref {
143 struct list_head node; 160 struct list_head node;
144 struct v4l2_ctrl_ref *next; 161 struct v4l2_ctrl_ref *next;
145 struct v4l2_ctrl *ctrl; 162 struct v4l2_ctrl *ctrl;
163 struct v4l2_ctrl_helper *helper;
146}; 164};
147 165
148/** struct v4l2_ctrl_handler - The control handler keeps track of all the 166/** struct v4l2_ctrl_handler - The control handler keeps track of all the
@@ -363,6 +381,40 @@ int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
363void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); 381void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls);
364 382
365 383
384/** v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging to
385 * that cluster and set it up for autofoo/foo-type handling.
386 * @ncontrols: The number of controls in this cluster.
387 * @controls: The cluster control array of size @ncontrols. The first control
388 * must be the 'auto' control (e.g. autogain, autoexposure, etc.)
389 * @manual_val: The value for the first control in the cluster that equals the
390 * manual setting.
391 * @set_volatile: If true, then all controls except the first auto control will
392 * have is_volatile set to true. If false, then is_volatile will not
393 * be touched.
394 *
395 * Use for control groups where one control selects some automatic feature and
396 * the other controls are only active whenever the automatic feature is turned
397 * off (manual mode). Typical examples: autogain vs gain, auto-whitebalance vs
398 * red and blue balance, etc.
399 *
400 * The behavior of such controls is as follows:
401 *
402 * When the autofoo control is set to automatic, then any manual controls
403 * are set to inactive and any reads will call g_volatile_ctrl (if the control
404 * was marked volatile).
405 *
406 * When the autofoo control is set to manual, then any manual controls will
407 * be marked active, and any reads will just return the current value without
408 * going through g_volatile_ctrl.
409 *
410 * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
411 * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
412 * if autofoo is in auto mode.
413 */
414void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
415 u8 manual_val, bool set_volatile);
416
417
366/** v4l2_ctrl_find() - Find a control with the given ID. 418/** v4l2_ctrl_find() - Find a control with the given ID.
367 * @hdl: The control handler. 419 * @hdl: The control handler.
368 * @id: The control ID to find. 420 * @id: The control ID to find.
@@ -379,9 +431,9 @@ struct v4l2_ctrl *v4l2_ctrl_find(struct v4l2_ctrl_handler *hdl, u32 id);
379 * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically. 431 * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically.
380 * Does nothing if @ctrl == NULL. 432 * Does nothing if @ctrl == NULL.
381 * This will usually be called from within the s_ctrl op. 433 * This will usually be called from within the s_ctrl op.
434 * The V4L2_EVENT_CTRL event will be generated afterwards.
382 * 435 *
383 * This function can be called regardless of whether the control handler 436 * This function assumes that the control handler is locked.
384 * is locked or not.
385 */ 437 */
386void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); 438void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
387 439
@@ -391,11 +443,12 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
391 * 443 *
392 * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically. 444 * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically.
393 * Does nothing if @ctrl == NULL. 445 * Does nothing if @ctrl == NULL.
446 * The V4L2_EVENT_CTRL event will be generated afterwards.
394 * This will usually be called when starting or stopping streaming in the 447 * This will usually be called when starting or stopping streaming in the
395 * driver. 448 * driver.
396 * 449 *
397 * This function can be called regardless of whether the control handler 450 * This function assumes that the control handler is not locked and will
398 * is locked or not. 451 * take the lock itself.
399 */ 452 */
400void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); 453void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
401 454
@@ -440,15 +493,22 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
440 */ 493 */
441int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); 494int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
442 495
496/* Internal helper functions that deal with control events. */
497void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
498 struct v4l2_subscribed_event *sev);
499void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
500 struct v4l2_subscribed_event *sev);
443 501
444/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ 502/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */
445int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); 503int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc);
446int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); 504int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm);
447int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); 505int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl);
448int v4l2_s_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); 506int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
507 struct v4l2_control *ctrl);
449int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 508int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c);
450int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 509int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c);
451int v4l2_s_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 510int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
511 struct v4l2_ext_controls *c);
452 512
453/* Helpers for subdevices. If the associated ctrl_handler == NULL then they 513/* Helpers for subdevices. If the associated ctrl_handler == NULL then they
454 will all return -EINVAL. */ 514 will all return -EINVAL. */
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 3b86177c8cd2..5f14e8895ce2 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -29,39 +29,95 @@
29#include <linux/videodev2.h> 29#include <linux/videodev2.h>
30#include <linux/wait.h> 30#include <linux/wait.h>
31 31
32/*
33 * Overview:
34 *
35 * Events are subscribed per-filehandle. An event specification consists of a
36 * type and is optionally associated with an object identified through the
37 * 'id' field. So an event is uniquely identified by the (type, id) tuple.
38 *
39 * The v4l2-fh struct has a list of subscribed events. The v4l2_subscribed_event
40 * struct is added to that list, one for every subscribed event.
41 *
42 * Each v4l2_subscribed_event struct ends with an array of v4l2_kevent structs.
43 * This array (ringbuffer, really) is used to store any events raised by the
44 * driver. The v4l2_kevent struct links into the 'available' list of the
45 * v4l2_fh struct so VIDIOC_DQEVENT will know which event to dequeue first.
46 *
47 * Finally, if the event subscription is associated with a particular object
48 * such as a V4L2 control, then that object needs to know about that as well
49 * so that an event can be raised by that object. So the 'node' field can
50 * be used to link the v4l2_subscribed_event struct into a list of that
51 * object.
52 *
53 * So to summarize:
54 *
55 * struct v4l2_fh has two lists: one of the subscribed events, and one of the
56 * pending events.
57 *
58 * struct v4l2_subscribed_event has a ringbuffer of raised (pending) events of
59 * that particular type.
60 *
61 * If struct v4l2_subscribed_event is associated with a specific object, then
62 * that object will have an internal list of struct v4l2_subscribed_event so
63 * it knows who subscribed an event to that object.
64 */
65
32struct v4l2_fh; 66struct v4l2_fh;
67struct v4l2_subscribed_event;
33struct video_device; 68struct video_device;
34 69
70/** struct v4l2_kevent - Internal kernel event struct.
71 * @list: List node for the v4l2_fh->available list.
72 * @sev: Pointer to parent v4l2_subscribed_event.
73 * @event: The event itself.
74 */
35struct v4l2_kevent { 75struct v4l2_kevent {
36 struct list_head list; 76 struct list_head list;
77 struct v4l2_subscribed_event *sev;
37 struct v4l2_event event; 78 struct v4l2_event event;
38}; 79};
39 80
81/** struct v4l2_subscribed_event - Internal struct representing a subscribed event.
82 * @list: List node for the v4l2_fh->subscribed list.
83 * @type: Event type.
84 * @id: Associated object ID (e.g. control ID). 0 if there isn't any.
85 * @flags: Copy of v4l2_event_subscription->flags.
86 * @fh: Filehandle that subscribed to this event.
87 * @node: List node that hooks into the object's event list (if there is one).
88 * @replace: Optional callback that can replace event 'old' with event 'new'.
89 * @merge: Optional callback that can merge event 'old' into event 'new'.
90 * @elems: The number of elements in the events array.
91 * @first: The index of the events containing the oldest available event.
92 * @in_use: The number of queued events.
93 * @events: An array of @elems events.
94 */
40struct v4l2_subscribed_event { 95struct v4l2_subscribed_event {
41 struct list_head list; 96 struct list_head list;
42 u32 type; 97 u32 type;
98 u32 id;
99 u32 flags;
100 struct v4l2_fh *fh;
101 struct list_head node;
102 void (*replace)(struct v4l2_event *old,
103 const struct v4l2_event *new);
104 void (*merge)(const struct v4l2_event *old,
105 struct v4l2_event *new);
106 unsigned elems;
107 unsigned first;
108 unsigned in_use;
109 struct v4l2_kevent events[];
43}; 110};
44 111
45struct v4l2_events {
46 wait_queue_head_t wait;
47 struct list_head subscribed; /* Subscribed events */
48 struct list_head free; /* Events ready for use */
49 struct list_head available; /* Dequeueable event */
50 unsigned int navailable;
51 unsigned int nallocated; /* Number of allocated events */
52 u32 sequence;
53};
54
55int v4l2_event_init(struct v4l2_fh *fh);
56int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n);
57void v4l2_event_free(struct v4l2_fh *fh);
58int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, 112int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event,
59 int nonblocking); 113 int nonblocking);
60void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); 114void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev);
115void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev);
61int v4l2_event_pending(struct v4l2_fh *fh); 116int v4l2_event_pending(struct v4l2_fh *fh);
62int v4l2_event_subscribe(struct v4l2_fh *fh, 117int v4l2_event_subscribe(struct v4l2_fh *fh,
63 struct v4l2_event_subscription *sub); 118 struct v4l2_event_subscription *sub, unsigned elems);
64int v4l2_event_unsubscribe(struct v4l2_fh *fh, 119int v4l2_event_unsubscribe(struct v4l2_fh *fh,
65 struct v4l2_event_subscription *sub); 120 struct v4l2_event_subscription *sub);
121void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
66 122
67#endif /* V4L2_EVENT_H */ 123#endif /* V4L2_EVENT_H */
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h
index 0206aa55be24..52513c225c18 100644
--- a/include/media/v4l2-fh.h
+++ b/include/media/v4l2-fh.h
@@ -29,13 +29,20 @@
29#include <linux/list.h> 29#include <linux/list.h>
30 30
31struct video_device; 31struct video_device;
32struct v4l2_events; 32struct v4l2_ctrl_handler;
33 33
34struct v4l2_fh { 34struct v4l2_fh {
35 struct list_head list; 35 struct list_head list;
36 struct video_device *vdev; 36 struct video_device *vdev;
37 struct v4l2_events *events; /* events, pending and subscribed */ 37 struct v4l2_ctrl_handler *ctrl_handler;
38 enum v4l2_priority prio; 38 enum v4l2_priority prio;
39
40 /* Events */
41 wait_queue_head_t wait;
42 struct list_head subscribed; /* Subscribed events */
43 struct list_head available; /* Dequeueable event */
44 unsigned int navailable;
45 u32 sequence;
39}; 46};
40 47
41/* 48/*
@@ -44,7 +51,7 @@ struct v4l2_fh {
44 * from driver's v4l2_file_operations->open() handler if the driver 51 * from driver's v4l2_file_operations->open() handler if the driver
45 * uses v4l2_fh. 52 * uses v4l2_fh.
46 */ 53 */
47int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); 54void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev);
48/* 55/*
49 * Add the fh to the list of file handles on a video_device. The file 56 * Add the fh to the list of file handles on a video_device. The file
50 * handle must be initialised first. 57 * handle must be initialised first.
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 971c7fa29614..6114007c8c74 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -13,6 +13,69 @@
13 13
14#include <linux/v4l2-mediabus.h> 14#include <linux/v4l2-mediabus.h>
15 15
16/* Parallel flags */
17/*
18 * Can the client run in master or in slave mode. By "Master mode" an operation
19 * mode is meant, when the client (e.g., a camera sensor) is producing
20 * horizontal and vertical synchronisation. In "Slave mode" the host is
21 * providing these signals to the slave.
22 */
23#define V4L2_MBUS_MASTER (1 << 0)
24#define V4L2_MBUS_SLAVE (1 << 1)
25/* Which signal polarities it supports */
26/* Note: in BT.656 mode HSYNC and VSYNC are unused */
27#define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2)
28#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3)
29#define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4)
30#define V4L2_MBUS_VSYNC_ACTIVE_LOW (1 << 5)
31#define V4L2_MBUS_PCLK_SAMPLE_RISING (1 << 6)
32#define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7)
33#define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8)
34#define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9)
35
36/* Serial flags */
37/* How many lanes the client can use */
38#define V4L2_MBUS_CSI2_1_LANE (1 << 0)
39#define V4L2_MBUS_CSI2_2_LANE (1 << 1)
40#define V4L2_MBUS_CSI2_3_LANE (1 << 2)
41#define V4L2_MBUS_CSI2_4_LANE (1 << 3)
42/* On which channels it can send video data */
43#define V4L2_MBUS_CSI2_CHANNEL_0 (1 << 4)
44#define V4L2_MBUS_CSI2_CHANNEL_1 (1 << 5)
45#define V4L2_MBUS_CSI2_CHANNEL_2 (1 << 6)
46#define V4L2_MBUS_CSI2_CHANNEL_3 (1 << 7)
47/* Does it support only continuous or also non-continuous clock mode */
48#define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK (1 << 8)
49#define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK (1 << 9)
50
51#define V4L2_MBUS_CSI2_LANES (V4L2_MBUS_CSI2_1_LANE | V4L2_MBUS_CSI2_2_LANE | \
52 V4L2_MBUS_CSI2_3_LANE | V4L2_MBUS_CSI2_4_LANE)
53#define V4L2_MBUS_CSI2_CHANNELS (V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1 | \
54 V4L2_MBUS_CSI2_CHANNEL_2 | V4L2_MBUS_CSI2_CHANNEL_3)
55
56/**
57 * v4l2_mbus_type - media bus type
58 * @V4L2_MBUS_PARALLEL: parallel interface with hsync and vsync
59 * @V4L2_MBUS_BT656: parallel interface with embedded synchronisation, can
60 * also be used for BT.1120
61 * @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface
62 */
63enum v4l2_mbus_type {
64 V4L2_MBUS_PARALLEL,
65 V4L2_MBUS_BT656,
66 V4L2_MBUS_CSI2,
67};
68
69/**
70 * v4l2_mbus_config - media bus configuration
71 * @type: in: interface type
72 * @flags: in / out: configuration flags, depending on @type
73 */
74struct v4l2_mbus_config {
75 enum v4l2_mbus_type type;
76 unsigned int flags;
77};
78
16static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, 79static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
17 const struct v4l2_mbus_framefmt *mbus_fmt) 80 const struct v4l2_mbus_framefmt *mbus_fmt)
18{ 81{
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 2884e3e69cb1..257da1a30f66 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -229,6 +229,12 @@ struct v4l2_subdev_audio_ops {
229 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 229 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
230 video input devices. 230 video input devices.
231 231
232 g_std_output: get current standard for video OUTPUT devices. This is ignored
233 by video input devices.
234
235 g_tvnorms_output: get v4l2_std_id with all standards supported by video
236 OUTPUT device. This is ignored by video input devices.
237
232 s_crystal_freq: sets the frequency of the crystal used to generate the 238 s_crystal_freq: sets the frequency of the crystal used to generate the
233 clocks in Hz. An extra flags field allows device specific configuration 239 clocks in Hz. An extra flags field allows device specific configuration
234 regarding clock frequency dividers, etc. If not used, then set flags 240 regarding clock frequency dividers, etc. If not used, then set flags
@@ -243,6 +249,8 @@ struct v4l2_subdev_audio_ops {
243 s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to 249 s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to
244 s_std() 250 s_std()
245 251
252 g_dv_preset: get current dv (Digital Video) preset in the sub device.
253
246 query_dv_preset: query dv preset in the sub device. This is similar to 254 query_dv_preset: query dv preset in the sub device. This is similar to
247 querystd() 255 querystd()
248 256
@@ -259,12 +267,20 @@ struct v4l2_subdev_audio_ops {
259 try_mbus_fmt: try to set a pixel format on a video data source 267 try_mbus_fmt: try to set a pixel format on a video data source
260 268
261 s_mbus_fmt: set a pixel format on a video data source 269 s_mbus_fmt: set a pixel format on a video data source
270
271 g_mbus_config: get supported mediabus configurations
272
273 s_mbus_config: set a certain mediabus configuration. This operation is added
274 for compatibility with soc-camera drivers and should not be used by new
275 software.
262 */ 276 */
263struct v4l2_subdev_video_ops { 277struct v4l2_subdev_video_ops {
264 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 278 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
265 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); 279 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags);
266 int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); 280 int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std);
281 int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
267 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); 282 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
283 int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
268 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); 284 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
269 int (*s_stream)(struct v4l2_subdev *sd, int enable); 285 int (*s_stream)(struct v4l2_subdev *sd, int enable);
270 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); 286 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
@@ -282,6 +298,8 @@ struct v4l2_subdev_video_ops {
282 struct v4l2_dv_enum_preset *preset); 298 struct v4l2_dv_enum_preset *preset);
283 int (*s_dv_preset)(struct v4l2_subdev *sd, 299 int (*s_dv_preset)(struct v4l2_subdev *sd,
284 struct v4l2_dv_preset *preset); 300 struct v4l2_dv_preset *preset);
301 int (*g_dv_preset)(struct v4l2_subdev *sd,
302 struct v4l2_dv_preset *preset);
285 int (*query_dv_preset)(struct v4l2_subdev *sd, 303 int (*query_dv_preset)(struct v4l2_subdev *sd,
286 struct v4l2_dv_preset *preset); 304 struct v4l2_dv_preset *preset);
287 int (*s_dv_timings)(struct v4l2_subdev *sd, 305 int (*s_dv_timings)(struct v4l2_subdev *sd,
@@ -298,6 +316,10 @@ struct v4l2_subdev_video_ops {
298 struct v4l2_mbus_framefmt *fmt); 316 struct v4l2_mbus_framefmt *fmt);
299 int (*s_mbus_fmt)(struct v4l2_subdev *sd, 317 int (*s_mbus_fmt)(struct v4l2_subdev *sd,
300 struct v4l2_mbus_framefmt *fmt); 318 struct v4l2_mbus_framefmt *fmt);
319 int (*g_mbus_config)(struct v4l2_subdev *sd,
320 struct v4l2_mbus_config *cfg);
321 int (*s_mbus_config)(struct v4l2_subdev *sd,
322 const struct v4l2_mbus_config *cfg);
301}; 323};
302 324
303/* 325/*
@@ -513,8 +535,6 @@ struct v4l2_subdev {
513 void *host_priv; 535 void *host_priv;
514 /* subdev device node */ 536 /* subdev device node */
515 struct video_device devnode; 537 struct video_device devnode;
516 /* number of events to be allocated on open */
517 unsigned int nevents;
518}; 538};
519 539
520#define media_entity_to_v4l2_subdev(ent) \ 540#define media_entity_to_v4l2_subdev(ent) \
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 342dcf13d039..a6326ef8ade6 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -288,6 +288,35 @@ enum p9_perm_t {
288 P9_DMSETVTX = 0x00010000, 288 P9_DMSETVTX = 0x00010000,
289}; 289};
290 290
291/* 9p2000.L open flags */
292#define P9_DOTL_RDONLY 00000000
293#define P9_DOTL_WRONLY 00000001
294#define P9_DOTL_RDWR 00000002
295#define P9_DOTL_NOACCESS 00000003
296#define P9_DOTL_CREATE 00000100
297#define P9_DOTL_EXCL 00000200
298#define P9_DOTL_NOCTTY 00000400
299#define P9_DOTL_TRUNC 00001000
300#define P9_DOTL_APPEND 00002000
301#define P9_DOTL_NONBLOCK 00004000
302#define P9_DOTL_DSYNC 00010000
303#define P9_DOTL_FASYNC 00020000
304#define P9_DOTL_DIRECT 00040000
305#define P9_DOTL_LARGEFILE 00100000
306#define P9_DOTL_DIRECTORY 00200000
307#define P9_DOTL_NOFOLLOW 00400000
308#define P9_DOTL_NOATIME 01000000
309#define P9_DOTL_CLOEXEC 02000000
310#define P9_DOTL_SYNC 04000000
311
312/* 9p2000.L at flags */
313#define P9_DOTL_AT_REMOVEDIR 0x200
314
315/* 9p2000.L lock type */
316#define P9_LOCK_TYPE_RDLCK 0
317#define P9_LOCK_TYPE_WRLCK 1
318#define P9_LOCK_TYPE_UNLCK 2
319
291/** 320/**
292 * enum p9_qid_t - QID types 321 * enum p9_qid_t - QID types
293 * @P9_QTDIR: directory 322 * @P9_QTDIR: directory
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 206d22297ac3..94e09d361bb1 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -11,7 +11,7 @@
11#include <linux/timer.h> 11#include <linux/timer.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <asm/atomic.h> 14#include <linux/atomic.h>
15 15
16#define AX25_T1CLAMPLO 1 16#define AX25_T1CLAMPLO 1
17#define AX25_T1CLAMPHI (30 * HZ) 17#define AX25_T1CLAMPHI (30 * HZ)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d17f47fc9e31..401d73bd151f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1744,6 +1744,8 @@ struct wiphy_wowlan_support {
1744 * by default for perm_addr. In this case, the mask should be set to 1744 * by default for perm_addr. In this case, the mask should be set to
1745 * all-zeroes. In this case it is assumed that the device can handle 1745 * all-zeroes. In this case it is assumed that the device can handle
1746 * the same number of arbitrary MAC addresses. 1746 * the same number of arbitrary MAC addresses.
1747 * @registered: protects ->resume and ->suspend sysfs callbacks against
1748 * unregister hardware
1747 * @debugfsdir: debugfs directory used for this wiphy, will be renamed 1749 * @debugfsdir: debugfs directory used for this wiphy, will be renamed
1748 * automatically on wiphy renames 1750 * automatically on wiphy renames
1749 * @dev: (virtual) struct device for this wiphy 1751 * @dev: (virtual) struct device for this wiphy
@@ -1865,6 +1867,9 @@ struct wiphy {
1865 * you need use set_wiphy_dev() (see below) */ 1867 * you need use set_wiphy_dev() (see below) */
1866 struct device dev; 1868 struct device dev;
1867 1869
1870 /* protects ->resume, ->suspend sysfs callbacks against unregister hw */
1871 bool registered;
1872
1868 /* dir in debugfs: ieee80211/<wiphyname> */ 1873 /* dir in debugfs: ieee80211/<wiphyname> */
1869 struct dentry *debugfsdir; 1874 struct dentry *debugfsdir;
1870 1875
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index abd443604c9f..9808877c2ab9 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -8,7 +8,7 @@
8 * have chosen to adopt the protocol and over the years it has become a 8 * have chosen to adopt the protocol and over the years it has become a
9 * de-facto standard for labeled networking. 9 * de-facto standard for labeled networking.
10 * 10 *
11 * Author: Paul Moore <paul.moore@hp.com> 11 * Author: Paul Moore <paul@paul-moore.com>
12 * 12 *
13 */ 13 */
14 14
@@ -41,7 +41,7 @@
41#include <linux/skbuff.h> 41#include <linux/skbuff.h>
42#include <net/netlabel.h> 42#include <net/netlabel.h>
43#include <net/request_sock.h> 43#include <net/request_sock.h>
44#include <asm/atomic.h> 44#include <linux/atomic.h>
45 45
46/* known doi values */ 46/* known doi values */
47#define CIPSO_V4_DOI_UNKNOWN 0x00000000 47#define CIPSO_V4_DOI_UNKNOWN 0x00000000
diff --git a/include/net/dst.h b/include/net/dst.h
index 29e255796ce1..13d507d69ddb 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -37,7 +37,7 @@ struct dst_entry {
37 unsigned long _metrics; 37 unsigned long _metrics;
38 unsigned long expires; 38 unsigned long expires;
39 struct dst_entry *path; 39 struct dst_entry *path;
40 struct neighbour *_neighbour; 40 struct neighbour __rcu *_neighbour;
41#ifdef CONFIG_XFRM 41#ifdef CONFIG_XFRM
42 struct xfrm_state *xfrm; 42 struct xfrm_state *xfrm;
43#else 43#else
@@ -88,12 +88,17 @@ struct dst_entry {
88 88
89static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst) 89static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
90{ 90{
91 return dst->_neighbour; 91 return rcu_dereference(dst->_neighbour);
92}
93
94static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst)
95{
96 return rcu_dereference_raw(dst->_neighbour);
92} 97}
93 98
94static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) 99static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
95{ 100{
96 dst->_neighbour = neigh; 101 rcu_assign_pointer(dst->_neighbour, neigh);
97} 102}
98 103
99extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); 104extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
@@ -382,8 +387,12 @@ static inline void dst_rcu_free(struct rcu_head *head)
382static inline void dst_confirm(struct dst_entry *dst) 387static inline void dst_confirm(struct dst_entry *dst)
383{ 388{
384 if (dst) { 389 if (dst) {
385 struct neighbour *n = dst_get_neighbour(dst); 390 struct neighbour *n;
391
392 rcu_read_lock();
393 n = dst_get_neighbour(dst);
386 neigh_confirm(n); 394 neigh_confirm(n);
395 rcu_read_unlock();
387 } 396 }
388} 397}
389 398
diff --git a/include/net/flow.h b/include/net/flow.h
index c6d5fe5ec1bf..78113daadd63 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -8,7 +8,7 @@
8#define _NET_FLOW_H 8#define _NET_FLOW_H
9 9
10#include <linux/in6.h> 10#include <linux/in6.h>
11#include <asm/atomic.h> 11#include <linux/atomic.h>
12 12
13struct flowi_common { 13struct flowi_common {
14 int flowic_oif; 14 int flowic_oif;
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index e9c2ed8af864..808fc5f76b03 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -33,7 +33,7 @@
33#include <net/tcp_states.h> 33#include <net/tcp_states.h>
34#include <net/netns/hash.h> 34#include <net/netns/hash.h>
35 35
36#include <asm/atomic.h> 36#include <linux/atomic.h>
37#include <asm/byteorder.h> 37#include <asm/byteorder.h>
38 38
39/* This is for all connections with a full identity, no wildcards. 39/* This is for all connections with a full identity, no wildcards.
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index caaff5f5f39f..b897d6e6d0a5 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -238,7 +238,7 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
238{ 238{
239 __u8 flags = 0; 239 __u8 flags = 0;
240 240
241 if (inet_sk(sk)->transparent) 241 if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl)
242 flags |= FLOWI_FLAG_ANYSRC; 242 flags |= FLOWI_FLAG_ANYSRC;
243 if (sk->sk_protocol == IPPROTO_TCP) 243 if (sk->sk_protocol == IPPROTO_TCP)
244 flags |= FLOWI_FLAG_PRECOW_METRICS; 244 flags |= FLOWI_FLAG_PRECOW_METRICS;
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 17404b5388a7..f1a770977c4f 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -28,7 +28,7 @@
28#include <net/tcp_states.h> 28#include <net/tcp_states.h>
29#include <net/timewait_sock.h> 29#include <net/timewait_sock.h>
30 30
31#include <asm/atomic.h> 31#include <linux/atomic.h>
32 32
33struct inet_hashinfo; 33struct inet_hashinfo;
34 34
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 4233e6f9841d..78c83e62218f 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -13,7 +13,7 @@
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/rtnetlink.h> 14#include <linux/rtnetlink.h>
15#include <net/ipv6.h> 15#include <net/ipv6.h>
16#include <asm/atomic.h> 16#include <linux/atomic.h>
17 17
18struct inetpeer_addr_base { 18struct inetpeer_addr_base {
19 union { 19 union {
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index b1370c4015b6..1aaf915656f3 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -13,7 +13,7 @@
13#include <linux/sysctl.h> /* for ctl_path */ 13#include <linux/sysctl.h> /* for ctl_path */
14#include <linux/list.h> /* for struct list_head */ 14#include <linux/list.h> /* for struct list_head */
15#include <linux/spinlock.h> /* for struct rwlock_t */ 15#include <linux/spinlock.h> /* for struct rwlock_t */
16#include <asm/atomic.h> /* for struct atomic_t */ 16#include <linux/atomic.h> /* for struct atomic_t */
17#include <linux/compiler.h> 17#include <linux/compiler.h>
18#include <linux/timer.h> 18#include <linux/timer.h>
19 19
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
index 848cce1bb7a5..b95bbb083ee8 100644
--- a/include/net/lib80211.h
+++ b/include/net/lib80211.h
@@ -26,7 +26,7 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <asm/atomic.h> 29#include <linux/atomic.h>
30#include <linux/if.h> 30#include <linux/if.h>
31#include <linux/skbuff.h> 31#include <linux/skbuff.h>
32#include <linux/ieee80211.h> 32#include <linux/ieee80211.h>
diff --git a/include/net/llc.h b/include/net/llc.h
index 5503b74ab170..226c846cab08 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -20,7 +20,7 @@
20#include <linux/hash.h> 20#include <linux/hash.h>
21#include <linux/jhash.h> 21#include <linux/jhash.h>
22 22
23#include <asm/atomic.h> 23#include <linux/atomic.h>
24 24
25struct net_device; 25struct net_device;
26struct packet_type; 26struct packet_type;
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 4ba8521490ba..2720884287c3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -16,7 +16,7 @@
16 * - Add neighbour cache statistics like rtstat 16 * - Add neighbour cache statistics like rtstat
17 */ 17 */
18 18
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20#include <linux/netdevice.h> 20#include <linux/netdevice.h>
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <linux/rcupdate.h> 22#include <linux/rcupdate.h>
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 1ab1aec209ac..3bb6fa0eace0 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -4,7 +4,7 @@
4#ifndef __NET_NET_NAMESPACE_H 4#ifndef __NET_NET_NAMESPACE_H
5#define __NET_NET_NAMESPACE_H 5#define __NET_NET_NAMESPACE_H
6 6
7#include <asm/atomic.h> 7#include <linux/atomic.h>
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9#include <linux/list.h> 9#include <linux/list.h>
10#include <linux/sysctl.h> 10#include <linux/sysctl.h>
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 5d4f8e586e32..0b7f05e4a927 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -16,7 +16,7 @@
16 16
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21#include <linux/netfilter/nf_conntrack_tcp.h> 21#include <linux/netfilter/nf_conntrack_tcp.h>
22#include <linux/netfilter/nf_conntrack_dccp.h> 22#include <linux/netfilter/nf_conntrack_dccp.h>
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 9db401a8b4d9..f67440970d7e 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -4,7 +4,7 @@
4 * The NetLabel system manages static and dynamic label mappings for network 4 * The NetLabel system manages static and dynamic label mappings for network
5 * protocols such as CIPSO and RIPSO. 5 * protocols such as CIPSO and RIPSO.
6 * 6 *
7 * Author: Paul Moore <paul.moore@hp.com> 7 * Author: Paul Moore <paul@paul-moore.com>
8 * 8 *
9 */ 9 */
10 10
@@ -38,7 +38,7 @@
38#include <linux/in6.h> 38#include <linux/in6.h>
39#include <net/netlink.h> 39#include <net/netlink.h>
40#include <net/request_sock.h> 40#include <net/request_sock.h>
41#include <asm/atomic.h> 41#include <linux/atomic.h>
42 42
43struct cipso_v4_doi; 43struct cipso_v4_doi;
44 44
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 341eb089349e..0249399e51a7 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/list_nulls.h> 5#include <linux/list_nulls.h>
6#include <asm/atomic.h> 6#include <linux/atomic.h>
7 7
8struct ctl_table_header; 8struct ctl_table_header;
9struct nf_conntrack_ecache; 9struct nf_conntrack_ecache;
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 31d7ea2e1d2a..f7d9c3fc06fd 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -60,7 +60,7 @@
60#include <linux/in6.h> /* We get struct in6_addr */ 60#include <linux/in6.h> /* We get struct in6_addr */
61#include <linux/ipv6.h> 61#include <linux/ipv6.h>
62#include <asm/param.h> /* We get MAXHOSTNAMELEN. */ 62#include <asm/param.h> /* We get MAXHOSTNAMELEN. */
63#include <asm/atomic.h> /* This gets us atomic counters. */ 63#include <linux/atomic.h> /* This gets us atomic counters. */
64#include <linux/skbuff.h> /* We need sk_buff_head. */ 64#include <linux/skbuff.h> /* We need sk_buff_head. */
65#include <linux/workqueue.h> /* We need tq_struct. */ 65#include <linux/workqueue.h> /* We need tq_struct. */
66#include <linux/sctp.h> /* We need sctp* header structs. */ 66#include <linux/sctp.h> /* We need sctp* header structs. */
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
new file mode 100644
index 000000000000..d97f6892c019
--- /dev/null
+++ b/include/net/secure_seq.h
@@ -0,0 +1,20 @@
1#ifndef _NET_SECURE_SEQ
2#define _NET_SECURE_SEQ
3
4#include <linux/types.h>
5
6extern __u32 secure_ip_id(__be32 daddr);
7extern __u32 secure_ipv6_id(const __be32 daddr[4]);
8extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
9extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
10 __be16 dport);
11extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
12 __be16 sport, __be16 dport);
13extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
14 __be16 sport, __be16 dport);
15extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
16 __be16 sport, __be16 dport);
17extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,
18 __be16 sport, __be16 dport);
19
20#endif /* _NET_SECURE_SEQ */
diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h
index 63e5b8f6b7dd..00dbfac9c6e1 100644
--- a/include/pcmcia/device_id.h
+++ b/include/pcmcia/device_id.h
@@ -95,6 +95,15 @@
95 .prod_id = { (v1), NULL, NULL, NULL }, \ 95 .prod_id = { (v1), NULL, NULL, NULL }, \
96 .prod_id_hash = { (vh1), 0, 0, 0 }, } 96 .prod_id_hash = { (vh1), 0, 0, 0 }, }
97 97
98#define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
99 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
100 PCMCIA_DEV_ID_MATCH_CARD_ID| \
101 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
102 .manf_id = (manf), \
103 .card_id = (card), \
104 .prod_id = { NULL, NULL, (v3), NULL }, \
105 .prod_id_hash = { 0, 0, (vh3), 0 }, }
106
98 107
99/* multi-function devices */ 108/* multi-function devices */
100 109
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 7b82080eb02c..3bbbd78e1439 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -26,7 +26,7 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
29#include <asm/atomic.h> 29#include <linux/atomic.h>
30 30
31 31
32/* 32/*
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h
index 1082afaed158..d44a56388a3e 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -38,7 +38,7 @@
38#include <linux/completion.h> 38#include <linux/completion.h>
39#include <linux/compiler.h> 39#include <linux/compiler.h>
40 40
41#include <asm/atomic.h> 41#include <linux/atomic.h>
42 42
43#include <rdma/ib_verbs.h> 43#include <rdma/ib_verbs.h>
44#include <rdma/ib_mad.h> 44#include <rdma/ib_mad.h>
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index bf4306aea169..228be3e220d9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -49,7 +49,7 @@
49#include <linux/scatterlist.h> 49#include <linux/scatterlist.h>
50#include <linux/workqueue.h> 50#include <linux/workqueue.h>
51 51
52#include <asm/atomic.h> 52#include <linux/atomic.h>
53#include <asm/uaccess.h> 53#include <asm/uaccess.h>
54 54
55extern struct workqueue_struct *ib_wq; 55extern struct workqueue_struct *ib_wq;
diff --git a/include/rxrpc/types.h b/include/rxrpc/types.h
index 327a5fc4719c..30d48f6da228 100644
--- a/include/rxrpc/types.h
+++ b/include/rxrpc/types.h
@@ -17,7 +17,7 @@
17#include <linux/socket.h> 17#include <linux/socket.h>
18#include <linux/in.h> 18#include <linux/in.h>
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21 21
22typedef uint32_t rxrpc_seq_t; /* Rx message sequence number */ 22typedef uint32_t rxrpc_seq_t; /* Rx message sequence number */
23typedef uint32_t rxrpc_serial_t; /* Rx message serial number */ 23typedef uint32_t rxrpc_serial_t; /* Rx message serial number */
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index 4ad02041b667..8225d8063ec4 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -78,7 +78,6 @@ struct fc_frame {
78}; 78};
79 79
80struct fcoe_rcv_info { 80struct fcoe_rcv_info {
81 struct packet_type *ptype;
82 struct fc_lport *fr_dev; /* transport layer private pointer */ 81 struct fc_lport *fr_dev; /* transport layer private pointer */
83 struct fc_seq *fr_seq; /* for use with exchange manager */ 82 struct fc_seq *fr_seq; /* for use with exchange manager */
84 struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */ 83 struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index ea68b3c56dbf..988ba06b3ad6 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -29,10 +29,40 @@
29/* default iSCSI listen port for incoming connections */ 29/* default iSCSI listen port for incoming connections */
30#define ISCSI_LISTEN_PORT 3260 30#define ISCSI_LISTEN_PORT 3260
31 31
32/* iSCSI header length */
33#define ISCSI_HDR_LEN 48
34
35/* iSCSI CRC32C length */
36#define ISCSI_CRC_LEN 4
37
32/* Padding word length */ 38/* Padding word length */
33#define ISCSI_PAD_LEN 4 39#define ISCSI_PAD_LEN 4
34 40
35/* 41/*
42 * Serial Number Arithmetic, 32 bits, RFC1982
43 */
44
45static inline int iscsi_sna_lt(u32 n1, u32 n2)
46{
47 return (s32)(n1 - n2) < 0;
48}
49
50static inline int iscsi_sna_lte(u32 n1, u32 n2)
51{
52 return (s32)(n1 - n2) <= 0;
53}
54
55static inline int iscsi_sna_gt(u32 n1, u32 n2)
56{
57 return (s32)(n1 - n2) > 0;
58}
59
60static inline int iscsi_sna_gte(u32 n1, u32 n2)
61{
62 return (s32)(n1 - n2) >= 0;
63}
64
65/*
36 * useful common(control and data pathes) macro 66 * useful common(control and data pathes) macro
37 */ 67 */
38#define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2])) 68#define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2]))
@@ -116,7 +146,7 @@ struct iscsi_ahs_hdr {
116#define ISCSI_CDB_SIZE 16 146#define ISCSI_CDB_SIZE 16
117 147
118/* iSCSI PDU Header */ 148/* iSCSI PDU Header */
119struct iscsi_cmd { 149struct iscsi_scsi_req {
120 uint8_t opcode; 150 uint8_t opcode;
121 uint8_t flags; 151 uint8_t flags;
122 __be16 rsvd2; 152 __be16 rsvd2;
@@ -161,7 +191,7 @@ struct iscsi_ecdb_ahdr {
161}; 191};
162 192
163/* SCSI Response Header */ 193/* SCSI Response Header */
164struct iscsi_cmd_rsp { 194struct iscsi_scsi_rsp {
165 uint8_t opcode; 195 uint8_t opcode;
166 uint8_t flags; 196 uint8_t flags;
167 uint8_t response; 197 uint8_t response;
@@ -406,7 +436,7 @@ struct iscsi_text_rsp {
406}; 436};
407 437
408/* Login Header */ 438/* Login Header */
409struct iscsi_login { 439struct iscsi_login_req {
410 uint8_t opcode; 440 uint8_t opcode;
411 uint8_t flags; 441 uint8_t flags;
412 uint8_t max_version; /* Max. version supported */ 442 uint8_t max_version; /* Max. version supported */
@@ -427,7 +457,13 @@ struct iscsi_login {
427#define ISCSI_FLAG_LOGIN_TRANSIT 0x80 457#define ISCSI_FLAG_LOGIN_TRANSIT 0x80
428#define ISCSI_FLAG_LOGIN_CONTINUE 0x40 458#define ISCSI_FLAG_LOGIN_CONTINUE 0x40
429#define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */ 459#define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */
460#define ISCSI_FLAG_LOGIN_CURRENT_STAGE1 0x04
461#define ISCSI_FLAG_LOGIN_CURRENT_STAGE2 0x08
462#define ISCSI_FLAG_LOGIN_CURRENT_STAGE3 0x0C
430#define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */ 463#define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */
464#define ISCSI_FLAG_LOGIN_NEXT_STAGE1 0x01
465#define ISCSI_FLAG_LOGIN_NEXT_STAGE2 0x02
466#define ISCSI_FLAG_LOGIN_NEXT_STAGE3 0x03
431 467
432#define ISCSI_LOGIN_CURRENT_STAGE(flags) \ 468#define ISCSI_LOGIN_CURRENT_STAGE(flags) \
433 ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2) 469 ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2)
@@ -550,17 +586,25 @@ struct iscsi_logout_rsp {
550struct iscsi_snack { 586struct iscsi_snack {
551 uint8_t opcode; 587 uint8_t opcode;
552 uint8_t flags; 588 uint8_t flags;
553 uint8_t rsvd2[14]; 589 uint8_t rsvd2[2];
590 uint8_t hlength;
591 uint8_t dlength[3];
592 uint8_t lun[8];
554 itt_t itt; 593 itt_t itt;
594 __be32 ttt;
595 uint8_t rsvd3[4];
596 __be32 exp_statsn;
597 uint8_t rsvd4[8];
555 __be32 begrun; 598 __be32 begrun;
556 __be32 runlength; 599 __be32 runlength;
557 __be32 exp_statsn;
558 __be32 rsvd3;
559 __be32 exp_datasn;
560 uint8_t rsvd6[8];
561}; 600};
562 601
563/* SNACK PDU flags */ 602/* SNACK PDU flags */
603#define ISCSI_FLAG_SNACK_TYPE_DATA 0
604#define ISCSI_FLAG_SNACK_TYPE_R2T 0
605#define ISCSI_FLAG_SNACK_TYPE_STATUS 1
606#define ISCSI_FLAG_SNACK_TYPE_DATA_ACK 2
607#define ISCSI_FLAG_SNACK_TYPE_RDATA 3
564#define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */ 608#define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */
565 609
566/* Reject Message Header */ 610/* Reject Message Header */
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
new file mode 100644
index 000000000000..c5c5e008e6de
--- /dev/null
+++ b/include/scsi/osd_ore.h
@@ -0,0 +1,125 @@
1/*
2 * Copyright (C) 2011
3 * Boaz Harrosh <bharrosh@panasas.com>
4 *
5 * Public Declarations of the ORE API
6 *
7 * This file is part of the ORE (Object Raid Engine) library.
8 *
9 * ORE is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation. (GPL v2)
12 *
13 * ORE is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with the ORE; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22#ifndef __ORE_H__
23#define __ORE_H__
24
25#include <scsi/osd_initiator.h>
26#include <scsi/osd_attributes.h>
27#include <scsi/osd_sec.h>
28#include <linux/pnfs_osd_xdr.h>
29
30struct ore_comp {
31 struct osd_obj_id obj;
32 u8 cred[OSD_CAP_LEN];
33};
34
35struct ore_layout {
36 /* Our way of looking at the data_map */
37 unsigned stripe_unit;
38 unsigned mirrors_p1;
39
40 unsigned group_width;
41 u64 group_depth;
42 unsigned group_count;
43};
44
45struct ore_components {
46 unsigned numdevs; /* Num of devices in array */
47 /* If @single_comp == EC_SINGLE_COMP, @comps points to a single
48 * component. else there are @numdevs components
49 */
50 enum EC_COMP_USAGE {
51 EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff
52 } single_comp;
53 struct ore_comp *comps;
54 struct osd_dev **ods; /* osd_dev array */
55};
56
57struct ore_io_state;
58typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private);
59
60struct ore_io_state {
61 struct kref kref;
62
63 void *private;
64 ore_io_done_fn done;
65
66 struct ore_layout *layout;
67 struct ore_components *comps;
68
69 /* Global read/write IO*/
70 loff_t offset;
71 unsigned long length;
72 void *kern_buff;
73
74 struct page **pages;
75 unsigned nr_pages;
76 unsigned pgbase;
77 unsigned pages_consumed;
78
79 /* Attributes */
80 unsigned in_attr_len;
81 struct osd_attr *in_attr;
82 unsigned out_attr_len;
83 struct osd_attr *out_attr;
84
85 bool reading;
86
87 /* Variable array of size numdevs */
88 unsigned numdevs;
89 struct ore_per_dev_state {
90 struct osd_request *or;
91 struct bio *bio;
92 loff_t offset;
93 unsigned length;
94 unsigned dev;
95 } per_dev[];
96};
97
98static inline unsigned ore_io_state_size(unsigned numdevs)
99{
100 return sizeof(struct ore_io_state) +
101 sizeof(struct ore_per_dev_state) * numdevs;
102}
103
104/* ore.c */
105int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
106 bool is_reading, u64 offset, u64 length,
107 struct ore_io_state **ios);
108int ore_get_io_state(struct ore_layout *layout, struct ore_components *comps,
109 struct ore_io_state **ios);
110void ore_put_io_state(struct ore_io_state *ios);
111
112int ore_check_io(struct ore_io_state *ios, u64 *resid);
113
114int ore_create(struct ore_io_state *ios);
115int ore_remove(struct ore_io_state *ios);
116int ore_write(struct ore_io_state *ios);
117int ore_read(struct ore_io_state *ios);
118int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
119 u64 size);
120
121int extract_attr_from_ios(struct ore_io_state *ios, struct osd_attr *attr);
122
123extern const struct osd_attr g_attr_logical_length;
124
125#endif
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index dd82e02ddde3..d371c3ca90c3 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -7,7 +7,7 @@
7#include <linux/workqueue.h> 7#include <linux/workqueue.h>
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <scsi/scsi.h> 9#include <scsi/scsi.h>
10#include <asm/atomic.h> 10#include <linux/atomic.h>
11 11
12struct request_queue; 12struct request_queue;
13struct scsi_cmnd; 13struct scsi_cmnd;
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index e1bad1130616..57e71fa33f7c 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -507,6 +507,18 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
507void snd_pcm_vma_notify_data(void *client, void *data); 507void snd_pcm_vma_notify_data(void *client, void *data);
508int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); 508int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
509 509
510
511#ifdef CONFIG_SND_DEBUG
512void snd_pcm_debug_name(struct snd_pcm_substream *substream,
513 char *name, size_t len);
514#else
515static inline void
516snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
517{
518 *buf = 0;
519}
520#endif
521
510/* 522/*
511 * PCM library 523 * PCM library
512 */ 524 */
@@ -749,17 +761,18 @@ static inline const struct snd_interval *hw_param_interval_c(const struct snd_pc
749 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 761 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
750} 762}
751 763
752#define params_access(p) ((__force snd_pcm_access_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))) 764#define params_channels(p) \
753#define params_format(p) ((__force snd_pcm_format_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT))) 765 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min)
754#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) 766#define params_rate(p) \
755#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min 767 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_RATE)->min)
756#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min 768#define params_period_size(p) \
757#define params_period_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min 769 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min)
758#define params_period_bytes(p) ((params_period_size(p)*snd_pcm_format_physical_width(params_format(p))*params_channels(p))/8) 770#define params_periods(p) \
759#define params_periods(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIODS)->min 771 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIODS)->min)
760#define params_buffer_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min 772#define params_buffer_size(p) \
761#define params_buffer_bytes(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min 773 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min)
762 774#define params_buffer_bytes(p) \
775 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min)
763 776
764int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v); 777int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
765void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 778void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 85cf1cf4f31a..f494f1e3c900 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -337,5 +337,19 @@ static inline unsigned int sub(unsigned int a, unsigned int b)
337 return 0; 337 return 0;
338} 338}
339 339
340#endif /* __SOUND_PCM_PARAMS_H */ 340#define params_access(p) ((__force snd_pcm_access_t)\
341 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_ACCESS)))
342#define params_format(p) ((__force snd_pcm_format_t)\
343 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_FORMAT)))
344#define params_subformat(p) \
345 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_SUBFORMAT))
341 346
347static inline unsigned int
348params_period_bytes(const struct snd_pcm_hw_params *p)
349{
350 return (params_period_size(p) *
351 snd_pcm_format_physical_width(params_format(p)) *
352 params_channels(p)) / 8;
353}
354
355#endif /* __SOUND_PCM_PARAMS_H */
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index e09505c5a490..e0583b7769cb 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -266,6 +266,12 @@
266 .get = snd_soc_dapm_get_enum_virt, \ 266 .get = snd_soc_dapm_get_enum_virt, \
267 .put = snd_soc_dapm_put_enum_virt, \ 267 .put = snd_soc_dapm_put_enum_virt, \
268 .private_value = (unsigned long)&xenum } 268 .private_value = (unsigned long)&xenum }
269#define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \
270{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
271 .info = snd_soc_info_enum_double, \
272 .get = xget, \
273 .put = xput, \
274 .private_value = (unsigned long)&xenum }
269#define SOC_DAPM_VALUE_ENUM(xname, xenum) \ 275#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
270{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 276{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
271 .info = snd_soc_info_enum_double, \ 277 .info = snd_soc_info_enum_double, \
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index d2ea112fc20f..726e94742a5c 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -23,8 +23,8 @@
23 */ 23 */
24 24
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <media/v4l2-ctrls.h>
26#include <media/v4l2-dev.h> 27#include <media/v4l2-dev.h>
27#include <media/v4l2-ioctl.h>
28 28
29#define TEA575X_FMIF 10700 29#define TEA575X_FMIF 10700
30 30
@@ -42,18 +42,20 @@ struct snd_tea575x_ops {
42}; 42};
43 43
44struct snd_tea575x { 44struct snd_tea575x {
45 struct video_device *vd; /* video device */ 45 struct video_device vd; /* video device */
46 bool tea5759; /* 5759 chip is present */ 46 bool tea5759; /* 5759 chip is present */
47 bool mute; /* Device is muted? */ 47 bool mute; /* Device is muted? */
48 bool stereo; /* receiving stereo */ 48 bool stereo; /* receiving stereo */
49 bool tuned; /* tuned to a station */ 49 bool tuned; /* tuned to a station */
50 unsigned int val; /* hw value */ 50 unsigned int val; /* hw value */
51 unsigned long freq; /* frequency */ 51 unsigned long freq; /* frequency */
52 unsigned long in_use; /* set if the device is in use */ 52 struct mutex mutex;
53 struct snd_tea575x_ops *ops; 53 struct snd_tea575x_ops *ops;
54 void *private_data; 54 void *private_data;
55 u8 card[32]; 55 u8 card[32];
56 u8 bus_info[32]; 56 u8 bus_info[32];
57 struct v4l2_ctrl_handler ctrl_handler;
58 int (*ext_init)(struct snd_tea575x *tea);
57}; 59};
58 60
59int snd_tea575x_init(struct snd_tea575x *tea); 61int snd_tea575x_init(struct snd_tea575x *tea);
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h
index 99e0308bf2c2..ffd9bc793105 100644
--- a/include/sound/tlv320aic3x.h
+++ b/include/sound/tlv320aic3x.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Platform data for Texas Instruments TLV320AIC3x codec 2 * Platform data for Texas Instruments TLV320AIC3x codec
3 * 3 *
4 * Author: Jarkko Nikula <jhnikula@gmail.com> 4 * Author: Jarkko Nikula <jarkko.nikula@bitmer.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/include/sound/wm8915.h b/include/sound/wm8996.h
index 5817d762f6f3..ea4d88f43975 100644
--- a/include/sound/wm8915.h
+++ b/include/sound/wm8996.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/sound/wm8915.h -- Platform data for WM8915 2 * linux/sound/wm8996.h -- Platform data for WM8996
3 * 3 *
4 * Copyright 2011 Wolfson Microelectronics. PLC. 4 * Copyright 2011 Wolfson Microelectronics. PLC.
5 * 5 *
@@ -8,14 +8,14 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#ifndef __LINUX_SND_WM8903_H 11#ifndef __LINUX_SND_WM8996_H
12#define __LINUX_SND_WM8903_H 12#define __LINUX_SND_WM8996_H
13 13
14enum wm8915_inmode { 14enum wm8996_inmode {
15 WM8915_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */ 15 WM8996_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */
16 WM8915_INVERTING = 1, /* IN1xN */ 16 WM8996_INVERTING = 1, /* IN1xN */
17 WM8915_NON_INVERTING = 2, /* IN1xP */ 17 WM8996_NON_INVERTING = 2, /* IN1xP */
18 WM8915_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */ 18 WM8996_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */
19}; 19};
20 20
21/** 21/**
@@ -25,23 +25,23 @@ enum wm8915_inmode {
25 * Configurations are expected to be generated using the ReTune Mobile 25 * Configurations are expected to be generated using the ReTune Mobile
26 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ 26 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
27 */ 27 */
28struct wm8915_retune_mobile_config { 28struct wm8996_retune_mobile_config {
29 const char *name; 29 const char *name;
30 int rate; 30 int rate;
31 u16 regs[20]; 31 u16 regs[20];
32}; 32};
33 33
34#define WM8915_SET_DEFAULT 0x10000 34#define WM8996_SET_DEFAULT 0x10000
35 35
36struct wm8915_pdata { 36struct wm8996_pdata {
37 int irq_flags; /** Set IRQ trigger flags; default active low */ 37 int irq_flags; /** Set IRQ trigger flags; default active low */
38 38
39 int ldo_ena; /** GPIO for LDO1; -1 for none */ 39 int ldo_ena; /** GPIO for LDO1; -1 for none */
40 40
41 int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */ 41 int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */
42 42
43 enum wm8915_inmode inl_mode; 43 enum wm8996_inmode inl_mode;
44 enum wm8915_inmode inr_mode; 44 enum wm8996_inmode inr_mode;
45 45
46 u32 spkmute_seq; /** Value for register 0x802 */ 46 u32 spkmute_seq; /** Value for register 0x802 */
47 47
@@ -49,7 +49,7 @@ struct wm8915_pdata {
49 u32 gpio_default[5]; 49 u32 gpio_default[5];
50 50
51 int num_retune_mobile_cfgs; 51 int num_retune_mobile_cfgs;
52 struct wm8915_retune_mobile_config *retune_mobile_cfgs; 52 struct wm8996_retune_mobile_config *retune_mobile_cfgs;
53}; 53};
54 54
55#endif 55#endif
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index 2de8fe907596..126c675f4f14 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -27,6 +27,12 @@ struct target_core_fabric_ops {
27 int (*tpg_check_demo_mode_cache)(struct se_portal_group *); 27 int (*tpg_check_demo_mode_cache)(struct se_portal_group *);
28 int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); 28 int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *);
29 int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *); 29 int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);
30 /*
31 * Optionally used by fabrics to allow demo-mode login, but not
32 * expose any TPG LUNs, and return 'not connected' in standard
33 * inquiry response
34 */
35 int (*tpg_check_demo_mode_login_only)(struct se_portal_group *);
30 struct se_node_acl *(*tpg_alloc_fabric_acl)( 36 struct se_node_acl *(*tpg_alloc_fabric_acl)(
31 struct se_portal_group *); 37 struct se_portal_group *);
32 void (*tpg_release_fabric_acl)(struct se_portal_group *, 38 void (*tpg_release_fabric_acl)(struct se_portal_group *,
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index bf366547da25..05c5e61f0a7c 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -8,6 +8,8 @@
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
10 10
11#define RWBS_LEN 8
12
11DECLARE_EVENT_CLASS(block_rq_with_error, 13DECLARE_EVENT_CLASS(block_rq_with_error,
12 14
13 TP_PROTO(struct request_queue *q, struct request *rq), 15 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -19,7 +21,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
19 __field( sector_t, sector ) 21 __field( sector_t, sector )
20 __field( unsigned int, nr_sector ) 22 __field( unsigned int, nr_sector )
21 __field( int, errors ) 23 __field( int, errors )
22 __array( char, rwbs, 6 ) 24 __array( char, rwbs, RWBS_LEN )
23 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 25 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
24 ), 26 ),
25 27
@@ -104,7 +106,7 @@ DECLARE_EVENT_CLASS(block_rq,
104 __field( sector_t, sector ) 106 __field( sector_t, sector )
105 __field( unsigned int, nr_sector ) 107 __field( unsigned int, nr_sector )
106 __field( unsigned int, bytes ) 108 __field( unsigned int, bytes )
107 __array( char, rwbs, 6 ) 109 __array( char, rwbs, RWBS_LEN )
108 __array( char, comm, TASK_COMM_LEN ) 110 __array( char, comm, TASK_COMM_LEN )
109 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 111 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
110 ), 112 ),
@@ -183,7 +185,7 @@ TRACE_EVENT(block_bio_bounce,
183 __field( dev_t, dev ) 185 __field( dev_t, dev )
184 __field( sector_t, sector ) 186 __field( sector_t, sector )
185 __field( unsigned int, nr_sector ) 187 __field( unsigned int, nr_sector )
186 __array( char, rwbs, 6 ) 188 __array( char, rwbs, RWBS_LEN )
187 __array( char, comm, TASK_COMM_LEN ) 189 __array( char, comm, TASK_COMM_LEN )
188 ), 190 ),
189 191
@@ -222,7 +224,7 @@ TRACE_EVENT(block_bio_complete,
222 __field( sector_t, sector ) 224 __field( sector_t, sector )
223 __field( unsigned, nr_sector ) 225 __field( unsigned, nr_sector )
224 __field( int, error ) 226 __field( int, error )
225 __array( char, rwbs, 6 ) 227 __array( char, rwbs, RWBS_LEN)
226 ), 228 ),
227 229
228 TP_fast_assign( 230 TP_fast_assign(
@@ -249,7 +251,7 @@ DECLARE_EVENT_CLASS(block_bio,
249 __field( dev_t, dev ) 251 __field( dev_t, dev )
250 __field( sector_t, sector ) 252 __field( sector_t, sector )
251 __field( unsigned int, nr_sector ) 253 __field( unsigned int, nr_sector )
252 __array( char, rwbs, 6 ) 254 __array( char, rwbs, RWBS_LEN )
253 __array( char, comm, TASK_COMM_LEN ) 255 __array( char, comm, TASK_COMM_LEN )
254 ), 256 ),
255 257
@@ -321,7 +323,7 @@ DECLARE_EVENT_CLASS(block_get_rq,
321 __field( dev_t, dev ) 323 __field( dev_t, dev )
322 __field( sector_t, sector ) 324 __field( sector_t, sector )
323 __field( unsigned int, nr_sector ) 325 __field( unsigned int, nr_sector )
324 __array( char, rwbs, 6 ) 326 __array( char, rwbs, RWBS_LEN )
325 __array( char, comm, TASK_COMM_LEN ) 327 __array( char, comm, TASK_COMM_LEN )
326 ), 328 ),
327 329
@@ -456,7 +458,7 @@ TRACE_EVENT(block_split,
456 __field( dev_t, dev ) 458 __field( dev_t, dev )
457 __field( sector_t, sector ) 459 __field( sector_t, sector )
458 __field( sector_t, new_sector ) 460 __field( sector_t, new_sector )
459 __array( char, rwbs, 6 ) 461 __array( char, rwbs, RWBS_LEN )
460 __array( char, comm, TASK_COMM_LEN ) 462 __array( char, comm, TASK_COMM_LEN )
461 ), 463 ),
462 464
@@ -498,7 +500,7 @@ TRACE_EVENT(block_bio_remap,
498 __field( unsigned int, nr_sector ) 500 __field( unsigned int, nr_sector )
499 __field( dev_t, old_dev ) 501 __field( dev_t, old_dev )
500 __field( sector_t, old_sector ) 502 __field( sector_t, old_sector )
501 __array( char, rwbs, 6 ) 503 __array( char, rwbs, RWBS_LEN)
502 ), 504 ),
503 505
504 TP_fast_assign( 506 TP_fast_assign(
@@ -542,7 +544,7 @@ TRACE_EVENT(block_rq_remap,
542 __field( unsigned int, nr_sector ) 544 __field( unsigned int, nr_sector )
543 __field( dev_t, old_dev ) 545 __field( dev_t, old_dev )
544 __field( sector_t, old_sector ) 546 __field( sector_t, old_sector )
545 __array( char, rwbs, 6 ) 547 __array( char, rwbs, RWBS_LEN)
546 ), 548 ),
547 549
548 TP_fast_assign( 550 TP_fast_assign(
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 4114129f0794..b31702ac15be 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
284 __field( long, pages_skipped ) 284 __field( long, pages_skipped )
285 __field( loff_t, range_start ) 285 __field( loff_t, range_start )
286 __field( loff_t, range_end ) 286 __field( loff_t, range_end )
287 __field( char, nonblocking )
288 __field( char, for_kupdate ) 287 __field( char, for_kupdate )
289 __field( char, for_reclaim ) 288 __field( char, for_reclaim )
290 __field( char, range_cyclic ) 289 __field( char, range_cyclic )
@@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
299 __entry->pages_skipped = wbc->pages_skipped; 298 __entry->pages_skipped = wbc->pages_skipped;
300 __entry->range_start = wbc->range_start; 299 __entry->range_start = wbc->range_start;
301 __entry->range_end = wbc->range_end; 300 __entry->range_end = wbc->range_end;
302 __entry->nonblocking = wbc->nonblocking;
303 __entry->for_kupdate = wbc->for_kupdate; 301 __entry->for_kupdate = wbc->for_kupdate;
304 __entry->for_reclaim = wbc->for_reclaim; 302 __entry->for_reclaim = wbc->for_reclaim;
305 __entry->range_cyclic = wbc->range_cyclic; 303 __entry->range_cyclic = wbc->range_cyclic;
@@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
310 308
311 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " 309 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
312 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " 310 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
313 "range_end = %llu, nonblocking = %d, for_kupdate = %d, " 311 "range_end = %llu, for_kupdate = %d, "
314 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", 312 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
315 show_root_type(__entry->root_objectid), 313 show_root_type(__entry->root_objectid),
316 (unsigned long)__entry->ino, __entry->index, 314 (unsigned long)__entry->ino, __entry->index,
317 __entry->nr_to_write, __entry->pages_skipped, 315 __entry->nr_to_write, __entry->pages_skipped,
318 __entry->range_start, __entry->range_end, 316 __entry->range_start, __entry->range_end,
319 __entry->nonblocking, __entry->for_kupdate, 317 __entry->for_kupdate,
320 __entry->for_reclaim, __entry->range_cyclic, 318 __entry->for_reclaim, __entry->range_cyclic,
321 (unsigned long)__entry->writeback_index) 319 (unsigned long)__entry->writeback_index)
322); 320);
diff --git a/include/trace/events/ext3.h b/include/trace/events/ext3.h
new file mode 100644
index 000000000000..7b53c0573dc9
--- /dev/null
+++ b/include/trace/events/ext3.h
@@ -0,0 +1,864 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM ext3
3
4#if !defined(_TRACE_EXT3_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_EXT3_H
6
7#include <linux/tracepoint.h>
8
9TRACE_EVENT(ext3_free_inode,
10 TP_PROTO(struct inode *inode),
11
12 TP_ARGS(inode),
13
14 TP_STRUCT__entry(
15 __field( dev_t, dev )
16 __field( ino_t, ino )
17 __field( umode_t, mode )
18 __field( uid_t, uid )
19 __field( gid_t, gid )
20 __field( blkcnt_t, blocks )
21 ),
22
23 TP_fast_assign(
24 __entry->dev = inode->i_sb->s_dev;
25 __entry->ino = inode->i_ino;
26 __entry->mode = inode->i_mode;
27 __entry->uid = inode->i_uid;
28 __entry->gid = inode->i_gid;
29 __entry->blocks = inode->i_blocks;
30 ),
31
32 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %lu",
33 MAJOR(__entry->dev), MINOR(__entry->dev),
34 (unsigned long) __entry->ino,
35 __entry->mode, __entry->uid, __entry->gid,
36 (unsigned long) __entry->blocks)
37);
38
39TRACE_EVENT(ext3_request_inode,
40 TP_PROTO(struct inode *dir, int mode),
41
42 TP_ARGS(dir, mode),
43
44 TP_STRUCT__entry(
45 __field( dev_t, dev )
46 __field( ino_t, dir )
47 __field( umode_t, mode )
48 ),
49
50 TP_fast_assign(
51 __entry->dev = dir->i_sb->s_dev;
52 __entry->dir = dir->i_ino;
53 __entry->mode = mode;
54 ),
55
56 TP_printk("dev %d,%d dir %lu mode 0%o",
57 MAJOR(__entry->dev), MINOR(__entry->dev),
58 (unsigned long) __entry->dir, __entry->mode)
59);
60
61TRACE_EVENT(ext3_allocate_inode,
62 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
63
64 TP_ARGS(inode, dir, mode),
65
66 TP_STRUCT__entry(
67 __field( dev_t, dev )
68 __field( ino_t, ino )
69 __field( ino_t, dir )
70 __field( umode_t, mode )
71 ),
72
73 TP_fast_assign(
74 __entry->dev = inode->i_sb->s_dev;
75 __entry->ino = inode->i_ino;
76 __entry->dir = dir->i_ino;
77 __entry->mode = mode;
78 ),
79
80 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
81 MAJOR(__entry->dev), MINOR(__entry->dev),
82 (unsigned long) __entry->ino,
83 (unsigned long) __entry->dir, __entry->mode)
84);
85
86TRACE_EVENT(ext3_evict_inode,
87 TP_PROTO(struct inode *inode),
88
89 TP_ARGS(inode),
90
91 TP_STRUCT__entry(
92 __field( dev_t, dev )
93 __field( ino_t, ino )
94 __field( int, nlink )
95 ),
96
97 TP_fast_assign(
98 __entry->dev = inode->i_sb->s_dev;
99 __entry->ino = inode->i_ino;
100 __entry->nlink = inode->i_nlink;
101 ),
102
103 TP_printk("dev %d,%d ino %lu nlink %d",
104 MAJOR(__entry->dev), MINOR(__entry->dev),
105 (unsigned long) __entry->ino, __entry->nlink)
106);
107
108TRACE_EVENT(ext3_drop_inode,
109 TP_PROTO(struct inode *inode, int drop),
110
111 TP_ARGS(inode, drop),
112
113 TP_STRUCT__entry(
114 __field( dev_t, dev )
115 __field( ino_t, ino )
116 __field( int, drop )
117 ),
118
119 TP_fast_assign(
120 __entry->dev = inode->i_sb->s_dev;
121 __entry->ino = inode->i_ino;
122 __entry->drop = drop;
123 ),
124
125 TP_printk("dev %d,%d ino %lu drop %d",
126 MAJOR(__entry->dev), MINOR(__entry->dev),
127 (unsigned long) __entry->ino, __entry->drop)
128);
129
130TRACE_EVENT(ext3_mark_inode_dirty,
131 TP_PROTO(struct inode *inode, unsigned long IP),
132
133 TP_ARGS(inode, IP),
134
135 TP_STRUCT__entry(
136 __field( dev_t, dev )
137 __field( ino_t, ino )
138 __field(unsigned long, ip )
139 ),
140
141 TP_fast_assign(
142 __entry->dev = inode->i_sb->s_dev;
143 __entry->ino = inode->i_ino;
144 __entry->ip = IP;
145 ),
146
147 TP_printk("dev %d,%d ino %lu caller %pF",
148 MAJOR(__entry->dev), MINOR(__entry->dev),
149 (unsigned long) __entry->ino, (void *)__entry->ip)
150);
151
152TRACE_EVENT(ext3_write_begin,
153 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
154 unsigned int flags),
155
156 TP_ARGS(inode, pos, len, flags),
157
158 TP_STRUCT__entry(
159 __field( dev_t, dev )
160 __field( ino_t, ino )
161 __field( loff_t, pos )
162 __field( unsigned int, len )
163 __field( unsigned int, flags )
164 ),
165
166 TP_fast_assign(
167 __entry->dev = inode->i_sb->s_dev;
168 __entry->ino = inode->i_ino;
169 __entry->pos = pos;
170 __entry->len = len;
171 __entry->flags = flags;
172 ),
173
174 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u",
175 MAJOR(__entry->dev), MINOR(__entry->dev),
176 (unsigned long) __entry->ino,
177 (unsigned long long) __entry->pos, __entry->len,
178 __entry->flags)
179);
180
181DECLARE_EVENT_CLASS(ext3__write_end,
182 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
183 unsigned int copied),
184
185 TP_ARGS(inode, pos, len, copied),
186
187 TP_STRUCT__entry(
188 __field( dev_t, dev )
189 __field( ino_t, ino )
190 __field( loff_t, pos )
191 __field( unsigned int, len )
192 __field( unsigned int, copied )
193 ),
194
195 TP_fast_assign(
196 __entry->dev = inode->i_sb->s_dev;
197 __entry->ino = inode->i_ino;
198 __entry->pos = pos;
199 __entry->len = len;
200 __entry->copied = copied;
201 ),
202
203 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u",
204 MAJOR(__entry->dev), MINOR(__entry->dev),
205 (unsigned long) __entry->ino,
206 (unsigned long long) __entry->pos, __entry->len,
207 __entry->copied)
208);
209
210DEFINE_EVENT(ext3__write_end, ext3_ordered_write_end,
211
212 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
213 unsigned int copied),
214
215 TP_ARGS(inode, pos, len, copied)
216);
217
218DEFINE_EVENT(ext3__write_end, ext3_writeback_write_end,
219
220 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
221 unsigned int copied),
222
223 TP_ARGS(inode, pos, len, copied)
224);
225
226DEFINE_EVENT(ext3__write_end, ext3_journalled_write_end,
227
228 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
229 unsigned int copied),
230
231 TP_ARGS(inode, pos, len, copied)
232);
233
234DECLARE_EVENT_CLASS(ext3__page_op,
235 TP_PROTO(struct page *page),
236
237 TP_ARGS(page),
238
239 TP_STRUCT__entry(
240 __field( dev_t, dev )
241 __field( ino_t, ino )
242 __field( pgoff_t, index )
243
244 ),
245
246 TP_fast_assign(
247 __entry->index = page->index;
248 __entry->ino = page->mapping->host->i_ino;
249 __entry->dev = page->mapping->host->i_sb->s_dev;
250 ),
251
252 TP_printk("dev %d,%d ino %lu page_index %lu",
253 MAJOR(__entry->dev), MINOR(__entry->dev),
254 (unsigned long) __entry->ino, __entry->index)
255);
256
257DEFINE_EVENT(ext3__page_op, ext3_ordered_writepage,
258
259 TP_PROTO(struct page *page),
260
261 TP_ARGS(page)
262);
263
264DEFINE_EVENT(ext3__page_op, ext3_writeback_writepage,
265
266 TP_PROTO(struct page *page),
267
268 TP_ARGS(page)
269);
270
271DEFINE_EVENT(ext3__page_op, ext3_journalled_writepage,
272
273 TP_PROTO(struct page *page),
274
275 TP_ARGS(page)
276);
277
278DEFINE_EVENT(ext3__page_op, ext3_readpage,
279
280 TP_PROTO(struct page *page),
281
282 TP_ARGS(page)
283);
284
285DEFINE_EVENT(ext3__page_op, ext3_releasepage,
286
287 TP_PROTO(struct page *page),
288
289 TP_ARGS(page)
290);
291
292TRACE_EVENT(ext3_invalidatepage,
293 TP_PROTO(struct page *page, unsigned long offset),
294
295 TP_ARGS(page, offset),
296
297 TP_STRUCT__entry(
298 __field( pgoff_t, index )
299 __field( unsigned long, offset )
300 __field( ino_t, ino )
301 __field( dev_t, dev )
302
303 ),
304
305 TP_fast_assign(
306 __entry->index = page->index;
307 __entry->offset = offset;
308 __entry->ino = page->mapping->host->i_ino;
309 __entry->dev = page->mapping->host->i_sb->s_dev;
310 ),
311
312 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
313 MAJOR(__entry->dev), MINOR(__entry->dev),
314 (unsigned long) __entry->ino,
315 __entry->index, __entry->offset)
316);
317
318TRACE_EVENT(ext3_discard_blocks,
319 TP_PROTO(struct super_block *sb, unsigned long blk,
320 unsigned long count),
321
322 TP_ARGS(sb, blk, count),
323
324 TP_STRUCT__entry(
325 __field( dev_t, dev )
326 __field( unsigned long, blk )
327 __field( unsigned long, count )
328
329 ),
330
331 TP_fast_assign(
332 __entry->dev = sb->s_dev;
333 __entry->blk = blk;
334 __entry->count = count;
335 ),
336
337 TP_printk("dev %d,%d blk %lu count %lu",
338 MAJOR(__entry->dev), MINOR(__entry->dev),
339 __entry->blk, __entry->count)
340);
341
342TRACE_EVENT(ext3_request_blocks,
343 TP_PROTO(struct inode *inode, unsigned long goal,
344 unsigned long count),
345
346 TP_ARGS(inode, goal, count),
347
348 TP_STRUCT__entry(
349 __field( dev_t, dev )
350 __field( ino_t, ino )
351 __field( unsigned long, count )
352 __field( unsigned long, goal )
353 ),
354
355 TP_fast_assign(
356 __entry->dev = inode->i_sb->s_dev;
357 __entry->ino = inode->i_ino;
358 __entry->count = count;
359 __entry->goal = goal;
360 ),
361
362 TP_printk("dev %d,%d ino %lu count %lu goal %lu ",
363 MAJOR(__entry->dev), MINOR(__entry->dev),
364 (unsigned long) __entry->ino,
365 __entry->count, __entry->goal)
366);
367
368TRACE_EVENT(ext3_allocate_blocks,
369 TP_PROTO(struct inode *inode, unsigned long goal,
370 unsigned long count, unsigned long block),
371
372 TP_ARGS(inode, goal, count, block),
373
374 TP_STRUCT__entry(
375 __field( dev_t, dev )
376 __field( ino_t, ino )
377 __field( unsigned long, block )
378 __field( unsigned long, count )
379 __field( unsigned long, goal )
380 ),
381
382 TP_fast_assign(
383 __entry->dev = inode->i_sb->s_dev;
384 __entry->ino = inode->i_ino;
385 __entry->block = block;
386 __entry->count = count;
387 __entry->goal = goal;
388 ),
389
390 TP_printk("dev %d,%d ino %lu count %lu block %lu goal %lu",
391 MAJOR(__entry->dev), MINOR(__entry->dev),
392 (unsigned long) __entry->ino,
393 __entry->count, __entry->block,
394 __entry->goal)
395);
396
397TRACE_EVENT(ext3_free_blocks,
398 TP_PROTO(struct inode *inode, unsigned long block,
399 unsigned long count),
400
401 TP_ARGS(inode, block, count),
402
403 TP_STRUCT__entry(
404 __field( dev_t, dev )
405 __field( ino_t, ino )
406 __field( umode_t, mode )
407 __field( unsigned long, block )
408 __field( unsigned long, count )
409 ),
410
411 TP_fast_assign(
412 __entry->dev = inode->i_sb->s_dev;
413 __entry->ino = inode->i_ino;
414 __entry->mode = inode->i_mode;
415 __entry->block = block;
416 __entry->count = count;
417 ),
418
419 TP_printk("dev %d,%d ino %lu mode 0%o block %lu count %lu",
420 MAJOR(__entry->dev), MINOR(__entry->dev),
421 (unsigned long) __entry->ino,
422 __entry->mode, __entry->block, __entry->count)
423);
424
425TRACE_EVENT(ext3_sync_file_enter,
426 TP_PROTO(struct file *file, int datasync),
427
428 TP_ARGS(file, datasync),
429
430 TP_STRUCT__entry(
431 __field( dev_t, dev )
432 __field( ino_t, ino )
433 __field( ino_t, parent )
434 __field( int, datasync )
435 ),
436
437 TP_fast_assign(
438 struct dentry *dentry = file->f_path.dentry;
439
440 __entry->dev = dentry->d_inode->i_sb->s_dev;
441 __entry->ino = dentry->d_inode->i_ino;
442 __entry->datasync = datasync;
443 __entry->parent = dentry->d_parent->d_inode->i_ino;
444 ),
445
446 TP_printk("dev %d,%d ino %lu parent %ld datasync %d ",
447 MAJOR(__entry->dev), MINOR(__entry->dev),
448 (unsigned long) __entry->ino,
449 (unsigned long) __entry->parent, __entry->datasync)
450);
451
452TRACE_EVENT(ext3_sync_file_exit,
453 TP_PROTO(struct inode *inode, int ret),
454
455 TP_ARGS(inode, ret),
456
457 TP_STRUCT__entry(
458 __field( int, ret )
459 __field( ino_t, ino )
460 __field( dev_t, dev )
461 ),
462
463 TP_fast_assign(
464 __entry->ret = ret;
465 __entry->ino = inode->i_ino;
466 __entry->dev = inode->i_sb->s_dev;
467 ),
468
469 TP_printk("dev %d,%d ino %lu ret %d",
470 MAJOR(__entry->dev), MINOR(__entry->dev),
471 (unsigned long) __entry->ino,
472 __entry->ret)
473);
474
475TRACE_EVENT(ext3_sync_fs,
476 TP_PROTO(struct super_block *sb, int wait),
477
478 TP_ARGS(sb, wait),
479
480 TP_STRUCT__entry(
481 __field( dev_t, dev )
482 __field( int, wait )
483
484 ),
485
486 TP_fast_assign(
487 __entry->dev = sb->s_dev;
488 __entry->wait = wait;
489 ),
490
491 TP_printk("dev %d,%d wait %d",
492 MAJOR(__entry->dev), MINOR(__entry->dev),
493 __entry->wait)
494);
495
496TRACE_EVENT(ext3_rsv_window_add,
497 TP_PROTO(struct super_block *sb,
498 struct ext3_reserve_window_node *rsv_node),
499
500 TP_ARGS(sb, rsv_node),
501
502 TP_STRUCT__entry(
503 __field( unsigned long, start )
504 __field( unsigned long, end )
505 __field( dev_t, dev )
506 ),
507
508 TP_fast_assign(
509 __entry->dev = sb->s_dev;
510 __entry->start = rsv_node->rsv_window._rsv_start;
511 __entry->end = rsv_node->rsv_window._rsv_end;
512 ),
513
514 TP_printk("dev %d,%d start %lu end %lu",
515 MAJOR(__entry->dev), MINOR(__entry->dev),
516 __entry->start, __entry->end)
517);
518
519TRACE_EVENT(ext3_discard_reservation,
520 TP_PROTO(struct inode *inode,
521 struct ext3_reserve_window_node *rsv_node),
522
523 TP_ARGS(inode, rsv_node),
524
525 TP_STRUCT__entry(
526 __field( unsigned long, start )
527 __field( unsigned long, end )
528 __field( ino_t, ino )
529 __field( dev_t, dev )
530 ),
531
532 TP_fast_assign(
533 __entry->start = rsv_node->rsv_window._rsv_start;
534 __entry->end = rsv_node->rsv_window._rsv_end;
535 __entry->ino = inode->i_ino;
536 __entry->dev = inode->i_sb->s_dev;
537 ),
538
539 TP_printk("dev %d,%d ino %lu start %lu end %lu",
540 MAJOR(__entry->dev), MINOR(__entry->dev),
541 (unsigned long)__entry->ino, __entry->start,
542 __entry->end)
543);
544
545TRACE_EVENT(ext3_alloc_new_reservation,
546 TP_PROTO(struct super_block *sb, unsigned long goal),
547
548 TP_ARGS(sb, goal),
549
550 TP_STRUCT__entry(
551 __field( dev_t, dev )
552 __field( unsigned long, goal )
553 ),
554
555 TP_fast_assign(
556 __entry->dev = sb->s_dev;
557 __entry->goal = goal;
558 ),
559
560 TP_printk("dev %d,%d goal %lu",
561 MAJOR(__entry->dev), MINOR(__entry->dev),
562 __entry->goal)
563);
564
565TRACE_EVENT(ext3_reserved,
566 TP_PROTO(struct super_block *sb, unsigned long block,
567 struct ext3_reserve_window_node *rsv_node),
568
569 TP_ARGS(sb, block, rsv_node),
570
571 TP_STRUCT__entry(
572 __field( unsigned long, block )
573 __field( unsigned long, start )
574 __field( unsigned long, end )
575 __field( dev_t, dev )
576 ),
577
578 TP_fast_assign(
579 __entry->block = block;
580 __entry->start = rsv_node->rsv_window._rsv_start;
581 __entry->end = rsv_node->rsv_window._rsv_end;
582 __entry->dev = sb->s_dev;
583 ),
584
585 TP_printk("dev %d,%d block %lu, start %lu end %lu",
586 MAJOR(__entry->dev), MINOR(__entry->dev),
587 __entry->block, __entry->start, __entry->end)
588);
589
590TRACE_EVENT(ext3_forget,
591 TP_PROTO(struct inode *inode, int is_metadata, unsigned long block),
592
593 TP_ARGS(inode, is_metadata, block),
594
595 TP_STRUCT__entry(
596 __field( dev_t, dev )
597 __field( ino_t, ino )
598 __field( umode_t, mode )
599 __field( int, is_metadata )
600 __field( unsigned long, block )
601 ),
602
603 TP_fast_assign(
604 __entry->dev = inode->i_sb->s_dev;
605 __entry->ino = inode->i_ino;
606 __entry->mode = inode->i_mode;
607 __entry->is_metadata = is_metadata;
608 __entry->block = block;
609 ),
610
611 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %lu",
612 MAJOR(__entry->dev), MINOR(__entry->dev),
613 (unsigned long) __entry->ino,
614 __entry->mode, __entry->is_metadata, __entry->block)
615);
616
617TRACE_EVENT(ext3_read_block_bitmap,
618 TP_PROTO(struct super_block *sb, unsigned int group),
619
620 TP_ARGS(sb, group),
621
622 TP_STRUCT__entry(
623 __field( dev_t, dev )
624 __field( __u32, group )
625
626 ),
627
628 TP_fast_assign(
629 __entry->dev = sb->s_dev;
630 __entry->group = group;
631 ),
632
633 TP_printk("dev %d,%d group %u",
634 MAJOR(__entry->dev), MINOR(__entry->dev),
635 __entry->group)
636);
637
638TRACE_EVENT(ext3_direct_IO_enter,
639 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
640
641 TP_ARGS(inode, offset, len, rw),
642
643 TP_STRUCT__entry(
644 __field( ino_t, ino )
645 __field( dev_t, dev )
646 __field( loff_t, pos )
647 __field( unsigned long, len )
648 __field( int, rw )
649 ),
650
651 TP_fast_assign(
652 __entry->ino = inode->i_ino;
653 __entry->dev = inode->i_sb->s_dev;
654 __entry->pos = offset;
655 __entry->len = len;
656 __entry->rw = rw;
657 ),
658
659 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d",
660 MAJOR(__entry->dev), MINOR(__entry->dev),
661 (unsigned long) __entry->ino,
662 (unsigned long long) __entry->pos, __entry->len,
663 __entry->rw)
664);
665
666TRACE_EVENT(ext3_direct_IO_exit,
667 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
668 int rw, int ret),
669
670 TP_ARGS(inode, offset, len, rw, ret),
671
672 TP_STRUCT__entry(
673 __field( ino_t, ino )
674 __field( dev_t, dev )
675 __field( loff_t, pos )
676 __field( unsigned long, len )
677 __field( int, rw )
678 __field( int, ret )
679 ),
680
681 TP_fast_assign(
682 __entry->ino = inode->i_ino;
683 __entry->dev = inode->i_sb->s_dev;
684 __entry->pos = offset;
685 __entry->len = len;
686 __entry->rw = rw;
687 __entry->ret = ret;
688 ),
689
690 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d ret %d",
691 MAJOR(__entry->dev), MINOR(__entry->dev),
692 (unsigned long) __entry->ino,
693 (unsigned long long) __entry->pos, __entry->len,
694 __entry->rw, __entry->ret)
695);
696
697TRACE_EVENT(ext3_unlink_enter,
698 TP_PROTO(struct inode *parent, struct dentry *dentry),
699
700 TP_ARGS(parent, dentry),
701
702 TP_STRUCT__entry(
703 __field( ino_t, parent )
704 __field( ino_t, ino )
705 __field( loff_t, size )
706 __field( dev_t, dev )
707 ),
708
709 TP_fast_assign(
710 __entry->parent = parent->i_ino;
711 __entry->ino = dentry->d_inode->i_ino;
712 __entry->size = dentry->d_inode->i_size;
713 __entry->dev = dentry->d_inode->i_sb->s_dev;
714 ),
715
716 TP_printk("dev %d,%d ino %lu size %lld parent %ld",
717 MAJOR(__entry->dev), MINOR(__entry->dev),
718 (unsigned long) __entry->ino,
719 (unsigned long long)__entry->size,
720 (unsigned long) __entry->parent)
721);
722
723TRACE_EVENT(ext3_unlink_exit,
724 TP_PROTO(struct dentry *dentry, int ret),
725
726 TP_ARGS(dentry, ret),
727
728 TP_STRUCT__entry(
729 __field( ino_t, ino )
730 __field( dev_t, dev )
731 __field( int, ret )
732 ),
733
734 TP_fast_assign(
735 __entry->ino = dentry->d_inode->i_ino;
736 __entry->dev = dentry->d_inode->i_sb->s_dev;
737 __entry->ret = ret;
738 ),
739
740 TP_printk("dev %d,%d ino %lu ret %d",
741 MAJOR(__entry->dev), MINOR(__entry->dev),
742 (unsigned long) __entry->ino,
743 __entry->ret)
744);
745
746DECLARE_EVENT_CLASS(ext3__truncate,
747 TP_PROTO(struct inode *inode),
748
749 TP_ARGS(inode),
750
751 TP_STRUCT__entry(
752 __field( ino_t, ino )
753 __field( dev_t, dev )
754 __field( blkcnt_t, blocks )
755 ),
756
757 TP_fast_assign(
758 __entry->ino = inode->i_ino;
759 __entry->dev = inode->i_sb->s_dev;
760 __entry->blocks = inode->i_blocks;
761 ),
762
763 TP_printk("dev %d,%d ino %lu blocks %lu",
764 MAJOR(__entry->dev), MINOR(__entry->dev),
765 (unsigned long) __entry->ino, (unsigned long) __entry->blocks)
766);
767
768DEFINE_EVENT(ext3__truncate, ext3_truncate_enter,
769
770 TP_PROTO(struct inode *inode),
771
772 TP_ARGS(inode)
773);
774
775DEFINE_EVENT(ext3__truncate, ext3_truncate_exit,
776
777 TP_PROTO(struct inode *inode),
778
779 TP_ARGS(inode)
780);
781
782TRACE_EVENT(ext3_get_blocks_enter,
783 TP_PROTO(struct inode *inode, unsigned long lblk,
784 unsigned long len, int create),
785
786 TP_ARGS(inode, lblk, len, create),
787
788 TP_STRUCT__entry(
789 __field( ino_t, ino )
790 __field( dev_t, dev )
791 __field( unsigned long, lblk )
792 __field( unsigned long, len )
793 __field( int, create )
794 ),
795
796 TP_fast_assign(
797 __entry->ino = inode->i_ino;
798 __entry->dev = inode->i_sb->s_dev;
799 __entry->lblk = lblk;
800 __entry->len = len;
801 __entry->create = create;
802 ),
803
804 TP_printk("dev %d,%d ino %lu lblk %lu len %lu create %u",
805 MAJOR(__entry->dev), MINOR(__entry->dev),
806 (unsigned long) __entry->ino,
807 __entry->lblk, __entry->len, __entry->create)
808);
809
810TRACE_EVENT(ext3_get_blocks_exit,
811 TP_PROTO(struct inode *inode, unsigned long lblk,
812 unsigned long pblk, unsigned long len, int ret),
813
814 TP_ARGS(inode, lblk, pblk, len, ret),
815
816 TP_STRUCT__entry(
817 __field( ino_t, ino )
818 __field( dev_t, dev )
819 __field( unsigned long, lblk )
820 __field( unsigned long, pblk )
821 __field( unsigned long, len )
822 __field( int, ret )
823 ),
824
825 TP_fast_assign(
826 __entry->ino = inode->i_ino;
827 __entry->dev = inode->i_sb->s_dev;
828 __entry->lblk = lblk;
829 __entry->pblk = pblk;
830 __entry->len = len;
831 __entry->ret = ret;
832 ),
833
834 TP_printk("dev %d,%d ino %lu lblk %lu pblk %lu len %lu ret %d",
835 MAJOR(__entry->dev), MINOR(__entry->dev),
836 (unsigned long) __entry->ino,
837 __entry->lblk, __entry->pblk,
838 __entry->len, __entry->ret)
839);
840
841TRACE_EVENT(ext3_load_inode,
842 TP_PROTO(struct inode *inode),
843
844 TP_ARGS(inode),
845
846 TP_STRUCT__entry(
847 __field( ino_t, ino )
848 __field( dev_t, dev )
849 ),
850
851 TP_fast_assign(
852 __entry->ino = inode->i_ino;
853 __entry->dev = inode->i_sb->s_dev;
854 ),
855
856 TP_printk("dev %d,%d ino %lu",
857 MAJOR(__entry->dev), MINOR(__entry->dev),
858 (unsigned long) __entry->ino)
859);
860
861#endif /* _TRACE_EXT3_H */
862
863/* This part must be outside protection */
864#include <trace/define_trace.h>
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 5ce2b2f5f524..b50a54736242 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -23,7 +23,7 @@ TRACE_EVENT(ext4_free_inode,
23 TP_STRUCT__entry( 23 TP_STRUCT__entry(
24 __field( dev_t, dev ) 24 __field( dev_t, dev )
25 __field( ino_t, ino ) 25 __field( ino_t, ino )
26 __field( umode_t, mode ) 26 __field( __u16, mode )
27 __field( uid_t, uid ) 27 __field( uid_t, uid )
28 __field( gid_t, gid ) 28 __field( gid_t, gid )
29 __field( __u64, blocks ) 29 __field( __u64, blocks )
@@ -52,7 +52,7 @@ TRACE_EVENT(ext4_request_inode,
52 TP_STRUCT__entry( 52 TP_STRUCT__entry(
53 __field( dev_t, dev ) 53 __field( dev_t, dev )
54 __field( ino_t, dir ) 54 __field( ino_t, dir )
55 __field( umode_t, mode ) 55 __field( __u16, mode )
56 ), 56 ),
57 57
58 TP_fast_assign( 58 TP_fast_assign(
@@ -75,7 +75,7 @@ TRACE_EVENT(ext4_allocate_inode,
75 __field( dev_t, dev ) 75 __field( dev_t, dev )
76 __field( ino_t, ino ) 76 __field( ino_t, ino )
77 __field( ino_t, dir ) 77 __field( ino_t, dir )
78 __field( umode_t, mode ) 78 __field( __u16, mode )
79 ), 79 ),
80 80
81 TP_fast_assign( 81 TP_fast_assign(
@@ -380,7 +380,6 @@ TRACE_EVENT(ext4_da_writepages_result,
380 __field( int, pages_written ) 380 __field( int, pages_written )
381 __field( long, pages_skipped ) 381 __field( long, pages_skipped )
382 __field( int, sync_mode ) 382 __field( int, sync_mode )
383 __field( char, more_io )
384 __field( pgoff_t, writeback_index ) 383 __field( pgoff_t, writeback_index )
385 ), 384 ),
386 385
@@ -391,16 +390,15 @@ TRACE_EVENT(ext4_da_writepages_result,
391 __entry->pages_written = pages_written; 390 __entry->pages_written = pages_written;
392 __entry->pages_skipped = wbc->pages_skipped; 391 __entry->pages_skipped = wbc->pages_skipped;
393 __entry->sync_mode = wbc->sync_mode; 392 __entry->sync_mode = wbc->sync_mode;
394 __entry->more_io = wbc->more_io;
395 __entry->writeback_index = inode->i_mapping->writeback_index; 393 __entry->writeback_index = inode->i_mapping->writeback_index;
396 ), 394 ),
397 395
398 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " 396 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
399 " more_io %d sync_mode %d writeback_index %lu", 397 "sync_mode %d writeback_index %lu",
400 MAJOR(__entry->dev), MINOR(__entry->dev), 398 MAJOR(__entry->dev), MINOR(__entry->dev),
401 (unsigned long) __entry->ino, __entry->ret, 399 (unsigned long) __entry->ino, __entry->ret,
402 __entry->pages_written, __entry->pages_skipped, 400 __entry->pages_written, __entry->pages_skipped,
403 __entry->more_io, __entry->sync_mode, 401 __entry->sync_mode,
404 (unsigned long) __entry->writeback_index) 402 (unsigned long) __entry->writeback_index)
405); 403);
406 404
@@ -727,7 +725,7 @@ TRACE_EVENT(ext4_free_blocks,
727 TP_STRUCT__entry( 725 TP_STRUCT__entry(
728 __field( dev_t, dev ) 726 __field( dev_t, dev )
729 __field( ino_t, ino ) 727 __field( ino_t, ino )
730 __field( umode_t, mode ) 728 __field( __u16, mode )
731 __field( __u64, block ) 729 __field( __u64, block )
732 __field( unsigned long, count ) 730 __field( unsigned long, count )
733 __field( int, flags ) 731 __field( int, flags )
@@ -1014,7 +1012,7 @@ TRACE_EVENT(ext4_forget,
1014 TP_STRUCT__entry( 1012 TP_STRUCT__entry(
1015 __field( dev_t, dev ) 1013 __field( dev_t, dev )
1016 __field( ino_t, ino ) 1014 __field( ino_t, ino )
1017 __field( umode_t, mode ) 1015 __field( __u16, mode )
1018 __field( int, is_metadata ) 1016 __field( int, is_metadata )
1019 __field( __u64, block ) 1017 __field( __u64, block )
1020 ), 1018 ),
@@ -1041,7 +1039,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1041 TP_STRUCT__entry( 1039 TP_STRUCT__entry(
1042 __field( dev_t, dev ) 1040 __field( dev_t, dev )
1043 __field( ino_t, ino ) 1041 __field( ino_t, ino )
1044 __field( umode_t, mode ) 1042 __field( __u16, mode )
1045 __field( __u64, i_blocks ) 1043 __field( __u64, i_blocks )
1046 __field( int, used_blocks ) 1044 __field( int, used_blocks )
1047 __field( int, reserved_data_blocks ) 1045 __field( int, reserved_data_blocks )
@@ -1078,7 +1076,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1078 TP_STRUCT__entry( 1076 TP_STRUCT__entry(
1079 __field( dev_t, dev ) 1077 __field( dev_t, dev )
1080 __field( ino_t, ino ) 1078 __field( ino_t, ino )
1081 __field( umode_t, mode ) 1079 __field( __u16, mode )
1082 __field( __u64, i_blocks ) 1080 __field( __u64, i_blocks )
1083 __field( int, md_needed ) 1081 __field( int, md_needed )
1084 __field( int, reserved_data_blocks ) 1082 __field( int, reserved_data_blocks )
@@ -1112,7 +1110,7 @@ TRACE_EVENT(ext4_da_release_space,
1112 TP_STRUCT__entry( 1110 TP_STRUCT__entry(
1113 __field( dev_t, dev ) 1111 __field( dev_t, dev )
1114 __field( ino_t, ino ) 1112 __field( ino_t, ino )
1115 __field( umode_t, mode ) 1113 __field( __u16, mode )
1116 __field( __u64, i_blocks ) 1114 __field( __u64, i_blocks )
1117 __field( int, freed_blocks ) 1115 __field( int, freed_blocks )
1118 __field( int, reserved_data_blocks ) 1116 __field( int, reserved_data_blocks )
@@ -1520,6 +1518,77 @@ TRACE_EVENT(ext4_load_inode,
1520 (unsigned long) __entry->ino) 1518 (unsigned long) __entry->ino)
1521); 1519);
1522 1520
1521TRACE_EVENT(ext4_journal_start,
1522 TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
1523
1524 TP_ARGS(sb, nblocks, IP),
1525
1526 TP_STRUCT__entry(
1527 __field( dev_t, dev )
1528 __field( int, nblocks )
1529 __field(unsigned long, ip )
1530 ),
1531
1532 TP_fast_assign(
1533 __entry->dev = sb->s_dev;
1534 __entry->nblocks = nblocks;
1535 __entry->ip = IP;
1536 ),
1537
1538 TP_printk("dev %d,%d nblocks %d caller %pF",
1539 MAJOR(__entry->dev), MINOR(__entry->dev),
1540 __entry->nblocks, (void *)__entry->ip)
1541);
1542
1543DECLARE_EVENT_CLASS(ext4__trim,
1544 TP_PROTO(struct super_block *sb,
1545 ext4_group_t group,
1546 ext4_grpblk_t start,
1547 ext4_grpblk_t len),
1548
1549 TP_ARGS(sb, group, start, len),
1550
1551 TP_STRUCT__entry(
1552 __field( int, dev_major )
1553 __field( int, dev_minor )
1554 __field( __u32, group )
1555 __field( int, start )
1556 __field( int, len )
1557 ),
1558
1559 TP_fast_assign(
1560 __entry->dev_major = MAJOR(sb->s_dev);
1561 __entry->dev_minor = MINOR(sb->s_dev);
1562 __entry->group = group;
1563 __entry->start = start;
1564 __entry->len = len;
1565 ),
1566
1567 TP_printk("dev %d,%d group %u, start %d, len %d",
1568 __entry->dev_major, __entry->dev_minor,
1569 __entry->group, __entry->start, __entry->len)
1570);
1571
1572DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1573
1574 TP_PROTO(struct super_block *sb,
1575 ext4_group_t group,
1576 ext4_grpblk_t start,
1577 ext4_grpblk_t len),
1578
1579 TP_ARGS(sb, group, start, len)
1580);
1581
1582DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1583
1584 TP_PROTO(struct super_block *sb,
1585 ext4_group_t group,
1586 ext4_grpblk_t start,
1587 ext4_grpblk_t len),
1588
1589 TP_ARGS(sb, group, start, len)
1590);
1591
1523#endif /* _TRACE_EXT4_H */ 1592#endif /* _TRACE_EXT4_H */
1524 1593
1525/* This part must be outside protection */ 1594/* This part must be outside protection */
diff --git a/include/trace/events/jbd.h b/include/trace/events/jbd.h
new file mode 100644
index 000000000000..aff64d82d713
--- /dev/null
+++ b/include/trace/events/jbd.h
@@ -0,0 +1,203 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM jbd
3
4#if !defined(_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_JBD_H
6
7#include <linux/jbd.h>
8#include <linux/tracepoint.h>
9
10TRACE_EVENT(jbd_checkpoint,
11
12 TP_PROTO(journal_t *journal, int result),
13
14 TP_ARGS(journal, result),
15
16 TP_STRUCT__entry(
17 __field( dev_t, dev )
18 __field( int, result )
19 ),
20
21 TP_fast_assign(
22 __entry->dev = journal->j_fs_dev->bd_dev;
23 __entry->result = result;
24 ),
25
26 TP_printk("dev %d,%d result %d",
27 MAJOR(__entry->dev), MINOR(__entry->dev),
28 __entry->result)
29);
30
31DECLARE_EVENT_CLASS(jbd_commit,
32
33 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
34
35 TP_ARGS(journal, commit_transaction),
36
37 TP_STRUCT__entry(
38 __field( dev_t, dev )
39 __field( char, sync_commit )
40 __field( int, transaction )
41 ),
42
43 TP_fast_assign(
44 __entry->dev = journal->j_fs_dev->bd_dev;
45 __entry->sync_commit = commit_transaction->t_synchronous_commit;
46 __entry->transaction = commit_transaction->t_tid;
47 ),
48
49 TP_printk("dev %d,%d transaction %d sync %d",
50 MAJOR(__entry->dev), MINOR(__entry->dev),
51 __entry->transaction, __entry->sync_commit)
52);
53
54DEFINE_EVENT(jbd_commit, jbd_start_commit,
55
56 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
57
58 TP_ARGS(journal, commit_transaction)
59);
60
61DEFINE_EVENT(jbd_commit, jbd_commit_locking,
62
63 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
64
65 TP_ARGS(journal, commit_transaction)
66);
67
68DEFINE_EVENT(jbd_commit, jbd_commit_flushing,
69
70 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
71
72 TP_ARGS(journal, commit_transaction)
73);
74
75DEFINE_EVENT(jbd_commit, jbd_commit_logging,
76
77 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
78
79 TP_ARGS(journal, commit_transaction)
80);
81
82TRACE_EVENT(jbd_drop_transaction,
83
84 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
85
86 TP_ARGS(journal, commit_transaction),
87
88 TP_STRUCT__entry(
89 __field( dev_t, dev )
90 __field( char, sync_commit )
91 __field( int, transaction )
92 ),
93
94 TP_fast_assign(
95 __entry->dev = journal->j_fs_dev->bd_dev;
96 __entry->sync_commit = commit_transaction->t_synchronous_commit;
97 __entry->transaction = commit_transaction->t_tid;
98 ),
99
100 TP_printk("dev %d,%d transaction %d sync %d",
101 MAJOR(__entry->dev), MINOR(__entry->dev),
102 __entry->transaction, __entry->sync_commit)
103);
104
105TRACE_EVENT(jbd_end_commit,
106 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
107
108 TP_ARGS(journal, commit_transaction),
109
110 TP_STRUCT__entry(
111 __field( dev_t, dev )
112 __field( char, sync_commit )
113 __field( int, transaction )
114 __field( int, head )
115 ),
116
117 TP_fast_assign(
118 __entry->dev = journal->j_fs_dev->bd_dev;
119 __entry->sync_commit = commit_transaction->t_synchronous_commit;
120 __entry->transaction = commit_transaction->t_tid;
121 __entry->head = journal->j_tail_sequence;
122 ),
123
124 TP_printk("dev %d,%d transaction %d sync %d head %d",
125 MAJOR(__entry->dev), MINOR(__entry->dev),
126 __entry->transaction, __entry->sync_commit, __entry->head)
127);
128
129TRACE_EVENT(jbd_do_submit_data,
130 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
131
132 TP_ARGS(journal, commit_transaction),
133
134 TP_STRUCT__entry(
135 __field( dev_t, dev )
136 __field( char, sync_commit )
137 __field( int, transaction )
138 ),
139
140 TP_fast_assign(
141 __entry->dev = journal->j_fs_dev->bd_dev;
142 __entry->sync_commit = commit_transaction->t_synchronous_commit;
143 __entry->transaction = commit_transaction->t_tid;
144 ),
145
146 TP_printk("dev %d,%d transaction %d sync %d",
147 MAJOR(__entry->dev), MINOR(__entry->dev),
148 __entry->transaction, __entry->sync_commit)
149);
150
151TRACE_EVENT(jbd_cleanup_journal_tail,
152
153 TP_PROTO(journal_t *journal, tid_t first_tid,
154 unsigned long block_nr, unsigned long freed),
155
156 TP_ARGS(journal, first_tid, block_nr, freed),
157
158 TP_STRUCT__entry(
159 __field( dev_t, dev )
160 __field( tid_t, tail_sequence )
161 __field( tid_t, first_tid )
162 __field(unsigned long, block_nr )
163 __field(unsigned long, freed )
164 ),
165
166 TP_fast_assign(
167 __entry->dev = journal->j_fs_dev->bd_dev;
168 __entry->tail_sequence = journal->j_tail_sequence;
169 __entry->first_tid = first_tid;
170 __entry->block_nr = block_nr;
171 __entry->freed = freed;
172 ),
173
174 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
175 MAJOR(__entry->dev), MINOR(__entry->dev),
176 __entry->tail_sequence, __entry->first_tid,
177 __entry->block_nr, __entry->freed)
178);
179
180TRACE_EVENT(jbd_update_superblock_end,
181 TP_PROTO(journal_t *journal, int wait),
182
183 TP_ARGS(journal, wait),
184
185 TP_STRUCT__entry(
186 __field( dev_t, dev )
187 __field( int, wait )
188 ),
189
190 TP_fast_assign(
191 __entry->dev = journal->j_fs_dev->bd_dev;
192 __entry->wait = wait;
193 ),
194
195 TP_printk("dev %d,%d wait %d",
196 MAJOR(__entry->dev), MINOR(__entry->dev),
197 __entry->wait)
198);
199
200#endif /* _TRACE_JBD_H */
201
202/* This part must be outside protection */
203#include <trace/define_trace.h>
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index bf16545cc977..75964412ddbb 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -26,8 +26,8 @@ TRACE_EVENT(jbd2_checkpoint,
26 __entry->result = result; 26 __entry->result = result;
27 ), 27 ),
28 28
29 TP_printk("dev %s result %d", 29 TP_printk("dev %d,%d result %d",
30 jbd2_dev_to_name(__entry->dev), __entry->result) 30 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result)
31); 31);
32 32
33DECLARE_EVENT_CLASS(jbd2_commit, 33DECLARE_EVENT_CLASS(jbd2_commit,
@@ -48,9 +48,9 @@ DECLARE_EVENT_CLASS(jbd2_commit,
48 __entry->transaction = commit_transaction->t_tid; 48 __entry->transaction = commit_transaction->t_tid;
49 ), 49 ),
50 50
51 TP_printk("dev %s transaction %d sync %d", 51 TP_printk("dev %d,%d transaction %d sync %d",
52 jbd2_dev_to_name(__entry->dev), __entry->transaction, 52 MAJOR(__entry->dev), MINOR(__entry->dev),
53 __entry->sync_commit) 53 __entry->transaction, __entry->sync_commit)
54); 54);
55 55
56DEFINE_EVENT(jbd2_commit, jbd2_start_commit, 56DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
@@ -100,9 +100,9 @@ TRACE_EVENT(jbd2_end_commit,
100 __entry->head = journal->j_tail_sequence; 100 __entry->head = journal->j_tail_sequence;
101 ), 101 ),
102 102
103 TP_printk("dev %s transaction %d sync %d head %d", 103 TP_printk("dev %d,%d transaction %d sync %d head %d",
104 jbd2_dev_to_name(__entry->dev), __entry->transaction, 104 MAJOR(__entry->dev), MINOR(__entry->dev),
105 __entry->sync_commit, __entry->head) 105 __entry->transaction, __entry->sync_commit, __entry->head)
106); 106);
107 107
108TRACE_EVENT(jbd2_submit_inode_data, 108TRACE_EVENT(jbd2_submit_inode_data,
@@ -120,8 +120,9 @@ TRACE_EVENT(jbd2_submit_inode_data,
120 __entry->ino = inode->i_ino; 120 __entry->ino = inode->i_ino;
121 ), 121 ),
122 122
123 TP_printk("dev %s ino %lu", 123 TP_printk("dev %d,%d ino %lu",
124 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 124 MAJOR(__entry->dev), MINOR(__entry->dev),
125 (unsigned long) __entry->ino)
125); 126);
126 127
127TRACE_EVENT(jbd2_run_stats, 128TRACE_EVENT(jbd2_run_stats,
@@ -156,9 +157,9 @@ TRACE_EVENT(jbd2_run_stats,
156 __entry->blocks_logged = stats->rs_blocks_logged; 157 __entry->blocks_logged = stats->rs_blocks_logged;
157 ), 158 ),
158 159
159 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u " 160 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u "
160 "logging %u handle_count %u blocks %u blocks_logged %u", 161 "logging %u handle_count %u blocks %u blocks_logged %u",
161 jbd2_dev_to_name(__entry->dev), __entry->tid, 162 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
162 jiffies_to_msecs(__entry->wait), 163 jiffies_to_msecs(__entry->wait),
163 jiffies_to_msecs(__entry->running), 164 jiffies_to_msecs(__entry->running),
164 jiffies_to_msecs(__entry->locked), 165 jiffies_to_msecs(__entry->locked),
@@ -192,9 +193,9 @@ TRACE_EVENT(jbd2_checkpoint_stats,
192 __entry->dropped = stats->cs_dropped; 193 __entry->dropped = stats->cs_dropped;
193 ), 194 ),
194 195
195 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u " 196 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
196 "written %u dropped %u", 197 "written %u dropped %u",
197 jbd2_dev_to_name(__entry->dev), __entry->tid, 198 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
198 jiffies_to_msecs(__entry->chp_time), 199 jiffies_to_msecs(__entry->chp_time),
199 __entry->forced_to_close, __entry->written, __entry->dropped) 200 __entry->forced_to_close, __entry->written, __entry->dropped)
200); 201);
@@ -222,9 +223,10 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
222 __entry->freed = freed; 223 __entry->freed = freed;
223 ), 224 ),
224 225
225 TP_printk("dev %s from %u to %u offset %lu freed %lu", 226 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
226 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence, 227 MAJOR(__entry->dev), MINOR(__entry->dev),
227 __entry->first_tid, __entry->block_nr, __entry->freed) 228 __entry->tail_sequence, __entry->first_tid,
229 __entry->block_nr, __entry->freed)
228); 230);
229 231
230#endif /* _TRACE_JBD2_H */ 232#endif /* _TRACE_JBD2_H */
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 4e249b927eaa..6bca4cc0063c 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -8,6 +8,19 @@
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/writeback.h> 9#include <linux/writeback.h>
10 10
11#define show_inode_state(state) \
12 __print_flags(state, "|", \
13 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
14 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
15 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
16 {I_NEW, "I_NEW"}, \
17 {I_WILL_FREE, "I_WILL_FREE"}, \
18 {I_FREEING, "I_FREEING"}, \
19 {I_CLEAR, "I_CLEAR"}, \
20 {I_SYNC, "I_SYNC"}, \
21 {I_REFERENCED, "I_REFERENCED"} \
22 )
23
11struct wb_writeback_work; 24struct wb_writeback_work;
12 25
13DECLARE_EVENT_CLASS(writeback_work_class, 26DECLARE_EVENT_CLASS(writeback_work_class,
@@ -49,6 +62,9 @@ DEFINE_EVENT(writeback_work_class, name, \
49DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); 62DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread);
50DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); 63DEFINE_WRITEBACK_WORK_EVENT(writeback_queue);
51DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); 64DEFINE_WRITEBACK_WORK_EVENT(writeback_exec);
65DEFINE_WRITEBACK_WORK_EVENT(writeback_start);
66DEFINE_WRITEBACK_WORK_EVENT(writeback_written);
67DEFINE_WRITEBACK_WORK_EVENT(writeback_wait);
52 68
53TRACE_EVENT(writeback_pages_written, 69TRACE_EVENT(writeback_pages_written,
54 TP_PROTO(long pages_written), 70 TP_PROTO(long pages_written),
@@ -88,6 +104,30 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
88DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); 104DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister);
89DEFINE_WRITEBACK_EVENT(writeback_thread_start); 105DEFINE_WRITEBACK_EVENT(writeback_thread_start);
90DEFINE_WRITEBACK_EVENT(writeback_thread_stop); 106DEFINE_WRITEBACK_EVENT(writeback_thread_stop);
107DEFINE_WRITEBACK_EVENT(balance_dirty_start);
108DEFINE_WRITEBACK_EVENT(balance_dirty_wait);
109
110TRACE_EVENT(balance_dirty_written,
111
112 TP_PROTO(struct backing_dev_info *bdi, int written),
113
114 TP_ARGS(bdi, written),
115
116 TP_STRUCT__entry(
117 __array(char, name, 32)
118 __field(int, written)
119 ),
120
121 TP_fast_assign(
122 strncpy(__entry->name, dev_name(bdi->dev), 32);
123 __entry->written = written;
124 ),
125
126 TP_printk("bdi %s written %d",
127 __entry->name,
128 __entry->written
129 )
130);
91 131
92DECLARE_EVENT_CLASS(wbc_class, 132DECLARE_EVENT_CLASS(wbc_class,
93 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), 133 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),
@@ -101,8 +141,6 @@ DECLARE_EVENT_CLASS(wbc_class,
101 __field(int, for_background) 141 __field(int, for_background)
102 __field(int, for_reclaim) 142 __field(int, for_reclaim)
103 __field(int, range_cyclic) 143 __field(int, range_cyclic)
104 __field(int, more_io)
105 __field(unsigned long, older_than_this)
106 __field(long, range_start) 144 __field(long, range_start)
107 __field(long, range_end) 145 __field(long, range_end)
108 ), 146 ),
@@ -116,15 +154,12 @@ DECLARE_EVENT_CLASS(wbc_class,
116 __entry->for_background = wbc->for_background; 154 __entry->for_background = wbc->for_background;
117 __entry->for_reclaim = wbc->for_reclaim; 155 __entry->for_reclaim = wbc->for_reclaim;
118 __entry->range_cyclic = wbc->range_cyclic; 156 __entry->range_cyclic = wbc->range_cyclic;
119 __entry->more_io = wbc->more_io;
120 __entry->older_than_this = wbc->older_than_this ?
121 *wbc->older_than_this : 0;
122 __entry->range_start = (long)wbc->range_start; 157 __entry->range_start = (long)wbc->range_start;
123 __entry->range_end = (long)wbc->range_end; 158 __entry->range_end = (long)wbc->range_end;
124 ), 159 ),
125 160
126 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " 161 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
127 "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " 162 "bgrd=%d reclm=%d cyclic=%d "
128 "start=0x%lx end=0x%lx", 163 "start=0x%lx end=0x%lx",
129 __entry->name, 164 __entry->name,
130 __entry->nr_to_write, 165 __entry->nr_to_write,
@@ -134,8 +169,6 @@ DECLARE_EVENT_CLASS(wbc_class,
134 __entry->for_background, 169 __entry->for_background,
135 __entry->for_reclaim, 170 __entry->for_reclaim,
136 __entry->range_cyclic, 171 __entry->range_cyclic,
137 __entry->more_io,
138 __entry->older_than_this,
139 __entry->range_start, 172 __entry->range_start,
140 __entry->range_end) 173 __entry->range_end)
141) 174)
@@ -144,14 +177,79 @@ DECLARE_EVENT_CLASS(wbc_class,
144DEFINE_EVENT(wbc_class, name, \ 177DEFINE_EVENT(wbc_class, name, \
145 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ 178 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
146 TP_ARGS(wbc, bdi)) 179 TP_ARGS(wbc, bdi))
147DEFINE_WBC_EVENT(wbc_writeback_start);
148DEFINE_WBC_EVENT(wbc_writeback_written);
149DEFINE_WBC_EVENT(wbc_writeback_wait);
150DEFINE_WBC_EVENT(wbc_balance_dirty_start);
151DEFINE_WBC_EVENT(wbc_balance_dirty_written);
152DEFINE_WBC_EVENT(wbc_balance_dirty_wait);
153DEFINE_WBC_EVENT(wbc_writepage); 180DEFINE_WBC_EVENT(wbc_writepage);
154 181
182TRACE_EVENT(writeback_queue_io,
183 TP_PROTO(struct bdi_writeback *wb,
184 unsigned long *older_than_this,
185 int moved),
186 TP_ARGS(wb, older_than_this, moved),
187 TP_STRUCT__entry(
188 __array(char, name, 32)
189 __field(unsigned long, older)
190 __field(long, age)
191 __field(int, moved)
192 ),
193 TP_fast_assign(
194 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
195 __entry->older = older_than_this ? *older_than_this : 0;
196 __entry->age = older_than_this ?
197 (jiffies - *older_than_this) * 1000 / HZ : -1;
198 __entry->moved = moved;
199 ),
200 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d",
201 __entry->name,
202 __entry->older, /* older_than_this in jiffies */
203 __entry->age, /* older_than_this in relative milliseconds */
204 __entry->moved)
205);
206
207TRACE_EVENT(global_dirty_state,
208
209 TP_PROTO(unsigned long background_thresh,
210 unsigned long dirty_thresh
211 ),
212
213 TP_ARGS(background_thresh,
214 dirty_thresh
215 ),
216
217 TP_STRUCT__entry(
218 __field(unsigned long, nr_dirty)
219 __field(unsigned long, nr_writeback)
220 __field(unsigned long, nr_unstable)
221 __field(unsigned long, background_thresh)
222 __field(unsigned long, dirty_thresh)
223 __field(unsigned long, dirty_limit)
224 __field(unsigned long, nr_dirtied)
225 __field(unsigned long, nr_written)
226 ),
227
228 TP_fast_assign(
229 __entry->nr_dirty = global_page_state(NR_FILE_DIRTY);
230 __entry->nr_writeback = global_page_state(NR_WRITEBACK);
231 __entry->nr_unstable = global_page_state(NR_UNSTABLE_NFS);
232 __entry->nr_dirtied = global_page_state(NR_DIRTIED);
233 __entry->nr_written = global_page_state(NR_WRITTEN);
234 __entry->background_thresh = background_thresh;
235 __entry->dirty_thresh = dirty_thresh;
236 __entry->dirty_limit = global_dirty_limit;
237 ),
238
239 TP_printk("dirty=%lu writeback=%lu unstable=%lu "
240 "bg_thresh=%lu thresh=%lu limit=%lu "
241 "dirtied=%lu written=%lu",
242 __entry->nr_dirty,
243 __entry->nr_writeback,
244 __entry->nr_unstable,
245 __entry->background_thresh,
246 __entry->dirty_thresh,
247 __entry->dirty_limit,
248 __entry->nr_dirtied,
249 __entry->nr_written
250 )
251);
252
155DECLARE_EVENT_CLASS(writeback_congest_waited_template, 253DECLARE_EVENT_CLASS(writeback_congest_waited_template,
156 254
157 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), 255 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
@@ -187,6 +285,63 @@ DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested,
187 TP_ARGS(usec_timeout, usec_delayed) 285 TP_ARGS(usec_timeout, usec_delayed)
188); 286);
189 287
288DECLARE_EVENT_CLASS(writeback_single_inode_template,
289
290 TP_PROTO(struct inode *inode,
291 struct writeback_control *wbc,
292 unsigned long nr_to_write
293 ),
294
295 TP_ARGS(inode, wbc, nr_to_write),
296
297 TP_STRUCT__entry(
298 __array(char, name, 32)
299 __field(unsigned long, ino)
300 __field(unsigned long, state)
301 __field(unsigned long, age)
302 __field(unsigned long, writeback_index)
303 __field(long, nr_to_write)
304 __field(unsigned long, wrote)
305 ),
306
307 TP_fast_assign(
308 strncpy(__entry->name,
309 dev_name(inode->i_mapping->backing_dev_info->dev), 32);
310 __entry->ino = inode->i_ino;
311 __entry->state = inode->i_state;
312 __entry->age = (jiffies - inode->dirtied_when) *
313 1000 / HZ;
314 __entry->writeback_index = inode->i_mapping->writeback_index;
315 __entry->nr_to_write = nr_to_write;
316 __entry->wrote = nr_to_write - wbc->nr_to_write;
317 ),
318
319 TP_printk("bdi %s: ino=%lu state=%s age=%lu "
320 "index=%lu to_write=%ld wrote=%lu",
321 __entry->name,
322 __entry->ino,
323 show_inode_state(__entry->state),
324 __entry->age,
325 __entry->writeback_index,
326 __entry->nr_to_write,
327 __entry->wrote
328 )
329);
330
331DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_requeue,
332 TP_PROTO(struct inode *inode,
333 struct writeback_control *wbc,
334 unsigned long nr_to_write),
335 TP_ARGS(inode, wbc, nr_to_write)
336);
337
338DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode,
339 TP_PROTO(struct inode *inode,
340 struct writeback_control *wbc,
341 unsigned long nr_to_write),
342 TP_ARGS(inode, wbc, nr_to_write)
343);
344
190#endif /* _TRACE_WRITEBACK_H */ 345#endif /* _TRACE_WRITEBACK_H */
191 346
192/* This part must be outside protection */ 347/* This part must be outside protection */
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index 44d8decee09e..92f1a796829e 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -8,6 +8,8 @@
8#include <asm/paravirt_types.h> 8#include <asm/paravirt_types.h>
9#include <asm/xen/trace_types.h> 9#include <asm/xen/trace_types.h>
10 10
11struct multicall_entry;
12
11/* Multicalls */ 13/* Multicalls */
12DECLARE_EVENT_CLASS(xen_mc__batch, 14DECLARE_EVENT_CLASS(xen_mc__batch,
13 TP_PROTO(enum paravirt_lazy_mode mode), 15 TP_PROTO(enum paravirt_lazy_mode mode),
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 892b97f8e157..3b55ef22f8db 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -21,8 +21,6 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/kobject.h> 22#include <linux/kobject.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/platform_device.h>
25#include <asm/atomic.h>
26 24
27#define DISPC_IRQ_FRAMEDONE (1 << 0) 25#define DISPC_IRQ_FRAMEDONE (1 << 0)
28#define DISPC_IRQ_VSYNC (1 << 1) 26#define DISPC_IRQ_VSYNC (1 << 1)
@@ -136,12 +134,6 @@ enum omap_display_caps {
136 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, 134 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1,
137}; 135};
138 136
139enum omap_dss_update_mode {
140 OMAP_DSS_UPDATE_DISABLED = 0,
141 OMAP_DSS_UPDATE_AUTO,
142 OMAP_DSS_UPDATE_MANUAL,
143};
144
145enum omap_dss_display_state { 137enum omap_dss_display_state {
146 OMAP_DSS_DISPLAY_DISABLED = 0, 138 OMAP_DSS_DISPLAY_DISABLED = 0,
147 OMAP_DSS_DISPLAY_ACTIVE, 139 OMAP_DSS_DISPLAY_ACTIVE,
@@ -246,7 +238,7 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
246 238
247/* Board specific data */ 239/* Board specific data */
248struct omap_dss_board_info { 240struct omap_dss_board_info {
249 int (*get_last_off_on_transaction_id)(struct device *dev); 241 int (*get_context_loss_count)(struct device *dev);
250 int num_devices; 242 int num_devices;
251 struct omap_dss_device **devices; 243 struct omap_dss_device **devices;
252 struct omap_dss_device *default_device; 244 struct omap_dss_device *default_device;
@@ -266,8 +258,6 @@ static inline int omap_display_init(struct omap_dss_board_info *board_data)
266struct omap_display_platform_data { 258struct omap_display_platform_data {
267 struct omap_dss_board_info *board_data; 259 struct omap_dss_board_info *board_data;
268 /* TODO: Additional members to be added when PM is considered */ 260 /* TODO: Additional members to be added when PM is considered */
269
270 bool (*opt_clock_available)(const char *clk_role);
271}; 261};
272 262
273struct omap_video_timings { 263struct omap_video_timings {
@@ -300,6 +290,12 @@ extern const struct omap_video_timings omap_dss_pal_timings;
300extern const struct omap_video_timings omap_dss_ntsc_timings; 290extern const struct omap_video_timings omap_dss_ntsc_timings;
301#endif 291#endif
302 292
293struct omap_dss_cpr_coefs {
294 s16 rr, rg, rb;
295 s16 gr, gg, gb;
296 s16 br, bg, bb;
297};
298
303struct omap_overlay_info { 299struct omap_overlay_info {
304 bool enabled; 300 bool enabled;
305 301
@@ -359,6 +355,9 @@ struct omap_overlay_manager_info {
359 bool trans_enabled; 355 bool trans_enabled;
360 356
361 bool alpha_enabled; 357 bool alpha_enabled;
358
359 bool cpr_enable;
360 struct omap_dss_cpr_coefs cpr_coefs;
362}; 361};
363 362
364struct omap_overlay_manager { 363struct omap_overlay_manager {
@@ -526,11 +525,6 @@ struct omap_dss_driver {
526 int (*resume)(struct omap_dss_device *display); 525 int (*resume)(struct omap_dss_device *display);
527 int (*run_test)(struct omap_dss_device *display, int test); 526 int (*run_test)(struct omap_dss_device *display, int test);
528 527
529 int (*set_update_mode)(struct omap_dss_device *dssdev,
530 enum omap_dss_update_mode);
531 enum omap_dss_update_mode (*get_update_mode)(
532 struct omap_dss_device *dssdev);
533
534 int (*update)(struct omap_dss_device *dssdev, 528 int (*update)(struct omap_dss_device *dssdev,
535 u16 x, u16 y, u16 w, u16 h); 529 u16 x, u16 y, u16 w, u16 h);
536 int (*sync)(struct omap_dss_device *dssdev); 530 int (*sync)(struct omap_dss_device *dssdev);