diff options
Diffstat (limited to 'include')
246 files changed, 6591 insertions, 1917 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 4543b6f75867..83062ed0ef2f 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -189,6 +189,8 @@ void acpi_os_fixed_event_count(u32 fixed_event_number); | |||
189 | /* | 189 | /* |
190 | * Threads and Scheduling | 190 | * Threads and Scheduling |
191 | */ | 191 | */ |
192 | extern struct workqueue_struct *kacpi_hotplug_wq; | ||
193 | |||
192 | acpi_thread_id acpi_os_get_thread_id(void); | 194 | acpi_thread_id acpi_os_get_thread_id(void); |
193 | 195 | ||
194 | acpi_status | 196 | acpi_status |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index dfb0ec666c94..84458b0c38d1 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -61,11 +61,12 @@ struct bug_entry { | |||
61 | */ | 61 | */ |
62 | #ifndef __WARN_TAINT | 62 | #ifndef __WARN_TAINT |
63 | #ifndef __ASSEMBLY__ | 63 | #ifndef __ASSEMBLY__ |
64 | extern void warn_slowpath_fmt(const char *file, const int line, | 64 | extern __printf(3, 4) |
65 | const char *fmt, ...) __attribute__((format(printf, 3, 4))); | 65 | void warn_slowpath_fmt(const char *file, const int line, |
66 | extern void warn_slowpath_fmt_taint(const char *file, const int line, | 66 | const char *fmt, ...); |
67 | unsigned taint, const char *fmt, ...) | 67 | extern __printf(4, 5) |
68 | __attribute__((format(printf, 4, 5))); | 68 | void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint, |
69 | const char *fmt, ...); | ||
69 | extern void warn_slowpath_null(const char *file, const int line); | 70 | extern void warn_slowpath_null(const char *file, const int line); |
70 | #define WANT_WARN_ON_SLOWPATH | 71 | #define WANT_WARN_ON_SLOWPATH |
71 | #endif | 72 | #endif |
diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h index 4647c762d970..c084767c88bc 100644 --- a/include/asm-generic/checksum.h +++ b/include/asm-generic/checksum.h | |||
@@ -33,8 +33,10 @@ extern __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum) | |||
33 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, | 33 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
34 | int len, __wsum sum, int *csum_err); | 34 | int len, __wsum sum, int *csum_err); |
35 | 35 | ||
36 | #ifndef csum_partial_copy_nocheck | ||
36 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 37 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ |
37 | csum_partial_copy((src), (dst), (len), (sum)) | 38 | csum_partial_copy((src), (dst), (len), (sum)) |
39 | #endif | ||
38 | 40 | ||
39 | /* | 41 | /* |
40 | * This is a version of ip_compute_csum() optimized for IP headers, | 42 | * This is a version of ip_compute_csum() optimized for IP headers, |
@@ -63,12 +65,14 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, | |||
63 | unsigned short proto, __wsum sum); | 65 | unsigned short proto, __wsum sum); |
64 | #endif | 66 | #endif |
65 | 67 | ||
68 | #ifndef csum_tcpudp_magic | ||
66 | static inline __sum16 | 69 | static inline __sum16 |
67 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, | 70 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
68 | unsigned short proto, __wsum sum) | 71 | unsigned short proto, __wsum sum) |
69 | { | 72 | { |
70 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); | 73 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); |
71 | } | 74 | } |
75 | #endif | ||
72 | 76 | ||
73 | /* | 77 | /* |
74 | * this routine is used for miscellaneous IP-like checksums, mainly | 78 | * this routine is used for miscellaneous IP-like checksums, mainly |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index 0c80bb38773f..9fa3f96e38cf 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h | |||
@@ -123,7 +123,12 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
123 | size_t size, | 123 | size_t size, |
124 | enum dma_data_direction dir) | 124 | enum dma_data_direction dir) |
125 | { | 125 | { |
126 | dma_sync_single_for_cpu(dev, addr + offset, size, dir); | 126 | const struct dma_map_ops *ops = get_dma_ops(dev); |
127 | |||
128 | BUG_ON(!valid_dma_direction(dir)); | ||
129 | if (ops->sync_single_for_cpu) | ||
130 | ops->sync_single_for_cpu(dev, addr + offset, size, dir); | ||
131 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); | ||
127 | } | 132 | } |
128 | 133 | ||
129 | static inline void dma_sync_single_range_for_device(struct device *dev, | 134 | static inline void dma_sync_single_range_for_device(struct device *dev, |
@@ -132,7 +137,12 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
132 | size_t size, | 137 | size_t size, |
133 | enum dma_data_direction dir) | 138 | enum dma_data_direction dir) |
134 | { | 139 | { |
135 | dma_sync_single_for_device(dev, addr + offset, size, dir); | 140 | const struct dma_map_ops *ops = get_dma_ops(dev); |
141 | |||
142 | BUG_ON(!valid_dma_direction(dir)); | ||
143 | if (ops->sync_single_for_device) | ||
144 | ops->sync_single_for_device(dev, addr + offset, size, dir); | ||
145 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); | ||
136 | } | 146 | } |
137 | 147 | ||
138 | static inline void | 148 | static inline void |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index d494001b1226..8c8621097fa0 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -41,6 +41,7 @@ static inline bool gpio_is_valid(int number) | |||
41 | } | 41 | } |
42 | 42 | ||
43 | struct device; | 43 | struct device; |
44 | struct gpio; | ||
44 | struct seq_file; | 45 | struct seq_file; |
45 | struct module; | 46 | struct module; |
46 | struct device_node; | 47 | struct device_node; |
@@ -170,18 +171,6 @@ extern int __gpio_cansleep(unsigned gpio); | |||
170 | 171 | ||
171 | extern int __gpio_to_irq(unsigned gpio); | 172 | extern int __gpio_to_irq(unsigned gpio); |
172 | 173 | ||
173 | /** | ||
174 | * struct gpio - a structure describing a GPIO with configuration | ||
175 | * @gpio: the GPIO number | ||
176 | * @flags: GPIO configuration as specified by GPIOF_* | ||
177 | * @label: a literal description string of this GPIO | ||
178 | */ | ||
179 | struct gpio { | ||
180 | unsigned gpio; | ||
181 | unsigned long flags; | ||
182 | const char *label; | ||
183 | }; | ||
184 | |||
185 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | 174 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); |
186 | extern int gpio_request_array(const struct gpio *array, size_t num); | 175 | extern int gpio_request_array(const struct gpio *array, size_t num); |
187 | extern void gpio_free_array(const struct gpio *array, size_t num); | 176 | extern void gpio_free_array(const struct gpio *array, size_t num); |
@@ -220,13 +209,13 @@ static inline int gpio_cansleep(unsigned gpio) | |||
220 | static inline int gpio_get_value_cansleep(unsigned gpio) | 209 | static inline int gpio_get_value_cansleep(unsigned gpio) |
221 | { | 210 | { |
222 | might_sleep(); | 211 | might_sleep(); |
223 | return gpio_get_value(gpio); | 212 | return __gpio_get_value(gpio); |
224 | } | 213 | } |
225 | 214 | ||
226 | static inline void gpio_set_value_cansleep(unsigned gpio, int value) | 215 | static inline void gpio_set_value_cansleep(unsigned gpio, int value) |
227 | { | 216 | { |
228 | might_sleep(); | 217 | might_sleep(); |
229 | gpio_set_value(gpio, value); | 218 | __gpio_set_value(gpio, value); |
230 | } | 219 | } |
231 | 220 | ||
232 | #endif /* !CONFIG_GPIOLIB */ | 221 | #endif /* !CONFIG_GPIOLIB */ |
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index 75fec18cdc59..351889d1de19 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h | |||
@@ -79,8 +79,8 @@ extern unsigned long memory_end; | |||
79 | #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) | 79 | #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) |
80 | #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) | 80 | #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) |
81 | 81 | ||
82 | #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) | 82 | #define virt_to_page(addr) pfn_to_page(virt_to_pfn(addr)) |
83 | #define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) | 83 | #define page_to_virt(page) pfn_to_virt(page_to_pfn(page)) |
84 | 84 | ||
85 | #ifndef page_to_phys | 85 | #ifndef page_to_phys |
86 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) | 86 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) |
diff --git a/include/asm-generic/rwsem.h b/include/asm-generic/rwsem.h new file mode 100644 index 000000000000..bb1e2cdeb9bf --- /dev/null +++ b/include/asm-generic/rwsem.h | |||
@@ -0,0 +1,132 @@ | |||
1 | #ifndef _ASM_POWERPC_RWSEM_H | ||
2 | #define _ASM_POWERPC_RWSEM_H | ||
3 | |||
4 | #ifndef _LINUX_RWSEM_H | ||
5 | #error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead." | ||
6 | #endif | ||
7 | |||
8 | #ifdef __KERNEL__ | ||
9 | |||
10 | /* | ||
11 | * R/W semaphores for PPC using the stuff in lib/rwsem.c. | ||
12 | * Adapted largely from include/asm-i386/rwsem.h | ||
13 | * by Paul Mackerras <paulus@samba.org>. | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * the semaphore definition | ||
18 | */ | ||
19 | #ifdef CONFIG_PPC64 | ||
20 | # define RWSEM_ACTIVE_MASK 0xffffffffL | ||
21 | #else | ||
22 | # define RWSEM_ACTIVE_MASK 0x0000ffffL | ||
23 | #endif | ||
24 | |||
25 | #define RWSEM_UNLOCKED_VALUE 0x00000000L | ||
26 | #define RWSEM_ACTIVE_BIAS 0x00000001L | ||
27 | #define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1) | ||
28 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS | ||
29 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | ||
30 | |||
31 | /* | ||
32 | * lock for reading | ||
33 | */ | ||
34 | static inline void __down_read(struct rw_semaphore *sem) | ||
35 | { | ||
36 | if (unlikely(atomic_long_inc_return((atomic_long_t *)&sem->count) <= 0)) | ||
37 | rwsem_down_read_failed(sem); | ||
38 | } | ||
39 | |||
40 | static inline int __down_read_trylock(struct rw_semaphore *sem) | ||
41 | { | ||
42 | long tmp; | ||
43 | |||
44 | while ((tmp = sem->count) >= 0) { | ||
45 | if (tmp == cmpxchg(&sem->count, tmp, | ||
46 | tmp + RWSEM_ACTIVE_READ_BIAS)) { | ||
47 | return 1; | ||
48 | } | ||
49 | } | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | /* | ||
54 | * lock for writing | ||
55 | */ | ||
56 | static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) | ||
57 | { | ||
58 | long tmp; | ||
59 | |||
60 | tmp = atomic_long_add_return(RWSEM_ACTIVE_WRITE_BIAS, | ||
61 | (atomic_long_t *)&sem->count); | ||
62 | if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS)) | ||
63 | rwsem_down_write_failed(sem); | ||
64 | } | ||
65 | |||
66 | static inline void __down_write(struct rw_semaphore *sem) | ||
67 | { | ||
68 | __down_write_nested(sem, 0); | ||
69 | } | ||
70 | |||
71 | static inline int __down_write_trylock(struct rw_semaphore *sem) | ||
72 | { | ||
73 | long tmp; | ||
74 | |||
75 | tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, | ||
76 | RWSEM_ACTIVE_WRITE_BIAS); | ||
77 | return tmp == RWSEM_UNLOCKED_VALUE; | ||
78 | } | ||
79 | |||
80 | /* | ||
81 | * unlock after reading | ||
82 | */ | ||
83 | static inline void __up_read(struct rw_semaphore *sem) | ||
84 | { | ||
85 | long tmp; | ||
86 | |||
87 | tmp = atomic_long_dec_return((atomic_long_t *)&sem->count); | ||
88 | if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)) | ||
89 | rwsem_wake(sem); | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * unlock after writing | ||
94 | */ | ||
95 | static inline void __up_write(struct rw_semaphore *sem) | ||
96 | { | ||
97 | if (unlikely(atomic_long_sub_return(RWSEM_ACTIVE_WRITE_BIAS, | ||
98 | (atomic_long_t *)&sem->count) < 0)) | ||
99 | rwsem_wake(sem); | ||
100 | } | ||
101 | |||
102 | /* | ||
103 | * implement atomic add functionality | ||
104 | */ | ||
105 | static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem) | ||
106 | { | ||
107 | atomic_long_add(delta, (atomic_long_t *)&sem->count); | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | * downgrade write lock to read lock | ||
112 | */ | ||
113 | static inline void __downgrade_write(struct rw_semaphore *sem) | ||
114 | { | ||
115 | long tmp; | ||
116 | |||
117 | tmp = atomic_long_add_return(-RWSEM_WAITING_BIAS, | ||
118 | (atomic_long_t *)&sem->count); | ||
119 | if (tmp < 0) | ||
120 | rwsem_downgrade_wake(sem); | ||
121 | } | ||
122 | |||
123 | /* | ||
124 | * implement exchange and add functionality | ||
125 | */ | ||
126 | static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) | ||
127 | { | ||
128 | return atomic_long_add_return(delta, (atomic_long_t *)&sem->count); | ||
129 | } | ||
130 | |||
131 | #endif /* __KERNEL__ */ | ||
132 | #endif /* _ASM_POWERPC_RWSEM_H */ | ||
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 59c3e5bd2c06..ecc721def10c 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/crypto.h> | 15 | #include <linux/crypto.h> |
16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/skbuff.h> | ||
18 | 19 | ||
19 | struct module; | 20 | struct module; |
20 | struct rtattr; | 21 | struct rtattr; |
@@ -26,6 +27,7 @@ struct crypto_type { | |||
26 | int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); | 27 | int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); |
27 | int (*init_tfm)(struct crypto_tfm *tfm); | 28 | int (*init_tfm)(struct crypto_tfm *tfm); |
28 | void (*show)(struct seq_file *m, struct crypto_alg *alg); | 29 | void (*show)(struct seq_file *m, struct crypto_alg *alg); |
30 | int (*report)(struct sk_buff *skb, struct crypto_alg *alg); | ||
29 | struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); | 31 | struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); |
30 | 32 | ||
31 | unsigned int type; | 33 | unsigned int type; |
diff --git a/include/crypto/blowfish.h b/include/crypto/blowfish.h new file mode 100644 index 000000000000..1450d4a27980 --- /dev/null +++ b/include/crypto/blowfish.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Common values for blowfish algorithms | ||
3 | */ | ||
4 | |||
5 | #ifndef _CRYPTO_BLOWFISH_H | ||
6 | #define _CRYPTO_BLOWFISH_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | #include <linux/crypto.h> | ||
10 | |||
11 | #define BF_BLOCK_SIZE 8 | ||
12 | #define BF_MIN_KEY_SIZE 4 | ||
13 | #define BF_MAX_KEY_SIZE 56 | ||
14 | |||
15 | struct bf_ctx { | ||
16 | u32 p[18]; | ||
17 | u32 s[1024]; | ||
18 | }; | ||
19 | |||
20 | int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key, | ||
21 | unsigned int key_len); | ||
22 | |||
23 | #endif | ||
diff --git a/include/crypto/sha.h b/include/crypto/sha.h index 069e85ba97e1..c6c9c1fe460c 100644 --- a/include/crypto/sha.h +++ b/include/crypto/sha.h | |||
@@ -82,4 +82,9 @@ struct sha512_state { | |||
82 | u8 buf[SHA512_BLOCK_SIZE]; | 82 | u8 buf[SHA512_BLOCK_SIZE]; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | struct shash_desc; | ||
86 | |||
87 | extern int crypto_sha1_update(struct shash_desc *desc, const u8 *data, | ||
88 | unsigned int len); | ||
89 | |||
85 | #endif | 90 | #endif |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 9b7c2bb4bb44..cf3b446139ea 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -122,12 +122,12 @@ struct drm_device; | |||
122 | * using the DRM_DEBUG_KMS and DRM_DEBUG. | 122 | * using the DRM_DEBUG_KMS and DRM_DEBUG. |
123 | */ | 123 | */ |
124 | 124 | ||
125 | extern __attribute__((format (printf, 4, 5))) | 125 | extern __printf(4, 5) |
126 | void drm_ut_debug_printk(unsigned int request_level, | 126 | void drm_ut_debug_printk(unsigned int request_level, |
127 | const char *prefix, | 127 | const char *prefix, |
128 | const char *function_name, | 128 | const char *function_name, |
129 | const char *format, ...); | 129 | const char *format, ...); |
130 | extern __attribute__((format (printf, 2, 3))) | 130 | extern __printf(2, 3) |
131 | int drm_err(const char *func, const char *format, ...); | 131 | int drm_err(const char *func, const char *format, ...); |
132 | 132 | ||
133 | /***********************************************************************/ | 133 | /***********************************************************************/ |
@@ -1624,6 +1624,9 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) | |||
1624 | drm_gem_object_unreference_unlocked(obj); | 1624 | drm_gem_object_unreference_unlocked(obj); |
1625 | } | 1625 | } |
1626 | 1626 | ||
1627 | void drm_gem_free_mmap_offset(struct drm_gem_object *obj); | ||
1628 | int drm_gem_create_mmap_offset(struct drm_gem_object *obj); | ||
1629 | |||
1627 | struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, | 1630 | struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, |
1628 | struct drm_file *filp, | 1631 | struct drm_file *filp, |
1629 | u32 handle); | 1632 | u32 handle); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 44335e57eaaa..802079809282 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -466,6 +466,8 @@ enum drm_connector_force { | |||
466 | /* DACs should rarely do this without a lot of testing */ | 466 | /* DACs should rarely do this without a lot of testing */ |
467 | #define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) | 467 | #define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) |
468 | 468 | ||
469 | #define MAX_ELD_BYTES 128 | ||
470 | |||
469 | /** | 471 | /** |
470 | * drm_connector - central DRM connector control structure | 472 | * drm_connector - central DRM connector control structure |
471 | * @crtc: CRTC this connector is currently connected to, NULL if none | 473 | * @crtc: CRTC this connector is currently connected to, NULL if none |
@@ -523,6 +525,13 @@ struct drm_connector { | |||
523 | uint32_t force_encoder_id; | 525 | uint32_t force_encoder_id; |
524 | struct drm_encoder *encoder; /* currently active encoder */ | 526 | struct drm_encoder *encoder; /* currently active encoder */ |
525 | 527 | ||
528 | /* EDID bits */ | ||
529 | uint8_t eld[MAX_ELD_BYTES]; | ||
530 | bool dvi_dual; | ||
531 | int max_tmds_clock; /* in MHz */ | ||
532 | bool latency_present[2]; | ||
533 | int video_latency[2]; /* [0]: progressive, [1]: interlaced */ | ||
534 | int audio_latency[2]; | ||
526 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ | 535 | int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ |
527 | }; | 536 | }; |
528 | 537 | ||
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 91567bbdb027..0d2f727e96be 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
@@ -74,6 +74,20 @@ | |||
74 | 74 | ||
75 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e | 75 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e |
76 | 76 | ||
77 | #define DP_PSR_SUPPORT 0x070 | ||
78 | # define DP_PSR_IS_SUPPORTED 1 | ||
79 | #define DP_PSR_CAPS 0x071 | ||
80 | # define DP_PSR_NO_TRAIN_ON_EXIT 1 | ||
81 | # define DP_PSR_SETUP_TIME_330 (0 << 1) | ||
82 | # define DP_PSR_SETUP_TIME_275 (1 << 1) | ||
83 | # define DP_PSR_SETUP_TIME_220 (2 << 1) | ||
84 | # define DP_PSR_SETUP_TIME_165 (3 << 1) | ||
85 | # define DP_PSR_SETUP_TIME_110 (4 << 1) | ||
86 | # define DP_PSR_SETUP_TIME_55 (5 << 1) | ||
87 | # define DP_PSR_SETUP_TIME_0 (6 << 1) | ||
88 | # define DP_PSR_SETUP_TIME_MASK (7 << 1) | ||
89 | # define DP_PSR_SETUP_TIME_SHIFT 1 | ||
90 | |||
77 | /* link configuration */ | 91 | /* link configuration */ |
78 | #define DP_LINK_BW_SET 0x100 | 92 | #define DP_LINK_BW_SET 0x100 |
79 | # define DP_LINK_BW_1_62 0x06 | 93 | # define DP_LINK_BW_1_62 0x06 |
@@ -133,6 +147,18 @@ | |||
133 | #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 | 147 | #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 |
134 | # define DP_SET_ANSI_8B10B (1 << 0) | 148 | # define DP_SET_ANSI_8B10B (1 << 0) |
135 | 149 | ||
150 | #define DP_PSR_EN_CFG 0x170 | ||
151 | # define DP_PSR_ENABLE (1 << 0) | ||
152 | # define DP_PSR_MAIN_LINK_ACTIVE (1 << 1) | ||
153 | # define DP_PSR_CRC_VERIFICATION (1 << 2) | ||
154 | # define DP_PSR_FRAME_CAPTURE (1 << 3) | ||
155 | |||
156 | #define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201 | ||
157 | # define DP_REMOTE_CONTROL_COMMAND_PENDING (1 << 0) | ||
158 | # define DP_AUTOMATED_TEST_REQUEST (1 << 1) | ||
159 | # define DP_CP_IRQ (1 << 2) | ||
160 | # define DP_SINK_SPECIFIC_IRQ (1 << 6) | ||
161 | |||
136 | #define DP_LANE0_1_STATUS 0x202 | 162 | #define DP_LANE0_1_STATUS 0x202 |
137 | #define DP_LANE2_3_STATUS 0x203 | 163 | #define DP_LANE2_3_STATUS 0x203 |
138 | # define DP_LANE_CR_DONE (1 << 0) | 164 | # define DP_LANE_CR_DONE (1 << 0) |
@@ -165,10 +191,45 @@ | |||
165 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 | 191 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 |
166 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 | 192 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 |
167 | 193 | ||
194 | #define DP_TEST_REQUEST 0x218 | ||
195 | # define DP_TEST_LINK_TRAINING (1 << 0) | ||
196 | # define DP_TEST_LINK_PATTERN (1 << 1) | ||
197 | # define DP_TEST_LINK_EDID_READ (1 << 2) | ||
198 | # define DP_TEST_LINK_PHY_TEST_PATTERN (1 << 3) /* DPCD >= 1.1 */ | ||
199 | |||
200 | #define DP_TEST_LINK_RATE 0x219 | ||
201 | # define DP_LINK_RATE_162 (0x6) | ||
202 | # define DP_LINK_RATE_27 (0xa) | ||
203 | |||
204 | #define DP_TEST_LANE_COUNT 0x220 | ||
205 | |||
206 | #define DP_TEST_PATTERN 0x221 | ||
207 | |||
208 | #define DP_TEST_RESPONSE 0x260 | ||
209 | # define DP_TEST_ACK (1 << 0) | ||
210 | # define DP_TEST_NAK (1 << 1) | ||
211 | # define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) | ||
212 | |||
168 | #define DP_SET_POWER 0x600 | 213 | #define DP_SET_POWER 0x600 |
169 | # define DP_SET_POWER_D0 0x1 | 214 | # define DP_SET_POWER_D0 0x1 |
170 | # define DP_SET_POWER_D3 0x2 | 215 | # define DP_SET_POWER_D3 0x2 |
171 | 216 | ||
217 | #define DP_PSR_ERROR_STATUS 0x2006 | ||
218 | # define DP_PSR_LINK_CRC_ERROR (1 << 0) | ||
219 | # define DP_PSR_RFB_STORAGE_ERROR (1 << 1) | ||
220 | |||
221 | #define DP_PSR_ESI 0x2007 | ||
222 | # define DP_PSR_CAPS_CHANGE (1 << 0) | ||
223 | |||
224 | #define DP_PSR_STATUS 0x2008 | ||
225 | # define DP_PSR_SINK_INACTIVE 0 | ||
226 | # define DP_PSR_SINK_ACTIVE_SRC_SYNCED 1 | ||
227 | # define DP_PSR_SINK_ACTIVE_RFB 2 | ||
228 | # define DP_PSR_SINK_ACTIVE_SINK_SYNCED 3 | ||
229 | # define DP_PSR_SINK_ACTIVE_RESYNC 4 | ||
230 | # define DP_PSR_SINK_INTERNAL_ERROR 7 | ||
231 | # define DP_PSR_SINK_STATE_MASK 0x07 | ||
232 | |||
172 | #define MODE_I2C_START 1 | 233 | #define MODE_I2C_START 1 |
173 | #define MODE_I2C_WRITE 2 | 234 | #define MODE_I2C_WRITE 2 |
174 | #define MODE_I2C_READ 4 | 235 | #define MODE_I2C_READ 4 |
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index eacb415b309a..74ce91684629 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
@@ -230,4 +230,13 @@ struct edid { | |||
230 | 230 | ||
231 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) | 231 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) |
232 | 232 | ||
233 | struct drm_encoder; | ||
234 | struct drm_connector; | ||
235 | struct drm_display_mode; | ||
236 | void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); | ||
237 | int drm_av_sync_delay(struct drm_connector *connector, | ||
238 | struct drm_display_mode *mode); | ||
239 | struct drm_connector *drm_select_eld(struct drm_encoder *encoder, | ||
240 | struct drm_display_mode *mode); | ||
241 | |||
233 | #endif /* __DRM_EDID_H__ */ | 242 | #endif /* __DRM_EDID_H__ */ |
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h new file mode 100644 index 000000000000..874c4d271328 --- /dev/null +++ b/include/drm/exynos_drm.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* exynos_drm.h | ||
2 | * | ||
3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
4 | * Authors: | ||
5 | * Inki Dae <inki.dae@samsung.com> | ||
6 | * Joonyoung Shim <jy0922.shim@samsung.com> | ||
7 | * Seung-Woo Kim <sw0312.kim@samsung.com> | ||
8 | * | ||
9 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
10 | * copy of this software and associated documentation files (the "Software"), | ||
11 | * to deal in the Software without restriction, including without limitation | ||
12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
13 | * and/or sell copies of the Software, and to permit persons to whom the | ||
14 | * Software is furnished to do so, subject to the following conditions: | ||
15 | * | ||
16 | * The above copyright notice and this permission notice (including the next | ||
17 | * paragraph) shall be included in all copies or substantial portions of the | ||
18 | * Software. | ||
19 | * | ||
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
23 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
24 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
25 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
26 | * OTHER DEALINGS IN THE SOFTWARE. | ||
27 | */ | ||
28 | |||
29 | #ifndef _EXYNOS_DRM_H_ | ||
30 | #define _EXYNOS_DRM_H_ | ||
31 | |||
32 | /** | ||
33 | * User-desired buffer creation information structure. | ||
34 | * | ||
35 | * @size: requested size for the object. | ||
36 | * - this size value would be page-aligned internally. | ||
37 | * @flags: user request for setting memory type or cache attributes. | ||
38 | * @handle: returned handle for the object. | ||
39 | */ | ||
40 | struct drm_exynos_gem_create { | ||
41 | unsigned int size; | ||
42 | unsigned int flags; | ||
43 | unsigned int handle; | ||
44 | }; | ||
45 | |||
46 | /** | ||
47 | * A structure for getting buffer offset. | ||
48 | * | ||
49 | * @handle: a pointer to gem object created. | ||
50 | * @pad: just padding to be 64-bit aligned. | ||
51 | * @offset: relatived offset value of the memory region allocated. | ||
52 | * - this value should be set by user. | ||
53 | */ | ||
54 | struct drm_exynos_gem_map_off { | ||
55 | unsigned int handle; | ||
56 | unsigned int pad; | ||
57 | uint64_t offset; | ||
58 | }; | ||
59 | |||
60 | /** | ||
61 | * A structure for mapping buffer. | ||
62 | * | ||
63 | * @handle: a handle to gem object created. | ||
64 | * @size: memory size to be mapped. | ||
65 | * @mapped: having user virtual address mmaped. | ||
66 | * - this variable would be filled by exynos gem module | ||
67 | * of kernel side with user virtual address which is allocated | ||
68 | * by do_mmap(). | ||
69 | */ | ||
70 | struct drm_exynos_gem_mmap { | ||
71 | unsigned int handle; | ||
72 | unsigned int size; | ||
73 | uint64_t mapped; | ||
74 | }; | ||
75 | |||
76 | #define DRM_EXYNOS_GEM_CREATE 0x00 | ||
77 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 | ||
78 | #define DRM_EXYNOS_GEM_MMAP 0x02 | ||
79 | |||
80 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ | ||
81 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) | ||
82 | |||
83 | #define DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \ | ||
84 | DRM_EXYNOS_GEM_MAP_OFFSET, struct drm_exynos_gem_map_off) | ||
85 | |||
86 | #define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \ | ||
87 | DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap) | ||
88 | |||
89 | /** | ||
90 | * Platform Specific Structure for DRM based FIMD. | ||
91 | * | ||
92 | * @timing: default video mode for initializing | ||
93 | * @default_win: default window layer number to be used for UI. | ||
94 | * @bpp: default bit per pixel. | ||
95 | */ | ||
96 | struct exynos_drm_fimd_pdata { | ||
97 | struct fb_videomode timing; | ||
98 | u32 vidcon0; | ||
99 | u32 vidcon1; | ||
100 | unsigned int default_win; | ||
101 | unsigned int bpp; | ||
102 | }; | ||
103 | |||
104 | #endif | ||
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index 9e343c0998b4..b174620cc9b3 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h | |||
@@ -13,6 +13,8 @@ const struct intel_gtt { | |||
13 | unsigned int gtt_mappable_entries; | 13 | unsigned int gtt_mappable_entries; |
14 | /* Whether i915 needs to use the dmar apis or not. */ | 14 | /* Whether i915 needs to use the dmar apis or not. */ |
15 | unsigned int needs_dmar : 1; | 15 | unsigned int needs_dmar : 1; |
16 | /* Whether we idle the gpu before mapping/unmapping */ | ||
17 | unsigned int do_idle_maps : 1; | ||
16 | } *intel_gtt_get(void); | 18 | } *intel_gtt_get(void); |
17 | 19 | ||
18 | void intel_gtt_chipset_flush(void); | 20 | void intel_gtt_chipset_flush(void); |
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h index 5c36432d9ce5..cd7cd8162ed6 100644 --- a/include/drm/vmwgfx_drm.h +++ b/include/drm/vmwgfx_drm.h | |||
@@ -31,7 +31,6 @@ | |||
31 | #define DRM_VMW_MAX_SURFACE_FACES 6 | 31 | #define DRM_VMW_MAX_SURFACE_FACES 6 |
32 | #define DRM_VMW_MAX_MIP_LEVELS 24 | 32 | #define DRM_VMW_MAX_MIP_LEVELS 24 |
33 | 33 | ||
34 | #define DRM_VMW_EXT_NAME_LEN 128 | ||
35 | 34 | ||
36 | #define DRM_VMW_GET_PARAM 0 | 35 | #define DRM_VMW_GET_PARAM 0 |
37 | #define DRM_VMW_ALLOC_DMABUF 1 | 36 | #define DRM_VMW_ALLOC_DMABUF 1 |
@@ -48,10 +47,13 @@ | |||
48 | #define DRM_VMW_UNREF_SURFACE 10 | 47 | #define DRM_VMW_UNREF_SURFACE 10 |
49 | #define DRM_VMW_REF_SURFACE 11 | 48 | #define DRM_VMW_REF_SURFACE 11 |
50 | #define DRM_VMW_EXECBUF 12 | 49 | #define DRM_VMW_EXECBUF 12 |
51 | #define DRM_VMW_FIFO_DEBUG 13 | 50 | #define DRM_VMW_GET_3D_CAP 13 |
52 | #define DRM_VMW_FENCE_WAIT 14 | 51 | #define DRM_VMW_FENCE_WAIT 14 |
53 | /* guarded by minor version >= 2 */ | 52 | #define DRM_VMW_FENCE_SIGNALED 15 |
54 | #define DRM_VMW_UPDATE_LAYOUT 15 | 53 | #define DRM_VMW_FENCE_UNREF 16 |
54 | #define DRM_VMW_FENCE_EVENT 17 | ||
55 | #define DRM_VMW_PRESENT 18 | ||
56 | #define DRM_VMW_PRESENT_READBACK 19 | ||
55 | 57 | ||
56 | 58 | ||
57 | /*************************************************************************/ | 59 | /*************************************************************************/ |
@@ -69,10 +71,10 @@ | |||
69 | #define DRM_VMW_PARAM_NUM_STREAMS 0 | 71 | #define DRM_VMW_PARAM_NUM_STREAMS 0 |
70 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 | 72 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 |
71 | #define DRM_VMW_PARAM_3D 2 | 73 | #define DRM_VMW_PARAM_3D 2 |
72 | #define DRM_VMW_PARAM_FIFO_OFFSET 3 | 74 | #define DRM_VMW_PARAM_HW_CAPS 3 |
73 | #define DRM_VMW_PARAM_HW_CAPS 4 | 75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 |
74 | #define DRM_VMW_PARAM_FIFO_CAPS 5 | 76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 |
75 | #define DRM_VMW_PARAM_MAX_FB_SIZE 6 | 77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 |
76 | 78 | ||
77 | /** | 79 | /** |
78 | * struct drm_vmw_getparam_arg | 80 | * struct drm_vmw_getparam_arg |
@@ -91,49 +93,6 @@ struct drm_vmw_getparam_arg { | |||
91 | 93 | ||
92 | /*************************************************************************/ | 94 | /*************************************************************************/ |
93 | /** | 95 | /** |
94 | * DRM_VMW_EXTENSION - Query device extensions. | ||
95 | */ | ||
96 | |||
97 | /** | ||
98 | * struct drm_vmw_extension_rep | ||
99 | * | ||
100 | * @exists: The queried extension exists. | ||
101 | * @driver_ioctl_offset: Ioctl number of the first ioctl in the extension. | ||
102 | * @driver_sarea_offset: Offset to any space in the DRI SAREA | ||
103 | * used by the extension. | ||
104 | * @major: Major version number of the extension. | ||
105 | * @minor: Minor version number of the extension. | ||
106 | * @pl: Patch level version number of the extension. | ||
107 | * | ||
108 | * Output argument to the DRM_VMW_EXTENSION Ioctl. | ||
109 | */ | ||
110 | |||
111 | struct drm_vmw_extension_rep { | ||
112 | int32_t exists; | ||
113 | uint32_t driver_ioctl_offset; | ||
114 | uint32_t driver_sarea_offset; | ||
115 | uint32_t major; | ||
116 | uint32_t minor; | ||
117 | uint32_t pl; | ||
118 | uint32_t pad64; | ||
119 | }; | ||
120 | |||
121 | /** | ||
122 | * union drm_vmw_extension_arg | ||
123 | * | ||
124 | * @extension - Ascii name of the extension to be queried. //In | ||
125 | * @rep - Reply as defined above. //Out | ||
126 | * | ||
127 | * Argument to the DRM_VMW_EXTENSION Ioctl. | ||
128 | */ | ||
129 | |||
130 | union drm_vmw_extension_arg { | ||
131 | char extension[DRM_VMW_EXT_NAME_LEN]; | ||
132 | struct drm_vmw_extension_rep rep; | ||
133 | }; | ||
134 | |||
135 | /*************************************************************************/ | ||
136 | /** | ||
137 | * DRM_VMW_CREATE_CONTEXT - Create a host context. | 96 | * DRM_VMW_CREATE_CONTEXT - Create a host context. |
138 | * | 97 | * |
139 | * Allocates a device unique context id, and queues a create context command | 98 | * Allocates a device unique context id, and queues a create context command |
@@ -292,7 +251,7 @@ union drm_vmw_surface_reference_arg { | |||
292 | * DRM_VMW_EXECBUF | 251 | * DRM_VMW_EXECBUF |
293 | * | 252 | * |
294 | * Submit a command buffer for execution on the host, and return a | 253 | * Submit a command buffer for execution on the host, and return a |
295 | * fence sequence that when signaled, indicates that the command buffer has | 254 | * fence seqno that when signaled, indicates that the command buffer has |
296 | * executed. | 255 | * executed. |
297 | */ | 256 | */ |
298 | 257 | ||
@@ -314,21 +273,30 @@ union drm_vmw_surface_reference_arg { | |||
314 | * Argument to the DRM_VMW_EXECBUF Ioctl. | 273 | * Argument to the DRM_VMW_EXECBUF Ioctl. |
315 | */ | 274 | */ |
316 | 275 | ||
317 | #define DRM_VMW_EXECBUF_VERSION 0 | 276 | #define DRM_VMW_EXECBUF_VERSION 1 |
318 | 277 | ||
319 | struct drm_vmw_execbuf_arg { | 278 | struct drm_vmw_execbuf_arg { |
320 | uint64_t commands; | 279 | uint64_t commands; |
321 | uint32_t command_size; | 280 | uint32_t command_size; |
322 | uint32_t throttle_us; | 281 | uint32_t throttle_us; |
323 | uint64_t fence_rep; | 282 | uint64_t fence_rep; |
324 | uint32_t version; | 283 | uint32_t version; |
325 | uint32_t flags; | 284 | uint32_t flags; |
326 | }; | 285 | }; |
327 | 286 | ||
328 | /** | 287 | /** |
329 | * struct drm_vmw_fence_rep | 288 | * struct drm_vmw_fence_rep |
330 | * | 289 | * |
331 | * @fence_seq: Fence sequence associated with a command submission. | 290 | * @handle: Fence object handle for fence associated with a command submission. |
291 | * @mask: Fence flags relevant for this fence object. | ||
292 | * @seqno: Fence sequence number in fifo. A fence object with a lower | ||
293 | * seqno will signal the EXEC flag before a fence object with a higher | ||
294 | * seqno. This can be used by user-space to avoid kernel calls to determine | ||
295 | * whether a fence has signaled the EXEC flag. Note that @seqno will | ||
296 | * wrap at 32-bit. | ||
297 | * @passed_seqno: The highest seqno number processed by the hardware | ||
298 | * so far. This can be used to mark user-space fence objects as signaled, and | ||
299 | * to determine whether a fence seqno might be stale. | ||
332 | * @error: This member should've been set to -EFAULT on submission. | 300 | * @error: This member should've been set to -EFAULT on submission. |
333 | * The following actions should be take on completion: | 301 | * The following actions should be take on completion: |
334 | * error == -EFAULT: Fence communication failed. The host is synchronized. | 302 | * error == -EFAULT: Fence communication failed. The host is synchronized. |
@@ -342,9 +310,12 @@ struct drm_vmw_execbuf_arg { | |||
342 | */ | 310 | */ |
343 | 311 | ||
344 | struct drm_vmw_fence_rep { | 312 | struct drm_vmw_fence_rep { |
345 | uint64_t fence_seq; | 313 | uint32_t handle; |
346 | int32_t error; | 314 | uint32_t mask; |
315 | uint32_t seqno; | ||
316 | uint32_t passed_seqno; | ||
347 | uint32_t pad64; | 317 | uint32_t pad64; |
318 | int32_t error; | ||
348 | }; | 319 | }; |
349 | 320 | ||
350 | /*************************************************************************/ | 321 | /*************************************************************************/ |
@@ -435,39 +406,6 @@ struct drm_vmw_unref_dmabuf_arg { | |||
435 | 406 | ||
436 | /*************************************************************************/ | 407 | /*************************************************************************/ |
437 | /** | 408 | /** |
438 | * DRM_VMW_FIFO_DEBUG - Get last FIFO submission. | ||
439 | * | ||
440 | * This IOCTL copies the last FIFO submission directly out of the FIFO buffer. | ||
441 | */ | ||
442 | |||
443 | /** | ||
444 | * struct drm_vmw_fifo_debug_arg | ||
445 | * | ||
446 | * @debug_buffer: User space address of a debug_buffer cast to an uint64_t //In | ||
447 | * @debug_buffer_size: Size in bytes of debug buffer //In | ||
448 | * @used_size: Number of bytes copied to the buffer // Out | ||
449 | * @did_not_fit: Boolean indicating that the fifo contents did not fit. //Out | ||
450 | * | ||
451 | * Argument to the DRM_VMW_FIFO_DEBUG Ioctl. | ||
452 | */ | ||
453 | |||
454 | struct drm_vmw_fifo_debug_arg { | ||
455 | uint64_t debug_buffer; | ||
456 | uint32_t debug_buffer_size; | ||
457 | uint32_t used_size; | ||
458 | int32_t did_not_fit; | ||
459 | uint32_t pad64; | ||
460 | }; | ||
461 | |||
462 | struct drm_vmw_fence_wait_arg { | ||
463 | uint64_t sequence; | ||
464 | uint64_t kernel_cookie; | ||
465 | int32_t cookie_valid; | ||
466 | int32_t pad64; | ||
467 | }; | ||
468 | |||
469 | /*************************************************************************/ | ||
470 | /** | ||
471 | * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. | 409 | * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. |
472 | * | 410 | * |
473 | * This IOCTL controls the overlay units of the svga device. | 411 | * This IOCTL controls the overlay units of the svga device. |
@@ -590,6 +528,30 @@ struct drm_vmw_stream_arg { | |||
590 | 528 | ||
591 | /*************************************************************************/ | 529 | /*************************************************************************/ |
592 | /** | 530 | /** |
531 | * DRM_VMW_GET_3D_CAP | ||
532 | * | ||
533 | * Read 3D capabilities from the FIFO | ||
534 | * | ||
535 | */ | ||
536 | |||
537 | /** | ||
538 | * struct drm_vmw_get_3d_cap_arg | ||
539 | * | ||
540 | * @buffer: Pointer to a buffer for capability data, cast to an uint64_t | ||
541 | * @size: Max size to copy | ||
542 | * | ||
543 | * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL | ||
544 | * ioctls. | ||
545 | */ | ||
546 | |||
547 | struct drm_vmw_get_3d_cap_arg { | ||
548 | uint64_t buffer; | ||
549 | uint32_t max_size; | ||
550 | uint32_t pad64; | ||
551 | }; | ||
552 | |||
553 | /*************************************************************************/ | ||
554 | /** | ||
593 | * DRM_VMW_UPDATE_LAYOUT - Update layout | 555 | * DRM_VMW_UPDATE_LAYOUT - Update layout |
594 | * | 556 | * |
595 | * Updates the preferred modes and connection status for connectors. The | 557 | * Updates the preferred modes and connection status for connectors. The |
@@ -612,4 +574,218 @@ struct drm_vmw_update_layout_arg { | |||
612 | uint64_t rects; | 574 | uint64_t rects; |
613 | }; | 575 | }; |
614 | 576 | ||
577 | |||
578 | /*************************************************************************/ | ||
579 | /** | ||
580 | * DRM_VMW_FENCE_WAIT | ||
581 | * | ||
582 | * Waits for a fence object to signal. The wait is interruptible, so that | ||
583 | * signals may be delivered during the interrupt. The wait may timeout, | ||
584 | * in which case the calls returns -EBUSY. If the wait is restarted, | ||
585 | * that is restarting without resetting @cookie_valid to zero, | ||
586 | * the timeout is computed from the first call. | ||
587 | * | ||
588 | * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait | ||
589 | * on: | ||
590 | * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command | ||
591 | * stream | ||
592 | * have executed. | ||
593 | * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish | ||
594 | * commands | ||
595 | * in the buffer given to the EXECBUF ioctl returning the fence object handle | ||
596 | * are available to user-space. | ||
597 | * | ||
598 | * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the | ||
599 | * fenc wait ioctl returns 0, the fence object has been unreferenced after | ||
600 | * the wait. | ||
601 | */ | ||
602 | |||
603 | #define DRM_VMW_FENCE_FLAG_EXEC (1 << 0) | ||
604 | #define DRM_VMW_FENCE_FLAG_QUERY (1 << 1) | ||
605 | |||
606 | #define DRM_VMW_WAIT_OPTION_UNREF (1 << 0) | ||
607 | |||
608 | /** | ||
609 | * struct drm_vmw_fence_wait_arg | ||
610 | * | ||
611 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
612 | * @cookie_valid: Must be reset to 0 on first call. Left alone on restart. | ||
613 | * @kernel_cookie: Set to 0 on first call. Left alone on restart. | ||
614 | * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout. | ||
615 | * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick | ||
616 | * before returning. | ||
617 | * @flags: Fence flags to wait on. | ||
618 | * @wait_options: Options that control the behaviour of the wait ioctl. | ||
619 | * | ||
620 | * Input argument to the DRM_VMW_FENCE_WAIT ioctl. | ||
621 | */ | ||
622 | |||
623 | struct drm_vmw_fence_wait_arg { | ||
624 | uint32_t handle; | ||
625 | int32_t cookie_valid; | ||
626 | uint64_t kernel_cookie; | ||
627 | uint64_t timeout_us; | ||
628 | int32_t lazy; | ||
629 | int32_t flags; | ||
630 | int32_t wait_options; | ||
631 | int32_t pad64; | ||
632 | }; | ||
633 | |||
634 | /*************************************************************************/ | ||
635 | /** | ||
636 | * DRM_VMW_FENCE_SIGNALED | ||
637 | * | ||
638 | * Checks if a fence object is signaled.. | ||
639 | */ | ||
640 | |||
641 | /** | ||
642 | * struct drm_vmw_fence_signaled_arg | ||
643 | * | ||
644 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
645 | * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl | ||
646 | * @signaled: Out: Flags signaled. | ||
647 | * @sequence: Out: Highest sequence passed so far. Can be used to signal the | ||
648 | * EXEC flag of user-space fence objects. | ||
649 | * | ||
650 | * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF | ||
651 | * ioctls. | ||
652 | */ | ||
653 | |||
654 | struct drm_vmw_fence_signaled_arg { | ||
655 | uint32_t handle; | ||
656 | uint32_t flags; | ||
657 | int32_t signaled; | ||
658 | uint32_t passed_seqno; | ||
659 | uint32_t signaled_flags; | ||
660 | uint32_t pad64; | ||
661 | }; | ||
662 | |||
663 | /*************************************************************************/ | ||
664 | /** | ||
665 | * DRM_VMW_FENCE_UNREF | ||
666 | * | ||
667 | * Unreferences a fence object, and causes it to be destroyed if there are no | ||
668 | * other references to it. | ||
669 | * | ||
670 | */ | ||
671 | |||
672 | /** | ||
673 | * struct drm_vmw_fence_arg | ||
674 | * | ||
675 | * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl. | ||
676 | * | ||
677 | * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl.. | ||
678 | */ | ||
679 | |||
680 | struct drm_vmw_fence_arg { | ||
681 | uint32_t handle; | ||
682 | uint32_t pad64; | ||
683 | }; | ||
684 | |||
685 | |||
686 | /*************************************************************************/ | ||
687 | /** | ||
688 | * DRM_VMW_FENCE_EVENT | ||
689 | * | ||
690 | * Queues an event on a fence to be delivered on the drm character device | ||
691 | * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag. | ||
692 | * Optionally the approximate time when the fence signaled is | ||
693 | * given by the event. | ||
694 | */ | ||
695 | |||
696 | /* | ||
697 | * The event type | ||
698 | */ | ||
699 | #define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000 | ||
700 | |||
701 | struct drm_vmw_event_fence { | ||
702 | struct drm_event base; | ||
703 | uint64_t user_data; | ||
704 | uint32_t tv_sec; | ||
705 | uint32_t tv_usec; | ||
706 | }; | ||
707 | |||
708 | /* | ||
709 | * Flags that may be given to the command. | ||
710 | */ | ||
711 | /* Request fence signaled time on the event. */ | ||
712 | #define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0) | ||
713 | |||
714 | /** | ||
715 | * struct drm_vmw_fence_event_arg | ||
716 | * | ||
717 | * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if | ||
718 | * the fence is not supposed to be referenced by user-space. | ||
719 | * @user_info: Info to be delivered with the event. | ||
720 | * @handle: Attach the event to this fence only. | ||
721 | * @flags: A set of flags as defined above. | ||
722 | */ | ||
723 | struct drm_vmw_fence_event_arg { | ||
724 | uint64_t fence_rep; | ||
725 | uint64_t user_data; | ||
726 | uint32_t handle; | ||
727 | uint32_t flags; | ||
728 | }; | ||
729 | |||
730 | |||
731 | /*************************************************************************/ | ||
732 | /** | ||
733 | * DRM_VMW_PRESENT | ||
734 | * | ||
735 | * Executes an SVGA present on a given fb for a given surface. The surface | ||
736 | * is placed on the framebuffer. Cliprects are given relative to the given | ||
737 | * point (the point disignated by dest_{x|y}). | ||
738 | * | ||
739 | */ | ||
740 | |||
741 | /** | ||
742 | * struct drm_vmw_present_arg | ||
743 | * @fb_id: framebuffer id to present / read back from. | ||
744 | * @sid: Surface id to present from. | ||
745 | * @dest_x: X placement coordinate for surface. | ||
746 | * @dest_y: Y placement coordinate for surface. | ||
747 | * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. | ||
748 | * @num_clips: Number of cliprects given relative to the framebuffer origin, | ||
749 | * in the same coordinate space as the frame buffer. | ||
750 | * @pad64: Unused 64-bit padding. | ||
751 | * | ||
752 | * Input argument to the DRM_VMW_PRESENT ioctl. | ||
753 | */ | ||
754 | |||
755 | struct drm_vmw_present_arg { | ||
756 | uint32_t fb_id; | ||
757 | uint32_t sid; | ||
758 | int32_t dest_x; | ||
759 | int32_t dest_y; | ||
760 | uint64_t clips_ptr; | ||
761 | uint32_t num_clips; | ||
762 | uint32_t pad64; | ||
763 | }; | ||
764 | |||
765 | |||
766 | /*************************************************************************/ | ||
767 | /** | ||
768 | * DRM_VMW_PRESENT_READBACK | ||
769 | * | ||
770 | * Executes an SVGA present readback from a given fb to the dma buffer | ||
771 | * currently bound as the fb. If there is no dma buffer bound to the fb, | ||
772 | * an error will be returned. | ||
773 | * | ||
774 | */ | ||
775 | |||
776 | /** | ||
777 | * struct drm_vmw_present_arg | ||
778 | * @fb_id: fb_id to present / read back from. | ||
779 | * @num_clips: Number of cliprects. | ||
780 | * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t. | ||
781 | * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t. | ||
782 | * If this member is NULL, then the ioctl should not return a fence. | ||
783 | */ | ||
784 | |||
785 | struct drm_vmw_present_readback_arg { | ||
786 | uint32_t fb_id; | ||
787 | uint32_t num_clips; | ||
788 | uint64_t clips_ptr; | ||
789 | uint64_t fence_rep; | ||
790 | }; | ||
615 | #endif | 791 | #endif |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 2dcb72bff4b6..2314ad8b3c9c 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -117,6 +117,7 @@ struct kiocb { | |||
117 | 117 | ||
118 | struct list_head ki_list; /* the aio core uses this | 118 | struct list_head ki_list; /* the aio core uses this |
119 | * for cancellation */ | 119 | * for cancellation */ |
120 | struct list_head ki_batch; /* batch allocation */ | ||
120 | 121 | ||
121 | /* | 122 | /* |
122 | * If the aio_resfd field of the userspace iocb is not zero, | 123 | * If the aio_resfd field of the userspace iocb is not zero, |
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h index 5ddd9ad4b19c..2412af944f1f 100644 --- a/include/linux/amba/pl061.h +++ b/include/linux/amba/pl061.h | |||
@@ -7,8 +7,7 @@ struct pl061_platform_data { | |||
7 | unsigned gpio_base; | 7 | unsigned gpio_base; |
8 | 8 | ||
9 | /* number of the first IRQ. | 9 | /* number of the first IRQ. |
10 | * If the IRQ functionality in not desired this must be set to | 10 | * If the IRQ functionality in not desired this must be set to NO_IRQ. |
11 | * (unsigned) -1. | ||
12 | */ | 11 | */ |
13 | unsigned irq_base; | 12 | unsigned irq_base; |
14 | 13 | ||
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h index 3e09b345f4d6..4c7a4b2104bf 100644 --- a/include/linux/atmel-mci.h +++ b/include/linux/atmel-mci.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __LINUX_ATMEL_MCI_H | 1 | #ifndef __LINUX_ATMEL_MCI_H |
2 | #define __LINUX_ATMEL_MCI_H | 2 | #define __LINUX_ATMEL_MCI_H |
3 | 3 | ||
4 | #define ATMEL_MCI_MAX_NR_SLOTS 2 | 4 | #define ATMCI_MAX_NR_SLOTS 2 |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * struct mci_slot_pdata - board-specific per-slot configuration | 7 | * struct mci_slot_pdata - board-specific per-slot configuration |
@@ -33,7 +33,7 @@ struct mci_slot_pdata { | |||
33 | */ | 33 | */ |
34 | struct mci_platform_data { | 34 | struct mci_platform_data { |
35 | struct mci_dma_data *dma_slave; | 35 | struct mci_dma_data *dma_slave; |
36 | struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; | 36 | struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS]; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #endif /* __LINUX_ATMEL_MCI_H */ | 39 | #endif /* __LINUX_ATMEL_MCI_H */ |
diff --git a/include/linux/atmel_pdc.h b/include/linux/atmel_pdc.h index 5058a31d2ce8..63499ce806ea 100644 --- a/include/linux/atmel_pdc.h +++ b/include/linux/atmel_pdc.h | |||
@@ -33,4 +33,6 @@ | |||
33 | 33 | ||
34 | #define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ | 34 | #define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ |
35 | 35 | ||
36 | #define ATMEL_PDC_SCND_BUF_OFF 0x10 /* Offset between first and second buffer registers */ | ||
37 | |||
36 | #endif | 38 | #endif |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 0c8006129fb2..2f81c6f3b630 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -584,14 +584,13 @@ extern int audit_signals; | |||
584 | #ifdef CONFIG_AUDIT | 584 | #ifdef CONFIG_AUDIT |
585 | /* These are defined in audit.c */ | 585 | /* These are defined in audit.c */ |
586 | /* Public API */ | 586 | /* Public API */ |
587 | extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask, | 587 | extern __printf(4, 5) |
588 | int type, const char *fmt, ...) | 588 | void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, |
589 | __attribute__((format(printf,4,5))); | 589 | const char *fmt, ...); |
590 | 590 | ||
591 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type); | 591 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type); |
592 | extern void audit_log_format(struct audit_buffer *ab, | 592 | extern __printf(2, 3) |
593 | const char *fmt, ...) | 593 | void audit_log_format(struct audit_buffer *ab, const char *fmt, ...); |
594 | __attribute__((format(printf,2,3))); | ||
595 | extern void audit_log_end(struct audit_buffer *ab); | 594 | extern void audit_log_end(struct audit_buffer *ab); |
596 | extern int audit_string_contains_control(const char *string, | 595 | extern int audit_string_contains_control(const char *string, |
597 | size_t len); | 596 | size_t len); |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 8e9e4bc6d73b..4d1a0748eaf8 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -170,7 +170,7 @@ extern void blk_trace_shutdown(struct request_queue *); | |||
170 | extern int do_blk_trace_setup(struct request_queue *q, char *name, | 170 | extern int do_blk_trace_setup(struct request_queue *q, char *name, |
171 | dev_t dev, struct block_device *bdev, | 171 | dev_t dev, struct block_device *bdev, |
172 | struct blk_user_trace_setup *buts); | 172 | struct blk_user_trace_setup *buts); |
173 | extern __attribute__((format(printf, 2, 3))) | 173 | extern __printf(2, 3) |
174 | void __trace_note_message(struct blk_trace *, const char *fmt, ...); | 174 | void __trace_note_message(struct blk_trace *, const char *fmt, ...); |
175 | 175 | ||
176 | /** | 176 | /** |
diff --git a/include/linux/bma150.h b/include/linux/bma150.h new file mode 100644 index 000000000000..7911fda23bb4 --- /dev/null +++ b/include/linux/bma150.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011 Bosch Sensortec GmbH | ||
3 | * Copyright (c) 2011 Unixphere | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef _BMA150_H_ | ||
21 | #define _BMA150_H_ | ||
22 | |||
23 | #define BMA150_DRIVER "bma150" | ||
24 | |||
25 | struct bma150_cfg { | ||
26 | bool any_motion_int; /* Set to enable any-motion interrupt */ | ||
27 | bool hg_int; /* Set to enable high-G interrupt */ | ||
28 | bool lg_int; /* Set to enable low-G interrupt */ | ||
29 | unsigned char any_motion_dur; /* Any-motion duration */ | ||
30 | unsigned char any_motion_thres; /* Any-motion threshold */ | ||
31 | unsigned char hg_hyst; /* High-G hysterisis */ | ||
32 | unsigned char hg_dur; /* High-G duration */ | ||
33 | unsigned char hg_thres; /* High-G threshold */ | ||
34 | unsigned char lg_hyst; /* Low-G hysterisis */ | ||
35 | unsigned char lg_dur; /* Low-G duration */ | ||
36 | unsigned char lg_thres; /* Low-G threshold */ | ||
37 | unsigned char range; /* BMA0150_RANGE_xxx (in G) */ | ||
38 | unsigned char bandwidth; /* BMA0150_BW_xxx (in Hz) */ | ||
39 | }; | ||
40 | |||
41 | struct bma150_platform_data { | ||
42 | struct bma150_cfg cfg; | ||
43 | int (*irq_gpio_cfg)(void); | ||
44 | }; | ||
45 | |||
46 | #endif /* _BMA150_H_ */ | ||
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 563755181c1e..95bd8502e715 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -215,7 +215,9 @@ extern void ceph_destroy_options(struct ceph_options *opt); | |||
215 | extern int ceph_compare_options(struct ceph_options *new_opt, | 215 | extern int ceph_compare_options(struct ceph_options *new_opt, |
216 | struct ceph_client *client); | 216 | struct ceph_client *client); |
217 | extern struct ceph_client *ceph_create_client(struct ceph_options *opt, | 217 | extern struct ceph_client *ceph_create_client(struct ceph_options *opt, |
218 | void *private); | 218 | void *private, |
219 | unsigned supported_features, | ||
220 | unsigned required_features); | ||
219 | extern u64 ceph_client_id(struct ceph_client *client); | 221 | extern u64 ceph_client_id(struct ceph_client *client); |
220 | extern void ceph_destroy_client(struct ceph_client *client); | 222 | extern void ceph_destroy_client(struct ceph_client *client); |
221 | extern int __ceph_open_session(struct ceph_client *client, | 223 | extern int __ceph_open_session(struct ceph_client *client, |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index ca768ae729b4..ffbeb2c217b4 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -237,7 +237,8 @@ extern void ceph_con_keepalive(struct ceph_connection *con); | |||
237 | extern struct ceph_connection *ceph_con_get(struct ceph_connection *con); | 237 | extern struct ceph_connection *ceph_con_get(struct ceph_connection *con); |
238 | extern void ceph_con_put(struct ceph_connection *con); | 238 | extern void ceph_con_put(struct ceph_connection *con); |
239 | 239 | ||
240 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags); | 240 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, |
241 | bool can_fail); | ||
241 | extern void ceph_msg_kfree(struct ceph_msg *m); | 242 | extern void ceph_msg_kfree(struct ceph_msg *m); |
242 | 243 | ||
243 | 244 | ||
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index da7e4bc34e8c..1b7f9d525013 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -516,7 +516,7 @@ struct cgroup_subsys { | |||
516 | struct list_head sibling; | 516 | struct list_head sibling; |
517 | /* used when use_id == true */ | 517 | /* used when use_id == true */ |
518 | struct idr idr; | 518 | struct idr idr; |
519 | spinlock_t id_lock; | 519 | rwlock_t id_lock; |
520 | 520 | ||
521 | /* should be defined only by modular subsystems */ | 521 | /* should be defined only by modular subsystems */ |
522 | struct module *module; | 522 | struct module *module; |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 1d37f42ac294..7213b52b2c0e 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __LINUX_CLK_H | 11 | #ifndef __LINUX_CLK_H |
12 | #define __LINUX_CLK_H | 12 | #define __LINUX_CLK_H |
13 | 13 | ||
14 | #include <linux/kernel.h> | ||
15 | |||
14 | struct device; | 16 | struct device; |
15 | 17 | ||
16 | /* | 18 | /* |
@@ -41,11 +43,31 @@ struct clk; | |||
41 | struct clk *clk_get(struct device *dev, const char *id); | 43 | struct clk *clk_get(struct device *dev, const char *id); |
42 | 44 | ||
43 | /** | 45 | /** |
46 | * clk_prepare - prepare a clock source | ||
47 | * @clk: clock source | ||
48 | * | ||
49 | * This prepares the clock source for use. | ||
50 | * | ||
51 | * Must not be called from within atomic context. | ||
52 | */ | ||
53 | #ifdef CONFIG_HAVE_CLK_PREPARE | ||
54 | int clk_prepare(struct clk *clk); | ||
55 | #else | ||
56 | static inline int clk_prepare(struct clk *clk) | ||
57 | { | ||
58 | might_sleep(); | ||
59 | return 0; | ||
60 | } | ||
61 | #endif | ||
62 | |||
63 | /** | ||
44 | * clk_enable - inform the system when the clock source should be running. | 64 | * clk_enable - inform the system when the clock source should be running. |
45 | * @clk: clock source | 65 | * @clk: clock source |
46 | * | 66 | * |
47 | * If the clock can not be enabled/disabled, this should return success. | 67 | * If the clock can not be enabled/disabled, this should return success. |
48 | * | 68 | * |
69 | * May be called from atomic contexts. | ||
70 | * | ||
49 | * Returns success (0) or negative errno. | 71 | * Returns success (0) or negative errno. |
50 | */ | 72 | */ |
51 | int clk_enable(struct clk *clk); | 73 | int clk_enable(struct clk *clk); |
@@ -57,6 +79,8 @@ int clk_enable(struct clk *clk); | |||
57 | * Inform the system that a clock source is no longer required by | 79 | * Inform the system that a clock source is no longer required by |
58 | * a driver and may be shut down. | 80 | * a driver and may be shut down. |
59 | * | 81 | * |
82 | * May be called from atomic contexts. | ||
83 | * | ||
60 | * Implementation detail: if the clock source is shared between | 84 | * Implementation detail: if the clock source is shared between |
61 | * multiple drivers, clk_enable() calls must be balanced by the | 85 | * multiple drivers, clk_enable() calls must be balanced by the |
62 | * same number of clk_disable() calls for the clock source to be | 86 | * same number of clk_disable() calls for the clock source to be |
@@ -64,6 +88,25 @@ int clk_enable(struct clk *clk); | |||
64 | */ | 88 | */ |
65 | void clk_disable(struct clk *clk); | 89 | void clk_disable(struct clk *clk); |
66 | 90 | ||
91 | |||
92 | /** | ||
93 | * clk_unprepare - undo preparation of a clock source | ||
94 | * @clk: clock source | ||
95 | * | ||
96 | * This undoes a previously prepared clock. The caller must balance | ||
97 | * the number of prepare and unprepare calls. | ||
98 | * | ||
99 | * Must not be called from within atomic context. | ||
100 | */ | ||
101 | #ifdef CONFIG_HAVE_CLK_PREPARE | ||
102 | void clk_unprepare(struct clk *clk); | ||
103 | #else | ||
104 | static inline void clk_unprepare(struct clk *clk) | ||
105 | { | ||
106 | might_sleep(); | ||
107 | } | ||
108 | #endif | ||
109 | |||
67 | /** | 110 | /** |
68 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. | 111 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. |
69 | * This is only valid once the clock source has been enabled. | 112 | * This is only valid once the clock source has been enabled. |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index 457bcb0a310a..d9a4fd028c9d 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h | |||
@@ -24,6 +24,13 @@ struct clk_lookup { | |||
24 | struct clk *clk; | 24 | struct clk *clk; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #define CLKDEV_INIT(d, n, c) \ | ||
28 | { \ | ||
29 | .dev_id = d, \ | ||
30 | .con_id = n, \ | ||
31 | .clk = c, \ | ||
32 | } | ||
33 | |||
27 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | 34 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, |
28 | const char *dev_fmt, ...); | 35 | const char *dev_fmt, ...); |
29 | 36 | ||
diff --git a/include/linux/clksrc-dbx500-prcmu.h b/include/linux/clksrc-dbx500-prcmu.h new file mode 100644 index 000000000000..4fb8119c49e4 --- /dev/null +++ b/include/linux/clksrc-dbx500-prcmu.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2011 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> | ||
6 | * | ||
7 | */ | ||
8 | #ifndef __CLKSRC_DBX500_PRCMU_H | ||
9 | #define __CLKSRC_DBX500_PRCMU_H | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/io.h> | ||
13 | |||
14 | #ifdef CONFIG_CLKSRC_DBX500_PRCMU | ||
15 | void __init clksrc_dbx500_prcmu_init(void __iomem *base); | ||
16 | #else | ||
17 | static inline void __init clksrc_dbx500_prcmu_init(void __iomem *base) {} | ||
18 | #endif | ||
19 | |||
20 | #endif | ||
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index cc9f7a428649..bb2bbdbe5464 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -24,8 +24,6 @@ extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
24 | int order, gfp_t gfp_mask, nodemask_t *mask, | 24 | int order, gfp_t gfp_mask, nodemask_t *mask, |
25 | bool sync); | 25 | bool sync); |
26 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 26 | extern unsigned long compaction_suitable(struct zone *zone, int order); |
27 | extern unsigned long compact_zone_order(struct zone *zone, int order, | ||
28 | gfp_t gfp_mask, bool sync); | ||
29 | 27 | ||
30 | /* Do not skip compaction more than 64 times */ | 28 | /* Do not skip compaction more than 64 times */ |
31 | #define COMPACT_MAX_DEFER_SHIFT 6 | 29 | #define COMPACT_MAX_DEFER_SHIFT 6 |
@@ -69,12 +67,6 @@ static inline unsigned long compaction_suitable(struct zone *zone, int order) | |||
69 | return COMPACT_SKIPPED; | 67 | return COMPACT_SKIPPED; |
70 | } | 68 | } |
71 | 69 | ||
72 | static inline unsigned long compact_zone_order(struct zone *zone, int order, | ||
73 | gfp_t gfp_mask, bool sync) | ||
74 | { | ||
75 | return COMPACT_CONTINUE; | ||
76 | } | ||
77 | |||
78 | static inline void defer_compaction(struct zone *zone) | 70 | static inline void defer_compaction(struct zone *zone) |
79 | { | 71 | { |
80 | } | 72 | } |
diff --git a/include/linux/compat.h b/include/linux/compat.h index c6e7523bf765..154bf5683015 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -547,7 +547,8 @@ extern ssize_t compat_rw_copy_check_uvector(int type, | |||
547 | const struct compat_iovec __user *uvector, | 547 | const struct compat_iovec __user *uvector, |
548 | unsigned long nr_segs, | 548 | unsigned long nr_segs, |
549 | unsigned long fast_segs, struct iovec *fast_pointer, | 549 | unsigned long fast_segs, struct iovec *fast_pointer, |
550 | struct iovec **ret_pointer); | 550 | struct iovec **ret_pointer, |
551 | int check_access); | ||
551 | 552 | ||
552 | extern void __user *compat_alloc_user_space(unsigned long len); | 553 | extern void __user *compat_alloc_user_space(unsigned long len); |
553 | 554 | ||
diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h new file mode 100644 index 000000000000..455b233dd3b1 --- /dev/null +++ b/include/linux/cpu_pm.h | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Google, Inc. | ||
3 | * | ||
4 | * Author: | ||
5 | * Colin Cross <ccross@android.com> | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
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 | |||
18 | #ifndef _LINUX_CPU_PM_H | ||
19 | #define _LINUX_CPU_PM_H | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/notifier.h> | ||
23 | |||
24 | /* | ||
25 | * When a CPU goes to a low power state that turns off power to the CPU's | ||
26 | * power domain, the contents of some blocks (floating point coprocessors, | ||
27 | * interrupt controllers, caches, timers) in the same power domain can | ||
28 | * be lost. The cpm_pm notifiers provide a method for platform idle, suspend, | ||
29 | * and hotplug implementations to notify the drivers for these blocks that | ||
30 | * they may be reset. | ||
31 | * | ||
32 | * All cpu_pm notifications must be called with interrupts disabled. | ||
33 | * | ||
34 | * The notifications are split into two classes: CPU notifications and CPU | ||
35 | * cluster notifications. | ||
36 | * | ||
37 | * CPU notifications apply to a single CPU and must be called on the affected | ||
38 | * CPU. They are used to save per-cpu context for affected blocks. | ||
39 | * | ||
40 | * CPU cluster notifications apply to all CPUs in a single power domain. They | ||
41 | * are used to save any global context for affected blocks, and must be called | ||
42 | * after all the CPUs in the power domain have been notified of the low power | ||
43 | * state. | ||
44 | */ | ||
45 | |||
46 | /* | ||
47 | * Event codes passed as unsigned long val to notifier calls | ||
48 | */ | ||
49 | enum cpu_pm_event { | ||
50 | /* A single cpu is entering a low power state */ | ||
51 | CPU_PM_ENTER, | ||
52 | |||
53 | /* A single cpu failed to enter a low power state */ | ||
54 | CPU_PM_ENTER_FAILED, | ||
55 | |||
56 | /* A single cpu is exiting a low power state */ | ||
57 | CPU_PM_EXIT, | ||
58 | |||
59 | /* A cpu power domain is entering a low power state */ | ||
60 | CPU_CLUSTER_PM_ENTER, | ||
61 | |||
62 | /* A cpu power domain failed to enter a low power state */ | ||
63 | CPU_CLUSTER_PM_ENTER_FAILED, | ||
64 | |||
65 | /* A cpu power domain is exiting a low power state */ | ||
66 | CPU_CLUSTER_PM_EXIT, | ||
67 | }; | ||
68 | |||
69 | #ifdef CONFIG_CPU_PM | ||
70 | int cpu_pm_register_notifier(struct notifier_block *nb); | ||
71 | int cpu_pm_unregister_notifier(struct notifier_block *nb); | ||
72 | int cpu_pm_enter(void); | ||
73 | int cpu_pm_exit(void); | ||
74 | int cpu_cluster_pm_enter(void); | ||
75 | int cpu_cluster_pm_exit(void); | ||
76 | |||
77 | #else | ||
78 | |||
79 | static inline int cpu_pm_register_notifier(struct notifier_block *nb) | ||
80 | { | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static inline int cpu_pm_unregister_notifier(struct notifier_block *nb) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | static inline int cpu_pm_enter(void) | ||
90 | { | ||
91 | return 0; | ||
92 | } | ||
93 | |||
94 | static inline int cpu_pm_exit(void) | ||
95 | { | ||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | static inline int cpu_cluster_pm_enter(void) | ||
100 | { | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | static inline int cpu_cluster_pm_exit(void) | ||
105 | { | ||
106 | return 0; | ||
107 | } | ||
108 | #endif | ||
109 | #endif | ||
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 74054074e876..5c4abce94ad1 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define ELFCORE_ADDR_ERR (-2ULL) | 10 | #define ELFCORE_ADDR_ERR (-2ULL) |
11 | 11 | ||
12 | extern unsigned long long elfcorehdr_addr; | 12 | extern unsigned long long elfcorehdr_addr; |
13 | extern unsigned long long elfcorehdr_size; | ||
13 | 14 | ||
14 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | 15 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
15 | unsigned long, int); | 16 | unsigned long, int); |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index e5e468e9133d..de9adec5693c 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -72,6 +72,11 @@ | |||
72 | #define CRYPTO_ALG_TESTED 0x00000400 | 72 | #define CRYPTO_ALG_TESTED 0x00000400 |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * Set if the algorithm is an instance that is build from templates. | ||
76 | */ | ||
77 | #define CRYPTO_ALG_INSTANCE 0x00000800 | ||
78 | |||
79 | /* | ||
75 | * Transform masks and values (for crt_flags). | 80 | * Transform masks and values (for crt_flags). |
76 | */ | 81 | */ |
77 | #define CRYPTO_TFM_REQ_MASK 0x000fff00 | 82 | #define CRYPTO_TFM_REQ_MASK 0x000fff00 |
diff --git a/include/linux/cryptouser.h b/include/linux/cryptouser.h new file mode 100644 index 000000000000..532fb58f16bf --- /dev/null +++ b/include/linux/cryptouser.h | |||
@@ -0,0 +1,102 @@ | |||
1 | /* | ||
2 | * Crypto user configuration API. | ||
3 | * | ||
4 | * Copyright (C) 2011 secunet Security Networks AG | ||
5 | * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms and conditions of the GNU General Public License, | ||
9 | * version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | /* Netlink configuration messages. */ | ||
22 | enum { | ||
23 | CRYPTO_MSG_BASE = 0x10, | ||
24 | CRYPTO_MSG_NEWALG = 0x10, | ||
25 | CRYPTO_MSG_DELALG, | ||
26 | CRYPTO_MSG_UPDATEALG, | ||
27 | CRYPTO_MSG_GETALG, | ||
28 | __CRYPTO_MSG_MAX | ||
29 | }; | ||
30 | #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1) | ||
31 | #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE) | ||
32 | |||
33 | #define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME | ||
34 | |||
35 | /* Netlink message attributes. */ | ||
36 | enum crypto_attr_type_t { | ||
37 | CRYPTOCFGA_UNSPEC, | ||
38 | CRYPTOCFGA_PRIORITY_VAL, /* __u32 */ | ||
39 | CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */ | ||
40 | CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */ | ||
41 | CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */ | ||
42 | CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */ | ||
43 | CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */ | ||
44 | CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */ | ||
45 | CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */ | ||
46 | __CRYPTOCFGA_MAX | ||
47 | |||
48 | #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1) | ||
49 | }; | ||
50 | |||
51 | struct crypto_user_alg { | ||
52 | char cru_name[CRYPTO_MAX_ALG_NAME]; | ||
53 | char cru_driver_name[CRYPTO_MAX_ALG_NAME]; | ||
54 | char cru_module_name[CRYPTO_MAX_ALG_NAME]; | ||
55 | __u32 cru_type; | ||
56 | __u32 cru_mask; | ||
57 | __u32 cru_refcnt; | ||
58 | __u32 cru_flags; | ||
59 | }; | ||
60 | |||
61 | struct crypto_report_larval { | ||
62 | char type[CRYPTO_MAX_NAME]; | ||
63 | }; | ||
64 | |||
65 | struct crypto_report_hash { | ||
66 | char type[CRYPTO_MAX_NAME]; | ||
67 | unsigned int blocksize; | ||
68 | unsigned int digestsize; | ||
69 | }; | ||
70 | |||
71 | struct crypto_report_cipher { | ||
72 | char type[CRYPTO_MAX_ALG_NAME]; | ||
73 | unsigned int blocksize; | ||
74 | unsigned int min_keysize; | ||
75 | unsigned int max_keysize; | ||
76 | }; | ||
77 | |||
78 | struct crypto_report_blkcipher { | ||
79 | char type[CRYPTO_MAX_NAME]; | ||
80 | char geniv[CRYPTO_MAX_NAME]; | ||
81 | unsigned int blocksize; | ||
82 | unsigned int min_keysize; | ||
83 | unsigned int max_keysize; | ||
84 | unsigned int ivsize; | ||
85 | }; | ||
86 | |||
87 | struct crypto_report_aead { | ||
88 | char type[CRYPTO_MAX_NAME]; | ||
89 | char geniv[CRYPTO_MAX_NAME]; | ||
90 | unsigned int blocksize; | ||
91 | unsigned int maxauthsize; | ||
92 | unsigned int ivsize; | ||
93 | }; | ||
94 | |||
95 | struct crypto_report_comp { | ||
96 | char type[CRYPTO_MAX_NAME]; | ||
97 | }; | ||
98 | |||
99 | struct crypto_report_rng { | ||
100 | char type[CRYPTO_MAX_NAME]; | ||
101 | unsigned int seedsize; | ||
102 | }; | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 62157c03caf7..4df926199369 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -165,6 +165,7 @@ struct dentry_operations { | |||
165 | unsigned int, const char *, const struct qstr *); | 165 | unsigned int, const char *, const struct qstr *); |
166 | int (*d_delete)(const struct dentry *); | 166 | int (*d_delete)(const struct dentry *); |
167 | void (*d_release)(struct dentry *); | 167 | void (*d_release)(struct dentry *); |
168 | void (*d_prune)(struct dentry *); | ||
168 | void (*d_iput)(struct dentry *, struct inode *); | 169 | void (*d_iput)(struct dentry *, struct inode *); |
169 | char *(*d_dname)(struct dentry *, char *, int); | 170 | char *(*d_dname)(struct dentry *, char *, int); |
170 | struct vfsmount *(*d_automount)(struct path *); | 171 | struct vfsmount *(*d_automount)(struct path *); |
@@ -184,8 +185,9 @@ struct dentry_operations { | |||
184 | #define DCACHE_OP_COMPARE 0x0002 | 185 | #define DCACHE_OP_COMPARE 0x0002 |
185 | #define DCACHE_OP_REVALIDATE 0x0004 | 186 | #define DCACHE_OP_REVALIDATE 0x0004 |
186 | #define DCACHE_OP_DELETE 0x0008 | 187 | #define DCACHE_OP_DELETE 0x0008 |
188 | #define DCACHE_OP_PRUNE 0x0010 | ||
187 | 189 | ||
188 | #define DCACHE_DISCONNECTED 0x0010 | 190 | #define DCACHE_DISCONNECTED 0x0020 |
189 | /* This dentry is possibly not currently connected to the dcache tree, in | 191 | /* This dentry is possibly not currently connected to the dcache tree, in |
190 | * which case its parent will either be itself, or will have this flag as | 192 | * which case its parent will either be itself, or will have this flag as |
191 | * well. nfsd will not use a dentry with this bit set, but will first | 193 | * well. nfsd will not use a dentry with this bit set, but will first |
@@ -196,8 +198,8 @@ struct dentry_operations { | |||
196 | * dentry into place and return that dentry rather than the passed one, | 198 | * dentry into place and return that dentry rather than the passed one, |
197 | * typically using d_splice_alias. */ | 199 | * typically using d_splice_alias. */ |
198 | 200 | ||
199 | #define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */ | 201 | #define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */ |
200 | #define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */ | 202 | #define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */ |
201 | 203 | ||
202 | #define DCACHE_CANT_MOUNT 0x0100 | 204 | #define DCACHE_CANT_MOUNT 0x0100 |
203 | #define DCACHE_GENOCIDE 0x0200 | 205 | #define DCACHE_GENOCIDE 0x0200 |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 99e3e50b5c57..98f34b886f95 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/bio.h> | 11 | #include <linux/bio.h> |
12 | #include <linux/blkdev.h> | 12 | #include <linux/blkdev.h> |
13 | #include <linux/ratelimit.h> | ||
13 | 14 | ||
14 | struct dm_dev; | 15 | struct dm_dev; |
15 | struct dm_target; | 16 | struct dm_target; |
@@ -127,10 +128,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d); | |||
127 | * Information about a target type | 128 | * Information about a target type |
128 | */ | 129 | */ |
129 | 130 | ||
130 | /* | ||
131 | * Target features | ||
132 | */ | ||
133 | |||
134 | struct target_type { | 131 | struct target_type { |
135 | uint64_t features; | 132 | uint64_t features; |
136 | const char *name; | 133 | const char *name; |
@@ -159,6 +156,30 @@ struct target_type { | |||
159 | struct list_head list; | 156 | struct list_head list; |
160 | }; | 157 | }; |
161 | 158 | ||
159 | /* | ||
160 | * Target features | ||
161 | */ | ||
162 | |||
163 | /* | ||
164 | * Any table that contains an instance of this target must have only one. | ||
165 | */ | ||
166 | #define DM_TARGET_SINGLETON 0x00000001 | ||
167 | #define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON) | ||
168 | |||
169 | /* | ||
170 | * Indicates that a target does not support read-only devices. | ||
171 | */ | ||
172 | #define DM_TARGET_ALWAYS_WRITEABLE 0x00000002 | ||
173 | #define dm_target_always_writeable(type) \ | ||
174 | ((type)->features & DM_TARGET_ALWAYS_WRITEABLE) | ||
175 | |||
176 | /* | ||
177 | * Any device that contains a table with an instance of this target may never | ||
178 | * have tables containing any different target type. | ||
179 | */ | ||
180 | #define DM_TARGET_IMMUTABLE 0x00000004 | ||
181 | #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE) | ||
182 | |||
162 | struct dm_target { | 183 | struct dm_target { |
163 | struct dm_table *table; | 184 | struct dm_table *table; |
164 | struct target_type *type; | 185 | struct target_type *type; |
@@ -375,6 +396,14 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
375 | *---------------------------------------------------------------*/ | 396 | *---------------------------------------------------------------*/ |
376 | #define DM_NAME "device-mapper" | 397 | #define DM_NAME "device-mapper" |
377 | 398 | ||
399 | #ifdef CONFIG_PRINTK | ||
400 | extern struct ratelimit_state dm_ratelimit_state; | ||
401 | |||
402 | #define dm_ratelimit() __ratelimit(&dm_ratelimit_state) | ||
403 | #else | ||
404 | #define dm_ratelimit() 0 | ||
405 | #endif | ||
406 | |||
378 | #define DMCRIT(f, arg...) \ | 407 | #define DMCRIT(f, arg...) \ |
379 | printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 408 | printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
380 | 409 | ||
@@ -382,7 +411,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
382 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 411 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
383 | #define DMERR_LIMIT(f, arg...) \ | 412 | #define DMERR_LIMIT(f, arg...) \ |
384 | do { \ | 413 | do { \ |
385 | if (printk_ratelimit()) \ | 414 | if (dm_ratelimit()) \ |
386 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ | 415 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ |
387 | f "\n", ## arg); \ | 416 | f "\n", ## arg); \ |
388 | } while (0) | 417 | } while (0) |
@@ -391,7 +420,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
391 | printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 420 | printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
392 | #define DMWARN_LIMIT(f, arg...) \ | 421 | #define DMWARN_LIMIT(f, arg...) \ |
393 | do { \ | 422 | do { \ |
394 | if (printk_ratelimit()) \ | 423 | if (dm_ratelimit()) \ |
395 | printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ | 424 | printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ |
396 | f "\n", ## arg); \ | 425 | f "\n", ## arg); \ |
397 | } while (0) | 426 | } while (0) |
@@ -400,7 +429,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
400 | printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 429 | printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
401 | #define DMINFO_LIMIT(f, arg...) \ | 430 | #define DMINFO_LIMIT(f, arg...) \ |
402 | do { \ | 431 | do { \ |
403 | if (printk_ratelimit()) \ | 432 | if (dm_ratelimit()) \ |
404 | printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ | 433 | printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ |
405 | "\n", ## arg); \ | 434 | "\n", ## arg); \ |
406 | } while (0) | 435 | } while (0) |
@@ -410,7 +439,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
410 | printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) | 439 | printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) |
411 | # define DMDEBUG_LIMIT(f, arg...) \ | 440 | # define DMDEBUG_LIMIT(f, arg...) \ |
412 | do { \ | 441 | do { \ |
413 | if (printk_ratelimit()) \ | 442 | if (dm_ratelimit()) \ |
414 | printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ | 443 | printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ |
415 | "\n", ## arg); \ | 444 | "\n", ## arg); \ |
416 | } while (0) | 445 | } while (0) |
diff --git a/include/linux/device.h b/include/linux/device.h index bdcf361ca938..e88abeecfadf 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -33,6 +33,7 @@ struct class; | |||
33 | struct subsys_private; | 33 | struct subsys_private; |
34 | struct bus_type; | 34 | struct bus_type; |
35 | struct device_node; | 35 | struct device_node; |
36 | struct iommu_ops; | ||
36 | 37 | ||
37 | struct bus_attribute { | 38 | struct bus_attribute { |
38 | struct attribute attr; | 39 | struct attribute attr; |
@@ -67,6 +68,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
67 | * @resume: Called to bring a device on this bus out of sleep mode. | 68 | * @resume: Called to bring a device on this bus out of sleep mode. |
68 | * @pm: Power management operations of this bus, callback the specific | 69 | * @pm: Power management operations of this bus, callback the specific |
69 | * device driver's pm-ops. | 70 | * device driver's pm-ops. |
71 | * @iommu_ops IOMMU specific operations for this bus, used to attach IOMMU | ||
72 | * driver implementations to a bus and allow the driver to do | ||
73 | * bus-specific setup | ||
70 | * @p: The private data of the driver core, only the driver core can | 74 | * @p: The private data of the driver core, only the driver core can |
71 | * touch this. | 75 | * touch this. |
72 | * | 76 | * |
@@ -96,6 +100,8 @@ struct bus_type { | |||
96 | 100 | ||
97 | const struct dev_pm_ops *pm; | 101 | const struct dev_pm_ops *pm; |
98 | 102 | ||
103 | struct iommu_ops *iommu_ops; | ||
104 | |||
99 | struct subsys_private *p; | 105 | struct subsys_private *p; |
100 | }; | 106 | }; |
101 | 107 | ||
@@ -616,8 +622,8 @@ static inline const char *dev_name(const struct device *dev) | |||
616 | return kobject_name(&dev->kobj); | 622 | return kobject_name(&dev->kobj); |
617 | } | 623 | } |
618 | 624 | ||
619 | extern int dev_set_name(struct device *dev, const char *name, ...) | 625 | extern __printf(2, 3) |
620 | __attribute__((format(printf, 2, 3))); | 626 | int dev_set_name(struct device *dev, const char *name, ...); |
621 | 627 | ||
622 | #ifdef CONFIG_NUMA | 628 | #ifdef CONFIG_NUMA |
623 | static inline int dev_to_node(struct device *dev) | 629 | static inline int dev_to_node(struct device *dev) |
@@ -747,10 +753,10 @@ extern struct device *device_create_vargs(struct class *cls, | |||
747 | void *drvdata, | 753 | void *drvdata, |
748 | const char *fmt, | 754 | const char *fmt, |
749 | va_list vargs); | 755 | va_list vargs); |
750 | extern struct device *device_create(struct class *cls, struct device *parent, | 756 | extern __printf(5, 6) |
751 | dev_t devt, void *drvdata, | 757 | struct device *device_create(struct class *cls, struct device *parent, |
752 | const char *fmt, ...) | 758 | dev_t devt, void *drvdata, |
753 | __attribute__((format(printf, 5, 6))); | 759 | const char *fmt, ...); |
754 | extern void device_destroy(struct class *cls, dev_t devt); | 760 | extern void device_destroy(struct class *cls, dev_t devt); |
755 | 761 | ||
756 | /* | 762 | /* |
@@ -794,64 +800,56 @@ extern const char *dev_driver_string(const struct device *dev); | |||
794 | 800 | ||
795 | extern int __dev_printk(const char *level, const struct device *dev, | 801 | extern int __dev_printk(const char *level, const struct device *dev, |
796 | struct va_format *vaf); | 802 | struct va_format *vaf); |
797 | extern int dev_printk(const char *level, const struct device *dev, | 803 | extern __printf(3, 4) |
798 | const char *fmt, ...) | 804 | int dev_printk(const char *level, const struct device *dev, |
799 | __attribute__ ((format (printf, 3, 4))); | 805 | const char *fmt, ...) |
800 | extern int dev_emerg(const struct device *dev, const char *fmt, ...) | 806 | ; |
801 | __attribute__ ((format (printf, 2, 3))); | 807 | extern __printf(2, 3) |
802 | extern int dev_alert(const struct device *dev, const char *fmt, ...) | 808 | int dev_emerg(const struct device *dev, const char *fmt, ...); |
803 | __attribute__ ((format (printf, 2, 3))); | 809 | extern __printf(2, 3) |
804 | extern int dev_crit(const struct device *dev, const char *fmt, ...) | 810 | int dev_alert(const struct device *dev, const char *fmt, ...); |
805 | __attribute__ ((format (printf, 2, 3))); | 811 | extern __printf(2, 3) |
806 | extern int dev_err(const struct device *dev, const char *fmt, ...) | 812 | int dev_crit(const struct device *dev, const char *fmt, ...); |
807 | __attribute__ ((format (printf, 2, 3))); | 813 | extern __printf(2, 3) |
808 | extern int dev_warn(const struct device *dev, const char *fmt, ...) | 814 | int dev_err(const struct device *dev, const char *fmt, ...); |
809 | __attribute__ ((format (printf, 2, 3))); | 815 | extern __printf(2, 3) |
810 | extern int dev_notice(const struct device *dev, const char *fmt, ...) | 816 | int dev_warn(const struct device *dev, const char *fmt, ...); |
811 | __attribute__ ((format (printf, 2, 3))); | 817 | extern __printf(2, 3) |
812 | extern int _dev_info(const struct device *dev, const char *fmt, ...) | 818 | int dev_notice(const struct device *dev, const char *fmt, ...); |
813 | __attribute__ ((format (printf, 2, 3))); | 819 | extern __printf(2, 3) |
820 | int _dev_info(const struct device *dev, const char *fmt, ...); | ||
814 | 821 | ||
815 | #else | 822 | #else |
816 | 823 | ||
817 | static inline int __dev_printk(const char *level, const struct device *dev, | 824 | static inline int __dev_printk(const char *level, const struct device *dev, |
818 | struct va_format *vaf) | 825 | struct va_format *vaf) |
819 | { return 0; } | 826 | { return 0; } |
820 | static inline int dev_printk(const char *level, const struct device *dev, | 827 | static inline __printf(3, 4) |
821 | const char *fmt, ...) | 828 | int dev_printk(const char *level, const struct device *dev, |
822 | __attribute__ ((format (printf, 3, 4))); | 829 | const char *fmt, ...) |
823 | static inline int dev_printk(const char *level, const struct device *dev, | 830 | { return 0; } |
824 | const char *fmt, ...) | 831 | |
825 | { return 0; } | 832 | static inline __printf(2, 3) |
826 | 833 | int dev_emerg(const struct device *dev, const char *fmt, ...) | |
827 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | 834 | { return 0; } |
828 | __attribute__ ((format (printf, 2, 3))); | 835 | static inline __printf(2, 3) |
829 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | 836 | int dev_crit(const struct device *dev, const char *fmt, ...) |
830 | { return 0; } | 837 | { return 0; } |
831 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | 838 | static inline __printf(2, 3) |
832 | __attribute__ ((format (printf, 2, 3))); | 839 | int dev_alert(const struct device *dev, const char *fmt, ...) |
833 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | 840 | { return 0; } |
834 | { return 0; } | 841 | static inline __printf(2, 3) |
835 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | 842 | int dev_err(const struct device *dev, const char *fmt, ...) |
836 | __attribute__ ((format (printf, 2, 3))); | 843 | { return 0; } |
837 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | 844 | static inline __printf(2, 3) |
838 | { return 0; } | 845 | int dev_warn(const struct device *dev, const char *fmt, ...) |
839 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | 846 | { return 0; } |
840 | __attribute__ ((format (printf, 2, 3))); | 847 | static inline __printf(2, 3) |
841 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | 848 | int dev_notice(const struct device *dev, const char *fmt, ...) |
842 | { return 0; } | 849 | { return 0; } |
843 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | 850 | static inline __printf(2, 3) |
844 | __attribute__ ((format (printf, 2, 3))); | 851 | int _dev_info(const struct device *dev, const char *fmt, ...) |
845 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | 852 | { return 0; } |
846 | { return 0; } | ||
847 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
848 | __attribute__ ((format (printf, 2, 3))); | ||
849 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
850 | { return 0; } | ||
851 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
852 | __attribute__ ((format (printf, 2, 3))); | ||
853 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
854 | { return 0; } | ||
855 | 853 | ||
856 | #endif | 854 | #endif |
857 | 855 | ||
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 0cb8eff76bd6..75fd5573516e 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -267,9 +267,9 @@ enum { | |||
267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
268 | 268 | ||
269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
270 | #define DM_VERSION_MINOR 21 | 270 | #define DM_VERSION_MINOR 22 |
271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 0 |
272 | #define DM_VERSION_EXTRA "-ioctl (2011-07-06)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2011-10-19)" |
273 | 273 | ||
274 | /* Status bits */ | 274 | /* Status bits */ |
275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h index 5e54458e920f..47d9d376e4e7 100644 --- a/include/linux/dm-kcopyd.h +++ b/include/linux/dm-kcopyd.h | |||
@@ -57,5 +57,9 @@ void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc, | |||
57 | dm_kcopyd_notify_fn fn, void *context); | 57 | dm_kcopyd_notify_fn fn, void *context); |
58 | void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err); | 58 | void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err); |
59 | 59 | ||
60 | int dm_kcopyd_zero(struct dm_kcopyd_client *kc, | ||
61 | unsigned num_dests, struct dm_io_region *dests, | ||
62 | unsigned flags, dm_kcopyd_notify_fn fn, void *context); | ||
63 | |||
60 | #endif /* __KERNEL__ */ | 64 | #endif /* __KERNEL__ */ |
61 | #endif /* _LINUX_DM_KCOPYD_H */ | 65 | #endif /* _LINUX_DM_KCOPYD_H */ |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h index eeace7d3ff15..0678c2adc421 100644 --- a/include/linux/dm-log-userspace.h +++ b/include/linux/dm-log-userspace.h | |||
@@ -52,15 +52,20 @@ | |||
52 | * Payload-to-userspace: | 52 | * Payload-to-userspace: |
53 | * A single string containing all the argv arguments separated by ' 's | 53 | * A single string containing all the argv arguments separated by ' 's |
54 | * Payload-to-kernel: | 54 | * Payload-to-kernel: |
55 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | 55 | * A NUL-terminated string that is the name of the device that is used |
56 | * as the backing store for the log data. 'dm_get_device' will be called | ||
57 | * on this device. ('dm_put_device' will be called on this device | ||
58 | * automatically after calling DM_ULOG_DTR.) If there is no device needed | ||
59 | * for log data, 'data_size' in the dm_ulog_request struct should be 0. | ||
56 | * | 60 | * |
57 | * The UUID contained in the dm_ulog_request structure is the reference that | 61 | * The UUID contained in the dm_ulog_request structure is the reference that |
58 | * will be used by all request types to a specific log. The constructor must | 62 | * will be used by all request types to a specific log. The constructor must |
59 | * record this assotiation with instance created. | 63 | * record this association with the instance created. |
60 | * | 64 | * |
61 | * When the request has been processed, user-space must return the | 65 | * When the request has been processed, user-space must return the |
62 | * dm_ulog_request to the kernel - setting the 'error' field and | 66 | * dm_ulog_request to the kernel - setting the 'error' field, filling the |
63 | * 'data_size' appropriately. | 67 | * data field with the log device if necessary, and setting 'data_size' |
68 | * appropriately. | ||
64 | */ | 69 | */ |
65 | #define DM_ULOG_CTR 1 | 70 | #define DM_ULOG_CTR 1 |
66 | 71 | ||
@@ -377,8 +382,11 @@ | |||
377 | * dm_ulog_request or a change in the way requests are | 382 | * dm_ulog_request or a change in the way requests are |
378 | * issued/handled. Changes are outlined here: | 383 | * issued/handled. Changes are outlined here: |
379 | * version 1: Initial implementation | 384 | * version 1: Initial implementation |
385 | * version 2: DM_ULOG_CTR allowed to return a string containing a | ||
386 | * device name that is to be registered with DM via | ||
387 | * 'dm_get_device'. | ||
380 | */ | 388 | */ |
381 | #define DM_ULOG_REQUEST_VERSION 1 | 389 | #define DM_ULOG_REQUEST_VERSION 2 |
382 | 390 | ||
383 | struct dm_ulog_request { | 391 | struct dm_ulog_request { |
384 | /* | 392 | /* |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 347fdc32177a..be86ae13893f 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_DMA_MAPPING_H | 1 | #ifndef _LINUX_DMA_MAPPING_H |
2 | #define _LINUX_DMA_MAPPING_H | 2 | #define _LINUX_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/string.h> | ||
4 | #include <linux/device.h> | 5 | #include <linux/device.h> |
5 | #include <linux/err.h> | 6 | #include <linux/err.h> |
6 | #include <linux/dma-attrs.h> | 7 | #include <linux/dma-attrs.h> |
@@ -117,6 +118,15 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) | |||
117 | return -EIO; | 118 | return -EIO; |
118 | } | 119 | } |
119 | 120 | ||
121 | static inline void *dma_zalloc_coherent(struct device *dev, size_t size, | ||
122 | dma_addr_t *dma_handle, gfp_t flag) | ||
123 | { | ||
124 | void *ret = dma_alloc_coherent(dev, size, dma_handle, flag); | ||
125 | if (ret) | ||
126 | memset(ret, 0, size); | ||
127 | return ret; | ||
128 | } | ||
129 | |||
120 | #ifdef CONFIG_HAS_DMA | 130 | #ifdef CONFIG_HAS_DMA |
121 | static inline int dma_get_cache_alignment(void) | 131 | static inline int dma_get_cache_alignment(void) |
122 | { | 132 | { |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index a8b1a847c103..731a60975101 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/msi.h> | 26 | #include <linux/msi.h> |
27 | #include <linux/irqreturn.h> | 27 | #include <linux/irqreturn.h> |
28 | 28 | ||
29 | struct acpi_dmar_header; | ||
30 | |||
29 | /* DMAR Flags */ | 31 | /* DMAR Flags */ |
30 | #define DMAR_INTR_REMAP 0x1 | 32 | #define DMAR_INTR_REMAP 0x1 |
31 | #define DMAR_X2APIC_OPT_OUT 0x2 | 33 | #define DMAR_X2APIC_OPT_OUT 0x2 |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 36a3ed63f571..1b1094c35e4f 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
@@ -349,6 +349,7 @@ typedef enum fe_delivery_system { | |||
349 | SYS_CMMB, | 349 | SYS_CMMB, |
350 | SYS_DAB, | 350 | SYS_DAB, |
351 | SYS_DVBT2, | 351 | SYS_DVBT2, |
352 | SYS_TURBO, | ||
352 | } fe_delivery_system_t; | 353 | } fe_delivery_system_t; |
353 | 354 | ||
354 | struct dtv_cmds_h { | 355 | struct dtv_cmds_h { |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 1421cc84afaa..66594b1d5d7b 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
@@ -24,6 +24,6 @@ | |||
24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
25 | 25 | ||
26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
27 | #define DVB_API_VERSION_MINOR 3 | 27 | #define DVB_API_VERSION_MINOR 4 |
28 | 28 | ||
29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 13aae8087b56..0564e3c39882 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -37,22 +37,21 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n, | |||
37 | 37 | ||
38 | #if defined(CONFIG_DYNAMIC_DEBUG) | 38 | #if defined(CONFIG_DYNAMIC_DEBUG) |
39 | extern int ddebug_remove_module(const char *mod_name); | 39 | extern int ddebug_remove_module(const char *mod_name); |
40 | extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) | 40 | extern __printf(2, 3) |
41 | __attribute__ ((format (printf, 2, 3))); | 41 | int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); |
42 | 42 | ||
43 | struct device; | 43 | struct device; |
44 | 44 | ||
45 | extern int __dynamic_dev_dbg(struct _ddebug *descriptor, | 45 | extern __printf(3, 4) |
46 | const struct device *dev, | 46 | int __dynamic_dev_dbg(struct _ddebug *descriptor, const struct device *dev, |
47 | const char *fmt, ...) | 47 | const char *fmt, ...); |
48 | __attribute__ ((format (printf, 3, 4))); | ||
49 | 48 | ||
50 | struct net_device; | 49 | struct net_device; |
51 | 50 | ||
52 | extern int __dynamic_netdev_dbg(struct _ddebug *descriptor, | 51 | extern __printf(3, 4) |
53 | const struct net_device *dev, | 52 | int __dynamic_netdev_dbg(struct _ddebug *descriptor, |
54 | const char *fmt, ...) | 53 | const struct net_device *dev, |
55 | __attribute__ ((format (printf, 3, 4))); | 54 | const char *fmt, ...); |
56 | 55 | ||
57 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ | 56 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ |
58 | static struct _ddebug __used __aligned(8) \ | 57 | static struct _ddebug __used __aligned(8) \ |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 4a73257b47d0..055b248bdd53 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -42,4 +42,354 @@ static inline void opstate_init(void) | |||
42 | return; | 42 | return; |
43 | } | 43 | } |
44 | 44 | ||
45 | #define EDAC_MC_LABEL_LEN 31 | ||
46 | #define MC_PROC_NAME_MAX_LEN 7 | ||
47 | |||
48 | /* memory devices */ | ||
49 | enum dev_type { | ||
50 | DEV_UNKNOWN = 0, | ||
51 | DEV_X1, | ||
52 | DEV_X2, | ||
53 | DEV_X4, | ||
54 | DEV_X8, | ||
55 | DEV_X16, | ||
56 | DEV_X32, /* Do these parts exist? */ | ||
57 | DEV_X64 /* Do these parts exist? */ | ||
58 | }; | ||
59 | |||
60 | #define DEV_FLAG_UNKNOWN BIT(DEV_UNKNOWN) | ||
61 | #define DEV_FLAG_X1 BIT(DEV_X1) | ||
62 | #define DEV_FLAG_X2 BIT(DEV_X2) | ||
63 | #define DEV_FLAG_X4 BIT(DEV_X4) | ||
64 | #define DEV_FLAG_X8 BIT(DEV_X8) | ||
65 | #define DEV_FLAG_X16 BIT(DEV_X16) | ||
66 | #define DEV_FLAG_X32 BIT(DEV_X32) | ||
67 | #define DEV_FLAG_X64 BIT(DEV_X64) | ||
68 | |||
69 | /* memory types */ | ||
70 | enum mem_type { | ||
71 | MEM_EMPTY = 0, /* Empty csrow */ | ||
72 | MEM_RESERVED, /* Reserved csrow type */ | ||
73 | MEM_UNKNOWN, /* Unknown csrow type */ | ||
74 | MEM_FPM, /* Fast page mode */ | ||
75 | MEM_EDO, /* Extended data out */ | ||
76 | MEM_BEDO, /* Burst Extended data out */ | ||
77 | MEM_SDR, /* Single data rate SDRAM */ | ||
78 | MEM_RDR, /* Registered single data rate SDRAM */ | ||
79 | MEM_DDR, /* Double data rate SDRAM */ | ||
80 | MEM_RDDR, /* Registered Double data rate SDRAM */ | ||
81 | MEM_RMBS, /* Rambus DRAM */ | ||
82 | MEM_DDR2, /* DDR2 RAM */ | ||
83 | MEM_FB_DDR2, /* fully buffered DDR2 */ | ||
84 | MEM_RDDR2, /* Registered DDR2 RAM */ | ||
85 | MEM_XDR, /* Rambus XDR */ | ||
86 | MEM_DDR3, /* DDR3 RAM */ | ||
87 | MEM_RDDR3, /* Registered DDR3 RAM */ | ||
88 | }; | ||
89 | |||
90 | #define MEM_FLAG_EMPTY BIT(MEM_EMPTY) | ||
91 | #define MEM_FLAG_RESERVED BIT(MEM_RESERVED) | ||
92 | #define MEM_FLAG_UNKNOWN BIT(MEM_UNKNOWN) | ||
93 | #define MEM_FLAG_FPM BIT(MEM_FPM) | ||
94 | #define MEM_FLAG_EDO BIT(MEM_EDO) | ||
95 | #define MEM_FLAG_BEDO BIT(MEM_BEDO) | ||
96 | #define MEM_FLAG_SDR BIT(MEM_SDR) | ||
97 | #define MEM_FLAG_RDR BIT(MEM_RDR) | ||
98 | #define MEM_FLAG_DDR BIT(MEM_DDR) | ||
99 | #define MEM_FLAG_RDDR BIT(MEM_RDDR) | ||
100 | #define MEM_FLAG_RMBS BIT(MEM_RMBS) | ||
101 | #define MEM_FLAG_DDR2 BIT(MEM_DDR2) | ||
102 | #define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2) | ||
103 | #define MEM_FLAG_RDDR2 BIT(MEM_RDDR2) | ||
104 | #define MEM_FLAG_XDR BIT(MEM_XDR) | ||
105 | #define MEM_FLAG_DDR3 BIT(MEM_DDR3) | ||
106 | #define MEM_FLAG_RDDR3 BIT(MEM_RDDR3) | ||
107 | |||
108 | /* chipset Error Detection and Correction capabilities and mode */ | ||
109 | enum edac_type { | ||
110 | EDAC_UNKNOWN = 0, /* Unknown if ECC is available */ | ||
111 | EDAC_NONE, /* Doesn't support ECC */ | ||
112 | EDAC_RESERVED, /* Reserved ECC type */ | ||
113 | EDAC_PARITY, /* Detects parity errors */ | ||
114 | EDAC_EC, /* Error Checking - no correction */ | ||
115 | EDAC_SECDED, /* Single bit error correction, Double detection */ | ||
116 | EDAC_S2ECD2ED, /* Chipkill x2 devices - do these exist? */ | ||
117 | EDAC_S4ECD4ED, /* Chipkill x4 devices */ | ||
118 | EDAC_S8ECD8ED, /* Chipkill x8 devices */ | ||
119 | EDAC_S16ECD16ED, /* Chipkill x16 devices */ | ||
120 | }; | ||
121 | |||
122 | #define EDAC_FLAG_UNKNOWN BIT(EDAC_UNKNOWN) | ||
123 | #define EDAC_FLAG_NONE BIT(EDAC_NONE) | ||
124 | #define EDAC_FLAG_PARITY BIT(EDAC_PARITY) | ||
125 | #define EDAC_FLAG_EC BIT(EDAC_EC) | ||
126 | #define EDAC_FLAG_SECDED BIT(EDAC_SECDED) | ||
127 | #define EDAC_FLAG_S2ECD2ED BIT(EDAC_S2ECD2ED) | ||
128 | #define EDAC_FLAG_S4ECD4ED BIT(EDAC_S4ECD4ED) | ||
129 | #define EDAC_FLAG_S8ECD8ED BIT(EDAC_S8ECD8ED) | ||
130 | #define EDAC_FLAG_S16ECD16ED BIT(EDAC_S16ECD16ED) | ||
131 | |||
132 | /* scrubbing capabilities */ | ||
133 | enum scrub_type { | ||
134 | SCRUB_UNKNOWN = 0, /* Unknown if scrubber is available */ | ||
135 | SCRUB_NONE, /* No scrubber */ | ||
136 | SCRUB_SW_PROG, /* SW progressive (sequential) scrubbing */ | ||
137 | SCRUB_SW_SRC, /* Software scrub only errors */ | ||
138 | SCRUB_SW_PROG_SRC, /* Progressive software scrub from an error */ | ||
139 | SCRUB_SW_TUNABLE, /* Software scrub frequency is tunable */ | ||
140 | SCRUB_HW_PROG, /* HW progressive (sequential) scrubbing */ | ||
141 | SCRUB_HW_SRC, /* Hardware scrub only errors */ | ||
142 | SCRUB_HW_PROG_SRC, /* Progressive hardware scrub from an error */ | ||
143 | SCRUB_HW_TUNABLE /* Hardware scrub frequency is tunable */ | ||
144 | }; | ||
145 | |||
146 | #define SCRUB_FLAG_SW_PROG BIT(SCRUB_SW_PROG) | ||
147 | #define SCRUB_FLAG_SW_SRC BIT(SCRUB_SW_SRC) | ||
148 | #define SCRUB_FLAG_SW_PROG_SRC BIT(SCRUB_SW_PROG_SRC) | ||
149 | #define SCRUB_FLAG_SW_TUN BIT(SCRUB_SW_SCRUB_TUNABLE) | ||
150 | #define SCRUB_FLAG_HW_PROG BIT(SCRUB_HW_PROG) | ||
151 | #define SCRUB_FLAG_HW_SRC BIT(SCRUB_HW_SRC) | ||
152 | #define SCRUB_FLAG_HW_PROG_SRC BIT(SCRUB_HW_PROG_SRC) | ||
153 | #define SCRUB_FLAG_HW_TUN BIT(SCRUB_HW_TUNABLE) | ||
154 | |||
155 | /* FIXME - should have notify capabilities: NMI, LOG, PROC, etc */ | ||
156 | |||
157 | /* EDAC internal operation states */ | ||
158 | #define OP_ALLOC 0x100 | ||
159 | #define OP_RUNNING_POLL 0x201 | ||
160 | #define OP_RUNNING_INTERRUPT 0x202 | ||
161 | #define OP_RUNNING_POLL_INTR 0x203 | ||
162 | #define OP_OFFLINE 0x300 | ||
163 | |||
164 | /* | ||
165 | * There are several things to be aware of that aren't at all obvious: | ||
166 | * | ||
167 | * | ||
168 | * SOCKETS, SOCKET SETS, BANKS, ROWS, CHIP-SELECT ROWS, CHANNELS, etc.. | ||
169 | * | ||
170 | * These are some of the many terms that are thrown about that don't always | ||
171 | * mean what people think they mean (Inconceivable!). In the interest of | ||
172 | * creating a common ground for discussion, terms and their definitions | ||
173 | * will be established. | ||
174 | * | ||
175 | * Memory devices: The individual chip on a memory stick. These devices | ||
176 | * commonly output 4 and 8 bits each. Grouping several | ||
177 | * of these in parallel provides 64 bits which is common | ||
178 | * for a memory stick. | ||
179 | * | ||
180 | * Memory Stick: A printed circuit board that aggregates multiple | ||
181 | * memory devices in parallel. This is the atomic | ||
182 | * memory component that is purchaseable by Joe consumer | ||
183 | * and loaded into a memory socket. | ||
184 | * | ||
185 | * Socket: A physical connector on the motherboard that accepts | ||
186 | * a single memory stick. | ||
187 | * | ||
188 | * Channel: Set of memory devices on a memory stick that must be | ||
189 | * grouped in parallel with one or more additional | ||
190 | * channels from other memory sticks. This parallel | ||
191 | * grouping of the output from multiple channels are | ||
192 | * necessary for the smallest granularity of memory access. | ||
193 | * Some memory controllers are capable of single channel - | ||
194 | * which means that memory sticks can be loaded | ||
195 | * individually. Other memory controllers are only | ||
196 | * capable of dual channel - which means that memory | ||
197 | * sticks must be loaded as pairs (see "socket set"). | ||
198 | * | ||
199 | * Chip-select row: All of the memory devices that are selected together. | ||
200 | * for a single, minimum grain of memory access. | ||
201 | * This selects all of the parallel memory devices across | ||
202 | * all of the parallel channels. Common chip-select rows | ||
203 | * for single channel are 64 bits, for dual channel 128 | ||
204 | * bits. | ||
205 | * | ||
206 | * Single-Ranked stick: A Single-ranked stick has 1 chip-select row of memory. | ||
207 | * Motherboards commonly drive two chip-select pins to | ||
208 | * a memory stick. A single-ranked stick, will occupy | ||
209 | * only one of those rows. The other will be unused. | ||
210 | * | ||
211 | * Double-Ranked stick: A double-ranked stick has two chip-select rows which | ||
212 | * access different sets of memory devices. The two | ||
213 | * rows cannot be accessed concurrently. | ||
214 | * | ||
215 | * Double-sided stick: DEPRECATED TERM, see Double-Ranked stick. | ||
216 | * A double-sided stick has two chip-select rows which | ||
217 | * access different sets of memory devices. The two | ||
218 | * rows cannot be accessed concurrently. "Double-sided" | ||
219 | * is irrespective of the memory devices being mounted | ||
220 | * on both sides of the memory stick. | ||
221 | * | ||
222 | * Socket set: All of the memory sticks that are required for | ||
223 | * a single memory access or all of the memory sticks | ||
224 | * spanned by a chip-select row. A single socket set | ||
225 | * has two chip-select rows and if double-sided sticks | ||
226 | * are used these will occupy those chip-select rows. | ||
227 | * | ||
228 | * Bank: This term is avoided because it is unclear when | ||
229 | * needing to distinguish between chip-select rows and | ||
230 | * socket sets. | ||
231 | * | ||
232 | * Controller pages: | ||
233 | * | ||
234 | * Physical pages: | ||
235 | * | ||
236 | * Virtual pages: | ||
237 | * | ||
238 | * | ||
239 | * STRUCTURE ORGANIZATION AND CHOICES | ||
240 | * | ||
241 | * | ||
242 | * | ||
243 | * PS - I enjoyed writing all that about as much as you enjoyed reading it. | ||
244 | */ | ||
245 | |||
246 | struct channel_info { | ||
247 | int chan_idx; /* channel index */ | ||
248 | u32 ce_count; /* Correctable Errors for this CHANNEL */ | ||
249 | char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */ | ||
250 | struct csrow_info *csrow; /* the parent */ | ||
251 | }; | ||
252 | |||
253 | struct csrow_info { | ||
254 | unsigned long first_page; /* first page number in dimm */ | ||
255 | unsigned long last_page; /* last page number in dimm */ | ||
256 | unsigned long page_mask; /* used for interleaving - | ||
257 | * 0UL for non intlv | ||
258 | */ | ||
259 | u32 nr_pages; /* number of pages in csrow */ | ||
260 | u32 grain; /* granularity of reported error in bytes */ | ||
261 | int csrow_idx; /* the chip-select row */ | ||
262 | enum dev_type dtype; /* memory device type */ | ||
263 | u32 ue_count; /* Uncorrectable Errors for this csrow */ | ||
264 | u32 ce_count; /* Correctable Errors for this csrow */ | ||
265 | enum mem_type mtype; /* memory csrow type */ | ||
266 | enum edac_type edac_mode; /* EDAC mode for this csrow */ | ||
267 | struct mem_ctl_info *mci; /* the parent */ | ||
268 | |||
269 | struct kobject kobj; /* sysfs kobject for this csrow */ | ||
270 | |||
271 | /* channel information for this csrow */ | ||
272 | u32 nr_channels; | ||
273 | struct channel_info *channels; | ||
274 | }; | ||
275 | |||
276 | struct mcidev_sysfs_group { | ||
277 | const char *name; /* group name */ | ||
278 | const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */ | ||
279 | }; | ||
280 | |||
281 | struct mcidev_sysfs_group_kobj { | ||
282 | struct list_head list; /* list for all instances within a mc */ | ||
283 | |||
284 | struct kobject kobj; /* kobj for the group */ | ||
285 | |||
286 | const struct mcidev_sysfs_group *grp; /* group description table */ | ||
287 | struct mem_ctl_info *mci; /* the parent */ | ||
288 | }; | ||
289 | |||
290 | /* mcidev_sysfs_attribute structure | ||
291 | * used for driver sysfs attributes and in mem_ctl_info | ||
292 | * sysfs top level entries | ||
293 | */ | ||
294 | struct mcidev_sysfs_attribute { | ||
295 | /* It should use either attr or grp */ | ||
296 | struct attribute attr; | ||
297 | const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */ | ||
298 | |||
299 | /* Ops for show/store values at the attribute - not used on group */ | ||
300 | ssize_t (*show)(struct mem_ctl_info *,char *); | ||
301 | ssize_t (*store)(struct mem_ctl_info *, const char *,size_t); | ||
302 | }; | ||
303 | |||
304 | /* MEMORY controller information structure | ||
305 | */ | ||
306 | struct mem_ctl_info { | ||
307 | struct list_head link; /* for global list of mem_ctl_info structs */ | ||
308 | |||
309 | struct module *owner; /* Module owner of this control struct */ | ||
310 | |||
311 | unsigned long mtype_cap; /* memory types supported by mc */ | ||
312 | unsigned long edac_ctl_cap; /* Mem controller EDAC capabilities */ | ||
313 | unsigned long edac_cap; /* configuration capabilities - this is | ||
314 | * closely related to edac_ctl_cap. The | ||
315 | * difference is that the controller may be | ||
316 | * capable of s4ecd4ed which would be listed | ||
317 | * in edac_ctl_cap, but if channels aren't | ||
318 | * capable of s4ecd4ed then the edac_cap would | ||
319 | * not have that capability. | ||
320 | */ | ||
321 | unsigned long scrub_cap; /* chipset scrub capabilities */ | ||
322 | enum scrub_type scrub_mode; /* current scrub mode */ | ||
323 | |||
324 | /* Translates sdram memory scrub rate given in bytes/sec to the | ||
325 | internal representation and configures whatever else needs | ||
326 | to be configured. | ||
327 | */ | ||
328 | int (*set_sdram_scrub_rate) (struct mem_ctl_info * mci, u32 bw); | ||
329 | |||
330 | /* Get the current sdram memory scrub rate from the internal | ||
331 | representation and converts it to the closest matching | ||
332 | bandwidth in bytes/sec. | ||
333 | */ | ||
334 | int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci); | ||
335 | |||
336 | |||
337 | /* pointer to edac checking routine */ | ||
338 | void (*edac_check) (struct mem_ctl_info * mci); | ||
339 | |||
340 | /* | ||
341 | * Remaps memory pages: controller pages to physical pages. | ||
342 | * For most MC's, this will be NULL. | ||
343 | */ | ||
344 | /* FIXME - why not send the phys page to begin with? */ | ||
345 | unsigned long (*ctl_page_to_phys) (struct mem_ctl_info * mci, | ||
346 | unsigned long page); | ||
347 | int mc_idx; | ||
348 | int nr_csrows; | ||
349 | struct csrow_info *csrows; | ||
350 | /* | ||
351 | * FIXME - what about controllers on other busses? - IDs must be | ||
352 | * unique. dev pointer should be sufficiently unique, but | ||
353 | * BUS:SLOT.FUNC numbers may not be unique. | ||
354 | */ | ||
355 | struct device *dev; | ||
356 | const char *mod_name; | ||
357 | const char *mod_ver; | ||
358 | const char *ctl_name; | ||
359 | const char *dev_name; | ||
360 | char proc_name[MC_PROC_NAME_MAX_LEN + 1]; | ||
361 | void *pvt_info; | ||
362 | u32 ue_noinfo_count; /* Uncorrectable Errors w/o info */ | ||
363 | u32 ce_noinfo_count; /* Correctable Errors w/o info */ | ||
364 | u32 ue_count; /* Total Uncorrectable Errors for this MC */ | ||
365 | u32 ce_count; /* Total Correctable Errors for this MC */ | ||
366 | unsigned long start_time; /* mci load start time (in jiffies) */ | ||
367 | |||
368 | struct completion complete; | ||
369 | |||
370 | /* edac sysfs device control */ | ||
371 | struct kobject edac_mci_kobj; | ||
372 | |||
373 | /* list for all grp instances within a mc */ | ||
374 | struct list_head grp_kobj_list; | ||
375 | |||
376 | /* Additional top controller level attributes, but specified | ||
377 | * by the low level driver. | ||
378 | * | ||
379 | * Set by the low level driver to provide attributes at the | ||
380 | * controller level, same level as 'ue_count' and 'ce_count' above. | ||
381 | * An array of structures, NULL terminated | ||
382 | * | ||
383 | * If attributes are desired, then set to array of attributes | ||
384 | * If no attributes are desired, leave NULL | ||
385 | */ | ||
386 | const struct mcidev_sysfs_attribute *mc_driver_sysfs_attributes; | ||
387 | |||
388 | /* work struct for this MC */ | ||
389 | struct delayed_work work; | ||
390 | |||
391 | /* the internal state of this controller instance */ | ||
392 | int op_state; | ||
393 | }; | ||
394 | |||
45 | #endif | 395 | #endif |
diff --git a/include/linux/edac_mce.h b/include/linux/edac_mce.h deleted file mode 100644 index f974fc035363..000000000000 --- a/include/linux/edac_mce.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* Provides edac interface to mcelog events | ||
2 | * | ||
3 | * This file may be distributed under the terms of the | ||
4 | * GNU General Public License version 2. | ||
5 | * | ||
6 | * Copyright (c) 2009 by: | ||
7 | * Mauro Carvalho Chehab <mchehab@redhat.com> | ||
8 | * | ||
9 | * Red Hat Inc. http://www.redhat.com | ||
10 | */ | ||
11 | |||
12 | #if defined(CONFIG_EDAC_MCE) || \ | ||
13 | (defined(CONFIG_EDAC_MCE_MODULE) && defined(MODULE)) | ||
14 | |||
15 | #include <asm/mce.h> | ||
16 | #include <linux/list.h> | ||
17 | |||
18 | struct edac_mce { | ||
19 | struct list_head list; | ||
20 | |||
21 | void *priv; | ||
22 | int (*check_error)(void *priv, struct mce *mce); | ||
23 | }; | ||
24 | |||
25 | int edac_mce_register(struct edac_mce *edac_mce); | ||
26 | void edac_mce_unregister(struct edac_mce *edac_mce); | ||
27 | int edac_mce_parse(struct mce *mce); | ||
28 | |||
29 | #else | ||
30 | #define edac_mce_parse(mce) (0) | ||
31 | #endif | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index 110821cb6ea5..31f0508d7da7 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -395,6 +395,7 @@ typedef struct elf64_shdr { | |||
395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ | 395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ |
396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | 396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ |
397 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ | 397 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ |
398 | #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ | ||
398 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ | 399 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ |
399 | 400 | ||
400 | 401 | ||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 45f00b61c096..de33de1e2052 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -1097,10 +1097,12 @@ struct ethtool_ops { | |||
1097 | #define SPEED_1000 1000 | 1097 | #define SPEED_1000 1000 |
1098 | #define SPEED_2500 2500 | 1098 | #define SPEED_2500 2500 |
1099 | #define SPEED_10000 10000 | 1099 | #define SPEED_10000 10000 |
1100 | #define SPEED_UNKNOWN -1 | ||
1100 | 1101 | ||
1101 | /* Duplex, half or full. */ | 1102 | /* Duplex, half or full. */ |
1102 | #define DUPLEX_HALF 0x00 | 1103 | #define DUPLEX_HALF 0x00 |
1103 | #define DUPLEX_FULL 0x01 | 1104 | #define DUPLEX_FULL 0x01 |
1105 | #define DUPLEX_UNKNOWN 0xff | ||
1104 | 1106 | ||
1105 | /* Which connector port. */ | 1107 | /* Which connector port. */ |
1106 | #define PORT_TP 0x00 | 1108 | #define PORT_TP 0x00 |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 53792bf36c71..ce1b719e8bd4 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -197,8 +197,8 @@ struct ext2_group_desc | |||
197 | 197 | ||
198 | /* Flags that should be inherited by new inodes from their parent. */ | 198 | /* Flags that should be inherited by new inodes from their parent. */ |
199 | #define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ | 199 | #define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ |
200 | EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ | 200 | EXT2_SYNC_FL | EXT2_NODUMP_FL |\ |
201 | EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ | 201 | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\ |
202 | EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ | 202 | EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ |
203 | EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) | 203 | EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) |
204 | 204 | ||
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 67a803aee619..dec99116a0e4 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -180,8 +180,8 @@ struct ext3_group_desc | |||
180 | 180 | ||
181 | /* Flags that should be inherited by new inodes from their parent. */ | 181 | /* Flags that should be inherited by new inodes from their parent. */ |
182 | #define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\ | 182 | #define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\ |
183 | EXT3_SYNC_FL | EXT3_IMMUTABLE_FL | EXT3_APPEND_FL |\ | 183 | EXT3_SYNC_FL | EXT3_NODUMP_FL |\ |
184 | EXT3_NODUMP_FL | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL|\ | 184 | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL |\ |
185 | EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\ | 185 | EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\ |
186 | EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL) | 186 | EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL) |
187 | 187 | ||
@@ -381,7 +381,7 @@ struct ext3_inode { | |||
381 | * Mount flags | 381 | * Mount flags |
382 | */ | 382 | */ |
383 | #define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */ | 383 | #define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */ |
384 | #define EXT3_MOUNT_OLDALLOC 0x00002 /* Don't use the new Orlov allocator */ | 384 | /* EXT3_MOUNT_OLDALLOC was there */ |
385 | #define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */ | 385 | #define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */ |
386 | #define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */ | 386 | #define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */ |
387 | #define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */ | 387 | #define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */ |
@@ -937,15 +937,15 @@ extern int ext3_group_extend(struct super_block *sb, | |||
937 | ext3_fsblk_t n_blocks_count); | 937 | ext3_fsblk_t n_blocks_count); |
938 | 938 | ||
939 | /* super.c */ | 939 | /* super.c */ |
940 | extern void ext3_error (struct super_block *, const char *, const char *, ...) | 940 | extern __printf(3, 4) |
941 | __attribute__ ((format (printf, 3, 4))); | 941 | void ext3_error(struct super_block *, const char *, const char *, ...); |
942 | extern void __ext3_std_error (struct super_block *, const char *, int); | 942 | extern void __ext3_std_error (struct super_block *, const char *, int); |
943 | extern void ext3_abort (struct super_block *, const char *, const char *, ...) | 943 | extern __printf(3, 4) |
944 | __attribute__ ((format (printf, 3, 4))); | 944 | void ext3_abort(struct super_block *, const char *, const char *, ...); |
945 | extern void ext3_warning (struct super_block *, const char *, const char *, ...) | 945 | extern __printf(3, 4) |
946 | __attribute__ ((format (printf, 3, 4))); | 946 | void ext3_warning(struct super_block *, const char *, const char *, ...); |
947 | extern void ext3_msg(struct super_block *, const char *, const char *, ...) | 947 | extern __printf(3, 4) |
948 | __attribute__ ((format (printf, 3, 4))); | 948 | void ext3_msg(struct super_block *, const char *, const char *, ...); |
949 | extern void ext3_update_dynamic_rev (struct super_block *sb); | 949 | extern void ext3_update_dynamic_rev (struct super_block *sb); |
950 | 950 | ||
951 | #define ext3_std_error(sb, errno) \ | 951 | #define ext3_std_error(sb, errno) \ |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index 258088ab3c6b..64365252f1b0 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -76,10 +76,6 @@ struct ext3_sb_info { | |||
76 | struct mutex s_resize_lock; | 76 | struct mutex s_resize_lock; |
77 | unsigned long s_commit_interval; | 77 | unsigned long s_commit_interval; |
78 | struct block_device *journal_bdev; | 78 | struct block_device *journal_bdev; |
79 | #ifdef CONFIG_JBD_DEBUG | ||
80 | struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ | ||
81 | wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */ | ||
82 | #endif | ||
83 | #ifdef CONFIG_QUOTA | 79 | #ifdef CONFIG_QUOTA |
84 | char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ | 80 | char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ |
85 | int s_jquota_fmt; /* Format of quota to use */ | 81 | int s_jquota_fmt; /* Format of quota to use */ |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index aa56cf31f7ff..a49b52934c55 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -135,10 +135,25 @@ static inline void set_freezable_with_signal(void) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /* | 137 | /* |
138 | * Freezer-friendly wrappers around wait_event_interruptible() and | 138 | * Freezer-friendly wrappers around wait_event_interruptible(), |
139 | * wait_event_interruptible_timeout(), originally defined in <linux/wait.h> | 139 | * wait_event_killable() and wait_event_interruptible_timeout(), originally |
140 | * defined in <linux/wait.h> | ||
140 | */ | 141 | */ |
141 | 142 | ||
143 | #define wait_event_freezekillable(wq, condition) \ | ||
144 | ({ \ | ||
145 | int __retval; \ | ||
146 | do { \ | ||
147 | __retval = wait_event_killable(wq, \ | ||
148 | (condition) || freezing(current)); \ | ||
149 | if (__retval && !freezing(current)) \ | ||
150 | break; \ | ||
151 | else if (!(condition)) \ | ||
152 | __retval = -ERESTARTSYS; \ | ||
153 | } while (try_to_freeze()); \ | ||
154 | __retval; \ | ||
155 | }) | ||
156 | |||
142 | #define wait_event_freezable(wq, condition) \ | 157 | #define wait_event_freezable(wq, condition) \ |
143 | ({ \ | 158 | ({ \ |
144 | int __retval; \ | 159 | int __retval; \ |
@@ -190,6 +205,9 @@ static inline void set_freezable_with_signal(void) {} | |||
190 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | 205 | #define wait_event_freezable_timeout(wq, condition, timeout) \ |
191 | wait_event_interruptible_timeout(wq, condition, timeout) | 206 | wait_event_interruptible_timeout(wq, condition, timeout) |
192 | 207 | ||
208 | #define wait_event_freezekillable(wq, condition) \ | ||
209 | wait_event_killable(wq, condition) | ||
210 | |||
193 | #endif /* !CONFIG_FREEZER */ | 211 | #endif /* !CONFIG_FREEZER */ |
194 | 212 | ||
195 | #endif /* FREEZER_H_INCLUDED */ | 213 | #endif /* FREEZER_H_INCLUDED */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index ba98668a1826..0c4df261af7e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -58,14 +58,15 @@ struct inodes_stat_t { | |||
58 | 58 | ||
59 | #define NR_FILE 8192 /* this can well be larger on a larger system */ | 59 | #define NR_FILE 8192 /* this can well be larger on a larger system */ |
60 | 60 | ||
61 | #define MAY_EXEC 1 | 61 | #define MAY_EXEC 0x00000001 |
62 | #define MAY_WRITE 2 | 62 | #define MAY_WRITE 0x00000002 |
63 | #define MAY_READ 4 | 63 | #define MAY_READ 0x00000004 |
64 | #define MAY_APPEND 8 | 64 | #define MAY_APPEND 0x00000008 |
65 | #define MAY_ACCESS 16 | 65 | #define MAY_ACCESS 0x00000010 |
66 | #define MAY_OPEN 32 | 66 | #define MAY_OPEN 0x00000020 |
67 | #define MAY_CHDIR 64 | 67 | #define MAY_CHDIR 0x00000040 |
68 | #define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */ | 68 | /* called from RCU mode, don't block */ |
69 | #define MAY_NOT_BLOCK 0x00000080 | ||
69 | 70 | ||
70 | /* | 71 | /* |
71 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | 72 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond |
@@ -767,14 +768,25 @@ struct inode { | |||
767 | 768 | ||
768 | /* Stat data, not accessed from path walking */ | 769 | /* Stat data, not accessed from path walking */ |
769 | unsigned long i_ino; | 770 | unsigned long i_ino; |
770 | unsigned int i_nlink; | 771 | /* |
772 | * Filesystems may only read i_nlink directly. They shall use the | ||
773 | * following functions for modification: | ||
774 | * | ||
775 | * (set|clear|inc|drop)_nlink | ||
776 | * inode_(inc|dec)_link_count | ||
777 | */ | ||
778 | union { | ||
779 | const unsigned int i_nlink; | ||
780 | unsigned int __i_nlink; | ||
781 | }; | ||
771 | dev_t i_rdev; | 782 | dev_t i_rdev; |
772 | loff_t i_size; | ||
773 | struct timespec i_atime; | 783 | struct timespec i_atime; |
774 | struct timespec i_mtime; | 784 | struct timespec i_mtime; |
775 | struct timespec i_ctime; | 785 | struct timespec i_ctime; |
776 | unsigned int i_blkbits; | 786 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
787 | unsigned short i_bytes; | ||
777 | blkcnt_t i_blocks; | 788 | blkcnt_t i_blocks; |
789 | loff_t i_size; | ||
778 | 790 | ||
779 | #ifdef __NEED_I_SIZE_ORDERED | 791 | #ifdef __NEED_I_SIZE_ORDERED |
780 | seqcount_t i_size_seqcount; | 792 | seqcount_t i_size_seqcount; |
@@ -782,7 +794,6 @@ struct inode { | |||
782 | 794 | ||
783 | /* Misc */ | 795 | /* Misc */ |
784 | unsigned long i_state; | 796 | unsigned long i_state; |
785 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
786 | struct mutex i_mutex; | 797 | struct mutex i_mutex; |
787 | 798 | ||
788 | unsigned long dirtied_when; /* jiffies of first dirtying */ | 799 | unsigned long dirtied_when; /* jiffies of first dirtying */ |
@@ -796,9 +807,10 @@ struct inode { | |||
796 | struct rcu_head i_rcu; | 807 | struct rcu_head i_rcu; |
797 | }; | 808 | }; |
798 | atomic_t i_count; | 809 | atomic_t i_count; |
810 | unsigned int i_blkbits; | ||
799 | u64 i_version; | 811 | u64 i_version; |
800 | unsigned short i_bytes; | ||
801 | atomic_t i_dio_count; | 812 | atomic_t i_dio_count; |
813 | atomic_t i_writecount; | ||
802 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 814 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
803 | struct file_lock *i_flock; | 815 | struct file_lock *i_flock; |
804 | struct address_space i_data; | 816 | struct address_space i_data; |
@@ -822,7 +834,6 @@ struct inode { | |||
822 | #ifdef CONFIG_IMA | 834 | #ifdef CONFIG_IMA |
823 | atomic_t i_readcount; /* struct files open RO */ | 835 | atomic_t i_readcount; /* struct files open RO */ |
824 | #endif | 836 | #endif |
825 | atomic_t i_writecount; | ||
826 | void *i_private; /* fs or device private pointer */ | 837 | void *i_private; /* fs or device private pointer */ |
827 | }; | 838 | }; |
828 | 839 | ||
@@ -963,7 +974,12 @@ struct file { | |||
963 | #define f_dentry f_path.dentry | 974 | #define f_dentry f_path.dentry |
964 | #define f_vfsmnt f_path.mnt | 975 | #define f_vfsmnt f_path.mnt |
965 | const struct file_operations *f_op; | 976 | const struct file_operations *f_op; |
966 | spinlock_t f_lock; /* f_ep_links, f_flags, no IRQ */ | 977 | |
978 | /* | ||
979 | * Protects f_ep_links, f_flags, f_pos vs i_size in lseek SEEK_CUR. | ||
980 | * Must not be taken from IRQ context. | ||
981 | */ | ||
982 | spinlock_t f_lock; | ||
967 | #ifdef CONFIG_SMP | 983 | #ifdef CONFIG_SMP |
968 | int f_sb_list_cpu; | 984 | int f_sb_list_cpu; |
969 | #endif | 985 | #endif |
@@ -1627,9 +1643,10 @@ struct inode_operations { | |||
1627 | struct seq_file; | 1643 | struct seq_file; |
1628 | 1644 | ||
1629 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1645 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
1630 | unsigned long nr_segs, unsigned long fast_segs, | 1646 | unsigned long nr_segs, unsigned long fast_segs, |
1631 | struct iovec *fast_pointer, | 1647 | struct iovec *fast_pointer, |
1632 | struct iovec **ret_pointer); | 1648 | struct iovec **ret_pointer, |
1649 | int check_access); | ||
1633 | 1650 | ||
1634 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1651 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1635 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1652 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |
@@ -1748,6 +1765,19 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1748 | } | 1765 | } |
1749 | 1766 | ||
1750 | /** | 1767 | /** |
1768 | * set_nlink - directly set an inode's link count | ||
1769 | * @inode: inode | ||
1770 | * @nlink: new nlink (should be non-zero) | ||
1771 | * | ||
1772 | * This is a low-level filesystem helper to replace any | ||
1773 | * direct filesystem manipulation of i_nlink. | ||
1774 | */ | ||
1775 | static inline void set_nlink(struct inode *inode, unsigned int nlink) | ||
1776 | { | ||
1777 | inode->__i_nlink = nlink; | ||
1778 | } | ||
1779 | |||
1780 | /** | ||
1751 | * inc_nlink - directly increment an inode's link count | 1781 | * inc_nlink - directly increment an inode's link count |
1752 | * @inode: inode | 1782 | * @inode: inode |
1753 | * | 1783 | * |
@@ -1757,7 +1787,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1757 | */ | 1787 | */ |
1758 | static inline void inc_nlink(struct inode *inode) | 1788 | static inline void inc_nlink(struct inode *inode) |
1759 | { | 1789 | { |
1760 | inode->i_nlink++; | 1790 | inode->__i_nlink++; |
1761 | } | 1791 | } |
1762 | 1792 | ||
1763 | static inline void inode_inc_link_count(struct inode *inode) | 1793 | static inline void inode_inc_link_count(struct inode *inode) |
@@ -1779,7 +1809,7 @@ static inline void inode_inc_link_count(struct inode *inode) | |||
1779 | */ | 1809 | */ |
1780 | static inline void drop_nlink(struct inode *inode) | 1810 | static inline void drop_nlink(struct inode *inode) |
1781 | { | 1811 | { |
1782 | inode->i_nlink--; | 1812 | inode->__i_nlink--; |
1783 | } | 1813 | } |
1784 | 1814 | ||
1785 | /** | 1815 | /** |
@@ -1792,7 +1822,7 @@ static inline void drop_nlink(struct inode *inode) | |||
1792 | */ | 1822 | */ |
1793 | static inline void clear_nlink(struct inode *inode) | 1823 | static inline void clear_nlink(struct inode *inode) |
1794 | { | 1824 | { |
1795 | inode->i_nlink = 0; | 1825 | inode->__i_nlink = 0; |
1796 | } | 1826 | } |
1797 | 1827 | ||
1798 | static inline void inode_dec_link_count(struct inode *inode) | 1828 | static inline void inode_dec_link_count(struct inode *inode) |
@@ -2401,8 +2431,8 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | |||
2401 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); | 2431 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); |
2402 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 2432 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
2403 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 2433 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
2404 | extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, | 2434 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
2405 | int origin); | 2435 | int origin, loff_t maxsize); |
2406 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2436 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2407 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2437 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2408 | 2438 | ||
@@ -2628,8 +2658,8 @@ static const struct file_operations __fops = { \ | |||
2628 | .llseek = generic_file_llseek, \ | 2658 | .llseek = generic_file_llseek, \ |
2629 | }; | 2659 | }; |
2630 | 2660 | ||
2631 | static inline void __attribute__((format(printf, 1, 2))) | 2661 | static inline __printf(1, 2) |
2632 | __simple_attr_check_format(const char *fmt, ...) | 2662 | void __simple_attr_check_format(const char *fmt, ...) |
2633 | { | 2663 | { |
2634 | /* don't do anything, just let the compiler check the arguments; */ | 2664 | /* don't do anything, just let the compiler check the arguments; */ |
2635 | } | 2665 | } |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index af095b54502e..ce31408b1e47 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -492,10 +492,10 @@ static inline void fscache_end_io(struct fscache_retrieval *op, | |||
492 | /* | 492 | /* |
493 | * out-of-line cache backend functions | 493 | * out-of-line cache backend functions |
494 | */ | 494 | */ |
495 | extern void fscache_init_cache(struct fscache_cache *cache, | 495 | extern __printf(3, 4) |
496 | const struct fscache_cache_ops *ops, | 496 | void fscache_init_cache(struct fscache_cache *cache, |
497 | const char *idfmt, | 497 | const struct fscache_cache_ops *ops, |
498 | ...) __attribute__ ((format (printf, 3, 4))); | 498 | const char *idfmt, ...); |
499 | 499 | ||
500 | extern int fscache_add_cache(struct fscache_cache *cache, | 500 | extern int fscache_add_cache(struct fscache_cache *cache, |
501 | struct fscache_object *fsdef, | 501 | struct fscache_object *fsdef, |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index daa9952d2174..11c16a1fb9e3 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
@@ -20,18 +20,8 @@ | |||
20 | #ifndef __FSL_DIU_FB_H__ | 20 | #ifndef __FSL_DIU_FB_H__ |
21 | #define __FSL_DIU_FB_H__ | 21 | #define __FSL_DIU_FB_H__ |
22 | 22 | ||
23 | /* Arbitrary threshold to determine the allocation method | ||
24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | ||
25 | */ | ||
26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | ||
27 | |||
28 | #include <linux/types.h> | 23 | #include <linux/types.h> |
29 | 24 | ||
30 | struct mfb_alpha { | ||
31 | int enable; | ||
32 | int alpha; | ||
33 | }; | ||
34 | |||
35 | struct mfb_chroma_key { | 25 | struct mfb_chroma_key { |
36 | int enable; | 26 | int enable; |
37 | __u8 red_max; | 27 | __u8 red_max; |
@@ -43,25 +33,29 @@ struct mfb_chroma_key { | |||
43 | }; | 33 | }; |
44 | 34 | ||
45 | struct aoi_display_offset { | 35 | struct aoi_display_offset { |
46 | int x_aoi_d; | 36 | __s32 x_aoi_d; |
47 | int y_aoi_d; | 37 | __s32 y_aoi_d; |
48 | }; | 38 | }; |
49 | 39 | ||
50 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | 40 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) |
51 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | 41 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) |
42 | #define MFB_SET_ALPHA _IOW('M', 0, __u8) | ||
43 | #define MFB_GET_ALPHA _IOR('M', 0, __u8) | ||
44 | #define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset) | ||
45 | #define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset) | ||
46 | #define MFB_SET_PIXFMT _IOW('M', 8, __u32) | ||
47 | #define MFB_GET_PIXFMT _IOR('M', 8, __u32) | ||
52 | 48 | ||
53 | #define MFB_SET_ALPHA 0x80014d00 | 49 | /* |
54 | #define MFB_GET_ALPHA 0x40014d00 | 50 | * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the |
55 | #define MFB_SET_AOID 0x80084d04 | 51 | * wrong value for 'size' field of the ioctl. The current macros above use the |
56 | #define MFB_GET_AOID 0x40084d04 | 52 | * right size, but we still need to provide backwards compatibility, at least |
57 | #define MFB_SET_PIXFMT 0x80014d08 | 53 | * for a while. |
58 | #define MFB_GET_PIXFMT 0x40014d08 | 54 | */ |
59 | 55 | #define MFB_SET_PIXFMT_OLD 0x80014d08 | |
60 | #define FBIOGET_GWINFO 0x46E0 | 56 | #define MFB_GET_PIXFMT_OLD 0x40014d08 |
61 | #define FBIOPUT_GWINFO 0x46E1 | ||
62 | 57 | ||
63 | #ifdef __KERNEL__ | 58 | #ifdef __KERNEL__ |
64 | #include <linux/spinlock.h> | ||
65 | 59 | ||
66 | /* | 60 | /* |
67 | * These are the fields of area descriptor(in DDR memory) for every plane | 61 | * These are the fields of area descriptor(in DDR memory) for every plane |
@@ -159,58 +153,12 @@ struct diu { | |||
159 | __be32 plut; | 153 | __be32 plut; |
160 | } __attribute__ ((packed)); | 154 | } __attribute__ ((packed)); |
161 | 155 | ||
162 | struct diu_hw { | 156 | /* |
163 | struct diu *diu_reg; | 157 | * Modes of operation of DIU. The DIU supports five different modes, but |
164 | spinlock_t reg_lock; | 158 | * the driver only supports modes 0 and 1. |
165 | 159 | */ | |
166 | __u32 mode; /* DIU operation mode */ | ||
167 | }; | ||
168 | |||
169 | struct diu_addr { | ||
170 | __u8 __iomem *vaddr; /* Virtual address */ | ||
171 | dma_addr_t paddr; /* Physical address */ | ||
172 | __u32 offset; | ||
173 | }; | ||
174 | |||
175 | struct diu_pool { | ||
176 | struct diu_addr ad; | ||
177 | struct diu_addr gamma; | ||
178 | struct diu_addr pallete; | ||
179 | struct diu_addr cursor; | ||
180 | }; | ||
181 | |||
182 | #define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */ | ||
183 | #define INT_LCDC 64 /* DIU interrupt number */ | ||
184 | |||
185 | #define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */ | ||
186 | /* 1 for plane 0, 2 for plane 1&2 each */ | ||
187 | |||
188 | /* Minimum X and Y resolutions */ | ||
189 | #define MIN_XRES 64 | ||
190 | #define MIN_YRES 64 | ||
191 | |||
192 | /* HW cursor parameters */ | ||
193 | #define MAX_CURS 32 | ||
194 | |||
195 | /* Modes of operation of DIU */ | ||
196 | #define MFB_MODE0 0 /* DIU off */ | 160 | #define MFB_MODE0 0 /* DIU off */ |
197 | #define MFB_MODE1 1 /* All three planes output to display */ | 161 | #define MFB_MODE1 1 /* All three planes output to display */ |
198 | #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/ | ||
199 | #define MFB_MODE3 3 /* All three planes written back to memory */ | ||
200 | #define MFB_MODE4 4 /* Color bar generation */ | ||
201 | |||
202 | /* INT_STATUS/INT_MASK field descriptions */ | ||
203 | #define INT_VSYNC 0x01 /* Vsync interrupt */ | ||
204 | #define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */ | ||
205 | #define INT_UNDRUN 0x04 /* Under run exception interrupt */ | ||
206 | #define INT_PARERR 0x08 /* Display parameters error interrupt */ | ||
207 | #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ | ||
208 | |||
209 | /* Panels'operation modes */ | ||
210 | #define MFB_TYPE_OUTPUT 0 /* Panel output to display */ | ||
211 | #define MFB_TYPE_OFF 1 /* Panel off */ | ||
212 | #define MFB_TYPE_WB 2 /* Panel written back to memory */ | ||
213 | #define MFB_TYPE_TEST 3 /* Panel generate color bar */ | ||
214 | 162 | ||
215 | #endif /* __KERNEL__ */ | 163 | #endif /* __KERNEL__ */ |
216 | #endif /* __FSL_DIU_FB_H__ */ | 164 | #endif /* __FSL_DIU_FB_H__ */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index b65a6f472775..069ee4139105 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -78,8 +78,8 @@ static inline void gameport_register_port(struct gameport *gameport) | |||
78 | 78 | ||
79 | void gameport_unregister_port(struct gameport *gameport); | 79 | void gameport_unregister_port(struct gameport *gameport); |
80 | 80 | ||
81 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) | 81 | __printf(2, 3) |
82 | __attribute__ ((format (printf, 2, 3))); | 82 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...); |
83 | 83 | ||
84 | #else | 84 | #else |
85 | 85 | ||
@@ -93,8 +93,8 @@ static inline void gameport_unregister_port(struct gameport *gameport) | |||
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | 95 | ||
96 | static inline void gameport_set_phys(struct gameport *gameport, | 96 | static inline __printf(2, 3) |
97 | const char *fmt, ...) | 97 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) |
98 | { | 98 | { |
99 | return; | 99 | return; |
100 | } | 100 | } |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 02fa4697a0e5..6957350e122f 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) | 21 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) |
22 | #define disk_to_dev(disk) (&(disk)->part0.__dev) | 22 | #define disk_to_dev(disk) (&(disk)->part0.__dev) |
23 | #define part_to_dev(part) (&((part)->__dev)) | 23 | #define part_to_dev(part) (&((part)->__dev)) |
24 | #define alias_name(disk) ((disk)->alias ? (disk)->alias : \ | ||
25 | (disk)->disk_name) | ||
24 | 26 | ||
25 | extern struct device_type part_type; | 27 | extern struct device_type part_type; |
26 | extern struct kobject *block_depr; | 28 | extern struct kobject *block_depr; |
@@ -58,6 +60,7 @@ enum { | |||
58 | 60 | ||
59 | #define DISK_MAX_PARTS 256 | 61 | #define DISK_MAX_PARTS 256 |
60 | #define DISK_NAME_LEN 32 | 62 | #define DISK_NAME_LEN 32 |
63 | #define ALIAS_LEN 256 | ||
61 | 64 | ||
62 | #include <linux/major.h> | 65 | #include <linux/major.h> |
63 | #include <linux/device.h> | 66 | #include <linux/device.h> |
@@ -162,6 +165,7 @@ struct gendisk { | |||
162 | * disks that can't be partitioned. */ | 165 | * disks that can't be partitioned. */ |
163 | 166 | ||
164 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 167 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
168 | char *alias; /* alias name of disk */ | ||
165 | char *(*devnode)(struct gendisk *gd, mode_t *mode); | 169 | char *(*devnode)(struct gendisk *gd, mode_t *mode); |
166 | 170 | ||
167 | unsigned int events; /* supported events */ | 171 | unsigned int events; /* supported events */ |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 17b5a0d80e42..38ac48b7d3a8 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -14,6 +14,18 @@ | |||
14 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) | 14 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) |
15 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) | 15 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) |
16 | 16 | ||
17 | /** | ||
18 | * struct gpio - a structure describing a GPIO with configuration | ||
19 | * @gpio: the GPIO number | ||
20 | * @flags: GPIO configuration as specified by GPIOF_* | ||
21 | * @label: a literal description string of this GPIO | ||
22 | */ | ||
23 | struct gpio { | ||
24 | unsigned gpio; | ||
25 | unsigned long flags; | ||
26 | const char *label; | ||
27 | }; | ||
28 | |||
17 | #ifdef CONFIG_GENERIC_GPIO | 29 | #ifdef CONFIG_GENERIC_GPIO |
18 | #include <asm/gpio.h> | 30 | #include <asm/gpio.h> |
19 | 31 | ||
@@ -24,18 +36,8 @@ | |||
24 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
25 | 37 | ||
26 | struct device; | 38 | struct device; |
27 | struct gpio; | ||
28 | struct gpio_chip; | 39 | struct gpio_chip; |
29 | 40 | ||
30 | /* | ||
31 | * Some platforms don't support the GPIO programming interface. | ||
32 | * | ||
33 | * In case some driver uses it anyway (it should normally have | ||
34 | * depended on GENERIC_GPIO), these routines help the compiler | ||
35 | * optimize out much GPIO-related code ... or trigger a runtime | ||
36 | * warning when something is wrongly called. | ||
37 | */ | ||
38 | |||
39 | static inline bool gpio_is_valid(int number) | 41 | static inline bool gpio_is_valid(int number) |
40 | { | 42 | { |
41 | return false; | 43 | return false; |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 48c32ebf65a7..a9ace9c32507 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -22,6 +22,11 @@ extern int zap_huge_pmd(struct mmu_gather *tlb, | |||
22 | extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | 22 | extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, |
23 | unsigned long addr, unsigned long end, | 23 | unsigned long addr, unsigned long end, |
24 | unsigned char *vec); | 24 | unsigned char *vec); |
25 | extern int move_huge_pmd(struct vm_area_struct *vma, | ||
26 | struct vm_area_struct *new_vma, | ||
27 | unsigned long old_addr, | ||
28 | unsigned long new_addr, unsigned long old_end, | ||
29 | pmd_t *old_pmd, pmd_t *new_pmd); | ||
25 | extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, | 30 | extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, |
26 | unsigned long addr, pgprot_t newprot); | 31 | unsigned long addr, pgprot_t newprot); |
27 | 32 | ||
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h index 8390efc457eb..08a2fee40659 100644 --- a/include/linux/hwspinlock.h +++ b/include/linux/hwspinlock.h | |||
@@ -20,17 +20,49 @@ | |||
20 | 20 | ||
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/device.h> | ||
23 | 24 | ||
24 | /* hwspinlock mode argument */ | 25 | /* hwspinlock mode argument */ |
25 | #define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */ | 26 | #define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */ |
26 | #define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */ | 27 | #define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */ |
27 | 28 | ||
28 | struct hwspinlock; | 29 | struct hwspinlock; |
30 | struct hwspinlock_device; | ||
31 | struct hwspinlock_ops; | ||
32 | |||
33 | /** | ||
34 | * struct hwspinlock_pdata - platform data for hwspinlock drivers | ||
35 | * @base_id: base id for this hwspinlock device | ||
36 | * | ||
37 | * hwspinlock devices provide system-wide hardware locks that are used | ||
38 | * by remote processors that have no other way to achieve synchronization. | ||
39 | * | ||
40 | * To achieve that, each physical lock must have a system-wide id number | ||
41 | * that is agreed upon, otherwise remote processors can't possibly assume | ||
42 | * they're using the same hardware lock. | ||
43 | * | ||
44 | * Usually boards have a single hwspinlock device, which provides several | ||
45 | * hwspinlocks, and in this case, they can be trivially numbered 0 to | ||
46 | * (num-of-locks - 1). | ||
47 | * | ||
48 | * In case boards have several hwspinlocks devices, a different base id | ||
49 | * should be used for each hwspinlock device (they can't all use 0 as | ||
50 | * a starting id!). | ||
51 | * | ||
52 | * This platform data structure should be used to provide the base id | ||
53 | * for each device (which is trivially 0 when only a single hwspinlock | ||
54 | * device exists). It can be shared between different platforms, hence | ||
55 | * its location. | ||
56 | */ | ||
57 | struct hwspinlock_pdata { | ||
58 | int base_id; | ||
59 | }; | ||
29 | 60 | ||
30 | #if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE) | 61 | #if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE) |
31 | 62 | ||
32 | int hwspin_lock_register(struct hwspinlock *lock); | 63 | int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, |
33 | struct hwspinlock *hwspin_lock_unregister(unsigned int id); | 64 | const struct hwspinlock_ops *ops, int base_id, int num_locks); |
65 | int hwspin_lock_unregister(struct hwspinlock_device *bank); | ||
34 | struct hwspinlock *hwspin_lock_request(void); | 66 | struct hwspinlock *hwspin_lock_request(void); |
35 | struct hwspinlock *hwspin_lock_request_specific(unsigned int id); | 67 | struct hwspinlock *hwspin_lock_request_specific(unsigned int id); |
36 | int hwspin_lock_free(struct hwspinlock *hwlock); | 68 | int hwspin_lock_free(struct hwspinlock *hwlock); |
@@ -94,16 +126,6 @@ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock) | |||
94 | return 0; | 126 | return 0; |
95 | } | 127 | } |
96 | 128 | ||
97 | static inline int hwspin_lock_register(struct hwspinlock *hwlock) | ||
98 | { | ||
99 | return -ENODEV; | ||
100 | } | ||
101 | |||
102 | static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id) | ||
103 | { | ||
104 | return NULL; | ||
105 | } | ||
106 | |||
107 | #endif /* !CONFIG_HWSPINLOCK */ | 129 | #endif /* !CONFIG_HWSPINLOCK */ |
108 | 130 | ||
109 | /** | 131 | /** |
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index 0aa0cbd676f7..92a0dc75bc74 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h | |||
@@ -32,10 +32,9 @@ | |||
32 | 32 | ||
33 | struct omap_i2c_bus_platform_data { | 33 | struct omap_i2c_bus_platform_data { |
34 | u32 clkrate; | 34 | u32 clkrate; |
35 | u32 rev; | ||
36 | u32 flags; | ||
35 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | 37 | void (*set_mpu_wkup_lat)(struct device *dev, long set); |
36 | int (*device_enable) (struct platform_device *pdev); | ||
37 | int (*device_shutdown) (struct platform_device *pdev); | ||
38 | int (*device_idle) (struct platform_device *pdev); | ||
39 | }; | 38 | }; |
40 | 39 | ||
41 | #endif | 40 | #endif |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a6c652ef516d..38a21c3edd2c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/sched.h> /* for completion */ | 34 | #include <linux/sched.h> /* for completion */ |
35 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
36 | #include <linux/of.h> /* for struct device_node */ | 36 | #include <linux/of.h> /* for struct device_node */ |
37 | #include <linux/swab.h> /* for swab16 */ | ||
37 | 38 | ||
38 | extern struct bus_type i2c_bus_type; | 39 | extern struct bus_type i2c_bus_type; |
39 | extern struct device_type i2c_adapter_type; | 40 | extern struct device_type i2c_adapter_type; |
@@ -88,6 +89,22 @@ extern s32 i2c_smbus_read_word_data(const struct i2c_client *client, | |||
88 | u8 command); | 89 | u8 command); |
89 | extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, | 90 | extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, |
90 | u8 command, u16 value); | 91 | u8 command, u16 value); |
92 | |||
93 | static inline s32 | ||
94 | i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command) | ||
95 | { | ||
96 | s32 value = i2c_smbus_read_word_data(client, command); | ||
97 | |||
98 | return (value < 0) ? value : swab16(value); | ||
99 | } | ||
100 | |||
101 | static inline s32 | ||
102 | i2c_smbus_write_word_swapped(const struct i2c_client *client, | ||
103 | u8 command, u16 value) | ||
104 | { | ||
105 | return i2c_smbus_write_word_data(client, command, swab16(value)); | ||
106 | } | ||
107 | |||
91 | /* Returns the number of read bytes */ | 108 | /* Returns the number of read bytes */ |
92 | extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, | 109 | extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, |
93 | u8 command, u8 *values); | 110 | u8 command, u8 *values); |
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h index 591427a63b06..506a9f7af51e 100644 --- a/include/linux/i2c/tsc2007.h +++ b/include/linux/i2c/tsc2007.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | struct tsc2007_platform_data { | 6 | struct tsc2007_platform_data { |
7 | u16 model; /* 2007. */ | 7 | u16 model; /* 2007. */ |
8 | u16 x_plate_ohms; | 8 | u16 x_plate_ohms; /* must be non-zero value */ |
9 | u16 max_rt; /* max. resistance above which samples are ignored */ | 9 | u16 max_rt; /* max. resistance above which samples are ignored */ |
10 | unsigned long poll_delay; /* delay (in ms) after pen-down event | 10 | unsigned long poll_delay; /* delay (in ms) after pen-down event |
11 | before polling starts */ | 11 | before polling starts */ |
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h index 6427d298fbfc..530e11ba0738 100644 --- a/include/linux/i2c/twl4030-madc.h +++ b/include/linux/i2c/twl4030-madc.h | |||
@@ -129,6 +129,10 @@ enum sample_type { | |||
129 | #define REG_BCICTL2 0x024 | 129 | #define REG_BCICTL2 0x024 |
130 | #define TWL4030_BCI_ITHSENS 0x007 | 130 | #define TWL4030_BCI_ITHSENS 0x007 |
131 | 131 | ||
132 | /* Register and bits for GPBR1 register */ | ||
133 | #define TWL4030_REG_GPBR1 0x0c | ||
134 | #define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7) | ||
135 | |||
132 | struct twl4030_madc_user_parms { | 136 | struct twl4030_madc_user_parms { |
133 | int channel; | 137 | int channel; |
134 | int average; | 138 | int average; |
diff --git a/include/linux/input.h b/include/linux/input.h index a637e7814334..3862e32c4eeb 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -505,6 +505,7 @@ struct input_keymap_entry { | |||
505 | #define BTN_TOOL_FINGER 0x145 | 505 | #define BTN_TOOL_FINGER 0x145 |
506 | #define BTN_TOOL_MOUSE 0x146 | 506 | #define BTN_TOOL_MOUSE 0x146 |
507 | #define BTN_TOOL_LENS 0x147 | 507 | #define BTN_TOOL_LENS 0x147 |
508 | #define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ | ||
508 | #define BTN_TOUCH 0x14a | 509 | #define BTN_TOUCH 0x14a |
509 | #define BTN_STYLUS 0x14b | 510 | #define BTN_STYLUS 0x14b |
510 | #define BTN_STYLUS2 0x14c | 511 | #define BTN_STYLUS2 0x14c |
@@ -814,6 +815,7 @@ struct input_keymap_entry { | |||
814 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ | 815 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ |
815 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 816 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
816 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | 817 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ |
818 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ | ||
817 | #define SW_MAX 0x0f | 819 | #define SW_MAX 0x0f |
818 | #define SW_CNT (SW_MAX+1) | 820 | #define SW_CNT (SW_MAX+1) |
819 | 821 | ||
@@ -1609,7 +1611,7 @@ struct ff_device { | |||
1609 | struct file *effect_owners[]; | 1611 | struct file *effect_owners[]; |
1610 | }; | 1612 | }; |
1611 | 1613 | ||
1612 | int input_ff_create(struct input_dev *dev, int max_effects); | 1614 | int input_ff_create(struct input_dev *dev, unsigned int max_effects); |
1613 | void input_ff_destroy(struct input_dev *dev); | 1615 | void input_ff_destroy(struct input_dev *dev); |
1614 | 1616 | ||
1615 | int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 1617 | int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
diff --git a/include/linux/input/adp5589.h b/include/linux/input/adp5589.h index ef792ecfaabf..1a05eee15e67 100644 --- a/include/linux/input/adp5589.h +++ b/include/linux/input/adp5589.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Analog Devices ADP5589 I/O Expander and QWERTY Keypad Controller | 2 | * Analog Devices ADP5589/ADP5585 I/O Expander and QWERTY Keypad Controller |
3 | * | 3 | * |
4 | * Copyright 2010-2011 Analog Devices Inc. | 4 | * Copyright 2010-2011 Analog Devices Inc. |
5 | * | 5 | * |
@@ -9,89 +9,9 @@ | |||
9 | #ifndef _ADP5589_H | 9 | #ifndef _ADP5589_H |
10 | #define _ADP5589_H | 10 | #define _ADP5589_H |
11 | 11 | ||
12 | #define ADP5589_ID 0x00 | 12 | /* |
13 | #define ADP5589_INT_STATUS 0x01 | 13 | * ADP5589 specific GPI and Keymap defines |
14 | #define ADP5589_STATUS 0x02 | 14 | */ |
15 | #define ADP5589_FIFO_1 0x03 | ||
16 | #define ADP5589_FIFO_2 0x04 | ||
17 | #define ADP5589_FIFO_3 0x05 | ||
18 | #define ADP5589_FIFO_4 0x06 | ||
19 | #define ADP5589_FIFO_5 0x07 | ||
20 | #define ADP5589_FIFO_6 0x08 | ||
21 | #define ADP5589_FIFO_7 0x09 | ||
22 | #define ADP5589_FIFO_8 0x0A | ||
23 | #define ADP5589_FIFO_9 0x0B | ||
24 | #define ADP5589_FIFO_10 0x0C | ||
25 | #define ADP5589_FIFO_11 0x0D | ||
26 | #define ADP5589_FIFO_12 0x0E | ||
27 | #define ADP5589_FIFO_13 0x0F | ||
28 | #define ADP5589_FIFO_14 0x10 | ||
29 | #define ADP5589_FIFO_15 0x11 | ||
30 | #define ADP5589_FIFO_16 0x12 | ||
31 | #define ADP5589_GPI_INT_STAT_A 0x13 | ||
32 | #define ADP5589_GPI_INT_STAT_B 0x14 | ||
33 | #define ADP5589_GPI_INT_STAT_C 0x15 | ||
34 | #define ADP5589_GPI_STATUS_A 0x16 | ||
35 | #define ADP5589_GPI_STATUS_B 0x17 | ||
36 | #define ADP5589_GPI_STATUS_C 0x18 | ||
37 | #define ADP5589_RPULL_CONFIG_A 0x19 | ||
38 | #define ADP5589_RPULL_CONFIG_B 0x1A | ||
39 | #define ADP5589_RPULL_CONFIG_C 0x1B | ||
40 | #define ADP5589_RPULL_CONFIG_D 0x1C | ||
41 | #define ADP5589_RPULL_CONFIG_E 0x1D | ||
42 | #define ADP5589_GPI_INT_LEVEL_A 0x1E | ||
43 | #define ADP5589_GPI_INT_LEVEL_B 0x1F | ||
44 | #define ADP5589_GPI_INT_LEVEL_C 0x20 | ||
45 | #define ADP5589_GPI_EVENT_EN_A 0x21 | ||
46 | #define ADP5589_GPI_EVENT_EN_B 0x22 | ||
47 | #define ADP5589_GPI_EVENT_EN_C 0x23 | ||
48 | #define ADP5589_GPI_INTERRUPT_EN_A 0x24 | ||
49 | #define ADP5589_GPI_INTERRUPT_EN_B 0x25 | ||
50 | #define ADP5589_GPI_INTERRUPT_EN_C 0x26 | ||
51 | #define ADP5589_DEBOUNCE_DIS_A 0x27 | ||
52 | #define ADP5589_DEBOUNCE_DIS_B 0x28 | ||
53 | #define ADP5589_DEBOUNCE_DIS_C 0x29 | ||
54 | #define ADP5589_GPO_DATA_OUT_A 0x2A | ||
55 | #define ADP5589_GPO_DATA_OUT_B 0x2B | ||
56 | #define ADP5589_GPO_DATA_OUT_C 0x2C | ||
57 | #define ADP5589_GPO_OUT_MODE_A 0x2D | ||
58 | #define ADP5589_GPO_OUT_MODE_B 0x2E | ||
59 | #define ADP5589_GPO_OUT_MODE_C 0x2F | ||
60 | #define ADP5589_GPIO_DIRECTION_A 0x30 | ||
61 | #define ADP5589_GPIO_DIRECTION_B 0x31 | ||
62 | #define ADP5589_GPIO_DIRECTION_C 0x32 | ||
63 | #define ADP5589_UNLOCK1 0x33 | ||
64 | #define ADP5589_UNLOCK2 0x34 | ||
65 | #define ADP5589_EXT_LOCK_EVENT 0x35 | ||
66 | #define ADP5589_UNLOCK_TIMERS 0x36 | ||
67 | #define ADP5589_LOCK_CFG 0x37 | ||
68 | #define ADP5589_RESET1_EVENT_A 0x38 | ||
69 | #define ADP5589_RESET1_EVENT_B 0x39 | ||
70 | #define ADP5589_RESET1_EVENT_C 0x3A | ||
71 | #define ADP5589_RESET2_EVENT_A 0x3B | ||
72 | #define ADP5589_RESET2_EVENT_B 0x3C | ||
73 | #define ADP5589_RESET_CFG 0x3D | ||
74 | #define ADP5589_PWM_OFFT_LOW 0x3E | ||
75 | #define ADP5589_PWM_OFFT_HIGH 0x3F | ||
76 | #define ADP5589_PWM_ONT_LOW 0x40 | ||
77 | #define ADP5589_PWM_ONT_HIGH 0x41 | ||
78 | #define ADP5589_PWM_CFG 0x42 | ||
79 | #define ADP5589_CLOCK_DIV_CFG 0x43 | ||
80 | #define ADP5589_LOGIC_1_CFG 0x44 | ||
81 | #define ADP5589_LOGIC_2_CFG 0x45 | ||
82 | #define ADP5589_LOGIC_FF_CFG 0x46 | ||
83 | #define ADP5589_LOGIC_INT_EVENT_EN 0x47 | ||
84 | #define ADP5589_POLL_PTIME_CFG 0x48 | ||
85 | #define ADP5589_PIN_CONFIG_A 0x49 | ||
86 | #define ADP5589_PIN_CONFIG_B 0x4A | ||
87 | #define ADP5589_PIN_CONFIG_C 0x4B | ||
88 | #define ADP5589_PIN_CONFIG_D 0x4C | ||
89 | #define ADP5589_GENERAL_CFG 0x4D | ||
90 | #define ADP5589_INT_EN 0x4E | ||
91 | |||
92 | #define ADP5589_DEVICE_ID_MASK 0xF | ||
93 | |||
94 | /* Put one of these structures in i2c_board_info platform_data */ | ||
95 | 15 | ||
96 | #define ADP5589_KEYMAPSIZE 88 | 16 | #define ADP5589_KEYMAPSIZE 88 |
97 | 17 | ||
@@ -127,6 +47,35 @@ | |||
127 | 47 | ||
128 | #define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) | 48 | #define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) |
129 | 49 | ||
50 | /* | ||
51 | * ADP5585 specific GPI and Keymap defines | ||
52 | */ | ||
53 | |||
54 | #define ADP5585_KEYMAPSIZE 30 | ||
55 | |||
56 | #define ADP5585_GPI_PIN_ROW0 37 | ||
57 | #define ADP5585_GPI_PIN_ROW1 38 | ||
58 | #define ADP5585_GPI_PIN_ROW2 39 | ||
59 | #define ADP5585_GPI_PIN_ROW3 40 | ||
60 | #define ADP5585_GPI_PIN_ROW4 41 | ||
61 | #define ADP5585_GPI_PIN_ROW5 42 | ||
62 | #define ADP5585_GPI_PIN_COL0 43 | ||
63 | #define ADP5585_GPI_PIN_COL1 44 | ||
64 | #define ADP5585_GPI_PIN_COL2 45 | ||
65 | #define ADP5585_GPI_PIN_COL3 46 | ||
66 | #define ADP5585_GPI_PIN_COL4 47 | ||
67 | #define GPI_LOGIC 48 | ||
68 | |||
69 | #define ADP5585_GPI_PIN_ROW_BASE ADP5585_GPI_PIN_ROW0 | ||
70 | #define ADP5585_GPI_PIN_ROW_END ADP5585_GPI_PIN_ROW5 | ||
71 | #define ADP5585_GPI_PIN_COL_BASE ADP5585_GPI_PIN_COL0 | ||
72 | #define ADP5585_GPI_PIN_COL_END ADP5585_GPI_PIN_COL4 | ||
73 | |||
74 | #define ADP5585_GPI_PIN_BASE ADP5585_GPI_PIN_ROW_BASE | ||
75 | #define ADP5585_GPI_PIN_END ADP5585_GPI_PIN_COL_END | ||
76 | |||
77 | #define ADP5585_GPIMAPSIZE_MAX (ADP5585_GPI_PIN_END - ADP5585_GPI_PIN_BASE + 1) | ||
78 | |||
130 | struct adp5589_gpi_map { | 79 | struct adp5589_gpi_map { |
131 | unsigned short pin; | 80 | unsigned short pin; |
132 | unsigned short sw_evt; | 81 | unsigned short sw_evt; |
@@ -159,7 +108,7 @@ struct adp5589_gpi_map { | |||
159 | #define RESET2_POL_HIGH (1 << 7) | 108 | #define RESET2_POL_HIGH (1 << 7) |
160 | #define RESET2_POL_LOW (0 << 7) | 109 | #define RESET2_POL_LOW (0 << 7) |
161 | 110 | ||
162 | /* Mask Bits: | 111 | /* ADP5589 Mask Bits: |
163 | * C C C C C C C C C C C | R R R R R R R R | 112 | * C C C C C C C C C C C | R R R R R R R R |
164 | * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 113 | * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 |
165 | * 0 | 114 | * 0 |
@@ -168,18 +117,44 @@ struct adp5589_gpi_map { | |||
168 | * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 | 117 | * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 |
169 | */ | 118 | */ |
170 | 119 | ||
171 | #define ADP_ROW(x) (1 << (x)) | 120 | #define ADP_ROW(x) (1 << (x)) |
172 | #define ADP_COL(x) (1 << (x + 8)) | 121 | #define ADP_COL(x) (1 << (x + 8)) |
122 | #define ADP5589_ROW_MASK 0xFF | ||
123 | #define ADP5589_COL_MASK 0xFF | ||
124 | #define ADP5589_COL_SHIFT 8 | ||
125 | #define ADP5589_MAX_ROW_NUM 7 | ||
126 | #define ADP5589_MAX_COL_NUM 10 | ||
127 | |||
128 | /* ADP5585 Mask Bits: | ||
129 | * C C C C C | R R R R R R | ||
130 | * 4 3 2 1 0 | 5 4 3 2 1 0 | ||
131 | * | ||
132 | * ---- BIT -- ----------- | ||
133 | * 1 0 0 0 0 | 0 0 0 0 0 0 | ||
134 | * 0 9 8 7 6 | 5 4 3 2 1 0 | ||
135 | */ | ||
136 | |||
137 | #define ADP5585_ROW_MASK 0x3F | ||
138 | #define ADP5585_COL_MASK 0x1F | ||
139 | #define ADP5585_ROW_SHIFT 0 | ||
140 | #define ADP5585_COL_SHIFT 6 | ||
141 | #define ADP5585_MAX_ROW_NUM 5 | ||
142 | #define ADP5585_MAX_COL_NUM 4 | ||
143 | |||
144 | #define ADP5585_ROW(x) (1 << ((x) & ADP5585_ROW_MASK)) | ||
145 | #define ADP5585_COL(x) (1 << (((x) & ADP5585_COL_MASK) + ADP5585_COL_SHIFT)) | ||
146 | |||
147 | /* Put one of these structures in i2c_board_info platform_data */ | ||
173 | 148 | ||
174 | struct adp5589_kpad_platform_data { | 149 | struct adp5589_kpad_platform_data { |
175 | unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ | 150 | unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ |
176 | const unsigned short *keymap; /* Pointer to keymap */ | 151 | const unsigned short *keymap; /* Pointer to keymap */ |
177 | unsigned short keymapsize; /* Keymap size */ | 152 | unsigned short keymapsize; /* Keymap size */ |
178 | bool repeat; /* Enable key repeat */ | 153 | bool repeat; /* Enable key repeat */ |
179 | bool en_keylock; /* Enable key lock feature */ | 154 | bool en_keylock; /* Enable key lock feature (ADP5589 only)*/ |
180 | unsigned char unlock_key1; /* Unlock Key 1 */ | 155 | unsigned char unlock_key1; /* Unlock Key 1 (ADP5589 only) */ |
181 | unsigned char unlock_key2; /* Unlock Key 2 */ | 156 | unsigned char unlock_key2; /* Unlock Key 2 (ADP5589 only) */ |
182 | unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable */ | 157 | unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable (ADP5589 only) */ |
183 | unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ | 158 | unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ |
184 | unsigned char reset_cfg; /* Reset config */ | 159 | unsigned char reset_cfg; /* Reset config */ |
185 | unsigned short reset1_key_1; /* Reset Key 1 */ | 160 | unsigned short reset1_key_1; /* Reset Key 1 */ |
diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h index df00d998a44a..57e01a7cb006 100644 --- a/include/linux/input/adxl34x.h +++ b/include/linux/input/adxl34x.h | |||
@@ -30,8 +30,9 @@ struct adxl34x_platform_data { | |||
30 | * Y, or Z participation in Tap detection. A '0' excludes the | 30 | * Y, or Z participation in Tap detection. A '0' excludes the |
31 | * selected axis from participation in Tap detection. | 31 | * selected axis from participation in Tap detection. |
32 | * Setting the SUPPRESS bit suppresses Double Tap detection if | 32 | * Setting the SUPPRESS bit suppresses Double Tap detection if |
33 | * acceleration greater than tap_threshold is present between | 33 | * acceleration greater than tap_threshold is present during the |
34 | * taps. | 34 | * tap_latency period, i.e. after the first tap but before the |
35 | * opening of the second tap window. | ||
35 | */ | 36 | */ |
36 | 37 | ||
37 | #define ADXL_SUPPRESS (1 << 3) | 38 | #define ADXL_SUPPRESS (1 << 3) |
@@ -226,13 +227,13 @@ struct adxl34x_platform_data { | |||
226 | * detection will begin and prevent the detection of activity. This | 227 | * detection will begin and prevent the detection of activity. This |
227 | * bit serially links the activity and inactivity functions. When '0' | 228 | * bit serially links the activity and inactivity functions. When '0' |
228 | * the inactivity and activity functions are concurrent. Additional | 229 | * the inactivity and activity functions are concurrent. Additional |
229 | * information can be found in the Application section under Link | 230 | * information can be found in the ADXL34x datasheet's Application |
230 | * Mode. | 231 | * section under Link Mode. |
231 | * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode | 232 | * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode |
232 | * when inactivity (acceleration has been below inactivity_threshold | 233 | * when inactivity (acceleration has been below inactivity_threshold |
233 | * for at least inactivity_time) is detected and the LINK bit is set. | 234 | * for at least inactivity_time) is detected and the LINK bit is set. |
234 | * A '0' disables automatic switching to Sleep Mode. See SLEEP | 235 | * A '0' disables automatic switching to Sleep Mode. See the |
235 | * for further description. | 236 | * Sleep Bit section of the ADXL34x datasheet for more information. |
236 | */ | 237 | */ |
237 | 238 | ||
238 | #define ADXL_LINK (1 << 5) | 239 | #define ADXL_LINK (1 << 5) |
@@ -266,6 +267,12 @@ struct adxl34x_platform_data { | |||
266 | 267 | ||
267 | u8 watermark; | 268 | u8 watermark; |
268 | 269 | ||
270 | /* | ||
271 | * When acceleration measurements are received from the ADXL34x | ||
272 | * events are sent to the event subsystem. The following settings | ||
273 | * select the event type and event code for new x, y and z axis data | ||
274 | * respectively. | ||
275 | */ | ||
269 | u32 ev_type; /* EV_ABS or EV_REL */ | 276 | u32 ev_type; /* EV_ABS or EV_REL */ |
270 | 277 | ||
271 | u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ | 278 | u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ |
@@ -289,7 +296,7 @@ struct adxl34x_platform_data { | |||
289 | u32 ev_code_act_inactivity; /* EV_KEY */ | 296 | u32 ev_code_act_inactivity; /* EV_KEY */ |
290 | 297 | ||
291 | /* | 298 | /* |
292 | * Use ADXL34x INT2 instead of INT1 | 299 | * Use ADXL34x INT2 pin instead of INT1 pin for interrupt output |
293 | */ | 300 | */ |
294 | u8 use_int2; | 301 | u8 use_int2; |
295 | 302 | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index c81ed2ac16bd..e44e84f0156c 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
@@ -117,6 +117,8 @@ io_mapping_unmap(void __iomem *vaddr) | |||
117 | 117 | ||
118 | #else | 118 | #else |
119 | 119 | ||
120 | #include <linux/uaccess.h> | ||
121 | |||
120 | /* this struct isn't actually defined anywhere */ | 122 | /* this struct isn't actually defined anywhere */ |
121 | struct io_mapping; | 123 | struct io_mapping; |
122 | 124 | ||
@@ -138,12 +140,14 @@ static inline void __iomem * | |||
138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, | 140 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
139 | unsigned long offset) | 141 | unsigned long offset) |
140 | { | 142 | { |
143 | pagefault_disable(); | ||
141 | return ((char __force __iomem *) mapping) + offset; | 144 | return ((char __force __iomem *) mapping) + offset; |
142 | } | 145 | } |
143 | 146 | ||
144 | static inline void | 147 | static inline void |
145 | io_mapping_unmap_atomic(void __iomem *vaddr) | 148 | io_mapping_unmap_atomic(void __iomem *vaddr) |
146 | { | 149 | { |
150 | pagefault_enable(); | ||
147 | } | 151 | } |
148 | 152 | ||
149 | /* Non-atomic map/unmap */ | 153 | /* Non-atomic map/unmap */ |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9940319d6f9d..432acc4c054d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -25,15 +25,29 @@ | |||
25 | #define IOMMU_WRITE (2) | 25 | #define IOMMU_WRITE (2) |
26 | #define IOMMU_CACHE (4) /* DMA cache coherency */ | 26 | #define IOMMU_CACHE (4) /* DMA cache coherency */ |
27 | 27 | ||
28 | struct iommu_ops; | ||
29 | struct bus_type; | ||
28 | struct device; | 30 | struct device; |
31 | struct iommu_domain; | ||
32 | |||
33 | /* iommu fault flags */ | ||
34 | #define IOMMU_FAULT_READ 0x0 | ||
35 | #define IOMMU_FAULT_WRITE 0x1 | ||
36 | |||
37 | typedef int (*iommu_fault_handler_t)(struct iommu_domain *, | ||
38 | struct device *, unsigned long, int); | ||
29 | 39 | ||
30 | struct iommu_domain { | 40 | struct iommu_domain { |
41 | struct iommu_ops *ops; | ||
31 | void *priv; | 42 | void *priv; |
43 | iommu_fault_handler_t handler; | ||
32 | }; | 44 | }; |
33 | 45 | ||
34 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 | 46 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 |
35 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 47 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
36 | 48 | ||
49 | #ifdef CONFIG_IOMMU_API | ||
50 | |||
37 | struct iommu_ops { | 51 | struct iommu_ops { |
38 | int (*domain_init)(struct iommu_domain *domain); | 52 | int (*domain_init)(struct iommu_domain *domain); |
39 | void (*domain_destroy)(struct iommu_domain *domain); | 53 | void (*domain_destroy)(struct iommu_domain *domain); |
@@ -49,11 +63,9 @@ struct iommu_ops { | |||
49 | unsigned long cap); | 63 | unsigned long cap); |
50 | }; | 64 | }; |
51 | 65 | ||
52 | #ifdef CONFIG_IOMMU_API | 66 | extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); |
53 | 67 | extern bool iommu_present(struct bus_type *bus); | |
54 | extern void register_iommu(struct iommu_ops *ops); | 68 | extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); |
55 | extern bool iommu_found(void); | ||
56 | extern struct iommu_domain *iommu_domain_alloc(void); | ||
57 | extern void iommu_domain_free(struct iommu_domain *domain); | 69 | extern void iommu_domain_free(struct iommu_domain *domain); |
58 | extern int iommu_attach_device(struct iommu_domain *domain, | 70 | extern int iommu_attach_device(struct iommu_domain *domain, |
59 | struct device *dev); | 71 | struct device *dev); |
@@ -67,19 +79,58 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | |||
67 | unsigned long iova); | 79 | unsigned long iova); |
68 | extern int iommu_domain_has_cap(struct iommu_domain *domain, | 80 | extern int iommu_domain_has_cap(struct iommu_domain *domain, |
69 | unsigned long cap); | 81 | unsigned long cap); |
82 | extern void iommu_set_fault_handler(struct iommu_domain *domain, | ||
83 | iommu_fault_handler_t handler); | ||
84 | |||
85 | /** | ||
86 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | ||
87 | * @domain: the iommu domain where the fault has happened | ||
88 | * @dev: the device where the fault has happened | ||
89 | * @iova: the faulting address | ||
90 | * @flags: mmu fault flags (e.g. IOMMU_FAULT_READ/IOMMU_FAULT_WRITE/...) | ||
91 | * | ||
92 | * This function should be called by the low-level IOMMU implementations | ||
93 | * whenever IOMMU faults happen, to allow high-level users, that are | ||
94 | * interested in such events, to know about them. | ||
95 | * | ||
96 | * This event may be useful for several possible use cases: | ||
97 | * - mere logging of the event | ||
98 | * - dynamic TLB/PTE loading | ||
99 | * - if restarting of the faulting device is required | ||
100 | * | ||
101 | * Returns 0 on success and an appropriate error code otherwise (if dynamic | ||
102 | * PTE/TLB loading will one day be supported, implementations will be able | ||
103 | * to tell whether it succeeded or not according to this return value). | ||
104 | * | ||
105 | * Specifically, -ENOSYS is returned if a fault handler isn't installed | ||
106 | * (though fault handlers can also return -ENOSYS, in case they want to | ||
107 | * elicit the default behavior of the IOMMU drivers). | ||
108 | */ | ||
109 | static inline int report_iommu_fault(struct iommu_domain *domain, | ||
110 | struct device *dev, unsigned long iova, int flags) | ||
111 | { | ||
112 | int ret = -ENOSYS; | ||
70 | 113 | ||
71 | #else /* CONFIG_IOMMU_API */ | 114 | /* |
115 | * if upper layers showed interest and installed a fault handler, | ||
116 | * invoke it. | ||
117 | */ | ||
118 | if (domain->handler) | ||
119 | ret = domain->handler(domain, dev, iova, flags); | ||
72 | 120 | ||
73 | static inline void register_iommu(struct iommu_ops *ops) | 121 | return ret; |
74 | { | ||
75 | } | 122 | } |
76 | 123 | ||
77 | static inline bool iommu_found(void) | 124 | #else /* CONFIG_IOMMU_API */ |
125 | |||
126 | struct iommu_ops {}; | ||
127 | |||
128 | static inline bool iommu_present(struct bus_type *bus) | ||
78 | { | 129 | { |
79 | return false; | 130 | return false; |
80 | } | 131 | } |
81 | 132 | ||
82 | static inline struct iommu_domain *iommu_domain_alloc(void) | 133 | static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) |
83 | { | 134 | { |
84 | return NULL; | 135 | return NULL; |
85 | } | 136 | } |
@@ -123,6 +174,11 @@ static inline int domain_has_cap(struct iommu_domain *domain, | |||
123 | return 0; | 174 | return 0; |
124 | } | 175 | } |
125 | 176 | ||
177 | static inline void iommu_set_fault_handler(struct iommu_domain *domain, | ||
178 | iommu_fault_handler_t handler) | ||
179 | { | ||
180 | } | ||
181 | |||
126 | #endif /* CONFIG_IOMMU_API */ | 182 | #endif /* CONFIG_IOMMU_API */ |
127 | 183 | ||
128 | #endif /* __LINUX_IOMMU_H */ | 184 | #endif /* __LINUX_IOMMU_H */ |
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 3ad553e8eae2..99834e581b9e 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
@@ -47,6 +47,7 @@ struct irq_domain_ops { | |||
47 | * of the irq_domain is responsible for allocating the array of | 47 | * of the irq_domain is responsible for allocating the array of |
48 | * irq_desc structures. | 48 | * irq_desc structures. |
49 | * @nr_irq: Number of irqs managed by the irq domain | 49 | * @nr_irq: Number of irqs managed by the irq domain |
50 | * @hwirq_base: Starting number for hwirqs managed by the irq domain | ||
50 | * @ops: pointer to irq_domain methods | 51 | * @ops: pointer to irq_domain methods |
51 | * @priv: private data pointer for use by owner. Not touched by irq_domain | 52 | * @priv: private data pointer for use by owner. Not touched by irq_domain |
52 | * core code. | 53 | * core code. |
@@ -57,6 +58,7 @@ struct irq_domain { | |||
57 | struct list_head list; | 58 | struct list_head list; |
58 | unsigned int irq_base; | 59 | unsigned int irq_base; |
59 | unsigned int nr_irq; | 60 | unsigned int nr_irq; |
61 | unsigned int hwirq_base; | ||
60 | const struct irq_domain_ops *ops; | 62 | const struct irq_domain_ops *ops; |
61 | void *priv; | 63 | void *priv; |
62 | struct device_node *of_node; | 64 | struct device_node *of_node; |
@@ -72,9 +74,21 @@ struct irq_domain { | |||
72 | static inline unsigned int irq_domain_to_irq(struct irq_domain *d, | 74 | static inline unsigned int irq_domain_to_irq(struct irq_domain *d, |
73 | unsigned long hwirq) | 75 | unsigned long hwirq) |
74 | { | 76 | { |
75 | return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq; | 77 | if (d->ops->to_irq) |
78 | return d->ops->to_irq(d, hwirq); | ||
79 | if (WARN_ON(hwirq < d->hwirq_base)) | ||
80 | return 0; | ||
81 | return d->irq_base + hwirq - d->hwirq_base; | ||
76 | } | 82 | } |
77 | 83 | ||
84 | #define irq_domain_for_each_hwirq(d, hw) \ | ||
85 | for (hw = d->hwirq_base; hw < d->hwirq_base + d->nr_irq; hw++) | ||
86 | |||
87 | #define irq_domain_for_each_irq(d, hw, irq) \ | ||
88 | for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \ | ||
89 | hw < d->hwirq_base + d->nr_irq; \ | ||
90 | hw++, irq = irq_domain_to_irq(d, hw)) | ||
91 | |||
78 | extern void irq_domain_add(struct irq_domain *domain); | 92 | extern void irq_domain_add(struct irq_domain *domain); |
79 | extern void irq_domain_del(struct irq_domain *domain); | 93 | extern void irq_domain_del(struct irq_domain *domain); |
80 | #endif /* CONFIG_IRQ_DOMAIN */ | 94 | #endif /* CONFIG_IRQ_DOMAIN */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index e6a5e34bed4f..c7acdde3243d 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -244,6 +244,7 @@ typedef struct journal_superblock_s | |||
244 | 244 | ||
245 | #include <linux/fs.h> | 245 | #include <linux/fs.h> |
246 | #include <linux/sched.h> | 246 | #include <linux/sched.h> |
247 | #include <linux/jbd_common.h> | ||
247 | 248 | ||
248 | #define J_ASSERT(assert) BUG_ON(!(assert)) | 249 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
249 | 250 | ||
@@ -270,69 +271,6 @@ typedef struct journal_superblock_s | |||
270 | #define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) | 271 | #define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) |
271 | #endif | 272 | #endif |
272 | 273 | ||
273 | enum jbd_state_bits { | ||
274 | BH_JBD /* Has an attached ext3 journal_head */ | ||
275 | = BH_PrivateStart, | ||
276 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
277 | BH_Freed, /* Has been freed (truncated) */ | ||
278 | BH_Revoked, /* Has been revoked from the log */ | ||
279 | BH_RevokeValid, /* Revoked flag is valid */ | ||
280 | BH_JBDDirty, /* Is dirty but journaled */ | ||
281 | BH_State, /* Pins most journal_head state */ | ||
282 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
283 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
284 | }; | ||
285 | |||
286 | BUFFER_FNS(JBD, jbd) | ||
287 | BUFFER_FNS(JWrite, jwrite) | ||
288 | BUFFER_FNS(JBDDirty, jbddirty) | ||
289 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
290 | BUFFER_FNS(Revoked, revoked) | ||
291 | TAS_BUFFER_FNS(Revoked, revoked) | ||
292 | BUFFER_FNS(RevokeValid, revokevalid) | ||
293 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
294 | BUFFER_FNS(Freed, freed) | ||
295 | |||
296 | static inline struct buffer_head *jh2bh(struct journal_head *jh) | ||
297 | { | ||
298 | return jh->b_bh; | ||
299 | } | ||
300 | |||
301 | static inline struct journal_head *bh2jh(struct buffer_head *bh) | ||
302 | { | ||
303 | return bh->b_private; | ||
304 | } | ||
305 | |||
306 | static inline void jbd_lock_bh_state(struct buffer_head *bh) | ||
307 | { | ||
308 | bit_spin_lock(BH_State, &bh->b_state); | ||
309 | } | ||
310 | |||
311 | static inline int jbd_trylock_bh_state(struct buffer_head *bh) | ||
312 | { | ||
313 | return bit_spin_trylock(BH_State, &bh->b_state); | ||
314 | } | ||
315 | |||
316 | static inline int jbd_is_locked_bh_state(struct buffer_head *bh) | ||
317 | { | ||
318 | return bit_spin_is_locked(BH_State, &bh->b_state); | ||
319 | } | ||
320 | |||
321 | static inline void jbd_unlock_bh_state(struct buffer_head *bh) | ||
322 | { | ||
323 | bit_spin_unlock(BH_State, &bh->b_state); | ||
324 | } | ||
325 | |||
326 | static inline void jbd_lock_bh_journal_head(struct buffer_head *bh) | ||
327 | { | ||
328 | bit_spin_lock(BH_JournalHead, &bh->b_state); | ||
329 | } | ||
330 | |||
331 | static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh) | ||
332 | { | ||
333 | bit_spin_unlock(BH_JournalHead, &bh->b_state); | ||
334 | } | ||
335 | |||
336 | struct jbd_revoke_table_s; | 274 | struct jbd_revoke_table_s; |
337 | 275 | ||
338 | /** | 276 | /** |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 38f307b8c334..2092ea21e469 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -275,6 +275,7 @@ typedef struct journal_superblock_s | |||
275 | 275 | ||
276 | #include <linux/fs.h> | 276 | #include <linux/fs.h> |
277 | #include <linux/sched.h> | 277 | #include <linux/sched.h> |
278 | #include <linux/jbd_common.h> | ||
278 | 279 | ||
279 | #define J_ASSERT(assert) BUG_ON(!(assert)) | 280 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
280 | 281 | ||
@@ -302,70 +303,6 @@ typedef struct journal_superblock_s | |||
302 | #define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) | 303 | #define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) |
303 | #endif | 304 | #endif |
304 | 305 | ||
305 | enum jbd_state_bits { | ||
306 | BH_JBD /* Has an attached ext3 journal_head */ | ||
307 | = BH_PrivateStart, | ||
308 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
309 | BH_Freed, /* Has been freed (truncated) */ | ||
310 | BH_Revoked, /* Has been revoked from the log */ | ||
311 | BH_RevokeValid, /* Revoked flag is valid */ | ||
312 | BH_JBDDirty, /* Is dirty but journaled */ | ||
313 | BH_State, /* Pins most journal_head state */ | ||
314 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
315 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
316 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
317 | }; | ||
318 | |||
319 | BUFFER_FNS(JBD, jbd) | ||
320 | BUFFER_FNS(JWrite, jwrite) | ||
321 | BUFFER_FNS(JBDDirty, jbddirty) | ||
322 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
323 | BUFFER_FNS(Revoked, revoked) | ||
324 | TAS_BUFFER_FNS(Revoked, revoked) | ||
325 | BUFFER_FNS(RevokeValid, revokevalid) | ||
326 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
327 | BUFFER_FNS(Freed, freed) | ||
328 | |||
329 | static inline struct buffer_head *jh2bh(struct journal_head *jh) | ||
330 | { | ||
331 | return jh->b_bh; | ||
332 | } | ||
333 | |||
334 | static inline struct journal_head *bh2jh(struct buffer_head *bh) | ||
335 | { | ||
336 | return bh->b_private; | ||
337 | } | ||
338 | |||
339 | static inline void jbd_lock_bh_state(struct buffer_head *bh) | ||
340 | { | ||
341 | bit_spin_lock(BH_State, &bh->b_state); | ||
342 | } | ||
343 | |||
344 | static inline int jbd_trylock_bh_state(struct buffer_head *bh) | ||
345 | { | ||
346 | return bit_spin_trylock(BH_State, &bh->b_state); | ||
347 | } | ||
348 | |||
349 | static inline int jbd_is_locked_bh_state(struct buffer_head *bh) | ||
350 | { | ||
351 | return bit_spin_is_locked(BH_State, &bh->b_state); | ||
352 | } | ||
353 | |||
354 | static inline void jbd_unlock_bh_state(struct buffer_head *bh) | ||
355 | { | ||
356 | bit_spin_unlock(BH_State, &bh->b_state); | ||
357 | } | ||
358 | |||
359 | static inline void jbd_lock_bh_journal_head(struct buffer_head *bh) | ||
360 | { | ||
361 | bit_spin_lock(BH_JournalHead, &bh->b_state); | ||
362 | } | ||
363 | |||
364 | static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh) | ||
365 | { | ||
366 | bit_spin_unlock(BH_JournalHead, &bh->b_state); | ||
367 | } | ||
368 | |||
369 | /* Flags in jbd_inode->i_flags */ | 306 | /* Flags in jbd_inode->i_flags */ |
370 | #define __JI_COMMIT_RUNNING 0 | 307 | #define __JI_COMMIT_RUNNING 0 |
371 | /* Commit of the inode data in progress. We use this flag to protect us from | 308 | /* Commit of the inode data in progress. We use this flag to protect us from |
@@ -1106,9 +1043,9 @@ static inline handle_t *journal_current_handle(void) | |||
1106 | */ | 1043 | */ |
1107 | 1044 | ||
1108 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); | 1045 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
1109 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask); | 1046 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask); |
1110 | extern int jbd2_journal_restart(handle_t *, int nblocks); | 1047 | extern int jbd2_journal_restart(handle_t *, int nblocks); |
1111 | extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask); | 1048 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); |
1112 | extern int jbd2_journal_extend (handle_t *, int nblocks); | 1049 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
1113 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1050 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
1114 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1051 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
diff --git a/include/linux/jbd_common.h b/include/linux/jbd_common.h new file mode 100644 index 000000000000..6230f8556a4e --- /dev/null +++ b/include/linux/jbd_common.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #ifndef _LINUX_JBD_STATE_H | ||
2 | #define _LINUX_JBD_STATE_H | ||
3 | |||
4 | enum jbd_state_bits { | ||
5 | BH_JBD /* Has an attached ext3 journal_head */ | ||
6 | = BH_PrivateStart, | ||
7 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
8 | BH_Freed, /* Has been freed (truncated) */ | ||
9 | BH_Revoked, /* Has been revoked from the log */ | ||
10 | BH_RevokeValid, /* Revoked flag is valid */ | ||
11 | BH_JBDDirty, /* Is dirty but journaled */ | ||
12 | BH_State, /* Pins most journal_head state */ | ||
13 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
14 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
15 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
16 | }; | ||
17 | |||
18 | BUFFER_FNS(JBD, jbd) | ||
19 | BUFFER_FNS(JWrite, jwrite) | ||
20 | BUFFER_FNS(JBDDirty, jbddirty) | ||
21 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
22 | BUFFER_FNS(Revoked, revoked) | ||
23 | TAS_BUFFER_FNS(Revoked, revoked) | ||
24 | BUFFER_FNS(RevokeValid, revokevalid) | ||
25 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
26 | BUFFER_FNS(Freed, freed) | ||
27 | |||
28 | static inline struct buffer_head *jh2bh(struct journal_head *jh) | ||
29 | { | ||
30 | return jh->b_bh; | ||
31 | } | ||
32 | |||
33 | static inline struct journal_head *bh2jh(struct buffer_head *bh) | ||
34 | { | ||
35 | return bh->b_private; | ||
36 | } | ||
37 | |||
38 | static inline void jbd_lock_bh_state(struct buffer_head *bh) | ||
39 | { | ||
40 | bit_spin_lock(BH_State, &bh->b_state); | ||
41 | } | ||
42 | |||
43 | static inline int jbd_trylock_bh_state(struct buffer_head *bh) | ||
44 | { | ||
45 | return bit_spin_trylock(BH_State, &bh->b_state); | ||
46 | } | ||
47 | |||
48 | static inline int jbd_is_locked_bh_state(struct buffer_head *bh) | ||
49 | { | ||
50 | return bit_spin_is_locked(BH_State, &bh->b_state); | ||
51 | } | ||
52 | |||
53 | static inline void jbd_unlock_bh_state(struct buffer_head *bh) | ||
54 | { | ||
55 | bit_spin_unlock(BH_State, &bh->b_state); | ||
56 | } | ||
57 | |||
58 | static inline void jbd_lock_bh_journal_head(struct buffer_head *bh) | ||
59 | { | ||
60 | bit_spin_lock(BH_JournalHead, &bh->b_state); | ||
61 | } | ||
62 | |||
63 | static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh) | ||
64 | { | ||
65 | bit_spin_unlock(BH_JournalHead, &bh->b_state); | ||
66 | } | ||
67 | |||
68 | #endif | ||
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 0df513b7a9f8..387571959dd9 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -101,9 +101,8 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u | |||
101 | #endif /*CONFIG_KALLSYMS*/ | 101 | #endif /*CONFIG_KALLSYMS*/ |
102 | 102 | ||
103 | /* This macro allows us to keep printk typechecking */ | 103 | /* This macro allows us to keep printk typechecking */ |
104 | static void __check_printsym_format(const char *fmt, ...) | 104 | static __printf(1, 2) |
105 | __attribute__((format(printf,1,2))); | 105 | void __check_printsym_format(const char *fmt, ...) |
106 | static inline void __check_printsym_format(const char *fmt, ...) | ||
107 | { | 106 | { |
108 | } | 107 | } |
109 | 108 | ||
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index 529d9a0c75a5..064725854db8 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
@@ -114,12 +114,9 @@ typedef enum { | |||
114 | } kdb_reason_t; | 114 | } kdb_reason_t; |
115 | 115 | ||
116 | extern int kdb_trap_printk; | 116 | extern int kdb_trap_printk; |
117 | extern int vkdb_printf(const char *fmt, va_list args) | 117 | extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args); |
118 | __attribute__ ((format (printf, 1, 0))); | 118 | extern __printf(1, 2) int kdb_printf(const char *, ...); |
119 | extern int kdb_printf(const char *, ...) | 119 | typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...); |
120 | __attribute__ ((format (printf, 1, 2))); | ||
121 | typedef int (*kdb_printf_t)(const char *, ...) | ||
122 | __attribute__ ((format (printf, 1, 2))); | ||
123 | 120 | ||
124 | extern void kdb_init(int level); | 121 | extern void kdb_init(int level); |
125 | 122 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 8eefcf7e95eb..4c0d3b2fd5fc 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -287,6 +287,8 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t | |||
287 | return kstrtoint_from_user(s, count, base, res); | 287 | return kstrtoint_from_user(s, count, base, res); |
288 | } | 288 | } |
289 | 289 | ||
290 | /* Obsolete, do not use. Use kstrto<foo> instead */ | ||
291 | |||
290 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); | 292 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); |
291 | extern long simple_strtol(const char *,char **,unsigned int); | 293 | extern long simple_strtol(const char *,char **,unsigned int); |
292 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 294 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
@@ -296,20 +298,20 @@ extern long long simple_strtoll(const char *,char **,unsigned int); | |||
296 | #define strict_strtoull kstrtoull | 298 | #define strict_strtoull kstrtoull |
297 | #define strict_strtoll kstrtoll | 299 | #define strict_strtoll kstrtoll |
298 | 300 | ||
299 | extern int sprintf(char * buf, const char * fmt, ...) | 301 | /* lib/printf utilities */ |
300 | __attribute__ ((format (printf, 2, 3))); | 302 | |
301 | extern int vsprintf(char *buf, const char *, va_list) | 303 | extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...); |
302 | __attribute__ ((format (printf, 2, 0))); | 304 | extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list); |
303 | extern int snprintf(char * buf, size_t size, const char * fmt, ...) | 305 | extern __printf(3, 4) |
304 | __attribute__ ((format (printf, 3, 4))); | 306 | int snprintf(char *buf, size_t size, const char *fmt, ...); |
305 | extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | 307 | extern __printf(3, 0) |
306 | __attribute__ ((format (printf, 3, 0))); | 308 | int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); |
307 | extern int scnprintf(char * buf, size_t size, const char * fmt, ...) | 309 | extern __printf(3, 4) |
308 | __attribute__ ((format (printf, 3, 4))); | 310 | int scnprintf(char *buf, size_t size, const char *fmt, ...); |
309 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) | 311 | extern __printf(3, 0) |
310 | __attribute__ ((format (printf, 3, 0))); | 312 | int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); |
311 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) | 313 | extern __printf(2, 3) |
312 | __attribute__ ((format (printf, 2, 3))); | 314 | char *kasprintf(gfp_t gfp, const char *fmt, ...); |
313 | extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); | 315 | extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); |
314 | 316 | ||
315 | extern int sscanf(const char *, const char *, ...) | 317 | extern int sscanf(const char *, const char *, ...) |
@@ -374,13 +376,18 @@ extern const char hex_asc[]; | |||
374 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 376 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
375 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 377 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
376 | 378 | ||
377 | static inline char *pack_hex_byte(char *buf, u8 byte) | 379 | static inline char *hex_byte_pack(char *buf, u8 byte) |
378 | { | 380 | { |
379 | *buf++ = hex_asc_hi(byte); | 381 | *buf++ = hex_asc_hi(byte); |
380 | *buf++ = hex_asc_lo(byte); | 382 | *buf++ = hex_asc_lo(byte); |
381 | return buf; | 383 | return buf; |
382 | } | 384 | } |
383 | 385 | ||
386 | static inline char * __deprecated pack_hex_byte(char *buf, u8 byte) | ||
387 | { | ||
388 | return hex_byte_pack(buf, byte); | ||
389 | } | ||
390 | |||
384 | extern int hex_to_bin(char ch); | 391 | extern int hex_to_bin(char ch); |
385 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); | 392 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
386 | 393 | ||
@@ -427,8 +434,8 @@ extern void tracing_start(void); | |||
427 | extern void tracing_stop(void); | 434 | extern void tracing_stop(void); |
428 | extern void ftrace_off_permanent(void); | 435 | extern void ftrace_off_permanent(void); |
429 | 436 | ||
430 | static inline void __attribute__ ((format (printf, 1, 2))) | 437 | static inline __printf(1, 2) |
431 | ____trace_printk_check_format(const char *fmt, ...) | 438 | void ____trace_printk_check_format(const char *fmt, ...) |
432 | { | 439 | { |
433 | } | 440 | } |
434 | #define __trace_printk_check_format(fmt, args...) \ | 441 | #define __trace_printk_check_format(fmt, args...) \ |
@@ -467,13 +474,11 @@ do { \ | |||
467 | __trace_printk(_THIS_IP_, fmt, ##args); \ | 474 | __trace_printk(_THIS_IP_, fmt, ##args); \ |
468 | } while (0) | 475 | } while (0) |
469 | 476 | ||
470 | extern int | 477 | extern __printf(2, 3) |
471 | __trace_bprintk(unsigned long ip, const char *fmt, ...) | 478 | int __trace_bprintk(unsigned long ip, const char *fmt, ...); |
472 | __attribute__ ((format (printf, 2, 3))); | ||
473 | 479 | ||
474 | extern int | 480 | extern __printf(2, 3) |
475 | __trace_printk(unsigned long ip, const char *fmt, ...) | 481 | int __trace_printk(unsigned long ip, const char *fmt, ...); |
476 | __attribute__ ((format (printf, 2, 3))); | ||
477 | 482 | ||
478 | extern void trace_dump_stack(void); | 483 | extern void trace_dump_stack(void); |
479 | 484 | ||
@@ -502,8 +507,8 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | |||
502 | 507 | ||
503 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); | 508 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); |
504 | #else | 509 | #else |
505 | static inline int | 510 | static inline __printf(1, 2) |
506 | trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); | 511 | int trace_printk(const char *fmt, ...); |
507 | 512 | ||
508 | static inline void tracing_start(void) { } | 513 | static inline void tracing_start(void) { } |
509 | static inline void tracing_stop(void) { } | 514 | static inline void tracing_stop(void) { } |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index c2478a342cd7..2fa0901219d4 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -33,6 +33,14 @@ | |||
33 | #error KEXEC_ARCH not defined | 33 | #error KEXEC_ARCH not defined |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #ifndef KEXEC_CRASH_CONTROL_MEMORY_LIMIT | ||
37 | #define KEXEC_CRASH_CONTROL_MEMORY_LIMIT KEXEC_CONTROL_MEMORY_LIMIT | ||
38 | #endif | ||
39 | |||
40 | #ifndef KEXEC_CRASH_MEM_ALIGN | ||
41 | #define KEXEC_CRASH_MEM_ALIGN PAGE_SIZE | ||
42 | #endif | ||
43 | |||
36 | #define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) | 44 | #define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) |
37 | #define KEXEC_CORE_NOTE_NAME "CORE" | 45 | #define KEXEC_CORE_NOTE_NAME "CORE" |
38 | #define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4) | 46 | #define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4) |
@@ -129,9 +137,11 @@ extern void crash_kexec(struct pt_regs *); | |||
129 | int kexec_should_crash(struct task_struct *); | 137 | int kexec_should_crash(struct task_struct *); |
130 | void crash_save_cpu(struct pt_regs *regs, int cpu); | 138 | void crash_save_cpu(struct pt_regs *regs, int cpu); |
131 | void crash_save_vmcoreinfo(void); | 139 | void crash_save_vmcoreinfo(void); |
140 | void crash_map_reserved_pages(void); | ||
141 | void crash_unmap_reserved_pages(void); | ||
132 | void arch_crash_save_vmcoreinfo(void); | 142 | void arch_crash_save_vmcoreinfo(void); |
133 | void vmcoreinfo_append_str(const char *fmt, ...) | 143 | __printf(1, 2) |
134 | __attribute__ ((format (printf, 1, 2))); | 144 | void vmcoreinfo_append_str(const char *fmt, ...); |
135 | unsigned long paddr_vmcoreinfo_note(void); | 145 | unsigned long paddr_vmcoreinfo_note(void); |
136 | 146 | ||
137 | #define VMCOREINFO_OSRELEASE(value) \ | 147 | #define VMCOREINFO_OSRELEASE(value) \ |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 0da38cf7db7b..b16f65390734 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -32,8 +32,8 @@ | |||
32 | extern char modprobe_path[]; /* for sysctl */ | 32 | extern char modprobe_path[]; /* for sysctl */ |
33 | /* modprobe exit status on success, -ve on error. Return value | 33 | /* modprobe exit status on success, -ve on error. Return value |
34 | * usually useless though. */ | 34 | * usually useless though. */ |
35 | extern int __request_module(bool wait, const char *name, ...) \ | 35 | extern __printf(2, 3) |
36 | __attribute__((format(printf, 2, 3))); | 36 | int __request_module(bool wait, const char *name, ...); |
37 | #define request_module(mod...) __request_module(true, mod) | 37 | #define request_module(mod...) __request_module(true, mod) |
38 | #define request_module_nowait(mod...) __request_module(false, mod) | 38 | #define request_module_nowait(mod...) __request_module(false, mod) |
39 | #define try_then_request_module(x, mod...) \ | 39 | #define try_then_request_module(x, mod...) \ |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 668729cc0fe9..ad81e1c51487 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -72,8 +72,8 @@ struct kobject { | |||
72 | unsigned int uevent_suppress:1; | 72 | unsigned int uevent_suppress:1; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | extern int kobject_set_name(struct kobject *kobj, const char *name, ...) | 75 | extern __printf(2, 3) |
76 | __attribute__((format(printf, 2, 3))); | 76 | int kobject_set_name(struct kobject *kobj, const char *name, ...); |
77 | extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, | 77 | extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, |
78 | va_list vargs); | 78 | va_list vargs); |
79 | 79 | ||
@@ -83,15 +83,13 @@ static inline const char *kobject_name(const struct kobject *kobj) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); | 85 | extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); |
86 | extern int __must_check kobject_add(struct kobject *kobj, | 86 | extern __printf(3, 4) __must_check |
87 | struct kobject *parent, | 87 | int kobject_add(struct kobject *kobj, struct kobject *parent, |
88 | const char *fmt, ...) | 88 | const char *fmt, ...); |
89 | __attribute__((format(printf, 3, 4))); | 89 | extern __printf(4, 5) __must_check |
90 | extern int __must_check kobject_init_and_add(struct kobject *kobj, | 90 | int kobject_init_and_add(struct kobject *kobj, |
91 | struct kobj_type *ktype, | 91 | struct kobj_type *ktype, struct kobject *parent, |
92 | struct kobject *parent, | 92 | const char *fmt, ...); |
93 | const char *fmt, ...) | ||
94 | __attribute__((format(printf, 4, 5))); | ||
95 | 93 | ||
96 | extern void kobject_del(struct kobject *kobj); | 94 | extern void kobject_del(struct kobject *kobj); |
97 | 95 | ||
@@ -212,8 +210,8 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action); | |||
212 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | 210 | int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, |
213 | char *envp[]); | 211 | char *envp[]); |
214 | 212 | ||
215 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | 213 | __printf(2, 3) |
216 | __attribute__((format (printf, 2, 3))); | 214 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); |
217 | 215 | ||
218 | int kobject_action_type(const char *buf, size_t count, | 216 | int kobject_action_type(const char *buf, size_t count, |
219 | enum kobject_action *type); | 217 | enum kobject_action *type); |
@@ -226,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj, | |||
226 | char *envp[]) | 224 | char *envp[]) |
227 | { return 0; } | 225 | { return 0; } |
228 | 226 | ||
229 | static inline __attribute__((format(printf, 2, 3))) | 227 | static inline __printf(2, 3) |
230 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | 228 | int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) |
231 | { return 0; } | 229 | { return 0; } |
232 | 230 | ||
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 1e923e5e88e8..5cac19b3a266 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -4,11 +4,11 @@ | |||
4 | #include <linux/err.h> | 4 | #include <linux/err.h> |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | __printf(4, 5) | ||
7 | struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), | 8 | struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), |
8 | void *data, | 9 | void *data, |
9 | int node, | 10 | int node, |
10 | const char namefmt[], ...) | 11 | const char namefmt[], ...); |
11 | __attribute__((format(printf, 4, 5))); | ||
12 | 12 | ||
13 | #define kthread_create(threadfn, data, namefmt, arg...) \ | 13 | #define kthread_create(threadfn, data, namefmt, arg...) \ |
14 | kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) | 14 | kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index aace6b8691a2..f47fcd30273d 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -371,6 +371,7 @@ struct kvm_s390_psw { | |||
371 | #define KVM_S390_INT_VIRTIO 0xffff2603u | 371 | #define KVM_S390_INT_VIRTIO 0xffff2603u |
372 | #define KVM_S390_INT_SERVICE 0xffff2401u | 372 | #define KVM_S390_INT_SERVICE 0xffff2401u |
373 | #define KVM_S390_INT_EMERGENCY 0xffff1201u | 373 | #define KVM_S390_INT_EMERGENCY 0xffff1201u |
374 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u | ||
374 | 375 | ||
375 | struct kvm_s390_interrupt { | 376 | struct kvm_s390_interrupt { |
376 | __u32 type; | 377 | __u32 type; |
@@ -463,7 +464,7 @@ struct kvm_ppc_pvinfo { | |||
463 | #define KVM_CAP_VAPIC 6 | 464 | #define KVM_CAP_VAPIC 6 |
464 | #define KVM_CAP_EXT_CPUID 7 | 465 | #define KVM_CAP_EXT_CPUID 7 |
465 | #define KVM_CAP_CLOCKSOURCE 8 | 466 | #define KVM_CAP_CLOCKSOURCE 8 |
466 | #define KVM_CAP_NR_VCPUS 9 /* returns max vcpus per vm */ | 467 | #define KVM_CAP_NR_VCPUS 9 /* returns recommended max vcpus per vm */ |
467 | #define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */ | 468 | #define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */ |
468 | #define KVM_CAP_PIT 11 | 469 | #define KVM_CAP_PIT 11 |
469 | #define KVM_CAP_NOP_IO_DELAY 12 | 470 | #define KVM_CAP_NOP_IO_DELAY 12 |
@@ -553,6 +554,9 @@ struct kvm_ppc_pvinfo { | |||
553 | #define KVM_CAP_SPAPR_TCE 63 | 554 | #define KVM_CAP_SPAPR_TCE 63 |
554 | #define KVM_CAP_PPC_SMT 64 | 555 | #define KVM_CAP_PPC_SMT 64 |
555 | #define KVM_CAP_PPC_RMA 65 | 556 | #define KVM_CAP_PPC_RMA 65 |
557 | #define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */ | ||
558 | #define KVM_CAP_PPC_HIOR 67 | ||
559 | #define KVM_CAP_PPC_PAPR 68 | ||
556 | #define KVM_CAP_S390_GMAP 71 | 560 | #define KVM_CAP_S390_GMAP 71 |
557 | 561 | ||
558 | #ifdef KVM_CAP_IRQ_ROUTING | 562 | #ifdef KVM_CAP_IRQ_ROUTING |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index eabb21a30c34..d52623199978 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/msi.h> | 18 | #include <linux/msi.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/rcupdate.h> | 20 | #include <linux/rcupdate.h> |
21 | #include <linux/ratelimit.h> | ||
21 | #include <asm/signal.h> | 22 | #include <asm/signal.h> |
22 | 23 | ||
23 | #include <linux/kvm.h> | 24 | #include <linux/kvm.h> |
@@ -48,6 +49,7 @@ | |||
48 | #define KVM_REQ_EVENT 11 | 49 | #define KVM_REQ_EVENT 11 |
49 | #define KVM_REQ_APF_HALT 12 | 50 | #define KVM_REQ_APF_HALT 12 |
50 | #define KVM_REQ_STEAL_UPDATE 13 | 51 | #define KVM_REQ_STEAL_UPDATE 13 |
52 | #define KVM_REQ_NMI 14 | ||
51 | 53 | ||
52 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 54 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
53 | 55 | ||
@@ -55,16 +57,16 @@ struct kvm; | |||
55 | struct kvm_vcpu; | 57 | struct kvm_vcpu; |
56 | extern struct kmem_cache *kvm_vcpu_cache; | 58 | extern struct kmem_cache *kvm_vcpu_cache; |
57 | 59 | ||
58 | /* | 60 | struct kvm_io_range { |
59 | * It would be nice to use something smarter than a linear search, TBD... | 61 | gpa_t addr; |
60 | * Thankfully we dont expect many devices to register (famous last words :), | 62 | int len; |
61 | * so until then it will suffice. At least its abstracted so we can change | 63 | struct kvm_io_device *dev; |
62 | * in one place. | 64 | }; |
63 | */ | 65 | |
64 | struct kvm_io_bus { | 66 | struct kvm_io_bus { |
65 | int dev_count; | 67 | int dev_count; |
66 | #define NR_IOBUS_DEVS 200 | 68 | #define NR_IOBUS_DEVS 300 |
67 | struct kvm_io_device *devs[NR_IOBUS_DEVS]; | 69 | struct kvm_io_range range[NR_IOBUS_DEVS]; |
68 | }; | 70 | }; |
69 | 71 | ||
70 | enum kvm_bus { | 72 | enum kvm_bus { |
@@ -77,8 +79,8 @@ int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | |||
77 | int len, const void *val); | 79 | int len, const void *val); |
78 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, | 80 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, |
79 | void *val); | 81 | void *val); |
80 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 82 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, |
81 | struct kvm_io_device *dev); | 83 | int len, struct kvm_io_device *dev); |
82 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 84 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
83 | struct kvm_io_device *dev); | 85 | struct kvm_io_device *dev); |
84 | 86 | ||
@@ -256,8 +258,9 @@ struct kvm { | |||
256 | struct kvm_arch arch; | 258 | struct kvm_arch arch; |
257 | atomic_t users_count; | 259 | atomic_t users_count; |
258 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | 260 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET |
259 | struct kvm_coalesced_mmio_dev *coalesced_mmio_dev; | ||
260 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; | 261 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; |
262 | spinlock_t ring_lock; | ||
263 | struct list_head coalesced_zones; | ||
261 | #endif | 264 | #endif |
262 | 265 | ||
263 | struct mutex irq_lock; | 266 | struct mutex irq_lock; |
@@ -281,11 +284,8 @@ struct kvm { | |||
281 | 284 | ||
282 | /* The guest did something we don't support. */ | 285 | /* The guest did something we don't support. */ |
283 | #define pr_unimpl(vcpu, fmt, ...) \ | 286 | #define pr_unimpl(vcpu, fmt, ...) \ |
284 | do { \ | 287 | pr_err_ratelimited("kvm: %i: cpu%i " fmt, \ |
285 | if (printk_ratelimit()) \ | 288 | current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__) |
286 | printk(KERN_ERR "kvm: %i: cpu%i " fmt, \ | ||
287 | current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__); \ | ||
288 | } while (0) | ||
289 | 289 | ||
290 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) | 290 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) |
291 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) | 291 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index efd6f9800762..cafc09a64fe4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1052,6 +1052,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev); | |||
1052 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); | 1052 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); |
1053 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, | 1053 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, |
1054 | int queue_depth, int reason); | 1054 | int queue_depth, int reason); |
1055 | extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, | ||
1056 | int queue_depth, int reason); | ||
1055 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); | 1057 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); |
1056 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); | 1058 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); |
1057 | extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); | 1059 | extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); |
@@ -1254,13 +1256,13 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1254 | /* | 1256 | /* |
1255 | * printk helpers | 1257 | * printk helpers |
1256 | */ | 1258 | */ |
1257 | __attribute__((format (printf, 3, 4))) | 1259 | __printf(3, 4) |
1258 | int ata_port_printk(const struct ata_port *ap, const char *level, | 1260 | int ata_port_printk(const struct ata_port *ap, const char *level, |
1259 | const char *fmt, ...); | 1261 | const char *fmt, ...); |
1260 | __attribute__((format (printf, 3, 4))) | 1262 | __printf(3, 4) |
1261 | int ata_link_printk(const struct ata_link *link, const char *level, | 1263 | int ata_link_printk(const struct ata_link *link, const char *level, |
1262 | const char *fmt, ...); | 1264 | const char *fmt, ...); |
1263 | __attribute__((format (printf, 3, 4))) | 1265 | __printf(3, 4) |
1264 | int ata_dev_printk(const struct ata_device *dev, const char *level, | 1266 | int ata_dev_printk(const struct ata_device *dev, const char *level, |
1265 | const char *fmt, ...); | 1267 | const char *fmt, ...); |
1266 | 1268 | ||
@@ -1302,10 +1304,10 @@ void ata_print_version(const struct device *dev, const char *version); | |||
1302 | /* | 1304 | /* |
1303 | * ata_eh_info helpers | 1305 | * ata_eh_info helpers |
1304 | */ | 1306 | */ |
1305 | extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...) | 1307 | extern __printf(2, 3) |
1306 | __attribute__ ((format (printf, 2, 3))); | 1308 | void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); |
1307 | extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...) | 1309 | extern __printf(2, 3) |
1308 | __attribute__ ((format (printf, 2, 3))); | 1310 | void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); |
1309 | extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); | 1311 | extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); |
1310 | 1312 | ||
1311 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | 1313 | static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) |
@@ -1319,8 +1321,8 @@ static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) | |||
1319 | /* | 1321 | /* |
1320 | * port description helpers | 1322 | * port description helpers |
1321 | */ | 1323 | */ |
1322 | extern void ata_port_desc(struct ata_port *ap, const char *fmt, ...) | 1324 | extern __printf(2, 3) |
1323 | __attribute__ ((format (printf, 2, 3))); | 1325 | void ata_port_desc(struct ata_port *ap, const char *fmt, ...); |
1324 | #ifdef CONFIG_PCI | 1326 | #ifdef CONFIG_PCI |
1325 | extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset, | 1327 | extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset, |
1326 | const char *name); | 1328 | const char *name); |
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h index d4292c8431e0..f1664c636af0 100644 --- a/include/linux/lis3lv02d.h +++ b/include/linux/lis3lv02d.h | |||
@@ -113,7 +113,6 @@ struct lis3lv02d_platform_data { | |||
113 | s8 axis_x; | 113 | s8 axis_x; |
114 | s8 axis_y; | 114 | s8 axis_y; |
115 | s8 axis_z; | 115 | s8 axis_z; |
116 | #define LIS3_USE_REGULATOR_CTRL 0x01 | ||
117 | #define LIS3_USE_BLOCK_READ 0x02 | 116 | #define LIS3_USE_BLOCK_READ 0x02 |
118 | u16 driver_features; | 117 | u16 driver_features; |
119 | int default_rate; | 118 | int default_rate; |
diff --git a/include/linux/llist.h b/include/linux/llist.h index 7287734e08d1..801b44b07aac 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
@@ -148,7 +148,7 @@ static inline struct llist_node *llist_next(struct llist_node *node) | |||
148 | * @new: new entry to be added | 148 | * @new: new entry to be added |
149 | * @head: the head for your lock-less list | 149 | * @head: the head for your lock-less list |
150 | * | 150 | * |
151 | * Return whether list is empty before adding. | 151 | * Returns true if the list was empty prior to adding this entry. |
152 | */ | 152 | */ |
153 | static inline bool llist_add(struct llist_node *new, struct llist_head *head) | 153 | static inline bool llist_add(struct llist_node *new, struct llist_head *head) |
154 | { | 154 | { |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 1e5df2af8d84..2d4beab0d5b7 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -30,11 +30,11 @@ | |||
30 | #define ANON_INODE_FS_MAGIC 0x09041934 | 30 | #define ANON_INODE_FS_MAGIC 0x09041934 |
31 | #define PSTOREFS_MAGIC 0x6165676C | 31 | #define PSTOREFS_MAGIC 0x6165676C |
32 | 32 | ||
33 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | 33 | #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ |
34 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | 34 | #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ |
35 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | 35 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix v2 fs, 14 char names */ |
36 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | 36 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix v2 fs, 30 char names */ |
37 | #define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */ | 37 | #define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */ |
38 | 38 | ||
39 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ | 39 | #define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ |
40 | #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ | 40 | #define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 7525e38c434d..e6b843e16e81 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -80,6 +80,7 @@ extern phys_addr_t __memblock_alloc_base(phys_addr_t size, | |||
80 | phys_addr_t align, | 80 | phys_addr_t align, |
81 | phys_addr_t max_addr); | 81 | phys_addr_t max_addr); |
82 | extern phys_addr_t memblock_phys_mem_size(void); | 82 | extern phys_addr_t memblock_phys_mem_size(void); |
83 | extern phys_addr_t memblock_start_of_DRAM(void); | ||
83 | extern phys_addr_t memblock_end_of_DRAM(void); | 84 | extern phys_addr_t memblock_end_of_DRAM(void); |
84 | extern void memblock_enforce_memory_limit(phys_addr_t memory_limit); | 85 | extern void memblock_enforce_memory_limit(phys_addr_t memory_limit); |
85 | extern int memblock_is_memory(phys_addr_t addr); | 86 | extern int memblock_is_memory(phys_addr_t addr); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 343bd7661f2a..b87068a1a09e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -35,7 +35,8 @@ enum mem_cgroup_page_stat_item { | |||
35 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 35 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
36 | struct list_head *dst, | 36 | struct list_head *dst, |
37 | unsigned long *scanned, int order, | 37 | unsigned long *scanned, int order, |
38 | int mode, struct zone *z, | 38 | isolate_mode_t mode, |
39 | struct zone *z, | ||
39 | struct mem_cgroup *mem_cont, | 40 | struct mem_cgroup *mem_cont, |
40 | int active, int file); | 41 | int active, int file); |
41 | 42 | ||
@@ -77,8 +78,8 @@ extern void mem_cgroup_uncharge_end(void); | |||
77 | extern void mem_cgroup_uncharge_page(struct page *page); | 78 | extern void mem_cgroup_uncharge_page(struct page *page); |
78 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 79 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
79 | 80 | ||
80 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 81 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask); |
81 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 82 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); |
82 | 83 | ||
83 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 84 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
84 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 85 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
@@ -87,26 +88,28 @@ extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); | |||
87 | static inline | 88 | static inline |
88 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | 89 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
89 | { | 90 | { |
90 | struct mem_cgroup *mem; | 91 | struct mem_cgroup *memcg; |
91 | rcu_read_lock(); | 92 | rcu_read_lock(); |
92 | mem = mem_cgroup_from_task(rcu_dereference((mm)->owner)); | 93 | memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner)); |
93 | rcu_read_unlock(); | 94 | rcu_read_unlock(); |
94 | return cgroup == mem; | 95 | return cgroup == memcg; |
95 | } | 96 | } |
96 | 97 | ||
97 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); | 98 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); |
98 | 99 | ||
99 | extern int | 100 | extern int |
100 | mem_cgroup_prepare_migration(struct page *page, | 101 | mem_cgroup_prepare_migration(struct page *page, |
101 | struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); | 102 | struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); |
102 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | 103 | extern void mem_cgroup_end_migration(struct mem_cgroup *memcg, |
103 | struct page *oldpage, struct page *newpage, bool migration_ok); | 104 | struct page *oldpage, struct page *newpage, bool migration_ok); |
104 | 105 | ||
105 | /* | 106 | /* |
106 | * For memory reclaim. | 107 | * For memory reclaim. |
107 | */ | 108 | */ |
108 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | 109 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, |
109 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | 110 | struct zone *zone); |
111 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, | ||
112 | struct zone *zone); | ||
110 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 113 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
111 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, | 114 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, |
112 | int nid, int zid, unsigned int lrumask); | 115 | int nid, int zid, unsigned int lrumask); |
@@ -147,7 +150,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
147 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 150 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
148 | gfp_t gfp_mask, | 151 | gfp_t gfp_mask, |
149 | unsigned long *total_scanned); | 152 | unsigned long *total_scanned); |
150 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | 153 | u64 mem_cgroup_get_limit(struct mem_cgroup *memcg); |
151 | 154 | ||
152 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); | 155 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); |
153 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 156 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
@@ -243,18 +246,20 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm | |||
243 | return NULL; | 246 | return NULL; |
244 | } | 247 | } |
245 | 248 | ||
246 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 249 | static inline int mm_match_cgroup(struct mm_struct *mm, |
250 | struct mem_cgroup *memcg) | ||
247 | { | 251 | { |
248 | return 1; | 252 | return 1; |
249 | } | 253 | } |
250 | 254 | ||
251 | static inline int task_in_mem_cgroup(struct task_struct *task, | 255 | static inline int task_in_mem_cgroup(struct task_struct *task, |
252 | const struct mem_cgroup *mem) | 256 | const struct mem_cgroup *memcg) |
253 | { | 257 | { |
254 | return 1; | 258 | return 1; |
255 | } | 259 | } |
256 | 260 | ||
257 | static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) | 261 | static inline struct cgroup_subsys_state |
262 | *mem_cgroup_css(struct mem_cgroup *memcg) | ||
258 | { | 263 | { |
259 | return NULL; | 264 | return NULL; |
260 | } | 265 | } |
@@ -266,22 +271,22 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage, | |||
266 | return 0; | 271 | return 0; |
267 | } | 272 | } |
268 | 273 | ||
269 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, | 274 | static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg, |
270 | struct page *oldpage, struct page *newpage, bool migration_ok) | 275 | struct page *oldpage, struct page *newpage, bool migration_ok) |
271 | { | 276 | { |
272 | } | 277 | } |
273 | 278 | ||
274 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) | 279 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg) |
275 | { | 280 | { |
276 | return 0; | 281 | return 0; |
277 | } | 282 | } |
278 | 283 | ||
279 | static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | 284 | static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg, |
280 | int priority) | 285 | int priority) |
281 | { | 286 | { |
282 | } | 287 | } |
283 | 288 | ||
284 | static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | 289 | static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg, |
285 | int priority) | 290 | int priority) |
286 | { | 291 | { |
287 | } | 292 | } |
@@ -292,13 +297,13 @@ static inline bool mem_cgroup_disabled(void) | |||
292 | } | 297 | } |
293 | 298 | ||
294 | static inline int | 299 | static inline int |
295 | mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) | 300 | mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) |
296 | { | 301 | { |
297 | return 1; | 302 | return 1; |
298 | } | 303 | } |
299 | 304 | ||
300 | static inline int | 305 | static inline int |
301 | mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | 306 | mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, struct zone *zone) |
302 | { | 307 | { |
303 | return 1; | 308 | return 1; |
304 | } | 309 | } |
@@ -347,7 +352,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | |||
347 | } | 352 | } |
348 | 353 | ||
349 | static inline | 354 | static inline |
350 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem) | 355 | u64 mem_cgroup_get_limit(struct mem_cgroup *memcg) |
351 | { | 356 | { |
352 | return 0; | 357 | return 0; |
353 | } | 358 | } |
diff --git a/include/linux/mfd/ab5500/ab5500.h b/include/linux/mfd/ab5500/ab5500.h new file mode 100644 index 000000000000..a720051ae933 --- /dev/null +++ b/include/linux/mfd/ab5500/ab5500.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson 2011 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | */ | ||
6 | #ifndef MFD_AB5500_H | ||
7 | #define MFD_AB5500_H | ||
8 | |||
9 | #include <linux/device.h> | ||
10 | |||
11 | enum ab5500_devid { | ||
12 | AB5500_DEVID_ADC, | ||
13 | AB5500_DEVID_LEDS, | ||
14 | AB5500_DEVID_POWER, | ||
15 | AB5500_DEVID_REGULATORS, | ||
16 | AB5500_DEVID_SIM, | ||
17 | AB5500_DEVID_RTC, | ||
18 | AB5500_DEVID_CHARGER, | ||
19 | AB5500_DEVID_FUELGAUGE, | ||
20 | AB5500_DEVID_VIBRATOR, | ||
21 | AB5500_DEVID_CODEC, | ||
22 | AB5500_DEVID_USB, | ||
23 | AB5500_DEVID_OTP, | ||
24 | AB5500_DEVID_VIDEO, | ||
25 | AB5500_DEVID_DBIECI, | ||
26 | AB5500_DEVID_ONSWA, | ||
27 | AB5500_NUM_DEVICES, | ||
28 | }; | ||
29 | |||
30 | enum ab5500_banks { | ||
31 | AB5500_BANK_VIT_IO_I2C_CLK_TST_OTP = 0, | ||
32 | AB5500_BANK_VDDDIG_IO_I2C_CLK_TST = 1, | ||
33 | AB5500_BANK_VDENC = 2, | ||
34 | AB5500_BANK_SIM_USBSIM = 3, | ||
35 | AB5500_BANK_LED = 4, | ||
36 | AB5500_BANK_ADC = 5, | ||
37 | AB5500_BANK_RTC = 6, | ||
38 | AB5500_BANK_STARTUP = 7, | ||
39 | AB5500_BANK_DBI_ECI = 8, | ||
40 | AB5500_BANK_CHG = 9, | ||
41 | AB5500_BANK_FG_BATTCOM_ACC = 10, | ||
42 | AB5500_BANK_USB = 11, | ||
43 | AB5500_BANK_IT = 12, | ||
44 | AB5500_BANK_VIBRA = 13, | ||
45 | AB5500_BANK_AUDIO_HEADSETUSB = 14, | ||
46 | AB5500_NUM_BANKS = 15, | ||
47 | }; | ||
48 | |||
49 | enum ab5500_banks_addr { | ||
50 | AB5500_ADDR_VIT_IO_I2C_CLK_TST_OTP = 0x4A, | ||
51 | AB5500_ADDR_VDDDIG_IO_I2C_CLK_TST = 0x4B, | ||
52 | AB5500_ADDR_VDENC = 0x06, | ||
53 | AB5500_ADDR_SIM_USBSIM = 0x04, | ||
54 | AB5500_ADDR_LED = 0x10, | ||
55 | AB5500_ADDR_ADC = 0x0A, | ||
56 | AB5500_ADDR_RTC = 0x0F, | ||
57 | AB5500_ADDR_STARTUP = 0x03, | ||
58 | AB5500_ADDR_DBI_ECI = 0x07, | ||
59 | AB5500_ADDR_CHG = 0x0B, | ||
60 | AB5500_ADDR_FG_BATTCOM_ACC = 0x0C, | ||
61 | AB5500_ADDR_USB = 0x05, | ||
62 | AB5500_ADDR_IT = 0x0E, | ||
63 | AB5500_ADDR_VIBRA = 0x02, | ||
64 | AB5500_ADDR_AUDIO_HEADSETUSB = 0x0D, | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * Interrupt register offsets | ||
69 | * Bank : 0x0E | ||
70 | */ | ||
71 | #define AB5500_IT_SOURCE0_REG 0x20 | ||
72 | #define AB5500_IT_SOURCE1_REG 0x21 | ||
73 | #define AB5500_IT_SOURCE2_REG 0x22 | ||
74 | #define AB5500_IT_SOURCE3_REG 0x23 | ||
75 | #define AB5500_IT_SOURCE4_REG 0x24 | ||
76 | #define AB5500_IT_SOURCE5_REG 0x25 | ||
77 | #define AB5500_IT_SOURCE6_REG 0x26 | ||
78 | #define AB5500_IT_SOURCE7_REG 0x27 | ||
79 | #define AB5500_IT_SOURCE8_REG 0x28 | ||
80 | #define AB5500_IT_SOURCE9_REG 0x29 | ||
81 | #define AB5500_IT_SOURCE10_REG 0x2A | ||
82 | #define AB5500_IT_SOURCE11_REG 0x2B | ||
83 | #define AB5500_IT_SOURCE12_REG 0x2C | ||
84 | #define AB5500_IT_SOURCE13_REG 0x2D | ||
85 | #define AB5500_IT_SOURCE14_REG 0x2E | ||
86 | #define AB5500_IT_SOURCE15_REG 0x2F | ||
87 | #define AB5500_IT_SOURCE16_REG 0x30 | ||
88 | #define AB5500_IT_SOURCE17_REG 0x31 | ||
89 | #define AB5500_IT_SOURCE18_REG 0x32 | ||
90 | #define AB5500_IT_SOURCE19_REG 0x33 | ||
91 | #define AB5500_IT_SOURCE20_REG 0x34 | ||
92 | #define AB5500_IT_SOURCE21_REG 0x35 | ||
93 | #define AB5500_IT_SOURCE22_REG 0x36 | ||
94 | #define AB5500_IT_SOURCE23_REG 0x37 | ||
95 | |||
96 | #define AB5500_NUM_IRQ_REGS 23 | ||
97 | |||
98 | /** | ||
99 | * struct ab5500 | ||
100 | * @access_mutex: lock out concurrent accesses to the AB registers | ||
101 | * @dev: a pointer to the device struct for this chip driver | ||
102 | * @ab5500_irq: the analog baseband irq | ||
103 | * @irq_base: the platform configuration irq base for subdevices | ||
104 | * @chip_name: name of this chip variant | ||
105 | * @chip_id: 8 bit chip ID for this chip variant | ||
106 | * @irq_lock: a lock to protect the mask | ||
107 | * @abb_events: a local bit mask of the prcmu wakeup events | ||
108 | * @event_mask: a local copy of the mask event registers | ||
109 | * @last_event_mask: a copy of the last event_mask written to hardware | ||
110 | * @startup_events: a copy of the first reading of the event registers | ||
111 | * @startup_events_read: whether the first events have been read | ||
112 | */ | ||
113 | struct ab5500 { | ||
114 | struct mutex access_mutex; | ||
115 | struct device *dev; | ||
116 | unsigned int ab5500_irq; | ||
117 | unsigned int irq_base; | ||
118 | char chip_name[32]; | ||
119 | u8 chip_id; | ||
120 | struct mutex irq_lock; | ||
121 | u32 abb_events; | ||
122 | u8 mask[AB5500_NUM_IRQ_REGS]; | ||
123 | u8 oldmask[AB5500_NUM_IRQ_REGS]; | ||
124 | u8 startup_events[AB5500_NUM_IRQ_REGS]; | ||
125 | bool startup_events_read; | ||
126 | #ifdef CONFIG_DEBUG_FS | ||
127 | unsigned int debug_bank; | ||
128 | unsigned int debug_address; | ||
129 | #endif | ||
130 | }; | ||
131 | |||
132 | struct ab5500_platform_data { | ||
133 | struct {unsigned int base; unsigned int count; } irq; | ||
134 | void *dev_data[AB5500_NUM_DEVICES]; | ||
135 | struct abx500_init_settings *init_settings; | ||
136 | unsigned int init_settings_sz; | ||
137 | bool pm_power_off; | ||
138 | }; | ||
139 | |||
140 | #endif /* MFD_AB5500_H */ | ||
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/ab8500/gpadc.h index 46b954011f16..252966769d93 100644 --- a/include/linux/mfd/ab8500/gpadc.h +++ b/include/linux/mfd/ab8500/gpadc.h | |||
@@ -27,6 +27,9 @@ | |||
27 | struct ab8500_gpadc; | 27 | struct ab8500_gpadc; |
28 | 28 | ||
29 | struct ab8500_gpadc *ab8500_gpadc_get(char *name); | 29 | struct ab8500_gpadc *ab8500_gpadc_get(char *name); |
30 | int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input); | 30 | int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel); |
31 | int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel); | ||
32 | int ab8500_gpadc_ad_to_voltage(struct ab8500_gpadc *gpadc, | ||
33 | u8 channel, int ad_value); | ||
31 | 34 | ||
32 | #endif /* _AB8500_GPADC_H */ | 35 | #endif /* _AB8500_GPADC_H */ |
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 896b5e47f16e..9970337ff041 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * ABX500 core access functions. | 7 | * ABX500 core access functions. |
8 | * The abx500 interface is used for the Analog Baseband chip | 8 | * The abx500 interface is used for the Analog Baseband chip |
9 | * ab3100, ab3550, ab5500, and ab8500. | 9 | * ab3100, ab5500, and ab8500. |
10 | * | 10 | * |
11 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> | 11 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> |
12 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 12 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> |
@@ -29,17 +29,16 @@ | |||
29 | #define AB3100_P1G 0xc6 | 29 | #define AB3100_P1G 0xc6 |
30 | #define AB3100_R2A 0xc7 | 30 | #define AB3100_R2A 0xc7 |
31 | #define AB3100_R2B 0xc8 | 31 | #define AB3100_R2B 0xc8 |
32 | #define AB3550_P1A 0x10 | ||
33 | #define AB5500_1_0 0x20 | 32 | #define AB5500_1_0 0x20 |
34 | #define AB5500_2_0 0x21 | 33 | #define AB5500_1_1 0x21 |
35 | #define AB5500_2_1 0x22 | 34 | #define AB5500_2_0 0x24 |
36 | 35 | ||
37 | /* AB8500 CIDs*/ | 36 | /* AB8500 CIDs*/ |
38 | #define AB8500_CUTEARLY 0x00 | ||
39 | #define AB8500_CUT1P0 0x10 | 37 | #define AB8500_CUT1P0 0x10 |
40 | #define AB8500_CUT1P1 0x11 | 38 | #define AB8500_CUT1P1 0x11 |
41 | #define AB8500_CUT2P0 0x20 | 39 | #define AB8500_CUT2P0 0x20 |
42 | #define AB8500_CUT3P0 0x30 | 40 | #define AB8500_CUT3P0 0x30 |
41 | #define AB8500_CUT3P3 0x33 | ||
43 | 42 | ||
44 | /* | 43 | /* |
45 | * AB3100, EVENTA1, A2 and A3 event register flags | 44 | * AB3100, EVENTA1, A2 and A3 event register flags |
@@ -143,39 +142,6 @@ int ab3100_event_register(struct ab3100 *ab3100, | |||
143 | int ab3100_event_unregister(struct ab3100 *ab3100, | 142 | int ab3100_event_unregister(struct ab3100 *ab3100, |
144 | struct notifier_block *nb); | 143 | struct notifier_block *nb); |
145 | 144 | ||
146 | /* AB3550, STR register flags */ | ||
147 | #define AB3550_STR_ONSWA (0x01) | ||
148 | #define AB3550_STR_ONSWB (0x02) | ||
149 | #define AB3550_STR_ONSWC (0x04) | ||
150 | #define AB3550_STR_DCIO (0x08) | ||
151 | #define AB3550_STR_BOOT_MODE (0x10) | ||
152 | #define AB3550_STR_SIM_OFF (0x20) | ||
153 | #define AB3550_STR_BATT_REMOVAL (0x40) | ||
154 | #define AB3550_STR_VBUS (0x80) | ||
155 | |||
156 | /* Interrupt mask registers */ | ||
157 | #define AB3550_IMR1 0x29 | ||
158 | #define AB3550_IMR2 0x2a | ||
159 | #define AB3550_IMR3 0x2b | ||
160 | #define AB3550_IMR4 0x2c | ||
161 | #define AB3550_IMR5 0x2d | ||
162 | |||
163 | enum ab3550_devid { | ||
164 | AB3550_DEVID_ADC, | ||
165 | AB3550_DEVID_DAC, | ||
166 | AB3550_DEVID_LEDS, | ||
167 | AB3550_DEVID_POWER, | ||
168 | AB3550_DEVID_REGULATORS, | ||
169 | AB3550_DEVID_SIM, | ||
170 | AB3550_DEVID_UART, | ||
171 | AB3550_DEVID_RTC, | ||
172 | AB3550_DEVID_CHARGER, | ||
173 | AB3550_DEVID_FUELGAUGE, | ||
174 | AB3550_DEVID_VIBRATOR, | ||
175 | AB3550_DEVID_CODEC, | ||
176 | AB3550_NUM_DEVICES, | ||
177 | }; | ||
178 | |||
179 | /** | 145 | /** |
180 | * struct abx500_init_setting | 146 | * struct abx500_init_setting |
181 | * Initial value of the registers for driver to use during setup. | 147 | * Initial value of the registers for driver to use during setup. |
@@ -186,18 +152,6 @@ struct abx500_init_settings { | |||
186 | u8 setting; | 152 | u8 setting; |
187 | }; | 153 | }; |
188 | 154 | ||
189 | /** | ||
190 | * struct ab3550_platform_data | ||
191 | * Data supplied to initialize board connections to the AB3550 | ||
192 | */ | ||
193 | struct ab3550_platform_data { | ||
194 | struct {unsigned int base; unsigned int count; } irq; | ||
195 | void *dev_data[AB3550_NUM_DEVICES]; | ||
196 | size_t dev_data_sz[AB3550_NUM_DEVICES]; | ||
197 | struct abx500_init_settings *init_settings; | ||
198 | unsigned int init_settings_sz; | ||
199 | }; | ||
200 | |||
201 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, | 155 | int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, |
202 | u8 value); | 156 | u8 value); |
203 | int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, | 157 | int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, |
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h index f0977986402c..9890687f582d 100644 --- a/include/linux/mfd/db5500-prcmu.h +++ b/include/linux/mfd/db5500-prcmu.h | |||
@@ -5,21 +5,35 @@ | |||
5 | * | 5 | * |
6 | * U5500 PRCMU API. | 6 | * U5500 PRCMU API. |
7 | */ | 7 | */ |
8 | #ifndef __MACH_PRCMU_U5500_H | 8 | #ifndef __MFD_DB5500_PRCMU_H |
9 | #define __MACH_PRCMU_U5500_H | 9 | #define __MFD_DB5500_PRCMU_H |
10 | 10 | ||
11 | #ifdef CONFIG_UX500_SOC_DB5500 | 11 | #ifdef CONFIG_MFD_DB5500_PRCMU |
12 | 12 | ||
13 | void db5500_prcmu_early_init(void); | 13 | void db5500_prcmu_early_init(void); |
14 | 14 | int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state); | |
15 | int db5500_prcmu_set_display_clocks(void); | ||
16 | int db5500_prcmu_disable_dsipll(void); | ||
17 | int db5500_prcmu_enable_dsipll(void); | ||
15 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | 18 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); |
16 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | 19 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); |
20 | void db5500_prcmu_enable_wakeups(u32 wakeups); | ||
21 | int db5500_prcmu_request_clock(u8 clock, bool enable); | ||
22 | void db5500_prcmu_config_abb_event_readout(u32 abb_events); | ||
23 | void db5500_prcmu_get_abb_event_buffer(void __iomem **buf); | ||
24 | int prcmu_resetout(u8 resoutn, u8 state); | ||
25 | int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
26 | bool keep_ap_pll); | ||
27 | int db5500_prcmu_config_esram0_deep_sleep(u8 state); | ||
28 | void db5500_prcmu_system_reset(u16 reset_code); | ||
29 | u16 db5500_prcmu_get_reset_code(void); | ||
30 | bool db5500_prcmu_is_ac_wake_requested(void); | ||
31 | int db5500_prcmu_set_arm_opp(u8 opp); | ||
32 | int db5500_prcmu_get_arm_opp(void); | ||
17 | 33 | ||
18 | #else /* !CONFIG_UX500_SOC_DB5500 */ | 34 | #else /* !CONFIG_UX500_SOC_DB5500 */ |
19 | 35 | ||
20 | static inline void db5500_prcmu_early_init(void) | 36 | static inline void db5500_prcmu_early_init(void) {} |
21 | { | ||
22 | } | ||
23 | 37 | ||
24 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | 38 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) |
25 | { | 39 | { |
@@ -31,15 +45,75 @@ static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | |||
31 | return -ENOSYS; | 45 | return -ENOSYS; |
32 | } | 46 | } |
33 | 47 | ||
34 | #endif /* CONFIG_UX500_SOC_DB5500 */ | 48 | static inline int db5500_prcmu_request_clock(u8 clock, bool enable) |
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static inline int db5500_prcmu_set_display_clocks(void) | ||
54 | { | ||
55 | return 0; | ||
56 | } | ||
57 | |||
58 | static inline int db5500_prcmu_disable_dsipll(void) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | static inline int db5500_prcmu_enable_dsipll(void) | ||
64 | { | ||
65 | return 0; | ||
66 | } | ||
35 | 67 | ||
36 | static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events) | 68 | static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state) |
37 | { | 69 | { |
38 | #ifdef CONFIG_MACH_U5500_SIMULATOR | ||
39 | return 0; | 70 | return 0; |
40 | #else | ||
41 | return -1; | ||
42 | #endif | ||
43 | } | 71 | } |
44 | 72 | ||
45 | #endif /* __MACH_PRCMU_U5500_H */ | 73 | static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {} |
74 | |||
75 | static inline int prcmu_resetout(u8 resoutn, u8 state) | ||
76 | { | ||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {} | ||
86 | static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {} | ||
87 | |||
88 | static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
89 | bool keep_ap_pll) | ||
90 | { | ||
91 | return 0; | ||
92 | } | ||
93 | |||
94 | static inline void db5500_prcmu_system_reset(u16 reset_code) {} | ||
95 | |||
96 | static inline u16 db5500_prcmu_get_reset_code(void) | ||
97 | { | ||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | static inline bool db5500_prcmu_is_ac_wake_requested(void) | ||
102 | { | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static inline int db5500_prcmu_set_arm_opp(u8 opp) | ||
107 | { | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | static inline int db5500_prcmu_get_arm_opp(void) | ||
112 | { | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | |||
117 | #endif /* CONFIG_MFD_DB5500_PRCMU */ | ||
118 | |||
119 | #endif /* __MFD_DB5500_PRCMU_H */ | ||
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 917dbcab701c..60d27f7bfc1f 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #define __MFD_DB8500_PRCMU_H | 11 | #define __MFD_DB8500_PRCMU_H |
12 | 12 | ||
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/notifier.h> | ||
15 | 14 | ||
16 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ | 15 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ |
17 | 16 | ||
@@ -133,7 +132,7 @@ enum ap_pwrst { | |||
133 | * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle | 132 | * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle |
134 | */ | 133 | */ |
135 | enum ap_pwrst_trans { | 134 | enum ap_pwrst_trans { |
136 | NO_TRANSITION = 0x00, | 135 | PRCMU_AP_NO_CHANGE = 0x00, |
137 | APEXECUTE_TO_APSLEEP = 0x01, | 136 | APEXECUTE_TO_APSLEEP = 0x01, |
138 | APIDLE_TO_APSLEEP = 0x02, /* To be removed */ | 137 | APIDLE_TO_APSLEEP = 0x02, /* To be removed */ |
139 | PRCMU_AP_SLEEP = 0x01, | 138 | PRCMU_AP_SLEEP = 0x01, |
@@ -146,54 +145,6 @@ enum ap_pwrst_trans { | |||
146 | }; | 145 | }; |
147 | 146 | ||
148 | /** | 147 | /** |
149 | * enum ddr_pwrst - DDR power states definition | ||
150 | * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged | ||
151 | * @DDR_PWR_STATE_ON: | ||
152 | * @DDR_PWR_STATE_OFFLOWLAT: | ||
153 | * @DDR_PWR_STATE_OFFHIGHLAT: | ||
154 | */ | ||
155 | enum ddr_pwrst { | ||
156 | DDR_PWR_STATE_UNCHANGED = 0x00, | ||
157 | DDR_PWR_STATE_ON = 0x01, | ||
158 | DDR_PWR_STATE_OFFLOWLAT = 0x02, | ||
159 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | ||
160 | }; | ||
161 | |||
162 | /** | ||
163 | * enum arm_opp - ARM OPP states definition | ||
164 | * @ARM_OPP_INIT: | ||
165 | * @ARM_NO_CHANGE: The ARM operating point is unchanged | ||
166 | * @ARM_100_OPP: The new ARM operating point is arm100opp | ||
167 | * @ARM_50_OPP: The new ARM operating point is arm50opp | ||
168 | * @ARM_MAX_OPP: Operating point is "max" (more than 100) | ||
169 | * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100 | ||
170 | * @ARM_EXTCLK: The new ARM operating point is armExtClk | ||
171 | */ | ||
172 | enum arm_opp { | ||
173 | ARM_OPP_INIT = 0x00, | ||
174 | ARM_NO_CHANGE = 0x01, | ||
175 | ARM_100_OPP = 0x02, | ||
176 | ARM_50_OPP = 0x03, | ||
177 | ARM_MAX_OPP = 0x04, | ||
178 | ARM_MAX_FREQ100OPP = 0x05, | ||
179 | ARM_EXTCLK = 0x07 | ||
180 | }; | ||
181 | |||
182 | /** | ||
183 | * enum ape_opp - APE OPP states definition | ||
184 | * @APE_OPP_INIT: | ||
185 | * @APE_NO_CHANGE: The APE operating point is unchanged | ||
186 | * @APE_100_OPP: The new APE operating point is ape100opp | ||
187 | * @APE_50_OPP: 50% | ||
188 | */ | ||
189 | enum ape_opp { | ||
190 | APE_OPP_INIT = 0x00, | ||
191 | APE_NO_CHANGE = 0x01, | ||
192 | APE_100_OPP = 0x02, | ||
193 | APE_50_OPP = 0x03 | ||
194 | }; | ||
195 | |||
196 | /** | ||
197 | * enum hw_acc_state - State definition for hardware accelerator | 148 | * enum hw_acc_state - State definition for hardware accelerator |
198 | * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged | 149 | * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged |
199 | * @HW_OFF: The hardware accelerator must be switched off | 150 | * @HW_OFF: The hardware accelerator must be switched off |
@@ -469,26 +420,6 @@ enum auto_enable { | |||
469 | 420 | ||
470 | /* End of file previously known as prcmu-fw-defs_v1.h */ | 421 | /* End of file previously known as prcmu-fw-defs_v1.h */ |
471 | 422 | ||
472 | /* PRCMU Wakeup defines */ | ||
473 | enum prcmu_wakeup_index { | ||
474 | PRCMU_WAKEUP_INDEX_RTC, | ||
475 | PRCMU_WAKEUP_INDEX_RTT0, | ||
476 | PRCMU_WAKEUP_INDEX_RTT1, | ||
477 | PRCMU_WAKEUP_INDEX_HSI0, | ||
478 | PRCMU_WAKEUP_INDEX_HSI1, | ||
479 | PRCMU_WAKEUP_INDEX_USB, | ||
480 | PRCMU_WAKEUP_INDEX_ABB, | ||
481 | PRCMU_WAKEUP_INDEX_ABB_FIFO, | ||
482 | PRCMU_WAKEUP_INDEX_ARM, | ||
483 | NUM_PRCMU_WAKEUP_INDICES | ||
484 | }; | ||
485 | #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name)) | ||
486 | |||
487 | /* PRCMU QoS APE OPP class */ | ||
488 | #define PRCMU_QOS_APE_OPP 1 | ||
489 | #define PRCMU_QOS_DDR_OPP 2 | ||
490 | #define PRCMU_QOS_DEFAULT_VALUE -1 | ||
491 | |||
492 | /** | 423 | /** |
493 | * enum hw_acc_dev - enum for hw accelerators | 424 | * enum hw_acc_dev - enum for hw accelerators |
494 | * @HW_ACC_SVAMMDSP: for SVAMMDSP | 425 | * @HW_ACC_SVAMMDSP: for SVAMMDSP |
@@ -527,64 +458,6 @@ enum hw_acc_dev { | |||
527 | }; | 458 | }; |
528 | 459 | ||
529 | /* | 460 | /* |
530 | * Ids for all EPODs (power domains) | ||
531 | * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP | ||
532 | * - EPOD_ID_SVAPIPE: power domain for SVA pipe | ||
533 | * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP | ||
534 | * - EPOD_ID_SIAPIPE: power domain for SIA pipe | ||
535 | * - EPOD_ID_SGA: power domain for SGA | ||
536 | * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE | ||
537 | * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2 | ||
538 | * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4 | ||
539 | * - NUM_EPOD_ID: number of power domains | ||
540 | */ | ||
541 | #define EPOD_ID_SVAMMDSP 0 | ||
542 | #define EPOD_ID_SVAPIPE 1 | ||
543 | #define EPOD_ID_SIAMMDSP 2 | ||
544 | #define EPOD_ID_SIAPIPE 3 | ||
545 | #define EPOD_ID_SGA 4 | ||
546 | #define EPOD_ID_B2R2_MCDE 5 | ||
547 | #define EPOD_ID_ESRAM12 6 | ||
548 | #define EPOD_ID_ESRAM34 7 | ||
549 | #define NUM_EPOD_ID 8 | ||
550 | |||
551 | /* | ||
552 | * state definition for EPOD (power domain) | ||
553 | * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged | ||
554 | * - EPOD_STATE_OFF: The EPOD is switched off | ||
555 | * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in | ||
556 | * retention | ||
557 | * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off | ||
558 | * - EPOD_STATE_ON: Same as above, but with clock enabled | ||
559 | */ | ||
560 | #define EPOD_STATE_NO_CHANGE 0x00 | ||
561 | #define EPOD_STATE_OFF 0x01 | ||
562 | #define EPOD_STATE_RAMRET 0x02 | ||
563 | #define EPOD_STATE_ON_CLK_OFF 0x03 | ||
564 | #define EPOD_STATE_ON 0x04 | ||
565 | |||
566 | /* | ||
567 | * CLKOUT sources | ||
568 | */ | ||
569 | #define PRCMU_CLKSRC_CLK38M 0x00 | ||
570 | #define PRCMU_CLKSRC_ACLK 0x01 | ||
571 | #define PRCMU_CLKSRC_SYSCLK 0x02 | ||
572 | #define PRCMU_CLKSRC_LCDCLK 0x03 | ||
573 | #define PRCMU_CLKSRC_SDMMCCLK 0x04 | ||
574 | #define PRCMU_CLKSRC_TVCLK 0x05 | ||
575 | #define PRCMU_CLKSRC_TIMCLK 0x06 | ||
576 | #define PRCMU_CLKSRC_CLK009 0x07 | ||
577 | /* These are only valid for CLKOUT1: */ | ||
578 | #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40 | ||
579 | #define PRCMU_CLKSRC_I2CCLK 0x41 | ||
580 | #define PRCMU_CLKSRC_MSP02CLK 0x42 | ||
581 | #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43 | ||
582 | #define PRCMU_CLKSRC_HSIRXCLK 0x44 | ||
583 | #define PRCMU_CLKSRC_HSITXCLK 0x45 | ||
584 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | ||
585 | #define PRCMU_CLKSRC_HDMICLK 0x47 | ||
586 | |||
587 | /* | ||
588 | * Definitions for autonomous power management configuration. | 461 | * Definitions for autonomous power management configuration. |
589 | */ | 462 | */ |
590 | 463 | ||
@@ -620,88 +493,12 @@ struct prcmu_auto_pm_config { | |||
620 | u8 sva_policy; | 493 | u8 sva_policy; |
621 | }; | 494 | }; |
622 | 495 | ||
623 | /** | ||
624 | * enum ddr_opp - DDR OPP states definition | ||
625 | * @DDR_100_OPP: The new DDR operating point is ddr100opp | ||
626 | * @DDR_50_OPP: The new DDR operating point is ddr50opp | ||
627 | * @DDR_25_OPP: The new DDR operating point is ddr25opp | ||
628 | */ | ||
629 | enum ddr_opp { | ||
630 | DDR_100_OPP = 0x00, | ||
631 | DDR_50_OPP = 0x01, | ||
632 | DDR_25_OPP = 0x02, | ||
633 | }; | ||
634 | |||
635 | /* | ||
636 | * Clock identifiers. | ||
637 | */ | ||
638 | enum prcmu_clock { | ||
639 | PRCMU_SGACLK, | ||
640 | PRCMU_UARTCLK, | ||
641 | PRCMU_MSP02CLK, | ||
642 | PRCMU_MSP1CLK, | ||
643 | PRCMU_I2CCLK, | ||
644 | PRCMU_SDMMCCLK, | ||
645 | PRCMU_SLIMCLK, | ||
646 | PRCMU_PER1CLK, | ||
647 | PRCMU_PER2CLK, | ||
648 | PRCMU_PER3CLK, | ||
649 | PRCMU_PER5CLK, | ||
650 | PRCMU_PER6CLK, | ||
651 | PRCMU_PER7CLK, | ||
652 | PRCMU_LCDCLK, | ||
653 | PRCMU_BMLCLK, | ||
654 | PRCMU_HSITXCLK, | ||
655 | PRCMU_HSIRXCLK, | ||
656 | PRCMU_HDMICLK, | ||
657 | PRCMU_APEATCLK, | ||
658 | PRCMU_APETRACECLK, | ||
659 | PRCMU_MCDECLK, | ||
660 | PRCMU_IPI2CCLK, | ||
661 | PRCMU_DSIALTCLK, | ||
662 | PRCMU_DMACLK, | ||
663 | PRCMU_B2R2CLK, | ||
664 | PRCMU_TVCLK, | ||
665 | PRCMU_SSPCLK, | ||
666 | PRCMU_RNGCLK, | ||
667 | PRCMU_UICCCLK, | ||
668 | PRCMU_NUM_REG_CLOCKS, | ||
669 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | ||
670 | PRCMU_TIMCLK, | ||
671 | }; | ||
672 | |||
673 | /* | ||
674 | * Definitions for controlling ESRAM0 in deep sleep. | ||
675 | */ | ||
676 | #define ESRAM0_DEEP_SLEEP_STATE_OFF 1 | ||
677 | #define ESRAM0_DEEP_SLEEP_STATE_RET 2 | ||
678 | |||
679 | #ifdef CONFIG_MFD_DB8500_PRCMU | ||
680 | void __init prcmu_early_init(void); | ||
681 | int prcmu_set_display_clocks(void); | ||
682 | int prcmu_disable_dsipll(void); | ||
683 | int prcmu_enable_dsipll(void); | ||
684 | #else | ||
685 | static inline void __init prcmu_early_init(void) {} | ||
686 | #endif | ||
687 | |||
688 | #ifdef CONFIG_MFD_DB8500_PRCMU | 496 | #ifdef CONFIG_MFD_DB8500_PRCMU |
689 | 497 | ||
498 | void db8500_prcmu_early_init(void); | ||
690 | int prcmu_set_rc_a2p(enum romcode_write); | 499 | int prcmu_set_rc_a2p(enum romcode_write); |
691 | enum romcode_read prcmu_get_rc_p2a(void); | 500 | enum romcode_read prcmu_get_rc_p2a(void); |
692 | enum ap_pwrst prcmu_get_xp70_current_state(void); | 501 | enum ap_pwrst prcmu_get_xp70_current_state(void); |
693 | int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | ||
694 | |||
695 | void prcmu_enable_wakeups(u32 wakeups); | ||
696 | static inline void prcmu_disable_wakeups(void) | ||
697 | { | ||
698 | prcmu_enable_wakeups(0); | ||
699 | } | ||
700 | |||
701 | void prcmu_config_abb_event_readout(u32 abb_events); | ||
702 | void prcmu_get_abb_event_buffer(void __iomem **buf); | ||
703 | int prcmu_set_arm_opp(u8 opp); | ||
704 | int prcmu_get_arm_opp(void); | ||
705 | bool prcmu_has_arm_maxopp(void); | 502 | bool prcmu_has_arm_maxopp(void); |
706 | bool prcmu_is_u8400(void); | 503 | bool prcmu_is_u8400(void); |
707 | int prcmu_set_ape_opp(u8 opp); | 504 | int prcmu_set_ape_opp(u8 opp); |
@@ -710,19 +507,14 @@ int prcmu_request_ape_opp_100_voltage(bool enable); | |||
710 | int prcmu_release_usb_wakeup_state(void); | 507 | int prcmu_release_usb_wakeup_state(void); |
711 | int prcmu_set_ddr_opp(u8 opp); | 508 | int prcmu_set_ddr_opp(u8 opp); |
712 | int prcmu_get_ddr_opp(void); | 509 | int prcmu_get_ddr_opp(void); |
713 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | ||
714 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | ||
715 | /* NOTE! Use regulator framework instead */ | 510 | /* NOTE! Use regulator framework instead */ |
716 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); | 511 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); |
717 | int prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
718 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | 512 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, |
719 | struct prcmu_auto_pm_config *idle); | 513 | struct prcmu_auto_pm_config *idle); |
720 | bool prcmu_is_auto_pm_enabled(void); | 514 | bool prcmu_is_auto_pm_enabled(void); |
721 | 515 | ||
722 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | 516 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); |
723 | int prcmu_request_clock(u8 clock, bool enable); | ||
724 | int prcmu_set_clock_divider(u8 clock, u8 divider); | 517 | int prcmu_set_clock_divider(u8 clock, u8 divider); |
725 | int prcmu_config_esram0_deep_sleep(u8 state); | ||
726 | int prcmu_config_hotdog(u8 threshold); | 518 | int prcmu_config_hotdog(u8 threshold); |
727 | int prcmu_config_hotmon(u8 low, u8 high); | 519 | int prcmu_config_hotmon(u8 low, u8 high); |
728 | int prcmu_start_temp_sense(u16 cycles32k); | 520 | int prcmu_start_temp_sense(u16 cycles32k); |
@@ -732,14 +524,36 @@ int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | |||
732 | 524 | ||
733 | void prcmu_ac_wake_req(void); | 525 | void prcmu_ac_wake_req(void); |
734 | void prcmu_ac_sleep_req(void); | 526 | void prcmu_ac_sleep_req(void); |
735 | void prcmu_system_reset(u16 reset_code); | ||
736 | void prcmu_modem_reset(void); | 527 | void prcmu_modem_reset(void); |
737 | bool prcmu_is_ac_wake_requested(void); | ||
738 | void prcmu_enable_spi2(void); | 528 | void prcmu_enable_spi2(void); |
739 | void prcmu_disable_spi2(void); | 529 | void prcmu_disable_spi2(void); |
740 | 530 | ||
531 | int prcmu_config_a9wdog(u8 num, bool sleep_auto_off); | ||
532 | int prcmu_enable_a9wdog(u8 id); | ||
533 | int prcmu_disable_a9wdog(u8 id); | ||
534 | int prcmu_kick_a9wdog(u8 id); | ||
535 | int prcmu_load_a9wdog(u8 id, u32 val); | ||
536 | |||
537 | void db8500_prcmu_system_reset(u16 reset_code); | ||
538 | int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | ||
539 | void db8500_prcmu_enable_wakeups(u32 wakeups); | ||
540 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
541 | int db8500_prcmu_request_clock(u8 clock, bool enable); | ||
542 | int db8500_prcmu_set_display_clocks(void); | ||
543 | int db8500_prcmu_disable_dsipll(void); | ||
544 | int db8500_prcmu_enable_dsipll(void); | ||
545 | void db8500_prcmu_config_abb_event_readout(u32 abb_events); | ||
546 | void db8500_prcmu_get_abb_event_buffer(void __iomem **buf); | ||
547 | int db8500_prcmu_config_esram0_deep_sleep(u8 state); | ||
548 | u16 db8500_prcmu_get_reset_code(void); | ||
549 | bool db8500_prcmu_is_ac_wake_requested(void); | ||
550 | int db8500_prcmu_set_arm_opp(u8 opp); | ||
551 | int db8500_prcmu_get_arm_opp(void); | ||
552 | |||
741 | #else /* !CONFIG_MFD_DB8500_PRCMU */ | 553 | #else /* !CONFIG_MFD_DB8500_PRCMU */ |
742 | 554 | ||
555 | static inline void db8500_prcmu_early_init(void) {} | ||
556 | |||
743 | static inline int prcmu_set_rc_a2p(enum romcode_write code) | 557 | static inline int prcmu_set_rc_a2p(enum romcode_write code) |
744 | { | 558 | { |
745 | return 0; | 559 | return 0; |
@@ -755,34 +569,12 @@ static inline enum ap_pwrst prcmu_get_xp70_current_state(void) | |||
755 | return AP_EXECUTE; | 569 | return AP_EXECUTE; |
756 | } | 570 | } |
757 | 571 | ||
758 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | 572 | static inline bool prcmu_has_arm_maxopp(void) |
759 | bool keep_ap_pll) | ||
760 | { | ||
761 | return 0; | ||
762 | } | ||
763 | |||
764 | static inline void prcmu_enable_wakeups(u32 wakeups) {} | ||
765 | |||
766 | static inline void prcmu_disable_wakeups(void) {} | ||
767 | |||
768 | static inline void prcmu_config_abb_event_readout(u32 abb_events) {} | ||
769 | |||
770 | static inline int prcmu_set_arm_opp(u8 opp) | ||
771 | { | ||
772 | return 0; | ||
773 | } | ||
774 | |||
775 | static inline int prcmu_get_arm_opp(void) | ||
776 | { | ||
777 | return ARM_100_OPP; | ||
778 | } | ||
779 | |||
780 | static bool prcmu_has_arm_maxopp(void) | ||
781 | { | 573 | { |
782 | return false; | 574 | return false; |
783 | } | 575 | } |
784 | 576 | ||
785 | static bool prcmu_is_u8400(void) | 577 | static inline bool prcmu_is_u8400(void) |
786 | { | 578 | { |
787 | return false; | 579 | return false; |
788 | } | 580 | } |
@@ -817,13 +609,6 @@ static inline int prcmu_get_ddr_opp(void) | |||
817 | return DDR_100_OPP; | 609 | return DDR_100_OPP; |
818 | } | 610 | } |
819 | 611 | ||
820 | static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void) | ||
821 | { | ||
822 | return 0; | ||
823 | } | ||
824 | |||
825 | static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {} | ||
826 | |||
827 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) | 612 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) |
828 | { | 613 | { |
829 | return 0; | 614 | return 0; |
@@ -844,21 +629,11 @@ static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) | |||
844 | return 0; | 629 | return 0; |
845 | } | 630 | } |
846 | 631 | ||
847 | static inline int prcmu_request_clock(u8 clock, bool enable) | ||
848 | { | ||
849 | return 0; | ||
850 | } | ||
851 | |||
852 | static inline int prcmu_set_clock_divider(u8 clock, u8 divider) | 632 | static inline int prcmu_set_clock_divider(u8 clock, u8 divider) |
853 | { | 633 | { |
854 | return 0; | 634 | return 0; |
855 | } | 635 | } |
856 | 636 | ||
857 | int prcmu_config_esram0_deep_sleep(u8 state) | ||
858 | { | ||
859 | return 0; | ||
860 | } | ||
861 | |||
862 | static inline int prcmu_config_hotdog(u8 threshold) | 637 | static inline int prcmu_config_hotdog(u8 threshold) |
863 | { | 638 | { |
864 | return 0; | 639 | return 0; |
@@ -893,86 +668,107 @@ static inline void prcmu_ac_wake_req(void) {} | |||
893 | 668 | ||
894 | static inline void prcmu_ac_sleep_req(void) {} | 669 | static inline void prcmu_ac_sleep_req(void) {} |
895 | 670 | ||
896 | static inline void prcmu_system_reset(u16 reset_code) {} | ||
897 | |||
898 | static inline void prcmu_modem_reset(void) {} | 671 | static inline void prcmu_modem_reset(void) {} |
899 | 672 | ||
900 | static inline bool prcmu_is_ac_wake_requested(void) | 673 | static inline int prcmu_enable_spi2(void) |
901 | { | 674 | { |
902 | return false; | 675 | return 0; |
903 | } | 676 | } |
904 | 677 | ||
905 | #ifndef CONFIG_UX500_SOC_DB5500 | 678 | static inline int prcmu_disable_spi2(void) |
906 | static inline int prcmu_set_display_clocks(void) | ||
907 | { | 679 | { |
908 | return 0; | 680 | return 0; |
909 | } | 681 | } |
910 | 682 | ||
911 | static inline int prcmu_disable_dsipll(void) | 683 | static inline void db8500_prcmu_system_reset(u16 reset_code) {} |
684 | |||
685 | static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
686 | bool keep_ap_pll) | ||
912 | { | 687 | { |
913 | return 0; | 688 | return 0; |
914 | } | 689 | } |
915 | 690 | ||
916 | static inline int prcmu_enable_dsipll(void) | 691 | static inline void db8500_prcmu_enable_wakeups(u32 wakeups) {} |
692 | |||
693 | static inline int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state) | ||
917 | { | 694 | { |
918 | return 0; | 695 | return 0; |
919 | } | 696 | } |
920 | #endif | ||
921 | 697 | ||
922 | static inline int prcmu_enable_spi2(void) | 698 | static inline int db8500_prcmu_request_clock(u8 clock, bool enable) |
923 | { | 699 | { |
924 | return 0; | 700 | return 0; |
925 | } | 701 | } |
926 | 702 | ||
927 | static inline int prcmu_disable_spi2(void) | 703 | static inline int db8500_prcmu_set_display_clocks(void) |
928 | { | 704 | { |
929 | return 0; | 705 | return 0; |
930 | } | 706 | } |
931 | 707 | ||
932 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | 708 | static inline int db8500_prcmu_disable_dsipll(void) |
709 | { | ||
710 | return 0; | ||
711 | } | ||
712 | |||
713 | static inline int db8500_prcmu_enable_dsipll(void) | ||
714 | { | ||
715 | return 0; | ||
716 | } | ||
717 | |||
718 | static inline int db8500_prcmu_config_esram0_deep_sleep(u8 state) | ||
719 | { | ||
720 | return 0; | ||
721 | } | ||
722 | |||
723 | static inline void db8500_prcmu_config_abb_event_readout(u32 abb_events) {} | ||
933 | 724 | ||
934 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | 725 | static inline void db8500_prcmu_get_abb_event_buffer(void __iomem **buf) {} |
935 | int prcmu_qos_requirement(int pm_qos_class); | 726 | |
936 | int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); | 727 | static inline u16 db8500_prcmu_get_reset_code(void) |
937 | int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value); | ||
938 | void prcmu_qos_remove_requirement(int pm_qos_class, char *name); | ||
939 | int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
940 | struct notifier_block *notifier); | ||
941 | int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
942 | struct notifier_block *notifier); | ||
943 | #else | ||
944 | static inline int prcmu_qos_requirement(int prcmu_qos_class) | ||
945 | { | 728 | { |
946 | return 0; | 729 | return 0; |
947 | } | 730 | } |
948 | 731 | ||
949 | static inline int prcmu_qos_add_requirement(int prcmu_qos_class, | 732 | static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off) |
950 | char *name, s32 value) | ||
951 | { | 733 | { |
952 | return 0; | 734 | return 0; |
953 | } | 735 | } |
954 | 736 | ||
955 | static inline int prcmu_qos_update_requirement(int prcmu_qos_class, | 737 | static inline int prcmu_enable_a9wdog(u8 id) |
956 | char *name, s32 new_value) | ||
957 | { | 738 | { |
958 | return 0; | 739 | return 0; |
959 | } | 740 | } |
960 | 741 | ||
961 | static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) | 742 | static inline int prcmu_disable_a9wdog(u8 id) |
962 | { | 743 | { |
744 | return 0; | ||
963 | } | 745 | } |
964 | 746 | ||
965 | static inline int prcmu_qos_add_notifier(int prcmu_qos_class, | 747 | static inline int prcmu_kick_a9wdog(u8 id) |
966 | struct notifier_block *notifier) | ||
967 | { | 748 | { |
968 | return 0; | 749 | return 0; |
969 | } | 750 | } |
970 | static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, | 751 | |
971 | struct notifier_block *notifier) | 752 | static inline int prcmu_load_a9wdog(u8 id, u32 val) |
972 | { | 753 | { |
973 | return 0; | 754 | return 0; |
974 | } | 755 | } |
975 | 756 | ||
976 | #endif | 757 | static inline bool db8500_prcmu_is_ac_wake_requested(void) |
758 | { | ||
759 | return 0; | ||
760 | } | ||
761 | |||
762 | static inline int db8500_prcmu_set_arm_opp(u8 opp) | ||
763 | { | ||
764 | return 0; | ||
765 | } | ||
766 | |||
767 | static inline int db8500_prcmu_get_arm_opp(void) | ||
768 | { | ||
769 | return 0; | ||
770 | } | ||
771 | |||
772 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | ||
977 | 773 | ||
978 | #endif /* __MFD_DB8500_PRCMU_H */ | 774 | #endif /* __MFD_DB8500_PRCMU_H */ |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h new file mode 100644 index 000000000000..bac942f959c1 --- /dev/null +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -0,0 +1,549 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST Ericsson SA 2011 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * STE Ux500 PRCMU API | ||
7 | */ | ||
8 | #ifndef __MACH_PRCMU_H | ||
9 | #define __MACH_PRCMU_H | ||
10 | |||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/notifier.h> | ||
13 | #include <asm/mach-types.h> | ||
14 | |||
15 | /* PRCMU Wakeup defines */ | ||
16 | enum prcmu_wakeup_index { | ||
17 | PRCMU_WAKEUP_INDEX_RTC, | ||
18 | PRCMU_WAKEUP_INDEX_RTT0, | ||
19 | PRCMU_WAKEUP_INDEX_RTT1, | ||
20 | PRCMU_WAKEUP_INDEX_HSI0, | ||
21 | PRCMU_WAKEUP_INDEX_HSI1, | ||
22 | PRCMU_WAKEUP_INDEX_USB, | ||
23 | PRCMU_WAKEUP_INDEX_ABB, | ||
24 | PRCMU_WAKEUP_INDEX_ABB_FIFO, | ||
25 | PRCMU_WAKEUP_INDEX_ARM, | ||
26 | PRCMU_WAKEUP_INDEX_CD_IRQ, | ||
27 | NUM_PRCMU_WAKEUP_INDICES | ||
28 | }; | ||
29 | #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name)) | ||
30 | |||
31 | /* EPOD (power domain) IDs */ | ||
32 | |||
33 | /* | ||
34 | * DB8500 EPODs | ||
35 | * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP | ||
36 | * - EPOD_ID_SVAPIPE: power domain for SVA pipe | ||
37 | * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP | ||
38 | * - EPOD_ID_SIAPIPE: power domain for SIA pipe | ||
39 | * - EPOD_ID_SGA: power domain for SGA | ||
40 | * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE | ||
41 | * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2 | ||
42 | * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4 | ||
43 | * - NUM_EPOD_ID: number of power domains | ||
44 | * | ||
45 | * TODO: These should be prefixed. | ||
46 | */ | ||
47 | #define EPOD_ID_SVAMMDSP 0 | ||
48 | #define EPOD_ID_SVAPIPE 1 | ||
49 | #define EPOD_ID_SIAMMDSP 2 | ||
50 | #define EPOD_ID_SIAPIPE 3 | ||
51 | #define EPOD_ID_SGA 4 | ||
52 | #define EPOD_ID_B2R2_MCDE 5 | ||
53 | #define EPOD_ID_ESRAM12 6 | ||
54 | #define EPOD_ID_ESRAM34 7 | ||
55 | #define NUM_EPOD_ID 8 | ||
56 | |||
57 | /* | ||
58 | * DB5500 EPODs | ||
59 | */ | ||
60 | #define DB5500_EPOD_ID_BASE 0x0100 | ||
61 | #define DB5500_EPOD_ID_SGA (DB5500_EPOD_ID_BASE + 0) | ||
62 | #define DB5500_EPOD_ID_HVA (DB5500_EPOD_ID_BASE + 1) | ||
63 | #define DB5500_EPOD_ID_SIA (DB5500_EPOD_ID_BASE + 2) | ||
64 | #define DB5500_EPOD_ID_DISP (DB5500_EPOD_ID_BASE + 3) | ||
65 | #define DB5500_EPOD_ID_ESRAM12 (DB5500_EPOD_ID_BASE + 6) | ||
66 | #define DB5500_NUM_EPOD_ID 7 | ||
67 | |||
68 | /* | ||
69 | * state definition for EPOD (power domain) | ||
70 | * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged | ||
71 | * - EPOD_STATE_OFF: The EPOD is switched off | ||
72 | * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in | ||
73 | * retention | ||
74 | * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off | ||
75 | * - EPOD_STATE_ON: Same as above, but with clock enabled | ||
76 | */ | ||
77 | #define EPOD_STATE_NO_CHANGE 0x00 | ||
78 | #define EPOD_STATE_OFF 0x01 | ||
79 | #define EPOD_STATE_RAMRET 0x02 | ||
80 | #define EPOD_STATE_ON_CLK_OFF 0x03 | ||
81 | #define EPOD_STATE_ON 0x04 | ||
82 | |||
83 | /* | ||
84 | * CLKOUT sources | ||
85 | */ | ||
86 | #define PRCMU_CLKSRC_CLK38M 0x00 | ||
87 | #define PRCMU_CLKSRC_ACLK 0x01 | ||
88 | #define PRCMU_CLKSRC_SYSCLK 0x02 | ||
89 | #define PRCMU_CLKSRC_LCDCLK 0x03 | ||
90 | #define PRCMU_CLKSRC_SDMMCCLK 0x04 | ||
91 | #define PRCMU_CLKSRC_TVCLK 0x05 | ||
92 | #define PRCMU_CLKSRC_TIMCLK 0x06 | ||
93 | #define PRCMU_CLKSRC_CLK009 0x07 | ||
94 | /* These are only valid for CLKOUT1: */ | ||
95 | #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40 | ||
96 | #define PRCMU_CLKSRC_I2CCLK 0x41 | ||
97 | #define PRCMU_CLKSRC_MSP02CLK 0x42 | ||
98 | #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43 | ||
99 | #define PRCMU_CLKSRC_HSIRXCLK 0x44 | ||
100 | #define PRCMU_CLKSRC_HSITXCLK 0x45 | ||
101 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | ||
102 | #define PRCMU_CLKSRC_HDMICLK 0x47 | ||
103 | |||
104 | /* | ||
105 | * Clock identifiers. | ||
106 | */ | ||
107 | enum prcmu_clock { | ||
108 | PRCMU_SGACLK, | ||
109 | PRCMU_UARTCLK, | ||
110 | PRCMU_MSP02CLK, | ||
111 | PRCMU_MSP1CLK, | ||
112 | PRCMU_I2CCLK, | ||
113 | PRCMU_SDMMCCLK, | ||
114 | PRCMU_SLIMCLK, | ||
115 | PRCMU_PER1CLK, | ||
116 | PRCMU_PER2CLK, | ||
117 | PRCMU_PER3CLK, | ||
118 | PRCMU_PER5CLK, | ||
119 | PRCMU_PER6CLK, | ||
120 | PRCMU_PER7CLK, | ||
121 | PRCMU_LCDCLK, | ||
122 | PRCMU_BMLCLK, | ||
123 | PRCMU_HSITXCLK, | ||
124 | PRCMU_HSIRXCLK, | ||
125 | PRCMU_HDMICLK, | ||
126 | PRCMU_APEATCLK, | ||
127 | PRCMU_APETRACECLK, | ||
128 | PRCMU_MCDECLK, | ||
129 | PRCMU_IPI2CCLK, | ||
130 | PRCMU_DSIALTCLK, | ||
131 | PRCMU_DMACLK, | ||
132 | PRCMU_B2R2CLK, | ||
133 | PRCMU_TVCLK, | ||
134 | PRCMU_SSPCLK, | ||
135 | PRCMU_RNGCLK, | ||
136 | PRCMU_UICCCLK, | ||
137 | PRCMU_PWMCLK, | ||
138 | PRCMU_IRDACLK, | ||
139 | PRCMU_IRRCCLK, | ||
140 | PRCMU_SIACLK, | ||
141 | PRCMU_SVACLK, | ||
142 | PRCMU_NUM_REG_CLOCKS, | ||
143 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | ||
144 | PRCMU_TIMCLK, | ||
145 | PRCMU_PLLSOC0, | ||
146 | PRCMU_PLLSOC1, | ||
147 | PRCMU_PLLDDR, | ||
148 | }; | ||
149 | |||
150 | /** | ||
151 | * enum ape_opp - APE OPP states definition | ||
152 | * @APE_OPP_INIT: | ||
153 | * @APE_NO_CHANGE: The APE operating point is unchanged | ||
154 | * @APE_100_OPP: The new APE operating point is ape100opp | ||
155 | * @APE_50_OPP: 50% | ||
156 | */ | ||
157 | enum ape_opp { | ||
158 | APE_OPP_INIT = 0x00, | ||
159 | APE_NO_CHANGE = 0x01, | ||
160 | APE_100_OPP = 0x02, | ||
161 | APE_50_OPP = 0x03 | ||
162 | }; | ||
163 | |||
164 | /** | ||
165 | * enum arm_opp - ARM OPP states definition | ||
166 | * @ARM_OPP_INIT: | ||
167 | * @ARM_NO_CHANGE: The ARM operating point is unchanged | ||
168 | * @ARM_100_OPP: The new ARM operating point is arm100opp | ||
169 | * @ARM_50_OPP: The new ARM operating point is arm50opp | ||
170 | * @ARM_MAX_OPP: Operating point is "max" (more than 100) | ||
171 | * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100 | ||
172 | * @ARM_EXTCLK: The new ARM operating point is armExtClk | ||
173 | */ | ||
174 | enum arm_opp { | ||
175 | ARM_OPP_INIT = 0x00, | ||
176 | ARM_NO_CHANGE = 0x01, | ||
177 | ARM_100_OPP = 0x02, | ||
178 | ARM_50_OPP = 0x03, | ||
179 | ARM_MAX_OPP = 0x04, | ||
180 | ARM_MAX_FREQ100OPP = 0x05, | ||
181 | ARM_EXTCLK = 0x07 | ||
182 | }; | ||
183 | |||
184 | /** | ||
185 | * enum ddr_opp - DDR OPP states definition | ||
186 | * @DDR_100_OPP: The new DDR operating point is ddr100opp | ||
187 | * @DDR_50_OPP: The new DDR operating point is ddr50opp | ||
188 | * @DDR_25_OPP: The new DDR operating point is ddr25opp | ||
189 | */ | ||
190 | enum ddr_opp { | ||
191 | DDR_100_OPP = 0x00, | ||
192 | DDR_50_OPP = 0x01, | ||
193 | DDR_25_OPP = 0x02, | ||
194 | }; | ||
195 | |||
196 | /* | ||
197 | * Definitions for controlling ESRAM0 in deep sleep. | ||
198 | */ | ||
199 | #define ESRAM0_DEEP_SLEEP_STATE_OFF 1 | ||
200 | #define ESRAM0_DEEP_SLEEP_STATE_RET 2 | ||
201 | |||
202 | /** | ||
203 | * enum ddr_pwrst - DDR power states definition | ||
204 | * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged | ||
205 | * @DDR_PWR_STATE_ON: | ||
206 | * @DDR_PWR_STATE_OFFLOWLAT: | ||
207 | * @DDR_PWR_STATE_OFFHIGHLAT: | ||
208 | */ | ||
209 | enum ddr_pwrst { | ||
210 | DDR_PWR_STATE_UNCHANGED = 0x00, | ||
211 | DDR_PWR_STATE_ON = 0x01, | ||
212 | DDR_PWR_STATE_OFFLOWLAT = 0x02, | ||
213 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | ||
214 | }; | ||
215 | |||
216 | #include <linux/mfd/db8500-prcmu.h> | ||
217 | #include <linux/mfd/db5500-prcmu.h> | ||
218 | |||
219 | #if defined(CONFIG_UX500_SOC_DB8500) || defined(CONFIG_UX500_SOC_DB5500) | ||
220 | |||
221 | static inline void __init prcmu_early_init(void) | ||
222 | { | ||
223 | if (machine_is_u5500()) | ||
224 | return db5500_prcmu_early_init(); | ||
225 | else | ||
226 | return db8500_prcmu_early_init(); | ||
227 | } | ||
228 | |||
229 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
230 | bool keep_ap_pll) | ||
231 | { | ||
232 | if (machine_is_u5500()) | ||
233 | return db5500_prcmu_set_power_state(state, keep_ulp_clk, | ||
234 | keep_ap_pll); | ||
235 | else | ||
236 | return db8500_prcmu_set_power_state(state, keep_ulp_clk, | ||
237 | keep_ap_pll); | ||
238 | } | ||
239 | |||
240 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | ||
241 | { | ||
242 | if (machine_is_u5500()) | ||
243 | return -EINVAL; | ||
244 | else | ||
245 | return db8500_prcmu_set_epod(epod_id, epod_state); | ||
246 | } | ||
247 | |||
248 | static inline void prcmu_enable_wakeups(u32 wakeups) | ||
249 | { | ||
250 | if (machine_is_u5500()) | ||
251 | db5500_prcmu_enable_wakeups(wakeups); | ||
252 | else | ||
253 | db8500_prcmu_enable_wakeups(wakeups); | ||
254 | } | ||
255 | |||
256 | static inline void prcmu_disable_wakeups(void) | ||
257 | { | ||
258 | prcmu_enable_wakeups(0); | ||
259 | } | ||
260 | |||
261 | static inline void prcmu_config_abb_event_readout(u32 abb_events) | ||
262 | { | ||
263 | if (machine_is_u5500()) | ||
264 | db5500_prcmu_config_abb_event_readout(abb_events); | ||
265 | else | ||
266 | db8500_prcmu_config_abb_event_readout(abb_events); | ||
267 | } | ||
268 | |||
269 | static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | ||
270 | { | ||
271 | if (machine_is_u5500()) | ||
272 | db5500_prcmu_get_abb_event_buffer(buf); | ||
273 | else | ||
274 | db8500_prcmu_get_abb_event_buffer(buf); | ||
275 | } | ||
276 | |||
277 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
278 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
279 | |||
280 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | ||
281 | |||
282 | static inline int prcmu_request_clock(u8 clock, bool enable) | ||
283 | { | ||
284 | if (machine_is_u5500()) | ||
285 | return db5500_prcmu_request_clock(clock, enable); | ||
286 | else | ||
287 | return db8500_prcmu_request_clock(clock, enable); | ||
288 | } | ||
289 | |||
290 | int prcmu_set_ape_opp(u8 opp); | ||
291 | int prcmu_get_ape_opp(void); | ||
292 | int prcmu_set_ddr_opp(u8 opp); | ||
293 | int prcmu_get_ddr_opp(void); | ||
294 | |||
295 | static inline int prcmu_set_arm_opp(u8 opp) | ||
296 | { | ||
297 | if (machine_is_u5500()) | ||
298 | return -EINVAL; | ||
299 | else | ||
300 | return db8500_prcmu_set_arm_opp(opp); | ||
301 | } | ||
302 | |||
303 | static inline int prcmu_get_arm_opp(void) | ||
304 | { | ||
305 | if (machine_is_u5500()) | ||
306 | return -EINVAL; | ||
307 | else | ||
308 | return db8500_prcmu_get_arm_opp(); | ||
309 | } | ||
310 | |||
311 | static inline void prcmu_system_reset(u16 reset_code) | ||
312 | { | ||
313 | if (machine_is_u5500()) | ||
314 | return db5500_prcmu_system_reset(reset_code); | ||
315 | else | ||
316 | return db8500_prcmu_system_reset(reset_code); | ||
317 | } | ||
318 | |||
319 | static inline u16 prcmu_get_reset_code(void) | ||
320 | { | ||
321 | if (machine_is_u5500()) | ||
322 | return db5500_prcmu_get_reset_code(); | ||
323 | else | ||
324 | return db8500_prcmu_get_reset_code(); | ||
325 | } | ||
326 | |||
327 | void prcmu_ac_wake_req(void); | ||
328 | void prcmu_ac_sleep_req(void); | ||
329 | void prcmu_modem_reset(void); | ||
330 | static inline bool prcmu_is_ac_wake_requested(void) | ||
331 | { | ||
332 | if (machine_is_u5500()) | ||
333 | return db5500_prcmu_is_ac_wake_requested(); | ||
334 | else | ||
335 | return db8500_prcmu_is_ac_wake_requested(); | ||
336 | } | ||
337 | |||
338 | static inline int prcmu_set_display_clocks(void) | ||
339 | { | ||
340 | if (machine_is_u5500()) | ||
341 | return db5500_prcmu_set_display_clocks(); | ||
342 | else | ||
343 | return db8500_prcmu_set_display_clocks(); | ||
344 | } | ||
345 | |||
346 | static inline int prcmu_disable_dsipll(void) | ||
347 | { | ||
348 | if (machine_is_u5500()) | ||
349 | return db5500_prcmu_disable_dsipll(); | ||
350 | else | ||
351 | return db8500_prcmu_disable_dsipll(); | ||
352 | } | ||
353 | |||
354 | static inline int prcmu_enable_dsipll(void) | ||
355 | { | ||
356 | if (machine_is_u5500()) | ||
357 | return db5500_prcmu_enable_dsipll(); | ||
358 | else | ||
359 | return db8500_prcmu_enable_dsipll(); | ||
360 | } | ||
361 | |||
362 | static inline int prcmu_config_esram0_deep_sleep(u8 state) | ||
363 | { | ||
364 | if (machine_is_u5500()) | ||
365 | return -EINVAL; | ||
366 | else | ||
367 | return db8500_prcmu_config_esram0_deep_sleep(state); | ||
368 | } | ||
369 | #else | ||
370 | |||
371 | static inline void __init prcmu_early_init(void) {} | ||
372 | |||
373 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
374 | bool keep_ap_pll) | ||
375 | { | ||
376 | return 0; | ||
377 | } | ||
378 | |||
379 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | ||
380 | { | ||
381 | return 0; | ||
382 | } | ||
383 | |||
384 | static inline void prcmu_enable_wakeups(u32 wakeups) {} | ||
385 | |||
386 | static inline void prcmu_disable_wakeups(void) {} | ||
387 | |||
388 | static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
389 | { | ||
390 | return -ENOSYS; | ||
391 | } | ||
392 | |||
393 | static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | ||
394 | { | ||
395 | return -ENOSYS; | ||
396 | } | ||
397 | |||
398 | static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) | ||
399 | { | ||
400 | return 0; | ||
401 | } | ||
402 | |||
403 | static inline int prcmu_request_clock(u8 clock, bool enable) | ||
404 | { | ||
405 | return 0; | ||
406 | } | ||
407 | |||
408 | static inline int prcmu_set_ape_opp(u8 opp) | ||
409 | { | ||
410 | return 0; | ||
411 | } | ||
412 | |||
413 | static inline int prcmu_get_ape_opp(void) | ||
414 | { | ||
415 | return APE_100_OPP; | ||
416 | } | ||
417 | |||
418 | static inline int prcmu_set_arm_opp(u8 opp) | ||
419 | { | ||
420 | return 0; | ||
421 | } | ||
422 | |||
423 | static inline int prcmu_get_arm_opp(void) | ||
424 | { | ||
425 | return ARM_100_OPP; | ||
426 | } | ||
427 | |||
428 | static inline int prcmu_set_ddr_opp(u8 opp) | ||
429 | { | ||
430 | return 0; | ||
431 | } | ||
432 | |||
433 | static inline int prcmu_get_ddr_opp(void) | ||
434 | { | ||
435 | return DDR_100_OPP; | ||
436 | } | ||
437 | |||
438 | static inline void prcmu_system_reset(u16 reset_code) {} | ||
439 | |||
440 | static inline u16 prcmu_get_reset_code(void) | ||
441 | { | ||
442 | return 0; | ||
443 | } | ||
444 | |||
445 | static inline void prcmu_ac_wake_req(void) {} | ||
446 | |||
447 | static inline void prcmu_ac_sleep_req(void) {} | ||
448 | |||
449 | static inline void prcmu_modem_reset(void) {} | ||
450 | |||
451 | static inline bool prcmu_is_ac_wake_requested(void) | ||
452 | { | ||
453 | return false; | ||
454 | } | ||
455 | |||
456 | static inline int prcmu_set_display_clocks(void) | ||
457 | { | ||
458 | return 0; | ||
459 | } | ||
460 | |||
461 | static inline int prcmu_disable_dsipll(void) | ||
462 | { | ||
463 | return 0; | ||
464 | } | ||
465 | |||
466 | static inline int prcmu_enable_dsipll(void) | ||
467 | { | ||
468 | return 0; | ||
469 | } | ||
470 | |||
471 | static inline int prcmu_config_esram0_deep_sleep(u8 state) | ||
472 | { | ||
473 | return 0; | ||
474 | } | ||
475 | |||
476 | static inline void prcmu_config_abb_event_readout(u32 abb_events) {} | ||
477 | |||
478 | static inline void prcmu_get_abb_event_buffer(void __iomem **buf) | ||
479 | { | ||
480 | *buf = NULL; | ||
481 | } | ||
482 | |||
483 | #endif | ||
484 | |||
485 | /* PRCMU QoS APE OPP class */ | ||
486 | #define PRCMU_QOS_APE_OPP 1 | ||
487 | #define PRCMU_QOS_DDR_OPP 2 | ||
488 | #define PRCMU_QOS_DEFAULT_VALUE -1 | ||
489 | |||
490 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | ||
491 | |||
492 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | ||
493 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | ||
494 | void prcmu_qos_force_opp(int, s32); | ||
495 | int prcmu_qos_requirement(int pm_qos_class); | ||
496 | int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); | ||
497 | int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value); | ||
498 | void prcmu_qos_remove_requirement(int pm_qos_class, char *name); | ||
499 | int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
500 | struct notifier_block *notifier); | ||
501 | int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
502 | struct notifier_block *notifier); | ||
503 | |||
504 | #else | ||
505 | |||
506 | static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void) | ||
507 | { | ||
508 | return 0; | ||
509 | } | ||
510 | |||
511 | static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {} | ||
512 | |||
513 | static inline void prcmu_qos_force_opp(int prcmu_qos_class, s32 i) {} | ||
514 | |||
515 | static inline int prcmu_qos_requirement(int prcmu_qos_class) | ||
516 | { | ||
517 | return 0; | ||
518 | } | ||
519 | |||
520 | static inline int prcmu_qos_add_requirement(int prcmu_qos_class, | ||
521 | char *name, s32 value) | ||
522 | { | ||
523 | return 0; | ||
524 | } | ||
525 | |||
526 | static inline int prcmu_qos_update_requirement(int prcmu_qos_class, | ||
527 | char *name, s32 new_value) | ||
528 | { | ||
529 | return 0; | ||
530 | } | ||
531 | |||
532 | static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) | ||
533 | { | ||
534 | } | ||
535 | |||
536 | static inline int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
537 | struct notifier_block *notifier) | ||
538 | { | ||
539 | return 0; | ||
540 | } | ||
541 | static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
542 | struct notifier_block *notifier) | ||
543 | { | ||
544 | return 0; | ||
545 | } | ||
546 | |||
547 | #endif | ||
548 | |||
549 | #endif /* __MACH_PRCMU_H */ | ||
diff --git a/include/linux/mfd/intel_msic.h b/include/linux/mfd/intel_msic.h new file mode 100644 index 000000000000..439a7a617bc9 --- /dev/null +++ b/include/linux/mfd/intel_msic.h | |||
@@ -0,0 +1,456 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/intel_msic.h - Core interface for Intel MSIC | ||
3 | * | ||
4 | * Copyright (C) 2011, Intel Corporation | ||
5 | * Author: Mika Westerberg <mika.westerberg@linux.intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_MFD_INTEL_MSIC_H__ | ||
13 | #define __LINUX_MFD_INTEL_MSIC_H__ | ||
14 | |||
15 | /* ID */ | ||
16 | #define INTEL_MSIC_ID0 0x000 /* RO */ | ||
17 | #define INTEL_MSIC_ID1 0x001 /* RO */ | ||
18 | |||
19 | /* IRQ */ | ||
20 | #define INTEL_MSIC_IRQLVL1 0x002 | ||
21 | #define INTEL_MSIC_ADC1INT 0x003 | ||
22 | #define INTEL_MSIC_CCINT 0x004 | ||
23 | #define INTEL_MSIC_PWRSRCINT 0x005 | ||
24 | #define INTEL_MSIC_PWRSRCINT1 0x006 | ||
25 | #define INTEL_MSIC_CHRINT 0x007 | ||
26 | #define INTEL_MSIC_CHRINT1 0x008 | ||
27 | #define INTEL_MSIC_RTCIRQ 0x009 | ||
28 | #define INTEL_MSIC_GPIO0LVIRQ 0x00a | ||
29 | #define INTEL_MSIC_GPIO1LVIRQ 0x00b | ||
30 | #define INTEL_MSIC_GPIOHVIRQ 0x00c | ||
31 | #define INTEL_MSIC_VRINT 0x00d | ||
32 | #define INTEL_MSIC_OCAUDIO 0x00e | ||
33 | #define INTEL_MSIC_ACCDET 0x00f | ||
34 | #define INTEL_MSIC_RESETIRQ1 0x010 | ||
35 | #define INTEL_MSIC_RESETIRQ2 0x011 | ||
36 | #define INTEL_MSIC_MADC1INT 0x012 | ||
37 | #define INTEL_MSIC_MCCINT 0x013 | ||
38 | #define INTEL_MSIC_MPWRSRCINT 0x014 | ||
39 | #define INTEL_MSIC_MPWRSRCINT1 0x015 | ||
40 | #define INTEL_MSIC_MCHRINT 0x016 | ||
41 | #define INTEL_MSIC_MCHRINT1 0x017 | ||
42 | #define INTEL_MSIC_RTCIRQMASK 0x018 | ||
43 | #define INTEL_MSIC_GPIO0LVIRQMASK 0x019 | ||
44 | #define INTEL_MSIC_GPIO1LVIRQMASK 0x01a | ||
45 | #define INTEL_MSIC_GPIOHVIRQMASK 0x01b | ||
46 | #define INTEL_MSIC_VRINTMASK 0x01c | ||
47 | #define INTEL_MSIC_OCAUDIOMASK 0x01d | ||
48 | #define INTEL_MSIC_ACCDETMASK 0x01e | ||
49 | #define INTEL_MSIC_RESETIRQ1MASK 0x01f | ||
50 | #define INTEL_MSIC_RESETIRQ2MASK 0x020 | ||
51 | #define INTEL_MSIC_IRQLVL1MSK 0x021 | ||
52 | #define INTEL_MSIC_PBCONFIG 0x03e | ||
53 | #define INTEL_MSIC_PBSTATUS 0x03f /* RO */ | ||
54 | |||
55 | /* GPIO */ | ||
56 | #define INTEL_MSIC_GPIO0LV7CTLO 0x040 | ||
57 | #define INTEL_MSIC_GPIO0LV6CTLO 0x041 | ||
58 | #define INTEL_MSIC_GPIO0LV5CTLO 0x042 | ||
59 | #define INTEL_MSIC_GPIO0LV4CTLO 0x043 | ||
60 | #define INTEL_MSIC_GPIO0LV3CTLO 0x044 | ||
61 | #define INTEL_MSIC_GPIO0LV2CTLO 0x045 | ||
62 | #define INTEL_MSIC_GPIO0LV1CTLO 0x046 | ||
63 | #define INTEL_MSIC_GPIO0LV0CTLO 0x047 | ||
64 | #define INTEL_MSIC_GPIO1LV7CTLOS 0x048 | ||
65 | #define INTEL_MSIC_GPIO1LV6CTLO 0x049 | ||
66 | #define INTEL_MSIC_GPIO1LV5CTLO 0x04a | ||
67 | #define INTEL_MSIC_GPIO1LV4CTLO 0x04b | ||
68 | #define INTEL_MSIC_GPIO1LV3CTLO 0x04c | ||
69 | #define INTEL_MSIC_GPIO1LV2CTLO 0x04d | ||
70 | #define INTEL_MSIC_GPIO1LV1CTLO 0x04e | ||
71 | #define INTEL_MSIC_GPIO1LV0CTLO 0x04f | ||
72 | #define INTEL_MSIC_GPIO0LV7CTLI 0x050 | ||
73 | #define INTEL_MSIC_GPIO0LV6CTLI 0x051 | ||
74 | #define INTEL_MSIC_GPIO0LV5CTLI 0x052 | ||
75 | #define INTEL_MSIC_GPIO0LV4CTLI 0x053 | ||
76 | #define INTEL_MSIC_GPIO0LV3CTLI 0x054 | ||
77 | #define INTEL_MSIC_GPIO0LV2CTLI 0x055 | ||
78 | #define INTEL_MSIC_GPIO0LV1CTLI 0x056 | ||
79 | #define INTEL_MSIC_GPIO0LV0CTLI 0x057 | ||
80 | #define INTEL_MSIC_GPIO1LV7CTLIS 0x058 | ||
81 | #define INTEL_MSIC_GPIO1LV6CTLI 0x059 | ||
82 | #define INTEL_MSIC_GPIO1LV5CTLI 0x05a | ||
83 | #define INTEL_MSIC_GPIO1LV4CTLI 0x05b | ||
84 | #define INTEL_MSIC_GPIO1LV3CTLI 0x05c | ||
85 | #define INTEL_MSIC_GPIO1LV2CTLI 0x05d | ||
86 | #define INTEL_MSIC_GPIO1LV1CTLI 0x05e | ||
87 | #define INTEL_MSIC_GPIO1LV0CTLI 0x05f | ||
88 | #define INTEL_MSIC_PWM0CLKDIV1 0x061 | ||
89 | #define INTEL_MSIC_PWM0CLKDIV0 0x062 | ||
90 | #define INTEL_MSIC_PWM1CLKDIV1 0x063 | ||
91 | #define INTEL_MSIC_PWM1CLKDIV0 0x064 | ||
92 | #define INTEL_MSIC_PWM2CLKDIV1 0x065 | ||
93 | #define INTEL_MSIC_PWM2CLKDIV0 0x066 | ||
94 | #define INTEL_MSIC_PWM0DUTYCYCLE 0x067 | ||
95 | #define INTEL_MSIC_PWM1DUTYCYCLE 0x068 | ||
96 | #define INTEL_MSIC_PWM2DUTYCYCLE 0x069 | ||
97 | #define INTEL_MSIC_GPIO0HV3CTLO 0x06d | ||
98 | #define INTEL_MSIC_GPIO0HV2CTLO 0x06e | ||
99 | #define INTEL_MSIC_GPIO0HV1CTLO 0x06f | ||
100 | #define INTEL_MSIC_GPIO0HV0CTLO 0x070 | ||
101 | #define INTEL_MSIC_GPIO1HV3CTLO 0x071 | ||
102 | #define INTEL_MSIC_GPIO1HV2CTLO 0x072 | ||
103 | #define INTEL_MSIC_GPIO1HV1CTLO 0x073 | ||
104 | #define INTEL_MSIC_GPIO1HV0CTLO 0x074 | ||
105 | #define INTEL_MSIC_GPIO0HV3CTLI 0x075 | ||
106 | #define INTEL_MSIC_GPIO0HV2CTLI 0x076 | ||
107 | #define INTEL_MSIC_GPIO0HV1CTLI 0x077 | ||
108 | #define INTEL_MSIC_GPIO0HV0CTLI 0x078 | ||
109 | #define INTEL_MSIC_GPIO1HV3CTLI 0x079 | ||
110 | #define INTEL_MSIC_GPIO1HV2CTLI 0x07a | ||
111 | #define INTEL_MSIC_GPIO1HV1CTLI 0x07b | ||
112 | #define INTEL_MSIC_GPIO1HV0CTLI 0x07c | ||
113 | |||
114 | /* SVID */ | ||
115 | #define INTEL_MSIC_SVIDCTRL0 0x080 | ||
116 | #define INTEL_MSIC_SVIDCTRL1 0x081 | ||
117 | #define INTEL_MSIC_SVIDCTRL2 0x082 | ||
118 | #define INTEL_MSIC_SVIDTXLASTPKT3 0x083 /* RO */ | ||
119 | #define INTEL_MSIC_SVIDTXLASTPKT2 0x084 /* RO */ | ||
120 | #define INTEL_MSIC_SVIDTXLASTPKT1 0x085 /* RO */ | ||
121 | #define INTEL_MSIC_SVIDTXLASTPKT0 0x086 /* RO */ | ||
122 | #define INTEL_MSIC_SVIDPKTOUTBYTE3 0x087 | ||
123 | #define INTEL_MSIC_SVIDPKTOUTBYTE2 0x088 | ||
124 | #define INTEL_MSIC_SVIDPKTOUTBYTE1 0x089 | ||
125 | #define INTEL_MSIC_SVIDPKTOUTBYTE0 0x08a | ||
126 | #define INTEL_MSIC_SVIDRXVPDEBUG1 0x08b | ||
127 | #define INTEL_MSIC_SVIDRXVPDEBUG0 0x08c | ||
128 | #define INTEL_MSIC_SVIDRXLASTPKT3 0x08d /* RO */ | ||
129 | #define INTEL_MSIC_SVIDRXLASTPKT2 0x08e /* RO */ | ||
130 | #define INTEL_MSIC_SVIDRXLASTPKT1 0x08f /* RO */ | ||
131 | #define INTEL_MSIC_SVIDRXLASTPKT0 0x090 /* RO */ | ||
132 | #define INTEL_MSIC_SVIDRXCHKSTATUS3 0x091 /* RO */ | ||
133 | #define INTEL_MSIC_SVIDRXCHKSTATUS2 0x092 /* RO */ | ||
134 | #define INTEL_MSIC_SVIDRXCHKSTATUS1 0x093 /* RO */ | ||
135 | #define INTEL_MSIC_SVIDRXCHKSTATUS0 0x094 /* RO */ | ||
136 | |||
137 | /* VREG */ | ||
138 | #define INTEL_MSIC_VCCLATCH 0x0c0 | ||
139 | #define INTEL_MSIC_VNNLATCH 0x0c1 | ||
140 | #define INTEL_MSIC_VCCCNT 0x0c2 | ||
141 | #define INTEL_MSIC_SMPSRAMP 0x0c3 | ||
142 | #define INTEL_MSIC_VNNCNT 0x0c4 | ||
143 | #define INTEL_MSIC_VNNAONCNT 0x0c5 | ||
144 | #define INTEL_MSIC_VCC122AONCNT 0x0c6 | ||
145 | #define INTEL_MSIC_V180AONCNT 0x0c7 | ||
146 | #define INTEL_MSIC_V500CNT 0x0c8 | ||
147 | #define INTEL_MSIC_VIHFCNT 0x0c9 | ||
148 | #define INTEL_MSIC_LDORAMP1 0x0ca | ||
149 | #define INTEL_MSIC_LDORAMP2 0x0cb | ||
150 | #define INTEL_MSIC_VCC108AONCNT 0x0cc | ||
151 | #define INTEL_MSIC_VCC108ASCNT 0x0cd | ||
152 | #define INTEL_MSIC_VCC108CNT 0x0ce | ||
153 | #define INTEL_MSIC_VCCA100ASCNT 0x0cf | ||
154 | #define INTEL_MSIC_VCCA100CNT 0x0d0 | ||
155 | #define INTEL_MSIC_VCC180AONCNT 0x0d1 | ||
156 | #define INTEL_MSIC_VCC180CNT 0x0d2 | ||
157 | #define INTEL_MSIC_VCC330CNT 0x0d3 | ||
158 | #define INTEL_MSIC_VUSB330CNT 0x0d4 | ||
159 | #define INTEL_MSIC_VCCSDIOCNT 0x0d5 | ||
160 | #define INTEL_MSIC_VPROG1CNT 0x0d6 | ||
161 | #define INTEL_MSIC_VPROG2CNT 0x0d7 | ||
162 | #define INTEL_MSIC_VEMMCSCNT 0x0d8 | ||
163 | #define INTEL_MSIC_VEMMC1CNT 0x0d9 | ||
164 | #define INTEL_MSIC_VEMMC2CNT 0x0da | ||
165 | #define INTEL_MSIC_VAUDACNT 0x0db | ||
166 | #define INTEL_MSIC_VHSPCNT 0x0dc | ||
167 | #define INTEL_MSIC_VHSNCNT 0x0dd | ||
168 | #define INTEL_MSIC_VHDMICNT 0x0de | ||
169 | #define INTEL_MSIC_VOTGCNT 0x0df | ||
170 | #define INTEL_MSIC_V1P35CNT 0x0e0 | ||
171 | #define INTEL_MSIC_V330AONCNT 0x0e1 | ||
172 | |||
173 | /* RESET */ | ||
174 | #define INTEL_MSIC_CHIPCNTRL 0x100 /* WO */ | ||
175 | #define INTEL_MSIC_ERCONFIG 0x101 | ||
176 | |||
177 | /* BURST */ | ||
178 | #define INTEL_MSIC_BATCURRENTLIMIT12 0x102 | ||
179 | #define INTEL_MSIC_BATTIMELIMIT12 0x103 | ||
180 | #define INTEL_MSIC_BATTIMELIMIT3 0x104 | ||
181 | #define INTEL_MSIC_BATTIMEDB 0x105 | ||
182 | #define INTEL_MSIC_BRSTCONFIGOUTPUTS 0x106 | ||
183 | #define INTEL_MSIC_BRSTCONFIGACTIONS 0x107 | ||
184 | #define INTEL_MSIC_BURSTCONTROLSTATUS 0x108 | ||
185 | |||
186 | /* RTC */ | ||
187 | #define INTEL_MSIC_RTCB1 0x140 /* RO */ | ||
188 | #define INTEL_MSIC_RTCB2 0x141 /* RO */ | ||
189 | #define INTEL_MSIC_RTCB3 0x142 /* RO */ | ||
190 | #define INTEL_MSIC_RTCB4 0x143 /* RO */ | ||
191 | #define INTEL_MSIC_RTCOB1 0x144 | ||
192 | #define INTEL_MSIC_RTCOB2 0x145 | ||
193 | #define INTEL_MSIC_RTCOB3 0x146 | ||
194 | #define INTEL_MSIC_RTCOB4 0x147 | ||
195 | #define INTEL_MSIC_RTCAB1 0x148 | ||
196 | #define INTEL_MSIC_RTCAB2 0x149 | ||
197 | #define INTEL_MSIC_RTCAB3 0x14a | ||
198 | #define INTEL_MSIC_RTCAB4 0x14b | ||
199 | #define INTEL_MSIC_RTCWAB1 0x14c | ||
200 | #define INTEL_MSIC_RTCWAB2 0x14d | ||
201 | #define INTEL_MSIC_RTCWAB3 0x14e | ||
202 | #define INTEL_MSIC_RTCWAB4 0x14f | ||
203 | #define INTEL_MSIC_RTCSC1 0x150 | ||
204 | #define INTEL_MSIC_RTCSC2 0x151 | ||
205 | #define INTEL_MSIC_RTCSC3 0x152 | ||
206 | #define INTEL_MSIC_RTCSC4 0x153 | ||
207 | #define INTEL_MSIC_RTCSTATUS 0x154 /* RO */ | ||
208 | #define INTEL_MSIC_RTCCONFIG1 0x155 | ||
209 | #define INTEL_MSIC_RTCCONFIG2 0x156 | ||
210 | |||
211 | /* CHARGER */ | ||
212 | #define INTEL_MSIC_BDTIMER 0x180 | ||
213 | #define INTEL_MSIC_BATTRMV 0x181 | ||
214 | #define INTEL_MSIC_VBUSDET 0x182 | ||
215 | #define INTEL_MSIC_VBUSDET1 0x183 | ||
216 | #define INTEL_MSIC_ADPHVDET 0x184 | ||
217 | #define INTEL_MSIC_ADPLVDET 0x185 | ||
218 | #define INTEL_MSIC_ADPDETDBDM 0x186 | ||
219 | #define INTEL_MSIC_LOWBATTDET 0x187 | ||
220 | #define INTEL_MSIC_CHRCTRL 0x188 | ||
221 | #define INTEL_MSIC_CHRCVOLTAGE 0x189 | ||
222 | #define INTEL_MSIC_CHRCCURRENT 0x18a | ||
223 | #define INTEL_MSIC_SPCHARGER 0x18b | ||
224 | #define INTEL_MSIC_CHRTTIME 0x18c | ||
225 | #define INTEL_MSIC_CHRCTRL1 0x18d | ||
226 | #define INTEL_MSIC_PWRSRCLMT 0x18e | ||
227 | #define INTEL_MSIC_CHRSTWDT 0x18f | ||
228 | #define INTEL_MSIC_WDTWRITE 0x190 /* WO */ | ||
229 | #define INTEL_MSIC_CHRSAFELMT 0x191 | ||
230 | #define INTEL_MSIC_SPWRSRCINT 0x192 /* RO */ | ||
231 | #define INTEL_MSIC_SPWRSRCINT1 0x193 /* RO */ | ||
232 | #define INTEL_MSIC_CHRLEDPWM 0x194 | ||
233 | #define INTEL_MSIC_CHRLEDCTRL 0x195 | ||
234 | |||
235 | /* ADC */ | ||
236 | #define INTEL_MSIC_ADC1CNTL1 0x1c0 | ||
237 | #define INTEL_MSIC_ADC1CNTL2 0x1c1 | ||
238 | #define INTEL_MSIC_ADC1CNTL3 0x1c2 | ||
239 | #define INTEL_MSIC_ADC1OFFSETH 0x1c3 /* RO */ | ||
240 | #define INTEL_MSIC_ADC1OFFSETL 0x1c4 /* RO */ | ||
241 | #define INTEL_MSIC_ADC1ADDR0 0x1c5 | ||
242 | #define INTEL_MSIC_ADC1ADDR1 0x1c6 | ||
243 | #define INTEL_MSIC_ADC1ADDR2 0x1c7 | ||
244 | #define INTEL_MSIC_ADC1ADDR3 0x1c8 | ||
245 | #define INTEL_MSIC_ADC1ADDR4 0x1c9 | ||
246 | #define INTEL_MSIC_ADC1ADDR5 0x1ca | ||
247 | #define INTEL_MSIC_ADC1ADDR6 0x1cb | ||
248 | #define INTEL_MSIC_ADC1ADDR7 0x1cc | ||
249 | #define INTEL_MSIC_ADC1ADDR8 0x1cd | ||
250 | #define INTEL_MSIC_ADC1ADDR9 0x1ce | ||
251 | #define INTEL_MSIC_ADC1ADDR10 0x1cf | ||
252 | #define INTEL_MSIC_ADC1ADDR11 0x1d0 | ||
253 | #define INTEL_MSIC_ADC1ADDR12 0x1d1 | ||
254 | #define INTEL_MSIC_ADC1ADDR13 0x1d2 | ||
255 | #define INTEL_MSIC_ADC1ADDR14 0x1d3 | ||
256 | #define INTEL_MSIC_ADC1SNS0H 0x1d4 /* RO */ | ||
257 | #define INTEL_MSIC_ADC1SNS0L 0x1d5 /* RO */ | ||
258 | #define INTEL_MSIC_ADC1SNS1H 0x1d6 /* RO */ | ||
259 | #define INTEL_MSIC_ADC1SNS1L 0x1d7 /* RO */ | ||
260 | #define INTEL_MSIC_ADC1SNS2H 0x1d8 /* RO */ | ||
261 | #define INTEL_MSIC_ADC1SNS2L 0x1d9 /* RO */ | ||
262 | #define INTEL_MSIC_ADC1SNS3H 0x1da /* RO */ | ||
263 | #define INTEL_MSIC_ADC1SNS3L 0x1db /* RO */ | ||
264 | #define INTEL_MSIC_ADC1SNS4H 0x1dc /* RO */ | ||
265 | #define INTEL_MSIC_ADC1SNS4L 0x1dd /* RO */ | ||
266 | #define INTEL_MSIC_ADC1SNS5H 0x1de /* RO */ | ||
267 | #define INTEL_MSIC_ADC1SNS5L 0x1df /* RO */ | ||
268 | #define INTEL_MSIC_ADC1SNS6H 0x1e0 /* RO */ | ||
269 | #define INTEL_MSIC_ADC1SNS6L 0x1e1 /* RO */ | ||
270 | #define INTEL_MSIC_ADC1SNS7H 0x1e2 /* RO */ | ||
271 | #define INTEL_MSIC_ADC1SNS7L 0x1e3 /* RO */ | ||
272 | #define INTEL_MSIC_ADC1SNS8H 0x1e4 /* RO */ | ||
273 | #define INTEL_MSIC_ADC1SNS8L 0x1e5 /* RO */ | ||
274 | #define INTEL_MSIC_ADC1SNS9H 0x1e6 /* RO */ | ||
275 | #define INTEL_MSIC_ADC1SNS9L 0x1e7 /* RO */ | ||
276 | #define INTEL_MSIC_ADC1SNS10H 0x1e8 /* RO */ | ||
277 | #define INTEL_MSIC_ADC1SNS10L 0x1e9 /* RO */ | ||
278 | #define INTEL_MSIC_ADC1SNS11H 0x1ea /* RO */ | ||
279 | #define INTEL_MSIC_ADC1SNS11L 0x1eb /* RO */ | ||
280 | #define INTEL_MSIC_ADC1SNS12H 0x1ec /* RO */ | ||
281 | #define INTEL_MSIC_ADC1SNS12L 0x1ed /* RO */ | ||
282 | #define INTEL_MSIC_ADC1SNS13H 0x1ee /* RO */ | ||
283 | #define INTEL_MSIC_ADC1SNS13L 0x1ef /* RO */ | ||
284 | #define INTEL_MSIC_ADC1SNS14H 0x1f0 /* RO */ | ||
285 | #define INTEL_MSIC_ADC1SNS14L 0x1f1 /* RO */ | ||
286 | #define INTEL_MSIC_ADC1BV0H 0x1f2 /* RO */ | ||
287 | #define INTEL_MSIC_ADC1BV0L 0x1f3 /* RO */ | ||
288 | #define INTEL_MSIC_ADC1BV1H 0x1f4 /* RO */ | ||
289 | #define INTEL_MSIC_ADC1BV1L 0x1f5 /* RO */ | ||
290 | #define INTEL_MSIC_ADC1BV2H 0x1f6 /* RO */ | ||
291 | #define INTEL_MSIC_ADC1BV2L 0x1f7 /* RO */ | ||
292 | #define INTEL_MSIC_ADC1BV3H 0x1f8 /* RO */ | ||
293 | #define INTEL_MSIC_ADC1BV3L 0x1f9 /* RO */ | ||
294 | #define INTEL_MSIC_ADC1BI0H 0x1fa /* RO */ | ||
295 | #define INTEL_MSIC_ADC1BI0L 0x1fb /* RO */ | ||
296 | #define INTEL_MSIC_ADC1BI1H 0x1fc /* RO */ | ||
297 | #define INTEL_MSIC_ADC1BI1L 0x1fd /* RO */ | ||
298 | #define INTEL_MSIC_ADC1BI2H 0x1fe /* RO */ | ||
299 | #define INTEL_MSIC_ADC1BI2L 0x1ff /* RO */ | ||
300 | #define INTEL_MSIC_ADC1BI3H 0x200 /* RO */ | ||
301 | #define INTEL_MSIC_ADC1BI3L 0x201 /* RO */ | ||
302 | #define INTEL_MSIC_CCCNTL 0x202 | ||
303 | #define INTEL_MSIC_CCOFFSETH 0x203 /* RO */ | ||
304 | #define INTEL_MSIC_CCOFFSETL 0x204 /* RO */ | ||
305 | #define INTEL_MSIC_CCADCHA 0x205 /* RO */ | ||
306 | #define INTEL_MSIC_CCADCLA 0x206 /* RO */ | ||
307 | |||
308 | /* AUDIO */ | ||
309 | #define INTEL_MSIC_AUDPLLCTRL 0x240 | ||
310 | #define INTEL_MSIC_DMICBUF0123 0x241 | ||
311 | #define INTEL_MSIC_DMICBUF45 0x242 | ||
312 | #define INTEL_MSIC_DMICGPO 0x244 | ||
313 | #define INTEL_MSIC_DMICMUX 0x245 | ||
314 | #define INTEL_MSIC_DMICCLK 0x246 | ||
315 | #define INTEL_MSIC_MICBIAS 0x247 | ||
316 | #define INTEL_MSIC_ADCCONFIG 0x248 | ||
317 | #define INTEL_MSIC_MICAMP1 0x249 | ||
318 | #define INTEL_MSIC_MICAMP2 0x24a | ||
319 | #define INTEL_MSIC_NOISEMUX 0x24b | ||
320 | #define INTEL_MSIC_AUDIOMUX12 0x24c | ||
321 | #define INTEL_MSIC_AUDIOMUX34 0x24d | ||
322 | #define INTEL_MSIC_AUDIOSINC 0x24e | ||
323 | #define INTEL_MSIC_AUDIOTXEN 0x24f | ||
324 | #define INTEL_MSIC_HSEPRXCTRL 0x250 | ||
325 | #define INTEL_MSIC_IHFRXCTRL 0x251 | ||
326 | #define INTEL_MSIC_VOICETXVOL 0x252 | ||
327 | #define INTEL_MSIC_SIDETONEVOL 0x253 | ||
328 | #define INTEL_MSIC_MUSICSHARVOL 0x254 | ||
329 | #define INTEL_MSIC_VOICETXCTRL 0x255 | ||
330 | #define INTEL_MSIC_HSMIXER 0x256 | ||
331 | #define INTEL_MSIC_DACCONFIG 0x257 | ||
332 | #define INTEL_MSIC_SOFTMUTE 0x258 | ||
333 | #define INTEL_MSIC_HSLVOLCTRL 0x259 | ||
334 | #define INTEL_MSIC_HSRVOLCTRL 0x25a | ||
335 | #define INTEL_MSIC_IHFLVOLCTRL 0x25b | ||
336 | #define INTEL_MSIC_IHFRVOLCTRL 0x25c | ||
337 | #define INTEL_MSIC_DRIVEREN 0x25d | ||
338 | #define INTEL_MSIC_LINEOUTCTRL 0x25e | ||
339 | #define INTEL_MSIC_VIB1CTRL1 0x25f | ||
340 | #define INTEL_MSIC_VIB1CTRL2 0x260 | ||
341 | #define INTEL_MSIC_VIB1CTRL3 0x261 | ||
342 | #define INTEL_MSIC_VIB1SPIPCM_1 0x262 | ||
343 | #define INTEL_MSIC_VIB1SPIPCM_2 0x263 | ||
344 | #define INTEL_MSIC_VIB1CTRL5 0x264 | ||
345 | #define INTEL_MSIC_VIB2CTRL1 0x265 | ||
346 | #define INTEL_MSIC_VIB2CTRL2 0x266 | ||
347 | #define INTEL_MSIC_VIB2CTRL3 0x267 | ||
348 | #define INTEL_MSIC_VIB2SPIPCM_1 0x268 | ||
349 | #define INTEL_MSIC_VIB2SPIPCM_2 0x269 | ||
350 | #define INTEL_MSIC_VIB2CTRL5 0x26a | ||
351 | #define INTEL_MSIC_BTNCTRL1 0x26b | ||
352 | #define INTEL_MSIC_BTNCTRL2 0x26c | ||
353 | #define INTEL_MSIC_PCM1TXSLOT01 0x26d | ||
354 | #define INTEL_MSIC_PCM1TXSLOT23 0x26e | ||
355 | #define INTEL_MSIC_PCM1TXSLOT45 0x26f | ||
356 | #define INTEL_MSIC_PCM1RXSLOT0123 0x270 | ||
357 | #define INTEL_MSIC_PCM1RXSLOT045 0x271 | ||
358 | #define INTEL_MSIC_PCM2TXSLOT01 0x272 | ||
359 | #define INTEL_MSIC_PCM2TXSLOT23 0x273 | ||
360 | #define INTEL_MSIC_PCM2TXSLOT45 0x274 | ||
361 | #define INTEL_MSIC_PCM2RXSLOT01 0x275 | ||
362 | #define INTEL_MSIC_PCM2RXSLOT23 0x276 | ||
363 | #define INTEL_MSIC_PCM2RXSLOT45 0x277 | ||
364 | #define INTEL_MSIC_PCM1CTRL1 0x278 | ||
365 | #define INTEL_MSIC_PCM1CTRL2 0x279 | ||
366 | #define INTEL_MSIC_PCM1CTRL3 0x27a | ||
367 | #define INTEL_MSIC_PCM2CTRL1 0x27b | ||
368 | #define INTEL_MSIC_PCM2CTRL2 0x27c | ||
369 | |||
370 | /* HDMI */ | ||
371 | #define INTEL_MSIC_HDMIPUEN 0x280 | ||
372 | #define INTEL_MSIC_HDMISTATUS 0x281 /* RO */ | ||
373 | |||
374 | /* Physical address of the start of the MSIC interrupt tree in SRAM */ | ||
375 | #define INTEL_MSIC_IRQ_PHYS_BASE 0xffff7fc0 | ||
376 | |||
377 | /** | ||
378 | * struct intel_msic_gpio_pdata - platform data for the MSIC GPIO driver | ||
379 | * @gpio_base: base number for the GPIOs | ||
380 | */ | ||
381 | struct intel_msic_gpio_pdata { | ||
382 | unsigned gpio_base; | ||
383 | }; | ||
384 | |||
385 | /** | ||
386 | * struct intel_msic_ocd_pdata - platform data for the MSIC OCD driver | ||
387 | * @gpio: GPIO number used for OCD interrupts | ||
388 | * | ||
389 | * The MSIC MFD driver converts @gpio into an IRQ number and passes it to | ||
390 | * the OCD driver as %IORESOURCE_IRQ. | ||
391 | */ | ||
392 | struct intel_msic_ocd_pdata { | ||
393 | unsigned gpio; | ||
394 | }; | ||
395 | |||
396 | /* MSIC embedded blocks (subdevices) */ | ||
397 | enum intel_msic_block { | ||
398 | INTEL_MSIC_BLOCK_TOUCH, | ||
399 | INTEL_MSIC_BLOCK_ADC, | ||
400 | INTEL_MSIC_BLOCK_BATTERY, | ||
401 | INTEL_MSIC_BLOCK_GPIO, | ||
402 | INTEL_MSIC_BLOCK_AUDIO, | ||
403 | INTEL_MSIC_BLOCK_HDMI, | ||
404 | INTEL_MSIC_BLOCK_THERMAL, | ||
405 | INTEL_MSIC_BLOCK_POWER_BTN, | ||
406 | INTEL_MSIC_BLOCK_OCD, | ||
407 | |||
408 | INTEL_MSIC_BLOCK_LAST, | ||
409 | }; | ||
410 | |||
411 | /** | ||
412 | * struct intel_msic_platform_data - platform data for the MSIC driver | ||
413 | * @irq: array of interrupt numbers, one per device. If @irq is set to %0 | ||
414 | * for a given block, the corresponding platform device is not | ||
415 | * created. For devices which don't have an interrupt, use %0xff | ||
416 | * (this is same as in SFI spec). | ||
417 | * @gpio: platform data for the MSIC GPIO driver | ||
418 | * @ocd: platform data for the MSIC OCD driver | ||
419 | * | ||
420 | * Once the MSIC driver is initialized, the register interface is ready to | ||
421 | * use. All the platform devices for subdevices are created after the | ||
422 | * register interface is ready so that we can guarantee its availability to | ||
423 | * the subdevice drivers. | ||
424 | * | ||
425 | * Interrupt numbers are passed to the subdevices via %IORESOURCE_IRQ | ||
426 | * resources of the created platform device. | ||
427 | */ | ||
428 | struct intel_msic_platform_data { | ||
429 | int irq[INTEL_MSIC_BLOCK_LAST]; | ||
430 | struct intel_msic_gpio_pdata *gpio; | ||
431 | struct intel_msic_ocd_pdata *ocd; | ||
432 | }; | ||
433 | |||
434 | struct intel_msic; | ||
435 | |||
436 | extern int intel_msic_reg_read(unsigned short reg, u8 *val); | ||
437 | extern int intel_msic_reg_write(unsigned short reg, u8 val); | ||
438 | extern int intel_msic_reg_update(unsigned short reg, u8 val, u8 mask); | ||
439 | extern int intel_msic_bulk_read(unsigned short *reg, u8 *buf, size_t count); | ||
440 | extern int intel_msic_bulk_write(unsigned short *reg, u8 *buf, size_t count); | ||
441 | |||
442 | /* | ||
443 | * pdev_to_intel_msic - gets an MSIC instance from the platform device | ||
444 | * @pdev: platform device pointer | ||
445 | * | ||
446 | * The client drivers need to have pointer to the MSIC instance if they | ||
447 | * want to call intel_msic_irq_read(). This macro can be used for | ||
448 | * convenience to get the MSIC pointer from @pdev where needed. This is | ||
449 | * _only_ valid for devices which are managed by the MSIC. | ||
450 | */ | ||
451 | #define pdev_to_intel_msic(pdev) (dev_get_drvdata(pdev->dev.parent)) | ||
452 | |||
453 | extern int intel_msic_irq_read(struct intel_msic *msic, unsigned short reg, | ||
454 | u8 *val); | ||
455 | |||
456 | #endif /* __LINUX_MFD_INTEL_MSIC_H__ */ | ||
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index 5ff2400ad46c..3f4deb62d6b0 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
@@ -326,7 +326,6 @@ struct max8997_dev { | |||
326 | int irq; | 326 | int irq; |
327 | int ono; | 327 | int ono; |
328 | int irq_base; | 328 | int irq_base; |
329 | bool wakeup; | ||
330 | struct mutex irqlock; | 329 | struct mutex irqlock; |
331 | int irq_masks_cur[MAX8997_IRQ_GROUP_NR]; | 330 | int irq_masks_cur[MAX8997_IRQ_GROUP_NR]; |
332 | int irq_masks_cache[MAX8997_IRQ_GROUP_NR]; | 331 | int irq_masks_cache[MAX8997_IRQ_GROUP_NR]; |
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index 7d0f3d6a0002..a8eeda773a7b 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
@@ -12,117 +12,6 @@ | |||
12 | 12 | ||
13 | #include <linux/mfd/mc13xxx.h> | 13 | #include <linux/mfd/mc13xxx.h> |
14 | 14 | ||
15 | struct mc13783; | ||
16 | |||
17 | struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783); | ||
18 | |||
19 | static inline void mc13783_lock(struct mc13783 *mc13783) | ||
20 | { | ||
21 | mc13xxx_lock(mc13783_to_mc13xxx(mc13783)); | ||
22 | } | ||
23 | |||
24 | static inline void mc13783_unlock(struct mc13783 *mc13783) | ||
25 | { | ||
26 | mc13xxx_unlock(mc13783_to_mc13xxx(mc13783)); | ||
27 | } | ||
28 | |||
29 | static inline int mc13783_reg_read(struct mc13783 *mc13783, | ||
30 | unsigned int offset, u32 *val) | ||
31 | { | ||
32 | return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val); | ||
33 | } | ||
34 | |||
35 | static inline int mc13783_reg_write(struct mc13783 *mc13783, | ||
36 | unsigned int offset, u32 val) | ||
37 | { | ||
38 | return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val); | ||
39 | } | ||
40 | |||
41 | static inline int mc13783_reg_rmw(struct mc13783 *mc13783, | ||
42 | unsigned int offset, u32 mask, u32 val) | ||
43 | { | ||
44 | return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val); | ||
45 | } | ||
46 | |||
47 | static inline int mc13783_get_flags(struct mc13783 *mc13783) | ||
48 | { | ||
49 | return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783)); | ||
50 | } | ||
51 | |||
52 | static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq, | ||
53 | irq_handler_t handler, const char *name, void *dev) | ||
54 | { | ||
55 | return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq, | ||
56 | handler, name, dev); | ||
57 | } | ||
58 | |||
59 | static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, | ||
60 | irq_handler_t handler, const char *name, void *dev) | ||
61 | { | ||
62 | return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq, | ||
63 | handler, name, dev); | ||
64 | } | ||
65 | |||
66 | static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev) | ||
67 | { | ||
68 | return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev); | ||
69 | } | ||
70 | |||
71 | static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq) | ||
72 | { | ||
73 | return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq); | ||
74 | } | ||
75 | |||
76 | static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq) | ||
77 | { | ||
78 | return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq); | ||
79 | } | ||
80 | static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq, | ||
81 | int *enabled, int *pending) | ||
82 | { | ||
83 | return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783), | ||
84 | irq, enabled, pending); | ||
85 | } | ||
86 | |||
87 | static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq) | ||
88 | { | ||
89 | return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq); | ||
90 | } | ||
91 | |||
92 | #define MC13783_ADC0 43 | ||
93 | #define MC13783_ADC0_ADREFEN (1 << 10) | ||
94 | #define MC13783_ADC0_ADREFMODE (1 << 11) | ||
95 | #define MC13783_ADC0_TSMOD0 (1 << 12) | ||
96 | #define MC13783_ADC0_TSMOD1 (1 << 13) | ||
97 | #define MC13783_ADC0_TSMOD2 (1 << 14) | ||
98 | #define MC13783_ADC0_ADINC1 (1 << 16) | ||
99 | #define MC13783_ADC0_ADINC2 (1 << 17) | ||
100 | |||
101 | #define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \ | ||
102 | MC13783_ADC0_TSMOD1 | \ | ||
103 | MC13783_ADC0_TSMOD2) | ||
104 | |||
105 | #define mc13783_regulator_init_data mc13xxx_regulator_init_data | ||
106 | #define mc13783_regulator_platform_data mc13xxx_regulator_platform_data | ||
107 | #define mc13783_led_platform_data mc13xxx_led_platform_data | ||
108 | #define mc13783_leds_platform_data mc13xxx_leds_platform_data | ||
109 | |||
110 | #define mc13783_platform_data mc13xxx_platform_data | ||
111 | #define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN | ||
112 | #define MC13783_USE_CODEC MC13XXX_USE_CODEC | ||
113 | #define MC13783_USE_ADC MC13XXX_USE_ADC | ||
114 | #define MC13783_USE_RTC MC13XXX_USE_RTC | ||
115 | #define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR | ||
116 | #define MC13783_USE_LED MC13XXX_USE_LED | ||
117 | |||
118 | #define MC13783_ADC_MODE_TS 1 | ||
119 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | ||
120 | #define MC13783_ADC_MODE_MULT_CHAN 3 | ||
121 | |||
122 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | ||
123 | unsigned int channel, unsigned int *sample); | ||
124 | |||
125 | |||
126 | #define MC13783_REG_SW1A 0 | 15 | #define MC13783_REG_SW1A 0 |
127 | #define MC13783_REG_SW1B 1 | 16 | #define MC13783_REG_SW1B 1 |
128 | #define MC13783_REG_SW2A 2 | 17 | #define MC13783_REG_SW2A 2 |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index c064beaaccb7..3816c2fac0ad 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
@@ -37,6 +37,9 @@ int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq); | |||
37 | 37 | ||
38 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); | 38 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); |
39 | 39 | ||
40 | int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, | ||
41 | unsigned int mode, unsigned int channel, unsigned int *sample); | ||
42 | |||
40 | #define MC13XXX_IRQ_ADCDONE 0 | 43 | #define MC13XXX_IRQ_ADCDONE 0 |
41 | #define MC13XXX_IRQ_ADCBISDONE 1 | 44 | #define MC13XXX_IRQ_ADCBISDONE 1 |
42 | #define MC13XXX_IRQ_TS 2 | 45 | #define MC13XXX_IRQ_TS 2 |
@@ -137,17 +140,48 @@ struct mc13xxx_leds_platform_data { | |||
137 | char tc3_period; | 140 | char tc3_period; |
138 | }; | 141 | }; |
139 | 142 | ||
143 | struct mc13xxx_buttons_platform_data { | ||
144 | #define MC13783_BUTTON_DBNC_0MS 0 | ||
145 | #define MC13783_BUTTON_DBNC_30MS 1 | ||
146 | #define MC13783_BUTTON_DBNC_150MS 2 | ||
147 | #define MC13783_BUTTON_DBNC_750MS 3 | ||
148 | #define MC13783_BUTTON_ENABLE (1 << 2) | ||
149 | #define MC13783_BUTTON_POL_INVERT (1 << 3) | ||
150 | #define MC13783_BUTTON_RESET_EN (1 << 4) | ||
151 | int b1on_flags; | ||
152 | unsigned short b1on_key; | ||
153 | int b2on_flags; | ||
154 | unsigned short b2on_key; | ||
155 | int b3on_flags; | ||
156 | unsigned short b3on_key; | ||
157 | }; | ||
158 | |||
140 | struct mc13xxx_platform_data { | 159 | struct mc13xxx_platform_data { |
141 | #define MC13XXX_USE_TOUCHSCREEN (1 << 0) | 160 | #define MC13XXX_USE_TOUCHSCREEN (1 << 0) |
142 | #define MC13XXX_USE_CODEC (1 << 1) | 161 | #define MC13XXX_USE_CODEC (1 << 1) |
143 | #define MC13XXX_USE_ADC (1 << 2) | 162 | #define MC13XXX_USE_ADC (1 << 2) |
144 | #define MC13XXX_USE_RTC (1 << 3) | 163 | #define MC13XXX_USE_RTC (1 << 3) |
145 | #define MC13XXX_USE_REGULATOR (1 << 4) | ||
146 | #define MC13XXX_USE_LED (1 << 5) | ||
147 | unsigned int flags; | 164 | unsigned int flags; |
148 | 165 | ||
149 | struct mc13xxx_regulator_platform_data regulators; | 166 | struct mc13xxx_regulator_platform_data regulators; |
150 | struct mc13xxx_leds_platform_data *leds; | 167 | struct mc13xxx_leds_platform_data *leds; |
168 | struct mc13xxx_buttons_platform_data *buttons; | ||
151 | }; | 169 | }; |
152 | 170 | ||
171 | #define MC13XXX_ADC_MODE_TS 1 | ||
172 | #define MC13XXX_ADC_MODE_SINGLE_CHAN 2 | ||
173 | #define MC13XXX_ADC_MODE_MULT_CHAN 3 | ||
174 | |||
175 | #define MC13XXX_ADC0 43 | ||
176 | #define MC13XXX_ADC0_ADREFEN (1 << 10) | ||
177 | #define MC13XXX_ADC0_TSMOD0 (1 << 12) | ||
178 | #define MC13XXX_ADC0_TSMOD1 (1 << 13) | ||
179 | #define MC13XXX_ADC0_TSMOD2 (1 << 14) | ||
180 | #define MC13XXX_ADC0_ADINC1 (1 << 16) | ||
181 | #define MC13XXX_ADC0_ADINC2 (1 << 17) | ||
182 | |||
183 | #define MC13XXX_ADC0_TSMOD_MASK (MC13XXX_ADC0_TSMOD0 | \ | ||
184 | MC13XXX_ADC0_TSMOD1 | \ | ||
185 | MC13XXX_ADC0_TSMOD2) | ||
186 | |||
153 | #endif /* ifndef __LINUX_MFD_MC13XXX_H */ | 187 | #endif /* ifndef __LINUX_MFD_MC13XXX_H */ |
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 50d4a047118d..a80840752b4c 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mfd/pcf50633/backlight.h> | 21 | #include <linux/mfd/pcf50633/backlight.h> |
22 | 22 | ||
23 | struct pcf50633; | 23 | struct pcf50633; |
24 | struct regmap; | ||
24 | 25 | ||
25 | #define PCF50633_NUM_REGULATORS 11 | 26 | #define PCF50633_NUM_REGULATORS 11 |
26 | 27 | ||
@@ -134,7 +135,7 @@ enum { | |||
134 | 135 | ||
135 | struct pcf50633 { | 136 | struct pcf50633 { |
136 | struct device *dev; | 137 | struct device *dev; |
137 | struct i2c_client *i2c_client; | 138 | struct regmap *regmap; |
138 | 139 | ||
139 | struct pcf50633_platform_data *pdata; | 140 | struct pcf50633_platform_data *pdata; |
140 | int irq; | 141 | int irq; |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index b6bab1b04e25..b19176eab44d 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
@@ -1,6 +1,18 @@ | |||
1 | #ifndef __LINUX_MFD_TPS6586X_H | 1 | #ifndef __LINUX_MFD_TPS6586X_H |
2 | #define __LINUX_MFD_TPS6586X_H | 2 | #define __LINUX_MFD_TPS6586X_H |
3 | 3 | ||
4 | #define TPS6586X_SLEW_RATE_INSTANTLY 0x00 | ||
5 | #define TPS6586X_SLEW_RATE_110UV 0x01 | ||
6 | #define TPS6586X_SLEW_RATE_220UV 0x02 | ||
7 | #define TPS6586X_SLEW_RATE_440UV 0x03 | ||
8 | #define TPS6586X_SLEW_RATE_880UV 0x04 | ||
9 | #define TPS6586X_SLEW_RATE_1760UV 0x05 | ||
10 | #define TPS6586X_SLEW_RATE_3520UV 0x06 | ||
11 | #define TPS6586X_SLEW_RATE_7040UV 0x07 | ||
12 | |||
13 | #define TPS6586X_SLEW_RATE_SET 0x08 | ||
14 | #define TPS6586X_SLEW_RATE_MASK 0x07 | ||
15 | |||
4 | enum { | 16 | enum { |
5 | TPS6586X_ID_SM_0, | 17 | TPS6586X_ID_SM_0, |
6 | TPS6586X_ID_SM_1, | 18 | TPS6586X_ID_SM_1, |
@@ -48,6 +60,10 @@ enum { | |||
48 | TPS6586X_INT_RTC_ALM2, | 60 | TPS6586X_INT_RTC_ALM2, |
49 | }; | 61 | }; |
50 | 62 | ||
63 | struct tps6586x_settings { | ||
64 | int slew_rate; | ||
65 | }; | ||
66 | |||
51 | struct tps6586x_subdev_info { | 67 | struct tps6586x_subdev_info { |
52 | int id; | 68 | int id; |
53 | const char *name; | 69 | const char *name; |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index 4c806f6d663e..2463c2619596 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
@@ -68,11 +68,6 @@ | |||
68 | #define TWL6040_REG_ACCCTL 0x2D | 68 | #define TWL6040_REG_ACCCTL 0x2D |
69 | #define TWL6040_REG_STATUS 0x2E | 69 | #define TWL6040_REG_STATUS 0x2E |
70 | 70 | ||
71 | #define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1) | ||
72 | |||
73 | #define TWL6040_VIOREGNUM 18 | ||
74 | #define TWL6040_VDDREGNUM 21 | ||
75 | |||
76 | /* INTID (0x03) fields */ | 71 | /* INTID (0x03) fields */ |
77 | 72 | ||
78 | #define TWL6040_THINT 0x01 | 73 | #define TWL6040_THINT 0x01 |
@@ -125,34 +120,24 @@ | |||
125 | #define TWL6040_LPLLFIN 0x08 | 120 | #define TWL6040_LPLLFIN 0x08 |
126 | #define TWL6040_HPLLSEL 0x10 | 121 | #define TWL6040_HPLLSEL 0x10 |
127 | 122 | ||
128 | /* HSLCTL (0x10) fields */ | 123 | /* HSLCTL/R (0x10/0x11) fields */ |
129 | |||
130 | #define TWL6040_HSDACMODEL 0x02 | ||
131 | #define TWL6040_HSDRVMODEL 0x08 | ||
132 | |||
133 | /* HSRCTL (0x11) fields */ | ||
134 | 124 | ||
135 | #define TWL6040_HSDACMODER 0x02 | 125 | #define TWL6040_HSDACENA (1 << 0) |
136 | #define TWL6040_HSDRVMODER 0x08 | 126 | #define TWL6040_HSDACMODE (1 << 1) |
127 | #define TWL6040_HSDRVMODE (1 << 3) | ||
137 | 128 | ||
138 | /* VIBCTLL (0x18) fields */ | 129 | /* VIBCTLL/R (0x18/0x1A) fields */ |
139 | 130 | ||
140 | #define TWL6040_VIBENAL 0x01 | 131 | #define TWL6040_VIBENA (1 << 0) |
141 | #define TWL6040_VIBCTRLL 0x04 | 132 | #define TWL6040_VIBSEL (1 << 1) |
142 | #define TWL6040_VIBCTRLLP 0x08 | 133 | #define TWL6040_VIBCTRL (1 << 2) |
143 | #define TWL6040_VIBCTRLLN 0x10 | 134 | #define TWL6040_VIBCTRL_P (1 << 3) |
135 | #define TWL6040_VIBCTRL_N (1 << 4) | ||
144 | 136 | ||
145 | /* VIBDATL (0x19) fields */ | 137 | /* VIBDATL/R (0x19/0x1B) fields */ |
146 | 138 | ||
147 | #define TWL6040_VIBDAT_MAX 0x64 | 139 | #define TWL6040_VIBDAT_MAX 0x64 |
148 | 140 | ||
149 | /* VIBCTLR (0x1A) fields */ | ||
150 | |||
151 | #define TWL6040_VIBENAR 0x01 | ||
152 | #define TWL6040_VIBCTRLR 0x04 | ||
153 | #define TWL6040_VIBCTRLRP 0x08 | ||
154 | #define TWL6040_VIBCTRLRN 0x10 | ||
155 | |||
156 | /* GPOCTL (0x1E) fields */ | 141 | /* GPOCTL (0x1E) fields */ |
157 | 142 | ||
158 | #define TWL6040_GPO1 0x01 | 143 | #define TWL6040_GPO1 0x01 |
@@ -200,6 +185,7 @@ struct twl6040 { | |||
200 | int audpwron; | 185 | int audpwron; |
201 | int power_count; | 186 | int power_count; |
202 | int rev; | 187 | int rev; |
188 | u8 vibra_ctrl_cache[2]; | ||
203 | 189 | ||
204 | int pll; | 190 | int pll; |
205 | unsigned int sysclk; | 191 | unsigned int sysclk; |
@@ -224,5 +210,13 @@ int twl6040_get_pll(struct twl6040 *twl6040); | |||
224 | unsigned int twl6040_get_sysclk(struct twl6040 *twl6040); | 210 | unsigned int twl6040_get_sysclk(struct twl6040 *twl6040); |
225 | int twl6040_irq_init(struct twl6040 *twl6040); | 211 | int twl6040_irq_init(struct twl6040 *twl6040); |
226 | void twl6040_irq_exit(struct twl6040 *twl6040); | 212 | void twl6040_irq_exit(struct twl6040 *twl6040); |
213 | /* Get the combined status of the vibra control register */ | ||
214 | int twl6040_get_vibralr_status(struct twl6040 *twl6040); | ||
215 | |||
216 | static inline int twl6040_get_revid(struct twl6040 *twl6040) | ||
217 | { | ||
218 | return twl6040->rev; | ||
219 | } | ||
220 | |||
227 | 221 | ||
228 | #endif /* End of __TWL6040_CODEC_H__ */ | 222 | #endif /* End of __TWL6040_CODEC_H__ */ |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index ed8fe0d04097..4b1211859f74 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -382,6 +382,7 @@ struct wm831x { | |||
382 | 382 | ||
383 | /* Used by the interrupt controller code to post writes */ | 383 | /* Used by the interrupt controller code to post writes */ |
384 | int gpio_update[WM831X_NUM_GPIO_REGS]; | 384 | int gpio_update[WM831X_NUM_GPIO_REGS]; |
385 | bool gpio_level[WM831X_NUM_GPIO_REGS]; | ||
385 | 386 | ||
386 | struct mutex auxadc_lock; | 387 | struct mutex auxadc_lock; |
387 | struct list_head auxadc_pending; | 388 | struct list_head auxadc_pending; |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index 45df450d869f..f44bdb7273bd 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -20,6 +20,7 @@ | |||
20 | enum wm8994_type { | 20 | enum wm8994_type { |
21 | WM8994 = 0, | 21 | WM8994 = 0, |
22 | WM8958 = 1, | 22 | WM8958 = 1, |
23 | WM1811 = 2, | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | struct regulator_dev; | 26 | struct regulator_dev; |
@@ -58,6 +59,8 @@ struct wm8994 { | |||
58 | struct device *dev; | 59 | struct device *dev; |
59 | struct regmap *regmap; | 60 | struct regmap *regmap; |
60 | 61 | ||
62 | bool ldo_ena_always_driven; | ||
63 | |||
61 | int gpio_base; | 64 | int gpio_base; |
62 | int irq_base; | 65 | int irq_base; |
63 | 66 | ||
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 97cf4f27d647..ea32f306dca6 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -167,6 +167,13 @@ struct wm8994_pdata { | |||
167 | 167 | ||
168 | /* WM8958 microphone bias configuration */ | 168 | /* WM8958 microphone bias configuration */ |
169 | int micbias[2]; | 169 | int micbias[2]; |
170 | |||
171 | /* Disable the internal pull downs on the LDOs if they are | ||
172 | * always driven (eg, connected to an always on supply or | ||
173 | * GPIO that always drives an output. If they float power | ||
174 | * consumption will rise. | ||
175 | */ | ||
176 | bool ldo_ena_always_driven; | ||
170 | }; | 177 | }; |
171 | 178 | ||
172 | #endif | 179 | #endif |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index f3ee84284670..fae295048a8b 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -72,6 +72,7 @@ | |||
72 | #define WM8994_DC_SERVO_2 0x55 | 72 | #define WM8994_DC_SERVO_2 0x55 |
73 | #define WM8994_DC_SERVO_4 0x57 | 73 | #define WM8994_DC_SERVO_4 0x57 |
74 | #define WM8994_DC_SERVO_READBACK 0x58 | 74 | #define WM8994_DC_SERVO_READBACK 0x58 |
75 | #define WM8994_DC_SERVO_4E 0x59 | ||
75 | #define WM8994_ANALOGUE_HP_1 0x60 | 76 | #define WM8994_ANALOGUE_HP_1 0x60 |
76 | #define WM8958_MIC_DETECT_1 0xD0 | 77 | #define WM8958_MIC_DETECT_1 0xD0 |
77 | #define WM8958_MIC_DETECT_2 0xD1 | 78 | #define WM8958_MIC_DETECT_2 0xD1 |
@@ -133,6 +134,8 @@ | |||
133 | #define WM8994_AIF1_DAC1_FILTERS_2 0x421 | 134 | #define WM8994_AIF1_DAC1_FILTERS_2 0x421 |
134 | #define WM8994_AIF1_DAC2_FILTERS_1 0x422 | 135 | #define WM8994_AIF1_DAC2_FILTERS_1 0x422 |
135 | #define WM8994_AIF1_DAC2_FILTERS_2 0x423 | 136 | #define WM8994_AIF1_DAC2_FILTERS_2 0x423 |
137 | #define WM8958_AIF1_DAC1_NOISE_GATE 0x430 | ||
138 | #define WM8958_AIF1_DAC2_NOISE_GATE 0x431 | ||
136 | #define WM8994_AIF1_DRC1_1 0x440 | 139 | #define WM8994_AIF1_DRC1_1 0x440 |
137 | #define WM8994_AIF1_DRC1_2 0x441 | 140 | #define WM8994_AIF1_DRC1_2 0x441 |
138 | #define WM8994_AIF1_DRC1_3 0x442 | 141 | #define WM8994_AIF1_DRC1_3 0x442 |
@@ -190,6 +193,7 @@ | |||
190 | #define WM8994_AIF2_ADC_FILTERS 0x510 | 193 | #define WM8994_AIF2_ADC_FILTERS 0x510 |
191 | #define WM8994_AIF2_DAC_FILTERS_1 0x520 | 194 | #define WM8994_AIF2_DAC_FILTERS_1 0x520 |
192 | #define WM8994_AIF2_DAC_FILTERS_2 0x521 | 195 | #define WM8994_AIF2_DAC_FILTERS_2 0x521 |
196 | #define WM8958_AIF2_DAC_NOISE_GATE 0x530 | ||
193 | #define WM8994_AIF2_DRC_1 0x540 | 197 | #define WM8994_AIF2_DRC_1 0x540 |
194 | #define WM8994_AIF2_DRC_2 0x541 | 198 | #define WM8994_AIF2_DRC_2 0x541 |
195 | #define WM8994_AIF2_DRC_3 0x542 | 199 | #define WM8994_AIF2_DRC_3 0x542 |
@@ -1921,6 +1925,44 @@ | |||
1921 | #define WM8994_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */ | 1925 | #define WM8994_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */ |
1922 | 1926 | ||
1923 | /* | 1927 | /* |
1928 | * R61 (0x3D) - MICBIAS1 | ||
1929 | */ | ||
1930 | #define WM8958_MICB1_RATE 0x0020 /* MICB1_RATE */ | ||
1931 | #define WM8958_MICB1_RATE_MASK 0x0020 /* MICB1_RATE */ | ||
1932 | #define WM8958_MICB1_RATE_SHIFT 5 /* MICB1_RATE */ | ||
1933 | #define WM8958_MICB1_RATE_WIDTH 1 /* MICB1_RATE */ | ||
1934 | #define WM8958_MICB1_MODE 0x0010 /* MICB1_MODE */ | ||
1935 | #define WM8958_MICB1_MODE_MASK 0x0010 /* MICB1_MODE */ | ||
1936 | #define WM8958_MICB1_MODE_SHIFT 4 /* MICB1_MODE */ | ||
1937 | #define WM8958_MICB1_MODE_WIDTH 1 /* MICB1_MODE */ | ||
1938 | #define WM8958_MICB1_LVL_MASK 0x000E /* MICB1_LVL - [3:1] */ | ||
1939 | #define WM8958_MICB1_LVL_SHIFT 1 /* MICB1_LVL - [3:1] */ | ||
1940 | #define WM8958_MICB1_LVL_WIDTH 3 /* MICB1_LVL - [3:1] */ | ||
1941 | #define WM8958_MICB1_DISCH 0x0001 /* MICB1_DISCH */ | ||
1942 | #define WM8958_MICB1_DISCH_MASK 0x0001 /* MICB1_DISCH */ | ||
1943 | #define WM8958_MICB1_DISCH_SHIFT 0 /* MICB1_DISCH */ | ||
1944 | #define WM8958_MICB1_DISCH_WIDTH 1 /* MICB1_DISCH */ | ||
1945 | |||
1946 | /* | ||
1947 | * R62 (0x3E) - MICBIAS2 | ||
1948 | */ | ||
1949 | #define WM8958_MICB2_RATE 0x0020 /* MICB2_RATE */ | ||
1950 | #define WM8958_MICB2_RATE_MASK 0x0020 /* MICB2_RATE */ | ||
1951 | #define WM8958_MICB2_RATE_SHIFT 5 /* MICB2_RATE */ | ||
1952 | #define WM8958_MICB2_RATE_WIDTH 1 /* MICB2_RATE */ | ||
1953 | #define WM8958_MICB2_MODE 0x0010 /* MICB2_MODE */ | ||
1954 | #define WM8958_MICB2_MODE_MASK 0x0010 /* MICB2_MODE */ | ||
1955 | #define WM8958_MICB2_MODE_SHIFT 4 /* MICB2_MODE */ | ||
1956 | #define WM8958_MICB2_MODE_WIDTH 1 /* MICB2_MODE */ | ||
1957 | #define WM8958_MICB2_LVL_MASK 0x000E /* MICB2_LVL - [3:1] */ | ||
1958 | #define WM8958_MICB2_LVL_SHIFT 1 /* MICB2_LVL - [3:1] */ | ||
1959 | #define WM8958_MICB2_LVL_WIDTH 3 /* MICB2_LVL - [3:1] */ | ||
1960 | #define WM8958_MICB2_DISCH 0x0001 /* MICB2_DISCH */ | ||
1961 | #define WM8958_MICB2_DISCH_MASK 0x0001 /* MICB2_DISCH */ | ||
1962 | #define WM8958_MICB2_DISCH_SHIFT 0 /* MICB2_DISCH */ | ||
1963 | #define WM8958_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */ | ||
1964 | |||
1965 | /* | ||
1924 | * R76 (0x4C) - Charge Pump (1) | 1966 | * R76 (0x4C) - Charge Pump (1) |
1925 | */ | 1967 | */ |
1926 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ | 1968 | #define WM8994_CP_ENA 0x8000 /* CP_ENA */ |
@@ -2027,6 +2069,10 @@ | |||
2027 | /* | 2069 | /* |
2028 | * R96 (0x60) - Analogue HP (1) | 2070 | * R96 (0x60) - Analogue HP (1) |
2029 | */ | 2071 | */ |
2072 | #define WM1811_HPOUT1_ATTN 0x0100 /* HPOUT1_ATTN */ | ||
2073 | #define WM1811_HPOUT1_ATTN_MASK 0x0100 /* HPOUT1_ATTN */ | ||
2074 | #define WM1811_HPOUT1_ATTN_SHIFT 8 /* HPOUT1_ATTN */ | ||
2075 | #define WM1811_HPOUT1_ATTN_WIDTH 1 /* HPOUT1_ATTN */ | ||
2030 | #define WM8994_HPOUT1L_RMV_SHORT 0x0080 /* HPOUT1L_RMV_SHORT */ | 2076 | #define WM8994_HPOUT1L_RMV_SHORT 0x0080 /* HPOUT1L_RMV_SHORT */ |
2031 | #define WM8994_HPOUT1L_RMV_SHORT_MASK 0x0080 /* HPOUT1L_RMV_SHORT */ | 2077 | #define WM8994_HPOUT1L_RMV_SHORT_MASK 0x0080 /* HPOUT1L_RMV_SHORT */ |
2032 | #define WM8994_HPOUT1L_RMV_SHORT_SHIFT 7 /* HPOUT1L_RMV_SHORT */ | 2078 | #define WM8994_HPOUT1L_RMV_SHORT_SHIFT 7 /* HPOUT1L_RMV_SHORT */ |
@@ -2949,6 +2995,34 @@ | |||
2949 | #define WM8994_AIF1DAC2_3D_ENA_WIDTH 1 /* AIF1DAC2_3D_ENA */ | 2995 | #define WM8994_AIF1DAC2_3D_ENA_WIDTH 1 /* AIF1DAC2_3D_ENA */ |
2950 | 2996 | ||
2951 | /* | 2997 | /* |
2998 | * R1072 (0x430) - AIF1 DAC1 Noise Gate | ||
2999 | */ | ||
3000 | #define WM8958_AIF1DAC1_NG_HLD_MASK 0x0060 /* AIF1DAC1_NG_HLD - [6:5] */ | ||
3001 | #define WM8958_AIF1DAC1_NG_HLD_SHIFT 5 /* AIF1DAC1_NG_HLD - [6:5] */ | ||
3002 | #define WM8958_AIF1DAC1_NG_HLD_WIDTH 2 /* AIF1DAC1_NG_HLD - [6:5] */ | ||
3003 | #define WM8958_AIF1DAC1_NG_THR_MASK 0x000E /* AIF1DAC1_NG_THR - [3:1] */ | ||
3004 | #define WM8958_AIF1DAC1_NG_THR_SHIFT 1 /* AIF1DAC1_NG_THR - [3:1] */ | ||
3005 | #define WM8958_AIF1DAC1_NG_THR_WIDTH 3 /* AIF1DAC1_NG_THR - [3:1] */ | ||
3006 | #define WM8958_AIF1DAC1_NG_ENA 0x0001 /* AIF1DAC1_NG_ENA */ | ||
3007 | #define WM8958_AIF1DAC1_NG_ENA_MASK 0x0001 /* AIF1DAC1_NG_ENA */ | ||
3008 | #define WM8958_AIF1DAC1_NG_ENA_SHIFT 0 /* AIF1DAC1_NG_ENA */ | ||
3009 | #define WM8958_AIF1DAC1_NG_ENA_WIDTH 1 /* AIF1DAC1_NG_ENA */ | ||
3010 | |||
3011 | /* | ||
3012 | * R1073 (0x431) - AIF1 DAC2 Noise Gate | ||
3013 | */ | ||
3014 | #define WM8958_AIF1DAC2_NG_HLD_MASK 0x0060 /* AIF1DAC2_NG_HLD - [6:5] */ | ||
3015 | #define WM8958_AIF1DAC2_NG_HLD_SHIFT 5 /* AIF1DAC2_NG_HLD - [6:5] */ | ||
3016 | #define WM8958_AIF1DAC2_NG_HLD_WIDTH 2 /* AIF1DAC2_NG_HLD - [6:5] */ | ||
3017 | #define WM8958_AIF1DAC2_NG_THR_MASK 0x000E /* AIF1DAC2_NG_THR - [3:1] */ | ||
3018 | #define WM8958_AIF1DAC2_NG_THR_SHIFT 1 /* AIF1DAC2_NG_THR - [3:1] */ | ||
3019 | #define WM8958_AIF1DAC2_NG_THR_WIDTH 3 /* AIF1DAC2_NG_THR - [3:1] */ | ||
3020 | #define WM8958_AIF1DAC2_NG_ENA 0x0001 /* AIF1DAC2_NG_ENA */ | ||
3021 | #define WM8958_AIF1DAC2_NG_ENA_MASK 0x0001 /* AIF1DAC2_NG_ENA */ | ||
3022 | #define WM8958_AIF1DAC2_NG_ENA_SHIFT 0 /* AIF1DAC2_NG_ENA */ | ||
3023 | #define WM8958_AIF1DAC2_NG_ENA_WIDTH 1 /* AIF1DAC2_NG_ENA */ | ||
3024 | |||
3025 | /* | ||
2952 | * R1088 (0x440) - AIF1 DRC1 (1) | 3026 | * R1088 (0x440) - AIF1 DRC1 (1) |
2953 | */ | 3027 | */ |
2954 | #define WM8994_AIF1DRC1_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ | 3028 | #define WM8994_AIF1DRC1_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC1_SIG_DET_RMS - [15:11] */ |
@@ -3560,6 +3634,20 @@ | |||
3560 | #define WM8994_AIF2DAC_3D_ENA_WIDTH 1 /* AIF2DAC_3D_ENA */ | 3634 | #define WM8994_AIF2DAC_3D_ENA_WIDTH 1 /* AIF2DAC_3D_ENA */ |
3561 | 3635 | ||
3562 | /* | 3636 | /* |
3637 | * R1328 (0x530) - AIF2 DAC Noise Gate | ||
3638 | */ | ||
3639 | #define WM8958_AIF2DAC_NG_HLD_MASK 0x0060 /* AIF2DAC_NG_HLD - [6:5] */ | ||
3640 | #define WM8958_AIF2DAC_NG_HLD_SHIFT 5 /* AIF2DAC_NG_HLD - [6:5] */ | ||
3641 | #define WM8958_AIF2DAC_NG_HLD_WIDTH 2 /* AIF2DAC_NG_HLD - [6:5] */ | ||
3642 | #define WM8958_AIF2DAC_NG_THR_MASK 0x000E /* AIF2DAC_NG_THR - [3:1] */ | ||
3643 | #define WM8958_AIF2DAC_NG_THR_SHIFT 1 /* AIF2DAC_NG_THR - [3:1] */ | ||
3644 | #define WM8958_AIF2DAC_NG_THR_WIDTH 3 /* AIF2DAC_NG_THR - [3:1] */ | ||
3645 | #define WM8958_AIF2DAC_NG_ENA 0x0001 /* AIF2DAC_NG_ENA */ | ||
3646 | #define WM8958_AIF2DAC_NG_ENA_MASK 0x0001 /* AIF2DAC_NG_ENA */ | ||
3647 | #define WM8958_AIF2DAC_NG_ENA_SHIFT 0 /* AIF2DAC_NG_ENA */ | ||
3648 | #define WM8958_AIF2DAC_NG_ENA_WIDTH 1 /* AIF2DAC_NG_ENA */ | ||
3649 | |||
3650 | /* | ||
3563 | * R1344 (0x540) - AIF2 DRC (1) | 3651 | * R1344 (0x540) - AIF2 DRC (1) |
3564 | */ | 3652 | */ |
3565 | #define WM8994_AIF2DRC_SIG_DET_RMS_MASK 0xF800 /* AIF2DRC_SIG_DET_RMS - [15:11] */ | 3653 | #define WM8994_AIF2DRC_SIG_DET_RMS_MASK 0xF800 /* AIF2DRC_SIG_DET_RMS - [15:11] */ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 2366f94a095a..84b0b1848f17 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -61,6 +61,7 @@ enum { | |||
61 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, | 61 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, |
62 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, | 62 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, |
63 | MLX4_DEV_CAP_FLAG_UD = 1LL << 2, | 63 | MLX4_DEV_CAP_FLAG_UD = 1LL << 2, |
64 | MLX4_DEV_CAP_FLAG_XRC = 1LL << 3, | ||
64 | MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6, | 65 | MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6, |
65 | MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7, | 66 | MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7, |
66 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, | 67 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, |
@@ -83,6 +84,12 @@ enum { | |||
83 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48 | 84 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48 |
84 | }; | 85 | }; |
85 | 86 | ||
87 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) | ||
88 | |||
89 | enum { | ||
90 | MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0 | ||
91 | }; | ||
92 | |||
86 | enum { | 93 | enum { |
87 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, | 94 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, |
88 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, | 95 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, |
@@ -257,6 +264,8 @@ struct mlx4_caps { | |||
257 | int num_qp_per_mgm; | 264 | int num_qp_per_mgm; |
258 | int num_pds; | 265 | int num_pds; |
259 | int reserved_pds; | 266 | int reserved_pds; |
267 | int max_xrcds; | ||
268 | int reserved_xrcds; | ||
260 | int mtt_entry_sz; | 269 | int mtt_entry_sz; |
261 | u32 max_msg_sz; | 270 | u32 max_msg_sz; |
262 | u32 page_size_cap; | 271 | u32 page_size_cap; |
@@ -277,6 +286,7 @@ struct mlx4_caps { | |||
277 | u32 port_mask; | 286 | u32 port_mask; |
278 | enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; | 287 | enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; |
279 | u32 max_counters; | 288 | u32 max_counters; |
289 | u8 ext_port_cap[MLX4_MAX_PORTS + 1]; | ||
280 | }; | 290 | }; |
281 | 291 | ||
282 | struct mlx4_buf_list { | 292 | struct mlx4_buf_list { |
@@ -500,6 +510,8 @@ static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) | |||
500 | 510 | ||
501 | int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); | 511 | int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); |
502 | void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); | 512 | void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); |
513 | int mlx4_xrcd_alloc(struct mlx4_dev *dev, u32 *xrcdn); | ||
514 | void mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn); | ||
503 | 515 | ||
504 | int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); | 516 | int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); |
505 | void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); | 517 | void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); |
@@ -539,8 +551,8 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt); | |||
539 | int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp); | 551 | int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp); |
540 | void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); | 552 | void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); |
541 | 553 | ||
542 | int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, | 554 | int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcdn, |
543 | u64 db_rec, struct mlx4_srq *srq); | 555 | struct mlx4_mtt *mtt, u64 db_rec, struct mlx4_srq *srq); |
544 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); | 556 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); |
545 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); | 557 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); |
546 | int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark); | 558 | int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark); |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 4001c8249dbb..48cc4cb97858 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -75,6 +75,7 @@ enum { | |||
75 | MLX4_QP_ST_UC = 0x1, | 75 | MLX4_QP_ST_UC = 0x1, |
76 | MLX4_QP_ST_RD = 0x2, | 76 | MLX4_QP_ST_RD = 0x2, |
77 | MLX4_QP_ST_UD = 0x3, | 77 | MLX4_QP_ST_UD = 0x3, |
78 | MLX4_QP_ST_XRC = 0x6, | ||
78 | MLX4_QP_ST_MLX = 0x7 | 79 | MLX4_QP_ST_MLX = 0x7 |
79 | }; | 80 | }; |
80 | 81 | ||
@@ -137,7 +138,7 @@ struct mlx4_qp_context { | |||
137 | __be32 ssn; | 138 | __be32 ssn; |
138 | __be32 params2; | 139 | __be32 params2; |
139 | __be32 rnr_nextrecvpsn; | 140 | __be32 rnr_nextrecvpsn; |
140 | __be32 srcd; | 141 | __be32 xrcd; |
141 | __be32 cqn_recv; | 142 | __be32 cqn_recv; |
142 | __be64 db_rec_addr; | 143 | __be64 db_rec_addr; |
143 | __be32 qkey; | 144 | __be32 qkey; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 7438071b44aa..3dc3a8c2c485 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -356,36 +356,50 @@ static inline struct page *compound_head(struct page *page) | |||
356 | return page; | 356 | return page; |
357 | } | 357 | } |
358 | 358 | ||
359 | /* | ||
360 | * The atomic page->_mapcount, starts from -1: so that transitions | ||
361 | * both from it and to it can be tracked, using atomic_inc_and_test | ||
362 | * and atomic_add_negative(-1). | ||
363 | */ | ||
364 | static inline void reset_page_mapcount(struct page *page) | ||
365 | { | ||
366 | atomic_set(&(page)->_mapcount, -1); | ||
367 | } | ||
368 | |||
369 | static inline int page_mapcount(struct page *page) | ||
370 | { | ||
371 | return atomic_read(&(page)->_mapcount) + 1; | ||
372 | } | ||
373 | |||
359 | static inline int page_count(struct page *page) | 374 | static inline int page_count(struct page *page) |
360 | { | 375 | { |
361 | return atomic_read(&compound_head(page)->_count); | 376 | return atomic_read(&compound_head(page)->_count); |
362 | } | 377 | } |
363 | 378 | ||
379 | static inline void get_huge_page_tail(struct page *page) | ||
380 | { | ||
381 | /* | ||
382 | * __split_huge_page_refcount() cannot run | ||
383 | * from under us. | ||
384 | */ | ||
385 | VM_BUG_ON(page_mapcount(page) < 0); | ||
386 | VM_BUG_ON(atomic_read(&page->_count) != 0); | ||
387 | atomic_inc(&page->_mapcount); | ||
388 | } | ||
389 | |||
390 | extern bool __get_page_tail(struct page *page); | ||
391 | |||
364 | static inline void get_page(struct page *page) | 392 | static inline void get_page(struct page *page) |
365 | { | 393 | { |
394 | if (unlikely(PageTail(page))) | ||
395 | if (likely(__get_page_tail(page))) | ||
396 | return; | ||
366 | /* | 397 | /* |
367 | * Getting a normal page or the head of a compound page | 398 | * Getting a normal page or the head of a compound page |
368 | * requires to already have an elevated page->_count. Only if | 399 | * requires to already have an elevated page->_count. |
369 | * we're getting a tail page, the elevated page->_count is | ||
370 | * required only in the head page, so for tail pages the | ||
371 | * bugcheck only verifies that the page->_count isn't | ||
372 | * negative. | ||
373 | */ | 400 | */ |
374 | VM_BUG_ON(atomic_read(&page->_count) < !PageTail(page)); | 401 | VM_BUG_ON(atomic_read(&page->_count) <= 0); |
375 | atomic_inc(&page->_count); | 402 | atomic_inc(&page->_count); |
376 | /* | ||
377 | * Getting a tail page will elevate both the head and tail | ||
378 | * page->_count(s). | ||
379 | */ | ||
380 | if (unlikely(PageTail(page))) { | ||
381 | /* | ||
382 | * This is safe only because | ||
383 | * __split_huge_page_refcount can't run under | ||
384 | * get_page(). | ||
385 | */ | ||
386 | VM_BUG_ON(atomic_read(&page->first_page->_count) <= 0); | ||
387 | atomic_inc(&page->first_page->_count); | ||
388 | } | ||
389 | } | 403 | } |
390 | 404 | ||
391 | static inline struct page *virt_to_head_page(const void *x) | 405 | static inline struct page *virt_to_head_page(const void *x) |
@@ -804,21 +818,6 @@ static inline pgoff_t page_index(struct page *page) | |||
804 | } | 818 | } |
805 | 819 | ||
806 | /* | 820 | /* |
807 | * The atomic page->_mapcount, like _count, starts from -1: | ||
808 | * so that transitions both from it and to it can be tracked, | ||
809 | * using atomic_inc_and_test and atomic_add_negative(-1). | ||
810 | */ | ||
811 | static inline void reset_page_mapcount(struct page *page) | ||
812 | { | ||
813 | atomic_set(&(page)->_mapcount, -1); | ||
814 | } | ||
815 | |||
816 | static inline int page_mapcount(struct page *page) | ||
817 | { | ||
818 | return atomic_read(&(page)->_mapcount) + 1; | ||
819 | } | ||
820 | |||
821 | /* | ||
822 | * Return true if this page is mapped into pagetables. | 821 | * Return true if this page is mapped into pagetables. |
823 | */ | 822 | */ |
824 | static inline int page_mapped(struct page *page) | 823 | static inline int page_mapped(struct page *page) |
@@ -1334,7 +1333,8 @@ extern void si_meminfo(struct sysinfo * val); | |||
1334 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1333 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
1335 | extern int after_bootmem; | 1334 | extern int after_bootmem; |
1336 | 1335 | ||
1337 | extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | 1336 | extern __printf(3, 4) |
1337 | void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | ||
1338 | 1338 | ||
1339 | extern void setup_per_cpu_pageset(void); | 1339 | extern void setup_per_cpu_pageset(void); |
1340 | 1340 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index c93d00a6e95d..5b42f1b34eb7 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -62,10 +62,23 @@ struct page { | |||
62 | struct { | 62 | struct { |
63 | 63 | ||
64 | union { | 64 | union { |
65 | atomic_t _mapcount; /* Count of ptes mapped in mms, | 65 | /* |
66 | * to show when page is mapped | 66 | * Count of ptes mapped in |
67 | * & limit reverse map searches. | 67 | * mms, to show when page is |
68 | */ | 68 | * mapped & limit reverse map |
69 | * searches. | ||
70 | * | ||
71 | * Used also for tail pages | ||
72 | * refcounting instead of | ||
73 | * _count. Tail pages cannot | ||
74 | * be mapped and keeping the | ||
75 | * tail page _count zero at | ||
76 | * all times guarantees | ||
77 | * get_page_unless_zero() will | ||
78 | * never succeed on tail | ||
79 | * pages. | ||
80 | */ | ||
81 | atomic_t _mapcount; | ||
69 | 82 | ||
70 | struct { | 83 | struct { |
71 | unsigned inuse:16; | 84 | unsigned inuse:16; |
@@ -304,8 +317,15 @@ struct mm_struct { | |||
304 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ | 317 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ |
305 | unsigned long hiwater_vm; /* High-water virtual memory usage */ | 318 | unsigned long hiwater_vm; /* High-water virtual memory usage */ |
306 | 319 | ||
307 | unsigned long total_vm, locked_vm, shared_vm, exec_vm; | 320 | unsigned long total_vm; /* Total pages mapped */ |
308 | unsigned long stack_vm, reserved_vm, def_flags, nr_ptes; | 321 | unsigned long locked_vm; /* Pages that have PG_mlocked set */ |
322 | unsigned long pinned_vm; /* Refcount permanently increased */ | ||
323 | unsigned long shared_vm; /* Shared pages (files) */ | ||
324 | unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */ | ||
325 | unsigned long stack_vm; /* VM_GROWSUP/DOWN */ | ||
326 | unsigned long reserved_vm; /* VM_RESERVED|VM_IO pages */ | ||
327 | unsigned long def_flags; | ||
328 | unsigned long nr_ptes; /* Page table pages */ | ||
309 | unsigned long start_code, end_code, start_data, end_data; | 329 | unsigned long start_code, end_code, start_data, end_data; |
310 | unsigned long start_brk, brk, start_stack; | 330 | unsigned long start_brk, brk, start_stack; |
311 | unsigned long arg_start, arg_end, env_start, env_end; | 331 | unsigned long arg_start, arg_end, env_start, env_end; |
@@ -336,9 +356,6 @@ struct mm_struct { | |||
336 | unsigned int token_priority; | 356 | unsigned int token_priority; |
337 | unsigned int last_interval; | 357 | unsigned int last_interval; |
338 | 358 | ||
339 | /* How many tasks sharing this mm are OOM_DISABLE */ | ||
340 | atomic_t oom_disable_count; | ||
341 | |||
342 | unsigned long flags; /* Must use atomic bitops to access the bits */ | 359 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
343 | 360 | ||
344 | struct core_state *core_state; /* coredumping support */ | 361 | struct core_state *core_state; /* coredumping support */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index b460fc2af8a1..415f2db414e1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -50,8 +50,12 @@ struct mmc_ext_csd { | |||
50 | u8 rel_sectors; | 50 | u8 rel_sectors; |
51 | u8 rel_param; | 51 | u8 rel_param; |
52 | u8 part_config; | 52 | u8 part_config; |
53 | u8 cache_ctrl; | ||
54 | u8 rst_n_function; | ||
53 | unsigned int part_time; /* Units: ms */ | 55 | unsigned int part_time; /* Units: ms */ |
54 | unsigned int sa_timeout; /* Units: 100ns */ | 56 | unsigned int sa_timeout; /* Units: 100ns */ |
57 | unsigned int generic_cmd6_time; /* Units: 10ms */ | ||
58 | unsigned int power_off_longtime; /* Units: ms */ | ||
55 | unsigned int hs_max_dtr; | 59 | unsigned int hs_max_dtr; |
56 | unsigned int sectors; | 60 | unsigned int sectors; |
57 | unsigned int card_type; | 61 | unsigned int card_type; |
@@ -63,11 +67,15 @@ struct mmc_ext_csd { | |||
63 | bool enhanced_area_en; /* enable bit */ | 67 | bool enhanced_area_en; /* enable bit */ |
64 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 68 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
65 | unsigned int enhanced_area_size; /* Units: KB */ | 69 | unsigned int enhanced_area_size; /* Units: KB */ |
66 | unsigned int boot_size; /* in bytes */ | 70 | unsigned int cache_size; /* Units: KB */ |
71 | bool hpi_en; /* HPI enablebit */ | ||
72 | bool hpi; /* HPI support bit */ | ||
73 | unsigned int hpi_cmd; /* cmd used as HPI */ | ||
67 | u8 raw_partition_support; /* 160 */ | 74 | u8 raw_partition_support; /* 160 */ |
68 | u8 raw_erased_mem_count; /* 181 */ | 75 | u8 raw_erased_mem_count; /* 181 */ |
69 | u8 raw_ext_csd_structure; /* 194 */ | 76 | u8 raw_ext_csd_structure; /* 194 */ |
70 | u8 raw_card_type; /* 196 */ | 77 | u8 raw_card_type; /* 196 */ |
78 | u8 out_of_int_time; /* 198 */ | ||
71 | u8 raw_s_a_timeout; /* 217 */ | 79 | u8 raw_s_a_timeout; /* 217 */ |
72 | u8 raw_hc_erase_gap_size; /* 221 */ | 80 | u8 raw_hc_erase_gap_size; /* 221 */ |
73 | u8 raw_erase_timeout_mult; /* 223 */ | 81 | u8 raw_erase_timeout_mult; /* 223 */ |
@@ -77,6 +85,9 @@ struct mmc_ext_csd { | |||
77 | u8 raw_sec_feature_support;/* 231 */ | 85 | u8 raw_sec_feature_support;/* 231 */ |
78 | u8 raw_trim_mult; /* 232 */ | 86 | u8 raw_trim_mult; /* 232 */ |
79 | u8 raw_sectors[4]; /* 212 - 4 bytes */ | 87 | u8 raw_sectors[4]; /* 212 - 4 bytes */ |
88 | |||
89 | unsigned int feature_support; | ||
90 | #define MMC_DISCARD_FEATURE BIT(0) /* CMD38 feature */ | ||
80 | }; | 91 | }; |
81 | 92 | ||
82 | struct sd_scr { | 93 | struct sd_scr { |
@@ -157,6 +168,24 @@ struct sdio_func_tuple; | |||
157 | 168 | ||
158 | #define SDIO_MAX_FUNCS 7 | 169 | #define SDIO_MAX_FUNCS 7 |
159 | 170 | ||
171 | /* The number of MMC physical partitions. These consist of: | ||
172 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. | ||
173 | */ | ||
174 | #define MMC_NUM_BOOT_PARTITION 2 | ||
175 | #define MMC_NUM_GP_PARTITION 4 | ||
176 | #define MMC_NUM_PHY_PARTITION 6 | ||
177 | #define MAX_MMC_PART_NAME_LEN 20 | ||
178 | |||
179 | /* | ||
180 | * MMC Physical partitions | ||
181 | */ | ||
182 | struct mmc_part { | ||
183 | unsigned int size; /* partition size (in bytes) */ | ||
184 | unsigned int part_cfg; /* partition type */ | ||
185 | char name[MAX_MMC_PART_NAME_LEN]; | ||
186 | bool force_ro; /* to make boot parts RO by default */ | ||
187 | }; | ||
188 | |||
160 | /* | 189 | /* |
161 | * MMC device | 190 | * MMC device |
162 | */ | 191 | */ |
@@ -188,6 +217,13 @@ struct mmc_card { | |||
188 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ | 217 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ |
189 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ | 218 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ |
190 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | 219 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ |
220 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ | ||
221 | /* byte mode */ | ||
222 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ | ||
223 | #define MMC_NO_POWER_NOTIFICATION 0 | ||
224 | #define MMC_POWERED_ON 1 | ||
225 | #define MMC_POWEROFF_SHORT 2 | ||
226 | #define MMC_POWEROFF_LONG 3 | ||
191 | 227 | ||
192 | unsigned int erase_size; /* erase size in sectors */ | 228 | unsigned int erase_size; /* erase size in sectors */ |
193 | unsigned int erase_shift; /* if erase unit is power 2 */ | 229 | unsigned int erase_shift; /* if erase unit is power 2 */ |
@@ -216,9 +252,24 @@ struct mmc_card { | |||
216 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ | 252 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ |
217 | 253 | ||
218 | struct dentry *debugfs_root; | 254 | struct dentry *debugfs_root; |
255 | struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */ | ||
256 | unsigned int nr_parts; | ||
219 | }; | 257 | }; |
220 | 258 | ||
221 | /* | 259 | /* |
260 | * This function fill contents in mmc_part. | ||
261 | */ | ||
262 | static inline void mmc_part_add(struct mmc_card *card, unsigned int size, | ||
263 | unsigned int part_cfg, char *name, int idx, bool ro) | ||
264 | { | ||
265 | card->part[card->nr_parts].size = size; | ||
266 | card->part[card->nr_parts].part_cfg = part_cfg; | ||
267 | sprintf(card->part[card->nr_parts].name, name, idx); | ||
268 | card->part[card->nr_parts].force_ro = ro; | ||
269 | card->nr_parts++; | ||
270 | } | ||
271 | |||
272 | /* | ||
222 | * The world is not perfect and supplies us with broken mmc/sdio devices. | 273 | * The world is not perfect and supplies us with broken mmc/sdio devices. |
223 | * For at least some of these bugs we need a work-around. | 274 | * For at least some of these bugs we need a work-around. |
224 | */ | 275 | */ |
@@ -377,6 +428,11 @@ static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) | |||
377 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; | 428 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; |
378 | } | 429 | } |
379 | 430 | ||
431 | static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c) | ||
432 | { | ||
433 | return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512; | ||
434 | } | ||
435 | |||
380 | #define mmc_card_name(c) ((c)->cid.prod_name) | 436 | #define mmc_card_name(c) ((c)->cid.prod_name) |
381 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 437 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
382 | 438 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index b8b1b7a311f1..174a844a5dda 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -136,6 +136,7 @@ struct mmc_async_req; | |||
136 | 136 | ||
137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, | 137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, |
138 | struct mmc_async_req *, int *); | 138 | struct mmc_async_req *, int *); |
139 | extern int mmc_interrupt_hpi(struct mmc_card *); | ||
139 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 140 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
140 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 141 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
141 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); | 142 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); |
@@ -146,6 +147,7 @@ extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | |||
146 | #define MMC_ERASE_ARG 0x00000000 | 147 | #define MMC_ERASE_ARG 0x00000000 |
147 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 148 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
148 | #define MMC_TRIM_ARG 0x00000001 | 149 | #define MMC_TRIM_ARG 0x00000001 |
150 | #define MMC_DISCARD_ARG 0x00000003 | ||
149 | #define MMC_SECURE_TRIM1_ARG 0x80000001 | 151 | #define MMC_SECURE_TRIM1_ARG 0x80000001 |
150 | #define MMC_SECURE_TRIM2_ARG 0x80008000 | 152 | #define MMC_SECURE_TRIM2_ARG 0x80008000 |
151 | 153 | ||
@@ -156,12 +158,17 @@ extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, | |||
156 | unsigned int arg); | 158 | unsigned int arg); |
157 | extern int mmc_can_erase(struct mmc_card *card); | 159 | extern int mmc_can_erase(struct mmc_card *card); |
158 | extern int mmc_can_trim(struct mmc_card *card); | 160 | extern int mmc_can_trim(struct mmc_card *card); |
161 | extern int mmc_can_discard(struct mmc_card *card); | ||
162 | extern int mmc_can_sanitize(struct mmc_card *card); | ||
159 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); | 163 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); |
160 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | 164 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, |
161 | unsigned int nr); | 165 | unsigned int nr); |
162 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); | 166 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); |
163 | 167 | ||
164 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | 168 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
169 | extern int mmc_hw_reset(struct mmc_host *host); | ||
170 | extern int mmc_hw_reset_check(struct mmc_host *host); | ||
171 | extern int mmc_can_reset(struct mmc_card *card); | ||
165 | 172 | ||
166 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 173 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
167 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | 174 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); |
@@ -171,6 +178,8 @@ extern void mmc_release_host(struct mmc_host *host); | |||
171 | extern void mmc_do_release_host(struct mmc_host *host); | 178 | extern void mmc_do_release_host(struct mmc_host *host); |
172 | extern int mmc_try_claim_host(struct mmc_host *host); | 179 | extern int mmc_try_claim_host(struct mmc_host *host); |
173 | 180 | ||
181 | extern int mmc_flush_cache(struct mmc_card *); | ||
182 | |||
174 | /** | 183 | /** |
175 | * mmc_claim_host - exclusively claim a host | 184 | * mmc_claim_host - exclusively claim a host |
176 | * @host: mmc host to claim | 185 | * @host: mmc host to claim |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 6b46819705d1..6dc9b80568a0 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -72,6 +72,8 @@ struct mmc_data; | |||
72 | * rate and timeout calculations. | 72 | * rate and timeout calculations. |
73 | * @current_speed: Configured rate of the controller. | 73 | * @current_speed: Configured rate of the controller. |
74 | * @num_slots: Number of slots available. | 74 | * @num_slots: Number of slots available. |
75 | * @verid: Denote Version ID. | ||
76 | * @data_offset: Set the offset of DATA register according to VERID. | ||
75 | * @pdev: Platform device associated with the MMC controller. | 77 | * @pdev: Platform device associated with the MMC controller. |
76 | * @pdata: Platform data associated with the MMC controller. | 78 | * @pdata: Platform data associated with the MMC controller. |
77 | * @slot: Slots sharing this MMC controller. | 79 | * @slot: Slots sharing this MMC controller. |
@@ -147,6 +149,8 @@ struct dw_mci { | |||
147 | u32 current_speed; | 149 | u32 current_speed; |
148 | u32 num_slots; | 150 | u32 num_slots; |
149 | u32 fifoth_val; | 151 | u32 fifoth_val; |
152 | u16 verid; | ||
153 | u16 data_offset; | ||
150 | struct platform_device *pdev; | 154 | struct platform_device *pdev; |
151 | struct dw_mci_board *pdata; | 155 | struct dw_mci_board *pdata; |
152 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; | 156 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 1d09562ccf73..a3ac9c48e5de 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/fault-inject.h> | ||
15 | 16 | ||
16 | #include <linux/mmc/core.h> | 17 | #include <linux/mmc/core.h> |
17 | #include <linux/mmc/pm.h> | 18 | #include <linux/mmc/pm.h> |
@@ -108,6 +109,9 @@ struct mmc_host_ops { | |||
108 | * It is optional for the host to implement pre_req and post_req in | 109 | * It is optional for the host to implement pre_req and post_req in |
109 | * order to support double buffering of requests (prepare one | 110 | * order to support double buffering of requests (prepare one |
110 | * request while another request is active). | 111 | * request while another request is active). |
112 | * pre_req() must always be followed by a post_req(). | ||
113 | * To undo a call made to pre_req(), call post_req() with | ||
114 | * a nonzero err condition. | ||
111 | */ | 115 | */ |
112 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, | 116 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, |
113 | int err); | 117 | int err); |
@@ -147,6 +151,7 @@ struct mmc_host_ops { | |||
147 | int (*execute_tuning)(struct mmc_host *host); | 151 | int (*execute_tuning)(struct mmc_host *host); |
148 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 152 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
149 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 153 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
154 | void (*hw_reset)(struct mmc_host *host); | ||
150 | }; | 155 | }; |
151 | 156 | ||
152 | struct mmc_card; | 157 | struct mmc_card; |
@@ -229,8 +234,20 @@ struct mmc_host { | |||
229 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ | 234 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ |
230 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ | 235 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ |
231 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | 236 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ |
237 | #define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ | ||
238 | |||
239 | unsigned int caps2; /* More host capabilities */ | ||
240 | |||
241 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | ||
242 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | ||
243 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | ||
244 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | ||
232 | 245 | ||
233 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 246 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
247 | unsigned int power_notify_type; | ||
248 | #define MMC_HOST_PW_NOTIFY_NONE 0 | ||
249 | #define MMC_HOST_PW_NOTIFY_SHORT 1 | ||
250 | #define MMC_HOST_PW_NOTIFY_LONG 2 | ||
234 | 251 | ||
235 | #ifdef CONFIG_MMC_CLKGATE | 252 | #ifdef CONFIG_MMC_CLKGATE |
236 | int clk_requests; /* internal reference counter */ | 253 | int clk_requests; /* internal reference counter */ |
@@ -302,6 +319,10 @@ struct mmc_host { | |||
302 | 319 | ||
303 | struct mmc_async_req *areq; /* active async req */ | 320 | struct mmc_async_req *areq; /* active async req */ |
304 | 321 | ||
322 | #ifdef CONFIG_FAIL_MMC_REQUEST | ||
323 | struct fault_attr fail_mmc_request; | ||
324 | #endif | ||
325 | |||
305 | unsigned long private[0] ____cacheline_aligned; | 326 | unsigned long private[0] ____cacheline_aligned; |
306 | }; | 327 | }; |
307 | 328 | ||
@@ -330,6 +351,8 @@ extern int mmc_power_restore_host(struct mmc_host *host); | |||
330 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 351 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
331 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 352 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
332 | 353 | ||
354 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | ||
355 | |||
333 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 356 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
334 | { | 357 | { |
335 | host->ops->enable_sdio_irq(host, 0); | 358 | host->ops->enable_sdio_irq(host, 0); |
@@ -394,4 +417,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host) | |||
394 | { | 417 | { |
395 | return host->caps & MMC_CAP_CMD23; | 418 | return host->caps & MMC_CAP_CMD23; |
396 | } | 419 | } |
420 | |||
421 | static inline int mmc_boot_partition_access(struct mmc_host *host) | ||
422 | { | ||
423 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | ||
424 | } | ||
425 | |||
397 | #endif /* LINUX_MMC_HOST_H */ | 426 | #endif /* LINUX_MMC_HOST_H */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 5a794cb503ea..0e7135697d11 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -270,18 +270,31 @@ struct _mmc_csd { | |||
270 | * EXT_CSD fields | 270 | * EXT_CSD fields |
271 | */ | 271 | */ |
272 | 272 | ||
273 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ | ||
274 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ | ||
275 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ | ||
276 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | ||
273 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 277 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
274 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | 278 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ |
279 | #define EXT_CSD_HPI_MGMT 161 /* R/W */ | ||
280 | #define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ | ||
281 | #define EXT_CSD_SANITIZE_START 165 /* W */ | ||
275 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 282 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
276 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 283 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
277 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 284 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
278 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 285 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
279 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | 286 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
280 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | 287 | #define EXT_CSD_HS_TIMING 185 /* R/W */ |
288 | #define EXT_CSD_POWER_CLASS 187 /* R/W */ | ||
281 | #define EXT_CSD_REV 192 /* RO */ | 289 | #define EXT_CSD_REV 192 /* RO */ |
282 | #define EXT_CSD_STRUCTURE 194 /* RO */ | 290 | #define EXT_CSD_STRUCTURE 194 /* RO */ |
283 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 291 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
292 | #define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */ | ||
284 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ | 293 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ |
294 | #define EXT_CSD_PWR_CL_52_195 200 /* RO */ | ||
295 | #define EXT_CSD_PWR_CL_26_195 201 /* RO */ | ||
296 | #define EXT_CSD_PWR_CL_52_360 202 /* RO */ | ||
297 | #define EXT_CSD_PWR_CL_26_360 203 /* RO */ | ||
285 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 298 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
286 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ | 299 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ |
287 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ | 300 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ |
@@ -293,6 +306,14 @@ struct _mmc_csd { | |||
293 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ | 306 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ |
294 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ | 307 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ |
295 | #define EXT_CSD_TRIM_MULT 232 /* RO */ | 308 | #define EXT_CSD_TRIM_MULT 232 /* RO */ |
309 | #define EXT_CSD_PWR_CL_200_195 236 /* RO */ | ||
310 | #define EXT_CSD_PWR_CL_200_360 237 /* RO */ | ||
311 | #define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ | ||
312 | #define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ | ||
313 | #define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ | ||
314 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ | ||
315 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | ||
316 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ | ||
296 | 317 | ||
297 | /* | 318 | /* |
298 | * EXT_CSD field definitions | 319 | * EXT_CSD field definitions |
@@ -302,7 +323,9 @@ struct _mmc_csd { | |||
302 | 323 | ||
303 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | 324 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) |
304 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | 325 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) |
305 | #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) | 326 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
327 | |||
328 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) | ||
306 | 329 | ||
307 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | 330 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
308 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | 331 | #define EXT_CSD_CMD_SET_SECURE (1<<1) |
@@ -327,7 +350,20 @@ struct _mmc_csd { | |||
327 | #define EXT_CSD_SEC_ER_EN BIT(0) | 350 | #define EXT_CSD_SEC_ER_EN BIT(0) |
328 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) | 351 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) |
329 | #define EXT_CSD_SEC_GB_CL_EN BIT(4) | 352 | #define EXT_CSD_SEC_GB_CL_EN BIT(4) |
353 | #define EXT_CSD_SEC_SANITIZE BIT(6) /* v4.5 only */ | ||
354 | |||
355 | #define EXT_CSD_RST_N_EN_MASK 0x3 | ||
356 | #define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */ | ||
357 | |||
358 | #define EXT_CSD_NO_POWER_NOTIFICATION 0 | ||
359 | #define EXT_CSD_POWER_ON 1 | ||
360 | #define EXT_CSD_POWER_OFF_SHORT 2 | ||
361 | #define EXT_CSD_POWER_OFF_LONG 3 | ||
330 | 362 | ||
363 | #define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */ | ||
364 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ | ||
365 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 | ||
366 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 | ||
331 | /* | 367 | /* |
332 | * MMC_SWITCH access modes | 368 | * MMC_SWITCH access modes |
333 | */ | 369 | */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 5666f3abfab7..e4b69353678d 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -88,6 +88,10 @@ struct sdhci_host { | |||
88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ | 88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ |
89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) | 89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) |
90 | 90 | ||
91 | unsigned int quirks2; /* More deviations from spec. */ | ||
92 | |||
93 | #define SDHCI_QUIRK2_OWN_CARD_DETECTION (1<<0) | ||
94 | |||
91 | int irq; /* Device IRQ */ | 95 | int irq; /* Device IRQ */ |
92 | void __iomem *ioaddr; /* Mapped address */ | 96 | void __iomem *ioaddr; /* Mapped address */ |
93 | 97 | ||
@@ -115,6 +119,8 @@ struct sdhci_host { | |||
115 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ | 119 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ |
116 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ | 120 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ |
117 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | 121 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ |
122 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ | ||
123 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | ||
118 | 124 | ||
119 | unsigned int version; /* SDHCI spec. version */ | 125 | unsigned int version; /* SDHCI spec. version */ |
120 | 126 | ||
@@ -125,6 +131,8 @@ struct sdhci_host { | |||
125 | unsigned int clock; /* Current clock (MHz) */ | 131 | unsigned int clock; /* Current clock (MHz) */ |
126 | u8 pwr; /* Current voltage */ | 132 | u8 pwr; /* Current voltage */ |
127 | 133 | ||
134 | bool runtime_suspended; /* Host is runtime suspended */ | ||
135 | |||
128 | struct mmc_request *mrq; /* Current request */ | 136 | struct mmc_request *mrq; /* Current request */ |
129 | struct mmc_command *cmd; /* Current command */ | 137 | struct mmc_command *cmd; /* Current command */ |
130 | struct mmc_data *data; /* Current data request */ | 138 | struct mmc_data *data; /* Current data request */ |
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 2a2e9905a247..e0b1123497b9 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
@@ -72,11 +72,13 @@ | |||
72 | #define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ | 72 | #define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ |
73 | #define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ | 73 | #define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ |
74 | #define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ | 74 | #define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ |
75 | #define SDIO_CCCR_REV_3_00 3 /* CCCR/FBR Version 3.00 */ | ||
75 | 76 | ||
76 | #define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ | 77 | #define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ |
77 | #define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ | 78 | #define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ |
78 | #define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ | 79 | #define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ |
79 | #define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ | 80 | #define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ |
81 | #define SDIO_SDIO_REV_3_00 4 /* SDIO Spec Version 3.00 */ | ||
80 | 82 | ||
81 | #define SDIO_CCCR_SD 0x01 | 83 | #define SDIO_CCCR_SD 0x01 |
82 | 84 | ||
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 0222cd8ebe76..04ff452bf5c3 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -41,7 +41,9 @@ struct sh_mmcif_plat_data { | |||
41 | void (*set_pwr)(struct platform_device *pdev, int state); | 41 | void (*set_pwr)(struct platform_device *pdev, int state); |
42 | void (*down_pwr)(struct platform_device *pdev); | 42 | void (*down_pwr)(struct platform_device *pdev); |
43 | int (*get_cd)(struct platform_device *pdef); | 43 | int (*get_cd)(struct platform_device *pdef); |
44 | struct sh_mmcif_dma *dma; | 44 | struct sh_mmcif_dma *dma; /* Deprecated. Instead */ |
45 | unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */ | ||
46 | unsigned int slave_id_rx; | ||
45 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 47 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
46 | unsigned long caps; | 48 | unsigned long caps; |
47 | u32 ocr; | 49 | u32 ocr; |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index bd50b365167f..71b805451bd8 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -6,6 +6,10 @@ | |||
6 | struct platform_device; | 6 | struct platform_device; |
7 | struct tmio_mmc_data; | 7 | struct tmio_mmc_data; |
8 | 8 | ||
9 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | ||
10 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | ||
11 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" | ||
12 | |||
9 | struct sh_mobile_sdhi_info { | 13 | struct sh_mobile_sdhi_info { |
10 | int dma_slave_tx; | 14 | int dma_slave_tx; |
11 | int dma_slave_rx; | 15 | int dma_slave_rx; |
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h index 97491f78b08c..c5d52780d6a0 100644 --- a/include/linux/mmiotrace.h +++ b/include/linux/mmiotrace.h | |||
@@ -49,8 +49,7 @@ extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size, | |||
49 | extern void mmiotrace_iounmap(volatile void __iomem *addr); | 49 | extern void mmiotrace_iounmap(volatile void __iomem *addr); |
50 | 50 | ||
51 | /* For anyone to insert markers. Remember trailing newline. */ | 51 | /* For anyone to insert markers. Remember trailing newline. */ |
52 | extern int mmiotrace_printk(const char *fmt, ...) | 52 | extern __printf(1, 2) int mmiotrace_printk(const char *fmt, ...); |
53 | __attribute__ ((format (printf, 1, 2))); | ||
54 | #else /* !CONFIG_MMIOTRACE: */ | 53 | #else /* !CONFIG_MMIOTRACE: */ |
55 | static inline int is_kmmio_active(void) | 54 | static inline int is_kmmio_active(void) |
56 | { | 55 | { |
@@ -71,10 +70,7 @@ static inline void mmiotrace_iounmap(volatile void __iomem *addr) | |||
71 | { | 70 | { |
72 | } | 71 | } |
73 | 72 | ||
74 | static inline int mmiotrace_printk(const char *fmt, ...) | 73 | static inline __printf(1, 2) int mmiotrace_printk(const char *fmt, ...) |
75 | __attribute__ ((format (printf, 1, 0))); | ||
76 | |||
77 | static inline int mmiotrace_printk(const char *fmt, ...) | ||
78 | { | 74 | { |
79 | return 0; | 75 | return 0; |
80 | } | 76 | } |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index be1ac8d7789b..188cb2ffe8db 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -100,6 +100,7 @@ enum zone_stat_item { | |||
100 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 100 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
101 | NR_BOUNCE, | 101 | NR_BOUNCE, |
102 | NR_VMSCAN_WRITE, | 102 | NR_VMSCAN_WRITE, |
103 | NR_VMSCAN_IMMEDIATE, /* Prioritise for reclaim when writeback ends */ | ||
103 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ | 104 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ |
104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ | 105 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ |
105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ | 106 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ |
@@ -164,6 +165,18 @@ static inline int is_unevictable_lru(enum lru_list l) | |||
164 | #define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON) | 165 | #define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON) |
165 | #define LRU_ALL ((1 << NR_LRU_LISTS) - 1) | 166 | #define LRU_ALL ((1 << NR_LRU_LISTS) - 1) |
166 | 167 | ||
168 | /* Isolate inactive pages */ | ||
169 | #define ISOLATE_INACTIVE ((__force isolate_mode_t)0x1) | ||
170 | /* Isolate active pages */ | ||
171 | #define ISOLATE_ACTIVE ((__force isolate_mode_t)0x2) | ||
172 | /* Isolate clean file */ | ||
173 | #define ISOLATE_CLEAN ((__force isolate_mode_t)0x4) | ||
174 | /* Isolate unmapped file */ | ||
175 | #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8) | ||
176 | |||
177 | /* LRU Isolation modes. */ | ||
178 | typedef unsigned __bitwise__ isolate_mode_t; | ||
179 | |||
167 | enum zone_watermarks { | 180 | enum zone_watermarks { |
168 | WMARK_MIN, | 181 | WMARK_MIN, |
169 | WMARK_LOW, | 182 | WMARK_LOW, |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 409328d1cbbb..ffc02135c483 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -67,6 +67,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
67 | #define LOOKUP_EMPTY 0x4000 | 67 | #define LOOKUP_EMPTY 0x4000 |
68 | 68 | ||
69 | extern int user_path_at(int, const char __user *, unsigned, struct path *); | 69 | extern int user_path_at(int, const char __user *, unsigned, struct path *); |
70 | extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty); | ||
70 | 71 | ||
71 | #define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) | 72 | #define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) |
72 | #define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) | 73 | #define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index df1c836e6948..cbeb5867cff7 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2622,23 +2622,23 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
2622 | extern int __netdev_printk(const char *level, const struct net_device *dev, | 2622 | extern int __netdev_printk(const char *level, const struct net_device *dev, |
2623 | struct va_format *vaf); | 2623 | struct va_format *vaf); |
2624 | 2624 | ||
2625 | extern int netdev_printk(const char *level, const struct net_device *dev, | 2625 | extern __printf(3, 4) |
2626 | const char *format, ...) | 2626 | int netdev_printk(const char *level, const struct net_device *dev, |
2627 | __attribute__ ((format (printf, 3, 4))); | 2627 | const char *format, ...); |
2628 | extern int netdev_emerg(const struct net_device *dev, const char *format, ...) | 2628 | extern __printf(2, 3) |
2629 | __attribute__ ((format (printf, 2, 3))); | 2629 | int netdev_emerg(const struct net_device *dev, const char *format, ...); |
2630 | extern int netdev_alert(const struct net_device *dev, const char *format, ...) | 2630 | extern __printf(2, 3) |
2631 | __attribute__ ((format (printf, 2, 3))); | 2631 | int netdev_alert(const struct net_device *dev, const char *format, ...); |
2632 | extern int netdev_crit(const struct net_device *dev, const char *format, ...) | 2632 | extern __printf(2, 3) |
2633 | __attribute__ ((format (printf, 2, 3))); | 2633 | int netdev_crit(const struct net_device *dev, const char *format, ...); |
2634 | extern int netdev_err(const struct net_device *dev, const char *format, ...) | 2634 | extern __printf(2, 3) |
2635 | __attribute__ ((format (printf, 2, 3))); | 2635 | int netdev_err(const struct net_device *dev, const char *format, ...); |
2636 | extern int netdev_warn(const struct net_device *dev, const char *format, ...) | 2636 | extern __printf(2, 3) |
2637 | __attribute__ ((format (printf, 2, 3))); | 2637 | int netdev_warn(const struct net_device *dev, const char *format, ...); |
2638 | extern int netdev_notice(const struct net_device *dev, const char *format, ...) | 2638 | extern __printf(2, 3) |
2639 | __attribute__ ((format (printf, 2, 3))); | 2639 | int netdev_notice(const struct net_device *dev, const char *format, ...); |
2640 | extern int netdev_info(const struct net_device *dev, const char *format, ...) | 2640 | extern __printf(2, 3) |
2641 | __attribute__ ((format (printf, 2, 3))); | 2641 | int netdev_info(const struct net_device *dev, const char *format, ...); |
2642 | 2642 | ||
2643 | #define MODULE_ALIAS_NETDEV(device) \ | 2643 | #define MODULE_ALIAS_NETDEV(device) \ |
2644 | MODULE_ALIAS("netdev-" device) | 2644 | MODULE_ALIAS("netdev-" device) |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index f9930c87fff3..c3b45480ecf7 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -12,3 +12,4 @@ header-y += ipt_ah.h | |||
12 | header-y += ipt_ecn.h | 12 | header-y += ipt_ecn.h |
13 | header-y += ipt_realm.h | 13 | header-y += ipt_realm.h |
14 | header-y += ipt_ttl.h | 14 | header-y += ipt_ttl.h |
15 | header-y += nf_nat.h | ||
diff --git a/include/linux/netfilter_ipv4/nf_nat.h b/include/linux/netfilter_ipv4/nf_nat.h new file mode 100644 index 000000000000..7a861d09fc86 --- /dev/null +++ b/include/linux/netfilter_ipv4/nf_nat.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _LINUX_NF_NAT_H | ||
2 | #define _LINUX_NF_NAT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define IP_NAT_RANGE_MAP_IPS 1 | ||
7 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | ||
8 | #define IP_NAT_RANGE_PROTO_RANDOM 4 | ||
9 | #define IP_NAT_RANGE_PERSISTENT 8 | ||
10 | |||
11 | /* The protocol-specific manipulable parts of the tuple. */ | ||
12 | union nf_conntrack_man_proto { | ||
13 | /* Add other protocols here. */ | ||
14 | __be16 all; | ||
15 | |||
16 | struct { | ||
17 | __be16 port; | ||
18 | } tcp; | ||
19 | struct { | ||
20 | __be16 port; | ||
21 | } udp; | ||
22 | struct { | ||
23 | __be16 id; | ||
24 | } icmp; | ||
25 | struct { | ||
26 | __be16 port; | ||
27 | } dccp; | ||
28 | struct { | ||
29 | __be16 port; | ||
30 | } sctp; | ||
31 | struct { | ||
32 | __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ | ||
33 | } gre; | ||
34 | }; | ||
35 | |||
36 | /* Single range specification. */ | ||
37 | struct nf_nat_range { | ||
38 | /* Set to OR of flags above. */ | ||
39 | unsigned int flags; | ||
40 | |||
41 | /* Inclusive: network order. */ | ||
42 | __be32 min_ip, max_ip; | ||
43 | |||
44 | /* Inclusive: network order */ | ||
45 | union nf_conntrack_man_proto min, max; | ||
46 | }; | ||
47 | |||
48 | /* For backwards compat: don't use in modern code. */ | ||
49 | struct nf_nat_multi_range_compat { | ||
50 | unsigned int rangesize; /* Must be 1. */ | ||
51 | |||
52 | /* hangs off end. */ | ||
53 | struct nf_nat_range range[1]; | ||
54 | }; | ||
55 | |||
56 | #define nf_nat_multi_range nf_nat_multi_range_compat | ||
57 | |||
58 | #endif | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 8180cd9d73d5..8374d2967362 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ | 25 | #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ |
26 | #define NETLINK_ECRYPTFS 19 | 26 | #define NETLINK_ECRYPTFS 19 |
27 | #define NETLINK_RDMA 20 | 27 | #define NETLINK_RDMA 20 |
28 | #define NETLINK_CRYPTO 21 /* Crypto layer */ | ||
28 | 29 | ||
29 | #define MAX_LINKS 32 | 30 | #define MAX_LINKS 32 |
30 | 31 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 60a137b7f171..ab2c6343361a 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -229,6 +229,7 @@ struct nfs_inode { | |||
229 | #define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ | 229 | #define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ |
230 | #define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */ | 230 | #define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */ |
231 | #define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ | 231 | #define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ |
232 | #define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */ | ||
232 | 233 | ||
233 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 234 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
234 | { | 235 | { |
diff --git a/include/linux/of.h b/include/linux/of.h index 9180dc5cb00b..0e89aa0bf07a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
20 | #include <linux/errno.h> | ||
20 | #include <linux/kref.h> | 21 | #include <linux/kref.h> |
21 | #include <linux/mod_devicetable.h> | 22 | #include <linux/mod_devicetable.h> |
22 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
@@ -68,6 +69,7 @@ struct device_node { | |||
68 | /* Pointer for first entry in chain of all nodes. */ | 69 | /* Pointer for first entry in chain of all nodes. */ |
69 | extern struct device_node *allnodes; | 70 | extern struct device_node *allnodes; |
70 | extern struct device_node *of_chosen; | 71 | extern struct device_node *of_chosen; |
72 | extern struct device_node *of_aliases; | ||
71 | extern rwlock_t devtree_lock; | 73 | extern rwlock_t devtree_lock; |
72 | 74 | ||
73 | static inline bool of_have_populated_dt(void) | 75 | static inline bool of_have_populated_dt(void) |
@@ -199,16 +201,26 @@ extern int of_property_read_u32_array(const struct device_node *np, | |||
199 | const char *propname, | 201 | const char *propname, |
200 | u32 *out_values, | 202 | u32 *out_values, |
201 | size_t sz); | 203 | size_t sz); |
204 | extern int of_property_read_u64(const struct device_node *np, | ||
205 | const char *propname, u64 *out_value); | ||
202 | 206 | ||
203 | extern int of_property_read_string(struct device_node *np, | 207 | extern int of_property_read_string(struct device_node *np, |
204 | const char *propname, | 208 | const char *propname, |
205 | const char **out_string); | 209 | const char **out_string); |
210 | extern int of_property_read_string_index(struct device_node *np, | ||
211 | const char *propname, | ||
212 | int index, const char **output); | ||
213 | extern int of_property_count_strings(struct device_node *np, | ||
214 | const char *propname); | ||
206 | extern int of_device_is_compatible(const struct device_node *device, | 215 | extern int of_device_is_compatible(const struct device_node *device, |
207 | const char *); | 216 | const char *); |
208 | extern int of_device_is_available(const struct device_node *device); | 217 | extern int of_device_is_available(const struct device_node *device); |
209 | extern const void *of_get_property(const struct device_node *node, | 218 | extern const void *of_get_property(const struct device_node *node, |
210 | const char *name, | 219 | const char *name, |
211 | int *lenp); | 220 | int *lenp); |
221 | #define for_each_property(pp, properties) \ | ||
222 | for (pp = properties; pp != NULL; pp = pp->next) | ||
223 | |||
212 | extern int of_n_addr_cells(struct device_node *np); | 224 | extern int of_n_addr_cells(struct device_node *np); |
213 | extern int of_n_size_cells(struct device_node *np); | 225 | extern int of_n_size_cells(struct device_node *np); |
214 | extern const struct of_device_id *of_match_node( | 226 | extern const struct of_device_id *of_match_node( |
@@ -221,6 +233,9 @@ extern int of_parse_phandles_with_args(struct device_node *np, | |||
221 | const char *list_name, const char *cells_name, int index, | 233 | const char *list_name, const char *cells_name, int index, |
222 | struct device_node **out_node, const void **out_args); | 234 | struct device_node **out_node, const void **out_args); |
223 | 235 | ||
236 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); | ||
237 | extern int of_alias_get_id(struct device_node *np, const char *stem); | ||
238 | |||
224 | extern int of_machine_is_compatible(const char *compat); | 239 | extern int of_machine_is_compatible(const char *compat); |
225 | 240 | ||
226 | extern int prom_add_property(struct device_node* np, struct property* prop); | 241 | extern int prom_add_property(struct device_node* np, struct property* prop); |
@@ -235,6 +250,7 @@ extern void of_attach_node(struct device_node *); | |||
235 | extern void of_detach_node(struct device_node *); | 250 | extern void of_detach_node(struct device_node *); |
236 | #endif | 251 | #endif |
237 | 252 | ||
253 | #define of_match_ptr(_ptr) (_ptr) | ||
238 | #else /* CONFIG_OF */ | 254 | #else /* CONFIG_OF */ |
239 | 255 | ||
240 | static inline bool of_have_populated_dt(void) | 256 | static inline bool of_have_populated_dt(void) |
@@ -242,6 +258,22 @@ static inline bool of_have_populated_dt(void) | |||
242 | return false; | 258 | return false; |
243 | } | 259 | } |
244 | 260 | ||
261 | #define for_each_child_of_node(parent, child) \ | ||
262 | while (0) | ||
263 | |||
264 | static inline int of_device_is_compatible(const struct device_node *device, | ||
265 | const char *name) | ||
266 | { | ||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static inline struct property *of_find_property(const struct device_node *np, | ||
271 | const char *name, | ||
272 | int *lenp) | ||
273 | { | ||
274 | return NULL; | ||
275 | } | ||
276 | |||
245 | static inline int of_property_read_u32_array(const struct device_node *np, | 277 | static inline int of_property_read_u32_array(const struct device_node *np, |
246 | const char *propname, | 278 | const char *propname, |
247 | u32 *out_values, size_t sz) | 279 | u32 *out_values, size_t sz) |
@@ -256,6 +288,19 @@ static inline int of_property_read_string(struct device_node *np, | |||
256 | return -ENOSYS; | 288 | return -ENOSYS; |
257 | } | 289 | } |
258 | 290 | ||
291 | static inline int of_property_read_string_index(struct device_node *np, | ||
292 | const char *propname, int index, | ||
293 | const char **out_string) | ||
294 | { | ||
295 | return -ENOSYS; | ||
296 | } | ||
297 | |||
298 | static inline int of_property_count_strings(struct device_node *np, | ||
299 | const char *propname) | ||
300 | { | ||
301 | return -ENOSYS; | ||
302 | } | ||
303 | |||
259 | static inline const void *of_get_property(const struct device_node *node, | 304 | static inline const void *of_get_property(const struct device_node *node, |
260 | const char *name, | 305 | const char *name, |
261 | int *lenp) | 306 | int *lenp) |
@@ -263,6 +308,31 @@ static inline const void *of_get_property(const struct device_node *node, | |||
263 | return NULL; | 308 | return NULL; |
264 | } | 309 | } |
265 | 310 | ||
311 | static inline int of_property_read_u64(const struct device_node *np, | ||
312 | const char *propname, u64 *out_value) | ||
313 | { | ||
314 | return -ENOSYS; | ||
315 | } | ||
316 | |||
317 | static inline struct device_node *of_parse_phandle(struct device_node *np, | ||
318 | const char *phandle_name, | ||
319 | int index) | ||
320 | { | ||
321 | return NULL; | ||
322 | } | ||
323 | |||
324 | static inline int of_alias_get_id(struct device_node *np, const char *stem) | ||
325 | { | ||
326 | return -ENOSYS; | ||
327 | } | ||
328 | |||
329 | static inline int of_machine_is_compatible(const char *compat) | ||
330 | { | ||
331 | return 0; | ||
332 | } | ||
333 | |||
334 | #define of_match_ptr(_ptr) NULL | ||
335 | #define of_match_node(_matches, _node) NULL | ||
266 | #endif /* CONFIG_OF */ | 336 | #endif /* CONFIG_OF */ |
267 | 337 | ||
268 | static inline int of_property_read_u32(const struct device_node *np, | 338 | static inline int of_property_read_u32(const struct device_node *np, |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index cd2e61ce4e83..d0307eed20c9 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -33,6 +33,8 @@ struct of_irq { | |||
33 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | 33 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ |
34 | }; | 34 | }; |
35 | 35 | ||
36 | typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); | ||
37 | |||
36 | /* | 38 | /* |
37 | * Workarounds only applied to 32bit powermac machines | 39 | * Workarounds only applied to 32bit powermac machines |
38 | */ | 40 | */ |
@@ -73,6 +75,7 @@ extern int of_irq_to_resource_table(struct device_node *dev, | |||
73 | struct resource *res, int nr_irqs); | 75 | struct resource *res, int nr_irqs); |
74 | extern struct device_node *of_irq_find_parent(struct device_node *child); | 76 | extern struct device_node *of_irq_find_parent(struct device_node *child); |
75 | 77 | ||
78 | extern void of_irq_init(const struct of_device_id *matches); | ||
76 | 79 | ||
77 | #endif /* CONFIG_OF_IRQ */ | 80 | #endif /* CONFIG_OF_IRQ */ |
78 | #endif /* CONFIG_OF */ | 81 | #endif /* CONFIG_OF */ |
diff --git a/include/linux/omap3isp.h b/include/linux/omap3isp.h index b6111f8cd49a..c73a34c3434d 100644 --- a/include/linux/omap3isp.h +++ b/include/linux/omap3isp.h | |||
@@ -62,14 +62,12 @@ | |||
62 | * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready | 62 | * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready |
63 | * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready | 63 | * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready |
64 | * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready | 64 | * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready |
65 | * V4L2_EVENT_OMAP3ISP_HS_VS: Horizontal/vertical synchronization detected | ||
66 | */ | 65 | */ |
67 | 66 | ||
68 | #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) | 67 | #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) |
69 | #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) | 68 | #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) |
70 | #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) | 69 | #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) |
71 | #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) | 70 | #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) |
72 | #define V4L2_EVENT_OMAP3ISP_HS_VS (V4L2_EVENT_OMAP3ISP_CLASS | 0x4) | ||
73 | 71 | ||
74 | struct omap3isp_stat_event_status { | 72 | struct omap3isp_stat_event_status { |
75 | __u32 frame_number; | 73 | __u32 frame_number; |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 13b7b02e599a..6f9d04a85336 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -40,6 +40,7 @@ enum oom_constraint { | |||
40 | CONSTRAINT_MEMCG, | 40 | CONSTRAINT_MEMCG, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | extern void compare_swap_oom_score_adj(int old_val, int new_val); | ||
43 | extern int test_set_oom_score_adj(int new_val); | 44 | extern int test_set_oom_score_adj(int new_val); |
44 | 45 | ||
45 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, | 46 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 655824fa4c76..e3d0b3890249 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef LINUX_PCI_ATS_H | 1 | #ifndef LINUX_PCI_ATS_H |
2 | #define LINUX_PCI_ATS_H | 2 | #define LINUX_PCI_ATS_H |
3 | 3 | ||
4 | #include <linux/pci.h> | ||
5 | |||
4 | /* Address Translation Service */ | 6 | /* Address Translation Service */ |
5 | struct pci_ats { | 7 | struct pci_ats { |
6 | int pos; /* capability position */ | 8 | int pos; /* capability position */ |
@@ -15,6 +17,7 @@ struct pci_ats { | |||
15 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | 17 | extern int pci_enable_ats(struct pci_dev *dev, int ps); |
16 | extern void pci_disable_ats(struct pci_dev *dev); | 18 | extern void pci_disable_ats(struct pci_dev *dev); |
17 | extern int pci_ats_queue_depth(struct pci_dev *dev); | 19 | extern int pci_ats_queue_depth(struct pci_dev *dev); |
20 | |||
18 | /** | 21 | /** |
19 | * pci_ats_enabled - query the ATS status | 22 | * pci_ats_enabled - query the ATS status |
20 | * @dev: the PCI device | 23 | * @dev: the PCI device |
@@ -49,4 +52,76 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
49 | 52 | ||
50 | #endif /* CONFIG_PCI_IOV */ | 53 | #endif /* CONFIG_PCI_IOV */ |
51 | 54 | ||
55 | #ifdef CONFIG_PCI_PRI | ||
56 | |||
57 | extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | ||
58 | extern void pci_disable_pri(struct pci_dev *pdev); | ||
59 | extern bool pci_pri_enabled(struct pci_dev *pdev); | ||
60 | extern int pci_reset_pri(struct pci_dev *pdev); | ||
61 | extern bool pci_pri_stopped(struct pci_dev *pdev); | ||
62 | extern int pci_pri_status(struct pci_dev *pdev); | ||
63 | |||
64 | #else /* CONFIG_PCI_PRI */ | ||
65 | |||
66 | static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs) | ||
67 | { | ||
68 | return -ENODEV; | ||
69 | } | ||
70 | |||
71 | static inline void pci_disable_pri(struct pci_dev *pdev) | ||
72 | { | ||
73 | } | ||
74 | |||
75 | static inline bool pci_pri_enabled(struct pci_dev *pdev) | ||
76 | { | ||
77 | return false; | ||
78 | } | ||
79 | |||
80 | static inline int pci_reset_pri(struct pci_dev *pdev) | ||
81 | { | ||
82 | return -ENODEV; | ||
83 | } | ||
84 | |||
85 | static inline bool pci_pri_stopped(struct pci_dev *pdev) | ||
86 | { | ||
87 | return true; | ||
88 | } | ||
89 | |||
90 | static inline int pci_pri_status(struct pci_dev *pdev) | ||
91 | { | ||
92 | return -ENODEV; | ||
93 | } | ||
94 | #endif /* CONFIG_PCI_PRI */ | ||
95 | |||
96 | #ifdef CONFIG_PCI_PASID | ||
97 | |||
98 | extern int pci_enable_pasid(struct pci_dev *pdev, int features); | ||
99 | extern void pci_disable_pasid(struct pci_dev *pdev); | ||
100 | extern int pci_pasid_features(struct pci_dev *pdev); | ||
101 | extern int pci_max_pasids(struct pci_dev *pdev); | ||
102 | |||
103 | #else /* CONFIG_PCI_PASID */ | ||
104 | |||
105 | static inline int pci_enable_pasid(struct pci_dev *pdev, int features) | ||
106 | { | ||
107 | return -EINVAL; | ||
108 | } | ||
109 | |||
110 | static inline void pci_disable_pasid(struct pci_dev *pdev) | ||
111 | { | ||
112 | } | ||
113 | |||
114 | static inline int pci_pasid_features(struct pci_dev *pdev) | ||
115 | { | ||
116 | return -EINVAL; | ||
117 | } | ||
118 | |||
119 | static inline int pci_max_pasids(struct pci_dev *pdev) | ||
120 | { | ||
121 | return -EINVAL; | ||
122 | } | ||
123 | |||
124 | #endif /* CONFIG_PCI_PASID */ | ||
125 | |||
126 | |||
52 | #endif /* LINUX_PCI_ATS_H*/ | 127 | #endif /* LINUX_PCI_ATS_H*/ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index f1b1ca1a09e1..337df0d5d5f7 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -275,6 +275,7 @@ struct pci_dev { | |||
275 | unsigned int pme_support:5; /* Bitmask of states from which PME# | 275 | unsigned int pme_support:5; /* Bitmask of states from which PME# |
276 | can be generated */ | 276 | can be generated */ |
277 | unsigned int pme_interrupt:1; | 277 | unsigned int pme_interrupt:1; |
278 | unsigned int pme_poll:1; /* Poll device's PME status bit */ | ||
278 | unsigned int d1_support:1; /* Low power state D1 is supported */ | 279 | unsigned int d1_support:1; /* Low power state D1 is supported */ |
279 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 280 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
280 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 281 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
@@ -957,6 +958,7 @@ void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), | |||
957 | int pci_cfg_space_size_ext(struct pci_dev *dev); | 958 | int pci_cfg_space_size_ext(struct pci_dev *dev); |
958 | int pci_cfg_space_size(struct pci_dev *dev); | 959 | int pci_cfg_space_size(struct pci_dev *dev); |
959 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 960 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
961 | void pci_setup_bridge(struct pci_bus *bus); | ||
960 | 962 | ||
961 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) | 963 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) |
962 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) | 964 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ae96bbe54518..1679ff6931f9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2302,6 +2302,11 @@ | |||
2302 | #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 | 2302 | #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 |
2303 | #define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 | 2303 | #define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 |
2304 | 2304 | ||
2305 | #define PCI_VENDOR_ID_SOLARFLARE 0x1924 | ||
2306 | #define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0 0x0703 | ||
2307 | #define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1 0x6703 | ||
2308 | #define PCI_DEVICE_ID_SOLARFLARE_SFC4000B 0x0710 | ||
2309 | |||
2305 | #define PCI_VENDOR_ID_TDI 0x192E | 2310 | #define PCI_VENDOR_ID_TDI 0x192E |
2306 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2311 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
2307 | 2312 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index e8840964aca1..b5d9657f3100 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -663,6 +663,26 @@ | |||
663 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ | 663 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ |
664 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ | 664 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ |
665 | 665 | ||
666 | /* Page Request Interface */ | ||
667 | #define PCI_PRI_CAP 0x13 /* PRI capability ID */ | ||
668 | #define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */ | ||
669 | #define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */ | ||
670 | #define PCI_PRI_ENABLE 0x0001 /* Enable mask */ | ||
671 | #define PCI_PRI_RESET 0x0002 /* Reset bit mask */ | ||
672 | #define PCI_PRI_STATUS_RF 0x0001 /* Request Failure */ | ||
673 | #define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */ | ||
674 | #define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */ | ||
675 | #define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */ | ||
676 | #define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ | ||
677 | |||
678 | /* PASID capability */ | ||
679 | #define PCI_PASID_CAP 0x1b /* PASID capability ID */ | ||
680 | #define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */ | ||
681 | #define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */ | ||
682 | #define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */ | ||
683 | #define PCI_PASID_EXEC 0x02 /* Exec permissions Enable/Supported */ | ||
684 | #define PCI_PASID_PRIV 0x04 /* Priviledge Mode Enable/Support */ | ||
685 | |||
666 | /* Single Root I/O Virtualization */ | 686 | /* Single Root I/O Virtualization */ |
667 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 687 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
668 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ | 688 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ |
diff --git a/include/linux/platform_data/leds-renesas-tpu.h b/include/linux/platform_data/leds-renesas-tpu.h new file mode 100644 index 000000000000..055387086fc1 --- /dev/null +++ b/include/linux/platform_data/leds-renesas-tpu.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __LEDS_RENESAS_TPU_H__ | ||
2 | #define __LEDS_RENESAS_TPU_H__ | ||
3 | |||
4 | struct led_renesas_tpu_config { | ||
5 | char *name; | ||
6 | unsigned pin_gpio_fn; | ||
7 | unsigned pin_gpio; | ||
8 | unsigned int channel_offset; | ||
9 | unsigned int timer_bit; | ||
10 | unsigned int max_brightness; | ||
11 | unsigned int refresh_rate; | ||
12 | }; | ||
13 | |||
14 | #endif /* __LEDS_RENESAS_TPU_H__ */ | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 651a066686ac..2a23f7d1a825 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -190,6 +190,23 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data | |||
190 | dev_set_drvdata(&pdev->dev, data); | 190 | dev_set_drvdata(&pdev->dev, data); |
191 | } | 191 | } |
192 | 192 | ||
193 | /* module_platform_driver() - Helper macro for drivers that don't do | ||
194 | * anything special in module init/exit. This eliminates a lot of | ||
195 | * boilerplate. Each module may only use this macro once, and | ||
196 | * calling it replaces module_init() and module_exit() | ||
197 | */ | ||
198 | #define module_platform_driver(__platform_driver) \ | ||
199 | static int __init __platform_driver##_init(void) \ | ||
200 | { \ | ||
201 | return platform_driver_register(&(__platform_driver)); \ | ||
202 | } \ | ||
203 | module_init(__platform_driver##_init); \ | ||
204 | static void __exit __platform_driver##_exit(void) \ | ||
205 | { \ | ||
206 | platform_driver_unregister(&(__platform_driver)); \ | ||
207 | } \ | ||
208 | module_exit(__platform_driver##_exit); | ||
209 | |||
193 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 210 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, |
194 | int (*probe)(struct platform_device *), | 211 | int (*probe)(struct platform_device *), |
195 | struct resource *res, unsigned int n_res, | 212 | struct resource *res, unsigned int n_res, |
diff --git a/include/linux/pps-gpio.h b/include/linux/pps-gpio.h new file mode 100644 index 000000000000..0035abe41b9a --- /dev/null +++ b/include/linux/pps-gpio.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * pps-gpio.h -- PPS client for GPIOs | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2011 James Nuss <jamesnuss@nanometrics.ca> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef _PPS_GPIO_H | ||
23 | #define _PPS_GPIO_H | ||
24 | |||
25 | struct pps_gpio_platform_data { | ||
26 | bool assert_falling_edge; | ||
27 | bool capture_clear; | ||
28 | unsigned int gpio_pin; | ||
29 | const char *gpio_label; | ||
30 | }; | ||
31 | |||
32 | #endif | ||
diff --git a/include/linux/printk.h b/include/linux/printk.h index 0101d55d9651..f0e22f75143f 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -82,22 +82,22 @@ struct va_format { | |||
82 | * Dummy printk for disabled debugging statements to use whilst maintaining | 82 | * Dummy printk for disabled debugging statements to use whilst maintaining |
83 | * gcc's format and side-effect checking. | 83 | * gcc's format and side-effect checking. |
84 | */ | 84 | */ |
85 | static inline __attribute__ ((format (printf, 1, 2))) | 85 | static inline __printf(1, 2) |
86 | int no_printk(const char *fmt, ...) | 86 | int no_printk(const char *fmt, ...) |
87 | { | 87 | { |
88 | return 0; | 88 | return 0; |
89 | } | 89 | } |
90 | 90 | ||
91 | extern asmlinkage __attribute__ ((format (printf, 1, 2))) | 91 | extern asmlinkage __printf(1, 2) |
92 | void early_printk(const char *fmt, ...); | 92 | void early_printk(const char *fmt, ...); |
93 | 93 | ||
94 | extern int printk_needs_cpu(int cpu); | 94 | extern int printk_needs_cpu(int cpu); |
95 | extern void printk_tick(void); | 95 | extern void printk_tick(void); |
96 | 96 | ||
97 | #ifdef CONFIG_PRINTK | 97 | #ifdef CONFIG_PRINTK |
98 | asmlinkage __attribute__ ((format (printf, 1, 0))) | 98 | asmlinkage __printf(1, 0) |
99 | int vprintk(const char *fmt, va_list args); | 99 | int vprintk(const char *fmt, va_list args); |
100 | asmlinkage __attribute__ ((format (printf, 1, 2))) __cold | 100 | asmlinkage __printf(1, 2) __cold |
101 | int printk(const char *fmt, ...); | 101 | int printk(const char *fmt, ...); |
102 | 102 | ||
103 | /* | 103 | /* |
@@ -117,12 +117,12 @@ extern int kptr_restrict; | |||
117 | void log_buf_kexec_setup(void); | 117 | void log_buf_kexec_setup(void); |
118 | void __init setup_log_buf(int early); | 118 | void __init setup_log_buf(int early); |
119 | #else | 119 | #else |
120 | static inline __attribute__ ((format (printf, 1, 0))) | 120 | static inline __printf(1, 0) |
121 | int vprintk(const char *s, va_list args) | 121 | int vprintk(const char *s, va_list args) |
122 | { | 122 | { |
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | static inline __attribute__ ((format (printf, 1, 2))) __cold | 125 | static inline __printf(1, 2) __cold |
126 | int printk(const char *s, ...) | 126 | int printk(const char *s, ...) |
127 | { | 127 | { |
128 | return 0; | 128 | return 0; |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index cc03bbf5c4b8..ea567321ae3c 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -32,15 +32,15 @@ enum pstore_type_id { | |||
32 | struct pstore_info { | 32 | struct pstore_info { |
33 | struct module *owner; | 33 | struct module *owner; |
34 | char *name; | 34 | char *name; |
35 | struct mutex buf_mutex; /* serialize access to 'buf' */ | 35 | spinlock_t buf_lock; /* serialize access to 'buf' */ |
36 | char *buf; | 36 | char *buf; |
37 | size_t bufsize; | 37 | size_t bufsize; |
38 | int (*open)(struct pstore_info *psi); | 38 | int (*open)(struct pstore_info *psi); |
39 | int (*close)(struct pstore_info *psi); | 39 | int (*close)(struct pstore_info *psi); |
40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
41 | struct timespec *time, struct pstore_info *psi); | 41 | struct timespec *time, struct pstore_info *psi); |
42 | u64 (*write)(enum pstore_type_id type, unsigned int part, | 42 | int (*write)(enum pstore_type_id type, u64 *id, |
43 | size_t size, struct pstore_info *psi); | 43 | unsigned int part, size_t size, struct pstore_info *psi); |
44 | int (*erase)(enum pstore_type_id type, u64 id, | 44 | int (*erase)(enum pstore_type_id type, u64 id, |
45 | struct pstore_info *psi); | 45 | struct pstore_info *psi); |
46 | void *data; | 46 | void *data; |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 26f9e3612e0f..d93f95e6177c 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -31,7 +31,7 @@ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia) | |||
31 | #define quota_error(sb, fmt, args...) \ | 31 | #define quota_error(sb, fmt, args...) \ |
32 | __quota_error((sb), __func__, fmt , ## args) | 32 | __quota_error((sb), __func__, fmt , ## args) |
33 | 33 | ||
34 | extern __attribute__((format (printf, 3, 4))) | 34 | extern __printf(3, 4) |
35 | void __quota_error(struct super_block *sb, const char *func, | 35 | void __quota_error(struct super_block *sb, const char *func, |
36 | const char *fmt, ...); | 36 | const char *fmt, ...); |
37 | 37 | ||
diff --git a/include/linux/random.h b/include/linux/random.h index d13059f3ea32..8f74538c96db 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -91,6 +91,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed) | |||
91 | state->s3 = __seed(i, 15); | 91 | state->s3 = __seed(i, 15); |
92 | } | 92 | } |
93 | 93 | ||
94 | #ifdef CONFIG_ARCH_RANDOM | ||
95 | # include <asm/archrandom.h> | ||
96 | #else | ||
97 | static inline int arch_get_random_long(unsigned long *v) | ||
98 | { | ||
99 | return 0; | ||
100 | } | ||
101 | static inline int arch_get_random_int(unsigned int *v) | ||
102 | { | ||
103 | return 0; | ||
104 | } | ||
105 | #endif | ||
106 | |||
94 | #endif /* __KERNEL___ */ | 107 | #endif /* __KERNEL___ */ |
95 | 108 | ||
96 | #endif /* _LINUX_RANDOM_H */ | 109 | #endif /* _LINUX_RANDOM_H */ |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index b47771aa5718..f7756d146c61 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -141,6 +141,7 @@ int regulator_enable(struct regulator *regulator); | |||
141 | int regulator_disable(struct regulator *regulator); | 141 | int regulator_disable(struct regulator *regulator); |
142 | int regulator_force_disable(struct regulator *regulator); | 142 | int regulator_force_disable(struct regulator *regulator); |
143 | int regulator_is_enabled(struct regulator *regulator); | 143 | int regulator_is_enabled(struct regulator *regulator); |
144 | int regulator_disable_deferred(struct regulator *regulator, int ms); | ||
144 | 145 | ||
145 | int regulator_bulk_get(struct device *dev, int num_consumers, | 146 | int regulator_bulk_get(struct device *dev, int num_consumers, |
146 | struct regulator_bulk_data *consumers); | 147 | struct regulator_bulk_data *consumers); |
@@ -211,6 +212,12 @@ static inline int regulator_disable(struct regulator *regulator) | |||
211 | return 0; | 212 | return 0; |
212 | } | 213 | } |
213 | 214 | ||
215 | static inline int regulator_disable_deferred(struct regulator *regulator, | ||
216 | int ms) | ||
217 | { | ||
218 | return 0; | ||
219 | } | ||
220 | |||
214 | static inline int regulator_is_enabled(struct regulator *regulator) | 221 | static inline int regulator_is_enabled(struct regulator *regulator) |
215 | { | 222 | { |
216 | return 1; | 223 | return 1; |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 1a80bc77517d..12a1aa04b720 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -199,6 +199,9 @@ struct regulator_dev { | |||
199 | struct regulation_constraints *constraints; | 199 | struct regulation_constraints *constraints; |
200 | struct regulator *supply; /* for tree */ | 200 | struct regulator *supply; /* for tree */ |
201 | 201 | ||
202 | struct delayed_work disable_work; | ||
203 | int deferred_disables; | ||
204 | |||
202 | void *reg_data; /* regulator_dev data */ | 205 | void *reg_data; /* regulator_dev data */ |
203 | 206 | ||
204 | #ifdef CONFIG_DEBUG_FS | 207 | #ifdef CONFIG_DEBUG_FS |
diff --git a/include/linux/regulator/gpio-regulator.h b/include/linux/regulator/gpio-regulator.h new file mode 100644 index 000000000000..19fbd267406d --- /dev/null +++ b/include/linux/regulator/gpio-regulator.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | * gpio-regulator.h | ||
3 | * | ||
4 | * Copyright 2011 Heiko Stuebner <heiko@sntech.de> | ||
5 | * | ||
6 | * based on fixed.h | ||
7 | * | ||
8 | * Copyright 2008 Wolfson Microelectronics PLC. | ||
9 | * | ||
10 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
11 | * | ||
12 | * Copyright (c) 2009 Nokia Corporation | ||
13 | * Roger Quadros <ext-roger.quadros@nokia.com> | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License as | ||
17 | * published by the Free Software Foundation; either version 2 of the | ||
18 | * License, or (at your option) any later version. | ||
19 | */ | ||
20 | |||
21 | #ifndef __REGULATOR_GPIO_H | ||
22 | #define __REGULATOR_GPIO_H | ||
23 | |||
24 | struct regulator_init_data; | ||
25 | |||
26 | enum regulator_type; | ||
27 | |||
28 | /** | ||
29 | * struct gpio_regulator_state - state description | ||
30 | * @value: microvolts or microamps | ||
31 | * @gpios: bitfield of gpio target-states for the value | ||
32 | * | ||
33 | * This structure describes a supported setting of the regulator | ||
34 | * and the necessary gpio-state to achieve it. | ||
35 | * | ||
36 | * The n-th bit in the bitfield describes the state of the n-th GPIO | ||
37 | * from the gpios-array defined in gpio_regulator_config below. | ||
38 | */ | ||
39 | struct gpio_regulator_state { | ||
40 | int value; | ||
41 | int gpios; | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * struct gpio_regulator_config - config structure | ||
46 | * @supply_name: Name of the regulator supply | ||
47 | * @enable_gpio: GPIO to use for enable control | ||
48 | * set to -EINVAL if not used | ||
49 | * @enable_high: Polarity of enable GPIO | ||
50 | * 1 = Active high, 0 = Active low | ||
51 | * @enabled_at_boot: Whether regulator has been enabled at | ||
52 | * boot or not. 1 = Yes, 0 = No | ||
53 | * This is used to keep the regulator at | ||
54 | * the default state | ||
55 | * @startup_delay: Start-up time in microseconds | ||
56 | * @gpios: Array containing the gpios needed to control | ||
57 | * the setting of the regulator | ||
58 | * @nr_gpios: Number of gpios | ||
59 | * @states: Array of gpio_regulator_state entries describing | ||
60 | * the gpio state for specific voltages | ||
61 | * @nr_states: Number of states available | ||
62 | * @regulator_type: either REGULATOR_CURRENT or REGULATOR_VOLTAGE | ||
63 | * @init_data: regulator_init_data | ||
64 | * | ||
65 | * This structure contains gpio-voltage regulator configuration | ||
66 | * information that must be passed by platform code to the | ||
67 | * gpio-voltage regulator driver. | ||
68 | */ | ||
69 | struct gpio_regulator_config { | ||
70 | const char *supply_name; | ||
71 | |||
72 | int enable_gpio; | ||
73 | unsigned enable_high:1; | ||
74 | unsigned enabled_at_boot:1; | ||
75 | unsigned startup_delay; | ||
76 | |||
77 | struct gpio *gpios; | ||
78 | int nr_gpios; | ||
79 | |||
80 | struct gpio_regulator_state *states; | ||
81 | int nr_states; | ||
82 | |||
83 | enum regulator_type type; | ||
84 | struct regulator_init_data *init_data; | ||
85 | }; | ||
86 | |||
87 | #endif | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index ce3127a75c88..f3f13fd5868f 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -95,7 +95,7 @@ struct regulator_state { | |||
95 | */ | 95 | */ |
96 | struct regulation_constraints { | 96 | struct regulation_constraints { |
97 | 97 | ||
98 | char *name; | 98 | const char *name; |
99 | 99 | ||
100 | /* voltage output range (inclusive) - for voltage control */ | 100 | /* voltage output range (inclusive) - for voltage control */ |
101 | int min_uV; | 101 | int min_uV; |
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h index 0cee0152aca9..b66d13d1bdc0 100644 --- a/include/linux/rio_ids.h +++ b/include/linux/rio_ids.h | |||
@@ -39,5 +39,6 @@ | |||
39 | #define RIO_DID_IDTCPS1616 0x0379 | 39 | #define RIO_DID_IDTCPS1616 0x0379 |
40 | #define RIO_DID_IDTVPS1616 0x0377 | 40 | #define RIO_DID_IDTVPS1616 0x0377 |
41 | #define RIO_DID_IDTSPS1616 0x0378 | 41 | #define RIO_DID_IDTSPS1616 0x0378 |
42 | #define RIO_DID_TSI721 0x80ab | ||
42 | 43 | ||
43 | #endif /* LINUX_RIO_IDS_H */ | 44 | #endif /* LINUX_RIO_IDS_H */ |
diff --git a/include/linux/rtc/sirfsoc_rtciobrg.h b/include/linux/rtc/sirfsoc_rtciobrg.h new file mode 100644 index 000000000000..2c92e1c8e055 --- /dev/null +++ b/include/linux/rtc/sirfsoc_rtciobrg.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * RTC I/O Bridge interfaces for CSR SiRFprimaII | ||
3 | * ARM access the registers of SYSRTC, GPSRTC and PWRC through this module | ||
4 | * | ||
5 | * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. | ||
6 | * | ||
7 | * Licensed under GPLv2 or later. | ||
8 | */ | ||
9 | #ifndef _SIRFSOC_RTC_IOBRG_H_ | ||
10 | #define _SIRFSOC_RTC_IOBRG_H_ | ||
11 | |||
12 | extern void sirfsoc_rtc_iobrg_besyncing(void); | ||
13 | |||
14 | extern u32 sirfsoc_rtc_iobrg_readl(u32 addr); | ||
15 | |||
16 | extern void sirfsoc_rtc_iobrg_writel(u32 val, u32 addr); | ||
17 | |||
18 | #endif | ||
diff --git a/include/linux/sem.h b/include/linux/sem.h index 1feb2de2ee57..10d6b226afc5 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -83,13 +83,6 @@ struct seminfo { | |||
83 | 83 | ||
84 | struct task_struct; | 84 | struct task_struct; |
85 | 85 | ||
86 | /* One semaphore structure for each semaphore in the system. */ | ||
87 | struct sem { | ||
88 | int semval; /* current value */ | ||
89 | int sempid; /* pid of last operation */ | ||
90 | struct list_head sem_pending; /* pending single-sop operations */ | ||
91 | }; | ||
92 | |||
93 | /* One sem_array data structure for each set of semaphores in the system. */ | 86 | /* One sem_array data structure for each set of semaphores in the system. */ |
94 | struct sem_array { | 87 | struct sem_array { |
95 | struct kern_ipc_perm ____cacheline_aligned_in_smp | 88 | struct kern_ipc_perm ____cacheline_aligned_in_smp |
@@ -103,51 +96,21 @@ struct sem_array { | |||
103 | int complex_count; /* pending complex operations */ | 96 | int complex_count; /* pending complex operations */ |
104 | }; | 97 | }; |
105 | 98 | ||
106 | /* One queue for each sleeping process in the system. */ | 99 | #ifdef CONFIG_SYSVIPC |
107 | struct sem_queue { | ||
108 | struct list_head simple_list; /* queue of pending operations */ | ||
109 | struct list_head list; /* queue of pending operations */ | ||
110 | struct task_struct *sleeper; /* this process */ | ||
111 | struct sem_undo *undo; /* undo structure */ | ||
112 | int pid; /* process id of requesting process */ | ||
113 | int status; /* completion status of operation */ | ||
114 | struct sembuf *sops; /* array of pending operations */ | ||
115 | int nsops; /* number of operations */ | ||
116 | int alter; /* does the operation alter the array? */ | ||
117 | }; | ||
118 | |||
119 | /* Each task has a list of undo requests. They are executed automatically | ||
120 | * when the process exits. | ||
121 | */ | ||
122 | struct sem_undo { | ||
123 | struct list_head list_proc; /* per-process list: all undos from one process. */ | ||
124 | /* rcu protected */ | ||
125 | struct rcu_head rcu; /* rcu struct for sem_undo() */ | ||
126 | struct sem_undo_list *ulp; /* sem_undo_list for the process */ | ||
127 | struct list_head list_id; /* per semaphore array list: all undos for one array */ | ||
128 | int semid; /* semaphore set identifier */ | ||
129 | short * semadj; /* array of adjustments, one per semaphore */ | ||
130 | }; | ||
131 | |||
132 | /* sem_undo_list controls shared access to the list of sem_undo structures | ||
133 | * that may be shared among all a CLONE_SYSVSEM task group. | ||
134 | */ | ||
135 | struct sem_undo_list { | ||
136 | atomic_t refcnt; | ||
137 | spinlock_t lock; | ||
138 | struct list_head list_proc; | ||
139 | }; | ||
140 | 100 | ||
141 | struct sysv_sem { | 101 | struct sysv_sem { |
142 | struct sem_undo_list *undo_list; | 102 | struct sem_undo_list *undo_list; |
143 | }; | 103 | }; |
144 | 104 | ||
145 | #ifdef CONFIG_SYSVIPC | ||
146 | |||
147 | extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); | 105 | extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); |
148 | extern void exit_sem(struct task_struct *tsk); | 106 | extern void exit_sem(struct task_struct *tsk); |
149 | 107 | ||
150 | #else | 108 | #else |
109 | |||
110 | struct sysv_sem { | ||
111 | /* empty */ | ||
112 | }; | ||
113 | |||
151 | static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) | 114 | static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) |
152 | { | 115 | { |
153 | return 0; | 116 | return 0; |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index be720cd2038d..0b69a4684216 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -84,8 +84,7 @@ int seq_putc(struct seq_file *m, char c); | |||
84 | int seq_puts(struct seq_file *m, const char *s); | 84 | int seq_puts(struct seq_file *m, const char *s); |
85 | int seq_write(struct seq_file *seq, const void *data, size_t len); | 85 | int seq_write(struct seq_file *seq, const void *data, size_t len); |
86 | 86 | ||
87 | int seq_printf(struct seq_file *, const char *, ...) | 87 | __printf(2, 3) int seq_printf(struct seq_file *, const char *, ...); |
88 | __attribute__ ((format (printf,2,3))); | ||
89 | 88 | ||
90 | int seq_path(struct seq_file *, struct path *, char *); | 89 | int seq_path(struct seq_file *, struct path *, char *); |
91 | int seq_dentry(struct seq_file *, struct dentry *, char *); | 90 | int seq_dentry(struct seq_file *, struct dentry *, char *); |
diff --git a/include/linux/serio.h b/include/linux/serio.h index e26f4788845f..be7dfb0f12d0 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -199,5 +199,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
199 | #define SERIO_DYNAPRO 0x3a | 199 | #define SERIO_DYNAPRO 0x3a |
200 | #define SERIO_HAMPSHIRE 0x3b | 200 | #define SERIO_HAMPSHIRE 0x3b |
201 | #define SERIO_PS2MULT 0x3c | 201 | #define SERIO_PS2MULT 0x3c |
202 | #define SERIO_TSC40 0x3d | ||
202 | 203 | ||
203 | #endif | 204 | #endif |
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h index 30cae70874f4..bc8c9208f7e2 100644 --- a/include/linux/sh_pfc.h +++ b/include/linux/sh_pfc.h | |||
@@ -61,6 +61,14 @@ struct pinmux_data_reg { | |||
61 | .reg = r, .reg_width = r_width, \ | 61 | .reg = r, .reg_width = r_width, \ |
62 | .enum_ids = (pinmux_enum_t [r_width]) \ | 62 | .enum_ids = (pinmux_enum_t [r_width]) \ |
63 | 63 | ||
64 | struct pinmux_irq { | ||
65 | int irq; | ||
66 | pinmux_enum_t *enum_ids; | ||
67 | }; | ||
68 | |||
69 | #define PINMUX_IRQ(irq_nr, ids...) \ | ||
70 | { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } } \ | ||
71 | |||
64 | struct pinmux_range { | 72 | struct pinmux_range { |
65 | pinmux_enum_t begin; | 73 | pinmux_enum_t begin; |
66 | pinmux_enum_t end; | 74 | pinmux_enum_t end; |
@@ -87,7 +95,9 @@ struct pinmux_info { | |||
87 | pinmux_enum_t *gpio_data; | 95 | pinmux_enum_t *gpio_data; |
88 | unsigned int gpio_data_size; | 96 | unsigned int gpio_data_size; |
89 | 97 | ||
90 | unsigned long *gpio_in_use; | 98 | struct pinmux_irq *gpio_irq; |
99 | unsigned int gpio_irq_size; | ||
100 | |||
91 | struct gpio_chip chip; | 101 | struct gpio_chip chip; |
92 | }; | 102 | }; |
93 | 103 | ||
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 790651b4e5ba..a83833a1f7a2 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h | |||
@@ -20,6 +20,7 @@ struct shrink_control { | |||
20 | * 'nr_to_scan' entries and attempt to free them up. It should return | 20 | * 'nr_to_scan' entries and attempt to free them up. It should return |
21 | * the number of objects which remain in the cache. If it returns -1, it means | 21 | * the number of objects which remain in the cache. If it returns -1, it means |
22 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). | 22 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). |
23 | * The callback must not return -1 if nr_to_scan is zero. | ||
23 | * | 24 | * |
24 | * The 'gfpmask' refers to the allocation we are currently trying to | 25 | * The 'gfpmask' refers to the allocation we are currently trying to |
25 | * fulfil. | 26 | * fulfil. |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6a6b352326d7..fe864885c1ed 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1806,12 +1806,12 @@ static inline void skb_frag_set_page(struct sk_buff *skb, int f, | |||
1806 | 1806 | ||
1807 | /** | 1807 | /** |
1808 | * skb_frag_dma_map - maps a paged fragment via the DMA API | 1808 | * skb_frag_dma_map - maps a paged fragment via the DMA API |
1809 | * @device: the device to map the fragment to | 1809 | * @dev: the device to map the fragment to |
1810 | * @frag: the paged fragment to map | 1810 | * @frag: the paged fragment to map |
1811 | * @offset: the offset within the fragment (starting at the | 1811 | * @offset: the offset within the fragment (starting at the |
1812 | * fragment's own offset) | 1812 | * fragment's own offset) |
1813 | * @size: the number of bytes to map | 1813 | * @size: the number of bytes to map |
1814 | * @direction: the direction of the mapping (%PCI_DMA_*) | 1814 | * @dir: the direction of the mapping (%PCI_DMA_*) |
1815 | * | 1815 | * |
1816 | * Maps the page associated with @frag to @device. | 1816 | * Maps the page associated with @frag to @device. |
1817 | */ | 1817 | */ |
diff --git a/include/linux/spi/l4f00242t03.h b/include/linux/spi/l4f00242t03.h index aee1dbda4edc..bc8677c8eba9 100644 --- a/include/linux/spi/l4f00242t03.h +++ b/include/linux/spi/l4f00242t03.h | |||
@@ -24,8 +24,6 @@ | |||
24 | struct l4f00242t03_pdata { | 24 | struct l4f00242t03_pdata { |
25 | unsigned int reset_gpio; | 25 | unsigned int reset_gpio; |
26 | unsigned int data_enable_gpio; | 26 | unsigned int data_enable_gpio; |
27 | const char *io_supply; /* will be set to 1.8 V */ | ||
28 | const char *core_supply; /* will be set to 2.8 V */ | ||
29 | }; | 27 | }; |
30 | 28 | ||
31 | #endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */ | 29 | #endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */ |
diff --git a/include/linux/string.h b/include/linux/string.h index a176db2f2c85..e033564f10ba 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -114,6 +114,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t); | |||
114 | #ifndef __HAVE_ARCH_MEMCHR | 114 | #ifndef __HAVE_ARCH_MEMCHR |
115 | extern void * memchr(const void *,int,__kernel_size_t); | 115 | extern void * memchr(const void *,int,__kernel_size_t); |
116 | #endif | 116 | #endif |
117 | void *memchr_inv(const void *s, int c, size_t n); | ||
117 | 118 | ||
118 | extern char *kstrdup(const char *s, gfp_t gfp); | 119 | extern char *kstrdup(const char *s, gfp_t gfp); |
119 | extern char *kstrndup(const char *s, size_t len, gfp_t gfp); | 120 | extern char *kstrndup(const char *s, size_t len, gfp_t gfp); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 492486a74484..3d8f9c44e27d 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -136,6 +136,8 @@ void rpc_shutdown_client(struct rpc_clnt *); | |||
136 | void rpc_release_client(struct rpc_clnt *); | 136 | void rpc_release_client(struct rpc_clnt *); |
137 | void rpc_task_release_client(struct rpc_task *); | 137 | void rpc_task_release_client(struct rpc_task *); |
138 | 138 | ||
139 | int rpcb_create_local(void); | ||
140 | void rpcb_put_local(void); | ||
139 | int rpcb_register(u32, u32, int, unsigned short); | 141 | int rpcb_register(u32, u32, int, unsigned short); |
140 | int rpcb_v4_register(const u32 program, const u32 version, | 142 | int rpcb_v4_register(const u32 program, const u32 version, |
141 | const struct sockaddr *address, | 143 | const struct sockaddr *address, |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index d8d5d93071b3..35b37b1e9299 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -413,6 +413,7 @@ struct svc_procedure { | |||
413 | /* | 413 | /* |
414 | * Function prototypes. | 414 | * Function prototypes. |
415 | */ | 415 | */ |
416 | void svc_rpcb_cleanup(struct svc_serv *serv); | ||
416 | struct svc_serv *svc_create(struct svc_program *, unsigned int, | 417 | struct svc_serv *svc_create(struct svc_program *, unsigned int, |
417 | void (*shutdown)(struct svc_serv *)); | 418 | void (*shutdown)(struct svc_serv *)); |
418 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | 419 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, |
diff --git a/include/linux/swap.h b/include/linux/swap.h index c71f84bb62ec..1e22e126d2ac 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -243,15 +243,10 @@ static inline void lru_cache_add_file(struct page *page) | |||
243 | __lru_cache_add(page, LRU_INACTIVE_FILE); | 243 | __lru_cache_add(page, LRU_INACTIVE_FILE); |
244 | } | 244 | } |
245 | 245 | ||
246 | /* LRU Isolation modes. */ | ||
247 | #define ISOLATE_INACTIVE 0 /* Isolate inactive pages. */ | ||
248 | #define ISOLATE_ACTIVE 1 /* Isolate active pages. */ | ||
249 | #define ISOLATE_BOTH 2 /* Isolate both active and inactive pages. */ | ||
250 | |||
251 | /* linux/mm/vmscan.c */ | 246 | /* linux/mm/vmscan.c */ |
252 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 247 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
253 | gfp_t gfp_mask, nodemask_t *mask); | 248 | gfp_t gfp_mask, nodemask_t *mask); |
254 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 249 | extern int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file); |
255 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 250 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
256 | gfp_t gfp_mask, bool noswap); | 251 | gfp_t gfp_mask, bool noswap); |
257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | 252 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 1ff0ec2a5e8d..86a24b1166d1 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -844,4 +844,17 @@ asmlinkage long sys_open_by_handle_at(int mountdirfd, | |||
844 | struct file_handle __user *handle, | 844 | struct file_handle __user *handle, |
845 | int flags); | 845 | int flags); |
846 | asmlinkage long sys_setns(int fd, int nstype); | 846 | asmlinkage long sys_setns(int fd, int nstype); |
847 | asmlinkage long sys_process_vm_readv(pid_t pid, | ||
848 | const struct iovec __user *lvec, | ||
849 | unsigned long liovcnt, | ||
850 | const struct iovec __user *rvec, | ||
851 | unsigned long riovcnt, | ||
852 | unsigned long flags); | ||
853 | asmlinkage long sys_process_vm_writev(pid_t pid, | ||
854 | const struct iovec __user *lvec, | ||
855 | unsigned long liovcnt, | ||
856 | const struct iovec __user *rvec, | ||
857 | unsigned long riovcnt, | ||
858 | unsigned long flags); | ||
859 | |||
847 | #endif | 860 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 9a1ec10fd504..703cfa33a3ca 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -931,6 +931,7 @@ enum | |||
931 | #ifdef __KERNEL__ | 931 | #ifdef __KERNEL__ |
932 | #include <linux/list.h> | 932 | #include <linux/list.h> |
933 | #include <linux/rcupdate.h> | 933 | #include <linux/rcupdate.h> |
934 | #include <linux/wait.h> | ||
934 | 935 | ||
935 | /* For the /proc/sys support */ | 936 | /* For the /proc/sys support */ |
936 | struct ctl_table; | 937 | struct ctl_table; |
@@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int, | |||
1011 | * cover common cases. | 1012 | * cover common cases. |
1012 | */ | 1013 | */ |
1013 | 1014 | ||
1015 | /* Support for userspace poll() to watch for changes */ | ||
1016 | struct ctl_table_poll { | ||
1017 | atomic_t event; | ||
1018 | wait_queue_head_t wait; | ||
1019 | }; | ||
1020 | |||
1021 | static inline void *proc_sys_poll_event(struct ctl_table_poll *poll) | ||
1022 | { | ||
1023 | return (void *)(unsigned long)atomic_read(&poll->event); | ||
1024 | } | ||
1025 | |||
1026 | void proc_sys_poll_notify(struct ctl_table_poll *poll); | ||
1027 | |||
1028 | #define __CTL_TABLE_POLL_INITIALIZER(name) { \ | ||
1029 | .event = ATOMIC_INIT(0), \ | ||
1030 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) } | ||
1031 | |||
1032 | #define DEFINE_CTL_TABLE_POLL(name) \ | ||
1033 | struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name) | ||
1034 | |||
1014 | /* A sysctl table is an array of struct ctl_table: */ | 1035 | /* A sysctl table is an array of struct ctl_table: */ |
1015 | struct ctl_table | 1036 | struct ctl_table |
1016 | { | 1037 | { |
@@ -1021,6 +1042,7 @@ struct ctl_table | |||
1021 | struct ctl_table *child; | 1042 | struct ctl_table *child; |
1022 | struct ctl_table *parent; /* Automatically set */ | 1043 | struct ctl_table *parent; /* Automatically set */ |
1023 | proc_handler *proc_handler; /* Callback for text formatting */ | 1044 | proc_handler *proc_handler; /* Callback for text formatting */ |
1045 | struct ctl_table_poll *poll; | ||
1024 | void *extra1; | 1046 | void *extra1; |
1025 | void *extra2; | 1047 | void *extra2; |
1026 | }; | 1048 | }; |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 5cf397ceb726..7dadc3df0c77 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -29,10 +29,10 @@ trace_seq_init(struct trace_seq *s) | |||
29 | * Currently only defined when tracing is enabled. | 29 | * Currently only defined when tracing is enabled. |
30 | */ | 30 | */ |
31 | #ifdef CONFIG_TRACING | 31 | #ifdef CONFIG_TRACING |
32 | extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | 32 | extern __printf(2, 3) |
33 | __attribute__ ((format (printf, 2, 3))); | 33 | int trace_seq_printf(struct trace_seq *s, const char *fmt, ...); |
34 | extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) | 34 | extern __printf(2, 0) |
35 | __attribute__ ((format (printf, 2, 0))); | 35 | int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args); |
36 | extern int | 36 | extern int |
37 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | 37 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); |
38 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); | 38 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index d28c726ede4f..2aa2881b0df9 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -68,7 +68,7 @@ struct uinput_device { | |||
68 | unsigned char head; | 68 | unsigned char head; |
69 | unsigned char tail; | 69 | unsigned char tail; |
70 | struct input_event buff[UINPUT_BUFFER_SIZE]; | 70 | struct input_event buff[UINPUT_BUFFER_SIZE]; |
71 | int ff_effects_max; | 71 | unsigned int ff_effects_max; |
72 | 72 | ||
73 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; | 73 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; |
74 | wait_queue_head_t requests_waitq; | 74 | wait_queue_head_t requests_waitq; |
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index ed91fb62674b..b607f3532e88 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
@@ -7,3 +7,4 @@ header-y += gadgetfs.h | |||
7 | header-y += midi.h | 7 | header-y += midi.h |
8 | header-y += g_printer.h | 8 | header-y += g_printer.h |
9 | header-y += tmc.h | 9 | header-y += tmc.h |
10 | header-y += video.h | ||
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index f32a64e57f97..d5da6c68c250 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -383,12 +383,6 @@ struct usb_endpoint_descriptor { | |||
383 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | 383 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ |
384 | #define USB_ENDPOINT_DIR_MASK 0x80 | 384 | #define USB_ENDPOINT_DIR_MASK 0x80 |
385 | 385 | ||
386 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
387 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
388 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
389 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
390 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
391 | |||
392 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | 386 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ |
393 | #define USB_ENDPOINT_XFER_CONTROL 0 | 387 | #define USB_ENDPOINT_XFER_CONTROL 0 |
394 | #define USB_ENDPOINT_XFER_ISOC 1 | 388 | #define USB_ENDPOINT_XFER_ISOC 1 |
@@ -396,6 +390,17 @@ struct usb_endpoint_descriptor { | |||
396 | #define USB_ENDPOINT_XFER_INT 3 | 390 | #define USB_ENDPOINT_XFER_INT 3 |
397 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 | 391 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 |
398 | 392 | ||
393 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
394 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
395 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
396 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
397 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
398 | |||
399 | #define USB_ENDPOINT_USAGE_MASK 0x30 | ||
400 | #define USB_ENDPOINT_USAGE_DATA 0x00 | ||
401 | #define USB_ENDPOINT_USAGE_FEEDBACK 0x10 | ||
402 | #define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20 /* Implicit feedback Data endpoint */ | ||
403 | |||
399 | /*-------------------------------------------------------------------------*/ | 404 | /*-------------------------------------------------------------------------*/ |
400 | 405 | ||
401 | /** | 406 | /** |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 4e5b0213fdc1..c714ed75eae2 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -37,6 +37,14 @@ struct new_utsname { | |||
37 | #include <linux/nsproxy.h> | 37 | #include <linux/nsproxy.h> |
38 | #include <linux/err.h> | 38 | #include <linux/err.h> |
39 | 39 | ||
40 | enum uts_proc { | ||
41 | UTS_PROC_OSTYPE, | ||
42 | UTS_PROC_OSRELEASE, | ||
43 | UTS_PROC_VERSION, | ||
44 | UTS_PROC_HOSTNAME, | ||
45 | UTS_PROC_DOMAINNAME, | ||
46 | }; | ||
47 | |||
40 | struct user_namespace; | 48 | struct user_namespace; |
41 | extern struct user_namespace init_user_ns; | 49 | extern struct user_namespace init_user_ns; |
42 | 50 | ||
@@ -80,6 +88,14 @@ static inline struct uts_namespace *copy_utsname(unsigned long flags, | |||
80 | } | 88 | } |
81 | #endif | 89 | #endif |
82 | 90 | ||
91 | #ifdef CONFIG_PROC_SYSCTL | ||
92 | extern void uts_proc_notify(enum uts_proc proc); | ||
93 | #else | ||
94 | static inline void uts_proc_notify(enum uts_proc proc) | ||
95 | { | ||
96 | } | ||
97 | #endif | ||
98 | |||
83 | static inline struct new_utsname *utsname(void) | 99 | static inline struct new_utsname *utsname(void) |
84 | { | 100 | { |
85 | return ¤t->nsproxy->uts_ns->name; | 101 | return ¤t->nsproxy->uts_ns->name; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index fca24cc50436..4b752d5ee80e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -653,6 +653,10 @@ struct v4l2_buffer { | |||
653 | #define V4L2_BUF_FLAG_ERROR 0x0040 | 653 | #define V4L2_BUF_FLAG_ERROR 0x0040 |
654 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ | 654 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ |
655 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ | 655 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ |
656 | #define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ | ||
657 | /* Cache handling flags */ | ||
658 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 | ||
659 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 | ||
656 | 660 | ||
657 | /* | 661 | /* |
658 | * O V E R L A Y P R E V I E W | 662 | * O V E R L A Y P R E V I E W |
@@ -759,10 +763,10 @@ typedef __u64 v4l2_std_id; | |||
759 | #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400) | 763 | #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400) |
760 | #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800) | 764 | #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800) |
761 | 765 | ||
762 | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) | 766 | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) /* BTSC */ |
763 | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) | 767 | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) /* EIA-J */ |
764 | #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) | 768 | #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) |
765 | #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) | 769 | #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) /* FM A2 */ |
766 | 770 | ||
767 | #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) | 771 | #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) |
768 | #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) | 772 | #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) |
@@ -786,47 +790,86 @@ typedef __u64 v4l2_std_id; | |||
786 | v4l2-common.c should be fixed. | 790 | v4l2-common.c should be fixed. |
787 | */ | 791 | */ |
788 | 792 | ||
789 | /* some merged standards */ | 793 | /* |
790 | #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) | 794 | * Some macros to merge video standards in order to make live easier for the |
791 | #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) | 795 | * drivers and V4L2 applications |
792 | #define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H) | 796 | */ |
793 | #define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK) | ||
794 | 797 | ||
795 | /* some common needed stuff */ | 798 | /* |
796 | #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ | 799 | * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is |
797 | V4L2_STD_PAL_B1 |\ | 800 | * Missing here. |
798 | V4L2_STD_PAL_G) | 801 | */ |
799 | #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ | ||
800 | V4L2_STD_PAL_D1 |\ | ||
801 | V4L2_STD_PAL_K) | ||
802 | #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ | ||
803 | V4L2_STD_PAL_DK |\ | ||
804 | V4L2_STD_PAL_H |\ | ||
805 | V4L2_STD_PAL_I) | ||
806 | #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ | 802 | #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ |
807 | V4L2_STD_NTSC_M_JP |\ | 803 | V4L2_STD_NTSC_M_JP |\ |
808 | V4L2_STD_NTSC_M_KR) | 804 | V4L2_STD_NTSC_M_KR) |
805 | /* Secam macros */ | ||
809 | #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ | 806 | #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ |
810 | V4L2_STD_SECAM_K |\ | 807 | V4L2_STD_SECAM_K |\ |
811 | V4L2_STD_SECAM_K1) | 808 | V4L2_STD_SECAM_K1) |
809 | /* All Secam Standards */ | ||
812 | #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ | 810 | #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ |
813 | V4L2_STD_SECAM_G |\ | 811 | V4L2_STD_SECAM_G |\ |
814 | V4L2_STD_SECAM_H |\ | 812 | V4L2_STD_SECAM_H |\ |
815 | V4L2_STD_SECAM_DK |\ | 813 | V4L2_STD_SECAM_DK |\ |
816 | V4L2_STD_SECAM_L |\ | 814 | V4L2_STD_SECAM_L |\ |
817 | V4L2_STD_SECAM_LC) | 815 | V4L2_STD_SECAM_LC) |
816 | /* PAL macros */ | ||
817 | #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ | ||
818 | V4L2_STD_PAL_B1 |\ | ||
819 | V4L2_STD_PAL_G) | ||
820 | #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ | ||
821 | V4L2_STD_PAL_D1 |\ | ||
822 | V4L2_STD_PAL_K) | ||
823 | /* | ||
824 | * "Common" PAL - This macro is there to be compatible with the old | ||
825 | * V4L1 concept of "PAL": /BGDKHI. | ||
826 | * Several PAL standards are mising here: /M, /N and /Nc | ||
827 | */ | ||
828 | #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ | ||
829 | V4L2_STD_PAL_DK |\ | ||
830 | V4L2_STD_PAL_H |\ | ||
831 | V4L2_STD_PAL_I) | ||
832 | /* Chroma "agnostic" standards */ | ||
833 | #define V4L2_STD_B (V4L2_STD_PAL_B |\ | ||
834 | V4L2_STD_PAL_B1 |\ | ||
835 | V4L2_STD_SECAM_B) | ||
836 | #define V4L2_STD_G (V4L2_STD_PAL_G |\ | ||
837 | V4L2_STD_SECAM_G) | ||
838 | #define V4L2_STD_H (V4L2_STD_PAL_H |\ | ||
839 | V4L2_STD_SECAM_H) | ||
840 | #define V4L2_STD_L (V4L2_STD_SECAM_L |\ | ||
841 | V4L2_STD_SECAM_LC) | ||
842 | #define V4L2_STD_GH (V4L2_STD_G |\ | ||
843 | V4L2_STD_H) | ||
844 | #define V4L2_STD_DK (V4L2_STD_PAL_DK |\ | ||
845 | V4L2_STD_SECAM_DK) | ||
846 | #define V4L2_STD_BG (V4L2_STD_B |\ | ||
847 | V4L2_STD_G) | ||
848 | #define V4L2_STD_MN (V4L2_STD_PAL_M |\ | ||
849 | V4L2_STD_PAL_N |\ | ||
850 | V4L2_STD_PAL_Nc |\ | ||
851 | V4L2_STD_NTSC) | ||
818 | 852 | ||
853 | /* Standards where MTS/BTSC stereo could be found */ | ||
854 | #define V4L2_STD_MTS (V4L2_STD_NTSC_M |\ | ||
855 | V4L2_STD_PAL_M |\ | ||
856 | V4L2_STD_PAL_N |\ | ||
857 | V4L2_STD_PAL_Nc) | ||
858 | |||
859 | /* Standards for Countries with 60Hz Line frequency */ | ||
819 | #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ | 860 | #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ |
820 | V4L2_STD_PAL_60 |\ | 861 | V4L2_STD_PAL_60 |\ |
821 | V4L2_STD_NTSC |\ | 862 | V4L2_STD_NTSC |\ |
822 | V4L2_STD_NTSC_443) | 863 | V4L2_STD_NTSC_443) |
864 | /* Standards for Countries with 50Hz Line frequency */ | ||
823 | #define V4L2_STD_625_50 (V4L2_STD_PAL |\ | 865 | #define V4L2_STD_625_50 (V4L2_STD_PAL |\ |
824 | V4L2_STD_PAL_N |\ | 866 | V4L2_STD_PAL_N |\ |
825 | V4L2_STD_PAL_Nc |\ | 867 | V4L2_STD_PAL_Nc |\ |
826 | V4L2_STD_SECAM) | 868 | V4L2_STD_SECAM) |
869 | |||
827 | #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ | 870 | #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ |
828 | V4L2_STD_ATSC_16_VSB) | 871 | V4L2_STD_ATSC_16_VSB) |
829 | 872 | /* Macros with none and all analog standards */ | |
830 | #define V4L2_STD_UNKNOWN 0 | 873 | #define V4L2_STD_UNKNOWN 0 |
831 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ | 874 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ |
832 | V4L2_STD_625_50) | 875 | V4L2_STD_625_50) |
@@ -1082,6 +1125,7 @@ struct v4l2_querymenu { | |||
1082 | #define V4L2_CTRL_FLAG_INACTIVE 0x0010 | 1125 | #define V4L2_CTRL_FLAG_INACTIVE 0x0010 |
1083 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 | 1126 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 |
1084 | #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 | 1127 | #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 |
1128 | #define V4L2_CTRL_FLAG_VOLATILE 0x0080 | ||
1085 | 1129 | ||
1086 | /* Query flag, to be ORed with the control ID */ | 1130 | /* Query flag, to be ORed with the control ID */ |
1087 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 | 1131 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 |
@@ -1125,6 +1169,7 @@ enum v4l2_power_line_frequency { | |||
1125 | V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, | 1169 | V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, |
1126 | V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1, | 1170 | V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1, |
1127 | V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2, | 1171 | V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2, |
1172 | V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3, | ||
1128 | }; | 1173 | }; |
1129 | #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) | 1174 | #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) |
1130 | #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) | 1175 | #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) |
@@ -2006,6 +2051,7 @@ struct v4l2_streamparm { | |||
2006 | #define V4L2_EVENT_VSYNC 1 | 2051 | #define V4L2_EVENT_VSYNC 1 |
2007 | #define V4L2_EVENT_EOS 2 | 2052 | #define V4L2_EVENT_EOS 2 |
2008 | #define V4L2_EVENT_CTRL 3 | 2053 | #define V4L2_EVENT_CTRL 3 |
2054 | #define V4L2_EVENT_FRAME_SYNC 4 | ||
2009 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | 2055 | #define V4L2_EVENT_PRIVATE_START 0x08000000 |
2010 | 2056 | ||
2011 | /* Payload for V4L2_EVENT_VSYNC */ | 2057 | /* Payload for V4L2_EVENT_VSYNC */ |
@@ -2032,12 +2078,17 @@ struct v4l2_event_ctrl { | |||
2032 | __s32 default_value; | 2078 | __s32 default_value; |
2033 | }; | 2079 | }; |
2034 | 2080 | ||
2081 | struct v4l2_event_frame_sync { | ||
2082 | __u32 frame_sequence; | ||
2083 | }; | ||
2084 | |||
2035 | struct v4l2_event { | 2085 | struct v4l2_event { |
2036 | __u32 type; | 2086 | __u32 type; |
2037 | union { | 2087 | union { |
2038 | struct v4l2_event_vsync vsync; | 2088 | struct v4l2_event_vsync vsync; |
2039 | struct v4l2_event_ctrl ctrl; | 2089 | struct v4l2_event_ctrl ctrl; |
2040 | __u8 data[64]; | 2090 | struct v4l2_event_frame_sync frame_sync; |
2091 | __u8 data[64]; | ||
2041 | } u; | 2092 | } u; |
2042 | __u32 pending; | 2093 | __u32 pending; |
2043 | __u32 sequence; | 2094 | __u32 sequence; |
@@ -2092,6 +2143,23 @@ struct v4l2_dbg_chip_ident { | |||
2092 | __u32 revision; /* chip revision, chip specific */ | 2143 | __u32 revision; /* chip revision, chip specific */ |
2093 | } __attribute__ ((packed)); | 2144 | } __attribute__ ((packed)); |
2094 | 2145 | ||
2146 | /** | ||
2147 | * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument | ||
2148 | * @index: on return, index of the first created buffer | ||
2149 | * @count: entry: number of requested buffers, | ||
2150 | * return: number of created buffers | ||
2151 | * @memory: buffer memory type | ||
2152 | * @format: frame format, for which buffers are requested | ||
2153 | * @reserved: future extensions | ||
2154 | */ | ||
2155 | struct v4l2_create_buffers { | ||
2156 | __u32 index; | ||
2157 | __u32 count; | ||
2158 | enum v4l2_memory memory; | ||
2159 | struct v4l2_format format; | ||
2160 | __u32 reserved[8]; | ||
2161 | }; | ||
2162 | |||
2095 | /* | 2163 | /* |
2096 | * I O C T L C O D E S F O R V I D E O D E V I C E S | 2164 | * I O C T L C O D E S F O R V I D E O D E V I C E S |
2097 | * | 2165 | * |
@@ -2182,6 +2250,11 @@ struct v4l2_dbg_chip_ident { | |||
2182 | #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription) | 2250 | #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription) |
2183 | #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription) | 2251 | #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription) |
2184 | 2252 | ||
2253 | /* Experimental, the below two ioctls may change over the next couple of kernel | ||
2254 | versions */ | ||
2255 | #define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers) | ||
2256 | #define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer) | ||
2257 | |||
2185 | /* Reminder: when adding new ioctls please add support for them to | 2258 | /* Reminder: when adding new ioctls please add support for them to |
2186 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 2259 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
2187 | 2260 | ||
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 851ebf1a4476..4c069d8bd740 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -131,10 +131,10 @@ void unregister_virtio_device(struct virtio_device *dev); | |||
131 | * virtio_driver - operations for a virtio I/O driver | 131 | * virtio_driver - operations for a virtio I/O driver |
132 | * @driver: underlying device driver (populate name and owner). | 132 | * @driver: underlying device driver (populate name and owner). |
133 | * @id_table: the ids serviced by this driver. | 133 | * @id_table: the ids serviced by this driver. |
134 | * @feature_table: an array of feature numbers supported by this device. | 134 | * @feature_table: an array of feature numbers supported by this driver. |
135 | * @feature_table_size: number of entries in the feature table array. | 135 | * @feature_table_size: number of entries in the feature table array. |
136 | * @probe: the function to call when a device is found. Returns 0 or -errno. | 136 | * @probe: the function to call when a device is found. Returns 0 or -errno. |
137 | * @remove: the function when a device is removed. | 137 | * @remove: the function to call when a device is removed. |
138 | * @config_changed: optional function to call when the device configuration | 138 | * @config_changed: optional function to call when the device configuration |
139 | * changes; may be called in interrupt context. | 139 | * changes; may be called in interrupt context. |
140 | */ | 140 | */ |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 39c88c5ad19d..add4790b21fe 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -155,6 +155,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
155 | #define virtio_config_val(vdev, fbit, offset, v) \ | 155 | #define virtio_config_val(vdev, fbit, offset, v) \ |
156 | virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) | 156 | virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) |
157 | 157 | ||
158 | #define virtio_config_val_len(vdev, fbit, offset, v, len) \ | ||
159 | virtio_config_buf((vdev), (fbit), (offset), (v), (len)) | ||
160 | |||
158 | static inline int virtio_config_buf(struct virtio_device *vdev, | 161 | static inline int virtio_config_buf(struct virtio_device *vdev, |
159 | unsigned int fbit, | 162 | unsigned int fbit, |
160 | unsigned int offset, | 163 | unsigned int offset, |
diff --git a/include/linux/virtio_mmio.h b/include/linux/virtio_mmio.h new file mode 100644 index 000000000000..27c7edefbc86 --- /dev/null +++ b/include/linux/virtio_mmio.h | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | * Virtio platform device driver | ||
3 | * | ||
4 | * Copyright 2011, ARM Ltd. | ||
5 | * | ||
6 | * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007 | ||
7 | * | ||
8 | * This header is BSD licensed so anyone can use the definitions to implement | ||
9 | * compatible drivers/servers. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer. | ||
16 | * 2. Redistributions in binary form must reproduce the above copyright | ||
17 | * notice, this list of conditions and the following disclaimer in the | ||
18 | * documentation and/or other materials provided with the distribution. | ||
19 | * 3. Neither the name of IBM nor the names of its contributors | ||
20 | * may be used to endorse or promote products derived from this software | ||
21 | * without specific prior written permission. | ||
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
25 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
32 | * SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | #ifndef _LINUX_VIRTIO_MMIO_H | ||
36 | #define _LINUX_VIRTIO_MMIO_H | ||
37 | |||
38 | /* | ||
39 | * Control registers | ||
40 | */ | ||
41 | |||
42 | /* Magic value ("virt" string) - Read Only */ | ||
43 | #define VIRTIO_MMIO_MAGIC_VALUE 0x000 | ||
44 | |||
45 | /* Virtio device version - Read Only */ | ||
46 | #define VIRTIO_MMIO_VERSION 0x004 | ||
47 | |||
48 | /* Virtio device ID - Read Only */ | ||
49 | #define VIRTIO_MMIO_DEVICE_ID 0x008 | ||
50 | |||
51 | /* Virtio vendor ID - Read Only */ | ||
52 | #define VIRTIO_MMIO_VENDOR_ID 0x00c | ||
53 | |||
54 | /* Bitmask of the features supported by the host | ||
55 | * (32 bits per set) - Read Only */ | ||
56 | #define VIRTIO_MMIO_HOST_FEATURES 0x010 | ||
57 | |||
58 | /* Host features set selector - Write Only */ | ||
59 | #define VIRTIO_MMIO_HOST_FEATURES_SEL 0x014 | ||
60 | |||
61 | /* Bitmask of features activated by the guest | ||
62 | * (32 bits per set) - Write Only */ | ||
63 | #define VIRTIO_MMIO_GUEST_FEATURES 0x020 | ||
64 | |||
65 | /* Activated features set selector - Write Only */ | ||
66 | #define VIRTIO_MMIO_GUEST_FEATURES_SET 0x024 | ||
67 | |||
68 | /* Guest's memory page size in bytes - Write Only */ | ||
69 | #define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 | ||
70 | |||
71 | /* Queue selector - Write Only */ | ||
72 | #define VIRTIO_MMIO_QUEUE_SEL 0x030 | ||
73 | |||
74 | /* Maximum size of the currently selected queue - Read Only */ | ||
75 | #define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034 | ||
76 | |||
77 | /* Queue size for the currently selected queue - Write Only */ | ||
78 | #define VIRTIO_MMIO_QUEUE_NUM 0x038 | ||
79 | |||
80 | /* Used Ring alignment for the currently selected queue - Write Only */ | ||
81 | #define VIRTIO_MMIO_QUEUE_ALIGN 0x03c | ||
82 | |||
83 | /* Guest's PFN for the currently selected queue - Read Write */ | ||
84 | #define VIRTIO_MMIO_QUEUE_PFN 0x040 | ||
85 | |||
86 | /* Queue notifier - Write Only */ | ||
87 | #define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 | ||
88 | |||
89 | /* Interrupt status - Read Only */ | ||
90 | #define VIRTIO_MMIO_INTERRUPT_STATUS 0x060 | ||
91 | |||
92 | /* Interrupt acknowledge - Write Only */ | ||
93 | #define VIRTIO_MMIO_INTERRUPT_ACK 0x064 | ||
94 | |||
95 | /* Device status register - Read Write */ | ||
96 | #define VIRTIO_MMIO_STATUS 0x070 | ||
97 | |||
98 | /* The config space is defined by each driver as | ||
99 | * the per-driver configuration space - Read Write */ | ||
100 | #define VIRTIO_MMIO_CONFIG 0x100 | ||
101 | |||
102 | |||
103 | |||
104 | /* | ||
105 | * Interrupt flags (re: interrupt status & acknowledge registers) | ||
106 | */ | ||
107 | |||
108 | #define VIRTIO_MMIO_INT_VRING (1 << 0) | ||
109 | #define VIRTIO_MMIO_INT_CONFIG (1 << 1) | ||
110 | |||
111 | #endif | ||
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 4a32cb6da425..36be0f6e18a9 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -135,13 +135,13 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p, | |||
135 | vr->num = num; | 135 | vr->num = num; |
136 | vr->desc = p; | 136 | vr->desc = p; |
137 | vr->avail = p + num*sizeof(struct vring_desc); | 137 | vr->avail = p + num*sizeof(struct vring_desc); |
138 | vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1) | 138 | vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16) |
139 | & ~(align - 1)); | 139 | + align-1) & ~(align - 1)); |
140 | } | 140 | } |
141 | 141 | ||
142 | static inline unsigned vring_size(unsigned int num, unsigned long align) | 142 | static inline unsigned vring_size(unsigned int num, unsigned long align) |
143 | { | 143 | { |
144 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) | 144 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num) |
145 | + align - 1) & ~(align - 1)) | 145 | + align - 1) & ~(align - 1)) |
146 | + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num; | 146 | + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num; |
147 | } | 147 | } |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 9332e52ea8c2..687fb11e2010 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -13,6 +13,7 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | |||
13 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 13 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
14 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ | 14 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ |
15 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ | 15 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ |
16 | #define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */ | ||
16 | /* bits [20..32] reserved for arch specific ioremap internals */ | 17 | /* bits [20..32] reserved for arch specific ioremap internals */ |
17 | 18 | ||
18 | /* | 19 | /* |
diff --git a/include/media/m5mols.h b/include/media/m5mols.h index aac2c0e06d5e..4a825ae5c6c8 100644 --- a/include/media/m5mols.h +++ b/include/media/m5mols.h | |||
@@ -18,15 +18,13 @@ | |||
18 | 18 | ||
19 | /** | 19 | /** |
20 | * struct m5mols_platform_data - platform data for M-5MOLS driver | 20 | * struct m5mols_platform_data - platform data for M-5MOLS driver |
21 | * @irq: GPIO getting the irq pin of M-5MOLS | ||
22 | * @gpio_reset: GPIO driving the reset pin of M-5MOLS | 21 | * @gpio_reset: GPIO driving the reset pin of M-5MOLS |
23 | * @reset_polarity: active state for gpio_rst pin, 0 or 1 | 22 | * @reset_polarity: active state for gpio_reset pin, 0 or 1 |
24 | * @set_power: an additional callback to the board setup code | 23 | * @set_power: an additional callback to the board setup code |
25 | * to be called after enabling and before disabling | 24 | * to be called after enabling and before disabling |
26 | * the sensor's supply regulators | 25 | * the sensor's supply regulators |
27 | */ | 26 | */ |
28 | struct m5mols_platform_data { | 27 | struct m5mols_platform_data { |
29 | int irq; | ||
30 | int gpio_reset; | 28 | int gpio_reset; |
31 | u8 reset_polarity; | 29 | u8 reset_polarity; |
32 | int (*set_power)(struct device *dev, int on); | 30 | int (*set_power)(struct device *dev, int on); |
diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h new file mode 100644 index 000000000000..96448c7a318b --- /dev/null +++ b/include/media/mt9p031.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef MT9P031_H | ||
2 | #define MT9P031_H | ||
3 | |||
4 | struct v4l2_subdev; | ||
5 | |||
6 | enum { | ||
7 | MT9P031_COLOR_VERSION, | ||
8 | MT9P031_MONOCHROME_VERSION, | ||
9 | }; | ||
10 | |||
11 | struct mt9p031_platform_data { | ||
12 | int (*set_xclk)(struct v4l2_subdev *subdev, int hz); | ||
13 | int (*reset)(struct v4l2_subdev *subdev, int active); | ||
14 | int ext_freq; /* input frequency to the mt9p031 for PLL dividers */ | ||
15 | int target_freq; /* frequency target for the PLL */ | ||
16 | int version; /* MT9P031_COLOR_VERSION or MT9P031_MONOCHROME_VERSION */ | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/media/mt9t001.h b/include/media/mt9t001.h new file mode 100644 index 000000000000..e839a78bb9c5 --- /dev/null +++ b/include/media/mt9t001.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _MEDIA_MT9T001_H | ||
2 | #define _MEDIA_MT9T001_H | ||
3 | |||
4 | struct mt9t001_platform_data { | ||
5 | unsigned int clk_pol:1; | ||
6 | }; | ||
7 | |||
8 | #endif | ||
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h new file mode 100644 index 000000000000..e917b1da6577 --- /dev/null +++ b/include/media/omap3isp.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | * omap3isp.h | ||
3 | * | ||
4 | * TI OMAP3 ISP - Platform data | ||
5 | * | ||
6 | * Copyright (C) 2011 Nokia Corporation | ||
7 | * | ||
8 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
9 | * Sakari Ailus <sakari.ailus@iki.fi> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, but | ||
16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
23 | * 02110-1301 USA | ||
24 | */ | ||
25 | |||
26 | #ifndef __MEDIA_OMAP3ISP_H__ | ||
27 | #define __MEDIA_OMAP3ISP_H__ | ||
28 | |||
29 | struct i2c_board_info; | ||
30 | struct isp_device; | ||
31 | |||
32 | enum isp_interface_type { | ||
33 | ISP_INTERFACE_PARALLEL, | ||
34 | ISP_INTERFACE_CSI2A_PHY2, | ||
35 | ISP_INTERFACE_CCP2B_PHY1, | ||
36 | ISP_INTERFACE_CCP2B_PHY2, | ||
37 | ISP_INTERFACE_CSI2C_PHY1, | ||
38 | }; | ||
39 | |||
40 | enum { | ||
41 | ISP_BRIDGE_DISABLE = 0, | ||
42 | ISP_BRIDGE_LITTLE_ENDIAN = 2, | ||
43 | ISP_BRIDGE_BIG_ENDIAN = 3, | ||
44 | }; | ||
45 | |||
46 | enum { | ||
47 | ISP_LANE_SHIFT_0 = 0, | ||
48 | ISP_LANE_SHIFT_2 = 1, | ||
49 | ISP_LANE_SHIFT_4 = 2, | ||
50 | ISP_LANE_SHIFT_6 = 3, | ||
51 | }; | ||
52 | |||
53 | /** | ||
54 | * struct isp_parallel_platform_data - Parallel interface platform data | ||
55 | * @data_lane_shift: Data lane shifter | ||
56 | * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0] | ||
57 | * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0] | ||
58 | * ISP_LANE_SHIFT_4 - CAMEXT[13:4] -> CAM[9:0] | ||
59 | * ISP_LANE_SHIFT_6 - CAMEXT[13:6] -> CAM[7:0] | ||
60 | * @clk_pol: Pixel clock polarity | ||
61 | * 0 - Non Inverted, 1 - Inverted | ||
62 | * @hs_pol: Horizontal synchronization polarity | ||
63 | * 0 - Active high, 1 - Active low | ||
64 | * @vs_pol: Vertical synchronization polarity | ||
65 | * 0 - Active high, 1 - Active low | ||
66 | * @bridge: CCDC Bridge input control | ||
67 | * ISP_BRIDGE_DISABLE - Disable | ||
68 | * ISP_BRIDGE_LITTLE_ENDIAN - Little endian | ||
69 | * ISP_BRIDGE_BIG_ENDIAN - Big endian | ||
70 | */ | ||
71 | struct isp_parallel_platform_data { | ||
72 | unsigned int data_lane_shift:2; | ||
73 | unsigned int clk_pol:1; | ||
74 | unsigned int hs_pol:1; | ||
75 | unsigned int vs_pol:1; | ||
76 | unsigned int bridge:2; | ||
77 | }; | ||
78 | |||
79 | enum { | ||
80 | ISP_CCP2_PHY_DATA_CLOCK = 0, | ||
81 | ISP_CCP2_PHY_DATA_STROBE = 1, | ||
82 | }; | ||
83 | |||
84 | enum { | ||
85 | ISP_CCP2_MODE_MIPI = 0, | ||
86 | ISP_CCP2_MODE_CCP2 = 1, | ||
87 | }; | ||
88 | |||
89 | /** | ||
90 | * struct isp_ccp2_platform_data - CCP2 interface platform data | ||
91 | * @strobe_clk_pol: Strobe/clock polarity | ||
92 | * 0 - Non Inverted, 1 - Inverted | ||
93 | * @crc: Enable the cyclic redundancy check | ||
94 | * @ccp2_mode: Enable CCP2 compatibility mode | ||
95 | * ISP_CCP2_MODE_MIPI - MIPI-CSI1 mode | ||
96 | * ISP_CCP2_MODE_CCP2 - CCP2 mode | ||
97 | * @phy_layer: Physical layer selection | ||
98 | * ISP_CCP2_PHY_DATA_CLOCK - Data/clock physical layer | ||
99 | * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer | ||
100 | * @vpclk_div: Video port output clock control | ||
101 | */ | ||
102 | struct isp_ccp2_platform_data { | ||
103 | unsigned int strobe_clk_pol:1; | ||
104 | unsigned int crc:1; | ||
105 | unsigned int ccp2_mode:1; | ||
106 | unsigned int phy_layer:1; | ||
107 | unsigned int vpclk_div:2; | ||
108 | }; | ||
109 | |||
110 | /** | ||
111 | * struct isp_csi2_platform_data - CSI2 interface platform data | ||
112 | * @crc: Enable the cyclic redundancy check | ||
113 | * @vpclk_div: Video port output clock control | ||
114 | */ | ||
115 | struct isp_csi2_platform_data { | ||
116 | unsigned crc:1; | ||
117 | unsigned vpclk_div:2; | ||
118 | }; | ||
119 | |||
120 | struct isp_subdev_i2c_board_info { | ||
121 | struct i2c_board_info *board_info; | ||
122 | int i2c_adapter_id; | ||
123 | }; | ||
124 | |||
125 | struct isp_v4l2_subdevs_group { | ||
126 | struct isp_subdev_i2c_board_info *subdevs; | ||
127 | enum isp_interface_type interface; | ||
128 | union { | ||
129 | struct isp_parallel_platform_data parallel; | ||
130 | struct isp_ccp2_platform_data ccp2; | ||
131 | struct isp_csi2_platform_data csi2; | ||
132 | } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */ | ||
133 | }; | ||
134 | |||
135 | struct isp_platform_data { | ||
136 | struct isp_v4l2_subdevs_group *subdevs; | ||
137 | void (*set_constraints)(struct isp_device *isp, bool enable); | ||
138 | }; | ||
139 | |||
140 | #endif /* __MEDIA_OMAP3ISP_H__ */ | ||
diff --git a/include/media/ov772x.h b/include/media/ov772x.h index 548bf1155c83..00dbb7c4feae 100644 --- a/include/media/ov772x.h +++ b/include/media/ov772x.h | |||
@@ -12,12 +12,9 @@ | |||
12 | #ifndef __OV772X_H__ | 12 | #ifndef __OV772X_H__ |
13 | #define __OV772X_H__ | 13 | #define __OV772X_H__ |
14 | 14 | ||
15 | #include <media/soc_camera.h> | ||
16 | |||
17 | /* for flags */ | 15 | /* for flags */ |
18 | #define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */ | 16 | #define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */ |
19 | #define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */ | 17 | #define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */ |
20 | #define OV772X_FLAG_8BIT (1 << 2) /* default 10 bit */ | ||
21 | 18 | ||
22 | /* | 19 | /* |
23 | * for Edge ctrl | 20 | * for Edge ctrl |
@@ -32,22 +29,23 @@ struct ov772x_edge_ctrl { | |||
32 | unsigned char lower; | 29 | unsigned char lower; |
33 | }; | 30 | }; |
34 | 31 | ||
35 | #define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */ | 32 | #define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */ |
36 | #define EDGE_STRENGTH_MASK 0x1F | 33 | #define OV772X_EDGE_STRENGTH_MASK 0x1F |
37 | #define EDGE_THRESHOLD_MASK 0x0F | 34 | #define OV772X_EDGE_THRESHOLD_MASK 0x0F |
38 | #define EDGE_UPPER_MASK 0xFF | 35 | #define OV772X_EDGE_UPPER_MASK 0xFF |
39 | #define EDGE_LOWER_MASK 0xFF | 36 | #define OV772X_EDGE_LOWER_MASK 0xFF |
40 | 37 | ||
41 | #define OV772X_AUTO_EDGECTRL(u, l) \ | 38 | #define OV772X_AUTO_EDGECTRL(u, l) \ |
42 | { \ | 39 | { \ |
43 | .upper = (u & EDGE_UPPER_MASK), \ | 40 | .upper = (u & OV772X_EDGE_UPPER_MASK), \ |
44 | .lower = (l & EDGE_LOWER_MASK), \ | 41 | .lower = (l & OV772X_EDGE_LOWER_MASK), \ |
45 | } | 42 | } |
46 | 43 | ||
47 | #define OV772X_MANUAL_EDGECTRL(s, t) \ | 44 | #define OV772X_MANUAL_EDGECTRL(s, t) \ |
48 | { \ | 45 | { \ |
49 | .strength = (s & EDGE_STRENGTH_MASK) | OV772X_MANUAL_EDGE_CTRL,\ | 46 | .strength = (s & OV772X_EDGE_STRENGTH_MASK) | \ |
50 | .threshold = (t & EDGE_THRESHOLD_MASK), \ | 47 | OV772X_MANUAL_EDGE_CTRL, \ |
48 | .threshold = (t & OV772X_EDGE_THRESHOLD_MASK), \ | ||
51 | } | 49 | } |
52 | 50 | ||
53 | /* | 51 | /* |
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index b1f19b77ecd4..b0c494a69079 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
@@ -23,8 +23,11 @@ | |||
23 | #include <media/rc-map.h> | 23 | #include <media/rc-map.h> |
24 | 24 | ||
25 | extern int rc_core_debug; | 25 | extern int rc_core_debug; |
26 | #define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ | 26 | #define IR_dprintk(level, fmt, ...) \ |
27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | 27 | do { \ |
28 | if (rc_core_debug >= level) \ | ||
29 | pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \ | ||
30 | } while (0) | ||
28 | 31 | ||
29 | enum rc_driver_type { | 32 | enum rc_driver_type { |
30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | 33 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 17c9759ae77b..26a3bd0fe57c 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -61,6 +61,7 @@ void rc_map_init(void); | |||
61 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" | 61 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" |
62 | #define RC_MAP_ASUS_PC39 "rc-asus-pc39" | 62 | #define RC_MAP_ASUS_PC39 "rc-asus-pc39" |
63 | #define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" | 63 | #define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" |
64 | #define RC_MAP_ATI_X10 "rc-ati-x10" | ||
64 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" | 65 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" |
65 | #define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" | 66 | #define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" |
66 | #define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" | 67 | #define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" |
@@ -106,6 +107,7 @@ void rc_map_init(void); | |||
106 | #define RC_MAP_LIRC "rc-lirc" | 107 | #define RC_MAP_LIRC "rc-lirc" |
107 | #define RC_MAP_LME2510 "rc-lme2510" | 108 | #define RC_MAP_LME2510 "rc-lme2510" |
108 | #define RC_MAP_MANLI "rc-manli" | 109 | #define RC_MAP_MANLI "rc-manli" |
110 | #define RC_MAP_MEDION_X10 "rc-medion-x10" | ||
109 | #define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii" | 111 | #define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii" |
110 | #define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii" | 112 | #define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii" |
111 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" | 113 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" |
@@ -130,6 +132,7 @@ void rc_map_init(void); | |||
130 | #define RC_MAP_RC5_TV "rc-rc5-tv" | 132 | #define RC_MAP_RC5_TV "rc-rc5-tv" |
131 | #define RC_MAP_RC6_MCE "rc-rc6-mce" | 133 | #define RC_MAP_RC6_MCE "rc-rc6-mce" |
132 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" | 134 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" |
135 | #define RC_MAP_SNAPSTREAM_FIREFLY "rc-snapstream-firefly" | ||
133 | #define RC_MAP_STREAMZAP "rc-streamzap" | 136 | #define RC_MAP_STREAMZAP "rc-streamzap" |
134 | #define RC_MAP_TBS_NEC "rc-tbs-nec" | 137 | #define RC_MAP_TBS_NEC "rc-tbs-nec" |
135 | #define RC_MAP_TECHNISAT_USB2 "rc-technisat-usb2" | 138 | #define RC_MAP_TECHNISAT_USB2 "rc-technisat-usb2" |
diff --git a/include/media/s5k6aa.h b/include/media/s5k6aa.h new file mode 100644 index 000000000000..ba34f7055e55 --- /dev/null +++ b/include/media/s5k6aa.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * S5K6AAFX camera sensor driver header | ||
3 | * | ||
4 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
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 | |||
12 | #ifndef S5K6AA_H | ||
13 | #define S5K6AA_H | ||
14 | |||
15 | #include <media/v4l2-mediabus.h> | ||
16 | |||
17 | /** | ||
18 | * struct s5k6aa_gpio - data structure describing a GPIO | ||
19 | * @gpio: GPIO number | ||
20 | * @level: indicates active state of the @gpio | ||
21 | */ | ||
22 | struct s5k6aa_gpio { | ||
23 | int gpio; | ||
24 | int level; | ||
25 | }; | ||
26 | |||
27 | /** | ||
28 | * struct s5k6aa_platform_data - s5k6aa driver platform data | ||
29 | * @set_power: an additional callback to the board code, called | ||
30 | * after enabling the regulators and before switching | ||
31 | * the sensor off | ||
32 | * @mclk_frequency: sensor's master clock frequency in Hz | ||
33 | * @gpio_reset: GPIO driving RESET pin | ||
34 | * @gpio_stby: GPIO driving STBY pin | ||
35 | * @nlanes: maximum number of MIPI-CSI lanes used | ||
36 | * @horiz_flip: default horizontal image flip value, non zero to enable | ||
37 | * @vert_flip: default vertical image flip value, non zero to enable | ||
38 | */ | ||
39 | |||
40 | struct s5k6aa_platform_data { | ||
41 | int (*set_power)(int enable); | ||
42 | unsigned long mclk_frequency; | ||
43 | struct s5k6aa_gpio gpio_reset; | ||
44 | struct s5k6aa_gpio gpio_stby; | ||
45 | enum v4l2_mbus_type bus_type; | ||
46 | u8 nlanes; | ||
47 | u8 horiz_flip; | ||
48 | u8 vert_flip; | ||
49 | }; | ||
50 | |||
51 | #endif /* S5K6AA_H */ | ||
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h index 9fdff8a4ed26..688fb3f1dc35 100644 --- a/include/media/s5p_fimc.h +++ b/include/media/s5p_fimc.h | |||
@@ -19,11 +19,6 @@ enum cam_bus_type { | |||
19 | FIMC_LCD_WB, /* FIFO link from LCD mixer */ | 19 | FIMC_LCD_WB, /* FIFO link from LCD mixer */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | #define FIMC_CLK_INV_PCLK (1 << 0) | ||
23 | #define FIMC_CLK_INV_VSYNC (1 << 1) | ||
24 | #define FIMC_CLK_INV_HREF (1 << 2) | ||
25 | #define FIMC_CLK_INV_HSYNC (1 << 3) | ||
26 | |||
27 | struct i2c_board_info; | 22 | struct i2c_board_info; |
28 | 23 | ||
29 | /** | 24 | /** |
@@ -36,7 +31,8 @@ struct i2c_board_info; | |||
36 | * @csi_data_align: MIPI-CSI interface data alignment in bits | 31 | * @csi_data_align: MIPI-CSI interface data alignment in bits |
37 | * @i2c_bus_num: i2c control bus id the sensor is attached to | 32 | * @i2c_bus_num: i2c control bus id the sensor is attached to |
38 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) | 33 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) |
39 | * @flags: flags defining bus signals polarity inversion (High by default) | 34 | * @clk_id: index of the SoC peripheral clock for sensors |
35 | * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*) | ||
40 | */ | 36 | */ |
41 | struct s5p_fimc_isp_info { | 37 | struct s5p_fimc_isp_info { |
42 | struct i2c_board_info *board_info; | 38 | struct i2c_board_info *board_info; |
@@ -46,6 +42,7 @@ struct s5p_fimc_isp_info { | |||
46 | u16 i2c_bus_num; | 42 | u16 i2c_bus_num; |
47 | u16 mux_id; | 43 | u16 mux_id; |
48 | u16 flags; | 44 | u16 flags; |
45 | u8 clk_id; | ||
49 | }; | 46 | }; |
50 | 47 | ||
51 | /** | 48 | /** |
@@ -58,4 +55,13 @@ struct s5p_platform_fimc { | |||
58 | struct s5p_fimc_isp_info *isp_info; | 55 | struct s5p_fimc_isp_info *isp_info; |
59 | int num_clients; | 56 | int num_clients; |
60 | }; | 57 | }; |
58 | |||
59 | /* | ||
60 | * v4l2_device notification id. This is only for internal use in the kernel. | ||
61 | * Sensor subdevs should issue S5P_FIMC_TX_END_NOTIFY notification in single | ||
62 | * frame capture mode when there is only one VSYNC pulse issued by the sensor | ||
63 | * at begining of the frame transmission. | ||
64 | */ | ||
65 | #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0) | ||
66 | |||
61 | #endif /* S5P_FIMC_H_ */ | 67 | #endif /* S5P_FIMC_H_ */ |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 79827143d5ac..5017500eda1b 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -25,24 +25,32 @@ | |||
25 | 25 | ||
26 | extern unsigned int saa7146_debug; | 26 | extern unsigned int saa7146_debug; |
27 | 27 | ||
28 | //#define DEBUG_PROLOG printk("(0x%08x)(0x%08x) %s: %s(): ",(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,RPS_ADDR0))),(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,IER))),KBUILD_MODNAME,__func__) | ||
29 | |||
30 | #ifndef DEBUG_VARIABLE | 28 | #ifndef DEBUG_VARIABLE |
31 | #define DEBUG_VARIABLE saa7146_debug | 29 | #define DEBUG_VARIABLE saa7146_debug |
32 | #endif | 30 | #endif |
33 | 31 | ||
34 | #define DEBUG_PROLOG printk("%s: %s(): ",KBUILD_MODNAME, __func__) | 32 | #define ERR(fmt, ...) pr_err("%s: " fmt, __func__, ##__VA_ARGS__) |
35 | #define INFO(x) { printk("%s: ",KBUILD_MODNAME); printk x; } | 33 | |
36 | 34 | #define _DBG(mask, fmt, ...) \ | |
37 | #define ERR(x) { DEBUG_PROLOG; printk x; } | 35 | do { \ |
38 | 36 | if (DEBUG_VARIABLE & mask) \ | |
39 | #define DEB_S(x) if (0!=(DEBUG_VARIABLE&0x01)) { DEBUG_PROLOG; printk x; } /* simple debug messages */ | 37 | pr_debug("%s(): " fmt, __func__, ##__VA_ARGS__); \ |
40 | #define DEB_D(x) if (0!=(DEBUG_VARIABLE&0x02)) { DEBUG_PROLOG; printk x; } /* more detailed debug messages */ | 38 | } while (0) |
41 | #define DEB_EE(x) if (0!=(DEBUG_VARIABLE&0x04)) { DEBUG_PROLOG; printk x; } /* print enter and exit of functions */ | 39 | |
42 | #define DEB_I2C(x) if (0!=(DEBUG_VARIABLE&0x08)) { DEBUG_PROLOG; printk x; } /* i2c debug messages */ | 40 | /* simple debug messages */ |
43 | #define DEB_VBI(x) if (0!=(DEBUG_VARIABLE&0x10)) { DEBUG_PROLOG; printk x; } /* vbi debug messages */ | 41 | #define DEB_S(fmt, ...) _DBG(0x01, fmt, ##__VA_ARGS__) |
44 | #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ | 42 | /* more detailed debug messages */ |
45 | #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ | 43 | #define DEB_D(fmt, ...) _DBG(0x02, fmt, ##__VA_ARGS__) |
44 | /* print enter and exit of functions */ | ||
45 | #define DEB_EE(fmt, ...) _DBG(0x04, fmt, ##__VA_ARGS__) | ||
46 | /* i2c debug messages */ | ||
47 | #define DEB_I2C(fmt, ...) _DBG(0x08, fmt, ##__VA_ARGS__) | ||
48 | /* vbi debug messages */ | ||
49 | #define DEB_VBI(fmt, ...) _DBG(0x10, fmt, ##__VA_ARGS__) | ||
50 | /* interrupt debug messages */ | ||
51 | #define DEB_INT(fmt, ...) _DBG(0x20, fmt, ##__VA_ARGS__) | ||
52 | /* capture debug messages */ | ||
53 | #define DEB_CAP(fmt, ...) _DBG(0x40, fmt, ##__VA_ARGS__) | ||
46 | 54 | ||
47 | #define SAA7146_ISR_CLEAR(x,y) \ | 55 | #define SAA7146_ISR_CLEAR(x,y) \ |
48 | saa7146_write(x, ISR, (y)); | 56 | saa7146_write(x, ISR, (y)); |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 7582952dceae..b1377b931eb7 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -12,12 +12,14 @@ | |||
12 | #ifndef SOC_CAMERA_H | 12 | #ifndef SOC_CAMERA_H |
13 | #define SOC_CAMERA_H | 13 | #define SOC_CAMERA_H |
14 | 14 | ||
15 | #include <linux/bitops.h> | ||
15 | #include <linux/device.h> | 16 | #include <linux/device.h> |
16 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
17 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
18 | #include <linux/videodev2.h> | 19 | #include <linux/videodev2.h> |
19 | #include <media/videobuf-core.h> | 20 | #include <media/videobuf-core.h> |
20 | #include <media/videobuf2-core.h> | 21 | #include <media/videobuf2-core.h> |
22 | #include <media/v4l2-ctrls.h> | ||
21 | #include <media/v4l2-device.h> | 23 | #include <media/v4l2-device.h> |
22 | 24 | ||
23 | struct file; | 25 | struct file; |
@@ -37,8 +39,8 @@ struct soc_camera_device { | |||
37 | unsigned char iface; /* Host number */ | 39 | unsigned char iface; /* Host number */ |
38 | unsigned char devnum; /* Device number per host */ | 40 | unsigned char devnum; /* Device number per host */ |
39 | struct soc_camera_sense *sense; /* See comment in struct definition */ | 41 | struct soc_camera_sense *sense; /* See comment in struct definition */ |
40 | struct soc_camera_ops *ops; | ||
41 | struct video_device *vdev; | 42 | struct video_device *vdev; |
43 | struct v4l2_ctrl_handler ctrl_handler; | ||
42 | const struct soc_camera_format_xlate *current_fmt; | 44 | const struct soc_camera_format_xlate *current_fmt; |
43 | struct soc_camera_format_xlate *user_formats; | 45 | struct soc_camera_format_xlate *user_formats; |
44 | int num_user_formats; | 46 | int num_user_formats; |
@@ -93,14 +95,10 @@ struct soc_camera_host_ops { | |||
93 | int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); | 95 | int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); |
94 | int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); | 96 | int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); |
95 | int (*set_bus_param)(struct soc_camera_device *, __u32); | 97 | int (*set_bus_param)(struct soc_camera_device *, __u32); |
96 | int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); | ||
97 | int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); | ||
98 | int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | 98 | int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); |
99 | int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | 99 | int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); |
100 | int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); | 100 | int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); |
101 | unsigned int (*poll)(struct file *, poll_table *); | 101 | unsigned int (*poll)(struct file *, poll_table *); |
102 | const struct v4l2_queryctrl *controls; | ||
103 | int num_controls; | ||
104 | }; | 102 | }; |
105 | 103 | ||
106 | #define SOCAM_SENSOR_INVERT_PCLK (1 << 0) | 104 | #define SOCAM_SENSOR_INVERT_PCLK (1 << 0) |
@@ -193,13 +191,6 @@ struct soc_camera_format_xlate { | |||
193 | const struct soc_mbus_pixelfmt *host_fmt; | 191 | const struct soc_mbus_pixelfmt *host_fmt; |
194 | }; | 192 | }; |
195 | 193 | ||
196 | struct soc_camera_ops { | ||
197 | unsigned long (*query_bus_param)(struct soc_camera_device *); | ||
198 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); | ||
199 | const struct v4l2_queryctrl *controls; | ||
200 | int num_controls; | ||
201 | }; | ||
202 | |||
203 | #define SOCAM_SENSE_PCLK_CHANGED (1 << 0) | 194 | #define SOCAM_SENSE_PCLK_CHANGED (1 << 0) |
204 | 195 | ||
205 | /** | 196 | /** |
@@ -226,65 +217,18 @@ struct soc_camera_sense { | |||
226 | unsigned long pixel_clock; | 217 | unsigned long pixel_clock; |
227 | }; | 218 | }; |
228 | 219 | ||
229 | static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( | 220 | #define SOCAM_DATAWIDTH(x) BIT((x) - 1) |
230 | struct soc_camera_ops *ops, int id) | 221 | #define SOCAM_DATAWIDTH_4 SOCAM_DATAWIDTH(4) |
231 | { | 222 | #define SOCAM_DATAWIDTH_8 SOCAM_DATAWIDTH(8) |
232 | int i; | 223 | #define SOCAM_DATAWIDTH_9 SOCAM_DATAWIDTH(9) |
233 | 224 | #define SOCAM_DATAWIDTH_10 SOCAM_DATAWIDTH(10) | |
234 | for (i = 0; i < ops->num_controls; i++) | 225 | #define SOCAM_DATAWIDTH_15 SOCAM_DATAWIDTH(15) |
235 | if (ops->controls[i].id == id) | 226 | #define SOCAM_DATAWIDTH_16 SOCAM_DATAWIDTH(16) |
236 | return &ops->controls[i]; | ||
237 | |||
238 | return NULL; | ||
239 | } | ||
240 | |||
241 | #define SOCAM_MASTER (1 << 0) | ||
242 | #define SOCAM_SLAVE (1 << 1) | ||
243 | #define SOCAM_HSYNC_ACTIVE_HIGH (1 << 2) | ||
244 | #define SOCAM_HSYNC_ACTIVE_LOW (1 << 3) | ||
245 | #define SOCAM_VSYNC_ACTIVE_HIGH (1 << 4) | ||
246 | #define SOCAM_VSYNC_ACTIVE_LOW (1 << 5) | ||
247 | #define SOCAM_DATAWIDTH_4 (1 << 6) | ||
248 | #define SOCAM_DATAWIDTH_8 (1 << 7) | ||
249 | #define SOCAM_DATAWIDTH_9 (1 << 8) | ||
250 | #define SOCAM_DATAWIDTH_10 (1 << 9) | ||
251 | #define SOCAM_DATAWIDTH_15 (1 << 10) | ||
252 | #define SOCAM_DATAWIDTH_16 (1 << 11) | ||
253 | #define SOCAM_PCLK_SAMPLE_RISING (1 << 12) | ||
254 | #define SOCAM_PCLK_SAMPLE_FALLING (1 << 13) | ||
255 | #define SOCAM_DATA_ACTIVE_HIGH (1 << 14) | ||
256 | #define SOCAM_DATA_ACTIVE_LOW (1 << 15) | ||
257 | #define SOCAM_MIPI_1LANE (1 << 16) | ||
258 | #define SOCAM_MIPI_2LANE (1 << 17) | ||
259 | #define SOCAM_MIPI_3LANE (1 << 18) | ||
260 | #define SOCAM_MIPI_4LANE (1 << 19) | ||
261 | #define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \ | ||
262 | SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE) | ||
263 | 227 | ||
264 | #define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ | 228 | #define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ |
265 | SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ | 229 | SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ |
266 | SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16) | 230 | SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16) |
267 | 231 | ||
268 | static inline unsigned long soc_camera_bus_param_compatible( | ||
269 | unsigned long camera_flags, unsigned long bus_flags) | ||
270 | { | ||
271 | unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode; | ||
272 | unsigned long mipi; | ||
273 | |||
274 | common_flags = camera_flags & bus_flags; | ||
275 | |||
276 | hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW); | ||
277 | vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW); | ||
278 | pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING); | ||
279 | data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW); | ||
280 | mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE); | ||
281 | buswidth = common_flags & SOCAM_DATAWIDTH_MASK; | ||
282 | mipi = common_flags & SOCAM_MIPI; | ||
283 | |||
284 | return ((!hsync || !vsync || !pclk || !data || !mode || !buswidth) && !mipi) ? 0 : | ||
285 | common_flags; | ||
286 | } | ||
287 | |||
288 | static inline void soc_camera_limit_side(int *start, int *length, | 232 | static inline void soc_camera_limit_side(int *start, int *length, |
289 | unsigned int start_min, | 233 | unsigned int start_min, |
290 | unsigned int length_min, unsigned int length_max) | 234 | unsigned int length_min, unsigned int length_max) |
@@ -300,23 +244,37 @@ static inline void soc_camera_limit_side(int *start, int *length, | |||
300 | *start = start_min + length_max - *length; | 244 | *start = start_min + length_max - *length; |
301 | } | 245 | } |
302 | 246 | ||
303 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 247 | unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, |
304 | unsigned long flags); | 248 | unsigned long flags); |
249 | unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl, | ||
250 | const struct v4l2_mbus_config *cfg); | ||
305 | 251 | ||
306 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ | 252 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ |
307 | #include <linux/i2c.h> | 253 | #include <linux/i2c.h> |
308 | static inline struct video_device *soc_camera_i2c_to_vdev(struct i2c_client *client) | 254 | static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client) |
255 | { | ||
256 | struct v4l2_subdev *sd = i2c_get_clientdata(client); | ||
257 | struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; | ||
258 | return icd ? icd->vdev : NULL; | ||
259 | } | ||
260 | |||
261 | static inline struct soc_camera_link *soc_camera_i2c_to_link(const struct i2c_client *client) | ||
262 | { | ||
263 | return client->dev.platform_data; | ||
264 | } | ||
265 | |||
266 | static inline struct v4l2_subdev *soc_camera_vdev_to_subdev(const struct video_device *vdev) | ||
309 | { | 267 | { |
310 | struct soc_camera_device *icd = client->dev.platform_data; | 268 | struct soc_camera_device *icd = dev_get_drvdata(vdev->parent); |
311 | return icd->vdev; | 269 | return soc_camera_to_subdev(icd); |
312 | } | 270 | } |
313 | 271 | ||
314 | static inline struct soc_camera_device *soc_camera_from_vb2q(struct vb2_queue *vq) | 272 | static inline struct soc_camera_device *soc_camera_from_vb2q(const struct vb2_queue *vq) |
315 | { | 273 | { |
316 | return container_of(vq, struct soc_camera_device, vb2_vidq); | 274 | return container_of(vq, struct soc_camera_device, vb2_vidq); |
317 | } | 275 | } |
318 | 276 | ||
319 | static inline struct soc_camera_device *soc_camera_from_vbq(struct videobuf_queue *vq) | 277 | static inline struct soc_camera_device *soc_camera_from_vbq(const struct videobuf_queue *vq) |
320 | { | 278 | { |
321 | return container_of(vq, struct soc_camera_device, vb_vidq); | 279 | return container_of(vq, struct soc_camera_device, vb_vidq); |
322 | } | 280 | } |
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 74f0fa15ca47..8aa4200a0b1d 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/videodev2.h> | 14 | #include <linux/videodev2.h> |
15 | #include <media/soc_camera.h> | 15 | #include <media/soc_camera.h> |
16 | #include <media/v4l2-mediabus.h> | ||
16 | 17 | ||
17 | struct device; | 18 | struct device; |
18 | 19 | ||
@@ -20,7 +21,8 @@ struct soc_camera_platform_info { | |||
20 | const char *format_name; | 21 | const char *format_name; |
21 | unsigned long format_depth; | 22 | unsigned long format_depth; |
22 | struct v4l2_mbus_framefmt format; | 23 | struct v4l2_mbus_framefmt format; |
23 | unsigned long bus_param; | 24 | unsigned long mbus_param; |
25 | enum v4l2_mbus_type mbus_type; | ||
24 | struct soc_camera_device *icd; | 26 | struct soc_camera_device *icd; |
25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 27 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
26 | }; | 28 | }; |
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index fae432544b41..73f1e7eb60f3 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h | |||
@@ -82,5 +82,7 @@ const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( | |||
82 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); | 82 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); |
83 | int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, | 83 | int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, |
84 | unsigned int *numerator, unsigned int *denominator); | 84 | unsigned int *numerator, unsigned int *denominator); |
85 | unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg, | ||
86 | unsigned int flags); | ||
85 | 87 | ||
86 | #endif | 88 | #endif |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 63fd9d3db296..810a20928a21 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -212,9 +212,6 @@ enum { | |||
212 | /* module sn9c20x: just ident 10000 */ | 212 | /* module sn9c20x: just ident 10000 */ |
213 | V4L2_IDENT_SN9C20X = 10000, | 213 | V4L2_IDENT_SN9C20X = 10000, |
214 | 214 | ||
215 | /* Siliconfile sensors: reserved range 10100 - 10199 */ | ||
216 | V4L2_IDENT_NOON010PC30 = 10100, | ||
217 | |||
218 | /* module cx231xx and cx25840 */ | 215 | /* module cx231xx and cx25840 */ |
219 | V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */ | 216 | V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */ |
220 | V4L2_IDENT_CX23100 = 23100, | 217 | V4L2_IDENT_CX23100 = 23100, |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 13fe4d744aba..eeb3df637144 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -65,14 +65,12 @@ struct v4l2_ctrl_ops { | |||
65 | * @is_private: If set, then this control is private to its handler and it | 65 | * @is_private: If set, then this control is private to its handler and it |
66 | * will not be added to any other handlers. Drivers can set | 66 | * will not be added to any other handlers. Drivers can set |
67 | * this flag. | 67 | * this flag. |
68 | * @is_volatile: If set, then this control is volatile. This means that the | ||
69 | * control's current value cannot be cached and needs to be | ||
70 | * retrieved through the g_volatile_ctrl op. Drivers can set | ||
71 | * this flag. | ||
72 | * @is_auto: If set, then this control selects whether the other cluster | 68 | * @is_auto: If set, then this control selects whether the other cluster |
73 | * members are in 'automatic' mode or 'manual' mode. This is | 69 | * members are in 'automatic' mode or 'manual' mode. This is |
74 | * used for autogain/gain type clusters. Drivers should never | 70 | * used for autogain/gain type clusters. Drivers should never |
75 | * set this flag directly. | 71 | * set this flag directly. |
72 | * @has_volatiles: If set, then one or more members of the cluster are volatile. | ||
73 | * Drivers should never touch this flag. | ||
76 | * @manual_mode_value: If the is_auto flag is set, then this is the value | 74 | * @manual_mode_value: If the is_auto flag is set, then this is the value |
77 | * of the auto control that determines if that control is in | 75 | * of the auto control that determines if that control is in |
78 | * manual mode. So if the value of the auto control equals this | 76 | * manual mode. So if the value of the auto control equals this |
@@ -118,8 +116,8 @@ struct v4l2_ctrl { | |||
118 | 116 | ||
119 | unsigned int is_new:1; | 117 | unsigned int is_new:1; |
120 | unsigned int is_private:1; | 118 | unsigned int is_private:1; |
121 | unsigned int is_volatile:1; | ||
122 | unsigned int is_auto:1; | 119 | unsigned int is_auto:1; |
120 | unsigned int has_volatiles:1; | ||
123 | unsigned int manual_mode_value:8; | 121 | unsigned int manual_mode_value:8; |
124 | 122 | ||
125 | const struct v4l2_ctrl_ops *ops; | 123 | const struct v4l2_ctrl_ops *ops; |
@@ -208,9 +206,6 @@ struct v4l2_ctrl_handler { | |||
208 | * must be NULL. | 206 | * must be NULL. |
209 | * @is_private: If set, then this control is private to its handler and it | 207 | * @is_private: If set, then this control is private to its handler and it |
210 | * will not be added to any other handlers. | 208 | * will not be added to any other handlers. |
211 | * @is_volatile: If set, then this control is volatile. This means that the | ||
212 | * control's current value cannot be cached and needs to be | ||
213 | * retrieved through the g_volatile_ctrl op. | ||
214 | */ | 209 | */ |
215 | struct v4l2_ctrl_config { | 210 | struct v4l2_ctrl_config { |
216 | const struct v4l2_ctrl_ops *ops; | 211 | const struct v4l2_ctrl_ops *ops; |
@@ -225,7 +220,6 @@ struct v4l2_ctrl_config { | |||
225 | u32 menu_skip_mask; | 220 | u32 menu_skip_mask; |
226 | const char * const *qmenu; | 221 | const char * const *qmenu; |
227 | unsigned int is_private:1; | 222 | unsigned int is_private:1; |
228 | unsigned int is_volatile:1; | ||
229 | }; | 223 | }; |
230 | 224 | ||
231 | /** v4l2_ctrl_fill() - Fill in the control fields based on the control ID. | 225 | /** v4l2_ctrl_fill() - Fill in the control fields based on the control ID. |
@@ -389,8 +383,7 @@ void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); | |||
389 | * @manual_val: The value for the first control in the cluster that equals the | 383 | * @manual_val: The value for the first control in the cluster that equals the |
390 | * manual setting. | 384 | * manual setting. |
391 | * @set_volatile: If true, then all controls except the first auto control will | 385 | * @set_volatile: If true, then all controls except the first auto control will |
392 | * have is_volatile set to true. If false, then is_volatile will not | 386 | * be volatile. |
393 | * be touched. | ||
394 | * | 387 | * |
395 | * Use for control groups where one control selects some automatic feature and | 388 | * Use for control groups where one control selects some automatic feature and |
396 | * the other controls are only active whenever the automatic feature is turned | 389 | * the other controls are only active whenever the automatic feature is turned |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index dd9f1e7b8ff7..4d1c74ad4c84 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -122,6 +122,8 @@ struct v4l2_ioctl_ops { | |||
122 | int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); | 122 | int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); |
123 | int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); | 123 | int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); |
124 | 124 | ||
125 | int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b); | ||
126 | int (*vidioc_prepare_buf)(struct file *file, void *fh, struct v4l2_buffer *b); | ||
125 | 127 | ||
126 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); | 128 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); |
127 | int (*vidioc_g_fbuf) (struct file *file, void *fh, | 129 | int (*vidioc_g_fbuf) (struct file *file, void *fh, |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 6114007c8c74..83ae07e53350 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h | |||
@@ -22,8 +22,12 @@ | |||
22 | */ | 22 | */ |
23 | #define V4L2_MBUS_MASTER (1 << 0) | 23 | #define V4L2_MBUS_MASTER (1 << 0) |
24 | #define V4L2_MBUS_SLAVE (1 << 1) | 24 | #define V4L2_MBUS_SLAVE (1 << 1) |
25 | /* Which signal polarities it supports */ | 25 | /* |
26 | /* Note: in BT.656 mode HSYNC and VSYNC are unused */ | 26 | * Signal polarity flags |
27 | * Note: in BT.656 mode HSYNC, FIELD, and VSYNC are unused | ||
28 | * V4L2_MBUS_[HV]SYNC* flags should be also used for specifying | ||
29 | * configuration of hardware that uses [HV]REF signals | ||
30 | */ | ||
27 | #define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2) | 31 | #define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2) |
28 | #define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3) | 32 | #define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3) |
29 | #define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4) | 33 | #define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4) |
@@ -32,6 +36,10 @@ | |||
32 | #define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7) | 36 | #define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7) |
33 | #define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8) | 37 | #define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8) |
34 | #define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9) | 38 | #define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9) |
39 | /* FIELD = 0/1 - Field1 (odd)/Field2 (even) */ | ||
40 | #define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10) | ||
41 | /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */ | ||
42 | #define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11) | ||
35 | 43 | ||
36 | /* Serial flags */ | 44 | /* Serial flags */ |
37 | /* How many lanes the client can use */ | 45 | /* How many lanes the client can use */ |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 257da1a30f66..f0f3358d1b1b 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -158,6 +158,7 @@ struct v4l2_subdev_core_ops { | |||
158 | int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | 158 | int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); |
159 | int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); | 159 | int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); |
160 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); | 160 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); |
161 | int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm); | ||
161 | int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); | 162 | int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); |
162 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); | 163 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); |
163 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 164 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
@@ -534,13 +535,13 @@ struct v4l2_subdev { | |||
534 | void *dev_priv; | 535 | void *dev_priv; |
535 | void *host_priv; | 536 | void *host_priv; |
536 | /* subdev device node */ | 537 | /* subdev device node */ |
537 | struct video_device devnode; | 538 | struct video_device *devnode; |
538 | }; | 539 | }; |
539 | 540 | ||
540 | #define media_entity_to_v4l2_subdev(ent) \ | 541 | #define media_entity_to_v4l2_subdev(ent) \ |
541 | container_of(ent, struct v4l2_subdev, entity) | 542 | container_of(ent, struct v4l2_subdev, entity) |
542 | #define vdev_to_v4l2_subdev(vdev) \ | 543 | #define vdev_to_v4l2_subdev(vdev) \ |
543 | container_of(vdev, struct v4l2_subdev, devnode) | 544 | video_get_drvdata(vdev) |
544 | 545 | ||
545 | /* | 546 | /* |
546 | * Used for storing subdev information per file handle | 547 | * Used for storing subdev information per file handle |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index f87472acbc51..a15d1f1b319e 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
@@ -75,7 +75,6 @@ struct vb2_mem_ops { | |||
75 | 75 | ||
76 | struct vb2_plane { | 76 | struct vb2_plane { |
77 | void *mem_priv; | 77 | void *mem_priv; |
78 | int mapped:1; | ||
79 | }; | 78 | }; |
80 | 79 | ||
81 | /** | 80 | /** |
@@ -106,6 +105,7 @@ enum vb2_fileio_flags { | |||
106 | /** | 105 | /** |
107 | * enum vb2_buffer_state - current video buffer state | 106 | * enum vb2_buffer_state - current video buffer state |
108 | * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control | 107 | * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control |
108 | * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver | ||
109 | * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver | 109 | * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver |
110 | * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used | 110 | * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used |
111 | * in a hardware operation | 111 | * in a hardware operation |
@@ -117,6 +117,7 @@ enum vb2_fileio_flags { | |||
117 | */ | 117 | */ |
118 | enum vb2_buffer_state { | 118 | enum vb2_buffer_state { |
119 | VB2_BUF_STATE_DEQUEUED, | 119 | VB2_BUF_STATE_DEQUEUED, |
120 | VB2_BUF_STATE_PREPARED, | ||
120 | VB2_BUF_STATE_QUEUED, | 121 | VB2_BUF_STATE_QUEUED, |
121 | VB2_BUF_STATE_ACTIVE, | 122 | VB2_BUF_STATE_ACTIVE, |
122 | VB2_BUF_STATE_DONE, | 123 | VB2_BUF_STATE_DONE, |
@@ -147,7 +148,6 @@ struct vb2_queue; | |||
147 | * @done_entry: entry on the list that stores all buffers ready to | 148 | * @done_entry: entry on the list that stores all buffers ready to |
148 | * be dequeued to userspace | 149 | * be dequeued to userspace |
149 | * @planes: private per-plane information; do not change | 150 | * @planes: private per-plane information; do not change |
150 | * @num_planes_mapped: number of mapped planes; do not change | ||
151 | */ | 151 | */ |
152 | struct vb2_buffer { | 152 | struct vb2_buffer { |
153 | struct v4l2_buffer v4l2_buf; | 153 | struct v4l2_buffer v4l2_buf; |
@@ -164,19 +164,26 @@ struct vb2_buffer { | |||
164 | struct list_head done_entry; | 164 | struct list_head done_entry; |
165 | 165 | ||
166 | struct vb2_plane planes[VIDEO_MAX_PLANES]; | 166 | struct vb2_plane planes[VIDEO_MAX_PLANES]; |
167 | unsigned int num_planes_mapped; | ||
168 | }; | 167 | }; |
169 | 168 | ||
170 | /** | 169 | /** |
171 | * struct vb2_ops - driver-specific callbacks | 170 | * struct vb2_ops - driver-specific callbacks |
172 | * | 171 | * |
173 | * @queue_setup: called from a VIDIOC_REQBUFS handler, before | 172 | * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS |
174 | * memory allocation; driver should return the required | 173 | * handlers before memory allocation, or, if |
175 | * number of buffers in num_buffers, the required number | 174 | * *num_planes != 0, after the allocation to verify a |
176 | * of planes per buffer in num_planes; the size of each | 175 | * smaller number of buffers. Driver should return |
177 | * plane should be set in the sizes[] array and optional | 176 | * the required number of buffers in *num_buffers, the |
178 | * per-plane allocator specific context in alloc_ctxs[] | 177 | * required number of planes per buffer in *num_planes; the |
179 | * array | 178 | * size of each plane should be set in the sizes[] array |
179 | * and optional per-plane allocator specific context in the | ||
180 | * alloc_ctxs[] array. When called from VIDIOC_REQBUFS, | ||
181 | * fmt == NULL, the driver has to use the currently | ||
182 | * configured format and *num_buffers is the total number | ||
183 | * of buffers, that are being allocated. When called from | ||
184 | * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the | ||
185 | * target frame format. In this case *num_buffers are being | ||
186 | * allocated additionally to q->num_buffers. | ||
180 | * @wait_prepare: release any locks taken while calling vb2 functions; | 187 | * @wait_prepare: release any locks taken while calling vb2 functions; |
181 | * it is called before an ioctl needs to wait for a new | 188 | * it is called before an ioctl needs to wait for a new |
182 | * buffer to arrive; required to avoid a deadlock in | 189 | * buffer to arrive; required to avoid a deadlock in |
@@ -189,30 +196,39 @@ struct vb2_buffer { | |||
189 | * perform additional buffer-related initialization; | 196 | * perform additional buffer-related initialization; |
190 | * initialization failure (return != 0) will prevent | 197 | * initialization failure (return != 0) will prevent |
191 | * queue setup from completing successfully; optional | 198 | * queue setup from completing successfully; optional |
192 | * @buf_prepare: called every time the buffer is queued from userspace; | 199 | * @buf_prepare: called every time the buffer is queued from userspace |
193 | * drivers may perform any initialization required before | 200 | * and from the VIDIOC_PREPARE_BUF ioctl; drivers may |
194 | * each hardware operation in this callback; | 201 | * perform any initialization required before each hardware |
195 | * if an error is returned, the buffer will not be queued | 202 | * operation in this callback; if an error is returned, the |
196 | * in driver; optional | 203 | * buffer will not be queued in driver; optional |
197 | * @buf_finish: called before every dequeue of the buffer back to | 204 | * @buf_finish: called before every dequeue of the buffer back to |
198 | * userspace; drivers may perform any operations required | 205 | * userspace; drivers may perform any operations required |
199 | * before userspace accesses the buffer; optional | 206 | * before userspace accesses the buffer; optional |
200 | * @buf_cleanup: called once before the buffer is freed; drivers may | 207 | * @buf_cleanup: called once before the buffer is freed; drivers may |
201 | * perform any additional cleanup; optional | 208 | * perform any additional cleanup; optional |
202 | * @start_streaming: called once before entering 'streaming' state; enables | 209 | * @start_streaming: called once to enter 'streaming' state; the driver may |
203 | * driver to receive buffers over buf_queue() callback | 210 | * receive buffers with @buf_queue callback before |
211 | * @start_streaming is called; the driver gets the number | ||
212 | * of already queued buffers in count parameter; driver | ||
213 | * can return an error if hardware fails or not enough | ||
214 | * buffers has been queued, in such case all buffers that | ||
215 | * have been already given by the @buf_queue callback are | ||
216 | * invalidated. | ||
204 | * @stop_streaming: called when 'streaming' state must be disabled; driver | 217 | * @stop_streaming: called when 'streaming' state must be disabled; driver |
205 | * should stop any DMA transactions or wait until they | 218 | * should stop any DMA transactions or wait until they |
206 | * finish and give back all buffers it got from buf_queue() | 219 | * finish and give back all buffers it got from buf_queue() |
207 | * callback; may use vb2_wait_for_all_buffers() function | 220 | * callback; may use vb2_wait_for_all_buffers() function |
208 | * @buf_queue: passes buffer vb to the driver; driver may start | 221 | * @buf_queue: passes buffer vb to the driver; driver may start |
209 | * hardware operation on this buffer; driver should give | 222 | * hardware operation on this buffer; driver should give |
210 | * the buffer back by calling vb2_buffer_done() function | 223 | * the buffer back by calling vb2_buffer_done() function; |
224 | * it is allways called after calling STREAMON ioctl; | ||
225 | * might be called before start_streaming callback if user | ||
226 | * pre-queued buffers before calling STREAMON | ||
211 | */ | 227 | */ |
212 | struct vb2_ops { | 228 | struct vb2_ops { |
213 | int (*queue_setup)(struct vb2_queue *q, unsigned int *num_buffers, | 229 | int (*queue_setup)(struct vb2_queue *q, const struct v4l2_format *fmt, |
214 | unsigned int *num_planes, unsigned long sizes[], | 230 | unsigned int *num_buffers, unsigned int *num_planes, |
215 | void *alloc_ctxs[]); | 231 | unsigned int sizes[], void *alloc_ctxs[]); |
216 | 232 | ||
217 | void (*wait_prepare)(struct vb2_queue *q); | 233 | void (*wait_prepare)(struct vb2_queue *q); |
218 | void (*wait_finish)(struct vb2_queue *q); | 234 | void (*wait_finish)(struct vb2_queue *q); |
@@ -222,7 +238,7 @@ struct vb2_ops { | |||
222 | int (*buf_finish)(struct vb2_buffer *vb); | 238 | int (*buf_finish)(struct vb2_buffer *vb); |
223 | void (*buf_cleanup)(struct vb2_buffer *vb); | 239 | void (*buf_cleanup)(struct vb2_buffer *vb); |
224 | 240 | ||
225 | int (*start_streaming)(struct vb2_queue *q); | 241 | int (*start_streaming)(struct vb2_queue *q, unsigned int count); |
226 | int (*stop_streaming)(struct vb2_queue *q); | 242 | int (*stop_streaming)(struct vb2_queue *q); |
227 | 243 | ||
228 | void (*buf_queue)(struct vb2_buffer *vb); | 244 | void (*buf_queue)(struct vb2_buffer *vb); |
@@ -276,6 +292,7 @@ struct vb2_queue { | |||
276 | wait_queue_head_t done_wq; | 292 | wait_queue_head_t done_wq; |
277 | 293 | ||
278 | void *alloc_ctx[VIDEO_MAX_PLANES]; | 294 | void *alloc_ctx[VIDEO_MAX_PLANES]; |
295 | unsigned int plane_sizes[VIDEO_MAX_PLANES]; | ||
279 | 296 | ||
280 | unsigned int streaming:1; | 297 | unsigned int streaming:1; |
281 | 298 | ||
@@ -291,6 +308,9 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q); | |||
291 | int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b); | 308 | int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b); |
292 | int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req); | 309 | int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req); |
293 | 310 | ||
311 | int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create); | ||
312 | int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b); | ||
313 | |||
294 | int vb2_queue_init(struct vb2_queue *q); | 314 | int vb2_queue_init(struct vb2_queue *q); |
295 | 315 | ||
296 | void vb2_queue_release(struct vb2_queue *q); | 316 | void vb2_queue_release(struct vb2_queue *q); |
@@ -302,6 +322,13 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type); | |||
302 | int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type); | 322 | int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type); |
303 | 323 | ||
304 | int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma); | 324 | int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma); |
325 | #ifndef CONFIG_MMU | ||
326 | unsigned long vb2_get_unmapped_area(struct vb2_queue *q, | ||
327 | unsigned long addr, | ||
328 | unsigned long len, | ||
329 | unsigned long pgoff, | ||
330 | unsigned long flags); | ||
331 | #endif | ||
305 | unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait); | 332 | unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait); |
306 | size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, | 333 | size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, |
307 | loff_t *ppos, int nonblock); | 334 | loff_t *ppos, int nonblock); |
diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h index 7e6c68b23773..19ae1e350567 100644 --- a/include/media/videobuf2-dma-contig.h +++ b/include/media/videobuf2-dma-contig.h | |||
@@ -17,11 +17,11 @@ | |||
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | 18 | ||
19 | static inline dma_addr_t | 19 | static inline dma_addr_t |
20 | vb2_dma_contig_plane_paddr(struct vb2_buffer *vb, unsigned int plane_no) | 20 | vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no) |
21 | { | 21 | { |
22 | dma_addr_t *paddr = vb2_plane_cookie(vb, plane_no); | 22 | dma_addr_t *addr = vb2_plane_cookie(vb, plane_no); |
23 | 23 | ||
24 | return *paddr; | 24 | return *addr; |
25 | } | 25 | } |
26 | 26 | ||
27 | void *vb2_dma_contig_init_ctx(struct device *dev); | 27 | void *vb2_dma_contig_init_ctx(struct device *dev); |
diff --git a/include/misc/altera.h b/include/misc/altera.h new file mode 100644 index 000000000000..94c0c6181daf --- /dev/null +++ b/include/misc/altera.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * altera.h | ||
3 | * | ||
4 | * altera FPGA driver | ||
5 | * | ||
6 | * Copyright (C) Altera Corporation 1998-2001 | ||
7 | * Copyright (C) 2010 NetUP Inc. | ||
8 | * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | #ifndef _ALTERA_H_ | ||
27 | #define _ALTERA_H_ | ||
28 | |||
29 | struct altera_config { | ||
30 | void *dev; | ||
31 | u8 *action; | ||
32 | int (*jtag_io) (void *dev, int tms, int tdi, int tdo); | ||
33 | }; | ||
34 | |||
35 | #if defined(CONFIG_ALTERA_STAPL) || \ | ||
36 | (defined(CONFIG_ALTERA_STAPL_MODULE) && defined(MODULE)) | ||
37 | |||
38 | extern int altera_init(struct altera_config *config, const struct firmware *fw); | ||
39 | #else | ||
40 | |||
41 | static inline int altera_init(struct altera_config *config, | ||
42 | const struct firmware *fw) | ||
43 | { | ||
44 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | ||
45 | return 0; | ||
46 | } | ||
47 | #endif /* CONFIG_ALTERA_STAPL */ | ||
48 | |||
49 | #endif /* _ALTERA_H_ */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index e727555d4ee9..e86af08293a8 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -77,7 +77,7 @@ struct bt_power { | |||
77 | #define BT_POWER_FORCE_ACTIVE_OFF 0 | 77 | #define BT_POWER_FORCE_ACTIVE_OFF 0 |
78 | #define BT_POWER_FORCE_ACTIVE_ON 1 | 78 | #define BT_POWER_FORCE_ACTIVE_ON 1 |
79 | 79 | ||
80 | __attribute__((format (printf, 2, 3))) | 80 | __printf(2, 3) |
81 | int bt_printk(const char *level, const char *fmt, ...); | 81 | int bt_printk(const char *level, const char *fmt, ...); |
82 | 82 | ||
83 | #define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg) | 83 | #define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg) |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 8fa4430f99c1..05b08c926ade 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -425,9 +425,9 @@ struct ip_vs_protocol { | |||
425 | 425 | ||
426 | const char *(*state_name)(int state); | 426 | const char *(*state_name)(int state); |
427 | 427 | ||
428 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 428 | void (*state_transition)(struct ip_vs_conn *cp, int direction, |
429 | const struct sk_buff *skb, | 429 | const struct sk_buff *skb, |
430 | struct ip_vs_proto_data *pd); | 430 | struct ip_vs_proto_data *pd); |
431 | 431 | ||
432 | int (*register_app)(struct net *net, struct ip_vs_app *inc); | 432 | int (*register_app)(struct net *net, struct ip_vs_app *inc); |
433 | 433 | ||
@@ -1378,7 +1378,7 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) | |||
1378 | 1378 | ||
1379 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, | 1379 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, |
1380 | int outin); | 1380 | int outin); |
1381 | extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp); | 1381 | extern int ip_vs_confirm_conntrack(struct sk_buff *skb); |
1382 | extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, | 1382 | extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, |
1383 | struct ip_vs_conn *cp, u_int8_t proto, | 1383 | struct ip_vs_conn *cp, u_int8_t proto, |
1384 | const __be16 port, int from_rs); | 1384 | const __be16 port, int from_rs); |
@@ -1396,8 +1396,7 @@ static inline void ip_vs_update_conntrack(struct sk_buff *skb, | |||
1396 | { | 1396 | { |
1397 | } | 1397 | } |
1398 | 1398 | ||
1399 | static inline int ip_vs_confirm_conntrack(struct sk_buff *skb, | 1399 | static inline int ip_vs_confirm_conntrack(struct sk_buff *skb) |
1400 | struct ip_vs_conn *cp) | ||
1401 | { | 1400 | { |
1402 | return NF_ACCEPT; | 1401 | return NF_ACCEPT; |
1403 | } | 1402 | } |
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 7ca6bdd5bae6..2f8fb77bfdd1 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/netfilter/x_tables.h> | 13 | #include <linux/netfilter/x_tables.h> |
14 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 14 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
15 | #include <linux/netfilter_ipv4/nf_nat.h> | ||
15 | #include <linux/list_nulls.h> | 16 | #include <linux/list_nulls.h> |
16 | 17 | ||
17 | /* A `tuple' is a structure containing the information to uniquely | 18 | /* A `tuple' is a structure containing the information to uniquely |
@@ -24,32 +25,6 @@ | |||
24 | 25 | ||
25 | #define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) | 26 | #define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) |
26 | 27 | ||
27 | /* The protocol-specific manipulable parts of the tuple: always in | ||
28 | network order! */ | ||
29 | union nf_conntrack_man_proto { | ||
30 | /* Add other protocols here. */ | ||
31 | __be16 all; | ||
32 | |||
33 | struct { | ||
34 | __be16 port; | ||
35 | } tcp; | ||
36 | struct { | ||
37 | __be16 port; | ||
38 | } udp; | ||
39 | struct { | ||
40 | __be16 id; | ||
41 | } icmp; | ||
42 | struct { | ||
43 | __be16 port; | ||
44 | } dccp; | ||
45 | struct { | ||
46 | __be16 port; | ||
47 | } sctp; | ||
48 | struct { | ||
49 | __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ | ||
50 | } gre; | ||
51 | }; | ||
52 | |||
53 | /* The manipulable part of the tuple. */ | 28 | /* The manipulable part of the tuple. */ |
54 | struct nf_conntrack_man { | 29 | struct nf_conntrack_man { |
55 | union nf_inet_addr u3; | 30 | union nf_inet_addr u3; |
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h index 920997f1aff0..e991bd0a27af 100644 --- a/include/net/netfilter/nf_log.h +++ b/include/net/netfilter/nf_log.h | |||
@@ -53,12 +53,13 @@ int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger); | |||
53 | void nf_log_unbind_pf(u_int8_t pf); | 53 | void nf_log_unbind_pf(u_int8_t pf); |
54 | 54 | ||
55 | /* Calls the registered backend logging function */ | 55 | /* Calls the registered backend logging function */ |
56 | __printf(7, 8) | ||
56 | void nf_log_packet(u_int8_t pf, | 57 | void nf_log_packet(u_int8_t pf, |
57 | unsigned int hooknum, | 58 | unsigned int hooknum, |
58 | const struct sk_buff *skb, | 59 | const struct sk_buff *skb, |
59 | const struct net_device *in, | 60 | const struct net_device *in, |
60 | const struct net_device *out, | 61 | const struct net_device *out, |
61 | const struct nf_loginfo *li, | 62 | const struct nf_loginfo *li, |
62 | const char *fmt, ...) __attribute__ ((format(printf,7,8))); | 63 | const char *fmt, ...); |
63 | 64 | ||
64 | #endif /* _NF_LOG_H */ | 65 | #endif /* _NF_LOG_H */ |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index 0346b0070864..b8872df7285f 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _NF_NAT_H | 1 | #ifndef _NF_NAT_H |
2 | #define _NF_NAT_H | 2 | #define _NF_NAT_H |
3 | #include <linux/netfilter_ipv4.h> | 3 | #include <linux/netfilter_ipv4.h> |
4 | #include <linux/netfilter_ipv4/nf_nat.h> | ||
4 | #include <net/netfilter/nf_conntrack_tuple.h> | 5 | #include <net/netfilter/nf_conntrack_tuple.h> |
5 | 6 | ||
6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 | 7 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 |
@@ -14,11 +15,6 @@ enum nf_nat_manip_type { | |||
14 | #define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ | 15 | #define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ |
15 | (hooknum) != NF_INET_LOCAL_IN) | 16 | (hooknum) != NF_INET_LOCAL_IN) |
16 | 17 | ||
17 | #define IP_NAT_RANGE_MAP_IPS 1 | ||
18 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | ||
19 | #define IP_NAT_RANGE_PROTO_RANDOM 4 | ||
20 | #define IP_NAT_RANGE_PERSISTENT 8 | ||
21 | |||
22 | /* NAT sequence number modifications */ | 18 | /* NAT sequence number modifications */ |
23 | struct nf_nat_seq { | 19 | struct nf_nat_seq { |
24 | /* position of the last TCP sequence number modification (if any) */ | 20 | /* position of the last TCP sequence number modification (if any) */ |
@@ -28,26 +24,6 @@ struct nf_nat_seq { | |||
28 | int16_t offset_before, offset_after; | 24 | int16_t offset_before, offset_after; |
29 | }; | 25 | }; |
30 | 26 | ||
31 | /* Single range specification. */ | ||
32 | struct nf_nat_range { | ||
33 | /* Set to OR of flags above. */ | ||
34 | unsigned int flags; | ||
35 | |||
36 | /* Inclusive: network order. */ | ||
37 | __be32 min_ip, max_ip; | ||
38 | |||
39 | /* Inclusive: network order */ | ||
40 | union nf_conntrack_man_proto min, max; | ||
41 | }; | ||
42 | |||
43 | /* For backwards compat: don't use in modern code. */ | ||
44 | struct nf_nat_multi_range_compat { | ||
45 | unsigned int rangesize; /* Must be 1. */ | ||
46 | |||
47 | /* hangs off end. */ | ||
48 | struct nf_nat_range range[1]; | ||
49 | }; | ||
50 | |||
51 | #include <linux/list.h> | 27 | #include <linux/list.h> |
52 | #include <linux/netfilter/nf_conntrack_pptp.h> | 28 | #include <linux/netfilter/nf_conntrack_pptp.h> |
53 | #include <net/netfilter/nf_conntrack_extend.h> | 29 | #include <net/netfilter/nf_conntrack_extend.h> |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 98c185441bee..cb1f3504687f 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -192,8 +192,15 @@ enum { | |||
192 | * NLA_NUL_STRING Maximum length of string (excluding NUL) | 192 | * NLA_NUL_STRING Maximum length of string (excluding NUL) |
193 | * NLA_FLAG Unused | 193 | * NLA_FLAG Unused |
194 | * NLA_BINARY Maximum length of attribute payload | 194 | * NLA_BINARY Maximum length of attribute payload |
195 | * NLA_NESTED_COMPAT Exact length of structure payload | 195 | * NLA_NESTED Don't use `len' field -- length verification is |
196 | * All other Exact length of attribute payload | 196 | * done by checking len of nested header (or empty) |
197 | * NLA_NESTED_COMPAT Minimum length of structure payload | ||
198 | * NLA_U8, NLA_U16, | ||
199 | * NLA_U32, NLA_U64, | ||
200 | * NLA_MSECS Leaving the length field zero will verify the | ||
201 | * given type fits, using it verifies minimum length | ||
202 | * just like "All other" | ||
203 | * All other Minimum length of attribute payload | ||
197 | * | 204 | * |
198 | * Example: | 205 | * Example: |
199 | * static const struct nla_policy my_policy[ATTR_MAX+1] = { | 206 | * static const struct nla_policy my_policy[ATTR_MAX+1] = { |
diff --git a/include/net/sock.h b/include/net/sock.h index 5ac682f73d63..c6658bef7f32 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -76,8 +76,8 @@ | |||
76 | printk(KERN_DEBUG msg); } while (0) | 76 | printk(KERN_DEBUG msg); } while (0) |
77 | #else | 77 | #else |
78 | /* Validate arguments and do nothing */ | 78 | /* Validate arguments and do nothing */ |
79 | static inline void __attribute__ ((format (printf, 2, 3))) | 79 | static inline __printf(2, 3) |
80 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) | 80 | void SOCK_DEBUG(struct sock *sk, const char *msg, ...) |
81 | { | 81 | { |
82 | } | 82 | } |
83 | #endif | 83 | #endif |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e147f42d643d..bb18c4d69aba 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1403,11 +1403,13 @@ enum tcp_seq_states { | |||
1403 | TCP_SEQ_STATE_TIME_WAIT, | 1403 | TCP_SEQ_STATE_TIME_WAIT, |
1404 | }; | 1404 | }; |
1405 | 1405 | ||
1406 | int tcp_seq_open(struct inode *inode, struct file *file); | ||
1407 | |||
1406 | struct tcp_seq_afinfo { | 1408 | struct tcp_seq_afinfo { |
1407 | char *name; | 1409 | char *name; |
1408 | sa_family_t family; | 1410 | sa_family_t family; |
1409 | struct file_operations seq_fops; | 1411 | const struct file_operations *seq_fops; |
1410 | struct seq_operations seq_ops; | 1412 | struct seq_operations seq_ops; |
1411 | }; | 1413 | }; |
1412 | 1414 | ||
1413 | struct tcp_iter_state { | 1415 | struct tcp_iter_state { |
diff --git a/include/net/udp.h b/include/net/udp.h index 67ea6fcb3ec0..3b285f402f48 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -230,12 +230,14 @@ extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *sadd | |||
230 | #endif | 230 | #endif |
231 | 231 | ||
232 | /* /proc */ | 232 | /* /proc */ |
233 | int udp_seq_open(struct inode *inode, struct file *file); | ||
234 | |||
233 | struct udp_seq_afinfo { | 235 | struct udp_seq_afinfo { |
234 | char *name; | 236 | char *name; |
235 | sa_family_t family; | 237 | sa_family_t family; |
236 | struct udp_table *udp_table; | 238 | struct udp_table *udp_table; |
237 | struct file_operations seq_fops; | 239 | const struct file_operations *seq_fops; |
238 | struct seq_operations seq_ops; | 240 | struct seq_operations seq_ops; |
239 | }; | 241 | }; |
240 | 242 | ||
241 | struct udp_iter_state { | 243 | struct udp_iter_state { |
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index fe5b05177a2c..81aba3a73aa3 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -81,7 +81,11 @@ enum { | |||
81 | IB_USER_VERBS_CMD_MODIFY_SRQ, | 81 | IB_USER_VERBS_CMD_MODIFY_SRQ, |
82 | IB_USER_VERBS_CMD_QUERY_SRQ, | 82 | IB_USER_VERBS_CMD_QUERY_SRQ, |
83 | IB_USER_VERBS_CMD_DESTROY_SRQ, | 83 | IB_USER_VERBS_CMD_DESTROY_SRQ, |
84 | IB_USER_VERBS_CMD_POST_SRQ_RECV | 84 | IB_USER_VERBS_CMD_POST_SRQ_RECV, |
85 | IB_USER_VERBS_CMD_OPEN_XRCD, | ||
86 | IB_USER_VERBS_CMD_CLOSE_XRCD, | ||
87 | IB_USER_VERBS_CMD_CREATE_XSRQ, | ||
88 | IB_USER_VERBS_CMD_OPEN_QP | ||
85 | }; | 89 | }; |
86 | 90 | ||
87 | /* | 91 | /* |
@@ -222,6 +226,21 @@ struct ib_uverbs_dealloc_pd { | |||
222 | __u32 pd_handle; | 226 | __u32 pd_handle; |
223 | }; | 227 | }; |
224 | 228 | ||
229 | struct ib_uverbs_open_xrcd { | ||
230 | __u64 response; | ||
231 | __u32 fd; | ||
232 | __u32 oflags; | ||
233 | __u64 driver_data[0]; | ||
234 | }; | ||
235 | |||
236 | struct ib_uverbs_open_xrcd_resp { | ||
237 | __u32 xrcd_handle; | ||
238 | }; | ||
239 | |||
240 | struct ib_uverbs_close_xrcd { | ||
241 | __u32 xrcd_handle; | ||
242 | }; | ||
243 | |||
225 | struct ib_uverbs_reg_mr { | 244 | struct ib_uverbs_reg_mr { |
226 | __u64 response; | 245 | __u64 response; |
227 | __u64 start; | 246 | __u64 start; |
@@ -404,6 +423,17 @@ struct ib_uverbs_create_qp { | |||
404 | __u64 driver_data[0]; | 423 | __u64 driver_data[0]; |
405 | }; | 424 | }; |
406 | 425 | ||
426 | struct ib_uverbs_open_qp { | ||
427 | __u64 response; | ||
428 | __u64 user_handle; | ||
429 | __u32 pd_handle; | ||
430 | __u32 qpn; | ||
431 | __u8 qp_type; | ||
432 | __u8 reserved[7]; | ||
433 | __u64 driver_data[0]; | ||
434 | }; | ||
435 | |||
436 | /* also used for open response */ | ||
407 | struct ib_uverbs_create_qp_resp { | 437 | struct ib_uverbs_create_qp_resp { |
408 | __u32 qp_handle; | 438 | __u32 qp_handle; |
409 | __u32 qpn; | 439 | __u32 qpn; |
@@ -648,11 +678,25 @@ struct ib_uverbs_create_srq { | |||
648 | __u64 driver_data[0]; | 678 | __u64 driver_data[0]; |
649 | }; | 679 | }; |
650 | 680 | ||
681 | struct ib_uverbs_create_xsrq { | ||
682 | __u64 response; | ||
683 | __u64 user_handle; | ||
684 | __u32 srq_type; | ||
685 | __u32 pd_handle; | ||
686 | __u32 max_wr; | ||
687 | __u32 max_sge; | ||
688 | __u32 srq_limit; | ||
689 | __u32 reserved; | ||
690 | __u32 xrcd_handle; | ||
691 | __u32 cq_handle; | ||
692 | __u64 driver_data[0]; | ||
693 | }; | ||
694 | |||
651 | struct ib_uverbs_create_srq_resp { | 695 | struct ib_uverbs_create_srq_resp { |
652 | __u32 srq_handle; | 696 | __u32 srq_handle; |
653 | __u32 max_wr; | 697 | __u32 max_wr; |
654 | __u32 max_sge; | 698 | __u32 max_sge; |
655 | __u32 reserved; | 699 | __u32 srqn; |
656 | }; | 700 | }; |
657 | 701 | ||
658 | struct ib_uverbs_modify_srq { | 702 | struct ib_uverbs_modify_srq { |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 228be3e220d9..bf5daafe8ecc 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -112,6 +112,7 @@ enum ib_device_cap_flags { | |||
112 | */ | 112 | */ |
113 | IB_DEVICE_UD_IP_CSUM = (1<<18), | 113 | IB_DEVICE_UD_IP_CSUM = (1<<18), |
114 | IB_DEVICE_UD_TSO = (1<<19), | 114 | IB_DEVICE_UD_TSO = (1<<19), |
115 | IB_DEVICE_XRC = (1<<20), | ||
115 | IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), | 116 | IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), |
116 | IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), | 117 | IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), |
117 | }; | 118 | }; |
@@ -207,6 +208,7 @@ enum ib_port_cap_flags { | |||
207 | IB_PORT_SM_DISABLED = 1 << 10, | 208 | IB_PORT_SM_DISABLED = 1 << 10, |
208 | IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11, | 209 | IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11, |
209 | IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12, | 210 | IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12, |
211 | IB_PORT_EXTENDED_SPEEDS_SUP = 1 << 14, | ||
210 | IB_PORT_CM_SUP = 1 << 16, | 212 | IB_PORT_CM_SUP = 1 << 16, |
211 | IB_PORT_SNMP_TUNNEL_SUP = 1 << 17, | 213 | IB_PORT_SNMP_TUNNEL_SUP = 1 << 17, |
212 | IB_PORT_REINIT_SUP = 1 << 18, | 214 | IB_PORT_REINIT_SUP = 1 << 18, |
@@ -415,7 +417,15 @@ enum ib_rate { | |||
415 | IB_RATE_40_GBPS = 7, | 417 | IB_RATE_40_GBPS = 7, |
416 | IB_RATE_60_GBPS = 8, | 418 | IB_RATE_60_GBPS = 8, |
417 | IB_RATE_80_GBPS = 9, | 419 | IB_RATE_80_GBPS = 9, |
418 | IB_RATE_120_GBPS = 10 | 420 | IB_RATE_120_GBPS = 10, |
421 | IB_RATE_14_GBPS = 11, | ||
422 | IB_RATE_56_GBPS = 12, | ||
423 | IB_RATE_112_GBPS = 13, | ||
424 | IB_RATE_168_GBPS = 14, | ||
425 | IB_RATE_25_GBPS = 15, | ||
426 | IB_RATE_100_GBPS = 16, | ||
427 | IB_RATE_200_GBPS = 17, | ||
428 | IB_RATE_300_GBPS = 18 | ||
419 | }; | 429 | }; |
420 | 430 | ||
421 | /** | 431 | /** |
@@ -427,6 +437,13 @@ enum ib_rate { | |||
427 | int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; | 437 | int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; |
428 | 438 | ||
429 | /** | 439 | /** |
440 | * ib_rate_to_mbps - Convert the IB rate enum to Mbps. | ||
441 | * For example, IB_RATE_2_5_GBPS will be converted to 2500. | ||
442 | * @rate: rate to convert. | ||
443 | */ | ||
444 | int ib_rate_to_mbps(enum ib_rate rate) __attribute_const__; | ||
445 | |||
446 | /** | ||
430 | * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate | 447 | * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate |
431 | * enum. | 448 | * enum. |
432 | * @mult: multiple to convert. | 449 | * @mult: multiple to convert. |
@@ -522,6 +539,11 @@ enum ib_cq_notify_flags { | |||
522 | IB_CQ_REPORT_MISSED_EVENTS = 1 << 2, | 539 | IB_CQ_REPORT_MISSED_EVENTS = 1 << 2, |
523 | }; | 540 | }; |
524 | 541 | ||
542 | enum ib_srq_type { | ||
543 | IB_SRQT_BASIC, | ||
544 | IB_SRQT_XRC | ||
545 | }; | ||
546 | |||
525 | enum ib_srq_attr_mask { | 547 | enum ib_srq_attr_mask { |
526 | IB_SRQ_MAX_WR = 1 << 0, | 548 | IB_SRQ_MAX_WR = 1 << 0, |
527 | IB_SRQ_LIMIT = 1 << 1, | 549 | IB_SRQ_LIMIT = 1 << 1, |
@@ -537,6 +559,14 @@ struct ib_srq_init_attr { | |||
537 | void (*event_handler)(struct ib_event *, void *); | 559 | void (*event_handler)(struct ib_event *, void *); |
538 | void *srq_context; | 560 | void *srq_context; |
539 | struct ib_srq_attr attr; | 561 | struct ib_srq_attr attr; |
562 | enum ib_srq_type srq_type; | ||
563 | |||
564 | union { | ||
565 | struct { | ||
566 | struct ib_xrcd *xrcd; | ||
567 | struct ib_cq *cq; | ||
568 | } xrc; | ||
569 | } ext; | ||
540 | }; | 570 | }; |
541 | 571 | ||
542 | struct ib_qp_cap { | 572 | struct ib_qp_cap { |
@@ -565,7 +595,11 @@ enum ib_qp_type { | |||
565 | IB_QPT_UC, | 595 | IB_QPT_UC, |
566 | IB_QPT_UD, | 596 | IB_QPT_UD, |
567 | IB_QPT_RAW_IPV6, | 597 | IB_QPT_RAW_IPV6, |
568 | IB_QPT_RAW_ETHERTYPE | 598 | IB_QPT_RAW_ETHERTYPE, |
599 | /* Save 8 for RAW_PACKET */ | ||
600 | IB_QPT_XRC_INI = 9, | ||
601 | IB_QPT_XRC_TGT, | ||
602 | IB_QPT_MAX | ||
569 | }; | 603 | }; |
570 | 604 | ||
571 | enum ib_qp_create_flags { | 605 | enum ib_qp_create_flags { |
@@ -579,6 +613,7 @@ struct ib_qp_init_attr { | |||
579 | struct ib_cq *send_cq; | 613 | struct ib_cq *send_cq; |
580 | struct ib_cq *recv_cq; | 614 | struct ib_cq *recv_cq; |
581 | struct ib_srq *srq; | 615 | struct ib_srq *srq; |
616 | struct ib_xrcd *xrcd; /* XRC TGT QPs only */ | ||
582 | struct ib_qp_cap cap; | 617 | struct ib_qp_cap cap; |
583 | enum ib_sig_type sq_sig_type; | 618 | enum ib_sig_type sq_sig_type; |
584 | enum ib_qp_type qp_type; | 619 | enum ib_qp_type qp_type; |
@@ -586,6 +621,13 @@ struct ib_qp_init_attr { | |||
586 | u8 port_num; /* special QP types only */ | 621 | u8 port_num; /* special QP types only */ |
587 | }; | 622 | }; |
588 | 623 | ||
624 | struct ib_qp_open_attr { | ||
625 | void (*event_handler)(struct ib_event *, void *); | ||
626 | void *qp_context; | ||
627 | u32 qp_num; | ||
628 | enum ib_qp_type qp_type; | ||
629 | }; | ||
630 | |||
589 | enum ib_rnr_timeout { | 631 | enum ib_rnr_timeout { |
590 | IB_RNR_TIMER_655_36 = 0, | 632 | IB_RNR_TIMER_655_36 = 0, |
591 | IB_RNR_TIMER_000_01 = 1, | 633 | IB_RNR_TIMER_000_01 = 1, |
@@ -770,6 +812,7 @@ struct ib_send_wr { | |||
770 | u32 rkey; | 812 | u32 rkey; |
771 | } fast_reg; | 813 | } fast_reg; |
772 | } wr; | 814 | } wr; |
815 | u32 xrc_remote_srq_num; /* XRC TGT QPs only */ | ||
773 | }; | 816 | }; |
774 | 817 | ||
775 | struct ib_recv_wr { | 818 | struct ib_recv_wr { |
@@ -831,6 +874,7 @@ struct ib_ucontext { | |||
831 | struct list_head qp_list; | 874 | struct list_head qp_list; |
832 | struct list_head srq_list; | 875 | struct list_head srq_list; |
833 | struct list_head ah_list; | 876 | struct list_head ah_list; |
877 | struct list_head xrcd_list; | ||
834 | int closing; | 878 | int closing; |
835 | }; | 879 | }; |
836 | 880 | ||
@@ -858,6 +902,15 @@ struct ib_pd { | |||
858 | atomic_t usecnt; /* count all resources */ | 902 | atomic_t usecnt; /* count all resources */ |
859 | }; | 903 | }; |
860 | 904 | ||
905 | struct ib_xrcd { | ||
906 | struct ib_device *device; | ||
907 | atomic_t usecnt; /* count all exposed resources */ | ||
908 | struct inode *inode; | ||
909 | |||
910 | struct mutex tgt_qp_mutex; | ||
911 | struct list_head tgt_qp_list; | ||
912 | }; | ||
913 | |||
861 | struct ib_ah { | 914 | struct ib_ah { |
862 | struct ib_device *device; | 915 | struct ib_device *device; |
863 | struct ib_pd *pd; | 916 | struct ib_pd *pd; |
@@ -882,7 +935,16 @@ struct ib_srq { | |||
882 | struct ib_uobject *uobject; | 935 | struct ib_uobject *uobject; |
883 | void (*event_handler)(struct ib_event *, void *); | 936 | void (*event_handler)(struct ib_event *, void *); |
884 | void *srq_context; | 937 | void *srq_context; |
938 | enum ib_srq_type srq_type; | ||
885 | atomic_t usecnt; | 939 | atomic_t usecnt; |
940 | |||
941 | union { | ||
942 | struct { | ||
943 | struct ib_xrcd *xrcd; | ||
944 | struct ib_cq *cq; | ||
945 | u32 srq_num; | ||
946 | } xrc; | ||
947 | } ext; | ||
886 | }; | 948 | }; |
887 | 949 | ||
888 | struct ib_qp { | 950 | struct ib_qp { |
@@ -891,6 +953,11 @@ struct ib_qp { | |||
891 | struct ib_cq *send_cq; | 953 | struct ib_cq *send_cq; |
892 | struct ib_cq *recv_cq; | 954 | struct ib_cq *recv_cq; |
893 | struct ib_srq *srq; | 955 | struct ib_srq *srq; |
956 | struct ib_xrcd *xrcd; /* XRC TGT QPs only */ | ||
957 | struct list_head xrcd_list; | ||
958 | atomic_t usecnt; /* count times opened */ | ||
959 | struct list_head open_list; | ||
960 | struct ib_qp *real_qp; | ||
894 | struct ib_uobject *uobject; | 961 | struct ib_uobject *uobject; |
895 | void (*event_handler)(struct ib_event *, void *); | 962 | void (*event_handler)(struct ib_event *, void *); |
896 | void *qp_context; | 963 | void *qp_context; |
@@ -1149,6 +1216,10 @@ struct ib_device { | |||
1149 | struct ib_grh *in_grh, | 1216 | struct ib_grh *in_grh, |
1150 | struct ib_mad *in_mad, | 1217 | struct ib_mad *in_mad, |
1151 | struct ib_mad *out_mad); | 1218 | struct ib_mad *out_mad); |
1219 | struct ib_xrcd * (*alloc_xrcd)(struct ib_device *device, | ||
1220 | struct ib_ucontext *ucontext, | ||
1221 | struct ib_udata *udata); | ||
1222 | int (*dealloc_xrcd)(struct ib_xrcd *xrcd); | ||
1152 | 1223 | ||
1153 | struct ib_dma_mapping_ops *dma_ops; | 1224 | struct ib_dma_mapping_ops *dma_ops; |
1154 | 1225 | ||
@@ -1443,6 +1514,25 @@ int ib_query_qp(struct ib_qp *qp, | |||
1443 | int ib_destroy_qp(struct ib_qp *qp); | 1514 | int ib_destroy_qp(struct ib_qp *qp); |
1444 | 1515 | ||
1445 | /** | 1516 | /** |
1517 | * ib_open_qp - Obtain a reference to an existing sharable QP. | ||
1518 | * @xrcd - XRC domain | ||
1519 | * @qp_open_attr: Attributes identifying the QP to open. | ||
1520 | * | ||
1521 | * Returns a reference to a sharable QP. | ||
1522 | */ | ||
1523 | struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd, | ||
1524 | struct ib_qp_open_attr *qp_open_attr); | ||
1525 | |||
1526 | /** | ||
1527 | * ib_close_qp - Release an external reference to a QP. | ||
1528 | * @qp: The QP handle to release | ||
1529 | * | ||
1530 | * The opened QP handle is released by the caller. The underlying | ||
1531 | * shared QP is not destroyed until all internal references are released. | ||
1532 | */ | ||
1533 | int ib_close_qp(struct ib_qp *qp); | ||
1534 | |||
1535 | /** | ||
1446 | * ib_post_send - Posts a list of work requests to the send queue of | 1536 | * ib_post_send - Posts a list of work requests to the send queue of |
1447 | * the specified QP. | 1537 | * the specified QP. |
1448 | * @qp: The QP to post the work request on. | 1538 | * @qp: The QP to post the work request on. |
@@ -2060,4 +2150,16 @@ int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid); | |||
2060 | */ | 2150 | */ |
2061 | int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid); | 2151 | int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid); |
2062 | 2152 | ||
2153 | /** | ||
2154 | * ib_alloc_xrcd - Allocates an XRC domain. | ||
2155 | * @device: The device on which to allocate the XRC domain. | ||
2156 | */ | ||
2157 | struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device); | ||
2158 | |||
2159 | /** | ||
2160 | * ib_dealloc_xrcd - Deallocates an XRC domain. | ||
2161 | * @xrcd: The XRC domain to deallocate. | ||
2162 | */ | ||
2163 | int ib_dealloc_xrcd(struct ib_xrcd *xrcd); | ||
2164 | |||
2063 | #endif /* IB_VERBS_H */ | 2165 | #endif /* IB_VERBS_H */ |
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h index 2d0191c90f9e..1a046b1595cc 100644 --- a/include/rdma/iw_cm.h +++ b/include/rdma/iw_cm.h | |||
@@ -52,8 +52,10 @@ struct iw_cm_event { | |||
52 | struct sockaddr_in local_addr; | 52 | struct sockaddr_in local_addr; |
53 | struct sockaddr_in remote_addr; | 53 | struct sockaddr_in remote_addr; |
54 | void *private_data; | 54 | void *private_data; |
55 | u8 private_data_len; | ||
56 | void *provider_data; | 55 | void *provider_data; |
56 | u8 private_data_len; | ||
57 | u8 ord; | ||
58 | u8 ird; | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | /** | 61 | /** |
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index 26977c149c41..51988f808181 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h | |||
@@ -65,6 +65,7 @@ enum rdma_cm_event_type { | |||
65 | enum rdma_port_space { | 65 | enum rdma_port_space { |
66 | RDMA_PS_SDP = 0x0001, | 66 | RDMA_PS_SDP = 0x0001, |
67 | RDMA_PS_IPOIB = 0x0002, | 67 | RDMA_PS_IPOIB = 0x0002, |
68 | RDMA_PS_IB = 0x013F, | ||
68 | RDMA_PS_TCP = 0x0106, | 69 | RDMA_PS_TCP = 0x0106, |
69 | RDMA_PS_UDP = 0x0111, | 70 | RDMA_PS_UDP = 0x0111, |
70 | }; | 71 | }; |
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h index fc82c1896f75..5348a000c8f3 100644 --- a/include/rdma/rdma_user_cm.h +++ b/include/rdma/rdma_user_cm.h | |||
@@ -77,7 +77,8 @@ struct rdma_ucm_create_id { | |||
77 | __u64 uid; | 77 | __u64 uid; |
78 | __u64 response; | 78 | __u64 response; |
79 | __u16 ps; | 79 | __u16 ps; |
80 | __u8 reserved[6]; | 80 | __u8 qp_type; |
81 | __u8 reserved[5]; | ||
81 | }; | 82 | }; |
82 | 83 | ||
83 | struct rdma_ucm_create_id_resp { | 84 | struct rdma_ucm_create_id_resp { |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index ddb04568a509..2703e3bedbf5 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -59,6 +59,7 @@ enum iscsi_uevent_e { | |||
59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, | 59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, |
60 | 60 | ||
61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, | 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, |
62 | ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, | ||
62 | 63 | ||
63 | /* up events */ | 64 | /* up events */ |
64 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 65 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
@@ -70,6 +71,7 @@ enum iscsi_uevent_e { | |||
70 | 71 | ||
71 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, | 72 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, |
72 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, | 73 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, |
74 | ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9, | ||
73 | }; | 75 | }; |
74 | 76 | ||
75 | enum iscsi_tgt_dscvr { | 77 | enum iscsi_tgt_dscvr { |
@@ -172,6 +174,10 @@ struct iscsi_uevent { | |||
172 | struct msg_set_path { | 174 | struct msg_set_path { |
173 | uint32_t host_no; | 175 | uint32_t host_no; |
174 | } set_path; | 176 | } set_path; |
177 | struct msg_set_iface_params { | ||
178 | uint32_t host_no; | ||
179 | uint32_t count; | ||
180 | } set_iface_params; | ||
175 | } u; | 181 | } u; |
176 | union { | 182 | union { |
177 | /* messages k -> u */ | 183 | /* messages k -> u */ |
@@ -193,6 +199,11 @@ struct iscsi_uevent { | |||
193 | uint32_t cid; | 199 | uint32_t cid; |
194 | uint64_t recv_handle; | 200 | uint64_t recv_handle; |
195 | } recv_req; | 201 | } recv_req; |
202 | struct msg_conn_login { | ||
203 | uint32_t sid; | ||
204 | uint32_t cid; | ||
205 | uint32_t state; /* enum iscsi_conn_state */ | ||
206 | } conn_login; | ||
196 | struct msg_conn_error { | 207 | struct msg_conn_error { |
197 | uint32_t sid; | 208 | uint32_t sid; |
198 | uint32_t cid; | 209 | uint32_t cid; |
@@ -214,6 +225,21 @@ struct iscsi_uevent { | |||
214 | } r; | 225 | } r; |
215 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 226 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
216 | 227 | ||
228 | enum iscsi_param_type { | ||
229 | ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */ | ||
230 | ISCSI_HOST_PARAM, /* iscsi_host_param */ | ||
231 | ISCSI_NET_PARAM, /* iscsi_net_param */ | ||
232 | }; | ||
233 | |||
234 | struct iscsi_iface_param_info { | ||
235 | uint32_t iface_num; /* iface number, 0 - n */ | ||
236 | uint32_t len; /* Actual length of the param */ | ||
237 | uint16_t param; /* iscsi param value */ | ||
238 | uint8_t iface_type; /* IPv4 or IPv6 */ | ||
239 | uint8_t param_type; /* iscsi_param_type */ | ||
240 | uint8_t value[0]; /* length sized value follows */ | ||
241 | } __packed; | ||
242 | |||
217 | /* | 243 | /* |
218 | * To keep the struct iscsi_uevent size the same for userspace code | 244 | * To keep the struct iscsi_uevent size the same for userspace code |
219 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and | 245 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and |
@@ -237,6 +263,71 @@ struct iscsi_path { | |||
237 | uint16_t pmtu; | 263 | uint16_t pmtu; |
238 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 264 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
239 | 265 | ||
266 | /* iscsi iface enabled/disabled setting */ | ||
267 | #define ISCSI_IFACE_DISABLE 0x01 | ||
268 | #define ISCSI_IFACE_ENABLE 0x02 | ||
269 | |||
270 | /* ipv4 bootproto */ | ||
271 | #define ISCSI_BOOTPROTO_STATIC 0x01 | ||
272 | #define ISCSI_BOOTPROTO_DHCP 0x02 | ||
273 | |||
274 | /* ipv6 addr autoconfig type */ | ||
275 | #define ISCSI_IPV6_AUTOCFG_DISABLE 0x01 | ||
276 | #define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02 | ||
277 | #define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03 | ||
278 | |||
279 | /* ipv6 link local addr type */ | ||
280 | #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01 | ||
281 | #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02 | ||
282 | |||
283 | /* ipv6 router addr type */ | ||
284 | #define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01 | ||
285 | #define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02 | ||
286 | |||
287 | #define ISCSI_IFACE_TYPE_IPV4 0x01 | ||
288 | #define ISCSI_IFACE_TYPE_IPV6 0x02 | ||
289 | |||
290 | #define ISCSI_MAX_VLAN_ID 4095 | ||
291 | #define ISCSI_MAX_VLAN_PRIORITY 7 | ||
292 | |||
293 | /* iscsi vlan enable/disabled setting */ | ||
294 | #define ISCSI_VLAN_DISABLE 0x01 | ||
295 | #define ISCSI_VLAN_ENABLE 0x02 | ||
296 | |||
297 | /* iSCSI network params */ | ||
298 | enum iscsi_net_param { | ||
299 | ISCSI_NET_PARAM_IPV4_ADDR = 1, | ||
300 | ISCSI_NET_PARAM_IPV4_SUBNET = 2, | ||
301 | ISCSI_NET_PARAM_IPV4_GW = 3, | ||
302 | ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4, | ||
303 | ISCSI_NET_PARAM_MAC = 5, | ||
304 | ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6, | ||
305 | ISCSI_NET_PARAM_IPV6_ADDR = 7, | ||
306 | ISCSI_NET_PARAM_IPV6_ROUTER = 8, | ||
307 | ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9, | ||
308 | ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10, | ||
309 | ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, | ||
310 | ISCSI_NET_PARAM_IFACE_ENABLE = 12, | ||
311 | ISCSI_NET_PARAM_VLAN_ID = 13, | ||
312 | ISCSI_NET_PARAM_VLAN_PRIORITY = 14, | ||
313 | ISCSI_NET_PARAM_VLAN_ENABLED = 15, | ||
314 | ISCSI_NET_PARAM_VLAN_TAG = 16, | ||
315 | ISCSI_NET_PARAM_IFACE_TYPE = 17, | ||
316 | ISCSI_NET_PARAM_IFACE_NAME = 18, | ||
317 | ISCSI_NET_PARAM_MTU = 19, | ||
318 | ISCSI_NET_PARAM_PORT = 20, | ||
319 | }; | ||
320 | |||
321 | enum iscsi_conn_state { | ||
322 | ISCSI_CONN_STATE_FREE, | ||
323 | ISCSI_CONN_STATE_XPT_WAIT, | ||
324 | ISCSI_CONN_STATE_IN_LOGIN, | ||
325 | ISCSI_CONN_STATE_LOGGED_IN, | ||
326 | ISCSI_CONN_STATE_IN_LOGOUT, | ||
327 | ISCSI_CONN_STATE_LOGOUT_REQUESTED, | ||
328 | ISCSI_CONN_STATE_CLEANUP_WAIT, | ||
329 | }; | ||
330 | |||
240 | /* | 331 | /* |
241 | * Common error codes | 332 | * Common error codes |
242 | */ | 333 | */ |
@@ -319,44 +410,6 @@ enum iscsi_param { | |||
319 | ISCSI_PARAM_MAX, | 410 | ISCSI_PARAM_MAX, |
320 | }; | 411 | }; |
321 | 412 | ||
322 | #define ISCSI_MAX_RECV_DLENGTH (1ULL << ISCSI_PARAM_MAX_RECV_DLENGTH) | ||
323 | #define ISCSI_MAX_XMIT_DLENGTH (1ULL << ISCSI_PARAM_MAX_XMIT_DLENGTH) | ||
324 | #define ISCSI_HDRDGST_EN (1ULL << ISCSI_PARAM_HDRDGST_EN) | ||
325 | #define ISCSI_DATADGST_EN (1ULL << ISCSI_PARAM_DATADGST_EN) | ||
326 | #define ISCSI_INITIAL_R2T_EN (1ULL << ISCSI_PARAM_INITIAL_R2T_EN) | ||
327 | #define ISCSI_MAX_R2T (1ULL << ISCSI_PARAM_MAX_R2T) | ||
328 | #define ISCSI_IMM_DATA_EN (1ULL << ISCSI_PARAM_IMM_DATA_EN) | ||
329 | #define ISCSI_FIRST_BURST (1ULL << ISCSI_PARAM_FIRST_BURST) | ||
330 | #define ISCSI_MAX_BURST (1ULL << ISCSI_PARAM_MAX_BURST) | ||
331 | #define ISCSI_PDU_INORDER_EN (1ULL << ISCSI_PARAM_PDU_INORDER_EN) | ||
332 | #define ISCSI_DATASEQ_INORDER_EN (1ULL << ISCSI_PARAM_DATASEQ_INORDER_EN) | ||
333 | #define ISCSI_ERL (1ULL << ISCSI_PARAM_ERL) | ||
334 | #define ISCSI_IFMARKER_EN (1ULL << ISCSI_PARAM_IFMARKER_EN) | ||
335 | #define ISCSI_OFMARKER_EN (1ULL << ISCSI_PARAM_OFMARKER_EN) | ||
336 | #define ISCSI_EXP_STATSN (1ULL << ISCSI_PARAM_EXP_STATSN) | ||
337 | #define ISCSI_TARGET_NAME (1ULL << ISCSI_PARAM_TARGET_NAME) | ||
338 | #define ISCSI_TPGT (1ULL << ISCSI_PARAM_TPGT) | ||
339 | #define ISCSI_PERSISTENT_ADDRESS (1ULL << ISCSI_PARAM_PERSISTENT_ADDRESS) | ||
340 | #define ISCSI_PERSISTENT_PORT (1ULL << ISCSI_PARAM_PERSISTENT_PORT) | ||
341 | #define ISCSI_SESS_RECOVERY_TMO (1ULL << ISCSI_PARAM_SESS_RECOVERY_TMO) | ||
342 | #define ISCSI_CONN_PORT (1ULL << ISCSI_PARAM_CONN_PORT) | ||
343 | #define ISCSI_CONN_ADDRESS (1ULL << ISCSI_PARAM_CONN_ADDRESS) | ||
344 | #define ISCSI_USERNAME (1ULL << ISCSI_PARAM_USERNAME) | ||
345 | #define ISCSI_USERNAME_IN (1ULL << ISCSI_PARAM_USERNAME_IN) | ||
346 | #define ISCSI_PASSWORD (1ULL << ISCSI_PARAM_PASSWORD) | ||
347 | #define ISCSI_PASSWORD_IN (1ULL << ISCSI_PARAM_PASSWORD_IN) | ||
348 | #define ISCSI_FAST_ABORT (1ULL << ISCSI_PARAM_FAST_ABORT) | ||
349 | #define ISCSI_ABORT_TMO (1ULL << ISCSI_PARAM_ABORT_TMO) | ||
350 | #define ISCSI_LU_RESET_TMO (1ULL << ISCSI_PARAM_LU_RESET_TMO) | ||
351 | #define ISCSI_HOST_RESET_TMO (1ULL << ISCSI_PARAM_HOST_RESET_TMO) | ||
352 | #define ISCSI_PING_TMO (1ULL << ISCSI_PARAM_PING_TMO) | ||
353 | #define ISCSI_RECV_TMO (1ULL << ISCSI_PARAM_RECV_TMO) | ||
354 | #define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME) | ||
355 | #define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID) | ||
356 | #define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME) | ||
357 | #define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO) | ||
358 | #define ISCSI_TARGET_ALIAS (1ULL << ISCSI_PARAM_TARGET_ALIAS) | ||
359 | |||
360 | /* iSCSI HBA params */ | 413 | /* iSCSI HBA params */ |
361 | enum iscsi_host_param { | 414 | enum iscsi_host_param { |
362 | ISCSI_HOST_PARAM_HWADDRESS, | 415 | ISCSI_HOST_PARAM_HWADDRESS, |
@@ -366,11 +419,6 @@ enum iscsi_host_param { | |||
366 | ISCSI_HOST_PARAM_MAX, | 419 | ISCSI_HOST_PARAM_MAX, |
367 | }; | 420 | }; |
368 | 421 | ||
369 | #define ISCSI_HOST_HWADDRESS (1ULL << ISCSI_HOST_PARAM_HWADDRESS) | ||
370 | #define ISCSI_HOST_INITIATOR_NAME (1ULL << ISCSI_HOST_PARAM_INITIATOR_NAME) | ||
371 | #define ISCSI_HOST_NETDEV_NAME (1ULL << ISCSI_HOST_PARAM_NETDEV_NAME) | ||
372 | #define ISCSI_HOST_IPADDRESS (1ULL << ISCSI_HOST_PARAM_IPADDRESS) | ||
373 | |||
374 | #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) | 422 | #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) |
375 | #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) | 423 | #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) |
376 | 424 | ||
@@ -392,6 +440,7 @@ enum iscsi_host_param { | |||
392 | #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ | 440 | #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ |
393 | #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, | 441 | #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, |
394 | and verification */ | 442 | and verification */ |
443 | #define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */ | ||
395 | 444 | ||
396 | /* | 445 | /* |
397 | * These flags describes reason of stop_conn() call | 446 | * These flags describes reason of stop_conn() call |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 7d96829b0c00..5d1a758e0595 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -281,9 +281,6 @@ struct fc_seq_els_data { | |||
281 | * @timer: The command timer | 281 | * @timer: The command timer |
282 | * @tm_done: Completion indicator | 282 | * @tm_done: Completion indicator |
283 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) | 283 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) |
284 | * @start_time: Timestamp indicating the start of the I/O (in jiffies) | ||
285 | * @end_time: Timestamp indicating the end of the I/O (in jiffies) | ||
286 | * @last_pkt_time: Timestamp of the last frame received (in jiffies) | ||
287 | * @data_len: The length of the data | 284 | * @data_len: The length of the data |
288 | * @cdb_cmd: The CDB command | 285 | * @cdb_cmd: The CDB command |
289 | * @xfer_len: The transfer length | 286 | * @xfer_len: The transfer length |
@@ -304,50 +301,46 @@ struct fc_seq_els_data { | |||
304 | * @recov_seq: The sequence for REC or SRR | 301 | * @recov_seq: The sequence for REC or SRR |
305 | */ | 302 | */ |
306 | struct fc_fcp_pkt { | 303 | struct fc_fcp_pkt { |
307 | /* Housekeeping information */ | ||
308 | struct fc_lport *lp; | ||
309 | u16 state; | ||
310 | atomic_t ref_cnt; | ||
311 | spinlock_t scsi_pkt_lock; | 304 | spinlock_t scsi_pkt_lock; |
305 | atomic_t ref_cnt; | ||
306 | |||
307 | /* SCSI command and data transfer information */ | ||
308 | u32 data_len; | ||
312 | 309 | ||
313 | /* SCSI I/O related information */ | 310 | /* SCSI I/O related information */ |
314 | struct scsi_cmnd *cmd; | 311 | struct scsi_cmnd *cmd; |
315 | struct list_head list; | 312 | struct list_head list; |
316 | 313 | ||
317 | /* Timeout related information */ | 314 | /* Housekeeping information */ |
318 | struct timer_list timer; | 315 | struct fc_lport *lp; |
319 | struct completion tm_done; | 316 | u8 state; |
320 | int wait_for_comp; | ||
321 | unsigned long start_time; | ||
322 | unsigned long end_time; | ||
323 | unsigned long last_pkt_time; | ||
324 | |||
325 | /* SCSI command and data transfer information */ | ||
326 | u32 data_len; | ||
327 | |||
328 | /* Transport related veriables */ | ||
329 | struct fcp_cmnd cdb_cmd; | ||
330 | size_t xfer_len; | ||
331 | u16 xfer_ddp; | ||
332 | u32 xfer_contig_end; | ||
333 | u16 max_payload; | ||
334 | 317 | ||
335 | /* SCSI/FCP return status */ | 318 | /* SCSI/FCP return status */ |
336 | u32 io_status; | ||
337 | u8 cdb_status; | 319 | u8 cdb_status; |
338 | u8 status_code; | 320 | u8 status_code; |
339 | u8 scsi_comp_flags; | 321 | u8 scsi_comp_flags; |
322 | u32 io_status; | ||
340 | u32 req_flags; | 323 | u32 req_flags; |
341 | u32 scsi_resid; | 324 | u32 scsi_resid; |
342 | 325 | ||
326 | /* Transport related veriables */ | ||
327 | size_t xfer_len; | ||
328 | struct fcp_cmnd cdb_cmd; | ||
329 | u32 xfer_contig_end; | ||
330 | u16 max_payload; | ||
331 | u16 xfer_ddp; | ||
332 | |||
343 | /* Associated structures */ | 333 | /* Associated structures */ |
344 | struct fc_rport *rport; | 334 | struct fc_rport *rport; |
345 | struct fc_seq *seq_ptr; | 335 | struct fc_seq *seq_ptr; |
346 | 336 | ||
347 | /* Error Processing information */ | 337 | /* Timeout/error related information */ |
348 | u8 recov_retry; | 338 | struct timer_list timer; |
339 | int wait_for_comp; | ||
340 | u32 recov_retry; | ||
349 | struct fc_seq *recov_seq; | 341 | struct fc_seq *recov_seq; |
350 | }; | 342 | struct completion tm_done; |
343 | } ____cacheline_aligned_in_smp; | ||
351 | 344 | ||
352 | /* | 345 | /* |
353 | * Structure and function definitions for managing Fibre Channel Exchanges | 346 | * Structure and function definitions for managing Fibre Channel Exchanges |
@@ -413,35 +406,32 @@ struct fc_seq { | |||
413 | * sequence allocation | 406 | * sequence allocation |
414 | */ | 407 | */ |
415 | struct fc_exch { | 408 | struct fc_exch { |
409 | spinlock_t ex_lock; | ||
410 | atomic_t ex_refcnt; | ||
411 | enum fc_class class; | ||
416 | struct fc_exch_mgr *em; | 412 | struct fc_exch_mgr *em; |
417 | struct fc_exch_pool *pool; | 413 | struct fc_exch_pool *pool; |
418 | u32 state; | ||
419 | u16 xid; | ||
420 | struct list_head ex_list; | 414 | struct list_head ex_list; |
421 | spinlock_t ex_lock; | ||
422 | atomic_t ex_refcnt; | ||
423 | struct delayed_work timeout_work; | ||
424 | struct fc_lport *lp; | 415 | struct fc_lport *lp; |
416 | u32 esb_stat; | ||
417 | u8 state; | ||
418 | u8 fh_type; | ||
419 | u8 seq_id; | ||
420 | u8 encaps; | ||
421 | u16 xid; | ||
425 | u16 oxid; | 422 | u16 oxid; |
426 | u16 rxid; | 423 | u16 rxid; |
427 | u32 oid; | 424 | u32 oid; |
428 | u32 sid; | 425 | u32 sid; |
429 | u32 did; | 426 | u32 did; |
430 | u32 esb_stat; | ||
431 | u32 r_a_tov; | 427 | u32 r_a_tov; |
432 | u8 seq_id; | ||
433 | u8 encaps; | ||
434 | u32 f_ctl; | 428 | u32 f_ctl; |
435 | u8 fh_type; | 429 | struct fc_seq seq; |
436 | enum fc_class class; | ||
437 | struct fc_seq seq; | ||
438 | |||
439 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); | 430 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); |
440 | void *arg; | 431 | void *arg; |
441 | |||
442 | void (*destructor)(struct fc_seq *, void *); | 432 | void (*destructor)(struct fc_seq *, void *); |
443 | 433 | struct delayed_work timeout_work; | |
444 | }; | 434 | } ____cacheline_aligned_in_smp; |
445 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) | 435 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) |
446 | 436 | ||
447 | 437 | ||
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8c1638b8c28e..d1e95c6ac776 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -229,6 +229,11 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, | |||
229 | const struct libfc_function_template *, int init_fcp); | 229 | const struct libfc_function_template *, int init_fcp); |
230 | u32 fcoe_fc_crc(struct fc_frame *fp); | 230 | u32 fcoe_fc_crc(struct fc_frame *fp); |
231 | int fcoe_start_io(struct sk_buff *skb); | 231 | int fcoe_start_io(struct sk_buff *skb); |
232 | int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type); | ||
233 | void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb, | ||
234 | struct net_device *netdev); | ||
235 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); | ||
236 | int fcoe_validate_vport_create(struct fc_vport *vport); | ||
232 | 237 | ||
233 | /** | 238 | /** |
234 | * is_fip_mode() - returns true if FIP mode selected. | 239 | * is_fip_mode() - returns true if FIP mode selected. |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ee866060f8a4..6a308d42d98f 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -142,8 +142,11 @@ struct expander_device { | |||
142 | u16 ex_change_count; | 142 | u16 ex_change_count; |
143 | u16 max_route_indexes; | 143 | u16 max_route_indexes; |
144 | u8 num_phys; | 144 | u8 num_phys; |
145 | |||
146 | u8 t2t_supp:1; | ||
145 | u8 configuring:1; | 147 | u8 configuring:1; |
146 | u8 conf_route_table:1; | 148 | u8 conf_route_table:1; |
149 | |||
147 | u8 enclosure_logical_id[8]; | 150 | u8 enclosure_logical_id[8]; |
148 | 151 | ||
149 | struct ex_phy *ex_phy; | 152 | struct ex_phy *ex_phy; |
@@ -386,6 +389,11 @@ sdev_to_domain_dev(struct scsi_device *sdev) { | |||
386 | return starget_to_domain_dev(sdev->sdev_target); | 389 | return starget_to_domain_dev(sdev->sdev_target); |
387 | } | 390 | } |
388 | 391 | ||
392 | static inline struct ata_device *sas_to_ata_dev(struct domain_device *dev) | ||
393 | { | ||
394 | return &dev->sata_dev.ap->link.device[0]; | ||
395 | } | ||
396 | |||
389 | static inline struct domain_device * | 397 | static inline struct domain_device * |
390 | cmd_to_domain_dev(struct scsi_cmnd *cmd) | 398 | cmd_to_domain_dev(struct scsi_cmnd *cmd) |
391 | { | 399 | { |
@@ -405,6 +413,20 @@ static inline void sas_phy_disconnected(struct asd_sas_phy *phy) | |||
405 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; | 413 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; |
406 | } | 414 | } |
407 | 415 | ||
416 | static inline unsigned int to_sas_gpio_od(int device, int bit) | ||
417 | { | ||
418 | return 3 * device + bit; | ||
419 | } | ||
420 | |||
421 | #ifdef CONFIG_SCSI_SAS_HOST_SMP | ||
422 | int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count); | ||
423 | #else | ||
424 | static inline int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count) | ||
425 | { | ||
426 | return -1; | ||
427 | } | ||
428 | #endif | ||
429 | |||
408 | /* ---------- Tasks ---------- */ | 430 | /* ---------- Tasks ---------- */ |
409 | /* | 431 | /* |
410 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | | 432 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | |
@@ -555,36 +577,14 @@ struct sas_task { | |||
555 | struct work_struct abort_work; | 577 | struct work_struct abort_work; |
556 | }; | 578 | }; |
557 | 579 | ||
558 | extern struct kmem_cache *sas_task_cache; | ||
559 | |||
560 | #define SAS_TASK_STATE_PENDING 1 | 580 | #define SAS_TASK_STATE_PENDING 1 |
561 | #define SAS_TASK_STATE_DONE 2 | 581 | #define SAS_TASK_STATE_DONE 2 |
562 | #define SAS_TASK_STATE_ABORTED 4 | 582 | #define SAS_TASK_STATE_ABORTED 4 |
563 | #define SAS_TASK_NEED_DEV_RESET 8 | 583 | #define SAS_TASK_NEED_DEV_RESET 8 |
564 | #define SAS_TASK_AT_INITIATOR 16 | 584 | #define SAS_TASK_AT_INITIATOR 16 |
565 | 585 | ||
566 | static inline struct sas_task *sas_alloc_task(gfp_t flags) | 586 | extern struct sas_task *sas_alloc_task(gfp_t flags); |
567 | { | 587 | extern void sas_free_task(struct sas_task *task); |
568 | struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); | ||
569 | |||
570 | if (task) { | ||
571 | INIT_LIST_HEAD(&task->list); | ||
572 | spin_lock_init(&task->task_state_lock); | ||
573 | task->task_state_flags = SAS_TASK_STATE_PENDING; | ||
574 | init_timer(&task->timer); | ||
575 | init_completion(&task->completion); | ||
576 | } | ||
577 | |||
578 | return task; | ||
579 | } | ||
580 | |||
581 | static inline void sas_free_task(struct sas_task *task) | ||
582 | { | ||
583 | if (task) { | ||
584 | BUG_ON(!list_empty(&task->list)); | ||
585 | kmem_cache_free(sas_task_cache, task); | ||
586 | } | ||
587 | } | ||
588 | 588 | ||
589 | struct sas_domain_function_template { | 589 | struct sas_domain_function_template { |
590 | /* The class calls these to notify the LLDD of an event. */ | 590 | /* The class calls these to notify the LLDD of an event. */ |
@@ -614,6 +614,10 @@ struct sas_domain_function_template { | |||
614 | 614 | ||
615 | /* Phy management */ | 615 | /* Phy management */ |
616 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); | 616 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); |
617 | |||
618 | /* GPIO support */ | ||
619 | int (*lldd_write_gpio)(struct sas_ha_struct *, u8 reg_type, | ||
620 | u8 reg_index, u8 reg_count, u8 *write_data); | ||
617 | }; | 621 | }; |
618 | 622 | ||
619 | extern int sas_register_ha(struct sas_ha_struct *); | 623 | extern int sas_register_ha(struct sas_ha_struct *); |
@@ -652,7 +656,7 @@ int sas_discover_event(struct asd_sas_port *, enum discover_event ev); | |||
652 | int sas_discover_sata(struct domain_device *); | 656 | int sas_discover_sata(struct domain_device *); |
653 | int sas_discover_end_dev(struct domain_device *); | 657 | int sas_discover_end_dev(struct domain_device *); |
654 | 658 | ||
655 | void sas_unregister_dev(struct domain_device *); | 659 | void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *); |
656 | 660 | ||
657 | void sas_init_dev(struct domain_device *); | 661 | void sas_init_dev(struct domain_device *); |
658 | 662 | ||
diff --git a/include/scsi/sas.h b/include/scsi/sas.h index e9fd02281381..3673d685e6ad 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h | |||
@@ -108,6 +108,7 @@ enum sas_protocol { | |||
108 | SAS_PROTOCOL_STP = 0x04, | 108 | SAS_PROTOCOL_STP = 0x04, |
109 | SAS_PROTOCOL_SSP = 0x08, | 109 | SAS_PROTOCOL_SSP = 0x08, |
110 | SAS_PROTOCOL_ALL = 0x0E, | 110 | SAS_PROTOCOL_ALL = 0x0E, |
111 | SAS_PROTOCOL_STP_ALL = SAS_PROTOCOL_STP|SAS_PROTOCOL_SATA, | ||
111 | }; | 112 | }; |
112 | 113 | ||
113 | /* From the spec; local phys only */ | 114 | /* From the spec; local phys only */ |
@@ -121,6 +122,7 @@ enum phy_func { | |||
121 | PHY_FUNC_TX_SATA_PS_SIGNAL, | 122 | PHY_FUNC_TX_SATA_PS_SIGNAL, |
122 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ | 123 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ |
123 | PHY_FUNC_SET_LINK_RATE, | 124 | PHY_FUNC_SET_LINK_RATE, |
125 | PHY_FUNC_GET_EVENTS, | ||
124 | }; | 126 | }; |
125 | 127 | ||
126 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. | 128 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. |
@@ -195,6 +197,14 @@ enum sas_open_rej_reason { | |||
195 | SAS_OREJ_RSVD_RETRY = 18, | 197 | SAS_OREJ_RSVD_RETRY = 18, |
196 | }; | 198 | }; |
197 | 199 | ||
200 | enum sas_gpio_reg_type { | ||
201 | SAS_GPIO_REG_CFG = 0, | ||
202 | SAS_GPIO_REG_RX = 1, | ||
203 | SAS_GPIO_REG_RX_GP = 2, | ||
204 | SAS_GPIO_REG_TX = 3, | ||
205 | SAS_GPIO_REG_TX_GP = 4, | ||
206 | }; | ||
207 | |||
198 | struct dev_to_host_fis { | 208 | struct dev_to_host_fis { |
199 | u8 fis_type; /* 0x34 */ | 209 | u8 fis_type; /* 0x34 */ |
200 | u8 flags; | 210 | u8 flags; |
@@ -341,7 +351,12 @@ struct report_general_resp { | |||
341 | 351 | ||
342 | u8 conf_route_table:1; | 352 | u8 conf_route_table:1; |
343 | u8 configuring:1; | 353 | u8 configuring:1; |
344 | u8 _r_b:6; | 354 | u8 config_others:1; |
355 | u8 orej_retry_supp:1; | ||
356 | u8 stp_cont_awt:1; | ||
357 | u8 self_config:1; | ||
358 | u8 zone_config:1; | ||
359 | u8 t2t_supp:1; | ||
345 | 360 | ||
346 | u8 _r_c; | 361 | u8 _r_c; |
347 | 362 | ||
@@ -528,7 +543,12 @@ struct report_general_resp { | |||
528 | u8 _r_a; | 543 | u8 _r_a; |
529 | u8 num_phys; | 544 | u8 num_phys; |
530 | 545 | ||
531 | u8 _r_b:6; | 546 | u8 t2t_supp:1; |
547 | u8 zone_config:1; | ||
548 | u8 self_config:1; | ||
549 | u8 stp_cont_awt:1; | ||
550 | u8 orej_retry_supp:1; | ||
551 | u8 config_others:1; | ||
532 | u8 configuring:1; | 552 | u8 configuring:1; |
533 | u8 conf_route_table:1; | 553 | u8 conf_route_table:1; |
534 | 554 | ||
diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h new file mode 100644 index 000000000000..fd5689d4c052 --- /dev/null +++ b/include/scsi/scsi_bsg_iscsi.h | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * iSCSI Transport BSG Interface | ||
3 | * | ||
4 | * Copyright (C) 2009 James Smart, Emulex Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
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 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifndef SCSI_BSG_ISCSI_H | ||
23 | #define SCSI_BSG_ISCSI_H | ||
24 | |||
25 | /* | ||
26 | * This file intended to be included by both kernel and user space | ||
27 | */ | ||
28 | |||
29 | #include <scsi/scsi.h> | ||
30 | |||
31 | /* | ||
32 | * iSCSI Transport SGIO v4 BSG Message Support | ||
33 | */ | ||
34 | |||
35 | /* Default BSG request timeout (in seconds) */ | ||
36 | #define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ) | ||
37 | |||
38 | |||
39 | /* | ||
40 | * Request Message Codes supported by the iSCSI Transport | ||
41 | */ | ||
42 | |||
43 | /* define the class masks for the message codes */ | ||
44 | #define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */ | ||
45 | #define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */ | ||
46 | |||
47 | /* iscsi host Message Codes */ | ||
48 | #define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF) | ||
49 | |||
50 | |||
51 | /* | ||
52 | * iSCSI Host Messages | ||
53 | */ | ||
54 | |||
55 | /* ISCSI_BSG_HST_VENDOR : */ | ||
56 | |||
57 | /* Request: | ||
58 | * Note: When specifying vendor_id, be sure to read the Vendor Type and ID | ||
59 | * formatting requirements specified in scsi_netlink.h | ||
60 | */ | ||
61 | struct iscsi_bsg_host_vendor { | ||
62 | /* | ||
63 | * Identifies the vendor that the message is formatted for. This | ||
64 | * should be the recipient of the message. | ||
65 | */ | ||
66 | uint64_t vendor_id; | ||
67 | |||
68 | /* start of vendor command area */ | ||
69 | uint32_t vendor_cmd[0]; | ||
70 | }; | ||
71 | |||
72 | /* Response: | ||
73 | */ | ||
74 | struct iscsi_bsg_host_vendor_reply { | ||
75 | /* start of vendor response area */ | ||
76 | uint32_t vendor_rsp[0]; | ||
77 | }; | ||
78 | |||
79 | |||
80 | /* request (CDB) structure of the sg_io_v4 */ | ||
81 | struct iscsi_bsg_request { | ||
82 | uint32_t msgcode; | ||
83 | union { | ||
84 | struct iscsi_bsg_host_vendor h_vendor; | ||
85 | } rqst_data; | ||
86 | } __attribute__((packed)); | ||
87 | |||
88 | |||
89 | /* response (request sense data) structure of the sg_io_v4 */ | ||
90 | struct iscsi_bsg_reply { | ||
91 | /* | ||
92 | * The completion result. Result exists in two forms: | ||
93 | * if negative, it is an -Exxx system errno value. There will | ||
94 | * be no further reply information supplied. | ||
95 | * else, it's the 4-byte scsi error result, with driver, host, | ||
96 | * msg and status fields. The per-msgcode reply structure | ||
97 | * will contain valid data. | ||
98 | */ | ||
99 | uint32_t result; | ||
100 | |||
101 | /* If there was reply_payload, how much was recevied ? */ | ||
102 | uint32_t reply_payload_rcv_len; | ||
103 | |||
104 | union { | ||
105 | struct iscsi_bsg_host_vendor_reply vendor_reply; | ||
106 | } reply_data; | ||
107 | }; | ||
108 | |||
109 | |||
110 | #endif /* SCSI_BSG_ISCSI_H */ | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d371c3ca90c3..5591ed54dc93 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -197,6 +197,7 @@ struct scsi_device_handler { | |||
197 | int (*activate)(struct scsi_device *, activate_complete, void *); | 197 | int (*activate)(struct scsi_device *, activate_complete, void *); |
198 | int (*prep_fn)(struct scsi_device *, struct request *); | 198 | int (*prep_fn)(struct scsi_device *, struct request *); |
199 | int (*set_params)(struct scsi_device *, const char *); | 199 | int (*set_params)(struct scsi_device *, const char *); |
200 | bool (*match)(struct scsi_device *); | ||
200 | }; | 201 | }; |
201 | 202 | ||
202 | struct scsi_dh_data { | 203 | struct scsi_dh_data { |
@@ -471,6 +472,11 @@ static inline int scsi_device_protection(struct scsi_device *sdev) | |||
471 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); | 472 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); |
472 | } | 473 | } |
473 | 474 | ||
475 | static inline int scsi_device_tpgs(struct scsi_device *sdev) | ||
476 | { | ||
477 | return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; | ||
478 | } | ||
479 | |||
474 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ | 480 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ |
475 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") | 481 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") |
476 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" | 482 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index f1f2644137b8..50266c9405fc 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -355,6 +355,19 @@ struct scsi_host_template { | |||
355 | */ | 355 | */ |
356 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); | 356 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); |
357 | 357 | ||
358 | /* This is an optional routine that allows transport to initiate | ||
359 | * LLD adapter or firmware reset using sysfs attribute. | ||
360 | * | ||
361 | * Return values: 0 on success, -ve value on failure. | ||
362 | * | ||
363 | * Status: OPTIONAL | ||
364 | */ | ||
365 | |||
366 | int (*host_reset)(struct Scsi_Host *shost, int reset_type); | ||
367 | #define SCSI_ADAPTER_RESET 1 | ||
368 | #define SCSI_FIRMWARE_RESET 2 | ||
369 | |||
370 | |||
358 | /* | 371 | /* |
359 | * Name of proc directory | 372 | * Name of proc directory |
360 | */ | 373 | */ |
@@ -791,7 +804,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) | |||
791 | **/ | 804 | **/ |
792 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) | 805 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) |
793 | { | 806 | { |
794 | return shost->shost_state == SHOST_RUNNING; | 807 | return shost->shost_state == SHOST_RUNNING || |
808 | shost->shost_state == SHOST_RECOVERY; | ||
795 | } | 809 | } |
796 | 810 | ||
797 | extern void scsi_unblock_requests(struct Scsi_Host *); | 811 | extern void scsi_unblock_requests(struct Scsi_Host *); |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index bf8f52965675..5994bcc1b017 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -37,6 +37,8 @@ struct iscsi_cls_conn; | |||
37 | struct iscsi_conn; | 37 | struct iscsi_conn; |
38 | struct iscsi_task; | 38 | struct iscsi_task; |
39 | struct sockaddr; | 39 | struct sockaddr; |
40 | struct iscsi_iface; | ||
41 | struct bsg_job; | ||
40 | 42 | ||
41 | /** | 43 | /** |
42 | * struct iscsi_transport - iSCSI Transport template | 44 | * struct iscsi_transport - iSCSI Transport template |
@@ -84,9 +86,7 @@ struct iscsi_transport { | |||
84 | struct module *owner; | 86 | struct module *owner; |
85 | char *name; | 87 | char *name; |
86 | unsigned int caps; | 88 | unsigned int caps; |
87 | /* LLD sets this to indicate what values it can export to sysfs */ | 89 | |
88 | uint64_t param_mask; | ||
89 | uint64_t host_param_mask; | ||
90 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, | 90 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, |
91 | uint16_t cmds_max, uint16_t qdepth, | 91 | uint16_t cmds_max, uint16_t qdepth, |
92 | uint32_t sn); | 92 | uint32_t sn); |
@@ -137,6 +137,13 @@ struct iscsi_transport { | |||
137 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, | 137 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, |
138 | uint32_t enable, struct sockaddr *dst_addr); | 138 | uint32_t enable, struct sockaddr *dst_addr); |
139 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); | 139 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); |
140 | int (*set_iface_param) (struct Scsi_Host *shost, void *data, | ||
141 | uint32_t len); | ||
142 | int (*get_iface_param) (struct iscsi_iface *iface, | ||
143 | enum iscsi_param_type param_type, | ||
144 | int param, char *buf); | ||
145 | mode_t (*attr_is_visible)(int param_type, int param); | ||
146 | int (*bsg_request)(struct bsg_job *job); | ||
140 | }; | 147 | }; |
141 | 148 | ||
142 | /* | 149 | /* |
@@ -150,6 +157,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt); | |||
150 | */ | 157 | */ |
151 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, | 158 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, |
152 | enum iscsi_err error); | 159 | enum iscsi_err error); |
160 | extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn, | ||
161 | enum iscsi_conn_state state); | ||
153 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 162 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
154 | char *data, uint32_t data_size); | 163 | char *data, uint32_t data_size); |
155 | 164 | ||
@@ -171,6 +180,9 @@ struct iscsi_cls_conn { | |||
171 | #define iscsi_dev_to_conn(_dev) \ | 180 | #define iscsi_dev_to_conn(_dev) \ |
172 | container_of(_dev, struct iscsi_cls_conn, dev) | 181 | container_of(_dev, struct iscsi_cls_conn, dev) |
173 | 182 | ||
183 | #define transport_class_to_conn(_cdev) \ | ||
184 | iscsi_dev_to_conn(_cdev->parent) | ||
185 | |||
174 | #define iscsi_conn_to_session(_conn) \ | 186 | #define iscsi_conn_to_session(_conn) \ |
175 | iscsi_dev_to_session(_conn->dev.parent) | 187 | iscsi_dev_to_session(_conn->dev.parent) |
176 | 188 | ||
@@ -197,6 +209,7 @@ struct iscsi_cls_session { | |||
197 | struct delayed_work recovery_work; | 209 | struct delayed_work recovery_work; |
198 | 210 | ||
199 | unsigned int target_id; | 211 | unsigned int target_id; |
212 | bool ida_used; | ||
200 | 213 | ||
201 | int state; | 214 | int state; |
202 | int sid; /* session id */ | 215 | int sid; /* session id */ |
@@ -207,6 +220,9 @@ struct iscsi_cls_session { | |||
207 | #define iscsi_dev_to_session(_dev) \ | 220 | #define iscsi_dev_to_session(_dev) \ |
208 | container_of(_dev, struct iscsi_cls_session, dev) | 221 | container_of(_dev, struct iscsi_cls_session, dev) |
209 | 222 | ||
223 | #define transport_class_to_session(_cdev) \ | ||
224 | iscsi_dev_to_session(_cdev->parent) | ||
225 | |||
210 | #define iscsi_session_to_shost(_session) \ | 226 | #define iscsi_session_to_shost(_session) \ |
211 | dev_to_shost(_session->dev.parent) | 227 | dev_to_shost(_session->dev.parent) |
212 | 228 | ||
@@ -216,8 +232,12 @@ struct iscsi_cls_session { | |||
216 | struct iscsi_cls_host { | 232 | struct iscsi_cls_host { |
217 | atomic_t nr_scans; | 233 | atomic_t nr_scans; |
218 | struct mutex mutex; | 234 | struct mutex mutex; |
235 | struct request_queue *bsg_q; | ||
219 | }; | 236 | }; |
220 | 237 | ||
238 | #define iscsi_job_to_shost(_job) \ | ||
239 | dev_to_shost(_job->dev) | ||
240 | |||
221 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, | 241 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, |
222 | void (*fn)(struct iscsi_cls_session *)); | 242 | void (*fn)(struct iscsi_cls_session *)); |
223 | 243 | ||
@@ -228,6 +248,20 @@ struct iscsi_endpoint { | |||
228 | struct iscsi_cls_conn *conn; | 248 | struct iscsi_cls_conn *conn; |
229 | }; | 249 | }; |
230 | 250 | ||
251 | struct iscsi_iface { | ||
252 | struct device dev; | ||
253 | struct iscsi_transport *transport; | ||
254 | uint32_t iface_type; /* IPv4 or IPv6 */ | ||
255 | uint32_t iface_num; /* iface number, 0 - n */ | ||
256 | void *dd_data; /* LLD private data */ | ||
257 | }; | ||
258 | |||
259 | #define iscsi_dev_to_iface(_dev) \ | ||
260 | container_of(_dev, struct iscsi_iface, dev) | ||
261 | |||
262 | #define iscsi_iface_to_shost(_iface) \ | ||
263 | dev_to_shost(_iface->dev.parent) | ||
264 | |||
231 | /* | 265 | /* |
232 | * session and connection functions that can be used by HW iSCSI LLDs | 266 | * session and connection functions that can be used by HW iSCSI LLDs |
233 | */ | 267 | */ |
@@ -238,6 +272,7 @@ struct iscsi_endpoint { | |||
238 | dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) | 272 | dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) |
239 | 273 | ||
240 | extern int iscsi_session_chkready(struct iscsi_cls_session *session); | 274 | extern int iscsi_session_chkready(struct iscsi_cls_session *session); |
275 | extern int iscsi_is_session_online(struct iscsi_cls_session *session); | ||
241 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, | 276 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, |
242 | struct iscsi_transport *transport, int dd_size); | 277 | struct iscsi_transport *transport, int dd_size); |
243 | extern int iscsi_add_session(struct iscsi_cls_session *session, | 278 | extern int iscsi_add_session(struct iscsi_cls_session *session, |
@@ -261,5 +296,11 @@ extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size); | |||
261 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); | 296 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); |
262 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); | 297 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); |
263 | extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); | 298 | extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); |
299 | extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost, | ||
300 | struct iscsi_transport *t, | ||
301 | uint32_t iface_type, | ||
302 | uint32_t iface_num, int dd_size); | ||
303 | extern void iscsi_destroy_iface(struct iscsi_iface *iface); | ||
304 | extern struct iscsi_iface *iscsi_lookup_iface(int handle); | ||
264 | 305 | ||
265 | #endif | 306 | #endif |
diff --git a/include/sound/adau1373.h b/include/sound/adau1373.h new file mode 100644 index 000000000000..1b19c7666574 --- /dev/null +++ b/include/sound/adau1373.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Analog Devices ADAU1373 Audio Codec drive | ||
3 | * | ||
4 | * Copyright 2011 Analog Devices Inc. | ||
5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #ifndef __SOUND_ADAU1373_H__ | ||
11 | #define __SOUND_ADAU1373_H__ | ||
12 | |||
13 | enum adau1373_micbias_voltage { | ||
14 | ADAU1373_MICBIAS_2_9V = 0, | ||
15 | ADAU1373_MICBIAS_2_2V = 1, | ||
16 | ADAU1373_MICBIAS_2_6V = 2, | ||
17 | ADAU1373_MICBIAS_1_8V = 3, | ||
18 | }; | ||
19 | |||
20 | #define ADAU1373_DRC_SIZE 13 | ||
21 | |||
22 | struct adau1373_platform_data { | ||
23 | bool input_differential[4]; | ||
24 | bool lineout_differential; | ||
25 | bool lineout_ground_sense; | ||
26 | |||
27 | unsigned int num_drc; | ||
28 | uint8_t drc_setting[3][ADAU1373_DRC_SIZE]; | ||
29 | |||
30 | enum adau1373_micbias_voltage micbias1; | ||
31 | enum adau1373_micbias_voltage micbias2; | ||
32 | }; | ||
33 | |||
34 | #endif | ||
diff --git a/include/sound/asound.h b/include/sound/asound.h index 5d6074faa279..a2e4ff5ba9e9 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -706,7 +706,7 @@ struct snd_timer_tread { | |||
706 | * * | 706 | * * |
707 | ****************************************************************************/ | 707 | ****************************************************************************/ |
708 | 708 | ||
709 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) | 709 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) |
710 | 710 | ||
711 | struct snd_ctl_card_info { | 711 | struct snd_ctl_card_info { |
712 | int card; /* card number */ | 712 | int card; /* card number */ |
@@ -803,6 +803,8 @@ struct snd_ctl_elem_info { | |||
803 | unsigned int items; /* R: number of items */ | 803 | unsigned int items; /* R: number of items */ |
804 | unsigned int item; /* W: item number */ | 804 | unsigned int item; /* W: item number */ |
805 | char name[64]; /* R: value name */ | 805 | char name[64]; /* R: value name */ |
806 | __u64 names_ptr; /* W: names list (ELEM_ADD only) */ | ||
807 | unsigned int names_length; | ||
806 | } enumerated; | 808 | } enumerated; |
807 | unsigned char reserved[128]; | 809 | unsigned char reserved[128]; |
808 | } value; | 810 | } value; |
diff --git a/include/sound/core.h b/include/sound/core.h index 1fa2407c966f..91d513879a78 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -326,9 +326,9 @@ void release_and_free_resource(struct resource *res); | |||
326 | /* --- */ | 326 | /* --- */ |
327 | 327 | ||
328 | #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) | 328 | #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) |
329 | __printf(4, 5) | ||
329 | void __snd_printk(unsigned int level, const char *file, int line, | 330 | void __snd_printk(unsigned int level, const char *file, int line, |
330 | const char *format, ...) | 331 | const char *format, ...); |
331 | __attribute__ ((format (printf, 4, 5))); | ||
332 | #else | 332 | #else |
333 | #define __snd_printk(level, file, line, format, args...) \ | 333 | #define __snd_printk(level, file, line, format, args...) \ |
334 | printk(format, ##args) | 334 | printk(format, ##args) |
diff --git a/include/sound/info.h b/include/sound/info.h index 4e94cf1ff762..5492cc40dc57 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
@@ -110,8 +110,8 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer); | |||
110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} | 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ | 113 | __printf(2, 3) |
114 | __attribute__ ((format (printf, 2, 3))); | 114 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...); |
115 | int snd_info_init(void); | 115 | int snd_info_init(void); |
116 | int snd_info_done(void); | 116 | int snd_info_done(void); |
117 | 117 | ||
diff --git a/include/sound/initval.h b/include/sound/initval.h index 1daa6dff8297..f99a0d2ddfe7 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h | |||
@@ -62,7 +62,7 @@ static int snd_legacy_find_free_irq(int *irq_table) | |||
62 | { | 62 | { |
63 | while (*irq_table != -1) { | 63 | while (*irq_table != -1) { |
64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, | 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, |
65 | IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ", | 65 | IRQF_PROBE_SHARED, "ALSA Test IRQ", |
66 | (void *) irq_table)) { | 66 | (void *) irq_table)) { |
67 | free_irq(*irq_table, (void *) irq_table); | 67 | free_irq(*irq_table, (void *) irq_table); |
68 | return *irq_table; | 68 | return *irq_table; |
diff --git a/include/sound/jack.h b/include/sound/jack.h index c140fc7cbd3f..63c790742db4 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h | |||
@@ -42,6 +42,7 @@ enum snd_jack_types { | |||
42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ | 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ |
43 | SND_JACK_VIDEOOUT = 0x0010, | 43 | SND_JACK_VIDEOOUT = 0x0010, |
44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, | 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, |
45 | SND_JACK_LINEIN = 0x0020, | ||
45 | 46 | ||
46 | /* Kept separate from switches to facilitate implementation */ | 47 | /* Kept separate from switches to facilitate implementation */ |
47 | SND_JACK_BTN_0 = 0x4000, | 48 | SND_JACK_BTN_0 = 0x4000, |
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index 1f1d53f8830b..20230db00ef1 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h | |||
@@ -50,7 +50,10 @@ | |||
50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ | 50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ |
51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ | 51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ |
52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ | 52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ |
53 | #define MPU401_INFO_IRQ_HOOK (1 << 5) /* mpu401 irq handler is called | ||
54 | from driver irq handler */ | ||
53 | #define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ | 55 | #define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ |
56 | #define MPU401_INFO_USE_TIMER (1 << 15) /* internal */ | ||
54 | 57 | ||
55 | #define MPU401_MODE_BIT_INPUT 0 | 58 | #define MPU401_MODE_BIT_INPUT 0 |
56 | #define MPU401_MODE_BIT_OUTPUT 1 | 59 | #define MPU401_MODE_BIT_OUTPUT 1 |
@@ -73,8 +76,7 @@ struct snd_mpu401 { | |||
73 | unsigned long port; /* base port of MPU-401 chip */ | 76 | unsigned long port; /* base port of MPU-401 chip */ |
74 | unsigned long cport; /* port + 1 (usually) */ | 77 | unsigned long cport; /* port + 1 (usually) */ |
75 | struct resource *res; /* port resource */ | 78 | struct resource *res; /* port resource */ |
76 | int irq; /* IRQ number of MPU-401 chip (-1 = poll) */ | 79 | int irq; /* IRQ number of MPU-401 chip */ |
77 | int irq_flags; | ||
78 | 80 | ||
79 | unsigned long mode; /* MPU401_MODE_XXXX */ | 81 | unsigned long mode; /* MPU401_MODE_XXXX */ |
80 | int timer_invoked; | 82 | int timer_invoked; |
@@ -131,7 +133,6 @@ int snd_mpu401_uart_new(struct snd_card *card, | |||
131 | unsigned long port, | 133 | unsigned long port, |
132 | unsigned int info_flags, | 134 | unsigned int info_flags, |
133 | int irq, | 135 | int irq, |
134 | int irq_flags, | ||
135 | struct snd_rawmidi ** rrawmidi); | 136 | struct snd_rawmidi ** rrawmidi); |
136 | 137 | ||
137 | #endif /* __SOUND_MPU401_H */ | 138 | #endif /* __SOUND_MPU401_H */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 54cb079b7bf1..0cf91b2f08ca 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -825,6 +825,8 @@ int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, | |||
825 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, | 825 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
826 | unsigned int cond, | 826 | unsigned int cond, |
827 | snd_pcm_hw_param_t var); | 827 | snd_pcm_hw_param_t var); |
828 | int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, | ||
829 | unsigned int base_rate); | ||
828 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, | 830 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, |
829 | unsigned int cond, | 831 | unsigned int cond, |
830 | int var, | 832 | int var, |
@@ -1035,6 +1037,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | |||
1035 | atomic_dec(&substream->mmap_count); | 1037 | atomic_dec(&substream->mmap_count); |
1036 | } | 1038 | } |
1037 | 1039 | ||
1040 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, | ||
1041 | struct vm_area_struct *area); | ||
1038 | /* mmap for io-memory area */ | 1042 | /* mmap for io-memory area */ |
1039 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) | 1043 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) |
1040 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP | 1044 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP |
diff --git a/include/sound/saif.h b/include/sound/saif.h new file mode 100644 index 000000000000..d0e0de7984ec --- /dev/null +++ b/include/sound/saif.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 | |||
9 | #ifndef __SOUND_SAIF_H__ | ||
10 | #define __SOUND_SAIF_H__ | ||
11 | |||
12 | struct mxs_saif_platform_data { | ||
13 | int (*init) (void); | ||
14 | int (*get_master_id) (unsigned int saif_id); | ||
15 | }; | ||
16 | #endif | ||
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h index 3d9afb6a8c9c..f352a98ce4f4 100644 --- a/include/sound/seq_kernel.h +++ b/include/sound/seq_kernel.h | |||
@@ -75,9 +75,9 @@ struct snd_seq_port_callback { | |||
75 | }; | 75 | }; |
76 | 76 | ||
77 | /* interface for kernel client */ | 77 | /* interface for kernel client */ |
78 | __printf(3, 4) | ||
78 | int snd_seq_create_kernel_client(struct snd_card *card, int client_index, | 79 | int snd_seq_create_kernel_client(struct snd_card *card, int client_index, |
79 | const char *name_fmt, ...) | 80 | const char *name_fmt, ...); |
80 | __attribute__ ((format (printf, 3, 4))); | ||
81 | int snd_seq_delete_kernel_client(int client); | 81 | int snd_seq_delete_kernel_client(int client); |
82 | int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); | 82 | int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); |
83 | int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop); | 83 | int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop); |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 5ad5f3a50c68..2413acc54883 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -24,13 +24,13 @@ struct snd_pcm_substream; | |||
24 | * Describes the physical PCM data formating and clocking. Add new formats | 24 | * Describes the physical PCM data formating and clocking. Add new formats |
25 | * to the end. | 25 | * to the end. |
26 | */ | 26 | */ |
27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 1 /* I2S mode */ |
28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 2 /* Right Justified mode */ |
29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 3 /* Left Justified mode */ |
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 4 /* L data MSB after FRM LRC */ |
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 6 /* AC97 */ |
33 | #define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */ | 33 | #define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */ |
34 | 34 | ||
35 | /* left and right justified also known as MSB and LSB respectively */ | 35 | /* left and right justified also known as MSB and LSB respectively */ |
36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | 36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J |
@@ -42,8 +42,8 @@ struct snd_pcm_substream; | |||
42 | * DAI bit clocks can be be gated (disabled) when the DAI is not | 42 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
43 | * sending or receiving PCM data in a frame. This can be used to save power. | 43 | * sending or receiving PCM data in a frame. This can be used to save power. |
44 | */ | 44 | */ |
45 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 45 | #define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ |
46 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | 46 | #define SND_SOC_DAIFMT_GATED (2 << 4) /* clock is gated */ |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * DAI hardware signal inversions. | 49 | * DAI hardware signal inversions. |
@@ -51,10 +51,10 @@ struct snd_pcm_substream; | |||
51 | * Specifies whether the DAI can also support inverted clocks for the specified | 51 | * Specifies whether the DAI can also support inverted clocks for the specified |
52 | * format. | 52 | * format. |
53 | */ | 53 | */ |
54 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 54 | #define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */ |
55 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ | 55 | #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */ |
56 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ | 56 | #define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */ |
57 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ | 57 | #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */ |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * DAI hardware clock masters. | 60 | * DAI hardware clock masters. |
@@ -63,10 +63,10 @@ struct snd_pcm_substream; | |||
63 | * i.e. if the codec is clk and FRM master then the interface is | 63 | * i.e. if the codec is clk and FRM master then the interface is |
64 | * clk and frame slave. | 64 | * clk and frame slave. |
65 | */ | 65 | */ |
66 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ | 66 | #define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */ |
67 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ | 67 | #define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk slave & FRM master */ |
68 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 68 | #define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame slave */ |
69 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ | 69 | #define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM slave */ |
70 | 70 | ||
71 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 71 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
72 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 72 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
@@ -242,6 +242,9 @@ struct snd_soc_dai { | |||
242 | void *playback_dma_data; | 242 | void *playback_dma_data; |
243 | void *capture_dma_data; | 243 | void *capture_dma_data; |
244 | 244 | ||
245 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
246 | unsigned int rate; | ||
247 | |||
245 | /* parent platform/codec */ | 248 | /* parent platform/codec */ |
246 | union { | 249 | union { |
247 | struct snd_soc_platform *platform; | 250 | struct snd_soc_platform *platform; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e0583b7769cb..17a4c17f19f5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -381,6 +381,9 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | |||
381 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 381 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
382 | const char *pin); | 382 | const char *pin); |
383 | 383 | ||
384 | /* Mostly internal - should not normally be used */ | ||
385 | void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); | ||
386 | |||
384 | /* dapm widget types */ | 387 | /* dapm widget types */ |
385 | enum snd_soc_dapm_type { | 388 | enum snd_soc_dapm_type { |
386 | snd_soc_dapm_input = 0, /* input pin */ | 389 | snd_soc_dapm_input = 0, /* input pin */ |
@@ -473,6 +476,8 @@ struct snd_soc_dapm_widget { | |||
473 | unsigned char ext:1; /* has external widgets */ | 476 | unsigned char ext:1; /* has external widgets */ |
474 | unsigned char force:1; /* force state */ | 477 | unsigned char force:1; /* force state */ |
475 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ | 478 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
479 | unsigned char new_power:1; /* power from this run */ | ||
480 | unsigned char power_checked:1; /* power checked this run */ | ||
476 | int subseq; /* sort within widget type */ | 481 | int subseq; /* sort within widget type */ |
477 | 482 | ||
478 | int (*power_check)(struct snd_soc_dapm_widget *w); | 483 | int (*power_check)(struct snd_soc_dapm_widget *w); |
@@ -492,6 +497,9 @@ struct snd_soc_dapm_widget { | |||
492 | 497 | ||
493 | /* used during DAPM updates */ | 498 | /* used during DAPM updates */ |
494 | struct list_head power_list; | 499 | struct list_head power_list; |
500 | struct list_head dirty; | ||
501 | int inputs; | ||
502 | int outputs; | ||
495 | }; | 503 | }; |
496 | 504 | ||
497 | struct snd_soc_dapm_update { | 505 | struct snd_soc_dapm_update { |
@@ -524,6 +532,8 @@ struct snd_soc_dapm_context { | |||
524 | enum snd_soc_bias_level target_bias_level; | 532 | enum snd_soc_bias_level target_bias_level; |
525 | struct list_head list; | 533 | struct list_head list; |
526 | 534 | ||
535 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
536 | |||
527 | #ifdef CONFIG_DEBUG_FS | 537 | #ifdef CONFIG_DEBUG_FS |
528 | struct dentry *debugfs_dapm; | 538 | struct dentry *debugfs_dapm; |
529 | #endif | 539 | #endif |
@@ -535,4 +545,10 @@ struct snd_soc_dapm_widget_list { | |||
535 | struct snd_soc_dapm_widget *widgets[0]; | 545 | struct snd_soc_dapm_widget *widgets[0]; |
536 | }; | 546 | }; |
537 | 547 | ||
548 | struct snd_soc_dapm_stats { | ||
549 | int power_checks; | ||
550 | int path_checks; | ||
551 | int neighbour_checks; | ||
552 | }; | ||
553 | |||
538 | #endif | 554 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index aa19f5a32ba8..11cfb5953e06 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/regmap.h> | ||
22 | #include <sound/core.h> | 23 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
24 | #include <sound/control.h> | 25 | #include <sound/control.h> |
@@ -27,13 +28,20 @@ | |||
27 | /* | 28 | /* |
28 | * Convenience kcontrol builders | 29 | * Convenience kcontrol builders |
29 | */ | 30 | */ |
30 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 31 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ |
31 | ((unsigned long)&(struct soc_mixer_control) \ | 32 | ((unsigned long)&(struct soc_mixer_control) \ |
32 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ | 33 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ |
33 | .platform_max = xmax, .invert = xinvert}) | 34 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ |
35 | .invert = xinvert}) | ||
36 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | ||
37 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) | ||
34 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 38 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
35 | ((unsigned long)&(struct soc_mixer_control) \ | 39 | ((unsigned long)&(struct soc_mixer_control) \ |
36 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) | 40 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
41 | #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ | ||
42 | ((unsigned long)&(struct soc_mixer_control) \ | ||
43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | ||
44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) | ||
37 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 45 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
38 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 46 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
39 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
@@ -47,40 +55,36 @@ | |||
47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 55 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
48 | .put = snd_soc_put_volsw, \ | 56 | .put = snd_soc_put_volsw, \ |
49 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 57 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
50 | #define SOC_DOUBLE(xname, xreg, shift_left, shift_right, xmax, xinvert) \ | 58 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ |
51 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 59 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
52 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 60 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
53 | .put = snd_soc_put_volsw, \ | 61 | .put = snd_soc_put_volsw, \ |
54 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 62 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
55 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 63 | max, invert) } |
56 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
57 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 64 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
58 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
59 | .info = snd_soc_info_volsw_2r, \ | 66 | .info = snd_soc_info_volsw, \ |
60 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 67 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
61 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 68 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
62 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 69 | xmax, xinvert) } |
63 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | 70 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ |
64 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ | ||
65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 71 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
66 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 72 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
67 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 73 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
68 | .tlv.p = (tlv_array), \ | 74 | .tlv.p = (tlv_array), \ |
69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 75 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
70 | .put = snd_soc_put_volsw, \ | 76 | .put = snd_soc_put_volsw, \ |
71 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 77 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
72 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ | 78 | max, invert) } |
73 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
74 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 79 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
75 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 80 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
76 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 81 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
77 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 82 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
78 | .tlv.p = (tlv_array), \ | 83 | .tlv.p = (tlv_array), \ |
79 | .info = snd_soc_info_volsw_2r, \ | 84 | .info = snd_soc_info_volsw, \ |
80 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 85 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
81 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 86 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
82 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 87 | xmax, xinvert) } |
83 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
84 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ | 88 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ |
85 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 89 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
86 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 90 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
@@ -120,14 +124,13 @@ | |||
120 | .info = snd_soc_info_volsw, \ | 124 | .info = snd_soc_info_volsw, \ |
121 | .get = xhandler_get, .put = xhandler_put, \ | 125 | .get = xhandler_get, .put = xhandler_put, \ |
122 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 126 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
123 | #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | 127 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ |
124 | xhandler_get, xhandler_put) \ | 128 | xhandler_get, xhandler_put) \ |
125 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 129 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
126 | .info = snd_soc_info_volsw, \ | 130 | .info = snd_soc_info_volsw, \ |
127 | .get = xhandler_get, .put = xhandler_put, \ | 131 | .get = xhandler_get, .put = xhandler_put, \ |
128 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 132 | .private_value = \ |
129 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 133 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } |
130 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
131 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 134 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
132 | xhandler_get, xhandler_put, tlv_array) \ | 135 | xhandler_get, xhandler_put, tlv_array) \ |
133 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 136 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -145,20 +148,18 @@ | |||
145 | .tlv.p = (tlv_array), \ | 148 | .tlv.p = (tlv_array), \ |
146 | .info = snd_soc_info_volsw, \ | 149 | .info = snd_soc_info_volsw, \ |
147 | .get = xhandler_get, .put = xhandler_put, \ | 150 | .get = xhandler_get, .put = xhandler_put, \ |
148 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 151 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ |
149 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 152 | xmax, xinvert) } |
150 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
151 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 153 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
152 | xhandler_get, xhandler_put, tlv_array) \ | 154 | xhandler_get, xhandler_put, tlv_array) \ |
153 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 155 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
154 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 156 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
155 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | 157 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
156 | .tlv.p = (tlv_array), \ | 158 | .tlv.p = (tlv_array), \ |
157 | .info = snd_soc_info_volsw_2r, \ | 159 | .info = snd_soc_info_volsw, \ |
158 | .get = xhandler_get, .put = xhandler_put, \ | 160 | .get = xhandler_get, .put = xhandler_put, \ |
159 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 161 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
160 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 162 | xmax, xinvert) } |
161 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
162 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 163 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
163 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 164 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
164 | .info = snd_soc_info_bool_ext, \ | 165 | .info = snd_soc_info_bool_ext, \ |
@@ -260,6 +261,7 @@ extern struct snd_ac97_bus_ops soc_ac97_ops; | |||
260 | enum snd_soc_control_type { | 261 | enum snd_soc_control_type { |
261 | SND_SOC_I2C = 1, | 262 | SND_SOC_I2C = 1, |
262 | SND_SOC_SPI, | 263 | SND_SOC_SPI, |
264 | SND_SOC_REGMAP, | ||
263 | }; | 265 | }; |
264 | 266 | ||
265 | enum snd_soc_compress_type { | 267 | enum snd_soc_compress_type { |
@@ -274,7 +276,7 @@ enum snd_soc_pcm_subclass { | |||
274 | }; | 276 | }; |
275 | 277 | ||
276 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, | 278 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, |
277 | unsigned int freq, int dir); | 279 | int source, unsigned int freq, int dir); |
278 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, | 280 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, |
279 | unsigned int freq_in, unsigned int freq_out); | 281 | unsigned int freq_in, unsigned int freq_out); |
280 | 282 | ||
@@ -391,12 +393,8 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, | |||
391 | struct snd_ctl_elem_value *ucontrol); | 393 | struct snd_ctl_elem_value *ucontrol); |
392 | int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, | 394 | int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, |
393 | struct snd_ctl_elem_value *ucontrol); | 395 | struct snd_ctl_elem_value *ucontrol); |
394 | int snd_soc_info_volsw_2r(struct snd_kcontrol *kcontrol, | 396 | #define snd_soc_get_volsw_2r snd_soc_get_volsw |
395 | struct snd_ctl_elem_info *uinfo); | 397 | #define snd_soc_put_volsw_2r snd_soc_put_volsw |
396 | int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol, | ||
397 | struct snd_ctl_elem_value *ucontrol); | ||
398 | int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol, | ||
399 | struct snd_ctl_elem_value *ucontrol); | ||
400 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, | 398 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, |
401 | struct snd_ctl_elem_info *uinfo); | 399 | struct snd_ctl_elem_info *uinfo); |
402 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | 400 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, |
@@ -576,9 +574,11 @@ struct snd_soc_codec { | |||
576 | const void *reg_def_copy; | 574 | const void *reg_def_copy; |
577 | const struct snd_soc_cache_ops *cache_ops; | 575 | const struct snd_soc_cache_ops *cache_ops; |
578 | struct mutex cache_rw_mutex; | 576 | struct mutex cache_rw_mutex; |
577 | int val_bytes; | ||
579 | 578 | ||
580 | /* dapm */ | 579 | /* dapm */ |
581 | struct snd_soc_dapm_context dapm; | 580 | struct snd_soc_dapm_context dapm; |
581 | unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ | ||
582 | 582 | ||
583 | #ifdef CONFIG_DEBUG_FS | 583 | #ifdef CONFIG_DEBUG_FS |
584 | struct dentry *debugfs_codec_root; | 584 | struct dentry *debugfs_codec_root; |
@@ -607,7 +607,7 @@ struct snd_soc_codec_driver { | |||
607 | 607 | ||
608 | /* codec wide operations */ | 608 | /* codec wide operations */ |
609 | int (*set_sysclk)(struct snd_soc_codec *codec, | 609 | int (*set_sysclk)(struct snd_soc_codec *codec, |
610 | int clk_id, unsigned int freq, int dir); | 610 | int clk_id, int source, unsigned int freq, int dir); |
611 | int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, | 611 | int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, |
612 | unsigned int freq_in, unsigned int freq_out); | 612 | unsigned int freq_in, unsigned int freq_out); |
613 | 613 | ||
@@ -619,7 +619,7 @@ struct snd_soc_codec_driver { | |||
619 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 619 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
620 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 620 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
621 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | 621 | int (*writable_register)(struct snd_soc_codec *, unsigned int); |
622 | short reg_cache_size; | 622 | unsigned int reg_cache_size; |
623 | short reg_cache_step; | 623 | short reg_cache_step; |
624 | short reg_word_size; | 624 | short reg_word_size; |
625 | const void *reg_cache_default; | 625 | const void *reg_cache_default; |
@@ -630,10 +630,14 @@ struct snd_soc_codec_driver { | |||
630 | /* codec bias level */ | 630 | /* codec bias level */ |
631 | int (*set_bias_level)(struct snd_soc_codec *, | 631 | int (*set_bias_level)(struct snd_soc_codec *, |
632 | enum snd_soc_bias_level level); | 632 | enum snd_soc_bias_level level); |
633 | bool idle_bias_off; | ||
633 | 634 | ||
634 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 635 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
635 | enum snd_soc_dapm_type, int); | 636 | enum snd_soc_dapm_type, int); |
636 | 637 | ||
638 | /* codec stream completion event */ | ||
639 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
640 | |||
637 | /* probe ordering - for components with runtime dependencies */ | 641 | /* probe ordering - for components with runtime dependencies */ |
638 | int probe_order; | 642 | int probe_order; |
639 | int remove_order; | 643 | int remove_order; |
@@ -669,6 +673,9 @@ struct snd_soc_platform_driver { | |||
669 | /* platform stream ops */ | 673 | /* platform stream ops */ |
670 | struct snd_pcm_ops *ops; | 674 | struct snd_pcm_ops *ops; |
671 | 675 | ||
676 | /* platform stream completion event */ | ||
677 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
678 | |||
672 | /* probe ordering - for components with runtime dependencies */ | 679 | /* probe ordering - for components with runtime dependencies */ |
673 | int probe_order; | 680 | int probe_order; |
674 | int remove_order; | 681 | int remove_order; |
@@ -703,6 +710,8 @@ struct snd_soc_dai_link { | |||
703 | const char *cpu_dai_name; | 710 | const char *cpu_dai_name; |
704 | const char *codec_dai_name; | 711 | const char *codec_dai_name; |
705 | 712 | ||
713 | unsigned int dai_fmt; /* format to set on init */ | ||
714 | |||
706 | /* Keep DAI active over suspend */ | 715 | /* Keep DAI active over suspend */ |
707 | unsigned int ignore_suspend:1; | 716 | unsigned int ignore_suspend:1; |
708 | 717 | ||
@@ -815,9 +824,11 @@ struct snd_soc_card { | |||
815 | struct list_head widgets; | 824 | struct list_head widgets; |
816 | struct list_head paths; | 825 | struct list_head paths; |
817 | struct list_head dapm_list; | 826 | struct list_head dapm_list; |
827 | struct list_head dapm_dirty; | ||
818 | 828 | ||
819 | /* Generic DAPM context for the card */ | 829 | /* Generic DAPM context for the card */ |
820 | struct snd_soc_dapm_context dapm; | 830 | struct snd_soc_dapm_context dapm; |
831 | struct snd_soc_dapm_stats dapm_stats; | ||
821 | 832 | ||
822 | #ifdef CONFIG_DEBUG_FS | 833 | #ifdef CONFIG_DEBUG_FS |
823 | struct dentry *debugfs_card_root; | 834 | struct dentry *debugfs_card_root; |
@@ -840,8 +851,6 @@ struct snd_soc_pcm_runtime { | |||
840 | unsigned int complete:1; | 851 | unsigned int complete:1; |
841 | unsigned int dev_registered:1; | 852 | unsigned int dev_registered:1; |
842 | 853 | ||
843 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
844 | unsigned int rate; | ||
845 | long pmdown_time; | 854 | long pmdown_time; |
846 | 855 | ||
847 | /* runtime devices */ | 856 | /* runtime devices */ |
@@ -936,6 +945,18 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
936 | INIT_LIST_HEAD(&card->dapm_list); | 945 | INIT_LIST_HEAD(&card->dapm_list); |
937 | } | 946 | } |
938 | 947 | ||
948 | static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) | ||
949 | { | ||
950 | if (mc->reg == mc->rreg && mc->shift == mc->rshift) | ||
951 | return 0; | ||
952 | /* | ||
953 | * mc->reg == mc->rreg && mc->shift != mc->rshift, or | ||
954 | * mc->reg != mc->rreg means that the control is | ||
955 | * stereo (bits in one register or in two registers) | ||
956 | */ | ||
957 | return 1; | ||
958 | } | ||
959 | |||
939 | int snd_soc_util_init(void); | 960 | int snd_soc_util_init(void); |
940 | void snd_soc_util_exit(void); | 961 | void snd_soc_util_exit(void); |
941 | 962 | ||
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index 89beccb57edd..4cc1093844c8 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h | |||
@@ -23,13 +23,7 @@ | |||
23 | #ifndef TPA6130A2_PLAT_H | 23 | #ifndef TPA6130A2_PLAT_H |
24 | #define TPA6130A2_PLAT_H | 24 | #define TPA6130A2_PLAT_H |
25 | 25 | ||
26 | enum tpa_model { | ||
27 | TPA6130A2, | ||
28 | TPA6140A2, | ||
29 | }; | ||
30 | |||
31 | struct tpa6130a2_platform_data { | 26 | struct tpa6130a2_platform_data { |
32 | enum tpa_model id; | ||
33 | int power_gpio; | 27 | int power_gpio; |
34 | }; | 28 | }; |
35 | 29 | ||
diff --git a/include/sound/wm1250-ev1.h b/include/sound/wm1250-ev1.h new file mode 100644 index 000000000000..7dff82834123 --- /dev/null +++ b/include/sound/wm1250-ev1.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * linux/sound/wm1250-ev1.h - Platform data for WM1250-EV1 | ||
3 | * | ||
4 | * Copyright 2011 Wolfson Microelectronics. PLC. | ||
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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM1250_EV1_H | ||
12 | #define __LINUX_SND_WM1250_EV1_H | ||
13 | |||
14 | #define WM1250_EV1_NUM_GPIOS 5 | ||
15 | |||
16 | #define WM1250_EV1_GPIO_CLK_ENA 0 | ||
17 | #define WM1250_EV1_GPIO_CLK_SEL0 1 | ||
18 | #define WM1250_EV1_GPIO_CLK_SEL1 2 | ||
19 | #define WM1250_EV1_GPIO_OSR 3 | ||
20 | #define WM1250_EV1_GPIO_MASTER 4 | ||
21 | |||
22 | |||
23 | struct wm1250_ev1_pdata { | ||
24 | int gpios[WM1250_EV1_NUM_GPIOS]; | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/sound/wm5100.h b/include/sound/wm5100.h new file mode 100644 index 000000000000..617d0c4a159f --- /dev/null +++ b/include/sound/wm5100.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * linux/sound/wm5100.h -- Platform data for WM5100 | ||
3 | * | ||
4 | * Copyright 2011 Wolfson Microelectronics. PLC. | ||
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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM5100_H | ||
12 | #define __LINUX_SND_WM5100_H | ||
13 | |||
14 | enum wm5100_in_mode { | ||
15 | WM5100_IN_SE = 0, | ||
16 | WM5100_IN_DIFF = 1, | ||
17 | WM5100_IN_DMIC = 2, | ||
18 | }; | ||
19 | |||
20 | enum wm5100_dmic_sup { | ||
21 | WM5100_DMIC_SUP_MICVDD = 0, | ||
22 | WM5100_DMIC_SUP_MICBIAS1 = 1, | ||
23 | WM5100_DMIC_SUP_MICBIAS2 = 2, | ||
24 | WM5100_DMIC_SUP_MICBIAS3 = 3, | ||
25 | }; | ||
26 | |||
27 | enum wm5100_micdet_bias { | ||
28 | WM5100_MICDET_MICBIAS1 = 0, | ||
29 | WM5100_MICDET_MICBIAS2 = 1, | ||
30 | WM5100_MICDET_MICBIAS3 = 2, | ||
31 | }; | ||
32 | |||
33 | struct wm5100_jack_mode { | ||
34 | enum wm5100_micdet_bias bias; | ||
35 | int hp_pol; | ||
36 | int micd_src; | ||
37 | }; | ||
38 | |||
39 | #define WM5100_GPIO_SET 0x10000 | ||
40 | |||
41 | struct wm5100_pdata { | ||
42 | int reset; /** GPIO controlling /RESET, if any */ | ||
43 | int ldo_ena; /** GPIO controlling LODENA, if any */ | ||
44 | int hp_pol; /** GPIO controlling headset polarity, if any */ | ||
45 | int irq_flags; | ||
46 | int gpio_base; | ||
47 | |||
48 | struct wm5100_jack_mode jack_modes[2]; | ||
49 | |||
50 | /* Input pin mode selection */ | ||
51 | enum wm5100_in_mode in_mode[4]; | ||
52 | |||
53 | /* DMIC supply selection */ | ||
54 | enum wm5100_dmic_sup dmic_sup[4]; | ||
55 | |||
56 | int gpio_defaults[6]; | ||
57 | }; | ||
58 | |||
59 | #endif | ||
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 603f5a0f0365..ab26f8aa3c78 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h | |||
@@ -216,6 +216,31 @@ DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, | |||
216 | 216 | ||
217 | ); | 217 | ); |
218 | 218 | ||
219 | TRACE_EVENT(snd_soc_dapm_walk_done, | ||
220 | |||
221 | TP_PROTO(struct snd_soc_card *card), | ||
222 | |||
223 | TP_ARGS(card), | ||
224 | |||
225 | TP_STRUCT__entry( | ||
226 | __string( name, card->name ) | ||
227 | __field( int, power_checks ) | ||
228 | __field( int, path_checks ) | ||
229 | __field( int, neighbour_checks ) | ||
230 | ), | ||
231 | |||
232 | TP_fast_assign( | ||
233 | __assign_str(name, card->name); | ||
234 | __entry->power_checks = card->dapm_stats.power_checks; | ||
235 | __entry->path_checks = card->dapm_stats.path_checks; | ||
236 | __entry->neighbour_checks = card->dapm_stats.neighbour_checks; | ||
237 | ), | ||
238 | |||
239 | TP_printk("%s: checks %d power, %d path, %d neighbour", | ||
240 | __get_str(name), (int)__entry->power_checks, | ||
241 | (int)__entry->path_checks, (int)__entry->neighbour_checks) | ||
242 | ); | ||
243 | |||
219 | TRACE_EVENT(snd_soc_jack_irq, | 244 | TRACE_EVENT(snd_soc_jack_irq, |
220 | 245 | ||
221 | TP_PROTO(const char *name), | 246 | TP_PROTO(const char *name), |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index b50a54736242..748ff7cbe555 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -9,9 +9,12 @@ | |||
9 | 9 | ||
10 | struct ext4_allocation_context; | 10 | struct ext4_allocation_context; |
11 | struct ext4_allocation_request; | 11 | struct ext4_allocation_request; |
12 | struct ext4_extent; | ||
12 | struct ext4_prealloc_space; | 13 | struct ext4_prealloc_space; |
13 | struct ext4_inode_info; | 14 | struct ext4_inode_info; |
14 | struct mpage_da_data; | 15 | struct mpage_da_data; |
16 | struct ext4_map_blocks; | ||
17 | struct ext4_extent; | ||
15 | 18 | ||
16 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) | 19 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) |
17 | 20 | ||
@@ -1032,9 +1035,9 @@ TRACE_EVENT(ext4_forget, | |||
1032 | ); | 1035 | ); |
1033 | 1036 | ||
1034 | TRACE_EVENT(ext4_da_update_reserve_space, | 1037 | TRACE_EVENT(ext4_da_update_reserve_space, |
1035 | TP_PROTO(struct inode *inode, int used_blocks), | 1038 | TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), |
1036 | 1039 | ||
1037 | TP_ARGS(inode, used_blocks), | 1040 | TP_ARGS(inode, used_blocks, quota_claim), |
1038 | 1041 | ||
1039 | TP_STRUCT__entry( | 1042 | TP_STRUCT__entry( |
1040 | __field( dev_t, dev ) | 1043 | __field( dev_t, dev ) |
@@ -1045,6 +1048,7 @@ TRACE_EVENT(ext4_da_update_reserve_space, | |||
1045 | __field( int, reserved_data_blocks ) | 1048 | __field( int, reserved_data_blocks ) |
1046 | __field( int, reserved_meta_blocks ) | 1049 | __field( int, reserved_meta_blocks ) |
1047 | __field( int, allocated_meta_blocks ) | 1050 | __field( int, allocated_meta_blocks ) |
1051 | __field( int, quota_claim ) | ||
1048 | ), | 1052 | ), |
1049 | 1053 | ||
1050 | TP_fast_assign( | 1054 | TP_fast_assign( |
@@ -1053,19 +1057,24 @@ TRACE_EVENT(ext4_da_update_reserve_space, | |||
1053 | __entry->mode = inode->i_mode; | 1057 | __entry->mode = inode->i_mode; |
1054 | __entry->i_blocks = inode->i_blocks; | 1058 | __entry->i_blocks = inode->i_blocks; |
1055 | __entry->used_blocks = used_blocks; | 1059 | __entry->used_blocks = used_blocks; |
1056 | __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks; | 1060 | __entry->reserved_data_blocks = |
1057 | __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; | 1061 | EXT4_I(inode)->i_reserved_data_blocks; |
1058 | __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; | 1062 | __entry->reserved_meta_blocks = |
1063 | EXT4_I(inode)->i_reserved_meta_blocks; | ||
1064 | __entry->allocated_meta_blocks = | ||
1065 | EXT4_I(inode)->i_allocated_meta_blocks; | ||
1066 | __entry->quota_claim = quota_claim; | ||
1059 | ), | 1067 | ), |
1060 | 1068 | ||
1061 | TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d " | 1069 | TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d " |
1062 | "reserved_data_blocks %d reserved_meta_blocks %d " | 1070 | "reserved_data_blocks %d reserved_meta_blocks %d " |
1063 | "allocated_meta_blocks %d", | 1071 | "allocated_meta_blocks %d quota_claim %d", |
1064 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1072 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1065 | (unsigned long) __entry->ino, | 1073 | (unsigned long) __entry->ino, |
1066 | __entry->mode, __entry->i_blocks, | 1074 | __entry->mode, __entry->i_blocks, |
1067 | __entry->used_blocks, __entry->reserved_data_blocks, | 1075 | __entry->used_blocks, __entry->reserved_data_blocks, |
1068 | __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) | 1076 | __entry->reserved_meta_blocks, __entry->allocated_meta_blocks, |
1077 | __entry->quota_claim) | ||
1069 | ); | 1078 | ); |
1070 | 1079 | ||
1071 | TRACE_EVENT(ext4_da_reserve_space, | 1080 | TRACE_EVENT(ext4_da_reserve_space, |
@@ -1386,6 +1395,87 @@ DEFINE_EVENT(ext4__truncate, ext4_truncate_exit, | |||
1386 | TP_ARGS(inode) | 1395 | TP_ARGS(inode) |
1387 | ); | 1396 | ); |
1388 | 1397 | ||
1398 | /* 'ux' is the uninitialized extent. */ | ||
1399 | TRACE_EVENT(ext4_ext_convert_to_initialized_enter, | ||
1400 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, | ||
1401 | struct ext4_extent *ux), | ||
1402 | |||
1403 | TP_ARGS(inode, map, ux), | ||
1404 | |||
1405 | TP_STRUCT__entry( | ||
1406 | __field( ino_t, ino ) | ||
1407 | __field( dev_t, dev ) | ||
1408 | __field( ext4_lblk_t, m_lblk ) | ||
1409 | __field( unsigned, m_len ) | ||
1410 | __field( ext4_lblk_t, u_lblk ) | ||
1411 | __field( unsigned, u_len ) | ||
1412 | __field( ext4_fsblk_t, u_pblk ) | ||
1413 | ), | ||
1414 | |||
1415 | TP_fast_assign( | ||
1416 | __entry->ino = inode->i_ino; | ||
1417 | __entry->dev = inode->i_sb->s_dev; | ||
1418 | __entry->m_lblk = map->m_lblk; | ||
1419 | __entry->m_len = map->m_len; | ||
1420 | __entry->u_lblk = le32_to_cpu(ux->ee_block); | ||
1421 | __entry->u_len = ext4_ext_get_actual_len(ux); | ||
1422 | __entry->u_pblk = ext4_ext_pblock(ux); | ||
1423 | ), | ||
1424 | |||
1425 | TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u " | ||
1426 | "u_pblk %llu", | ||
1427 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1428 | (unsigned long) __entry->ino, | ||
1429 | __entry->m_lblk, __entry->m_len, | ||
1430 | __entry->u_lblk, __entry->u_len, __entry->u_pblk) | ||
1431 | ); | ||
1432 | |||
1433 | /* | ||
1434 | * 'ux' is the uninitialized extent. | ||
1435 | * 'ix' is the initialized extent to which blocks are transferred. | ||
1436 | */ | ||
1437 | TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath, | ||
1438 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, | ||
1439 | struct ext4_extent *ux, struct ext4_extent *ix), | ||
1440 | |||
1441 | TP_ARGS(inode, map, ux, ix), | ||
1442 | |||
1443 | TP_STRUCT__entry( | ||
1444 | __field( ino_t, ino ) | ||
1445 | __field( dev_t, dev ) | ||
1446 | __field( ext4_lblk_t, m_lblk ) | ||
1447 | __field( unsigned, m_len ) | ||
1448 | __field( ext4_lblk_t, u_lblk ) | ||
1449 | __field( unsigned, u_len ) | ||
1450 | __field( ext4_fsblk_t, u_pblk ) | ||
1451 | __field( ext4_lblk_t, i_lblk ) | ||
1452 | __field( unsigned, i_len ) | ||
1453 | __field( ext4_fsblk_t, i_pblk ) | ||
1454 | ), | ||
1455 | |||
1456 | TP_fast_assign( | ||
1457 | __entry->ino = inode->i_ino; | ||
1458 | __entry->dev = inode->i_sb->s_dev; | ||
1459 | __entry->m_lblk = map->m_lblk; | ||
1460 | __entry->m_len = map->m_len; | ||
1461 | __entry->u_lblk = le32_to_cpu(ux->ee_block); | ||
1462 | __entry->u_len = ext4_ext_get_actual_len(ux); | ||
1463 | __entry->u_pblk = ext4_ext_pblock(ux); | ||
1464 | __entry->i_lblk = le32_to_cpu(ix->ee_block); | ||
1465 | __entry->i_len = ext4_ext_get_actual_len(ix); | ||
1466 | __entry->i_pblk = ext4_ext_pblock(ix); | ||
1467 | ), | ||
1468 | |||
1469 | TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u " | ||
1470 | "u_lblk %u u_len %u u_pblk %llu " | ||
1471 | "i_lblk %u i_len %u i_pblk %llu ", | ||
1472 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1473 | (unsigned long) __entry->ino, | ||
1474 | __entry->m_lblk, __entry->m_len, | ||
1475 | __entry->u_lblk, __entry->u_len, __entry->u_pblk, | ||
1476 | __entry->i_lblk, __entry->i_len, __entry->i_pblk) | ||
1477 | ); | ||
1478 | |||
1389 | DECLARE_EVENT_CLASS(ext4__map_blocks_enter, | 1479 | DECLARE_EVENT_CLASS(ext4__map_blocks_enter, |
1390 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, | 1480 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, |
1391 | unsigned int len, unsigned int flags), | 1481 | unsigned int len, unsigned int flags), |
@@ -1589,6 +1679,382 @@ DEFINE_EVENT(ext4__trim, ext4_trim_all_free, | |||
1589 | TP_ARGS(sb, group, start, len) | 1679 | TP_ARGS(sb, group, start, len) |
1590 | ); | 1680 | ); |
1591 | 1681 | ||
1682 | TRACE_EVENT(ext4_ext_handle_uninitialized_extents, | ||
1683 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, | ||
1684 | unsigned int allocated, ext4_fsblk_t newblock), | ||
1685 | |||
1686 | TP_ARGS(inode, map, allocated, newblock), | ||
1687 | |||
1688 | TP_STRUCT__entry( | ||
1689 | __field( ino_t, ino ) | ||
1690 | __field( dev_t, dev ) | ||
1691 | __field( ext4_lblk_t, lblk ) | ||
1692 | __field( ext4_fsblk_t, pblk ) | ||
1693 | __field( unsigned int, len ) | ||
1694 | __field( int, flags ) | ||
1695 | __field( unsigned int, allocated ) | ||
1696 | __field( ext4_fsblk_t, newblk ) | ||
1697 | ), | ||
1698 | |||
1699 | TP_fast_assign( | ||
1700 | __entry->ino = inode->i_ino; | ||
1701 | __entry->dev = inode->i_sb->s_dev; | ||
1702 | __entry->lblk = map->m_lblk; | ||
1703 | __entry->pblk = map->m_pblk; | ||
1704 | __entry->len = map->m_len; | ||
1705 | __entry->flags = map->m_flags; | ||
1706 | __entry->allocated = allocated; | ||
1707 | __entry->newblk = newblock; | ||
1708 | ), | ||
1709 | |||
1710 | TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %d" | ||
1711 | "allocated %d newblock %llu", | ||
1712 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1713 | (unsigned long) __entry->ino, | ||
1714 | (unsigned) __entry->lblk, (unsigned long long) __entry->pblk, | ||
1715 | __entry->len, __entry->flags, | ||
1716 | (unsigned int) __entry->allocated, | ||
1717 | (unsigned long long) __entry->newblk) | ||
1718 | ); | ||
1719 | |||
1720 | TRACE_EVENT(ext4_get_implied_cluster_alloc_exit, | ||
1721 | TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret), | ||
1722 | |||
1723 | TP_ARGS(sb, map, ret), | ||
1724 | |||
1725 | TP_STRUCT__entry( | ||
1726 | __field( dev_t, dev ) | ||
1727 | __field( ext4_lblk_t, lblk ) | ||
1728 | __field( ext4_fsblk_t, pblk ) | ||
1729 | __field( unsigned int, len ) | ||
1730 | __field( unsigned int, flags ) | ||
1731 | __field( int, ret ) | ||
1732 | ), | ||
1733 | |||
1734 | TP_fast_assign( | ||
1735 | __entry->dev = sb->s_dev; | ||
1736 | __entry->lblk = map->m_lblk; | ||
1737 | __entry->pblk = map->m_pblk; | ||
1738 | __entry->len = map->m_len; | ||
1739 | __entry->flags = map->m_flags; | ||
1740 | __entry->ret = ret; | ||
1741 | ), | ||
1742 | |||
1743 | TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d", | ||
1744 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1745 | __entry->lblk, (unsigned long long) __entry->pblk, | ||
1746 | __entry->len, __entry->flags, __entry->ret) | ||
1747 | ); | ||
1748 | |||
1749 | TRACE_EVENT(ext4_ext_put_in_cache, | ||
1750 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len, | ||
1751 | ext4_fsblk_t start), | ||
1752 | |||
1753 | TP_ARGS(inode, lblk, len, start), | ||
1754 | |||
1755 | TP_STRUCT__entry( | ||
1756 | __field( ino_t, ino ) | ||
1757 | __field( dev_t, dev ) | ||
1758 | __field( ext4_lblk_t, lblk ) | ||
1759 | __field( unsigned int, len ) | ||
1760 | __field( ext4_fsblk_t, start ) | ||
1761 | ), | ||
1762 | |||
1763 | TP_fast_assign( | ||
1764 | __entry->ino = inode->i_ino; | ||
1765 | __entry->dev = inode->i_sb->s_dev; | ||
1766 | __entry->lblk = lblk; | ||
1767 | __entry->len = len; | ||
1768 | __entry->start = start; | ||
1769 | ), | ||
1770 | |||
1771 | TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu", | ||
1772 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1773 | (unsigned long) __entry->ino, | ||
1774 | (unsigned) __entry->lblk, | ||
1775 | __entry->len, | ||
1776 | (unsigned long long) __entry->start) | ||
1777 | ); | ||
1778 | |||
1779 | TRACE_EVENT(ext4_ext_in_cache, | ||
1780 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret), | ||
1781 | |||
1782 | TP_ARGS(inode, lblk, ret), | ||
1783 | |||
1784 | TP_STRUCT__entry( | ||
1785 | __field( ino_t, ino ) | ||
1786 | __field( dev_t, dev ) | ||
1787 | __field( ext4_lblk_t, lblk ) | ||
1788 | __field( int, ret ) | ||
1789 | ), | ||
1790 | |||
1791 | TP_fast_assign( | ||
1792 | __entry->ino = inode->i_ino; | ||
1793 | __entry->dev = inode->i_sb->s_dev; | ||
1794 | __entry->lblk = lblk; | ||
1795 | __entry->ret = ret; | ||
1796 | ), | ||
1797 | |||
1798 | TP_printk("dev %d,%d ino %lu lblk %u ret %d", | ||
1799 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1800 | (unsigned long) __entry->ino, | ||
1801 | (unsigned) __entry->lblk, | ||
1802 | __entry->ret) | ||
1803 | |||
1804 | ); | ||
1805 | |||
1806 | TRACE_EVENT(ext4_find_delalloc_range, | ||
1807 | TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to, | ||
1808 | int reverse, int found, ext4_lblk_t found_blk), | ||
1809 | |||
1810 | TP_ARGS(inode, from, to, reverse, found, found_blk), | ||
1811 | |||
1812 | TP_STRUCT__entry( | ||
1813 | __field( ino_t, ino ) | ||
1814 | __field( dev_t, dev ) | ||
1815 | __field( ext4_lblk_t, from ) | ||
1816 | __field( ext4_lblk_t, to ) | ||
1817 | __field( int, reverse ) | ||
1818 | __field( int, found ) | ||
1819 | __field( ext4_lblk_t, found_blk ) | ||
1820 | ), | ||
1821 | |||
1822 | TP_fast_assign( | ||
1823 | __entry->ino = inode->i_ino; | ||
1824 | __entry->dev = inode->i_sb->s_dev; | ||
1825 | __entry->from = from; | ||
1826 | __entry->to = to; | ||
1827 | __entry->reverse = reverse; | ||
1828 | __entry->found = found; | ||
1829 | __entry->found_blk = found_blk; | ||
1830 | ), | ||
1831 | |||
1832 | TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d " | ||
1833 | "(blk = %u)", | ||
1834 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1835 | (unsigned long) __entry->ino, | ||
1836 | (unsigned) __entry->from, (unsigned) __entry->to, | ||
1837 | __entry->reverse, __entry->found, | ||
1838 | (unsigned) __entry->found_blk) | ||
1839 | ); | ||
1840 | |||
1841 | TRACE_EVENT(ext4_get_reserved_cluster_alloc, | ||
1842 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len), | ||
1843 | |||
1844 | TP_ARGS(inode, lblk, len), | ||
1845 | |||
1846 | TP_STRUCT__entry( | ||
1847 | __field( ino_t, ino ) | ||
1848 | __field( dev_t, dev ) | ||
1849 | __field( ext4_lblk_t, lblk ) | ||
1850 | __field( unsigned int, len ) | ||
1851 | ), | ||
1852 | |||
1853 | TP_fast_assign( | ||
1854 | __entry->ino = inode->i_ino; | ||
1855 | __entry->dev = inode->i_sb->s_dev; | ||
1856 | __entry->lblk = lblk; | ||
1857 | __entry->len = len; | ||
1858 | ), | ||
1859 | |||
1860 | TP_printk("dev %d,%d ino %lu lblk %u len %u", | ||
1861 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1862 | (unsigned long) __entry->ino, | ||
1863 | (unsigned) __entry->lblk, | ||
1864 | __entry->len) | ||
1865 | ); | ||
1866 | |||
1867 | TRACE_EVENT(ext4_ext_show_extent, | ||
1868 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk, | ||
1869 | unsigned short len), | ||
1870 | |||
1871 | TP_ARGS(inode, lblk, pblk, len), | ||
1872 | |||
1873 | TP_STRUCT__entry( | ||
1874 | __field( ino_t, ino ) | ||
1875 | __field( dev_t, dev ) | ||
1876 | __field( ext4_lblk_t, lblk ) | ||
1877 | __field( ext4_fsblk_t, pblk ) | ||
1878 | __field( unsigned short, len ) | ||
1879 | ), | ||
1880 | |||
1881 | TP_fast_assign( | ||
1882 | __entry->ino = inode->i_ino; | ||
1883 | __entry->dev = inode->i_sb->s_dev; | ||
1884 | __entry->lblk = lblk; | ||
1885 | __entry->pblk = pblk; | ||
1886 | __entry->len = len; | ||
1887 | ), | ||
1888 | |||
1889 | TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u", | ||
1890 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1891 | (unsigned long) __entry->ino, | ||
1892 | (unsigned) __entry->lblk, | ||
1893 | (unsigned long long) __entry->pblk, | ||
1894 | (unsigned short) __entry->len) | ||
1895 | ); | ||
1896 | |||
1897 | TRACE_EVENT(ext4_remove_blocks, | ||
1898 | TP_PROTO(struct inode *inode, struct ext4_extent *ex, | ||
1899 | ext4_lblk_t from, ext4_fsblk_t to, | ||
1900 | ext4_fsblk_t partial_cluster), | ||
1901 | |||
1902 | TP_ARGS(inode, ex, from, to, partial_cluster), | ||
1903 | |||
1904 | TP_STRUCT__entry( | ||
1905 | __field( ino_t, ino ) | ||
1906 | __field( dev_t, dev ) | ||
1907 | __field( ext4_lblk_t, ee_lblk ) | ||
1908 | __field( ext4_fsblk_t, ee_pblk ) | ||
1909 | __field( unsigned short, ee_len ) | ||
1910 | __field( ext4_lblk_t, from ) | ||
1911 | __field( ext4_lblk_t, to ) | ||
1912 | __field( ext4_fsblk_t, partial ) | ||
1913 | ), | ||
1914 | |||
1915 | TP_fast_assign( | ||
1916 | __entry->ino = inode->i_ino; | ||
1917 | __entry->dev = inode->i_sb->s_dev; | ||
1918 | __entry->ee_lblk = cpu_to_le32(ex->ee_block); | ||
1919 | __entry->ee_pblk = ext4_ext_pblock(ex); | ||
1920 | __entry->ee_len = ext4_ext_get_actual_len(ex); | ||
1921 | __entry->from = from; | ||
1922 | __entry->to = to; | ||
1923 | __entry->partial = partial_cluster; | ||
1924 | ), | ||
1925 | |||
1926 | TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]" | ||
1927 | "from %u to %u partial_cluster %u", | ||
1928 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1929 | (unsigned long) __entry->ino, | ||
1930 | (unsigned) __entry->ee_lblk, | ||
1931 | (unsigned long long) __entry->ee_pblk, | ||
1932 | (unsigned short) __entry->ee_len, | ||
1933 | (unsigned) __entry->from, | ||
1934 | (unsigned) __entry->to, | ||
1935 | (unsigned) __entry->partial) | ||
1936 | ); | ||
1937 | |||
1938 | TRACE_EVENT(ext4_ext_rm_leaf, | ||
1939 | TP_PROTO(struct inode *inode, ext4_lblk_t start, | ||
1940 | struct ext4_extent *ex, ext4_fsblk_t partial_cluster), | ||
1941 | |||
1942 | TP_ARGS(inode, start, ex, partial_cluster), | ||
1943 | |||
1944 | TP_STRUCT__entry( | ||
1945 | __field( ino_t, ino ) | ||
1946 | __field( dev_t, dev ) | ||
1947 | __field( ext4_lblk_t, start ) | ||
1948 | __field( ext4_lblk_t, ee_lblk ) | ||
1949 | __field( ext4_fsblk_t, ee_pblk ) | ||
1950 | __field( short, ee_len ) | ||
1951 | __field( ext4_fsblk_t, partial ) | ||
1952 | ), | ||
1953 | |||
1954 | TP_fast_assign( | ||
1955 | __entry->ino = inode->i_ino; | ||
1956 | __entry->dev = inode->i_sb->s_dev; | ||
1957 | __entry->start = start; | ||
1958 | __entry->ee_lblk = le32_to_cpu(ex->ee_block); | ||
1959 | __entry->ee_pblk = ext4_ext_pblock(ex); | ||
1960 | __entry->ee_len = ext4_ext_get_actual_len(ex); | ||
1961 | __entry->partial = partial_cluster; | ||
1962 | ), | ||
1963 | |||
1964 | TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]" | ||
1965 | "partial_cluster %u", | ||
1966 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1967 | (unsigned long) __entry->ino, | ||
1968 | (unsigned) __entry->start, | ||
1969 | (unsigned) __entry->ee_lblk, | ||
1970 | (unsigned long long) __entry->ee_pblk, | ||
1971 | (unsigned short) __entry->ee_len, | ||
1972 | (unsigned) __entry->partial) | ||
1973 | ); | ||
1974 | |||
1975 | TRACE_EVENT(ext4_ext_rm_idx, | ||
1976 | TP_PROTO(struct inode *inode, ext4_fsblk_t pblk), | ||
1977 | |||
1978 | TP_ARGS(inode, pblk), | ||
1979 | |||
1980 | TP_STRUCT__entry( | ||
1981 | __field( ino_t, ino ) | ||
1982 | __field( dev_t, dev ) | ||
1983 | __field( ext4_fsblk_t, pblk ) | ||
1984 | ), | ||
1985 | |||
1986 | TP_fast_assign( | ||
1987 | __entry->ino = inode->i_ino; | ||
1988 | __entry->dev = inode->i_sb->s_dev; | ||
1989 | __entry->pblk = pblk; | ||
1990 | ), | ||
1991 | |||
1992 | TP_printk("dev %d,%d ino %lu index_pblk %llu", | ||
1993 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1994 | (unsigned long) __entry->ino, | ||
1995 | (unsigned long long) __entry->pblk) | ||
1996 | ); | ||
1997 | |||
1998 | TRACE_EVENT(ext4_ext_remove_space, | ||
1999 | TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth), | ||
2000 | |||
2001 | TP_ARGS(inode, start, depth), | ||
2002 | |||
2003 | TP_STRUCT__entry( | ||
2004 | __field( ino_t, ino ) | ||
2005 | __field( dev_t, dev ) | ||
2006 | __field( ext4_lblk_t, start ) | ||
2007 | __field( int, depth ) | ||
2008 | ), | ||
2009 | |||
2010 | TP_fast_assign( | ||
2011 | __entry->ino = inode->i_ino; | ||
2012 | __entry->dev = inode->i_sb->s_dev; | ||
2013 | __entry->start = start; | ||
2014 | __entry->depth = depth; | ||
2015 | ), | ||
2016 | |||
2017 | TP_printk("dev %d,%d ino %lu since %u depth %d", | ||
2018 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2019 | (unsigned long) __entry->ino, | ||
2020 | (unsigned) __entry->start, | ||
2021 | __entry->depth) | ||
2022 | ); | ||
2023 | |||
2024 | TRACE_EVENT(ext4_ext_remove_space_done, | ||
2025 | TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth, | ||
2026 | ext4_lblk_t partial, unsigned short eh_entries), | ||
2027 | |||
2028 | TP_ARGS(inode, start, depth, partial, eh_entries), | ||
2029 | |||
2030 | TP_STRUCT__entry( | ||
2031 | __field( ino_t, ino ) | ||
2032 | __field( dev_t, dev ) | ||
2033 | __field( ext4_lblk_t, start ) | ||
2034 | __field( int, depth ) | ||
2035 | __field( ext4_lblk_t, partial ) | ||
2036 | __field( unsigned short, eh_entries ) | ||
2037 | ), | ||
2038 | |||
2039 | TP_fast_assign( | ||
2040 | __entry->ino = inode->i_ino; | ||
2041 | __entry->dev = inode->i_sb->s_dev; | ||
2042 | __entry->start = start; | ||
2043 | __entry->depth = depth; | ||
2044 | __entry->partial = partial; | ||
2045 | __entry->eh_entries = eh_entries; | ||
2046 | ), | ||
2047 | |||
2048 | TP_printk("dev %d,%d ino %lu since %u depth %d partial %u " | ||
2049 | "remaining_entries %u", | ||
2050 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
2051 | (unsigned long) __entry->ino, | ||
2052 | (unsigned) __entry->start, | ||
2053 | __entry->depth, | ||
2054 | (unsigned) __entry->partial, | ||
2055 | (unsigned short) __entry->eh_entries) | ||
2056 | ); | ||
2057 | |||
1592 | #endif /* _TRACE_EXT4_H */ | 2058 | #endif /* _TRACE_EXT4_H */ |
1593 | 2059 | ||
1594 | /* This part must be outside protection */ | 2060 | /* This part must be outside protection */ |
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index 36851f7f13da..edc4b3d25a2d 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -266,7 +266,7 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, | |||
266 | unsigned long nr_lumpy_taken, | 266 | unsigned long nr_lumpy_taken, |
267 | unsigned long nr_lumpy_dirty, | 267 | unsigned long nr_lumpy_dirty, |
268 | unsigned long nr_lumpy_failed, | 268 | unsigned long nr_lumpy_failed, |
269 | int isolate_mode), | 269 | isolate_mode_t isolate_mode), |
270 | 270 | ||
271 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode), | 271 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode), |
272 | 272 | ||
@@ -278,7 +278,7 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, | |||
278 | __field(unsigned long, nr_lumpy_taken) | 278 | __field(unsigned long, nr_lumpy_taken) |
279 | __field(unsigned long, nr_lumpy_dirty) | 279 | __field(unsigned long, nr_lumpy_dirty) |
280 | __field(unsigned long, nr_lumpy_failed) | 280 | __field(unsigned long, nr_lumpy_failed) |
281 | __field(int, isolate_mode) | 281 | __field(isolate_mode_t, isolate_mode) |
282 | ), | 282 | ), |
283 | 283 | ||
284 | TP_fast_assign( | 284 | TP_fast_assign( |
@@ -312,7 +312,7 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, | |||
312 | unsigned long nr_lumpy_taken, | 312 | unsigned long nr_lumpy_taken, |
313 | unsigned long nr_lumpy_dirty, | 313 | unsigned long nr_lumpy_dirty, |
314 | unsigned long nr_lumpy_failed, | 314 | unsigned long nr_lumpy_failed, |
315 | int isolate_mode), | 315 | isolate_mode_t isolate_mode), |
316 | 316 | ||
317 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) | 317 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) |
318 | 318 | ||
@@ -327,7 +327,7 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, | |||
327 | unsigned long nr_lumpy_taken, | 327 | unsigned long nr_lumpy_taken, |
328 | unsigned long nr_lumpy_dirty, | 328 | unsigned long nr_lumpy_dirty, |
329 | unsigned long nr_lumpy_failed, | 329 | unsigned long nr_lumpy_failed, |
330 | int isolate_mode), | 330 | isolate_mode_t isolate_mode), |
331 | 331 | ||
332 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) | 332 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) |
333 | 333 | ||
diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h new file mode 100644 index 000000000000..87ad567b4229 --- /dev/null +++ b/include/video/omap-panel-dvi.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Header for DVI output driver | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments Inc | ||
5 | * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __OMAP_PANEL_DVI_H | ||
21 | #define __OMAP_PANEL_DVI_H | ||
22 | |||
23 | struct omap_dss_device; | ||
24 | |||
25 | /** | ||
26 | * struct panel_dvi_platform_data - panel driver configuration data | ||
27 | * @platform_enable: platform specific panel enable function | ||
28 | * @platform_disable: platform specific panel disable function | ||
29 | * @i2c_bus_num: i2c bus id for the panel | ||
30 | */ | ||
31 | struct panel_dvi_platform_data { | ||
32 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
33 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
34 | u16 i2c_bus_num; | ||
35 | }; | ||
36 | |||
37 | #endif /* __OMAP_PANEL_DVI_H */ | ||
diff --git a/include/video/omap-panel-n8x0.h b/include/video/omap-panel-n8x0.h new file mode 100644 index 000000000000..50a1302e2cfd --- /dev/null +++ b/include/video/omap-panel-n8x0.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __OMAP_PANEL_N8X0_H | ||
2 | #define __OMAP_PANEL_N8X0_H | ||
3 | |||
4 | struct omap_dss_device; | ||
5 | |||
6 | struct panel_n8x0_data { | ||
7 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
8 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
9 | int panel_reset; | ||
10 | int ctrl_pwrdown; | ||
11 | |||
12 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
13 | }; | ||
14 | |||
15 | #endif | ||
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h index 921ae9327228..7dc71f9c13e6 100644 --- a/include/video/omap-panel-nokia-dsi.h +++ b/include/video/omap-panel-nokia-dsi.h | |||
@@ -10,9 +10,7 @@ struct omap_dss_device; | |||
10 | * @ext_te_gpio: external TE GPIO | 10 | * @ext_te_gpio: external TE GPIO |
11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) | 11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) |
12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) | 12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) |
13 | * @max_backlight_level: maximum backlight level | 13 | * @use_dsi_backlight: true if panel uses DSI command to control backlight |
14 | * @set_backlight: pointer to backlight set function | ||
15 | * @get_backlight: pointer to backlight get function | ||
16 | */ | 14 | */ |
17 | struct nokia_dsi_panel_data { | 15 | struct nokia_dsi_panel_data { |
18 | const char *name; | 16 | const char *name; |
@@ -25,9 +23,7 @@ struct nokia_dsi_panel_data { | |||
25 | unsigned esd_interval; | 23 | unsigned esd_interval; |
26 | unsigned ulps_timeout; | 24 | unsigned ulps_timeout; |
27 | 25 | ||
28 | int max_backlight_level; | 26 | bool use_dsi_backlight; |
29 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
30 | int (*get_backlight)(struct omap_dss_device *dssdev); | ||
31 | }; | 27 | }; |
32 | 28 | ||
33 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ | 29 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ |
diff --git a/include/video/omap-panel-picodlp.h b/include/video/omap-panel-picodlp.h new file mode 100644 index 000000000000..1c342ef6f3a1 --- /dev/null +++ b/include/video/omap-panel-picodlp.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * panel data for picodlp panel | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments | ||
5 | * | ||
6 | * Author: Mayuresh Janorkar <mayur@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 | #ifndef __PANEL_PICODLP_H | ||
13 | #define __PANEL_PICODLP_H | ||
14 | /** | ||
15 | * struct : picodlp panel data | ||
16 | * picodlp_adapter_id: i2c_adapter number for picodlp | ||
17 | */ | ||
18 | struct picodlp_panel_data { | ||
19 | int picodlp_adapter_id; | ||
20 | int emu_done_gpio; | ||
21 | int pwrgood_gpio; | ||
22 | }; | ||
23 | #endif /* __PANEL_PICODLP_H */ | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3b55ef22f8db..b66ebb2032c6 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -41,8 +41,13 @@ | |||
41 | #define DISPC_IRQ_WAKEUP (1 << 16) | 41 | #define DISPC_IRQ_WAKEUP (1 << 16) |
42 | #define DISPC_IRQ_SYNC_LOST2 (1 << 17) | 42 | #define DISPC_IRQ_SYNC_LOST2 (1 << 17) |
43 | #define DISPC_IRQ_VSYNC2 (1 << 18) | 43 | #define DISPC_IRQ_VSYNC2 (1 << 18) |
44 | #define DISPC_IRQ_VID3_END_WIN (1 << 19) | ||
45 | #define DISPC_IRQ_VID3_FIFO_UNDERFLOW (1 << 20) | ||
44 | #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) | 46 | #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) |
45 | #define DISPC_IRQ_FRAMEDONE2 (1 << 22) | 47 | #define DISPC_IRQ_FRAMEDONE2 (1 << 22) |
48 | #define DISPC_IRQ_FRAMEDONEWB (1 << 23) | ||
49 | #define DISPC_IRQ_FRAMEDONETV (1 << 24) | ||
50 | #define DISPC_IRQ_WBBUFFEROVERFLOW (1 << 25) | ||
46 | 51 | ||
47 | struct omap_dss_device; | 52 | struct omap_dss_device; |
48 | struct omap_overlay_manager; | 53 | struct omap_overlay_manager; |
@@ -60,7 +65,8 @@ enum omap_display_type { | |||
60 | enum omap_plane { | 65 | enum omap_plane { |
61 | OMAP_DSS_GFX = 0, | 66 | OMAP_DSS_GFX = 0, |
62 | OMAP_DSS_VIDEO1 = 1, | 67 | OMAP_DSS_VIDEO1 = 1, |
63 | OMAP_DSS_VIDEO2 = 2 | 68 | OMAP_DSS_VIDEO2 = 2, |
69 | OMAP_DSS_VIDEO3 = 3, | ||
64 | }; | 70 | }; |
65 | 71 | ||
66 | enum omap_channel { | 72 | enum omap_channel { |
@@ -129,6 +135,18 @@ enum omap_dss_venc_type { | |||
129 | OMAP_DSS_VENC_TYPE_SVIDEO, | 135 | OMAP_DSS_VENC_TYPE_SVIDEO, |
130 | }; | 136 | }; |
131 | 137 | ||
138 | enum omap_dss_dsi_pixel_format { | ||
139 | OMAP_DSS_DSI_FMT_RGB888, | ||
140 | OMAP_DSS_DSI_FMT_RGB666, | ||
141 | OMAP_DSS_DSI_FMT_RGB666_PACKED, | ||
142 | OMAP_DSS_DSI_FMT_RGB565, | ||
143 | }; | ||
144 | |||
145 | enum omap_dss_dsi_mode { | ||
146 | OMAP_DSS_DSI_CMD_MODE = 0, | ||
147 | OMAP_DSS_DSI_VIDEO_MODE, | ||
148 | }; | ||
149 | |||
132 | enum omap_display_caps { | 150 | enum omap_display_caps { |
133 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, | 151 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, |
134 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, | 152 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, |
@@ -162,11 +180,13 @@ enum omap_dss_rotation_angle { | |||
162 | 180 | ||
163 | enum omap_overlay_caps { | 181 | enum omap_overlay_caps { |
164 | OMAP_DSS_OVL_CAP_SCALE = 1 << 0, | 182 | OMAP_DSS_OVL_CAP_SCALE = 1 << 0, |
165 | OMAP_DSS_OVL_CAP_DISPC = 1 << 1, | 183 | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1, |
184 | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2, | ||
185 | OMAP_DSS_OVL_CAP_ZORDER = 1 << 3, | ||
166 | }; | 186 | }; |
167 | 187 | ||
168 | enum omap_overlay_manager_caps { | 188 | enum omap_overlay_manager_caps { |
169 | OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, | 189 | OMAP_DSS_DUMMY_VALUE, /* add a dummy value to prevent compiler error */ |
170 | }; | 190 | }; |
171 | 191 | ||
172 | enum omap_dss_clk_source { | 192 | enum omap_dss_clk_source { |
@@ -215,26 +235,67 @@ void rfbi_bus_lock(void); | |||
215 | void rfbi_bus_unlock(void); | 235 | void rfbi_bus_unlock(void); |
216 | 236 | ||
217 | /* DSI */ | 237 | /* DSI */ |
238 | |||
239 | struct omap_dss_dsi_videomode_data { | ||
240 | /* DSI video mode blanking data */ | ||
241 | /* Unit: byte clock cycles */ | ||
242 | u16 hsa; | ||
243 | u16 hfp; | ||
244 | u16 hbp; | ||
245 | /* Unit: line clocks */ | ||
246 | u16 vsa; | ||
247 | u16 vfp; | ||
248 | u16 vbp; | ||
249 | |||
250 | /* DSI blanking modes */ | ||
251 | int blanking_mode; | ||
252 | int hsa_blanking_mode; | ||
253 | int hbp_blanking_mode; | ||
254 | int hfp_blanking_mode; | ||
255 | |||
256 | /* Video port sync events */ | ||
257 | int vp_de_pol; | ||
258 | int vp_hsync_pol; | ||
259 | int vp_vsync_pol; | ||
260 | bool vp_vsync_end; | ||
261 | bool vp_hsync_end; | ||
262 | |||
263 | bool ddr_clk_always_on; | ||
264 | int window_sync; | ||
265 | }; | ||
266 | |||
218 | void dsi_bus_lock(struct omap_dss_device *dssdev); | 267 | void dsi_bus_lock(struct omap_dss_device *dssdev); |
219 | void dsi_bus_unlock(struct omap_dss_device *dssdev); | 268 | void dsi_bus_unlock(struct omap_dss_device *dssdev); |
220 | int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, | 269 | int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, |
221 | int len); | 270 | int len); |
222 | int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, | 271 | int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data, |
223 | u8 dcs_cmd); | 272 | int len); |
273 | int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd); | ||
274 | int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel); | ||
224 | int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 275 | int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, |
225 | u8 param); | 276 | u8 param); |
277 | int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel, | ||
278 | u8 param); | ||
279 | int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel, | ||
280 | u8 param1, u8 param2); | ||
226 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, | 281 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, |
227 | u8 *data, int len); | 282 | u8 *data, int len); |
283 | int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel, | ||
284 | u8 *data, int len); | ||
228 | int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 285 | int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, |
229 | u8 *buf, int buflen); | 286 | u8 *buf, int buflen); |
230 | int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 287 | int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf, |
231 | u8 *data); | 288 | int buflen); |
232 | int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | 289 | int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param, |
233 | u8 *data1, u8 *data2); | 290 | u8 *buf, int buflen); |
291 | int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel, | ||
292 | u8 param1, u8 param2, u8 *buf, int buflen); | ||
234 | int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, | 293 | int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, |
235 | u16 len); | 294 | u16 len); |
236 | int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); | 295 | int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); |
237 | int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); | 296 | int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); |
297 | int dsi_video_mode_enable(struct omap_dss_device *dssdev, int channel); | ||
298 | void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel); | ||
238 | 299 | ||
239 | /* Board specific data */ | 300 | /* Board specific data */ |
240 | struct omap_dss_board_info { | 301 | struct omap_dss_board_info { |
@@ -242,7 +303,8 @@ struct omap_dss_board_info { | |||
242 | int num_devices; | 303 | int num_devices; |
243 | struct omap_dss_device **devices; | 304 | struct omap_dss_device **devices; |
244 | struct omap_dss_device *default_device; | 305 | struct omap_dss_device *default_device; |
245 | void (*dsi_mux_pads)(bool enable); | 306 | int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); |
307 | void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); | ||
246 | }; | 308 | }; |
247 | 309 | ||
248 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) | 310 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) |
@@ -300,7 +362,6 @@ struct omap_overlay_info { | |||
300 | bool enabled; | 362 | bool enabled; |
301 | 363 | ||
302 | u32 paddr; | 364 | u32 paddr; |
303 | void __iomem *vaddr; | ||
304 | u32 p_uv_addr; /* for NV12 format */ | 365 | u32 p_uv_addr; /* for NV12 format */ |
305 | u16 screen_width; | 366 | u16 screen_width; |
306 | u16 width; | 367 | u16 width; |
@@ -316,6 +377,7 @@ struct omap_overlay_info { | |||
316 | u16 out_height; /* if 0, out_height == height */ | 377 | u16 out_height; /* if 0, out_height == height */ |
317 | u8 global_alpha; | 378 | u8 global_alpha; |
318 | u8 pre_mult_alpha; | 379 | u8 pre_mult_alpha; |
380 | u8 zorder; | ||
319 | }; | 381 | }; |
320 | 382 | ||
321 | struct omap_overlay { | 383 | struct omap_overlay { |
@@ -324,7 +386,7 @@ struct omap_overlay { | |||
324 | 386 | ||
325 | /* static fields */ | 387 | /* static fields */ |
326 | const char *name; | 388 | const char *name; |
327 | int id; | 389 | enum omap_plane id; |
328 | enum omap_color_mode supported_modes; | 390 | enum omap_color_mode supported_modes; |
329 | enum omap_overlay_caps caps; | 391 | enum omap_overlay_caps caps; |
330 | 392 | ||
@@ -332,6 +394,7 @@ struct omap_overlay { | |||
332 | struct omap_overlay_manager *manager; | 394 | struct omap_overlay_manager *manager; |
333 | struct omap_overlay_info info; | 395 | struct omap_overlay_info info; |
334 | 396 | ||
397 | bool manager_changed; | ||
335 | /* if true, info has been changed, but not applied() yet */ | 398 | /* if true, info has been changed, but not applied() yet */ |
336 | bool info_dirty; | 399 | bool info_dirty; |
337 | 400 | ||
@@ -354,7 +417,7 @@ struct omap_overlay_manager_info { | |||
354 | u32 trans_key; | 417 | u32 trans_key; |
355 | bool trans_enabled; | 418 | bool trans_enabled; |
356 | 419 | ||
357 | bool alpha_enabled; | 420 | bool partial_alpha_enabled; |
358 | 421 | ||
359 | bool cpr_enable; | 422 | bool cpr_enable; |
360 | struct omap_dss_cpr_coefs cpr_coefs; | 423 | struct omap_dss_cpr_coefs cpr_coefs; |
@@ -366,7 +429,7 @@ struct omap_overlay_manager { | |||
366 | 429 | ||
367 | /* static fields */ | 430 | /* static fields */ |
368 | const char *name; | 431 | const char *name; |
369 | int id; | 432 | enum omap_channel id; |
370 | enum omap_overlay_manager_caps caps; | 433 | enum omap_overlay_manager_caps caps; |
371 | int num_overlays; | 434 | int num_overlays; |
372 | struct omap_overlay **overlays; | 435 | struct omap_overlay **overlays; |
@@ -454,6 +517,7 @@ struct omap_dss_device { | |||
454 | } dispc; | 517 | } dispc; |
455 | 518 | ||
456 | struct { | 519 | struct { |
520 | /* regn is one greater than TRM's REGN value */ | ||
457 | u16 regn; | 521 | u16 regn; |
458 | u16 regm; | 522 | u16 regm; |
459 | u16 regm_dispc; | 523 | u16 regm_dispc; |
@@ -464,6 +528,7 @@ struct omap_dss_device { | |||
464 | } dsi; | 528 | } dsi; |
465 | 529 | ||
466 | struct { | 530 | struct { |
531 | /* regn is one greater than TRM's REGN value */ | ||
467 | u16 regn; | 532 | u16 regn; |
468 | u16 regm2; | 533 | u16 regm2; |
469 | } hdmi; | 534 | } hdmi; |
@@ -477,6 +542,10 @@ struct omap_dss_device { | |||
477 | int acb; /* ac-bias pin frequency */ | 542 | int acb; /* ac-bias pin frequency */ |
478 | 543 | ||
479 | enum omap_panel_config config; | 544 | enum omap_panel_config config; |
545 | |||
546 | enum omap_dss_dsi_pixel_format dsi_pix_fmt; | ||
547 | enum omap_dss_dsi_mode dsi_mode; | ||
548 | struct omap_dss_dsi_videomode_data dsi_vm_data; | ||
480 | } panel; | 549 | } panel; |
481 | 550 | ||
482 | struct { | 551 | struct { |
@@ -557,6 +626,9 @@ struct omap_dss_driver { | |||
557 | 626 | ||
558 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); | 627 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); |
559 | u32 (*get_wss)(struct omap_dss_device *dssdev); | 628 | u32 (*get_wss)(struct omap_dss_device *dssdev); |
629 | |||
630 | int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); | ||
631 | bool (*detect)(struct omap_dss_device *dssdev); | ||
560 | }; | 632 | }; |
561 | 633 | ||
562 | int omap_dss_register_driver(struct omap_dss_driver *); | 634 | int omap_dss_register_driver(struct omap_dss_driver *); |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index d964e68fc61d..8101b726b48a 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -4,26 +4,123 @@ | |||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <video/sh_mobile_meram.h> | 5 | #include <video/sh_mobile_meram.h> |
6 | 6 | ||
7 | /* Register definitions */ | ||
8 | #define _LDDCKR 0x410 | ||
9 | #define LDDCKR_ICKSEL_BUS (0 << 16) | ||
10 | #define LDDCKR_ICKSEL_MIPI (1 << 16) | ||
11 | #define LDDCKR_ICKSEL_HDMI (2 << 16) | ||
12 | #define LDDCKR_ICKSEL_EXT (3 << 16) | ||
13 | #define LDDCKR_ICKSEL_MASK (7 << 16) | ||
14 | #define LDDCKR_MOSEL (1 << 6) | ||
15 | #define _LDDCKSTPR 0x414 | ||
16 | #define _LDINTR 0x468 | ||
17 | #define LDINTR_FE (1 << 10) | ||
18 | #define LDINTR_VSE (1 << 9) | ||
19 | #define LDINTR_VEE (1 << 8) | ||
20 | #define LDINTR_FS (1 << 2) | ||
21 | #define LDINTR_VSS (1 << 1) | ||
22 | #define LDINTR_VES (1 << 0) | ||
23 | #define LDINTR_STATUS_MASK (0xff << 0) | ||
24 | #define _LDSR 0x46c | ||
25 | #define LDSR_MSS (1 << 10) | ||
26 | #define LDSR_MRS (1 << 8) | ||
27 | #define LDSR_AS (1 << 1) | ||
28 | #define _LDCNT1R 0x470 | ||
29 | #define LDCNT1R_DE (1 << 0) | ||
30 | #define _LDCNT2R 0x474 | ||
31 | #define LDCNT2R_BR (1 << 8) | ||
32 | #define LDCNT2R_MD (1 << 3) | ||
33 | #define LDCNT2R_SE (1 << 2) | ||
34 | #define LDCNT2R_ME (1 << 1) | ||
35 | #define LDCNT2R_DO (1 << 0) | ||
36 | #define _LDRCNTR 0x478 | ||
37 | #define LDRCNTR_SRS (1 << 17) | ||
38 | #define LDRCNTR_SRC (1 << 16) | ||
39 | #define LDRCNTR_MRS (1 << 1) | ||
40 | #define LDRCNTR_MRC (1 << 0) | ||
41 | #define _LDDDSR 0x47c | ||
42 | #define LDDDSR_LS (1 << 2) | ||
43 | #define LDDDSR_WS (1 << 1) | ||
44 | #define LDDDSR_BS (1 << 0) | ||
45 | |||
46 | #define LDMT1R_VPOL (1 << 28) | ||
47 | #define LDMT1R_HPOL (1 << 27) | ||
48 | #define LDMT1R_DWPOL (1 << 26) | ||
49 | #define LDMT1R_DIPOL (1 << 25) | ||
50 | #define LDMT1R_DAPOL (1 << 24) | ||
51 | #define LDMT1R_HSCNT (1 << 17) | ||
52 | #define LDMT1R_DWCNT (1 << 16) | ||
53 | #define LDMT1R_IFM (1 << 12) | ||
54 | #define LDMT1R_MIFTYP_RGB8 (0x0 << 0) | ||
55 | #define LDMT1R_MIFTYP_RGB9 (0x4 << 0) | ||
56 | #define LDMT1R_MIFTYP_RGB12A (0x5 << 0) | ||
57 | #define LDMT1R_MIFTYP_RGB12B (0x6 << 0) | ||
58 | #define LDMT1R_MIFTYP_RGB16 (0x7 << 0) | ||
59 | #define LDMT1R_MIFTYP_RGB18 (0xa << 0) | ||
60 | #define LDMT1R_MIFTYP_RGB24 (0xb << 0) | ||
61 | #define LDMT1R_MIFTYP_YCBCR (0xf << 0) | ||
62 | #define LDMT1R_MIFTYP_SYS8A (0x0 << 0) | ||
63 | #define LDMT1R_MIFTYP_SYS8B (0x1 << 0) | ||
64 | #define LDMT1R_MIFTYP_SYS8C (0x2 << 0) | ||
65 | #define LDMT1R_MIFTYP_SYS8D (0x3 << 0) | ||
66 | #define LDMT1R_MIFTYP_SYS9 (0x4 << 0) | ||
67 | #define LDMT1R_MIFTYP_SYS12 (0x5 << 0) | ||
68 | #define LDMT1R_MIFTYP_SYS16A (0x7 << 0) | ||
69 | #define LDMT1R_MIFTYP_SYS16B (0x8 << 0) | ||
70 | #define LDMT1R_MIFTYP_SYS16C (0x9 << 0) | ||
71 | #define LDMT1R_MIFTYP_SYS18 (0xa << 0) | ||
72 | #define LDMT1R_MIFTYP_SYS24 (0xb << 0) | ||
73 | #define LDMT1R_MIFTYP_MASK (0xf << 0) | ||
74 | |||
75 | #define LDDFR_CF1 (1 << 18) | ||
76 | #define LDDFR_CF0 (1 << 17) | ||
77 | #define LDDFR_CC (1 << 16) | ||
78 | #define LDDFR_YF_420 (0 << 8) | ||
79 | #define LDDFR_YF_422 (1 << 8) | ||
80 | #define LDDFR_YF_444 (2 << 8) | ||
81 | #define LDDFR_YF_MASK (3 << 8) | ||
82 | #define LDDFR_PKF_ARGB32 (0x00 << 0) | ||
83 | #define LDDFR_PKF_RGB16 (0x03 << 0) | ||
84 | #define LDDFR_PKF_RGB24 (0x0b << 0) | ||
85 | #define LDDFR_PKF_MASK (0x1f << 0) | ||
86 | |||
87 | #define LDSM1R_OS (1 << 0) | ||
88 | |||
89 | #define LDSM2R_OSTRG (1 << 0) | ||
90 | |||
91 | #define LDPMR_LPS (3 << 0) | ||
92 | |||
93 | #define _LDDWD0R 0x800 | ||
94 | #define LDDWDxR_WDACT (1 << 28) | ||
95 | #define LDDWDxR_RSW (1 << 24) | ||
96 | #define _LDDRDR 0x840 | ||
97 | #define LDDRDR_RSR (1 << 24) | ||
98 | #define LDDRDR_DRD_MASK (0x3ffff << 0) | ||
99 | #define _LDDWAR 0x900 | ||
100 | #define LDDWAR_WA (1 << 0) | ||
101 | #define _LDDRAR 0x904 | ||
102 | #define LDDRAR_RA (1 << 0) | ||
103 | |||
7 | enum { | 104 | enum { |
8 | RGB8, /* 24bpp, 8:8:8 */ | 105 | RGB8 = LDMT1R_MIFTYP_RGB8, /* 24bpp, 8:8:8 */ |
9 | RGB9, /* 18bpp, 9:9 */ | 106 | RGB9 = LDMT1R_MIFTYP_RGB9, /* 18bpp, 9:9 */ |
10 | RGB12A, /* 24bpp, 12:12 */ | 107 | RGB12A = LDMT1R_MIFTYP_RGB12A, /* 24bpp, 12:12 */ |
11 | RGB12B, /* 12bpp */ | 108 | RGB12B = LDMT1R_MIFTYP_RGB12B, /* 12bpp */ |
12 | RGB16, /* 16bpp */ | 109 | RGB16 = LDMT1R_MIFTYP_RGB16, /* 16bpp */ |
13 | RGB18, /* 18bpp */ | 110 | RGB18 = LDMT1R_MIFTYP_RGB18, /* 18bpp */ |
14 | RGB24, /* 24bpp */ | 111 | RGB24 = LDMT1R_MIFTYP_RGB24, /* 24bpp */ |
15 | YUV422, /* 16bpp */ | 112 | YUV422 = LDMT1R_MIFTYP_YCBCR, /* 16bpp */ |
16 | SYS8A, /* 24bpp, 8:8:8 */ | 113 | SYS8A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8A, /* 24bpp, 8:8:8 */ |
17 | SYS8B, /* 18bpp, 8:8:2 */ | 114 | SYS8B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8B, /* 18bpp, 8:8:2 */ |
18 | SYS8C, /* 18bpp, 2:8:8 */ | 115 | SYS8C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8C, /* 18bpp, 2:8:8 */ |
19 | SYS8D, /* 16bpp, 8:8 */ | 116 | SYS8D = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8D, /* 16bpp, 8:8 */ |
20 | SYS9, /* 18bpp, 9:9 */ | 117 | SYS9 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS9, /* 18bpp, 9:9 */ |
21 | SYS12, /* 24bpp, 12:12 */ | 118 | SYS12 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS12, /* 24bpp, 12:12 */ |
22 | SYS16A, /* 16bpp */ | 119 | SYS16A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16A, /* 16bpp */ |
23 | SYS16B, /* 18bpp, 16:2 */ | 120 | SYS16B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16B, /* 18bpp, 16:2 */ |
24 | SYS16C, /* 18bpp, 2:16 */ | 121 | SYS16C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16C, /* 18bpp, 2:16 */ |
25 | SYS18, /* 18bpp */ | 122 | SYS18 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS18, /* 18bpp */ |
26 | SYS24, /* 24bpp */ | 123 | SYS24 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS24, /* 24bpp */ |
27 | }; | 124 | }; |
28 | 125 | ||
29 | enum { LCDC_CHAN_DISABLED = 0, | 126 | enum { LCDC_CHAN_DISABLED = 0, |
diff --git a/include/video/udlfb.h b/include/video/udlfb.h index 69d485a4a026..c41f308c9636 100644 --- a/include/video/udlfb.h +++ b/include/video/udlfb.h | |||
@@ -50,6 +50,7 @@ struct dlfb_data { | |||
50 | int base16; | 50 | int base16; |
51 | int base8; | 51 | int base8; |
52 | u32 pseudo_palette[256]; | 52 | u32 pseudo_palette[256]; |
53 | int blank_mode; /*one of FB_BLANK_ */ | ||
53 | /* blit-only rendering path metrics, exposed through sysfs */ | 54 | /* blit-only rendering path metrics, exposed through sysfs */ |
54 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ | 55 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ |
55 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ | 56 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ |
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h index 901724dc528d..b62dfef15f61 100644 --- a/include/xen/hvc-console.h +++ b/include/xen/hvc-console.h | |||
@@ -6,12 +6,12 @@ extern struct console xenboot_console; | |||
6 | #ifdef CONFIG_HVC_XEN | 6 | #ifdef CONFIG_HVC_XEN |
7 | void xen_console_resume(void); | 7 | void xen_console_resume(void); |
8 | void xen_raw_console_write(const char *str); | 8 | void xen_raw_console_write(const char *str); |
9 | __attribute__((format(printf, 1, 2))) | 9 | __printf(1, 2) |
10 | void xen_raw_printk(const char *fmt, ...); | 10 | void xen_raw_printk(const char *fmt, ...); |
11 | #else | 11 | #else |
12 | static inline void xen_console_resume(void) { } | 12 | static inline void xen_console_resume(void) { } |
13 | static inline void xen_raw_console_write(const char *str) { } | 13 | static inline void xen_raw_console_write(const char *str) { } |
14 | static inline __attribute__((format(printf, 1, 2))) | 14 | static inline __printf(1, 2) |
15 | void xen_raw_printk(const char *fmt, ...) { } | 15 | void xen_raw_printk(const char *fmt, ...) { } |
16 | #endif | 16 | #endif |
17 | 17 | ||
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index aceeca799fd7..b9f9fb5af0d8 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
@@ -156,9 +156,9 @@ int xenbus_scanf(struct xenbus_transaction t, | |||
156 | __attribute__((format(scanf, 4, 5))); | 156 | __attribute__((format(scanf, 4, 5))); |
157 | 157 | ||
158 | /* Single printf and write: returns -errno or 0. */ | 158 | /* Single printf and write: returns -errno or 0. */ |
159 | __printf(4, 5) | ||
159 | int xenbus_printf(struct xenbus_transaction t, | 160 | int xenbus_printf(struct xenbus_transaction t, |
160 | const char *dir, const char *node, const char *fmt, ...) | 161 | const char *dir, const char *node, const char *fmt, ...); |
161 | __attribute__((format(printf, 4, 5))); | ||
162 | 162 | ||
163 | /* Generic read function: NULL-terminated triples of name, | 163 | /* Generic read function: NULL-terminated triples of name, |
164 | * sprintf-style type string, and pointer. Returns 0 or errno.*/ | 164 | * sprintf-style type string, and pointer. Returns 0 or errno.*/ |
@@ -200,11 +200,11 @@ int xenbus_watch_path(struct xenbus_device *dev, const char *path, | |||
200 | struct xenbus_watch *watch, | 200 | struct xenbus_watch *watch, |
201 | void (*callback)(struct xenbus_watch *, | 201 | void (*callback)(struct xenbus_watch *, |
202 | const char **, unsigned int)); | 202 | const char **, unsigned int)); |
203 | __printf(4, 5) | ||
203 | int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, | 204 | int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, |
204 | void (*callback)(struct xenbus_watch *, | 205 | void (*callback)(struct xenbus_watch *, |
205 | const char **, unsigned int), | 206 | const char **, unsigned int), |
206 | const char *pathfmt, ...) | 207 | const char *pathfmt, ...); |
207 | __attribute__ ((format (printf, 4, 5))); | ||
208 | 208 | ||
209 | int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); | 209 | int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); |
210 | int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn); | 210 | int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn); |
@@ -223,9 +223,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port); | |||
223 | 223 | ||
224 | enum xenbus_state xenbus_read_driver_state(const char *path); | 224 | enum xenbus_state xenbus_read_driver_state(const char *path); |
225 | 225 | ||
226 | __attribute__((format(printf, 3, 4))) | 226 | __printf(3, 4) |
227 | void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); | 227 | void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); |
228 | __attribute__((format(printf, 3, 4))) | 228 | __printf(3, 4) |
229 | void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); | 229 | void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); |
230 | 230 | ||
231 | const char *xenbus_strstate(enum xenbus_state state); | 231 | const char *xenbus_strstate(enum xenbus_state state); |