diff options
Diffstat (limited to 'include')
67 files changed, 1869 insertions, 104 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index e65278f560c4..22ba56e834e2 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -437,11 +437,9 @@ void acpi_remove_dir(struct acpi_device *); | |||
437 | */ | 437 | */ |
438 | struct acpi_bus_type { | 438 | struct acpi_bus_type { |
439 | struct list_head list; | 439 | struct list_head list; |
440 | struct bus_type *bus; | 440 | const char *name; |
441 | /* For general devices under the bus */ | 441 | bool (*match)(struct device *dev); |
442 | int (*find_device) (struct device *, acpi_handle *); | 442 | int (*find_device) (struct device *, acpi_handle *); |
443 | /* For bridges, such as PCI root bridge, IDE controller */ | ||
444 | int (*find_bridge) (struct device *, acpi_handle *); | ||
445 | void (*setup)(struct device *); | 443 | void (*setup)(struct device *); |
446 | void (*cleanup)(struct device *); | 444 | void (*cleanup)(struct device *); |
447 | }; | 445 | }; |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 555d0337ad95..b327b5a9296d 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -235,6 +235,9 @@ extern void acpi_processor_unregister_performance(struct | |||
235 | if a _PPC object exists, rmmod is disallowed then */ | 235 | if a _PPC object exists, rmmod is disallowed then */ |
236 | int acpi_processor_notify_smm(struct module *calling_module); | 236 | int acpi_processor_notify_smm(struct module *calling_module); |
237 | 237 | ||
238 | /* parsing the _P* objects. */ | ||
239 | extern int acpi_processor_get_performance_info(struct acpi_processor *pr); | ||
240 | |||
238 | /* for communication between multiple parts of the processor kernel module */ | 241 | /* for communication between multiple parts of the processor kernel module */ |
239 | DECLARE_PER_CPU(struct acpi_processor *, processors); | 242 | DECLARE_PER_CPU(struct acpi_processor *, processors); |
240 | extern struct acpi_processor_errata errata; | 243 | extern struct acpi_processor_errata errata; |
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 1ced6413ea03..33bd2de3bc1e 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h | |||
@@ -136,12 +136,6 @@ static inline void atomic_dec(atomic_t *v) | |||
136 | #define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v))) | 136 | #define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v))) |
137 | #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) | 137 | #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) |
138 | 138 | ||
139 | #define cmpxchg_local(ptr, o, n) \ | ||
140 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
141 | (unsigned long)(n), sizeof(*(ptr)))) | ||
142 | |||
143 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
144 | |||
145 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) | 139 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) |
146 | { | 140 | { |
147 | int c, old; | 141 | int c, old; |
diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h index 14883026015d..811fb1e9b061 100644 --- a/include/asm-generic/cmpxchg.h +++ b/include/asm-generic/cmpxchg.h | |||
@@ -92,6 +92,16 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size) | |||
92 | */ | 92 | */ |
93 | #include <asm-generic/cmpxchg-local.h> | 93 | #include <asm-generic/cmpxchg-local.h> |
94 | 94 | ||
95 | #ifndef cmpxchg_local | ||
96 | #define cmpxchg_local(ptr, o, n) \ | ||
97 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
98 | (unsigned long)(n), sizeof(*(ptr)))) | ||
99 | #endif | ||
100 | |||
101 | #ifndef cmpxchg64_local | ||
102 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
103 | #endif | ||
104 | |||
95 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) | 105 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) |
96 | #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) | 106 | #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) |
97 | 107 | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8839b3a24660..e3e0d651c6ca 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -443,12 +443,12 @@ struct drm_crtc { | |||
443 | * @dpms: set power state (see drm_crtc_funcs above) | 443 | * @dpms: set power state (see drm_crtc_funcs above) |
444 | * @save: save connector state | 444 | * @save: save connector state |
445 | * @restore: restore connector state | 445 | * @restore: restore connector state |
446 | * @reset: reset connector after state has been invalidate (e.g. resume) | 446 | * @reset: reset connector after state has been invalidated (e.g. resume) |
447 | * @detect: is this connector active? | 447 | * @detect: is this connector active? |
448 | * @fill_modes: fill mode list for this connector | 448 | * @fill_modes: fill mode list for this connector |
449 | * @set_property: property for this connector may need update | 449 | * @set_property: property for this connector may need an update |
450 | * @destroy: make object go away | 450 | * @destroy: make object go away |
451 | * @force: notify the driver the connector is forced on | 451 | * @force: notify the driver that the connector is forced on |
452 | * | 452 | * |
453 | * Each CRTC may have one or more connectors attached to it. The functions | 453 | * Each CRTC may have one or more connectors attached to it. The functions |
454 | * below allow the core DRM code to control connectors, enumerate available modes, | 454 | * below allow the core DRM code to control connectors, enumerate available modes, |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index a386b0b654cc..918e8fe2f5e9 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -581,7 +581,11 @@ | |||
581 | {0x1002, 0x9908, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 581 | {0x1002, 0x9908, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
582 | {0x1002, 0x9909, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 582 | {0x1002, 0x9909, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
583 | {0x1002, 0x990A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 583 | {0x1002, 0x990A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
584 | {0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 584 | {0x1002, 0x990B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
585 | {0x1002, 0x990C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
586 | {0x1002, 0x990D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
587 | {0x1002, 0x990E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
588 | {0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
585 | {0x1002, 0x9910, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 589 | {0x1002, 0x9910, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
586 | {0x1002, 0x9913, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 590 | {0x1002, 0x9913, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
587 | {0x1002, 0x9917, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 591 | {0x1002, 0x9917, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
@@ -592,6 +596,13 @@ | |||
592 | {0x1002, 0x9992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 596 | {0x1002, 0x9992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
593 | {0x1002, 0x9993, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 597 | {0x1002, 0x9993, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
594 | {0x1002, 0x9994, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 598 | {0x1002, 0x9994, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
599 | {0x1002, 0x9995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
600 | {0x1002, 0x9996, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
601 | {0x1002, 0x9997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
602 | {0x1002, 0x9998, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
603 | {0x1002, 0x9999, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
604 | {0x1002, 0x999A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
605 | {0x1002, 0x999B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
595 | {0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 606 | {0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
596 | {0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 607 | {0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
597 | {0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 608 | {0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index a975de1ff59f..3bd46f766751 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
@@ -51,7 +51,7 @@ struct task_struct; | |||
51 | extern void debug_show_all_locks(void); | 51 | extern void debug_show_all_locks(void); |
52 | extern void debug_show_held_locks(struct task_struct *task); | 52 | extern void debug_show_held_locks(struct task_struct *task); |
53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); | 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); |
54 | extern void debug_check_no_locks_held(void); | 54 | extern void debug_check_no_locks_held(struct task_struct *task); |
55 | #else | 55 | #else |
56 | static inline void debug_show_all_locks(void) | 56 | static inline void debug_show_all_locks(void) |
57 | { | 57 | { |
@@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | static inline void | 69 | static inline void |
70 | debug_check_no_locks_held(void) | 70 | debug_check_no_locks_held(struct task_struct *task) |
71 | { | 71 | { |
72 | } | 72 | } |
73 | #endif | 73 | #endif |
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h index 2224a8c0cb64..8d5ab998a222 100644 --- a/include/linux/ecryptfs.h +++ b/include/linux/ecryptfs.h | |||
@@ -6,9 +6,8 @@ | |||
6 | #define ECRYPTFS_VERSION_MINOR 0x04 | 6 | #define ECRYPTFS_VERSION_MINOR 0x04 |
7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 | 7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 |
8 | /* These flags indicate which features are supported by the kernel | 8 | /* These flags indicate which features are supported by the kernel |
9 | * module; userspace tools such as the mount helper read | 9 | * module; userspace tools such as the mount helper read the feature |
10 | * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine | 10 | * bits from a sysfs handle in order to determine how to behave. */ |
11 | * how to behave. */ | ||
12 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 | 11 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 |
13 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 | 12 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 |
14 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 | 13 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 |
@@ -19,13 +18,6 @@ | |||
19 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 | 18 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 |
20 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 | 19 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 |
21 | #define ECRYPTFS_VERSIONING_GCM 0x00000200 | 20 | #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 | 21 | #define ECRYPTFS_MAX_PASSWORD_LENGTH 64 |
30 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH | 22 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH |
31 | #define ECRYPTFS_SALT_SIZE 8 | 23 | #define ECRYPTFS_SALT_SIZE 8 |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 4fd4999ccb5b..0b763276f619 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -561,7 +561,6 @@ struct csrow_info { | |||
561 | 561 | ||
562 | u32 ue_count; /* Uncorrectable Errors for this csrow */ | 562 | u32 ue_count; /* Uncorrectable Errors for this csrow */ |
563 | u32 ce_count; /* Correctable Errors for this csrow */ | 563 | u32 ce_count; /* Correctable Errors for this csrow */ |
564 | u32 nr_pages; /* combined pages count of all channels */ | ||
565 | 564 | ||
566 | struct mem_ctl_info *mci; /* the parent */ | 565 | struct mem_ctl_info *mci; /* the parent */ |
567 | 566 | ||
@@ -676,11 +675,11 @@ struct mem_ctl_info { | |||
676 | * sees memory sticks ("dimms"), and the ones that sees memory ranks. | 675 | * sees memory sticks ("dimms"), and the ones that sees memory ranks. |
677 | * All old memory controllers enumerate memories per rank, but most | 676 | * All old memory controllers enumerate memories per rank, but most |
678 | * of the recent drivers enumerate memories per DIMM, instead. | 677 | * of the recent drivers enumerate memories per DIMM, instead. |
679 | * When the memory controller is per rank, mem_is_per_rank is true. | 678 | * When the memory controller is per rank, csbased is true. |
680 | */ | 679 | */ |
681 | unsigned n_layers; | 680 | unsigned n_layers; |
682 | struct edac_mc_layer *layers; | 681 | struct edac_mc_layer *layers; |
683 | bool mem_is_per_rank; | 682 | bool csbased; |
684 | 683 | ||
685 | /* | 684 | /* |
686 | * DIMM info. Will eventually remove the entire csrows_info some day | 685 | * DIMM info. Will eventually remove the entire csrows_info some day |
@@ -741,8 +740,6 @@ struct mem_ctl_info { | |||
741 | u32 fake_inject_ue; | 740 | u32 fake_inject_ue; |
742 | u16 fake_inject_count; | 741 | u16 fake_inject_count; |
743 | #endif | 742 | #endif |
744 | __u8 csbased : 1, /* csrow-based memory controller */ | ||
745 | __resv : 7; | ||
746 | }; | 743 | }; |
747 | 744 | ||
748 | #endif | 745 | #endif |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 043a5cf8b5ba..e70df40d84f6 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -3,7 +3,6 @@ | |||
3 | #ifndef FREEZER_H_INCLUDED | 3 | #ifndef FREEZER_H_INCLUDED |
4 | #define FREEZER_H_INCLUDED | 4 | #define FREEZER_H_INCLUDED |
5 | 5 | ||
6 | #include <linux/debug_locks.h> | ||
7 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
8 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
9 | #include <linux/atomic.h> | 8 | #include <linux/atomic.h> |
@@ -49,8 +48,6 @@ extern void thaw_kernel_threads(void); | |||
49 | 48 | ||
50 | static inline bool try_to_freeze(void) | 49 | static inline bool try_to_freeze(void) |
51 | { | 50 | { |
52 | if (!(current->flags & PF_NOFREEZE)) | ||
53 | debug_check_no_locks_held(); | ||
54 | might_sleep(); | 51 | might_sleep(); |
55 | if (likely(!freezing(current))) | 52 | if (likely(!freezing(current))) |
56 | return false; | 53 | return false; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 74a907b8b950..2c28271ab9d4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1825,6 +1825,8 @@ struct file_system_type { | |||
1825 | struct lock_class_key i_mutex_dir_key; | 1825 | struct lock_class_key i_mutex_dir_key; |
1826 | }; | 1826 | }; |
1827 | 1827 | ||
1828 | #define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME) | ||
1829 | |||
1828 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, | 1830 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, |
1829 | void *data, int (*fill_super)(struct super_block *, void *, int)); | 1831 | void *data, int (*fill_super)(struct super_block *, void *, int)); |
1830 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, | 1832 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, |
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 729eded4b24f..2b93a9a5a1e6 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
@@ -50,4 +50,6 @@ static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root, | |||
50 | spin_unlock(&fs->lock); | 50 | spin_unlock(&fs->lock); |
51 | } | 51 | } |
52 | 52 | ||
53 | extern bool current_chrooted(void); | ||
54 | |||
53 | #endif /* _LINUX_FS_STRUCT_H */ | 55 | #endif /* _LINUX_FS_STRUCT_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 29eb805ea4a6..c1d6555d2567 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -118,10 +118,8 @@ | |||
118 | 118 | ||
119 | #ifdef CONFIG_PREEMPT_COUNT | 119 | #ifdef CONFIG_PREEMPT_COUNT |
120 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 120 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
121 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | ||
122 | #else | 121 | #else |
123 | # define preemptible() 0 | 122 | # define preemptible() 0 |
124 | # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET | ||
125 | #endif | 123 | #endif |
126 | 124 | ||
127 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) | 125 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) |
diff --git a/include/linux/hash.h b/include/linux/hash.h index 61c97ae22e01..f09a0ae4d858 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <asm/types.h> | 17 | #include <asm/types.h> |
18 | #include <linux/compiler.h> | ||
18 | 19 | ||
19 | /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ | 20 | /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ |
20 | #define GOLDEN_RATIO_PRIME_32 0x9e370001UL | 21 | #define GOLDEN_RATIO_PRIME_32 0x9e370001UL |
@@ -31,7 +32,7 @@ | |||
31 | #error Wordsize not 32 or 64 | 32 | #error Wordsize not 32 or 64 |
32 | #endif | 33 | #endif |
33 | 34 | ||
34 | static inline u64 hash_64(u64 val, unsigned int bits) | 35 | static __always_inline u64 hash_64(u64 val, unsigned int bits) |
35 | { | 36 | { |
36 | u64 hash = val; | 37 | u64 hash = val; |
37 | 38 | ||
diff --git a/include/linux/i2c/atmel_mxt_ts.h b/include/linux/i2c/atmel_mxt_ts.h index f027f7a63511..99e379b74398 100644 --- a/include/linux/i2c/atmel_mxt_ts.h +++ b/include/linux/i2c/atmel_mxt_ts.h | |||
@@ -15,6 +15,9 @@ | |||
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | 17 | ||
18 | /* For key_map array */ | ||
19 | #define MXT_NUM_GPIO 4 | ||
20 | |||
18 | /* Orient */ | 21 | /* Orient */ |
19 | #define MXT_NORMAL 0x0 | 22 | #define MXT_NORMAL 0x0 |
20 | #define MXT_DIAGONAL 0x1 | 23 | #define MXT_DIAGONAL 0x1 |
@@ -39,6 +42,8 @@ struct mxt_platform_data { | |||
39 | unsigned int voltage; | 42 | unsigned int voltage; |
40 | unsigned char orient; | 43 | unsigned char orient; |
41 | unsigned long irqflags; | 44 | unsigned long irqflags; |
45 | bool is_tp; | ||
46 | const unsigned int key_map[MXT_NUM_GPIO]; | ||
42 | }; | 47 | }; |
43 | 48 | ||
44 | #endif /* __LINUX_ATMEL_MXT_TS_H */ | 49 | #endif /* __LINUX_ATMEL_MXT_TS_H */ |
diff --git a/include/linux/idr.h b/include/linux/idr.h index a6f38b5c34e4..2640c7e99e51 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -73,8 +73,6 @@ struct idr { | |||
73 | */ | 73 | */ |
74 | 74 | ||
75 | void *idr_find_slowpath(struct idr *idp, int id); | 75 | void *idr_find_slowpath(struct idr *idp, int id); |
76 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | ||
77 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | ||
78 | void idr_preload(gfp_t gfp_mask); | 76 | void idr_preload(gfp_t gfp_mask); |
79 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); | 77 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); |
80 | int idr_for_each(struct idr *idp, | 78 | int idr_for_each(struct idr *idp, |
@@ -99,7 +97,7 @@ static inline void idr_preload_end(void) | |||
99 | 97 | ||
100 | /** | 98 | /** |
101 | * idr_find - return pointer for given id | 99 | * idr_find - return pointer for given id |
102 | * @idp: idr handle | 100 | * @idr: idr handle |
103 | * @id: lookup key | 101 | * @id: lookup key |
104 | * | 102 | * |
105 | * Return the pointer given the id it has been registered with. A %NULL | 103 | * Return the pointer given the id it has been registered with. A %NULL |
@@ -120,19 +118,6 @@ static inline void *idr_find(struct idr *idr, int id) | |||
120 | } | 118 | } |
121 | 119 | ||
122 | /** | 120 | /** |
123 | * idr_get_new - allocate new idr entry | ||
124 | * @idp: idr handle | ||
125 | * @ptr: pointer you want associated with the id | ||
126 | * @id: pointer to the allocated handle | ||
127 | * | ||
128 | * Simple wrapper around idr_get_new_above() w/ @starting_id of zero. | ||
129 | */ | ||
130 | static inline int idr_get_new(struct idr *idp, void *ptr, int *id) | ||
131 | { | ||
132 | return idr_get_new_above(idp, ptr, 0, id); | ||
133 | } | ||
134 | |||
135 | /** | ||
136 | * idr_for_each_entry - iterate over an idr's elements of a given type | 121 | * idr_for_each_entry - iterate over an idr's elements of a given type |
137 | * @idp: idr handle | 122 | * @idp: idr handle |
138 | * @entry: the type * to use as cursor | 123 | * @entry: the type * to use as cursor |
@@ -143,7 +128,56 @@ static inline int idr_get_new(struct idr *idp, void *ptr, int *id) | |||
143 | entry != NULL; \ | 128 | entry != NULL; \ |
144 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) | 129 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) |
145 | 130 | ||
146 | void __idr_remove_all(struct idr *idp); /* don't use */ | 131 | /* |
132 | * Don't use the following functions. These exist only to suppress | ||
133 | * deprecated warnings on EXPORT_SYMBOL()s. | ||
134 | */ | ||
135 | int __idr_pre_get(struct idr *idp, gfp_t gfp_mask); | ||
136 | int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | ||
137 | void __idr_remove_all(struct idr *idp); | ||
138 | |||
139 | /** | ||
140 | * idr_pre_get - reserve resources for idr allocation | ||
141 | * @idp: idr handle | ||
142 | * @gfp_mask: memory allocation flags | ||
143 | * | ||
144 | * Part of old alloc interface. This is going away. Use | ||
145 | * idr_preload[_end]() and idr_alloc() instead. | ||
146 | */ | ||
147 | static inline int __deprecated idr_pre_get(struct idr *idp, gfp_t gfp_mask) | ||
148 | { | ||
149 | return __idr_pre_get(idp, gfp_mask); | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * idr_get_new_above - allocate new idr entry above or equal to a start id | ||
154 | * @idp: idr handle | ||
155 | * @ptr: pointer you want associated with the id | ||
156 | * @starting_id: id to start search at | ||
157 | * @id: pointer to the allocated handle | ||
158 | * | ||
159 | * Part of old alloc interface. This is going away. Use | ||
160 | * idr_preload[_end]() and idr_alloc() instead. | ||
161 | */ | ||
162 | static inline int __deprecated idr_get_new_above(struct idr *idp, void *ptr, | ||
163 | int starting_id, int *id) | ||
164 | { | ||
165 | return __idr_get_new_above(idp, ptr, starting_id, id); | ||
166 | } | ||
167 | |||
168 | /** | ||
169 | * idr_get_new - allocate new idr entry | ||
170 | * @idp: idr handle | ||
171 | * @ptr: pointer you want associated with the id | ||
172 | * @id: pointer to the allocated handle | ||
173 | * | ||
174 | * Part of old alloc interface. This is going away. Use | ||
175 | * idr_preload[_end]() and idr_alloc() instead. | ||
176 | */ | ||
177 | static inline int __deprecated idr_get_new(struct idr *idp, void *ptr, int *id) | ||
178 | { | ||
179 | return __idr_get_new_above(idp, ptr, 0, id); | ||
180 | } | ||
147 | 181 | ||
148 | /** | 182 | /** |
149 | * idr_remove_all - remove all ids from the given idr tree | 183 | * idr_remove_all - remove all ids from the given idr tree |
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 1f86a97ab2e2..8bd12be0b02f 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
@@ -227,14 +227,17 @@ struct st_sensor_data { | |||
227 | }; | 227 | }; |
228 | 228 | ||
229 | #ifdef CONFIG_IIO_BUFFER | 229 | #ifdef CONFIG_IIO_BUFFER |
230 | irqreturn_t st_sensors_trigger_handler(int irq, void *p); | ||
231 | |||
232 | int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf); | ||
233 | #endif | ||
234 | |||
235 | #ifdef CONFIG_IIO_TRIGGER | ||
230 | int st_sensors_allocate_trigger(struct iio_dev *indio_dev, | 236 | int st_sensors_allocate_trigger(struct iio_dev *indio_dev, |
231 | const struct iio_trigger_ops *trigger_ops); | 237 | const struct iio_trigger_ops *trigger_ops); |
232 | 238 | ||
233 | void st_sensors_deallocate_trigger(struct iio_dev *indio_dev); | 239 | void st_sensors_deallocate_trigger(struct iio_dev *indio_dev); |
234 | 240 | ||
235 | irqreturn_t st_sensors_trigger_handler(int irq, void *p); | ||
236 | |||
237 | int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf); | ||
238 | #else | 241 | #else |
239 | static inline int st_sensors_allocate_trigger(struct iio_dev *indio_dev, | 242 | static inline int st_sensors_allocate_trigger(struct iio_dev *indio_dev, |
240 | const struct iio_trigger_ops *trigger_ops) | 243 | const struct iio_trigger_ops *trigger_ops) |
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 5f3aa6b11bfa..27e06acc509a 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
@@ -81,4 +81,23 @@ int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data, | |||
81 | unsigned short *keymap, | 81 | unsigned short *keymap, |
82 | struct input_dev *input_dev); | 82 | struct input_dev *input_dev); |
83 | 83 | ||
84 | #ifdef CONFIG_OF | ||
85 | /** | ||
86 | * matrix_keypad_parse_of_params() - Read parameters from matrix-keypad node | ||
87 | * | ||
88 | * @dev: Device containing of_node | ||
89 | * @rows: Returns number of matrix rows | ||
90 | * @cols: Returns number of matrix columns | ||
91 | * @return 0 if OK, <0 on error | ||
92 | */ | ||
93 | int matrix_keypad_parse_of_params(struct device *dev, | ||
94 | unsigned int *rows, unsigned int *cols); | ||
95 | #else | ||
96 | static inline int matrix_keypad_parse_of_params(struct device *dev, | ||
97 | unsigned int *rows, unsigned int *cols) | ||
98 | { | ||
99 | return -ENOSYS; | ||
100 | } | ||
101 | #endif /* CONFIG_OF */ | ||
102 | |||
84 | #endif /* _MATRIX_KEYPAD_H */ | 103 | #endif /* _MATRIX_KEYPAD_H */ |
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h index f5dbce50466e..66017028dcb3 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h | |||
@@ -37,7 +37,7 @@ void irq_work_sync(struct irq_work *work); | |||
37 | #ifdef CONFIG_IRQ_WORK | 37 | #ifdef CONFIG_IRQ_WORK |
38 | bool irq_work_needs_cpu(void); | 38 | bool irq_work_needs_cpu(void); |
39 | #else | 39 | #else |
40 | static bool irq_work_needs_cpu(void) { return false; } | 40 | static inline bool irq_work_needs_cpu(void) { return false; } |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #endif /* _LINUX_IRQ_WORK_H */ | 43 | #endif /* _LINUX_IRQ_WORK_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 80d36874689b..79fdd80a42d4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -390,7 +390,6 @@ extern struct pid *session_of_pgrp(struct pid *pgrp); | |||
390 | unsigned long int_sqrt(unsigned long); | 390 | unsigned long int_sqrt(unsigned long); |
391 | 391 | ||
392 | extern void bust_spinlocks(int yes); | 392 | extern void bust_spinlocks(int yes); |
393 | extern void wake_up_klogd(void); | ||
394 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 393 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
395 | extern int panic_timeout; | 394 | extern int panic_timeout; |
396 | extern int panic_on_oops; | 395 | extern int panic_on_oops; |
diff --git a/include/linux/list.h b/include/linux/list.h index d991cc147c98..6a1f8df9144b 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -667,7 +667,9 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
667 | pos = n) | 667 | pos = n) |
668 | 668 | ||
669 | #define hlist_entry_safe(ptr, type, member) \ | 669 | #define hlist_entry_safe(ptr, type, member) \ |
670 | (ptr) ? hlist_entry(ptr, type, member) : NULL | 670 | ({ typeof(ptr) ____ptr = (ptr); \ |
671 | ____ptr ? hlist_entry(____ptr, type, member) : NULL; \ | ||
672 | }) | ||
671 | 673 | ||
672 | /** | 674 | /** |
673 | * hlist_for_each_entry - iterate over list of given type | 675 | * hlist_for_each_entry - iterate over list of given type |
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h new file mode 100644 index 000000000000..032af7fc5b2e --- /dev/null +++ b/include/linux/mfd/cros_ec.h | |||
@@ -0,0 +1,170 @@ | |||
1 | /* | ||
2 | * ChromeOS EC multi-function device | ||
3 | * | ||
4 | * Copyright (C) 2012 Google, Inc | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __LINUX_MFD_CROS_EC_H | ||
17 | #define __LINUX_MFD_CROS_EC_H | ||
18 | |||
19 | #include <linux/mfd/cros_ec_commands.h> | ||
20 | |||
21 | /* | ||
22 | * Command interface between EC and AP, for LPC, I2C and SPI interfaces. | ||
23 | */ | ||
24 | enum { | ||
25 | EC_MSG_TX_HEADER_BYTES = 3, | ||
26 | EC_MSG_TX_TRAILER_BYTES = 1, | ||
27 | EC_MSG_TX_PROTO_BYTES = EC_MSG_TX_HEADER_BYTES + | ||
28 | EC_MSG_TX_TRAILER_BYTES, | ||
29 | EC_MSG_RX_PROTO_BYTES = 3, | ||
30 | |||
31 | /* Max length of messages */ | ||
32 | EC_MSG_BYTES = EC_HOST_PARAM_SIZE + EC_MSG_TX_PROTO_BYTES, | ||
33 | |||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * struct cros_ec_msg - A message sent to the EC, and its reply | ||
38 | * | ||
39 | * @version: Command version number (often 0) | ||
40 | * @cmd: Command to send (EC_CMD_...) | ||
41 | * @out_buf: Outgoing payload (to EC) | ||
42 | * @outlen: Outgoing length | ||
43 | * @in_buf: Incoming payload (from EC) | ||
44 | * @in_len: Incoming length | ||
45 | */ | ||
46 | struct cros_ec_msg { | ||
47 | u8 version; | ||
48 | u8 cmd; | ||
49 | uint8_t *out_buf; | ||
50 | int out_len; | ||
51 | uint8_t *in_buf; | ||
52 | int in_len; | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * struct cros_ec_device - Information about a ChromeOS EC device | ||
57 | * | ||
58 | * @name: Name of this EC interface | ||
59 | * @priv: Private data | ||
60 | * @irq: Interrupt to use | ||
61 | * @din: input buffer (from EC) | ||
62 | * @dout: output buffer (to EC) | ||
63 | * \note | ||
64 | * These two buffers will always be dword-aligned and include enough | ||
65 | * space for up to 7 word-alignment bytes also, so we can ensure that | ||
66 | * the body of the message is always dword-aligned (64-bit). | ||
67 | * | ||
68 | * We use this alignment to keep ARM and x86 happy. Probably word | ||
69 | * alignment would be OK, there might be a small performance advantage | ||
70 | * to using dword. | ||
71 | * @din_size: size of din buffer | ||
72 | * @dout_size: size of dout buffer | ||
73 | * @command_send: send a command | ||
74 | * @command_recv: receive a command | ||
75 | * @ec_name: name of EC device (e.g. 'chromeos-ec') | ||
76 | * @phys_name: name of physical comms layer (e.g. 'i2c-4') | ||
77 | * @parent: pointer to parent device (e.g. i2c or spi device) | ||
78 | * @dev: Device pointer | ||
79 | * dev_lock: Lock to prevent concurrent access | ||
80 | * @wake_enabled: true if this device can wake the system from sleep | ||
81 | * @was_wake_device: true if this device was set to wake the system from | ||
82 | * sleep at the last suspend | ||
83 | * @event_notifier: interrupt event notifier for transport devices | ||
84 | */ | ||
85 | struct cros_ec_device { | ||
86 | const char *name; | ||
87 | void *priv; | ||
88 | int irq; | ||
89 | uint8_t *din; | ||
90 | uint8_t *dout; | ||
91 | int din_size; | ||
92 | int dout_size; | ||
93 | int (*command_send)(struct cros_ec_device *ec, | ||
94 | uint16_t cmd, void *out_buf, int out_len); | ||
95 | int (*command_recv)(struct cros_ec_device *ec, | ||
96 | uint16_t cmd, void *in_buf, int in_len); | ||
97 | int (*command_sendrecv)(struct cros_ec_device *ec, | ||
98 | uint16_t cmd, void *out_buf, int out_len, | ||
99 | void *in_buf, int in_len); | ||
100 | int (*command_xfer)(struct cros_ec_device *ec, | ||
101 | struct cros_ec_msg *msg); | ||
102 | |||
103 | const char *ec_name; | ||
104 | const char *phys_name; | ||
105 | struct device *parent; | ||
106 | |||
107 | /* These are --private-- fields - do not assign */ | ||
108 | struct device *dev; | ||
109 | struct mutex dev_lock; | ||
110 | bool wake_enabled; | ||
111 | bool was_wake_device; | ||
112 | struct blocking_notifier_head event_notifier; | ||
113 | }; | ||
114 | |||
115 | /** | ||
116 | * cros_ec_suspend - Handle a suspend operation for the ChromeOS EC device | ||
117 | * | ||
118 | * This can be called by drivers to handle a suspend event. | ||
119 | * | ||
120 | * ec_dev: Device to suspend | ||
121 | * @return 0 if ok, -ve on error | ||
122 | */ | ||
123 | int cros_ec_suspend(struct cros_ec_device *ec_dev); | ||
124 | |||
125 | /** | ||
126 | * cros_ec_resume - Handle a resume operation for the ChromeOS EC device | ||
127 | * | ||
128 | * This can be called by drivers to handle a resume event. | ||
129 | * | ||
130 | * @ec_dev: Device to resume | ||
131 | * @return 0 if ok, -ve on error | ||
132 | */ | ||
133 | int cros_ec_resume(struct cros_ec_device *ec_dev); | ||
134 | |||
135 | /** | ||
136 | * cros_ec_prepare_tx - Prepare an outgoing message in the output buffer | ||
137 | * | ||
138 | * This is intended to be used by all ChromeOS EC drivers, but at present | ||
139 | * only SPI uses it. Once LPC uses the same protocol it can start using it. | ||
140 | * I2C could use it now, with a refactor of the existing code. | ||
141 | * | ||
142 | * @ec_dev: Device to register | ||
143 | * @msg: Message to write | ||
144 | */ | ||
145 | int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, | ||
146 | struct cros_ec_msg *msg); | ||
147 | |||
148 | /** | ||
149 | * cros_ec_remove - Remove a ChromeOS EC | ||
150 | * | ||
151 | * Call this to deregister a ChromeOS EC. After this you should call | ||
152 | * cros_ec_free(). | ||
153 | * | ||
154 | * @ec_dev: Device to register | ||
155 | * @return 0 if ok, -ve on error | ||
156 | */ | ||
157 | int cros_ec_remove(struct cros_ec_device *ec_dev); | ||
158 | |||
159 | /** | ||
160 | * cros_ec_register - Register a new ChromeOS EC, using the provided info | ||
161 | * | ||
162 | * Before calling this, allocate a pointer to a new device and then fill | ||
163 | * in all the fields up to the --private-- marker. | ||
164 | * | ||
165 | * @ec_dev: Device to register | ||
166 | * @return 0 if ok, -ve on error | ||
167 | */ | ||
168 | int cros_ec_register(struct cros_ec_device *ec_dev); | ||
169 | |||
170 | #endif /* __LINUX_MFD_CROS_EC_H */ | ||
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h new file mode 100644 index 000000000000..86fd06953bcd --- /dev/null +++ b/include/linux/mfd/cros_ec_commands.h | |||
@@ -0,0 +1,1369 @@ | |||
1 | /* | ||
2 | * Host communication command constants for ChromeOS EC | ||
3 | * | ||
4 | * Copyright (C) 2012 Google, Inc | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * The ChromeOS EC multi function device is used to mux all the requests | ||
16 | * to the EC device for its multiple features: keyboard controller, | ||
17 | * battery charging and regulator control, firmware update. | ||
18 | * | ||
19 | * NOTE: This file is copied verbatim from the ChromeOS EC Open Source | ||
20 | * project in an attempt to make future updates easy to make. | ||
21 | */ | ||
22 | |||
23 | #ifndef __CROS_EC_COMMANDS_H | ||
24 | #define __CROS_EC_COMMANDS_H | ||
25 | |||
26 | /* | ||
27 | * Protocol overview | ||
28 | * | ||
29 | * request: CMD [ P0 P1 P2 ... Pn S ] | ||
30 | * response: ERR [ P0 P1 P2 ... Pn S ] | ||
31 | * | ||
32 | * where the bytes are defined as follow : | ||
33 | * - CMD is the command code. (defined by EC_CMD_ constants) | ||
34 | * - ERR is the error code. (defined by EC_RES_ constants) | ||
35 | * - Px is the optional payload. | ||
36 | * it is not sent if the error code is not success. | ||
37 | * (defined by ec_params_ and ec_response_ structures) | ||
38 | * - S is the checksum which is the sum of all payload bytes. | ||
39 | * | ||
40 | * On LPC, CMD and ERR are sent/received at EC_LPC_ADDR_KERNEL|USER_CMD | ||
41 | * and the payloads are sent/received at EC_LPC_ADDR_KERNEL|USER_PARAM. | ||
42 | * On I2C, all bytes are sent serially in the same message. | ||
43 | */ | ||
44 | |||
45 | /* Current version of this protocol */ | ||
46 | #define EC_PROTO_VERSION 0x00000002 | ||
47 | |||
48 | /* Command version mask */ | ||
49 | #define EC_VER_MASK(version) (1UL << (version)) | ||
50 | |||
51 | /* I/O addresses for ACPI commands */ | ||
52 | #define EC_LPC_ADDR_ACPI_DATA 0x62 | ||
53 | #define EC_LPC_ADDR_ACPI_CMD 0x66 | ||
54 | |||
55 | /* I/O addresses for host command */ | ||
56 | #define EC_LPC_ADDR_HOST_DATA 0x200 | ||
57 | #define EC_LPC_ADDR_HOST_CMD 0x204 | ||
58 | |||
59 | /* I/O addresses for host command args and params */ | ||
60 | #define EC_LPC_ADDR_HOST_ARGS 0x800 | ||
61 | #define EC_LPC_ADDR_HOST_PARAM 0x804 | ||
62 | #define EC_HOST_PARAM_SIZE 0x0fc /* Size of param area in bytes */ | ||
63 | |||
64 | /* I/O addresses for host command params, old interface */ | ||
65 | #define EC_LPC_ADDR_OLD_PARAM 0x880 | ||
66 | #define EC_OLD_PARAM_SIZE 0x080 /* Size of param area in bytes */ | ||
67 | |||
68 | /* EC command register bit functions */ | ||
69 | #define EC_LPC_CMDR_DATA (1 << 0) /* Data ready for host to read */ | ||
70 | #define EC_LPC_CMDR_PENDING (1 << 1) /* Write pending to EC */ | ||
71 | #define EC_LPC_CMDR_BUSY (1 << 2) /* EC is busy processing a command */ | ||
72 | #define EC_LPC_CMDR_CMD (1 << 3) /* Last host write was a command */ | ||
73 | #define EC_LPC_CMDR_ACPI_BRST (1 << 4) /* Burst mode (not used) */ | ||
74 | #define EC_LPC_CMDR_SCI (1 << 5) /* SCI event is pending */ | ||
75 | #define EC_LPC_CMDR_SMI (1 << 6) /* SMI event is pending */ | ||
76 | |||
77 | #define EC_LPC_ADDR_MEMMAP 0x900 | ||
78 | #define EC_MEMMAP_SIZE 255 /* ACPI IO buffer max is 255 bytes */ | ||
79 | #define EC_MEMMAP_TEXT_MAX 8 /* Size of a string in the memory map */ | ||
80 | |||
81 | /* The offset address of each type of data in mapped memory. */ | ||
82 | #define EC_MEMMAP_TEMP_SENSOR 0x00 /* Temp sensors */ | ||
83 | #define EC_MEMMAP_FAN 0x10 /* Fan speeds */ | ||
84 | #define EC_MEMMAP_TEMP_SENSOR_B 0x18 /* Temp sensors (second set) */ | ||
85 | #define EC_MEMMAP_ID 0x20 /* 'E' 'C' */ | ||
86 | #define EC_MEMMAP_ID_VERSION 0x22 /* Version of data in 0x20 - 0x2f */ | ||
87 | #define EC_MEMMAP_THERMAL_VERSION 0x23 /* Version of data in 0x00 - 0x1f */ | ||
88 | #define EC_MEMMAP_BATTERY_VERSION 0x24 /* Version of data in 0x40 - 0x7f */ | ||
89 | #define EC_MEMMAP_SWITCHES_VERSION 0x25 /* Version of data in 0x30 - 0x33 */ | ||
90 | #define EC_MEMMAP_EVENTS_VERSION 0x26 /* Version of data in 0x34 - 0x3f */ | ||
91 | #define EC_MEMMAP_HOST_CMD_FLAGS 0x27 /* Host command interface flags */ | ||
92 | #define EC_MEMMAP_SWITCHES 0x30 | ||
93 | #define EC_MEMMAP_HOST_EVENTS 0x34 | ||
94 | #define EC_MEMMAP_BATT_VOLT 0x40 /* Battery Present Voltage */ | ||
95 | #define EC_MEMMAP_BATT_RATE 0x44 /* Battery Present Rate */ | ||
96 | #define EC_MEMMAP_BATT_CAP 0x48 /* Battery Remaining Capacity */ | ||
97 | #define EC_MEMMAP_BATT_FLAG 0x4c /* Battery State, defined below */ | ||
98 | #define EC_MEMMAP_BATT_DCAP 0x50 /* Battery Design Capacity */ | ||
99 | #define EC_MEMMAP_BATT_DVLT 0x54 /* Battery Design Voltage */ | ||
100 | #define EC_MEMMAP_BATT_LFCC 0x58 /* Battery Last Full Charge Capacity */ | ||
101 | #define EC_MEMMAP_BATT_CCNT 0x5c /* Battery Cycle Count */ | ||
102 | #define EC_MEMMAP_BATT_MFGR 0x60 /* Battery Manufacturer String */ | ||
103 | #define EC_MEMMAP_BATT_MODEL 0x68 /* Battery Model Number String */ | ||
104 | #define EC_MEMMAP_BATT_SERIAL 0x70 /* Battery Serial Number String */ | ||
105 | #define EC_MEMMAP_BATT_TYPE 0x78 /* Battery Type String */ | ||
106 | |||
107 | /* Number of temp sensors at EC_MEMMAP_TEMP_SENSOR */ | ||
108 | #define EC_TEMP_SENSOR_ENTRIES 16 | ||
109 | /* | ||
110 | * Number of temp sensors at EC_MEMMAP_TEMP_SENSOR_B. | ||
111 | * | ||
112 | * Valid only if EC_MEMMAP_THERMAL_VERSION returns >= 2. | ||
113 | */ | ||
114 | #define EC_TEMP_SENSOR_B_ENTRIES 8 | ||
115 | #define EC_TEMP_SENSOR_NOT_PRESENT 0xff | ||
116 | #define EC_TEMP_SENSOR_ERROR 0xfe | ||
117 | #define EC_TEMP_SENSOR_NOT_POWERED 0xfd | ||
118 | #define EC_TEMP_SENSOR_NOT_CALIBRATED 0xfc | ||
119 | /* | ||
120 | * The offset of temperature value stored in mapped memory. This allows | ||
121 | * reporting a temperature range of 200K to 454K = -73C to 181C. | ||
122 | */ | ||
123 | #define EC_TEMP_SENSOR_OFFSET 200 | ||
124 | |||
125 | #define EC_FAN_SPEED_ENTRIES 4 /* Number of fans at EC_MEMMAP_FAN */ | ||
126 | #define EC_FAN_SPEED_NOT_PRESENT 0xffff /* Entry not present */ | ||
127 | #define EC_FAN_SPEED_STALLED 0xfffe /* Fan stalled */ | ||
128 | |||
129 | /* Battery bit flags at EC_MEMMAP_BATT_FLAG. */ | ||
130 | #define EC_BATT_FLAG_AC_PRESENT 0x01 | ||
131 | #define EC_BATT_FLAG_BATT_PRESENT 0x02 | ||
132 | #define EC_BATT_FLAG_DISCHARGING 0x04 | ||
133 | #define EC_BATT_FLAG_CHARGING 0x08 | ||
134 | #define EC_BATT_FLAG_LEVEL_CRITICAL 0x10 | ||
135 | |||
136 | /* Switch flags at EC_MEMMAP_SWITCHES */ | ||
137 | #define EC_SWITCH_LID_OPEN 0x01 | ||
138 | #define EC_SWITCH_POWER_BUTTON_PRESSED 0x02 | ||
139 | #define EC_SWITCH_WRITE_PROTECT_DISABLED 0x04 | ||
140 | /* Recovery requested via keyboard */ | ||
141 | #define EC_SWITCH_KEYBOARD_RECOVERY 0x08 | ||
142 | /* Recovery requested via dedicated signal (from servo board) */ | ||
143 | #define EC_SWITCH_DEDICATED_RECOVERY 0x10 | ||
144 | /* Was fake developer mode switch; now unused. Remove in next refactor. */ | ||
145 | #define EC_SWITCH_IGNORE0 0x20 | ||
146 | |||
147 | /* Host command interface flags */ | ||
148 | /* Host command interface supports LPC args (LPC interface only) */ | ||
149 | #define EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED 0x01 | ||
150 | |||
151 | /* Wireless switch flags */ | ||
152 | #define EC_WIRELESS_SWITCH_WLAN 0x01 | ||
153 | #define EC_WIRELESS_SWITCH_BLUETOOTH 0x02 | ||
154 | |||
155 | /* | ||
156 | * This header file is used in coreboot both in C and ACPI code. The ACPI code | ||
157 | * is pre-processed to handle constants but the ASL compiler is unable to | ||
158 | * handle actual C code so keep it separate. | ||
159 | */ | ||
160 | #ifndef __ACPI__ | ||
161 | |||
162 | /* LPC command status byte masks */ | ||
163 | /* EC has written a byte in the data register and host hasn't read it yet */ | ||
164 | #define EC_LPC_STATUS_TO_HOST 0x01 | ||
165 | /* Host has written a command/data byte and the EC hasn't read it yet */ | ||
166 | #define EC_LPC_STATUS_FROM_HOST 0x02 | ||
167 | /* EC is processing a command */ | ||
168 | #define EC_LPC_STATUS_PROCESSING 0x04 | ||
169 | /* Last write to EC was a command, not data */ | ||
170 | #define EC_LPC_STATUS_LAST_CMD 0x08 | ||
171 | /* EC is in burst mode. Unsupported by Chrome EC, so this bit is never set */ | ||
172 | #define EC_LPC_STATUS_BURST_MODE 0x10 | ||
173 | /* SCI event is pending (requesting SCI query) */ | ||
174 | #define EC_LPC_STATUS_SCI_PENDING 0x20 | ||
175 | /* SMI event is pending (requesting SMI query) */ | ||
176 | #define EC_LPC_STATUS_SMI_PENDING 0x40 | ||
177 | /* (reserved) */ | ||
178 | #define EC_LPC_STATUS_RESERVED 0x80 | ||
179 | |||
180 | /* | ||
181 | * EC is busy. This covers both the EC processing a command, and the host has | ||
182 | * written a new command but the EC hasn't picked it up yet. | ||
183 | */ | ||
184 | #define EC_LPC_STATUS_BUSY_MASK \ | ||
185 | (EC_LPC_STATUS_FROM_HOST | EC_LPC_STATUS_PROCESSING) | ||
186 | |||
187 | /* Host command response codes */ | ||
188 | enum ec_status { | ||
189 | EC_RES_SUCCESS = 0, | ||
190 | EC_RES_INVALID_COMMAND = 1, | ||
191 | EC_RES_ERROR = 2, | ||
192 | EC_RES_INVALID_PARAM = 3, | ||
193 | EC_RES_ACCESS_DENIED = 4, | ||
194 | EC_RES_INVALID_RESPONSE = 5, | ||
195 | EC_RES_INVALID_VERSION = 6, | ||
196 | EC_RES_INVALID_CHECKSUM = 7, | ||
197 | EC_RES_IN_PROGRESS = 8, /* Accepted, command in progress */ | ||
198 | EC_RES_UNAVAILABLE = 9, /* No response available */ | ||
199 | EC_RES_TIMEOUT = 10, /* We got a timeout */ | ||
200 | EC_RES_OVERFLOW = 11, /* Table / data overflow */ | ||
201 | }; | ||
202 | |||
203 | /* | ||
204 | * Host event codes. Note these are 1-based, not 0-based, because ACPI query | ||
205 | * EC command uses code 0 to mean "no event pending". We explicitly specify | ||
206 | * each value in the enum listing so they won't change if we delete/insert an | ||
207 | * item or rearrange the list (it needs to be stable across platforms, not | ||
208 | * just within a single compiled instance). | ||
209 | */ | ||
210 | enum host_event_code { | ||
211 | EC_HOST_EVENT_LID_CLOSED = 1, | ||
212 | EC_HOST_EVENT_LID_OPEN = 2, | ||
213 | EC_HOST_EVENT_POWER_BUTTON = 3, | ||
214 | EC_HOST_EVENT_AC_CONNECTED = 4, | ||
215 | EC_HOST_EVENT_AC_DISCONNECTED = 5, | ||
216 | EC_HOST_EVENT_BATTERY_LOW = 6, | ||
217 | EC_HOST_EVENT_BATTERY_CRITICAL = 7, | ||
218 | EC_HOST_EVENT_BATTERY = 8, | ||
219 | EC_HOST_EVENT_THERMAL_THRESHOLD = 9, | ||
220 | EC_HOST_EVENT_THERMAL_OVERLOAD = 10, | ||
221 | EC_HOST_EVENT_THERMAL = 11, | ||
222 | EC_HOST_EVENT_USB_CHARGER = 12, | ||
223 | EC_HOST_EVENT_KEY_PRESSED = 13, | ||
224 | /* | ||
225 | * EC has finished initializing the host interface. The host can check | ||
226 | * for this event following sending a EC_CMD_REBOOT_EC command to | ||
227 | * determine when the EC is ready to accept subsequent commands. | ||
228 | */ | ||
229 | EC_HOST_EVENT_INTERFACE_READY = 14, | ||
230 | /* Keyboard recovery combo has been pressed */ | ||
231 | EC_HOST_EVENT_KEYBOARD_RECOVERY = 15, | ||
232 | |||
233 | /* Shutdown due to thermal overload */ | ||
234 | EC_HOST_EVENT_THERMAL_SHUTDOWN = 16, | ||
235 | /* Shutdown due to battery level too low */ | ||
236 | EC_HOST_EVENT_BATTERY_SHUTDOWN = 17, | ||
237 | |||
238 | /* | ||
239 | * The high bit of the event mask is not used as a host event code. If | ||
240 | * it reads back as set, then the entire event mask should be | ||
241 | * considered invalid by the host. This can happen when reading the | ||
242 | * raw event status via EC_MEMMAP_HOST_EVENTS but the LPC interface is | ||
243 | * not initialized on the EC, or improperly configured on the host. | ||
244 | */ | ||
245 | EC_HOST_EVENT_INVALID = 32 | ||
246 | }; | ||
247 | /* Host event mask */ | ||
248 | #define EC_HOST_EVENT_MASK(event_code) (1UL << ((event_code) - 1)) | ||
249 | |||
250 | /* Arguments at EC_LPC_ADDR_HOST_ARGS */ | ||
251 | struct ec_lpc_host_args { | ||
252 | uint8_t flags; | ||
253 | uint8_t command_version; | ||
254 | uint8_t data_size; | ||
255 | /* | ||
256 | * Checksum; sum of command + flags + command_version + data_size + | ||
257 | * all params/response data bytes. | ||
258 | */ | ||
259 | uint8_t checksum; | ||
260 | } __packed; | ||
261 | |||
262 | /* Flags for ec_lpc_host_args.flags */ | ||
263 | /* | ||
264 | * Args are from host. Data area at EC_LPC_ADDR_HOST_PARAM contains command | ||
265 | * params. | ||
266 | * | ||
267 | * If EC gets a command and this flag is not set, this is an old-style command. | ||
268 | * Command version is 0 and params from host are at EC_LPC_ADDR_OLD_PARAM with | ||
269 | * unknown length. EC must respond with an old-style response (that is, | ||
270 | * withouth setting EC_HOST_ARGS_FLAG_TO_HOST). | ||
271 | */ | ||
272 | #define EC_HOST_ARGS_FLAG_FROM_HOST 0x01 | ||
273 | /* | ||
274 | * Args are from EC. Data area at EC_LPC_ADDR_HOST_PARAM contains response. | ||
275 | * | ||
276 | * If EC responds to a command and this flag is not set, this is an old-style | ||
277 | * response. Command version is 0 and response data from EC is at | ||
278 | * EC_LPC_ADDR_OLD_PARAM with unknown length. | ||
279 | */ | ||
280 | #define EC_HOST_ARGS_FLAG_TO_HOST 0x02 | ||
281 | |||
282 | /* | ||
283 | * Notes on commands: | ||
284 | * | ||
285 | * Each command is an 8-byte command value. Commands which take params or | ||
286 | * return response data specify structs for that data. If no struct is | ||
287 | * specified, the command does not input or output data, respectively. | ||
288 | * Parameter/response length is implicit in the structs. Some underlying | ||
289 | * communication protocols (I2C, SPI) may add length or checksum headers, but | ||
290 | * those are implementation-dependent and not defined here. | ||
291 | */ | ||
292 | |||
293 | /*****************************************************************************/ | ||
294 | /* General / test commands */ | ||
295 | |||
296 | /* | ||
297 | * Get protocol version, used to deal with non-backward compatible protocol | ||
298 | * changes. | ||
299 | */ | ||
300 | #define EC_CMD_PROTO_VERSION 0x00 | ||
301 | |||
302 | struct ec_response_proto_version { | ||
303 | uint32_t version; | ||
304 | } __packed; | ||
305 | |||
306 | /* | ||
307 | * Hello. This is a simple command to test the EC is responsive to | ||
308 | * commands. | ||
309 | */ | ||
310 | #define EC_CMD_HELLO 0x01 | ||
311 | |||
312 | struct ec_params_hello { | ||
313 | uint32_t in_data; /* Pass anything here */ | ||
314 | } __packed; | ||
315 | |||
316 | struct ec_response_hello { | ||
317 | uint32_t out_data; /* Output will be in_data + 0x01020304 */ | ||
318 | } __packed; | ||
319 | |||
320 | /* Get version number */ | ||
321 | #define EC_CMD_GET_VERSION 0x02 | ||
322 | |||
323 | enum ec_current_image { | ||
324 | EC_IMAGE_UNKNOWN = 0, | ||
325 | EC_IMAGE_RO, | ||
326 | EC_IMAGE_RW | ||
327 | }; | ||
328 | |||
329 | struct ec_response_get_version { | ||
330 | /* Null-terminated version strings for RO, RW */ | ||
331 | char version_string_ro[32]; | ||
332 | char version_string_rw[32]; | ||
333 | char reserved[32]; /* Was previously RW-B string */ | ||
334 | uint32_t current_image; /* One of ec_current_image */ | ||
335 | } __packed; | ||
336 | |||
337 | /* Read test */ | ||
338 | #define EC_CMD_READ_TEST 0x03 | ||
339 | |||
340 | struct ec_params_read_test { | ||
341 | uint32_t offset; /* Starting value for read buffer */ | ||
342 | uint32_t size; /* Size to read in bytes */ | ||
343 | } __packed; | ||
344 | |||
345 | struct ec_response_read_test { | ||
346 | uint32_t data[32]; | ||
347 | } __packed; | ||
348 | |||
349 | /* | ||
350 | * Get build information | ||
351 | * | ||
352 | * Response is null-terminated string. | ||
353 | */ | ||
354 | #define EC_CMD_GET_BUILD_INFO 0x04 | ||
355 | |||
356 | /* Get chip info */ | ||
357 | #define EC_CMD_GET_CHIP_INFO 0x05 | ||
358 | |||
359 | struct ec_response_get_chip_info { | ||
360 | /* Null-terminated strings */ | ||
361 | char vendor[32]; | ||
362 | char name[32]; | ||
363 | char revision[32]; /* Mask version */ | ||
364 | } __packed; | ||
365 | |||
366 | /* Get board HW version */ | ||
367 | #define EC_CMD_GET_BOARD_VERSION 0x06 | ||
368 | |||
369 | struct ec_response_board_version { | ||
370 | uint16_t board_version; /* A monotonously incrementing number. */ | ||
371 | } __packed; | ||
372 | |||
373 | /* | ||
374 | * Read memory-mapped data. | ||
375 | * | ||
376 | * This is an alternate interface to memory-mapped data for bus protocols | ||
377 | * which don't support direct-mapped memory - I2C, SPI, etc. | ||
378 | * | ||
379 | * Response is params.size bytes of data. | ||
380 | */ | ||
381 | #define EC_CMD_READ_MEMMAP 0x07 | ||
382 | |||
383 | struct ec_params_read_memmap { | ||
384 | uint8_t offset; /* Offset in memmap (EC_MEMMAP_*) */ | ||
385 | uint8_t size; /* Size to read in bytes */ | ||
386 | } __packed; | ||
387 | |||
388 | /* Read versions supported for a command */ | ||
389 | #define EC_CMD_GET_CMD_VERSIONS 0x08 | ||
390 | |||
391 | struct ec_params_get_cmd_versions { | ||
392 | uint8_t cmd; /* Command to check */ | ||
393 | } __packed; | ||
394 | |||
395 | struct ec_response_get_cmd_versions { | ||
396 | /* | ||
397 | * Mask of supported versions; use EC_VER_MASK() to compare with a | ||
398 | * desired version. | ||
399 | */ | ||
400 | uint32_t version_mask; | ||
401 | } __packed; | ||
402 | |||
403 | /* | ||
404 | * Check EC communcations status (busy). This is needed on i2c/spi but not | ||
405 | * on lpc since it has its own out-of-band busy indicator. | ||
406 | * | ||
407 | * lpc must read the status from the command register. Attempting this on | ||
408 | * lpc will overwrite the args/parameter space and corrupt its data. | ||
409 | */ | ||
410 | #define EC_CMD_GET_COMMS_STATUS 0x09 | ||
411 | |||
412 | /* Avoid using ec_status which is for return values */ | ||
413 | enum ec_comms_status { | ||
414 | EC_COMMS_STATUS_PROCESSING = 1 << 0, /* Processing cmd */ | ||
415 | }; | ||
416 | |||
417 | struct ec_response_get_comms_status { | ||
418 | uint32_t flags; /* Mask of enum ec_comms_status */ | ||
419 | } __packed; | ||
420 | |||
421 | |||
422 | /*****************************************************************************/ | ||
423 | /* Flash commands */ | ||
424 | |||
425 | /* Get flash info */ | ||
426 | #define EC_CMD_FLASH_INFO 0x10 | ||
427 | |||
428 | struct ec_response_flash_info { | ||
429 | /* Usable flash size, in bytes */ | ||
430 | uint32_t flash_size; | ||
431 | /* | ||
432 | * Write block size. Write offset and size must be a multiple | ||
433 | * of this. | ||
434 | */ | ||
435 | uint32_t write_block_size; | ||
436 | /* | ||
437 | * Erase block size. Erase offset and size must be a multiple | ||
438 | * of this. | ||
439 | */ | ||
440 | uint32_t erase_block_size; | ||
441 | /* | ||
442 | * Protection block size. Protection offset and size must be a | ||
443 | * multiple of this. | ||
444 | */ | ||
445 | uint32_t protect_block_size; | ||
446 | } __packed; | ||
447 | |||
448 | /* | ||
449 | * Read flash | ||
450 | * | ||
451 | * Response is params.size bytes of data. | ||
452 | */ | ||
453 | #define EC_CMD_FLASH_READ 0x11 | ||
454 | |||
455 | struct ec_params_flash_read { | ||
456 | uint32_t offset; /* Byte offset to read */ | ||
457 | uint32_t size; /* Size to read in bytes */ | ||
458 | } __packed; | ||
459 | |||
460 | /* Write flash */ | ||
461 | #define EC_CMD_FLASH_WRITE 0x12 | ||
462 | |||
463 | struct ec_params_flash_write { | ||
464 | uint32_t offset; /* Byte offset to write */ | ||
465 | uint32_t size; /* Size to write in bytes */ | ||
466 | /* | ||
467 | * Data to write. Could really use EC_PARAM_SIZE - 8, but tidiest to | ||
468 | * use a power of 2 so writes stay aligned. | ||
469 | */ | ||
470 | uint8_t data[64]; | ||
471 | } __packed; | ||
472 | |||
473 | /* Erase flash */ | ||
474 | #define EC_CMD_FLASH_ERASE 0x13 | ||
475 | |||
476 | struct ec_params_flash_erase { | ||
477 | uint32_t offset; /* Byte offset to erase */ | ||
478 | uint32_t size; /* Size to erase in bytes */ | ||
479 | } __packed; | ||
480 | |||
481 | /* | ||
482 | * Get/set flash protection. | ||
483 | * | ||
484 | * If mask!=0, sets/clear the requested bits of flags. Depending on the | ||
485 | * firmware write protect GPIO, not all flags will take effect immediately; | ||
486 | * some flags require a subsequent hard reset to take effect. Check the | ||
487 | * returned flags bits to see what actually happened. | ||
488 | * | ||
489 | * If mask=0, simply returns the current flags state. | ||
490 | */ | ||
491 | #define EC_CMD_FLASH_PROTECT 0x15 | ||
492 | #define EC_VER_FLASH_PROTECT 1 /* Command version 1 */ | ||
493 | |||
494 | /* Flags for flash protection */ | ||
495 | /* RO flash code protected when the EC boots */ | ||
496 | #define EC_FLASH_PROTECT_RO_AT_BOOT (1 << 0) | ||
497 | /* | ||
498 | * RO flash code protected now. If this bit is set, at-boot status cannot | ||
499 | * be changed. | ||
500 | */ | ||
501 | #define EC_FLASH_PROTECT_RO_NOW (1 << 1) | ||
502 | /* Entire flash code protected now, until reboot. */ | ||
503 | #define EC_FLASH_PROTECT_ALL_NOW (1 << 2) | ||
504 | /* Flash write protect GPIO is asserted now */ | ||
505 | #define EC_FLASH_PROTECT_GPIO_ASSERTED (1 << 3) | ||
506 | /* Error - at least one bank of flash is stuck locked, and cannot be unlocked */ | ||
507 | #define EC_FLASH_PROTECT_ERROR_STUCK (1 << 4) | ||
508 | /* | ||
509 | * Error - flash protection is in inconsistent state. At least one bank of | ||
510 | * flash which should be protected is not protected. Usually fixed by | ||
511 | * re-requesting the desired flags, or by a hard reset if that fails. | ||
512 | */ | ||
513 | #define EC_FLASH_PROTECT_ERROR_INCONSISTENT (1 << 5) | ||
514 | /* Entile flash code protected when the EC boots */ | ||
515 | #define EC_FLASH_PROTECT_ALL_AT_BOOT (1 << 6) | ||
516 | |||
517 | struct ec_params_flash_protect { | ||
518 | uint32_t mask; /* Bits in flags to apply */ | ||
519 | uint32_t flags; /* New flags to apply */ | ||
520 | } __packed; | ||
521 | |||
522 | struct ec_response_flash_protect { | ||
523 | /* Current value of flash protect flags */ | ||
524 | uint32_t flags; | ||
525 | /* | ||
526 | * Flags which are valid on this platform. This allows the caller | ||
527 | * to distinguish between flags which aren't set vs. flags which can't | ||
528 | * be set on this platform. | ||
529 | */ | ||
530 | uint32_t valid_flags; | ||
531 | /* Flags which can be changed given the current protection state */ | ||
532 | uint32_t writable_flags; | ||
533 | } __packed; | ||
534 | |||
535 | /* | ||
536 | * Note: commands 0x14 - 0x19 version 0 were old commands to get/set flash | ||
537 | * write protect. These commands may be reused with version > 0. | ||
538 | */ | ||
539 | |||
540 | /* Get the region offset/size */ | ||
541 | #define EC_CMD_FLASH_REGION_INFO 0x16 | ||
542 | #define EC_VER_FLASH_REGION_INFO 1 | ||
543 | |||
544 | enum ec_flash_region { | ||
545 | /* Region which holds read-only EC image */ | ||
546 | EC_FLASH_REGION_RO, | ||
547 | /* Region which holds rewritable EC image */ | ||
548 | EC_FLASH_REGION_RW, | ||
549 | /* | ||
550 | * Region which should be write-protected in the factory (a superset of | ||
551 | * EC_FLASH_REGION_RO) | ||
552 | */ | ||
553 | EC_FLASH_REGION_WP_RO, | ||
554 | }; | ||
555 | |||
556 | struct ec_params_flash_region_info { | ||
557 | uint32_t region; /* enum ec_flash_region */ | ||
558 | } __packed; | ||
559 | |||
560 | struct ec_response_flash_region_info { | ||
561 | uint32_t offset; | ||
562 | uint32_t size; | ||
563 | } __packed; | ||
564 | |||
565 | /* Read/write VbNvContext */ | ||
566 | #define EC_CMD_VBNV_CONTEXT 0x17 | ||
567 | #define EC_VER_VBNV_CONTEXT 1 | ||
568 | #define EC_VBNV_BLOCK_SIZE 16 | ||
569 | |||
570 | enum ec_vbnvcontext_op { | ||
571 | EC_VBNV_CONTEXT_OP_READ, | ||
572 | EC_VBNV_CONTEXT_OP_WRITE, | ||
573 | }; | ||
574 | |||
575 | struct ec_params_vbnvcontext { | ||
576 | uint32_t op; | ||
577 | uint8_t block[EC_VBNV_BLOCK_SIZE]; | ||
578 | } __packed; | ||
579 | |||
580 | struct ec_response_vbnvcontext { | ||
581 | uint8_t block[EC_VBNV_BLOCK_SIZE]; | ||
582 | } __packed; | ||
583 | |||
584 | /*****************************************************************************/ | ||
585 | /* PWM commands */ | ||
586 | |||
587 | /* Get fan target RPM */ | ||
588 | #define EC_CMD_PWM_GET_FAN_TARGET_RPM 0x20 | ||
589 | |||
590 | struct ec_response_pwm_get_fan_rpm { | ||
591 | uint32_t rpm; | ||
592 | } __packed; | ||
593 | |||
594 | /* Set target fan RPM */ | ||
595 | #define EC_CMD_PWM_SET_FAN_TARGET_RPM 0x21 | ||
596 | |||
597 | struct ec_params_pwm_set_fan_target_rpm { | ||
598 | uint32_t rpm; | ||
599 | } __packed; | ||
600 | |||
601 | /* Get keyboard backlight */ | ||
602 | #define EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT 0x22 | ||
603 | |||
604 | struct ec_response_pwm_get_keyboard_backlight { | ||
605 | uint8_t percent; | ||
606 | uint8_t enabled; | ||
607 | } __packed; | ||
608 | |||
609 | /* Set keyboard backlight */ | ||
610 | #define EC_CMD_PWM_SET_KEYBOARD_BACKLIGHT 0x23 | ||
611 | |||
612 | struct ec_params_pwm_set_keyboard_backlight { | ||
613 | uint8_t percent; | ||
614 | } __packed; | ||
615 | |||
616 | /* Set target fan PWM duty cycle */ | ||
617 | #define EC_CMD_PWM_SET_FAN_DUTY 0x24 | ||
618 | |||
619 | struct ec_params_pwm_set_fan_duty { | ||
620 | uint32_t percent; | ||
621 | } __packed; | ||
622 | |||
623 | /*****************************************************************************/ | ||
624 | /* | ||
625 | * Lightbar commands. This looks worse than it is. Since we only use one HOST | ||
626 | * command to say "talk to the lightbar", we put the "and tell it to do X" part | ||
627 | * into a subcommand. We'll make separate structs for subcommands with | ||
628 | * different input args, so that we know how much to expect. | ||
629 | */ | ||
630 | #define EC_CMD_LIGHTBAR_CMD 0x28 | ||
631 | |||
632 | struct rgb_s { | ||
633 | uint8_t r, g, b; | ||
634 | }; | ||
635 | |||
636 | #define LB_BATTERY_LEVELS 4 | ||
637 | /* List of tweakable parameters. NOTE: It's __packed so it can be sent in a | ||
638 | * host command, but the alignment is the same regardless. Keep it that way. | ||
639 | */ | ||
640 | struct lightbar_params { | ||
641 | /* Timing */ | ||
642 | int google_ramp_up; | ||
643 | int google_ramp_down; | ||
644 | int s3s0_ramp_up; | ||
645 | int s0_tick_delay[2]; /* AC=0/1 */ | ||
646 | int s0a_tick_delay[2]; /* AC=0/1 */ | ||
647 | int s0s3_ramp_down; | ||
648 | int s3_sleep_for; | ||
649 | int s3_ramp_up; | ||
650 | int s3_ramp_down; | ||
651 | |||
652 | /* Oscillation */ | ||
653 | uint8_t new_s0; | ||
654 | uint8_t osc_min[2]; /* AC=0/1 */ | ||
655 | uint8_t osc_max[2]; /* AC=0/1 */ | ||
656 | uint8_t w_ofs[2]; /* AC=0/1 */ | ||
657 | |||
658 | /* Brightness limits based on the backlight and AC. */ | ||
659 | uint8_t bright_bl_off_fixed[2]; /* AC=0/1 */ | ||
660 | uint8_t bright_bl_on_min[2]; /* AC=0/1 */ | ||
661 | uint8_t bright_bl_on_max[2]; /* AC=0/1 */ | ||
662 | |||
663 | /* Battery level thresholds */ | ||
664 | uint8_t battery_threshold[LB_BATTERY_LEVELS - 1]; | ||
665 | |||
666 | /* Map [AC][battery_level] to color index */ | ||
667 | uint8_t s0_idx[2][LB_BATTERY_LEVELS]; /* AP is running */ | ||
668 | uint8_t s3_idx[2][LB_BATTERY_LEVELS]; /* AP is sleeping */ | ||
669 | |||
670 | /* Color palette */ | ||
671 | struct rgb_s color[8]; /* 0-3 are Google colors */ | ||
672 | } __packed; | ||
673 | |||
674 | struct ec_params_lightbar { | ||
675 | uint8_t cmd; /* Command (see enum lightbar_command) */ | ||
676 | union { | ||
677 | struct { | ||
678 | /* no args */ | ||
679 | } dump, off, on, init, get_seq, get_params; | ||
680 | |||
681 | struct num { | ||
682 | uint8_t num; | ||
683 | } brightness, seq, demo; | ||
684 | |||
685 | struct reg { | ||
686 | uint8_t ctrl, reg, value; | ||
687 | } reg; | ||
688 | |||
689 | struct rgb { | ||
690 | uint8_t led, red, green, blue; | ||
691 | } rgb; | ||
692 | |||
693 | struct lightbar_params set_params; | ||
694 | }; | ||
695 | } __packed; | ||
696 | |||
697 | struct ec_response_lightbar { | ||
698 | union { | ||
699 | struct dump { | ||
700 | struct { | ||
701 | uint8_t reg; | ||
702 | uint8_t ic0; | ||
703 | uint8_t ic1; | ||
704 | } vals[23]; | ||
705 | } dump; | ||
706 | |||
707 | struct get_seq { | ||
708 | uint8_t num; | ||
709 | } get_seq; | ||
710 | |||
711 | struct lightbar_params get_params; | ||
712 | |||
713 | struct { | ||
714 | /* no return params */ | ||
715 | } off, on, init, brightness, seq, reg, rgb, demo, set_params; | ||
716 | }; | ||
717 | } __packed; | ||
718 | |||
719 | /* Lightbar commands */ | ||
720 | enum lightbar_command { | ||
721 | LIGHTBAR_CMD_DUMP = 0, | ||
722 | LIGHTBAR_CMD_OFF = 1, | ||
723 | LIGHTBAR_CMD_ON = 2, | ||
724 | LIGHTBAR_CMD_INIT = 3, | ||
725 | LIGHTBAR_CMD_BRIGHTNESS = 4, | ||
726 | LIGHTBAR_CMD_SEQ = 5, | ||
727 | LIGHTBAR_CMD_REG = 6, | ||
728 | LIGHTBAR_CMD_RGB = 7, | ||
729 | LIGHTBAR_CMD_GET_SEQ = 8, | ||
730 | LIGHTBAR_CMD_DEMO = 9, | ||
731 | LIGHTBAR_CMD_GET_PARAMS = 10, | ||
732 | LIGHTBAR_CMD_SET_PARAMS = 11, | ||
733 | LIGHTBAR_NUM_CMDS | ||
734 | }; | ||
735 | |||
736 | /*****************************************************************************/ | ||
737 | /* Verified boot commands */ | ||
738 | |||
739 | /* | ||
740 | * Note: command code 0x29 version 0 was VBOOT_CMD in Link EVT; it may be | ||
741 | * reused for other purposes with version > 0. | ||
742 | */ | ||
743 | |||
744 | /* Verified boot hash command */ | ||
745 | #define EC_CMD_VBOOT_HASH 0x2A | ||
746 | |||
747 | struct ec_params_vboot_hash { | ||
748 | uint8_t cmd; /* enum ec_vboot_hash_cmd */ | ||
749 | uint8_t hash_type; /* enum ec_vboot_hash_type */ | ||
750 | uint8_t nonce_size; /* Nonce size; may be 0 */ | ||
751 | uint8_t reserved0; /* Reserved; set 0 */ | ||
752 | uint32_t offset; /* Offset in flash to hash */ | ||
753 | uint32_t size; /* Number of bytes to hash */ | ||
754 | uint8_t nonce_data[64]; /* Nonce data; ignored if nonce_size=0 */ | ||
755 | } __packed; | ||
756 | |||
757 | struct ec_response_vboot_hash { | ||
758 | uint8_t status; /* enum ec_vboot_hash_status */ | ||
759 | uint8_t hash_type; /* enum ec_vboot_hash_type */ | ||
760 | uint8_t digest_size; /* Size of hash digest in bytes */ | ||
761 | uint8_t reserved0; /* Ignore; will be 0 */ | ||
762 | uint32_t offset; /* Offset in flash which was hashed */ | ||
763 | uint32_t size; /* Number of bytes hashed */ | ||
764 | uint8_t hash_digest[64]; /* Hash digest data */ | ||
765 | } __packed; | ||
766 | |||
767 | enum ec_vboot_hash_cmd { | ||
768 | EC_VBOOT_HASH_GET = 0, /* Get current hash status */ | ||
769 | EC_VBOOT_HASH_ABORT = 1, /* Abort calculating current hash */ | ||
770 | EC_VBOOT_HASH_START = 2, /* Start computing a new hash */ | ||
771 | EC_VBOOT_HASH_RECALC = 3, /* Synchronously compute a new hash */ | ||
772 | }; | ||
773 | |||
774 | enum ec_vboot_hash_type { | ||
775 | EC_VBOOT_HASH_TYPE_SHA256 = 0, /* SHA-256 */ | ||
776 | }; | ||
777 | |||
778 | enum ec_vboot_hash_status { | ||
779 | EC_VBOOT_HASH_STATUS_NONE = 0, /* No hash (not started, or aborted) */ | ||
780 | EC_VBOOT_HASH_STATUS_DONE = 1, /* Finished computing a hash */ | ||
781 | EC_VBOOT_HASH_STATUS_BUSY = 2, /* Busy computing a hash */ | ||
782 | }; | ||
783 | |||
784 | /* | ||
785 | * Special values for offset for EC_VBOOT_HASH_START and EC_VBOOT_HASH_RECALC. | ||
786 | * If one of these is specified, the EC will automatically update offset and | ||
787 | * size to the correct values for the specified image (RO or RW). | ||
788 | */ | ||
789 | #define EC_VBOOT_HASH_OFFSET_RO 0xfffffffe | ||
790 | #define EC_VBOOT_HASH_OFFSET_RW 0xfffffffd | ||
791 | |||
792 | /*****************************************************************************/ | ||
793 | /* USB charging control commands */ | ||
794 | |||
795 | /* Set USB port charging mode */ | ||
796 | #define EC_CMD_USB_CHARGE_SET_MODE 0x30 | ||
797 | |||
798 | struct ec_params_usb_charge_set_mode { | ||
799 | uint8_t usb_port_id; | ||
800 | uint8_t mode; | ||
801 | } __packed; | ||
802 | |||
803 | /*****************************************************************************/ | ||
804 | /* Persistent storage for host */ | ||
805 | |||
806 | /* Maximum bytes that can be read/written in a single command */ | ||
807 | #define EC_PSTORE_SIZE_MAX 64 | ||
808 | |||
809 | /* Get persistent storage info */ | ||
810 | #define EC_CMD_PSTORE_INFO 0x40 | ||
811 | |||
812 | struct ec_response_pstore_info { | ||
813 | /* Persistent storage size, in bytes */ | ||
814 | uint32_t pstore_size; | ||
815 | /* Access size; read/write offset and size must be a multiple of this */ | ||
816 | uint32_t access_size; | ||
817 | } __packed; | ||
818 | |||
819 | /* | ||
820 | * Read persistent storage | ||
821 | * | ||
822 | * Response is params.size bytes of data. | ||
823 | */ | ||
824 | #define EC_CMD_PSTORE_READ 0x41 | ||
825 | |||
826 | struct ec_params_pstore_read { | ||
827 | uint32_t offset; /* Byte offset to read */ | ||
828 | uint32_t size; /* Size to read in bytes */ | ||
829 | } __packed; | ||
830 | |||
831 | /* Write persistent storage */ | ||
832 | #define EC_CMD_PSTORE_WRITE 0x42 | ||
833 | |||
834 | struct ec_params_pstore_write { | ||
835 | uint32_t offset; /* Byte offset to write */ | ||
836 | uint32_t size; /* Size to write in bytes */ | ||
837 | uint8_t data[EC_PSTORE_SIZE_MAX]; | ||
838 | } __packed; | ||
839 | |||
840 | /*****************************************************************************/ | ||
841 | /* Real-time clock */ | ||
842 | |||
843 | /* RTC params and response structures */ | ||
844 | struct ec_params_rtc { | ||
845 | uint32_t time; | ||
846 | } __packed; | ||
847 | |||
848 | struct ec_response_rtc { | ||
849 | uint32_t time; | ||
850 | } __packed; | ||
851 | |||
852 | /* These use ec_response_rtc */ | ||
853 | #define EC_CMD_RTC_GET_VALUE 0x44 | ||
854 | #define EC_CMD_RTC_GET_ALARM 0x45 | ||
855 | |||
856 | /* These all use ec_params_rtc */ | ||
857 | #define EC_CMD_RTC_SET_VALUE 0x46 | ||
858 | #define EC_CMD_RTC_SET_ALARM 0x47 | ||
859 | |||
860 | /*****************************************************************************/ | ||
861 | /* Port80 log access */ | ||
862 | |||
863 | /* Get last port80 code from previous boot */ | ||
864 | #define EC_CMD_PORT80_LAST_BOOT 0x48 | ||
865 | |||
866 | struct ec_response_port80_last_boot { | ||
867 | uint16_t code; | ||
868 | } __packed; | ||
869 | |||
870 | /*****************************************************************************/ | ||
871 | /* Thermal engine commands */ | ||
872 | |||
873 | /* Set thershold value */ | ||
874 | #define EC_CMD_THERMAL_SET_THRESHOLD 0x50 | ||
875 | |||
876 | struct ec_params_thermal_set_threshold { | ||
877 | uint8_t sensor_type; | ||
878 | uint8_t threshold_id; | ||
879 | uint16_t value; | ||
880 | } __packed; | ||
881 | |||
882 | /* Get threshold value */ | ||
883 | #define EC_CMD_THERMAL_GET_THRESHOLD 0x51 | ||
884 | |||
885 | struct ec_params_thermal_get_threshold { | ||
886 | uint8_t sensor_type; | ||
887 | uint8_t threshold_id; | ||
888 | } __packed; | ||
889 | |||
890 | struct ec_response_thermal_get_threshold { | ||
891 | uint16_t value; | ||
892 | } __packed; | ||
893 | |||
894 | /* Toggle automatic fan control */ | ||
895 | #define EC_CMD_THERMAL_AUTO_FAN_CTRL 0x52 | ||
896 | |||
897 | /* Get TMP006 calibration data */ | ||
898 | #define EC_CMD_TMP006_GET_CALIBRATION 0x53 | ||
899 | |||
900 | struct ec_params_tmp006_get_calibration { | ||
901 | uint8_t index; | ||
902 | } __packed; | ||
903 | |||
904 | struct ec_response_tmp006_get_calibration { | ||
905 | float s0; | ||
906 | float b0; | ||
907 | float b1; | ||
908 | float b2; | ||
909 | } __packed; | ||
910 | |||
911 | /* Set TMP006 calibration data */ | ||
912 | #define EC_CMD_TMP006_SET_CALIBRATION 0x54 | ||
913 | |||
914 | struct ec_params_tmp006_set_calibration { | ||
915 | uint8_t index; | ||
916 | uint8_t reserved[3]; /* Reserved; set 0 */ | ||
917 | float s0; | ||
918 | float b0; | ||
919 | float b1; | ||
920 | float b2; | ||
921 | } __packed; | ||
922 | |||
923 | /*****************************************************************************/ | ||
924 | /* MKBP - Matrix KeyBoard Protocol */ | ||
925 | |||
926 | /* | ||
927 | * Read key state | ||
928 | * | ||
929 | * Returns raw data for keyboard cols; see ec_response_mkbp_info.cols for | ||
930 | * expected response size. | ||
931 | */ | ||
932 | #define EC_CMD_MKBP_STATE 0x60 | ||
933 | |||
934 | /* Provide information about the matrix : number of rows and columns */ | ||
935 | #define EC_CMD_MKBP_INFO 0x61 | ||
936 | |||
937 | struct ec_response_mkbp_info { | ||
938 | uint32_t rows; | ||
939 | uint32_t cols; | ||
940 | uint8_t switches; | ||
941 | } __packed; | ||
942 | |||
943 | /* Simulate key press */ | ||
944 | #define EC_CMD_MKBP_SIMULATE_KEY 0x62 | ||
945 | |||
946 | struct ec_params_mkbp_simulate_key { | ||
947 | uint8_t col; | ||
948 | uint8_t row; | ||
949 | uint8_t pressed; | ||
950 | } __packed; | ||
951 | |||
952 | /* Configure keyboard scanning */ | ||
953 | #define EC_CMD_MKBP_SET_CONFIG 0x64 | ||
954 | #define EC_CMD_MKBP_GET_CONFIG 0x65 | ||
955 | |||
956 | /* flags */ | ||
957 | enum mkbp_config_flags { | ||
958 | EC_MKBP_FLAGS_ENABLE = 1, /* Enable keyboard scanning */ | ||
959 | }; | ||
960 | |||
961 | enum mkbp_config_valid { | ||
962 | EC_MKBP_VALID_SCAN_PERIOD = 1 << 0, | ||
963 | EC_MKBP_VALID_POLL_TIMEOUT = 1 << 1, | ||
964 | EC_MKBP_VALID_MIN_POST_SCAN_DELAY = 1 << 3, | ||
965 | EC_MKBP_VALID_OUTPUT_SETTLE = 1 << 4, | ||
966 | EC_MKBP_VALID_DEBOUNCE_DOWN = 1 << 5, | ||
967 | EC_MKBP_VALID_DEBOUNCE_UP = 1 << 6, | ||
968 | EC_MKBP_VALID_FIFO_MAX_DEPTH = 1 << 7, | ||
969 | }; | ||
970 | |||
971 | /* Configuration for our key scanning algorithm */ | ||
972 | struct ec_mkbp_config { | ||
973 | uint32_t valid_mask; /* valid fields */ | ||
974 | uint8_t flags; /* some flags (enum mkbp_config_flags) */ | ||
975 | uint8_t valid_flags; /* which flags are valid */ | ||
976 | uint16_t scan_period_us; /* period between start of scans */ | ||
977 | /* revert to interrupt mode after no activity for this long */ | ||
978 | uint32_t poll_timeout_us; | ||
979 | /* | ||
980 | * minimum post-scan relax time. Once we finish a scan we check | ||
981 | * the time until we are due to start the next one. If this time is | ||
982 | * shorter this field, we use this instead. | ||
983 | */ | ||
984 | uint16_t min_post_scan_delay_us; | ||
985 | /* delay between setting up output and waiting for it to settle */ | ||
986 | uint16_t output_settle_us; | ||
987 | uint16_t debounce_down_us; /* time for debounce on key down */ | ||
988 | uint16_t debounce_up_us; /* time for debounce on key up */ | ||
989 | /* maximum depth to allow for fifo (0 = no keyscan output) */ | ||
990 | uint8_t fifo_max_depth; | ||
991 | } __packed; | ||
992 | |||
993 | struct ec_params_mkbp_set_config { | ||
994 | struct ec_mkbp_config config; | ||
995 | } __packed; | ||
996 | |||
997 | struct ec_response_mkbp_get_config { | ||
998 | struct ec_mkbp_config config; | ||
999 | } __packed; | ||
1000 | |||
1001 | /* Run the key scan emulation */ | ||
1002 | #define EC_CMD_KEYSCAN_SEQ_CTRL 0x66 | ||
1003 | |||
1004 | enum ec_keyscan_seq_cmd { | ||
1005 | EC_KEYSCAN_SEQ_STATUS = 0, /* Get status information */ | ||
1006 | EC_KEYSCAN_SEQ_CLEAR = 1, /* Clear sequence */ | ||
1007 | EC_KEYSCAN_SEQ_ADD = 2, /* Add item to sequence */ | ||
1008 | EC_KEYSCAN_SEQ_START = 3, /* Start running sequence */ | ||
1009 | EC_KEYSCAN_SEQ_COLLECT = 4, /* Collect sequence summary data */ | ||
1010 | }; | ||
1011 | |||
1012 | enum ec_collect_flags { | ||
1013 | /* | ||
1014 | * Indicates this scan was processed by the EC. Due to timing, some | ||
1015 | * scans may be skipped. | ||
1016 | */ | ||
1017 | EC_KEYSCAN_SEQ_FLAG_DONE = 1 << 0, | ||
1018 | }; | ||
1019 | |||
1020 | struct ec_collect_item { | ||
1021 | uint8_t flags; /* some flags (enum ec_collect_flags) */ | ||
1022 | }; | ||
1023 | |||
1024 | struct ec_params_keyscan_seq_ctrl { | ||
1025 | uint8_t cmd; /* Command to send (enum ec_keyscan_seq_cmd) */ | ||
1026 | union { | ||
1027 | struct { | ||
1028 | uint8_t active; /* still active */ | ||
1029 | uint8_t num_items; /* number of items */ | ||
1030 | /* Current item being presented */ | ||
1031 | uint8_t cur_item; | ||
1032 | } status; | ||
1033 | struct { | ||
1034 | /* | ||
1035 | * Absolute time for this scan, measured from the | ||
1036 | * start of the sequence. | ||
1037 | */ | ||
1038 | uint32_t time_us; | ||
1039 | uint8_t scan[0]; /* keyscan data */ | ||
1040 | } add; | ||
1041 | struct { | ||
1042 | uint8_t start_item; /* First item to return */ | ||
1043 | uint8_t num_items; /* Number of items to return */ | ||
1044 | } collect; | ||
1045 | }; | ||
1046 | } __packed; | ||
1047 | |||
1048 | struct ec_result_keyscan_seq_ctrl { | ||
1049 | union { | ||
1050 | struct { | ||
1051 | uint8_t num_items; /* Number of items */ | ||
1052 | /* Data for each item */ | ||
1053 | struct ec_collect_item item[0]; | ||
1054 | } collect; | ||
1055 | }; | ||
1056 | } __packed; | ||
1057 | |||
1058 | /*****************************************************************************/ | ||
1059 | /* Temperature sensor commands */ | ||
1060 | |||
1061 | /* Read temperature sensor info */ | ||
1062 | #define EC_CMD_TEMP_SENSOR_GET_INFO 0x70 | ||
1063 | |||
1064 | struct ec_params_temp_sensor_get_info { | ||
1065 | uint8_t id; | ||
1066 | } __packed; | ||
1067 | |||
1068 | struct ec_response_temp_sensor_get_info { | ||
1069 | char sensor_name[32]; | ||
1070 | uint8_t sensor_type; | ||
1071 | } __packed; | ||
1072 | |||
1073 | /*****************************************************************************/ | ||
1074 | |||
1075 | /* | ||
1076 | * Note: host commands 0x80 - 0x87 are reserved to avoid conflict with ACPI | ||
1077 | * commands accidentally sent to the wrong interface. See the ACPI section | ||
1078 | * below. | ||
1079 | */ | ||
1080 | |||
1081 | /*****************************************************************************/ | ||
1082 | /* Host event commands */ | ||
1083 | |||
1084 | /* | ||
1085 | * Host event mask params and response structures, shared by all of the host | ||
1086 | * event commands below. | ||
1087 | */ | ||
1088 | struct ec_params_host_event_mask { | ||
1089 | uint32_t mask; | ||
1090 | } __packed; | ||
1091 | |||
1092 | struct ec_response_host_event_mask { | ||
1093 | uint32_t mask; | ||
1094 | } __packed; | ||
1095 | |||
1096 | /* These all use ec_response_host_event_mask */ | ||
1097 | #define EC_CMD_HOST_EVENT_GET_B 0x87 | ||
1098 | #define EC_CMD_HOST_EVENT_GET_SMI_MASK 0x88 | ||
1099 | #define EC_CMD_HOST_EVENT_GET_SCI_MASK 0x89 | ||
1100 | #define EC_CMD_HOST_EVENT_GET_WAKE_MASK 0x8d | ||
1101 | |||
1102 | /* These all use ec_params_host_event_mask */ | ||
1103 | #define EC_CMD_HOST_EVENT_SET_SMI_MASK 0x8a | ||
1104 | #define EC_CMD_HOST_EVENT_SET_SCI_MASK 0x8b | ||
1105 | #define EC_CMD_HOST_EVENT_CLEAR 0x8c | ||
1106 | #define EC_CMD_HOST_EVENT_SET_WAKE_MASK 0x8e | ||
1107 | #define EC_CMD_HOST_EVENT_CLEAR_B 0x8f | ||
1108 | |||
1109 | /*****************************************************************************/ | ||
1110 | /* Switch commands */ | ||
1111 | |||
1112 | /* Enable/disable LCD backlight */ | ||
1113 | #define EC_CMD_SWITCH_ENABLE_BKLIGHT 0x90 | ||
1114 | |||
1115 | struct ec_params_switch_enable_backlight { | ||
1116 | uint8_t enabled; | ||
1117 | } __packed; | ||
1118 | |||
1119 | /* Enable/disable WLAN/Bluetooth */ | ||
1120 | #define EC_CMD_SWITCH_ENABLE_WIRELESS 0x91 | ||
1121 | |||
1122 | struct ec_params_switch_enable_wireless { | ||
1123 | uint8_t enabled; | ||
1124 | } __packed; | ||
1125 | |||
1126 | /*****************************************************************************/ | ||
1127 | /* GPIO commands. Only available on EC if write protect has been disabled. */ | ||
1128 | |||
1129 | /* Set GPIO output value */ | ||
1130 | #define EC_CMD_GPIO_SET 0x92 | ||
1131 | |||
1132 | struct ec_params_gpio_set { | ||
1133 | char name[32]; | ||
1134 | uint8_t val; | ||
1135 | } __packed; | ||
1136 | |||
1137 | /* Get GPIO value */ | ||
1138 | #define EC_CMD_GPIO_GET 0x93 | ||
1139 | |||
1140 | struct ec_params_gpio_get { | ||
1141 | char name[32]; | ||
1142 | } __packed; | ||
1143 | struct ec_response_gpio_get { | ||
1144 | uint8_t val; | ||
1145 | } __packed; | ||
1146 | |||
1147 | /*****************************************************************************/ | ||
1148 | /* I2C commands. Only available when flash write protect is unlocked. */ | ||
1149 | |||
1150 | /* Read I2C bus */ | ||
1151 | #define EC_CMD_I2C_READ 0x94 | ||
1152 | |||
1153 | struct ec_params_i2c_read { | ||
1154 | uint16_t addr; | ||
1155 | uint8_t read_size; /* Either 8 or 16. */ | ||
1156 | uint8_t port; | ||
1157 | uint8_t offset; | ||
1158 | } __packed; | ||
1159 | struct ec_response_i2c_read { | ||
1160 | uint16_t data; | ||
1161 | } __packed; | ||
1162 | |||
1163 | /* Write I2C bus */ | ||
1164 | #define EC_CMD_I2C_WRITE 0x95 | ||
1165 | |||
1166 | struct ec_params_i2c_write { | ||
1167 | uint16_t data; | ||
1168 | uint16_t addr; | ||
1169 | uint8_t write_size; /* Either 8 or 16. */ | ||
1170 | uint8_t port; | ||
1171 | uint8_t offset; | ||
1172 | } __packed; | ||
1173 | |||
1174 | /*****************************************************************************/ | ||
1175 | /* Charge state commands. Only available when flash write protect unlocked. */ | ||
1176 | |||
1177 | /* Force charge state machine to stop in idle mode */ | ||
1178 | #define EC_CMD_CHARGE_FORCE_IDLE 0x96 | ||
1179 | |||
1180 | struct ec_params_force_idle { | ||
1181 | uint8_t enabled; | ||
1182 | } __packed; | ||
1183 | |||
1184 | /*****************************************************************************/ | ||
1185 | /* Console commands. Only available when flash write protect is unlocked. */ | ||
1186 | |||
1187 | /* Snapshot console output buffer for use by EC_CMD_CONSOLE_READ. */ | ||
1188 | #define EC_CMD_CONSOLE_SNAPSHOT 0x97 | ||
1189 | |||
1190 | /* | ||
1191 | * Read next chunk of data from saved snapshot. | ||
1192 | * | ||
1193 | * Response is null-terminated string. Empty string, if there is no more | ||
1194 | * remaining output. | ||
1195 | */ | ||
1196 | #define EC_CMD_CONSOLE_READ 0x98 | ||
1197 | |||
1198 | /*****************************************************************************/ | ||
1199 | |||
1200 | /* | ||
1201 | * Cut off battery power output if the battery supports. | ||
1202 | * | ||
1203 | * For unsupported battery, just don't implement this command and lets EC | ||
1204 | * return EC_RES_INVALID_COMMAND. | ||
1205 | */ | ||
1206 | #define EC_CMD_BATTERY_CUT_OFF 0x99 | ||
1207 | |||
1208 | /*****************************************************************************/ | ||
1209 | /* Temporary debug commands. TODO: remove this crosbug.com/p/13849 */ | ||
1210 | |||
1211 | /* | ||
1212 | * Dump charge state machine context. | ||
1213 | * | ||
1214 | * Response is a binary dump of charge state machine context. | ||
1215 | */ | ||
1216 | #define EC_CMD_CHARGE_DUMP 0xa0 | ||
1217 | |||
1218 | /* | ||
1219 | * Set maximum battery charging current. | ||
1220 | */ | ||
1221 | #define EC_CMD_CHARGE_CURRENT_LIMIT 0xa1 | ||
1222 | |||
1223 | struct ec_params_current_limit { | ||
1224 | uint32_t limit; | ||
1225 | } __packed; | ||
1226 | |||
1227 | /*****************************************************************************/ | ||
1228 | /* System commands */ | ||
1229 | |||
1230 | /* | ||
1231 | * TODO: this is a confusing name, since it doesn't necessarily reboot the EC. | ||
1232 | * Rename to "set image" or something similar. | ||
1233 | */ | ||
1234 | #define EC_CMD_REBOOT_EC 0xd2 | ||
1235 | |||
1236 | /* Command */ | ||
1237 | enum ec_reboot_cmd { | ||
1238 | EC_REBOOT_CANCEL = 0, /* Cancel a pending reboot */ | ||
1239 | EC_REBOOT_JUMP_RO = 1, /* Jump to RO without rebooting */ | ||
1240 | EC_REBOOT_JUMP_RW = 2, /* Jump to RW without rebooting */ | ||
1241 | /* (command 3 was jump to RW-B) */ | ||
1242 | EC_REBOOT_COLD = 4, /* Cold-reboot */ | ||
1243 | EC_REBOOT_DISABLE_JUMP = 5, /* Disable jump until next reboot */ | ||
1244 | EC_REBOOT_HIBERNATE = 6 /* Hibernate EC */ | ||
1245 | }; | ||
1246 | |||
1247 | /* Flags for ec_params_reboot_ec.reboot_flags */ | ||
1248 | #define EC_REBOOT_FLAG_RESERVED0 (1 << 0) /* Was recovery request */ | ||
1249 | #define EC_REBOOT_FLAG_ON_AP_SHUTDOWN (1 << 1) /* Reboot after AP shutdown */ | ||
1250 | |||
1251 | struct ec_params_reboot_ec { | ||
1252 | uint8_t cmd; /* enum ec_reboot_cmd */ | ||
1253 | uint8_t flags; /* See EC_REBOOT_FLAG_* */ | ||
1254 | } __packed; | ||
1255 | |||
1256 | /* | ||
1257 | * Get information on last EC panic. | ||
1258 | * | ||
1259 | * Returns variable-length platform-dependent panic information. See panic.h | ||
1260 | * for details. | ||
1261 | */ | ||
1262 | #define EC_CMD_GET_PANIC_INFO 0xd3 | ||
1263 | |||
1264 | /*****************************************************************************/ | ||
1265 | /* | ||
1266 | * ACPI commands | ||
1267 | * | ||
1268 | * These are valid ONLY on the ACPI command/data port. | ||
1269 | */ | ||
1270 | |||
1271 | /* | ||
1272 | * ACPI Read Embedded Controller | ||
1273 | * | ||
1274 | * This reads from ACPI memory space on the EC (EC_ACPI_MEM_*). | ||
1275 | * | ||
1276 | * Use the following sequence: | ||
1277 | * | ||
1278 | * - Write EC_CMD_ACPI_READ to EC_LPC_ADDR_ACPI_CMD | ||
1279 | * - Wait for EC_LPC_CMDR_PENDING bit to clear | ||
1280 | * - Write address to EC_LPC_ADDR_ACPI_DATA | ||
1281 | * - Wait for EC_LPC_CMDR_DATA bit to set | ||
1282 | * - Read value from EC_LPC_ADDR_ACPI_DATA | ||
1283 | */ | ||
1284 | #define EC_CMD_ACPI_READ 0x80 | ||
1285 | |||
1286 | /* | ||
1287 | * ACPI Write Embedded Controller | ||
1288 | * | ||
1289 | * This reads from ACPI memory space on the EC (EC_ACPI_MEM_*). | ||
1290 | * | ||
1291 | * Use the following sequence: | ||
1292 | * | ||
1293 | * - Write EC_CMD_ACPI_WRITE to EC_LPC_ADDR_ACPI_CMD | ||
1294 | * - Wait for EC_LPC_CMDR_PENDING bit to clear | ||
1295 | * - Write address to EC_LPC_ADDR_ACPI_DATA | ||
1296 | * - Wait for EC_LPC_CMDR_PENDING bit to clear | ||
1297 | * - Write value to EC_LPC_ADDR_ACPI_DATA | ||
1298 | */ | ||
1299 | #define EC_CMD_ACPI_WRITE 0x81 | ||
1300 | |||
1301 | /* | ||
1302 | * ACPI Query Embedded Controller | ||
1303 | * | ||
1304 | * This clears the lowest-order bit in the currently pending host events, and | ||
1305 | * sets the result code to the 1-based index of the bit (event 0x00000001 = 1, | ||
1306 | * event 0x80000000 = 32), or 0 if no event was pending. | ||
1307 | */ | ||
1308 | #define EC_CMD_ACPI_QUERY_EVENT 0x84 | ||
1309 | |||
1310 | /* Valid addresses in ACPI memory space, for read/write commands */ | ||
1311 | /* Memory space version; set to EC_ACPI_MEM_VERSION_CURRENT */ | ||
1312 | #define EC_ACPI_MEM_VERSION 0x00 | ||
1313 | /* | ||
1314 | * Test location; writing value here updates test compliment byte to (0xff - | ||
1315 | * value). | ||
1316 | */ | ||
1317 | #define EC_ACPI_MEM_TEST 0x01 | ||
1318 | /* Test compliment; writes here are ignored. */ | ||
1319 | #define EC_ACPI_MEM_TEST_COMPLIMENT 0x02 | ||
1320 | /* Keyboard backlight brightness percent (0 - 100) */ | ||
1321 | #define EC_ACPI_MEM_KEYBOARD_BACKLIGHT 0x03 | ||
1322 | |||
1323 | /* Current version of ACPI memory address space */ | ||
1324 | #define EC_ACPI_MEM_VERSION_CURRENT 1 | ||
1325 | |||
1326 | |||
1327 | /*****************************************************************************/ | ||
1328 | /* | ||
1329 | * Special commands | ||
1330 | * | ||
1331 | * These do not follow the normal rules for commands. See each command for | ||
1332 | * details. | ||
1333 | */ | ||
1334 | |||
1335 | /* | ||
1336 | * Reboot NOW | ||
1337 | * | ||
1338 | * This command will work even when the EC LPC interface is busy, because the | ||
1339 | * reboot command is processed at interrupt level. Note that when the EC | ||
1340 | * reboots, the host will reboot too, so there is no response to this command. | ||
1341 | * | ||
1342 | * Use EC_CMD_REBOOT_EC to reboot the EC more politely. | ||
1343 | */ | ||
1344 | #define EC_CMD_REBOOT 0xd1 /* Think "die" */ | ||
1345 | |||
1346 | /* | ||
1347 | * Resend last response (not supported on LPC). | ||
1348 | * | ||
1349 | * Returns EC_RES_UNAVAILABLE if there is no response available - for example, | ||
1350 | * there was no previous command, or the previous command's response was too | ||
1351 | * big to save. | ||
1352 | */ | ||
1353 | #define EC_CMD_RESEND_RESPONSE 0xdb | ||
1354 | |||
1355 | /* | ||
1356 | * This header byte on a command indicate version 0. Any header byte less | ||
1357 | * than this means that we are talking to an old EC which doesn't support | ||
1358 | * versioning. In that case, we assume version 0. | ||
1359 | * | ||
1360 | * Header bytes greater than this indicate a later version. For example, | ||
1361 | * EC_CMD_VERSION0 + 1 means we are using version 1. | ||
1362 | * | ||
1363 | * The old EC interface must not use commands 0dc or higher. | ||
1364 | */ | ||
1365 | #define EC_CMD_VERSION0 0xdc | ||
1366 | |||
1367 | #endif /* !__ACPI__ */ | ||
1368 | |||
1369 | #endif /* __CROS_EC_COMMANDS_H */ | ||
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 5b18ecde69b5..1aa4f13cdfa6 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
@@ -106,6 +106,29 @@ enum max77693_muic_reg { | |||
106 | MAX77693_MUIC_REG_END, | 106 | MAX77693_MUIC_REG_END, |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* MAX77693 INTMASK1~2 Register */ | ||
110 | #define INTMASK1_ADC1K_SHIFT 3 | ||
111 | #define INTMASK1_ADCERR_SHIFT 2 | ||
112 | #define INTMASK1_ADCLOW_SHIFT 1 | ||
113 | #define INTMASK1_ADC_SHIFT 0 | ||
114 | #define INTMASK1_ADC1K_MASK (1 << INTMASK1_ADC1K_SHIFT) | ||
115 | #define INTMASK1_ADCERR_MASK (1 << INTMASK1_ADCERR_SHIFT) | ||
116 | #define INTMASK1_ADCLOW_MASK (1 << INTMASK1_ADCLOW_SHIFT) | ||
117 | #define INTMASK1_ADC_MASK (1 << INTMASK1_ADC_SHIFT) | ||
118 | |||
119 | #define INTMASK2_VIDRM_SHIFT 5 | ||
120 | #define INTMASK2_VBVOLT_SHIFT 4 | ||
121 | #define INTMASK2_DXOVP_SHIFT 3 | ||
122 | #define INTMASK2_DCDTMR_SHIFT 2 | ||
123 | #define INTMASK2_CHGDETRUN_SHIFT 1 | ||
124 | #define INTMASK2_CHGTYP_SHIFT 0 | ||
125 | #define INTMASK2_VIDRM_MASK (1 << INTMASK2_VIDRM_SHIFT) | ||
126 | #define INTMASK2_VBVOLT_MASK (1 << INTMASK2_VBVOLT_SHIFT) | ||
127 | #define INTMASK2_DXOVP_MASK (1 << INTMASK2_DXOVP_SHIFT) | ||
128 | #define INTMASK2_DCDTMR_MASK (1 << INTMASK2_DCDTMR_SHIFT) | ||
129 | #define INTMASK2_CHGDETRUN_MASK (1 << INTMASK2_CHGDETRUN_SHIFT) | ||
130 | #define INTMASK2_CHGTYP_MASK (1 << INTMASK2_CHGTYP_SHIFT) | ||
131 | |||
109 | /* MAX77693 MUIC - STATUS1~3 Register */ | 132 | /* MAX77693 MUIC - STATUS1~3 Register */ |
110 | #define STATUS1_ADC_SHIFT (0) | 133 | #define STATUS1_ADC_SHIFT (0) |
111 | #define STATUS1_ADCLOW_SHIFT (5) | 134 | #define STATUS1_ADCLOW_SHIFT (5) |
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index a4d13d7cd001..3bbda22721ea 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
@@ -221,6 +221,7 @@ struct palmas_clk_platform_data { | |||
221 | }; | 221 | }; |
222 | 222 | ||
223 | struct palmas_platform_data { | 223 | struct palmas_platform_data { |
224 | int irq_flags; | ||
224 | int gpio_base; | 225 | int gpio_base; |
225 | 226 | ||
226 | /* bit value to be loaded to the POWER_CTRL register */ | 227 | /* bit value to be loaded to the POWER_CTRL register */ |
diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h index 6aeb6b8da64d..5c9ee6ee7960 100644 --- a/include/linux/mfd/syscon.h +++ b/include/linux/mfd/syscon.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | extern struct regmap *syscon_node_to_regmap(struct device_node *np); | 18 | extern struct regmap *syscon_node_to_regmap(struct device_node *np); |
19 | extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); | 19 | extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); |
20 | extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s); | ||
20 | extern struct regmap *syscon_regmap_lookup_by_phandle( | 21 | extern struct regmap *syscon_regmap_lookup_by_phandle( |
21 | struct device_node *np, | 22 | struct device_node *np, |
22 | const char *property); | 23 | const char *property); |
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h index aaceab402ec5..6d309032dc0d 100644 --- a/include/linux/mfd/tps65912.h +++ b/include/linux/mfd/tps65912.h | |||
@@ -323,5 +323,6 @@ int tps65912_device_init(struct tps65912 *tps65912); | |||
323 | void tps65912_device_exit(struct tps65912 *tps65912); | 323 | void tps65912_device_exit(struct tps65912 *tps65912); |
324 | int tps65912_irq_init(struct tps65912 *tps65912, int irq, | 324 | int tps65912_irq_init(struct tps65912 *tps65912, int irq, |
325 | struct tps65912_platform_data *pdata); | 325 | struct tps65912_platform_data *pdata); |
326 | int tps65912_irq_exit(struct tps65912 *tps65912); | ||
326 | 327 | ||
327 | #endif /* __LINUX_MFD_TPS65912_H */ | 328 | #endif /* __LINUX_MFD_TPS65912_H */ |
diff --git a/include/linux/mfd/wm831x/auxadc.h b/include/linux/mfd/wm831x/auxadc.h index b132067e9e99..867aa23f9370 100644 --- a/include/linux/mfd/wm831x/auxadc.h +++ b/include/linux/mfd/wm831x/auxadc.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __MFD_WM831X_AUXADC_H__ | 15 | #ifndef __MFD_WM831X_AUXADC_H__ |
16 | #define __MFD_WM831X_AUXADC_H__ | 16 | #define __MFD_WM831X_AUXADC_H__ |
17 | 17 | ||
18 | struct wm831x; | ||
19 | |||
18 | /* | 20 | /* |
19 | * R16429 (0x402D) - AuxADC Data | 21 | * R16429 (0x402D) - AuxADC Data |
20 | */ | 22 | */ |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 4a3b83a77614..76c22648436f 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/irqdomain.h> | 20 | #include <linux/irqdomain.h> |
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/regmap.h> | 22 | #include <linux/regmap.h> |
23 | #include <linux/mfd/wm831x/auxadc.h> | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * Register values. | 26 | * Register values. |
@@ -355,7 +356,6 @@ enum wm831x_parent { | |||
355 | }; | 356 | }; |
356 | 357 | ||
357 | struct wm831x; | 358 | struct wm831x; |
358 | enum wm831x_auxadc; | ||
359 | 359 | ||
360 | typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x, | 360 | typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x, |
361 | enum wm831x_auxadc input); | 361 | enum wm831x_auxadc input); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 7acc9dc73c9f..e19ff30ad0a2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -87,7 +87,6 @@ extern unsigned int kobjsize(const void *objp); | |||
87 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 87 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
88 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 88 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
89 | 89 | ||
90 | #define VM_POPULATE 0x00001000 | ||
91 | #define VM_LOCKED 0x00002000 | 90 | #define VM_LOCKED 0x00002000 |
92 | #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ | 91 | #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ |
93 | 92 | ||
diff --git a/include/linux/mman.h b/include/linux/mman.h index 61c7a87e5d2b..9aa863da287f 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
@@ -79,8 +79,6 @@ calc_vm_flag_bits(unsigned long flags) | |||
79 | { | 79 | { |
80 | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | | 80 | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | |
81 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | | 81 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | |
82 | ((flags & MAP_LOCKED) ? (VM_LOCKED | VM_POPULATE) : 0) | | 82 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); |
83 | (((flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE) ? | ||
84 | VM_POPULATE : 0); | ||
85 | } | 83 | } |
86 | #endif /* _LINUX_MMAN_H */ | 84 | #endif /* _LINUX_MMAN_H */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ede274957e05..c74092eebf5c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -527,7 +527,7 @@ static inline int zone_is_oom_locked(const struct zone *zone) | |||
527 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); | 527 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); |
528 | } | 528 | } |
529 | 529 | ||
530 | static inline unsigned zone_end_pfn(const struct zone *zone) | 530 | static inline unsigned long zone_end_pfn(const struct zone *zone) |
531 | { | 531 | { |
532 | return zone->zone_start_pfn + zone->spanned_pages; | 532 | return zone->zone_start_pfn + zone->spanned_pages; |
533 | } | 533 | } |
diff --git a/include/linux/mount.h b/include/linux/mount.h index d7029f4a191a..73005f9957ea 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -47,6 +47,8 @@ struct mnt_namespace; | |||
47 | 47 | ||
48 | #define MNT_INTERNAL 0x4000 | 48 | #define MNT_INTERNAL 0x4000 |
49 | 49 | ||
50 | #define MNT_LOCK_READONLY 0x400000 | ||
51 | |||
50 | struct vfsmount { | 52 | struct vfsmount { |
51 | struct dentry *mnt_root; /* root of the mounted tree */ | 53 | struct dentry *mnt_root; /* root of the mounted tree */ |
52 | struct super_block *mnt_sb; /* pointer to superblock */ | 54 | struct super_block *mnt_sb; /* pointer to superblock */ |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7ccb3c59ed60..ef52d9c91459 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -187,6 +187,13 @@ typedef enum { | |||
187 | * This happens with the Renesas AG-AND chips, possibly others. | 187 | * This happens with the Renesas AG-AND chips, possibly others. |
188 | */ | 188 | */ |
189 | #define BBT_AUTO_REFRESH 0x00000080 | 189 | #define BBT_AUTO_REFRESH 0x00000080 |
190 | /* | ||
191 | * Chip requires ready check on read (for auto-incremented sequential read). | ||
192 | * True only for small page devices; large page devices do not support | ||
193 | * autoincrement. | ||
194 | */ | ||
195 | #define NAND_NEED_READRDY 0x00000100 | ||
196 | |||
190 | /* Chip does not allow subpage writes */ | 197 | /* Chip does not allow subpage writes */ |
191 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 198 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
192 | 199 | ||
diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h index f14943d55315..f80af8674342 100644 --- a/include/linux/mxsfb.h +++ b/include/linux/mxsfb.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */ | 24 | #define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */ |
25 | #define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ | 25 | #define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ |
26 | 26 | ||
27 | #define FB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6) | 27 | #define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6) |
28 | #define FB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */ | 28 | #define MXSFB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */ |
29 | 29 | ||
30 | struct mxsfb_platform_data { | 30 | struct mxsfb_platform_data { |
31 | struct fb_videomode *mode_list; | 31 | struct fb_videomode *mode_list; |
@@ -44,6 +44,9 @@ struct mxsfb_platform_data { | |||
44 | * allocated. If specified,fb_size must also be specified. | 44 | * allocated. If specified,fb_size must also be specified. |
45 | * fb_phys must be unused by Linux. | 45 | * fb_phys must be unused by Linux. |
46 | */ | 46 | */ |
47 | u32 sync; /* sync mask, contains MXSFB specifics not | ||
48 | * carried in fb_info->var.sync | ||
49 | */ | ||
47 | }; | 50 | }; |
48 | 51 | ||
49 | #endif /* __LINUX_MXSFB_H */ | 52 | #endif /* __LINUX_MXSFB_H */ |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index ef9acd3c8450..01d25e6fc792 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
@@ -854,6 +854,8 @@ type_pf_tresize(struct ip_set *set, bool retried) | |||
854 | retry: | 854 | retry: |
855 | ret = 0; | 855 | ret = 0; |
856 | htable_bits++; | 856 | htable_bits++; |
857 | pr_debug("attempt to resize set %s from %u to %u, t %p\n", | ||
858 | set->name, orig->htable_bits, htable_bits, orig); | ||
857 | if (!htable_bits) { | 859 | if (!htable_bits) { |
858 | /* In case we have plenty of memory :-) */ | 860 | /* In case we have plenty of memory :-) */ |
859 | pr_warning("Cannot increase the hashsize of set %s further\n", | 861 | pr_warning("Cannot increase the hashsize of set %s further\n", |
@@ -873,7 +875,7 @@ retry: | |||
873 | data = ahash_tdata(n, j); | 875 | data = ahash_tdata(n, j); |
874 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); | 876 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); |
875 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, | 877 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, |
876 | type_pf_data_timeout(data)); | 878 | ip_set_timeout_get(type_pf_data_timeout(data))); |
877 | if (ret < 0) { | 879 | if (ret < 0) { |
878 | read_unlock_bh(&set->lock); | 880 | read_unlock_bh(&set->lock); |
879 | ahash_destroy(t); | 881 | ahash_destroy(t); |
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index c25cccaa555a..4fa3b0b9b071 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
@@ -137,6 +137,34 @@ enum { | |||
137 | NVME_LBAF_RP_DEGRADED = 3, | 137 | NVME_LBAF_RP_DEGRADED = 3, |
138 | }; | 138 | }; |
139 | 139 | ||
140 | struct nvme_smart_log { | ||
141 | __u8 critical_warning; | ||
142 | __u8 temperature[2]; | ||
143 | __u8 avail_spare; | ||
144 | __u8 spare_thresh; | ||
145 | __u8 percent_used; | ||
146 | __u8 rsvd6[26]; | ||
147 | __u8 data_units_read[16]; | ||
148 | __u8 data_units_written[16]; | ||
149 | __u8 host_reads[16]; | ||
150 | __u8 host_writes[16]; | ||
151 | __u8 ctrl_busy_time[16]; | ||
152 | __u8 power_cycles[16]; | ||
153 | __u8 power_on_hours[16]; | ||
154 | __u8 unsafe_shutdowns[16]; | ||
155 | __u8 media_errors[16]; | ||
156 | __u8 num_err_log_entries[16]; | ||
157 | __u8 rsvd192[320]; | ||
158 | }; | ||
159 | |||
160 | enum { | ||
161 | NVME_SMART_CRIT_SPARE = 1 << 0, | ||
162 | NVME_SMART_CRIT_TEMPERATURE = 1 << 1, | ||
163 | NVME_SMART_CRIT_RELIABILITY = 1 << 2, | ||
164 | NVME_SMART_CRIT_MEDIA = 1 << 3, | ||
165 | NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4, | ||
166 | }; | ||
167 | |||
140 | struct nvme_lba_range_type { | 168 | struct nvme_lba_range_type { |
141 | __u8 type; | 169 | __u8 type; |
142 | __u8 attributes; | 170 | __u8 attributes; |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index e47ee462c2f2..1d795df6f4cf 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -799,6 +799,12 @@ static inline int __perf_event_disable(void *info) { return -1; } | |||
799 | static inline void perf_event_task_tick(void) { } | 799 | static inline void perf_event_task_tick(void) { } |
800 | #endif | 800 | #endif |
801 | 801 | ||
802 | #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) | ||
803 | extern void perf_restore_debug_store(void); | ||
804 | #else | ||
805 | static inline void perf_restore_debug_store(void) { } | ||
806 | #endif | ||
807 | |||
802 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) | 808 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) |
803 | 809 | ||
804 | /* | 810 | /* |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 1249a54d17e0..822171fcb1c8 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -134,6 +134,8 @@ extern int printk_delay_msec; | |||
134 | extern int dmesg_restrict; | 134 | extern int dmesg_restrict; |
135 | extern int kptr_restrict; | 135 | extern int kptr_restrict; |
136 | 136 | ||
137 | extern void wake_up_klogd(void); | ||
138 | |||
137 | void log_buf_kexec_setup(void); | 139 | void log_buf_kexec_setup(void); |
138 | void __init setup_log_buf(int early); | 140 | void __init setup_log_buf(int early); |
139 | #else | 141 | #else |
@@ -162,6 +164,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
162 | return false; | 164 | return false; |
163 | } | 165 | } |
164 | 166 | ||
167 | static inline void wake_up_klogd(void) | ||
168 | { | ||
169 | } | ||
170 | |||
165 | static inline void log_buf_kexec_setup(void) | 171 | static inline void log_buf_kexec_setup(void) |
166 | { | 172 | { |
167 | } | 173 | } |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 23070fd83872..7df93f52db08 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -199,6 +199,8 @@ enum regulator_type { | |||
199 | * output when using regulator_set_voltage_sel_regmap | 199 | * output when using regulator_set_voltage_sel_regmap |
200 | * @enable_reg: Register for control when using regmap enable/disable ops | 200 | * @enable_reg: Register for control when using regmap enable/disable ops |
201 | * @enable_mask: Mask for control when using regmap enable/disable ops | 201 | * @enable_mask: Mask for control when using regmap enable/disable ops |
202 | * @bypass_reg: Register for control when using regmap set_bypass | ||
203 | * @bypass_mask: Mask for control when using regmap set_bypass | ||
202 | * | 204 | * |
203 | * @enable_time: Time taken for initial enable of regulator (in uS). | 205 | * @enable_time: Time taken for initial enable of regulator (in uS). |
204 | */ | 206 | */ |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 5ae8456d9670..c23099413ad6 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/cgroup.h> | 16 | #include <linux/cgroup.h> |
17 | #include <linux/errno.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * The core object. the cgroup that wishes to account for some | 20 | * The core object. the cgroup that wishes to account for some |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 821c7f45d2a7..441f5bfdab8e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -500,7 +500,7 @@ struct sk_buff { | |||
500 | union { | 500 | union { |
501 | __u32 mark; | 501 | __u32 mark; |
502 | __u32 dropcount; | 502 | __u32 dropcount; |
503 | __u32 avail_size; | 503 | __u32 reserved_tailroom; |
504 | }; | 504 | }; |
505 | 505 | ||
506 | sk_buff_data_t inner_transport_header; | 506 | sk_buff_data_t inner_transport_header; |
@@ -1288,11 +1288,13 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, | |||
1288 | * do not lose pfmemalloc information as the pages would not be | 1288 | * do not lose pfmemalloc information as the pages would not be |
1289 | * allocated using __GFP_MEMALLOC. | 1289 | * allocated using __GFP_MEMALLOC. |
1290 | */ | 1290 | */ |
1291 | if (page->pfmemalloc && !page->mapping) | ||
1292 | skb->pfmemalloc = true; | ||
1293 | frag->page.p = page; | 1291 | frag->page.p = page; |
1294 | frag->page_offset = off; | 1292 | frag->page_offset = off; |
1295 | skb_frag_size_set(frag, size); | 1293 | skb_frag_size_set(frag, size); |
1294 | |||
1295 | page = compound_head(page); | ||
1296 | if (page->pfmemalloc && !page->mapping) | ||
1297 | skb->pfmemalloc = true; | ||
1296 | } | 1298 | } |
1297 | 1299 | ||
1298 | /** | 1300 | /** |
@@ -1447,7 +1449,10 @@ static inline int skb_tailroom(const struct sk_buff *skb) | |||
1447 | */ | 1449 | */ |
1448 | static inline int skb_availroom(const struct sk_buff *skb) | 1450 | static inline int skb_availroom(const struct sk_buff *skb) |
1449 | { | 1451 | { |
1450 | return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len; | 1452 | if (skb_is_nonlinear(skb)) |
1453 | return 0; | ||
1454 | |||
1455 | return skb->end - skb->tail - skb->reserved_tailroom; | ||
1451 | } | 1456 | } |
1452 | 1457 | ||
1453 | /** | 1458 | /** |
diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h index c65dee059913..13e929679550 100644 --- a/include/linux/smpboot.h +++ b/include/linux/smpboot.h | |||
@@ -24,6 +24,9 @@ struct smpboot_thread_data; | |||
24 | * parked (cpu offline) | 24 | * parked (cpu offline) |
25 | * @unpark: Optional unpark function, called when the thread is | 25 | * @unpark: Optional unpark function, called when the thread is |
26 | * unparked (cpu online) | 26 | * unparked (cpu online) |
27 | * @pre_unpark: Optional unpark function, called before the thread is | ||
28 | * unparked (cpu online). This is not guaranteed to be | ||
29 | * called on the target cpu of the thread. Careful! | ||
27 | * @selfparking: Thread is not parked by the park function. | 30 | * @selfparking: Thread is not parked by the park function. |
28 | * @thread_comm: The base name of the thread | 31 | * @thread_comm: The base name of the thread |
29 | */ | 32 | */ |
@@ -37,6 +40,7 @@ struct smp_hotplug_thread { | |||
37 | void (*cleanup)(unsigned int cpu, bool online); | 40 | void (*cleanup)(unsigned int cpu, bool online); |
38 | void (*park)(unsigned int cpu); | 41 | void (*park)(unsigned int cpu); |
39 | void (*unpark)(unsigned int cpu); | 42 | void (*unpark)(unsigned int cpu); |
43 | void (*pre_unpark)(unsigned int cpu); | ||
40 | bool selfparking; | 44 | bool selfparking; |
41 | const char *thread_comm; | 45 | const char *thread_comm; |
42 | }; | 46 | }; |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index f0bd7f90a90d..e3c0ae9bb1fa 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -44,7 +44,7 @@ | |||
44 | /* Adding event notification support elements */ | 44 | /* Adding event notification support elements */ |
45 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | 45 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" |
46 | #define THERMAL_GENL_VERSION 0x01 | 46 | #define THERMAL_GENL_VERSION 0x01 |
47 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | 47 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_grp" |
48 | 48 | ||
49 | /* Default Thermal Governor */ | 49 | /* Default Thermal Governor */ |
50 | #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) | 50 | #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 9d81de123c90..42278bbf7a88 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -68,6 +68,7 @@ struct udp_sock { | |||
68 | * For encapsulation sockets. | 68 | * For encapsulation sockets. |
69 | */ | 69 | */ |
70 | int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); | 70 | int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); |
71 | void (*encap_destroy)(struct sock *sk); | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | static inline struct udp_sock *udp_sk(const struct sock *sk) | 74 | static inline struct udp_sock *udp_sk(const struct sock *sk) |
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index 3b8f9d4fc3fe..cc25b70af33c 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h | |||
@@ -127,6 +127,7 @@ struct cdc_ncm_ctx { | |||
127 | u16 connected; | 127 | u16 connected; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | extern u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); | ||
130 | extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); | 131 | extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); |
131 | extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); | 132 | extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); |
132 | extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); | 133 | extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 3c671c1b37f6..8860594d6364 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -60,7 +60,7 @@ struct usb_configuration; | |||
60 | * @name: For diagnostics, identifies the function. | 60 | * @name: For diagnostics, identifies the function. |
61 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 61 | * @strings: tables of strings, keyed by identifiers assigned during bind() |
62 | * and by language IDs provided in control requests | 62 | * and by language IDs provided in control requests |
63 | * @descriptors: Table of full (or low) speed descriptors, using interface and | 63 | * @fs_descriptors: Table of full (or low) speed descriptors, using interface and |
64 | * string identifiers assigned during @bind(). If this pointer is null, | 64 | * string identifiers assigned during @bind(). If this pointer is null, |
65 | * the function will not be available at full speed (or at low speed). | 65 | * the function will not be available at full speed (or at low speed). |
66 | * @hs_descriptors: Table of high speed descriptors, using interface and | 66 | * @hs_descriptors: Table of high speed descriptors, using interface and |
@@ -290,6 +290,7 @@ enum { | |||
290 | * after function notifications | 290 | * after function notifications |
291 | * @resume: Notifies configuration when the host restarts USB traffic, | 291 | * @resume: Notifies configuration when the host restarts USB traffic, |
292 | * before function notifications | 292 | * before function notifications |
293 | * @gadget_driver: Gadget driver controlling this driver | ||
293 | * | 294 | * |
294 | * Devices default to reporting self powered operation. Devices which rely | 295 | * Devices default to reporting self powered operation. Devices which rely |
295 | * on bus powered operation should report this in their @bind method. | 296 | * on bus powered operation should report this in their @bind method. |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0a78df5f6cfd..59694b5e5e90 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -357,6 +357,7 @@ struct hc_driver { | |||
357 | */ | 357 | */ |
358 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, | 358 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, |
359 | struct usb_device *, enum usb3_link_state state); | 359 | struct usb_device *, enum usb3_link_state state); |
360 | int (*find_raw_port_number)(struct usb_hcd *, int); | ||
360 | }; | 361 | }; |
361 | 362 | ||
362 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 363 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
@@ -396,6 +397,7 @@ extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd); | |||
396 | extern int usb_add_hcd(struct usb_hcd *hcd, | 397 | extern int usb_add_hcd(struct usb_hcd *hcd, |
397 | unsigned int irqnum, unsigned long irqflags); | 398 | unsigned int irqnum, unsigned long irqflags); |
398 | extern void usb_remove_hcd(struct usb_hcd *hcd); | 399 | extern void usb_remove_hcd(struct usb_hcd *hcd); |
400 | extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1); | ||
399 | 401 | ||
400 | struct platform_device; | 402 | struct platform_device; |
401 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); | 403 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index ef9be7e1e190..1819b59aab2a 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -66,6 +66,7 @@ | |||
66 | * port. | 66 | * port. |
67 | * @flags: usb serial port flags | 67 | * @flags: usb serial port flags |
68 | * @write_wait: a wait_queue_head_t used by the port. | 68 | * @write_wait: a wait_queue_head_t used by the port. |
69 | * @delta_msr_wait: modem-status-change wait queue | ||
69 | * @work: work queue entry for the line discipline waking up. | 70 | * @work: work queue entry for the line discipline waking up. |
70 | * @throttled: nonzero if the read urb is inactive to throttle the device | 71 | * @throttled: nonzero if the read urb is inactive to throttle the device |
71 | * @throttle_req: nonzero if the tty wants to throttle us | 72 | * @throttle_req: nonzero if the tty wants to throttle us |
@@ -112,6 +113,7 @@ struct usb_serial_port { | |||
112 | 113 | ||
113 | unsigned long flags; | 114 | unsigned long flags; |
114 | wait_queue_head_t write_wait; | 115 | wait_queue_head_t write_wait; |
116 | wait_queue_head_t delta_msr_wait; | ||
115 | struct work_struct work; | 117 | struct work_struct work; |
116 | char throttled; | 118 | char throttled; |
117 | char throttle_req; | 119 | char throttle_req; |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 6f033a415ecb..5c295c26ad37 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h | |||
@@ -181,8 +181,16 @@ | |||
181 | 181 | ||
182 | /*-------------------------------------------------------------------------*/ | 182 | /*-------------------------------------------------------------------------*/ |
183 | 183 | ||
184 | #if IS_ENABLED(CONFIG_USB_ULPI) | ||
184 | struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, | 185 | struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, |
185 | unsigned int flags); | 186 | unsigned int flags); |
187 | #else | ||
188 | static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, | ||
189 | unsigned int flags) | ||
190 | { | ||
191 | return NULL; | ||
192 | } | ||
193 | #endif | ||
186 | 194 | ||
187 | #ifdef CONFIG_USB_ULPI_VIEWPORT | 195 | #ifdef CONFIG_USB_ULPI_VIEWPORT |
188 | /* access ops for controllers with a viewport register */ | 196 | /* access ops for controllers with a viewport register */ |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 4ce009324933..b6b215f13b45 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -26,6 +26,8 @@ struct user_namespace { | |||
26 | kuid_t owner; | 26 | kuid_t owner; |
27 | kgid_t group; | 27 | kgid_t group; |
28 | unsigned int proc_inum; | 28 | unsigned int proc_inum; |
29 | bool may_mount_sysfs; | ||
30 | bool may_mount_proc; | ||
29 | }; | 31 | }; |
30 | 32 | ||
31 | extern struct user_namespace init_user_ns; | 33 | extern struct user_namespace init_user_ns; |
@@ -82,4 +84,6 @@ static inline void put_user_ns(struct user_namespace *ns) | |||
82 | 84 | ||
83 | #endif | 85 | #endif |
84 | 86 | ||
87 | void update_mnt_policy(struct user_namespace *userns); | ||
88 | |||
85 | #endif /* _LINUX_USER_H */ | 89 | #endif /* _LINUX_USER_H */ |
diff --git a/include/net/dst.h b/include/net/dst.h index 853cda11e518..1f8fd109e225 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -413,13 +413,15 @@ static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n, | |||
413 | 413 | ||
414 | static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) | 414 | static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) |
415 | { | 415 | { |
416 | return dst->ops->neigh_lookup(dst, NULL, daddr); | 416 | struct neighbour *n = dst->ops->neigh_lookup(dst, NULL, daddr); |
417 | return IS_ERR(n) ? NULL : n; | ||
417 | } | 418 | } |
418 | 419 | ||
419 | static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, | 420 | static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, |
420 | struct sk_buff *skb) | 421 | struct sk_buff *skb) |
421 | { | 422 | { |
422 | return dst->ops->neigh_lookup(dst, skb, NULL); | 423 | struct neighbour *n = dst->ops->neigh_lookup(dst, skb, NULL); |
424 | return IS_ERR(n) ? NULL : n; | ||
423 | } | 425 | } |
424 | 426 | ||
425 | static inline void dst_link_failure(struct sk_buff *skb) | 427 | static inline void dst_link_failure(struct sk_buff *skb) |
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h index 80461c1ae9ef..bb8271d487b7 100644 --- a/include/net/flow_keys.h +++ b/include/net/flow_keys.h | |||
@@ -9,6 +9,7 @@ struct flow_keys { | |||
9 | __be32 ports; | 9 | __be32 ports; |
10 | __be16 port16[2]; | 10 | __be16 port16[2]; |
11 | }; | 11 | }; |
12 | u16 thoff; | ||
12 | u8 ip_proto; | 13 | u8 ip_proto; |
13 | }; | 14 | }; |
14 | 15 | ||
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 76c3fe5ecc2e..0a1dcc2fa2f5 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -43,6 +43,13 @@ struct inet_frag_queue { | |||
43 | 43 | ||
44 | #define INETFRAGS_HASHSZ 64 | 44 | #define INETFRAGS_HASHSZ 64 |
45 | 45 | ||
46 | /* averaged: | ||
47 | * max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ / | ||
48 | * rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or | ||
49 | * struct frag_queue)) | ||
50 | */ | ||
51 | #define INETFRAGS_MAXDEPTH 128 | ||
52 | |||
46 | struct inet_frags { | 53 | struct inet_frags { |
47 | struct hlist_head hash[INETFRAGS_HASHSZ]; | 54 | struct hlist_head hash[INETFRAGS_HASHSZ]; |
48 | /* This rwlock is a global lock (seperate per IPv4, IPv6 and | 55 | /* This rwlock is a global lock (seperate per IPv4, IPv6 and |
@@ -76,6 +83,8 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force); | |||
76 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, | 83 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
77 | struct inet_frags *f, void *key, unsigned int hash) | 84 | struct inet_frags *f, void *key, unsigned int hash) |
78 | __releases(&f->lock); | 85 | __releases(&f->lock); |
86 | void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, | ||
87 | const char *prefix); | ||
79 | 88 | ||
80 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) | 89 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) |
81 | { | 90 | { |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 9497be1ad4c0..e49db91593a9 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -152,18 +152,16 @@ struct fib_result_nl { | |||
152 | }; | 152 | }; |
153 | 153 | ||
154 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 154 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
155 | |||
156 | #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) | 155 | #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) |
157 | |||
158 | #define FIB_TABLE_HASHSZ 2 | ||
159 | |||
160 | #else /* CONFIG_IP_ROUTE_MULTIPATH */ | 156 | #else /* CONFIG_IP_ROUTE_MULTIPATH */ |
161 | |||
162 | #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) | 157 | #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) |
158 | #endif /* CONFIG_IP_ROUTE_MULTIPATH */ | ||
163 | 159 | ||
160 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
164 | #define FIB_TABLE_HASHSZ 256 | 161 | #define FIB_TABLE_HASHSZ 256 |
165 | 162 | #else | |
166 | #endif /* CONFIG_IP_ROUTE_MULTIPATH */ | 163 | #define FIB_TABLE_HASHSZ 2 |
164 | #endif | ||
167 | 165 | ||
168 | extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); | 166 | extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); |
169 | 167 | ||
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 68c69d54d392..fce8e6b66d55 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -976,6 +976,7 @@ struct netns_ipvs { | |||
976 | int sysctl_sync_retries; | 976 | int sysctl_sync_retries; |
977 | int sysctl_nat_icmp_send; | 977 | int sysctl_nat_icmp_send; |
978 | int sysctl_pmtu_disc; | 978 | int sysctl_pmtu_disc; |
979 | int sysctl_backup_only; | ||
979 | 980 | ||
980 | /* ip_vs_lblc */ | 981 | /* ip_vs_lblc */ |
981 | int sysctl_lblc_expiration; | 982 | int sysctl_lblc_expiration; |
@@ -1067,6 +1068,12 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | |||
1067 | return ipvs->sysctl_pmtu_disc; | 1068 | return ipvs->sysctl_pmtu_disc; |
1068 | } | 1069 | } |
1069 | 1070 | ||
1071 | static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | ||
1072 | { | ||
1073 | return ipvs->sync_state & IP_VS_STATE_BACKUP && | ||
1074 | ipvs->sysctl_backup_only; | ||
1075 | } | ||
1076 | |||
1070 | #else | 1077 | #else |
1071 | 1078 | ||
1072 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | 1079 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) |
@@ -1114,6 +1121,11 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | |||
1114 | return 1; | 1121 | return 1; |
1115 | } | 1122 | } |
1116 | 1123 | ||
1124 | static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | ||
1125 | { | ||
1126 | return 0; | ||
1127 | } | ||
1128 | |||
1117 | #endif | 1129 | #endif |
1118 | 1130 | ||
1119 | /* | 1131 | /* |
diff --git a/include/net/ipip.h b/include/net/ipip.h index fd19625ff99d..982141c15200 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -77,15 +77,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb, | |||
77 | { | 77 | { |
78 | struct iphdr *iph = ip_hdr(skb); | 78 | struct iphdr *iph = ip_hdr(skb); |
79 | 79 | ||
80 | if (iph->frag_off & htons(IP_DF)) | 80 | /* Use inner packet iph-id if possible. */ |
81 | iph->id = 0; | 81 | if (skb->protocol == htons(ETH_P_IP) && old_iph->id) |
82 | else { | 82 | iph->id = old_iph->id; |
83 | /* Use inner packet iph-id if possible. */ | 83 | else |
84 | if (skb->protocol == htons(ETH_P_IP) && old_iph->id) | 84 | __ip_select_ident(iph, dst, |
85 | iph->id = old_iph->id; | 85 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); |
86 | else | ||
87 | __ip_select_ident(iph, dst, | ||
88 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); | ||
89 | } | ||
90 | } | 86 | } |
91 | #endif | 87 | #endif |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 23f2e98d4b65..cf0694d4ad60 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1045,6 +1045,10 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
1045 | if (sysctl_tcp_low_latency || !tp->ucopy.task) | 1045 | if (sysctl_tcp_low_latency || !tp->ucopy.task) |
1046 | return false; | 1046 | return false; |
1047 | 1047 | ||
1048 | if (skb->len <= tcp_hdrlen(skb) && | ||
1049 | skb_queue_len(&tp->ucopy.prequeue) == 0) | ||
1050 | return false; | ||
1051 | |||
1048 | __skb_queue_tail(&tp->ucopy.prequeue, skb); | 1052 | __skb_queue_tail(&tp->ucopy.prequeue, skb); |
1049 | tp->ucopy.memory += skb->truesize; | 1053 | tp->ucopy.memory += skb->truesize; |
1050 | if (tp->ucopy.memory > sk->sk_rcvbuf) { | 1054 | if (tp->ucopy.memory > sk->sk_rcvbuf) { |
diff --git a/include/uapi/linux/acct.h b/include/uapi/linux/acct.h index 11b6ca3e0873..df2f9a0bba6a 100644 --- a/include/uapi/linux/acct.h +++ b/include/uapi/linux/acct.h | |||
@@ -107,10 +107,12 @@ struct acct_v3 | |||
107 | #define ACORE 0x08 /* ... dumped core */ | 107 | #define ACORE 0x08 /* ... dumped core */ |
108 | #define AXSIG 0x10 /* ... was killed by a signal */ | 108 | #define AXSIG 0x10 /* ... was killed by a signal */ |
109 | 109 | ||
110 | #ifdef __BIG_ENDIAN | 110 | #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) |
111 | #define ACCT_BYTEORDER 0x80 /* accounting file is big endian */ | 111 | #define ACCT_BYTEORDER 0x80 /* accounting file is big endian */ |
112 | #else | 112 | #elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) |
113 | #define ACCT_BYTEORDER 0x00 /* accounting file is little endian */ | 113 | #define ACCT_BYTEORDER 0x00 /* accounting file is little endian */ |
114 | #else | ||
115 | #error unspecified endianness | ||
114 | #endif | 116 | #endif |
115 | 117 | ||
116 | #ifndef __KERNEL__ | 118 | #ifndef __KERNEL__ |
diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h index 86fa7a71336a..bb2554f7fbd1 100644 --- a/include/uapi/linux/aio_abi.h +++ b/include/uapi/linux/aio_abi.h | |||
@@ -62,9 +62,9 @@ struct io_event { | |||
62 | __s64 res2; /* secondary result */ | 62 | __s64 res2; /* secondary result */ |
63 | }; | 63 | }; |
64 | 64 | ||
65 | #if defined(__LITTLE_ENDIAN) | 65 | #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) |
66 | #define PADDED(x,y) x, y | 66 | #define PADDED(x,y) x, y |
67 | #elif defined(__BIG_ENDIAN) | 67 | #elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) |
68 | #define PADDED(x,y) y, x | 68 | #define PADDED(x,y) y, x |
69 | #else | 69 | #else |
70 | #error edit for your odd byteorder. | 70 | #error edit for your odd byteorder. |
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index 93f5fa94a431..afafd703ad92 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h | |||
@@ -33,9 +33,11 @@ enum { | |||
33 | PACKET_DIAG_TX_RING, | 33 | PACKET_DIAG_TX_RING, |
34 | PACKET_DIAG_FANOUT, | 34 | PACKET_DIAG_FANOUT, |
35 | 35 | ||
36 | PACKET_DIAG_MAX, | 36 | __PACKET_DIAG_MAX, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1) | ||
40 | |||
39 | struct packet_diag_info { | 41 | struct packet_diag_info { |
40 | __u32 pdi_index; | 42 | __u32 pdi_index; |
41 | __u32 pdi_version; | 43 | __u32 pdi_version; |
diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index ee753536ab70..fe1a5406d4d9 100644 --- a/include/uapi/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h | |||
@@ -145,16 +145,18 @@ typedef struct mdp_superblock_s { | |||
145 | __u32 failed_disks; /* 4 Number of failed disks */ | 145 | __u32 failed_disks; /* 4 Number of failed disks */ |
146 | __u32 spare_disks; /* 5 Number of spare disks */ | 146 | __u32 spare_disks; /* 5 Number of spare disks */ |
147 | __u32 sb_csum; /* 6 checksum of the whole superblock */ | 147 | __u32 sb_csum; /* 6 checksum of the whole superblock */ |
148 | #ifdef __BIG_ENDIAN | 148 | #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) |
149 | __u32 events_hi; /* 7 high-order of superblock update count */ | 149 | __u32 events_hi; /* 7 high-order of superblock update count */ |
150 | __u32 events_lo; /* 8 low-order of superblock update count */ | 150 | __u32 events_lo; /* 8 low-order of superblock update count */ |
151 | __u32 cp_events_hi; /* 9 high-order of checkpoint update count */ | 151 | __u32 cp_events_hi; /* 9 high-order of checkpoint update count */ |
152 | __u32 cp_events_lo; /* 10 low-order of checkpoint update count */ | 152 | __u32 cp_events_lo; /* 10 low-order of checkpoint update count */ |
153 | #else | 153 | #elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) |
154 | __u32 events_lo; /* 7 low-order of superblock update count */ | 154 | __u32 events_lo; /* 7 low-order of superblock update count */ |
155 | __u32 events_hi; /* 8 high-order of superblock update count */ | 155 | __u32 events_hi; /* 8 high-order of superblock update count */ |
156 | __u32 cp_events_lo; /* 9 low-order of checkpoint update count */ | 156 | __u32 cp_events_lo; /* 9 low-order of checkpoint update count */ |
157 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ | 157 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ |
158 | #else | ||
159 | #error unspecified endianness | ||
158 | #endif | 160 | #endif |
159 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ | 161 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ |
160 | /* There are only valid for minor_version > 90 */ | 162 | /* There are only valid for minor_version > 90 */ |
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index b6a23a483d74..74c2bf7211f8 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
@@ -51,7 +51,10 @@ | |||
51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ | 52 | #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ |
53 | #define PORT_BRCM_TRUMANAGE 25 | 53 | #define PORT_BRCM_TRUMANAGE 25 |
54 | #define PORT_MAX_8250 25 /* max port ID */ | 54 | #define PORT_ALTR_16550_F32 26 /* Altera 16550 UART with 32 FIFOs */ |
55 | #define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */ | ||
56 | #define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */ | ||
57 | #define PORT_MAX_8250 28 /* max port ID */ | ||
55 | 58 | ||
56 | /* | 59 | /* |
57 | * ARM specific type numbers. These are not currently guaranteed | 60 | * ARM specific type numbers. These are not currently guaranteed |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b8a24941db21..b9e2a6a7446f 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
@@ -39,9 +39,11 @@ enum { | |||
39 | UNIX_DIAG_MEMINFO, | 39 | UNIX_DIAG_MEMINFO, |
40 | UNIX_DIAG_SHUTDOWN, | 40 | UNIX_DIAG_SHUTDOWN, |
41 | 41 | ||
42 | UNIX_DIAG_MAX, | 42 | __UNIX_DIAG_MAX, |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1) | ||
46 | |||
45 | struct unix_diag_vfs { | 47 | struct unix_diag_vfs { |
46 | __u32 udiag_vfs_ino; | 48 | __u32 udiag_vfs_ino; |
47 | __u32 udiag_vfs_dev; | 49 | __u32 udiag_vfs_dev; |
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index 28447f1594fa..8deb22672ada 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h | |||
@@ -30,7 +30,6 @@ | |||
30 | */ | 30 | */ |
31 | #define ATMEL_LCDC_WIRING_BGR 0 | 31 | #define ATMEL_LCDC_WIRING_BGR 0 |
32 | #define ATMEL_LCDC_WIRING_RGB 1 | 32 | #define ATMEL_LCDC_WIRING_RGB 1 |
33 | #define ATMEL_LCDC_WIRING_RGB555 2 | ||
34 | 33 | ||
35 | 34 | ||
36 | /* LCD Controller info data structure, stored in device platform_data */ | 35 | /* LCD Controller info data structure, stored in device platform_data */ |
@@ -62,6 +61,7 @@ struct atmel_lcdfb_info { | |||
62 | void (*atmel_lcdfb_power_control)(int on); | 61 | void (*atmel_lcdfb_power_control)(int on); |
63 | struct fb_monspecs *default_monspecs; | 62 | struct fb_monspecs *default_monspecs; |
64 | u32 pseudo_palette[16]; | 63 | u32 pseudo_palette[16]; |
64 | bool have_intensity_bit; | ||
65 | }; | 65 | }; |
66 | 66 | ||
67 | #define ATMEL_LCDC_DMABADDR1 0x00 | 67 | #define ATMEL_LCDC_DMABADDR1 0x00 |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 01c3d62436ef..ffd4652de91c 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -138,11 +138,21 @@ struct blkif_request_discard { | |||
138 | uint8_t _pad3; | 138 | uint8_t _pad3; |
139 | } __attribute__((__packed__)); | 139 | } __attribute__((__packed__)); |
140 | 140 | ||
141 | struct blkif_request_other { | ||
142 | uint8_t _pad1; | ||
143 | blkif_vdev_t _pad2; /* only for read/write requests */ | ||
144 | #ifdef CONFIG_X86_64 | ||
145 | uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/ | ||
146 | #endif | ||
147 | uint64_t id; /* private guest value, echoed in resp */ | ||
148 | } __attribute__((__packed__)); | ||
149 | |||
141 | struct blkif_request { | 150 | struct blkif_request { |
142 | uint8_t operation; /* BLKIF_OP_??? */ | 151 | uint8_t operation; /* BLKIF_OP_??? */ |
143 | union { | 152 | union { |
144 | struct blkif_request_rw rw; | 153 | struct blkif_request_rw rw; |
145 | struct blkif_request_discard discard; | 154 | struct blkif_request_discard discard; |
155 | struct blkif_request_other other; | ||
146 | } u; | 156 | } u; |
147 | } __attribute__((__packed__)); | 157 | } __attribute__((__packed__)); |
148 | 158 | ||
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 1844d31f4552..7000bb1f6e96 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
@@ -251,6 +251,12 @@ struct physdev_pci_device_add { | |||
251 | 251 | ||
252 | #define PHYSDEVOP_pci_device_remove 26 | 252 | #define PHYSDEVOP_pci_device_remove 26 |
253 | #define PHYSDEVOP_restore_msi_ext 27 | 253 | #define PHYSDEVOP_restore_msi_ext 27 |
254 | /* | ||
255 | * Dom0 should use these two to announce MMIO resources assigned to | ||
256 | * MSI-X capable devices won't (prepare) or may (release) change. | ||
257 | */ | ||
258 | #define PHYSDEVOP_prepare_msix 30 | ||
259 | #define PHYSDEVOP_release_msix 31 | ||
254 | struct physdev_pci_device { | 260 | struct physdev_pci_device { |
255 | /* IN */ | 261 | /* IN */ |
256 | uint16_t seg; | 262 | uint16_t seg; |