diff options
Diffstat (limited to 'include')
189 files changed, 4010 insertions, 981 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index c602c7718421..ddabed1f51c2 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -169,7 +169,8 @@ struct acpi_device_flags { | |||
169 | u32 ejectable:1; | 169 | u32 ejectable:1; |
170 | u32 power_manageable:1; | 170 | u32 power_manageable:1; |
171 | u32 match_driver:1; | 171 | u32 match_driver:1; |
172 | u32 reserved:27; | 172 | u32 no_hotplug:1; |
173 | u32 reserved:26; | ||
173 | }; | 174 | }; |
174 | 175 | ||
175 | /* File System */ | 176 | /* File System */ |
@@ -344,6 +345,7 @@ extern struct kobject *acpi_kobj; | |||
344 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); | 345 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); |
345 | void acpi_bus_private_data_handler(acpi_handle, void *); | 346 | void acpi_bus_private_data_handler(acpi_handle, void *); |
346 | int acpi_bus_get_private_data(acpi_handle, void **); | 347 | int acpi_bus_get_private_data(acpi_handle, void **); |
348 | void acpi_bus_no_hotplug(acpi_handle handle); | ||
347 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); | 349 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); |
348 | extern int register_acpi_notifier(struct notifier_block *); | 350 | extern int register_acpi_notifier(struct notifier_block *); |
349 | extern int unregister_acpi_notifier(struct notifier_block *); | 351 | extern int unregister_acpi_notifier(struct notifier_block *); |
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h index 639d7a4d033b..6f692f8ac664 100644 --- a/include/asm-generic/barrier.h +++ b/include/asm-generic/barrier.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* Generic barrier definitions, based on MN10300 definitions. | 1 | /* |
2 | * Generic barrier definitions, originally based on MN10300 definitions. | ||
2 | * | 3 | * |
3 | * It should be possible to use these on really simple architectures, | 4 | * It should be possible to use these on really simple architectures, |
4 | * but it serves more as a starting point for new ports. | 5 | * but it serves more as a starting point for new ports. |
@@ -16,35 +17,65 @@ | |||
16 | 17 | ||
17 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
18 | 19 | ||
19 | #define nop() asm volatile ("nop") | 20 | #include <linux/compiler.h> |
21 | |||
22 | #ifndef nop | ||
23 | #define nop() asm volatile ("nop") | ||
24 | #endif | ||
20 | 25 | ||
21 | /* | 26 | /* |
22 | * Force strict CPU ordering. | 27 | * Force strict CPU ordering. And yes, this is required on UP too when we're |
23 | * And yes, this is required on UP too when we're talking | 28 | * talking to devices. |
24 | * to devices. | ||
25 | * | 29 | * |
26 | * This implementation only contains a compiler barrier. | 30 | * Fall back to compiler barriers if nothing better is provided. |
27 | */ | 31 | */ |
28 | 32 | ||
29 | #define mb() asm volatile ("": : :"memory") | 33 | #ifndef mb |
34 | #define mb() barrier() | ||
35 | #endif | ||
36 | |||
37 | #ifndef rmb | ||
30 | #define rmb() mb() | 38 | #define rmb() mb() |
31 | #define wmb() asm volatile ("": : :"memory") | 39 | #endif |
40 | |||
41 | #ifndef wmb | ||
42 | #define wmb() mb() | ||
43 | #endif | ||
44 | |||
45 | #ifndef read_barrier_depends | ||
46 | #define read_barrier_depends() do { } while (0) | ||
47 | #endif | ||
32 | 48 | ||
33 | #ifdef CONFIG_SMP | 49 | #ifdef CONFIG_SMP |
34 | #define smp_mb() mb() | 50 | #define smp_mb() mb() |
35 | #define smp_rmb() rmb() | 51 | #define smp_rmb() rmb() |
36 | #define smp_wmb() wmb() | 52 | #define smp_wmb() wmb() |
53 | #define smp_read_barrier_depends() read_barrier_depends() | ||
37 | #else | 54 | #else |
38 | #define smp_mb() barrier() | 55 | #define smp_mb() barrier() |
39 | #define smp_rmb() barrier() | 56 | #define smp_rmb() barrier() |
40 | #define smp_wmb() barrier() | 57 | #define smp_wmb() barrier() |
58 | #define smp_read_barrier_depends() do { } while (0) | ||
59 | #endif | ||
60 | |||
61 | #ifndef set_mb | ||
62 | #define set_mb(var, value) do { (var) = (value); mb(); } while (0) | ||
41 | #endif | 63 | #endif |
42 | 64 | ||
43 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 65 | #define smp_store_release(p, v) \ |
44 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | 66 | do { \ |
67 | compiletime_assert_atomic_type(*p); \ | ||
68 | smp_mb(); \ | ||
69 | ACCESS_ONCE(*p) = (v); \ | ||
70 | } while (0) | ||
45 | 71 | ||
46 | #define read_barrier_depends() do {} while (0) | 72 | #define smp_load_acquire(p) \ |
47 | #define smp_read_barrier_depends() do {} while (0) | 73 | ({ \ |
74 | typeof(*p) ___p1 = ACCESS_ONCE(*p); \ | ||
75 | compiletime_assert_atomic_type(*p); \ | ||
76 | smp_mb(); \ | ||
77 | ___p1; \ | ||
78 | }) | ||
48 | 79 | ||
49 | #endif /* !__ASSEMBLY__ */ | 80 | #endif /* !__ASSEMBLY__ */ |
50 | #endif /* __ASM_GENERIC_BARRIER_H */ | 81 | #endif /* __ASM_GENERIC_BARRIER_H */ |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f330d28e4d0e..db0923458940 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -217,7 +217,7 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
217 | #endif | 217 | #endif |
218 | 218 | ||
219 | #ifndef pte_accessible | 219 | #ifndef pte_accessible |
220 | # define pte_accessible(pte) ((void)(pte),1) | 220 | # define pte_accessible(mm, pte) ((void)(pte), 1) |
221 | #endif | 221 | #endif |
222 | 222 | ||
223 | #ifndef flush_tlb_fix_spurious_fault | 223 | #ifndef flush_tlb_fix_spurious_fault |
@@ -599,11 +599,10 @@ static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd) | |||
599 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 599 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
600 | barrier(); | 600 | barrier(); |
601 | #endif | 601 | #endif |
602 | if (pmd_none(pmdval)) | 602 | if (pmd_none(pmdval) || pmd_trans_huge(pmdval)) |
603 | return 1; | 603 | return 1; |
604 | if (unlikely(pmd_bad(pmdval))) { | 604 | if (unlikely(pmd_bad(pmdval))) { |
605 | if (!pmd_trans_huge(pmdval)) | 605 | pmd_clear_bad(pmd); |
606 | pmd_clear_bad(pmd); | ||
607 | return 1; | 606 | return 1; |
608 | } | 607 | } |
609 | return 0; | 608 | return 0; |
diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h index ddf2b420ac8f..1cd3f5d767a8 100644 --- a/include/asm-generic/preempt.h +++ b/include/asm-generic/preempt.h | |||
@@ -3,13 +3,11 @@ | |||
3 | 3 | ||
4 | #include <linux/thread_info.h> | 4 | #include <linux/thread_info.h> |
5 | 5 | ||
6 | /* | 6 | #define PREEMPT_ENABLED (0) |
7 | * We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users | 7 | |
8 | * that think a non-zero value indicates we cannot preempt. | ||
9 | */ | ||
10 | static __always_inline int preempt_count(void) | 8 | static __always_inline int preempt_count(void) |
11 | { | 9 | { |
12 | return current_thread_info()->preempt_count & ~PREEMPT_NEED_RESCHED; | 10 | return current_thread_info()->preempt_count; |
13 | } | 11 | } |
14 | 12 | ||
15 | static __always_inline int *preempt_count_ptr(void) | 13 | static __always_inline int *preempt_count_ptr(void) |
@@ -17,11 +15,6 @@ static __always_inline int *preempt_count_ptr(void) | |||
17 | return ¤t_thread_info()->preempt_count; | 15 | return ¤t_thread_info()->preempt_count; |
18 | } | 16 | } |
19 | 17 | ||
20 | /* | ||
21 | * We now loose PREEMPT_NEED_RESCHED and cause an extra reschedule; however the | ||
22 | * alternative is loosing a reschedule. Better schedule too often -- also this | ||
23 | * should be a very rare operation. | ||
24 | */ | ||
25 | static __always_inline void preempt_count_set(int pc) | 18 | static __always_inline void preempt_count_set(int pc) |
26 | { | 19 | { |
27 | *preempt_count_ptr() = pc; | 20 | *preempt_count_ptr() = pc; |
@@ -41,28 +34,17 @@ static __always_inline void preempt_count_set(int pc) | |||
41 | task_thread_info(p)->preempt_count = PREEMPT_ENABLED; \ | 34 | task_thread_info(p)->preempt_count = PREEMPT_ENABLED; \ |
42 | } while (0) | 35 | } while (0) |
43 | 36 | ||
44 | /* | ||
45 | * We fold the NEED_RESCHED bit into the preempt count such that | ||
46 | * preempt_enable() can decrement and test for needing to reschedule with a | ||
47 | * single instruction. | ||
48 | * | ||
49 | * We invert the actual bit, so that when the decrement hits 0 we know we both | ||
50 | * need to resched (the bit is cleared) and can resched (no preempt count). | ||
51 | */ | ||
52 | |||
53 | static __always_inline void set_preempt_need_resched(void) | 37 | static __always_inline void set_preempt_need_resched(void) |
54 | { | 38 | { |
55 | *preempt_count_ptr() &= ~PREEMPT_NEED_RESCHED; | ||
56 | } | 39 | } |
57 | 40 | ||
58 | static __always_inline void clear_preempt_need_resched(void) | 41 | static __always_inline void clear_preempt_need_resched(void) |
59 | { | 42 | { |
60 | *preempt_count_ptr() |= PREEMPT_NEED_RESCHED; | ||
61 | } | 43 | } |
62 | 44 | ||
63 | static __always_inline bool test_preempt_need_resched(void) | 45 | static __always_inline bool test_preempt_need_resched(void) |
64 | { | 46 | { |
65 | return !(*preempt_count_ptr() & PREEMPT_NEED_RESCHED); | 47 | return false; |
66 | } | 48 | } |
67 | 49 | ||
68 | /* | 50 | /* |
@@ -81,7 +63,12 @@ static __always_inline void __preempt_count_sub(int val) | |||
81 | 63 | ||
82 | static __always_inline bool __preempt_count_dec_and_test(void) | 64 | static __always_inline bool __preempt_count_dec_and_test(void) |
83 | { | 65 | { |
84 | return !--*preempt_count_ptr(); | 66 | /* |
67 | * Because of load-store architectures cannot do per-cpu atomic | ||
68 | * operations; we cannot use PREEMPT_NEED_RESCHED because it might get | ||
69 | * lost. | ||
70 | */ | ||
71 | return !--*preempt_count_ptr() && tif_need_resched(); | ||
85 | } | 72 | } |
86 | 73 | ||
87 | /* | 74 | /* |
@@ -89,7 +76,7 @@ static __always_inline bool __preempt_count_dec_and_test(void) | |||
89 | */ | 76 | */ |
90 | static __always_inline bool should_resched(void) | 77 | static __always_inline bool should_resched(void) |
91 | { | 78 | { |
92 | return unlikely(!*preempt_count_ptr()); | 79 | return unlikely(!preempt_count() && tif_need_resched()); |
93 | } | 80 | } |
94 | 81 | ||
95 | #ifdef CONFIG_PREEMPT | 82 | #ifdef CONFIG_PREEMPT |
diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h index 3f21f1b72e45..d3909effd725 100644 --- a/include/asm-generic/word-at-a-time.h +++ b/include/asm-generic/word-at-a-time.h | |||
@@ -49,4 +49,12 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct | |||
49 | return (val + c->high_bits) & ~rhs; | 49 | return (val + c->high_bits) & ~rhs; |
50 | } | 50 | } |
51 | 51 | ||
52 | #ifndef zero_bytemask | ||
53 | #ifdef CONFIG_64BIT | ||
54 | #define zero_bytemask(mask) (~0ul << fls64(mask)) | ||
55 | #else | ||
56 | #define zero_bytemask(mask) (~0ul << fls(mask)) | ||
57 | #endif /* CONFIG_64BIT */ | ||
58 | #endif /* zero_bytemask */ | ||
59 | |||
52 | #endif /* _ASM_WORD_AT_A_TIME_H */ | 60 | #endif /* _ASM_WORD_AT_A_TIME_H */ |
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 13621cc8cf4c..6a626a507b8c 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -36,6 +36,7 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | |||
36 | { | 36 | { |
37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); | 37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); |
38 | sg1[num - 1].page_link &= ~0x02; | 38 | sg1[num - 1].page_link &= ~0x02; |
39 | sg1[num - 1].page_link |= 0x01; | ||
39 | } | 40 | } |
40 | 41 | ||
41 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | 42 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
@@ -43,7 +44,7 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | |||
43 | if (sg_is_last(sg)) | 44 | if (sg_is_last(sg)) |
44 | return NULL; | 45 | return NULL; |
45 | 46 | ||
46 | return (++sg)->length ? sg : (void *)sg_page(sg); | 47 | return (++sg)->length ? sg : sg_chain_ptr(sg); |
47 | } | 48 | } |
48 | 49 | ||
49 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, | 50 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 87578c109e48..49376aec2fbb 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -600,7 +600,7 @@ | |||
600 | {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 600 | {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
601 | {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | 601 | {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ |
602 | {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | 602 | {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ |
603 | {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | 603 | {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ |
604 | {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 604 | {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
605 | {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 605 | {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
606 | {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 606 | {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h deleted file mode 100644 index d875bc3dba3c..000000000000 --- a/include/linux/acpi_gpio.h +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | #ifndef _LINUX_ACPI_GPIO_H_ | ||
2 | #define _LINUX_ACPI_GPIO_H_ | ||
3 | |||
4 | #include <linux/device.h> | ||
5 | #include <linux/err.h> | ||
6 | #include <linux/errno.h> | ||
7 | #include <linux/gpio.h> | ||
8 | #include <linux/gpio/consumer.h> | ||
9 | |||
10 | /** | ||
11 | * struct acpi_gpio_info - ACPI GPIO specific information | ||
12 | * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo | ||
13 | * @active_low: in case of @gpioint, the pin is active low | ||
14 | */ | ||
15 | struct acpi_gpio_info { | ||
16 | bool gpioint; | ||
17 | bool active_low; | ||
18 | }; | ||
19 | |||
20 | #ifdef CONFIG_GPIO_ACPI | ||
21 | |||
22 | struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, | ||
23 | struct acpi_gpio_info *info); | ||
24 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | ||
25 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); | ||
26 | |||
27 | #else /* CONFIG_GPIO_ACPI */ | ||
28 | |||
29 | static inline struct gpio_desc * | ||
30 | acpi_get_gpiod_by_index(struct device *dev, int index, | ||
31 | struct acpi_gpio_info *info) | ||
32 | { | ||
33 | return ERR_PTR(-ENOSYS); | ||
34 | } | ||
35 | |||
36 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | ||
37 | static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } | ||
38 | |||
39 | #endif /* CONFIG_GPIO_ACPI */ | ||
40 | |||
41 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, | ||
42 | struct acpi_gpio_info *info) | ||
43 | { | ||
44 | struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); | ||
45 | |||
46 | if (IS_ERR(desc)) | ||
47 | return PTR_ERR(desc); | ||
48 | return desc_to_gpio(desc); | ||
49 | } | ||
50 | |||
51 | #endif /* _LINUX_ACPI_GPIO_H_ */ | ||
diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h index 9a193b84238a..a89df3be1686 100644 --- a/include/linux/assoc_array.h +++ b/include/linux/assoc_array.h | |||
@@ -41,10 +41,10 @@ struct assoc_array_ops { | |||
41 | /* Is this the object we're looking for? */ | 41 | /* Is this the object we're looking for? */ |
42 | bool (*compare_object)(const void *object, const void *index_key); | 42 | bool (*compare_object)(const void *object, const void *index_key); |
43 | 43 | ||
44 | /* How different are two objects, to a bit position in their keys? (or | 44 | /* How different is an object from an index key, to a bit position in |
45 | * -1 if they're the same) | 45 | * their keys? (or -1 if they're the same) |
46 | */ | 46 | */ |
47 | int (*diff_objects)(const void *a, const void *b); | 47 | int (*diff_objects)(const void *object, const void *index_key); |
48 | 48 | ||
49 | /* Method to free an object. */ | 49 | /* Method to free an object. */ |
50 | void (*free_object)(void *object); | 50 | void (*free_object)(void *object); |
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index 669fef5c745a..3e0fbe441763 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
@@ -3,6 +3,6 @@ | |||
3 | 3 | ||
4 | #include <uapi/linux/auxvec.h> | 4 | #include <uapi/linux/auxvec.h> |
5 | 5 | ||
6 | #define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ | 6 | #define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */ |
7 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ | 7 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ |
8 | #endif /* _LINUX_AUXVEC_H */ | 8 | #endif /* _LINUX_AUXVEC_H */ |
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h index 27b1bcffe408..86c12c93e3cf 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h | |||
@@ -1,9 +1,35 @@ | |||
1 | #ifndef _LINUX_BH_H | 1 | #ifndef _LINUX_BH_H |
2 | #define _LINUX_BH_H | 2 | #define _LINUX_BH_H |
3 | 3 | ||
4 | extern void local_bh_disable(void); | 4 | #include <linux/preempt.h> |
5 | #include <linux/preempt_mask.h> | ||
6 | |||
7 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
8 | extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); | ||
9 | #else | ||
10 | static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) | ||
11 | { | ||
12 | preempt_count_add(cnt); | ||
13 | barrier(); | ||
14 | } | ||
15 | #endif | ||
16 | |||
17 | static inline void local_bh_disable(void) | ||
18 | { | ||
19 | __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
20 | } | ||
21 | |||
5 | extern void _local_bh_enable(void); | 22 | extern void _local_bh_enable(void); |
6 | extern void local_bh_enable(void); | 23 | extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt); |
7 | extern void local_bh_enable_ip(unsigned long ip); | 24 | |
25 | static inline void local_bh_enable_ip(unsigned long ip) | ||
26 | { | ||
27 | __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET); | ||
28 | } | ||
29 | |||
30 | static inline void local_bh_enable(void) | ||
31 | { | ||
32 | __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
33 | } | ||
8 | 34 | ||
9 | #endif /* _LINUX_BH_H */ | 35 | #endif /* _LINUX_BH_H */ |
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 973ce10c40b6..dc1bd3dcf11f 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
@@ -28,8 +28,6 @@ | |||
28 | 28 | ||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #define uninitialized_var(x) x | ||
32 | |||
33 | #ifndef __HAVE_BUILTIN_BSWAP16__ | 31 | #ifndef __HAVE_BUILTIN_BSWAP16__ |
34 | /* icc has this, but it's called _bswap16 */ | 32 | /* icc has this, but it's called _bswap16 */ |
35 | #define __HAVE_BUILTIN_BSWAP16__ | 33 | #define __HAVE_BUILTIN_BSWAP16__ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 92669cd182a6..fe7a686dfd8d 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -298,6 +298,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
298 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 298 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
299 | #endif | 299 | #endif |
300 | 300 | ||
301 | /* Is this type a native word size -- useful for atomic operations */ | ||
302 | #ifndef __native_word | ||
303 | # define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | ||
304 | #endif | ||
305 | |||
301 | /* Compile time object size, -1 for unknown */ | 306 | /* Compile time object size, -1 for unknown */ |
302 | #ifndef __compiletime_object_size | 307 | #ifndef __compiletime_object_size |
303 | # define __compiletime_object_size(obj) -1 | 308 | # define __compiletime_object_size(obj) -1 |
@@ -337,6 +342,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
337 | #define compiletime_assert(condition, msg) \ | 342 | #define compiletime_assert(condition, msg) \ |
338 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | 343 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) |
339 | 344 | ||
345 | #define compiletime_assert_atomic_type(t) \ | ||
346 | compiletime_assert(__native_word(t), \ | ||
347 | "Need native word sized stores/loads for atomicity.") | ||
348 | |||
340 | /* | 349 | /* |
341 | * Prevent the compiler from merging or refetching accesses. The compiler | 350 | * Prevent the compiler from merging or refetching accesses. The compiler |
342 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 351 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/component.h b/include/linux/component.h new file mode 100644 index 000000000000..68870182ca1e --- /dev/null +++ b/include/linux/component.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef COMPONENT_H | ||
2 | #define COMPONENT_H | ||
3 | |||
4 | struct device; | ||
5 | |||
6 | struct component_ops { | ||
7 | int (*bind)(struct device *, struct device *, void *); | ||
8 | void (*unbind)(struct device *, struct device *, void *); | ||
9 | }; | ||
10 | |||
11 | int component_add(struct device *, const struct component_ops *); | ||
12 | void component_del(struct device *, const struct component_ops *); | ||
13 | |||
14 | int component_bind_all(struct device *, void *); | ||
15 | void component_unbind_all(struct device *, void *); | ||
16 | |||
17 | struct master; | ||
18 | |||
19 | struct component_master_ops { | ||
20 | int (*add_components)(struct device *, struct master *); | ||
21 | int (*bind)(struct device *); | ||
22 | void (*unbind)(struct device *); | ||
23 | }; | ||
24 | |||
25 | int component_master_add(struct device *, const struct component_master_ops *); | ||
26 | void component_master_del(struct device *, | ||
27 | const struct component_master_ops *); | ||
28 | |||
29 | int component_master_add_child(struct master *master, | ||
30 | int (*compare)(struct device *, void *), void *compare_data); | ||
31 | |||
32 | #endif | ||
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index 158158704c30..37b81bd51ec0 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
@@ -17,13 +17,13 @@ extern void __context_tracking_task_switch(struct task_struct *prev, | |||
17 | 17 | ||
18 | static inline void user_enter(void) | 18 | static inline void user_enter(void) |
19 | { | 19 | { |
20 | if (static_key_false(&context_tracking_enabled)) | 20 | if (context_tracking_is_enabled()) |
21 | context_tracking_user_enter(); | 21 | context_tracking_user_enter(); |
22 | 22 | ||
23 | } | 23 | } |
24 | static inline void user_exit(void) | 24 | static inline void user_exit(void) |
25 | { | 25 | { |
26 | if (static_key_false(&context_tracking_enabled)) | 26 | if (context_tracking_is_enabled()) |
27 | context_tracking_user_exit(); | 27 | context_tracking_user_exit(); |
28 | } | 28 | } |
29 | 29 | ||
@@ -31,7 +31,7 @@ static inline enum ctx_state exception_enter(void) | |||
31 | { | 31 | { |
32 | enum ctx_state prev_ctx; | 32 | enum ctx_state prev_ctx; |
33 | 33 | ||
34 | if (!static_key_false(&context_tracking_enabled)) | 34 | if (!context_tracking_is_enabled()) |
35 | return 0; | 35 | return 0; |
36 | 36 | ||
37 | prev_ctx = this_cpu_read(context_tracking.state); | 37 | prev_ctx = this_cpu_read(context_tracking.state); |
@@ -42,7 +42,7 @@ static inline enum ctx_state exception_enter(void) | |||
42 | 42 | ||
43 | static inline void exception_exit(enum ctx_state prev_ctx) | 43 | static inline void exception_exit(enum ctx_state prev_ctx) |
44 | { | 44 | { |
45 | if (static_key_false(&context_tracking_enabled)) { | 45 | if (context_tracking_is_enabled()) { |
46 | if (prev_ctx == IN_USER) | 46 | if (prev_ctx == IN_USER) |
47 | context_tracking_user_enter(); | 47 | context_tracking_user_enter(); |
48 | } | 48 | } |
@@ -51,7 +51,7 @@ static inline void exception_exit(enum ctx_state prev_ctx) | |||
51 | static inline void context_tracking_task_switch(struct task_struct *prev, | 51 | static inline void context_tracking_task_switch(struct task_struct *prev, |
52 | struct task_struct *next) | 52 | struct task_struct *next) |
53 | { | 53 | { |
54 | if (static_key_false(&context_tracking_enabled)) | 54 | if (context_tracking_is_enabled()) |
55 | __context_tracking_task_switch(prev, next); | 55 | __context_tracking_task_switch(prev, next); |
56 | } | 56 | } |
57 | #else | 57 | #else |
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h index 0f1979d0674f..97a81225d037 100644 --- a/include/linux/context_tracking_state.h +++ b/include/linux/context_tracking_state.h | |||
@@ -22,15 +22,20 @@ struct context_tracking { | |||
22 | extern struct static_key context_tracking_enabled; | 22 | extern struct static_key context_tracking_enabled; |
23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
24 | 24 | ||
25 | static inline bool context_tracking_in_user(void) | 25 | static inline bool context_tracking_is_enabled(void) |
26 | { | 26 | { |
27 | return __this_cpu_read(context_tracking.state) == IN_USER; | 27 | return static_key_false(&context_tracking_enabled); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline bool context_tracking_active(void) | 30 | static inline bool context_tracking_cpu_is_enabled(void) |
31 | { | 31 | { |
32 | return __this_cpu_read(context_tracking.active); | 32 | return __this_cpu_read(context_tracking.active); |
33 | } | 33 | } |
34 | |||
35 | static inline bool context_tracking_in_user(void) | ||
36 | { | ||
37 | return __this_cpu_read(context_tracking.state) == IN_USER; | ||
38 | } | ||
34 | #else | 39 | #else |
35 | static inline bool context_tracking_in_user(void) { return false; } | 40 | static inline bool context_tracking_in_user(void) { return false; } |
36 | static inline bool context_tracking_active(void) { return false; } | 41 | static inline bool context_tracking_active(void) { return false; } |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index fe68a5a98583..7032518f8542 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #include <linux/proc_fs.h> | 6 | #include <linux/proc_fs.h> |
7 | #include <linux/elf.h> | 7 | #include <linux/elf.h> |
8 | 8 | ||
9 | #include <asm/pgtable.h> /* for pgprot_t */ | ||
10 | |||
9 | #define ELFCORE_ADDR_MAX (-1ULL) | 11 | #define ELFCORE_ADDR_MAX (-1ULL) |
10 | #define ELFCORE_ADDR_ERR (-2ULL) | 12 | #define ELFCORE_ADDR_ERR (-2ULL) |
11 | 13 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 57e87e749a48..bf72e9ac6de0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -29,8 +29,10 @@ struct vfsmount; | |||
29 | /* The hash is always the low bits of hash_len */ | 29 | /* The hash is always the low bits of hash_len */ |
30 | #ifdef __LITTLE_ENDIAN | 30 | #ifdef __LITTLE_ENDIAN |
31 | #define HASH_LEN_DECLARE u32 hash; u32 len; | 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; |
32 | #define bytemask_from_count(cnt) (~(~0ul << (cnt)*8)) | ||
32 | #else | 33 | #else |
33 | #define HASH_LEN_DECLARE u32 len; u32 hash; | 34 | #define HASH_LEN_DECLARE u32 len; u32 hash; |
35 | #define bytemask_from_count(cnt) (~(~0ul >> (cnt)*8)) | ||
34 | #endif | 36 | #endif |
35 | 37 | ||
36 | /* | 38 | /* |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 41cf0c399288..ba5f96db0754 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define LINUX_DMAENGINE_H | 22 | #define LINUX_DMAENGINE_H |
23 | 23 | ||
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/err.h> | ||
25 | #include <linux/uio.h> | 26 | #include <linux/uio.h> |
26 | #include <linux/bug.h> | 27 | #include <linux/bug.h> |
27 | #include <linux/scatterlist.h> | 28 | #include <linux/scatterlist.h> |
@@ -363,6 +364,32 @@ struct dma_slave_config { | |||
363 | unsigned int slave_id; | 364 | unsigned int slave_id; |
364 | }; | 365 | }; |
365 | 366 | ||
367 | /** | ||
368 | * enum dma_residue_granularity - Granularity of the reported transfer residue | ||
369 | * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The | ||
370 | * DMA channel is only able to tell whether a descriptor has been completed or | ||
371 | * not, which means residue reporting is not supported by this channel. The | ||
372 | * residue field of the dma_tx_state field will always be 0. | ||
373 | * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully | ||
374 | * completed segment of the transfer (For cyclic transfers this is after each | ||
375 | * period). This is typically implemented by having the hardware generate an | ||
376 | * interrupt after each transferred segment and then the drivers updates the | ||
377 | * outstanding residue by the size of the segment. Another possibility is if | ||
378 | * the hardware supports scatter-gather and the segment descriptor has a field | ||
379 | * which gets set after the segment has been completed. The driver then counts | ||
380 | * the number of segments without the flag set to compute the residue. | ||
381 | * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred | ||
382 | * burst. This is typically only supported if the hardware has a progress | ||
383 | * register of some sort (E.g. a register with the current read/write address | ||
384 | * or a register with the amount of bursts/beats/bytes that have been | ||
385 | * transferred or still need to be transferred). | ||
386 | */ | ||
387 | enum dma_residue_granularity { | ||
388 | DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0, | ||
389 | DMA_RESIDUE_GRANULARITY_SEGMENT = 1, | ||
390 | DMA_RESIDUE_GRANULARITY_BURST = 2, | ||
391 | }; | ||
392 | |||
366 | /* struct dma_slave_caps - expose capabilities of a slave channel only | 393 | /* struct dma_slave_caps - expose capabilities of a slave channel only |
367 | * | 394 | * |
368 | * @src_addr_widths: bit mask of src addr widths the channel supports | 395 | * @src_addr_widths: bit mask of src addr widths the channel supports |
@@ -373,6 +400,7 @@ struct dma_slave_config { | |||
373 | * should be checked by controller as well | 400 | * should be checked by controller as well |
374 | * @cmd_pause: true, if pause and thereby resume is supported | 401 | * @cmd_pause: true, if pause and thereby resume is supported |
375 | * @cmd_terminate: true, if terminate cmd is supported | 402 | * @cmd_terminate: true, if terminate cmd is supported |
403 | * @residue_granularity: granularity of the reported transfer residue | ||
376 | */ | 404 | */ |
377 | struct dma_slave_caps { | 405 | struct dma_slave_caps { |
378 | u32 src_addr_widths; | 406 | u32 src_addr_widths; |
@@ -380,6 +408,7 @@ struct dma_slave_caps { | |||
380 | u32 directions; | 408 | u32 directions; |
381 | bool cmd_pause; | 409 | bool cmd_pause; |
382 | bool cmd_terminate; | 410 | bool cmd_terminate; |
411 | enum dma_residue_granularity residue_granularity; | ||
383 | }; | 412 | }; |
384 | 413 | ||
385 | static inline const char *dma_chan_name(struct dma_chan *chan) | 414 | static inline const char *dma_chan_name(struct dma_chan *chan) |
@@ -1040,6 +1069,8 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | |||
1040 | void dma_issue_pending_all(void); | 1069 | void dma_issue_pending_all(void); |
1041 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | 1070 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, |
1042 | dma_filter_fn fn, void *fn_param); | 1071 | dma_filter_fn fn, void *fn_param); |
1072 | struct dma_chan *dma_request_slave_channel_reason(struct device *dev, | ||
1073 | const char *name); | ||
1043 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); | 1074 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); |
1044 | void dma_release_channel(struct dma_chan *chan); | 1075 | void dma_release_channel(struct dma_chan *chan); |
1045 | #else | 1076 | #else |
@@ -1063,6 +1094,11 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | |||
1063 | { | 1094 | { |
1064 | return NULL; | 1095 | return NULL; |
1065 | } | 1096 | } |
1097 | static inline struct dma_chan *dma_request_slave_channel_reason( | ||
1098 | struct device *dev, const char *name) | ||
1099 | { | ||
1100 | return ERR_PTR(-ENODEV); | ||
1101 | } | ||
1066 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, | 1102 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, |
1067 | const char *name) | 1103 | const char *name) |
1068 | { | 1104 | { |
diff --git a/include/linux/edac.h b/include/linux/edac.h index dbdffe8d4469..8e6c20af11a2 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -35,6 +35,34 @@ extern void edac_atomic_assert_error(void); | |||
35 | extern struct bus_type *edac_get_sysfs_subsys(void); | 35 | extern struct bus_type *edac_get_sysfs_subsys(void); |
36 | extern void edac_put_sysfs_subsys(void); | 36 | extern void edac_put_sysfs_subsys(void); |
37 | 37 | ||
38 | enum { | ||
39 | EDAC_REPORTING_ENABLED, | ||
40 | EDAC_REPORTING_DISABLED, | ||
41 | EDAC_REPORTING_FORCE | ||
42 | }; | ||
43 | |||
44 | extern int edac_report_status; | ||
45 | #ifdef CONFIG_EDAC | ||
46 | static inline int get_edac_report_status(void) | ||
47 | { | ||
48 | return edac_report_status; | ||
49 | } | ||
50 | |||
51 | static inline void set_edac_report_status(int new) | ||
52 | { | ||
53 | edac_report_status = new; | ||
54 | } | ||
55 | #else | ||
56 | static inline int get_edac_report_status(void) | ||
57 | { | ||
58 | return EDAC_REPORTING_DISABLED; | ||
59 | } | ||
60 | |||
61 | static inline void set_edac_report_status(int new) | ||
62 | { | ||
63 | } | ||
64 | #endif | ||
65 | |||
38 | static inline void opstate_init(void) | 66 | static inline void opstate_init(void) |
39 | { | 67 | { |
40 | switch (edac_op_state) { | 68 | switch (edac_op_state) { |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bc5687d0f315..0a819e7a60c9 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -556,6 +556,9 @@ extern struct efi { | |||
556 | unsigned long hcdp; /* HCDP table */ | 556 | unsigned long hcdp; /* HCDP table */ |
557 | unsigned long uga; /* UGA table */ | 557 | unsigned long uga; /* UGA table */ |
558 | unsigned long uv_systab; /* UV system table */ | 558 | unsigned long uv_systab; /* UV system table */ |
559 | unsigned long fw_vendor; /* fw_vendor */ | ||
560 | unsigned long runtime; /* runtime table */ | ||
561 | unsigned long config_table; /* config tables */ | ||
559 | efi_get_time_t *get_time; | 562 | efi_get_time_t *get_time; |
560 | efi_set_time_t *set_time; | 563 | efi_set_time_t *set_time; |
561 | efi_get_wakeup_time_t *get_wakeup_time; | 564 | efi_get_wakeup_time_t *get_wakeup_time; |
@@ -653,6 +656,7 @@ extern int __init efi_setup_pcdp_console(char *); | |||
653 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ | 656 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ |
654 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ | 657 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ |
655 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ | 658 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ |
659 | #define EFI_ARCH_1 6 /* First arch-specific bit */ | ||
656 | 660 | ||
657 | #ifdef CONFIG_EFI | 661 | #ifdef CONFIG_EFI |
658 | # ifdef CONFIG_X86 | 662 | # ifdef CONFIG_X86 |
@@ -801,6 +805,8 @@ struct efivar_entry { | |||
801 | struct efi_variable var; | 805 | struct efi_variable var; |
802 | struct list_head list; | 806 | struct list_head list; |
803 | struct kobject kobj; | 807 | struct kobject kobj; |
808 | bool scanning; | ||
809 | bool deleting; | ||
804 | }; | 810 | }; |
805 | 811 | ||
806 | 812 | ||
@@ -866,6 +872,21 @@ void efivar_run_worker(void); | |||
866 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | 872 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) |
867 | int efivars_sysfs_init(void); | 873 | int efivars_sysfs_init(void); |
868 | 874 | ||
875 | #define EFIVARS_DATA_SIZE_MAX 1024 | ||
876 | |||
869 | #endif /* CONFIG_EFI_VARS */ | 877 | #endif /* CONFIG_EFI_VARS */ |
870 | 878 | ||
879 | #ifdef CONFIG_EFI_RUNTIME_MAP | ||
880 | int efi_runtime_map_init(struct kobject *); | ||
881 | void efi_runtime_map_setup(void *, int, u32); | ||
882 | #else | ||
883 | static inline int efi_runtime_map_init(struct kobject *kobj) | ||
884 | { | ||
885 | return 0; | ||
886 | } | ||
887 | |||
888 | static inline void | ||
889 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} | ||
890 | #endif | ||
891 | |||
871 | #endif /* _LINUX_EFI_H */ | 892 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h index 4195810f87fe..8900fdf511c6 100644 --- a/include/linux/extcon/extcon-gpio.h +++ b/include/linux/extcon/extcon-gpio.h | |||
@@ -51,6 +51,7 @@ struct gpio_extcon_platform_data { | |||
51 | /* if NULL, "0" or "1" will be printed */ | 51 | /* if NULL, "0" or "1" will be printed */ |
52 | const char *state_on; | 52 | const char *state_on; |
53 | const char *state_off; | 53 | const char *state_off; |
54 | bool check_on_resume; | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | #endif /* __EXTCON_GPIO_H__ */ | 57 | #endif /* __EXTCON_GPIO_H__ */ |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index e154c1005cd1..59529330efd6 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -68,4 +68,11 @@ static inline void release_firmware(const struct firmware *fw) | |||
68 | 68 | ||
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifdef CONFIG_FW_LOADER_USER_HELPER | ||
72 | int request_firmware_direct(const struct firmware **fw, const char *name, | ||
73 | struct device *device); | ||
74 | #else | ||
75 | #define request_firmware_direct request_firmware | ||
76 | #endif | ||
77 | |||
71 | #endif | 78 | #endif |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 9abbe630c456..8c9b7a1c4138 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -248,6 +248,9 @@ struct ftrace_event_call { | |||
248 | #ifdef CONFIG_PERF_EVENTS | 248 | #ifdef CONFIG_PERF_EVENTS |
249 | int perf_refcount; | 249 | int perf_refcount; |
250 | struct hlist_head __percpu *perf_events; | 250 | struct hlist_head __percpu *perf_events; |
251 | |||
252 | int (*perf_perm)(struct ftrace_event_call *, | ||
253 | struct perf_event *); | ||
251 | #endif | 254 | #endif |
252 | }; | 255 | }; |
253 | 256 | ||
@@ -317,6 +320,19 @@ struct ftrace_event_file { | |||
317 | } \ | 320 | } \ |
318 | early_initcall(trace_init_flags_##name); | 321 | early_initcall(trace_init_flags_##name); |
319 | 322 | ||
323 | #define __TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
324 | static int perf_perm_##name(struct ftrace_event_call *tp_event, \ | ||
325 | struct perf_event *p_event) \ | ||
326 | { \ | ||
327 | return ({ expr; }); \ | ||
328 | } \ | ||
329 | static int __init trace_init_perf_perm_##name(void) \ | ||
330 | { \ | ||
331 | event_##name.perf_perm = &perf_perm_##name; \ | ||
332 | return 0; \ | ||
333 | } \ | ||
334 | early_initcall(trace_init_perf_perm_##name); | ||
335 | |||
320 | #define PERF_MAX_TRACE_SIZE 2048 | 336 | #define PERF_MAX_TRACE_SIZE 2048 |
321 | 337 | ||
322 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 338 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 13dfd24d01ab..b581b13d29d9 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -90,7 +90,6 @@ void devm_gpio_free(struct device *dev, unsigned int gpio); | |||
90 | 90 | ||
91 | #include <linux/kernel.h> | 91 | #include <linux/kernel.h> |
92 | #include <linux/types.h> | 92 | #include <linux/types.h> |
93 | #include <linux/errno.h> | ||
94 | #include <linux/bug.h> | 93 | #include <linux/bug.h> |
95 | #include <linux/pinctrl/pinctrl.h> | 94 | #include <linux/pinctrl/pinctrl.h> |
96 | 95 | ||
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 82eac610ce1a..a3e181e09636 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
@@ -2,9 +2,12 @@ | |||
2 | #define __LINUX_GPIO_DRIVER_H | 2 | #define __LINUX_GPIO_DRIVER_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/module.h> | ||
5 | 6 | ||
6 | struct device; | 7 | struct device; |
7 | struct gpio_desc; | 8 | struct gpio_desc; |
9 | struct of_phandle_args; | ||
10 | struct device_node; | ||
8 | struct seq_file; | 11 | struct seq_file; |
9 | 12 | ||
10 | /** | 13 | /** |
@@ -36,14 +39,15 @@ struct seq_file; | |||
36 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | 39 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO |
37 | * handled is (base + ngpio - 1). | 40 | * handled is (base + ngpio - 1). |
38 | * @desc: array of ngpio descriptors. Private. | 41 | * @desc: array of ngpio descriptors. Private. |
39 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
40 | * must while accessing GPIO expander chips over I2C or SPI | ||
41 | * @names: if set, must be an array of strings to use as alternative | 42 | * @names: if set, must be an array of strings to use as alternative |
42 | * names for the GPIOs in this chip. Any entry in the array | 43 | * names for the GPIOs in this chip. Any entry in the array |
43 | * may be NULL if there is no alias for the GPIO, however the | 44 | * may be NULL if there is no alias for the GPIO, however the |
44 | * array must be @ngpio entries long. A name can include a single printk | 45 | * array must be @ngpio entries long. A name can include a single printk |
45 | * format specifier for an unsigned int. It is substituted by the actual | 46 | * format specifier for an unsigned int. It is substituted by the actual |
46 | * number of the gpio. | 47 | * number of the gpio. |
48 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
49 | * must while accessing GPIO expander chips over I2C or SPI | ||
50 | * @exported: flags if the gpiochip is exported for use from sysfs. Private. | ||
47 | * | 51 | * |
48 | * A gpio_chip can help platforms abstract various sources of GPIOs so | 52 | * A gpio_chip can help platforms abstract various sources of GPIOs so |
49 | * they can all be accessed through a common programing interface. | 53 | * they can all be accessed through a common programing interface. |
@@ -88,8 +92,8 @@ struct gpio_chip { | |||
88 | u16 ngpio; | 92 | u16 ngpio; |
89 | struct gpio_desc *desc; | 93 | struct gpio_desc *desc; |
90 | const char *const *names; | 94 | const char *const *names; |
91 | unsigned can_sleep:1; | 95 | bool can_sleep; |
92 | unsigned exported:1; | 96 | bool exported; |
93 | 97 | ||
94 | #if defined(CONFIG_OF_GPIO) | 98 | #if defined(CONFIG_OF_GPIO) |
95 | /* | 99 | /* |
@@ -133,59 +137,50 @@ enum gpio_lookup_flags { | |||
133 | }; | 137 | }; |
134 | 138 | ||
135 | /** | 139 | /** |
136 | * Lookup table for associating GPIOs to specific devices and functions using | 140 | * struct gpiod_lookup - lookup table |
137 | * platform data. | 141 | * @chip_label: name of the chip the GPIO belongs to |
142 | * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO | ||
143 | * @con_id: name of the GPIO from the device's point of view | ||
144 | * @idx: index of the GPIO in case several GPIOs share the same name | ||
145 | * @flags: mask of GPIO_* values | ||
146 | * | ||
147 | * gpiod_lookup is a lookup table for associating GPIOs to specific devices and | ||
148 | * functions using platform data. | ||
138 | */ | 149 | */ |
139 | struct gpiod_lookup { | 150 | struct gpiod_lookup { |
140 | struct list_head list; | ||
141 | /* | ||
142 | * name of the chip the GPIO belongs to | ||
143 | */ | ||
144 | const char *chip_label; | 151 | const char *chip_label; |
145 | /* | ||
146 | * hardware number (i.e. relative to the chip) of the GPIO | ||
147 | */ | ||
148 | u16 chip_hwnum; | 152 | u16 chip_hwnum; |
149 | /* | ||
150 | * name of device that can claim this GPIO | ||
151 | */ | ||
152 | const char *dev_id; | ||
153 | /* | ||
154 | * name of the GPIO from the device's point of view | ||
155 | */ | ||
156 | const char *con_id; | 153 | const char *con_id; |
157 | /* | ||
158 | * index of the GPIO in case several GPIOs share the same name | ||
159 | */ | ||
160 | unsigned int idx; | 154 | unsigned int idx; |
161 | /* | ||
162 | * mask of GPIO_* values | ||
163 | */ | ||
164 | enum gpio_lookup_flags flags; | 155 | enum gpio_lookup_flags flags; |
165 | }; | 156 | }; |
166 | 157 | ||
158 | struct gpiod_lookup_table { | ||
159 | struct list_head list; | ||
160 | const char *dev_id; | ||
161 | struct gpiod_lookup table[]; | ||
162 | }; | ||
163 | |||
167 | /* | 164 | /* |
168 | * Simple definition of a single GPIO under a con_id | 165 | * Simple definition of a single GPIO under a con_id |
169 | */ | 166 | */ |
170 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ | 167 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _con_id, _flags) \ |
171 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) | 168 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, 0, _flags) |
172 | 169 | ||
173 | /* | 170 | /* |
174 | * Use this macro if you need to have several GPIOs under the same con_id. | 171 | * Use this macro if you need to have several GPIOs under the same con_id. |
175 | * Each GPIO needs to use a different index and can be accessed using | 172 | * Each GPIO needs to use a different index and can be accessed using |
176 | * gpiod_get_index() | 173 | * gpiod_get_index() |
177 | */ | 174 | */ |
178 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ | 175 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, _idx, _flags) \ |
179 | _flags) \ | ||
180 | { \ | 176 | { \ |
181 | .chip_label = _chip_label, \ | 177 | .chip_label = _chip_label, \ |
182 | .chip_hwnum = _chip_hwnum, \ | 178 | .chip_hwnum = _chip_hwnum, \ |
183 | .dev_id = _dev_id, \ | ||
184 | .con_id = _con_id, \ | 179 | .con_id = _con_id, \ |
185 | .idx = _idx, \ | 180 | .idx = _idx, \ |
186 | .flags = _flags, \ | 181 | .flags = _flags, \ |
187 | } | 182 | } |
188 | 183 | ||
189 | void gpiod_add_table(struct gpiod_lookup *table, size_t size); | 184 | void gpiod_add_lookup_table(struct gpiod_lookup_table *table); |
190 | 185 | ||
191 | #endif | 186 | #endif |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index d9cf963ac832..12d5f972f23f 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
6 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
7 | #include <linux/vtime.h> | 7 | #include <linux/vtime.h> |
8 | #include <asm/hardirq.h> | ||
8 | 9 | ||
9 | 10 | ||
10 | extern void synchronize_irq(unsigned int irq); | 11 | extern void synchronize_irq(unsigned int irq); |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index 206a2af6b62b..b914ca3f57ba 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
@@ -42,6 +42,8 @@ struct hid_sensor_hub_attribute_info { | |||
42 | s32 units; | 42 | s32 units; |
43 | s32 unit_expo; | 43 | s32 unit_expo; |
44 | s32 size; | 44 | s32 size; |
45 | s32 logical_minimum; | ||
46 | s32 logical_maximum; | ||
45 | }; | 47 | }; |
46 | 48 | ||
47 | /** | 49 | /** |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 4f945d3ed49f..beaf965621c1 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
@@ -23,22 +23,26 @@ | |||
23 | 23 | ||
24 | /* Accel 3D (200073) */ | 24 | /* Accel 3D (200073) */ |
25 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 | 25 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 |
26 | #define HID_USAGE_SENSOR_DATA_ACCELERATION 0x200452 | ||
26 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 | 27 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 |
27 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 | 28 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 |
28 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 | 29 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 |
29 | 30 | ||
30 | /* ALS (200041) */ | 31 | /* ALS (200041) */ |
31 | #define HID_USAGE_SENSOR_ALS 0x200041 | 32 | #define HID_USAGE_SENSOR_ALS 0x200041 |
33 | #define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0 | ||
32 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 | 34 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 |
33 | 35 | ||
34 | /* Gyro 3D: (200076) */ | 36 | /* Gyro 3D: (200076) */ |
35 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 | 37 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 |
38 | #define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456 | ||
36 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 | 39 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 |
37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 | 40 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 |
38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 | 41 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 |
39 | 42 | ||
40 | /* ORIENTATION: Compass 3D: (200083) */ | 43 | /* ORIENTATION: Compass 3D: (200083) */ |
41 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 | 44 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 |
45 | #define HID_USAGE_SENSOR_DATA_ORIENTATION 0x200470 | ||
42 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 | 46 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 |
43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 | 47 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 |
44 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 | 48 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 |
@@ -54,10 +58,14 @@ | |||
54 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B | 58 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B |
55 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C | 59 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C |
56 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D | 60 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D |
61 | |||
62 | /* ORIENTATION: Inclinometer 3D: (200086) */ | ||
63 | #define HID_USAGE_SENSOR_INCLINOMETER_3D 0x200086 | ||
57 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E | 64 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E |
58 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F | 65 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F |
59 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 | 66 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 |
60 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 | 67 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 |
68 | |||
61 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 | 69 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 |
62 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 | 70 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 |
63 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 | 71 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 |
@@ -117,4 +125,20 @@ | |||
117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | 125 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 |
118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | 126 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 |
119 | 127 | ||
128 | /* Per data field properties */ | ||
129 | #define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00 | ||
130 | #define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000 | ||
131 | |||
132 | /* Power state enumerations */ | ||
133 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 | ||
134 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 | ||
135 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM 0x02 | ||
136 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM 0x03 | ||
137 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM 0x04 | ||
138 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM 0x05 | ||
139 | |||
140 | /* Report State enumerations */ | ||
141 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM 0x00 | ||
142 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM 0x01 | ||
143 | |||
120 | #endif | 144 | #endif |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9649ff0c63f8..bd7e98752222 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -142,7 +142,10 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page) | |||
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | #define isolate_huge_page(p, l) false | 145 | static inline bool isolate_huge_page(struct page *page, struct list_head *list) |
146 | { | ||
147 | return false; | ||
148 | } | ||
146 | #define putback_active_hugepage(p) do {} while (0) | 149 | #define putback_active_hugepage(p) do {} while (0) |
147 | #define is_hugepage_active(x) false | 150 | #define is_hugepage_active(x) false |
148 | 151 | ||
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index 49ed17fdf055..5388326fbbff 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
@@ -31,7 +31,6 @@ struct i2c_pnx_algo_data { | |||
31 | int last; | 31 | int last; |
32 | struct clk *clk; | 32 | struct clk *clk; |
33 | struct i2c_adapter adapter; | 33 | struct i2c_adapter adapter; |
34 | phys_addr_t base; | ||
35 | int irq; | 34 | int irq; |
36 | u32 timeout; | 35 | u32 timeout; |
37 | }; | 36 | }; |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eff50e062be8..d9c8dbd3373f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -445,7 +445,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
445 | static inline struct i2c_adapter * | 445 | static inline struct i2c_adapter * |
446 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | 446 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) |
447 | { | 447 | { |
448 | #if IS_ENABLED(I2C_MUX) | 448 | #if IS_ENABLED(CONFIG_I2C_MUX) |
449 | struct device *parent = adapter->dev.parent; | 449 | struct device *parent = adapter->dev.parent; |
450 | 450 | ||
451 | if (parent != NULL && parent->type == &i2c_adapter_type) | 451 | if (parent != NULL && parent->type == &i2c_adapter_type) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 673a3ce67f31..ade1c06d4ceb 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -175,6 +175,9 @@ static inline int twl_class_is_ ##class(void) \ | |||
175 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | 175 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) |
176 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 176 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
177 | 177 | ||
178 | /* Set the regcache bypass for the regmap associated with the nodule */ | ||
179 | int twl_set_regcache_bypass(u8 mod_no, bool enable); | ||
180 | |||
178 | /* | 181 | /* |
179 | * Read and write several 8-bit registers at once. | 182 | * Read and write several 8-bit registers at once. |
180 | */ | 183 | */ |
@@ -667,8 +670,6 @@ struct twl4030_codec_data { | |||
667 | unsigned int digimic_delay; /* in ms */ | 670 | unsigned int digimic_delay; /* in ms */ |
668 | unsigned int ramp_delay_value; | 671 | unsigned int ramp_delay_value; |
669 | unsigned int offset_cncl_path; | 672 | unsigned int offset_cncl_path; |
670 | unsigned int check_defaults:1; | ||
671 | unsigned int reset_registers:1; | ||
672 | unsigned int hs_extmute:1; | 673 | unsigned int hs_extmute:1; |
673 | int hs_extmute_gpio; | 674 | int hs_extmute_gpio; |
674 | }; | 675 | }; |
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 15607b45221a..519392763393 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
@@ -21,6 +21,8 @@ struct iio_buffer; | |||
21 | * struct iio_buffer_access_funcs - access functions for buffers. | 21 | * struct iio_buffer_access_funcs - access functions for buffers. |
22 | * @store_to: actually store stuff to the buffer | 22 | * @store_to: actually store stuff to the buffer |
23 | * @read_first_n: try to get a specified number of bytes (must exist) | 23 | * @read_first_n: try to get a specified number of bytes (must exist) |
24 | * @data_available: indicates whether data for reading from the buffer is | ||
25 | * available. | ||
24 | * @request_update: if a parameter change has been marked, update underlying | 26 | * @request_update: if a parameter change has been marked, update underlying |
25 | * storage. | 27 | * storage. |
26 | * @get_bytes_per_datum:get current bytes per datum | 28 | * @get_bytes_per_datum:get current bytes per datum |
@@ -43,6 +45,7 @@ struct iio_buffer_access_funcs { | |||
43 | int (*read_first_n)(struct iio_buffer *buffer, | 45 | int (*read_first_n)(struct iio_buffer *buffer, |
44 | size_t n, | 46 | size_t n, |
45 | char __user *buf); | 47 | char __user *buf); |
48 | bool (*data_available)(struct iio_buffer *buffer); | ||
46 | 49 | ||
47 | int (*request_update)(struct iio_buffer *buffer); | 50 | int (*request_update)(struct iio_buffer *buffer); |
48 | 51 | ||
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index 5dab2c41031f..8bbd7bc1043d 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h | |||
@@ -46,10 +46,6 @@ struct iio_event_data { | |||
46 | ((u16)chan)) | 46 | ((u16)chan)) |
47 | 47 | ||
48 | 48 | ||
49 | #define IIO_EV_DIR_MAX 4 | ||
50 | #define IIO_EV_BIT(type, direction) \ | ||
51 | (1 << (type*IIO_EV_DIR_MAX + direction)) | ||
52 | |||
53 | /** | 49 | /** |
54 | * IIO_MOD_EVENT_CODE() - create event identifier for modified channels | 50 | * IIO_MOD_EVENT_CODE() - create event identifier for modified channels |
55 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. | 51 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 256a90a1bea6..75a8a20c8179 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -185,7 +185,6 @@ struct iio_event_spec { | |||
185 | * by all channels of the same direction. | 185 | * by all channels of the same direction. |
186 | * @info_mask_shared_by_all: What information is to be exported that is shared | 186 | * @info_mask_shared_by_all: What information is to be exported that is shared |
187 | * by all channels. | 187 | * by all channels. |
188 | * @event_mask: What events can this channel produce. | ||
189 | * @event_spec: Array of events which should be registered for this | 188 | * @event_spec: Array of events which should be registered for this |
190 | * channel. | 189 | * channel. |
191 | * @num_event_specs: Size of the event_spec array. | 190 | * @num_event_specs: Size of the event_spec array. |
@@ -226,7 +225,6 @@ struct iio_chan_spec { | |||
226 | long info_mask_shared_by_type; | 225 | long info_mask_shared_by_type; |
227 | long info_mask_shared_by_dir; | 226 | long info_mask_shared_by_dir; |
228 | long info_mask_shared_by_all; | 227 | long info_mask_shared_by_all; |
229 | long event_mask; | ||
230 | const struct iio_event_spec *event_spec; | 228 | const struct iio_event_spec *event_spec; |
231 | unsigned int num_event_specs; | 229 | unsigned int num_event_specs; |
232 | const struct iio_chan_spec_ext_info *ext_info; | 230 | const struct iio_chan_spec_ext_info *ext_info; |
@@ -307,16 +305,8 @@ struct iio_dev; | |||
307 | * returns IIO_VAL_INT_PLUS_MICRO. | 305 | * returns IIO_VAL_INT_PLUS_MICRO. |
308 | * @read_event_config: find out if the event is enabled. | 306 | * @read_event_config: find out if the event is enabled. |
309 | * @write_event_config: set if the event is enabled. | 307 | * @write_event_config: set if the event is enabled. |
310 | * @read_event_value: read a value associated with the event. Meaning | 308 | * @read_event_value: read a configuration value associated with the event. |
311 | * is event dependant. event_code specifies which event. | 309 | * @write_event_value: write a configuration value for the event. |
312 | * @write_event_value: write the value associated with the event. | ||
313 | * Meaning is event dependent. | ||
314 | * @read_event_config_new: find out if the event is enabled. New style interface. | ||
315 | * @write_event_config_new: set if the event is enabled. New style interface. | ||
316 | * @read_event_value_new: read a configuration value associated with the event. | ||
317 | * New style interface. | ||
318 | * @write_event_value_new: write a configuration value for the event. New style | ||
319 | * interface. | ||
320 | * @validate_trigger: function to validate the trigger when the | 310 | * @validate_trigger: function to validate the trigger when the |
321 | * current trigger gets changed. | 311 | * current trigger gets changed. |
322 | * @update_scan_mode: function to configure device and scan buffer when | 312 | * @update_scan_mode: function to configure device and scan buffer when |
@@ -345,37 +335,23 @@ struct iio_info { | |||
345 | long mask); | 335 | long mask); |
346 | 336 | ||
347 | int (*read_event_config)(struct iio_dev *indio_dev, | 337 | int (*read_event_config)(struct iio_dev *indio_dev, |
348 | u64 event_code); | ||
349 | |||
350 | int (*write_event_config)(struct iio_dev *indio_dev, | ||
351 | u64 event_code, | ||
352 | int state); | ||
353 | |||
354 | int (*read_event_value)(struct iio_dev *indio_dev, | ||
355 | u64 event_code, | ||
356 | int *val); | ||
357 | int (*write_event_value)(struct iio_dev *indio_dev, | ||
358 | u64 event_code, | ||
359 | int val); | ||
360 | |||
361 | int (*read_event_config_new)(struct iio_dev *indio_dev, | ||
362 | const struct iio_chan_spec *chan, | 338 | const struct iio_chan_spec *chan, |
363 | enum iio_event_type type, | 339 | enum iio_event_type type, |
364 | enum iio_event_direction dir); | 340 | enum iio_event_direction dir); |
365 | 341 | ||
366 | int (*write_event_config_new)(struct iio_dev *indio_dev, | 342 | int (*write_event_config)(struct iio_dev *indio_dev, |
367 | const struct iio_chan_spec *chan, | 343 | const struct iio_chan_spec *chan, |
368 | enum iio_event_type type, | 344 | enum iio_event_type type, |
369 | enum iio_event_direction dir, | 345 | enum iio_event_direction dir, |
370 | int state); | 346 | int state); |
371 | 347 | ||
372 | int (*read_event_value_new)(struct iio_dev *indio_dev, | 348 | int (*read_event_value)(struct iio_dev *indio_dev, |
373 | const struct iio_chan_spec *chan, | 349 | const struct iio_chan_spec *chan, |
374 | enum iio_event_type type, | 350 | enum iio_event_type type, |
375 | enum iio_event_direction dir, | 351 | enum iio_event_direction dir, |
376 | enum iio_event_info info, int *val, int *val2); | 352 | enum iio_event_info info, int *val, int *val2); |
377 | 353 | ||
378 | int (*write_event_value_new)(struct iio_dev *indio_dev, | 354 | int (*write_event_value)(struct iio_dev *indio_dev, |
379 | const struct iio_chan_spec *chan, | 355 | const struct iio_chan_spec *chan, |
380 | enum iio_event_type type, | 356 | enum iio_event_type type, |
381 | enum iio_event_direction dir, | 357 | enum iio_event_direction dir, |
@@ -490,32 +466,12 @@ struct iio_dev { | |||
490 | #endif | 466 | #endif |
491 | }; | 467 | }; |
492 | 468 | ||
493 | /** | ||
494 | * iio_find_channel_from_si() - get channel from its scan index | ||
495 | * @indio_dev: device | ||
496 | * @si: scan index to match | ||
497 | */ | ||
498 | const struct iio_chan_spec | 469 | const struct iio_chan_spec |
499 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); | 470 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); |
500 | |||
501 | /** | ||
502 | * iio_device_register() - register a device with the IIO subsystem | ||
503 | * @indio_dev: Device structure filled by the device driver | ||
504 | **/ | ||
505 | int iio_device_register(struct iio_dev *indio_dev); | 471 | int iio_device_register(struct iio_dev *indio_dev); |
506 | |||
507 | /** | ||
508 | * iio_device_unregister() - unregister a device from the IIO subsystem | ||
509 | * @indio_dev: Device structure representing the device. | ||
510 | **/ | ||
511 | void iio_device_unregister(struct iio_dev *indio_dev); | 472 | void iio_device_unregister(struct iio_dev *indio_dev); |
512 | 473 | int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev); | |
513 | /** | 474 | void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev); |
514 | * iio_push_event() - try to add event to the list for userspace reading | ||
515 | * @indio_dev: IIO device structure | ||
516 | * @ev_code: What event | ||
517 | * @timestamp: When the event occurred | ||
518 | **/ | ||
519 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); | 475 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); |
520 | 476 | ||
521 | extern struct bus_type iio_bus_type; | 477 | extern struct bus_type iio_bus_type; |
@@ -579,10 +535,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev) | |||
579 | 535 | ||
580 | /* Can we make this smaller? */ | 536 | /* Can we make this smaller? */ |
581 | #define IIO_ALIGN L1_CACHE_BYTES | 537 | #define IIO_ALIGN L1_CACHE_BYTES |
582 | /** | ||
583 | * iio_device_alloc() - allocate an iio_dev from a driver | ||
584 | * @sizeof_priv: Space to allocate for private structure. | ||
585 | **/ | ||
586 | struct iio_dev *iio_device_alloc(int sizeof_priv); | 538 | struct iio_dev *iio_device_alloc(int sizeof_priv); |
587 | 539 | ||
588 | static inline void *iio_priv(const struct iio_dev *indio_dev) | 540 | static inline void *iio_priv(const struct iio_dev *indio_dev) |
@@ -596,64 +548,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv) | |||
596 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); | 548 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); |
597 | } | 549 | } |
598 | 550 | ||
599 | /** | ||
600 | * iio_device_free() - free an iio_dev from a driver | ||
601 | * @indio_dev: the iio_dev associated with the device | ||
602 | **/ | ||
603 | void iio_device_free(struct iio_dev *indio_dev); | 551 | void iio_device_free(struct iio_dev *indio_dev); |
604 | |||
605 | /** | ||
606 | * devm_iio_device_alloc - Resource-managed iio_device_alloc() | ||
607 | * @dev: Device to allocate iio_dev for | ||
608 | * @sizeof_priv: Space to allocate for private structure. | ||
609 | * | ||
610 | * Managed iio_device_alloc. iio_dev allocated with this function is | ||
611 | * automatically freed on driver detach. | ||
612 | * | ||
613 | * If an iio_dev allocated with this function needs to be freed separately, | ||
614 | * devm_iio_device_free() must be used. | ||
615 | * | ||
616 | * RETURNS: | ||
617 | * Pointer to allocated iio_dev on success, NULL on failure. | ||
618 | */ | ||
619 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); | 552 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); |
620 | |||
621 | /** | ||
622 | * devm_iio_device_free - Resource-managed iio_device_free() | ||
623 | * @dev: Device this iio_dev belongs to | ||
624 | * @indio_dev: the iio_dev associated with the device | ||
625 | * | ||
626 | * Free iio_dev allocated with devm_iio_device_alloc(). | ||
627 | */ | ||
628 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); | 553 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); |
629 | |||
630 | /** | ||
631 | * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc() | ||
632 | * @dev: Device to allocate iio_trigger for | ||
633 | * @fmt: trigger name format. If it includes format | ||
634 | * specifiers, the additional arguments following | ||
635 | * format are formatted and inserted in the resulting | ||
636 | * string replacing their respective specifiers. | ||
637 | * | ||
638 | * Managed iio_trigger_alloc. iio_trigger allocated with this function is | ||
639 | * automatically freed on driver detach. | ||
640 | * | ||
641 | * If an iio_trigger allocated with this function needs to be freed separately, | ||
642 | * devm_iio_trigger_free() must be used. | ||
643 | * | ||
644 | * RETURNS: | ||
645 | * Pointer to allocated iio_trigger on success, NULL on failure. | ||
646 | */ | ||
647 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, | 554 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, |
648 | const char *fmt, ...); | 555 | const char *fmt, ...); |
649 | |||
650 | /** | ||
651 | * devm_iio_trigger_free - Resource-managed iio_trigger_free() | ||
652 | * @dev: Device this iio_dev belongs to | ||
653 | * @iio_trig: the iio_trigger associated with the device | ||
654 | * | ||
655 | * Free iio_trigger allocated with devm_iio_trigger_alloc(). | ||
656 | */ | ||
657 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); | 556 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); |
658 | 557 | ||
659 | /** | 558 | /** |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4ac928ee31c5..084d882fe01b 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -29,6 +29,7 @@ enum iio_chan_type { | |||
29 | IIO_ALTVOLTAGE, | 29 | IIO_ALTVOLTAGE, |
30 | IIO_CCT, | 30 | IIO_CCT, |
31 | IIO_PRESSURE, | 31 | IIO_PRESSURE, |
32 | IIO_HUMIDITYRELATIVE, | ||
32 | }; | 33 | }; |
33 | 34 | ||
34 | enum iio_modifier { | 35 | enum iio_modifier { |
diff --git a/include/linux/init.h b/include/linux/init.h index 8e68a64bfe00..e1688802964f 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -286,9 +286,11 @@ void __init parse_early_options(char *cmdline); | |||
286 | #define arch_initcall(fn) module_init(fn) | 286 | #define arch_initcall(fn) module_init(fn) |
287 | #define subsys_initcall(fn) module_init(fn) | 287 | #define subsys_initcall(fn) module_init(fn) |
288 | #define fs_initcall(fn) module_init(fn) | 288 | #define fs_initcall(fn) module_init(fn) |
289 | #define rootfs_initcall(fn) module_init(fn) | ||
289 | #define device_initcall(fn) module_init(fn) | 290 | #define device_initcall(fn) module_init(fn) |
290 | #define late_initcall(fn) module_init(fn) | 291 | #define late_initcall(fn) module_init(fn) |
291 | 292 | ||
293 | #define console_initcall(fn) module_init(fn) | ||
292 | #define security_initcall(fn) module_init(fn) | 294 | #define security_initcall(fn) module_init(fn) |
293 | 295 | ||
294 | /* Each module must use one module_init(). */ | 296 | /* Each module must use one module_init(). */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index b0ed422e4e4a..f0e52383a001 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/user_namespace.h> | 11 | #include <linux/user_namespace.h> |
12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
13 | #include <linux/seqlock.h> | 13 | #include <linux/seqlock.h> |
14 | #include <linux/rbtree.h> | ||
14 | #include <net/net_namespace.h> | 15 | #include <net/net_namespace.h> |
15 | #include <linux/sched/rt.h> | 16 | #include <linux/sched/rt.h> |
16 | 17 | ||
@@ -154,6 +155,14 @@ extern struct task_group root_task_group; | |||
154 | 155 | ||
155 | #define INIT_TASK_COMM "swapper" | 156 | #define INIT_TASK_COMM "swapper" |
156 | 157 | ||
158 | #ifdef CONFIG_RT_MUTEXES | ||
159 | # define INIT_RT_MUTEXES(tsk) \ | ||
160 | .pi_waiters = RB_ROOT, \ | ||
161 | .pi_waiters_leftmost = NULL, | ||
162 | #else | ||
163 | # define INIT_RT_MUTEXES(tsk) | ||
164 | #endif | ||
165 | |||
157 | /* | 166 | /* |
158 | * INIT_TASK is used to set up the first task table, touch at | 167 | * INIT_TASK is used to set up the first task table, touch at |
159 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 168 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -221,6 +230,7 @@ extern struct task_group root_task_group; | |||
221 | INIT_TRACE_RECURSION \ | 230 | INIT_TRACE_RECURSION \ |
222 | INIT_TASK_RCU_PREEMPT(tsk) \ | 231 | INIT_TASK_RCU_PREEMPT(tsk) \ |
223 | INIT_CPUSET_SEQ(tsk) \ | 232 | INIT_CPUSET_SEQ(tsk) \ |
233 | INIT_RT_MUTEXES(tsk) \ | ||
224 | INIT_VTIME(tsk) \ | 234 | INIT_VTIME(tsk) \ |
225 | } | 235 | } |
226 | 236 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d89d1b808a6..c56c350324e4 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <uapi/linux/ipv6.h> | 4 | #include <uapi/linux/ipv6.h> |
5 | 5 | ||
6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) | 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) |
7 | #define ipv6_authlen(p) (((p)->hdrlen+2) << 2) | ||
7 | /* | 8 | /* |
8 | * This structure contains configuration options per IPv6 link. | 9 | * This structure contains configuration options per IPv6 link. |
9 | */ | 10 | */ |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 56fb646909dc..26e2661d3935 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -152,6 +152,14 @@ static inline int irq_balancing_disabled(unsigned int irq) | |||
152 | return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; | 152 | return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; |
153 | } | 153 | } |
154 | 154 | ||
155 | static inline int irq_is_percpu(unsigned int irq) | ||
156 | { | ||
157 | struct irq_desc *desc; | ||
158 | |||
159 | desc = irq_to_desc(irq); | ||
160 | return desc->status_use_accessors & IRQ_PER_CPU; | ||
161 | } | ||
162 | |||
155 | static inline void | 163 | static inline void |
156 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) | 164 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) |
157 | { | 165 | { |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 714ba08dc092..e374e369fb2f 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
@@ -14,6 +14,6 @@ enum irqreturn { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
17 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) | 17 | #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) |
18 | 18 | ||
19 | #endif | 19 | #endif |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 39999775b922..5c1dfb2a9e73 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -81,18 +81,21 @@ struct module; | |||
81 | #include <linux/atomic.h> | 81 | #include <linux/atomic.h> |
82 | #ifdef HAVE_JUMP_LABEL | 82 | #ifdef HAVE_JUMP_LABEL |
83 | 83 | ||
84 | #define JUMP_LABEL_TRUE_BRANCH 1UL | 84 | #define JUMP_LABEL_TYPE_FALSE_BRANCH 0UL |
85 | #define JUMP_LABEL_TYPE_TRUE_BRANCH 1UL | ||
86 | #define JUMP_LABEL_TYPE_MASK 1UL | ||
85 | 87 | ||
86 | static | 88 | static |
87 | inline struct jump_entry *jump_label_get_entries(struct static_key *key) | 89 | inline struct jump_entry *jump_label_get_entries(struct static_key *key) |
88 | { | 90 | { |
89 | return (struct jump_entry *)((unsigned long)key->entries | 91 | return (struct jump_entry *)((unsigned long)key->entries |
90 | & ~JUMP_LABEL_TRUE_BRANCH); | 92 | & ~JUMP_LABEL_TYPE_MASK); |
91 | } | 93 | } |
92 | 94 | ||
93 | static inline bool jump_label_get_branch_default(struct static_key *key) | 95 | static inline bool jump_label_get_branch_default(struct static_key *key) |
94 | { | 96 | { |
95 | if ((unsigned long)key->entries & JUMP_LABEL_TRUE_BRANCH) | 97 | if (((unsigned long)key->entries & JUMP_LABEL_TYPE_MASK) == |
98 | JUMP_LABEL_TYPE_TRUE_BRANCH) | ||
96 | return true; | 99 | return true; |
97 | return false; | 100 | return false; |
98 | } | 101 | } |
@@ -122,10 +125,12 @@ extern void static_key_slow_inc(struct static_key *key); | |||
122 | extern void static_key_slow_dec(struct static_key *key); | 125 | extern void static_key_slow_dec(struct static_key *key); |
123 | extern void jump_label_apply_nops(struct module *mod); | 126 | extern void jump_label_apply_nops(struct module *mod); |
124 | 127 | ||
125 | #define STATIC_KEY_INIT_TRUE ((struct static_key) \ | 128 | #define STATIC_KEY_INIT_TRUE ((struct static_key) \ |
126 | { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) | 129 | { .enabled = ATOMIC_INIT(1), \ |
127 | #define STATIC_KEY_INIT_FALSE ((struct static_key) \ | 130 | .entries = (void *)JUMP_LABEL_TYPE_TRUE_BRANCH }) |
128 | { .enabled = ATOMIC_INIT(0), .entries = (void *)0 }) | 131 | #define STATIC_KEY_INIT_FALSE ((struct static_key) \ |
132 | { .enabled = ATOMIC_INIT(0), \ | ||
133 | .entries = (void *)JUMP_LABEL_TYPE_FALSE_BRANCH }) | ||
129 | 134 | ||
130 | #else /* !HAVE_JUMP_LABEL */ | 135 | #else /* !HAVE_JUMP_LABEL */ |
131 | 136 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4e98d13eff4..2aa3d4b000e6 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -193,7 +193,8 @@ extern int _cond_resched(void); | |||
193 | (__x < 0) ? -__x : __x; \ | 193 | (__x < 0) ? -__x : __x; \ |
194 | }) | 194 | }) |
195 | 195 | ||
196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) | 196 | #if defined(CONFIG_MMU) && \ |
197 | (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) | ||
197 | void might_fault(void); | 198 | void might_fault(void); |
198 | #else | 199 | #else |
199 | static inline void might_fault(void) { } | 200 | static inline void might_fault(void) { } |
@@ -393,6 +394,15 @@ extern int panic_on_oops; | |||
393 | extern int panic_on_unrecovered_nmi; | 394 | extern int panic_on_unrecovered_nmi; |
394 | extern int panic_on_io_nmi; | 395 | extern int panic_on_io_nmi; |
395 | extern int sysctl_panic_on_stackoverflow; | 396 | extern int sysctl_panic_on_stackoverflow; |
397 | /* | ||
398 | * Only to be used by arch init code. If the user over-wrote the default | ||
399 | * CONFIG_PANIC_TIMEOUT, honor it. | ||
400 | */ | ||
401 | static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout) | ||
402 | { | ||
403 | if (panic_timeout == arch_default_timeout) | ||
404 | panic_timeout = timeout; | ||
405 | } | ||
396 | extern const char *print_tainted(void); | 406 | extern const char *print_tainted(void); |
397 | enum lockdep_ok { | 407 | enum lockdep_ok { |
398 | LOCKDEP_STILL_OK, | 408 | LOCKDEP_STILL_OK, |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h new file mode 100644 index 000000000000..5be9f0228a3b --- /dev/null +++ b/include/linux/kernfs.h | |||
@@ -0,0 +1,376 @@ | |||
1 | /* | ||
2 | * kernfs.h - pseudo filesystem decoupled from vfs locking | ||
3 | * | ||
4 | * This file is released under the GPLv2. | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_KERNFS_H | ||
8 | #define __LINUX_KERNFS_H | ||
9 | |||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/err.h> | ||
12 | #include <linux/list.h> | ||
13 | #include <linux/mutex.h> | ||
14 | #include <linux/idr.h> | ||
15 | #include <linux/lockdep.h> | ||
16 | #include <linux/rbtree.h> | ||
17 | #include <linux/atomic.h> | ||
18 | #include <linux/completion.h> | ||
19 | |||
20 | struct file; | ||
21 | struct dentry; | ||
22 | struct iattr; | ||
23 | struct seq_file; | ||
24 | struct vm_area_struct; | ||
25 | struct super_block; | ||
26 | struct file_system_type; | ||
27 | |||
28 | struct kernfs_open_node; | ||
29 | struct kernfs_iattrs; | ||
30 | |||
31 | enum kernfs_node_type { | ||
32 | KERNFS_DIR = 0x0001, | ||
33 | KERNFS_FILE = 0x0002, | ||
34 | KERNFS_LINK = 0x0004, | ||
35 | }; | ||
36 | |||
37 | #define KERNFS_TYPE_MASK 0x000f | ||
38 | #define KERNFS_ACTIVE_REF KERNFS_FILE | ||
39 | #define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK | ||
40 | |||
41 | enum kernfs_node_flag { | ||
42 | KERNFS_REMOVED = 0x0010, | ||
43 | KERNFS_NS = 0x0020, | ||
44 | KERNFS_HAS_SEQ_SHOW = 0x0040, | ||
45 | KERNFS_HAS_MMAP = 0x0080, | ||
46 | KERNFS_LOCKDEP = 0x0100, | ||
47 | KERNFS_STATIC_NAME = 0x0200, | ||
48 | }; | ||
49 | |||
50 | /* type-specific structures for kernfs_node union members */ | ||
51 | struct kernfs_elem_dir { | ||
52 | unsigned long subdirs; | ||
53 | /* children rbtree starts here and goes through kn->rb */ | ||
54 | struct rb_root children; | ||
55 | |||
56 | /* | ||
57 | * The kernfs hierarchy this directory belongs to. This fits | ||
58 | * better directly in kernfs_node but is here to save space. | ||
59 | */ | ||
60 | struct kernfs_root *root; | ||
61 | }; | ||
62 | |||
63 | struct kernfs_elem_symlink { | ||
64 | struct kernfs_node *target_kn; | ||
65 | }; | ||
66 | |||
67 | struct kernfs_elem_attr { | ||
68 | const struct kernfs_ops *ops; | ||
69 | struct kernfs_open_node *open; | ||
70 | loff_t size; | ||
71 | }; | ||
72 | |||
73 | /* | ||
74 | * kernfs_node - the building block of kernfs hierarchy. Each and every | ||
75 | * kernfs node is represented by single kernfs_node. Most fields are | ||
76 | * private to kernfs and shouldn't be accessed directly by kernfs users. | ||
77 | * | ||
78 | * As long as s_count reference is held, the kernfs_node itself is | ||
79 | * accessible. Dereferencing elem or any other outer entity requires | ||
80 | * active reference. | ||
81 | */ | ||
82 | struct kernfs_node { | ||
83 | atomic_t count; | ||
84 | atomic_t active; | ||
85 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
86 | struct lockdep_map dep_map; | ||
87 | #endif | ||
88 | /* the following two fields are published */ | ||
89 | struct kernfs_node *parent; | ||
90 | const char *name; | ||
91 | |||
92 | struct rb_node rb; | ||
93 | |||
94 | union { | ||
95 | struct completion *completion; | ||
96 | struct kernfs_node *removed_list; | ||
97 | } u; | ||
98 | |||
99 | const void *ns; /* namespace tag */ | ||
100 | unsigned int hash; /* ns + name hash */ | ||
101 | union { | ||
102 | struct kernfs_elem_dir dir; | ||
103 | struct kernfs_elem_symlink symlink; | ||
104 | struct kernfs_elem_attr attr; | ||
105 | }; | ||
106 | |||
107 | void *priv; | ||
108 | |||
109 | unsigned short flags; | ||
110 | umode_t mode; | ||
111 | unsigned int ino; | ||
112 | struct kernfs_iattrs *iattr; | ||
113 | }; | ||
114 | |||
115 | /* | ||
116 | * kernfs_dir_ops may be specified on kernfs_create_root() to support | ||
117 | * directory manipulation syscalls. These optional callbacks are invoked | ||
118 | * on the matching syscalls and can perform any kernfs operations which | ||
119 | * don't necessarily have to be the exact operation requested. | ||
120 | */ | ||
121 | struct kernfs_dir_ops { | ||
122 | int (*mkdir)(struct kernfs_node *parent, const char *name, | ||
123 | umode_t mode); | ||
124 | int (*rmdir)(struct kernfs_node *kn); | ||
125 | int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent, | ||
126 | const char *new_name); | ||
127 | }; | ||
128 | |||
129 | struct kernfs_root { | ||
130 | /* published fields */ | ||
131 | struct kernfs_node *kn; | ||
132 | |||
133 | /* private fields, do not use outside kernfs proper */ | ||
134 | struct ida ino_ida; | ||
135 | struct kernfs_dir_ops *dir_ops; | ||
136 | }; | ||
137 | |||
138 | struct kernfs_open_file { | ||
139 | /* published fields */ | ||
140 | struct kernfs_node *kn; | ||
141 | struct file *file; | ||
142 | |||
143 | /* private fields, do not use outside kernfs proper */ | ||
144 | struct mutex mutex; | ||
145 | int event; | ||
146 | struct list_head list; | ||
147 | |||
148 | bool mmapped; | ||
149 | const struct vm_operations_struct *vm_ops; | ||
150 | }; | ||
151 | |||
152 | struct kernfs_ops { | ||
153 | /* | ||
154 | * Read is handled by either seq_file or raw_read(). | ||
155 | * | ||
156 | * If seq_show() is present, seq_file path is active. Other seq | ||
157 | * operations are optional and if not implemented, the behavior is | ||
158 | * equivalent to single_open(). @sf->private points to the | ||
159 | * associated kernfs_open_file. | ||
160 | * | ||
161 | * read() is bounced through kernel buffer and a read larger than | ||
162 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
163 | */ | ||
164 | int (*seq_show)(struct seq_file *sf, void *v); | ||
165 | |||
166 | void *(*seq_start)(struct seq_file *sf, loff_t *ppos); | ||
167 | void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos); | ||
168 | void (*seq_stop)(struct seq_file *sf, void *v); | ||
169 | |||
170 | ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes, | ||
171 | loff_t off); | ||
172 | |||
173 | /* | ||
174 | * write() is bounced through kernel buffer and a write larger than | ||
175 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
176 | */ | ||
177 | ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes, | ||
178 | loff_t off); | ||
179 | |||
180 | int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); | ||
181 | |||
182 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
183 | struct lock_class_key lockdep_key; | ||
184 | #endif | ||
185 | }; | ||
186 | |||
187 | #ifdef CONFIG_SYSFS | ||
188 | |||
189 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | ||
190 | { | ||
191 | return kn->flags & KERNFS_TYPE_MASK; | ||
192 | } | ||
193 | |||
194 | /** | ||
195 | * kernfs_enable_ns - enable namespace under a directory | ||
196 | * @kn: directory of interest, should be empty | ||
197 | * | ||
198 | * This is to be called right after @kn is created to enable namespace | ||
199 | * under it. All children of @kn must have non-NULL namespace tags and | ||
200 | * only the ones which match the super_block's tag will be visible. | ||
201 | */ | ||
202 | static inline void kernfs_enable_ns(struct kernfs_node *kn) | ||
203 | { | ||
204 | WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR); | ||
205 | WARN_ON_ONCE(!RB_EMPTY_ROOT(&kn->dir.children)); | ||
206 | kn->flags |= KERNFS_NS; | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * kernfs_ns_enabled - test whether namespace is enabled | ||
211 | * @kn: the node to test | ||
212 | * | ||
213 | * Test whether namespace filtering is enabled for the children of @ns. | ||
214 | */ | ||
215 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | ||
216 | { | ||
217 | return kn->flags & KERNFS_NS; | ||
218 | } | ||
219 | |||
220 | struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, | ||
221 | const char *name, const void *ns); | ||
222 | void kernfs_get(struct kernfs_node *kn); | ||
223 | void kernfs_put(struct kernfs_node *kn); | ||
224 | |||
225 | struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops, | ||
226 | void *priv); | ||
227 | void kernfs_destroy_root(struct kernfs_root *root); | ||
228 | |||
229 | struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, | ||
230 | const char *name, umode_t mode, | ||
231 | void *priv, const void *ns); | ||
232 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, | ||
233 | const char *name, | ||
234 | umode_t mode, loff_t size, | ||
235 | const struct kernfs_ops *ops, | ||
236 | void *priv, const void *ns, | ||
237 | bool name_is_static, | ||
238 | struct lock_class_key *key); | ||
239 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, | ||
240 | const char *name, | ||
241 | struct kernfs_node *target); | ||
242 | void kernfs_remove(struct kernfs_node *kn); | ||
243 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, | ||
244 | const void *ns); | ||
245 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | ||
246 | const char *new_name, const void *new_ns); | ||
247 | int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr); | ||
248 | void kernfs_notify(struct kernfs_node *kn); | ||
249 | |||
250 | const void *kernfs_super_ns(struct super_block *sb); | ||
251 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | ||
252 | struct kernfs_root *root, const void *ns); | ||
253 | void kernfs_kill_sb(struct super_block *sb); | ||
254 | |||
255 | void kernfs_init(void); | ||
256 | |||
257 | #else /* CONFIG_SYSFS */ | ||
258 | |||
259 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | ||
260 | { return 0; } /* whatever */ | ||
261 | |||
262 | static inline void kernfs_enable_ns(struct kernfs_node *kn) { } | ||
263 | |||
264 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | ||
265 | { return false; } | ||
266 | |||
267 | static inline struct kernfs_node * | ||
268 | kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name, | ||
269 | const void *ns) | ||
270 | { return NULL; } | ||
271 | |||
272 | static inline void kernfs_get(struct kernfs_node *kn) { } | ||
273 | static inline void kernfs_put(struct kernfs_node *kn) { } | ||
274 | |||
275 | static inline struct kernfs_root * | ||
276 | kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv) | ||
277 | { return ERR_PTR(-ENOSYS); } | ||
278 | |||
279 | static inline void kernfs_destroy_root(struct kernfs_root *root) { } | ||
280 | |||
281 | static inline struct kernfs_node * | ||
282 | kernfs_create_dir_ns(struct kernfs_node *parent, const char *name, | ||
283 | umode_t mode, void *priv, const void *ns) | ||
284 | { return ERR_PTR(-ENOSYS); } | ||
285 | |||
286 | static inline struct kernfs_node * | ||
287 | __kernfs_create_file(struct kernfs_node *parent, const char *name, | ||
288 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | ||
289 | void *priv, const void *ns, bool name_is_static, | ||
290 | struct lock_class_key *key) | ||
291 | { return ERR_PTR(-ENOSYS); } | ||
292 | |||
293 | static inline struct kernfs_node * | ||
294 | kernfs_create_link(struct kernfs_node *parent, const char *name, | ||
295 | struct kernfs_node *target) | ||
296 | { return ERR_PTR(-ENOSYS); } | ||
297 | |||
298 | static inline void kernfs_remove(struct kernfs_node *kn) { } | ||
299 | |||
300 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, | ||
301 | const char *name, const void *ns) | ||
302 | { return -ENOSYS; } | ||
303 | |||
304 | static inline int kernfs_rename_ns(struct kernfs_node *kn, | ||
305 | struct kernfs_node *new_parent, | ||
306 | const char *new_name, const void *new_ns) | ||
307 | { return -ENOSYS; } | ||
308 | |||
309 | static inline int kernfs_setattr(struct kernfs_node *kn, | ||
310 | const struct iattr *iattr) | ||
311 | { return -ENOSYS; } | ||
312 | |||
313 | static inline void kernfs_notify(struct kernfs_node *kn) { } | ||
314 | |||
315 | static inline const void *kernfs_super_ns(struct super_block *sb) | ||
316 | { return NULL; } | ||
317 | |||
318 | static inline struct dentry * | ||
319 | kernfs_mount_ns(struct file_system_type *fs_type, int flags, | ||
320 | struct kernfs_root *root, const void *ns) | ||
321 | { return ERR_PTR(-ENOSYS); } | ||
322 | |||
323 | static inline void kernfs_kill_sb(struct super_block *sb) { } | ||
324 | |||
325 | static inline void kernfs_init(void) { } | ||
326 | |||
327 | #endif /* CONFIG_SYSFS */ | ||
328 | |||
329 | static inline struct kernfs_node * | ||
330 | kernfs_find_and_get(struct kernfs_node *kn, const char *name) | ||
331 | { | ||
332 | return kernfs_find_and_get_ns(kn, name, NULL); | ||
333 | } | ||
334 | |||
335 | static inline struct kernfs_node * | ||
336 | kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode, | ||
337 | void *priv) | ||
338 | { | ||
339 | return kernfs_create_dir_ns(parent, name, mode, priv, NULL); | ||
340 | } | ||
341 | |||
342 | static inline struct kernfs_node * | ||
343 | kernfs_create_file_ns(struct kernfs_node *parent, const char *name, | ||
344 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | ||
345 | void *priv, const void *ns) | ||
346 | { | ||
347 | struct lock_class_key *key = NULL; | ||
348 | |||
349 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
350 | key = (struct lock_class_key *)&ops->lockdep_key; | ||
351 | #endif | ||
352 | return __kernfs_create_file(parent, name, mode, size, ops, priv, ns, | ||
353 | false, key); | ||
354 | } | ||
355 | |||
356 | static inline struct kernfs_node * | ||
357 | kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode, | ||
358 | loff_t size, const struct kernfs_ops *ops, void *priv) | ||
359 | { | ||
360 | return kernfs_create_file_ns(parent, name, mode, size, ops, priv, NULL); | ||
361 | } | ||
362 | |||
363 | static inline int kernfs_remove_by_name(struct kernfs_node *parent, | ||
364 | const char *name) | ||
365 | { | ||
366 | return kernfs_remove_by_name_ns(parent, name, NULL); | ||
367 | } | ||
368 | |||
369 | static inline struct dentry * | ||
370 | kernfs_mount(struct file_system_type *fs_type, int flags, | ||
371 | struct kernfs_root *root) | ||
372 | { | ||
373 | return kernfs_mount_ns(fs_type, flags, root, NULL); | ||
374 | } | ||
375 | |||
376 | #endif /* __LINUX_KERNFS_H */ | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d78d28a733b1..5fd33dc1fe3a 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -198,6 +198,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
198 | extern size_t vmcoreinfo_size; | 198 | extern size_t vmcoreinfo_size; |
199 | extern size_t vmcoreinfo_max_size; | 199 | extern size_t vmcoreinfo_max_size; |
200 | 200 | ||
201 | /* flag to track if kexec reboot is in progress */ | ||
202 | extern bool kexec_in_progress; | ||
203 | |||
201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 204 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
202 | unsigned long long *crash_size, unsigned long long *crash_base); | 205 | unsigned long long *crash_size, unsigned long long *crash_base); |
203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | 206 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, |
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h deleted file mode 100644 index a428f6436063..000000000000 --- a/include/linux/kobj_completion.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #ifndef _KOBJ_COMPLETION_H_ | ||
2 | #define _KOBJ_COMPLETION_H_ | ||
3 | |||
4 | #include <linux/kobject.h> | ||
5 | #include <linux/completion.h> | ||
6 | |||
7 | struct kobj_completion { | ||
8 | struct kobject kc_kobj; | ||
9 | struct completion kc_unregister; | ||
10 | }; | ||
11 | |||
12 | #define kobj_to_kobj_completion(kobj) \ | ||
13 | container_of(kobj, struct kobj_completion, kc_kobj) | ||
14 | |||
15 | void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype); | ||
16 | void kobj_completion_release(struct kobject *kobj); | ||
17 | void kobj_completion_del_and_wait(struct kobj_completion *kc); | ||
18 | #endif /* _KOBJ_COMPLETION_H_ */ | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e7ba650086ce..926afb6f6b5f 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -64,7 +64,7 @@ struct kobject { | |||
64 | struct kobject *parent; | 64 | struct kobject *parent; |
65 | struct kset *kset; | 65 | struct kset *kset; |
66 | struct kobj_type *ktype; | 66 | struct kobj_type *ktype; |
67 | struct sysfs_dirent *sd; | 67 | struct kernfs_node *sd; |
68 | struct kref kref; | 68 | struct kref kref; |
69 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE | 69 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE |
70 | struct delayed_work release; | 70 | struct delayed_work release; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 0e23c26485f4..9b503376738f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -418,6 +418,7 @@ enum { | |||
418 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | 418 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
419 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ | 419 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ |
420 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ | 420 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ |
421 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ | ||
421 | 422 | ||
422 | /* DMA mask for user DMA control: User visible values; DO NOT | 423 | /* DMA mask for user DMA control: User visible values; DO NOT |
423 | renumber */ | 424 | renumber */ |
diff --git a/include/linux/lockref.h b/include/linux/lockref.h index c8929c3832db..4bfde0e99ed5 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | #define USE_CMPXCHG_LOCKREF \ | 20 | #define USE_CMPXCHG_LOCKREF \ |
21 | (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ | 21 | (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ |
22 | IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS) | 22 | IS_ENABLED(CONFIG_SMP) && SPINLOCK_SIZE <= 4) |
23 | 23 | ||
24 | struct lockref { | 24 | struct lockref { |
25 | union { | 25 | union { |
diff --git a/include/linux/math64.h b/include/linux/math64.h index 69ed5f5e9f6e..c45c089bfdac 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
@@ -133,4 +133,34 @@ __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) | |||
133 | return ret; | 133 | return ret; |
134 | } | 134 | } |
135 | 135 | ||
136 | #if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__) | ||
137 | |||
138 | #ifndef mul_u64_u32_shr | ||
139 | static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) | ||
140 | { | ||
141 | return (u64)(((unsigned __int128)a * mul) >> shift); | ||
142 | } | ||
143 | #endif /* mul_u64_u32_shr */ | ||
144 | |||
145 | #else | ||
146 | |||
147 | #ifndef mul_u64_u32_shr | ||
148 | static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) | ||
149 | { | ||
150 | u32 ah, al; | ||
151 | u64 ret; | ||
152 | |||
153 | al = a; | ||
154 | ah = a >> 32; | ||
155 | |||
156 | ret = ((u64)al * mul) >> shift; | ||
157 | if (ah) | ||
158 | ret += ((u64)ah * mul) << (32 - shift); | ||
159 | |||
160 | return ret; | ||
161 | } | ||
162 | #endif /* mul_u64_u32_shr */ | ||
163 | |||
164 | #endif | ||
165 | |||
136 | #endif /* _LINUX_MATH64_H */ | 166 | #endif /* _LINUX_MATH64_H */ |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 9a6bbf76452d..bb7384e3c3d8 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -35,6 +35,7 @@ struct memory_block { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | int arch_get_memory_phys_device(unsigned long start_pfn); | 37 | int arch_get_memory_phys_device(unsigned long start_pfn); |
38 | unsigned long __weak memory_block_size_bytes(void); | ||
38 | 39 | ||
39 | /* These states are exposed to userspace as text strings in sysfs */ | 40 | /* These states are exposed to userspace as text strings in sysfs */ |
40 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ | 41 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ |
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h deleted file mode 100644 index 172b2f201ae0..000000000000 --- a/include/linux/mfd/abx500/ab8500-gpio.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright ST-Ericsson 2010. | ||
3 | * | ||
4 | * Author: Bibek Basu <bibek.basu@stericsson.com> | ||
5 | * Licensed under GPLv2. | ||
6 | */ | ||
7 | |||
8 | #ifndef _AB8500_GPIO_H | ||
9 | #define _AB8500_GPIO_H | ||
10 | |||
11 | /* | ||
12 | * Platform data to register a block: only the initial gpio/irq number. | ||
13 | * Array sizes are large enough to contain all AB8500 and AB9540 GPIO | ||
14 | * registers. | ||
15 | */ | ||
16 | |||
17 | struct abx500_gpio_platform_data { | ||
18 | int gpio_base; | ||
19 | }; | ||
20 | |||
21 | enum abx500_gpio_pull_updown { | ||
22 | ABX500_GPIO_PULL_DOWN = 0x0, | ||
23 | ABX500_GPIO_PULL_NONE = 0x1, | ||
24 | ABX500_GPIO_PULL_UP = 0x3, | ||
25 | }; | ||
26 | |||
27 | enum abx500_gpio_vinsel { | ||
28 | ABX500_GPIO_VINSEL_VBAT = 0x0, | ||
29 | ABX500_GPIO_VINSEL_VIN_1V8 = 0x1, | ||
30 | ABX500_GPIO_VINSEL_VDD_BIF = 0x2, | ||
31 | }; | ||
32 | |||
33 | #endif /* _AB8500_GPIO_H */ | ||
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index f4acd898dac9..a86ca1406fb8 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -368,7 +368,6 @@ struct ab8500 { | |||
368 | }; | 368 | }; |
369 | 369 | ||
370 | struct ab8500_regulator_platform_data; | 370 | struct ab8500_regulator_platform_data; |
371 | struct ab8500_gpio_platform_data; | ||
372 | struct ab8500_codec_platform_data; | 371 | struct ab8500_codec_platform_data; |
373 | struct ab8500_sysctrl_platform_data; | 372 | struct ab8500_sysctrl_platform_data; |
374 | 373 | ||
@@ -382,7 +381,6 @@ struct ab8500_platform_data { | |||
382 | int irq_base; | 381 | int irq_base; |
383 | void (*init) (struct ab8500 *); | 382 | void (*init) (struct ab8500 *); |
384 | struct ab8500_regulator_platform_data *regulator; | 383 | struct ab8500_regulator_platform_data *regulator; |
385 | struct abx500_gpio_platform_data *gpio; | ||
386 | struct ab8500_codec_platform_data *codec; | 384 | struct ab8500_codec_platform_data *codec; |
387 | struct ab8500_sysctrl_platform_data *sysctrl; | 385 | struct ab8500_sysctrl_platform_data *sysctrl; |
388 | }; | 386 | }; |
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index cb49417f8ba9..fdf3aa376eb2 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
@@ -139,6 +139,7 @@ | |||
139 | #define ARIZONA_INPUT_ENABLES_STATUS 0x301 | 139 | #define ARIZONA_INPUT_ENABLES_STATUS 0x301 |
140 | #define ARIZONA_INPUT_RATE 0x308 | 140 | #define ARIZONA_INPUT_RATE 0x308 |
141 | #define ARIZONA_INPUT_VOLUME_RAMP 0x309 | 141 | #define ARIZONA_INPUT_VOLUME_RAMP 0x309 |
142 | #define ARIZONA_HPF_CONTROL 0x30C | ||
142 | #define ARIZONA_IN1L_CONTROL 0x310 | 143 | #define ARIZONA_IN1L_CONTROL 0x310 |
143 | #define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 | 144 | #define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 |
144 | #define ARIZONA_DMIC1L_CONTROL 0x312 | 145 | #define ARIZONA_DMIC1L_CONTROL 0x312 |
@@ -160,6 +161,7 @@ | |||
160 | #define ARIZONA_IN4L_CONTROL 0x328 | 161 | #define ARIZONA_IN4L_CONTROL 0x328 |
161 | #define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 | 162 | #define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 |
162 | #define ARIZONA_DMIC4L_CONTROL 0x32A | 163 | #define ARIZONA_DMIC4L_CONTROL 0x32A |
164 | #define ARIZONA_IN4R_CONTROL 0x32C | ||
163 | #define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D | 165 | #define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D |
164 | #define ARIZONA_DMIC4R_CONTROL 0x32E | 166 | #define ARIZONA_DMIC4R_CONTROL 0x32E |
165 | #define ARIZONA_OUTPUT_ENABLES_1 0x400 | 167 | #define ARIZONA_OUTPUT_ENABLES_1 0x400 |
@@ -224,6 +226,9 @@ | |||
224 | #define ARIZONA_PDM_SPK1_CTRL_2 0x491 | 226 | #define ARIZONA_PDM_SPK1_CTRL_2 0x491 |
225 | #define ARIZONA_PDM_SPK2_CTRL_1 0x492 | 227 | #define ARIZONA_PDM_SPK2_CTRL_1 0x492 |
226 | #define ARIZONA_PDM_SPK2_CTRL_2 0x493 | 228 | #define ARIZONA_PDM_SPK2_CTRL_2 0x493 |
229 | #define ARIZONA_HP1_SHORT_CIRCUIT_CTRL 0x4A0 | ||
230 | #define ARIZONA_HP2_SHORT_CIRCUIT_CTRL 0x4A1 | ||
231 | #define ARIZONA_HP3_SHORT_CIRCUIT_CTRL 0x4A2 | ||
227 | #define ARIZONA_SPK_CTRL_2 0x4B5 | 232 | #define ARIZONA_SPK_CTRL_2 0x4B5 |
228 | #define ARIZONA_SPK_CTRL_3 0x4B6 | 233 | #define ARIZONA_SPK_CTRL_3 0x4B6 |
229 | #define ARIZONA_DAC_COMP_1 0x4DC | 234 | #define ARIZONA_DAC_COMP_1 0x4DC |
@@ -511,6 +516,38 @@ | |||
511 | #define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D | 516 | #define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D |
512 | #define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E | 517 | #define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E |
513 | #define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F | 518 | #define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F |
519 | #define ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE 0x750 | ||
520 | #define ARIZONA_AIF2TX3MIX_INPUT_1_VOLUME 0x751 | ||
521 | #define ARIZONA_AIF2TX3MIX_INPUT_2_SOURCE 0x752 | ||
522 | #define ARIZONA_AIF2TX3MIX_INPUT_2_VOLUME 0x753 | ||
523 | #define ARIZONA_AIF2TX3MIX_INPUT_3_SOURCE 0x754 | ||
524 | #define ARIZONA_AIF2TX3MIX_INPUT_3_VOLUME 0x755 | ||
525 | #define ARIZONA_AIF2TX3MIX_INPUT_4_SOURCE 0x756 | ||
526 | #define ARIZONA_AIF2TX3MIX_INPUT_4_VOLUME 0x757 | ||
527 | #define ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE 0x758 | ||
528 | #define ARIZONA_AIF2TX4MIX_INPUT_1_VOLUME 0x759 | ||
529 | #define ARIZONA_AIF2TX4MIX_INPUT_2_SOURCE 0x75A | ||
530 | #define ARIZONA_AIF2TX4MIX_INPUT_2_VOLUME 0x75B | ||
531 | #define ARIZONA_AIF2TX4MIX_INPUT_3_SOURCE 0x75C | ||
532 | #define ARIZONA_AIF2TX4MIX_INPUT_3_VOLUME 0x75D | ||
533 | #define ARIZONA_AIF2TX4MIX_INPUT_4_SOURCE 0x75E | ||
534 | #define ARIZONA_AIF2TX4MIX_INPUT_4_VOLUME 0x75F | ||
535 | #define ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE 0x760 | ||
536 | #define ARIZONA_AIF2TX5MIX_INPUT_1_VOLUME 0x761 | ||
537 | #define ARIZONA_AIF2TX5MIX_INPUT_2_SOURCE 0x762 | ||
538 | #define ARIZONA_AIF2TX5MIX_INPUT_2_VOLUME 0x763 | ||
539 | #define ARIZONA_AIF2TX5MIX_INPUT_3_SOURCE 0x764 | ||
540 | #define ARIZONA_AIF2TX5MIX_INPUT_3_VOLUME 0x765 | ||
541 | #define ARIZONA_AIF2TX5MIX_INPUT_4_SOURCE 0x766 | ||
542 | #define ARIZONA_AIF2TX5MIX_INPUT_4_VOLUME 0x767 | ||
543 | #define ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE 0x768 | ||
544 | #define ARIZONA_AIF2TX6MIX_INPUT_1_VOLUME 0x769 | ||
545 | #define ARIZONA_AIF2TX6MIX_INPUT_2_SOURCE 0x76A | ||
546 | #define ARIZONA_AIF2TX6MIX_INPUT_2_VOLUME 0x76B | ||
547 | #define ARIZONA_AIF2TX6MIX_INPUT_3_SOURCE 0x76C | ||
548 | #define ARIZONA_AIF2TX6MIX_INPUT_3_VOLUME 0x76D | ||
549 | #define ARIZONA_AIF2TX6MIX_INPUT_4_SOURCE 0x76E | ||
550 | #define ARIZONA_AIF2TX6MIX_INPUT_4_VOLUME 0x76F | ||
514 | #define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 | 551 | #define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 |
515 | #define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 | 552 | #define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 |
516 | #define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 | 553 | #define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 |
@@ -2196,6 +2233,15 @@ | |||
2196 | /* | 2233 | /* |
2197 | * R677 (0x2A5) - Mic Detect 3 | 2234 | * R677 (0x2A5) - Mic Detect 3 |
2198 | */ | 2235 | */ |
2236 | #define ARIZONA_MICD_LVL_0 0x0004 /* MICD_LVL - [2] */ | ||
2237 | #define ARIZONA_MICD_LVL_1 0x0008 /* MICD_LVL - [3] */ | ||
2238 | #define ARIZONA_MICD_LVL_2 0x0010 /* MICD_LVL - [4] */ | ||
2239 | #define ARIZONA_MICD_LVL_3 0x0020 /* MICD_LVL - [5] */ | ||
2240 | #define ARIZONA_MICD_LVL_4 0x0040 /* MICD_LVL - [6] */ | ||
2241 | #define ARIZONA_MICD_LVL_5 0x0080 /* MICD_LVL - [7] */ | ||
2242 | #define ARIZONA_MICD_LVL_6 0x0100 /* MICD_LVL - [8] */ | ||
2243 | #define ARIZONA_MICD_LVL_7 0x0200 /* MICD_LVL - [9] */ | ||
2244 | #define ARIZONA_MICD_LVL_8 0x0400 /* MICD_LVL - [10] */ | ||
2199 | #define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ | 2245 | #define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ |
2200 | #define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ | 2246 | #define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ |
2201 | #define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ | 2247 | #define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ |
@@ -2293,8 +2339,18 @@ | |||
2293 | #define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ | 2339 | #define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ |
2294 | 2340 | ||
2295 | /* | 2341 | /* |
2342 | * R780 (0x30C) - HPF Control | ||
2343 | */ | ||
2344 | #define ARIZONA_IN_HPF_CUT_MASK 0x0007 /* IN_HPF_CUT [2:0] */ | ||
2345 | #define ARIZONA_IN_HPF_CUT_SHIFT 0 /* IN_HPF_CUT [2:0] */ | ||
2346 | #define ARIZONA_IN_HPF_CUT_WIDTH 3 /* IN_HPF_CUT [2:0] */ | ||
2347 | |||
2348 | /* | ||
2296 | * R784 (0x310) - IN1L Control | 2349 | * R784 (0x310) - IN1L Control |
2297 | */ | 2350 | */ |
2351 | #define ARIZONA_IN1L_HPF_MASK 0x8000 /* IN1L_HPF - [15] */ | ||
2352 | #define ARIZONA_IN1L_HPF_SHIFT 15 /* IN1L_HPF - [15] */ | ||
2353 | #define ARIZONA_IN1L_HPF_WIDTH 1 /* IN1L_HPF - [15] */ | ||
2298 | #define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ | 2354 | #define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ |
2299 | #define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ | 2355 | #define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ |
2300 | #define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ | 2356 | #define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ |
@@ -2333,6 +2389,9 @@ | |||
2333 | /* | 2389 | /* |
2334 | * R788 (0x314) - IN1R Control | 2390 | * R788 (0x314) - IN1R Control |
2335 | */ | 2391 | */ |
2392 | #define ARIZONA_IN1R_HPF_MASK 0x8000 /* IN1R_HPF - [15] */ | ||
2393 | #define ARIZONA_IN1R_HPF_SHIFT 15 /* IN1R_HPF - [15] */ | ||
2394 | #define ARIZONA_IN1R_HPF_WIDTH 1 /* IN1R_HPF - [15] */ | ||
2336 | #define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ | 2395 | #define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ |
2337 | #define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ | 2396 | #define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ |
2338 | #define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ | 2397 | #define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ |
@@ -2362,6 +2421,9 @@ | |||
2362 | /* | 2421 | /* |
2363 | * R792 (0x318) - IN2L Control | 2422 | * R792 (0x318) - IN2L Control |
2364 | */ | 2423 | */ |
2424 | #define ARIZONA_IN2L_HPF_MASK 0x8000 /* IN2L_HPF - [15] */ | ||
2425 | #define ARIZONA_IN2L_HPF_SHIFT 15 /* IN2L_HPF - [15] */ | ||
2426 | #define ARIZONA_IN2L_HPF_WIDTH 1 /* IN2L_HPF - [15] */ | ||
2365 | #define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ | 2427 | #define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ |
2366 | #define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ | 2428 | #define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ |
2367 | #define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ | 2429 | #define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ |
@@ -2400,6 +2462,9 @@ | |||
2400 | /* | 2462 | /* |
2401 | * R796 (0x31C) - IN2R Control | 2463 | * R796 (0x31C) - IN2R Control |
2402 | */ | 2464 | */ |
2465 | #define ARIZONA_IN2R_HPF_MASK 0x8000 /* IN2R_HPF - [15] */ | ||
2466 | #define ARIZONA_IN2R_HPF_SHIFT 15 /* IN2R_HPF - [15] */ | ||
2467 | #define ARIZONA_IN2R_HPF_WIDTH 1 /* IN2R_HPF - [15] */ | ||
2403 | #define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ | 2468 | #define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ |
2404 | #define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ | 2469 | #define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ |
2405 | #define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ | 2470 | #define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ |
@@ -2429,6 +2494,9 @@ | |||
2429 | /* | 2494 | /* |
2430 | * R800 (0x320) - IN3L Control | 2495 | * R800 (0x320) - IN3L Control |
2431 | */ | 2496 | */ |
2497 | #define ARIZONA_IN3L_HPF_MASK 0x8000 /* IN3L_HPF - [15] */ | ||
2498 | #define ARIZONA_IN3L_HPF_SHIFT 15 /* IN3L_HPF - [15] */ | ||
2499 | #define ARIZONA_IN3L_HPF_WIDTH 1 /* IN3L_HPF - [15] */ | ||
2432 | #define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ | 2500 | #define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ |
2433 | #define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ | 2501 | #define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ |
2434 | #define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ | 2502 | #define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ |
@@ -2467,6 +2535,9 @@ | |||
2467 | /* | 2535 | /* |
2468 | * R804 (0x324) - IN3R Control | 2536 | * R804 (0x324) - IN3R Control |
2469 | */ | 2537 | */ |
2538 | #define ARIZONA_IN3R_HPF_MASK 0x8000 /* IN3R_HPF - [15] */ | ||
2539 | #define ARIZONA_IN3R_HPF_SHIFT 15 /* IN3R_HPF - [15] */ | ||
2540 | #define ARIZONA_IN3R_HPF_WIDTH 1 /* IN3R_HPF - [15] */ | ||
2470 | #define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ | 2541 | #define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ |
2471 | #define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ | 2542 | #define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ |
2472 | #define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ | 2543 | #define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ |
@@ -2496,6 +2567,9 @@ | |||
2496 | /* | 2567 | /* |
2497 | * R808 (0x328) - IN4 Control | 2568 | * R808 (0x328) - IN4 Control |
2498 | */ | 2569 | */ |
2570 | #define ARIZONA_IN4L_HPF_MASK 0x8000 /* IN4L_HPF - [15] */ | ||
2571 | #define ARIZONA_IN4L_HPF_SHIFT 15 /* IN4L_HPF - [15] */ | ||
2572 | #define ARIZONA_IN4L_HPF_WIDTH 1 /* IN4L_HPF - [15] */ | ||
2499 | #define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ | 2573 | #define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ |
2500 | #define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ | 2574 | #define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ |
2501 | #define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ | 2575 | #define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ |
@@ -2526,6 +2600,13 @@ | |||
2526 | #define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ | 2600 | #define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ |
2527 | 2601 | ||
2528 | /* | 2602 | /* |
2603 | * R812 (0x32C) - IN4R Control | ||
2604 | */ | ||
2605 | #define ARIZONA_IN4R_HPF_MASK 0x8000 /* IN4R_HPF - [15] */ | ||
2606 | #define ARIZONA_IN4R_HPF_SHIFT 15 /* IN4R_HPF - [15] */ | ||
2607 | #define ARIZONA_IN4R_HPF_WIDTH 1 /* IN4R_HPF - [15] */ | ||
2608 | |||
2609 | /* | ||
2529 | * R813 (0x32D) - ADC Digital Volume 4R | 2610 | * R813 (0x32D) - ADC Digital Volume 4R |
2530 | */ | 2611 | */ |
2531 | #define ARIZONA_IN_VU 0x0200 /* IN_VU */ | 2612 | #define ARIZONA_IN_VU 0x0200 /* IN_VU */ |
@@ -3138,6 +3219,10 @@ | |||
3138 | /* | 3219 | /* |
3139 | * R1088 (0x440) - DRE Enable | 3220 | * R1088 (0x440) - DRE Enable |
3140 | */ | 3221 | */ |
3222 | #define ARIZONA_DRE3R_ENA 0x0020 /* DRE3R_ENA */ | ||
3223 | #define ARIZONA_DRE3R_ENA_MASK 0x0020 /* DRE3R_ENA */ | ||
3224 | #define ARIZONA_DRE3R_ENA_SHIFT 5 /* DRE3R_ENA */ | ||
3225 | #define ARIZONA_DRE3R_ENA_WIDTH 1 /* DRE3R_ENA */ | ||
3141 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ | 3226 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ |
3142 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ | 3227 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ |
3143 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ | 3228 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ |
@@ -3260,6 +3345,30 @@ | |||
3260 | #define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ | 3345 | #define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ |
3261 | 3346 | ||
3262 | /* | 3347 | /* |
3348 | * R1184 (0x4A0) - HP1 Short Circuit Ctrl | ||
3349 | */ | ||
3350 | #define ARIZONA_HP1_SC_ENA 0x1000 /* HP1_SC_ENA */ | ||
3351 | #define ARIZONA_HP1_SC_ENA_MASK 0x1000 /* HP1_SC_ENA */ | ||
3352 | #define ARIZONA_HP1_SC_ENA_SHIFT 12 /* HP1_SC_ENA */ | ||
3353 | #define ARIZONA_HP1_SC_ENA_WIDTH 1 /* HP1_SC_ENA */ | ||
3354 | |||
3355 | /* | ||
3356 | * R1185 (0x4A1) - HP2 Short Circuit Ctrl | ||
3357 | */ | ||
3358 | #define ARIZONA_HP2_SC_ENA 0x1000 /* HP2_SC_ENA */ | ||
3359 | #define ARIZONA_HP2_SC_ENA_MASK 0x1000 /* HP2_SC_ENA */ | ||
3360 | #define ARIZONA_HP2_SC_ENA_SHIFT 12 /* HP2_SC_ENA */ | ||
3361 | #define ARIZONA_HP2_SC_ENA_WIDTH 1 /* HP2_SC_ENA */ | ||
3362 | |||
3363 | /* | ||
3364 | * R1186 (0x4A2) - HP3 Short Circuit Ctrl | ||
3365 | */ | ||
3366 | #define ARIZONA_HP3_SC_ENA 0x1000 /* HP3_SC_ENA */ | ||
3367 | #define ARIZONA_HP3_SC_ENA_MASK 0x1000 /* HP3_SC_ENA */ | ||
3368 | #define ARIZONA_HP3_SC_ENA_SHIFT 12 /* HP3_SC_ENA */ | ||
3369 | #define ARIZONA_HP3_SC_ENA_WIDTH 1 /* HP3_SC_ENA */ | ||
3370 | |||
3371 | /* | ||
3263 | * R1244 (0x4DC) - DAC comp 1 | 3372 | * R1244 (0x4DC) - DAC comp 1 |
3264 | */ | 3373 | */ |
3265 | #define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ | 3374 | #define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ |
@@ -3726,6 +3835,35 @@ | |||
3726 | #define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ | 3835 | #define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ |
3727 | 3836 | ||
3728 | /* | 3837 | /* |
3838 | * R1355 (0x54B) - AIF2 Frame Ctrl 5 | ||
3839 | */ | ||
3840 | #define ARIZONA_AIF2TX3_SLOT_MASK 0x003F /* AIF2TX3_SLOT - [5:0] */ | ||
3841 | #define ARIZONA_AIF2TX3_SLOT_SHIFT 0 /* AIF2TX3_SLOT - [5:0] */ | ||
3842 | #define ARIZONA_AIF2TX3_SLOT_WIDTH 6 /* AIF2TX3_SLOT - [5:0] */ | ||
3843 | |||
3844 | /* | ||
3845 | * R1356 (0x54C) - AIF2 Frame Ctrl 6 | ||
3846 | */ | ||
3847 | #define ARIZONA_AIF2TX4_SLOT_MASK 0x003F /* AIF2TX4_SLOT - [5:0] */ | ||
3848 | #define ARIZONA_AIF2TX4_SLOT_SHIFT 0 /* AIF2TX4_SLOT - [5:0] */ | ||
3849 | #define ARIZONA_AIF2TX4_SLOT_WIDTH 6 /* AIF2TX4_SLOT - [5:0] */ | ||
3850 | |||
3851 | |||
3852 | /* | ||
3853 | * R1357 (0x54D) - AIF2 Frame Ctrl 7 | ||
3854 | */ | ||
3855 | #define ARIZONA_AIF2TX5_SLOT_MASK 0x003F /* AIF2TX5_SLOT - [5:0] */ | ||
3856 | #define ARIZONA_AIF2TX5_SLOT_SHIFT 0 /* AIF2TX5_SLOT - [5:0] */ | ||
3857 | #define ARIZONA_AIF2TX5_SLOT_WIDTH 6 /* AIF2TX5_SLOT - [5:0] */ | ||
3858 | |||
3859 | /* | ||
3860 | * R1358 (0x54E) - AIF2 Frame Ctrl 8 | ||
3861 | */ | ||
3862 | #define ARIZONA_AIF2TX6_SLOT_MASK 0x003F /* AIF2TX6_SLOT - [5:0] */ | ||
3863 | #define ARIZONA_AIF2TX6_SLOT_SHIFT 0 /* AIF2TX6_SLOT - [5:0] */ | ||
3864 | #define ARIZONA_AIF2TX6_SLOT_WIDTH 6 /* AIF2TX6_SLOT - [5:0] */ | ||
3865 | |||
3866 | /* | ||
3729 | * R1361 (0x551) - AIF2 Frame Ctrl 11 | 3867 | * R1361 (0x551) - AIF2 Frame Ctrl 11 |
3730 | */ | 3868 | */ |
3731 | #define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ | 3869 | #define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ |
@@ -3740,8 +3878,52 @@ | |||
3740 | #define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ | 3878 | #define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ |
3741 | 3879 | ||
3742 | /* | 3880 | /* |
3881 | * R1363 (0x553) - AIF2 Frame Ctrl 13 | ||
3882 | */ | ||
3883 | #define ARIZONA_AIF2RX3_SLOT_MASK 0x003F /* AIF2RX3_SLOT - [5:0] */ | ||
3884 | #define ARIZONA_AIF2RX3_SLOT_SHIFT 0 /* AIF2RX3_SLOT - [5:0] */ | ||
3885 | #define ARIZONA_AIF2RX3_SLOT_WIDTH 6 /* AIF2RX3_SLOT - [5:0] */ | ||
3886 | |||
3887 | /* | ||
3888 | * R1364 (0x554) - AIF2 Frame Ctrl 14 | ||
3889 | */ | ||
3890 | #define ARIZONA_AIF2RX4_SLOT_MASK 0x003F /* AIF2RX4_SLOT - [5:0] */ | ||
3891 | #define ARIZONA_AIF2RX4_SLOT_SHIFT 0 /* AIF2RX4_SLOT - [5:0] */ | ||
3892 | #define ARIZONA_AIF2RX4_SLOT_WIDTH 6 /* AIF2RX4_SLOT - [5:0] */ | ||
3893 | |||
3894 | /* | ||
3895 | * R1365 (0x555) - AIF2 Frame Ctrl 15 | ||
3896 | */ | ||
3897 | #define ARIZONA_AIF2RX5_SLOT_MASK 0x003F /* AIF2RX5_SLOT - [5:0] */ | ||
3898 | #define ARIZONA_AIF2RX5_SLOT_SHIFT 0 /* AIF2RX5_SLOT - [5:0] */ | ||
3899 | #define ARIZONA_AIF2RX5_SLOT_WIDTH 6 /* AIF2RX5_SLOT - [5:0] */ | ||
3900 | |||
3901 | /* | ||
3902 | * R1366 (0x556) - AIF2 Frame Ctrl 16 | ||
3903 | */ | ||
3904 | #define ARIZONA_AIF2RX6_SLOT_MASK 0x003F /* AIF2RX6_SLOT - [5:0] */ | ||
3905 | #define ARIZONA_AIF2RX6_SLOT_SHIFT 0 /* AIF2RX6_SLOT - [5:0] */ | ||
3906 | #define ARIZONA_AIF2RX6_SLOT_WIDTH 6 /* AIF2RX6_SLOT - [5:0] */ | ||
3907 | |||
3908 | /* | ||
3743 | * R1369 (0x559) - AIF2 Tx Enables | 3909 | * R1369 (0x559) - AIF2 Tx Enables |
3744 | */ | 3910 | */ |
3911 | #define ARIZONA_AIF2TX6_ENA 0x0020 /* AIF2TX6_ENA */ | ||
3912 | #define ARIZONA_AIF2TX6_ENA_MASK 0x0020 /* AIF2TX6_ENA */ | ||
3913 | #define ARIZONA_AIF2TX6_ENA_SHIFT 5 /* AIF2TX6_ENA */ | ||
3914 | #define ARIZONA_AIF2TX6_ENA_WIDTH 1 /* AIF2TX6_ENA */ | ||
3915 | #define ARIZONA_AIF2TX5_ENA 0x0010 /* AIF2TX5_ENA */ | ||
3916 | #define ARIZONA_AIF2TX5_ENA_MASK 0x0010 /* AIF2TX5_ENA */ | ||
3917 | #define ARIZONA_AIF2TX5_ENA_SHIFT 4 /* AIF2TX5_ENA */ | ||
3918 | #define ARIZONA_AIF2TX5_ENA_WIDTH 1 /* AIF2TX5_ENA */ | ||
3919 | #define ARIZONA_AIF2TX4_ENA 0x0008 /* AIF2TX4_ENA */ | ||
3920 | #define ARIZONA_AIF2TX4_ENA_MASK 0x0008 /* AIF2TX4_ENA */ | ||
3921 | #define ARIZONA_AIF2TX4_ENA_SHIFT 3 /* AIF2TX4_ENA */ | ||
3922 | #define ARIZONA_AIF2TX4_ENA_WIDTH 1 /* AIF2TX4_ENA */ | ||
3923 | #define ARIZONA_AIF2TX3_ENA 0x0004 /* AIF2TX3_ENA */ | ||
3924 | #define ARIZONA_AIF2TX3_ENA_MASK 0x0004 /* AIF2TX3_ENA */ | ||
3925 | #define ARIZONA_AIF2TX3_ENA_SHIFT 2 /* AIF2TX3_ENA */ | ||
3926 | #define ARIZONA_AIF2TX3_ENA_WIDTH 1 /* AIF2TX3_ENA */ | ||
3745 | #define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ | 3927 | #define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ |
3746 | #define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ | 3928 | #define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ |
3747 | #define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ | 3929 | #define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ |
@@ -3754,6 +3936,22 @@ | |||
3754 | /* | 3936 | /* |
3755 | * R1370 (0x55A) - AIF2 Rx Enables | 3937 | * R1370 (0x55A) - AIF2 Rx Enables |
3756 | */ | 3938 | */ |
3939 | #define ARIZONA_AIF2RX6_ENA 0x0020 /* AIF2RX6_ENA */ | ||
3940 | #define ARIZONA_AIF2RX6_ENA_MASK 0x0020 /* AIF2RX6_ENA */ | ||
3941 | #define ARIZONA_AIF2RX6_ENA_SHIFT 5 /* AIF2RX6_ENA */ | ||
3942 | #define ARIZONA_AIF2RX6_ENA_WIDTH 1 /* AIF2RX6_ENA */ | ||
3943 | #define ARIZONA_AIF2RX5_ENA 0x0010 /* AIF2RX5_ENA */ | ||
3944 | #define ARIZONA_AIF2RX5_ENA_MASK 0x0010 /* AIF2RX5_ENA */ | ||
3945 | #define ARIZONA_AIF2RX5_ENA_SHIFT 4 /* AIF2RX5_ENA */ | ||
3946 | #define ARIZONA_AIF2RX5_ENA_WIDTH 1 /* AIF2RX5_ENA */ | ||
3947 | #define ARIZONA_AIF2RX4_ENA 0x0008 /* AIF2RX4_ENA */ | ||
3948 | #define ARIZONA_AIF2RX4_ENA_MASK 0x0008 /* AIF2RX4_ENA */ | ||
3949 | #define ARIZONA_AIF2RX4_ENA_SHIFT 3 /* AIF2RX4_ENA */ | ||
3950 | #define ARIZONA_AIF2RX4_ENA_WIDTH 1 /* AIF2RX4_ENA */ | ||
3951 | #define ARIZONA_AIF2RX3_ENA 0x0004 /* AIF2RX3_ENA */ | ||
3952 | #define ARIZONA_AIF2RX3_ENA_MASK 0x0004 /* AIF2RX3_ENA */ | ||
3953 | #define ARIZONA_AIF2RX3_ENA_SHIFT 2 /* AIF2RX3_ENA */ | ||
3954 | #define ARIZONA_AIF2RX3_ENA_WIDTH 1 /* AIF2RX3_ENA */ | ||
3757 | #define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ | 3955 | #define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ |
3758 | #define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ | 3956 | #define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ |
3759 | #define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ | 3957 | #define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ |
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h index 16bf8a0dcd97..f654a7a42260 100644 --- a/include/linux/mfd/as3722.h +++ b/include/linux/mfd/as3722.h | |||
@@ -314,6 +314,7 @@ | |||
314 | #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) | 314 | #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) |
315 | #define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) | 315 | #define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) |
316 | #define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) | 316 | #define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) |
317 | #define AS3722_GPIO_IOSF_SD0_OUT AS3722_GPIO_IOSF_VAL(6) | ||
317 | #define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) | 318 | #define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) |
318 | #define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) | 319 | #define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) |
319 | #define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) | 320 | #define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) |
diff --git a/include/linux/mfd/lp3943.h b/include/linux/mfd/lp3943.h new file mode 100644 index 000000000000..3490db782988 --- /dev/null +++ b/include/linux/mfd/lp3943.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /* | ||
2 | * TI/National Semiconductor LP3943 Device | ||
3 | * | ||
4 | * Copyright 2013 Texas Instruments | ||
5 | * | ||
6 | * Author: Milo Kim <milo.kim@ti.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __MFD_LP3943_H__ | ||
15 | #define __MFD_LP3943_H__ | ||
16 | |||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/pwm.h> | ||
19 | #include <linux/regmap.h> | ||
20 | |||
21 | /* Registers */ | ||
22 | #define LP3943_REG_GPIO_A 0x00 | ||
23 | #define LP3943_REG_GPIO_B 0x01 | ||
24 | #define LP3943_REG_PRESCALE0 0x02 | ||
25 | #define LP3943_REG_PWM0 0x03 | ||
26 | #define LP3943_REG_PRESCALE1 0x04 | ||
27 | #define LP3943_REG_PWM1 0x05 | ||
28 | #define LP3943_REG_MUX0 0x06 | ||
29 | #define LP3943_REG_MUX1 0x07 | ||
30 | #define LP3943_REG_MUX2 0x08 | ||
31 | #define LP3943_REG_MUX3 0x09 | ||
32 | |||
33 | /* Bit description for LP3943_REG_MUX0 ~ 3 */ | ||
34 | #define LP3943_GPIO_IN 0x00 | ||
35 | #define LP3943_GPIO_OUT_HIGH 0x00 | ||
36 | #define LP3943_GPIO_OUT_LOW 0x01 | ||
37 | #define LP3943_DIM_PWM0 0x02 | ||
38 | #define LP3943_DIM_PWM1 0x03 | ||
39 | |||
40 | #define LP3943_NUM_PWMS 2 | ||
41 | |||
42 | enum lp3943_pwm_output { | ||
43 | LP3943_PWM_OUT0, | ||
44 | LP3943_PWM_OUT1, | ||
45 | LP3943_PWM_OUT2, | ||
46 | LP3943_PWM_OUT3, | ||
47 | LP3943_PWM_OUT4, | ||
48 | LP3943_PWM_OUT5, | ||
49 | LP3943_PWM_OUT6, | ||
50 | LP3943_PWM_OUT7, | ||
51 | LP3943_PWM_OUT8, | ||
52 | LP3943_PWM_OUT9, | ||
53 | LP3943_PWM_OUT10, | ||
54 | LP3943_PWM_OUT11, | ||
55 | LP3943_PWM_OUT12, | ||
56 | LP3943_PWM_OUT13, | ||
57 | LP3943_PWM_OUT14, | ||
58 | LP3943_PWM_OUT15, | ||
59 | }; | ||
60 | |||
61 | /* | ||
62 | * struct lp3943_pwm_map | ||
63 | * @output: Output pins which are mapped to each PWM channel | ||
64 | * @num_outputs: Number of outputs | ||
65 | */ | ||
66 | struct lp3943_pwm_map { | ||
67 | enum lp3943_pwm_output *output; | ||
68 | int num_outputs; | ||
69 | }; | ||
70 | |||
71 | /* | ||
72 | * struct lp3943_platform_data | ||
73 | * @pwms: Output channel definitions for PWM channel 0 and 1 | ||
74 | */ | ||
75 | struct lp3943_platform_data { | ||
76 | struct lp3943_pwm_map *pwms[LP3943_NUM_PWMS]; | ||
77 | }; | ||
78 | |||
79 | /* | ||
80 | * struct lp3943_reg_cfg | ||
81 | * @reg: Register address | ||
82 | * @mask: Register bit mask to be updated | ||
83 | * @shift: Register bit shift | ||
84 | */ | ||
85 | struct lp3943_reg_cfg { | ||
86 | u8 reg; | ||
87 | u8 mask; | ||
88 | u8 shift; | ||
89 | }; | ||
90 | |||
91 | /* | ||
92 | * struct lp3943 | ||
93 | * @dev: Parent device pointer | ||
94 | * @regmap: Used for I2C communication on accessing registers | ||
95 | * @pdata: LP3943 platform specific data | ||
96 | * @mux_cfg: Register configuration for pin MUX | ||
97 | * @pin_used: Bit mask for output pin used. | ||
98 | * This bitmask is used for pin assignment management. | ||
99 | * 1 = pin used, 0 = available. | ||
100 | * Only LSB 16 bits are used, but it is unsigned long type | ||
101 | * for atomic bitwise operations. | ||
102 | */ | ||
103 | struct lp3943 { | ||
104 | struct device *dev; | ||
105 | struct regmap *regmap; | ||
106 | struct lp3943_platform_data *pdata; | ||
107 | const struct lp3943_reg_cfg *mux_cfg; | ||
108 | unsigned long pin_used; | ||
109 | }; | ||
110 | |||
111 | int lp3943_read_byte(struct lp3943 *lp3943, u8 reg, u8 *read); | ||
112 | int lp3943_write_byte(struct lp3943 *lp3943, u8 reg, u8 data); | ||
113 | int lp3943_update_bits(struct lp3943 *lp3943, u8 reg, u8 mask, u8 data); | ||
114 | #endif | ||
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h new file mode 100644 index 000000000000..a3d0185196d3 --- /dev/null +++ b/include/linux/mfd/max14577-private.h | |||
@@ -0,0 +1,330 @@ | |||
1 | /* | ||
2 | * max14577-private.h - Common API for the Maxim 14577 internal sub chip | ||
3 | * | ||
4 | * Copyright (C) 2013 Samsung Electrnoics | ||
5 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
6 | * Krzysztof Kozlowski <k.kozlowski@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MAX14577_PRIVATE_H__ | ||
20 | #define __MAX14577_PRIVATE_H__ | ||
21 | |||
22 | #include <linux/i2c.h> | ||
23 | #include <linux/regmap.h> | ||
24 | |||
25 | #define MAX14577_REG_INVALID (0xff) | ||
26 | |||
27 | /* Slave addr = 0x4A: Interrupt */ | ||
28 | enum max14577_reg { | ||
29 | MAX14577_REG_DEVICEID = 0x00, | ||
30 | MAX14577_REG_INT1 = 0x01, | ||
31 | MAX14577_REG_INT2 = 0x02, | ||
32 | MAX14577_REG_INT3 = 0x03, | ||
33 | MAX14577_REG_STATUS1 = 0x04, | ||
34 | MAX14577_REG_STATUS2 = 0x05, | ||
35 | MAX14577_REG_STATUS3 = 0x06, | ||
36 | MAX14577_REG_INTMASK1 = 0x07, | ||
37 | MAX14577_REG_INTMASK2 = 0x08, | ||
38 | MAX14577_REG_INTMASK3 = 0x09, | ||
39 | MAX14577_REG_CDETCTRL1 = 0x0A, | ||
40 | MAX14577_REG_RFU = 0x0B, | ||
41 | MAX14577_REG_CONTROL1 = 0x0C, | ||
42 | MAX14577_REG_CONTROL2 = 0x0D, | ||
43 | MAX14577_REG_CONTROL3 = 0x0E, | ||
44 | MAX14577_REG_CHGCTRL1 = 0x0F, | ||
45 | MAX14577_REG_CHGCTRL2 = 0x10, | ||
46 | MAX14577_REG_CHGCTRL3 = 0x11, | ||
47 | MAX14577_REG_CHGCTRL4 = 0x12, | ||
48 | MAX14577_REG_CHGCTRL5 = 0x13, | ||
49 | MAX14577_REG_CHGCTRL6 = 0x14, | ||
50 | MAX14577_REG_CHGCTRL7 = 0x15, | ||
51 | |||
52 | MAX14577_REG_END, | ||
53 | }; | ||
54 | |||
55 | /* Slave addr = 0x4A: MUIC */ | ||
56 | enum max14577_muic_reg { | ||
57 | MAX14577_MUIC_REG_STATUS1 = 0x04, | ||
58 | MAX14577_MUIC_REG_STATUS2 = 0x05, | ||
59 | MAX14577_MUIC_REG_CONTROL1 = 0x0C, | ||
60 | MAX14577_MUIC_REG_CONTROL3 = 0x0E, | ||
61 | |||
62 | MAX14577_MUIC_REG_END, | ||
63 | }; | ||
64 | |||
65 | enum max14577_muic_charger_type { | ||
66 | MAX14577_CHARGER_TYPE_NONE = 0, | ||
67 | MAX14577_CHARGER_TYPE_USB, | ||
68 | MAX14577_CHARGER_TYPE_DOWNSTREAM_PORT, | ||
69 | MAX14577_CHARGER_TYPE_DEDICATED_CHG, | ||
70 | MAX14577_CHARGER_TYPE_SPECIAL_500MA, | ||
71 | MAX14577_CHARGER_TYPE_SPECIAL_1A, | ||
72 | MAX14577_CHARGER_TYPE_RESERVED, | ||
73 | MAX14577_CHARGER_TYPE_DEAD_BATTERY = 7, | ||
74 | }; | ||
75 | |||
76 | /* MAX14577 interrupts */ | ||
77 | #define INT1_ADC_MASK (0x1 << 0) | ||
78 | #define INT1_ADCLOW_MASK (0x1 << 1) | ||
79 | #define INT1_ADCERR_MASK (0x1 << 2) | ||
80 | |||
81 | #define INT2_CHGTYP_MASK (0x1 << 0) | ||
82 | #define INT2_CHGDETRUN_MASK (0x1 << 1) | ||
83 | #define INT2_DCDTMR_MASK (0x1 << 2) | ||
84 | #define INT2_DBCHG_MASK (0x1 << 3) | ||
85 | #define INT2_VBVOLT_MASK (0x1 << 4) | ||
86 | |||
87 | #define INT3_EOC_MASK (0x1 << 0) | ||
88 | #define INT3_CGMBC_MASK (0x1 << 1) | ||
89 | #define INT3_OVP_MASK (0x1 << 2) | ||
90 | #define INT3_MBCCHGERR_MASK (0x1 << 3) | ||
91 | |||
92 | /* MAX14577 DEVICE ID register */ | ||
93 | #define DEVID_VENDORID_SHIFT 0 | ||
94 | #define DEVID_DEVICEID_SHIFT 3 | ||
95 | #define DEVID_VENDORID_MASK (0x07 << DEVID_VENDORID_SHIFT) | ||
96 | #define DEVID_DEVICEID_MASK (0x1f << DEVID_DEVICEID_SHIFT) | ||
97 | |||
98 | /* MAX14577 STATUS1 register */ | ||
99 | #define STATUS1_ADC_SHIFT 0 | ||
100 | #define STATUS1_ADCLOW_SHIFT 5 | ||
101 | #define STATUS1_ADCERR_SHIFT 6 | ||
102 | #define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT) | ||
103 | #define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT) | ||
104 | #define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT) | ||
105 | |||
106 | /* MAX14577 STATUS2 register */ | ||
107 | #define STATUS2_CHGTYP_SHIFT 0 | ||
108 | #define STATUS2_CHGDETRUN_SHIFT 3 | ||
109 | #define STATUS2_DCDTMR_SHIFT 4 | ||
110 | #define STATUS2_DBCHG_SHIFT 5 | ||
111 | #define STATUS2_VBVOLT_SHIFT 6 | ||
112 | #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT) | ||
113 | #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT) | ||
114 | #define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT) | ||
115 | #define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT) | ||
116 | #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT) | ||
117 | |||
118 | /* MAX14577 CONTROL1 register */ | ||
119 | #define COMN1SW_SHIFT 0 | ||
120 | #define COMP2SW_SHIFT 3 | ||
121 | #define MICEN_SHIFT 6 | ||
122 | #define IDBEN_SHIFT 7 | ||
123 | #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT) | ||
124 | #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT) | ||
125 | #define MICEN_MASK (0x1 << MICEN_SHIFT) | ||
126 | #define IDBEN_MASK (0x1 << IDBEN_SHIFT) | ||
127 | #define CLEAR_IDBEN_MICEN_MASK (COMN1SW_MASK | COMP2SW_MASK) | ||
128 | #define CTRL1_SW_USB ((1 << COMP2SW_SHIFT) \ | ||
129 | | (1 << COMN1SW_SHIFT)) | ||
130 | #define CTRL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \ | ||
131 | | (2 << COMN1SW_SHIFT)) | ||
132 | #define CTRL1_SW_UART ((3 << COMP2SW_SHIFT) \ | ||
133 | | (3 << COMN1SW_SHIFT)) | ||
134 | #define CTRL1_SW_OPEN ((0 << COMP2SW_SHIFT) \ | ||
135 | | (0 << COMN1SW_SHIFT)) | ||
136 | |||
137 | /* MAX14577 CONTROL2 register */ | ||
138 | #define CTRL2_LOWPWR_SHIFT (0) | ||
139 | #define CTRL2_ADCEN_SHIFT (1) | ||
140 | #define CTRL2_CPEN_SHIFT (2) | ||
141 | #define CTRL2_SFOUTASRT_SHIFT (3) | ||
142 | #define CTRL2_SFOUTORD_SHIFT (4) | ||
143 | #define CTRL2_ACCDET_SHIFT (5) | ||
144 | #define CTRL2_USBCPINT_SHIFT (6) | ||
145 | #define CTRL2_RCPS_SHIFT (7) | ||
146 | #define CTRL2_LOWPWR_MASK (0x1 << CTRL2_LOWPWR_SHIFT) | ||
147 | #define CTRL2_ADCEN_MASK (0x1 << CTRL2_ADCEN_SHIFT) | ||
148 | #define CTRL2_CPEN_MASK (0x1 << CTRL2_CPEN_SHIFT) | ||
149 | #define CTRL2_SFOUTASRT_MASK (0x1 << CTRL2_SFOUTASRT_SHIFT) | ||
150 | #define CTRL2_SFOUTORD_MASK (0x1 << CTRL2_SFOUTORD_SHIFT) | ||
151 | #define CTRL2_ACCDET_MASK (0x1 << CTRL2_ACCDET_SHIFT) | ||
152 | #define CTRL2_USBCPINT_MASK (0x1 << CTRL2_USBCPINT_SHIFT) | ||
153 | #define CTRL2_RCPS_MASK (0x1 << CTR2_RCPS_SHIFT) | ||
154 | |||
155 | #define CTRL2_CPEN1_LOWPWR0 ((1 << CTRL2_CPEN_SHIFT) | \ | ||
156 | (0 << CTRL2_LOWPWR_SHIFT)) | ||
157 | #define CTRL2_CPEN0_LOWPWR1 ((0 << CTRL2_CPEN_SHIFT) | \ | ||
158 | (1 << CTRL2_LOWPWR_SHIFT)) | ||
159 | |||
160 | /* MAX14577 CONTROL3 register */ | ||
161 | #define CTRL3_JIGSET_SHIFT 0 | ||
162 | #define CTRL3_BOOTSET_SHIFT 2 | ||
163 | #define CTRL3_ADCDBSET_SHIFT 4 | ||
164 | #define CTRL3_JIGSET_MASK (0x3 << CTRL3_JIGSET_SHIFT) | ||
165 | #define CTRL3_BOOTSET_MASK (0x3 << CTRL3_BOOTSET_SHIFT) | ||
166 | #define CTRL3_ADCDBSET_MASK (0x3 << CTRL3_ADCDBSET_SHIFT) | ||
167 | |||
168 | /* Slave addr = 0x4A: Charger */ | ||
169 | enum max14577_charger_reg { | ||
170 | MAX14577_CHG_REG_STATUS3 = 0x06, | ||
171 | MAX14577_CHG_REG_CHG_CTRL1 = 0x0F, | ||
172 | MAX14577_CHG_REG_CHG_CTRL2 = 0x10, | ||
173 | MAX14577_CHG_REG_CHG_CTRL3 = 0x11, | ||
174 | MAX14577_CHG_REG_CHG_CTRL4 = 0x12, | ||
175 | MAX14577_CHG_REG_CHG_CTRL5 = 0x13, | ||
176 | MAX14577_CHG_REG_CHG_CTRL6 = 0x14, | ||
177 | MAX14577_CHG_REG_CHG_CTRL7 = 0x15, | ||
178 | |||
179 | MAX14577_CHG_REG_END, | ||
180 | }; | ||
181 | |||
182 | /* MAX14577 STATUS3 register */ | ||
183 | #define STATUS3_EOC_SHIFT 0 | ||
184 | #define STATUS3_CGMBC_SHIFT 1 | ||
185 | #define STATUS3_OVP_SHIFT 2 | ||
186 | #define STATUS3_MBCCHGERR_SHIFT 3 | ||
187 | #define STATUS3_EOC_MASK (0x1 << STATUS3_EOC_SHIFT) | ||
188 | #define STATUS3_CGMBC_MASK (0x1 << STATUS3_CGMBC_SHIFT) | ||
189 | #define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT) | ||
190 | #define STATUS3_MBCCHGERR_MASK (0x1 << STATUS3_MBCCHGERR_SHIFT) | ||
191 | |||
192 | /* MAX14577 CDETCTRL1 register */ | ||
193 | #define CDETCTRL1_CHGDETEN_SHIFT 0 | ||
194 | #define CDETCTRL1_CHGTYPMAN_SHIFT 1 | ||
195 | #define CDETCTRL1_DCDEN_SHIFT 2 | ||
196 | #define CDETCTRL1_DCD2SCT_SHIFT 3 | ||
197 | #define CDETCTRL1_DCHKTM_SHIFT 4 | ||
198 | #define CDETCTRL1_DBEXIT_SHIFT 5 | ||
199 | #define CDETCTRL1_DBIDLE_SHIFT 6 | ||
200 | #define CDETCTRL1_CDPDET_SHIFT 7 | ||
201 | #define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT) | ||
202 | #define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT) | ||
203 | #define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT) | ||
204 | #define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT) | ||
205 | #define CDETCTRL1_DCHKTM_MASK (0x1 << CDETCTRL1_DCHKTM_SHIFT) | ||
206 | #define CDETCTRL1_DBEXIT_MASK (0x1 << CDETCTRL1_DBEXIT_SHIFT) | ||
207 | #define CDETCTRL1_DBIDLE_MASK (0x1 << CDETCTRL1_DBIDLE_SHIFT) | ||
208 | #define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT) | ||
209 | |||
210 | /* MAX14577 CHGCTRL1 register */ | ||
211 | #define CHGCTRL1_TCHW_SHIFT 4 | ||
212 | #define CHGCTRL1_TCHW_MASK (0x7 << CHGCTRL1_TCHW_SHIFT) | ||
213 | |||
214 | /* MAX14577 CHGCTRL2 register */ | ||
215 | #define CHGCTRL2_MBCHOSTEN_SHIFT 6 | ||
216 | #define CHGCTRL2_MBCHOSTEN_MASK (0x1 << CHGCTRL2_MBCHOSTEN_SHIFT) | ||
217 | #define CHGCTRL2_VCHGR_RC_SHIFT 7 | ||
218 | #define CHGCTRL2_VCHGR_RC_MASK (0x1 << CHGCTRL2_VCHGR_RC_SHIFT) | ||
219 | |||
220 | /* MAX14577 CHGCTRL3 register */ | ||
221 | #define CHGCTRL3_MBCCVWRC_SHIFT 0 | ||
222 | #define CHGCTRL3_MBCCVWRC_MASK (0xf << CHGCTRL3_MBCCVWRC_SHIFT) | ||
223 | |||
224 | /* MAX14577 CHGCTRL4 register */ | ||
225 | #define CHGCTRL4_MBCICHWRCH_SHIFT 0 | ||
226 | #define CHGCTRL4_MBCICHWRCH_MASK (0xf << CHGCTRL4_MBCICHWRCH_SHIFT) | ||
227 | #define CHGCTRL4_MBCICHWRCL_SHIFT 4 | ||
228 | #define CHGCTRL4_MBCICHWRCL_MASK (0x1 << CHGCTRL4_MBCICHWRCL_SHIFT) | ||
229 | |||
230 | /* MAX14577 CHGCTRL5 register */ | ||
231 | #define CHGCTRL5_EOCS_SHIFT 0 | ||
232 | #define CHGCTRL5_EOCS_MASK (0xf << CHGCTRL5_EOCS_SHIFT) | ||
233 | |||
234 | /* MAX14577 CHGCTRL6 register */ | ||
235 | #define CHGCTRL6_AUTOSTOP_SHIFT 5 | ||
236 | #define CHGCTRL6_AUTOSTOP_MASK (0x1 << CHGCTRL6_AUTOSTOP_SHIFT) | ||
237 | |||
238 | /* MAX14577 CHGCTRL7 register */ | ||
239 | #define CHGCTRL7_OTPCGHCVS_SHIFT 0 | ||
240 | #define CHGCTRL7_OTPCGHCVS_MASK (0x3 << CHGCTRL7_OTPCGHCVS_SHIFT) | ||
241 | |||
242 | /* MAX14577 regulator current limits (as in CHGCTRL4 register), uA */ | ||
243 | #define MAX14577_REGULATOR_CURRENT_LIMIT_MIN 90000 | ||
244 | #define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_START 200000 | ||
245 | #define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_STEP 50000 | ||
246 | #define MAX14577_REGULATOR_CURRENT_LIMIT_MAX 950000 | ||
247 | |||
248 | /* MAX14577 regulator SFOUT LDO voltage, fixed, uV */ | ||
249 | #define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000 | ||
250 | |||
251 | enum max14577_irq_source { | ||
252 | MAX14577_IRQ_INT1 = 0, | ||
253 | MAX14577_IRQ_INT2, | ||
254 | MAX14577_IRQ_INT3, | ||
255 | |||
256 | MAX14577_IRQ_REGS_NUM, | ||
257 | }; | ||
258 | |||
259 | enum max14577_irq { | ||
260 | /* INT1 */ | ||
261 | MAX14577_IRQ_INT1_ADC, | ||
262 | MAX14577_IRQ_INT1_ADCLOW, | ||
263 | MAX14577_IRQ_INT1_ADCERR, | ||
264 | |||
265 | /* INT2 */ | ||
266 | MAX14577_IRQ_INT2_CHGTYP, | ||
267 | MAX14577_IRQ_INT2_CHGDETRUN, | ||
268 | MAX14577_IRQ_INT2_DCDTMR, | ||
269 | MAX14577_IRQ_INT2_DBCHG, | ||
270 | MAX14577_IRQ_INT2_VBVOLT, | ||
271 | |||
272 | /* INT3 */ | ||
273 | MAX14577_IRQ_INT3_EOC, | ||
274 | MAX14577_IRQ_INT3_CGMBC, | ||
275 | MAX14577_IRQ_INT3_OVP, | ||
276 | MAX14577_IRQ_INT3_MBCCHGERR, | ||
277 | |||
278 | MAX14577_IRQ_NUM, | ||
279 | }; | ||
280 | |||
281 | struct max14577 { | ||
282 | struct device *dev; | ||
283 | struct i2c_client *i2c; /* Slave addr = 0x4A */ | ||
284 | |||
285 | struct regmap *regmap; | ||
286 | |||
287 | struct regmap_irq_chip_data *irq_data; | ||
288 | int irq; | ||
289 | |||
290 | /* Device ID */ | ||
291 | u8 vendor_id; /* Vendor Identification */ | ||
292 | u8 device_id; /* Chip Version */ | ||
293 | }; | ||
294 | |||
295 | /* MAX14577 shared regmap API function */ | ||
296 | static inline int max14577_read_reg(struct regmap *map, u8 reg, u8 *dest) | ||
297 | { | ||
298 | unsigned int val; | ||
299 | int ret; | ||
300 | |||
301 | ret = regmap_read(map, reg, &val); | ||
302 | *dest = val; | ||
303 | |||
304 | return ret; | ||
305 | } | ||
306 | |||
307 | static inline int max14577_bulk_read(struct regmap *map, u8 reg, u8 *buf, | ||
308 | int count) | ||
309 | { | ||
310 | return regmap_bulk_read(map, reg, buf, count); | ||
311 | } | ||
312 | |||
313 | static inline int max14577_write_reg(struct regmap *map, u8 reg, u8 value) | ||
314 | { | ||
315 | return regmap_write(map, reg, value); | ||
316 | } | ||
317 | |||
318 | static inline int max14577_bulk_write(struct regmap *map, u8 reg, u8 *buf, | ||
319 | int count) | ||
320 | { | ||
321 | return regmap_bulk_write(map, reg, buf, count); | ||
322 | } | ||
323 | |||
324 | static inline int max14577_update_reg(struct regmap *map, u8 reg, u8 mask, | ||
325 | u8 val) | ||
326 | { | ||
327 | return regmap_update_bits(map, reg, mask, val); | ||
328 | } | ||
329 | |||
330 | #endif /* __MAX14577_PRIVATE_H__ */ | ||
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h new file mode 100644 index 000000000000..247b021dfaaf --- /dev/null +++ b/include/linux/mfd/max14577.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * max14577.h - Driver for the Maxim 14577 | ||
3 | * | ||
4 | * Copyright (C) 2013 Samsung Electrnoics | ||
5 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
6 | * Krzysztof Kozlowski <k.kozlowski@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * This driver is based on max8997.h | ||
19 | * | ||
20 | * MAX14577 has MUIC, Charger devices. | ||
21 | * The devices share the same I2C bus and interrupt line | ||
22 | * included in this mfd driver. | ||
23 | */ | ||
24 | |||
25 | #ifndef __MAX14577_H__ | ||
26 | #define __MAX14577_H__ | ||
27 | |||
28 | #include <linux/mfd/max14577-private.h> | ||
29 | #include <linux/regulator/consumer.h> | ||
30 | |||
31 | /* | ||
32 | * MAX14577 Regulator | ||
33 | */ | ||
34 | |||
35 | /* MAX14577 regulator IDs */ | ||
36 | enum max14577_regulators { | ||
37 | MAX14577_SAFEOUT = 0, | ||
38 | MAX14577_CHARGER, | ||
39 | |||
40 | MAX14577_REG_MAX, | ||
41 | }; | ||
42 | |||
43 | struct max14577_regulator_platform_data { | ||
44 | int id; | ||
45 | struct regulator_init_data *initdata; | ||
46 | struct device_node *of_node; | ||
47 | }; | ||
48 | |||
49 | /* | ||
50 | * MAX14577 MFD platform data | ||
51 | */ | ||
52 | struct max14577_platform_data { | ||
53 | /* IRQ */ | ||
54 | int irq_base; | ||
55 | |||
56 | /* current control GPIOs */ | ||
57 | int gpio_pogo_vbatt_en; | ||
58 | int gpio_pogo_vbus_en; | ||
59 | |||
60 | /* current control GPIO control function */ | ||
61 | int (*set_gpio_pogo_vbatt_en) (int gpio_val); | ||
62 | int (*set_gpio_pogo_vbus_en) (int gpio_val); | ||
63 | |||
64 | int (*set_gpio_pogo_cb) (int new_dev); | ||
65 | |||
66 | struct max14577_regulator_platform_data *regulators; | ||
67 | }; | ||
68 | |||
69 | #endif /* __MAX14577_H__ */ | ||
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h index d327d4971e4f..8c75a9c8dfab 100644 --- a/include/linux/mfd/max77686-private.h +++ b/include/linux/mfd/max77686-private.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * max77686.h - Voltage regulator driver for the Maxim 77686 | 2 | * max77686-private.h - Voltage regulator driver for the Maxim 77686 |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Samsung Electrnoics | 4 | * Copyright (C) 2012 Samsung Electrnoics |
5 | * Chiwoong Byun <woong.byun@samsung.com> | 5 | * Chiwoong Byun <woong.byun@samsung.com> |
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index fb465dfbb59e..ad1ae7f345ad 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * max8997.h - Voltage regulator driver for the Maxim 8997 | 2 | * max8997-private.h - Voltage regulator driver for the Maxim 8997 |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Samsung Electrnoics | 4 | * Copyright (C) 2010 Samsung Electrnoics |
5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | 5 | * MyungJoo Ham <myungjoo.ham@samsung.com> |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 84844e0a5704..4ecb24b4b863 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * max8998.h - Voltage regulator driver for the Maxim 8998 | 2 | * max8998-private.h - Voltage regulator driver for the Maxim 8998 |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Samsung Electrnoics | 4 | * Copyright (C) 2009-2010 Samsung Electrnoics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index 67c17b5a6f44..6156686bf108 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
@@ -21,8 +21,6 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val); | |||
21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, | 21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, |
22 | u32 mask, u32 val); | 22 | u32 mask, u32 val); |
23 | 23 | ||
24 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); | ||
25 | |||
26 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, | 24 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, |
27 | irq_handler_t handler, const char *name, void *dev); | 25 | irq_handler_t handler, const char *name, void *dev); |
28 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, | 26 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 2d0c9071bcfb..cab2dd279076 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
@@ -39,7 +39,8 @@ enum sec_device_type { | |||
39 | struct sec_pmic_dev { | 39 | struct sec_pmic_dev { |
40 | struct device *dev; | 40 | struct device *dev; |
41 | struct sec_platform_data *pdata; | 41 | struct sec_platform_data *pdata; |
42 | struct regmap *regmap; | 42 | struct regmap *regmap_pmic; |
43 | struct regmap *regmap_rtc; | ||
43 | struct i2c_client *i2c; | 44 | struct i2c_client *i2c; |
44 | struct i2c_client *rtc; | 45 | struct i2c_client *rtc; |
45 | 46 | ||
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index b6d36b38b99c..866e355fa409 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | |||
@@ -212,6 +212,7 @@ | |||
212 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) | 212 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) |
213 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) | 213 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) |
214 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) | 214 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) |
215 | #define IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT 2 | ||
215 | #define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) | 216 | #define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) |
216 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) | 217 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) |
217 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) | 218 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) |
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index d498d98f0c2c..fb96c84dada5 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
@@ -159,6 +159,9 @@ struct ti_tscadc_dev { | |||
159 | int adc_cell; /* -1 if not used */ | 159 | int adc_cell; /* -1 if not used */ |
160 | struct mfd_cell cells[TSCADC_CELLS]; | 160 | struct mfd_cell cells[TSCADC_CELLS]; |
161 | u32 reg_se_cache; | 161 | u32 reg_se_cache; |
162 | bool adc_waiting; | ||
163 | bool adc_in_use; | ||
164 | wait_queue_head_t reg_se_wait; | ||
162 | spinlock_t reg_lock; | 165 | spinlock_t reg_lock; |
163 | unsigned int clk_div; | 166 | unsigned int clk_div; |
164 | 167 | ||
@@ -176,8 +179,9 @@ static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p) | |||
176 | return *tscadc_dev; | 179 | return *tscadc_dev; |
177 | } | 180 | } |
178 | 181 | ||
179 | void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); | 182 | void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val); |
180 | void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); | 183 | void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val); |
181 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); | 184 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); |
185 | void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc); | ||
182 | 186 | ||
183 | #endif | 187 | #endif |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index 87994542573b..cbecec2e353a 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
@@ -13,6 +13,12 @@ | |||
13 | #define TPS6586X_SLEW_RATE_SET 0x08 | 13 | #define TPS6586X_SLEW_RATE_SET 0x08 |
14 | #define TPS6586X_SLEW_RATE_MASK 0x07 | 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 |
15 | 15 | ||
16 | /* VERSION CRC */ | ||
17 | #define TPS658621A 0x15 | ||
18 | #define TPS658621CD 0x2c | ||
19 | #define TPS658623 0x1b | ||
20 | #define TPS658643 0x03 | ||
21 | |||
16 | enum { | 22 | enum { |
17 | TPS6586X_ID_SYS, | 23 | TPS6586X_ID_SYS, |
18 | TPS6586X_ID_SM_0, | 24 | TPS6586X_ID_SM_0, |
@@ -97,5 +103,6 @@ extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | |||
97 | extern int tps6586x_update(struct device *dev, int reg, uint8_t val, | 103 | extern int tps6586x_update(struct device *dev, int reg, uint8_t val, |
98 | uint8_t mask); | 104 | uint8_t mask); |
99 | extern int tps6586x_irq_get_virq(struct device *dev, int irq); | 105 | extern int tps6586x_irq_get_virq(struct device *dev, int irq); |
106 | extern int tps6586x_get_version(struct device *dev); | ||
100 | 107 | ||
101 | #endif /*__LINUX_MFD_TPS6586X_H */ | 108 | #endif /*__LINUX_MFD_TPS6586X_H */ |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index ad05ce60c1c9..2e5b194b9b19 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #define PHY_ID_KSZ8021 0x00221555 | 22 | #define PHY_ID_KSZ8021 0x00221555 |
23 | #define PHY_ID_KSZ8031 0x00221556 | 23 | #define PHY_ID_KSZ8031 0x00221556 |
24 | #define PHY_ID_KSZ8041 0x00221510 | 24 | #define PHY_ID_KSZ8041 0x00221510 |
25 | /* undocumented */ | ||
26 | #define PHY_ID_KSZ8041RNLI 0x00221537 | ||
25 | #define PHY_ID_KSZ8051 0x00221550 | 27 | #define PHY_ID_KSZ8051 0x00221550 |
26 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ | 28 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ |
27 | #define PHY_ID_KSZ8001 0x0022161A | 29 | #define PHY_ID_KSZ8001 0x0022161A |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index f5096b58b20d..f015c059e159 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -55,7 +55,8 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
55 | struct page *newpage, struct page *page); | 55 | struct page *newpage, struct page *page); |
56 | extern int migrate_page_move_mapping(struct address_space *mapping, | 56 | extern int migrate_page_move_mapping(struct address_space *mapping, |
57 | struct page *newpage, struct page *page, | 57 | struct page *newpage, struct page *page, |
58 | struct buffer_head *head, enum migrate_mode mode); | 58 | struct buffer_head *head, enum migrate_mode mode, |
59 | int extra_count); | ||
59 | #else | 60 | #else |
60 | 61 | ||
61 | static inline void putback_lru_pages(struct list_head *l) {} | 62 | static inline void putback_lru_pages(struct list_head *l) {} |
@@ -90,10 +91,19 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
90 | #endif /* CONFIG_MIGRATION */ | 91 | #endif /* CONFIG_MIGRATION */ |
91 | 92 | ||
92 | #ifdef CONFIG_NUMA_BALANCING | 93 | #ifdef CONFIG_NUMA_BALANCING |
94 | extern bool pmd_trans_migrating(pmd_t pmd); | ||
95 | extern void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd); | ||
93 | extern int migrate_misplaced_page(struct page *page, | 96 | extern int migrate_misplaced_page(struct page *page, |
94 | struct vm_area_struct *vma, int node); | 97 | struct vm_area_struct *vma, int node); |
95 | extern bool migrate_ratelimited(int node); | 98 | extern bool migrate_ratelimited(int node); |
96 | #else | 99 | #else |
100 | static inline bool pmd_trans_migrating(pmd_t pmd) | ||
101 | { | ||
102 | return false; | ||
103 | } | ||
104 | static inline void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd) | ||
105 | { | ||
106 | } | ||
97 | static inline int migrate_misplaced_page(struct page *page, | 107 | static inline int migrate_misplaced_page(struct page *page, |
98 | struct vm_area_struct *vma, int node) | 108 | struct vm_area_struct *vma, int node) |
99 | { | 109 | { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1cedd000cf29..35527173cf50 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1317,7 +1317,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
1317 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ | 1317 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ |
1318 | 1318 | ||
1319 | #if USE_SPLIT_PTE_PTLOCKS | 1319 | #if USE_SPLIT_PTE_PTLOCKS |
1320 | #if BLOATED_SPINLOCKS | 1320 | #if ALLOC_SPLIT_PTLOCKS |
1321 | extern bool ptlock_alloc(struct page *page); | 1321 | extern bool ptlock_alloc(struct page *page); |
1322 | extern void ptlock_free(struct page *page); | 1322 | extern void ptlock_free(struct page *page); |
1323 | 1323 | ||
@@ -1325,7 +1325,7 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
1325 | { | 1325 | { |
1326 | return page->ptl; | 1326 | return page->ptl; |
1327 | } | 1327 | } |
1328 | #else /* BLOATED_SPINLOCKS */ | 1328 | #else /* ALLOC_SPLIT_PTLOCKS */ |
1329 | static inline bool ptlock_alloc(struct page *page) | 1329 | static inline bool ptlock_alloc(struct page *page) |
1330 | { | 1330 | { |
1331 | return true; | 1331 | return true; |
@@ -1339,7 +1339,7 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
1339 | { | 1339 | { |
1340 | return &page->ptl; | 1340 | return &page->ptl; |
1341 | } | 1341 | } |
1342 | #endif /* BLOATED_SPINLOCKS */ | 1342 | #endif /* ALLOC_SPLIT_PTLOCKS */ |
1343 | 1343 | ||
1344 | static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | 1344 | static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) |
1345 | { | 1345 | { |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bd299418a934..290901a8c1de 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -26,6 +26,7 @@ struct address_space; | |||
26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) | 26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) |
27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ | 27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ |
28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) | 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) |
29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Each physical page in the system has a struct page associated with | 32 | * Each physical page in the system has a struct page associated with |
@@ -155,7 +156,7 @@ struct page { | |||
155 | * system if PG_buddy is set. | 156 | * system if PG_buddy is set. |
156 | */ | 157 | */ |
157 | #if USE_SPLIT_PTE_PTLOCKS | 158 | #if USE_SPLIT_PTE_PTLOCKS |
158 | #if BLOATED_SPINLOCKS | 159 | #if ALLOC_SPLIT_PTLOCKS |
159 | spinlock_t *ptl; | 160 | spinlock_t *ptl; |
160 | #else | 161 | #else |
161 | spinlock_t ptl; | 162 | spinlock_t ptl; |
@@ -443,6 +444,14 @@ struct mm_struct { | |||
443 | /* numa_scan_seq prevents two threads setting pte_numa */ | 444 | /* numa_scan_seq prevents two threads setting pte_numa */ |
444 | int numa_scan_seq; | 445 | int numa_scan_seq; |
445 | #endif | 446 | #endif |
447 | #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) | ||
448 | /* | ||
449 | * An operation with batched TLB flushing is going on. Anything that | ||
450 | * can move process memory needs to flush the TLB when moving a | ||
451 | * PROT_NONE or PROT_NUMA mapped page. | ||
452 | */ | ||
453 | bool tlb_flush_pending; | ||
454 | #endif | ||
446 | struct uprobes_state uprobes_state; | 455 | struct uprobes_state uprobes_state; |
447 | }; | 456 | }; |
448 | 457 | ||
@@ -459,4 +468,45 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm) | |||
459 | return mm->cpu_vm_mask_var; | 468 | return mm->cpu_vm_mask_var; |
460 | } | 469 | } |
461 | 470 | ||
471 | #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) | ||
472 | /* | ||
473 | * Memory barriers to keep this state in sync are graciously provided by | ||
474 | * the page table locks, outside of which no page table modifications happen. | ||
475 | * The barriers below prevent the compiler from re-ordering the instructions | ||
476 | * around the memory barriers that are already present in the code. | ||
477 | */ | ||
478 | static inline bool mm_tlb_flush_pending(struct mm_struct *mm) | ||
479 | { | ||
480 | barrier(); | ||
481 | return mm->tlb_flush_pending; | ||
482 | } | ||
483 | static inline void set_tlb_flush_pending(struct mm_struct *mm) | ||
484 | { | ||
485 | mm->tlb_flush_pending = true; | ||
486 | |||
487 | /* | ||
488 | * Guarantee that the tlb_flush_pending store does not leak into the | ||
489 | * critical section updating the page tables | ||
490 | */ | ||
491 | smp_mb__before_spinlock(); | ||
492 | } | ||
493 | /* Clearing is done after a TLB flush, which also provides a barrier. */ | ||
494 | static inline void clear_tlb_flush_pending(struct mm_struct *mm) | ||
495 | { | ||
496 | barrier(); | ||
497 | mm->tlb_flush_pending = false; | ||
498 | } | ||
499 | #else | ||
500 | static inline bool mm_tlb_flush_pending(struct mm_struct *mm) | ||
501 | { | ||
502 | return false; | ||
503 | } | ||
504 | static inline void set_tlb_flush_pending(struct mm_struct *mm) | ||
505 | { | ||
506 | } | ||
507 | static inline void clear_tlb_flush_pending(struct mm_struct *mm) | ||
508 | { | ||
509 | } | ||
510 | #endif | ||
511 | |||
462 | #endif /* _LINUX_MM_TYPES_H */ | 512 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/net.h b/include/linux/net.h index 4bcee94cef93..69be3e6079c8 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -181,7 +181,7 @@ struct proto_ops { | |||
181 | int offset, size_t size, int flags); | 181 | int offset, size_t size, int flags); |
182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, |
183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
184 | void (*set_peek_off)(struct sock *sk, int val); | 184 | int (*set_peek_off)(struct sock *sk, int val); |
185 | }; | 185 | }; |
186 | 186 | ||
187 | #define DECLARE_SOCKADDR(type, dst, src) \ | 187 | #define DECLARE_SOCKADDR(type, dst, src) \ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed423a360..ce2a1f5f9a1e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -769,7 +769,8 @@ struct netdev_phys_port_id { | |||
769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) | 769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) |
770 | * Required can not be NULL. | 770 | * Required can not be NULL. |
771 | * | 771 | * |
772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | 772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
773 | * void *accel_priv); | ||
773 | * Called to decide which queue to when device supports multiple | 774 | * Called to decide which queue to when device supports multiple |
774 | * transmit queues. | 775 | * transmit queues. |
775 | * | 776 | * |
@@ -990,7 +991,8 @@ struct net_device_ops { | |||
990 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, | 991 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, |
991 | struct net_device *dev); | 992 | struct net_device *dev); |
992 | u16 (*ndo_select_queue)(struct net_device *dev, | 993 | u16 (*ndo_select_queue)(struct net_device *dev, |
993 | struct sk_buff *skb); | 994 | struct sk_buff *skb, |
995 | void *accel_priv); | ||
994 | void (*ndo_change_rx_flags)(struct net_device *dev, | 996 | void (*ndo_change_rx_flags)(struct net_device *dev, |
995 | int flags); | 997 | int flags); |
996 | void (*ndo_set_rx_mode)(struct net_device *dev); | 998 | void (*ndo_set_rx_mode)(struct net_device *dev); |
@@ -1255,7 +1257,7 @@ struct net_device { | |||
1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1257 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
1256 | unsigned char addr_assign_type; /* hw address assignment type */ | 1258 | unsigned char addr_assign_type; /* hw address assignment type */ |
1257 | unsigned char addr_len; /* hardware address length */ | 1259 | unsigned char addr_len; /* hardware address length */ |
1258 | unsigned char neigh_priv_len; | 1260 | unsigned short neigh_priv_len; |
1259 | unsigned short dev_id; /* Used to differentiate devices | 1261 | unsigned short dev_id; /* Used to differentiate devices |
1260 | * that share the same link | 1262 | * that share the same link |
1261 | * layer address | 1263 | * layer address |
@@ -1529,7 +1531,8 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
1529 | } | 1531 | } |
1530 | 1532 | ||
1531 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1533 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
1532 | struct sk_buff *skb); | 1534 | struct sk_buff *skb, |
1535 | void *accel_priv); | ||
1533 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | 1536 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); |
1534 | 1537 | ||
1535 | /* | 1538 | /* |
@@ -1819,6 +1822,7 @@ int dev_close(struct net_device *dev); | |||
1819 | void dev_disable_lro(struct net_device *dev); | 1822 | void dev_disable_lro(struct net_device *dev); |
1820 | int dev_loopback_xmit(struct sk_buff *newskb); | 1823 | int dev_loopback_xmit(struct sk_buff *newskb); |
1821 | int dev_queue_xmit(struct sk_buff *skb); | 1824 | int dev_queue_xmit(struct sk_buff *skb); |
1825 | int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); | ||
1822 | int register_netdevice(struct net_device *dev); | 1826 | int register_netdevice(struct net_device *dev); |
1823 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); | 1827 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); |
1824 | void unregister_netdevice_many(struct list_head *head); | 1828 | void unregister_netdevice_many(struct list_head *head); |
@@ -1912,6 +1916,15 @@ static inline int dev_parse_header(const struct sk_buff *skb, | |||
1912 | return dev->header_ops->parse(skb, haddr); | 1916 | return dev->header_ops->parse(skb, haddr); |
1913 | } | 1917 | } |
1914 | 1918 | ||
1919 | static inline int dev_rebuild_header(struct sk_buff *skb) | ||
1920 | { | ||
1921 | const struct net_device *dev = skb->dev; | ||
1922 | |||
1923 | if (!dev->header_ops || !dev->header_ops->rebuild) | ||
1924 | return 0; | ||
1925 | return dev->header_ops->rebuild(skb); | ||
1926 | } | ||
1927 | |||
1915 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); | 1928 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); |
1916 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); | 1929 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); |
1917 | static inline int unregister_gifconf(unsigned int family) | 1930 | static inline int unregister_gifconf(unsigned int family) |
@@ -2417,7 +2430,7 @@ int dev_change_carrier(struct net_device *, bool new_carrier); | |||
2417 | int dev_get_phys_port_id(struct net_device *dev, | 2430 | int dev_get_phys_port_id(struct net_device *dev, |
2418 | struct netdev_phys_port_id *ppid); | 2431 | struct netdev_phys_port_id *ppid); |
2419 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | 2432 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, |
2420 | struct netdev_queue *txq, void *accel_priv); | 2433 | struct netdev_queue *txq); |
2421 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 2434 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
2422 | 2435 | ||
2423 | extern int netdev_budget; | 2436 | extern int netdev_budget; |
@@ -3008,6 +3021,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
3008 | dev->gso_max_size = size; | 3021 | dev->gso_max_size = size; |
3009 | } | 3022 | } |
3010 | 3023 | ||
3024 | static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, | ||
3025 | int pulled_hlen, u16 mac_offset, | ||
3026 | int mac_len) | ||
3027 | { | ||
3028 | skb->protocol = protocol; | ||
3029 | skb->encapsulation = 1; | ||
3030 | skb_push(skb, pulled_hlen); | ||
3031 | skb_reset_transport_header(skb); | ||
3032 | skb->mac_header = mac_offset; | ||
3033 | skb->network_header = skb->mac_header + mac_len; | ||
3034 | skb->mac_len = mac_len; | ||
3035 | } | ||
3036 | |||
3011 | static inline bool netif_is_macvlan(struct net_device *dev) | 3037 | static inline bool netif_is_macvlan(struct net_device *dev) |
3012 | { | 3038 | { |
3013 | return dev->priv_flags & IFF_MACVLAN; | 3039 | return dev->priv_flags & IFF_MACVLAN; |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c1637062c1ce..12c2cb947df5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -413,16 +413,6 @@ enum lock_type4 { | |||
413 | #define NFS4_VERSION 4 | 413 | #define NFS4_VERSION 4 |
414 | #define NFS4_MINOR_VERSION 0 | 414 | #define NFS4_MINOR_VERSION 0 |
415 | 415 | ||
416 | #if defined(CONFIG_NFS_V4_2) | ||
417 | #define NFS4_MAX_MINOR_VERSION 2 | ||
418 | #else | ||
419 | #if defined(CONFIG_NFS_V4_1) | ||
420 | #define NFS4_MAX_MINOR_VERSION 1 | ||
421 | #else | ||
422 | #define NFS4_MAX_MINOR_VERSION 0 | ||
423 | #endif /* CONFIG_NFS_V4_1 */ | ||
424 | #endif /* CONFIG_NFS_V4_2 */ | ||
425 | |||
426 | #define NFS4_DEBUG 1 | 416 | #define NFS4_DEBUG 1 |
427 | 417 | ||
428 | /* Index of predefined Linux client operations */ | 418 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 14a48207a304..48997374eaf0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -507,24 +507,6 @@ extern int nfs_mountpoint_expiry_timeout; | |||
507 | extern void nfs_release_automount_timer(void); | 507 | extern void nfs_release_automount_timer(void); |
508 | 508 | ||
509 | /* | 509 | /* |
510 | * linux/fs/nfs/nfs4proc.c | ||
511 | */ | ||
512 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
513 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
514 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
515 | { | ||
516 | if (label) { | ||
517 | kfree(label->label); | ||
518 | kfree(label); | ||
519 | } | ||
520 | return; | ||
521 | } | ||
522 | #else | ||
523 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
524 | static inline void nfs4_label_free(void *label) {} | ||
525 | #endif | ||
526 | |||
527 | /* | ||
528 | * linux/fs/nfs/unlink.c | 510 | * linux/fs/nfs/unlink.c |
529 | */ | 511 | */ |
530 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 512 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1084a15175e0..a13d6825e586 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -960,6 +960,7 @@ void pci_update_resource(struct pci_dev *dev, int resno); | |||
960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
961 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); | 961 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); |
962 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 962 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
963 | bool pci_device_is_present(struct pci_dev *pdev); | ||
963 | 964 | ||
964 | /* ROM control related routines */ | 965 | /* ROM control related routines */ |
965 | int pci_enable_rom(struct pci_dev *pdev); | 966 | int pci_enable_rom(struct pci_dev *pdev); |
@@ -1567,65 +1568,65 @@ enum pci_fixup_pass { | |||
1567 | /* Anonymous variables would be nice... */ | 1568 | /* Anonymous variables would be nice... */ |
1568 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1569 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
1569 | class_shift, hook) \ | 1570 | class_shift, hook) \ |
1570 | static const struct pci_fixup __pci_fixup_##name __used \ | 1571 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
1571 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1572 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
1572 | = { vendor, device, class, class_shift, hook }; | 1573 | = { vendor, device, class, class_shift, hook }; |
1573 | 1574 | ||
1574 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1575 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
1575 | class_shift, hook) \ | 1576 | class_shift, hook) \ |
1576 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1577 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
1577 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1578 | hook, vendor, device, class, class_shift, hook) |
1578 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ | 1579 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ |
1579 | class_shift, hook) \ | 1580 | class_shift, hook) \ |
1580 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1581 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
1581 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1582 | hook, vendor, device, class, class_shift, hook) |
1582 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ | 1583 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ |
1583 | class_shift, hook) \ | 1584 | class_shift, hook) \ |
1584 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1585 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
1585 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1586 | hook, vendor, device, class, class_shift, hook) |
1586 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ | 1587 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ |
1587 | class_shift, hook) \ | 1588 | class_shift, hook) \ |
1588 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1589 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
1589 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1590 | hook, vendor, device, class, class_shift, hook) |
1590 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ | 1591 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ |
1591 | class_shift, hook) \ | 1592 | class_shift, hook) \ |
1592 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1593 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
1593 | resume##vendor##device##hook, vendor, device, class, \ | 1594 | resume##hook, vendor, device, class, \ |
1594 | class_shift, hook) | 1595 | class_shift, hook) |
1595 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ | 1596 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ |
1596 | class_shift, hook) \ | 1597 | class_shift, hook) \ |
1597 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1598 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
1598 | resume_early##vendor##device##hook, vendor, device, \ | 1599 | resume_early##hook, vendor, device, \ |
1599 | class, class_shift, hook) | 1600 | class, class_shift, hook) |
1600 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ | 1601 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ |
1601 | class_shift, hook) \ | 1602 | class_shift, hook) \ |
1602 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1603 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1603 | suspend##vendor##device##hook, vendor, device, class, \ | 1604 | suspend##hook, vendor, device, class, \ |
1604 | class_shift, hook) | 1605 | class_shift, hook) |
1605 | 1606 | ||
1606 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1607 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
1607 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1608 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
1608 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1609 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1609 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ | 1610 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ |
1610 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1611 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
1611 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1612 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1612 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ | 1613 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ |
1613 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1614 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
1614 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1615 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1615 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 1616 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
1616 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1617 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
1617 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1618 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1618 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | 1619 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ |
1619 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1620 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
1620 | resume##vendor##device##hook, vendor, device, \ | 1621 | resume##hook, vendor, device, \ |
1621 | PCI_ANY_ID, 0, hook) | 1622 | PCI_ANY_ID, 0, hook) |
1622 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ | 1623 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ |
1623 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1624 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
1624 | resume_early##vendor##device##hook, vendor, device, \ | 1625 | resume_early##hook, vendor, device, \ |
1625 | PCI_ANY_ID, 0, hook) | 1626 | PCI_ANY_ID, 0, hook) |
1626 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ | 1627 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ |
1627 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1628 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1628 | suspend##vendor##device##hook, vendor, device, \ | 1629 | suspend##hook, vendor, device, \ |
1629 | PCI_ANY_ID, 0, hook) | 1630 | PCI_ANY_ID, 0, hook) |
1630 | 1631 | ||
1631 | #ifdef CONFIG_PCI_QUIRKS | 1632 | #ifdef CONFIG_PCI_QUIRKS |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 57e890abe1f0..a5fc7d01aad6 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -69,6 +69,7 @@ | |||
69 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | 69 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ |
70 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 70 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
71 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 71 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
72 | extern __PCPU_ATTRS(sec) __typeof__(type) name; \ | ||
72 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ | 73 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ |
73 | __typeof__(type) name | 74 | __typeof__(type) name |
74 | #else | 75 | #else |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2e069d1288df..e56b07f5c9b6 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -320,6 +320,7 @@ struct perf_event { | |||
320 | struct list_head migrate_entry; | 320 | struct list_head migrate_entry; |
321 | 321 | ||
322 | struct hlist_node hlist_entry; | 322 | struct hlist_node hlist_entry; |
323 | struct list_head active_entry; | ||
323 | int nr_siblings; | 324 | int nr_siblings; |
324 | int group_flags; | 325 | int group_flags; |
325 | struct perf_event *group_leader; | 326 | struct perf_event *group_leader; |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 6d722695e027..e273e5ac19c9 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
@@ -38,6 +38,14 @@ struct phy_ops { | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * struct phy_attrs - represents phy attributes | ||
42 | * @bus_width: Data path width implemented by PHY | ||
43 | */ | ||
44 | struct phy_attrs { | ||
45 | u32 bus_width; | ||
46 | }; | ||
47 | |||
48 | /** | ||
41 | * struct phy - represents the phy device | 49 | * struct phy - represents the phy device |
42 | * @dev: phy device | 50 | * @dev: phy device |
43 | * @id: id of the phy device | 51 | * @id: id of the phy device |
@@ -46,6 +54,7 @@ struct phy_ops { | |||
46 | * @mutex: mutex to protect phy_ops | 54 | * @mutex: mutex to protect phy_ops |
47 | * @init_count: used to protect when the PHY is used by multiple consumers | 55 | * @init_count: used to protect when the PHY is used by multiple consumers |
48 | * @power_count: used to protect when the PHY is used by multiple consumers | 56 | * @power_count: used to protect when the PHY is used by multiple consumers |
57 | * @phy_attrs: used to specify PHY specific attributes | ||
49 | */ | 58 | */ |
50 | struct phy { | 59 | struct phy { |
51 | struct device dev; | 60 | struct device dev; |
@@ -55,6 +64,7 @@ struct phy { | |||
55 | struct mutex mutex; | 64 | struct mutex mutex; |
56 | int init_count; | 65 | int init_count; |
57 | int power_count; | 66 | int power_count; |
67 | struct phy_attrs attrs; | ||
58 | }; | 68 | }; |
59 | 69 | ||
60 | /** | 70 | /** |
@@ -127,6 +137,14 @@ int phy_init(struct phy *phy); | |||
127 | int phy_exit(struct phy *phy); | 137 | int phy_exit(struct phy *phy); |
128 | int phy_power_on(struct phy *phy); | 138 | int phy_power_on(struct phy *phy); |
129 | int phy_power_off(struct phy *phy); | 139 | int phy_power_off(struct phy *phy); |
140 | static inline int phy_get_bus_width(struct phy *phy) | ||
141 | { | ||
142 | return phy->attrs.bus_width; | ||
143 | } | ||
144 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) | ||
145 | { | ||
146 | phy->attrs.bus_width = bus_width; | ||
147 | } | ||
130 | struct phy *phy_get(struct device *dev, const char *string); | 148 | struct phy *phy_get(struct device *dev, const char *string); |
131 | struct phy *devm_phy_get(struct device *dev, const char *string); | 149 | struct phy *devm_phy_get(struct device *dev, const char *string); |
132 | void phy_put(struct phy *phy); | 150 | void phy_put(struct phy *phy); |
@@ -199,6 +217,16 @@ static inline int phy_power_off(struct phy *phy) | |||
199 | return -ENOSYS; | 217 | return -ENOSYS; |
200 | } | 218 | } |
201 | 219 | ||
220 | static inline int phy_get_bus_width(struct phy *phy) | ||
221 | { | ||
222 | return -ENOSYS; | ||
223 | } | ||
224 | |||
225 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) | ||
226 | { | ||
227 | return; | ||
228 | } | ||
229 | |||
202 | static inline struct phy *phy_get(struct device *dev, const char *string) | 230 | static inline struct phy *phy_get(struct device *dev, const char *string) |
203 | { | 231 | { |
204 | return ERR_PTR(-ENOSYS); | 232 | return ERR_PTR(-ENOSYS); |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index fb90ef5eb038..a15f10727eb8 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -61,6 +61,9 @@ | |||
61 | * argument is ignored. | 61 | * argument is ignored. |
62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current | 62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current |
63 | * passed as argument. The argument is in mA. | 63 | * passed as argument. The argument is in mA. |
64 | * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not | ||
65 | * affect the pin's ability to drive output. 1 enables input, 0 disables | ||
66 | * input. | ||
64 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. | 67 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. |
65 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, | 68 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, |
66 | * schmitt-trigger mode is disabled. | 69 | * schmitt-trigger mode is disabled. |
@@ -82,8 +85,10 @@ | |||
82 | * operation, if several modes of operation are supported these can be | 85 | * operation, if several modes of operation are supported these can be |
83 | * passed in the argument on a custom form, else just use argument 1 | 86 | * passed in the argument on a custom form, else just use argument 1 |
84 | * to indicate low power mode, argument 0 turns low power mode off. | 87 | * to indicate low power mode, argument 0 turns low power mode off. |
85 | * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument | 88 | * @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument |
86 | * 1 to indicate high level, argument 0 to indicate low level. | 89 | * 1 to indicate high level, argument 0 to indicate low level. (Please |
90 | * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a | ||
91 | * discussion around this parameter.) | ||
87 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if | 92 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if |
88 | * you need to pass in custom configurations to the pin controller, use | 93 | * you need to pass in custom configurations to the pin controller, use |
89 | * PIN_CONFIG_END+1 as the base offset. | 94 | * PIN_CONFIG_END+1 as the base offset. |
@@ -99,6 +104,7 @@ enum pin_config_param { | |||
99 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 104 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
100 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 105 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
101 | PIN_CONFIG_DRIVE_STRENGTH, | 106 | PIN_CONFIG_DRIVE_STRENGTH, |
107 | PIN_CONFIG_INPUT_ENABLE, | ||
102 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, | 108 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, |
103 | PIN_CONFIG_INPUT_SCHMITT, | 109 | PIN_CONFIG_INPUT_SCHMITT, |
104 | PIN_CONFIG_INPUT_DEBOUNCE, | 110 | PIN_CONFIG_INPUT_DEBOUNCE, |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb88663975..cc8e1aff0e28 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -32,10 +32,12 @@ struct device_node; | |||
32 | * pins, pads or other muxable units in this struct | 32 | * pins, pads or other muxable units in this struct |
33 | * @number: unique pin number from the global pin number space | 33 | * @number: unique pin number from the global pin number space |
34 | * @name: a name for this pin | 34 | * @name: a name for this pin |
35 | * @drv_data: driver-defined per-pin data. pinctrl core does not touch this | ||
35 | */ | 36 | */ |
36 | struct pinctrl_pin_desc { | 37 | struct pinctrl_pin_desc { |
37 | unsigned number; | 38 | unsigned number; |
38 | const char *name; | 39 | const char *name; |
40 | void *drv_data; | ||
39 | }; | 41 | }; |
40 | 42 | ||
41 | /* Convenience macro to define a single named or anonymous pin descriptor */ | 43 | /* Convenience macro to define a single named or anonymous pin descriptor */ |
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h index c78d90b28b19..3c73c045f8da 100644 --- a/include/linux/platform_data/asoc-ti-mcbsp.h +++ b/include/linux/platform_data/asoc-ti-mcbsp.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/mcbsp.h | ||
3 | * | ||
4 | * Defines for Multi-Channel Buffered Serial Port | 2 | * Defines for Multi-Channel Buffered Serial Port |
5 | * | 3 | * |
6 | * Copyright (C) 2002 RidgeRun, Inc. | 4 | * Copyright (C) 2002 RidgeRun, Inc. |
@@ -21,8 +19,8 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | * | 20 | * |
23 | */ | 21 | */ |
24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | 22 | #ifndef __ASOC_TI_MCBSP_H |
25 | #define __ASM_ARCH_OMAP_MCBSP_H | 23 | #define __ASOC_TI_MCBSP_H |
26 | 24 | ||
27 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
28 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
diff --git a/include/linux/platform_data/asoc-ux500-msp.h b/include/linux/platform_data/asoc-ux500-msp.h index 9991aea3d577..2f34bb98fe2a 100644 --- a/include/linux/platform_data/asoc-ux500-msp.h +++ b/include/linux/platform_data/asoc-ux500-msp.h | |||
@@ -10,16 +10,9 @@ | |||
10 | 10 | ||
11 | #include <linux/platform_data/dma-ste-dma40.h> | 11 | #include <linux/platform_data/dma-ste-dma40.h> |
12 | 12 | ||
13 | enum msp_i2s_id { | ||
14 | MSP_I2S_0 = 0, | ||
15 | MSP_I2S_1, | ||
16 | MSP_I2S_2, | ||
17 | MSP_I2S_3, | ||
18 | }; | ||
19 | |||
20 | /* Platform data structure for a MSP I2S-device */ | 13 | /* Platform data structure for a MSP I2S-device */ |
21 | struct msp_i2s_platform_data { | 14 | struct msp_i2s_platform_data { |
22 | enum msp_i2s_id id; | 15 | int id; |
23 | struct stedma40_chan_cfg *msp_i2s_dma_rx; | 16 | struct stedma40_chan_cfg *msp_i2s_dma_rx; |
24 | struct stedma40_chan_cfg *msp_i2s_dma_tx; | 17 | struct stedma40_chan_cfg *msp_i2s_dma_tx; |
25 | }; | 18 | }; |
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h index 689a856b86f9..5245992b0367 100644 --- a/include/linux/platform_data/davinci_asp.h +++ b/include/linux/platform_data/davinci_asp.h | |||
@@ -92,6 +92,7 @@ enum { | |||
92 | MCASP_VERSION_1 = 0, /* DM646x */ | 92 | MCASP_VERSION_1 = 0, /* DM646x */ |
93 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ | 93 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ |
94 | MCASP_VERSION_3, /* TI81xx/AM33xx */ | 94 | MCASP_VERSION_3, /* TI81xx/AM33xx */ |
95 | MCASP_VERSION_4, /* DRA7xxx */ | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | enum mcbsp_clk_input_pin { | 98 | enum mcbsp_clk_input_pin { |
diff --git a/include/linux/platform_data/gpio-lpc32xx.h b/include/linux/platform_data/gpio-lpc32xx.h new file mode 100644 index 000000000000..a544e962a818 --- /dev/null +++ b/include/linux/platform_data/gpio-lpc32xx.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Author: Kevin Wells <kevin.wells@nxp.com> | ||
3 | * | ||
4 | * Copyright (C) 2010 NXP Semiconductors | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __MACH_GPIO_LPC32XX_H | ||
18 | #define __MACH_GPIO_LPC32XX_H | ||
19 | |||
20 | /* | ||
21 | * Note! | ||
22 | * Muxed GP pins need to be setup to the GP state in the board level | ||
23 | * code prior to using this driver. | ||
24 | * GPI pins : 28xP3 group | ||
25 | * GPO pins : 24xP3 group | ||
26 | * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group | ||
27 | */ | ||
28 | |||
29 | #define LPC32XX_GPIO_P0_MAX 8 | ||
30 | #define LPC32XX_GPIO_P1_MAX 24 | ||
31 | #define LPC32XX_GPIO_P2_MAX 13 | ||
32 | #define LPC32XX_GPIO_P3_MAX 6 | ||
33 | #define LPC32XX_GPI_P3_MAX 29 | ||
34 | #define LPC32XX_GPO_P3_MAX 24 | ||
35 | |||
36 | #define LPC32XX_GPIO_P0_GRP 0 | ||
37 | #define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX) | ||
38 | #define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX) | ||
39 | #define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX) | ||
40 | #define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX) | ||
41 | #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX) | ||
42 | |||
43 | /* | ||
44 | * A specific GPIO can be selected with this macro | ||
45 | * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5) | ||
46 | * See the LPC32x0 User's guide for GPIO group numbers | ||
47 | */ | ||
48 | #define LPC32XX_GPIO(x, y) ((x) + (y)) | ||
49 | |||
50 | #endif /* __MACH_GPIO_LPC32XX_H */ | ||
diff --git a/include/linux/platform_data/hwmon-s3c.h b/include/linux/platform_data/hwmon-s3c.h index c167e4429bc7..0e3cce130fe2 100644 --- a/include/linux/platform_data/hwmon-s3c.h +++ b/include/linux/platform_data/hwmon-s3c.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* linux/arch/arm/plat-s3c/include/plat/hwmon.h | 1 | /* |
2 | * | ||
3 | * Copyright 2005 Simtec Electronics | 2 | * Copyright 2005 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 3 | * Ben Dooks <ben@simtec.co.uk> |
5 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
@@ -11,8 +10,8 @@ | |||
11 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
12 | */ | 11 | */ |
13 | 12 | ||
14 | #ifndef __ASM_ARCH_ADC_HWMON_H | 13 | #ifndef __HWMON_S3C_H__ |
15 | #define __ASM_ARCH_ADC_HWMON_H __FILE__ | 14 | #define __HWMON_S3C_H__ |
16 | 15 | ||
17 | /** | 16 | /** |
18 | * s3c_hwmon_chcfg - channel configuration | 17 | * s3c_hwmon_chcfg - channel configuration |
@@ -47,5 +46,4 @@ struct s3c_hwmon_pdata { | |||
47 | */ | 46 | */ |
48 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); | 47 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); |
49 | 48 | ||
50 | #endif /* __ASM_ARCH_ADC_HWMON_H */ | 49 | #endif /* __HWMON_S3C_H__ */ |
51 | |||
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h deleted file mode 100644 index 3a8be9cdc95c..000000000000 --- a/include/linux/platform_data/i2c-nomadik.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 ST-Ericsson | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __PDATA_I2C_NOMADIK_H | ||
9 | #define __PDATA_I2C_NOMADIK_H | ||
10 | |||
11 | enum i2c_freq_mode { | ||
12 | I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */ | ||
13 | I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */ | ||
14 | I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */ | ||
15 | I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */ | ||
16 | }; | ||
17 | |||
18 | /** | ||
19 | * struct nmk_i2c_controller - client specific controller configuration | ||
20 | * @clk_freq: clock frequency for the operation mode | ||
21 | * @slsu: Slave data setup time in ns. | ||
22 | * The needed setup time for three modes of operation | ||
23 | * are 250ns, 100ns and 10ns respectively thus leading | ||
24 | * to the values of 14, 6, 2 for a 48 MHz i2c clk | ||
25 | * @tft: Tx FIFO Threshold in bytes | ||
26 | * @rft: Rx FIFO Threshold in bytes | ||
27 | * @timeout Slave response timeout(ms) | ||
28 | * @sm: speed mode | ||
29 | */ | ||
30 | struct nmk_i2c_controller { | ||
31 | u32 clk_freq; | ||
32 | unsigned short slsu; | ||
33 | unsigned char tft; | ||
34 | unsigned char rft; | ||
35 | int timeout; | ||
36 | enum i2c_freq_mode sm; | ||
37 | }; | ||
38 | |||
39 | #endif /* __PDATA_I2C_NOMADIK_H */ | ||
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h index e2a41dd7690c..8da8f94ee15c 100644 --- a/include/linux/platform_data/max197.h +++ b/include/linux/platform_data/max197.h | |||
@@ -11,6 +11,9 @@ | |||
11 | * For further information, see the Documentation/hwmon/max197 file. | 11 | * For further information, see the Documentation/hwmon/max197 file. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef _PDATA_MAX197_H | ||
15 | #define _PDATA_MAX197_H | ||
16 | |||
14 | /** | 17 | /** |
15 | * struct max197_platform_data - MAX197 connectivity info | 18 | * struct max197_platform_data - MAX197 connectivity info |
16 | * @convert: Function used to start a conversion with control byte ctrl. | 19 | * @convert: Function used to start a conversion with control byte ctrl. |
@@ -19,3 +22,5 @@ | |||
19 | struct max197_platform_data { | 22 | struct max197_platform_data { |
20 | int (*convert)(u8 ctrl); | 23 | int (*convert)(u8 ctrl); |
21 | }; | 24 | }; |
25 | |||
26 | #endif /* _PDATA_MAX197_H */ | ||
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h index 4b2860ae3828..747cd6baf711 100644 --- a/include/linux/platform_data/mfd-mcp-sa11x0.h +++ b/include/linux/platform_data/mfd-mcp-sa11x0.h | |||
@@ -1,14 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-sa1100/include/mach/mcp.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Russell King. | 2 | * Copyright (C) 2005 Russell King. |
5 | * | 3 | * |
6 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
9 | */ | 7 | */ |
10 | #ifndef __ASM_ARM_ARCH_MCP_H | 8 | #ifndef __MFD_MCP_SA11X0_H |
11 | #define __ASM_ARM_ARCH_MCP_H | 9 | #define __MFD_MCP_SA11X0_H |
12 | 10 | ||
13 | #include <linux/types.h> | 11 | #include <linux/types.h> |
14 | 12 | ||
diff --git a/include/linux/platform_data/sht15.h b/include/linux/platform_data/sht15.h index 33e0fd27225e..12289c1e9413 100644 --- a/include/linux/platform_data/sht15.h +++ b/include/linux/platform_data/sht15.h | |||
@@ -12,6 +12,9 @@ | |||
12 | * For further information, see the Documentation/hwmon/sht15 file. | 12 | * For further information, see the Documentation/hwmon/sht15 file. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef _PDATA_SHT15_H | ||
16 | #define _PDATA_SHT15_H | ||
17 | |||
15 | /** | 18 | /** |
16 | * struct sht15_platform_data - sht15 connectivity info | 19 | * struct sht15_platform_data - sht15 connectivity info |
17 | * @gpio_data: no. of gpio to which bidirectional data line is | 20 | * @gpio_data: no. of gpio to which bidirectional data line is |
@@ -31,3 +34,5 @@ struct sht15_platform_data { | |||
31 | bool no_otp_reload; | 34 | bool no_otp_reload; |
32 | bool low_resolution; | 35 | bool low_resolution; |
33 | }; | 36 | }; |
37 | |||
38 | #endif /* _PDATA_SHT15_H */ | ||
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h index 6fc78e430420..52b0acb35fd7 100644 --- a/include/linux/platform_data/usb-ehci-orion.h +++ b/include/linux/platform_data/usb-ehci-orion.h | |||
@@ -1,13 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-orion/include/plat/ehci-orion.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | 2 | * This file is licensed under the terms of the GNU General Public |
5 | * License version 2. This program is licensed "as is" without any | 3 | * License version 2. This program is licensed "as is" without any |
6 | * warranty of any kind, whether express or implied. | 4 | * warranty of any kind, whether express or implied. |
7 | */ | 5 | */ |
8 | 6 | ||
9 | #ifndef __PLAT_EHCI_ORION_H | 7 | #ifndef __USB_EHCI_ORION_H |
10 | #define __PLAT_EHCI_ORION_H | 8 | #define __USB_EHCI_ORION_H |
11 | 9 | ||
12 | #include <linux/mbus.h> | 10 | #include <linux/mbus.h> |
13 | 11 | ||
diff --git a/include/linux/platform_data/usb-omap1.h b/include/linux/platform_data/usb-omap1.h new file mode 100644 index 000000000000..43b5ce139c37 --- /dev/null +++ b/include/linux/platform_data/usb-omap1.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Platform data for OMAP1 USB | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive for | ||
6 | * more details. | ||
7 | */ | ||
8 | #ifndef __LINUX_USB_OMAP1_H | ||
9 | #define __LINUX_USB_OMAP1_H | ||
10 | |||
11 | #include <linux/platform_device.h> | ||
12 | |||
13 | struct omap_usb_config { | ||
14 | /* Configure drivers according to the connectors on your board: | ||
15 | * - "A" connector (rectagular) | ||
16 | * ... for host/OHCI use, set "register_host". | ||
17 | * - "B" connector (squarish) or "Mini-B" | ||
18 | * ... for device/gadget use, set "register_dev". | ||
19 | * - "Mini-AB" connector (very similar to Mini-B) | ||
20 | * ... for OTG use as device OR host, initialize "otg" | ||
21 | */ | ||
22 | unsigned register_host:1; | ||
23 | unsigned register_dev:1; | ||
24 | u8 otg; /* port number, 1-based: usb1 == 2 */ | ||
25 | |||
26 | const char *extcon; /* extcon device for OTG */ | ||
27 | |||
28 | u8 hmc_mode; | ||
29 | |||
30 | /* implicitly true if otg: host supports remote wakeup? */ | ||
31 | u8 rwc; | ||
32 | |||
33 | /* signaling pins used to talk to transceiver on usbN: | ||
34 | * 0 == usbN unused | ||
35 | * 2 == usb0-only, using internal transceiver | ||
36 | * 3 == 3 wire bidirectional | ||
37 | * 4 == 4 wire bidirectional | ||
38 | * 6 == 6 wire unidirectional (or TLL) | ||
39 | */ | ||
40 | u8 pins[3]; | ||
41 | |||
42 | struct platform_device *udc_device; | ||
43 | struct platform_device *ohci_device; | ||
44 | struct platform_device *otg_device; | ||
45 | |||
46 | u32 (*usb0_init)(unsigned nwires, unsigned is_device); | ||
47 | u32 (*usb1_init)(unsigned nwires); | ||
48 | u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup); | ||
49 | |||
50 | int (*ocpi_enable)(void); | ||
51 | }; | ||
52 | |||
53 | #endif /* __LINUX_USB_OMAP1_H */ | ||
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index a3d9dc8c2c00..59749fc48328 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -64,7 +64,11 @@ do { \ | |||
64 | } while (0) | 64 | } while (0) |
65 | 65 | ||
66 | #else | 66 | #else |
67 | #define preempt_enable() preempt_enable_no_resched() | 67 | #define preempt_enable() \ |
68 | do { \ | ||
69 | barrier(); \ | ||
70 | preempt_count_dec(); \ | ||
71 | } while (0) | ||
68 | #define preempt_check_resched() do { } while (0) | 72 | #define preempt_check_resched() do { } while (0) |
69 | #endif | 73 | #endif |
70 | 74 | ||
@@ -93,7 +97,11 @@ do { \ | |||
93 | __preempt_schedule_context(); \ | 97 | __preempt_schedule_context(); \ |
94 | } while (0) | 98 | } while (0) |
95 | #else | 99 | #else |
96 | #define preempt_enable_notrace() preempt_enable_no_resched_notrace() | 100 | #define preempt_enable_notrace() \ |
101 | do { \ | ||
102 | barrier(); \ | ||
103 | __preempt_count_dec(); \ | ||
104 | } while (0) | ||
97 | #endif | 105 | #endif |
98 | 106 | ||
99 | #else /* !CONFIG_PREEMPT_COUNT */ | 107 | #else /* !CONFIG_PREEMPT_COUNT */ |
@@ -116,6 +124,31 @@ do { \ | |||
116 | 124 | ||
117 | #endif /* CONFIG_PREEMPT_COUNT */ | 125 | #endif /* CONFIG_PREEMPT_COUNT */ |
118 | 126 | ||
127 | #ifdef MODULE | ||
128 | /* | ||
129 | * Modules have no business playing preemption tricks. | ||
130 | */ | ||
131 | #undef sched_preempt_enable_no_resched | ||
132 | #undef preempt_enable_no_resched | ||
133 | #undef preempt_enable_no_resched_notrace | ||
134 | #undef preempt_check_resched | ||
135 | #endif | ||
136 | |||
137 | #ifdef CONFIG_PREEMPT | ||
138 | #define preempt_set_need_resched() \ | ||
139 | do { \ | ||
140 | set_preempt_need_resched(); \ | ||
141 | } while (0) | ||
142 | #define preempt_fold_need_resched() \ | ||
143 | do { \ | ||
144 | if (tif_need_resched()) \ | ||
145 | set_preempt_need_resched(); \ | ||
146 | } while (0) | ||
147 | #else | ||
148 | #define preempt_set_need_resched() do { } while (0) | ||
149 | #define preempt_fold_need_resched() do { } while (0) | ||
150 | #endif | ||
151 | |||
119 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 152 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
120 | 153 | ||
121 | struct preempt_notifier; | 154 | struct preempt_notifier; |
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index d169820203dd..dbeec4d4a3be 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define LINUX_PREEMPT_MASK_H | 2 | #define LINUX_PREEMPT_MASK_H |
3 | 3 | ||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #include <asm/hardirq.h> | ||
6 | 5 | ||
7 | /* | 6 | /* |
8 | * We put the hardirq and softirq counter into the preemption | 7 | * We put the hardirq and softirq counter into the preemption |
@@ -79,6 +78,21 @@ | |||
79 | #endif | 78 | #endif |
80 | 79 | ||
81 | /* | 80 | /* |
81 | * The preempt_count offset needed for things like: | ||
82 | * | ||
83 | * spin_lock_bh() | ||
84 | * | ||
85 | * Which need to disable both preemption (CONFIG_PREEMPT_COUNT) and | ||
86 | * softirqs, such that unlock sequences of: | ||
87 | * | ||
88 | * spin_unlock(); | ||
89 | * local_bh_enable(); | ||
90 | * | ||
91 | * Work as expected. | ||
92 | */ | ||
93 | #define SOFTIRQ_LOCK_OFFSET (SOFTIRQ_DISABLE_OFFSET + PREEMPT_CHECK_OFFSET) | ||
94 | |||
95 | /* | ||
82 | * Are we running in atomic context? WARNING: this macro cannot | 96 | * Are we running in atomic context? WARNING: this macro cannot |
83 | * always detect atomic context; in particular, it cannot know about | 97 | * always detect atomic context; in particular, it cannot know about |
84 | * held spinlocks in non-preemptible kernels. Thus it should not be | 98 | * held spinlocks in non-preemptible kernels. Thus it should not be |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index abd437d0a8a7..ece0c6bbfcc5 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -51,6 +51,7 @@ struct pstore_info { | |||
51 | char *buf; | 51 | char *buf; |
52 | size_t bufsize; | 52 | size_t bufsize; |
53 | struct mutex read_mutex; /* serialize open/read/close */ | 53 | struct mutex read_mutex; /* serialize open/read/close */ |
54 | int flags; | ||
54 | int (*open)(struct pstore_info *psi); | 55 | int (*open)(struct pstore_info *psi); |
55 | int (*close)(struct pstore_info *psi); | 56 | int (*close)(struct pstore_info *psi); |
56 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 57 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
@@ -70,6 +71,8 @@ struct pstore_info { | |||
70 | void *data; | 71 | void *data; |
71 | }; | 72 | }; |
72 | 73 | ||
74 | #define PSTORE_FLAGS_FRAGILE 1 | ||
75 | |||
73 | #ifdef CONFIG_PSTORE | 76 | #ifdef CONFIG_PSTORE |
74 | extern int pstore_register(struct pstore_info *); | 77 | extern int pstore_register(struct pstore_info *); |
75 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); | 78 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 45a0a9e81478..dbaf99084112 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -55,8 +55,8 @@ static inline void __list_add_rcu(struct list_head *new, | |||
55 | next->prev = new; | 55 | next->prev = new; |
56 | } | 56 | } |
57 | #else | 57 | #else |
58 | extern void __list_add_rcu(struct list_head *new, | 58 | void __list_add_rcu(struct list_head *new, |
59 | struct list_head *prev, struct list_head *next); | 59 | struct list_head *prev, struct list_head *next); |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | /** | 62 | /** |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 39cbb889e20d..3e355c688618 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -50,13 +50,13 @@ extern int rcutorture_runnable; /* for sysctl */ | |||
50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
51 | 51 | ||
52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
53 | extern void rcutorture_record_test_transition(void); | 53 | void rcutorture_record_test_transition(void); |
54 | extern void rcutorture_record_progress(unsigned long vernum); | 54 | void rcutorture_record_progress(unsigned long vernum); |
55 | extern void do_trace_rcu_torture_read(const char *rcutorturename, | 55 | void do_trace_rcu_torture_read(const char *rcutorturename, |
56 | struct rcu_head *rhp, | 56 | struct rcu_head *rhp, |
57 | unsigned long secs, | 57 | unsigned long secs, |
58 | unsigned long c_old, | 58 | unsigned long c_old, |
59 | unsigned long c); | 59 | unsigned long c); |
60 | #else | 60 | #else |
61 | static inline void rcutorture_record_test_transition(void) | 61 | static inline void rcutorture_record_test_transition(void) |
62 | { | 62 | { |
@@ -65,11 +65,11 @@ static inline void rcutorture_record_progress(unsigned long vernum) | |||
65 | { | 65 | { |
66 | } | 66 | } |
67 | #ifdef CONFIG_RCU_TRACE | 67 | #ifdef CONFIG_RCU_TRACE |
68 | extern void do_trace_rcu_torture_read(const char *rcutorturename, | 68 | void do_trace_rcu_torture_read(const char *rcutorturename, |
69 | struct rcu_head *rhp, | 69 | struct rcu_head *rhp, |
70 | unsigned long secs, | 70 | unsigned long secs, |
71 | unsigned long c_old, | 71 | unsigned long c_old, |
72 | unsigned long c); | 72 | unsigned long c); |
73 | #else | 73 | #else |
74 | #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ | 74 | #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ |
75 | do { } while (0) | 75 | do { } while (0) |
@@ -118,8 +118,8 @@ extern void do_trace_rcu_torture_read(const char *rcutorturename, | |||
118 | * if CPU A and CPU B are the same CPU (but again only if the system has | 118 | * if CPU A and CPU B are the same CPU (but again only if the system has |
119 | * more than one CPU). | 119 | * more than one CPU). |
120 | */ | 120 | */ |
121 | extern void call_rcu(struct rcu_head *head, | 121 | void call_rcu(struct rcu_head *head, |
122 | void (*func)(struct rcu_head *head)); | 122 | void (*func)(struct rcu_head *head)); |
123 | 123 | ||
124 | #else /* #ifdef CONFIG_PREEMPT_RCU */ | 124 | #else /* #ifdef CONFIG_PREEMPT_RCU */ |
125 | 125 | ||
@@ -149,8 +149,8 @@ extern void call_rcu(struct rcu_head *head, | |||
149 | * See the description of call_rcu() for more detailed information on | 149 | * See the description of call_rcu() for more detailed information on |
150 | * memory ordering guarantees. | 150 | * memory ordering guarantees. |
151 | */ | 151 | */ |
152 | extern void call_rcu_bh(struct rcu_head *head, | 152 | void call_rcu_bh(struct rcu_head *head, |
153 | void (*func)(struct rcu_head *head)); | 153 | void (*func)(struct rcu_head *head)); |
154 | 154 | ||
155 | /** | 155 | /** |
156 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. | 156 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. |
@@ -171,16 +171,16 @@ extern void call_rcu_bh(struct rcu_head *head, | |||
171 | * See the description of call_rcu() for more detailed information on | 171 | * See the description of call_rcu() for more detailed information on |
172 | * memory ordering guarantees. | 172 | * memory ordering guarantees. |
173 | */ | 173 | */ |
174 | extern void call_rcu_sched(struct rcu_head *head, | 174 | void call_rcu_sched(struct rcu_head *head, |
175 | void (*func)(struct rcu_head *rcu)); | 175 | void (*func)(struct rcu_head *rcu)); |
176 | 176 | ||
177 | extern void synchronize_sched(void); | 177 | void synchronize_sched(void); |
178 | 178 | ||
179 | #ifdef CONFIG_PREEMPT_RCU | 179 | #ifdef CONFIG_PREEMPT_RCU |
180 | 180 | ||
181 | extern void __rcu_read_lock(void); | 181 | void __rcu_read_lock(void); |
182 | extern void __rcu_read_unlock(void); | 182 | void __rcu_read_unlock(void); |
183 | extern void rcu_read_unlock_special(struct task_struct *t); | 183 | void rcu_read_unlock_special(struct task_struct *t); |
184 | void synchronize_rcu(void); | 184 | void synchronize_rcu(void); |
185 | 185 | ||
186 | /* | 186 | /* |
@@ -216,19 +216,19 @@ static inline int rcu_preempt_depth(void) | |||
216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
217 | 217 | ||
218 | /* Internal to kernel */ | 218 | /* Internal to kernel */ |
219 | extern void rcu_init(void); | 219 | void rcu_init(void); |
220 | extern void rcu_sched_qs(int cpu); | 220 | void rcu_sched_qs(int cpu); |
221 | extern void rcu_bh_qs(int cpu); | 221 | void rcu_bh_qs(int cpu); |
222 | extern void rcu_check_callbacks(int cpu, int user); | 222 | void rcu_check_callbacks(int cpu, int user); |
223 | struct notifier_block; | 223 | struct notifier_block; |
224 | extern void rcu_idle_enter(void); | 224 | void rcu_idle_enter(void); |
225 | extern void rcu_idle_exit(void); | 225 | void rcu_idle_exit(void); |
226 | extern void rcu_irq_enter(void); | 226 | void rcu_irq_enter(void); |
227 | extern void rcu_irq_exit(void); | 227 | void rcu_irq_exit(void); |
228 | 228 | ||
229 | #ifdef CONFIG_RCU_USER_QS | 229 | #ifdef CONFIG_RCU_USER_QS |
230 | extern void rcu_user_enter(void); | 230 | void rcu_user_enter(void); |
231 | extern void rcu_user_exit(void); | 231 | void rcu_user_exit(void); |
232 | #else | 232 | #else |
233 | static inline void rcu_user_enter(void) { } | 233 | static inline void rcu_user_enter(void) { } |
234 | static inline void rcu_user_exit(void) { } | 234 | static inline void rcu_user_exit(void) { } |
@@ -262,7 +262,7 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, | |||
262 | } while (0) | 262 | } while (0) |
263 | 263 | ||
264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) | 264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) |
265 | extern bool __rcu_is_watching(void); | 265 | bool __rcu_is_watching(void); |
266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ | 266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ |
267 | 267 | ||
268 | /* | 268 | /* |
@@ -289,8 +289,8 @@ void wait_rcu_gp(call_rcu_func_t crf); | |||
289 | * initialization. | 289 | * initialization. |
290 | */ | 290 | */ |
291 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD | 291 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD |
292 | extern void init_rcu_head_on_stack(struct rcu_head *head); | 292 | void init_rcu_head_on_stack(struct rcu_head *head); |
293 | extern void destroy_rcu_head_on_stack(struct rcu_head *head); | 293 | void destroy_rcu_head_on_stack(struct rcu_head *head); |
294 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 294 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
295 | static inline void init_rcu_head_on_stack(struct rcu_head *head) | 295 | static inline void init_rcu_head_on_stack(struct rcu_head *head) |
296 | { | 296 | { |
@@ -325,6 +325,7 @@ static inline void rcu_lock_release(struct lockdep_map *map) | |||
325 | extern struct lockdep_map rcu_lock_map; | 325 | extern struct lockdep_map rcu_lock_map; |
326 | extern struct lockdep_map rcu_bh_lock_map; | 326 | extern struct lockdep_map rcu_bh_lock_map; |
327 | extern struct lockdep_map rcu_sched_lock_map; | 327 | extern struct lockdep_map rcu_sched_lock_map; |
328 | extern struct lockdep_map rcu_callback_map; | ||
328 | extern int debug_lockdep_rcu_enabled(void); | 329 | extern int debug_lockdep_rcu_enabled(void); |
329 | 330 | ||
330 | /** | 331 | /** |
@@ -362,7 +363,7 @@ static inline int rcu_read_lock_held(void) | |||
362 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file | 363 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file |
363 | * hell. | 364 | * hell. |
364 | */ | 365 | */ |
365 | extern int rcu_read_lock_bh_held(void); | 366 | int rcu_read_lock_bh_held(void); |
366 | 367 | ||
367 | /** | 368 | /** |
368 | * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? | 369 | * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? |
@@ -448,7 +449,7 @@ static inline int rcu_read_lock_sched_held(void) | |||
448 | 449 | ||
449 | #ifdef CONFIG_PROVE_RCU | 450 | #ifdef CONFIG_PROVE_RCU |
450 | 451 | ||
451 | extern int rcu_my_thread_group_empty(void); | 452 | int rcu_my_thread_group_empty(void); |
452 | 453 | ||
453 | /** | 454 | /** |
454 | * rcu_lockdep_assert - emit lockdep splat if specified condition not met | 455 | * rcu_lockdep_assert - emit lockdep splat if specified condition not met |
@@ -548,10 +549,48 @@ static inline void rcu_preempt_sleep_check(void) | |||
548 | smp_read_barrier_depends(); \ | 549 | smp_read_barrier_depends(); \ |
549 | (_________p1); \ | 550 | (_________p1); \ |
550 | }) | 551 | }) |
551 | #define __rcu_assign_pointer(p, v, space) \ | 552 | |
553 | /** | ||
554 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable | ||
555 | * @v: The value to statically initialize with. | ||
556 | */ | ||
557 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) | ||
558 | |||
559 | /** | ||
560 | * rcu_assign_pointer() - assign to RCU-protected pointer | ||
561 | * @p: pointer to assign to | ||
562 | * @v: value to assign (publish) | ||
563 | * | ||
564 | * Assigns the specified value to the specified RCU-protected | ||
565 | * pointer, ensuring that any concurrent RCU readers will see | ||
566 | * any prior initialization. | ||
567 | * | ||
568 | * Inserts memory barriers on architectures that require them | ||
569 | * (which is most of them), and also prevents the compiler from | ||
570 | * reordering the code that initializes the structure after the pointer | ||
571 | * assignment. More importantly, this call documents which pointers | ||
572 | * will be dereferenced by RCU read-side code. | ||
573 | * | ||
574 | * In some special cases, you may use RCU_INIT_POINTER() instead | ||
575 | * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due | ||
576 | * to the fact that it does not constrain either the CPU or the compiler. | ||
577 | * That said, using RCU_INIT_POINTER() when you should have used | ||
578 | * rcu_assign_pointer() is a very bad thing that results in | ||
579 | * impossible-to-diagnose memory corruption. So please be careful. | ||
580 | * See the RCU_INIT_POINTER() comment header for details. | ||
581 | * | ||
582 | * Note that rcu_assign_pointer() evaluates each of its arguments only | ||
583 | * once, appearances notwithstanding. One of the "extra" evaluations | ||
584 | * is in typeof() and the other visible only to sparse (__CHECKER__), | ||
585 | * neither of which actually execute the argument. As with most cpp | ||
586 | * macros, this execute-arguments-only-once property is important, so | ||
587 | * please be careful when making changes to rcu_assign_pointer() and the | ||
588 | * other macros that it invokes. | ||
589 | */ | ||
590 | #define rcu_assign_pointer(p, v) \ | ||
552 | do { \ | 591 | do { \ |
553 | smp_wmb(); \ | 592 | smp_wmb(); \ |
554 | (p) = (typeof(*v) __force space *)(v); \ | 593 | ACCESS_ONCE(p) = RCU_INITIALIZER(v); \ |
555 | } while (0) | 594 | } while (0) |
556 | 595 | ||
557 | 596 | ||
@@ -890,32 +929,6 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
890 | } | 929 | } |
891 | 930 | ||
892 | /** | 931 | /** |
893 | * rcu_assign_pointer() - assign to RCU-protected pointer | ||
894 | * @p: pointer to assign to | ||
895 | * @v: value to assign (publish) | ||
896 | * | ||
897 | * Assigns the specified value to the specified RCU-protected | ||
898 | * pointer, ensuring that any concurrent RCU readers will see | ||
899 | * any prior initialization. | ||
900 | * | ||
901 | * Inserts memory barriers on architectures that require them | ||
902 | * (which is most of them), and also prevents the compiler from | ||
903 | * reordering the code that initializes the structure after the pointer | ||
904 | * assignment. More importantly, this call documents which pointers | ||
905 | * will be dereferenced by RCU read-side code. | ||
906 | * | ||
907 | * In some special cases, you may use RCU_INIT_POINTER() instead | ||
908 | * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due | ||
909 | * to the fact that it does not constrain either the CPU or the compiler. | ||
910 | * That said, using RCU_INIT_POINTER() when you should have used | ||
911 | * rcu_assign_pointer() is a very bad thing that results in | ||
912 | * impossible-to-diagnose memory corruption. So please be careful. | ||
913 | * See the RCU_INIT_POINTER() comment header for details. | ||
914 | */ | ||
915 | #define rcu_assign_pointer(p, v) \ | ||
916 | __rcu_assign_pointer((p), (v), __rcu) | ||
917 | |||
918 | /** | ||
919 | * RCU_INIT_POINTER() - initialize an RCU protected pointer | 932 | * RCU_INIT_POINTER() - initialize an RCU protected pointer |
920 | * | 933 | * |
921 | * Initialize an RCU-protected pointer in special cases where readers | 934 | * Initialize an RCU-protected pointer in special cases where readers |
@@ -949,7 +962,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
949 | */ | 962 | */ |
950 | #define RCU_INIT_POINTER(p, v) \ | 963 | #define RCU_INIT_POINTER(p, v) \ |
951 | do { \ | 964 | do { \ |
952 | p = (typeof(*v) __force __rcu *)(v); \ | 965 | p = RCU_INITIALIZER(v); \ |
953 | } while (0) | 966 | } while (0) |
954 | 967 | ||
955 | /** | 968 | /** |
@@ -958,7 +971,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
958 | * GCC-style initialization for an RCU-protected pointer in a structure field. | 971 | * GCC-style initialization for an RCU-protected pointer in a structure field. |
959 | */ | 972 | */ |
960 | #define RCU_POINTER_INITIALIZER(p, v) \ | 973 | #define RCU_POINTER_INITIALIZER(p, v) \ |
961 | .p = (typeof(*v) __force __rcu *)(v) | 974 | .p = RCU_INITIALIZER(v) |
962 | 975 | ||
963 | /* | 976 | /* |
964 | * Does the specified offset indicate that the corresponding rcu_head | 977 | * Does the specified offset indicate that the corresponding rcu_head |
@@ -1005,7 +1018,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
1005 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) | 1018 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) |
1006 | 1019 | ||
1007 | #ifdef CONFIG_RCU_NOCB_CPU | 1020 | #ifdef CONFIG_RCU_NOCB_CPU |
1008 | extern bool rcu_is_nocb_cpu(int cpu); | 1021 | bool rcu_is_nocb_cpu(int cpu); |
1009 | #else | 1022 | #else |
1010 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | 1023 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } |
1011 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ | 1024 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ |
@@ -1013,8 +1026,8 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | |||
1013 | 1026 | ||
1014 | /* Only for use by adaptive-ticks code. */ | 1027 | /* Only for use by adaptive-ticks code. */ |
1015 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE | 1028 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE |
1016 | extern bool rcu_sys_is_idle(void); | 1029 | bool rcu_sys_is_idle(void); |
1017 | extern void rcu_sysidle_force_exit(void); | 1030 | void rcu_sysidle_force_exit(void); |
1018 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ | 1031 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ |
1019 | 1032 | ||
1020 | static inline bool rcu_sys_is_idle(void) | 1033 | static inline bool rcu_sys_is_idle(void) |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 09ebcbe9fd78..6f01771b571c 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -125,7 +125,7 @@ static inline void exit_rcu(void) | |||
125 | 125 | ||
126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
127 | extern int rcu_scheduler_active __read_mostly; | 127 | extern int rcu_scheduler_active __read_mostly; |
128 | extern void rcu_scheduler_starting(void); | 128 | void rcu_scheduler_starting(void); |
129 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 129 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
130 | static inline void rcu_scheduler_starting(void) | 130 | static inline void rcu_scheduler_starting(void) |
131 | { | 131 | { |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 4b9c81548742..72137ee8c603 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,9 +30,9 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | ||
33 | extern void rcu_note_context_switch(int cpu); | 33 | void rcu_note_context_switch(int cpu); |
34 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 34 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
35 | extern void rcu_cpu_stall_reset(void); | 35 | void rcu_cpu_stall_reset(void); |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Note a virtualization-based context switch. This is simply a | 38 | * Note a virtualization-based context switch. This is simply a |
@@ -44,9 +44,9 @@ static inline void rcu_virt_note_context_switch(int cpu) | |||
44 | rcu_note_context_switch(cpu); | 44 | rcu_note_context_switch(cpu); |
45 | } | 45 | } |
46 | 46 | ||
47 | extern void synchronize_rcu_bh(void); | 47 | void synchronize_rcu_bh(void); |
48 | extern void synchronize_sched_expedited(void); | 48 | void synchronize_sched_expedited(void); |
49 | extern void synchronize_rcu_expedited(void); | 49 | void synchronize_rcu_expedited(void); |
50 | 50 | ||
51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | 51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); |
52 | 52 | ||
@@ -71,25 +71,25 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
71 | synchronize_sched_expedited(); | 71 | synchronize_sched_expedited(); |
72 | } | 72 | } |
73 | 73 | ||
74 | extern void rcu_barrier(void); | 74 | void rcu_barrier(void); |
75 | extern void rcu_barrier_bh(void); | 75 | void rcu_barrier_bh(void); |
76 | extern void rcu_barrier_sched(void); | 76 | void rcu_barrier_sched(void); |
77 | 77 | ||
78 | extern unsigned long rcutorture_testseq; | 78 | extern unsigned long rcutorture_testseq; |
79 | extern unsigned long rcutorture_vernum; | 79 | extern unsigned long rcutorture_vernum; |
80 | extern long rcu_batches_completed(void); | 80 | long rcu_batches_completed(void); |
81 | extern long rcu_batches_completed_bh(void); | 81 | long rcu_batches_completed_bh(void); |
82 | extern long rcu_batches_completed_sched(void); | 82 | long rcu_batches_completed_sched(void); |
83 | 83 | ||
84 | extern void rcu_force_quiescent_state(void); | 84 | void rcu_force_quiescent_state(void); |
85 | extern void rcu_bh_force_quiescent_state(void); | 85 | void rcu_bh_force_quiescent_state(void); |
86 | extern void rcu_sched_force_quiescent_state(void); | 86 | void rcu_sched_force_quiescent_state(void); |
87 | 87 | ||
88 | extern void exit_rcu(void); | 88 | void exit_rcu(void); |
89 | 89 | ||
90 | extern void rcu_scheduler_starting(void); | 90 | void rcu_scheduler_starting(void); |
91 | extern int rcu_scheduler_active __read_mostly; | 91 | extern int rcu_scheduler_active __read_mostly; |
92 | 92 | ||
93 | extern bool rcu_is_watching(void); | 93 | bool rcu_is_watching(void); |
94 | 94 | ||
95 | #endif /* __LINUX_RCUTREE_H */ | 95 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 8e00f9f6f963..9e7db9e73cc1 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -43,6 +43,7 @@ extern int unregister_reboot_notifier(struct notifier_block *); | |||
43 | * Architecture-specific implementations of sys_reboot commands. | 43 | * Architecture-specific implementations of sys_reboot commands. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | extern void migrate_to_reboot_cpu(void); | ||
46 | extern void machine_restart(char *cmd); | 47 | extern void machine_restart(char *cmd); |
47 | extern void machine_halt(void); | 48 | extern void machine_halt(void); |
48 | extern void machine_power_off(void); | 49 | extern void machine_power_off(void); |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index de17134244f3..3aed8d737e1a 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #define __LINUX_RT_MUTEX_H | 13 | #define __LINUX_RT_MUTEX_H |
14 | 14 | ||
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/plist.h> | 16 | #include <linux/rbtree.h> |
17 | #include <linux/spinlock_types.h> | 17 | #include <linux/spinlock_types.h> |
18 | 18 | ||
19 | extern int max_lock_depth; /* for sysctl */ | 19 | extern int max_lock_depth; /* for sysctl */ |
@@ -22,12 +22,14 @@ extern int max_lock_depth; /* for sysctl */ | |||
22 | * The rt_mutex structure | 22 | * The rt_mutex structure |
23 | * | 23 | * |
24 | * @wait_lock: spinlock to protect the structure | 24 | * @wait_lock: spinlock to protect the structure |
25 | * @wait_list: pilist head to enqueue waiters in priority order | 25 | * @waiters: rbtree root to enqueue waiters in priority order |
26 | * @waiters_leftmost: top waiter | ||
26 | * @owner: the mutex owner | 27 | * @owner: the mutex owner |
27 | */ | 28 | */ |
28 | struct rt_mutex { | 29 | struct rt_mutex { |
29 | raw_spinlock_t wait_lock; | 30 | raw_spinlock_t wait_lock; |
30 | struct plist_head wait_list; | 31 | struct rb_root waiters; |
32 | struct rb_node *waiters_leftmost; | ||
31 | struct task_struct *owner; | 33 | struct task_struct *owner; |
32 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 34 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
33 | int save_state; | 35 | int save_state; |
@@ -66,7 +68,7 @@ struct hrtimer_sleeper; | |||
66 | 68 | ||
67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | 69 | #define __RT_MUTEX_INITIALIZER(mutexname) \ |
68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ | 70 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \ | 71 | , .waiters = RB_ROOT \ |
70 | , .owner = NULL \ | 72 | , .owner = NULL \ |
71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | 73 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} |
72 | 74 | ||
@@ -98,12 +100,4 @@ extern int rt_mutex_trylock(struct rt_mutex *lock); | |||
98 | 100 | ||
99 | extern void rt_mutex_unlock(struct rt_mutex *lock); | 101 | extern void rt_mutex_unlock(struct rt_mutex *lock); |
100 | 102 | ||
101 | #ifdef CONFIG_RT_MUTEXES | ||
102 | # define INIT_RT_MUTEXES(tsk) \ | ||
103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \ | ||
104 | INIT_RT_MUTEX_DEBUG(tsk) | ||
105 | #else | ||
106 | # define INIT_RT_MUTEXES(tsk) | ||
107 | #endif | ||
108 | |||
109 | #endif | 103 | #endif |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 939428ad25ac..8e3e66ac0a52 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -24,6 +24,11 @@ extern int rtnl_trylock(void); | |||
24 | extern int rtnl_is_locked(void); | 24 | extern int rtnl_is_locked(void); |
25 | #ifdef CONFIG_PROVE_LOCKING | 25 | #ifdef CONFIG_PROVE_LOCKING |
26 | extern int lockdep_rtnl_is_held(void); | 26 | extern int lockdep_rtnl_is_held(void); |
27 | #else | ||
28 | static inline int lockdep_rtnl_is_held(void) | ||
29 | { | ||
30 | return 1; | ||
31 | } | ||
27 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | 32 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ |
28 | 33 | ||
29 | /** | 34 | /** |
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h index 9c9f0495d37c..5b9b84b20407 100644 --- a/include/linux/rwlock_api_smp.h +++ b/include/linux/rwlock_api_smp.h | |||
@@ -172,8 +172,7 @@ static inline void __raw_read_lock_irq(rwlock_t *lock) | |||
172 | 172 | ||
173 | static inline void __raw_read_lock_bh(rwlock_t *lock) | 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) |
174 | { | 174 | { |
175 | local_bh_disable(); | 175 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
176 | preempt_disable(); | ||
177 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 176 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
178 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | 177 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); |
179 | } | 178 | } |
@@ -200,8 +199,7 @@ static inline void __raw_write_lock_irq(rwlock_t *lock) | |||
200 | 199 | ||
201 | static inline void __raw_write_lock_bh(rwlock_t *lock) | 200 | static inline void __raw_write_lock_bh(rwlock_t *lock) |
202 | { | 201 | { |
203 | local_bh_disable(); | 202 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
204 | preempt_disable(); | ||
205 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 203 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
206 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | 204 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); |
207 | } | 205 | } |
@@ -250,8 +248,7 @@ static inline void __raw_read_unlock_bh(rwlock_t *lock) | |||
250 | { | 248 | { |
251 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 249 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
252 | do_raw_read_unlock(lock); | 250 | do_raw_read_unlock(lock); |
253 | preempt_enable_no_resched(); | 251 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
254 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
255 | } | 252 | } |
256 | 253 | ||
257 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, | 254 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, |
@@ -275,8 +272,7 @@ static inline void __raw_write_unlock_bh(rwlock_t *lock) | |||
275 | { | 272 | { |
276 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 273 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
277 | do_raw_write_unlock(lock); | 274 | do_raw_write_unlock(lock); |
278 | preempt_enable_no_resched(); | 275 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
279 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
280 | } | 276 | } |
281 | 277 | ||
282 | #endif /* __LINUX_RWLOCK_API_SMP_H */ | 278 | #endif /* __LINUX_RWLOCK_API_SMP_H */ |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index adae88f5b0ab..a964f7285600 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -345,6 +345,7 @@ struct sg_mapping_iter { | |||
345 | 345 | ||
346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, | 346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, |
347 | unsigned int nents, unsigned int flags); | 347 | unsigned int nents, unsigned int flags); |
348 | bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset); | ||
348 | bool sg_miter_next(struct sg_mapping_iter *miter); | 349 | bool sg_miter_next(struct sg_mapping_iter *miter); |
349 | void sg_miter_stop(struct sg_mapping_iter *miter); | 350 | void sg_miter_stop(struct sg_mapping_iter *miter); |
350 | 351 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7e35d4b9e14a..ffccdad050b5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -16,6 +16,7 @@ struct sched_param { | |||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/timex.h> | 17 | #include <linux/timex.h> |
18 | #include <linux/jiffies.h> | 18 | #include <linux/jiffies.h> |
19 | #include <linux/plist.h> | ||
19 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
20 | #include <linux/thread_info.h> | 21 | #include <linux/thread_info.h> |
21 | #include <linux/cpumask.h> | 22 | #include <linux/cpumask.h> |
@@ -56,6 +57,70 @@ struct sched_param { | |||
56 | 57 | ||
57 | #include <asm/processor.h> | 58 | #include <asm/processor.h> |
58 | 59 | ||
60 | #define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */ | ||
61 | |||
62 | /* | ||
63 | * Extended scheduling parameters data structure. | ||
64 | * | ||
65 | * This is needed because the original struct sched_param can not be | ||
66 | * altered without introducing ABI issues with legacy applications | ||
67 | * (e.g., in sched_getparam()). | ||
68 | * | ||
69 | * However, the possibility of specifying more than just a priority for | ||
70 | * the tasks may be useful for a wide variety of application fields, e.g., | ||
71 | * multimedia, streaming, automation and control, and many others. | ||
72 | * | ||
73 | * This variant (sched_attr) is meant at describing a so-called | ||
74 | * sporadic time-constrained task. In such model a task is specified by: | ||
75 | * - the activation period or minimum instance inter-arrival time; | ||
76 | * - the maximum (or average, depending on the actual scheduling | ||
77 | * discipline) computation time of all instances, a.k.a. runtime; | ||
78 | * - the deadline (relative to the actual activation time) of each | ||
79 | * instance. | ||
80 | * Very briefly, a periodic (sporadic) task asks for the execution of | ||
81 | * some specific computation --which is typically called an instance-- | ||
82 | * (at most) every period. Moreover, each instance typically lasts no more | ||
83 | * than the runtime and must be completed by time instant t equal to | ||
84 | * the instance activation time + the deadline. | ||
85 | * | ||
86 | * This is reflected by the actual fields of the sched_attr structure: | ||
87 | * | ||
88 | * @size size of the structure, for fwd/bwd compat. | ||
89 | * | ||
90 | * @sched_policy task's scheduling policy | ||
91 | * @sched_flags for customizing the scheduler behaviour | ||
92 | * @sched_nice task's nice value (SCHED_NORMAL/BATCH) | ||
93 | * @sched_priority task's static priority (SCHED_FIFO/RR) | ||
94 | * @sched_deadline representative of the task's deadline | ||
95 | * @sched_runtime representative of the task's runtime | ||
96 | * @sched_period representative of the task's period | ||
97 | * | ||
98 | * Given this task model, there are a multiplicity of scheduling algorithms | ||
99 | * and policies, that can be used to ensure all the tasks will make their | ||
100 | * timing constraints. | ||
101 | * | ||
102 | * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the | ||
103 | * only user of this new interface. More information about the algorithm | ||
104 | * available in the scheduling class file or in Documentation/. | ||
105 | */ | ||
106 | struct sched_attr { | ||
107 | u32 size; | ||
108 | |||
109 | u32 sched_policy; | ||
110 | u64 sched_flags; | ||
111 | |||
112 | /* SCHED_NORMAL, SCHED_BATCH */ | ||
113 | s32 sched_nice; | ||
114 | |||
115 | /* SCHED_FIFO, SCHED_RR */ | ||
116 | u32 sched_priority; | ||
117 | |||
118 | /* SCHED_DEADLINE */ | ||
119 | u64 sched_runtime; | ||
120 | u64 sched_deadline; | ||
121 | u64 sched_period; | ||
122 | }; | ||
123 | |||
59 | struct exec_domain; | 124 | struct exec_domain; |
60 | struct futex_pi_state; | 125 | struct futex_pi_state; |
61 | struct robust_list_head; | 126 | struct robust_list_head; |
@@ -168,7 +233,6 @@ extern char ___assert_task_state[1 - 2*!!( | |||
168 | 233 | ||
169 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) | 234 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) |
170 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) | 235 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) |
171 | #define task_is_dead(task) ((task)->exit_state != 0) | ||
172 | #define task_is_stopped_or_traced(task) \ | 236 | #define task_is_stopped_or_traced(task) \ |
173 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 237 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
174 | #define task_contributes_to_load(task) \ | 238 | #define task_contributes_to_load(task) \ |
@@ -440,8 +504,6 @@ struct task_cputime { | |||
440 | .sum_exec_runtime = 0, \ | 504 | .sum_exec_runtime = 0, \ |
441 | } | 505 | } |
442 | 506 | ||
443 | #define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED) | ||
444 | |||
445 | #ifdef CONFIG_PREEMPT_COUNT | 507 | #ifdef CONFIG_PREEMPT_COUNT |
446 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) | 508 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) |
447 | #else | 509 | #else |
@@ -831,8 +893,6 @@ struct sched_domain { | |||
831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ | 893 | unsigned int balance_interval; /* initialise to 1. units in ms. */ |
832 | unsigned int nr_balance_failed; /* initialise to 0 */ | 894 | unsigned int nr_balance_failed; /* initialise to 0 */ |
833 | 895 | ||
834 | u64 last_update; | ||
835 | |||
836 | /* idle_balance() stats */ | 896 | /* idle_balance() stats */ |
837 | u64 max_newidle_lb_cost; | 897 | u64 max_newidle_lb_cost; |
838 | unsigned long next_decay_max_lb_cost; | 898 | unsigned long next_decay_max_lb_cost; |
@@ -934,7 +994,8 @@ struct pipe_inode_info; | |||
934 | struct uts_namespace; | 994 | struct uts_namespace; |
935 | 995 | ||
936 | struct load_weight { | 996 | struct load_weight { |
937 | unsigned long weight, inv_weight; | 997 | unsigned long weight; |
998 | u32 inv_weight; | ||
938 | }; | 999 | }; |
939 | 1000 | ||
940 | struct sched_avg { | 1001 | struct sched_avg { |
@@ -1032,6 +1093,51 @@ struct sched_rt_entity { | |||
1032 | #endif | 1093 | #endif |
1033 | }; | 1094 | }; |
1034 | 1095 | ||
1096 | struct sched_dl_entity { | ||
1097 | struct rb_node rb_node; | ||
1098 | |||
1099 | /* | ||
1100 | * Original scheduling parameters. Copied here from sched_attr | ||
1101 | * during sched_setscheduler2(), they will remain the same until | ||
1102 | * the next sched_setscheduler2(). | ||
1103 | */ | ||
1104 | u64 dl_runtime; /* maximum runtime for each instance */ | ||
1105 | u64 dl_deadline; /* relative deadline of each instance */ | ||
1106 | u64 dl_period; /* separation of two instances (period) */ | ||
1107 | u64 dl_bw; /* dl_runtime / dl_deadline */ | ||
1108 | |||
1109 | /* | ||
1110 | * Actual scheduling parameters. Initialized with the values above, | ||
1111 | * they are continously updated during task execution. Note that | ||
1112 | * the remaining runtime could be < 0 in case we are in overrun. | ||
1113 | */ | ||
1114 | s64 runtime; /* remaining runtime for this instance */ | ||
1115 | u64 deadline; /* absolute deadline for this instance */ | ||
1116 | unsigned int flags; /* specifying the scheduler behaviour */ | ||
1117 | |||
1118 | /* | ||
1119 | * Some bool flags: | ||
1120 | * | ||
1121 | * @dl_throttled tells if we exhausted the runtime. If so, the | ||
1122 | * task has to wait for a replenishment to be performed at the | ||
1123 | * next firing of dl_timer. | ||
1124 | * | ||
1125 | * @dl_new tells if a new instance arrived. If so we must | ||
1126 | * start executing it with full runtime and reset its absolute | ||
1127 | * deadline; | ||
1128 | * | ||
1129 | * @dl_boosted tells if we are boosted due to DI. If so we are | ||
1130 | * outside bandwidth enforcement mechanism (but only until we | ||
1131 | * exit the critical section). | ||
1132 | */ | ||
1133 | int dl_throttled, dl_new, dl_boosted; | ||
1134 | |||
1135 | /* | ||
1136 | * Bandwidth enforcement timer. Each -deadline task has its | ||
1137 | * own bandwidth to be enforced, thus we need one timer per task. | ||
1138 | */ | ||
1139 | struct hrtimer dl_timer; | ||
1140 | }; | ||
1035 | 1141 | ||
1036 | struct rcu_node; | 1142 | struct rcu_node; |
1037 | 1143 | ||
@@ -1068,6 +1174,7 @@ struct task_struct { | |||
1068 | #ifdef CONFIG_CGROUP_SCHED | 1174 | #ifdef CONFIG_CGROUP_SCHED |
1069 | struct task_group *sched_task_group; | 1175 | struct task_group *sched_task_group; |
1070 | #endif | 1176 | #endif |
1177 | struct sched_dl_entity dl; | ||
1071 | 1178 | ||
1072 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 1179 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
1073 | /* list of struct preempt_notifier: */ | 1180 | /* list of struct preempt_notifier: */ |
@@ -1101,6 +1208,7 @@ struct task_struct { | |||
1101 | struct list_head tasks; | 1208 | struct list_head tasks; |
1102 | #ifdef CONFIG_SMP | 1209 | #ifdef CONFIG_SMP |
1103 | struct plist_node pushable_tasks; | 1210 | struct plist_node pushable_tasks; |
1211 | struct rb_node pushable_dl_tasks; | ||
1104 | #endif | 1212 | #endif |
1105 | 1213 | ||
1106 | struct mm_struct *mm, *active_mm; | 1214 | struct mm_struct *mm, *active_mm; |
@@ -1252,9 +1360,12 @@ struct task_struct { | |||
1252 | 1360 | ||
1253 | #ifdef CONFIG_RT_MUTEXES | 1361 | #ifdef CONFIG_RT_MUTEXES |
1254 | /* PI waiters blocked on a rt_mutex held by this task */ | 1362 | /* PI waiters blocked on a rt_mutex held by this task */ |
1255 | struct plist_head pi_waiters; | 1363 | struct rb_root pi_waiters; |
1364 | struct rb_node *pi_waiters_leftmost; | ||
1256 | /* Deadlock detection and priority inheritance handling */ | 1365 | /* Deadlock detection and priority inheritance handling */ |
1257 | struct rt_mutex_waiter *pi_blocked_on; | 1366 | struct rt_mutex_waiter *pi_blocked_on; |
1367 | /* Top pi_waiters task */ | ||
1368 | struct task_struct *pi_top_task; | ||
1258 | #endif | 1369 | #endif |
1259 | 1370 | ||
1260 | #ifdef CONFIG_DEBUG_MUTEXES | 1371 | #ifdef CONFIG_DEBUG_MUTEXES |
@@ -1883,7 +1994,9 @@ static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | |||
1883 | * but then during bootup it turns out that sched_clock() | 1994 | * but then during bootup it turns out that sched_clock() |
1884 | * is reliable after all: | 1995 | * is reliable after all: |
1885 | */ | 1996 | */ |
1886 | extern int sched_clock_stable; | 1997 | extern int sched_clock_stable(void); |
1998 | extern void set_sched_clock_stable(void); | ||
1999 | extern void clear_sched_clock_stable(void); | ||
1887 | 2000 | ||
1888 | extern void sched_clock_tick(void); | 2001 | extern void sched_clock_tick(void); |
1889 | extern void sched_clock_idle_sleep_event(void); | 2002 | extern void sched_clock_idle_sleep_event(void); |
@@ -1962,6 +2075,8 @@ extern int sched_setscheduler(struct task_struct *, int, | |||
1962 | const struct sched_param *); | 2075 | const struct sched_param *); |
1963 | extern int sched_setscheduler_nocheck(struct task_struct *, int, | 2076 | extern int sched_setscheduler_nocheck(struct task_struct *, int, |
1964 | const struct sched_param *); | 2077 | const struct sched_param *); |
2078 | extern int sched_setattr(struct task_struct *, | ||
2079 | const struct sched_attr *); | ||
1965 | extern struct task_struct *idle_task(int cpu); | 2080 | extern struct task_struct *idle_task(int cpu); |
1966 | /** | 2081 | /** |
1967 | * is_idle_task - is the specified task an idle task? | 2082 | * is_idle_task - is the specified task an idle task? |
@@ -2041,7 +2156,7 @@ extern void wake_up_new_task(struct task_struct *tsk); | |||
2041 | #else | 2156 | #else |
2042 | static inline void kick_process(struct task_struct *tsk) { } | 2157 | static inline void kick_process(struct task_struct *tsk) { } |
2043 | #endif | 2158 | #endif |
2044 | extern void sched_fork(unsigned long clone_flags, struct task_struct *p); | 2159 | extern int sched_fork(unsigned long clone_flags, struct task_struct *p); |
2045 | extern void sched_dead(struct task_struct *p); | 2160 | extern void sched_dead(struct task_struct *p); |
2046 | 2161 | ||
2047 | extern void proc_caches_init(void); | 2162 | extern void proc_caches_init(void); |
@@ -2630,6 +2745,21 @@ static inline bool __must_check current_clr_polling_and_test(void) | |||
2630 | } | 2745 | } |
2631 | #endif | 2746 | #endif |
2632 | 2747 | ||
2748 | static inline void current_clr_polling(void) | ||
2749 | { | ||
2750 | __current_clr_polling(); | ||
2751 | |||
2752 | /* | ||
2753 | * Ensure we check TIF_NEED_RESCHED after we clear the polling bit. | ||
2754 | * Once the bit is cleared, we'll get IPIs with every new | ||
2755 | * TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also | ||
2756 | * fold. | ||
2757 | */ | ||
2758 | smp_mb(); /* paired with resched_task() */ | ||
2759 | |||
2760 | preempt_fold_need_resched(); | ||
2761 | } | ||
2762 | |||
2633 | static __always_inline bool need_resched(void) | 2763 | static __always_inline bool need_resched(void) |
2634 | { | 2764 | { |
2635 | return unlikely(tif_need_resched()); | 2765 | return unlikely(tif_need_resched()); |
diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h new file mode 100644 index 000000000000..9d303b8847df --- /dev/null +++ b/include/linux/sched/deadline.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef _SCHED_DEADLINE_H | ||
2 | #define _SCHED_DEADLINE_H | ||
3 | |||
4 | /* | ||
5 | * SCHED_DEADLINE tasks has negative priorities, reflecting | ||
6 | * the fact that any of them has higher prio than RT and | ||
7 | * NORMAL/BATCH tasks. | ||
8 | */ | ||
9 | |||
10 | #define MAX_DL_PRIO 0 | ||
11 | |||
12 | static inline int dl_prio(int prio) | ||
13 | { | ||
14 | if (unlikely(prio < MAX_DL_PRIO)) | ||
15 | return 1; | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | static inline int dl_task(struct task_struct *p) | ||
20 | { | ||
21 | return dl_prio(p->prio); | ||
22 | } | ||
23 | |||
24 | #endif /* _SCHED_DEADLINE_H */ | ||
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 440434df3627..34e4ebea8fce 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
@@ -35,6 +35,7 @@ static inline int rt_task(struct task_struct *p) | |||
35 | #ifdef CONFIG_RT_MUTEXES | 35 | #ifdef CONFIG_RT_MUTEXES |
36 | extern int rt_mutex_getprio(struct task_struct *p); | 36 | extern int rt_mutex_getprio(struct task_struct *p); |
37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
38 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); | ||
38 | extern void rt_mutex_adjust_pi(struct task_struct *p); | 39 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
39 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 40 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
40 | { | 41 | { |
@@ -45,6 +46,10 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
45 | { | 46 | { |
46 | return p->normal_prio; | 47 | return p->normal_prio; |
47 | } | 48 | } |
49 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) | ||
50 | { | ||
51 | return NULL; | ||
52 | } | ||
48 | # define rt_mutex_adjust_pi(p) do { } while (0) | 53 | # define rt_mutex_adjust_pi(p) do { } while (0) |
49 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 54 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
50 | { | 55 | { |
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 41467f8ff8ec..31e0193cb0c5 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h | |||
@@ -48,7 +48,6 @@ extern unsigned int sysctl_numa_balancing_scan_delay; | |||
48 | extern unsigned int sysctl_numa_balancing_scan_period_min; | 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; |
49 | extern unsigned int sysctl_numa_balancing_scan_period_max; | 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; |
50 | extern unsigned int sysctl_numa_balancing_scan_size; | 50 | extern unsigned int sysctl_numa_balancing_scan_size; |
51 | extern unsigned int sysctl_numa_balancing_settle_count; | ||
52 | 51 | ||
53 | #ifdef CONFIG_SCHED_DEBUG | 52 | #ifdef CONFIG_SCHED_DEBUG |
54 | extern unsigned int sysctl_sched_migration_cost; | 53 | extern unsigned int sysctl_sched_migration_cost; |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index cf87a24c0f92..535f158977b9 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -117,15 +117,15 @@ repeat: | |||
117 | } | 117 | } |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep | 120 | * raw_read_seqcount_begin - start seq-read critical section w/o lockdep |
121 | * @s: pointer to seqcount_t | 121 | * @s: pointer to seqcount_t |
122 | * Returns: count to be passed to read_seqcount_retry | 122 | * Returns: count to be passed to read_seqcount_retry |
123 | * | 123 | * |
124 | * read_seqcount_begin_no_lockdep opens a read critical section of the given | 124 | * raw_read_seqcount_begin opens a read critical section of the given |
125 | * seqcount, but without any lockdep checking. Validity of the critical | 125 | * seqcount, but without any lockdep checking. Validity of the critical |
126 | * section is tested by checking read_seqcount_retry function. | 126 | * section is tested by checking read_seqcount_retry function. |
127 | */ | 127 | */ |
128 | static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | 128 | static inline unsigned raw_read_seqcount_begin(const seqcount_t *s) |
129 | { | 129 | { |
130 | unsigned ret = __read_seqcount_begin(s); | 130 | unsigned ret = __read_seqcount_begin(s); |
131 | smp_rmb(); | 131 | smp_rmb(); |
@@ -144,7 +144,7 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | |||
144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | 144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) |
145 | { | 145 | { |
146 | seqcount_lockdep_reader_access(s); | 146 | seqcount_lockdep_reader_access(s); |
147 | return read_seqcount_begin_no_lockdep(s); | 147 | return raw_read_seqcount_begin(s); |
148 | } | 148 | } |
149 | 149 | ||
150 | /** | 150 | /** |
@@ -206,14 +206,26 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | |||
206 | } | 206 | } |
207 | 207 | ||
208 | 208 | ||
209 | |||
210 | static inline void raw_write_seqcount_begin(seqcount_t *s) | ||
211 | { | ||
212 | s->sequence++; | ||
213 | smp_wmb(); | ||
214 | } | ||
215 | |||
216 | static inline void raw_write_seqcount_end(seqcount_t *s) | ||
217 | { | ||
218 | smp_wmb(); | ||
219 | s->sequence++; | ||
220 | } | ||
221 | |||
209 | /* | 222 | /* |
210 | * Sequence counter only version assumes that callers are using their | 223 | * Sequence counter only version assumes that callers are using their |
211 | * own mutexing. | 224 | * own mutexing. |
212 | */ | 225 | */ |
213 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) | 226 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) |
214 | { | 227 | { |
215 | s->sequence++; | 228 | raw_write_seqcount_begin(s); |
216 | smp_wmb(); | ||
217 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); | 229 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); |
218 | } | 230 | } |
219 | 231 | ||
@@ -225,8 +237,7 @@ static inline void write_seqcount_begin(seqcount_t *s) | |||
225 | static inline void write_seqcount_end(seqcount_t *s) | 237 | static inline void write_seqcount_end(seqcount_t *s) |
226 | { | 238 | { |
227 | seqcount_release(&s->dep_map, 1, _RET_IP_); | 239 | seqcount_release(&s->dep_map, 1, _RET_IP_); |
228 | smp_wmb(); | 240 | raw_write_seqcount_end(s); |
229 | s->sequence++; | ||
230 | } | 241 | } |
231 | 242 | ||
232 | /** | 243 | /** |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 30aa0dc60d75..9d55438bc4ad 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -47,6 +47,8 @@ extern int shmem_init(void); | |||
47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
48 | extern struct file *shmem_file_setup(const char *name, | 48 | extern struct file *shmem_file_setup(const char *name, |
49 | loff_t size, unsigned long flags); | 49 | loff_t size, unsigned long flags); |
50 | extern struct file *shmem_kernel_file_setup(const char *name, loff_t size, | ||
51 | unsigned long flags); | ||
50 | extern int shmem_zero_setup(struct vm_area_struct *); | 52 | extern int shmem_zero_setup(struct vm_area_struct *); |
51 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | 53 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
52 | extern void shmem_unlock_mapping(struct address_space *mapping); | 54 | extern void shmem_unlock_mapping(struct address_space *mapping); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bec1cc7d5e3c..6f69b3f914fb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1638,6 +1638,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
1638 | skb->mac_header += offset; | 1638 | skb->mac_header += offset; |
1639 | } | 1639 | } |
1640 | 1640 | ||
1641 | static inline void skb_pop_mac_header(struct sk_buff *skb) | ||
1642 | { | ||
1643 | skb->mac_header = skb->network_header; | ||
1644 | } | ||
1645 | |||
1641 | static inline void skb_probe_transport_header(struct sk_buff *skb, | 1646 | static inline void skb_probe_transport_header(struct sk_buff *skb, |
1642 | const int offset_hint) | 1647 | const int offset_hint) |
1643 | { | 1648 | { |
@@ -2263,6 +2268,24 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, | |||
2263 | 2268 | ||
2264 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | 2269 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); |
2265 | 2270 | ||
2271 | /** | ||
2272 | * pskb_trim_rcsum - trim received skb and update checksum | ||
2273 | * @skb: buffer to trim | ||
2274 | * @len: new length | ||
2275 | * | ||
2276 | * This is exactly the same as pskb_trim except that it ensures the | ||
2277 | * checksum of received packets are still valid after the operation. | ||
2278 | */ | ||
2279 | |||
2280 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
2281 | { | ||
2282 | if (likely(len >= skb->len)) | ||
2283 | return 0; | ||
2284 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
2285 | skb->ip_summed = CHECKSUM_NONE; | ||
2286 | return __pskb_trim(skb, len); | ||
2287 | } | ||
2288 | |||
2266 | #define skb_queue_walk(queue, skb) \ | 2289 | #define skb_queue_walk(queue, skb) \ |
2267 | for (skb = (queue)->next; \ | 2290 | for (skb = (queue)->next; \ |
2268 | skb != (struct sk_buff *)(queue); \ | 2291 | skb != (struct sk_buff *)(queue); \ |
@@ -2360,27 +2383,6 @@ __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len, | |||
2360 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, | 2383 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, |
2361 | __wsum csum); | 2384 | __wsum csum); |
2362 | 2385 | ||
2363 | /** | ||
2364 | * pskb_trim_rcsum - trim received skb and update checksum | ||
2365 | * @skb: buffer to trim | ||
2366 | * @len: new length | ||
2367 | * | ||
2368 | * This is exactly the same as pskb_trim except that it ensures the | ||
2369 | * checksum of received packets are still valid after the operation. | ||
2370 | */ | ||
2371 | |||
2372 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
2373 | { | ||
2374 | if (likely(len >= skb->len)) | ||
2375 | return 0; | ||
2376 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | ||
2377 | __wsum adj = skb_checksum(skb, len, skb->len - len, 0); | ||
2378 | |||
2379 | skb->csum = csum_sub(skb->csum, adj); | ||
2380 | } | ||
2381 | return __pskb_trim(skb, len); | ||
2382 | } | ||
2383 | |||
2384 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 2386 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
2385 | int len, void *buffer) | 2387 | int len, void *buffer) |
2386 | { | 2388 | { |
@@ -2529,6 +2531,10 @@ static inline void sw_tx_timestamp(struct sk_buff *skb) | |||
2529 | * Ethernet MAC Drivers should call this function in their hard_xmit() | 2531 | * Ethernet MAC Drivers should call this function in their hard_xmit() |
2530 | * function immediately before giving the sk_buff to the MAC hardware. | 2532 | * function immediately before giving the sk_buff to the MAC hardware. |
2531 | * | 2533 | * |
2534 | * Specifically, one should make absolutely sure that this function is | ||
2535 | * called before TX completion of this packet can trigger. Otherwise | ||
2536 | * the packet could potentially already be freed. | ||
2537 | * | ||
2532 | * @skb: A socket buffer. | 2538 | * @skb: A socket buffer. |
2533 | */ | 2539 | */ |
2534 | static inline void skb_tx_timestamp(struct sk_buff *skb) | 2540 | static inline void skb_tx_timestamp(struct sk_buff *skb) |
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h deleted file mode 100644 index 0aa6acc73317..000000000000 --- a/include/linux/spi/74x164.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef LINUX_SPI_74X164_H | ||
2 | #define LINUX_SPI_74X164_H | ||
3 | |||
4 | struct gen_74x164_chip_platform_data { | ||
5 | /* number assigned to the first GPIO */ | ||
6 | unsigned base; | ||
7 | }; | ||
8 | |||
9 | #endif | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 75f34949d9ab..3f2867ff0ced 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -130,6 +130,16 @@ do { \ | |||
130 | #define smp_mb__before_spinlock() smp_wmb() | 130 | #define smp_mb__before_spinlock() smp_wmb() |
131 | #endif | 131 | #endif |
132 | 132 | ||
133 | /* | ||
134 | * Place this after a lock-acquisition primitive to guarantee that | ||
135 | * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies | ||
136 | * if the UNLOCK and LOCK are executed by the same CPU or if the | ||
137 | * UNLOCK and LOCK operate on the same lock variable. | ||
138 | */ | ||
139 | #ifndef smp_mb__after_unlock_lock | ||
140 | #define smp_mb__after_unlock_lock() do { } while (0) | ||
141 | #endif | ||
142 | |||
133 | /** | 143 | /** |
134 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked | 144 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked |
135 | * @lock: the spinlock in question. | 145 | * @lock: the spinlock in question. |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index bdb9993f0fda..42dfab89e740 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -131,8 +131,7 @@ static inline void __raw_spin_lock_irq(raw_spinlock_t *lock) | |||
131 | 131 | ||
132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) | 132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) |
133 | { | 133 | { |
134 | local_bh_disable(); | 134 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
135 | preempt_disable(); | ||
136 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 135 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
137 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); | 136 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
138 | } | 137 | } |
@@ -174,20 +173,17 @@ static inline void __raw_spin_unlock_bh(raw_spinlock_t *lock) | |||
174 | { | 173 | { |
175 | spin_release(&lock->dep_map, 1, _RET_IP_); | 174 | spin_release(&lock->dep_map, 1, _RET_IP_); |
176 | do_raw_spin_unlock(lock); | 175 | do_raw_spin_unlock(lock); |
177 | preempt_enable_no_resched(); | 176 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
178 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
179 | } | 177 | } |
180 | 178 | ||
181 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) | 179 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) |
182 | { | 180 | { |
183 | local_bh_disable(); | 181 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
184 | preempt_disable(); | ||
185 | if (do_raw_spin_trylock(lock)) { | 182 | if (do_raw_spin_trylock(lock)) { |
186 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | 183 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); |
187 | return 1; | 184 | return 1; |
188 | } | 185 | } |
189 | preempt_enable_no_resched(); | 186 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
190 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
191 | return 0; | 187 | return 0; |
192 | } | 188 | } |
193 | 189 | ||
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index af1f47229e70..d0d188861ad6 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
@@ -24,11 +24,14 @@ | |||
24 | * flags straight, to suppress compiler warnings of unused lock | 24 | * flags straight, to suppress compiler warnings of unused lock |
25 | * variables, and to add the proper checker annotations: | 25 | * variables, and to add the proper checker annotations: |
26 | */ | 26 | */ |
27 | #define ___LOCK(lock) \ | ||
28 | do { __acquire(lock); (void)(lock); } while (0) | ||
29 | |||
27 | #define __LOCK(lock) \ | 30 | #define __LOCK(lock) \ |
28 | do { preempt_disable(); __acquire(lock); (void)(lock); } while (0) | 31 | do { preempt_disable(); ___LOCK(lock); } while (0) |
29 | 32 | ||
30 | #define __LOCK_BH(lock) \ | 33 | #define __LOCK_BH(lock) \ |
31 | do { local_bh_disable(); __LOCK(lock); } while (0) | 34 | do { __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); ___LOCK(lock); } while (0) |
32 | 35 | ||
33 | #define __LOCK_IRQ(lock) \ | 36 | #define __LOCK_IRQ(lock) \ |
34 | do { local_irq_disable(); __LOCK(lock); } while (0) | 37 | do { local_irq_disable(); __LOCK(lock); } while (0) |
@@ -36,12 +39,15 @@ | |||
36 | #define __LOCK_IRQSAVE(lock, flags) \ | 39 | #define __LOCK_IRQSAVE(lock, flags) \ |
37 | do { local_irq_save(flags); __LOCK(lock); } while (0) | 40 | do { local_irq_save(flags); __LOCK(lock); } while (0) |
38 | 41 | ||
42 | #define ___UNLOCK(lock) \ | ||
43 | do { __release(lock); (void)(lock); } while (0) | ||
44 | |||
39 | #define __UNLOCK(lock) \ | 45 | #define __UNLOCK(lock) \ |
40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) | 46 | do { preempt_enable(); ___UNLOCK(lock); } while (0) |
41 | 47 | ||
42 | #define __UNLOCK_BH(lock) \ | 48 | #define __UNLOCK_BH(lock) \ |
43 | do { preempt_enable_no_resched(); local_bh_enable(); \ | 49 | do { __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); \ |
44 | __release(lock); (void)(lock); } while (0) | 50 | ___UNLOCK(lock); } while (0) |
45 | 51 | ||
46 | #define __UNLOCK_IRQ(lock) \ | 52 | #define __UNLOCK_IRQ(lock) \ |
47 | do { local_irq_enable(); __UNLOCK(lock); } while (0) | 53 | do { local_irq_enable(); __UNLOCK(lock); } while (0) |
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h index 44ef5da21470..bcbb642a7641 100644 --- a/include/linux/ssbi.h +++ b/include/linux/ssbi.h | |||
@@ -17,22 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | 19 | ||
20 | struct ssbi_slave_info { | 20 | int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len); |
21 | const char *name; | ||
22 | void *platform_data; | ||
23 | }; | ||
24 | |||
25 | enum ssbi_controller_type { | ||
26 | MSM_SBI_CTRL_SSBI = 0, | ||
27 | MSM_SBI_CTRL_SSBI2, | ||
28 | MSM_SBI_CTRL_PMIC_ARBITER, | ||
29 | }; | ||
30 | |||
31 | struct ssbi_platform_data { | ||
32 | struct ssbi_slave_info slave; | ||
33 | enum ssbi_controller_type controller_type; | ||
34 | }; | ||
35 | |||
36 | int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len); | ||
37 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); | 21 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); |
22 | |||
38 | #endif | 23 | #endif |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 94273bbe6050..40ed9e9a77e5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -38,6 +38,7 @@ struct rlimit; | |||
38 | struct rlimit64; | 38 | struct rlimit64; |
39 | struct rusage; | 39 | struct rusage; |
40 | struct sched_param; | 40 | struct sched_param; |
41 | struct sched_attr; | ||
41 | struct sel_arg_struct; | 42 | struct sel_arg_struct; |
42 | struct semaphore; | 43 | struct semaphore; |
43 | struct sembuf; | 44 | struct sembuf; |
@@ -279,9 +280,14 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, | |||
279 | struct sched_param __user *param); | 280 | struct sched_param __user *param); |
280 | asmlinkage long sys_sched_setparam(pid_t pid, | 281 | asmlinkage long sys_sched_setparam(pid_t pid, |
281 | struct sched_param __user *param); | 282 | struct sched_param __user *param); |
283 | asmlinkage long sys_sched_setattr(pid_t pid, | ||
284 | struct sched_attr __user *attr); | ||
282 | asmlinkage long sys_sched_getscheduler(pid_t pid); | 285 | asmlinkage long sys_sched_getscheduler(pid_t pid); |
283 | asmlinkage long sys_sched_getparam(pid_t pid, | 286 | asmlinkage long sys_sched_getparam(pid_t pid, |
284 | struct sched_param __user *param); | 287 | struct sched_param __user *param); |
288 | asmlinkage long sys_sched_getattr(pid_t pid, | ||
289 | struct sched_attr __user *attr, | ||
290 | unsigned int size); | ||
285 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | 291 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, |
286 | unsigned long __user *user_mask_ptr); | 292 | unsigned long __user *user_mask_ptr); |
287 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | 293 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6695040a0317..30b2ebee6439 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifndef _SYSFS_H_ | 12 | #ifndef _SYSFS_H_ |
13 | #define _SYSFS_H_ | 13 | #define _SYSFS_H_ |
14 | 14 | ||
15 | #include <linux/kernfs.h> | ||
15 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
@@ -175,8 +176,6 @@ struct sysfs_ops { | |||
175 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); | 176 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); |
176 | }; | 177 | }; |
177 | 178 | ||
178 | struct sysfs_dirent; | ||
179 | |||
180 | #ifdef CONFIG_SYSFS | 179 | #ifdef CONFIG_SYSFS |
181 | 180 | ||
182 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 181 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
@@ -244,12 +243,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | |||
244 | const char *link_name); | 243 | const char *link_name); |
245 | 244 | ||
246 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 245 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
247 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | ||
248 | struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, | ||
249 | const unsigned char *name, | ||
250 | const void *ns); | ||
251 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | ||
252 | void sysfs_put(struct sysfs_dirent *sd); | ||
253 | 246 | ||
254 | int __must_check sysfs_init(void); | 247 | int __must_check sysfs_init(void); |
255 | 248 | ||
@@ -419,22 +412,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, | |||
419 | const char *attr) | 412 | const char *attr) |
420 | { | 413 | { |
421 | } | 414 | } |
422 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | ||
423 | { | ||
424 | } | ||
425 | static inline struct sysfs_dirent * | ||
426 | sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, | ||
427 | const void *ns) | ||
428 | { | ||
429 | return NULL; | ||
430 | } | ||
431 | static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd) | ||
432 | { | ||
433 | return NULL; | ||
434 | } | ||
435 | static inline void sysfs_put(struct sysfs_dirent *sd) | ||
436 | { | ||
437 | } | ||
438 | 415 | ||
439 | static inline int __must_check sysfs_init(void) | 416 | static inline int __must_check sysfs_init(void) |
440 | { | 417 | { |
@@ -461,10 +438,26 @@ static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target | |||
461 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); | 438 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); |
462 | } | 439 | } |
463 | 440 | ||
464 | static inline struct sysfs_dirent * | 441 | static inline void sysfs_notify_dirent(struct kernfs_node *kn) |
465 | sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) | 442 | { |
443 | kernfs_notify(kn); | ||
444 | } | ||
445 | |||
446 | static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent, | ||
447 | const unsigned char *name) | ||
448 | { | ||
449 | return kernfs_find_and_get(parent, name); | ||
450 | } | ||
451 | |||
452 | static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) | ||
453 | { | ||
454 | kernfs_get(kn); | ||
455 | return kn; | ||
456 | } | ||
457 | |||
458 | static inline void sysfs_put(struct kernfs_node *kn) | ||
466 | { | 459 | { |
467 | return sysfs_get_dirent_ns(parent_sd, name, NULL); | 460 | kernfs_put(kn); |
468 | } | 461 | } |
469 | 462 | ||
470 | #endif /* _SYSFS_H_ */ | 463 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 5128d33bbb39..0175d8663b6c 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -104,7 +104,7 @@ extern struct cpumask *tick_get_broadcast_oneshot_mask(void); | |||
104 | extern void tick_clock_notify(void); | 104 | extern void tick_clock_notify(void); |
105 | extern int tick_check_oneshot_change(int allow_nohz); | 105 | extern int tick_check_oneshot_change(int allow_nohz); |
106 | extern struct tick_sched *tick_get_tick_sched(int cpu); | 106 | extern struct tick_sched *tick_get_tick_sched(int cpu); |
107 | extern void tick_check_idle(int cpu); | 107 | extern void tick_check_idle(void); |
108 | extern int tick_oneshot_mode_active(void); | 108 | extern int tick_oneshot_mode_active(void); |
109 | # ifndef arch_needs_cpu | 109 | # ifndef arch_needs_cpu |
110 | # define arch_needs_cpu(cpu) (0) | 110 | # define arch_needs_cpu(cpu) (0) |
@@ -112,7 +112,7 @@ extern int tick_oneshot_mode_active(void); | |||
112 | # else | 112 | # else |
113 | static inline void tick_clock_notify(void) { } | 113 | static inline void tick_clock_notify(void) { } |
114 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 114 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
115 | static inline void tick_check_idle(int cpu) { } | 115 | static inline void tick_check_idle(void) { } |
116 | static inline int tick_oneshot_mode_active(void) { return 0; } | 116 | static inline int tick_oneshot_mode_active(void) { return 0; } |
117 | # endif | 117 | # endif |
118 | 118 | ||
@@ -121,7 +121,7 @@ static inline void tick_init(void) { } | |||
121 | static inline void tick_cancel_sched_timer(int cpu) { } | 121 | static inline void tick_cancel_sched_timer(int cpu) { } |
122 | static inline void tick_clock_notify(void) { } | 122 | static inline void tick_clock_notify(void) { } |
123 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 123 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
124 | static inline void tick_check_idle(int cpu) { } | 124 | static inline void tick_check_idle(void) { } |
125 | static inline int tick_oneshot_mode_active(void) { return 0; } | 125 | static inline int tick_oneshot_mode_active(void) { return 0; } |
126 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | 126 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
127 | 127 | ||
@@ -165,7 +165,7 @@ extern cpumask_var_t tick_nohz_full_mask; | |||
165 | 165 | ||
166 | static inline bool tick_nohz_full_enabled(void) | 166 | static inline bool tick_nohz_full_enabled(void) |
167 | { | 167 | { |
168 | if (!static_key_false(&context_tracking_enabled)) | 168 | if (!context_tracking_is_enabled()) |
169 | return false; | 169 | return false; |
170 | 170 | ||
171 | return tick_nohz_full_running; | 171 | return tick_nohz_full_running; |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 9a9051bb1a03..fff1d0976f80 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -29,6 +29,18 @@ | |||
29 | */ | 29 | */ |
30 | #define TPM_ANY_NUM 0xFFFF | 30 | #define TPM_ANY_NUM 0xFFFF |
31 | 31 | ||
32 | struct tpm_chip; | ||
33 | |||
34 | struct tpm_class_ops { | ||
35 | const u8 req_complete_mask; | ||
36 | const u8 req_complete_val; | ||
37 | bool (*req_canceled)(struct tpm_chip *chip, u8 status); | ||
38 | int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
39 | int (*send) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
40 | void (*cancel) (struct tpm_chip *chip); | ||
41 | u8 (*status) (struct tpm_chip *chip); | ||
42 | }; | ||
43 | |||
32 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) | 44 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
33 | 45 | ||
34 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 46 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index ebeab360d851..f16dc0a40049 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -267,6 +267,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
267 | 267 | ||
268 | #define TRACE_EVENT_FLAGS(event, flag) | 268 | #define TRACE_EVENT_FLAGS(event, flag) |
269 | 269 | ||
270 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
271 | |||
270 | #endif /* DECLARE_TRACE */ | 272 | #endif /* DECLARE_TRACE */ |
271 | 273 | ||
272 | #ifndef TRACE_EVENT | 274 | #ifndef TRACE_EVENT |
@@ -399,4 +401,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
399 | 401 | ||
400 | #define TRACE_EVENT_FLAGS(event, flag) | 402 | #define TRACE_EVENT_FLAGS(event, flag) |
401 | 403 | ||
404 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
405 | |||
402 | #endif /* ifdef TRACE_EVENT (see note above) */ | 406 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 97d660ed70c1..90b4fdc8a61f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -39,10 +39,14 @@ struct tty_buffer { | |||
39 | int size; | 39 | int size; |
40 | int commit; | 40 | int commit; |
41 | int read; | 41 | int read; |
42 | int flags; | ||
42 | /* Data points here */ | 43 | /* Data points here */ |
43 | unsigned long data[0]; | 44 | unsigned long data[0]; |
44 | }; | 45 | }; |
45 | 46 | ||
47 | /* Values for .flags field of tty_buffer */ | ||
48 | #define TTYB_NORMAL 1 /* buffer has no flags buffer */ | ||
49 | |||
46 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) | 50 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) |
47 | { | 51 | { |
48 | return ((unsigned char *)b->data) + ofs; | 52 | return ((unsigned char *)b->data) + ofs; |
@@ -60,7 +64,8 @@ struct tty_bufhead { | |||
60 | atomic_t priority; | 64 | atomic_t priority; |
61 | struct tty_buffer sentinel; | 65 | struct tty_buffer sentinel; |
62 | struct llist_head free; /* Free queue head */ | 66 | struct llist_head free; /* Free queue head */ |
63 | atomic_t memory_used; /* In-use buffers excluding free list */ | 67 | atomic_t mem_used; /* In-use buffers excluding free list */ |
68 | int mem_limit; | ||
64 | struct tty_buffer *tail; /* Active buffer */ | 69 | struct tty_buffer *tail; /* Active buffer */ |
65 | }; | 70 | }; |
66 | /* | 71 | /* |
@@ -137,6 +142,7 @@ struct tty_bufhead { | |||
137 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) | 142 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) |
138 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) | 143 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) |
139 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) | 144 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) |
145 | #define C_CMSPAR(tty) _C_FLAG((tty), CMSPAR) | ||
140 | 146 | ||
141 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) | 147 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) |
142 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) | 148 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) |
@@ -422,7 +428,6 @@ extern int is_ignored(int sig); | |||
422 | extern int tty_signal(int sig, struct tty_struct *tty); | 428 | extern int tty_signal(int sig, struct tty_struct *tty); |
423 | extern void tty_hangup(struct tty_struct *tty); | 429 | extern void tty_hangup(struct tty_struct *tty); |
424 | extern void tty_vhangup(struct tty_struct *tty); | 430 | extern void tty_vhangup(struct tty_struct *tty); |
425 | extern void tty_vhangup_locked(struct tty_struct *tty); | ||
426 | extern void tty_unhangup(struct file *filp); | 431 | extern void tty_unhangup(struct file *filp); |
427 | extern int tty_hung_up_p(struct file *filp); | 432 | extern int tty_hung_up_p(struct file *filp); |
428 | extern void do_SAK(struct tty_struct *tty); | 433 | extern void do_SAK(struct tty_struct *tty); |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 21ddd7d9ea1f..c28dd523f96e 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_TTY_FLIP_H | 1 | #ifndef _LINUX_TTY_FLIP_H |
2 | #define _LINUX_TTY_FLIP_H | 2 | #define _LINUX_TTY_FLIP_H |
3 | 3 | ||
4 | extern int tty_buffer_set_limit(struct tty_port *port, int limit); | ||
4 | extern int tty_buffer_space_avail(struct tty_port *port); | 5 | extern int tty_buffer_space_avail(struct tty_port *port); |
5 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); | 6 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); |
6 | extern int tty_insert_flip_string_flags(struct tty_port *port, | 7 | extern int tty_insert_flip_string_flags(struct tty_port *port, |
@@ -9,8 +10,6 @@ extern int tty_insert_flip_string_fixed_flag(struct tty_port *port, | |||
9 | const unsigned char *chars, char flag, size_t size); | 10 | const unsigned char *chars, char flag, size_t size); |
10 | extern int tty_prepare_flip_string(struct tty_port *port, | 11 | extern int tty_prepare_flip_string(struct tty_port *port, |
11 | unsigned char **chars, size_t size); | 12 | unsigned char **chars, size_t size); |
12 | extern int tty_prepare_flip_string_flags(struct tty_port *port, | ||
13 | unsigned char **chars, char **flags, size_t size); | ||
14 | extern void tty_flip_buffer_push(struct tty_port *port); | 13 | extern void tty_flip_buffer_push(struct tty_port *port); |
15 | void tty_schedule_flip(struct tty_port *port); | 14 | void tty_schedule_flip(struct tty_port *port); |
16 | 15 | ||
@@ -18,8 +17,12 @@ static inline int tty_insert_flip_char(struct tty_port *port, | |||
18 | unsigned char ch, char flag) | 17 | unsigned char ch, char flag) |
19 | { | 18 | { |
20 | struct tty_buffer *tb = port->buf.tail; | 19 | struct tty_buffer *tb = port->buf.tail; |
21 | if (tb && tb->used < tb->size) { | 20 | int change; |
22 | *flag_buf_ptr(tb, tb->used) = flag; | 21 | |
22 | change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL); | ||
23 | if (!change && tb->used < tb->size) { | ||
24 | if (~tb->flags & TTYB_NORMAL) | ||
25 | *flag_buf_ptr(tb, tb->used) = flag; | ||
23 | *char_buf_ptr(tb, tb->used++) = ch; | 26 | *char_buf_ptr(tb, tb->used++) = ch; |
24 | return 1; | 27 | return 1; |
25 | } | 28 | } |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index f15c898ff462..b8347c207cb8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -84,7 +84,8 @@ | |||
84 | * processing. <cp> is a pointer to the buffer of input | 84 | * processing. <cp> is a pointer to the buffer of input |
85 | * character received by the device. <fp> is a pointer to a | 85 | * character received by the device. <fp> is a pointer to a |
86 | * pointer of flag bytes which indicate whether a character was | 86 | * pointer of flag bytes which indicate whether a character was |
87 | * received with a parity error, etc. | 87 | * received with a parity error, etc. <fp> may be NULL to indicate |
88 | * all data received is TTY_NORMAL. | ||
88 | * | 89 | * |
89 | * void (*write_wakeup)(struct tty_struct *); | 90 | * void (*write_wakeup)(struct tty_struct *); |
90 | * | 91 | * |
@@ -118,7 +119,8 @@ | |||
118 | * processing. <cp> is a pointer to the buffer of input | 119 | * processing. <cp> is a pointer to the buffer of input |
119 | * character received by the device. <fp> is a pointer to a | 120 | * character received by the device. <fp> is a pointer to a |
120 | * pointer of flag bytes which indicate whether a character was | 121 | * pointer of flag bytes which indicate whether a character was |
121 | * received with a parity error, etc. | 122 | * received with a parity error, etc. <fp> may be NULL to indicate |
123 | * all data received is TTY_NORMAL. | ||
122 | * If assigned, prefer this function for automatic flow control. | 124 | * If assigned, prefer this function for automatic flow control. |
123 | */ | 125 | */ |
124 | 126 | ||
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 9d8cf056e661..ecd3319dac33 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -25,13 +25,16 @@ static inline void pagefault_disable(void) | |||
25 | 25 | ||
26 | static inline void pagefault_enable(void) | 26 | static inline void pagefault_enable(void) |
27 | { | 27 | { |
28 | #ifndef CONFIG_PREEMPT | ||
28 | /* | 29 | /* |
29 | * make sure to issue those last loads/stores before enabling | 30 | * make sure to issue those last loads/stores before enabling |
30 | * the pagefault handler again. | 31 | * the pagefault handler again. |
31 | */ | 32 | */ |
32 | barrier(); | 33 | barrier(); |
33 | preempt_count_dec(); | 34 | preempt_count_dec(); |
34 | preempt_check_resched(); | 35 | #else |
36 | preempt_enable(); | ||
37 | #endif | ||
35 | } | 38 | } |
36 | 39 | ||
37 | #ifndef ARCH_HAS_NOCACHE_UACCESS | 40 | #ifndef ARCH_HAS_NOCACHE_UACCESS |
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 319eae70fe84..e32251e00e62 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -26,16 +26,13 @@ | |||
26 | 26 | ||
27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
28 | #include <linux/rbtree.h> | 28 | #include <linux/rbtree.h> |
29 | #include <linux/types.h> | ||
29 | 30 | ||
30 | struct vm_area_struct; | 31 | struct vm_area_struct; |
31 | struct mm_struct; | 32 | struct mm_struct; |
32 | struct inode; | 33 | struct inode; |
33 | struct notifier_block; | 34 | struct notifier_block; |
34 | 35 | ||
35 | #ifdef CONFIG_ARCH_SUPPORTS_UPROBES | ||
36 | # include <asm/uprobes.h> | ||
37 | #endif | ||
38 | |||
39 | #define UPROBE_HANDLER_REMOVE 1 | 36 | #define UPROBE_HANDLER_REMOVE 1 |
40 | #define UPROBE_HANDLER_MASK 1 | 37 | #define UPROBE_HANDLER_MASK 1 |
41 | 38 | ||
@@ -60,6 +57,8 @@ struct uprobe_consumer { | |||
60 | }; | 57 | }; |
61 | 58 | ||
62 | #ifdef CONFIG_UPROBES | 59 | #ifdef CONFIG_UPROBES |
60 | #include <asm/uprobes.h> | ||
61 | |||
63 | enum uprobe_task_state { | 62 | enum uprobe_task_state { |
64 | UTASK_RUNNING, | 63 | UTASK_RUNNING, |
65 | UTASK_SSTEP, | 64 | UTASK_SSTEP, |
@@ -72,35 +71,28 @@ enum uprobe_task_state { | |||
72 | */ | 71 | */ |
73 | struct uprobe_task { | 72 | struct uprobe_task { |
74 | enum uprobe_task_state state; | 73 | enum uprobe_task_state state; |
75 | struct arch_uprobe_task autask; | ||
76 | 74 | ||
77 | struct return_instance *return_instances; | 75 | union { |
78 | unsigned int depth; | 76 | struct { |
79 | struct uprobe *active_uprobe; | 77 | struct arch_uprobe_task autask; |
78 | unsigned long vaddr; | ||
79 | }; | ||
80 | 80 | ||
81 | struct { | ||
82 | struct callback_head dup_xol_work; | ||
83 | unsigned long dup_xol_addr; | ||
84 | }; | ||
85 | }; | ||
86 | |||
87 | struct uprobe *active_uprobe; | ||
81 | unsigned long xol_vaddr; | 88 | unsigned long xol_vaddr; |
82 | unsigned long vaddr; | ||
83 | }; | ||
84 | 89 | ||
85 | /* | 90 | struct return_instance *return_instances; |
86 | * On a breakpoint hit, thread contests for a slot. It frees the | 91 | unsigned int depth; |
87 | * slot after singlestep. Currently a fixed number of slots are | ||
88 | * allocated. | ||
89 | */ | ||
90 | struct xol_area { | ||
91 | wait_queue_head_t wq; /* if all slots are busy */ | ||
92 | atomic_t slot_count; /* number of in-use slots */ | ||
93 | unsigned long *bitmap; /* 0 = free slot */ | ||
94 | struct page *page; | ||
95 | |||
96 | /* | ||
97 | * We keep the vma's vm_start rather than a pointer to the vma | ||
98 | * itself. The probed process or a naughty kernel module could make | ||
99 | * the vma go away, and we must handle that reasonably gracefully. | ||
100 | */ | ||
101 | unsigned long vaddr; /* Page(s) of instruction slots */ | ||
102 | }; | 92 | }; |
103 | 93 | ||
94 | struct xol_area; | ||
95 | |||
104 | struct uprobes_state { | 96 | struct uprobes_state { |
105 | struct xol_area *xol_area; | 97 | struct xol_area *xol_area; |
106 | }; | 98 | }; |
@@ -109,6 +101,7 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign | |||
109 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 101 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
110 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 102 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
111 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | 103 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); |
104 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
112 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); | 105 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); |
113 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 106 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
114 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 107 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
@@ -120,7 +113,6 @@ extern void uprobe_end_dup_mmap(void); | |||
120 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | 113 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); |
121 | extern void uprobe_free_utask(struct task_struct *t); | 114 | extern void uprobe_free_utask(struct task_struct *t); |
122 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); | 115 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); |
123 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
124 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 116 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
125 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 117 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
126 | extern void uprobe_notify_resume(struct pt_regs *regs); | 118 | extern void uprobe_notify_resume(struct pt_regs *regs); |
@@ -176,10 +168,6 @@ static inline bool uprobe_deny_signal(void) | |||
176 | { | 168 | { |
177 | return false; | 169 | return false; |
178 | } | 170 | } |
179 | static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) | ||
180 | { | ||
181 | return 0; | ||
182 | } | ||
183 | static inline void uprobe_free_utask(struct task_struct *t) | 171 | static inline void uprobe_free_utask(struct task_struct *t) |
184 | { | 172 | { |
185 | } | 173 | } |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7454865ad148..c716da18c668 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -965,6 +965,7 @@ struct usb_dynid { | |||
965 | }; | 965 | }; |
966 | 966 | ||
967 | extern ssize_t usb_store_new_id(struct usb_dynids *dynids, | 967 | extern ssize_t usb_store_new_id(struct usb_dynids *dynids, |
968 | const struct usb_device_id *id_table, | ||
968 | struct device_driver *driver, | 969 | struct device_driver *driver, |
969 | const char *buf, size_t count); | 970 | const char *buf, size_t count); |
970 | 971 | ||
@@ -1264,6 +1265,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1264 | * @sg: scatter gather buffer list, the buffer size of each element in | 1265 | * @sg: scatter gather buffer list, the buffer size of each element in |
1265 | * the list (except the last) must be divisible by the endpoint's | 1266 | * the list (except the last) must be divisible by the endpoint's |
1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' | 1267 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' |
1268 | * (FIXME: scatter-gather under xHCI is broken for periodic transfers. | ||
1269 | * Do not use urb->sg for interrupt endpoints for now, only bulk.) | ||
1267 | * @num_mapped_sgs: (internal) number of mapped sg entries | 1270 | * @num_mapped_sgs: (internal) number of mapped sg entries |
1268 | * @num_sgs: number of entries in the sg list | 1271 | * @num_sgs: number of entries in the sg list |
1269 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1272 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 7d399671a566..708bd119627f 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -24,6 +24,7 @@ struct ci_hdrc_platform_data { | |||
24 | * but otg is not supported (no register otgsc). | 24 | * but otg is not supported (no register otgsc). |
25 | */ | 25 | */ |
26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) | 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) |
27 | #define CI_HDRC_IMX28_WRITE_FIX BIT(5) | ||
27 | enum usb_dr_mode dr_mode; | 28 | enum usb_dr_mode dr_mode; |
28 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 | 29 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
29 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 | 30 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 5e61589fc166..dba63f53906c 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -468,6 +468,8 @@ struct usb_function_instance { | |||
468 | struct config_group group; | 468 | struct config_group group; |
469 | struct list_head cfs_list; | 469 | struct list_head cfs_list; |
470 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
471 | int (*set_inst_name)(struct usb_function_instance *inst, | ||
472 | const char *name); | ||
471 | void (*free_func_inst)(struct usb_function_instance *inst); | 473 | void (*free_func_inst)(struct usb_function_instance *inst); |
472 | }; | 474 | }; |
473 | 475 | ||
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index 65d0a88dbc67..71190663f1ee 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
@@ -3,34 +3,4 @@ | |||
3 | 3 | ||
4 | #include <uapi/linux/usb/functionfs.h> | 4 | #include <uapi/linux/usb/functionfs.h> |
5 | 5 | ||
6 | |||
7 | struct ffs_data; | ||
8 | struct usb_composite_dev; | ||
9 | struct usb_configuration; | ||
10 | |||
11 | |||
12 | static int functionfs_init(void) __attribute__((warn_unused_result)); | ||
13 | static void functionfs_cleanup(void); | ||
14 | |||
15 | static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) | ||
16 | __attribute__((warn_unused_result, nonnull)); | ||
17 | static void functionfs_unbind(struct ffs_data *ffs) | ||
18 | __attribute__((nonnull)); | ||
19 | |||
20 | static int functionfs_bind_config(struct usb_composite_dev *cdev, | ||
21 | struct usb_configuration *c, | ||
22 | struct ffs_data *ffs) | ||
23 | __attribute__((warn_unused_result, nonnull)); | ||
24 | |||
25 | |||
26 | static int functionfs_ready_callback(struct ffs_data *ffs) | ||
27 | __attribute__((warn_unused_result, nonnull)); | ||
28 | static void functionfs_closed_callback(struct ffs_data *ffs) | ||
29 | __attribute__((nonnull)); | ||
30 | static void *functionfs_acquire_dev_callback(const char *dev_name) | ||
31 | __attribute__((warn_unused_result, nonnull)); | ||
32 | static void functionfs_release_dev_callback(struct ffs_data *ffs_data) | ||
33 | __attribute__((nonnull)); | ||
34 | |||
35 | |||
36 | #endif | 6 | #endif |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 942ef5e053bf..c3a61853cd13 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -148,6 +148,9 @@ struct usb_ep_ops { | |||
148 | * @maxpacket:The maximum packet size used on this endpoint. The initial | 148 | * @maxpacket:The maximum packet size used on this endpoint. The initial |
149 | * value can sometimes be reduced (hardware allowing), according to | 149 | * value can sometimes be reduced (hardware allowing), according to |
150 | * the endpoint descriptor used to configure the endpoint. | 150 | * the endpoint descriptor used to configure the endpoint. |
151 | * @maxpacket_limit:The maximum packet size value which can be handled by this | ||
152 | * endpoint. It's set once by UDC driver when endpoint is initialized, and | ||
153 | * should not be changed. Should not be confused with maxpacket. | ||
151 | * @max_streams: The maximum number of streams supported | 154 | * @max_streams: The maximum number of streams supported |
152 | * by this EP (0 - 16, actual number is 2^n) | 155 | * by this EP (0 - 16, actual number is 2^n) |
153 | * @mult: multiplier, 'mult' value for SS Isoc EPs | 156 | * @mult: multiplier, 'mult' value for SS Isoc EPs |
@@ -171,6 +174,7 @@ struct usb_ep { | |||
171 | const struct usb_ep_ops *ops; | 174 | const struct usb_ep_ops *ops; |
172 | struct list_head ep_list; | 175 | struct list_head ep_list; |
173 | unsigned maxpacket:16; | 176 | unsigned maxpacket:16; |
177 | unsigned maxpacket_limit:16; | ||
174 | unsigned max_streams:16; | 178 | unsigned max_streams:16; |
175 | unsigned mult:2; | 179 | unsigned mult:2; |
176 | unsigned maxburst:5; | 180 | unsigned maxburst:5; |
@@ -182,6 +186,21 @@ struct usb_ep { | |||
182 | /*-------------------------------------------------------------------------*/ | 186 | /*-------------------------------------------------------------------------*/ |
183 | 187 | ||
184 | /** | 188 | /** |
189 | * usb_ep_set_maxpacket_limit - set maximum packet size limit for endpoint | ||
190 | * @ep:the endpoint being configured | ||
191 | * @maxpacket_limit:value of maximum packet size limit | ||
192 | * | ||
193 | * This function shoud be used only in UDC drivers to initialize endpoint | ||
194 | * (usually in probe function). | ||
195 | */ | ||
196 | static inline void usb_ep_set_maxpacket_limit(struct usb_ep *ep, | ||
197 | unsigned maxpacket_limit) | ||
198 | { | ||
199 | ep->maxpacket_limit = maxpacket_limit; | ||
200 | ep->maxpacket = maxpacket_limit; | ||
201 | } | ||
202 | |||
203 | /** | ||
185 | * usb_ep_enable - configure endpoint, making it usable | 204 | * usb_ep_enable - configure endpoint, making it usable |
186 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". | 205 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". |
187 | * drivers discover endpoints through the ep_list of a usb_gadget. | 206 | * drivers discover endpoints through the ep_list of a usb_gadget. |
@@ -485,6 +504,11 @@ struct usb_gadget_ops { | |||
485 | * @max_speed: Maximal speed the UDC can handle. UDC must support this | 504 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
486 | * and all slower speeds. | 505 | * and all slower speeds. |
487 | * @state: the state we are now (attached, suspended, configured, etc) | 506 | * @state: the state we are now (attached, suspended, configured, etc) |
507 | * @name: Identifies the controller hardware type. Used in diagnostics | ||
508 | * and sometimes configuration. | ||
509 | * @dev: Driver model state for this abstract device. | ||
510 | * @out_epnum: last used out ep number | ||
511 | * @in_epnum: last used in ep number | ||
488 | * @sg_supported: true if we can handle scatter-gather | 512 | * @sg_supported: true if we can handle scatter-gather |
489 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 513 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
490 | * gadget driver must provide a USB OTG descriptor. | 514 | * gadget driver must provide a USB OTG descriptor. |
@@ -497,11 +521,8 @@ struct usb_gadget_ops { | |||
497 | * only supports HNP on a different root port. | 521 | * only supports HNP on a different root port. |
498 | * @b_hnp_enable: OTG device feature flag, indicating that the A-Host | 522 | * @b_hnp_enable: OTG device feature flag, indicating that the A-Host |
499 | * enabled HNP support. | 523 | * enabled HNP support. |
500 | * @name: Identifies the controller hardware type. Used in diagnostics | 524 | * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to |
501 | * and sometimes configuration. | 525 | * MaxPacketSize. |
502 | * @dev: Driver model state for this abstract device. | ||
503 | * @out_epnum: last used out ep number | ||
504 | * @in_epnum: last used in ep number | ||
505 | * | 526 | * |
506 | * Gadgets have a mostly-portable "gadget driver" implementing device | 527 | * Gadgets have a mostly-portable "gadget driver" implementing device |
507 | * functions, handling all usb configurations and interfaces. Gadget | 528 | * functions, handling all usb configurations and interfaces. Gadget |
@@ -530,16 +551,18 @@ struct usb_gadget { | |||
530 | enum usb_device_speed speed; | 551 | enum usb_device_speed speed; |
531 | enum usb_device_speed max_speed; | 552 | enum usb_device_speed max_speed; |
532 | enum usb_device_state state; | 553 | enum usb_device_state state; |
554 | const char *name; | ||
555 | struct device dev; | ||
556 | unsigned out_epnum; | ||
557 | unsigned in_epnum; | ||
558 | |||
533 | unsigned sg_supported:1; | 559 | unsigned sg_supported:1; |
534 | unsigned is_otg:1; | 560 | unsigned is_otg:1; |
535 | unsigned is_a_peripheral:1; | 561 | unsigned is_a_peripheral:1; |
536 | unsigned b_hnp_enable:1; | 562 | unsigned b_hnp_enable:1; |
537 | unsigned a_hnp_support:1; | 563 | unsigned a_hnp_support:1; |
538 | unsigned a_alt_hnp_support:1; | 564 | unsigned a_alt_hnp_support:1; |
539 | const char *name; | 565 | unsigned quirk_ep_out_aligned_size:1; |
540 | struct device dev; | ||
541 | unsigned out_epnum; | ||
542 | unsigned in_epnum; | ||
543 | }; | 566 | }; |
544 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) | 567 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) |
545 | 568 | ||
@@ -558,6 +581,23 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | |||
558 | 581 | ||
559 | 582 | ||
560 | /** | 583 | /** |
584 | * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget | ||
585 | * requires quirk_ep_out_aligned_size, otherwise reguens len. | ||
586 | * @g: controller to check for quirk | ||
587 | * @ep: the endpoint whose maxpacketsize is used to align @len | ||
588 | * @len: buffer size's length to align to @ep's maxpacketsize | ||
589 | * | ||
590 | * This helper is used in case it's required for any reason to check and maybe | ||
591 | * align buffer's size to an ep's maxpacketsize. | ||
592 | */ | ||
593 | static inline size_t | ||
594 | usb_ep_align_maybe(struct usb_gadget *g, struct usb_ep *ep, size_t len) | ||
595 | { | ||
596 | return !g->quirk_ep_out_aligned_size ? len : | ||
597 | round_up(len, (size_t)ep->desc->wMaxPacketSize); | ||
598 | } | ||
599 | |||
600 | /** | ||
561 | * gadget_is_dualspeed - return true iff the hardware handles high speed | 601 | * gadget_is_dualspeed - return true iff the hardware handles high speed |
562 | * @g: controller that might support both high and full speeds | 602 | * @g: controller that might support both high and full speeds |
563 | */ | 603 | */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index b8aba196f7f1..efe8d8a7c7ad 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -134,6 +134,7 @@ struct usb_hcd { | |||
134 | unsigned rh_registered:1;/* is root hub registered? */ | 134 | unsigned rh_registered:1;/* is root hub registered? */ |
135 | unsigned rh_pollable:1; /* may we poll the root hub? */ | 135 | unsigned rh_pollable:1; /* may we poll the root hub? */ |
136 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ | 136 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ |
137 | unsigned remove_phy:1; /* auto-remove USB phy */ | ||
137 | 138 | ||
138 | /* The next flag is a stopgap, to be removed when all the HCDs | 139 | /* The next flag is a stopgap, to be removed when all the HCDs |
139 | * support the new root-hub polling mechanism. */ | 140 | * support the new root-hub polling mechanism. */ |
@@ -352,6 +353,8 @@ struct hc_driver { | |||
352 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); | 353 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); |
353 | /* Returns the hardware-chosen device address */ | 354 | /* Returns the hardware-chosen device address */ |
354 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); | 355 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); |
356 | /* prepares the hardware to send commands to the device */ | ||
357 | int (*enable_device)(struct usb_hcd *, struct usb_device *udev); | ||
355 | /* Notifies the HCD after a hub descriptor is fetched. | 358 | /* Notifies the HCD after a hub descriptor is fetched. |
356 | * Will block. | 359 | * Will block. |
357 | */ | 360 | */ |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index eb505250940a..a4ee1b582183 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
@@ -76,6 +76,9 @@ struct musb_hdrc_config { | |||
76 | unsigned dma:1 __deprecated; /* supports DMA */ | 76 | unsigned dma:1 __deprecated; /* supports DMA */ |
77 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ | 77 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ |
78 | 78 | ||
79 | /* need to explicitly de-assert the port reset after resume? */ | ||
80 | unsigned host_port_deassert_reset_at_resume:1; | ||
81 | |||
79 | u8 num_eps; /* number of endpoints _with_ ep0 */ | 82 | u8 num_eps; /* number of endpoints _with_ ep0 */ |
80 | u8 dma_channels __deprecated; /* number of dma channels */ | 83 | u8 dma_channels __deprecated; /* number of dma channels */ |
81 | u8 dyn_fifo_size; /* dynamic size in bytes */ | 84 | u8 dyn_fifo_size; /* dynamic size in bytes */ |
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h index 596b01918813..69ae383ee3cc 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/usb/omap_control_usb.h | |||
@@ -24,6 +24,7 @@ enum omap_control_usb_type { | |||
24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ | 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ |
25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ | 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ |
26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ | 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ |
27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | struct omap_control_usb { | 30 | struct omap_control_usb { |
@@ -64,6 +65,11 @@ enum omap_control_usb_mode { | |||
64 | 65 | ||
65 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) |
66 | 67 | ||
68 | #define AM437X_CTRL_USB2_PHY_PD BIT(0) | ||
69 | #define AM437X_CTRL_USB2_OTG_PD BIT(1) | ||
70 | #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) | ||
71 | #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) | ||
72 | |||
67 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | 73 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) |
68 | extern void omap_control_usb_phy_power(struct device *dev, int on); | 74 | extern void omap_control_usb_phy_power(struct device *dev, int on); |
69 | extern void omap_control_usb_set_mode(struct device *dev, | 75 | extern void omap_control_usb_set_mode(struct device *dev, |
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h new file mode 100644 index 000000000000..b6ba1bfb86f2 --- /dev/null +++ b/include/linux/usb/otg-fsm.h | |||
@@ -0,0 +1,244 @@ | |||
1 | /* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify it | ||
4 | * under the terms of the GNU General Public License as published by the | ||
5 | * Free Software Foundation; either version 2 of the License, or (at your | ||
6 | * option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
11 | * General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
16 | */ | ||
17 | |||
18 | #ifndef __LINUX_USB_OTG_FSM_H | ||
19 | #define __LINUX_USB_OTG_FSM_H | ||
20 | |||
21 | #include <linux/mutex.h> | ||
22 | #include <linux/errno.h> | ||
23 | |||
24 | #undef VERBOSE | ||
25 | |||
26 | #ifdef VERBOSE | ||
27 | #define VDBG(fmt, args...) pr_debug("[%s] " fmt , \ | ||
28 | __func__, ## args) | ||
29 | #else | ||
30 | #define VDBG(stuff...) do {} while (0) | ||
31 | #endif | ||
32 | |||
33 | #ifdef VERBOSE | ||
34 | #define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__) | ||
35 | #else | ||
36 | #define MPC_LOC do {} while (0) | ||
37 | #endif | ||
38 | |||
39 | #define PROTO_UNDEF (0) | ||
40 | #define PROTO_HOST (1) | ||
41 | #define PROTO_GADGET (2) | ||
42 | |||
43 | enum otg_fsm_timer { | ||
44 | /* Standard OTG timers */ | ||
45 | A_WAIT_VRISE, | ||
46 | A_WAIT_VFALL, | ||
47 | A_WAIT_BCON, | ||
48 | A_AIDL_BDIS, | ||
49 | B_ASE0_BRST, | ||
50 | A_BIDL_ADIS, | ||
51 | |||
52 | /* Auxiliary timers */ | ||
53 | B_SE0_SRP, | ||
54 | B_SRP_FAIL, | ||
55 | A_WAIT_ENUM, | ||
56 | |||
57 | NUM_OTG_FSM_TIMERS, | ||
58 | }; | ||
59 | |||
60 | /* OTG state machine according to the OTG spec */ | ||
61 | struct otg_fsm { | ||
62 | /* Input */ | ||
63 | int id; | ||
64 | int adp_change; | ||
65 | int power_up; | ||
66 | int test_device; | ||
67 | int a_bus_drop; | ||
68 | int a_bus_req; | ||
69 | int a_srp_det; | ||
70 | int a_vbus_vld; | ||
71 | int b_conn; | ||
72 | int a_bus_resume; | ||
73 | int a_bus_suspend; | ||
74 | int a_conn; | ||
75 | int b_bus_req; | ||
76 | int b_se0_srp; | ||
77 | int b_ssend_srp; | ||
78 | int b_sess_vld; | ||
79 | /* Auxilary inputs */ | ||
80 | int a_sess_vld; | ||
81 | int b_bus_resume; | ||
82 | int b_bus_suspend; | ||
83 | |||
84 | /* Output */ | ||
85 | int data_pulse; | ||
86 | int drv_vbus; | ||
87 | int loc_conn; | ||
88 | int loc_sof; | ||
89 | int adp_prb; | ||
90 | int adp_sns; | ||
91 | |||
92 | /* Internal variables */ | ||
93 | int a_set_b_hnp_en; | ||
94 | int b_srp_done; | ||
95 | int b_hnp_enable; | ||
96 | int a_clr_err; | ||
97 | |||
98 | /* Informative variables */ | ||
99 | int a_bus_drop_inf; | ||
100 | int a_bus_req_inf; | ||
101 | int a_clr_err_inf; | ||
102 | int b_bus_req_inf; | ||
103 | /* Auxilary informative variables */ | ||
104 | int a_suspend_req_inf; | ||
105 | |||
106 | /* Timeout indicator for timers */ | ||
107 | int a_wait_vrise_tmout; | ||
108 | int a_wait_vfall_tmout; | ||
109 | int a_wait_bcon_tmout; | ||
110 | int a_aidl_bdis_tmout; | ||
111 | int b_ase0_brst_tmout; | ||
112 | int a_bidl_adis_tmout; | ||
113 | |||
114 | struct otg_fsm_ops *ops; | ||
115 | struct usb_otg *otg; | ||
116 | |||
117 | /* Current usb protocol used: 0:undefine; 1:host; 2:client */ | ||
118 | int protocol; | ||
119 | struct mutex lock; | ||
120 | }; | ||
121 | |||
122 | struct otg_fsm_ops { | ||
123 | void (*chrg_vbus)(struct otg_fsm *fsm, int on); | ||
124 | void (*drv_vbus)(struct otg_fsm *fsm, int on); | ||
125 | void (*loc_conn)(struct otg_fsm *fsm, int on); | ||
126 | void (*loc_sof)(struct otg_fsm *fsm, int on); | ||
127 | void (*start_pulse)(struct otg_fsm *fsm); | ||
128 | void (*start_adp_prb)(struct otg_fsm *fsm); | ||
129 | void (*start_adp_sns)(struct otg_fsm *fsm); | ||
130 | void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); | ||
131 | void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); | ||
132 | int (*start_host)(struct otg_fsm *fsm, int on); | ||
133 | int (*start_gadget)(struct otg_fsm *fsm, int on); | ||
134 | }; | ||
135 | |||
136 | |||
137 | static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on) | ||
138 | { | ||
139 | if (!fsm->ops->chrg_vbus) | ||
140 | return -EOPNOTSUPP; | ||
141 | fsm->ops->chrg_vbus(fsm, on); | ||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | static inline int otg_drv_vbus(struct otg_fsm *fsm, int on) | ||
146 | { | ||
147 | if (!fsm->ops->drv_vbus) | ||
148 | return -EOPNOTSUPP; | ||
149 | if (fsm->drv_vbus != on) { | ||
150 | fsm->drv_vbus = on; | ||
151 | fsm->ops->drv_vbus(fsm, on); | ||
152 | } | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static inline int otg_loc_conn(struct otg_fsm *fsm, int on) | ||
157 | { | ||
158 | if (!fsm->ops->loc_conn) | ||
159 | return -EOPNOTSUPP; | ||
160 | if (fsm->loc_conn != on) { | ||
161 | fsm->loc_conn = on; | ||
162 | fsm->ops->loc_conn(fsm, on); | ||
163 | } | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static inline int otg_loc_sof(struct otg_fsm *fsm, int on) | ||
168 | { | ||
169 | if (!fsm->ops->loc_sof) | ||
170 | return -EOPNOTSUPP; | ||
171 | if (fsm->loc_sof != on) { | ||
172 | fsm->loc_sof = on; | ||
173 | fsm->ops->loc_sof(fsm, on); | ||
174 | } | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static inline int otg_start_pulse(struct otg_fsm *fsm) | ||
179 | { | ||
180 | if (!fsm->ops->start_pulse) | ||
181 | return -EOPNOTSUPP; | ||
182 | if (!fsm->data_pulse) { | ||
183 | fsm->data_pulse = 1; | ||
184 | fsm->ops->start_pulse(fsm); | ||
185 | } | ||
186 | return 0; | ||
187 | } | ||
188 | |||
189 | static inline int otg_start_adp_prb(struct otg_fsm *fsm) | ||
190 | { | ||
191 | if (!fsm->ops->start_adp_prb) | ||
192 | return -EOPNOTSUPP; | ||
193 | if (!fsm->adp_prb) { | ||
194 | fsm->adp_sns = 0; | ||
195 | fsm->adp_prb = 1; | ||
196 | fsm->ops->start_adp_prb(fsm); | ||
197 | } | ||
198 | return 0; | ||
199 | } | ||
200 | |||
201 | static inline int otg_start_adp_sns(struct otg_fsm *fsm) | ||
202 | { | ||
203 | if (!fsm->ops->start_adp_sns) | ||
204 | return -EOPNOTSUPP; | ||
205 | if (!fsm->adp_sns) { | ||
206 | fsm->adp_sns = 1; | ||
207 | fsm->ops->start_adp_sns(fsm); | ||
208 | } | ||
209 | return 0; | ||
210 | } | ||
211 | |||
212 | static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) | ||
213 | { | ||
214 | if (!fsm->ops->add_timer) | ||
215 | return -EOPNOTSUPP; | ||
216 | fsm->ops->add_timer(fsm, timer); | ||
217 | return 0; | ||
218 | } | ||
219 | |||
220 | static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) | ||
221 | { | ||
222 | if (!fsm->ops->del_timer) | ||
223 | return -EOPNOTSUPP; | ||
224 | fsm->ops->del_timer(fsm, timer); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | static inline int otg_start_host(struct otg_fsm *fsm, int on) | ||
229 | { | ||
230 | if (!fsm->ops->start_host) | ||
231 | return -EOPNOTSUPP; | ||
232 | return fsm->ops->start_host(fsm, on); | ||
233 | } | ||
234 | |||
235 | static inline int otg_start_gadget(struct otg_fsm *fsm, int on) | ||
236 | { | ||
237 | if (!fsm->ops->start_gadget) | ||
238 | return -EOPNOTSUPP; | ||
239 | return fsm->ops->start_gadget(fsm, on); | ||
240 | } | ||
241 | |||
242 | int otg_statemachine(struct otg_fsm *fsm); | ||
243 | |||
244 | #endif /* __LINUX_USB_OTG_FSM_H */ | ||
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index 0c4d4ca370ec..eeb28329fa3c 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h | |||
@@ -271,6 +271,8 @@ static inline u8 wusb_key_index(int index, int type, int originator) | |||
271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 | 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 |
272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 | 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 |
273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 | 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 |
274 | /* bits 0-3 used for the key index. */ | ||
275 | #define WUSB_KEY_INDEX_MAX 15 | ||
274 | 276 | ||
275 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ | 277 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ |
276 | struct aes_ccm_nonce { | 278 | struct aes_ccm_nonce { |
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h index 891d1d5f3947..ba82f03d8287 100644 --- a/include/linux/uwb/umc.h +++ b/include/linux/uwb/umc.h | |||
@@ -143,7 +143,7 @@ int umc_match_pci_id(struct umc_driver *umc_drv, struct umc_dev *umc); | |||
143 | static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) | 143 | static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) |
144 | { | 144 | { |
145 | struct pci_dev *pci_dev = NULL; | 145 | struct pci_dev *pci_dev = NULL; |
146 | if (umc_dev->dev.parent->bus == &pci_bus_type) | 146 | if (dev_is_pci(umc_dev->dev.parent)) |
147 | pci_dev = to_pci_dev(umc_dev->dev.parent); | 147 | pci_dev = to_pci_dev(umc_dev->dev.parent); |
148 | return pci_dev; | 148 | return pci_dev; |
149 | } | 149 | } |
diff --git a/include/linux/vme.h b/include/linux/vme.h index c9d65bf14cec..8cd6f19ca518 100644 --- a/include/linux/vme.h +++ b/include/linux/vme.h | |||
@@ -164,7 +164,8 @@ int vme_lm_attach(struct vme_resource *, int, void (*callback)(int)); | |||
164 | int vme_lm_detach(struct vme_resource *, int); | 164 | int vme_lm_detach(struct vme_resource *, int); |
165 | void vme_lm_free(struct vme_resource *); | 165 | void vme_lm_free(struct vme_resource *); |
166 | 166 | ||
167 | int vme_slot_get(struct vme_dev *); | 167 | int vme_slot_num(struct vme_dev *); |
168 | int vme_bus_num(struct vme_dev *); | ||
168 | 169 | ||
169 | int vme_register_driver(struct vme_driver *, unsigned int); | 170 | int vme_register_driver(struct vme_driver *, unsigned int); |
170 | void vme_unregister_driver(struct vme_driver *); | 171 | void vme_unregister_driver(struct vme_driver *); |
diff --git a/include/linux/vtime.h b/include/linux/vtime.h index f5b72b364bda..c5165fd256f9 100644 --- a/include/linux/vtime.h +++ b/include/linux/vtime.h | |||
@@ -19,8 +19,8 @@ static inline bool vtime_accounting_enabled(void) { return true; } | |||
19 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | 19 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
20 | static inline bool vtime_accounting_enabled(void) | 20 | static inline bool vtime_accounting_enabled(void) |
21 | { | 21 | { |
22 | if (static_key_false(&context_tracking_enabled)) { | 22 | if (context_tracking_is_enabled()) { |
23 | if (context_tracking_active()) | 23 | if (context_tracking_cpu_is_enabled()) |
24 | return true; | 24 | return true; |
25 | } | 25 | } |
26 | 26 | ||
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index dff42025649b..63fbba0740c2 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
@@ -11,107 +11,10 @@ | |||
11 | #ifndef _LINUX_ZORRO_H | 11 | #ifndef _LINUX_ZORRO_H |
12 | #define _LINUX_ZORRO_H | 12 | #define _LINUX_ZORRO_H |
13 | 13 | ||
14 | #include <linux/device.h> | ||
15 | |||
16 | |||
17 | /* | ||
18 | * Each Zorro board has a 32-bit ID of the form | ||
19 | * | ||
20 | * mmmmmmmmmmmmmmmmppppppppeeeeeeee | ||
21 | * | ||
22 | * with | ||
23 | * | ||
24 | * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) | ||
25 | * pppppppp 8-bit Product ID (assigned by manufacturer) | ||
26 | * eeeeeeee 8-bit Extended Product ID (currently only used | ||
27 | * for some GVP boards) | ||
28 | */ | ||
29 | |||
30 | |||
31 | #define ZORRO_MANUF(id) ((id) >> 16) | ||
32 | #define ZORRO_PROD(id) (((id) >> 8) & 0xff) | ||
33 | #define ZORRO_EPC(id) ((id) & 0xff) | ||
34 | |||
35 | #define ZORRO_ID(manuf, prod, epc) \ | ||
36 | ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) | ||
37 | |||
38 | typedef __u32 zorro_id; | ||
39 | |||
40 | |||
41 | /* Include the ID list */ | ||
42 | #include <linux/zorro_ids.h> | ||
43 | |||
44 | 14 | ||
45 | /* | 15 | #include <uapi/linux/zorro.h> |
46 | * GVP identifies most of its products through the 'extended product code' | ||
47 | * (epc). The epc has to be ANDed with the GVP_PRODMASK before the | ||
48 | * identification. | ||
49 | */ | ||
50 | |||
51 | #define GVP_PRODMASK (0xf8) | ||
52 | #define GVP_SCSICLKMASK (0x01) | ||
53 | |||
54 | enum GVP_flags { | ||
55 | GVP_IO = 0x01, | ||
56 | GVP_ACCEL = 0x02, | ||
57 | GVP_SCSI = 0x04, | ||
58 | GVP_24BITDMA = 0x08, | ||
59 | GVP_25BITDMA = 0x10, | ||
60 | GVP_NOBANK = 0x20, | ||
61 | GVP_14MHZ = 0x40, | ||
62 | }; | ||
63 | |||
64 | |||
65 | struct Node { | ||
66 | struct Node *ln_Succ; /* Pointer to next (successor) */ | ||
67 | struct Node *ln_Pred; /* Pointer to previous (predecessor) */ | ||
68 | __u8 ln_Type; | ||
69 | __s8 ln_Pri; /* Priority, for sorting */ | ||
70 | __s8 *ln_Name; /* ID string, null terminated */ | ||
71 | } __attribute__ ((packed)); | ||
72 | |||
73 | struct ExpansionRom { | ||
74 | /* -First 16 bytes of the expansion ROM */ | ||
75 | __u8 er_Type; /* Board type, size and flags */ | ||
76 | __u8 er_Product; /* Product number, assigned by manufacturer */ | ||
77 | __u8 er_Flags; /* Flags */ | ||
78 | __u8 er_Reserved03; /* Must be zero ($ff inverted) */ | ||
79 | __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ | ||
80 | __u32 er_SerialNumber; /* Available for use by manufacturer */ | ||
81 | __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ | ||
82 | __u8 er_Reserved0c; | ||
83 | __u8 er_Reserved0d; | ||
84 | __u8 er_Reserved0e; | ||
85 | __u8 er_Reserved0f; | ||
86 | } __attribute__ ((packed)); | ||
87 | |||
88 | /* er_Type board type bits */ | ||
89 | #define ERT_TYPEMASK 0xc0 | ||
90 | #define ERT_ZORROII 0xc0 | ||
91 | #define ERT_ZORROIII 0x80 | ||
92 | |||
93 | /* other bits defined in er_Type */ | ||
94 | #define ERTB_MEMLIST 5 /* Link RAM into free memory list */ | ||
95 | #define ERTF_MEMLIST (1<<5) | ||
96 | |||
97 | struct ConfigDev { | ||
98 | struct Node cd_Node; | ||
99 | __u8 cd_Flags; /* (read/write) */ | ||
100 | __u8 cd_Pad; /* reserved */ | ||
101 | struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ | ||
102 | void *cd_BoardAddr; /* where in memory the board was placed */ | ||
103 | __u32 cd_BoardSize; /* size of board in bytes */ | ||
104 | __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ | ||
105 | __u16 cd_SlotSize; /* number of slots (PRIVATE) */ | ||
106 | void *cd_Driver; /* pointer to node of driver */ | ||
107 | struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ | ||
108 | __u32 cd_Unused[4]; /* for whatever the driver wants */ | ||
109 | } __attribute__ ((packed)); | ||
110 | |||
111 | #define ZORRO_NUM_AUTO 16 | ||
112 | |||
113 | #ifdef __KERNEL__ | ||
114 | 16 | ||
17 | #include <linux/device.h> | ||
115 | #include <linux/init.h> | 18 | #include <linux/init.h> |
116 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
117 | #include <linux/mod_devicetable.h> | 20 | #include <linux/mod_devicetable.h> |
@@ -175,7 +78,23 @@ static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z) | |||
175 | 78 | ||
176 | 79 | ||
177 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ | 80 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ |
178 | extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; | 81 | extern struct zorro_dev *zorro_autocon; |
82 | |||
83 | |||
84 | /* | ||
85 | * Minimal information about a Zorro device, passed from bootinfo | ||
86 | * Only available temporarily, i.e. until initmem has been freed! | ||
87 | */ | ||
88 | |||
89 | struct zorro_dev_init { | ||
90 | struct ExpansionRom rom; | ||
91 | u16 slotaddr; | ||
92 | u16 slotsize; | ||
93 | u32 boardaddr; | ||
94 | u32 boardsize; | ||
95 | }; | ||
96 | |||
97 | extern struct zorro_dev_init zorro_autocon_init[ZORRO_NUM_AUTO] __initdata; | ||
179 | 98 | ||
180 | 99 | ||
181 | /* | 100 | /* |
@@ -229,6 +148,4 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128); | |||
229 | #define Z2RAM_CHUNKSHIFT (16) | 148 | #define Z2RAM_CHUNKSHIFT (16) |
230 | 149 | ||
231 | 150 | ||
232 | #endif /* __KERNEL__ */ | ||
233 | |||
234 | #endif /* _LINUX_ZORRO_H */ | 151 | #endif /* _LINUX_ZORRO_H */ |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index bd8218b15009..941055e9d125 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -83,7 +83,7 @@ struct vb2_fileio_data; | |||
83 | struct vb2_mem_ops { | 83 | struct vb2_mem_ops { |
84 | void *(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); | 84 | void *(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); |
85 | void (*put)(void *buf_priv); | 85 | void (*put)(void *buf_priv); |
86 | struct dma_buf *(*get_dmabuf)(void *buf_priv); | 86 | struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags); |
87 | 87 | ||
88 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, | 88 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, |
89 | unsigned long size, int write); | 89 | unsigned long size, int write); |
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h index 829627d7b846..1d67fb6b23a0 100644 --- a/include/net/busy_poll.h +++ b/include/net/busy_poll.h | |||
@@ -42,27 +42,10 @@ static inline bool net_busy_loop_on(void) | |||
42 | return sysctl_net_busy_poll; | 42 | return sysctl_net_busy_poll; |
43 | } | 43 | } |
44 | 44 | ||
45 | /* a wrapper to make debug_smp_processor_id() happy | ||
46 | * we can use sched_clock() because we don't care much about precision | ||
47 | * we only care that the average is bounded | ||
48 | */ | ||
49 | #ifdef CONFIG_DEBUG_PREEMPT | ||
50 | static inline u64 busy_loop_us_clock(void) | ||
51 | { | ||
52 | u64 rc; | ||
53 | |||
54 | preempt_disable_notrace(); | ||
55 | rc = sched_clock(); | ||
56 | preempt_enable_no_resched_notrace(); | ||
57 | |||
58 | return rc >> 10; | ||
59 | } | ||
60 | #else /* CONFIG_DEBUG_PREEMPT */ | ||
61 | static inline u64 busy_loop_us_clock(void) | 45 | static inline u64 busy_loop_us_clock(void) |
62 | { | 46 | { |
63 | return sched_clock() >> 10; | 47 | return local_clock() >> 10; |
64 | } | 48 | } |
65 | #endif /* CONFIG_DEBUG_PREEMPT */ | ||
66 | 49 | ||
67 | static inline unsigned long sk_busy_loop_end_time(struct sock *sk) | 50 | static inline unsigned long sk_busy_loop_end_time(struct sock *sk) |
68 | { | 51 | { |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 76d54270f2e2..65bb13035598 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -165,7 +165,6 @@ struct inet6_dev { | |||
165 | struct net_device *dev; | 165 | struct net_device *dev; |
166 | 166 | ||
167 | struct list_head addr_list; | 167 | struct list_head addr_list; |
168 | int valid_ll_addr_cnt; | ||
169 | 168 | ||
170 | struct ifmcaddr6 *mc_list; | 169 | struct ifmcaddr6 *mc_list; |
171 | struct ifmcaddr6 *mc_tomb; | 170 | struct ifmcaddr6 *mc_tomb; |
diff --git a/include/net/ip.h b/include/net/ip.h index 217bc5bfc6c6..5a25f36fe3a7 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -473,7 +473,7 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, | |||
473 | int ip_ra_control(struct sock *sk, unsigned char on, | 473 | int ip_ra_control(struct sock *sk, unsigned char on, |
474 | void (*destructor)(struct sock *)); | 474 | void (*destructor)(struct sock *)); |
475 | 475 | ||
476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len); |
477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
478 | u32 info, u8 *payload); | 478 | u32 info, u8 *payload); |
479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 2a5f668cd683..488316e339a1 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -110,7 +110,8 @@ struct frag_hdr { | |||
110 | __be32 identification; | 110 | __be32 identification; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define IP6_MF 0x0001 | 113 | #define IP6_MF 0x0001 |
114 | #define IP6_OFFSET 0xFFF8 | ||
114 | 115 | ||
115 | #include <net/sock.h> | 116 | #include <net/sock.h> |
116 | 117 | ||
@@ -776,8 +777,10 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
776 | 777 | ||
777 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); | 778 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); |
778 | 779 | ||
779 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 780 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, |
780 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | 781 | int *addr_len); |
782 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, | ||
783 | int *addr_len); | ||
781 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 784 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
782 | u32 info, u8 *payload); | 785 | u32 info, u8 *payload); |
783 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); | 786 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 31e2de7d57c5..c0f0a13ed818 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
@@ -142,7 +142,7 @@ | |||
142 | #define LLC_S_PF_IS_1(pdu) ((pdu->ctrl_2 & LLC_S_PF_BIT_MASK) ? 1 : 0) | 142 | #define LLC_S_PF_IS_1(pdu) ((pdu->ctrl_2 & LLC_S_PF_BIT_MASK) ? 1 : 0) |
143 | 143 | ||
144 | #define PDU_SUPV_GET_Nr(pdu) ((pdu->ctrl_2 & 0xFE) >> 1) | 144 | #define PDU_SUPV_GET_Nr(pdu) ((pdu->ctrl_2 & 0xFE) >> 1) |
145 | #define PDU_GET_NEXT_Vr(sn) (++sn & ~LLC_2_SEQ_NBR_MODULO) | 145 | #define PDU_GET_NEXT_Vr(sn) (((sn) + 1) & ~LLC_2_SEQ_NBR_MODULO) |
146 | 146 | ||
147 | /* FRMR information field macros */ | 147 | /* FRMR information field macros */ |
148 | 148 | ||
diff --git a/include/net/ping.h b/include/net/ping.h index 3f67704f3747..90f48417b03d 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
@@ -31,7 +31,8 @@ | |||
31 | 31 | ||
32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ | 32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ |
33 | struct pingv6_ops { | 33 | struct pingv6_ops { |
34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len); | 34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, |
35 | int *addr_len); | ||
35 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, | 36 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, |
36 | struct sk_buff *skb); | 37 | struct sk_buff *skb); |
37 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); | 38 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 2174d8da0770..0a248b323d87 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -629,6 +629,7 @@ struct sctp_chunk { | |||
629 | #define SCTP_NEED_FRTX 0x1 | 629 | #define SCTP_NEED_FRTX 0x1 |
630 | #define SCTP_DONT_FRTX 0x2 | 630 | #define SCTP_DONT_FRTX 0x2 |
631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ | 631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ |
632 | resent:1, /* Has this chunk ever been resent. */ | ||
632 | has_tsn:1, /* Does this chunk have a TSN yet? */ | 633 | has_tsn:1, /* Does this chunk have a TSN yet? */ |
633 | has_ssn:1, /* Does this chunk have a SSN yet? */ | 634 | has_ssn:1, /* Does this chunk have a SSN yet? */ |
634 | singleton:1, /* Only chunk in the packet? */ | 635 | singleton:1, /* Only chunk in the packet? */ |
@@ -1045,9 +1046,6 @@ struct sctp_outq { | |||
1045 | 1046 | ||
1046 | /* Corked? */ | 1047 | /* Corked? */ |
1047 | char cork; | 1048 | char cork; |
1048 | |||
1049 | /* Is this structure empty? */ | ||
1050 | char empty; | ||
1051 | }; | 1049 | }; |
1052 | 1050 | ||
1053 | void sctp_outq_init(struct sctp_association *, struct sctp_outq *); | 1051 | void sctp_outq_init(struct sctp_association *, struct sctp_outq *); |
@@ -1725,12 +1723,6 @@ struct sctp_association { | |||
1725 | /* How many duplicated TSNs have we seen? */ | 1723 | /* How many duplicated TSNs have we seen? */ |
1726 | int numduptsns; | 1724 | int numduptsns; |
1727 | 1725 | ||
1728 | /* Number of seconds of idle time before an association is closed. | ||
1729 | * In the association context, this is really used as a boolean | ||
1730 | * since the real timeout is stored in the timeouts array | ||
1731 | */ | ||
1732 | __u32 autoclose; | ||
1733 | |||
1734 | /* These are to support | 1726 | /* These are to support |
1735 | * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses | 1727 | * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses |
1736 | * and Enforcement of Flow and Message Limits" | 1728 | * and Enforcement of Flow and Message Limits" |
diff --git a/include/net/sock.h b/include/net/sock.h index e3a18ff0c38b..2ef3c3eca47a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1035,7 +1035,6 @@ enum cg_proto_flags { | |||
1035 | }; | 1035 | }; |
1036 | 1036 | ||
1037 | struct cg_proto { | 1037 | struct cg_proto { |
1038 | void (*enter_memory_pressure)(struct sock *sk); | ||
1039 | struct res_counter memory_allocated; /* Current allocated memory. */ | 1038 | struct res_counter memory_allocated; /* Current allocated memory. */ |
1040 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ | 1039 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ |
1041 | int memory_pressure; | 1040 | int memory_pressure; |
@@ -1155,8 +1154,7 @@ static inline void sk_leave_memory_pressure(struct sock *sk) | |||
1155 | struct proto *prot = sk->sk_prot; | 1154 | struct proto *prot = sk->sk_prot; |
1156 | 1155 | ||
1157 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1156 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
1158 | if (cg_proto->memory_pressure) | 1157 | cg_proto->memory_pressure = 0; |
1159 | cg_proto->memory_pressure = 0; | ||
1160 | } | 1158 | } |
1161 | 1159 | ||
1162 | } | 1160 | } |
@@ -1171,7 +1169,7 @@ static inline void sk_enter_memory_pressure(struct sock *sk) | |||
1171 | struct proto *prot = sk->sk_prot; | 1169 | struct proto *prot = sk->sk_prot; |
1172 | 1170 | ||
1173 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1171 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
1174 | cg_proto->enter_memory_pressure(sk); | 1172 | cg_proto->memory_pressure = 1; |
1175 | } | 1173 | } |
1176 | 1174 | ||
1177 | sk->sk_prot->enter_memory_pressure(sk); | 1175 | sk->sk_prot->enter_memory_pressure(sk); |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 979874c627ee..61e1935c91b1 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -978,7 +978,7 @@ struct ib_uobject { | |||
978 | }; | 978 | }; |
979 | 979 | ||
980 | struct ib_udata { | 980 | struct ib_udata { |
981 | void __user *inbuf; | 981 | const void __user *inbuf; |
982 | void __user *outbuf; | 982 | void __user *outbuf; |
983 | size_t inlen; | 983 | size_t inlen; |
984 | size_t outlen; | 984 | size_t outlen; |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 546084964d55..fe3b58e836c8 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -475,6 +475,9 @@ struct scsi_host_template { | |||
475 | */ | 475 | */ |
476 | unsigned ordered_tag:1; | 476 | unsigned ordered_tag:1; |
477 | 477 | ||
478 | /* True if the controller does not support WRITE SAME */ | ||
479 | unsigned no_write_same:1; | ||
480 | |||
478 | /* | 481 | /* |
479 | * Countdown for host blocking with no commands outstanding. | 482 | * Countdown for host blocking with no commands outstanding. |
480 | */ | 483 | */ |
@@ -677,6 +680,9 @@ struct Scsi_Host { | |||
677 | /* Don't resume host in EH */ | 680 | /* Don't resume host in EH */ |
678 | unsigned eh_noresume:1; | 681 | unsigned eh_noresume:1; |
679 | 682 | ||
683 | /* The controller does not support WRITE SAME */ | ||
684 | unsigned no_write_same:1; | ||
685 | |||
680 | /* | 686 | /* |
681 | * Optional work queue to be utilized by the transport | 687 | * Optional work queue to be utilized by the transport |
682 | */ | 688 | */ |
diff --git a/include/sound/cs42l52.h b/include/sound/cs42l52.h index 7c2be4a51894..bbabf84bdb44 100644 --- a/include/sound/cs42l52.h +++ b/include/sound/cs42l52.h | |||
@@ -16,17 +16,11 @@ struct cs42l52_platform_data { | |||
16 | /* MICBIAS Level. Check datasheet Pg48 */ | 16 | /* MICBIAS Level. Check datasheet Pg48 */ |
17 | unsigned int micbias_lvl; | 17 | unsigned int micbias_lvl; |
18 | 18 | ||
19 | /* MICA mode selection 0=Single 1=Differential */ | 19 | /* MICA mode selection Differential or Single-ended */ |
20 | unsigned int mica_cfg; | 20 | bool mica_diff_cfg; |
21 | 21 | ||
22 | /* MICB mode selection 0=Single 1=Differential */ | 22 | /* MICB mode selection Differential or Single-ended */ |
23 | unsigned int micb_cfg; | 23 | bool micb_diff_cfg; |
24 | |||
25 | /* MICA Select 0=MIC1A 1=MIC2A */ | ||
26 | unsigned int mica_sel; | ||
27 | |||
28 | /* MICB Select 0=MIC2A 1=MIC2B */ | ||
29 | unsigned int micb_sel; | ||
30 | 24 | ||
31 | /* Charge Pump Freq. Check datasheet Pg73 */ | 25 | /* Charge Pump Freq. Check datasheet Pg73 */ |
32 | unsigned int chgfreq; | 26 | unsigned int chgfreq; |
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 15017311f2e9..eb73a3a39ec2 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
@@ -114,6 +114,10 @@ void snd_dmaengine_pcm_set_config_from_dai_data( | |||
114 | * @compat_filter_fn: Will be used as the filter function when requesting a | 114 | * @compat_filter_fn: Will be used as the filter function when requesting a |
115 | * channel for platforms which do not use devicetree. The filter parameter | 115 | * channel for platforms which do not use devicetree. The filter parameter |
116 | * will be the DAI's DMA data. | 116 | * will be the DAI's DMA data. |
117 | * @dma_dev: If set, request DMA channel on this device rather than the DAI | ||
118 | * device. | ||
119 | * @chan_names: If set, these custom DMA channel names will be requested at | ||
120 | * registration time. | ||
117 | * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. | 121 | * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. |
118 | * @prealloc_buffer_size: Size of the preallocated audio buffer. | 122 | * @prealloc_buffer_size: Size of the preallocated audio buffer. |
119 | * | 123 | * |
@@ -130,6 +134,8 @@ struct snd_dmaengine_pcm_config { | |||
130 | struct snd_soc_pcm_runtime *rtd, | 134 | struct snd_soc_pcm_runtime *rtd, |
131 | struct snd_pcm_substream *substream); | 135 | struct snd_pcm_substream *substream); |
132 | dma_filter_fn compat_filter_fn; | 136 | dma_filter_fn compat_filter_fn; |
137 | struct device *dma_dev; | ||
138 | const char *chan_names[SNDRV_PCM_STREAM_LAST + 1]; | ||
133 | 139 | ||
134 | const struct snd_pcm_hardware *pcm_hardware; | 140 | const struct snd_pcm_hardware *pcm_hardware; |
135 | unsigned int prealloc_buffer_size; | 141 | unsigned int prealloc_buffer_size; |
@@ -140,6 +146,10 @@ int snd_dmaengine_pcm_register(struct device *dev, | |||
140 | unsigned int flags); | 146 | unsigned int flags); |
141 | void snd_dmaengine_pcm_unregister(struct device *dev); | 147 | void snd_dmaengine_pcm_unregister(struct device *dev); |
142 | 148 | ||
149 | int devm_snd_dmaengine_pcm_register(struct device *dev, | ||
150 | const struct snd_dmaengine_pcm_config *config, | ||
151 | unsigned int flags); | ||
152 | |||
143 | int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, | 153 | int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, |
144 | struct snd_pcm_hw_params *params, | 154 | struct snd_pcm_hw_params *params, |
145 | struct dma_slave_config *slave_config); | 155 | struct dma_slave_config *slave_config); |
diff --git a/include/sound/hda_verbs.h b/include/sound/hda_verbs.h new file mode 100644 index 000000000000..d0509db6d0ec --- /dev/null +++ b/include/sound/hda_verbs.h | |||
@@ -0,0 +1,554 @@ | |||
1 | /* | ||
2 | * HD-audio codec verbs | ||
3 | */ | ||
4 | |||
5 | #ifndef __SOUND_HDA_VERBS_H | ||
6 | #define __SOUND_HDA_VERBS_H | ||
7 | |||
8 | /* | ||
9 | * nodes | ||
10 | */ | ||
11 | #define AC_NODE_ROOT 0x00 | ||
12 | |||
13 | /* | ||
14 | * function group types | ||
15 | */ | ||
16 | enum { | ||
17 | AC_GRP_AUDIO_FUNCTION = 0x01, | ||
18 | AC_GRP_MODEM_FUNCTION = 0x02, | ||
19 | }; | ||
20 | |||
21 | /* | ||
22 | * widget types | ||
23 | */ | ||
24 | enum { | ||
25 | AC_WID_AUD_OUT, /* Audio Out */ | ||
26 | AC_WID_AUD_IN, /* Audio In */ | ||
27 | AC_WID_AUD_MIX, /* Audio Mixer */ | ||
28 | AC_WID_AUD_SEL, /* Audio Selector */ | ||
29 | AC_WID_PIN, /* Pin Complex */ | ||
30 | AC_WID_POWER, /* Power */ | ||
31 | AC_WID_VOL_KNB, /* Volume Knob */ | ||
32 | AC_WID_BEEP, /* Beep Generator */ | ||
33 | AC_WID_VENDOR = 0x0f /* Vendor specific */ | ||
34 | }; | ||
35 | |||
36 | /* | ||
37 | * GET verbs | ||
38 | */ | ||
39 | #define AC_VERB_GET_STREAM_FORMAT 0x0a00 | ||
40 | #define AC_VERB_GET_AMP_GAIN_MUTE 0x0b00 | ||
41 | #define AC_VERB_GET_PROC_COEF 0x0c00 | ||
42 | #define AC_VERB_GET_COEF_INDEX 0x0d00 | ||
43 | #define AC_VERB_PARAMETERS 0x0f00 | ||
44 | #define AC_VERB_GET_CONNECT_SEL 0x0f01 | ||
45 | #define AC_VERB_GET_CONNECT_LIST 0x0f02 | ||
46 | #define AC_VERB_GET_PROC_STATE 0x0f03 | ||
47 | #define AC_VERB_GET_SDI_SELECT 0x0f04 | ||
48 | #define AC_VERB_GET_POWER_STATE 0x0f05 | ||
49 | #define AC_VERB_GET_CONV 0x0f06 | ||
50 | #define AC_VERB_GET_PIN_WIDGET_CONTROL 0x0f07 | ||
51 | #define AC_VERB_GET_UNSOLICITED_RESPONSE 0x0f08 | ||
52 | #define AC_VERB_GET_PIN_SENSE 0x0f09 | ||
53 | #define AC_VERB_GET_BEEP_CONTROL 0x0f0a | ||
54 | #define AC_VERB_GET_EAPD_BTLENABLE 0x0f0c | ||
55 | #define AC_VERB_GET_DIGI_CONVERT_1 0x0f0d | ||
56 | #define AC_VERB_GET_DIGI_CONVERT_2 0x0f0e /* unused */ | ||
57 | #define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f | ||
58 | /* f10-f1a: GPIO */ | ||
59 | #define AC_VERB_GET_GPIO_DATA 0x0f15 | ||
60 | #define AC_VERB_GET_GPIO_MASK 0x0f16 | ||
61 | #define AC_VERB_GET_GPIO_DIRECTION 0x0f17 | ||
62 | #define AC_VERB_GET_GPIO_WAKE_MASK 0x0f18 | ||
63 | #define AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK 0x0f19 | ||
64 | #define AC_VERB_GET_GPIO_STICKY_MASK 0x0f1a | ||
65 | #define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c | ||
66 | /* f20: AFG/MFG */ | ||
67 | #define AC_VERB_GET_SUBSYSTEM_ID 0x0f20 | ||
68 | #define AC_VERB_GET_CVT_CHAN_COUNT 0x0f2d | ||
69 | #define AC_VERB_GET_HDMI_DIP_SIZE 0x0f2e | ||
70 | #define AC_VERB_GET_HDMI_ELDD 0x0f2f | ||
71 | #define AC_VERB_GET_HDMI_DIP_INDEX 0x0f30 | ||
72 | #define AC_VERB_GET_HDMI_DIP_DATA 0x0f31 | ||
73 | #define AC_VERB_GET_HDMI_DIP_XMIT 0x0f32 | ||
74 | #define AC_VERB_GET_HDMI_CP_CTRL 0x0f33 | ||
75 | #define AC_VERB_GET_HDMI_CHAN_SLOT 0x0f34 | ||
76 | #define AC_VERB_GET_DEVICE_SEL 0xf35 | ||
77 | #define AC_VERB_GET_DEVICE_LIST 0xf36 | ||
78 | |||
79 | /* | ||
80 | * SET verbs | ||
81 | */ | ||
82 | #define AC_VERB_SET_STREAM_FORMAT 0x200 | ||
83 | #define AC_VERB_SET_AMP_GAIN_MUTE 0x300 | ||
84 | #define AC_VERB_SET_PROC_COEF 0x400 | ||
85 | #define AC_VERB_SET_COEF_INDEX 0x500 | ||
86 | #define AC_VERB_SET_CONNECT_SEL 0x701 | ||
87 | #define AC_VERB_SET_PROC_STATE 0x703 | ||
88 | #define AC_VERB_SET_SDI_SELECT 0x704 | ||
89 | #define AC_VERB_SET_POWER_STATE 0x705 | ||
90 | #define AC_VERB_SET_CHANNEL_STREAMID 0x706 | ||
91 | #define AC_VERB_SET_PIN_WIDGET_CONTROL 0x707 | ||
92 | #define AC_VERB_SET_UNSOLICITED_ENABLE 0x708 | ||
93 | #define AC_VERB_SET_PIN_SENSE 0x709 | ||
94 | #define AC_VERB_SET_BEEP_CONTROL 0x70a | ||
95 | #define AC_VERB_SET_EAPD_BTLENABLE 0x70c | ||
96 | #define AC_VERB_SET_DIGI_CONVERT_1 0x70d | ||
97 | #define AC_VERB_SET_DIGI_CONVERT_2 0x70e | ||
98 | #define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f | ||
99 | #define AC_VERB_SET_GPIO_DATA 0x715 | ||
100 | #define AC_VERB_SET_GPIO_MASK 0x716 | ||
101 | #define AC_VERB_SET_GPIO_DIRECTION 0x717 | ||
102 | #define AC_VERB_SET_GPIO_WAKE_MASK 0x718 | ||
103 | #define AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK 0x719 | ||
104 | #define AC_VERB_SET_GPIO_STICKY_MASK 0x71a | ||
105 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 0x71c | ||
106 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d | ||
107 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e | ||
108 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f | ||
109 | #define AC_VERB_SET_EAPD 0x788 | ||
110 | #define AC_VERB_SET_CODEC_RESET 0x7ff | ||
111 | #define AC_VERB_SET_CVT_CHAN_COUNT 0x72d | ||
112 | #define AC_VERB_SET_HDMI_DIP_INDEX 0x730 | ||
113 | #define AC_VERB_SET_HDMI_DIP_DATA 0x731 | ||
114 | #define AC_VERB_SET_HDMI_DIP_XMIT 0x732 | ||
115 | #define AC_VERB_SET_HDMI_CP_CTRL 0x733 | ||
116 | #define AC_VERB_SET_HDMI_CHAN_SLOT 0x734 | ||
117 | #define AC_VERB_SET_DEVICE_SEL 0x735 | ||
118 | |||
119 | /* | ||
120 | * Parameter IDs | ||
121 | */ | ||
122 | #define AC_PAR_VENDOR_ID 0x00 | ||
123 | #define AC_PAR_SUBSYSTEM_ID 0x01 | ||
124 | #define AC_PAR_REV_ID 0x02 | ||
125 | #define AC_PAR_NODE_COUNT 0x04 | ||
126 | #define AC_PAR_FUNCTION_TYPE 0x05 | ||
127 | #define AC_PAR_AUDIO_FG_CAP 0x08 | ||
128 | #define AC_PAR_AUDIO_WIDGET_CAP 0x09 | ||
129 | #define AC_PAR_PCM 0x0a | ||
130 | #define AC_PAR_STREAM 0x0b | ||
131 | #define AC_PAR_PIN_CAP 0x0c | ||
132 | #define AC_PAR_AMP_IN_CAP 0x0d | ||
133 | #define AC_PAR_CONNLIST_LEN 0x0e | ||
134 | #define AC_PAR_POWER_STATE 0x0f | ||
135 | #define AC_PAR_PROC_CAP 0x10 | ||
136 | #define AC_PAR_GPIO_CAP 0x11 | ||
137 | #define AC_PAR_AMP_OUT_CAP 0x12 | ||
138 | #define AC_PAR_VOL_KNB_CAP 0x13 | ||
139 | #define AC_PAR_DEVLIST_LEN 0x15 | ||
140 | #define AC_PAR_HDMI_LPCM_CAP 0x20 | ||
141 | |||
142 | /* | ||
143 | * AC_VERB_PARAMETERS results (32bit) | ||
144 | */ | ||
145 | |||
146 | /* Function Group Type */ | ||
147 | #define AC_FGT_TYPE (0xff<<0) | ||
148 | #define AC_FGT_TYPE_SHIFT 0 | ||
149 | #define AC_FGT_UNSOL_CAP (1<<8) | ||
150 | |||
151 | /* Audio Function Group Capabilities */ | ||
152 | #define AC_AFG_OUT_DELAY (0xf<<0) | ||
153 | #define AC_AFG_IN_DELAY (0xf<<8) | ||
154 | #define AC_AFG_BEEP_GEN (1<<16) | ||
155 | |||
156 | /* Audio Widget Capabilities */ | ||
157 | #define AC_WCAP_STEREO (1<<0) /* stereo I/O */ | ||
158 | #define AC_WCAP_IN_AMP (1<<1) /* AMP-in present */ | ||
159 | #define AC_WCAP_OUT_AMP (1<<2) /* AMP-out present */ | ||
160 | #define AC_WCAP_AMP_OVRD (1<<3) /* AMP-parameter override */ | ||
161 | #define AC_WCAP_FORMAT_OVRD (1<<4) /* format override */ | ||
162 | #define AC_WCAP_STRIPE (1<<5) /* stripe */ | ||
163 | #define AC_WCAP_PROC_WID (1<<6) /* Proc Widget */ | ||
164 | #define AC_WCAP_UNSOL_CAP (1<<7) /* Unsol capable */ | ||
165 | #define AC_WCAP_CONN_LIST (1<<8) /* connection list */ | ||
166 | #define AC_WCAP_DIGITAL (1<<9) /* digital I/O */ | ||
167 | #define AC_WCAP_POWER (1<<10) /* power control */ | ||
168 | #define AC_WCAP_LR_SWAP (1<<11) /* L/R swap */ | ||
169 | #define AC_WCAP_CP_CAPS (1<<12) /* content protection */ | ||
170 | #define AC_WCAP_CHAN_CNT_EXT (7<<13) /* channel count ext */ | ||
171 | #define AC_WCAP_DELAY (0xf<<16) | ||
172 | #define AC_WCAP_DELAY_SHIFT 16 | ||
173 | #define AC_WCAP_TYPE (0xf<<20) | ||
174 | #define AC_WCAP_TYPE_SHIFT 20 | ||
175 | |||
176 | /* supported PCM rates and bits */ | ||
177 | #define AC_SUPPCM_RATES (0xfff << 0) | ||
178 | #define AC_SUPPCM_BITS_8 (1<<16) | ||
179 | #define AC_SUPPCM_BITS_16 (1<<17) | ||
180 | #define AC_SUPPCM_BITS_20 (1<<18) | ||
181 | #define AC_SUPPCM_BITS_24 (1<<19) | ||
182 | #define AC_SUPPCM_BITS_32 (1<<20) | ||
183 | |||
184 | /* supported PCM stream format */ | ||
185 | #define AC_SUPFMT_PCM (1<<0) | ||
186 | #define AC_SUPFMT_FLOAT32 (1<<1) | ||
187 | #define AC_SUPFMT_AC3 (1<<2) | ||
188 | |||
189 | /* GP I/O count */ | ||
190 | #define AC_GPIO_IO_COUNT (0xff<<0) | ||
191 | #define AC_GPIO_O_COUNT (0xff<<8) | ||
192 | #define AC_GPIO_O_COUNT_SHIFT 8 | ||
193 | #define AC_GPIO_I_COUNT (0xff<<16) | ||
194 | #define AC_GPIO_I_COUNT_SHIFT 16 | ||
195 | #define AC_GPIO_UNSOLICITED (1<<30) | ||
196 | #define AC_GPIO_WAKE (1<<31) | ||
197 | |||
198 | /* Converter stream, channel */ | ||
199 | #define AC_CONV_CHANNEL (0xf<<0) | ||
200 | #define AC_CONV_STREAM (0xf<<4) | ||
201 | #define AC_CONV_STREAM_SHIFT 4 | ||
202 | |||
203 | /* Input converter SDI select */ | ||
204 | #define AC_SDI_SELECT (0xf<<0) | ||
205 | |||
206 | /* stream format id */ | ||
207 | #define AC_FMT_CHAN_SHIFT 0 | ||
208 | #define AC_FMT_CHAN_MASK (0x0f << 0) | ||
209 | #define AC_FMT_BITS_SHIFT 4 | ||
210 | #define AC_FMT_BITS_MASK (7 << 4) | ||
211 | #define AC_FMT_BITS_8 (0 << 4) | ||
212 | #define AC_FMT_BITS_16 (1 << 4) | ||
213 | #define AC_FMT_BITS_20 (2 << 4) | ||
214 | #define AC_FMT_BITS_24 (3 << 4) | ||
215 | #define AC_FMT_BITS_32 (4 << 4) | ||
216 | #define AC_FMT_DIV_SHIFT 8 | ||
217 | #define AC_FMT_DIV_MASK (7 << 8) | ||
218 | #define AC_FMT_MULT_SHIFT 11 | ||
219 | #define AC_FMT_MULT_MASK (7 << 11) | ||
220 | #define AC_FMT_BASE_SHIFT 14 | ||
221 | #define AC_FMT_BASE_48K (0 << 14) | ||
222 | #define AC_FMT_BASE_44K (1 << 14) | ||
223 | #define AC_FMT_TYPE_SHIFT 15 | ||
224 | #define AC_FMT_TYPE_PCM (0 << 15) | ||
225 | #define AC_FMT_TYPE_NON_PCM (1 << 15) | ||
226 | |||
227 | /* Unsolicited response control */ | ||
228 | #define AC_UNSOL_TAG (0x3f<<0) | ||
229 | #define AC_UNSOL_ENABLED (1<<7) | ||
230 | #define AC_USRSP_EN AC_UNSOL_ENABLED | ||
231 | |||
232 | /* Unsolicited responses */ | ||
233 | #define AC_UNSOL_RES_TAG (0x3f<<26) | ||
234 | #define AC_UNSOL_RES_TAG_SHIFT 26 | ||
235 | #define AC_UNSOL_RES_SUBTAG (0x1f<<21) | ||
236 | #define AC_UNSOL_RES_SUBTAG_SHIFT 21 | ||
237 | #define AC_UNSOL_RES_DE (0x3f<<15) /* Device Entry | ||
238 | * (for DP1.2 MST) | ||
239 | */ | ||
240 | #define AC_UNSOL_RES_DE_SHIFT 15 | ||
241 | #define AC_UNSOL_RES_IA (1<<2) /* Inactive (for DP1.2 MST) */ | ||
242 | #define AC_UNSOL_RES_ELDV (1<<1) /* ELD Data valid (for HDMI) */ | ||
243 | #define AC_UNSOL_RES_PD (1<<0) /* pinsense detect */ | ||
244 | #define AC_UNSOL_RES_CP_STATE (1<<1) /* content protection */ | ||
245 | #define AC_UNSOL_RES_CP_READY (1<<0) /* content protection */ | ||
246 | |||
247 | /* Pin widget capabilies */ | ||
248 | #define AC_PINCAP_IMP_SENSE (1<<0) /* impedance sense capable */ | ||
249 | #define AC_PINCAP_TRIG_REQ (1<<1) /* trigger required */ | ||
250 | #define AC_PINCAP_PRES_DETECT (1<<2) /* presence detect capable */ | ||
251 | #define AC_PINCAP_HP_DRV (1<<3) /* headphone drive capable */ | ||
252 | #define AC_PINCAP_OUT (1<<4) /* output capable */ | ||
253 | #define AC_PINCAP_IN (1<<5) /* input capable */ | ||
254 | #define AC_PINCAP_BALANCE (1<<6) /* balanced I/O capable */ | ||
255 | /* Note: This LR_SWAP pincap is defined in the Realtek ALC883 specification, | ||
256 | * but is marked reserved in the Intel HDA specification. | ||
257 | */ | ||
258 | #define AC_PINCAP_LR_SWAP (1<<7) /* L/R swap */ | ||
259 | /* Note: The same bit as LR_SWAP is newly defined as HDMI capability | ||
260 | * in HD-audio specification | ||
261 | */ | ||
262 | #define AC_PINCAP_HDMI (1<<7) /* HDMI pin */ | ||
263 | #define AC_PINCAP_DP (1<<24) /* DisplayPort pin, can | ||
264 | * coexist with AC_PINCAP_HDMI | ||
265 | */ | ||
266 | #define AC_PINCAP_VREF (0x37<<8) | ||
267 | #define AC_PINCAP_VREF_SHIFT 8 | ||
268 | #define AC_PINCAP_EAPD (1<<16) /* EAPD capable */ | ||
269 | #define AC_PINCAP_HBR (1<<27) /* High Bit Rate */ | ||
270 | /* Vref status (used in pin cap) */ | ||
271 | #define AC_PINCAP_VREF_HIZ (1<<0) /* Hi-Z */ | ||
272 | #define AC_PINCAP_VREF_50 (1<<1) /* 50% */ | ||
273 | #define AC_PINCAP_VREF_GRD (1<<2) /* ground */ | ||
274 | #define AC_PINCAP_VREF_80 (1<<4) /* 80% */ | ||
275 | #define AC_PINCAP_VREF_100 (1<<5) /* 100% */ | ||
276 | |||
277 | /* Amplifier capabilities */ | ||
278 | #define AC_AMPCAP_OFFSET (0x7f<<0) /* 0dB offset */ | ||
279 | #define AC_AMPCAP_OFFSET_SHIFT 0 | ||
280 | #define AC_AMPCAP_NUM_STEPS (0x7f<<8) /* number of steps */ | ||
281 | #define AC_AMPCAP_NUM_STEPS_SHIFT 8 | ||
282 | #define AC_AMPCAP_STEP_SIZE (0x7f<<16) /* step size 0-32dB | ||
283 | * in 0.25dB | ||
284 | */ | ||
285 | #define AC_AMPCAP_STEP_SIZE_SHIFT 16 | ||
286 | #define AC_AMPCAP_MUTE (1<<31) /* mute capable */ | ||
287 | #define AC_AMPCAP_MUTE_SHIFT 31 | ||
288 | |||
289 | /* driver-specific amp-caps: using bits 24-30 */ | ||
290 | #define AC_AMPCAP_MIN_MUTE (1 << 30) /* min-volume = mute */ | ||
291 | |||
292 | /* Connection list */ | ||
293 | #define AC_CLIST_LENGTH (0x7f<<0) | ||
294 | #define AC_CLIST_LONG (1<<7) | ||
295 | |||
296 | /* Supported power status */ | ||
297 | #define AC_PWRST_D0SUP (1<<0) | ||
298 | #define AC_PWRST_D1SUP (1<<1) | ||
299 | #define AC_PWRST_D2SUP (1<<2) | ||
300 | #define AC_PWRST_D3SUP (1<<3) | ||
301 | #define AC_PWRST_D3COLDSUP (1<<4) | ||
302 | #define AC_PWRST_S3D3COLDSUP (1<<29) | ||
303 | #define AC_PWRST_CLKSTOP (1<<30) | ||
304 | #define AC_PWRST_EPSS (1U<<31) | ||
305 | |||
306 | /* Power state values */ | ||
307 | #define AC_PWRST_SETTING (0xf<<0) | ||
308 | #define AC_PWRST_ACTUAL (0xf<<4) | ||
309 | #define AC_PWRST_ACTUAL_SHIFT 4 | ||
310 | #define AC_PWRST_D0 0x00 | ||
311 | #define AC_PWRST_D1 0x01 | ||
312 | #define AC_PWRST_D2 0x02 | ||
313 | #define AC_PWRST_D3 0x03 | ||
314 | #define AC_PWRST_ERROR (1<<8) | ||
315 | #define AC_PWRST_CLK_STOP_OK (1<<9) | ||
316 | #define AC_PWRST_SETTING_RESET (1<<10) | ||
317 | |||
318 | /* Processing capabilies */ | ||
319 | #define AC_PCAP_BENIGN (1<<0) | ||
320 | #define AC_PCAP_NUM_COEF (0xff<<8) | ||
321 | #define AC_PCAP_NUM_COEF_SHIFT 8 | ||
322 | |||
323 | /* Volume knobs capabilities */ | ||
324 | #define AC_KNBCAP_NUM_STEPS (0x7f<<0) | ||
325 | #define AC_KNBCAP_DELTA (1<<7) | ||
326 | |||
327 | /* HDMI LPCM capabilities */ | ||
328 | #define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */ | ||
329 | #define AC_LPCMCAP_48K_NO_CHNS (0x0f<<4) /* max channels w/o CP-on */ | ||
330 | #define AC_LPCMCAP_48K_20BIT (1<<8) /* 20b bitrate supported */ | ||
331 | #define AC_LPCMCAP_48K_24BIT (1<<9) /* 24b bitrate supported */ | ||
332 | #define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */ | ||
333 | #define AC_LPCMCAP_96K_NO_CHNS (0x0f<<14) /* max channels w/o CP-on */ | ||
334 | #define AC_LPCMCAP_96K_20BIT (1<<18) /* 20b bitrate supported */ | ||
335 | #define AC_LPCMCAP_96K_24BIT (1<<19) /* 24b bitrate supported */ | ||
336 | #define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */ | ||
337 | #define AC_LPCMCAP_192K_NO_CHNS (0x0f<<24) /* max channels w/o CP-on */ | ||
338 | #define AC_LPCMCAP_192K_20BIT (1<<28) /* 20b bitrate supported */ | ||
339 | #define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */ | ||
340 | #define AC_LPCMCAP_44K (1<<30) /* 44.1kHz support */ | ||
341 | #define AC_LPCMCAP_44K_MS (1<<31) /* 44.1kHz-multiplies support */ | ||
342 | |||
343 | /* Display pin's device list length */ | ||
344 | #define AC_DEV_LIST_LEN_MASK 0x3f | ||
345 | #define AC_MAX_DEV_LIST_LEN 64 | ||
346 | |||
347 | /* | ||
348 | * Control Parameters | ||
349 | */ | ||
350 | |||
351 | /* Amp gain/mute */ | ||
352 | #define AC_AMP_MUTE (1<<7) | ||
353 | #define AC_AMP_GAIN (0x7f) | ||
354 | #define AC_AMP_GET_INDEX (0xf<<0) | ||
355 | |||
356 | #define AC_AMP_GET_LEFT (1<<13) | ||
357 | #define AC_AMP_GET_RIGHT (0<<13) | ||
358 | #define AC_AMP_GET_OUTPUT (1<<15) | ||
359 | #define AC_AMP_GET_INPUT (0<<15) | ||
360 | |||
361 | #define AC_AMP_SET_INDEX (0xf<<8) | ||
362 | #define AC_AMP_SET_INDEX_SHIFT 8 | ||
363 | #define AC_AMP_SET_RIGHT (1<<12) | ||
364 | #define AC_AMP_SET_LEFT (1<<13) | ||
365 | #define AC_AMP_SET_INPUT (1<<14) | ||
366 | #define AC_AMP_SET_OUTPUT (1<<15) | ||
367 | |||
368 | /* DIGITAL1 bits */ | ||
369 | #define AC_DIG1_ENABLE (1<<0) | ||
370 | #define AC_DIG1_V (1<<1) | ||
371 | #define AC_DIG1_VCFG (1<<2) | ||
372 | #define AC_DIG1_EMPHASIS (1<<3) | ||
373 | #define AC_DIG1_COPYRIGHT (1<<4) | ||
374 | #define AC_DIG1_NONAUDIO (1<<5) | ||
375 | #define AC_DIG1_PROFESSIONAL (1<<6) | ||
376 | #define AC_DIG1_LEVEL (1<<7) | ||
377 | |||
378 | /* DIGITAL2 bits */ | ||
379 | #define AC_DIG2_CC (0x7f<<0) | ||
380 | |||
381 | /* DIGITAL3 bits */ | ||
382 | #define AC_DIG3_ICT (0xf<<0) | ||
383 | #define AC_DIG3_KAE (1<<7) | ||
384 | |||
385 | /* Pin widget control - 8bit */ | ||
386 | #define AC_PINCTL_EPT (0x3<<0) | ||
387 | #define AC_PINCTL_EPT_NATIVE 0 | ||
388 | #define AC_PINCTL_EPT_HBR 3 | ||
389 | #define AC_PINCTL_VREFEN (0x7<<0) | ||
390 | #define AC_PINCTL_VREF_HIZ 0 /* Hi-Z */ | ||
391 | #define AC_PINCTL_VREF_50 1 /* 50% */ | ||
392 | #define AC_PINCTL_VREF_GRD 2 /* ground */ | ||
393 | #define AC_PINCTL_VREF_80 4 /* 80% */ | ||
394 | #define AC_PINCTL_VREF_100 5 /* 100% */ | ||
395 | #define AC_PINCTL_IN_EN (1<<5) | ||
396 | #define AC_PINCTL_OUT_EN (1<<6) | ||
397 | #define AC_PINCTL_HP_EN (1<<7) | ||
398 | |||
399 | /* Pin sense - 32bit */ | ||
400 | #define AC_PINSENSE_IMPEDANCE_MASK (0x7fffffff) | ||
401 | #define AC_PINSENSE_PRESENCE (1<<31) | ||
402 | #define AC_PINSENSE_ELDV (1<<30) /* ELD valid (HDMI) */ | ||
403 | |||
404 | /* EAPD/BTL enable - 32bit */ | ||
405 | #define AC_EAPDBTL_BALANCED (1<<0) | ||
406 | #define AC_EAPDBTL_EAPD (1<<1) | ||
407 | #define AC_EAPDBTL_LR_SWAP (1<<2) | ||
408 | |||
409 | /* HDMI ELD data */ | ||
410 | #define AC_ELDD_ELD_VALID (1<<31) | ||
411 | #define AC_ELDD_ELD_DATA 0xff | ||
412 | |||
413 | /* HDMI DIP size */ | ||
414 | #define AC_DIPSIZE_ELD_BUF (1<<3) /* ELD buf size of packet size */ | ||
415 | #define AC_DIPSIZE_PACK_IDX (0x07<<0) /* packet index */ | ||
416 | |||
417 | /* HDMI DIP index */ | ||
418 | #define AC_DIPIDX_PACK_IDX (0x07<<5) /* packet idnex */ | ||
419 | #define AC_DIPIDX_BYTE_IDX (0x1f<<0) /* byte index */ | ||
420 | |||
421 | /* HDMI DIP xmit (transmit) control */ | ||
422 | #define AC_DIPXMIT_MASK (0x3<<6) | ||
423 | #define AC_DIPXMIT_DISABLE (0x0<<6) /* disable xmit */ | ||
424 | #define AC_DIPXMIT_ONCE (0x2<<6) /* xmit once then disable */ | ||
425 | #define AC_DIPXMIT_BEST (0x3<<6) /* best effort */ | ||
426 | |||
427 | /* HDMI content protection (CP) control */ | ||
428 | #define AC_CPCTRL_CES (1<<9) /* current encryption state */ | ||
429 | #define AC_CPCTRL_READY (1<<8) /* ready bit */ | ||
430 | #define AC_CPCTRL_SUBTAG (0x1f<<3) /* subtag for unsol-resp */ | ||
431 | #define AC_CPCTRL_STATE (3<<0) /* current CP request state */ | ||
432 | |||
433 | /* Converter channel <-> HDMI slot mapping */ | ||
434 | #define AC_CVTMAP_HDMI_SLOT (0xf<<0) /* HDMI slot number */ | ||
435 | #define AC_CVTMAP_CHAN (0xf<<4) /* converter channel number */ | ||
436 | |||
437 | /* configuration default - 32bit */ | ||
438 | #define AC_DEFCFG_SEQUENCE (0xf<<0) | ||
439 | #define AC_DEFCFG_DEF_ASSOC (0xf<<4) | ||
440 | #define AC_DEFCFG_ASSOC_SHIFT 4 | ||
441 | #define AC_DEFCFG_MISC (0xf<<8) | ||
442 | #define AC_DEFCFG_MISC_SHIFT 8 | ||
443 | #define AC_DEFCFG_MISC_NO_PRESENCE (1<<0) | ||
444 | #define AC_DEFCFG_COLOR (0xf<<12) | ||
445 | #define AC_DEFCFG_COLOR_SHIFT 12 | ||
446 | #define AC_DEFCFG_CONN_TYPE (0xf<<16) | ||
447 | #define AC_DEFCFG_CONN_TYPE_SHIFT 16 | ||
448 | #define AC_DEFCFG_DEVICE (0xf<<20) | ||
449 | #define AC_DEFCFG_DEVICE_SHIFT 20 | ||
450 | #define AC_DEFCFG_LOCATION (0x3f<<24) | ||
451 | #define AC_DEFCFG_LOCATION_SHIFT 24 | ||
452 | #define AC_DEFCFG_PORT_CONN (0x3<<30) | ||
453 | #define AC_DEFCFG_PORT_CONN_SHIFT 30 | ||
454 | |||
455 | /* Display pin's device list entry */ | ||
456 | #define AC_DE_PD (1<<0) | ||
457 | #define AC_DE_ELDV (1<<1) | ||
458 | #define AC_DE_IA (1<<2) | ||
459 | |||
460 | /* device device types (0x0-0xf) */ | ||
461 | enum { | ||
462 | AC_JACK_LINE_OUT, | ||
463 | AC_JACK_SPEAKER, | ||
464 | AC_JACK_HP_OUT, | ||
465 | AC_JACK_CD, | ||
466 | AC_JACK_SPDIF_OUT, | ||
467 | AC_JACK_DIG_OTHER_OUT, | ||
468 | AC_JACK_MODEM_LINE_SIDE, | ||
469 | AC_JACK_MODEM_HAND_SIDE, | ||
470 | AC_JACK_LINE_IN, | ||
471 | AC_JACK_AUX, | ||
472 | AC_JACK_MIC_IN, | ||
473 | AC_JACK_TELEPHONY, | ||
474 | AC_JACK_SPDIF_IN, | ||
475 | AC_JACK_DIG_OTHER_IN, | ||
476 | AC_JACK_OTHER = 0xf, | ||
477 | }; | ||
478 | |||
479 | /* jack connection types (0x0-0xf) */ | ||
480 | enum { | ||
481 | AC_JACK_CONN_UNKNOWN, | ||
482 | AC_JACK_CONN_1_8, | ||
483 | AC_JACK_CONN_1_4, | ||
484 | AC_JACK_CONN_ATAPI, | ||
485 | AC_JACK_CONN_RCA, | ||
486 | AC_JACK_CONN_OPTICAL, | ||
487 | AC_JACK_CONN_OTHER_DIGITAL, | ||
488 | AC_JACK_CONN_OTHER_ANALOG, | ||
489 | AC_JACK_CONN_DIN, | ||
490 | AC_JACK_CONN_XLR, | ||
491 | AC_JACK_CONN_RJ11, | ||
492 | AC_JACK_CONN_COMB, | ||
493 | AC_JACK_CONN_OTHER = 0xf, | ||
494 | }; | ||
495 | |||
496 | /* jack colors (0x0-0xf) */ | ||
497 | enum { | ||
498 | AC_JACK_COLOR_UNKNOWN, | ||
499 | AC_JACK_COLOR_BLACK, | ||
500 | AC_JACK_COLOR_GREY, | ||
501 | AC_JACK_COLOR_BLUE, | ||
502 | AC_JACK_COLOR_GREEN, | ||
503 | AC_JACK_COLOR_RED, | ||
504 | AC_JACK_COLOR_ORANGE, | ||
505 | AC_JACK_COLOR_YELLOW, | ||
506 | AC_JACK_COLOR_PURPLE, | ||
507 | AC_JACK_COLOR_PINK, | ||
508 | AC_JACK_COLOR_WHITE = 0xe, | ||
509 | AC_JACK_COLOR_OTHER, | ||
510 | }; | ||
511 | |||
512 | /* Jack location (0x0-0x3f) */ | ||
513 | /* common case */ | ||
514 | enum { | ||
515 | AC_JACK_LOC_NONE, | ||
516 | AC_JACK_LOC_REAR, | ||
517 | AC_JACK_LOC_FRONT, | ||
518 | AC_JACK_LOC_LEFT, | ||
519 | AC_JACK_LOC_RIGHT, | ||
520 | AC_JACK_LOC_TOP, | ||
521 | AC_JACK_LOC_BOTTOM, | ||
522 | }; | ||
523 | /* bits 4-5 */ | ||
524 | enum { | ||
525 | AC_JACK_LOC_EXTERNAL = 0x00, | ||
526 | AC_JACK_LOC_INTERNAL = 0x10, | ||
527 | AC_JACK_LOC_SEPARATE = 0x20, | ||
528 | AC_JACK_LOC_OTHER = 0x30, | ||
529 | }; | ||
530 | enum { | ||
531 | /* external on primary chasis */ | ||
532 | AC_JACK_LOC_REAR_PANEL = 0x07, | ||
533 | AC_JACK_LOC_DRIVE_BAY, | ||
534 | /* internal */ | ||
535 | AC_JACK_LOC_RISER = 0x17, | ||
536 | AC_JACK_LOC_HDMI, | ||
537 | AC_JACK_LOC_ATAPI, | ||
538 | /* others */ | ||
539 | AC_JACK_LOC_MOBILE_IN = 0x37, | ||
540 | AC_JACK_LOC_MOBILE_OUT, | ||
541 | }; | ||
542 | |||
543 | /* Port connectivity (0-3) */ | ||
544 | enum { | ||
545 | AC_JACK_PORT_COMPLEX, | ||
546 | AC_JACK_PORT_NONE, | ||
547 | AC_JACK_PORT_FIXED, | ||
548 | AC_JACK_PORT_BOTH, | ||
549 | }; | ||
550 | |||
551 | /* max. codec address */ | ||
552 | #define HDA_MAX_CODEC_ADDRESS 0x0f | ||
553 | |||
554 | #endif /* __SOUND_HDA_VERBS_H */ | ||
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index af9983970417..782d1df34208 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -108,7 +108,7 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, | |||
108 | { | 108 | { |
109 | struct snd_sg_buf *sgbuf = dmab->private_data; | 109 | struct snd_sg_buf *sgbuf = dmab->private_data; |
110 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; | 110 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; |
111 | addr &= PAGE_MASK; | 111 | addr &= ~((dma_addr_t)PAGE_SIZE - 1); |
112 | return addr + offset % PAGE_SIZE; | 112 | return addr + offset % PAGE_SIZE; |
113 | } | 113 | } |
114 | 114 | ||
@@ -149,13 +149,6 @@ int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size, | |||
149 | struct snd_dma_buffer *dmab); | 149 | struct snd_dma_buffer *dmab); |
150 | void snd_dma_free_pages(struct snd_dma_buffer *dmab); | 150 | void snd_dma_free_pages(struct snd_dma_buffer *dmab); |
151 | 151 | ||
152 | /* buffer-preservation managements */ | ||
153 | |||
154 | #define snd_dma_pci_buf_id(pci) (((unsigned int)(pci)->vendor << 16) | (pci)->device) | ||
155 | |||
156 | size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id); | ||
157 | int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id); | ||
158 | |||
159 | /* basic memory allocation functions */ | 152 | /* basic memory allocation functions */ |
160 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags); | 153 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags); |
161 | void snd_free_pages(void *ptr, size_t size); | 154 | void snd_free_pages(void *ptr, size_t size); |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 84b10f9a2832..4883499ab38b 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -381,7 +381,6 @@ struct snd_pcm_substream { | |||
381 | struct pm_qos_request latency_pm_qos_req; /* pm_qos request */ | 381 | struct pm_qos_request latency_pm_qos_req; /* pm_qos request */ |
382 | size_t buffer_bytes_max; /* limit ring buffer size */ | 382 | size_t buffer_bytes_max; /* limit ring buffer size */ |
383 | struct snd_dma_buffer dma_buffer; | 383 | struct snd_dma_buffer dma_buffer; |
384 | unsigned int dma_buf_id; | ||
385 | size_t dma_max; | 384 | size_t dma_max; |
386 | /* -- hardware operations -- */ | 385 | /* -- hardware operations -- */ |
387 | const struct snd_pcm_ops *ops; | 386 | const struct snd_pcm_ops *ops; |
@@ -901,6 +900,8 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates; | |||
901 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); | 900 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); |
902 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); | 901 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); |
903 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit); | 902 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit); |
903 | unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a, | ||
904 | unsigned int rates_b); | ||
904 | 905 | ||
905 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, | 906 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, |
906 | struct snd_dma_buffer *bufp) | 907 | struct snd_dma_buffer *bufp) |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 37ae12e0ab06..6b1c78f05fab 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
@@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p) | |||
354 | params_channels(p)) / 8; | 354 | params_channels(p)) / 8; |
355 | } | 355 | } |
356 | 356 | ||
357 | static inline int | ||
358 | params_width(const struct snd_pcm_hw_params *p) | ||
359 | { | ||
360 | return snd_pcm_format_width(params_format(p)); | ||
361 | } | ||
362 | |||
363 | static inline int | ||
364 | params_physical_width(const struct snd_pcm_hw_params *p) | ||
365 | { | ||
366 | return snd_pcm_format_physical_width(params_format(p)); | ||
367 | } | ||
368 | |||
357 | #endif /* __SOUND_PCM_PARAMS_H */ | 369 | #endif /* __SOUND_PCM_PARAMS_H */ |
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h index 12afab18945d..e147498abe50 100644 --- a/include/sound/rcar_snd.h +++ b/include/sound/rcar_snd.h | |||
@@ -18,7 +18,7 @@ | |||
18 | #define RSND_GEN1_ADG 1 | 18 | #define RSND_GEN1_ADG 1 |
19 | #define RSND_GEN1_SSI 2 | 19 | #define RSND_GEN1_SSI 2 |
20 | 20 | ||
21 | #define RSND_GEN2_SRU 0 | 21 | #define RSND_GEN2_SCU 0 |
22 | #define RSND_GEN2_ADG 1 | 22 | #define RSND_GEN2_ADG 1 |
23 | #define RSND_GEN2_SSIU 2 | 23 | #define RSND_GEN2_SSIU 2 |
24 | #define RSND_GEN2_SSI 3 | 24 | #define RSND_GEN2_SSI 3 |
@@ -58,6 +58,7 @@ struct rsnd_ssi_platform_info { | |||
58 | 58 | ||
59 | struct rsnd_scu_platform_info { | 59 | struct rsnd_scu_platform_info { |
60 | u32 flags; | 60 | u32 flags; |
61 | u32 convert_rate; /* sampling rate convert */ | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /* | 64 | /* |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 800c101bb096..71f27c403194 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -123,6 +123,8 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | |||
123 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, | 123 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, |
124 | int direction); | 124 | int direction); |
125 | 125 | ||
126 | int snd_soc_dai_is_dummy(struct snd_soc_dai *dai); | ||
127 | |||
126 | struct snd_soc_dai_ops { | 128 | struct snd_soc_dai_ops { |
127 | /* | 129 | /* |
128 | * DAI clocking configuration, all optional. | 130 | * DAI clocking configuration, all optional. |
@@ -220,6 +222,8 @@ struct snd_soc_dai_driver { | |||
220 | struct snd_soc_pcm_stream capture; | 222 | struct snd_soc_pcm_stream capture; |
221 | struct snd_soc_pcm_stream playback; | 223 | struct snd_soc_pcm_stream playback; |
222 | unsigned int symmetric_rates:1; | 224 | unsigned int symmetric_rates:1; |
225 | unsigned int symmetric_channels:1; | ||
226 | unsigned int symmetric_samplebits:1; | ||
223 | 227 | ||
224 | /* probe ordering - for components with runtime dependencies */ | 228 | /* probe ordering - for components with runtime dependencies */ |
225 | int probe_order; | 229 | int probe_order; |
@@ -244,6 +248,8 @@ struct snd_soc_dai { | |||
244 | unsigned int capture_active:1; /* stream is in use */ | 248 | unsigned int capture_active:1; /* stream is in use */ |
245 | unsigned int playback_active:1; /* stream is in use */ | 249 | unsigned int playback_active:1; /* stream is in use */ |
246 | unsigned int symmetric_rates:1; | 250 | unsigned int symmetric_rates:1; |
251 | unsigned int symmetric_channels:1; | ||
252 | unsigned int symmetric_samplebits:1; | ||
247 | struct snd_pcm_runtime *runtime; | 253 | struct snd_pcm_runtime *runtime; |
248 | unsigned int active; | 254 | unsigned int active; |
249 | unsigned char probed:1; | 255 | unsigned char probed:1; |
@@ -258,6 +264,8 @@ struct snd_soc_dai { | |||
258 | 264 | ||
259 | /* Symmetry data - only valid if symmetry is being enforced */ | 265 | /* Symmetry data - only valid if symmetry is being enforced */ |
260 | unsigned int rate; | 266 | unsigned int rate; |
267 | unsigned int channels; | ||
268 | unsigned int sample_bits; | ||
261 | 269 | ||
262 | /* parent platform/codec */ | 270 | /* parent platform/codec */ |
263 | struct snd_soc_platform *platform; | 271 | struct snd_soc_platform *platform; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 2037c45adfe6..68d92e36facd 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -104,7 +104,8 @@ struct device; | |||
104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
107 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \ | 107 | { .id = snd_soc_dapm_mux, .name = wname, \ |
108 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | ||
108 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 109 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
109 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 110 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
110 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ | 111 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
@@ -411,6 +412,7 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, | |||
411 | int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, | 412 | int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, |
412 | struct snd_soc_dai *dai); | 413 | struct snd_soc_dai *dai); |
413 | int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); | 414 | int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); |
415 | void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); | ||
414 | int snd_soc_dapm_new_pcm(struct snd_soc_card *card, | 416 | int snd_soc_dapm_new_pcm(struct snd_soc_card *card, |
415 | const struct snd_soc_pcm_stream *params, | 417 | const struct snd_soc_pcm_stream *params, |
416 | struct snd_soc_dapm_widget *source, | 418 | struct snd_soc_dapm_widget *source, |
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 047d657c331c..2883a7a6f9f3 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #ifndef __LINUX_SND_SOC_DPCM_H | 11 | #ifndef __LINUX_SND_SOC_DPCM_H |
12 | #define __LINUX_SND_SOC_DPCM_H | 12 | #define __LINUX_SND_SOC_DPCM_H |
13 | 13 | ||
14 | #include <linux/slab.h> | ||
14 | #include <linux/list.h> | 15 | #include <linux/list.h> |
15 | #include <sound/pcm.h> | 16 | #include <sound/pcm.h> |
16 | 17 | ||
@@ -135,4 +136,25 @@ int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); | |||
135 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); | 136 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); |
136 | int soc_dpcm_runtime_update(struct snd_soc_card *); | 137 | int soc_dpcm_runtime_update(struct snd_soc_card *); |
137 | 138 | ||
139 | int dpcm_path_get(struct snd_soc_pcm_runtime *fe, | ||
140 | int stream, struct snd_soc_dapm_widget_list **list_); | ||
141 | int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, | ||
142 | int stream, struct snd_soc_dapm_widget_list **list, int new); | ||
143 | int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream); | ||
144 | int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream); | ||
145 | void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream); | ||
146 | void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream); | ||
147 | int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream); | ||
148 | int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream); | ||
149 | int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd); | ||
150 | int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream); | ||
151 | int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, | ||
152 | int event); | ||
153 | |||
154 | static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list) | ||
155 | { | ||
156 | kfree(*list); | ||
157 | } | ||
158 | |||
159 | |||
138 | #endif | 160 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 1f741cb24f33..9a001472b96a 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -334,9 +334,7 @@ struct snd_soc_jack_pin; | |||
334 | #include <sound/soc-dapm.h> | 334 | #include <sound/soc-dapm.h> |
335 | #include <sound/soc-dpcm.h> | 335 | #include <sound/soc-dpcm.h> |
336 | 336 | ||
337 | #ifdef CONFIG_GPIOLIB | ||
338 | struct snd_soc_jack_gpio; | 337 | struct snd_soc_jack_gpio; |
339 | #endif | ||
340 | 338 | ||
341 | typedef int (*hw_write_t)(void *,const char* ,int); | 339 | typedef int (*hw_write_t)(void *,const char* ,int); |
342 | 340 | ||
@@ -446,6 +444,17 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | |||
446 | struct snd_soc_jack_gpio *gpios); | 444 | struct snd_soc_jack_gpio *gpios); |
447 | void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | 445 | void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, |
448 | struct snd_soc_jack_gpio *gpios); | 446 | struct snd_soc_jack_gpio *gpios); |
447 | #else | ||
448 | static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | ||
449 | struct snd_soc_jack_gpio *gpios) | ||
450 | { | ||
451 | return 0; | ||
452 | } | ||
453 | |||
454 | static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | ||
455 | struct snd_soc_jack_gpio *gpios) | ||
456 | { | ||
457 | } | ||
449 | #endif | 458 | #endif |
450 | 459 | ||
451 | /* codec register bit access */ | 460 | /* codec register bit access */ |
@@ -580,7 +589,6 @@ struct snd_soc_jack_zone { | |||
580 | * to provide more complex checks (eg, reading an | 589 | * to provide more complex checks (eg, reading an |
581 | * ADC). | 590 | * ADC). |
582 | */ | 591 | */ |
583 | #ifdef CONFIG_GPIOLIB | ||
584 | struct snd_soc_jack_gpio { | 592 | struct snd_soc_jack_gpio { |
585 | unsigned int gpio; | 593 | unsigned int gpio; |
586 | const char *name; | 594 | const char *name; |
@@ -594,7 +602,6 @@ struct snd_soc_jack_gpio { | |||
594 | 602 | ||
595 | int (*jack_status_check)(void); | 603 | int (*jack_status_check)(void); |
596 | }; | 604 | }; |
597 | #endif | ||
598 | 605 | ||
599 | struct snd_soc_jack { | 606 | struct snd_soc_jack { |
600 | struct mutex mutex; | 607 | struct mutex mutex; |
@@ -879,6 +886,8 @@ struct snd_soc_dai_link { | |||
879 | 886 | ||
880 | /* Symmetry requirements */ | 887 | /* Symmetry requirements */ |
881 | unsigned int symmetric_rates:1; | 888 | unsigned int symmetric_rates:1; |
889 | unsigned int symmetric_channels:1; | ||
890 | unsigned int symmetric_samplebits:1; | ||
882 | 891 | ||
883 | /* Do not create a PCM for this DAI link (Backend link) */ | 892 | /* Do not create a PCM for this DAI link (Backend link) */ |
884 | unsigned int no_pcm:1; | 893 | unsigned int no_pcm:1; |
@@ -886,6 +895,10 @@ struct snd_soc_dai_link { | |||
886 | /* This DAI link can route to other DAI links at runtime (Frontend)*/ | 895 | /* This DAI link can route to other DAI links at runtime (Frontend)*/ |
887 | unsigned int dynamic:1; | 896 | unsigned int dynamic:1; |
888 | 897 | ||
898 | /* DPCM capture and Playback support */ | ||
899 | unsigned int dpcm_capture:1; | ||
900 | unsigned int dpcm_playback:1; | ||
901 | |||
889 | /* pmdown_time is ignored at stop */ | 902 | /* pmdown_time is ignored at stop */ |
890 | unsigned int ignore_pmdown_time:1; | 903 | unsigned int ignore_pmdown_time:1; |
891 | 904 | ||
@@ -1029,6 +1042,7 @@ struct snd_soc_pcm_runtime { | |||
1029 | 1042 | ||
1030 | /* Dynamic PCM BE runtime data */ | 1043 | /* Dynamic PCM BE runtime data */ |
1031 | struct snd_soc_dpcm_runtime dpcm[2]; | 1044 | struct snd_soc_dpcm_runtime dpcm[2]; |
1045 | int fe_compr; | ||
1032 | 1046 | ||
1033 | long pmdown_time; | 1047 | long pmdown_time; |
1034 | unsigned char pop_wait:1; | 1048 | unsigned char pop_wait:1; |
diff --git a/include/sound/spear_dma.h b/include/sound/spear_dma.h index 1b365bfdfb37..65aca51fe255 100644 --- a/include/sound/spear_dma.h +++ b/include/sound/spear_dma.h | |||
@@ -29,7 +29,6 @@ struct spear_dma_data { | |||
29 | dma_addr_t addr; | 29 | dma_addr_t addr; |
30 | u32 max_burst; | 30 | u32 max_burst; |
31 | enum dma_slave_buswidth addr_width; | 31 | enum dma_slave_buswidth addr_width; |
32 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
33 | }; | 32 | }; |
34 | 33 | ||
35 | #endif /* SPEAR_DMA_H */ | 34 | #endif /* SPEAR_DMA_H */ |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 45412a6afa69..321301c0a643 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -517,10 +517,6 @@ struct se_node_acl { | |||
517 | u32 acl_index; | 517 | u32 acl_index; |
518 | #define MAX_ACL_TAG_SIZE 64 | 518 | #define MAX_ACL_TAG_SIZE 64 |
519 | char acl_tag[MAX_ACL_TAG_SIZE]; | 519 | char acl_tag[MAX_ACL_TAG_SIZE]; |
520 | u64 num_cmds; | ||
521 | u64 read_bytes; | ||
522 | u64 write_bytes; | ||
523 | spinlock_t stats_lock; | ||
524 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | 520 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ |
525 | atomic_t acl_pr_ref_count; | 521 | atomic_t acl_pr_ref_count; |
526 | struct se_dev_entry **device_list; | 522 | struct se_dev_entry **device_list; |
@@ -624,6 +620,7 @@ struct se_dev_attrib { | |||
624 | u32 unmap_granularity; | 620 | u32 unmap_granularity; |
625 | u32 unmap_granularity_alignment; | 621 | u32 unmap_granularity_alignment; |
626 | u32 max_write_same_len; | 622 | u32 max_write_same_len; |
623 | u32 max_bytes_per_io; | ||
627 | struct se_device *da_dev; | 624 | struct se_device *da_dev; |
628 | struct config_group da_group; | 625 | struct config_group da_group; |
629 | }; | 626 | }; |
diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h index 88b878383797..1c875ad1ee5f 100644 --- a/include/trace/events/ras.h +++ b/include/trace/events/ras.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #define _TRACE_AER_H | 5 | #define _TRACE_AER_H |
6 | 6 | ||
7 | #include <linux/tracepoint.h> | 7 | #include <linux/tracepoint.h> |
8 | #include <linux/edac.h> | 8 | #include <linux/aer.h> |
9 | 9 | ||
10 | 10 | ||
11 | /* | 11 | /* |
@@ -63,10 +63,10 @@ TRACE_EVENT(aer_event, | |||
63 | 63 | ||
64 | TP_printk("%s PCIe Bus Error: severity=%s, %s\n", | 64 | TP_printk("%s PCIe Bus Error: severity=%s, %s\n", |
65 | __get_str(dev_name), | 65 | __get_str(dev_name), |
66 | __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" : | 66 | __entry->severity == AER_CORRECTABLE ? "Corrected" : |
67 | __entry->severity == HW_EVENT_ERR_FATAL ? | 67 | __entry->severity == AER_FATAL ? |
68 | "Fatal" : "Uncorrected", | 68 | "Fatal" : "Uncorrected, non-fatal", |
69 | __entry->severity == HW_EVENT_ERR_CORRECTED ? | 69 | __entry->severity == AER_CORRECTABLE ? |
70 | __print_flags(__entry->status, "|", aer_correctable_errors) : | 70 | __print_flags(__entry->status, "|", aer_correctable_errors) : |
71 | __print_flags(__entry->status, "|", aer_uncorrectable_errors)) | 71 | __print_flags(__entry->status, "|", aer_uncorrectable_errors)) |
72 | ); | 72 | ); |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index d17a35c6537e..5c38606613d8 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -90,6 +90,10 @@ | |||
90 | #define TRACE_EVENT_FLAGS(name, value) \ | 90 | #define TRACE_EVENT_FLAGS(name, value) \ |
91 | __TRACE_EVENT_FLAGS(name, value) | 91 | __TRACE_EVENT_FLAGS(name, value) |
92 | 92 | ||
93 | #undef TRACE_EVENT_PERF_PERM | ||
94 | #define TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
95 | __TRACE_EVENT_PERF_PERM(name, expr) | ||
96 | |||
93 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 97 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
94 | 98 | ||
95 | 99 | ||
@@ -140,6 +144,9 @@ | |||
140 | #undef TRACE_EVENT_FLAGS | 144 | #undef TRACE_EVENT_FLAGS |
141 | #define TRACE_EVENT_FLAGS(event, flag) | 145 | #define TRACE_EVENT_FLAGS(event, flag) |
142 | 146 | ||
147 | #undef TRACE_EVENT_PERF_PERM | ||
148 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
149 | |||
143 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 150 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
144 | 151 | ||
145 | /* | 152 | /* |
diff --git a/include/uapi/asm-generic/statfs.h b/include/uapi/asm-generic/statfs.h index 0999647fca13..cb89cc730f0b 100644 --- a/include/uapi/asm-generic/statfs.h +++ b/include/uapi/asm-generic/statfs.h | |||
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | #ifndef __statfs_word | 14 | #ifndef __statfs_word |
15 | #if __BITS_PER_LONG == 64 | 15 | #if __BITS_PER_LONG == 64 |
16 | #define __statfs_word long | 16 | #define __statfs_word __kernel_long_t |
17 | #else | 17 | #else |
18 | #define __statfs_word __u32 | 18 | #define __statfs_word __u32 |
19 | #endif | 19 | #endif |
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index 2f3f7ea8c77b..fe421e8a431b 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h | |||
@@ -983,6 +983,8 @@ struct drm_radeon_cs { | |||
983 | #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 | 983 | #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 |
984 | /* CIK macrotile mode array */ | 984 | /* CIK macrotile mode array */ |
985 | #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 | 985 | #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 |
986 | /* query the number of render backends */ | ||
987 | #define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19 | ||
986 | 988 | ||
987 | 989 | ||
988 | struct drm_radeon_info { | 990 | struct drm_radeon_info { |
diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h index bcb0912afe7a..f854ca4a1372 100644 --- a/include/uapi/drm/vmwgfx_drm.h +++ b/include/uapi/drm/vmwgfx_drm.h | |||
@@ -75,6 +75,7 @@ | |||
75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 | 75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 |
76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 | 76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 |
77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 | 77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 |
78 | #define DRM_VMW_PARAM_MAX_SURF_MEMORY 7 | ||
78 | 79 | ||
79 | /** | 80 | /** |
80 | * struct drm_vmw_getparam_arg | 81 | * struct drm_vmw_getparam_arg |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 33d2b8fe166d..3ce25b5d75a9 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
@@ -426,3 +426,5 @@ header-y += x25.h | |||
426 | header-y += xattr.h | 426 | header-y += xattr.h |
427 | header-y += xfrm.h | 427 | header-y += xfrm.h |
428 | header-y += hw_breakpoint.h | 428 | header-y += hw_breakpoint.h |
429 | header-y += zorro.h | ||
430 | header-y += zorro_ids.h | ||
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index 2c267bcbb85c..bc81fb2e1f0e 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h | |||
@@ -61,5 +61,16 @@ struct epoll_event { | |||
61 | __u64 data; | 61 | __u64 data; |
62 | } EPOLL_PACKED; | 62 | } EPOLL_PACKED; |
63 | 63 | ||
64 | 64 | #ifdef CONFIG_PM_SLEEP | |
65 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
66 | { | ||
67 | if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) | ||
68 | epev->events &= ~EPOLLWAKEUP; | ||
69 | } | ||
70 | #else | ||
71 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
72 | { | ||
73 | epev->events &= ~EPOLLWAKEUP; | ||
74 | } | ||
75 | #endif | ||
65 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ | 76 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ |
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h index 1af72d8228e0..c3363ba1ae05 100644 --- a/include/uapi/linux/genetlink.h +++ b/include/uapi/linux/genetlink.h | |||
@@ -28,6 +28,7 @@ struct genlmsghdr { | |||
28 | #define GENL_ID_GENERATE 0 | 28 | #define GENL_ID_GENERATE 0 |
29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE | 29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE |
30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) | 30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) |
31 | #define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2) | ||
31 | 32 | ||
32 | /************************************************************************** | 33 | /************************************************************************** |
33 | * Controller | 34 | * Controller |
diff --git a/include/uapi/linux/genwqe/genwqe_card.h b/include/uapi/linux/genwqe/genwqe_card.h new file mode 100644 index 000000000000..795e957bb840 --- /dev/null +++ b/include/uapi/linux/genwqe/genwqe_card.h | |||
@@ -0,0 +1,500 @@ | |||
1 | #ifndef __GENWQE_CARD_H__ | ||
2 | #define __GENWQE_CARD_H__ | ||
3 | |||
4 | /** | ||
5 | * IBM Accelerator Family 'GenWQE' | ||
6 | * | ||
7 | * (C) Copyright IBM Corp. 2013 | ||
8 | * | ||
9 | * Author: Frank Haverkamp <haver@linux.vnet.ibm.com> | ||
10 | * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com> | ||
11 | * Author: Michael Jung <mijung@de.ibm.com> | ||
12 | * Author: Michael Ruettger <michael@ibmra.de> | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License (version 2 only) | ||
16 | * as published by the Free Software Foundation. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * User-space API for the GenWQE card. For debugging and test purposes | ||
26 | * the register addresses are included here too. | ||
27 | */ | ||
28 | |||
29 | #include <linux/types.h> | ||
30 | #include <linux/ioctl.h> | ||
31 | |||
32 | /* Basename of sysfs, debugfs and /dev interfaces */ | ||
33 | #define GENWQE_DEVNAME "genwqe" | ||
34 | |||
35 | #define GENWQE_TYPE_ALTERA_230 0x00 /* GenWQE4 Stratix-IV-230 */ | ||
36 | #define GENWQE_TYPE_ALTERA_530 0x01 /* GenWQE4 Stratix-IV-530 */ | ||
37 | #define GENWQE_TYPE_ALTERA_A4 0x02 /* GenWQE5 A4 Stratix-V-A4 */ | ||
38 | #define GENWQE_TYPE_ALTERA_A7 0x03 /* GenWQE5 A7 Stratix-V-A7 */ | ||
39 | |||
40 | /* MMIO Unit offsets: Each UnitID occupies a defined address range */ | ||
41 | #define GENWQE_UID_OFFS(uid) ((uid) << 24) | ||
42 | #define GENWQE_SLU_OFFS GENWQE_UID_OFFS(0) | ||
43 | #define GENWQE_HSU_OFFS GENWQE_UID_OFFS(1) | ||
44 | #define GENWQE_APP_OFFS GENWQE_UID_OFFS(2) | ||
45 | #define GENWQE_MAX_UNITS 3 | ||
46 | |||
47 | /* Common offsets per UnitID */ | ||
48 | #define IO_EXTENDED_ERROR_POINTER 0x00000048 | ||
49 | #define IO_ERROR_INJECT_SELECTOR 0x00000060 | ||
50 | #define IO_EXTENDED_DIAG_SELECTOR 0x00000070 | ||
51 | #define IO_EXTENDED_DIAG_READ_MBX 0x00000078 | ||
52 | #define IO_EXTENDED_DIAG_MAP(ring) (0x00000500 | ((ring) << 3)) | ||
53 | |||
54 | #define GENWQE_EXTENDED_DIAG_SELECTOR(ring, trace) (((ring) << 8) | (trace)) | ||
55 | |||
56 | /* UnitID 0: Service Layer Unit (SLU) */ | ||
57 | |||
58 | /* SLU: Unit Configuration Register */ | ||
59 | #define IO_SLU_UNITCFG 0x00000000 | ||
60 | #define IO_SLU_UNITCFG_TYPE_MASK 0x000000000ff00000 /* 27:20 */ | ||
61 | |||
62 | /* SLU: Fault Isolation Register (FIR) (ac_slu_fir) */ | ||
63 | #define IO_SLU_FIR 0x00000008 /* read only, wr direct */ | ||
64 | #define IO_SLU_FIR_CLR 0x00000010 /* read and clear */ | ||
65 | |||
66 | /* SLU: First Error Capture Register (FEC/WOF) */ | ||
67 | #define IO_SLU_FEC 0x00000018 | ||
68 | |||
69 | #define IO_SLU_ERR_ACT_MASK 0x00000020 | ||
70 | #define IO_SLU_ERR_ATTN_MASK 0x00000028 | ||
71 | #define IO_SLU_FIRX1_ACT_MASK 0x00000030 | ||
72 | #define IO_SLU_FIRX0_ACT_MASK 0x00000038 | ||
73 | #define IO_SLU_SEC_LEM_DEBUG_OVR 0x00000040 | ||
74 | #define IO_SLU_EXTENDED_ERR_PTR 0x00000048 | ||
75 | #define IO_SLU_COMMON_CONFIG 0x00000060 | ||
76 | |||
77 | #define IO_SLU_FLASH_FIR 0x00000108 | ||
78 | #define IO_SLU_SLC_FIR 0x00000110 | ||
79 | #define IO_SLU_RIU_TRAP 0x00000280 | ||
80 | #define IO_SLU_FLASH_FEC 0x00000308 | ||
81 | #define IO_SLU_SLC_FEC 0x00000310 | ||
82 | |||
83 | /* | ||
84 | * The Virtual Function's Access is from offset 0x00010000 | ||
85 | * The Physical Function's Access is from offset 0x00050000 | ||
86 | * Single Shared Registers exists only at offset 0x00060000 | ||
87 | * | ||
88 | * SLC: Queue Virtual Window Window for accessing into a specific VF | ||
89 | * queue. When accessing the 0x10000 space using the 0x50000 address | ||
90 | * segment, the value indicated here is used to specify which VF | ||
91 | * register is decoded. This register, and the 0x50000 register space | ||
92 | * can only be accessed by the PF. Example, if this register is set to | ||
93 | * 0x2, then a read from 0x50000 is the same as a read from 0x10000 | ||
94 | * from VF=2. | ||
95 | */ | ||
96 | |||
97 | /* SLC: Queue Segment */ | ||
98 | #define IO_SLC_QUEUE_SEGMENT 0x00010000 | ||
99 | #define IO_SLC_VF_QUEUE_SEGMENT 0x00050000 | ||
100 | |||
101 | /* SLC: Queue Offset */ | ||
102 | #define IO_SLC_QUEUE_OFFSET 0x00010008 | ||
103 | #define IO_SLC_VF_QUEUE_OFFSET 0x00050008 | ||
104 | |||
105 | /* SLC: Queue Configuration */ | ||
106 | #define IO_SLC_QUEUE_CONFIG 0x00010010 | ||
107 | #define IO_SLC_VF_QUEUE_CONFIG 0x00050010 | ||
108 | |||
109 | /* SLC: Job Timout/Only accessible for the PF */ | ||
110 | #define IO_SLC_APPJOB_TIMEOUT 0x00010018 | ||
111 | #define IO_SLC_VF_APPJOB_TIMEOUT 0x00050018 | ||
112 | #define TIMEOUT_250MS 0x0000000f | ||
113 | #define HEARTBEAT_DISABLE 0x0000ff00 | ||
114 | |||
115 | /* SLC: Queue InitSequence Register */ | ||
116 | #define IO_SLC_QUEUE_INITSQN 0x00010020 | ||
117 | #define IO_SLC_VF_QUEUE_INITSQN 0x00050020 | ||
118 | |||
119 | /* SLC: Queue Wrap */ | ||
120 | #define IO_SLC_QUEUE_WRAP 0x00010028 | ||
121 | #define IO_SLC_VF_QUEUE_WRAP 0x00050028 | ||
122 | |||
123 | /* SLC: Queue Status */ | ||
124 | #define IO_SLC_QUEUE_STATUS 0x00010100 | ||
125 | #define IO_SLC_VF_QUEUE_STATUS 0x00050100 | ||
126 | |||
127 | /* SLC: Queue Working Time */ | ||
128 | #define IO_SLC_QUEUE_WTIME 0x00010030 | ||
129 | #define IO_SLC_VF_QUEUE_WTIME 0x00050030 | ||
130 | |||
131 | /* SLC: Queue Error Counts */ | ||
132 | #define IO_SLC_QUEUE_ERRCNTS 0x00010038 | ||
133 | #define IO_SLC_VF_QUEUE_ERRCNTS 0x00050038 | ||
134 | |||
135 | /* SLC: Queue Loast Response Word */ | ||
136 | #define IO_SLC_QUEUE_LRW 0x00010040 | ||
137 | #define IO_SLC_VF_QUEUE_LRW 0x00050040 | ||
138 | |||
139 | /* SLC: Freerunning Timer */ | ||
140 | #define IO_SLC_FREE_RUNNING_TIMER 0x00010108 | ||
141 | #define IO_SLC_VF_FREE_RUNNING_TIMER 0x00050108 | ||
142 | |||
143 | /* SLC: Queue Virtual Access Region */ | ||
144 | #define IO_PF_SLC_VIRTUAL_REGION 0x00050000 | ||
145 | |||
146 | /* SLC: Queue Virtual Window */ | ||
147 | #define IO_PF_SLC_VIRTUAL_WINDOW 0x00060000 | ||
148 | |||
149 | /* SLC: DDCB Application Job Pending [n] (n=0:63) */ | ||
150 | #define IO_PF_SLC_JOBPEND(n) (0x00061000 + 8*(n)) | ||
151 | #define IO_SLC_JOBPEND(n) IO_PF_SLC_JOBPEND(n) | ||
152 | |||
153 | /* SLC: Parser Trap RAM [n] (n=0:31) */ | ||
154 | #define IO_SLU_SLC_PARSE_TRAP(n) (0x00011000 + 8*(n)) | ||
155 | |||
156 | /* SLC: Dispatcher Trap RAM [n] (n=0:31) */ | ||
157 | #define IO_SLU_SLC_DISP_TRAP(n) (0x00011200 + 8*(n)) | ||
158 | |||
159 | /* Global Fault Isolation Register (GFIR) */ | ||
160 | #define IO_SLC_CFGREG_GFIR 0x00020000 | ||
161 | #define GFIR_ERR_TRIGGER 0x0000ffff | ||
162 | |||
163 | /* SLU: Soft Reset Register */ | ||
164 | #define IO_SLC_CFGREG_SOFTRESET 0x00020018 | ||
165 | |||
166 | /* SLU: Misc Debug Register */ | ||
167 | #define IO_SLC_MISC_DEBUG 0x00020060 | ||
168 | #define IO_SLC_MISC_DEBUG_CLR 0x00020068 | ||
169 | #define IO_SLC_MISC_DEBUG_SET 0x00020070 | ||
170 | |||
171 | /* Temperature Sensor Reading */ | ||
172 | #define IO_SLU_TEMPERATURE_SENSOR 0x00030000 | ||
173 | #define IO_SLU_TEMPERATURE_CONFIG 0x00030008 | ||
174 | |||
175 | /* Voltage Margining Control */ | ||
176 | #define IO_SLU_VOLTAGE_CONTROL 0x00030080 | ||
177 | #define IO_SLU_VOLTAGE_NOMINAL 0x00000000 | ||
178 | #define IO_SLU_VOLTAGE_DOWN5 0x00000006 | ||
179 | #define IO_SLU_VOLTAGE_UP5 0x00000007 | ||
180 | |||
181 | /* Direct LED Control Register */ | ||
182 | #define IO_SLU_LEDCONTROL 0x00030100 | ||
183 | |||
184 | /* SLU: Flashbus Direct Access -A5 */ | ||
185 | #define IO_SLU_FLASH_DIRECTACCESS 0x00040010 | ||
186 | |||
187 | /* SLU: Flashbus Direct Access2 -A5 */ | ||
188 | #define IO_SLU_FLASH_DIRECTACCESS2 0x00040020 | ||
189 | |||
190 | /* SLU: Flashbus Command Interface -A5 */ | ||
191 | #define IO_SLU_FLASH_CMDINTF 0x00040030 | ||
192 | |||
193 | /* SLU: BitStream Loaded */ | ||
194 | #define IO_SLU_BITSTREAM 0x00040040 | ||
195 | |||
196 | /* This Register has a switch which will change the CAs to UR */ | ||
197 | #define IO_HSU_ERR_BEHAVIOR 0x01001010 | ||
198 | |||
199 | #define IO_SLC2_SQB_TRAP 0x00062000 | ||
200 | #define IO_SLC2_QUEUE_MANAGER_TRAP 0x00062008 | ||
201 | #define IO_SLC2_FLS_MASTER_TRAP 0x00062010 | ||
202 | |||
203 | /* UnitID 1: HSU Registers */ | ||
204 | #define IO_HSU_UNITCFG 0x01000000 | ||
205 | #define IO_HSU_FIR 0x01000008 | ||
206 | #define IO_HSU_FIR_CLR 0x01000010 | ||
207 | #define IO_HSU_FEC 0x01000018 | ||
208 | #define IO_HSU_ERR_ACT_MASK 0x01000020 | ||
209 | #define IO_HSU_ERR_ATTN_MASK 0x01000028 | ||
210 | #define IO_HSU_FIRX1_ACT_MASK 0x01000030 | ||
211 | #define IO_HSU_FIRX0_ACT_MASK 0x01000038 | ||
212 | #define IO_HSU_SEC_LEM_DEBUG_OVR 0x01000040 | ||
213 | #define IO_HSU_EXTENDED_ERR_PTR 0x01000048 | ||
214 | #define IO_HSU_COMMON_CONFIG 0x01000060 | ||
215 | |||
216 | /* UnitID 2: Application Unit (APP) */ | ||
217 | #define IO_APP_UNITCFG 0x02000000 | ||
218 | #define IO_APP_FIR 0x02000008 | ||
219 | #define IO_APP_FIR_CLR 0x02000010 | ||
220 | #define IO_APP_FEC 0x02000018 | ||
221 | #define IO_APP_ERR_ACT_MASK 0x02000020 | ||
222 | #define IO_APP_ERR_ATTN_MASK 0x02000028 | ||
223 | #define IO_APP_FIRX1_ACT_MASK 0x02000030 | ||
224 | #define IO_APP_FIRX0_ACT_MASK 0x02000038 | ||
225 | #define IO_APP_SEC_LEM_DEBUG_OVR 0x02000040 | ||
226 | #define IO_APP_EXTENDED_ERR_PTR 0x02000048 | ||
227 | #define IO_APP_COMMON_CONFIG 0x02000060 | ||
228 | |||
229 | #define IO_APP_DEBUG_REG_01 0x02010000 | ||
230 | #define IO_APP_DEBUG_REG_02 0x02010008 | ||
231 | #define IO_APP_DEBUG_REG_03 0x02010010 | ||
232 | #define IO_APP_DEBUG_REG_04 0x02010018 | ||
233 | #define IO_APP_DEBUG_REG_05 0x02010020 | ||
234 | #define IO_APP_DEBUG_REG_06 0x02010028 | ||
235 | #define IO_APP_DEBUG_REG_07 0x02010030 | ||
236 | #define IO_APP_DEBUG_REG_08 0x02010038 | ||
237 | #define IO_APP_DEBUG_REG_09 0x02010040 | ||
238 | #define IO_APP_DEBUG_REG_10 0x02010048 | ||
239 | #define IO_APP_DEBUG_REG_11 0x02010050 | ||
240 | #define IO_APP_DEBUG_REG_12 0x02010058 | ||
241 | #define IO_APP_DEBUG_REG_13 0x02010060 | ||
242 | #define IO_APP_DEBUG_REG_14 0x02010068 | ||
243 | #define IO_APP_DEBUG_REG_15 0x02010070 | ||
244 | #define IO_APP_DEBUG_REG_16 0x02010078 | ||
245 | #define IO_APP_DEBUG_REG_17 0x02010080 | ||
246 | #define IO_APP_DEBUG_REG_18 0x02010088 | ||
247 | |||
248 | /* Read/write from/to registers */ | ||
249 | struct genwqe_reg_io { | ||
250 | __u64 num; /* register offset/address */ | ||
251 | __u64 val64; | ||
252 | }; | ||
253 | |||
254 | /* | ||
255 | * All registers of our card will return values not equal this values. | ||
256 | * If we see IO_ILLEGAL_VALUE on any of our MMIO register reads, the | ||
257 | * card can be considered as unusable. It will need recovery. | ||
258 | */ | ||
259 | #define IO_ILLEGAL_VALUE 0xffffffffffffffffull | ||
260 | |||
261 | /* | ||
262 | * Generic DDCB execution interface. | ||
263 | * | ||
264 | * This interface is a first prototype resulting from discussions we | ||
265 | * had with other teams which wanted to use the Genwqe card. It allows | ||
266 | * to issue a DDCB request in a generic way. The request will block | ||
267 | * until it finishes or time out with error. | ||
268 | * | ||
269 | * Some DDCBs require DMA addresses to be specified in the ASIV | ||
270 | * block. The interface provies the capability to let the kernel | ||
271 | * driver know where those addresses are by specifying the ATS field, | ||
272 | * such that it can replace the user-space addresses with appropriate | ||
273 | * DMA addresses or DMA addresses of a scatter gather list which is | ||
274 | * dynamically created. | ||
275 | * | ||
276 | * Our hardware will refuse DDCB execution if the ATS field is not as | ||
277 | * expected. That means the DDCB execution engine in the chip knows | ||
278 | * where it expects DMA addresses within the ASIV part of the DDCB and | ||
279 | * will check that against the ATS field definition. Any invalid or | ||
280 | * unknown ATS content will lead to DDCB refusal. | ||
281 | */ | ||
282 | |||
283 | /* Genwqe chip Units */ | ||
284 | #define DDCB_ACFUNC_SLU 0x00 /* chip service layer unit */ | ||
285 | #define DDCB_ACFUNC_APP 0x01 /* chip application */ | ||
286 | |||
287 | /* DDCB return codes (RETC) */ | ||
288 | #define DDCB_RETC_IDLE 0x0000 /* Unexecuted/DDCB created */ | ||
289 | #define DDCB_RETC_PENDING 0x0101 /* Pending Execution */ | ||
290 | #define DDCB_RETC_COMPLETE 0x0102 /* Cmd complete. No error */ | ||
291 | #define DDCB_RETC_FAULT 0x0104 /* App Err, recoverable */ | ||
292 | #define DDCB_RETC_ERROR 0x0108 /* App Err, non-recoverable */ | ||
293 | #define DDCB_RETC_FORCED_ERROR 0x01ff /* overwritten by driver */ | ||
294 | |||
295 | #define DDCB_RETC_UNEXEC 0x0110 /* Unexe/Removed from queue */ | ||
296 | #define DDCB_RETC_TERM 0x0120 /* Terminated */ | ||
297 | #define DDCB_RETC_RES0 0x0140 /* Reserved */ | ||
298 | #define DDCB_RETC_RES1 0x0180 /* Reserved */ | ||
299 | |||
300 | /* DDCB Command Options (CMDOPT) */ | ||
301 | #define DDCB_OPT_ECHO_FORCE_NO 0x0000 /* ECHO DDCB */ | ||
302 | #define DDCB_OPT_ECHO_FORCE_102 0x0001 /* force return code */ | ||
303 | #define DDCB_OPT_ECHO_FORCE_104 0x0002 | ||
304 | #define DDCB_OPT_ECHO_FORCE_108 0x0003 | ||
305 | |||
306 | #define DDCB_OPT_ECHO_FORCE_110 0x0004 /* only on PF ! */ | ||
307 | #define DDCB_OPT_ECHO_FORCE_120 0x0005 | ||
308 | #define DDCB_OPT_ECHO_FORCE_140 0x0006 | ||
309 | #define DDCB_OPT_ECHO_FORCE_180 0x0007 | ||
310 | |||
311 | #define DDCB_OPT_ECHO_COPY_NONE (0 << 5) | ||
312 | #define DDCB_OPT_ECHO_COPY_ALL (1 << 5) | ||
313 | |||
314 | /* Definitions of Service Layer Commands */ | ||
315 | #define SLCMD_ECHO_SYNC 0x00 /* PF/VF */ | ||
316 | #define SLCMD_MOVE_FLASH 0x06 /* PF only */ | ||
317 | #define SLCMD_MOVE_FLASH_FLAGS_MODE 0x03 /* bit 0 and 1 used for mode */ | ||
318 | #define SLCMD_MOVE_FLASH_FLAGS_DLOAD 0 /* mode: download */ | ||
319 | #define SLCMD_MOVE_FLASH_FLAGS_EMUL 1 /* mode: emulation */ | ||
320 | #define SLCMD_MOVE_FLASH_FLAGS_UPLOAD 2 /* mode: upload */ | ||
321 | #define SLCMD_MOVE_FLASH_FLAGS_VERIFY 3 /* mode: verify */ | ||
322 | #define SLCMD_MOVE_FLASH_FLAG_NOTAP (1 << 2)/* just dump DDCB and exit */ | ||
323 | #define SLCMD_MOVE_FLASH_FLAG_POLL (1 << 3)/* wait for RETC >= 0102 */ | ||
324 | #define SLCMD_MOVE_FLASH_FLAG_PARTITION (1 << 4) | ||
325 | #define SLCMD_MOVE_FLASH_FLAG_ERASE (1 << 5) | ||
326 | |||
327 | enum genwqe_card_state { | ||
328 | GENWQE_CARD_UNUSED = 0, | ||
329 | GENWQE_CARD_USED = 1, | ||
330 | GENWQE_CARD_FATAL_ERROR = 2, | ||
331 | GENWQE_CARD_STATE_MAX, | ||
332 | }; | ||
333 | |||
334 | /* common struct for chip image exchange */ | ||
335 | struct genwqe_bitstream { | ||
336 | __u64 data_addr; /* pointer to image data */ | ||
337 | __u32 size; /* size of image file */ | ||
338 | __u32 crc; /* crc of this image */ | ||
339 | __u64 target_addr; /* starting address in Flash */ | ||
340 | __u32 partition; /* '0', '1', or 'v' */ | ||
341 | __u32 uid; /* 1=host/x=dram */ | ||
342 | |||
343 | __u64 slu_id; /* informational/sim: SluID */ | ||
344 | __u64 app_id; /* informational/sim: AppID */ | ||
345 | |||
346 | __u16 retc; /* returned from processing */ | ||
347 | __u16 attn; /* attention code from processing */ | ||
348 | __u32 progress; /* progress code from processing */ | ||
349 | }; | ||
350 | |||
351 | /* Issuing a specific DDCB command */ | ||
352 | #define DDCB_LENGTH 256 /* for debug data */ | ||
353 | #define DDCB_ASIV_LENGTH 104 /* len of the DDCB ASIV array */ | ||
354 | #define DDCB_ASIV_LENGTH_ATS 96 /* ASIV in ATS architecture */ | ||
355 | #define DDCB_ASV_LENGTH 64 /* len of the DDCB ASV array */ | ||
356 | #define DDCB_FIXUPS 12 /* maximum number of fixups */ | ||
357 | |||
358 | struct genwqe_debug_data { | ||
359 | char driver_version[64]; | ||
360 | __u64 slu_unitcfg; | ||
361 | __u64 app_unitcfg; | ||
362 | |||
363 | __u8 ddcb_before[DDCB_LENGTH]; | ||
364 | __u8 ddcb_prev[DDCB_LENGTH]; | ||
365 | __u8 ddcb_finished[DDCB_LENGTH]; | ||
366 | }; | ||
367 | |||
368 | /* | ||
369 | * Address Translation Specification (ATS) definitions | ||
370 | * | ||
371 | * Each 4 bit within the ATS 64-bit word specify the required address | ||
372 | * translation at the defined offset. | ||
373 | * | ||
374 | * 63 LSB | ||
375 | * 6666.5555.5555.5544.4444.4443.3333.3333 ... 11 | ||
376 | * 3210.9876.5432.1098.7654.3210.9876.5432 ... 1098.7654.3210 | ||
377 | * | ||
378 | * offset: 0x00 0x08 0x10 0x18 0x20 0x28 0x30 0x38 ... 0x68 0x70 0x78 | ||
379 | * res res res res ASIV ... | ||
380 | * The first 4 entries in the ATS word are reserved. The following nibbles | ||
381 | * each describe at an 8 byte offset the format of the required data. | ||
382 | */ | ||
383 | #define ATS_TYPE_DATA 0x0ull /* data */ | ||
384 | #define ATS_TYPE_FLAT_RD 0x4ull /* flat buffer read only */ | ||
385 | #define ATS_TYPE_FLAT_RDWR 0x5ull /* flat buffer read/write */ | ||
386 | #define ATS_TYPE_SGL_RD 0x6ull /* sgl read only */ | ||
387 | #define ATS_TYPE_SGL_RDWR 0x7ull /* sgl read/write */ | ||
388 | |||
389 | #define ATS_SET_FLAGS(_struct, _field, _flags) \ | ||
390 | (((_flags) & 0xf) << (44 - (4 * (offsetof(_struct, _field) / 8)))) | ||
391 | |||
392 | #define ATS_GET_FLAGS(_ats, _byte_offs) \ | ||
393 | (((_ats) >> (44 - (4 * ((_byte_offs) / 8)))) & 0xf) | ||
394 | |||
395 | /** | ||
396 | * struct genwqe_ddcb_cmd - User parameter for generic DDCB commands | ||
397 | * | ||
398 | * On the way into the kernel the driver will read the whole data | ||
399 | * structure. On the way out the driver will not copy the ASIV data | ||
400 | * back to user-space. | ||
401 | */ | ||
402 | struct genwqe_ddcb_cmd { | ||
403 | /* START of data copied to/from driver */ | ||
404 | __u64 next_addr; /* chaining genwqe_ddcb_cmd */ | ||
405 | __u64 flags; /* reserved */ | ||
406 | |||
407 | __u8 acfunc; /* accelerators functional unit */ | ||
408 | __u8 cmd; /* command to execute */ | ||
409 | __u8 asiv_length; /* used parameter length */ | ||
410 | __u8 asv_length; /* length of valid return values */ | ||
411 | __u16 cmdopts; /* command options */ | ||
412 | __u16 retc; /* return code from processing */ | ||
413 | |||
414 | __u16 attn; /* attention code from processing */ | ||
415 | __u16 vcrc; /* variant crc16 */ | ||
416 | __u32 progress; /* progress code from processing */ | ||
417 | |||
418 | __u64 deque_ts; /* dequeue time stamp */ | ||
419 | __u64 cmplt_ts; /* completion time stamp */ | ||
420 | __u64 disp_ts; /* SW processing start */ | ||
421 | |||
422 | /* move to end and avoid copy-back */ | ||
423 | __u64 ddata_addr; /* collect debug data */ | ||
424 | |||
425 | /* command specific values */ | ||
426 | __u8 asv[DDCB_ASV_LENGTH]; | ||
427 | |||
428 | /* END of data copied from driver */ | ||
429 | union { | ||
430 | struct { | ||
431 | __u64 ats; | ||
432 | __u8 asiv[DDCB_ASIV_LENGTH_ATS]; | ||
433 | }; | ||
434 | /* used for flash update to keep it backward compatible */ | ||
435 | __u8 __asiv[DDCB_ASIV_LENGTH]; | ||
436 | }; | ||
437 | /* END of data copied to driver */ | ||
438 | }; | ||
439 | |||
440 | #define GENWQE_IOC_CODE 0xa5 | ||
441 | |||
442 | /* Access functions */ | ||
443 | #define GENWQE_READ_REG64 _IOR(GENWQE_IOC_CODE, 30, struct genwqe_reg_io) | ||
444 | #define GENWQE_WRITE_REG64 _IOW(GENWQE_IOC_CODE, 31, struct genwqe_reg_io) | ||
445 | #define GENWQE_READ_REG32 _IOR(GENWQE_IOC_CODE, 32, struct genwqe_reg_io) | ||
446 | #define GENWQE_WRITE_REG32 _IOW(GENWQE_IOC_CODE, 33, struct genwqe_reg_io) | ||
447 | #define GENWQE_READ_REG16 _IOR(GENWQE_IOC_CODE, 34, struct genwqe_reg_io) | ||
448 | #define GENWQE_WRITE_REG16 _IOW(GENWQE_IOC_CODE, 35, struct genwqe_reg_io) | ||
449 | |||
450 | #define GENWQE_GET_CARD_STATE _IOR(GENWQE_IOC_CODE, 36, enum genwqe_card_state) | ||
451 | |||
452 | /** | ||
453 | * struct genwqe_mem - Memory pinning/unpinning information | ||
454 | * @addr: virtual user space address | ||
455 | * @size: size of the area pin/dma-map/unmap | ||
456 | * direction: 0: read/1: read and write | ||
457 | * | ||
458 | * Avoid pinning and unpinning of memory pages dynamically. Instead | ||
459 | * the idea is to pin the whole buffer space required for DDCB | ||
460 | * opertionas in advance. The driver will reuse this pinning and the | ||
461 | * memory associated with it to setup the sglists for the DDCB | ||
462 | * requests without the need to allocate and free memory or map and | ||
463 | * unmap to get the DMA addresses. | ||
464 | * | ||
465 | * The inverse operation needs to be called after the pinning is not | ||
466 | * needed anymore. The pinnings else the pinnings will get removed | ||
467 | * after the device is closed. Note that pinnings will required | ||
468 | * memory. | ||
469 | */ | ||
470 | struct genwqe_mem { | ||
471 | __u64 addr; | ||
472 | __u64 size; | ||
473 | __u64 direction; | ||
474 | __u64 flags; | ||
475 | }; | ||
476 | |||
477 | #define GENWQE_PIN_MEM _IOWR(GENWQE_IOC_CODE, 40, struct genwqe_mem) | ||
478 | #define GENWQE_UNPIN_MEM _IOWR(GENWQE_IOC_CODE, 41, struct genwqe_mem) | ||
479 | |||
480 | /* | ||
481 | * Generic synchronous DDCB execution interface. | ||
482 | * Synchronously execute a DDCB. | ||
483 | * | ||
484 | * Return: 0 on success or negative error code. | ||
485 | * -EINVAL: Invalid parameters (ASIV_LEN, ASV_LEN, illegal fixups | ||
486 | * no mappings found/could not create mappings | ||
487 | * -EFAULT: illegal addresses in fixups, purging failed | ||
488 | * -EBADMSG: enqueing failed, retc != DDCB_RETC_COMPLETE | ||
489 | */ | ||
490 | #define GENWQE_EXECUTE_DDCB \ | ||
491 | _IOWR(GENWQE_IOC_CODE, 50, struct genwqe_ddcb_cmd) | ||
492 | |||
493 | #define GENWQE_EXECUTE_RAW_DDCB \ | ||
494 | _IOWR(GENWQE_IOC_CODE, 51, struct genwqe_ddcb_cmd) | ||
495 | |||
496 | /* Service Layer functions (PF only) */ | ||
497 | #define GENWQE_SLU_UPDATE _IOWR(GENWQE_IOC_CODE, 80, struct genwqe_bitstream) | ||
498 | #define GENWQE_SLU_READ _IOWR(GENWQE_IOC_CODE, 81, struct genwqe_bitstream) | ||
499 | |||
500 | #endif /* __GENWQE_CARD_H__ */ | ||
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index b78566f59aba..6db460121f84 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -488,7 +488,9 @@ enum { | |||
488 | IFLA_HSR_UNSPEC, | 488 | IFLA_HSR_UNSPEC, |
489 | IFLA_HSR_SLAVE1, | 489 | IFLA_HSR_SLAVE1, |
490 | IFLA_HSR_SLAVE2, | 490 | IFLA_HSR_SLAVE2, |
491 | IFLA_HSR_MULTICAST_SPEC, | 491 | IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */ |
492 | IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */ | ||
493 | IFLA_HSR_SEQ_NR, | ||
492 | __IFLA_HSR_MAX, | 494 | __IFLA_HSR_MAX, |
493 | }; | 495 | }; |
494 | 496 | ||
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index a3726275876d..bd24470d24a2 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h | |||
@@ -464,7 +464,8 @@ struct input_keymap_entry { | |||
464 | #define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ | 464 | #define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ |
465 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ | 465 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ |
466 | 466 | ||
467 | #define KEY_WIMAX 246 | 467 | #define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */ |
468 | #define KEY_WIMAX KEY_WWAN | ||
468 | #define KEY_RFKILL 247 /* Key that controls all radios */ | 469 | #define KEY_RFKILL 247 /* Key that controls all radios */ |
469 | 470 | ||
470 | #define KEY_MICMUTE 248 /* Mute / unmute the microphone */ | 471 | #define KEY_MICMUTE 248 /* Mute / unmute the microphone */ |
@@ -719,6 +720,8 @@ struct input_keymap_entry { | |||
719 | #define BTN_DPAD_LEFT 0x222 | 720 | #define BTN_DPAD_LEFT 0x222 |
720 | #define BTN_DPAD_RIGHT 0x223 | 721 | #define BTN_DPAD_RIGHT 0x223 |
721 | 722 | ||
723 | #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ | ||
724 | |||
722 | #define BTN_TRIGGER_HAPPY 0x2c0 | 725 | #define BTN_TRIGGER_HAPPY 0x2c0 |
723 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 726 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
724 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 727 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
@@ -856,6 +859,7 @@ struct input_keymap_entry { | |||
856 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 859 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
857 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | 860 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ |
858 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ | 861 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ |
862 | #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ | ||
859 | #define SW_MAX 0x0f | 863 | #define SW_MAX 0x0f |
860 | #define SW_CNT (SW_MAX+1) | 864 | #define SW_CNT (SW_MAX+1) |
861 | 865 | ||
diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h index 104838f65bc1..d6629d49a243 100644 --- a/include/uapi/linux/kexec.h +++ b/include/uapi/linux/kexec.h | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | #define KEXEC_ARCH_DEFAULT ( 0 << 16) | 19 | #define KEXEC_ARCH_DEFAULT ( 0 << 16) |
20 | #define KEXEC_ARCH_386 ( 3 << 16) | 20 | #define KEXEC_ARCH_386 ( 3 << 16) |
21 | #define KEXEC_ARCH_68K ( 4 << 16) | ||
21 | #define KEXEC_ARCH_X86_64 (62 << 16) | 22 | #define KEXEC_ARCH_X86_64 (62 << 16) |
22 | #define KEXEC_ARCH_PPC (20 << 16) | 23 | #define KEXEC_ARCH_PPC (20 << 16) |
23 | #define KEXEC_ARCH_PPC64 (21 << 16) | 24 | #define KEXEC_ARCH_PPC64 (21 << 16) |
diff --git a/include/uapi/linux/mic_common.h b/include/uapi/linux/mic_common.h index 17e7d95e4f53..6eb40244e019 100644 --- a/include/uapi/linux/mic_common.h +++ b/include/uapi/linux/mic_common.h | |||
@@ -23,12 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/virtio_ring.h> | 24 | #include <linux/virtio_ring.h> |
25 | 25 | ||
26 | #ifndef __KERNEL__ | 26 | #define __mic_align(a, x) (((a) + (x) - 1) & ~((x) - 1)) |
27 | #define ALIGN(a, x) (((a) + (x) - 1) & ~((x) - 1)) | ||
28 | #define __aligned(x) __attribute__ ((aligned(x))) | ||
29 | #endif | ||
30 | |||
31 | #define mic_aligned_size(x) ALIGN(sizeof(x), 8) | ||
32 | 27 | ||
33 | /** | 28 | /** |
34 | * struct mic_device_desc: Virtio device information shared between the | 29 | * struct mic_device_desc: Virtio device information shared between the |
@@ -48,8 +43,8 @@ struct mic_device_desc { | |||
48 | __u8 feature_len; | 43 | __u8 feature_len; |
49 | __u8 config_len; | 44 | __u8 config_len; |
50 | __u8 status; | 45 | __u8 status; |
51 | __u64 config[0]; | 46 | __le64 config[0]; |
52 | } __aligned(8); | 47 | } __attribute__ ((aligned(8))); |
53 | 48 | ||
54 | /** | 49 | /** |
55 | * struct mic_device_ctrl: Per virtio device information in the device page | 50 | * struct mic_device_ctrl: Per virtio device information in the device page |
@@ -66,7 +61,7 @@ struct mic_device_desc { | |||
66 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. | 61 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. |
67 | */ | 62 | */ |
68 | struct mic_device_ctrl { | 63 | struct mic_device_ctrl { |
69 | __u64 vdev; | 64 | __le64 vdev; |
70 | __u8 config_change; | 65 | __u8 config_change; |
71 | __u8 vdev_reset; | 66 | __u8 vdev_reset; |
72 | __u8 guest_ack; | 67 | __u8 guest_ack; |
@@ -74,7 +69,7 @@ struct mic_device_ctrl { | |||
74 | __u8 used_address_updated; | 69 | __u8 used_address_updated; |
75 | __s8 c2h_vdev_db; | 70 | __s8 c2h_vdev_db; |
76 | __s8 h2c_vdev_db; | 71 | __s8 h2c_vdev_db; |
77 | } __aligned(8); | 72 | } __attribute__ ((aligned(8))); |
78 | 73 | ||
79 | /** | 74 | /** |
80 | * struct mic_bootparam: Virtio device independent information in device page | 75 | * struct mic_bootparam: Virtio device independent information in device page |
@@ -87,13 +82,13 @@ struct mic_device_ctrl { | |||
87 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated | 82 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated |
88 | */ | 83 | */ |
89 | struct mic_bootparam { | 84 | struct mic_bootparam { |
90 | __u32 magic; | 85 | __le32 magic; |
91 | __s8 c2h_shutdown_db; | 86 | __s8 c2h_shutdown_db; |
92 | __s8 h2c_shutdown_db; | 87 | __s8 h2c_shutdown_db; |
93 | __s8 h2c_config_db; | 88 | __s8 h2c_config_db; |
94 | __u8 shutdown_status; | 89 | __u8 shutdown_status; |
95 | __u8 shutdown_card; | 90 | __u8 shutdown_card; |
96 | } __aligned(8); | 91 | } __attribute__ ((aligned(8))); |
97 | 92 | ||
98 | /** | 93 | /** |
99 | * struct mic_device_page: High level representation of the device page | 94 | * struct mic_device_page: High level representation of the device page |
@@ -116,10 +111,10 @@ struct mic_device_page { | |||
116 | * @num: The number of entries in the virtio_ring | 111 | * @num: The number of entries in the virtio_ring |
117 | */ | 112 | */ |
118 | struct mic_vqconfig { | 113 | struct mic_vqconfig { |
119 | __u64 address; | 114 | __le64 address; |
120 | __u64 used_address; | 115 | __le64 used_address; |
121 | __u16 num; | 116 | __le16 num; |
122 | } __aligned(8); | 117 | } __attribute__ ((aligned(8))); |
123 | 118 | ||
124 | /* | 119 | /* |
125 | * The alignment to use between consumer and producer parts of vring. | 120 | * The alignment to use between consumer and producer parts of vring. |
@@ -154,7 +149,7 @@ struct mic_vqconfig { | |||
154 | */ | 149 | */ |
155 | struct _mic_vring_info { | 150 | struct _mic_vring_info { |
156 | __u16 avail_idx; | 151 | __u16 avail_idx; |
157 | int magic; | 152 | __le32 magic; |
158 | }; | 153 | }; |
159 | 154 | ||
160 | /** | 155 | /** |
@@ -173,15 +168,13 @@ struct mic_vring { | |||
173 | int len; | 168 | int len; |
174 | }; | 169 | }; |
175 | 170 | ||
176 | #define mic_aligned_desc_size(d) ALIGN(mic_desc_size(d), 8) | 171 | #define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8) |
177 | 172 | ||
178 | #ifndef INTEL_MIC_CARD | 173 | #ifndef INTEL_MIC_CARD |
179 | static inline unsigned mic_desc_size(const struct mic_device_desc *desc) | 174 | static inline unsigned mic_desc_size(const struct mic_device_desc *desc) |
180 | { | 175 | { |
181 | return mic_aligned_size(*desc) | 176 | return sizeof(*desc) + desc->num_vq * sizeof(struct mic_vqconfig) |
182 | + desc->num_vq * mic_aligned_size(struct mic_vqconfig) | 177 | + desc->feature_len * 2 + desc->config_len; |
183 | + desc->feature_len * 2 | ||
184 | + desc->config_len; | ||
185 | } | 178 | } |
186 | 179 | ||
187 | static inline struct mic_vqconfig * | 180 | static inline struct mic_vqconfig * |
@@ -201,8 +194,7 @@ static inline __u8 *mic_vq_configspace(const struct mic_device_desc *desc) | |||
201 | } | 194 | } |
202 | static inline unsigned mic_total_desc_size(struct mic_device_desc *desc) | 195 | static inline unsigned mic_total_desc_size(struct mic_device_desc *desc) |
203 | { | 196 | { |
204 | return mic_aligned_desc_size(desc) + | 197 | return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl); |
205 | mic_aligned_size(struct mic_device_ctrl); | ||
206 | } | 198 | } |
207 | #endif | 199 | #endif |
208 | 200 | ||
diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h index 4e31db4eea41..f2159d30d1f5 100644 --- a/include/uapi/linux/netlink_diag.h +++ b/include/uapi/linux/netlink_diag.h | |||
@@ -33,6 +33,7 @@ struct netlink_diag_ring { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | enum { | 35 | enum { |
36 | /* NETLINK_DIAG_NONE, standard nl API requires this attribute! */ | ||
36 | NETLINK_DIAG_MEMINFO, | 37 | NETLINK_DIAG_MEMINFO, |
37 | NETLINK_DIAG_GROUPS, | 38 | NETLINK_DIAG_GROUPS, |
38 | NETLINK_DIAG_RX_RING, | 39 | NETLINK_DIAG_RX_RING, |
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index b2cc0cd9c4d9..d08c63f3dd6f 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h | |||
@@ -29,6 +29,7 @@ struct packet_diag_msg { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | enum { | 31 | enum { |
32 | /* PACKET_DIAG_NONE, standard nl API requires this attribute! */ | ||
32 | PACKET_DIAG_INFO, | 33 | PACKET_DIAG_INFO, |
33 | PACKET_DIAG_MCLIST, | 34 | PACKET_DIAG_MCLIST, |
34 | PACKET_DIAG_RX_RING, | 35 | PACKET_DIAG_RX_RING, |
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index e1802d6153ae..e244ed412745 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
@@ -679,6 +679,7 @@ enum perf_event_type { | |||
679 | * | 679 | * |
680 | * { u64 weight; } && PERF_SAMPLE_WEIGHT | 680 | * { u64 weight; } && PERF_SAMPLE_WEIGHT |
681 | * { u64 data_src; } && PERF_SAMPLE_DATA_SRC | 681 | * { u64 data_src; } && PERF_SAMPLE_DATA_SRC |
682 | * { u64 transaction; } && PERF_SAMPLE_TRANSACTION | ||
682 | * }; | 683 | * }; |
683 | */ | 684 | */ |
684 | PERF_RECORD_SAMPLE = 9, | 685 | PERF_RECORD_SAMPLE = 9, |
@@ -724,6 +725,7 @@ enum perf_callchain_context { | |||
724 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | 725 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) |
725 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | 726 | #define PERF_FLAG_FD_OUTPUT (1U << 1) |
726 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ | 727 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ |
728 | #define PERF_FLAG_FD_CLOEXEC (1U << 3) /* O_CLOEXEC */ | ||
727 | 729 | ||
728 | union perf_mem_data_src { | 730 | union perf_mem_data_src { |
729 | __u64 val; | 731 | __u64 val; |
diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h index 5a0f945927ac..34f9d7387d13 100644 --- a/include/uapi/linux/sched.h +++ b/include/uapi/linux/sched.h | |||
@@ -39,8 +39,14 @@ | |||
39 | #define SCHED_BATCH 3 | 39 | #define SCHED_BATCH 3 |
40 | /* SCHED_ISO: reserved but not implemented yet */ | 40 | /* SCHED_ISO: reserved but not implemented yet */ |
41 | #define SCHED_IDLE 5 | 41 | #define SCHED_IDLE 5 |
42 | #define SCHED_DEADLINE 6 | ||
43 | |||
42 | /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */ | 44 | /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */ |
43 | #define SCHED_RESET_ON_FORK 0x40000000 | 45 | #define SCHED_RESET_ON_FORK 0x40000000 |
44 | 46 | ||
47 | /* | ||
48 | * For the sched_{set,get}attr() calls | ||
49 | */ | ||
50 | #define SCHED_FLAG_RESET_ON_FORK 0x01 | ||
45 | 51 | ||
46 | #endif /* _UAPI_LINUX_SCHED_H */ | 52 | #endif /* _UAPI_LINUX_SCHED_H */ |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b9e2a6a7446f..1eb0b8dd1830 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
@@ -31,6 +31,7 @@ struct unix_diag_msg { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | enum { | 33 | enum { |
34 | /* UNIX_DIAG_NONE, standard nl API requires this attribute! */ | ||
34 | UNIX_DIAG_NAME, | 35 | UNIX_DIAG_NAME, |
35 | UNIX_DIAG_VFS, | 36 | UNIX_DIAG_VFS, |
36 | UNIX_DIAG_PEER, | 37 | UNIX_DIAG_PEER, |
diff --git a/include/uapi/linux/zorro.h b/include/uapi/linux/zorro.h new file mode 100644 index 000000000000..59d021b242ed --- /dev/null +++ b/include/uapi/linux/zorro.h | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions | ||
3 | * | ||
4 | * Copyright (C) 1995--2003 Geert Uytterhoeven | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file COPYING in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #ifndef _UAPI_LINUX_ZORRO_H | ||
12 | #define _UAPI_LINUX_ZORRO_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | |||
16 | |||
17 | /* | ||
18 | * Each Zorro board has a 32-bit ID of the form | ||
19 | * | ||
20 | * mmmmmmmmmmmmmmmmppppppppeeeeeeee | ||
21 | * | ||
22 | * with | ||
23 | * | ||
24 | * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) | ||
25 | * pppppppp 8-bit Product ID (assigned by manufacturer) | ||
26 | * eeeeeeee 8-bit Extended Product ID (currently only used | ||
27 | * for some GVP boards) | ||
28 | */ | ||
29 | |||
30 | |||
31 | #define ZORRO_MANUF(id) ((id) >> 16) | ||
32 | #define ZORRO_PROD(id) (((id) >> 8) & 0xff) | ||
33 | #define ZORRO_EPC(id) ((id) & 0xff) | ||
34 | |||
35 | #define ZORRO_ID(manuf, prod, epc) \ | ||
36 | ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) | ||
37 | |||
38 | typedef __u32 zorro_id; | ||
39 | |||
40 | |||
41 | /* Include the ID list */ | ||
42 | #include <linux/zorro_ids.h> | ||
43 | |||
44 | |||
45 | /* | ||
46 | * GVP identifies most of its products through the 'extended product code' | ||
47 | * (epc). The epc has to be ANDed with the GVP_PRODMASK before the | ||
48 | * identification. | ||
49 | */ | ||
50 | |||
51 | #define GVP_PRODMASK (0xf8) | ||
52 | #define GVP_SCSICLKMASK (0x01) | ||
53 | |||
54 | enum GVP_flags { | ||
55 | GVP_IO = 0x01, | ||
56 | GVP_ACCEL = 0x02, | ||
57 | GVP_SCSI = 0x04, | ||
58 | GVP_24BITDMA = 0x08, | ||
59 | GVP_25BITDMA = 0x10, | ||
60 | GVP_NOBANK = 0x20, | ||
61 | GVP_14MHZ = 0x40, | ||
62 | }; | ||
63 | |||
64 | |||
65 | struct Node { | ||
66 | __be32 ln_Succ; /* Pointer to next (successor) */ | ||
67 | __be32 ln_Pred; /* Pointer to previous (predecessor) */ | ||
68 | __u8 ln_Type; | ||
69 | __s8 ln_Pri; /* Priority, for sorting */ | ||
70 | __be32 ln_Name; /* ID string, null terminated */ | ||
71 | } __packed; | ||
72 | |||
73 | struct ExpansionRom { | ||
74 | /* -First 16 bytes of the expansion ROM */ | ||
75 | __u8 er_Type; /* Board type, size and flags */ | ||
76 | __u8 er_Product; /* Product number, assigned by manufacturer */ | ||
77 | __u8 er_Flags; /* Flags */ | ||
78 | __u8 er_Reserved03; /* Must be zero ($ff inverted) */ | ||
79 | __be16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ | ||
80 | __be32 er_SerialNumber; /* Available for use by manufacturer */ | ||
81 | __be16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ | ||
82 | __u8 er_Reserved0c; | ||
83 | __u8 er_Reserved0d; | ||
84 | __u8 er_Reserved0e; | ||
85 | __u8 er_Reserved0f; | ||
86 | } __packed; | ||
87 | |||
88 | /* er_Type board type bits */ | ||
89 | #define ERT_TYPEMASK 0xc0 | ||
90 | #define ERT_ZORROII 0xc0 | ||
91 | #define ERT_ZORROIII 0x80 | ||
92 | |||
93 | /* other bits defined in er_Type */ | ||
94 | #define ERTB_MEMLIST 5 /* Link RAM into free memory list */ | ||
95 | #define ERTF_MEMLIST (1<<5) | ||
96 | |||
97 | struct ConfigDev { | ||
98 | struct Node cd_Node; | ||
99 | __u8 cd_Flags; /* (read/write) */ | ||
100 | __u8 cd_Pad; /* reserved */ | ||
101 | struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ | ||
102 | __be32 cd_BoardAddr; /* where in memory the board was placed */ | ||
103 | __be32 cd_BoardSize; /* size of board in bytes */ | ||
104 | __be16 cd_SlotAddr; /* which slot number (PRIVATE) */ | ||
105 | __be16 cd_SlotSize; /* number of slots (PRIVATE) */ | ||
106 | __be32 cd_Driver; /* pointer to node of driver */ | ||
107 | __be32 cd_NextCD; /* linked list of drivers to config */ | ||
108 | __be32 cd_Unused[4]; /* for whatever the driver wants */ | ||
109 | } __packed; | ||
110 | |||
111 | #define ZORRO_NUM_AUTO 16 | ||
112 | |||
113 | #endif /* _UAPI_LINUX_ZORRO_H */ | ||
diff --git a/include/linux/zorro_ids.h b/include/uapi/linux/zorro_ids.h index 74bc53bcfdcf..74bc53bcfdcf 100644 --- a/include/linux/zorro_ids.h +++ b/include/uapi/linux/zorro_ids.h | |||
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h index d630163b9a2e..5759810e1c1b 100644 --- a/include/uapi/sound/compress_offload.h +++ b/include/uapi/sound/compress_offload.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <sound/compress_params.h> | 30 | #include <sound/compress_params.h> |
31 | 31 | ||
32 | 32 | ||
33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 1) | 33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2) |
34 | /** | 34 | /** |
35 | * struct snd_compressed_buffer: compressed buffer | 35 | * struct snd_compressed_buffer: compressed buffer |
36 | * @fragment_size: size of buffer fragment in bytes | 36 | * @fragment_size: size of buffer fragment in bytes |
@@ -67,8 +67,8 @@ struct snd_compr_params { | |||
67 | struct snd_compr_tstamp { | 67 | struct snd_compr_tstamp { |
68 | __u32 byte_offset; | 68 | __u32 byte_offset; |
69 | __u32 copied_total; | 69 | __u32 copied_total; |
70 | snd_pcm_uframes_t pcm_frames; | 70 | __u32 pcm_frames; |
71 | snd_pcm_uframes_t pcm_io_frames; | 71 | __u32 pcm_io_frames; |
72 | __u32 sampling_rate; | 72 | __u32 sampling_rate; |
73 | }; | 73 | }; |
74 | 74 | ||
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h index 602dc6c45d1a..165e7059de75 100644 --- a/include/uapi/sound/compress_params.h +++ b/include/uapi/sound/compress_params.h | |||
@@ -57,6 +57,7 @@ | |||
57 | #define MAX_NUM_CODECS 32 | 57 | #define MAX_NUM_CODECS 32 |
58 | #define MAX_NUM_CODEC_DESCRIPTORS 32 | 58 | #define MAX_NUM_CODEC_DESCRIPTORS 32 |
59 | #define MAX_NUM_BITRATES 32 | 59 | #define MAX_NUM_BITRATES 32 |
60 | #define MAX_NUM_SAMPLE_RATES 32 | ||
60 | 61 | ||
61 | /* Codecs are listed linearly to allow for extensibility */ | 62 | /* Codecs are listed linearly to allow for extensibility */ |
62 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) | 63 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) |
@@ -324,7 +325,8 @@ union snd_codec_options { | |||
324 | 325 | ||
325 | /** struct snd_codec_desc - description of codec capabilities | 326 | /** struct snd_codec_desc - description of codec capabilities |
326 | * @max_ch: Maximum number of audio channels | 327 | * @max_ch: Maximum number of audio channels |
327 | * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this | 328 | * @sample_rates: Sampling rates in Hz, use values like 48000 for this |
329 | * @num_sample_rates: Number of valid values in sample_rates array | ||
328 | * @bit_rate: Indexed array containing supported bit rates | 330 | * @bit_rate: Indexed array containing supported bit rates |
329 | * @num_bitrates: Number of valid values in bit_rate array | 331 | * @num_bitrates: Number of valid values in bit_rate array |
330 | * @rate_control: value is specified by SND_RATECONTROLMODE defines. | 332 | * @rate_control: value is specified by SND_RATECONTROLMODE defines. |
@@ -346,7 +348,8 @@ union snd_codec_options { | |||
346 | 348 | ||
347 | struct snd_codec_desc { | 349 | struct snd_codec_desc { |
348 | __u32 max_ch; | 350 | __u32 max_ch; |
349 | __u32 sample_rates; | 351 | __u32 sample_rates[MAX_NUM_SAMPLE_RATES]; |
352 | __u32 num_sample_rates; | ||
350 | __u32 bit_rate[MAX_NUM_BITRATES]; | 353 | __u32 bit_rate[MAX_NUM_BITRATES]; |
351 | __u32 num_bitrates; | 354 | __u32 num_bitrates; |
352 | __u32 rate_control; | 355 | __u32 rate_control; |
@@ -364,7 +367,8 @@ struct snd_codec_desc { | |||
364 | * @ch_out: Number of output channels. In case of contradiction between | 367 | * @ch_out: Number of output channels. In case of contradiction between |
365 | * this field and the channelMode field, the channelMode field | 368 | * this field and the channelMode field, the channelMode field |
366 | * overrides. | 369 | * overrides. |
367 | * @sample_rate: Audio sample rate of input data | 370 | * @sample_rate: Audio sample rate of input data in Hz, use values like 48000 |
371 | * for this. | ||
368 | * @bit_rate: Bitrate of encoded data. May be ignored by decoders | 372 | * @bit_rate: Bitrate of encoded data. May be ignored by decoders |
369 | * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. | 373 | * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. |
370 | * Encoders may rely on profiles for quality levels. | 374 | * Encoders may rely on profiles for quality levels. |
diff --git a/include/xen/interface/callback.h b/include/xen/interface/callback.h index 8c5fa0e20155..dc3193f4b581 100644 --- a/include/xen/interface/callback.h +++ b/include/xen/interface/callback.h | |||
@@ -36,7 +36,7 @@ | |||
36 | * @extra_args == Operation-specific extra arguments (NULL if none). | 36 | * @extra_args == Operation-specific extra arguments (NULL if none). |
37 | */ | 37 | */ |
38 | 38 | ||
39 | /* ia64, x86: Callback for event delivery. */ | 39 | /* x86: Callback for event delivery. */ |
40 | #define CALLBACKTYPE_event 0 | 40 | #define CALLBACKTYPE_event 0 |
41 | 41 | ||
42 | /* x86: Failsafe callback when guest state cannot be restored by Xen. */ | 42 | /* x86: Failsafe callback when guest state cannot be restored by Xen. */ |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 65e12099ef89..ae665ac59c36 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -146,7 +146,7 @@ struct blkif_request_segment_aligned { | |||
146 | struct blkif_request_rw { | 146 | struct blkif_request_rw { |
147 | uint8_t nr_segments; /* number of segments */ | 147 | uint8_t nr_segments; /* number of segments */ |
148 | blkif_vdev_t handle; /* only for read/write requests */ | 148 | blkif_vdev_t handle; /* only for read/write requests */ |
149 | #ifdef CONFIG_X86_64 | 149 | #ifndef CONFIG_X86_32 |
150 | uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */ | 150 | uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */ |
151 | #endif | 151 | #endif |
152 | uint64_t id; /* private guest value, echoed in resp */ | 152 | uint64_t id; /* private guest value, echoed in resp */ |
@@ -163,7 +163,7 @@ struct blkif_request_discard { | |||
163 | uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ | 163 | uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ |
164 | #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ | 164 | #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ |
165 | blkif_vdev_t _pad1; /* only for read/write requests */ | 165 | blkif_vdev_t _pad1; /* only for read/write requests */ |
166 | #ifdef CONFIG_X86_64 | 166 | #ifndef CONFIG_X86_32 |
167 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ | 167 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ |
168 | #endif | 168 | #endif |
169 | uint64_t id; /* private guest value, echoed in resp */ | 169 | uint64_t id; /* private guest value, echoed in resp */ |
@@ -175,7 +175,7 @@ struct blkif_request_discard { | |||
175 | struct blkif_request_other { | 175 | struct blkif_request_other { |
176 | uint8_t _pad1; | 176 | uint8_t _pad1; |
177 | blkif_vdev_t _pad2; /* only for read/write requests */ | 177 | blkif_vdev_t _pad2; /* only for read/write requests */ |
178 | #ifdef CONFIG_X86_64 | 178 | #ifndef CONFIG_X86_32 |
179 | uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/ | 179 | uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/ |
180 | #endif | 180 | #endif |
181 | uint64_t id; /* private guest value, echoed in resp */ | 181 | uint64_t id; /* private guest value, echoed in resp */ |
@@ -184,7 +184,7 @@ struct blkif_request_other { | |||
184 | struct blkif_request_indirect { | 184 | struct blkif_request_indirect { |
185 | uint8_t indirect_op; | 185 | uint8_t indirect_op; |
186 | uint16_t nr_segments; | 186 | uint16_t nr_segments; |
187 | #ifdef CONFIG_X86_64 | 187 | #ifndef CONFIG_X86_32 |
188 | uint32_t _pad1; /* offsetof(blkif_...,u.indirect.id) == 8 */ | 188 | uint32_t _pad1; /* offsetof(blkif_...,u.indirect.id) == 8 */ |
189 | #endif | 189 | #endif |
190 | uint64_t id; | 190 | uint64_t id; |
@@ -192,7 +192,7 @@ struct blkif_request_indirect { | |||
192 | blkif_vdev_t handle; | 192 | blkif_vdev_t handle; |
193 | uint16_t _pad2; | 193 | uint16_t _pad2; |
194 | grant_ref_t indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST]; | 194 | grant_ref_t indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST]; |
195 | #ifdef CONFIG_X86_64 | 195 | #ifndef CONFIG_X86_32 |
196 | uint32_t _pad3; /* make it 64 byte aligned */ | 196 | uint32_t _pad3; /* make it 64 byte aligned */ |
197 | #else | 197 | #else |
198 | uint64_t _pad3; /* make it 64 byte aligned */ | 198 | uint64_t _pad3; /* make it 64 byte aligned */ |
diff --git a/include/xen/interface/io/protocols.h b/include/xen/interface/io/protocols.h index 056744b4b05e..545a14ba0bb3 100644 --- a/include/xen/interface/io/protocols.h +++ b/include/xen/interface/io/protocols.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi" | 4 | #define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi" |
5 | #define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi" | 5 | #define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi" |
6 | #define XEN_IO_PROTO_ABI_IA64 "ia64-abi" | ||
7 | #define XEN_IO_PROTO_ABI_POWERPC64 "powerpc64-abi" | 6 | #define XEN_IO_PROTO_ABI_POWERPC64 "powerpc64-abi" |
8 | #define XEN_IO_PROTO_ABI_ARM "arm-abi" | 7 | #define XEN_IO_PROTO_ABI_ARM "arm-abi" |
9 | 8 | ||
@@ -11,8 +10,6 @@ | |||
11 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32 | 10 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32 |
12 | #elif defined(__x86_64__) | 11 | #elif defined(__x86_64__) |
13 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64 | 12 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64 |
14 | #elif defined(__ia64__) | ||
15 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64 | ||
16 | #elif defined(__powerpc64__) | 13 | #elif defined(__powerpc64__) |
17 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64 | 14 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64 |
18 | #elif defined(__arm__) || defined(__aarch64__) | 15 | #elif defined(__arm__) || defined(__aarch64__) |