diff options
Diffstat (limited to 'include/linux')
72 files changed, 2808 insertions, 375 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index b0ada6f37dd6..75cf611641e6 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -233,6 +233,7 @@ header-y += magic.h | |||
233 | header-y += major.h | 233 | header-y += major.h |
234 | header-y += map_to_7segment.h | 234 | header-y += map_to_7segment.h |
235 | header-y += matroxfb.h | 235 | header-y += matroxfb.h |
236 | header-y += media.h | ||
236 | header-y += mempolicy.h | 237 | header-y += mempolicy.h |
237 | header-y += meye.h | 238 | header-y += meye.h |
238 | header-y += mii.h | 239 | header-y += mii.h |
@@ -276,6 +277,7 @@ header-y += nfsacl.h | |||
276 | header-y += nl80211.h | 277 | header-y += nl80211.h |
277 | header-y += nubus.h | 278 | header-y += nubus.h |
278 | header-y += nvram.h | 279 | header-y += nvram.h |
280 | header-y += omap3isp.h | ||
279 | header-y += omapfb.h | 281 | header-y += omapfb.h |
280 | header-y += oom.h | 282 | header-y += oom.h |
281 | header-y += param.h | 283 | header-y += param.h |
@@ -370,6 +372,8 @@ header-y += unistd.h | |||
370 | header-y += usbdevice_fs.h | 372 | header-y += usbdevice_fs.h |
371 | header-y += utime.h | 373 | header-y += utime.h |
372 | header-y += utsname.h | 374 | header-y += utsname.h |
375 | header-y += v4l2-mediabus.h | ||
376 | header-y += v4l2-subdev.h | ||
373 | header-y += veth.h | 377 | header-y += veth.h |
374 | header-y += vhost.h | 378 | header-y += vhost.h |
375 | header-y += videodev2.h | 379 | header-y += videodev2.h |
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h index 7180013a4a3a..4afd7102459d 100644 --- a/include/linux/acpi_io.h +++ b/include/linux/acpi_io.h | |||
@@ -10,7 +10,6 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | |||
10 | return ioremap_cache(phys, size); | 10 | return ioremap_cache(phys, size); |
11 | } | 11 | } |
12 | 12 | ||
13 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | 13 | void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); |
14 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
15 | 14 | ||
16 | #endif | 15 | #endif |
diff --git a/include/linux/aer.h b/include/linux/aer.h index f7df1eefc107..8414de22a779 100644 --- a/include/linux/aer.h +++ b/include/linux/aer.h | |||
@@ -7,6 +7,28 @@ | |||
7 | #ifndef _AER_H_ | 7 | #ifndef _AER_H_ |
8 | #define _AER_H_ | 8 | #define _AER_H_ |
9 | 9 | ||
10 | struct aer_header_log_regs { | ||
11 | unsigned int dw0; | ||
12 | unsigned int dw1; | ||
13 | unsigned int dw2; | ||
14 | unsigned int dw3; | ||
15 | }; | ||
16 | |||
17 | struct aer_capability_regs { | ||
18 | u32 header; | ||
19 | u32 uncor_status; | ||
20 | u32 uncor_mask; | ||
21 | u32 uncor_severity; | ||
22 | u32 cor_status; | ||
23 | u32 cor_mask; | ||
24 | u32 cap_control; | ||
25 | struct aer_header_log_regs header_log; | ||
26 | u32 root_command; | ||
27 | u32 root_status; | ||
28 | u16 cor_err_source; | ||
29 | u16 uncor_err_source; | ||
30 | }; | ||
31 | |||
10 | #if defined(CONFIG_PCIEAER) | 32 | #if defined(CONFIG_PCIEAER) |
11 | /* pci-e port driver needs this function to enable aer */ | 33 | /* pci-e port driver needs this function to enable aer */ |
12 | extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); | 34 | extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); |
@@ -27,5 +49,7 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) | |||
27 | } | 49 | } |
28 | #endif | 50 | #endif |
29 | 51 | ||
52 | extern void cper_print_aer(const char *prefix, int cper_severity, | ||
53 | struct aer_capability_regs *aer); | ||
30 | #endif //_AER_H_ | 54 | #endif //_AER_H_ |
31 | 55 | ||
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index be33b3affc8a..24d26efd1432 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #define CNTL_LCDBPP8 (3 << 1) | 53 | #define CNTL_LCDBPP8 (3 << 1) |
54 | #define CNTL_LCDBPP16 (4 << 1) | 54 | #define CNTL_LCDBPP16 (4 << 1) |
55 | #define CNTL_LCDBPP16_565 (6 << 1) | 55 | #define CNTL_LCDBPP16_565 (6 << 1) |
56 | #define CNTL_LCDBPP16_444 (7 << 1) | ||
56 | #define CNTL_LCDBPP24 (5 << 1) | 57 | #define CNTL_LCDBPP24 (5 << 1) |
57 | #define CNTL_LCDBW (1 << 4) | 58 | #define CNTL_LCDBW (1 << 4) |
58 | #define CNTL_LCDTFT (1 << 5) | 59 | #define CNTL_LCDTFT (1 << 5) |
@@ -66,6 +67,32 @@ | |||
66 | #define CNTL_LDMAFIFOTIME (1 << 15) | 67 | #define CNTL_LDMAFIFOTIME (1 << 15) |
67 | #define CNTL_WATERMARK (1 << 16) | 68 | #define CNTL_WATERMARK (1 << 16) |
68 | 69 | ||
70 | enum { | ||
71 | /* individual formats */ | ||
72 | CLCD_CAP_RGB444 = (1 << 0), | ||
73 | CLCD_CAP_RGB5551 = (1 << 1), | ||
74 | CLCD_CAP_RGB565 = (1 << 2), | ||
75 | CLCD_CAP_RGB888 = (1 << 3), | ||
76 | CLCD_CAP_BGR444 = (1 << 4), | ||
77 | CLCD_CAP_BGR5551 = (1 << 5), | ||
78 | CLCD_CAP_BGR565 = (1 << 6), | ||
79 | CLCD_CAP_BGR888 = (1 << 7), | ||
80 | |||
81 | /* connection layouts */ | ||
82 | CLCD_CAP_444 = CLCD_CAP_RGB444 | CLCD_CAP_BGR444, | ||
83 | CLCD_CAP_5551 = CLCD_CAP_RGB5551 | CLCD_CAP_BGR5551, | ||
84 | CLCD_CAP_565 = CLCD_CAP_RGB565 | CLCD_CAP_BGR565, | ||
85 | CLCD_CAP_888 = CLCD_CAP_RGB888 | CLCD_CAP_BGR888, | ||
86 | |||
87 | /* red/blue ordering */ | ||
88 | CLCD_CAP_RGB = CLCD_CAP_RGB444 | CLCD_CAP_RGB5551 | | ||
89 | CLCD_CAP_RGB565 | CLCD_CAP_RGB888, | ||
90 | CLCD_CAP_BGR = CLCD_CAP_BGR444 | CLCD_CAP_BGR5551 | | ||
91 | CLCD_CAP_BGR565 | CLCD_CAP_BGR888, | ||
92 | |||
93 | CLCD_CAP_ALL = CLCD_CAP_BGR | CLCD_CAP_RGB, | ||
94 | }; | ||
95 | |||
69 | struct clcd_panel { | 96 | struct clcd_panel { |
70 | struct fb_videomode mode; | 97 | struct fb_videomode mode; |
71 | signed short width; /* width in mm */ | 98 | signed short width; /* width in mm */ |
@@ -73,6 +100,7 @@ struct clcd_panel { | |||
73 | u32 tim2; | 100 | u32 tim2; |
74 | u32 tim3; | 101 | u32 tim3; |
75 | u32 cntl; | 102 | u32 cntl; |
103 | u32 caps; | ||
76 | unsigned int bpp:8, | 104 | unsigned int bpp:8, |
77 | fixedtimings:1, | 105 | fixedtimings:1, |
78 | grayscale:1; | 106 | grayscale:1; |
@@ -97,6 +125,11 @@ struct clcd_board { | |||
97 | const char *name; | 125 | const char *name; |
98 | 126 | ||
99 | /* | 127 | /* |
128 | * Optional. Hardware capability flags. | ||
129 | */ | ||
130 | u32 caps; | ||
131 | |||
132 | /* | ||
100 | * Optional. Check whether the var structure is acceptable | 133 | * Optional. Check whether the var structure is acceptable |
101 | * for this display. | 134 | * for this display. |
102 | */ | 135 | */ |
@@ -155,34 +188,35 @@ struct clcd_fb { | |||
155 | 188 | ||
156 | static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | 189 | static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) |
157 | { | 190 | { |
191 | struct fb_var_screeninfo *var = &fb->fb.var; | ||
158 | u32 val, cpl; | 192 | u32 val, cpl; |
159 | 193 | ||
160 | /* | 194 | /* |
161 | * Program the CLCD controller registers and start the CLCD | 195 | * Program the CLCD controller registers and start the CLCD |
162 | */ | 196 | */ |
163 | val = ((fb->fb.var.xres / 16) - 1) << 2; | 197 | val = ((var->xres / 16) - 1) << 2; |
164 | val |= (fb->fb.var.hsync_len - 1) << 8; | 198 | val |= (var->hsync_len - 1) << 8; |
165 | val |= (fb->fb.var.right_margin - 1) << 16; | 199 | val |= (var->right_margin - 1) << 16; |
166 | val |= (fb->fb.var.left_margin - 1) << 24; | 200 | val |= (var->left_margin - 1) << 24; |
167 | regs->tim0 = val; | 201 | regs->tim0 = val; |
168 | 202 | ||
169 | val = fb->fb.var.yres; | 203 | val = var->yres; |
170 | if (fb->panel->cntl & CNTL_LCDDUAL) | 204 | if (fb->panel->cntl & CNTL_LCDDUAL) |
171 | val /= 2; | 205 | val /= 2; |
172 | val -= 1; | 206 | val -= 1; |
173 | val |= (fb->fb.var.vsync_len - 1) << 10; | 207 | val |= (var->vsync_len - 1) << 10; |
174 | val |= fb->fb.var.lower_margin << 16; | 208 | val |= var->lower_margin << 16; |
175 | val |= fb->fb.var.upper_margin << 24; | 209 | val |= var->upper_margin << 24; |
176 | regs->tim1 = val; | 210 | regs->tim1 = val; |
177 | 211 | ||
178 | val = fb->panel->tim2; | 212 | val = fb->panel->tim2; |
179 | val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS; | 213 | val |= var->sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS; |
180 | val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS; | 214 | val |= var->sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS; |
181 | 215 | ||
182 | cpl = fb->fb.var.xres_virtual; | 216 | cpl = var->xres_virtual; |
183 | if (fb->panel->cntl & CNTL_LCDTFT) /* TFT */ | 217 | if (fb->panel->cntl & CNTL_LCDTFT) /* TFT */ |
184 | /* / 1 */; | 218 | /* / 1 */; |
185 | else if (!fb->fb.var.grayscale) /* STN color */ | 219 | else if (!var->grayscale) /* STN color */ |
186 | cpl = cpl * 8 / 3; | 220 | cpl = cpl * 8 / 3; |
187 | else if (fb->panel->cntl & CNTL_LCDMONO8) /* STN monochrome, 8bit */ | 221 | else if (fb->panel->cntl & CNTL_LCDMONO8) /* STN monochrome, 8bit */ |
188 | cpl /= 8; | 222 | cpl /= 8; |
@@ -194,10 +228,22 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
194 | regs->tim3 = fb->panel->tim3; | 228 | regs->tim3 = fb->panel->tim3; |
195 | 229 | ||
196 | val = fb->panel->cntl; | 230 | val = fb->panel->cntl; |
197 | if (fb->fb.var.grayscale) | 231 | if (var->grayscale) |
198 | val |= CNTL_LCDBW; | 232 | val |= CNTL_LCDBW; |
199 | 233 | ||
200 | switch (fb->fb.var.bits_per_pixel) { | 234 | if (fb->panel->caps && fb->board->caps && |
235 | var->bits_per_pixel >= 16) { | ||
236 | /* | ||
237 | * if board and panel supply capabilities, we can support | ||
238 | * changing BGR/RGB depending on supplied parameters | ||
239 | */ | ||
240 | if (var->red.offset == 0) | ||
241 | val &= ~CNTL_BGR; | ||
242 | else | ||
243 | val |= CNTL_BGR; | ||
244 | } | ||
245 | |||
246 | switch (var->bits_per_pixel) { | ||
201 | case 1: | 247 | case 1: |
202 | val |= CNTL_LCDBPP1; | 248 | val |= CNTL_LCDBPP1; |
203 | break; | 249 | break; |
@@ -212,15 +258,17 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
212 | break; | 258 | break; |
213 | case 16: | 259 | case 16: |
214 | /* | 260 | /* |
215 | * PL110 cannot choose between 5551 and 565 modes in | 261 | * PL110 cannot choose between 5551 and 565 modes in its |
216 | * its control register | 262 | * control register. It is possible to use 565 with |
263 | * custom external wiring. | ||
217 | */ | 264 | */ |
218 | if ((fb->dev->periphid & 0x000fffff) == 0x00041110) | 265 | if (amba_part(fb->dev) == 0x110 || |
266 | var->green.length == 5) | ||
219 | val |= CNTL_LCDBPP16; | 267 | val |= CNTL_LCDBPP16; |
220 | else if (fb->fb.var.green.length == 5) | 268 | else if (var->green.length == 6) |
221 | val |= CNTL_LCDBPP16; | ||
222 | else | ||
223 | val |= CNTL_LCDBPP16_565; | 269 | val |= CNTL_LCDBPP16_565; |
270 | else | ||
271 | val |= CNTL_LCDBPP16_444; | ||
224 | break; | 272 | break; |
225 | case 32: | 273 | case 32: |
226 | val |= CNTL_LCDBPP24; | 274 | val |= CNTL_LCDBPP24; |
@@ -228,7 +276,7 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
228 | } | 276 | } |
229 | 277 | ||
230 | regs->cntl = val; | 278 | regs->cntl = val; |
231 | regs->pixclock = fb->fb.var.pixclock; | 279 | regs->pixclock = var->pixclock; |
232 | } | 280 | } |
233 | 281 | ||
234 | static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) | 282 | static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 4ce34fa937d4..96f4094b706d 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -66,8 +66,6 @@ struct backing_dev_info { | |||
66 | unsigned int capabilities; /* Device capabilities */ | 66 | unsigned int capabilities; /* Device capabilities */ |
67 | congested_fn *congested_fn; /* Function pointer if device is md/dm */ | 67 | congested_fn *congested_fn; /* Function pointer if device is md/dm */ |
68 | void *congested_data; /* Pointer to aux data for congested func */ | 68 | void *congested_data; /* Pointer to aux data for congested func */ |
69 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); | ||
70 | void *unplug_io_data; | ||
71 | 69 | ||
72 | char *name; | 70 | char *name; |
73 | 71 | ||
@@ -251,7 +249,6 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
251 | 249 | ||
252 | extern struct backing_dev_info default_backing_dev_info; | 250 | extern struct backing_dev_info default_backing_dev_info; |
253 | extern struct backing_dev_info noop_backing_dev_info; | 251 | extern struct backing_dev_info noop_backing_dev_info; |
254 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); | ||
255 | 252 | ||
256 | int writeback_in_progress(struct backing_dev_info *bdi); | 253 | int writeback_in_progress(struct backing_dev_info *bdi); |
257 | 254 | ||
@@ -336,17 +333,4 @@ static inline int bdi_sched_wait(void *word) | |||
336 | return 0; | 333 | return 0; |
337 | } | 334 | } |
338 | 335 | ||
339 | static inline void blk_run_backing_dev(struct backing_dev_info *bdi, | ||
340 | struct page *page) | ||
341 | { | ||
342 | if (bdi && bdi->unplug_io_fn) | ||
343 | bdi->unplug_io_fn(bdi, page); | ||
344 | } | ||
345 | |||
346 | static inline void blk_run_address_space(struct address_space *mapping) | ||
347 | { | ||
348 | if (mapping) | ||
349 | blk_run_backing_dev(mapping->backing_dev_info, NULL); | ||
350 | } | ||
351 | |||
352 | #endif /* _LINUX_BACKING_DEV_H */ | 336 | #endif /* _LINUX_BACKING_DEV_H */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 35dcdb3589bc..ce33e6868a2f 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -304,7 +304,6 @@ struct biovec_slab { | |||
304 | }; | 304 | }; |
305 | 305 | ||
306 | extern struct bio_set *fs_bio_set; | 306 | extern struct bio_set *fs_bio_set; |
307 | extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly; | ||
308 | 307 | ||
309 | /* | 308 | /* |
310 | * a small number of entries is fine, not going to be performance critical. | 309 | * a small number of entries is fine, not going to be performance critical. |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 46ad5197537a..be50d9e70a7d 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -128,7 +128,6 @@ enum rq_flag_bits { | |||
128 | __REQ_NOIDLE, /* don't anticipate more IO after this one */ | 128 | __REQ_NOIDLE, /* don't anticipate more IO after this one */ |
129 | 129 | ||
130 | /* bio only flags */ | 130 | /* bio only flags */ |
131 | __REQ_UNPLUG, /* unplug the immediately after submission */ | ||
132 | __REQ_RAHEAD, /* read ahead, can fail anytime */ | 131 | __REQ_RAHEAD, /* read ahead, can fail anytime */ |
133 | __REQ_THROTTLED, /* This bio has already been subjected to | 132 | __REQ_THROTTLED, /* This bio has already been subjected to |
134 | * throttling rules. Don't do it again. */ | 133 | * throttling rules. Don't do it again. */ |
@@ -148,9 +147,11 @@ enum rq_flag_bits { | |||
148 | __REQ_ALLOCED, /* request came from our alloc pool */ | 147 | __REQ_ALLOCED, /* request came from our alloc pool */ |
149 | __REQ_COPY_USER, /* contains copies of user pages */ | 148 | __REQ_COPY_USER, /* contains copies of user pages */ |
150 | __REQ_FLUSH, /* request for cache flush */ | 149 | __REQ_FLUSH, /* request for cache flush */ |
150 | __REQ_FLUSH_SEQ, /* request for flush sequence */ | ||
151 | __REQ_IO_STAT, /* account I/O stat */ | 151 | __REQ_IO_STAT, /* account I/O stat */ |
152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | 152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ |
153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | 153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ |
154 | __REQ_ON_PLUG, /* on plug list */ | ||
154 | __REQ_NR_BITS, /* stops here */ | 155 | __REQ_NR_BITS, /* stops here */ |
155 | }; | 156 | }; |
156 | 157 | ||
@@ -170,7 +171,6 @@ enum rq_flag_bits { | |||
170 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 171 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
171 | #define REQ_CLONE_MASK REQ_COMMON_MASK | 172 | #define REQ_CLONE_MASK REQ_COMMON_MASK |
172 | 173 | ||
173 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | ||
174 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) | 174 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) |
175 | #define REQ_THROTTLED (1 << __REQ_THROTTLED) | 175 | #define REQ_THROTTLED (1 << __REQ_THROTTLED) |
176 | 176 | ||
@@ -188,8 +188,10 @@ enum rq_flag_bits { | |||
188 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | 188 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) |
189 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) | 189 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) |
190 | #define REQ_FLUSH (1 << __REQ_FLUSH) | 190 | #define REQ_FLUSH (1 << __REQ_FLUSH) |
191 | #define REQ_FLUSH_SEQ (1 << __REQ_FLUSH_SEQ) | ||
191 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 192 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
192 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | 193 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) |
193 | #define REQ_SECURE (1 << __REQ_SECURE) | 194 | #define REQ_SECURE (1 << __REQ_SECURE) |
195 | #define REQ_ON_PLUG (1 << __REQ_ON_PLUG) | ||
194 | 196 | ||
195 | #endif /* __LINUX_BLK_TYPES_H */ | 197 | #endif /* __LINUX_BLK_TYPES_H */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d5063e1b5555..16a902f099ac 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -108,11 +108,17 @@ struct request { | |||
108 | 108 | ||
109 | /* | 109 | /* |
110 | * Three pointers are available for the IO schedulers, if they need | 110 | * Three pointers are available for the IO schedulers, if they need |
111 | * more they have to dynamically allocate it. | 111 | * more they have to dynamically allocate it. Flush requests are |
112 | * never put on the IO scheduler. So let the flush fields share | ||
113 | * space with the three elevator_private pointers. | ||
112 | */ | 114 | */ |
113 | void *elevator_private; | 115 | union { |
114 | void *elevator_private2; | 116 | void *elevator_private[3]; |
115 | void *elevator_private3; | 117 | struct { |
118 | unsigned int seq; | ||
119 | struct list_head list; | ||
120 | } flush; | ||
121 | }; | ||
116 | 122 | ||
117 | struct gendisk *rq_disk; | 123 | struct gendisk *rq_disk; |
118 | struct hd_struct *part; | 124 | struct hd_struct *part; |
@@ -190,7 +196,6 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
190 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 196 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
191 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 197 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
192 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); | 198 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); |
193 | typedef void (unplug_fn) (struct request_queue *); | ||
194 | 199 | ||
195 | struct bio_vec; | 200 | struct bio_vec; |
196 | struct bvec_merge_data { | 201 | struct bvec_merge_data { |
@@ -273,7 +278,6 @@ struct request_queue | |||
273 | make_request_fn *make_request_fn; | 278 | make_request_fn *make_request_fn; |
274 | prep_rq_fn *prep_rq_fn; | 279 | prep_rq_fn *prep_rq_fn; |
275 | unprep_rq_fn *unprep_rq_fn; | 280 | unprep_rq_fn *unprep_rq_fn; |
276 | unplug_fn *unplug_fn; | ||
277 | merge_bvec_fn *merge_bvec_fn; | 281 | merge_bvec_fn *merge_bvec_fn; |
278 | softirq_done_fn *softirq_done_fn; | 282 | softirq_done_fn *softirq_done_fn; |
279 | rq_timed_out_fn *rq_timed_out_fn; | 283 | rq_timed_out_fn *rq_timed_out_fn; |
@@ -287,12 +291,9 @@ struct request_queue | |||
287 | struct request *boundary_rq; | 291 | struct request *boundary_rq; |
288 | 292 | ||
289 | /* | 293 | /* |
290 | * Auto-unplugging state | 294 | * Delayed queue handling |
291 | */ | 295 | */ |
292 | struct timer_list unplug_timer; | 296 | struct delayed_work delay_work; |
293 | int unplug_thresh; /* After this many requests */ | ||
294 | unsigned long unplug_delay; /* After this many jiffies */ | ||
295 | struct work_struct unplug_work; | ||
296 | 297 | ||
297 | struct backing_dev_info backing_dev_info; | 298 | struct backing_dev_info backing_dev_info; |
298 | 299 | ||
@@ -363,11 +364,12 @@ struct request_queue | |||
363 | * for flush operations | 364 | * for flush operations |
364 | */ | 365 | */ |
365 | unsigned int flush_flags; | 366 | unsigned int flush_flags; |
366 | unsigned int flush_seq; | 367 | unsigned int flush_pending_idx:1; |
367 | int flush_err; | 368 | unsigned int flush_running_idx:1; |
369 | unsigned long flush_pending_since; | ||
370 | struct list_head flush_queue[2]; | ||
371 | struct list_head flush_data_in_flight; | ||
368 | struct request flush_rq; | 372 | struct request flush_rq; |
369 | struct request *orig_flush_rq; | ||
370 | struct list_head pending_flushes; | ||
371 | 373 | ||
372 | struct mutex sysfs_lock; | 374 | struct mutex sysfs_lock; |
373 | 375 | ||
@@ -387,14 +389,13 @@ struct request_queue | |||
387 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ | 389 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ |
388 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 390 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
389 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 391 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
390 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 392 | #define QUEUE_FLAG_ELVSWITCH 7 /* don't use elevator, just do FIFO */ |
391 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 393 | #define QUEUE_FLAG_BIDI 8 /* queue supports bidi requests */ |
392 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | 394 | #define QUEUE_FLAG_NOMERGES 9 /* disable merge attempts */ |
393 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ | 395 | #define QUEUE_FLAG_SAME_COMP 10 /* force complete on same CPU */ |
394 | #define QUEUE_FLAG_SAME_COMP 11 /* force complete on same CPU */ | 396 | #define QUEUE_FLAG_FAIL_IO 11 /* fake timeout */ |
395 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | 397 | #define QUEUE_FLAG_STACKABLE 12 /* supports request stacking */ |
396 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 398 | #define QUEUE_FLAG_NONROT 13 /* non-rotational device (SSD) */ |
397 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | ||
398 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 399 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
399 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 400 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
400 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ | 401 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
@@ -472,7 +473,6 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | |||
472 | __clear_bit(flag, &q->queue_flags); | 473 | __clear_bit(flag, &q->queue_flags); |
473 | } | 474 | } |
474 | 475 | ||
475 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | ||
476 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 476 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
477 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 477 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
478 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 478 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
@@ -667,9 +667,7 @@ extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src, | |||
667 | extern void blk_rq_unprep_clone(struct request *rq); | 667 | extern void blk_rq_unprep_clone(struct request *rq); |
668 | extern int blk_insert_cloned_request(struct request_queue *q, | 668 | extern int blk_insert_cloned_request(struct request_queue *q, |
669 | struct request *rq); | 669 | struct request *rq); |
670 | extern void blk_plug_device(struct request_queue *); | 670 | extern void blk_delay_queue(struct request_queue *, unsigned long); |
671 | extern void blk_plug_device_unlocked(struct request_queue *); | ||
672 | extern int blk_remove_plug(struct request_queue *); | ||
673 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 671 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
674 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, | 672 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
675 | unsigned int, void __user *); | 673 | unsigned int, void __user *); |
@@ -713,7 +711,6 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *, | |||
713 | struct request *, int); | 711 | struct request *, int); |
714 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 712 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
715 | struct request *, int, rq_end_io_fn *); | 713 | struct request *, int, rq_end_io_fn *); |
716 | extern void blk_unplug(struct request_queue *q); | ||
717 | 714 | ||
718 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | 715 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) |
719 | { | 716 | { |
@@ -850,7 +847,6 @@ extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bd | |||
850 | 847 | ||
851 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 848 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
852 | extern void blk_dump_rq_flags(struct request *, char *); | 849 | extern void blk_dump_rq_flags(struct request *, char *); |
853 | extern void generic_unplug_device(struct request_queue *); | ||
854 | extern long nr_blockdev_pages(void); | 850 | extern long nr_blockdev_pages(void); |
855 | 851 | ||
856 | int blk_get_queue(struct request_queue *); | 852 | int blk_get_queue(struct request_queue *); |
@@ -858,6 +854,31 @@ struct request_queue *blk_alloc_queue(gfp_t); | |||
858 | struct request_queue *blk_alloc_queue_node(gfp_t, int); | 854 | struct request_queue *blk_alloc_queue_node(gfp_t, int); |
859 | extern void blk_put_queue(struct request_queue *); | 855 | extern void blk_put_queue(struct request_queue *); |
860 | 856 | ||
857 | struct blk_plug { | ||
858 | unsigned long magic; | ||
859 | struct list_head list; | ||
860 | unsigned int should_sort; | ||
861 | }; | ||
862 | |||
863 | extern void blk_start_plug(struct blk_plug *); | ||
864 | extern void blk_finish_plug(struct blk_plug *); | ||
865 | extern void __blk_flush_plug(struct task_struct *, struct blk_plug *); | ||
866 | |||
867 | static inline void blk_flush_plug(struct task_struct *tsk) | ||
868 | { | ||
869 | struct blk_plug *plug = tsk->plug; | ||
870 | |||
871 | if (unlikely(plug)) | ||
872 | __blk_flush_plug(tsk, plug); | ||
873 | } | ||
874 | |||
875 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) | ||
876 | { | ||
877 | struct blk_plug *plug = tsk->plug; | ||
878 | |||
879 | return plug && !list_empty(&plug->list); | ||
880 | } | ||
881 | |||
861 | /* | 882 | /* |
862 | * tag stuff | 883 | * tag stuff |
863 | */ | 884 | */ |
@@ -1135,7 +1156,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req) | |||
1135 | extern int blk_throtl_init(struct request_queue *q); | 1156 | extern int blk_throtl_init(struct request_queue *q); |
1136 | extern void blk_throtl_exit(struct request_queue *q); | 1157 | extern void blk_throtl_exit(struct request_queue *q); |
1137 | extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); | 1158 | extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); |
1138 | extern void throtl_shutdown_timer_wq(struct request_queue *q); | ||
1139 | #else /* CONFIG_BLK_DEV_THROTTLING */ | 1159 | #else /* CONFIG_BLK_DEV_THROTTLING */ |
1140 | static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) | 1160 | static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) |
1141 | { | 1161 | { |
@@ -1144,7 +1164,6 @@ static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) | |||
1144 | 1164 | ||
1145 | static inline int blk_throtl_init(struct request_queue *q) { return 0; } | 1165 | static inline int blk_throtl_init(struct request_queue *q) { return 0; } |
1146 | static inline int blk_throtl_exit(struct request_queue *q) { return 0; } | 1166 | static inline int blk_throtl_exit(struct request_queue *q) { return 0; } |
1147 | static inline void throtl_shutdown_timer_wq(struct request_queue *q) {} | ||
1148 | #endif /* CONFIG_BLK_DEV_THROTTLING */ | 1167 | #endif /* CONFIG_BLK_DEV_THROTTLING */ |
1149 | 1168 | ||
1150 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 1169 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
@@ -1278,6 +1297,26 @@ static inline long nr_blockdev_pages(void) | |||
1278 | return 0; | 1297 | return 0; |
1279 | } | 1298 | } |
1280 | 1299 | ||
1300 | struct blk_plug { | ||
1301 | }; | ||
1302 | |||
1303 | static inline void blk_start_plug(struct blk_plug *plug) | ||
1304 | { | ||
1305 | } | ||
1306 | |||
1307 | static inline void blk_finish_plug(struct blk_plug *plug) | ||
1308 | { | ||
1309 | } | ||
1310 | |||
1311 | static inline void blk_flush_plug(struct task_struct *task) | ||
1312 | { | ||
1313 | } | ||
1314 | |||
1315 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) | ||
1316 | { | ||
1317 | return false; | ||
1318 | } | ||
1319 | |||
1281 | #endif /* CONFIG_BLOCK */ | 1320 | #endif /* CONFIG_BLOCK */ |
1282 | 1321 | ||
1283 | #endif | 1322 | #endif |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 499dfe982a0e..b8613e806aa9 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -19,10 +19,6 @@ extern unsigned long min_low_pfn; | |||
19 | */ | 19 | */ |
20 | extern unsigned long max_pfn; | 20 | extern unsigned long max_pfn; |
21 | 21 | ||
22 | #ifdef CONFIG_CRASH_DUMP | ||
23 | extern unsigned long saved_max_pfn; | ||
24 | #endif | ||
25 | |||
26 | #ifndef CONFIG_NO_BOOTMEM | 22 | #ifndef CONFIG_NO_BOOTMEM |
27 | /* | 23 | /* |
28 | * node_bootmem_map is a map pointer - the bits represent all physical | 24 | * node_bootmem_map is a map pointer - the bits represent all physical |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 68d1fe7b877c..f5df23561b96 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -219,7 +219,6 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size); | |||
219 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 219 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
220 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | 220 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
221 | get_block_t get_block); | 221 | get_block_t get_block); |
222 | void block_sync_page(struct page *); | ||
223 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 222 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
224 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 223 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
225 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, | 224 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, |
diff --git a/include/linux/capability.h b/include/linux/capability.h index fb16a3699b99..16ee8b49a200 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -368,6 +368,15 @@ struct cpu_vfs_cap_data { | |||
368 | 368 | ||
369 | #ifdef __KERNEL__ | 369 | #ifdef __KERNEL__ |
370 | 370 | ||
371 | struct dentry; | ||
372 | struct user_namespace; | ||
373 | |||
374 | struct user_namespace *current_user_ns(void); | ||
375 | |||
376 | extern const kernel_cap_t __cap_empty_set; | ||
377 | extern const kernel_cap_t __cap_full_set; | ||
378 | extern const kernel_cap_t __cap_init_eff_set; | ||
379 | |||
371 | /* | 380 | /* |
372 | * Internal kernel functions only | 381 | * Internal kernel functions only |
373 | */ | 382 | */ |
@@ -530,40 +539,27 @@ static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a, | |||
530 | cap_intersect(permitted, __cap_nfsd_set)); | 539 | cap_intersect(permitted, __cap_nfsd_set)); |
531 | } | 540 | } |
532 | 541 | ||
533 | extern const kernel_cap_t __cap_empty_set; | 542 | extern bool has_capability(struct task_struct *t, int cap); |
534 | extern const kernel_cap_t __cap_full_set; | 543 | extern bool has_ns_capability(struct task_struct *t, |
535 | extern const kernel_cap_t __cap_init_eff_set; | 544 | struct user_namespace *ns, int cap); |
536 | 545 | extern bool has_capability_noaudit(struct task_struct *t, int cap); | |
537 | /** | 546 | extern bool capable(int cap); |
538 | * has_capability - Determine if a task has a superior capability available | 547 | extern bool ns_capable(struct user_namespace *ns, int cap); |
539 | * @t: The task in question | 548 | extern bool task_ns_capable(struct task_struct *t, int cap); |
540 | * @cap: The capability to be tested for | ||
541 | * | ||
542 | * Return true if the specified task has the given superior capability | ||
543 | * currently in effect, false if not. | ||
544 | * | ||
545 | * Note that this does not set PF_SUPERPRIV on the task. | ||
546 | */ | ||
547 | #define has_capability(t, cap) (security_real_capable((t), (cap)) == 0) | ||
548 | 549 | ||
549 | /** | 550 | /** |
550 | * has_capability_noaudit - Determine if a task has a superior capability available (unaudited) | 551 | * nsown_capable - Check superior capability to one's own user_ns |
551 | * @t: The task in question | 552 | * @cap: The capability in question |
552 | * @cap: The capability to be tested for | ||
553 | * | 553 | * |
554 | * Return true if the specified task has the given superior capability | 554 | * Return true if the current task has the given superior capability |
555 | * currently in effect, false if not, but don't write an audit message for the | 555 | * targeted at its own user namespace. |
556 | * check. | ||
557 | * | ||
558 | * Note that this does not set PF_SUPERPRIV on the task. | ||
559 | */ | 556 | */ |
560 | #define has_capability_noaudit(t, cap) \ | 557 | static inline bool nsown_capable(int cap) |
561 | (security_real_capable_noaudit((t), (cap)) == 0) | 558 | { |
562 | 559 | return ns_capable(current_user_ns(), cap); | |
563 | extern int capable(int cap); | 560 | } |
564 | 561 | ||
565 | /* audit system wants to get cap info from files as well */ | 562 | /* audit system wants to get cap info from files as well */ |
566 | struct dentry; | ||
567 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); | 563 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); |
568 | 564 | ||
569 | #endif /* __KERNEL__ */ | 565 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/cper.h b/include/linux/cper.h index 3104aaff5dd0..372a25839fd1 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
@@ -388,5 +388,7 @@ struct cper_sec_pcie { | |||
388 | #pragma pack() | 388 | #pragma pack() |
389 | 389 | ||
390 | u64 cper_next_record_id(void); | 390 | u64 cper_next_record_id(void); |
391 | void cper_print_bits(const char *prefix, unsigned int bits, | ||
392 | const char *strs[], unsigned int strs_size); | ||
391 | 393 | ||
392 | #endif | 394 | #endif |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4aaeab376446..9aeeb0ba2003 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -354,9 +354,11 @@ static inline void put_cred(const struct cred *_cred) | |||
354 | #define current_fsgid() (current_cred_xxx(fsgid)) | 354 | #define current_fsgid() (current_cred_xxx(fsgid)) |
355 | #define current_cap() (current_cred_xxx(cap_effective)) | 355 | #define current_cap() (current_cred_xxx(cap_effective)) |
356 | #define current_user() (current_cred_xxx(user)) | 356 | #define current_user() (current_cred_xxx(user)) |
357 | #define current_user_ns() (current_cred_xxx(user)->user_ns) | 357 | #define _current_user_ns() (current_cred_xxx(user)->user_ns) |
358 | #define current_security() (current_cred_xxx(security)) | 358 | #define current_security() (current_cred_xxx(security)) |
359 | 359 | ||
360 | extern struct user_namespace *current_user_ns(void); | ||
361 | |||
360 | #define current_uid_gid(_uid, _gid) \ | 362 | #define current_uid_gid(_uid, _gid) \ |
361 | do { \ | 363 | do { \ |
362 | const struct cred *__cred; \ | 364 | const struct cred *__cred; \ |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 272496d1fae4..e2768834f397 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -286,11 +286,6 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback | |||
286 | int dm_table_complete(struct dm_table *t); | 286 | int dm_table_complete(struct dm_table *t); |
287 | 287 | ||
288 | /* | 288 | /* |
289 | * Unplug all devices in a table. | ||
290 | */ | ||
291 | void dm_table_unplug_all(struct dm_table *t); | ||
292 | |||
293 | /* | ||
294 | * Table reference counting. | 289 | * Table reference counting. |
295 | */ | 290 | */ |
296 | struct dm_table *dm_get_live_table(struct mapped_device *md); | 291 | struct dm_table *dm_get_live_table(struct mapped_device *md); |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 4d857973d2c9..d93efcc44570 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -20,7 +20,6 @@ typedef void (elevator_bio_merged_fn) (struct request_queue *, | |||
20 | typedef int (elevator_dispatch_fn) (struct request_queue *, int); | 20 | typedef int (elevator_dispatch_fn) (struct request_queue *, int); |
21 | 21 | ||
22 | typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); | 22 | typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); |
23 | typedef int (elevator_queue_empty_fn) (struct request_queue *); | ||
24 | typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *); | 23 | typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *); |
25 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); | 24 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); |
26 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); | 25 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); |
@@ -46,7 +45,6 @@ struct elevator_ops | |||
46 | elevator_activate_req_fn *elevator_activate_req_fn; | 45 | elevator_activate_req_fn *elevator_activate_req_fn; |
47 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; | 46 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; |
48 | 47 | ||
49 | elevator_queue_empty_fn *elevator_queue_empty_fn; | ||
50 | elevator_completed_req_fn *elevator_completed_req_fn; | 48 | elevator_completed_req_fn *elevator_completed_req_fn; |
51 | 49 | ||
52 | elevator_request_list_fn *elevator_former_req_fn; | 50 | elevator_request_list_fn *elevator_former_req_fn; |
@@ -101,17 +99,17 @@ struct elevator_queue | |||
101 | */ | 99 | */ |
102 | extern void elv_dispatch_sort(struct request_queue *, struct request *); | 100 | extern void elv_dispatch_sort(struct request_queue *, struct request *); |
103 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); | 101 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); |
104 | extern void elv_add_request(struct request_queue *, struct request *, int, int); | 102 | extern void elv_add_request(struct request_queue *, struct request *, int); |
105 | extern void __elv_add_request(struct request_queue *, struct request *, int, int); | 103 | extern void __elv_add_request(struct request_queue *, struct request *, int); |
106 | extern void elv_insert(struct request_queue *, struct request *, int); | 104 | extern void elv_insert(struct request_queue *, struct request *, int); |
107 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); | 105 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); |
106 | extern int elv_try_merge(struct request *, struct bio *); | ||
108 | extern void elv_merge_requests(struct request_queue *, struct request *, | 107 | extern void elv_merge_requests(struct request_queue *, struct request *, |
109 | struct request *); | 108 | struct request *); |
110 | extern void elv_merged_request(struct request_queue *, struct request *, int); | 109 | extern void elv_merged_request(struct request_queue *, struct request *, int); |
111 | extern void elv_bio_merged(struct request_queue *q, struct request *, | 110 | extern void elv_bio_merged(struct request_queue *q, struct request *, |
112 | struct bio *); | 111 | struct bio *); |
113 | extern void elv_requeue_request(struct request_queue *, struct request *); | 112 | extern void elv_requeue_request(struct request_queue *, struct request *); |
114 | extern int elv_queue_empty(struct request_queue *); | ||
115 | extern struct request *elv_former_request(struct request_queue *, struct request *); | 113 | extern struct request *elv_former_request(struct request_queue *, struct request *); |
116 | extern struct request *elv_latter_request(struct request_queue *, struct request *); | 114 | extern struct request *elv_latter_request(struct request_queue *, struct request *); |
117 | extern int elv_register_queue(struct request_queue *q); | 115 | extern int elv_register_queue(struct request_queue *q); |
@@ -167,6 +165,8 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t); | |||
167 | #define ELEVATOR_INSERT_BACK 2 | 165 | #define ELEVATOR_INSERT_BACK 2 |
168 | #define ELEVATOR_INSERT_SORT 3 | 166 | #define ELEVATOR_INSERT_SORT 3 |
169 | #define ELEVATOR_INSERT_REQUEUE 4 | 167 | #define ELEVATOR_INSERT_REQUEUE 4 |
168 | #define ELEVATOR_INSERT_FLUSH 5 | ||
169 | #define ELEVATOR_INSERT_SORT_MERGE 6 | ||
170 | 170 | ||
171 | /* | 171 | /* |
172 | * return values from elevator_may_queue_fn | 172 | * return values from elevator_may_queue_fn |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 6043c64c207a..85c1d302c12e 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -418,13 +418,13 @@ struct ext3_inode { | |||
418 | #define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS | 418 | #define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS |
419 | #endif | 419 | #endif |
420 | 420 | ||
421 | #define ext3_set_bit ext2_set_bit | 421 | #define ext3_set_bit __test_and_set_bit_le |
422 | #define ext3_set_bit_atomic ext2_set_bit_atomic | 422 | #define ext3_set_bit_atomic ext2_set_bit_atomic |
423 | #define ext3_clear_bit ext2_clear_bit | 423 | #define ext3_clear_bit __test_and_clear_bit_le |
424 | #define ext3_clear_bit_atomic ext2_clear_bit_atomic | 424 | #define ext3_clear_bit_atomic ext2_clear_bit_atomic |
425 | #define ext3_test_bit ext2_test_bit | 425 | #define ext3_test_bit test_bit_le |
426 | #define ext3_find_first_zero_bit ext2_find_first_zero_bit | 426 | #define ext3_find_first_zero_bit find_first_zero_bit_le |
427 | #define ext3_find_next_zero_bit ext2_find_next_zero_bit | 427 | #define ext3_find_next_zero_bit find_next_zero_bit_le |
428 | 428 | ||
429 | /* | 429 | /* |
430 | * Maximal mount counts between two filesystem checks | 430 | * Maximal mount counts between two filesystem checks |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 12529e966350..b677bd77f2d6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -138,16 +138,10 @@ struct inodes_stat_t { | |||
138 | * block layer could (in theory) choose to ignore this | 138 | * block layer could (in theory) choose to ignore this |
139 | * request if it runs into resource problems. | 139 | * request if it runs into resource problems. |
140 | * WRITE A normal async write. Device will be plugged. | 140 | * WRITE A normal async write. Device will be plugged. |
141 | * WRITE_SYNC_PLUG Synchronous write. Identical to WRITE, but passes down | 141 | * WRITE_SYNC Synchronous write. Identical to WRITE, but passes down |
142 | * the hint that someone will be waiting on this IO | 142 | * the hint that someone will be waiting on this IO |
143 | * shortly. The device must still be unplugged explicitly, | 143 | * shortly. The write equivalent of READ_SYNC. |
144 | * WRITE_SYNC_PLUG does not do this as we could be | 144 | * WRITE_ODIRECT Special case write for O_DIRECT only. |
145 | * submitting more writes before we actually wait on any | ||
146 | * of them. | ||
147 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device | ||
148 | * immediately after submission. The write equivalent | ||
149 | * of READ_SYNC. | ||
150 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. | ||
151 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. | 145 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. |
152 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on | 146 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on |
153 | * non-volatile media on completion. | 147 | * non-volatile media on completion. |
@@ -163,18 +157,14 @@ struct inodes_stat_t { | |||
163 | #define WRITE RW_MASK | 157 | #define WRITE RW_MASK |
164 | #define READA RWA_MASK | 158 | #define READA RWA_MASK |
165 | 159 | ||
166 | #define READ_SYNC (READ | REQ_SYNC | REQ_UNPLUG) | 160 | #define READ_SYNC (READ | REQ_SYNC) |
167 | #define READ_META (READ | REQ_META) | 161 | #define READ_META (READ | REQ_META) |
168 | #define WRITE_SYNC_PLUG (WRITE | REQ_SYNC | REQ_NOIDLE) | 162 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) |
169 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) | 163 | #define WRITE_ODIRECT (WRITE | REQ_SYNC) |
170 | #define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) | ||
171 | #define WRITE_META (WRITE | REQ_META) | 164 | #define WRITE_META (WRITE | REQ_META) |
172 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 165 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) |
173 | REQ_FLUSH) | 166 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) |
174 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 167 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
175 | REQ_FUA) | ||
176 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | ||
177 | REQ_FLUSH | REQ_FUA) | ||
178 | 168 | ||
179 | #define SEL_IN 1 | 169 | #define SEL_IN 1 |
180 | #define SEL_OUT 2 | 170 | #define SEL_OUT 2 |
@@ -586,7 +576,6 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, | |||
586 | struct address_space_operations { | 576 | struct address_space_operations { |
587 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 577 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
588 | int (*readpage)(struct file *, struct page *); | 578 | int (*readpage)(struct file *, struct page *); |
589 | void (*sync_page)(struct page *); | ||
590 | 579 | ||
591 | /* Write back some dirty pages from this mapping. */ | 580 | /* Write back some dirty pages from this mapping. */ |
592 | int (*writepages)(struct address_space *, struct writeback_control *); | 581 | int (*writepages)(struct address_space *, struct writeback_control *); |
@@ -1457,8 +1446,13 @@ enum { | |||
1457 | #define put_fs_excl() atomic_dec(¤t->fs_excl) | 1446 | #define put_fs_excl() atomic_dec(¤t->fs_excl) |
1458 | #define has_fs_excl() atomic_read(¤t->fs_excl) | 1447 | #define has_fs_excl() atomic_read(¤t->fs_excl) |
1459 | 1448 | ||
1460 | #define is_owner_or_cap(inode) \ | 1449 | /* |
1461 | ((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER)) | 1450 | * until VFS tracks user namespaces for inodes, just make all files |
1451 | * belong to init_user_ns | ||
1452 | */ | ||
1453 | extern struct user_namespace init_user_ns; | ||
1454 | #define inode_userns(inode) (&init_user_ns) | ||
1455 | extern bool inode_owner_or_capable(const struct inode *inode); | ||
1462 | 1456 | ||
1463 | /* not quite ready to be deprecated, but... */ | 1457 | /* not quite ready to be deprecated, but... */ |
1464 | extern void lock_super(struct super_block *); | 1458 | extern void lock_super(struct super_block *); |
@@ -1642,7 +1636,7 @@ struct super_operations { | |||
1642 | }; | 1636 | }; |
1643 | 1637 | ||
1644 | /* | 1638 | /* |
1645 | * Inode state bits. Protected by inode_lock. | 1639 | * Inode state bits. Protected by inode->i_lock |
1646 | * | 1640 | * |
1647 | * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, | 1641 | * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, |
1648 | * I_DIRTY_DATASYNC and I_DIRTY_PAGES. | 1642 | * I_DIRTY_DATASYNC and I_DIRTY_PAGES. |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c0d5f6945c1e..d764a426e9fd 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -109,7 +109,7 @@ struct hd_struct { | |||
109 | int make_it_fail; | 109 | int make_it_fail; |
110 | #endif | 110 | #endif |
111 | unsigned long stamp; | 111 | unsigned long stamp; |
112 | int in_flight[2]; | 112 | atomic_t in_flight[2]; |
113 | #ifdef CONFIG_SMP | 113 | #ifdef CONFIG_SMP |
114 | struct disk_stats __percpu *dkstats; | 114 | struct disk_stats __percpu *dkstats; |
115 | #else | 115 | #else |
@@ -370,21 +370,21 @@ static inline void free_part_stats(struct hd_struct *part) | |||
370 | 370 | ||
371 | static inline void part_inc_in_flight(struct hd_struct *part, int rw) | 371 | static inline void part_inc_in_flight(struct hd_struct *part, int rw) |
372 | { | 372 | { |
373 | part->in_flight[rw]++; | 373 | atomic_inc(&part->in_flight[rw]); |
374 | if (part->partno) | 374 | if (part->partno) |
375 | part_to_disk(part)->part0.in_flight[rw]++; | 375 | atomic_inc(&part_to_disk(part)->part0.in_flight[rw]); |
376 | } | 376 | } |
377 | 377 | ||
378 | static inline void part_dec_in_flight(struct hd_struct *part, int rw) | 378 | static inline void part_dec_in_flight(struct hd_struct *part, int rw) |
379 | { | 379 | { |
380 | part->in_flight[rw]--; | 380 | atomic_dec(&part->in_flight[rw]); |
381 | if (part->partno) | 381 | if (part->partno) |
382 | part_to_disk(part)->part0.in_flight[rw]--; | 382 | atomic_dec(&part_to_disk(part)->part0.in_flight[rw]); |
383 | } | 383 | } |
384 | 384 | ||
385 | static inline int part_in_flight(struct hd_struct *part) | 385 | static inline int part_in_flight(struct hd_struct *part) |
386 | { | 386 | { |
387 | return part->in_flight[0] + part->in_flight[1]; | 387 | return atomic_read(&part->in_flight[0]) + atomic_read(&part->in_flight[1]); |
388 | } | 388 | } |
389 | 389 | ||
390 | static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk) | 390 | static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 58afd9d2c438..0c0d1ae79981 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -698,6 +698,7 @@ struct twl4030_platform_data { | |||
698 | struct regulator_init_data *vana; | 698 | struct regulator_init_data *vana; |
699 | struct regulator_init_data *vcxio; | 699 | struct regulator_init_data *vcxio; |
700 | struct regulator_init_data *vusb; | 700 | struct regulator_init_data *vusb; |
701 | struct regulator_init_data *clk32kg; | ||
701 | }; | 702 | }; |
702 | 703 | ||
703 | /*----------------------------------------------------------------------*/ | 704 | /*----------------------------------------------------------------------*/ |
@@ -777,5 +778,6 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
777 | 778 | ||
778 | /* INTERNAL LDOs */ | 779 | /* INTERNAL LDOs */ |
779 | #define TWL6030_REG_VRTC 47 | 780 | #define TWL6030_REG_VRTC 47 |
781 | #define TWL6030_REG_CLK32KG 48 | ||
780 | 782 | ||
781 | #endif /* End of __TWL4030_H */ | 783 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h new file mode 100644 index 000000000000..6427d298fbfc --- /dev/null +++ b/include/linux/i2c/twl4030-madc.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * twl4030_madc.h - Header for TWL4030 MADC | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * J Keerthy <j-keerthy@ti.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * version 2 as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
19 | * 02110-1301 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef _TWL4030_MADC_H | ||
24 | #define _TWL4030_MADC_H | ||
25 | |||
26 | struct twl4030_madc_conversion_method { | ||
27 | u8 sel; | ||
28 | u8 avg; | ||
29 | u8 rbase; | ||
30 | u8 ctrl; | ||
31 | }; | ||
32 | |||
33 | #define TWL4030_MADC_MAX_CHANNELS 16 | ||
34 | |||
35 | |||
36 | /* | ||
37 | * twl4030_madc_request- madc request packet for channel conversion | ||
38 | * @channels: 16 bit bitmap for individual channels | ||
39 | * @do_avgP: sample the input channel for 4 consecutive cycles | ||
40 | * @method: RT, SW1, SW2 | ||
41 | * @type: Polling or interrupt based method | ||
42 | */ | ||
43 | |||
44 | struct twl4030_madc_request { | ||
45 | unsigned long channels; | ||
46 | u16 do_avg; | ||
47 | u16 method; | ||
48 | u16 type; | ||
49 | bool active; | ||
50 | bool result_pending; | ||
51 | int rbuf[TWL4030_MADC_MAX_CHANNELS]; | ||
52 | void (*func_cb)(int len, int channels, int *buf); | ||
53 | }; | ||
54 | |||
55 | enum conversion_methods { | ||
56 | TWL4030_MADC_RT, | ||
57 | TWL4030_MADC_SW1, | ||
58 | TWL4030_MADC_SW2, | ||
59 | TWL4030_MADC_NUM_METHODS | ||
60 | }; | ||
61 | |||
62 | enum sample_type { | ||
63 | TWL4030_MADC_WAIT, | ||
64 | TWL4030_MADC_IRQ_ONESHOT, | ||
65 | TWL4030_MADC_IRQ_REARM | ||
66 | }; | ||
67 | |||
68 | #define TWL4030_MADC_CTRL1 0x00 | ||
69 | #define TWL4030_MADC_CTRL2 0x01 | ||
70 | |||
71 | #define TWL4030_MADC_RTSELECT_LSB 0x02 | ||
72 | #define TWL4030_MADC_SW1SELECT_LSB 0x06 | ||
73 | #define TWL4030_MADC_SW2SELECT_LSB 0x0A | ||
74 | |||
75 | #define TWL4030_MADC_RTAVERAGE_LSB 0x04 | ||
76 | #define TWL4030_MADC_SW1AVERAGE_LSB 0x08 | ||
77 | #define TWL4030_MADC_SW2AVERAGE_LSB 0x0C | ||
78 | |||
79 | #define TWL4030_MADC_CTRL_SW1 0x12 | ||
80 | #define TWL4030_MADC_CTRL_SW2 0x13 | ||
81 | |||
82 | #define TWL4030_MADC_RTCH0_LSB 0x17 | ||
83 | #define TWL4030_MADC_GPCH0_LSB 0x37 | ||
84 | |||
85 | #define TWL4030_MADC_MADCON (1 << 0) /* MADC power on */ | ||
86 | #define TWL4030_MADC_BUSY (1 << 0) /* MADC busy */ | ||
87 | /* MADC conversion completion */ | ||
88 | #define TWL4030_MADC_EOC_SW (1 << 1) | ||
89 | /* MADC SWx start conversion */ | ||
90 | #define TWL4030_MADC_SW_START (1 << 5) | ||
91 | #define TWL4030_MADC_ADCIN0 (1 << 0) | ||
92 | #define TWL4030_MADC_ADCIN1 (1 << 1) | ||
93 | #define TWL4030_MADC_ADCIN2 (1 << 2) | ||
94 | #define TWL4030_MADC_ADCIN3 (1 << 3) | ||
95 | #define TWL4030_MADC_ADCIN4 (1 << 4) | ||
96 | #define TWL4030_MADC_ADCIN5 (1 << 5) | ||
97 | #define TWL4030_MADC_ADCIN6 (1 << 6) | ||
98 | #define TWL4030_MADC_ADCIN7 (1 << 7) | ||
99 | #define TWL4030_MADC_ADCIN8 (1 << 8) | ||
100 | #define TWL4030_MADC_ADCIN9 (1 << 9) | ||
101 | #define TWL4030_MADC_ADCIN10 (1 << 10) | ||
102 | #define TWL4030_MADC_ADCIN11 (1 << 11) | ||
103 | #define TWL4030_MADC_ADCIN12 (1 << 12) | ||
104 | #define TWL4030_MADC_ADCIN13 (1 << 13) | ||
105 | #define TWL4030_MADC_ADCIN14 (1 << 14) | ||
106 | #define TWL4030_MADC_ADCIN15 (1 << 15) | ||
107 | |||
108 | /* Fixed channels */ | ||
109 | #define TWL4030_MADC_BTEMP TWL4030_MADC_ADCIN1 | ||
110 | #define TWL4030_MADC_VBUS TWL4030_MADC_ADCIN8 | ||
111 | #define TWL4030_MADC_VBKB TWL4030_MADC_ADCIN9 | ||
112 | #define TWL4030_MADC_ICHG TWL4030_MADC_ADCIN10 | ||
113 | #define TWL4030_MADC_VCHG TWL4030_MADC_ADCIN11 | ||
114 | #define TWL4030_MADC_VBAT TWL4030_MADC_ADCIN12 | ||
115 | |||
116 | /* Step size and prescaler ratio */ | ||
117 | #define TEMP_STEP_SIZE 147 | ||
118 | #define TEMP_PSR_R 100 | ||
119 | #define CURR_STEP_SIZE 147 | ||
120 | #define CURR_PSR_R1 44 | ||
121 | #define CURR_PSR_R2 88 | ||
122 | |||
123 | #define TWL4030_BCI_BCICTL1 0x23 | ||
124 | #define TWL4030_BCI_CGAIN 0x020 | ||
125 | #define TWL4030_BCI_MESBAT (1 << 1) | ||
126 | #define TWL4030_BCI_TYPEN (1 << 4) | ||
127 | #define TWL4030_BCI_ITHEN (1 << 3) | ||
128 | |||
129 | #define REG_BCICTL2 0x024 | ||
130 | #define TWL4030_BCI_ITHSENS 0x007 | ||
131 | |||
132 | struct twl4030_madc_user_parms { | ||
133 | int channel; | ||
134 | int average; | ||
135 | int status; | ||
136 | u16 result; | ||
137 | }; | ||
138 | |||
139 | int twl4030_madc_conversion(struct twl4030_madc_request *conv); | ||
140 | int twl4030_get_madc_conversion(int channel_no); | ||
141 | #endif | ||
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 51952989ad42..a6d1655f9607 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/idr.h> | 5 | #include <linux/idr.h> |
6 | #include <linux/rwsem.h> | 6 | #include <linux/rwsem.h> |
7 | #include <linux/notifier.h> | 7 | #include <linux/notifier.h> |
8 | #include <linux/nsproxy.h> | ||
8 | 9 | ||
9 | /* | 10 | /* |
10 | * ipc namespace events | 11 | * ipc namespace events |
@@ -15,6 +16,7 @@ | |||
15 | 16 | ||
16 | #define IPCNS_CALLBACK_PRI 0 | 17 | #define IPCNS_CALLBACK_PRI 0 |
17 | 18 | ||
19 | struct user_namespace; | ||
18 | 20 | ||
19 | struct ipc_ids { | 21 | struct ipc_ids { |
20 | int in_use; | 22 | int in_use; |
@@ -56,6 +58,8 @@ struct ipc_namespace { | |||
56 | unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */ | 58 | unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */ |
57 | unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */ | 59 | unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */ |
58 | 60 | ||
61 | /* user_ns which owns the ipc ns */ | ||
62 | struct user_namespace *user_ns; | ||
59 | }; | 63 | }; |
60 | 64 | ||
61 | extern struct ipc_namespace init_ipc_ns; | 65 | extern struct ipc_namespace init_ipc_ns; |
@@ -90,7 +94,7 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } | |||
90 | 94 | ||
91 | #if defined(CONFIG_IPC_NS) | 95 | #if defined(CONFIG_IPC_NS) |
92 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 96 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
93 | struct ipc_namespace *ns); | 97 | struct task_struct *tsk); |
94 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 98 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
95 | { | 99 | { |
96 | if (ns) | 100 | if (ns) |
@@ -101,12 +105,12 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | |||
101 | extern void put_ipc_ns(struct ipc_namespace *ns); | 105 | extern void put_ipc_ns(struct ipc_namespace *ns); |
102 | #else | 106 | #else |
103 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | 107 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, |
104 | struct ipc_namespace *ns) | 108 | struct task_struct *tsk) |
105 | { | 109 | { |
106 | if (flags & CLONE_NEWIPC) | 110 | if (flags & CLONE_NEWIPC) |
107 | return ERR_PTR(-EINVAL); | 111 | return ERR_PTR(-EINVAL); |
108 | 112 | ||
109 | return ns; | 113 | return tsk->nsproxy->ipc_ns; |
110 | } | 114 | } |
111 | 115 | ||
112 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 116 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 27e79c27ba08..a32dcaec04e1 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -432,13 +432,35 @@ struct jbd2_journal_handle | |||
432 | int h_err; | 432 | int h_err; |
433 | 433 | ||
434 | /* Flags [no locking] */ | 434 | /* Flags [no locking] */ |
435 | unsigned int h_sync: 1; /* sync-on-close */ | 435 | unsigned int h_sync:1; /* sync-on-close */ |
436 | unsigned int h_jdata: 1; /* force data journaling */ | 436 | unsigned int h_jdata:1; /* force data journaling */ |
437 | unsigned int h_aborted: 1; /* fatal error on handle */ | 437 | unsigned int h_aborted:1; /* fatal error on handle */ |
438 | unsigned int h_cowing:1; /* COWing block to snapshot */ | ||
439 | |||
440 | /* Number of buffers requested by user: | ||
441 | * (before adding the COW credits factor) */ | ||
442 | unsigned int h_base_credits:14; | ||
443 | |||
444 | /* Number of buffers the user is allowed to dirty: | ||
445 | * (counts only buffers dirtied when !h_cowing) */ | ||
446 | unsigned int h_user_credits:14; | ||
447 | |||
438 | 448 | ||
439 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 449 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
440 | struct lockdep_map h_lockdep_map; | 450 | struct lockdep_map h_lockdep_map; |
441 | #endif | 451 | #endif |
452 | |||
453 | #ifdef CONFIG_JBD2_DEBUG | ||
454 | /* COW debugging counters: */ | ||
455 | unsigned int h_cow_moved; /* blocks moved to snapshot */ | ||
456 | unsigned int h_cow_copied; /* blocks copied to snapshot */ | ||
457 | unsigned int h_cow_ok_jh; /* blocks already COWed during current | ||
458 | transaction */ | ||
459 | unsigned int h_cow_ok_bitmap; /* blocks not set in COW bitmap */ | ||
460 | unsigned int h_cow_ok_mapped;/* blocks already mapped in snapshot */ | ||
461 | unsigned int h_cow_bitmaps; /* COW bitmaps created */ | ||
462 | unsigned int h_cow_excluded; /* blocks set in exclude bitmap */ | ||
463 | #endif | ||
442 | }; | 464 | }; |
443 | 465 | ||
444 | 466 | ||
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index 525aac3c97df..44e95d0a721f 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -41,6 +41,13 @@ struct journal_head { | |||
41 | unsigned b_modified; | 41 | unsigned b_modified; |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * This feild tracks the last transaction id in which this buffer | ||
45 | * has been cowed | ||
46 | * [jbd_lock_bh_state()] | ||
47 | */ | ||
48 | unsigned b_cow_tid; | ||
49 | |||
50 | /* | ||
44 | * Copy of the buffer data frozen for writing to the log. | 51 | * Copy of the buffer data frozen for writing to the log. |
45 | * [jbd_lock_bh_state()] | 52 | * [jbd_lock_bh_state()] |
46 | */ | 53 | */ |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index d8e9b3d1c23c..0df513b7a9f8 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -36,6 +36,7 @@ const char *kallsyms_lookup(unsigned long addr, | |||
36 | 36 | ||
37 | /* Look up a kernel symbol and return it in a text buffer. */ | 37 | /* Look up a kernel symbol and return it in a text buffer. */ |
38 | extern int sprint_symbol(char *buffer, unsigned long address); | 38 | extern int sprint_symbol(char *buffer, unsigned long address); |
39 | extern int sprint_backtrace(char *buffer, unsigned long address); | ||
39 | 40 | ||
40 | /* Look up a kernel symbol and print it to the kernel messages. */ | 41 | /* Look up a kernel symbol and print it to the kernel messages. */ |
41 | extern void __print_symbol(const char *fmt, unsigned long address); | 42 | extern void __print_symbol(const char *fmt, unsigned long address); |
@@ -79,6 +80,12 @@ static inline int sprint_symbol(char *buffer, unsigned long addr) | |||
79 | return 0; | 80 | return 0; |
80 | } | 81 | } |
81 | 82 | ||
83 | static inline int sprint_backtrace(char *buffer, unsigned long addr) | ||
84 | { | ||
85 | *buffer = '\0'; | ||
86 | return 0; | ||
87 | } | ||
88 | |||
82 | static inline int lookup_symbol_name(unsigned long addr, char *symname) | 89 | static inline int lookup_symbol_name(unsigned long addr, char *symname) |
83 | { | 90 | { |
84 | return -ERANGE; | 91 | return -ERANGE; |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 092e4250a458..10ca03d0a250 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -297,6 +297,7 @@ extern int | |||
297 | kgdb_handle_exception(int ex_vector, int signo, int err_code, | 297 | kgdb_handle_exception(int ex_vector, int signo, int err_code, |
298 | struct pt_regs *regs); | 298 | struct pt_regs *regs); |
299 | extern int kgdb_nmicallback(int cpu, void *regs); | 299 | extern int kgdb_nmicallback(int cpu, void *regs); |
300 | extern void gdbstub_exit(int status); | ||
300 | 301 | ||
301 | extern int kgdb_single_step; | 302 | extern int kgdb_single_step; |
302 | extern atomic_t kgdb_active; | 303 | extern atomic_t kgdb_active; |
diff --git a/include/linux/media.h b/include/linux/media.h new file mode 100644 index 000000000000..0ef883327de2 --- /dev/null +++ b/include/linux/media.h | |||
@@ -0,0 +1,132 @@ | |||
1 | /* | ||
2 | * Multimedia device API | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
7 | * Sakari Ailus <sakari.ailus@iki.fi> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_MEDIA_H | ||
24 | #define __LINUX_MEDIA_H | ||
25 | |||
26 | #include <linux/ioctl.h> | ||
27 | #include <linux/types.h> | ||
28 | #include <linux/version.h> | ||
29 | |||
30 | #define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0) | ||
31 | |||
32 | struct media_device_info { | ||
33 | char driver[16]; | ||
34 | char model[32]; | ||
35 | char serial[40]; | ||
36 | char bus_info[32]; | ||
37 | __u32 media_version; | ||
38 | __u32 hw_revision; | ||
39 | __u32 driver_version; | ||
40 | __u32 reserved[31]; | ||
41 | }; | ||
42 | |||
43 | #define MEDIA_ENT_ID_FLAG_NEXT (1 << 31) | ||
44 | |||
45 | #define MEDIA_ENT_TYPE_SHIFT 16 | ||
46 | #define MEDIA_ENT_TYPE_MASK 0x00ff0000 | ||
47 | #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff | ||
48 | |||
49 | #define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT) | ||
50 | #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1) | ||
51 | #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2) | ||
52 | #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3) | ||
53 | #define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4) | ||
54 | |||
55 | #define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT) | ||
56 | #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1) | ||
57 | #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2) | ||
58 | #define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3) | ||
59 | |||
60 | #define MEDIA_ENT_FL_DEFAULT (1 << 0) | ||
61 | |||
62 | struct media_entity_desc { | ||
63 | __u32 id; | ||
64 | char name[32]; | ||
65 | __u32 type; | ||
66 | __u32 revision; | ||
67 | __u32 flags; | ||
68 | __u32 group_id; | ||
69 | __u16 pads; | ||
70 | __u16 links; | ||
71 | |||
72 | __u32 reserved[4]; | ||
73 | |||
74 | union { | ||
75 | /* Node specifications */ | ||
76 | struct { | ||
77 | __u32 major; | ||
78 | __u32 minor; | ||
79 | } v4l; | ||
80 | struct { | ||
81 | __u32 major; | ||
82 | __u32 minor; | ||
83 | } fb; | ||
84 | struct { | ||
85 | __u32 card; | ||
86 | __u32 device; | ||
87 | __u32 subdevice; | ||
88 | } alsa; | ||
89 | int dvb; | ||
90 | |||
91 | /* Sub-device specifications */ | ||
92 | /* Nothing needed yet */ | ||
93 | __u8 raw[184]; | ||
94 | }; | ||
95 | }; | ||
96 | |||
97 | #define MEDIA_PAD_FL_SINK (1 << 0) | ||
98 | #define MEDIA_PAD_FL_SOURCE (1 << 1) | ||
99 | |||
100 | struct media_pad_desc { | ||
101 | __u32 entity; /* entity ID */ | ||
102 | __u16 index; /* pad index */ | ||
103 | __u32 flags; /* pad flags */ | ||
104 | __u32 reserved[2]; | ||
105 | }; | ||
106 | |||
107 | #define MEDIA_LNK_FL_ENABLED (1 << 0) | ||
108 | #define MEDIA_LNK_FL_IMMUTABLE (1 << 1) | ||
109 | #define MEDIA_LNK_FL_DYNAMIC (1 << 2) | ||
110 | |||
111 | struct media_link_desc { | ||
112 | struct media_pad_desc source; | ||
113 | struct media_pad_desc sink; | ||
114 | __u32 flags; | ||
115 | __u32 reserved[2]; | ||
116 | }; | ||
117 | |||
118 | struct media_links_enum { | ||
119 | __u32 entity; | ||
120 | /* Should have enough room for pads elements */ | ||
121 | struct media_pad_desc __user *pads; | ||
122 | /* Should have enough room for links elements */ | ||
123 | struct media_link_desc __user *links; | ||
124 | __u32 reserved[4]; | ||
125 | }; | ||
126 | |||
127 | #define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info) | ||
128 | #define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc) | ||
129 | #define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum) | ||
130 | #define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc) | ||
131 | |||
132 | #endif /* __LINUX_MEDIA_H */ | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5bb7be2628ca..5a5ce7055839 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -151,6 +151,10 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | |||
151 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); | 151 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); |
152 | #endif | 152 | #endif |
153 | 153 | ||
154 | #ifdef CONFIG_DEBUG_VM | ||
155 | bool mem_cgroup_bad_page_check(struct page *page); | ||
156 | void mem_cgroup_print_bad_page(struct page *page); | ||
157 | #endif | ||
154 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 158 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
155 | struct mem_cgroup; | 159 | struct mem_cgroup; |
156 | 160 | ||
@@ -352,5 +356,18 @@ static inline void mem_cgroup_split_huge_fixup(struct page *head, | |||
352 | 356 | ||
353 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 357 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
354 | 358 | ||
359 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) | ||
360 | static inline bool | ||
361 | mem_cgroup_bad_page_check(struct page *page) | ||
362 | { | ||
363 | return false; | ||
364 | } | ||
365 | |||
366 | static inline void | ||
367 | mem_cgroup_print_bad_page(struct page *page) | ||
368 | { | ||
369 | } | ||
370 | #endif | ||
371 | |||
355 | #endif /* _LINUX_MEMCONTROL_H */ | 372 | #endif /* _LINUX_MEMCONTROL_H */ |
356 | 373 | ||
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index 4db1fbd8969e..8fba7972ff5f 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
@@ -131,9 +131,11 @@ enum { | |||
131 | PM8607_ID_LDO8, | 131 | PM8607_ID_LDO8, |
132 | PM8607_ID_LDO9, | 132 | PM8607_ID_LDO9, |
133 | PM8607_ID_LDO10, | 133 | PM8607_ID_LDO10, |
134 | PM8607_ID_LDO11, | ||
134 | PM8607_ID_LDO12, | 135 | PM8607_ID_LDO12, |
135 | PM8607_ID_LDO13, | 136 | PM8607_ID_LDO13, |
136 | PM8607_ID_LDO14, | 137 | PM8607_ID_LDO14, |
138 | PM8607_ID_LDO15, | ||
137 | 139 | ||
138 | PM8607_ID_RG_MAX, | 140 | PM8607_ID_RG_MAX, |
139 | }; | 141 | }; |
@@ -310,8 +312,6 @@ struct pm860x_chip { | |||
310 | 312 | ||
311 | }; | 313 | }; |
312 | 314 | ||
313 | #define PM8607_MAX_REGULATOR PM8607_ID_RG_MAX /* 3 Bucks, 13 LDOs */ | ||
314 | |||
315 | enum { | 315 | enum { |
316 | GI2C_PORT = 0, | 316 | GI2C_PORT = 0, |
317 | PI2C_PORT, | 317 | PI2C_PORT, |
@@ -351,23 +351,31 @@ struct pm860x_platform_data { | |||
351 | struct pm860x_led_pdata *led; | 351 | struct pm860x_led_pdata *led; |
352 | struct pm860x_touch_pdata *touch; | 352 | struct pm860x_touch_pdata *touch; |
353 | struct pm860x_power_pdata *power; | 353 | struct pm860x_power_pdata *power; |
354 | struct regulator_init_data *regulator; | ||
354 | 355 | ||
355 | unsigned short companion_addr; /* I2C address of companion chip */ | 356 | unsigned short companion_addr; /* I2C address of companion chip */ |
356 | int i2c_port; /* Controlled by GI2C or PI2C */ | 357 | int i2c_port; /* Controlled by GI2C or PI2C */ |
357 | int irq_mode; /* Clear interrupt by read/write(0/1) */ | 358 | int irq_mode; /* Clear interrupt by read/write(0/1) */ |
358 | int irq_base; /* IRQ base number of 88pm860x */ | 359 | int irq_base; /* IRQ base number of 88pm860x */ |
359 | struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; | 360 | int num_leds; |
361 | int num_backlights; | ||
362 | int num_regulators; | ||
360 | }; | 363 | }; |
361 | 364 | ||
362 | extern char pm860x_backlight_name[][MFD_NAME_SIZE]; | ||
363 | extern char pm860x_led_name[][MFD_NAME_SIZE]; | ||
364 | |||
365 | extern int pm860x_reg_read(struct i2c_client *, int); | 365 | extern int pm860x_reg_read(struct i2c_client *, int); |
366 | extern int pm860x_reg_write(struct i2c_client *, int, unsigned char); | 366 | extern int pm860x_reg_write(struct i2c_client *, int, unsigned char); |
367 | extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *); | 367 | extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *); |
368 | extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *); | 368 | extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *); |
369 | extern int pm860x_set_bits(struct i2c_client *, int, unsigned char, | 369 | extern int pm860x_set_bits(struct i2c_client *, int, unsigned char, |
370 | unsigned char); | 370 | unsigned char); |
371 | extern int pm860x_page_reg_read(struct i2c_client *, int); | ||
372 | extern int pm860x_page_reg_write(struct i2c_client *, int, unsigned char); | ||
373 | extern int pm860x_page_bulk_read(struct i2c_client *, int, int, | ||
374 | unsigned char *); | ||
375 | extern int pm860x_page_bulk_write(struct i2c_client *, int, int, | ||
376 | unsigned char *); | ||
377 | extern int pm860x_page_set_bits(struct i2c_client *, int, unsigned char, | ||
378 | unsigned char); | ||
371 | 379 | ||
372 | extern int pm860x_device_init(struct pm860x_chip *chip, | 380 | extern int pm860x_device_init(struct pm860x_chip *chip, |
373 | struct pm860x_platform_data *pdata) __devinit ; | 381 | struct pm860x_platform_data *pdata) __devinit ; |
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index 37f56b7c4c15..56f8dea72152 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -111,8 +111,8 @@ | |||
111 | * @dev: parent device | 111 | * @dev: parent device |
112 | * @lock: read/write operations lock | 112 | * @lock: read/write operations lock |
113 | * @irq_lock: genirq bus lock | 113 | * @irq_lock: genirq bus lock |
114 | * @revision: chip revision | ||
115 | * @irq: irq line | 114 | * @irq: irq line |
115 | * @chip_id: chip revision id | ||
116 | * @write: register write | 116 | * @write: register write |
117 | * @read: register read | 117 | * @read: register read |
118 | * @rx_buf: rx buf for SPI | 118 | * @rx_buf: rx buf for SPI |
@@ -124,7 +124,7 @@ struct ab8500 { | |||
124 | struct device *dev; | 124 | struct device *dev; |
125 | struct mutex lock; | 125 | struct mutex lock; |
126 | struct mutex irq_lock; | 126 | struct mutex irq_lock; |
127 | int revision; | 127 | |
128 | int irq_base; | 128 | int irq_base; |
129 | int irq; | 129 | int irq; |
130 | u8 chip_id; | 130 | u8 chip_id; |
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/ab8500/gpadc.h new file mode 100644 index 000000000000..46b954011f16 --- /dev/null +++ b/include/linux/mfd/ab8500/gpadc.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 ST-Ericsson SA | ||
3 | * Licensed under GPLv2. | ||
4 | * | ||
5 | * Author: Arun R Murthy <arun.murthy@stericsson.com> | ||
6 | * Author: Daniel Willerud <daniel.willerud@stericsson.com> | ||
7 | */ | ||
8 | |||
9 | #ifndef _AB8500_GPADC_H | ||
10 | #define _AB8500_GPADC_H | ||
11 | |||
12 | /* GPADC source: From datasheet(ADCSwSel[4:0] in GPADCCtrl2) */ | ||
13 | #define BAT_CTRL 0x01 | ||
14 | #define BTEMP_BALL 0x02 | ||
15 | #define MAIN_CHARGER_V 0x03 | ||
16 | #define ACC_DETECT1 0x04 | ||
17 | #define ACC_DETECT2 0x05 | ||
18 | #define ADC_AUX1 0x06 | ||
19 | #define ADC_AUX2 0x07 | ||
20 | #define MAIN_BAT_V 0x08 | ||
21 | #define VBUS_V 0x09 | ||
22 | #define MAIN_CHARGER_C 0x0A | ||
23 | #define USB_CHARGER_C 0x0B | ||
24 | #define BK_BAT_V 0x0C | ||
25 | #define DIE_TEMP 0x0D | ||
26 | |||
27 | struct ab8500_gpadc; | ||
28 | |||
29 | struct ab8500_gpadc *ab8500_gpadc_get(char *name); | ||
30 | int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input); | ||
31 | |||
32 | #endif /* _AB8500_GPADC_H */ | ||
diff --git a/include/linux/mfd/ab8500/sysctrl.h b/include/linux/mfd/ab8500/sysctrl.h new file mode 100644 index 000000000000..10da0291f8f8 --- /dev/null +++ b/include/linux/mfd/ab8500/sysctrl.h | |||
@@ -0,0 +1,254 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> for ST Ericsson. | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | #ifndef __AB8500_SYSCTRL_H | ||
7 | #define __AB8500_SYSCTRL_H | ||
8 | |||
9 | #include <linux/bitops.h> | ||
10 | |||
11 | #ifdef CONFIG_AB8500_CORE | ||
12 | |||
13 | int ab8500_sysctrl_read(u16 reg, u8 *value); | ||
14 | int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value); | ||
15 | |||
16 | #else | ||
17 | |||
18 | static inline int ab8500_sysctrl_read(u16 reg, u8 *value) | ||
19 | { | ||
20 | return 0; | ||
21 | } | ||
22 | |||
23 | static inline int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value) | ||
24 | { | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | #endif /* CONFIG_AB8500_CORE */ | ||
29 | |||
30 | static inline int ab8500_sysctrl_set(u16 reg, u8 bits) | ||
31 | { | ||
32 | return ab8500_sysctrl_write(reg, bits, bits); | ||
33 | } | ||
34 | |||
35 | static inline int ab8500_sysctrl_clear(u16 reg, u8 bits) | ||
36 | { | ||
37 | return ab8500_sysctrl_write(reg, bits, 0); | ||
38 | } | ||
39 | |||
40 | /* Registers */ | ||
41 | #define AB8500_TURNONSTATUS 0x100 | ||
42 | #define AB8500_RESETSTATUS 0x101 | ||
43 | #define AB8500_PONKEY1PRESSSTATUS 0x102 | ||
44 | #define AB8500_SYSCLKREQSTATUS 0x142 | ||
45 | #define AB8500_STW4500CTRL1 0x180 | ||
46 | #define AB8500_STW4500CTRL2 0x181 | ||
47 | #define AB8500_STW4500CTRL3 0x200 | ||
48 | #define AB8500_MAINWDOGCTRL 0x201 | ||
49 | #define AB8500_MAINWDOGTIMER 0x202 | ||
50 | #define AB8500_LOWBAT 0x203 | ||
51 | #define AB8500_BATTOK 0x204 | ||
52 | #define AB8500_SYSCLKTIMER 0x205 | ||
53 | #define AB8500_SMPSCLKCTRL 0x206 | ||
54 | #define AB8500_SMPSCLKSEL1 0x207 | ||
55 | #define AB8500_SMPSCLKSEL2 0x208 | ||
56 | #define AB8500_SMPSCLKSEL3 0x209 | ||
57 | #define AB8500_SYSULPCLKCONF 0x20A | ||
58 | #define AB8500_SYSULPCLKCTRL1 0x20B | ||
59 | #define AB8500_SYSCLKCTRL 0x20C | ||
60 | #define AB8500_SYSCLKREQ1VALID 0x20D | ||
61 | #define AB8500_SYSTEMCTRLSUP 0x20F | ||
62 | #define AB8500_SYSCLKREQ1RFCLKBUF 0x210 | ||
63 | #define AB8500_SYSCLKREQ2RFCLKBUF 0x211 | ||
64 | #define AB8500_SYSCLKREQ3RFCLKBUF 0x212 | ||
65 | #define AB8500_SYSCLKREQ4RFCLKBUF 0x213 | ||
66 | #define AB8500_SYSCLKREQ5RFCLKBUF 0x214 | ||
67 | #define AB8500_SYSCLKREQ6RFCLKBUF 0x215 | ||
68 | #define AB8500_SYSCLKREQ7RFCLKBUF 0x216 | ||
69 | #define AB8500_SYSCLKREQ8RFCLKBUF 0x217 | ||
70 | #define AB8500_DITHERCLKCTRL 0x220 | ||
71 | #define AB8500_SWATCTRL 0x230 | ||
72 | #define AB8500_HIQCLKCTRL 0x232 | ||
73 | #define AB8500_VSIMSYSCLKCTRL 0x233 | ||
74 | |||
75 | /* Bits */ | ||
76 | #define AB8500_TURNONSTATUS_PORNVBAT BIT(0) | ||
77 | #define AB8500_TURNONSTATUS_PONKEY1DBF BIT(1) | ||
78 | #define AB8500_TURNONSTATUS_PONKEY2DBF BIT(2) | ||
79 | #define AB8500_TURNONSTATUS_RTCALARM BIT(3) | ||
80 | #define AB8500_TURNONSTATUS_MAINCHDET BIT(4) | ||
81 | #define AB8500_TURNONSTATUS_VBUSDET BIT(5) | ||
82 | #define AB8500_TURNONSTATUS_USBIDDETECT BIT(6) | ||
83 | |||
84 | #define AB8500_RESETSTATUS_RESETN4500NSTATUS BIT(0) | ||
85 | #define AB8500_RESETSTATUS_SWRESETN4500NSTATUS BIT(2) | ||
86 | |||
87 | #define AB8500_PONKEY1PRESSSTATUS_PONKEY1PRESSTIME_MASK 0x7F | ||
88 | #define AB8500_PONKEY1PRESSSTATUS_PONKEY1PRESSTIME_SHIFT 0 | ||
89 | |||
90 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ1STATUS BIT(0) | ||
91 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ2STATUS BIT(1) | ||
92 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ3STATUS BIT(2) | ||
93 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ4STATUS BIT(3) | ||
94 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ5STATUS BIT(4) | ||
95 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ6STATUS BIT(5) | ||
96 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ7STATUS BIT(6) | ||
97 | #define AB8500_SYSCLKREQSTATUS_SYSCLKREQ8STATUS BIT(7) | ||
98 | |||
99 | #define AB8500_STW4500CTRL1_SWOFF BIT(0) | ||
100 | #define AB8500_STW4500CTRL1_SWRESET4500N BIT(1) | ||
101 | #define AB8500_STW4500CTRL1_THDB8500SWOFF BIT(2) | ||
102 | |||
103 | #define AB8500_STW4500CTRL2_RESETNVAUX1VALID BIT(0) | ||
104 | #define AB8500_STW4500CTRL2_RESETNVAUX2VALID BIT(1) | ||
105 | #define AB8500_STW4500CTRL2_RESETNVAUX3VALID BIT(2) | ||
106 | #define AB8500_STW4500CTRL2_RESETNVMODVALID BIT(3) | ||
107 | #define AB8500_STW4500CTRL2_RESETNVEXTSUPPLY1VALID BIT(4) | ||
108 | #define AB8500_STW4500CTRL2_RESETNVEXTSUPPLY2VALID BIT(5) | ||
109 | #define AB8500_STW4500CTRL2_RESETNVEXTSUPPLY3VALID BIT(6) | ||
110 | #define AB8500_STW4500CTRL2_RESETNVSMPS1VALID BIT(7) | ||
111 | |||
112 | #define AB8500_STW4500CTRL3_CLK32KOUT2DIS BIT(0) | ||
113 | #define AB8500_STW4500CTRL3_RESETAUDN BIT(1) | ||
114 | #define AB8500_STW4500CTRL3_RESETDENCN BIT(2) | ||
115 | #define AB8500_STW4500CTRL3_THSDENA BIT(3) | ||
116 | |||
117 | #define AB8500_MAINWDOGCTRL_MAINWDOGENA BIT(0) | ||
118 | #define AB8500_MAINWDOGCTRL_MAINWDOGKICK BIT(1) | ||
119 | #define AB8500_MAINWDOGCTRL_WDEXPTURNONVALID BIT(4) | ||
120 | |||
121 | #define AB8500_MAINWDOGTIMER_MAINWDOGTIMER_MASK 0x7F | ||
122 | #define AB8500_MAINWDOGTIMER_MAINWDOGTIMER_SHIFT 0 | ||
123 | |||
124 | #define AB8500_LOWBAT_LOWBATENA BIT(0) | ||
125 | #define AB8500_LOWBAT_LOWBAT_MASK 0x7E | ||
126 | #define AB8500_LOWBAT_LOWBAT_SHIFT 1 | ||
127 | |||
128 | #define AB8500_BATTOK_BATTOKSEL0THF_MASK 0x0F | ||
129 | #define AB8500_BATTOK_BATTOKSEL0THF_SHIFT 0 | ||
130 | #define AB8500_BATTOK_BATTOKSEL1THF_MASK 0xF0 | ||
131 | #define AB8500_BATTOK_BATTOKSEL1THF_SHIFT 4 | ||
132 | |||
133 | #define AB8500_SYSCLKTIMER_SYSCLKTIMER_MASK 0x0F | ||
134 | #define AB8500_SYSCLKTIMER_SYSCLKTIMER_SHIFT 0 | ||
135 | #define AB8500_SYSCLKTIMER_SYSCLKTIMERADJ_MASK 0xF0 | ||
136 | #define AB8500_SYSCLKTIMER_SYSCLKTIMERADJ_SHIFT 4 | ||
137 | |||
138 | #define AB8500_SMPSCLKCTRL_SMPSCLKINTSEL_MASK 0x03 | ||
139 | #define AB8500_SMPSCLKCTRL_SMPSCLKINTSEL_SHIFT 0 | ||
140 | #define AB8500_SMPSCLKCTRL_3M2CLKINTENA BIT(2) | ||
141 | |||
142 | #define AB8500_SMPSCLKSEL1_VARMCLKSEL_MASK 0x07 | ||
143 | #define AB8500_SMPSCLKSEL1_VARMCLKSEL_SHIFT 0 | ||
144 | #define AB8500_SMPSCLKSEL1_VAPECLKSEL_MASK 0x38 | ||
145 | #define AB8500_SMPSCLKSEL1_VAPECLKSEL_SHIFT 3 | ||
146 | |||
147 | #define AB8500_SMPSCLKSEL2_VMODCLKSEL_MASK 0x07 | ||
148 | #define AB8500_SMPSCLKSEL2_VMODCLKSEL_SHIFT 0 | ||
149 | #define AB8500_SMPSCLKSEL2_VSMPS1CLKSEL_MASK 0x38 | ||
150 | #define AB8500_SMPSCLKSEL2_VSMPS1CLKSEL_SHIFT 3 | ||
151 | |||
152 | #define AB8500_SMPSCLKSEL3_VSMPS2CLKSEL_MASK 0x07 | ||
153 | #define AB8500_SMPSCLKSEL3_VSMPS2CLKSEL_SHIFT 0 | ||
154 | #define AB8500_SMPSCLKSEL3_VSMPS3CLKSEL_MASK 0x38 | ||
155 | #define AB8500_SMPSCLKSEL3_VSMPS3CLKSEL_SHIFT 3 | ||
156 | |||
157 | #define AB8500_SYSULPCLKCONF_ULPCLKCONF_MASK 0x03 | ||
158 | #define AB8500_SYSULPCLKCONF_ULPCLKCONF_SHIFT 0 | ||
159 | #define AB8500_SYSULPCLKCONF_CLK27MHZSTRE BIT(2) | ||
160 | #define AB8500_SYSULPCLKCONF_TVOUTCLKDELN BIT(3) | ||
161 | #define AB8500_SYSULPCLKCONF_TVOUTCLKINV BIT(4) | ||
162 | #define AB8500_SYSULPCLKCONF_ULPCLKSTRE BIT(5) | ||
163 | #define AB8500_SYSULPCLKCONF_CLK27MHZBUFENA BIT(6) | ||
164 | #define AB8500_SYSULPCLKCONF_CLK27MHZPDENA BIT(7) | ||
165 | |||
166 | #define AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK 0x03 | ||
167 | #define AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT 0 | ||
168 | #define AB8500_SYSULPCLKCTRL1_ULPCLKREQ BIT(2) | ||
169 | #define AB8500_SYSULPCLKCTRL1_4500SYSCLKREQ BIT(3) | ||
170 | #define AB8500_SYSULPCLKCTRL1_AUDIOCLKENA BIT(4) | ||
171 | #define AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ BIT(5) | ||
172 | #define AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ BIT(6) | ||
173 | #define AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ BIT(7) | ||
174 | |||
175 | #define AB8500_SYSCLKCTRL_TVOUTPLLENA BIT(0) | ||
176 | #define AB8500_SYSCLKCTRL_TVOUTCLKENA BIT(1) | ||
177 | #define AB8500_SYSCLKCTRL_USBCLKENA BIT(2) | ||
178 | |||
179 | #define AB8500_SYSCLKREQ1VALID_SYSCLKREQ1VALID BIT(0) | ||
180 | #define AB8500_SYSCLKREQ1VALID_ULPCLKREQ1VALID BIT(1) | ||
181 | #define AB8500_SYSCLKREQ1VALID_USBSYSCLKREQ1VALID BIT(2) | ||
182 | |||
183 | #define AB8500_SYSTEMCTRLSUP_EXTSUP12LPNCLKSEL_MASK 0x03 | ||
184 | #define AB8500_SYSTEMCTRLSUP_EXTSUP12LPNCLKSEL_SHIFT 0 | ||
185 | #define AB8500_SYSTEMCTRLSUP_EXTSUP3LPNCLKSEL_MASK 0x0C | ||
186 | #define AB8500_SYSTEMCTRLSUP_EXTSUP3LPNCLKSEL_SHIFT 2 | ||
187 | #define AB8500_SYSTEMCTRLSUP_INTDB8500NOD BIT(4) | ||
188 | |||
189 | #define AB8500_SYSCLKREQ1RFCLKBUF_SYSCLKREQ1RFCLKBUF2 BIT(2) | ||
190 | #define AB8500_SYSCLKREQ1RFCLKBUF_SYSCLKREQ1RFCLKBUF3 BIT(3) | ||
191 | #define AB8500_SYSCLKREQ1RFCLKBUF_SYSCLKREQ1RFCLKBUF4 BIT(4) | ||
192 | |||
193 | #define AB8500_SYSCLKREQ2RFCLKBUF_SYSCLKREQ2RFCLKBUF2 BIT(2) | ||
194 | #define AB8500_SYSCLKREQ2RFCLKBUF_SYSCLKREQ2RFCLKBUF3 BIT(3) | ||
195 | #define AB8500_SYSCLKREQ2RFCLKBUF_SYSCLKREQ2RFCLKBUF4 BIT(4) | ||
196 | |||
197 | #define AB8500_SYSCLKREQ3RFCLKBUF_SYSCLKREQ3RFCLKBUF2 BIT(2) | ||
198 | #define AB8500_SYSCLKREQ3RFCLKBUF_SYSCLKREQ3RFCLKBUF3 BIT(3) | ||
199 | #define AB8500_SYSCLKREQ3RFCLKBUF_SYSCLKREQ3RFCLKBUF4 BIT(4) | ||
200 | |||
201 | #define AB8500_SYSCLKREQ4RFCLKBUF_SYSCLKREQ4RFCLKBUF2 BIT(2) | ||
202 | #define AB8500_SYSCLKREQ4RFCLKBUF_SYSCLKREQ4RFCLKBUF3 BIT(3) | ||
203 | #define AB8500_SYSCLKREQ4RFCLKBUF_SYSCLKREQ4RFCLKBUF4 BIT(4) | ||
204 | |||
205 | #define AB8500_SYSCLKREQ5RFCLKBUF_SYSCLKREQ5RFCLKBUF2 BIT(2) | ||
206 | #define AB8500_SYSCLKREQ5RFCLKBUF_SYSCLKREQ5RFCLKBUF3 BIT(3) | ||
207 | #define AB8500_SYSCLKREQ5RFCLKBUF_SYSCLKREQ5RFCLKBUF4 BIT(4) | ||
208 | |||
209 | #define AB8500_SYSCLKREQ6RFCLKBUF_SYSCLKREQ6RFCLKBUF2 BIT(2) | ||
210 | #define AB8500_SYSCLKREQ6RFCLKBUF_SYSCLKREQ6RFCLKBUF3 BIT(3) | ||
211 | #define AB8500_SYSCLKREQ6RFCLKBUF_SYSCLKREQ6RFCLKBUF4 BIT(4) | ||
212 | |||
213 | #define AB8500_SYSCLKREQ7RFCLKBUF_SYSCLKREQ7RFCLKBUF2 BIT(2) | ||
214 | #define AB8500_SYSCLKREQ7RFCLKBUF_SYSCLKREQ7RFCLKBUF3 BIT(3) | ||
215 | #define AB8500_SYSCLKREQ7RFCLKBUF_SYSCLKREQ7RFCLKBUF4 BIT(4) | ||
216 | |||
217 | #define AB8500_SYSCLKREQ8RFCLKBUF_SYSCLKREQ8RFCLKBUF2 BIT(2) | ||
218 | #define AB8500_SYSCLKREQ8RFCLKBUF_SYSCLKREQ8RFCLKBUF3 BIT(3) | ||
219 | #define AB8500_SYSCLKREQ8RFCLKBUF_SYSCLKREQ8RFCLKBUF4 BIT(4) | ||
220 | |||
221 | #define AB8500_DITHERCLKCTRL_VARMDITHERENA BIT(0) | ||
222 | #define AB8500_DITHERCLKCTRL_VSMPS3DITHERENA BIT(1) | ||
223 | #define AB8500_DITHERCLKCTRL_VSMPS1DITHERENA BIT(2) | ||
224 | #define AB8500_DITHERCLKCTRL_VSMPS2DITHERENA BIT(3) | ||
225 | #define AB8500_DITHERCLKCTRL_VMODDITHERENA BIT(4) | ||
226 | #define AB8500_DITHERCLKCTRL_VAPEDITHERENA BIT(5) | ||
227 | #define AB8500_DITHERCLKCTRL_DITHERDEL_MASK 0xC0 | ||
228 | #define AB8500_DITHERCLKCTRL_DITHERDEL_SHIFT 6 | ||
229 | |||
230 | #define AB8500_SWATCTRL_UPDATERF BIT(0) | ||
231 | #define AB8500_SWATCTRL_SWATENABLE BIT(1) | ||
232 | #define AB8500_SWATCTRL_RFOFFTIMER_MASK 0x1C | ||
233 | #define AB8500_SWATCTRL_RFOFFTIMER_SHIFT 2 | ||
234 | #define AB8500_SWATCTRL_SWATBIT5 BIT(6) | ||
235 | |||
236 | #define AB8500_HIQCLKCTRL_SYSCLKREQ1HIQENAVALID BIT(0) | ||
237 | #define AB8500_HIQCLKCTRL_SYSCLKREQ2HIQENAVALID BIT(1) | ||
238 | #define AB8500_HIQCLKCTRL_SYSCLKREQ3HIQENAVALID BIT(2) | ||
239 | #define AB8500_HIQCLKCTRL_SYSCLKREQ4HIQENAVALID BIT(3) | ||
240 | #define AB8500_HIQCLKCTRL_SYSCLKREQ5HIQENAVALID BIT(4) | ||
241 | #define AB8500_HIQCLKCTRL_SYSCLKREQ6HIQENAVALID BIT(5) | ||
242 | #define AB8500_HIQCLKCTRL_SYSCLKREQ7HIQENAVALID BIT(6) | ||
243 | #define AB8500_HIQCLKCTRL_SYSCLKREQ8HIQENAVALID BIT(7) | ||
244 | |||
245 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ1VALID BIT(0) | ||
246 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ2VALID BIT(1) | ||
247 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ3VALID BIT(2) | ||
248 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ4VALID BIT(3) | ||
249 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ5VALID BIT(4) | ||
250 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ6VALID BIT(5) | ||
251 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ7VALID BIT(6) | ||
252 | #define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ8VALID BIT(7) | ||
253 | |||
254 | #endif /* __AB8500_SYSCTRL_H */ | ||
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 67bd6f7ecf32..7d9b6ae1c203 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -186,7 +186,6 @@ struct abx500_init_settings { | |||
186 | struct ab3550_platform_data { | 186 | struct ab3550_platform_data { |
187 | struct {unsigned int base; unsigned int count; } irq; | 187 | struct {unsigned int base; unsigned int count; } irq; |
188 | void *dev_data[AB3550_NUM_DEVICES]; | 188 | void *dev_data[AB3550_NUM_DEVICES]; |
189 | size_t dev_data_sz[AB3550_NUM_DEVICES]; | ||
190 | struct abx500_init_settings *init_settings; | 189 | struct abx500_init_settings *init_settings; |
191 | unsigned int init_settings_sz; | 190 | unsigned int init_settings_sz; |
192 | }; | 191 | }; |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 835996e167e1..1408bf8eed5f 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -25,22 +25,20 @@ struct mfd_cell { | |||
25 | const char *name; | 25 | const char *name; |
26 | int id; | 26 | int id; |
27 | 27 | ||
28 | /* refcounting for multiple drivers to use a single cell */ | ||
29 | atomic_t *usage_count; | ||
28 | int (*enable)(struct platform_device *dev); | 30 | int (*enable)(struct platform_device *dev); |
29 | int (*disable)(struct platform_device *dev); | 31 | int (*disable)(struct platform_device *dev); |
32 | |||
30 | int (*suspend)(struct platform_device *dev); | 33 | int (*suspend)(struct platform_device *dev); |
31 | int (*resume)(struct platform_device *dev); | 34 | int (*resume)(struct platform_device *dev); |
32 | 35 | ||
33 | /* driver-specific data for MFD-aware "cell" drivers */ | 36 | /* mfd_data can be used to pass data to client drivers */ |
34 | void *driver_data; | 37 | void *mfd_data; |
35 | |||
36 | /* platform_data can be used to either pass data to "generic" | ||
37 | driver or as a hook to mfd_cell for the "cell" drivers */ | ||
38 | void *platform_data; | ||
39 | size_t data_size; | ||
40 | 38 | ||
41 | /* | 39 | /* |
42 | * This resources can be specified relatively to the parent device. | 40 | * These resources can be specified relative to the parent device. |
43 | * For accessing device you should use resources from device | 41 | * For accessing hardware you should use resources from the platform dev |
44 | */ | 42 | */ |
45 | int num_resources; | 43 | int num_resources; |
46 | const struct resource *resources; | 44 | const struct resource *resources; |
@@ -55,11 +53,47 @@ struct mfd_cell { | |||
55 | bool pm_runtime_no_callbacks; | 53 | bool pm_runtime_no_callbacks; |
56 | }; | 54 | }; |
57 | 55 | ||
56 | /* | ||
57 | * Convenience functions for clients using shared cells. Refcounting | ||
58 | * happens automatically, with the cell's enable/disable callbacks | ||
59 | * being called only when a device is first being enabled or no other | ||
60 | * clients are making use of it. | ||
61 | */ | ||
62 | extern int mfd_cell_enable(struct platform_device *pdev); | ||
63 | extern int mfd_cell_disable(struct platform_device *pdev); | ||
64 | |||
65 | /* | ||
66 | * Given a platform device that's been created by mfd_add_devices(), fetch | ||
67 | * the mfd_cell that created it. | ||
68 | */ | ||
69 | static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) | ||
70 | { | ||
71 | return pdev->dev.platform_data; | ||
72 | } | ||
73 | |||
74 | /* | ||
75 | * Given a platform device that's been created by mfd_add_devices(), fetch | ||
76 | * the .mfd_data entry from the mfd_cell that created it. | ||
77 | */ | ||
78 | static inline void *mfd_get_data(struct platform_device *pdev) | ||
79 | { | ||
80 | return mfd_get_cell(pdev)->mfd_data; | ||
81 | } | ||
82 | |||
58 | extern int mfd_add_devices(struct device *parent, int id, | 83 | extern int mfd_add_devices(struct device *parent, int id, |
59 | const struct mfd_cell *cells, int n_devs, | 84 | struct mfd_cell *cells, int n_devs, |
60 | struct resource *mem_base, | 85 | struct resource *mem_base, |
61 | int irq_base); | 86 | int irq_base); |
62 | 87 | ||
63 | extern void mfd_remove_devices(struct device *parent); | 88 | extern void mfd_remove_devices(struct device *parent); |
64 | 89 | ||
90 | /* | ||
91 | * For MFD drivers with clients sharing access to resources, these create | ||
92 | * multiple platform devices per cell. Contention handling must still be | ||
93 | * handled via drivers (ie, with enable/disable hooks). | ||
94 | */ | ||
95 | extern int mfd_shared_platform_driver_register(struct platform_driver *drv, | ||
96 | const char *cellname); | ||
97 | extern void mfd_shared_platform_driver_unregister(struct platform_driver *drv); | ||
98 | |||
65 | #endif | 99 | #endif |
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h new file mode 100644 index 000000000000..93a9477e075f --- /dev/null +++ b/include/linux/mfd/max8997-private.h | |||
@@ -0,0 +1,347 @@ | |||
1 | /* | ||
2 | * max8997.h - Voltage regulator driver for the Maxim 8997 | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electrnoics | ||
5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #ifndef __LINUX_MFD_MAX8997_PRIV_H | ||
23 | #define __LINUX_MFD_MAX8997_PRIV_H | ||
24 | |||
25 | #include <linux/i2c.h> | ||
26 | |||
27 | enum max8997_pmic_reg { | ||
28 | MAX8997_REG_PMIC_ID0 = 0x00, | ||
29 | MAX8997_REG_PMIC_ID1 = 0x01, | ||
30 | MAX8997_REG_INTSRC = 0x02, | ||
31 | MAX8997_REG_INT1 = 0x03, | ||
32 | MAX8997_REG_INT2 = 0x04, | ||
33 | MAX8997_REG_INT3 = 0x05, | ||
34 | MAX8997_REG_INT4 = 0x06, | ||
35 | |||
36 | MAX8997_REG_INT1MSK = 0x08, | ||
37 | MAX8997_REG_INT2MSK = 0x09, | ||
38 | MAX8997_REG_INT3MSK = 0x0a, | ||
39 | MAX8997_REG_INT4MSK = 0x0b, | ||
40 | |||
41 | MAX8997_REG_STATUS1 = 0x0d, | ||
42 | MAX8997_REG_STATUS2 = 0x0e, | ||
43 | MAX8997_REG_STATUS3 = 0x0f, | ||
44 | MAX8997_REG_STATUS4 = 0x10, | ||
45 | |||
46 | MAX8997_REG_MAINCON1 = 0x13, | ||
47 | MAX8997_REG_MAINCON2 = 0x14, | ||
48 | MAX8997_REG_BUCKRAMP = 0x15, | ||
49 | |||
50 | MAX8997_REG_BUCK1CTRL = 0x18, | ||
51 | MAX8997_REG_BUCK1DVS1 = 0x19, | ||
52 | MAX8997_REG_BUCK1DVS2 = 0x1a, | ||
53 | MAX8997_REG_BUCK1DVS3 = 0x1b, | ||
54 | MAX8997_REG_BUCK1DVS4 = 0x1c, | ||
55 | MAX8997_REG_BUCK1DVS5 = 0x1d, | ||
56 | MAX8997_REG_BUCK1DVS6 = 0x1e, | ||
57 | MAX8997_REG_BUCK1DVS7 = 0x1f, | ||
58 | MAX8997_REG_BUCK1DVS8 = 0x20, | ||
59 | MAX8997_REG_BUCK2CTRL = 0x21, | ||
60 | MAX8997_REG_BUCK2DVS1 = 0x22, | ||
61 | MAX8997_REG_BUCK2DVS2 = 0x23, | ||
62 | MAX8997_REG_BUCK2DVS3 = 0x24, | ||
63 | MAX8997_REG_BUCK2DVS4 = 0x25, | ||
64 | MAX8997_REG_BUCK2DVS5 = 0x26, | ||
65 | MAX8997_REG_BUCK2DVS6 = 0x27, | ||
66 | MAX8997_REG_BUCK2DVS7 = 0x28, | ||
67 | MAX8997_REG_BUCK2DVS8 = 0x29, | ||
68 | MAX8997_REG_BUCK3CTRL = 0x2a, | ||
69 | MAX8997_REG_BUCK3DVS = 0x2b, | ||
70 | MAX8997_REG_BUCK4CTRL = 0x2c, | ||
71 | MAX8997_REG_BUCK4DVS = 0x2d, | ||
72 | MAX8997_REG_BUCK5CTRL = 0x2e, | ||
73 | MAX8997_REG_BUCK5DVS1 = 0x2f, | ||
74 | MAX8997_REG_BUCK5DVS2 = 0x30, | ||
75 | MAX8997_REG_BUCK5DVS3 = 0x31, | ||
76 | MAX8997_REG_BUCK5DVS4 = 0x32, | ||
77 | MAX8997_REG_BUCK5DVS5 = 0x33, | ||
78 | MAX8997_REG_BUCK5DVS6 = 0x34, | ||
79 | MAX8997_REG_BUCK5DVS7 = 0x35, | ||
80 | MAX8997_REG_BUCK5DVS8 = 0x36, | ||
81 | MAX8997_REG_BUCK6CTRL = 0x37, | ||
82 | MAX8997_REG_BUCK6BPSKIPCTRL = 0x38, | ||
83 | MAX8997_REG_BUCK7CTRL = 0x39, | ||
84 | MAX8997_REG_BUCK7DVS = 0x3a, | ||
85 | MAX8997_REG_LDO1CTRL = 0x3b, | ||
86 | MAX8997_REG_LDO2CTRL = 0x3c, | ||
87 | MAX8997_REG_LDO3CTRL = 0x3d, | ||
88 | MAX8997_REG_LDO4CTRL = 0x3e, | ||
89 | MAX8997_REG_LDO5CTRL = 0x3f, | ||
90 | MAX8997_REG_LDO6CTRL = 0x40, | ||
91 | MAX8997_REG_LDO7CTRL = 0x41, | ||
92 | MAX8997_REG_LDO8CTRL = 0x42, | ||
93 | MAX8997_REG_LDO9CTRL = 0x43, | ||
94 | MAX8997_REG_LDO10CTRL = 0x44, | ||
95 | MAX8997_REG_LDO11CTRL = 0x45, | ||
96 | MAX8997_REG_LDO12CTRL = 0x46, | ||
97 | MAX8997_REG_LDO13CTRL = 0x47, | ||
98 | MAX8997_REG_LDO14CTRL = 0x48, | ||
99 | MAX8997_REG_LDO15CTRL = 0x49, | ||
100 | MAX8997_REG_LDO16CTRL = 0x4a, | ||
101 | MAX8997_REG_LDO17CTRL = 0x4b, | ||
102 | MAX8997_REG_LDO18CTRL = 0x4c, | ||
103 | MAX8997_REG_LDO21CTRL = 0x4d, | ||
104 | |||
105 | MAX8997_REG_MBCCTRL1 = 0x50, | ||
106 | MAX8997_REG_MBCCTRL2 = 0x51, | ||
107 | MAX8997_REG_MBCCTRL3 = 0x52, | ||
108 | MAX8997_REG_MBCCTRL4 = 0x53, | ||
109 | MAX8997_REG_MBCCTRL5 = 0x54, | ||
110 | MAX8997_REG_MBCCTRL6 = 0x55, | ||
111 | MAX8997_REG_OTPCGHCVS = 0x56, | ||
112 | |||
113 | MAX8997_REG_SAFEOUTCTRL = 0x5a, | ||
114 | |||
115 | MAX8997_REG_LBCNFG1 = 0x5e, | ||
116 | MAX8997_REG_LBCNFG2 = 0x5f, | ||
117 | MAX8997_REG_BBCCTRL = 0x60, | ||
118 | |||
119 | MAX8997_REG_FLASH1_CUR = 0x63, /* 0x63 ~ 0x6e for FLASH */ | ||
120 | MAX8997_REG_FLASH2_CUR = 0x64, | ||
121 | MAX8997_REG_MOVIE_CUR = 0x65, | ||
122 | MAX8997_REG_GSMB_CUR = 0x66, | ||
123 | MAX8997_REG_BOOST_CNTL = 0x67, | ||
124 | MAX8997_REG_LEN_CNTL = 0x68, | ||
125 | MAX8997_REG_FLASH_CNTL = 0x69, | ||
126 | MAX8997_REG_WDT_CNTL = 0x6a, | ||
127 | MAX8997_REG_MAXFLASH1 = 0x6b, | ||
128 | MAX8997_REG_MAXFLASH2 = 0x6c, | ||
129 | MAX8997_REG_FLASHSTATUS = 0x6d, | ||
130 | MAX8997_REG_FLASHSTATUSMASK = 0x6e, | ||
131 | |||
132 | MAX8997_REG_GPIOCNTL1 = 0x70, | ||
133 | MAX8997_REG_GPIOCNTL2 = 0x71, | ||
134 | MAX8997_REG_GPIOCNTL3 = 0x72, | ||
135 | MAX8997_REG_GPIOCNTL4 = 0x73, | ||
136 | MAX8997_REG_GPIOCNTL5 = 0x74, | ||
137 | MAX8997_REG_GPIOCNTL6 = 0x75, | ||
138 | MAX8997_REG_GPIOCNTL7 = 0x76, | ||
139 | MAX8997_REG_GPIOCNTL8 = 0x77, | ||
140 | MAX8997_REG_GPIOCNTL9 = 0x78, | ||
141 | MAX8997_REG_GPIOCNTL10 = 0x79, | ||
142 | MAX8997_REG_GPIOCNTL11 = 0x7a, | ||
143 | MAX8997_REG_GPIOCNTL12 = 0x7b, | ||
144 | |||
145 | MAX8997_REG_LDO1CONFIG = 0x80, | ||
146 | MAX8997_REG_LDO2CONFIG = 0x81, | ||
147 | MAX8997_REG_LDO3CONFIG = 0x82, | ||
148 | MAX8997_REG_LDO4CONFIG = 0x83, | ||
149 | MAX8997_REG_LDO5CONFIG = 0x84, | ||
150 | MAX8997_REG_LDO6CONFIG = 0x85, | ||
151 | MAX8997_REG_LDO7CONFIG = 0x86, | ||
152 | MAX8997_REG_LDO8CONFIG = 0x87, | ||
153 | MAX8997_REG_LDO9CONFIG = 0x88, | ||
154 | MAX8997_REG_LDO10CONFIG = 0x89, | ||
155 | MAX8997_REG_LDO11CONFIG = 0x8a, | ||
156 | MAX8997_REG_LDO12CONFIG = 0x8b, | ||
157 | MAX8997_REG_LDO13CONFIG = 0x8c, | ||
158 | MAX8997_REG_LDO14CONFIG = 0x8d, | ||
159 | MAX8997_REG_LDO15CONFIG = 0x8e, | ||
160 | MAX8997_REG_LDO16CONFIG = 0x8f, | ||
161 | MAX8997_REG_LDO17CONFIG = 0x90, | ||
162 | MAX8997_REG_LDO18CONFIG = 0x91, | ||
163 | MAX8997_REG_LDO21CONFIG = 0x92, | ||
164 | |||
165 | MAX8997_REG_DVSOKTIMER1 = 0x97, | ||
166 | MAX8997_REG_DVSOKTIMER2 = 0x98, | ||
167 | MAX8997_REG_DVSOKTIMER4 = 0x99, | ||
168 | MAX8997_REG_DVSOKTIMER5 = 0x9a, | ||
169 | |||
170 | MAX8997_REG_PMIC_END = 0x9b, | ||
171 | }; | ||
172 | |||
173 | enum max8997_muic_reg { | ||
174 | MAX8997_MUIC_REG_ID = 0x0, | ||
175 | MAX8997_MUIC_REG_INT1 = 0x1, | ||
176 | MAX8997_MUIC_REG_INT2 = 0x2, | ||
177 | MAX8997_MUIC_REG_INT3 = 0x3, | ||
178 | MAX8997_MUIC_REG_STATUS1 = 0x4, | ||
179 | MAX8997_MUIC_REG_STATUS2 = 0x5, | ||
180 | MAX8997_MUIC_REG_STATUS3 = 0x6, | ||
181 | MAX8997_MUIC_REG_INTMASK1 = 0x7, | ||
182 | MAX8997_MUIC_REG_INTMASK2 = 0x8, | ||
183 | MAX8997_MUIC_REG_INTMASK3 = 0x9, | ||
184 | MAX8997_MUIC_REG_CDETCTRL = 0xa, | ||
185 | |||
186 | MAX8997_MUIC_REG_CONTROL1 = 0xc, | ||
187 | MAX8997_MUIC_REG_CONTROL2 = 0xd, | ||
188 | MAX8997_MUIC_REG_CONTROL3 = 0xe, | ||
189 | |||
190 | MAX8997_MUIC_REG_END = 0xf, | ||
191 | }; | ||
192 | |||
193 | enum max8997_haptic_reg { | ||
194 | MAX8997_HAPTIC_REG_GENERAL = 0x00, | ||
195 | MAX8997_HAPTIC_REG_CONF1 = 0x01, | ||
196 | MAX8997_HAPTIC_REG_CONF2 = 0x02, | ||
197 | MAX8997_HAPTIC_REG_DRVCONF = 0x03, | ||
198 | MAX8997_HAPTIC_REG_CYCLECONF1 = 0x04, | ||
199 | MAX8997_HAPTIC_REG_CYCLECONF2 = 0x05, | ||
200 | MAX8997_HAPTIC_REG_SIGCONF1 = 0x06, | ||
201 | MAX8997_HAPTIC_REG_SIGCONF2 = 0x07, | ||
202 | MAX8997_HAPTIC_REG_SIGCONF3 = 0x08, | ||
203 | MAX8997_HAPTIC_REG_SIGCONF4 = 0x09, | ||
204 | MAX8997_HAPTIC_REG_SIGDC1 = 0x0a, | ||
205 | MAX8997_HAPTIC_REG_SIGDC2 = 0x0b, | ||
206 | MAX8997_HAPTIC_REG_SIGPWMDC1 = 0x0c, | ||
207 | MAX8997_HAPTIC_REG_SIGPWMDC2 = 0x0d, | ||
208 | MAX8997_HAPTIC_REG_SIGPWMDC3 = 0x0e, | ||
209 | MAX8997_HAPTIC_REG_SIGPWMDC4 = 0x0f, | ||
210 | MAX8997_HAPTIC_REG_MTR_REV = 0x10, | ||
211 | |||
212 | MAX8997_HAPTIC_REG_END = 0x11, | ||
213 | }; | ||
214 | |||
215 | /* slave addr = 0x0c: using "2nd part" of rev4 datasheet */ | ||
216 | enum max8997_rtc_reg { | ||
217 | MAX8997_RTC_CTRLMASK = 0x02, | ||
218 | MAX8997_RTC_CTRL = 0x03, | ||
219 | MAX8997_RTC_UPDATE1 = 0x04, | ||
220 | MAX8997_RTC_UPDATE2 = 0x05, | ||
221 | MAX8997_RTC_WTSR_SMPL = 0x06, | ||
222 | |||
223 | MAX8997_RTC_SEC = 0x10, | ||
224 | MAX8997_RTC_MIN = 0x11, | ||
225 | MAX8997_RTC_HOUR = 0x12, | ||
226 | MAX8997_RTC_DAY_OF_WEEK = 0x13, | ||
227 | MAX8997_RTC_MONTH = 0x14, | ||
228 | MAX8997_RTC_YEAR = 0x15, | ||
229 | MAX8997_RTC_DAY_OF_MONTH = 0x16, | ||
230 | MAX8997_RTC_ALARM1_SEC = 0x17, | ||
231 | MAX8997_RTC_ALARM1_MIN = 0x18, | ||
232 | MAX8997_RTC_ALARM1_HOUR = 0x19, | ||
233 | MAX8997_RTC_ALARM1_DAY_OF_WEEK = 0x1a, | ||
234 | MAX8997_RTC_ALARM1_MONTH = 0x1b, | ||
235 | MAX8997_RTC_ALARM1_YEAR = 0x1c, | ||
236 | MAX8997_RTC_ALARM1_DAY_OF_MONTH = 0x1d, | ||
237 | MAX8997_RTC_ALARM2_SEC = 0x1e, | ||
238 | MAX8997_RTC_ALARM2_MIN = 0x1f, | ||
239 | MAX8997_RTC_ALARM2_HOUR = 0x20, | ||
240 | MAX8997_RTC_ALARM2_DAY_OF_WEEK = 0x21, | ||
241 | MAX8997_RTC_ALARM2_MONTH = 0x22, | ||
242 | MAX8997_RTC_ALARM2_YEAR = 0x23, | ||
243 | MAX8997_RTC_ALARM2_DAY_OF_MONTH = 0x24, | ||
244 | }; | ||
245 | |||
246 | enum max8997_irq_source { | ||
247 | PMIC_INT1 = 0, | ||
248 | PMIC_INT2, | ||
249 | PMIC_INT3, | ||
250 | PMIC_INT4, | ||
251 | |||
252 | FUEL_GAUGE, /* Ignored (MAX17042 driver handles) */ | ||
253 | |||
254 | MUIC_INT1, | ||
255 | MUIC_INT2, | ||
256 | MUIC_INT3, | ||
257 | |||
258 | GPIO_LOW, /* Not implemented */ | ||
259 | GPIO_HI, /* Not implemented */ | ||
260 | |||
261 | FLASH_STATUS, /* Not implemented */ | ||
262 | |||
263 | MAX8997_IRQ_GROUP_NR, | ||
264 | }; | ||
265 | |||
266 | enum max8997_irq { | ||
267 | MAX8997_PMICIRQ_PWRONR, | ||
268 | MAX8997_PMICIRQ_PWRONF, | ||
269 | MAX8997_PMICIRQ_PWRON1SEC, | ||
270 | MAX8997_PMICIRQ_JIGONR, | ||
271 | MAX8997_PMICIRQ_JIGONF, | ||
272 | MAX8997_PMICIRQ_LOWBAT2, | ||
273 | MAX8997_PMICIRQ_LOWBAT1, | ||
274 | |||
275 | MAX8997_PMICIRQ_JIGR, | ||
276 | MAX8997_PMICIRQ_JIGF, | ||
277 | MAX8997_PMICIRQ_MR, | ||
278 | MAX8997_PMICIRQ_DVS1OK, | ||
279 | MAX8997_PMICIRQ_DVS2OK, | ||
280 | MAX8997_PMICIRQ_DVS3OK, | ||
281 | MAX8997_PMICIRQ_DVS4OK, | ||
282 | |||
283 | MAX8997_PMICIRQ_CHGINS, | ||
284 | MAX8997_PMICIRQ_CHGRM, | ||
285 | MAX8997_PMICIRQ_DCINOVP, | ||
286 | MAX8997_PMICIRQ_TOPOFFR, | ||
287 | MAX8997_PMICIRQ_CHGRSTF, | ||
288 | MAX8997_PMICIRQ_MBCHGTMEXPD, | ||
289 | |||
290 | MAX8997_PMICIRQ_RTC60S, | ||
291 | MAX8997_PMICIRQ_RTCA1, | ||
292 | MAX8997_PMICIRQ_RTCA2, | ||
293 | MAX8997_PMICIRQ_SMPL_INT, | ||
294 | MAX8997_PMICIRQ_RTC1S, | ||
295 | MAX8997_PMICIRQ_WTSR, | ||
296 | |||
297 | MAX8997_MUICIRQ_ADCError, | ||
298 | MAX8997_MUICIRQ_ADCLow, | ||
299 | MAX8997_MUICIRQ_ADC, | ||
300 | |||
301 | MAX8997_MUICIRQ_VBVolt, | ||
302 | MAX8997_MUICIRQ_DBChg, | ||
303 | MAX8997_MUICIRQ_DCDTmr, | ||
304 | MAX8997_MUICIRQ_ChgDetRun, | ||
305 | MAX8997_MUICIRQ_ChgTyp, | ||
306 | |||
307 | MAX8997_MUICIRQ_OVP, | ||
308 | |||
309 | MAX8997_IRQ_NR, | ||
310 | }; | ||
311 | |||
312 | #define MAX8997_REG_BUCK1DVS(x) (MAX8997_REG_BUCK1DVS1 + (x) - 1) | ||
313 | #define MAX8997_REG_BUCK2DVS(x) (MAX8997_REG_BUCK2DVS1 + (x) - 1) | ||
314 | #define MAX8997_REG_BUCK5DVS(x) (MAX8997_REG_BUCK5DVS1 + (x) - 1) | ||
315 | |||
316 | struct max8997_dev { | ||
317 | struct device *dev; | ||
318 | struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */ | ||
319 | struct i2c_client *rtc; /* slave addr 0x0c */ | ||
320 | struct i2c_client *haptic; /* slave addr 0x90 */ | ||
321 | struct i2c_client *muic; /* slave addr 0x4a */ | ||
322 | struct mutex iolock; | ||
323 | |||
324 | int type; | ||
325 | struct platform_device *battery; /* battery control (not fuel gauge) */ | ||
326 | |||
327 | bool wakeup; | ||
328 | |||
329 | /* For hibernation */ | ||
330 | u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END + | ||
331 | MAX8997_HAPTIC_REG_END]; | ||
332 | }; | ||
333 | |||
334 | enum max8997_types { | ||
335 | TYPE_MAX8997, | ||
336 | TYPE_MAX8966, | ||
337 | }; | ||
338 | |||
339 | extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); | ||
340 | extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count, | ||
341 | u8 *buf); | ||
342 | extern int max8997_write_reg(struct i2c_client *i2c, u8 reg, u8 value); | ||
343 | extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count, | ||
344 | u8 *buf); | ||
345 | extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask); | ||
346 | |||
347 | #endif /* __LINUX_MFD_MAX8997_PRIV_H */ | ||
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h new file mode 100644 index 000000000000..cb671b3451bf --- /dev/null +++ b/include/linux/mfd/max8997.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /* | ||
2 | * max8997.h - Driver for the Maxim 8997/8966 | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Samsung Electrnoics | ||
5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | * This driver is based on max8998.h | ||
22 | * | ||
23 | * MAX8997 has PMIC, MUIC, HAPTIC, RTC, FLASH, and Fuel Gauge devices. | ||
24 | * Except Fuel Gauge, every device shares the same I2C bus and included in | ||
25 | * this mfd driver. Although the fuel gauge is included in the chip, it is | ||
26 | * excluded from the driver because a) it has a different I2C bus from | ||
27 | * others and b) it can be enabled simply by using MAX17042 driver. | ||
28 | */ | ||
29 | |||
30 | #ifndef __LINUX_MFD_MAX8998_H | ||
31 | #define __LINUX_MFD_MAX8998_H | ||
32 | |||
33 | #include <linux/regulator/consumer.h> | ||
34 | |||
35 | /* MAX8997/8966 regulator IDs */ | ||
36 | enum max8998_regulators { | ||
37 | MAX8997_LDO1 = 0, | ||
38 | MAX8997_LDO2, | ||
39 | MAX8997_LDO3, | ||
40 | MAX8997_LDO4, | ||
41 | MAX8997_LDO5, | ||
42 | MAX8997_LDO6, | ||
43 | MAX8997_LDO7, | ||
44 | MAX8997_LDO8, | ||
45 | MAX8997_LDO9, | ||
46 | MAX8997_LDO10, | ||
47 | MAX8997_LDO11, | ||
48 | MAX8997_LDO12, | ||
49 | MAX8997_LDO13, | ||
50 | MAX8997_LDO14, | ||
51 | MAX8997_LDO15, | ||
52 | MAX8997_LDO16, | ||
53 | MAX8997_LDO17, | ||
54 | MAX8997_LDO18, | ||
55 | MAX8997_LDO21, | ||
56 | MAX8997_BUCK1, | ||
57 | MAX8997_BUCK2, | ||
58 | MAX8997_BUCK3, | ||
59 | MAX8997_BUCK4, | ||
60 | MAX8997_BUCK5, | ||
61 | MAX8997_BUCK6, | ||
62 | MAX8997_BUCK7, | ||
63 | MAX8997_EN32KHZ_AP, | ||
64 | MAX8997_EN32KHZ_CP, | ||
65 | MAX8997_ENVICHG, | ||
66 | MAX8997_ESAFEOUT1, | ||
67 | MAX8997_ESAFEOUT2, | ||
68 | MAX8997_CHARGER_CV, /* control MBCCV of MBCCTRL3 */ | ||
69 | MAX8997_CHARGER, /* charger current, MBCCTRL4 */ | ||
70 | MAX8997_CHARGER_TOPOFF, /* MBCCTRL5 */ | ||
71 | |||
72 | MAX8997_REG_MAX, | ||
73 | }; | ||
74 | |||
75 | struct max8997_regulator_data { | ||
76 | int id; | ||
77 | struct regulator_init_data *initdata; | ||
78 | }; | ||
79 | |||
80 | struct max8997_platform_data { | ||
81 | bool wakeup; | ||
82 | /* IRQ: Not implemented */ | ||
83 | /* ---- PMIC ---- */ | ||
84 | struct max8997_regulator_data *regulators; | ||
85 | int num_regulators; | ||
86 | |||
87 | /* | ||
88 | * SET1~3 DVS GPIOs control Buck1, 2, and 5 simultaneously. Therefore, | ||
89 | * With buckx_gpiodvs enabled, the buckx cannot be controlled | ||
90 | * independently. To control buckx (of 1, 2, and 5) independently, | ||
91 | * disable buckx_gpiodvs and control with BUCKxDVS1 register. | ||
92 | * | ||
93 | * When buckx_gpiodvs and bucky_gpiodvs are both enabled, set_voltage | ||
94 | * on buckx will change the voltage of bucky at the same time. | ||
95 | * | ||
96 | */ | ||
97 | bool ignore_gpiodvs_side_effect; | ||
98 | int buck125_gpios[3]; /* GPIO of [0]SET1, [1]SET2, [2]SET3 */ | ||
99 | int buck125_default_idx; /* Default value of SET1, 2, 3 */ | ||
100 | unsigned int buck1_voltage[8]; /* buckx_voltage in uV */ | ||
101 | bool buck1_gpiodvs; | ||
102 | unsigned int buck2_voltage[8]; | ||
103 | bool buck2_gpiodvs; | ||
104 | unsigned int buck5_voltage[8]; | ||
105 | bool buck5_gpiodvs; | ||
106 | |||
107 | /* MUIC: Not implemented */ | ||
108 | /* HAPTIC: Not implemented */ | ||
109 | /* RTC: Not implemented */ | ||
110 | /* Flash: Not implemented */ | ||
111 | /* Charger control: Not implemented */ | ||
112 | }; | ||
113 | |||
114 | #endif /* __LINUX_MFD_MAX8998_H */ | ||
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index a1d391b40e68..c064beaaccb7 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
@@ -146,8 +146,7 @@ struct mc13xxx_platform_data { | |||
146 | #define MC13XXX_USE_LED (1 << 5) | 146 | #define MC13XXX_USE_LED (1 << 5) |
147 | unsigned int flags; | 147 | unsigned int flags; |
148 | 148 | ||
149 | int num_regulators; | 149 | struct mc13xxx_regulator_platform_data regulators; |
150 | struct mc13xxx_regulator_init_data *regulators; | ||
151 | struct mc13xxx_leds_platform_data *leds; | 150 | struct mc13xxx_leds_platform_data *leds; |
152 | }; | 151 | }; |
153 | 152 | ||
diff --git a/include/linux/mfd/tps6105x.h b/include/linux/mfd/tps6105x.h new file mode 100644 index 000000000000..386743dd931c --- /dev/null +++ b/include/linux/mfd/tps6105x.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 ST-Ericsson SA | ||
3 | * Written on behalf of Linaro for ST-Ericsson | ||
4 | * | ||
5 | * Author: Linus Walleij <linus.walleij@linaro.org> | ||
6 | * | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | */ | ||
9 | #ifndef MFD_TPS6105X_H | ||
10 | #define MFD_TPS6105X_H | ||
11 | |||
12 | #include <linux/i2c.h> | ||
13 | #include <linux/regulator/machine.h> | ||
14 | |||
15 | /* | ||
16 | * Register definitions to all subdrivers | ||
17 | */ | ||
18 | #define TPS6105X_REG_0 0x00 | ||
19 | #define TPS6105X_REG0_MODE_SHIFT 6 | ||
20 | #define TPS6105X_REG0_MODE_MASK (0x03<<6) | ||
21 | /* These defines for both reg0 and reg1 */ | ||
22 | #define TPS6105X_REG0_MODE_SHUTDOWN 0x00 | ||
23 | #define TPS6105X_REG0_MODE_TORCH 0x01 | ||
24 | #define TPS6105X_REG0_MODE_TORCH_FLASH 0x02 | ||
25 | #define TPS6105X_REG0_MODE_VOLTAGE 0x03 | ||
26 | #define TPS6105X_REG0_VOLTAGE_SHIFT 4 | ||
27 | #define TPS6105X_REG0_VOLTAGE_MASK (3<<4) | ||
28 | #define TPS6105X_REG0_VOLTAGE_450 0 | ||
29 | #define TPS6105X_REG0_VOLTAGE_500 1 | ||
30 | #define TPS6105X_REG0_VOLTAGE_525 2 | ||
31 | #define TPS6105X_REG0_VOLTAGE_500_2 3 | ||
32 | #define TPS6105X_REG0_DIMMING_SHIFT 3 | ||
33 | #define TPS6105X_REG0_TORCHC_SHIFT 0 | ||
34 | #define TPS6105X_REG0_TORCHC_MASK (7<<0) | ||
35 | #define TPS6105X_REG0_TORCHC_0 0x00 | ||
36 | #define TPS6105X_REG0_TORCHC_50 0x01 | ||
37 | #define TPS6105X_REG0_TORCHC_75 0x02 | ||
38 | #define TPS6105X_REG0_TORCHC_100 0x03 | ||
39 | #define TPS6105X_REG0_TORCHC_150 0x04 | ||
40 | #define TPS6105X_REG0_TORCHC_200 0x05 | ||
41 | #define TPS6105X_REG0_TORCHC_250_400 0x06 | ||
42 | #define TPS6105X_REG0_TORCHC_250_500 0x07 | ||
43 | #define TPS6105X_REG_1 0x01 | ||
44 | #define TPS6105X_REG1_MODE_SHIFT 6 | ||
45 | #define TPS6105X_REG1_MODE_MASK (0x03<<6) | ||
46 | #define TPS6105X_REG1_MODE_SHUTDOWN 0x00 | ||
47 | #define TPS6105X_REG1_MODE_TORCH 0x01 | ||
48 | #define TPS6105X_REG1_MODE_TORCH_FLASH 0x02 | ||
49 | #define TPS6105X_REG1_MODE_VOLTAGE 0x03 | ||
50 | #define TPS6105X_REG_2 0x02 | ||
51 | #define TPS6105X_REG_3 0x03 | ||
52 | |||
53 | /** | ||
54 | * enum tps6105x_mode - desired mode for the TPS6105x | ||
55 | * @TPS6105X_MODE_SHUTDOWN: this instance is inactive, not used for anything | ||
56 | * @TPS61905X_MODE_TORCH: this instance is used as a LED, usually a while | ||
57 | * LED, for example as backlight or flashlight. If this is set, the | ||
58 | * TPS6105X will register to the LED framework | ||
59 | * @TPS6105X_MODE_TORCH_FLASH: this instance is used as a flashgun, usually | ||
60 | * in a camera | ||
61 | * @TPS6105X_MODE_VOLTAGE: this instance is used as a voltage regulator and | ||
62 | * will register to the regulator framework | ||
63 | */ | ||
64 | enum tps6105x_mode { | ||
65 | TPS6105X_MODE_SHUTDOWN, | ||
66 | TPS6105X_MODE_TORCH, | ||
67 | TPS6105X_MODE_TORCH_FLASH, | ||
68 | TPS6105X_MODE_VOLTAGE, | ||
69 | }; | ||
70 | |||
71 | /** | ||
72 | * struct tps6105x_platform_data - TPS61905x platform data | ||
73 | * @mode: what mode this instance shall be operated in, | ||
74 | * this is not selectable at runtime | ||
75 | * @regulator_data: initialization data for the voltage | ||
76 | * regulator if used as a voltage source | ||
77 | */ | ||
78 | struct tps6105x_platform_data { | ||
79 | enum tps6105x_mode mode; | ||
80 | struct regulator_init_data *regulator_data; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * struct tps6105x - state holder for the TPS6105x drivers | ||
85 | * @mutex: mutex to serialize I2C accesses | ||
86 | * @i2c_client: corresponding I2C client | ||
87 | * @regulator: regulator device if used in voltage mode | ||
88 | */ | ||
89 | struct tps6105x { | ||
90 | struct tps6105x_platform_data *pdata; | ||
91 | struct mutex lock; | ||
92 | struct i2c_client *client; | ||
93 | struct regulator_dev *regulator; | ||
94 | }; | ||
95 | |||
96 | extern int tps6105x_set(struct tps6105x *tps6105x, u8 reg, u8 value); | ||
97 | extern int tps6105x_get(struct tps6105x *tps6105x, u8 reg, u8 *buf); | ||
98 | extern int tps6105x_mask_and_set(struct tps6105x *tps6105x, u8 reg, | ||
99 | u8 bitmask, u8 bitvalues); | ||
100 | |||
101 | #endif | ||
diff --git a/include/linux/mfd/wl1273-core.h b/include/linux/mfd/wl1273-core.h index 9787293eae5f..db2f3f454a1b 100644 --- a/include/linux/mfd/wl1273-core.h +++ b/include/linux/mfd/wl1273-core.h | |||
@@ -280,7 +280,9 @@ struct wl1273_core { | |||
280 | 280 | ||
281 | struct i2c_client *client; | 281 | struct i2c_client *client; |
282 | 282 | ||
283 | int (*read)(struct wl1273_core *core, u8, u16 *); | ||
283 | int (*write)(struct wl1273_core *core, u8, u16); | 284 | int (*write)(struct wl1273_core *core, u8, u16); |
285 | int (*write_data)(struct wl1273_core *core, u8 *, u16); | ||
284 | int (*set_audio)(struct wl1273_core *core, unsigned int); | 286 | int (*set_audio)(struct wl1273_core *core, unsigned int); |
285 | int (*set_volume)(struct wl1273_core *core, unsigned int); | 287 | int (*set_volume)(struct wl1273_core *core, unsigned int); |
286 | }; | 288 | }; |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 173086d42af4..afe4db49402d 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
@@ -104,11 +104,17 @@ struct wm831x_watchdog_pdata { | |||
104 | #define WM831X_MAX_ISINK 2 | 104 | #define WM831X_MAX_ISINK 2 |
105 | 105 | ||
106 | struct wm831x_pdata { | 106 | struct wm831x_pdata { |
107 | /** Used to distinguish multiple WM831x chips */ | ||
108 | int wm831x_num; | ||
109 | |||
107 | /** Called before subdevices are set up */ | 110 | /** Called before subdevices are set up */ |
108 | int (*pre_init)(struct wm831x *wm831x); | 111 | int (*pre_init)(struct wm831x *wm831x); |
109 | /** Called after subdevices are set up */ | 112 | /** Called after subdevices are set up */ |
110 | int (*post_init)(struct wm831x *wm831x); | 113 | int (*post_init)(struct wm831x *wm831x); |
111 | 114 | ||
115 | /** Put the /IRQ line into CMOS mode */ | ||
116 | bool irq_cmos; | ||
117 | |||
112 | int irq_base; | 118 | int irq_base; |
113 | int gpio_base; | 119 | int gpio_base; |
114 | struct wm831x_backlight_pdata *backlight; | 120 | struct wm831x_backlight_pdata *backlight; |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index ef4f0b6083a3..f0b69cdae41c 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -59,7 +59,7 @@ struct wm8994 { | |||
59 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, | 59 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, |
60 | int bytes, void *dest); | 60 | int bytes, void *dest); |
61 | int (*write_dev)(struct wm8994 *wm8994, unsigned short reg, | 61 | int (*write_dev)(struct wm8994 *wm8994, unsigned short reg, |
62 | int bytes, void *src); | 62 | int bytes, const void *src); |
63 | 63 | ||
64 | void *control_data; | 64 | void *control_data; |
65 | 65 | ||
@@ -88,6 +88,8 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, | |||
88 | unsigned short mask, unsigned short val); | 88 | unsigned short mask, unsigned short val); |
89 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, | 89 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, |
90 | int count, u16 *buf); | 90 | int count, u16 *buf); |
91 | int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg, | ||
92 | int count, const u16 *buf); | ||
91 | 93 | ||
92 | 94 | ||
93 | /* Helper to save on boilerplate */ | 95 | /* Helper to save on boilerplate */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 294104e0891d..7606d7db96c9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -861,7 +861,7 @@ extern void pagefault_out_of_memory(void); | |||
861 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 861 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
862 | 862 | ||
863 | /* | 863 | /* |
864 | * Flags passed to __show_mem() and __show_free_areas() to suppress output in | 864 | * Flags passed to show_mem() and __show_free_areas() to suppress output in |
865 | * various contexts. | 865 | * various contexts. |
866 | */ | 866 | */ |
867 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ | 867 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ |
@@ -982,6 +982,8 @@ static inline int handle_mm_fault(struct mm_struct *mm, | |||
982 | 982 | ||
983 | extern int make_pages_present(unsigned long addr, unsigned long end); | 983 | extern int make_pages_present(unsigned long addr, unsigned long end); |
984 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 984 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
985 | extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, | ||
986 | void *buf, int len, int write); | ||
985 | 987 | ||
986 | int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 988 | int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
987 | unsigned long start, int len, unsigned int foll_flags, | 989 | unsigned long start, int len, unsigned int foll_flags, |
@@ -1358,8 +1360,7 @@ extern void setup_per_zone_wmarks(void); | |||
1358 | extern void calculate_zone_inactive_ratio(struct zone *zone); | 1360 | extern void calculate_zone_inactive_ratio(struct zone *zone); |
1359 | extern void mem_init(void); | 1361 | extern void mem_init(void); |
1360 | extern void __init mmap_init(void); | 1362 | extern void __init mmap_init(void); |
1361 | extern void show_mem(void); | 1363 | extern void show_mem(unsigned int flags); |
1362 | extern void __show_mem(unsigned int flags); | ||
1363 | extern void si_meminfo(struct sysinfo * val); | 1364 | extern void si_meminfo(struct sysinfo * val); |
1364 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1365 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
1365 | extern int after_bootmem; | 1366 | extern int after_bootmem; |
@@ -1592,13 +1593,13 @@ static inline bool kernel_page_present(struct page *page) { return true; } | |||
1592 | #endif /* CONFIG_HIBERNATION */ | 1593 | #endif /* CONFIG_HIBERNATION */ |
1593 | #endif | 1594 | #endif |
1594 | 1595 | ||
1595 | extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); | 1596 | extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm); |
1596 | #ifdef __HAVE_ARCH_GATE_AREA | 1597 | #ifdef __HAVE_ARCH_GATE_AREA |
1597 | int in_gate_area_no_task(unsigned long addr); | 1598 | int in_gate_area_no_mm(unsigned long addr); |
1598 | int in_gate_area(struct task_struct *task, unsigned long addr); | 1599 | int in_gate_area(struct mm_struct *mm, unsigned long addr); |
1599 | #else | 1600 | #else |
1600 | int in_gate_area_no_task(unsigned long addr); | 1601 | int in_gate_area_no_mm(unsigned long addr); |
1601 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) | 1602 | #define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);}) |
1602 | #endif /* __HAVE_ARCH_GATE_AREA */ | 1603 | #endif /* __HAVE_ARCH_GATE_AREA */ |
1603 | 1604 | ||
1604 | int drop_caches_sysctl_handler(struct ctl_table *, int, | 1605 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h new file mode 100644 index 000000000000..39d787c229cb --- /dev/null +++ b/include/linux/mmc/boot.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef MMC_BOOT_H | ||
2 | #define MMC_BOOT_H | ||
3 | |||
4 | enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, | ||
5 | MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; | ||
6 | |||
7 | #endif | ||
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 38d393092812..9eb9b4b96f55 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -104,9 +104,6 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | |||
104 | 104 | ||
105 | #define SH_MMCIF_BBS 512 /* boot block size */ | 105 | #define SH_MMCIF_BBS 512 /* boot block size */ |
106 | 106 | ||
107 | enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT, | ||
108 | MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE }; | ||
109 | |||
110 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, | 107 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, |
111 | unsigned long cmd, unsigned long arg) | 108 | unsigned long cmd, unsigned long arg) |
112 | { | 109 | { |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 134716e5e350..b528f6d4b860 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -550,6 +550,7 @@ enum { | |||
550 | NFSPROC4_CLNT_SETACL, | 550 | NFSPROC4_CLNT_SETACL, |
551 | NFSPROC4_CLNT_FS_LOCATIONS, | 551 | NFSPROC4_CLNT_FS_LOCATIONS, |
552 | NFSPROC4_CLNT_RELEASE_LOCKOWNER, | 552 | NFSPROC4_CLNT_RELEASE_LOCKOWNER, |
553 | NFSPROC4_CLNT_SECINFO, | ||
553 | 554 | ||
554 | /* nfs41 */ | 555 | /* nfs41 */ |
555 | NFSPROC4_CLNT_EXCHANGE_ID, | 556 | NFSPROC4_CLNT_EXCHANGE_ID, |
@@ -560,6 +561,7 @@ enum { | |||
560 | NFSPROC4_CLNT_RECLAIM_COMPLETE, | 561 | NFSPROC4_CLNT_RECLAIM_COMPLETE, |
561 | NFSPROC4_CLNT_LAYOUTGET, | 562 | NFSPROC4_CLNT_LAYOUTGET, |
562 | NFSPROC4_CLNT_GETDEVICEINFO, | 563 | NFSPROC4_CLNT_GETDEVICEINFO, |
564 | NFSPROC4_CLNT_LAYOUTCOMMIT, | ||
563 | }; | 565 | }; |
564 | 566 | ||
565 | /* nfs41 types */ | 567 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index f88522b10a38..1b93b9c60e55 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #define FLUSH_STABLE 4 /* commit to stable storage */ | 33 | #define FLUSH_STABLE 4 /* commit to stable storage */ |
34 | #define FLUSH_LOWPRI 8 /* low priority background flush */ | 34 | #define FLUSH_LOWPRI 8 /* low priority background flush */ |
35 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ | 35 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ |
36 | #define FLUSH_COND_STABLE 32 /* conditional stable write - only stable | ||
37 | * if everything fits in one RPC */ | ||
36 | 38 | ||
37 | #ifdef __KERNEL__ | 39 | #ifdef __KERNEL__ |
38 | 40 | ||
@@ -93,8 +95,13 @@ struct nfs_open_context { | |||
93 | int error; | 95 | int error; |
94 | 96 | ||
95 | struct list_head list; | 97 | struct list_head list; |
98 | }; | ||
96 | 99 | ||
100 | struct nfs_open_dir_context { | ||
101 | struct rpc_cred *cred; | ||
97 | __u64 dir_cookie; | 102 | __u64 dir_cookie; |
103 | __u64 dup_cookie; | ||
104 | int duped; | ||
98 | }; | 105 | }; |
99 | 106 | ||
100 | /* | 107 | /* |
@@ -191,6 +198,7 @@ struct nfs_inode { | |||
191 | 198 | ||
192 | /* pNFS layout information */ | 199 | /* pNFS layout information */ |
193 | struct pnfs_layout_hdr *layout; | 200 | struct pnfs_layout_hdr *layout; |
201 | atomic_t commits_outstanding; | ||
194 | #endif /* CONFIG_NFS_V4*/ | 202 | #endif /* CONFIG_NFS_V4*/ |
195 | #ifdef CONFIG_NFS_FSCACHE | 203 | #ifdef CONFIG_NFS_FSCACHE |
196 | struct fscache_cookie *fscache; | 204 | struct fscache_cookie *fscache; |
@@ -219,6 +227,8 @@ struct nfs_inode { | |||
219 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ | 227 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ |
220 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ | 228 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ |
221 | #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 */ | ||
231 | #define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ | ||
222 | 232 | ||
223 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 233 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
224 | { | 234 | { |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 90907ada6d52..8023e4e25133 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -33,11 +33,15 @@ enum { | |||
33 | PG_CLEAN, | 33 | PG_CLEAN, |
34 | PG_NEED_COMMIT, | 34 | PG_NEED_COMMIT, |
35 | PG_NEED_RESCHED, | 35 | PG_NEED_RESCHED, |
36 | PG_PNFS_COMMIT, | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | struct nfs_inode; | 39 | struct nfs_inode; |
39 | struct nfs_page { | 40 | struct nfs_page { |
40 | struct list_head wb_list; /* Defines state of page: */ | 41 | union { |
42 | struct list_head wb_list; /* Defines state of page: */ | ||
43 | struct pnfs_layout_segment *wb_commit_lseg; /* Used when PG_PNFS_COMMIT set */ | ||
44 | }; | ||
41 | struct page *wb_page; /* page to read in/write out */ | 45 | struct page *wb_page; /* page to read in/write out */ |
42 | struct nfs_open_context *wb_context; /* File state context info */ | 46 | struct nfs_open_context *wb_context; /* File state context info */ |
43 | struct nfs_lock_context *wb_lock_context; /* lock context info */ | 47 | struct nfs_lock_context *wb_lock_context; /* lock context info */ |
@@ -57,6 +61,7 @@ struct nfs_pageio_descriptor { | |||
57 | size_t pg_count; | 61 | size_t pg_count; |
58 | size_t pg_bsize; | 62 | size_t pg_bsize; |
59 | unsigned int pg_base; | 63 | unsigned int pg_base; |
64 | char pg_moreio; | ||
60 | 65 | ||
61 | struct inode *pg_inode; | 66 | struct inode *pg_inode; |
62 | int (*pg_doio)(struct nfs_pageio_descriptor *); | 67 | int (*pg_doio)(struct nfs_pageio_descriptor *); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 2c2c67d2eb42..78b101e487ea 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/nfsacl.h> | 4 | #include <linux/nfsacl.h> |
5 | #include <linux/nfs3.h> | 5 | #include <linux/nfs3.h> |
6 | #include <linux/sunrpc/gss_api.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * To change the maximum rsize and wsize supported by the NFS client, adjust | 9 | * To change the maximum rsize and wsize supported by the NFS client, adjust |
@@ -14,6 +15,9 @@ | |||
14 | #define NFS_DEF_FILE_IO_SIZE (4096U) | 15 | #define NFS_DEF_FILE_IO_SIZE (4096U) |
15 | #define NFS_MIN_FILE_IO_SIZE (1024U) | 16 | #define NFS_MIN_FILE_IO_SIZE (1024U) |
16 | 17 | ||
18 | /* Forward declaration for NFS v3 */ | ||
19 | struct nfs4_secinfo_flavors; | ||
20 | |||
17 | struct nfs_fsid { | 21 | struct nfs_fsid { |
18 | uint64_t major; | 22 | uint64_t major; |
19 | uint64_t minor; | 23 | uint64_t minor; |
@@ -78,6 +82,7 @@ struct nfs_fattr { | |||
78 | #define NFS_ATTR_FATTR_CHANGE (1U << 17) | 82 | #define NFS_ATTR_FATTR_CHANGE (1U << 17) |
79 | #define NFS_ATTR_FATTR_PRECHANGE (1U << 18) | 83 | #define NFS_ATTR_FATTR_PRECHANGE (1U << 18) |
80 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ | 84 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ |
85 | #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 20) /* Treat as mountpoint */ | ||
81 | 86 | ||
82 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ | 87 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ |
83 | | NFS_ATTR_FATTR_MODE \ | 88 | | NFS_ATTR_FATTR_MODE \ |
@@ -190,8 +195,9 @@ struct nfs4_get_lease_time_res { | |||
190 | #define PNFS_LAYOUT_MAXSIZE 4096 | 195 | #define PNFS_LAYOUT_MAXSIZE 4096 |
191 | 196 | ||
192 | struct nfs4_layoutdriver_data { | 197 | struct nfs4_layoutdriver_data { |
198 | struct page **pages; | ||
199 | __u32 pglen; | ||
193 | __u32 len; | 200 | __u32 len; |
194 | void *buf; | ||
195 | }; | 201 | }; |
196 | 202 | ||
197 | struct pnfs_layout_range { | 203 | struct pnfs_layout_range { |
@@ -209,6 +215,7 @@ struct nfs4_layoutget_args { | |||
209 | struct nfs_open_context *ctx; | 215 | struct nfs_open_context *ctx; |
210 | struct nfs4_sequence_args seq_args; | 216 | struct nfs4_sequence_args seq_args; |
211 | nfs4_stateid stateid; | 217 | nfs4_stateid stateid; |
218 | struct nfs4_layoutdriver_data layout; | ||
212 | }; | 219 | }; |
213 | 220 | ||
214 | struct nfs4_layoutget_res { | 221 | struct nfs4_layoutget_res { |
@@ -216,8 +223,8 @@ struct nfs4_layoutget_res { | |||
216 | struct pnfs_layout_range range; | 223 | struct pnfs_layout_range range; |
217 | __u32 type; | 224 | __u32 type; |
218 | nfs4_stateid stateid; | 225 | nfs4_stateid stateid; |
219 | struct nfs4_layoutdriver_data layout; | ||
220 | struct nfs4_sequence_res seq_res; | 226 | struct nfs4_sequence_res seq_res; |
227 | struct nfs4_layoutdriver_data *layoutp; | ||
221 | }; | 228 | }; |
222 | 229 | ||
223 | struct nfs4_layoutget { | 230 | struct nfs4_layoutget { |
@@ -236,6 +243,29 @@ struct nfs4_getdeviceinfo_res { | |||
236 | struct nfs4_sequence_res seq_res; | 243 | struct nfs4_sequence_res seq_res; |
237 | }; | 244 | }; |
238 | 245 | ||
246 | struct nfs4_layoutcommit_args { | ||
247 | nfs4_stateid stateid; | ||
248 | __u64 lastbytewritten; | ||
249 | struct inode *inode; | ||
250 | const u32 *bitmask; | ||
251 | struct nfs4_sequence_args seq_args; | ||
252 | }; | ||
253 | |||
254 | struct nfs4_layoutcommit_res { | ||
255 | struct nfs_fattr *fattr; | ||
256 | const struct nfs_server *server; | ||
257 | struct nfs4_sequence_res seq_res; | ||
258 | }; | ||
259 | |||
260 | struct nfs4_layoutcommit_data { | ||
261 | struct rpc_task task; | ||
262 | struct nfs_fattr fattr; | ||
263 | struct pnfs_layout_segment *lseg; | ||
264 | struct rpc_cred *cred; | ||
265 | struct nfs4_layoutcommit_args args; | ||
266 | struct nfs4_layoutcommit_res res; | ||
267 | }; | ||
268 | |||
239 | /* | 269 | /* |
240 | * Arguments to the open call. | 270 | * Arguments to the open call. |
241 | */ | 271 | */ |
@@ -936,6 +966,38 @@ struct nfs4_fs_locations_res { | |||
936 | struct nfs4_sequence_res seq_res; | 966 | struct nfs4_sequence_res seq_res; |
937 | }; | 967 | }; |
938 | 968 | ||
969 | struct nfs4_secinfo_oid { | ||
970 | unsigned int len; | ||
971 | char data[GSS_OID_MAX_LEN]; | ||
972 | }; | ||
973 | |||
974 | struct nfs4_secinfo_gss { | ||
975 | struct nfs4_secinfo_oid sec_oid4; | ||
976 | unsigned int qop4; | ||
977 | unsigned int service; | ||
978 | }; | ||
979 | |||
980 | struct nfs4_secinfo_flavor { | ||
981 | unsigned int flavor; | ||
982 | struct nfs4_secinfo_gss gss; | ||
983 | }; | ||
984 | |||
985 | struct nfs4_secinfo_flavors { | ||
986 | unsigned int num_flavors; | ||
987 | struct nfs4_secinfo_flavor flavors[0]; | ||
988 | }; | ||
989 | |||
990 | struct nfs4_secinfo_arg { | ||
991 | const struct nfs_fh *dir_fh; | ||
992 | const struct qstr *name; | ||
993 | struct nfs4_sequence_args seq_args; | ||
994 | }; | ||
995 | |||
996 | struct nfs4_secinfo_res { | ||
997 | struct nfs4_secinfo_flavors *flavors; | ||
998 | struct nfs4_sequence_res seq_res; | ||
999 | }; | ||
1000 | |||
939 | #endif /* CONFIG_NFS_V4 */ | 1001 | #endif /* CONFIG_NFS_V4 */ |
940 | 1002 | ||
941 | struct nfstime4 { | 1003 | struct nfstime4 { |
@@ -1040,6 +1102,7 @@ struct nfs_write_data { | |||
1040 | struct nfs_writeres res; /* result struct */ | 1102 | struct nfs_writeres res; /* result struct */ |
1041 | struct pnfs_layout_segment *lseg; | 1103 | struct pnfs_layout_segment *lseg; |
1042 | struct nfs_client *ds_clp; /* pNFS data server */ | 1104 | struct nfs_client *ds_clp; /* pNFS data server */ |
1105 | int ds_commit_index; | ||
1043 | const struct rpc_call_ops *mds_ops; | 1106 | const struct rpc_call_ops *mds_ops; |
1044 | int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); | 1107 | int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); |
1045 | #ifdef CONFIG_NFS_V4 | 1108 | #ifdef CONFIG_NFS_V4 |
@@ -1071,7 +1134,7 @@ struct nfs_rpc_ops { | |||
1071 | struct nfs_fattr *); | 1134 | struct nfs_fattr *); |
1072 | int (*setattr) (struct dentry *, struct nfs_fattr *, | 1135 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
1073 | struct iattr *); | 1136 | struct iattr *); |
1074 | int (*lookup) (struct inode *, struct qstr *, | 1137 | int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *, |
1075 | struct nfs_fh *, struct nfs_fattr *); | 1138 | struct nfs_fh *, struct nfs_fattr *); |
1076 | int (*access) (struct inode *, struct nfs_access_entry *); | 1139 | int (*access) (struct inode *, struct nfs_access_entry *); |
1077 | int (*readlink)(struct inode *, struct page *, unsigned int, | 1140 | int (*readlink)(struct inode *, struct page *, unsigned int, |
@@ -1118,6 +1181,7 @@ struct nfs_rpc_ops { | |||
1118 | struct iattr *iattr); | 1181 | struct iattr *iattr); |
1119 | int (*init_client) (struct nfs_client *, const struct rpc_timeout *, | 1182 | int (*init_client) (struct nfs_client *, const struct rpc_timeout *, |
1120 | const char *, rpc_authflavor_t, int); | 1183 | const char *, rpc_authflavor_t, int); |
1184 | int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); | ||
1121 | }; | 1185 | }; |
1122 | 1186 | ||
1123 | /* | 1187 | /* |
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 17c7e21c0bd7..fb51ae38cea7 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -52,9 +52,6 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, | |||
52 | const char *bus_id, | 52 | const char *bus_id, |
53 | struct device *parent); | 53 | struct device *parent); |
54 | 54 | ||
55 | /* pseudo "matches" value to not do deep probe */ | ||
56 | #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1) | ||
57 | |||
58 | extern int of_platform_bus_probe(struct device_node *root, | 55 | extern int of_platform_bus_probe(struct device_node *root, |
59 | const struct of_device_id *matches, | 56 | const struct of_device_id *matches, |
60 | struct device *parent); | 57 | struct device *parent); |
diff --git a/include/linux/omap3isp.h b/include/linux/omap3isp.h new file mode 100644 index 000000000000..150822b4dbff --- /dev/null +++ b/include/linux/omap3isp.h | |||
@@ -0,0 +1,646 @@ | |||
1 | /* | ||
2 | * omap3isp.h | ||
3 | * | ||
4 | * TI OMAP3 ISP - User-space API | ||
5 | * | ||
6 | * Copyright (C) 2010 Nokia Corporation | ||
7 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
8 | * | ||
9 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
10 | * Sakari Ailus <sakari.ailus@iki.fi> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but | ||
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | * General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
24 | * 02110-1301 USA | ||
25 | */ | ||
26 | |||
27 | #ifndef OMAP3_ISP_USER_H | ||
28 | #define OMAP3_ISP_USER_H | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | |||
32 | /* | ||
33 | * Private IOCTLs | ||
34 | * | ||
35 | * VIDIOC_OMAP3ISP_CCDC_CFG: Set CCDC configuration | ||
36 | * VIDIOC_OMAP3ISP_PRV_CFG: Set preview engine configuration | ||
37 | * VIDIOC_OMAP3ISP_AEWB_CFG: Set AEWB module configuration | ||
38 | * VIDIOC_OMAP3ISP_HIST_CFG: Set histogram module configuration | ||
39 | * VIDIOC_OMAP3ISP_AF_CFG: Set auto-focus module configuration | ||
40 | * VIDIOC_OMAP3ISP_STAT_REQ: Read statistics (AEWB/AF/histogram) data | ||
41 | * VIDIOC_OMAP3ISP_STAT_EN: Enable/disable a statistics module | ||
42 | */ | ||
43 | |||
44 | #define VIDIOC_OMAP3ISP_CCDC_CFG \ | ||
45 | _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct omap3isp_ccdc_update_config) | ||
46 | #define VIDIOC_OMAP3ISP_PRV_CFG \ | ||
47 | _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct omap3isp_prev_update_config) | ||
48 | #define VIDIOC_OMAP3ISP_AEWB_CFG \ | ||
49 | _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct omap3isp_h3a_aewb_config) | ||
50 | #define VIDIOC_OMAP3ISP_HIST_CFG \ | ||
51 | _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct omap3isp_hist_config) | ||
52 | #define VIDIOC_OMAP3ISP_AF_CFG \ | ||
53 | _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config) | ||
54 | #define VIDIOC_OMAP3ISP_STAT_REQ \ | ||
55 | _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data) | ||
56 | #define VIDIOC_OMAP3ISP_STAT_EN \ | ||
57 | _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long) | ||
58 | |||
59 | /* | ||
60 | * Events | ||
61 | * | ||
62 | * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready | ||
63 | * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready | ||
64 | * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready | ||
65 | * V4L2_EVENT_OMAP3ISP_HS_VS: Horizontal/vertical synchronization detected | ||
66 | */ | ||
67 | |||
68 | #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) | ||
69 | #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) | ||
70 | #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) | ||
71 | #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) | ||
72 | #define V4L2_EVENT_OMAP3ISP_HS_VS (V4L2_EVENT_OMAP3ISP_CLASS | 0x4) | ||
73 | |||
74 | struct omap3isp_stat_event_status { | ||
75 | __u32 frame_number; | ||
76 | __u16 config_counter; | ||
77 | __u8 buf_err; | ||
78 | }; | ||
79 | |||
80 | /* AE/AWB related structures and flags*/ | ||
81 | |||
82 | /* H3A Range Constants */ | ||
83 | #define OMAP3ISP_AEWB_MAX_SATURATION_LIM 1023 | ||
84 | #define OMAP3ISP_AEWB_MIN_WIN_H 2 | ||
85 | #define OMAP3ISP_AEWB_MAX_WIN_H 256 | ||
86 | #define OMAP3ISP_AEWB_MIN_WIN_W 6 | ||
87 | #define OMAP3ISP_AEWB_MAX_WIN_W 256 | ||
88 | #define OMAP3ISP_AEWB_MIN_WINVC 1 | ||
89 | #define OMAP3ISP_AEWB_MIN_WINHC 1 | ||
90 | #define OMAP3ISP_AEWB_MAX_WINVC 128 | ||
91 | #define OMAP3ISP_AEWB_MAX_WINHC 36 | ||
92 | #define OMAP3ISP_AEWB_MAX_WINSTART 4095 | ||
93 | #define OMAP3ISP_AEWB_MIN_SUB_INC 2 | ||
94 | #define OMAP3ISP_AEWB_MAX_SUB_INC 32 | ||
95 | #define OMAP3ISP_AEWB_MAX_BUF_SIZE 83600 | ||
96 | |||
97 | #define OMAP3ISP_AF_IIRSH_MIN 0 | ||
98 | #define OMAP3ISP_AF_IIRSH_MAX 4095 | ||
99 | #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MIN 1 | ||
100 | #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MAX 36 | ||
101 | #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MIN 1 | ||
102 | #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MAX 128 | ||
103 | #define OMAP3ISP_AF_PAXEL_INCREMENT_MIN 2 | ||
104 | #define OMAP3ISP_AF_PAXEL_INCREMENT_MAX 32 | ||
105 | #define OMAP3ISP_AF_PAXEL_HEIGHT_MIN 2 | ||
106 | #define OMAP3ISP_AF_PAXEL_HEIGHT_MAX 256 | ||
107 | #define OMAP3ISP_AF_PAXEL_WIDTH_MIN 16 | ||
108 | #define OMAP3ISP_AF_PAXEL_WIDTH_MAX 256 | ||
109 | #define OMAP3ISP_AF_PAXEL_HZSTART_MIN 1 | ||
110 | #define OMAP3ISP_AF_PAXEL_HZSTART_MAX 4095 | ||
111 | #define OMAP3ISP_AF_PAXEL_VTSTART_MIN 0 | ||
112 | #define OMAP3ISP_AF_PAXEL_VTSTART_MAX 4095 | ||
113 | #define OMAP3ISP_AF_THRESHOLD_MAX 255 | ||
114 | #define OMAP3ISP_AF_COEF_MAX 4095 | ||
115 | #define OMAP3ISP_AF_PAXEL_SIZE 48 | ||
116 | #define OMAP3ISP_AF_MAX_BUF_SIZE 221184 | ||
117 | |||
118 | /** | ||
119 | * struct omap3isp_h3a_aewb_config - AE AWB configuration reset values | ||
120 | * saturation_limit: Saturation limit. | ||
121 | * @win_height: Window Height. Range 2 - 256, even values only. | ||
122 | * @win_width: Window Width. Range 6 - 256, even values only. | ||
123 | * @ver_win_count: Vertical Window Count. Range 1 - 128. | ||
124 | * @hor_win_count: Horizontal Window Count. Range 1 - 36. | ||
125 | * @ver_win_start: Vertical Window Start. Range 0 - 4095. | ||
126 | * @hor_win_start: Horizontal Window Start. Range 0 - 4095. | ||
127 | * @blk_ver_win_start: Black Vertical Windows Start. Range 0 - 4095. | ||
128 | * @blk_win_height: Black Window Height. Range 2 - 256, even values only. | ||
129 | * @subsample_ver_inc: Subsample Vertical points increment Range 2 - 32, even | ||
130 | * values only. | ||
131 | * @subsample_hor_inc: Subsample Horizontal points increment Range 2 - 32, even | ||
132 | * values only. | ||
133 | * @alaw_enable: AEW ALAW EN flag. | ||
134 | */ | ||
135 | struct omap3isp_h3a_aewb_config { | ||
136 | /* | ||
137 | * Common fields. | ||
138 | * They should be the first ones and must be in the same order as in | ||
139 | * ispstat_generic_config struct. | ||
140 | */ | ||
141 | __u32 buf_size; | ||
142 | __u16 config_counter; | ||
143 | |||
144 | /* Private fields */ | ||
145 | __u16 saturation_limit; | ||
146 | __u16 win_height; | ||
147 | __u16 win_width; | ||
148 | __u16 ver_win_count; | ||
149 | __u16 hor_win_count; | ||
150 | __u16 ver_win_start; | ||
151 | __u16 hor_win_start; | ||
152 | __u16 blk_ver_win_start; | ||
153 | __u16 blk_win_height; | ||
154 | __u16 subsample_ver_inc; | ||
155 | __u16 subsample_hor_inc; | ||
156 | __u8 alaw_enable; | ||
157 | }; | ||
158 | |||
159 | /** | ||
160 | * struct omap3isp_stat_data - Statistic data sent to or received from user | ||
161 | * @ts: Timestamp of returned framestats. | ||
162 | * @buf: Pointer to pass to user. | ||
163 | * @frame_number: Frame number of requested stats. | ||
164 | * @cur_frame: Current frame number being processed. | ||
165 | * @config_counter: Number of the configuration associated with the data. | ||
166 | */ | ||
167 | struct omap3isp_stat_data { | ||
168 | struct timeval ts; | ||
169 | void __user *buf; | ||
170 | __u32 buf_size; | ||
171 | __u16 frame_number; | ||
172 | __u16 cur_frame; | ||
173 | __u16 config_counter; | ||
174 | }; | ||
175 | |||
176 | |||
177 | /* Histogram related structs */ | ||
178 | |||
179 | /* Flags for number of bins */ | ||
180 | #define OMAP3ISP_HIST_BINS_32 0 | ||
181 | #define OMAP3ISP_HIST_BINS_64 1 | ||
182 | #define OMAP3ISP_HIST_BINS_128 2 | ||
183 | #define OMAP3ISP_HIST_BINS_256 3 | ||
184 | |||
185 | /* Number of bins * 4 colors * 4-bytes word */ | ||
186 | #define OMAP3ISP_HIST_MEM_SIZE_BINS(n) ((1 << ((n)+5))*4*4) | ||
187 | |||
188 | #define OMAP3ISP_HIST_MEM_SIZE 1024 | ||
189 | #define OMAP3ISP_HIST_MIN_REGIONS 1 | ||
190 | #define OMAP3ISP_HIST_MAX_REGIONS 4 | ||
191 | #define OMAP3ISP_HIST_MAX_WB_GAIN 255 | ||
192 | #define OMAP3ISP_HIST_MIN_WB_GAIN 0 | ||
193 | #define OMAP3ISP_HIST_MAX_BIT_WIDTH 14 | ||
194 | #define OMAP3ISP_HIST_MIN_BIT_WIDTH 8 | ||
195 | #define OMAP3ISP_HIST_MAX_WG 4 | ||
196 | #define OMAP3ISP_HIST_MAX_BUF_SIZE 4096 | ||
197 | |||
198 | /* Source */ | ||
199 | #define OMAP3ISP_HIST_SOURCE_CCDC 0 | ||
200 | #define OMAP3ISP_HIST_SOURCE_MEM 1 | ||
201 | |||
202 | /* CFA pattern */ | ||
203 | #define OMAP3ISP_HIST_CFA_BAYER 0 | ||
204 | #define OMAP3ISP_HIST_CFA_FOVEONX3 1 | ||
205 | |||
206 | struct omap3isp_hist_region { | ||
207 | __u16 h_start; | ||
208 | __u16 h_end; | ||
209 | __u16 v_start; | ||
210 | __u16 v_end; | ||
211 | }; | ||
212 | |||
213 | struct omap3isp_hist_config { | ||
214 | /* | ||
215 | * Common fields. | ||
216 | * They should be the first ones and must be in the same order as in | ||
217 | * ispstat_generic_config struct. | ||
218 | */ | ||
219 | __u32 buf_size; | ||
220 | __u16 config_counter; | ||
221 | |||
222 | __u8 num_acc_frames; /* Num of image frames to be processed and | ||
223 | accumulated for each histogram frame */ | ||
224 | __u16 hist_bins; /* number of bins: 32, 64, 128, or 256 */ | ||
225 | __u8 cfa; /* BAYER or FOVEON X3 */ | ||
226 | __u8 wg[OMAP3ISP_HIST_MAX_WG]; /* White Balance Gain */ | ||
227 | __u8 num_regions; /* number of regions to be configured */ | ||
228 | struct omap3isp_hist_region region[OMAP3ISP_HIST_MAX_REGIONS]; | ||
229 | }; | ||
230 | |||
231 | /* Auto Focus related structs */ | ||
232 | |||
233 | #define OMAP3ISP_AF_NUM_COEF 11 | ||
234 | |||
235 | enum omap3isp_h3a_af_fvmode { | ||
236 | OMAP3ISP_AF_MODE_SUMMED = 0, | ||
237 | OMAP3ISP_AF_MODE_PEAK = 1 | ||
238 | }; | ||
239 | |||
240 | /* Red, Green, and blue pixel location in the AF windows */ | ||
241 | enum omap3isp_h3a_af_rgbpos { | ||
242 | OMAP3ISP_AF_GR_GB_BAYER = 0, /* GR and GB as Bayer pattern */ | ||
243 | OMAP3ISP_AF_RG_GB_BAYER = 1, /* RG and GB as Bayer pattern */ | ||
244 | OMAP3ISP_AF_GR_BG_BAYER = 2, /* GR and BG as Bayer pattern */ | ||
245 | OMAP3ISP_AF_RG_BG_BAYER = 3, /* RG and BG as Bayer pattern */ | ||
246 | OMAP3ISP_AF_GG_RB_CUSTOM = 4, /* GG and RB as custom pattern */ | ||
247 | OMAP3ISP_AF_RB_GG_CUSTOM = 5 /* RB and GG as custom pattern */ | ||
248 | }; | ||
249 | |||
250 | /* Contains the information regarding the Horizontal Median Filter */ | ||
251 | struct omap3isp_h3a_af_hmf { | ||
252 | __u8 enable; /* Status of Horizontal Median Filter */ | ||
253 | __u8 threshold; /* Threshhold Value for Horizontal Median Filter */ | ||
254 | }; | ||
255 | |||
256 | /* Contains the information regarding the IIR Filters */ | ||
257 | struct omap3isp_h3a_af_iir { | ||
258 | __u16 h_start; /* IIR horizontal start */ | ||
259 | __u16 coeff_set0[OMAP3ISP_AF_NUM_COEF]; /* Filter coefficient, set 0 */ | ||
260 | __u16 coeff_set1[OMAP3ISP_AF_NUM_COEF]; /* Filter coefficient, set 1 */ | ||
261 | }; | ||
262 | |||
263 | /* Contains the information regarding the Paxels Structure in AF Engine */ | ||
264 | struct omap3isp_h3a_af_paxel { | ||
265 | __u16 h_start; /* Horizontal Start Position */ | ||
266 | __u16 v_start; /* Vertical Start Position */ | ||
267 | __u8 width; /* Width of the Paxel */ | ||
268 | __u8 height; /* Height of the Paxel */ | ||
269 | __u8 h_cnt; /* Horizontal Count */ | ||
270 | __u8 v_cnt; /* vertical Count */ | ||
271 | __u8 line_inc; /* Line Increment */ | ||
272 | }; | ||
273 | |||
274 | /* Contains the parameters required for hardware set up of AF Engine */ | ||
275 | struct omap3isp_h3a_af_config { | ||
276 | /* | ||
277 | * Common fields. | ||
278 | * They should be the first ones and must be in the same order as in | ||
279 | * ispstat_generic_config struct. | ||
280 | */ | ||
281 | __u32 buf_size; | ||
282 | __u16 config_counter; | ||
283 | |||
284 | struct omap3isp_h3a_af_hmf hmf; /* HMF configurations */ | ||
285 | struct omap3isp_h3a_af_iir iir; /* IIR filter configurations */ | ||
286 | struct omap3isp_h3a_af_paxel paxel; /* Paxel parameters */ | ||
287 | enum omap3isp_h3a_af_rgbpos rgb_pos; /* RGB Positions */ | ||
288 | enum omap3isp_h3a_af_fvmode fvmode; /* Accumulator mode */ | ||
289 | __u8 alaw_enable; /* AF ALAW status */ | ||
290 | }; | ||
291 | |||
292 | /* ISP CCDC structs */ | ||
293 | |||
294 | /* Abstraction layer CCDC configurations */ | ||
295 | #define OMAP3ISP_CCDC_ALAW (1 << 0) | ||
296 | #define OMAP3ISP_CCDC_LPF (1 << 1) | ||
297 | #define OMAP3ISP_CCDC_BLCLAMP (1 << 2) | ||
298 | #define OMAP3ISP_CCDC_BCOMP (1 << 3) | ||
299 | #define OMAP3ISP_CCDC_FPC (1 << 4) | ||
300 | #define OMAP3ISP_CCDC_CULL (1 << 5) | ||
301 | #define OMAP3ISP_CCDC_CONFIG_LSC (1 << 7) | ||
302 | #define OMAP3ISP_CCDC_TBL_LSC (1 << 8) | ||
303 | |||
304 | #define OMAP3ISP_RGB_MAX 3 | ||
305 | |||
306 | /* Enumeration constants for Alaw input width */ | ||
307 | enum omap3isp_alaw_ipwidth { | ||
308 | OMAP3ISP_ALAW_BIT12_3 = 0x3, | ||
309 | OMAP3ISP_ALAW_BIT11_2 = 0x4, | ||
310 | OMAP3ISP_ALAW_BIT10_1 = 0x5, | ||
311 | OMAP3ISP_ALAW_BIT9_0 = 0x6 | ||
312 | }; | ||
313 | |||
314 | /** | ||
315 | * struct omap3isp_ccdc_lsc_config - LSC configuration | ||
316 | * @offset: Table Offset of the gain table. | ||
317 | * @gain_mode_n: Vertical dimension of a paxel in LSC configuration. | ||
318 | * @gain_mode_m: Horizontal dimension of a paxel in LSC configuration. | ||
319 | * @gain_format: Gain table format. | ||
320 | * @fmtsph: Start pixel horizontal from start of the HS sync pulse. | ||
321 | * @fmtlnh: Number of pixels in horizontal direction to use for the data | ||
322 | * reformatter. | ||
323 | * @fmtslv: Start line from start of VS sync pulse for the data reformatter. | ||
324 | * @fmtlnv: Number of lines in vertical direction for the data reformatter. | ||
325 | * @initial_x: X position, in pixels, of the first active pixel in reference | ||
326 | * to the first active paxel. Must be an even number. | ||
327 | * @initial_y: Y position, in pixels, of the first active pixel in reference | ||
328 | * to the first active paxel. Must be an even number. | ||
329 | * @size: Size of LSC gain table. Filled when loaded from userspace. | ||
330 | */ | ||
331 | struct omap3isp_ccdc_lsc_config { | ||
332 | __u16 offset; | ||
333 | __u8 gain_mode_n; | ||
334 | __u8 gain_mode_m; | ||
335 | __u8 gain_format; | ||
336 | __u16 fmtsph; | ||
337 | __u16 fmtlnh; | ||
338 | __u16 fmtslv; | ||
339 | __u16 fmtlnv; | ||
340 | __u8 initial_x; | ||
341 | __u8 initial_y; | ||
342 | __u32 size; | ||
343 | }; | ||
344 | |||
345 | /** | ||
346 | * struct omap3isp_ccdc_bclamp - Optical & Digital black clamp subtract | ||
347 | * @obgain: Optical black average gain. | ||
348 | * @obstpixel: Start Pixel w.r.t. HS pulse in Optical black sample. | ||
349 | * @oblines: Optical Black Sample lines. | ||
350 | * @oblen: Optical Black Sample Length. | ||
351 | * @dcsubval: Digital Black Clamp subtract value. | ||
352 | */ | ||
353 | struct omap3isp_ccdc_bclamp { | ||
354 | __u8 obgain; | ||
355 | __u8 obstpixel; | ||
356 | __u8 oblines; | ||
357 | __u8 oblen; | ||
358 | __u16 dcsubval; | ||
359 | }; | ||
360 | |||
361 | /** | ||
362 | * struct omap3isp_ccdc_fpc - Faulty Pixels Correction | ||
363 | * @fpnum: Number of faulty pixels to be corrected in the frame. | ||
364 | * @fpcaddr: Memory address of the FPC Table | ||
365 | */ | ||
366 | struct omap3isp_ccdc_fpc { | ||
367 | __u16 fpnum; | ||
368 | __u32 fpcaddr; | ||
369 | }; | ||
370 | |||
371 | /** | ||
372 | * struct omap3isp_ccdc_blcomp - Black Level Compensation parameters | ||
373 | * @b_mg: B/Mg pixels. 2's complement. -128 to +127. | ||
374 | * @gb_g: Gb/G pixels. 2's complement. -128 to +127. | ||
375 | * @gr_cy: Gr/Cy pixels. 2's complement. -128 to +127. | ||
376 | * @r_ye: R/Ye pixels. 2's complement. -128 to +127. | ||
377 | */ | ||
378 | struct omap3isp_ccdc_blcomp { | ||
379 | __u8 b_mg; | ||
380 | __u8 gb_g; | ||
381 | __u8 gr_cy; | ||
382 | __u8 r_ye; | ||
383 | }; | ||
384 | |||
385 | /** | ||
386 | * omap3isp_ccdc_culling - Culling parameters | ||
387 | * @v_pattern: Vertical culling pattern. | ||
388 | * @h_odd: Horizontal Culling pattern for odd lines. | ||
389 | * @h_even: Horizontal Culling pattern for even lines. | ||
390 | */ | ||
391 | struct omap3isp_ccdc_culling { | ||
392 | __u8 v_pattern; | ||
393 | __u16 h_odd; | ||
394 | __u16 h_even; | ||
395 | }; | ||
396 | |||
397 | /** | ||
398 | * omap3isp_ccdc_update_config - CCDC configuration | ||
399 | * @update: Specifies which CCDC registers should be updated. | ||
400 | * @flag: Specifies which CCDC functions should be enabled. | ||
401 | * @alawip: Enable/Disable A-Law compression. | ||
402 | * @bclamp: Black clamp control register. | ||
403 | * @blcomp: Black level compensation value for RGrGbB Pixels. 2's complement. | ||
404 | * @fpc: Number of faulty pixels corrected in the frame, address of FPC table. | ||
405 | * @cull: Cull control register. | ||
406 | * @lsc: Pointer to LSC gain table. | ||
407 | */ | ||
408 | struct omap3isp_ccdc_update_config { | ||
409 | __u16 update; | ||
410 | __u16 flag; | ||
411 | enum omap3isp_alaw_ipwidth alawip; | ||
412 | struct omap3isp_ccdc_bclamp __user *bclamp; | ||
413 | struct omap3isp_ccdc_blcomp __user *blcomp; | ||
414 | struct omap3isp_ccdc_fpc __user *fpc; | ||
415 | struct omap3isp_ccdc_lsc_config __user *lsc_cfg; | ||
416 | struct omap3isp_ccdc_culling __user *cull; | ||
417 | __u8 __user *lsc; | ||
418 | }; | ||
419 | |||
420 | /* Preview configurations */ | ||
421 | #define OMAP3ISP_PREV_LUMAENH (1 << 0) | ||
422 | #define OMAP3ISP_PREV_INVALAW (1 << 1) | ||
423 | #define OMAP3ISP_PREV_HRZ_MED (1 << 2) | ||
424 | #define OMAP3ISP_PREV_CFA (1 << 3) | ||
425 | #define OMAP3ISP_PREV_CHROMA_SUPP (1 << 4) | ||
426 | #define OMAP3ISP_PREV_WB (1 << 5) | ||
427 | #define OMAP3ISP_PREV_BLKADJ (1 << 6) | ||
428 | #define OMAP3ISP_PREV_RGB2RGB (1 << 7) | ||
429 | #define OMAP3ISP_PREV_COLOR_CONV (1 << 8) | ||
430 | #define OMAP3ISP_PREV_YC_LIMIT (1 << 9) | ||
431 | #define OMAP3ISP_PREV_DEFECT_COR (1 << 10) | ||
432 | #define OMAP3ISP_PREV_GAMMABYPASS (1 << 11) | ||
433 | #define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12) | ||
434 | #define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13) | ||
435 | #define OMAP3ISP_PREV_LENS_SHADING (1 << 14) | ||
436 | #define OMAP3ISP_PREV_NF (1 << 15) | ||
437 | #define OMAP3ISP_PREV_GAMMA (1 << 16) | ||
438 | |||
439 | #define OMAP3ISP_PREV_NF_TBL_SIZE 64 | ||
440 | #define OMAP3ISP_PREV_CFA_TBL_SIZE 576 | ||
441 | #define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024 | ||
442 | #define OMAP3ISP_PREV_YENH_TBL_SIZE 128 | ||
443 | |||
444 | #define OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS 4 | ||
445 | |||
446 | /** | ||
447 | * struct omap3isp_prev_hmed - Horizontal Median Filter | ||
448 | * @odddist: Distance between consecutive pixels of same color in the odd line. | ||
449 | * @evendist: Distance between consecutive pixels of same color in the even | ||
450 | * line. | ||
451 | * @thres: Horizontal median filter threshold. | ||
452 | */ | ||
453 | struct omap3isp_prev_hmed { | ||
454 | __u8 odddist; | ||
455 | __u8 evendist; | ||
456 | __u8 thres; | ||
457 | }; | ||
458 | |||
459 | /* | ||
460 | * Enumeration for CFA Formats supported by preview | ||
461 | */ | ||
462 | enum omap3isp_cfa_fmt { | ||
463 | OMAP3ISP_CFAFMT_BAYER, | ||
464 | OMAP3ISP_CFAFMT_SONYVGA, | ||
465 | OMAP3ISP_CFAFMT_RGBFOVEON, | ||
466 | OMAP3ISP_CFAFMT_DNSPL, | ||
467 | OMAP3ISP_CFAFMT_HONEYCOMB, | ||
468 | OMAP3ISP_CFAFMT_RRGGBBFOVEON | ||
469 | }; | ||
470 | |||
471 | /** | ||
472 | * struct omap3isp_prev_cfa - CFA Interpolation | ||
473 | * @format: CFA Format Enum value supported by preview. | ||
474 | * @gradthrs_vert: CFA Gradient Threshold - Vertical. | ||
475 | * @gradthrs_horz: CFA Gradient Threshold - Horizontal. | ||
476 | * @table: Pointer to the CFA table. | ||
477 | */ | ||
478 | struct omap3isp_prev_cfa { | ||
479 | enum omap3isp_cfa_fmt format; | ||
480 | __u8 gradthrs_vert; | ||
481 | __u8 gradthrs_horz; | ||
482 | __u32 table[OMAP3ISP_PREV_CFA_TBL_SIZE]; | ||
483 | }; | ||
484 | |||
485 | /** | ||
486 | * struct omap3isp_prev_csup - Chrominance Suppression | ||
487 | * @gain: Gain. | ||
488 | * @thres: Threshold. | ||
489 | * @hypf_en: Flag to enable/disable the High Pass Filter. | ||
490 | */ | ||
491 | struct omap3isp_prev_csup { | ||
492 | __u8 gain; | ||
493 | __u8 thres; | ||
494 | __u8 hypf_en; | ||
495 | }; | ||
496 | |||
497 | /** | ||
498 | * struct omap3isp_prev_wbal - White Balance | ||
499 | * @dgain: Digital gain (U10Q8). | ||
500 | * @coef3: White balance gain - COEF 3 (U8Q5). | ||
501 | * @coef2: White balance gain - COEF 2 (U8Q5). | ||
502 | * @coef1: White balance gain - COEF 1 (U8Q5). | ||
503 | * @coef0: White balance gain - COEF 0 (U8Q5). | ||
504 | */ | ||
505 | struct omap3isp_prev_wbal { | ||
506 | __u16 dgain; | ||
507 | __u8 coef3; | ||
508 | __u8 coef2; | ||
509 | __u8 coef1; | ||
510 | __u8 coef0; | ||
511 | }; | ||
512 | |||
513 | /** | ||
514 | * struct omap3isp_prev_blkadj - Black Level Adjustment | ||
515 | * @red: Black level offset adjustment for Red in 2's complement format | ||
516 | * @green: Black level offset adjustment for Green in 2's complement format | ||
517 | * @blue: Black level offset adjustment for Blue in 2's complement format | ||
518 | */ | ||
519 | struct omap3isp_prev_blkadj { | ||
520 | /*Black level offset adjustment for Red in 2's complement format */ | ||
521 | __u8 red; | ||
522 | /*Black level offset adjustment for Green in 2's complement format */ | ||
523 | __u8 green; | ||
524 | /* Black level offset adjustment for Blue in 2's complement format */ | ||
525 | __u8 blue; | ||
526 | }; | ||
527 | |||
528 | /** | ||
529 | * struct omap3isp_prev_rgbtorgb - RGB to RGB Blending | ||
530 | * @matrix: Blending values(S12Q8 format) | ||
531 | * [RR] [GR] [BR] | ||
532 | * [RG] [GG] [BG] | ||
533 | * [RB] [GB] [BB] | ||
534 | * @offset: Blending offset value for R,G,B in 2's complement integer format. | ||
535 | */ | ||
536 | struct omap3isp_prev_rgbtorgb { | ||
537 | __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX]; | ||
538 | __u16 offset[OMAP3ISP_RGB_MAX]; | ||
539 | }; | ||
540 | |||
541 | /** | ||
542 | * struct omap3isp_prev_csc - Color Space Conversion from RGB-YCbYCr | ||
543 | * @matrix: Color space conversion coefficients(S10Q8) | ||
544 | * [CSCRY] [CSCGY] [CSCBY] | ||
545 | * [CSCRCB] [CSCGCB] [CSCBCB] | ||
546 | * [CSCRCR] [CSCGCR] [CSCBCR] | ||
547 | * @offset: CSC offset values for Y offset, CB offset and CR offset respectively | ||
548 | */ | ||
549 | struct omap3isp_prev_csc { | ||
550 | __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX]; | ||
551 | __s16 offset[OMAP3ISP_RGB_MAX]; | ||
552 | }; | ||
553 | |||
554 | /** | ||
555 | * struct omap3isp_prev_yclimit - Y, C Value Limit | ||
556 | * @minC: Minimum C value | ||
557 | * @maxC: Maximum C value | ||
558 | * @minY: Minimum Y value | ||
559 | * @maxY: Maximum Y value | ||
560 | */ | ||
561 | struct omap3isp_prev_yclimit { | ||
562 | __u8 minC; | ||
563 | __u8 maxC; | ||
564 | __u8 minY; | ||
565 | __u8 maxY; | ||
566 | }; | ||
567 | |||
568 | /** | ||
569 | * struct omap3isp_prev_dcor - Defect correction | ||
570 | * @couplet_mode_en: Flag to enable or disable the couplet dc Correction in NF | ||
571 | * @detect_correct: Thresholds for correction bit 0:10 detect 16:25 correct | ||
572 | */ | ||
573 | struct omap3isp_prev_dcor { | ||
574 | __u8 couplet_mode_en; | ||
575 | __u32 detect_correct[OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS]; | ||
576 | }; | ||
577 | |||
578 | /** | ||
579 | * struct omap3isp_prev_nf - Noise Filter | ||
580 | * @spread: Spread value to be used in Noise Filter | ||
581 | * @table: Pointer to the Noise Filter table | ||
582 | */ | ||
583 | struct omap3isp_prev_nf { | ||
584 | __u8 spread; | ||
585 | __u32 table[OMAP3ISP_PREV_NF_TBL_SIZE]; | ||
586 | }; | ||
587 | |||
588 | /** | ||
589 | * struct omap3isp_prev_gtables - Gamma correction tables | ||
590 | * @red: Array for red gamma table. | ||
591 | * @green: Array for green gamma table. | ||
592 | * @blue: Array for blue gamma table. | ||
593 | */ | ||
594 | struct omap3isp_prev_gtables { | ||
595 | __u32 red[OMAP3ISP_PREV_GAMMA_TBL_SIZE]; | ||
596 | __u32 green[OMAP3ISP_PREV_GAMMA_TBL_SIZE]; | ||
597 | __u32 blue[OMAP3ISP_PREV_GAMMA_TBL_SIZE]; | ||
598 | }; | ||
599 | |||
600 | /** | ||
601 | * struct omap3isp_prev_luma - Luma enhancement | ||
602 | * @table: Array for luma enhancement table. | ||
603 | */ | ||
604 | struct omap3isp_prev_luma { | ||
605 | __u32 table[OMAP3ISP_PREV_YENH_TBL_SIZE]; | ||
606 | }; | ||
607 | |||
608 | /** | ||
609 | * struct omap3isp_prev_update_config - Preview engine configuration (user) | ||
610 | * @update: Specifies which ISP Preview registers should be updated. | ||
611 | * @flag: Specifies which ISP Preview functions should be enabled. | ||
612 | * @shading_shift: 3bit value of shift used in shading compensation. | ||
613 | * @luma: Pointer to luma enhancement structure. | ||
614 | * @hmed: Pointer to structure containing the odd and even distance. | ||
615 | * between the pixels in the image along with the filter threshold. | ||
616 | * @cfa: Pointer to structure containing the CFA interpolation table, CFA. | ||
617 | * format in the image, vertical and horizontal gradient threshold. | ||
618 | * @csup: Pointer to Structure for Chrominance Suppression coefficients. | ||
619 | * @wbal: Pointer to structure for White Balance. | ||
620 | * @blkadj: Pointer to structure for Black Adjustment. | ||
621 | * @rgb2rgb: Pointer to structure for RGB to RGB Blending. | ||
622 | * @csc: Pointer to structure for Color Space Conversion from RGB-YCbYCr. | ||
623 | * @yclimit: Pointer to structure for Y, C Value Limit. | ||
624 | * @dcor: Pointer to structure for defect correction. | ||
625 | * @nf: Pointer to structure for Noise Filter | ||
626 | * @gamma: Pointer to gamma structure. | ||
627 | */ | ||
628 | struct omap3isp_prev_update_config { | ||
629 | __u32 update; | ||
630 | __u32 flag; | ||
631 | __u32 shading_shift; | ||
632 | struct omap3isp_prev_luma __user *luma; | ||
633 | struct omap3isp_prev_hmed __user *hmed; | ||
634 | struct omap3isp_prev_cfa __user *cfa; | ||
635 | struct omap3isp_prev_csup __user *csup; | ||
636 | struct omap3isp_prev_wbal __user *wbal; | ||
637 | struct omap3isp_prev_blkadj __user *blkadj; | ||
638 | struct omap3isp_prev_rgbtorgb __user *rgb2rgb; | ||
639 | struct omap3isp_prev_csc __user *csc; | ||
640 | struct omap3isp_prev_yclimit __user *yclimit; | ||
641 | struct omap3isp_prev_dcor __user *dcor; | ||
642 | struct omap3isp_prev_nf __user *nf; | ||
643 | struct omap3isp_prev_gtables __user *gamma; | ||
644 | }; | ||
645 | |||
646 | #endif /* OMAP3_ISP_USER_H */ | ||
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 6d6cb7a57bb3..f5de21de31dd 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -1,8 +1,26 @@ | |||
1 | #ifndef __LINUX_PAGE_CGROUP_H | 1 | #ifndef __LINUX_PAGE_CGROUP_H |
2 | #define __LINUX_PAGE_CGROUP_H | 2 | #define __LINUX_PAGE_CGROUP_H |
3 | 3 | ||
4 | enum { | ||
5 | /* flags for mem_cgroup */ | ||
6 | PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ | ||
7 | PCG_CACHE, /* charged as cache */ | ||
8 | PCG_USED, /* this object is in use. */ | ||
9 | PCG_MIGRATION, /* under page migration */ | ||
10 | /* flags for mem_cgroup and file and I/O status */ | ||
11 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | ||
12 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
13 | /* No lock in page_cgroup */ | ||
14 | PCG_ACCT_LRU, /* page has been accounted for (under lru_lock) */ | ||
15 | __NR_PCG_FLAGS, | ||
16 | }; | ||
17 | |||
18 | #ifndef __GENERATING_BOUNDS_H | ||
19 | #include <generated/bounds.h> | ||
20 | |||
4 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 21 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
5 | #include <linux/bit_spinlock.h> | 22 | #include <linux/bit_spinlock.h> |
23 | |||
6 | /* | 24 | /* |
7 | * Page Cgroup can be considered as an extended mem_map. | 25 | * Page Cgroup can be considered as an extended mem_map. |
8 | * A page_cgroup page is associated with every page descriptor. The | 26 | * A page_cgroup page is associated with every page descriptor. The |
@@ -13,7 +31,6 @@ | |||
13 | struct page_cgroup { | 31 | struct page_cgroup { |
14 | unsigned long flags; | 32 | unsigned long flags; |
15 | struct mem_cgroup *mem_cgroup; | 33 | struct mem_cgroup *mem_cgroup; |
16 | struct page *page; | ||
17 | struct list_head lru; /* per cgroup LRU list */ | 34 | struct list_head lru; /* per cgroup LRU list */ |
18 | }; | 35 | }; |
19 | 36 | ||
@@ -32,19 +49,7 @@ static inline void __init page_cgroup_init(void) | |||
32 | #endif | 49 | #endif |
33 | 50 | ||
34 | struct page_cgroup *lookup_page_cgroup(struct page *page); | 51 | struct page_cgroup *lookup_page_cgroup(struct page *page); |
35 | 52 | struct page *lookup_cgroup_page(struct page_cgroup *pc); | |
36 | enum { | ||
37 | /* flags for mem_cgroup */ | ||
38 | PCG_LOCK, /* Lock for pc->mem_cgroup and following bits. */ | ||
39 | PCG_CACHE, /* charged as cache */ | ||
40 | PCG_USED, /* this object is in use. */ | ||
41 | PCG_MIGRATION, /* under page migration */ | ||
42 | /* flags for mem_cgroup and file and I/O status */ | ||
43 | PCG_MOVE_LOCK, /* For race between move_account v.s. following bits */ | ||
44 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
45 | /* No lock in page_cgroup */ | ||
46 | PCG_ACCT_LRU, /* page has been accounted for (under lru_lock) */ | ||
47 | }; | ||
48 | 53 | ||
49 | #define TESTPCGFLAG(uname, lname) \ | 54 | #define TESTPCGFLAG(uname, lname) \ |
50 | static inline int PageCgroup##uname(struct page_cgroup *pc) \ | 55 | static inline int PageCgroup##uname(struct page_cgroup *pc) \ |
@@ -85,16 +90,6 @@ SETPCGFLAG(Migration, MIGRATION) | |||
85 | CLEARPCGFLAG(Migration, MIGRATION) | 90 | CLEARPCGFLAG(Migration, MIGRATION) |
86 | TESTPCGFLAG(Migration, MIGRATION) | 91 | TESTPCGFLAG(Migration, MIGRATION) |
87 | 92 | ||
88 | static inline int page_cgroup_nid(struct page_cgroup *pc) | ||
89 | { | ||
90 | return page_to_nid(pc->page); | ||
91 | } | ||
92 | |||
93 | static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc) | ||
94 | { | ||
95 | return page_zonenum(pc->page); | ||
96 | } | ||
97 | |||
98 | static inline void lock_page_cgroup(struct page_cgroup *pc) | 93 | static inline void lock_page_cgroup(struct page_cgroup *pc) |
99 | { | 94 | { |
100 | /* | 95 | /* |
@@ -109,11 +104,6 @@ static inline void unlock_page_cgroup(struct page_cgroup *pc) | |||
109 | bit_spin_unlock(PCG_LOCK, &pc->flags); | 104 | bit_spin_unlock(PCG_LOCK, &pc->flags); |
110 | } | 105 | } |
111 | 106 | ||
112 | static inline int page_is_cgroup_locked(struct page_cgroup *pc) | ||
113 | { | ||
114 | return bit_spin_is_locked(PCG_LOCK, &pc->flags); | ||
115 | } | ||
116 | |||
117 | static inline void move_lock_page_cgroup(struct page_cgroup *pc, | 107 | static inline void move_lock_page_cgroup(struct page_cgroup *pc, |
118 | unsigned long *flags) | 108 | unsigned long *flags) |
119 | { | 109 | { |
@@ -132,6 +122,39 @@ static inline void move_unlock_page_cgroup(struct page_cgroup *pc, | |||
132 | local_irq_restore(*flags); | 122 | local_irq_restore(*flags); |
133 | } | 123 | } |
134 | 124 | ||
125 | #ifdef CONFIG_SPARSEMEM | ||
126 | #define PCG_ARRAYID_WIDTH SECTIONS_SHIFT | ||
127 | #else | ||
128 | #define PCG_ARRAYID_WIDTH NODES_SHIFT | ||
129 | #endif | ||
130 | |||
131 | #if (PCG_ARRAYID_WIDTH > BITS_PER_LONG - NR_PCG_FLAGS) | ||
132 | #error Not enough space left in pc->flags to store page_cgroup array IDs | ||
133 | #endif | ||
134 | |||
135 | /* pc->flags: ARRAY-ID | FLAGS */ | ||
136 | |||
137 | #define PCG_ARRAYID_MASK ((1UL << PCG_ARRAYID_WIDTH) - 1) | ||
138 | |||
139 | #define PCG_ARRAYID_OFFSET (BITS_PER_LONG - PCG_ARRAYID_WIDTH) | ||
140 | /* | ||
141 | * Zero the shift count for non-existant fields, to prevent compiler | ||
142 | * warnings and ensure references are optimized away. | ||
143 | */ | ||
144 | #define PCG_ARRAYID_SHIFT (PCG_ARRAYID_OFFSET * (PCG_ARRAYID_WIDTH != 0)) | ||
145 | |||
146 | static inline void set_page_cgroup_array_id(struct page_cgroup *pc, | ||
147 | unsigned long id) | ||
148 | { | ||
149 | pc->flags &= ~(PCG_ARRAYID_MASK << PCG_ARRAYID_SHIFT); | ||
150 | pc->flags |= (id & PCG_ARRAYID_MASK) << PCG_ARRAYID_SHIFT; | ||
151 | } | ||
152 | |||
153 | static inline unsigned long page_cgroup_array_id(struct page_cgroup *pc) | ||
154 | { | ||
155 | return (pc->flags >> PCG_ARRAYID_SHIFT) & PCG_ARRAYID_MASK; | ||
156 | } | ||
157 | |||
135 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 158 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
136 | struct page_cgroup; | 159 | struct page_cgroup; |
137 | 160 | ||
@@ -152,7 +175,7 @@ static inline void __init page_cgroup_init_flatmem(void) | |||
152 | { | 175 | { |
153 | } | 176 | } |
154 | 177 | ||
155 | #endif | 178 | #endif /* CONFIG_CGROUP_MEM_RES_CTLR */ |
156 | 179 | ||
157 | #include <linux/swap.h> | 180 | #include <linux/swap.h> |
158 | 181 | ||
@@ -188,5 +211,8 @@ static inline void swap_cgroup_swapoff(int type) | |||
188 | return; | 211 | return; |
189 | } | 212 | } |
190 | 213 | ||
191 | #endif | 214 | #endif /* CONFIG_CGROUP_MEM_RES_CTLR_SWAP */ |
192 | #endif | 215 | |
216 | #endif /* !__GENERATING_BOUNDS_H */ | ||
217 | |||
218 | #endif /* __LINUX_PAGE_CGROUP_H */ | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 29ebba54c238..c11950652646 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -298,7 +298,6 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | |||
298 | 298 | ||
299 | extern void __lock_page(struct page *page); | 299 | extern void __lock_page(struct page *page); |
300 | extern int __lock_page_killable(struct page *page); | 300 | extern int __lock_page_killable(struct page *page); |
301 | extern void __lock_page_nosync(struct page *page); | ||
302 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, | 301 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, |
303 | unsigned int flags); | 302 | unsigned int flags); |
304 | extern void unlock_page(struct page *page); | 303 | extern void unlock_page(struct page *page); |
@@ -342,17 +341,6 @@ static inline int lock_page_killable(struct page *page) | |||
342 | } | 341 | } |
343 | 342 | ||
344 | /* | 343 | /* |
345 | * lock_page_nosync should only be used if we can't pin the page's inode. | ||
346 | * Doesn't play quite so well with block device plugging. | ||
347 | */ | ||
348 | static inline void lock_page_nosync(struct page *page) | ||
349 | { | ||
350 | might_sleep(); | ||
351 | if (!trylock_page(page)) | ||
352 | __lock_page_nosync(page); | ||
353 | } | ||
354 | |||
355 | /* | ||
356 | * lock_page_or_retry - Lock the page, unless this would block and the | 344 | * lock_page_or_retry - Lock the page, unless this would block and the |
357 | * caller indicated that it can handle a retry. | 345 | * caller indicated that it can handle a retry. |
358 | */ | 346 | */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index bda221dfaf0a..11fd38151cc9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2737,6 +2737,7 @@ | |||
2737 | #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 | 2737 | #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 |
2738 | #define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119 | 2738 | #define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119 |
2739 | #define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a | 2739 | #define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a |
2740 | #define PCI_DEVICE_ID_INTEL_ITC_LPC 0x8186 | ||
2740 | #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 | 2741 | #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 |
2741 | #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 | 2742 | #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 |
2742 | #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca | 2743 | #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index f495c0147240..311b4dc785a1 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -938,9 +938,7 @@ struct perf_cpu_context { | |||
938 | struct list_head rotation_list; | 938 | struct list_head rotation_list; |
939 | int jiffies_interval; | 939 | int jiffies_interval; |
940 | struct pmu *active_pmu; | 940 | struct pmu *active_pmu; |
941 | #ifdef CONFIG_CGROUP_PERF | ||
942 | struct perf_cgroup *cgrp; | 941 | struct perf_cgroup *cgrp; |
943 | #endif | ||
944 | }; | 942 | }; |
945 | 943 | ||
946 | struct perf_output_handle { | 944 | struct perf_output_handle { |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 49f1c2f66e95..efceda0a51b1 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -141,6 +141,17 @@ static inline struct pid_namespace *ns_of_pid(struct pid *pid) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * is_child_reaper returns true if the pid is the init process | ||
145 | * of the current namespace. As this one could be checked before | ||
146 | * pid_ns->child_reaper is assigned in copy_process, we check | ||
147 | * with the pid number. | ||
148 | */ | ||
149 | static inline bool is_child_reaper(struct pid *pid) | ||
150 | { | ||
151 | return pid->numbers[pid->level].nr == 1; | ||
152 | } | ||
153 | |||
154 | /* | ||
144 | * the helpers to get the pid's id seen from different namespaces | 155 | * the helpers to get the pid's id seen from different namespaces |
145 | * | 156 | * |
146 | * pid_nr() : global id, i.e. the id seen from the init namespace; | 157 | * pid_nr() : global id, i.e. the id seen from the init namespace; |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 379eaed72d4b..838c1149251a 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -50,7 +50,7 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer, | |||
50 | 50 | ||
51 | struct proc_dir_entry { | 51 | struct proc_dir_entry { |
52 | unsigned int low_ino; | 52 | unsigned int low_ino; |
53 | unsigned short namelen; | 53 | unsigned int namelen; |
54 | const char *name; | 54 | const char *name; |
55 | mode_t mode; | 55 | mode_t mode; |
56 | nlink_t nlink; | 56 | nlink_t nlink; |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index eb354f6f26b3..26f9e3612e0f 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -277,7 +277,7 @@ static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) | |||
277 | /* | 277 | /* |
278 | * Mark inode fully dirty. Since we are allocating blocks, inode | 278 | * Mark inode fully dirty. Since we are allocating blocks, inode |
279 | * would become fully dirty soon anyway and it reportedly | 279 | * would become fully dirty soon anyway and it reportedly |
280 | * reduces inode_lock contention. | 280 | * reduces lock contention. |
281 | */ | 281 | */ |
282 | mark_inode_dirty(inode); | 282 | mark_inode_dirty(inode); |
283 | } | 283 | } |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index c21072adbfad..0a3842aacba9 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1124,15 +1124,18 @@ struct reiserfs_de_head { | |||
1124 | # define aligned_address(addr) ((void *)((long)(addr) & ~((1UL << ADDR_UNALIGNED_BITS) - 1))) | 1124 | # define aligned_address(addr) ((void *)((long)(addr) & ~((1UL << ADDR_UNALIGNED_BITS) - 1))) |
1125 | # define unaligned_offset(addr) (((int)((long)(addr) & ((1 << ADDR_UNALIGNED_BITS) - 1))) << 3) | 1125 | # define unaligned_offset(addr) (((int)((long)(addr) & ((1 << ADDR_UNALIGNED_BITS) - 1))) << 3) |
1126 | 1126 | ||
1127 | # define set_bit_unaligned(nr, addr) ext2_set_bit((nr) + unaligned_offset(addr), aligned_address(addr)) | 1127 | # define set_bit_unaligned(nr, addr) \ |
1128 | # define clear_bit_unaligned(nr, addr) ext2_clear_bit((nr) + unaligned_offset(addr), aligned_address(addr)) | 1128 | __test_and_set_bit_le((nr) + unaligned_offset(addr), aligned_address(addr)) |
1129 | # define test_bit_unaligned(nr, addr) ext2_test_bit((nr) + unaligned_offset(addr), aligned_address(addr)) | 1129 | # define clear_bit_unaligned(nr, addr) \ |
1130 | __test_and_clear_bit_le((nr) + unaligned_offset(addr), aligned_address(addr)) | ||
1131 | # define test_bit_unaligned(nr, addr) \ | ||
1132 | test_bit_le((nr) + unaligned_offset(addr), aligned_address(addr)) | ||
1130 | 1133 | ||
1131 | #else | 1134 | #else |
1132 | 1135 | ||
1133 | # define set_bit_unaligned(nr, addr) ext2_set_bit(nr, addr) | 1136 | # define set_bit_unaligned(nr, addr) __test_and_set_bit_le(nr, addr) |
1134 | # define clear_bit_unaligned(nr, addr) ext2_clear_bit(nr, addr) | 1137 | # define clear_bit_unaligned(nr, addr) __test_and_clear_bit_le(nr, addr) |
1135 | # define test_bit_unaligned(nr, addr) ext2_test_bit(nr, addr) | 1138 | # define test_bit_unaligned(nr, addr) test_bit_le(nr, addr) |
1136 | 1139 | ||
1137 | #endif | 1140 | #endif |
1138 | 1141 | ||
@@ -2329,14 +2332,10 @@ __u32 keyed_hash(const signed char *msg, int len); | |||
2329 | __u32 yura_hash(const signed char *msg, int len); | 2332 | __u32 yura_hash(const signed char *msg, int len); |
2330 | __u32 r5_hash(const signed char *msg, int len); | 2333 | __u32 r5_hash(const signed char *msg, int len); |
2331 | 2334 | ||
2332 | /* the ext2 bit routines adjust for big or little endian as | 2335 | #define reiserfs_test_and_set_le_bit __test_and_set_bit_le |
2333 | ** appropriate for the arch, so in our laziness we use them rather | 2336 | #define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le |
2334 | ** than using the bit routines they call more directly. These | 2337 | #define reiserfs_test_le_bit test_bit_le |
2335 | ** routines must be used when changing on disk bitmaps. */ | 2338 | #define reiserfs_find_next_zero_le_bit find_next_zero_bit_le |
2336 | #define reiserfs_test_and_set_le_bit ext2_set_bit | ||
2337 | #define reiserfs_test_and_clear_le_bit ext2_clear_bit | ||
2338 | #define reiserfs_test_le_bit ext2_test_bit | ||
2339 | #define reiserfs_find_next_zero_le_bit ext2_find_next_zero_bit | ||
2340 | 2339 | ||
2341 | /* sometimes reiserfs_truncate may require to allocate few new blocks | 2340 | /* sometimes reiserfs_truncate may require to allocate few new blocks |
2342 | to perform indirect2direct conversion. People probably used to | 2341 | to perform indirect2direct conversion. People probably used to |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index a5930cb66145..c9d625ca659e 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -129,20 +129,22 @@ int __must_check res_counter_charge(struct res_counter *counter, | |||
129 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); | 129 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); |
130 | void res_counter_uncharge(struct res_counter *counter, unsigned long val); | 130 | void res_counter_uncharge(struct res_counter *counter, unsigned long val); |
131 | 131 | ||
132 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | 132 | /** |
133 | { | 133 | * res_counter_margin - calculate chargeable space of a counter |
134 | if (cnt->usage < cnt->limit) | 134 | * @cnt: the counter |
135 | return true; | 135 | * |
136 | 136 | * Returns the difference between the hard limit and the current usage | |
137 | return false; | 137 | * of resource counter @cnt. |
138 | } | 138 | */ |
139 | 139 | static inline unsigned long long res_counter_margin(struct res_counter *cnt) | |
140 | static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt) | ||
141 | { | 140 | { |
142 | if (cnt->usage < cnt->soft_limit) | 141 | unsigned long long margin; |
143 | return true; | 142 | unsigned long flags; |
144 | 143 | ||
145 | return false; | 144 | spin_lock_irqsave(&cnt->lock, flags); |
145 | margin = cnt->limit - cnt->usage; | ||
146 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
147 | return margin; | ||
146 | } | 148 | } |
147 | 149 | ||
148 | /** | 150 | /** |
@@ -167,52 +169,6 @@ res_counter_soft_limit_excess(struct res_counter *cnt) | |||
167 | return excess; | 169 | return excess; |
168 | } | 170 | } |
169 | 171 | ||
170 | /* | ||
171 | * Helper function to detect if the cgroup is within it's limit or | ||
172 | * not. It's currently called from cgroup_rss_prepare() | ||
173 | */ | ||
174 | static inline bool res_counter_check_under_limit(struct res_counter *cnt) | ||
175 | { | ||
176 | bool ret; | ||
177 | unsigned long flags; | ||
178 | |||
179 | spin_lock_irqsave(&cnt->lock, flags); | ||
180 | ret = res_counter_limit_check_locked(cnt); | ||
181 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
182 | return ret; | ||
183 | } | ||
184 | |||
185 | /** | ||
186 | * res_counter_check_margin - check if the counter allows charging | ||
187 | * @cnt: the resource counter to check | ||
188 | * @bytes: the number of bytes to check the remaining space against | ||
189 | * | ||
190 | * Returns a boolean value on whether the counter can be charged | ||
191 | * @bytes or whether this would exceed the limit. | ||
192 | */ | ||
193 | static inline bool res_counter_check_margin(struct res_counter *cnt, | ||
194 | unsigned long bytes) | ||
195 | { | ||
196 | bool ret; | ||
197 | unsigned long flags; | ||
198 | |||
199 | spin_lock_irqsave(&cnt->lock, flags); | ||
200 | ret = cnt->limit - cnt->usage >= bytes; | ||
201 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
202 | return ret; | ||
203 | } | ||
204 | |||
205 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) | ||
206 | { | ||
207 | bool ret; | ||
208 | unsigned long flags; | ||
209 | |||
210 | spin_lock_irqsave(&cnt->lock, flags); | ||
211 | ret = res_counter_soft_limit_check_locked(cnt); | ||
212 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
213 | return ret; | ||
214 | } | ||
215 | |||
216 | static inline void res_counter_reset_max(struct res_counter *cnt) | 172 | static inline void res_counter_reset_max(struct res_counter *cnt) |
217 | { | 173 | { |
218 | unsigned long flags; | 174 | unsigned long flags; |
diff --git a/include/linux/rio.h b/include/linux/rio.h index ff681ebba585..4e37a7cfa726 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #define RIO_NO_HOPCOUNT -1 | 24 | #define RIO_NO_HOPCOUNT -1 |
25 | #define RIO_INVALID_DESTID 0xffff | 25 | #define RIO_INVALID_DESTID 0xffff |
26 | 26 | ||
27 | #define RIO_MAX_MPORTS 8 | ||
27 | #define RIO_MAX_MPORT_RESOURCES 16 | 28 | #define RIO_MAX_MPORT_RESOURCES 16 |
28 | #define RIO_MAX_DEV_RESOURCES 16 | 29 | #define RIO_MAX_DEV_RESOURCES 16 |
29 | 30 | ||
@@ -241,7 +242,7 @@ struct rio_mport { | |||
241 | struct rio_msg inb_msg[RIO_MAX_MBOX]; | 242 | struct rio_msg inb_msg[RIO_MAX_MBOX]; |
242 | struct rio_msg outb_msg[RIO_MAX_MBOX]; | 243 | struct rio_msg outb_msg[RIO_MAX_MBOX]; |
243 | int host_deviceid; /* Host device ID */ | 244 | int host_deviceid; /* Host device ID */ |
244 | struct rio_ops *ops; /* maintenance transaction functions */ | 245 | struct rio_ops *ops; /* low-level architecture-dependent routines */ |
245 | unsigned char id; /* port ID, unique among all ports */ | 246 | unsigned char id; /* port ID, unique among all ports */ |
246 | unsigned char index; /* port index, unique among all port | 247 | unsigned char index; /* port index, unique among all port |
247 | interfaces of the same type */ | 248 | interfaces of the same type */ |
@@ -285,6 +286,13 @@ struct rio_net { | |||
285 | * @cwrite: Callback to perform network write of config space. | 286 | * @cwrite: Callback to perform network write of config space. |
286 | * @dsend: Callback to send a doorbell message. | 287 | * @dsend: Callback to send a doorbell message. |
287 | * @pwenable: Callback to enable/disable port-write message handling. | 288 | * @pwenable: Callback to enable/disable port-write message handling. |
289 | * @open_outb_mbox: Callback to initialize outbound mailbox. | ||
290 | * @close_outb_mbox: Callback to shut down outbound mailbox. | ||
291 | * @open_inb_mbox: Callback to initialize inbound mailbox. | ||
292 | * @close_inb_mbox: Callback to shut down inbound mailbox. | ||
293 | * @add_outb_message: Callback to add a message to an outbound mailbox queue. | ||
294 | * @add_inb_buffer: Callback to add a buffer to an inbound mailbox queue. | ||
295 | * @get_inb_message: Callback to get a message from an inbound mailbox queue. | ||
288 | */ | 296 | */ |
289 | struct rio_ops { | 297 | struct rio_ops { |
290 | int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, | 298 | int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, |
@@ -297,6 +305,16 @@ struct rio_ops { | |||
297 | u8 hopcount, u32 offset, int len, u32 data); | 305 | u8 hopcount, u32 offset, int len, u32 data); |
298 | int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); | 306 | int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); |
299 | int (*pwenable) (struct rio_mport *mport, int enable); | 307 | int (*pwenable) (struct rio_mport *mport, int enable); |
308 | int (*open_outb_mbox)(struct rio_mport *mport, void *dev_id, | ||
309 | int mbox, int entries); | ||
310 | void (*close_outb_mbox)(struct rio_mport *mport, int mbox); | ||
311 | int (*open_inb_mbox)(struct rio_mport *mport, void *dev_id, | ||
312 | int mbox, int entries); | ||
313 | void (*close_inb_mbox)(struct rio_mport *mport, int mbox); | ||
314 | int (*add_outb_message)(struct rio_mport *mport, struct rio_dev *rdev, | ||
315 | int mbox, void *buffer, size_t len); | ||
316 | int (*add_inb_buffer)(struct rio_mport *mport, int mbox, void *buf); | ||
317 | void *(*get_inb_message)(struct rio_mport *mport, int mbox); | ||
300 | }; | 318 | }; |
301 | 319 | ||
302 | #define RIO_RESOURCE_MEM 0x00000100 | 320 | #define RIO_RESOURCE_MEM 0x00000100 |
@@ -378,12 +396,7 @@ union rio_pw_msg { | |||
378 | }; | 396 | }; |
379 | 397 | ||
380 | /* Architecture and hardware-specific functions */ | 398 | /* Architecture and hardware-specific functions */ |
381 | extern int rio_init_mports(void); | ||
382 | extern void rio_register_mport(struct rio_mport *); | 399 | extern void rio_register_mport(struct rio_mport *); |
383 | extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int, | ||
384 | void *, size_t); | ||
385 | extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *); | ||
386 | extern void *rio_hw_get_inb_message(struct rio_mport *, int); | ||
387 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); | 400 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); |
388 | extern void rio_close_inb_mbox(struct rio_mport *, int); | 401 | extern void rio_close_inb_mbox(struct rio_mport *, int); |
389 | extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); | 402 | extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int); |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index e09e565c4bce..229b3ca23134 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -317,7 +317,8 @@ static inline int rio_add_outb_message(struct rio_mport *mport, | |||
317 | struct rio_dev *rdev, int mbox, | 317 | struct rio_dev *rdev, int mbox, |
318 | void *buffer, size_t len) | 318 | void *buffer, size_t len) |
319 | { | 319 | { |
320 | return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len); | 320 | return mport->ops->add_outb_message(mport, rdev, mbox, |
321 | buffer, len); | ||
321 | } | 322 | } |
322 | 323 | ||
323 | extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int, | 324 | extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int, |
@@ -336,7 +337,7 @@ extern int rio_release_inb_mbox(struct rio_mport *, int); | |||
336 | static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, | 337 | static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, |
337 | void *buffer) | 338 | void *buffer) |
338 | { | 339 | { |
339 | return rio_hw_add_inb_buffer(mport, mbox, buffer); | 340 | return mport->ops->add_inb_buffer(mport, mbox, buffer); |
340 | } | 341 | } |
341 | 342 | ||
342 | /** | 343 | /** |
@@ -348,7 +349,7 @@ static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, | |||
348 | */ | 349 | */ |
349 | static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox) | 350 | static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox) |
350 | { | 351 | { |
351 | return rio_hw_get_inb_message(mport, mbox); | 352 | return mport->ops->get_inb_message(mport, mbox); |
352 | } | 353 | } |
353 | 354 | ||
354 | /* Doorbell management */ | 355 | /* Doorbell management */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4b601be3dace..83bd2e2982fc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -99,6 +99,7 @@ struct robust_list_head; | |||
99 | struct bio_list; | 99 | struct bio_list; |
100 | struct fs_struct; | 100 | struct fs_struct; |
101 | struct perf_event_context; | 101 | struct perf_event_context; |
102 | struct blk_plug; | ||
102 | 103 | ||
103 | /* | 104 | /* |
104 | * List of flags we want to share for kernel threads, | 105 | * List of flags we want to share for kernel threads, |
@@ -516,7 +517,7 @@ struct thread_group_cputimer { | |||
516 | struct autogroup; | 517 | struct autogroup; |
517 | 518 | ||
518 | /* | 519 | /* |
519 | * NOTE! "signal_struct" does not have it's own | 520 | * NOTE! "signal_struct" does not have its own |
520 | * locking, because a shared signal_struct always | 521 | * locking, because a shared signal_struct always |
521 | * implies a shared sighand_struct, so locking | 522 | * implies a shared sighand_struct, so locking |
522 | * sighand_struct is always a proper superset of | 523 | * sighand_struct is always a proper superset of |
@@ -1428,6 +1429,11 @@ struct task_struct { | |||
1428 | /* stacked block device info */ | 1429 | /* stacked block device info */ |
1429 | struct bio_list *bio_list; | 1430 | struct bio_list *bio_list; |
1430 | 1431 | ||
1432 | #ifdef CONFIG_BLOCK | ||
1433 | /* stack plugging */ | ||
1434 | struct blk_plug *plug; | ||
1435 | #endif | ||
1436 | |||
1431 | /* VM state */ | 1437 | /* VM state */ |
1432 | struct reclaim_state *reclaim_state; | 1438 | struct reclaim_state *reclaim_state; |
1433 | 1439 | ||
@@ -1524,8 +1530,8 @@ struct task_struct { | |||
1524 | struct memcg_batch_info { | 1530 | struct memcg_batch_info { |
1525 | int do_batch; /* incremented when batch uncharge started */ | 1531 | int do_batch; /* incremented when batch uncharge started */ |
1526 | struct mem_cgroup *memcg; /* target memcg of uncharge */ | 1532 | struct mem_cgroup *memcg; /* target memcg of uncharge */ |
1527 | unsigned long bytes; /* uncharged usage */ | 1533 | unsigned long nr_pages; /* uncharged usage */ |
1528 | unsigned long memsw_bytes; /* uncharged mem+swap usage */ | 1534 | unsigned long memsw_nr_pages; /* uncharged mem+swap usage */ |
1529 | } memcg_batch; | 1535 | } memcg_batch; |
1530 | #endif | 1536 | #endif |
1531 | }; | 1537 | }; |
diff --git a/include/linux/security.h b/include/linux/security.h index 56cac520d014..ca02f1716736 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -47,13 +47,14 @@ | |||
47 | 47 | ||
48 | struct ctl_table; | 48 | struct ctl_table; |
49 | struct audit_krule; | 49 | struct audit_krule; |
50 | struct user_namespace; | ||
50 | 51 | ||
51 | /* | 52 | /* |
52 | * These functions are in security/capability.c and are used | 53 | * These functions are in security/capability.c and are used |
53 | * as the default capabilities functions | 54 | * as the default capabilities functions |
54 | */ | 55 | */ |
55 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, | 56 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, |
56 | int cap, int audit); | 57 | struct user_namespace *ns, int cap, int audit); |
57 | extern int cap_settime(const struct timespec *ts, const struct timezone *tz); | 58 | extern int cap_settime(const struct timespec *ts, const struct timezone *tz); |
58 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); | 59 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); |
59 | extern int cap_ptrace_traceme(struct task_struct *parent); | 60 | extern int cap_ptrace_traceme(struct task_struct *parent); |
@@ -1262,6 +1263,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1262 | * credentials. | 1263 | * credentials. |
1263 | * @tsk contains the task_struct for the process. | 1264 | * @tsk contains the task_struct for the process. |
1264 | * @cred contains the credentials to use. | 1265 | * @cred contains the credentials to use. |
1266 | * @ns contains the user namespace we want the capability in | ||
1265 | * @cap contains the capability <include/linux/capability.h>. | 1267 | * @cap contains the capability <include/linux/capability.h>. |
1266 | * @audit: Whether to write an audit message or not | 1268 | * @audit: Whether to write an audit message or not |
1267 | * Return 0 if the capability is granted for @tsk. | 1269 | * Return 0 if the capability is granted for @tsk. |
@@ -1384,7 +1386,7 @@ struct security_operations { | |||
1384 | const kernel_cap_t *inheritable, | 1386 | const kernel_cap_t *inheritable, |
1385 | const kernel_cap_t *permitted); | 1387 | const kernel_cap_t *permitted); |
1386 | int (*capable) (struct task_struct *tsk, const struct cred *cred, | 1388 | int (*capable) (struct task_struct *tsk, const struct cred *cred, |
1387 | int cap, int audit); | 1389 | struct user_namespace *ns, int cap, int audit); |
1388 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1390 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
1389 | int (*quota_on) (struct dentry *dentry); | 1391 | int (*quota_on) (struct dentry *dentry); |
1390 | int (*syslog) (int type); | 1392 | int (*syslog) (int type); |
@@ -1665,9 +1667,12 @@ int security_capset(struct cred *new, const struct cred *old, | |||
1665 | const kernel_cap_t *effective, | 1667 | const kernel_cap_t *effective, |
1666 | const kernel_cap_t *inheritable, | 1668 | const kernel_cap_t *inheritable, |
1667 | const kernel_cap_t *permitted); | 1669 | const kernel_cap_t *permitted); |
1668 | int security_capable(const struct cred *cred, int cap); | 1670 | int security_capable(struct user_namespace *ns, const struct cred *cred, |
1669 | int security_real_capable(struct task_struct *tsk, int cap); | 1671 | int cap); |
1670 | int security_real_capable_noaudit(struct task_struct *tsk, int cap); | 1672 | int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, |
1673 | int cap); | ||
1674 | int security_real_capable_noaudit(struct task_struct *tsk, | ||
1675 | struct user_namespace *ns, int cap); | ||
1671 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1676 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
1672 | int security_quota_on(struct dentry *dentry); | 1677 | int security_quota_on(struct dentry *dentry); |
1673 | int security_syslog(int type); | 1678 | int security_syslog(int type); |
@@ -1860,28 +1865,29 @@ static inline int security_capset(struct cred *new, | |||
1860 | return cap_capset(new, old, effective, inheritable, permitted); | 1865 | return cap_capset(new, old, effective, inheritable, permitted); |
1861 | } | 1866 | } |
1862 | 1867 | ||
1863 | static inline int security_capable(const struct cred *cred, int cap) | 1868 | static inline int security_capable(struct user_namespace *ns, |
1869 | const struct cred *cred, int cap) | ||
1864 | { | 1870 | { |
1865 | return cap_capable(current, cred, cap, SECURITY_CAP_AUDIT); | 1871 | return cap_capable(current, cred, ns, cap, SECURITY_CAP_AUDIT); |
1866 | } | 1872 | } |
1867 | 1873 | ||
1868 | static inline int security_real_capable(struct task_struct *tsk, int cap) | 1874 | static inline int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, int cap) |
1869 | { | 1875 | { |
1870 | int ret; | 1876 | int ret; |
1871 | 1877 | ||
1872 | rcu_read_lock(); | 1878 | rcu_read_lock(); |
1873 | ret = cap_capable(tsk, __task_cred(tsk), cap, SECURITY_CAP_AUDIT); | 1879 | ret = cap_capable(tsk, __task_cred(tsk), ns, cap, SECURITY_CAP_AUDIT); |
1874 | rcu_read_unlock(); | 1880 | rcu_read_unlock(); |
1875 | return ret; | 1881 | return ret; |
1876 | } | 1882 | } |
1877 | 1883 | ||
1878 | static inline | 1884 | static inline |
1879 | int security_real_capable_noaudit(struct task_struct *tsk, int cap) | 1885 | int security_real_capable_noaudit(struct task_struct *tsk, struct user_namespace *ns, int cap) |
1880 | { | 1886 | { |
1881 | int ret; | 1887 | int ret; |
1882 | 1888 | ||
1883 | rcu_read_lock(); | 1889 | rcu_read_lock(); |
1884 | ret = cap_capable(tsk, __task_cred(tsk), cap, | 1890 | ret = cap_capable(tsk, __task_cred(tsk), ns, cap, |
1885 | SECURITY_CAP_NOAUDIT); | 1891 | SECURITY_CAP_NOAUDIT); |
1886 | rcu_read_unlock(); | 1892 | rcu_read_unlock(); |
1887 | return ret; | 1893 | return ret; |
diff --git a/include/linux/sm501.h b/include/linux/sm501.h index 214f93209b8c..02fde50a79a5 100644 --- a/include/linux/sm501.h +++ b/include/linux/sm501.h | |||
@@ -172,3 +172,11 @@ struct sm501_platdata { | |||
172 | struct sm501_platdata_gpio_i2c *gpio_i2c; | 172 | struct sm501_platdata_gpio_i2c *gpio_i2c; |
173 | unsigned int gpio_i2c_nr; | 173 | unsigned int gpio_i2c_nr; |
174 | }; | 174 | }; |
175 | |||
176 | #if defined(CONFIG_PPC32) | ||
177 | #define smc501_readl(addr) ioread32be((addr)) | ||
178 | #define smc501_writel(val, addr) iowrite32be((val), (addr)) | ||
179 | #else | ||
180 | #define smc501_readl(addr) readl(addr) | ||
181 | #define smc501_writel(val, addr) writel(val, addr) | ||
182 | #endif | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index 48159dd320d0..74243c86ba39 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/init.h> | ||
13 | 14 | ||
14 | extern void cpu_idle(void); | 15 | extern void cpu_idle(void); |
15 | 16 | ||
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 5d8048beb051..332da61cf8b7 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -126,6 +126,9 @@ struct gss_api_mech *gss_mech_get_by_name(const char *); | |||
126 | /* Similar, but get by pseudoflavor. */ | 126 | /* Similar, but get by pseudoflavor. */ |
127 | struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | 127 | struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); |
128 | 128 | ||
129 | /* Fill in an array with a list of supported pseudoflavors */ | ||
130 | int gss_mech_list_pseudoflavors(u32 *); | ||
131 | |||
129 | /* Just increments the mechanism's reference count and returns its input: */ | 132 | /* Just increments the mechanism's reference count and returns its input: */ |
130 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | 133 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); |
131 | 134 | ||
diff --git a/include/linux/svga.h b/include/linux/svga.h index c59a51a2b0e7..bfa68e837d6a 100644 --- a/include/linux/svga.h +++ b/include/linux/svga.h | |||
@@ -67,25 +67,25 @@ struct svga_pll { | |||
67 | 67 | ||
68 | /* Write a value to the attribute register */ | 68 | /* Write a value to the attribute register */ |
69 | 69 | ||
70 | static inline void svga_wattr(u8 index, u8 data) | 70 | static inline void svga_wattr(void __iomem *regbase, u8 index, u8 data) |
71 | { | 71 | { |
72 | inb(0x3DA); | 72 | vga_r(regbase, VGA_IS1_RC); |
73 | outb(index, 0x3C0); | 73 | vga_w(regbase, VGA_ATT_IW, index); |
74 | outb(data, 0x3C0); | 74 | vga_w(regbase, VGA_ATT_W, data); |
75 | } | 75 | } |
76 | 76 | ||
77 | /* Write a value to a sequence register with a mask */ | 77 | /* Write a value to a sequence register with a mask */ |
78 | 78 | ||
79 | static inline void svga_wseq_mask(u8 index, u8 data, u8 mask) | 79 | static inline void svga_wseq_mask(void __iomem *regbase, u8 index, u8 data, u8 mask) |
80 | { | 80 | { |
81 | vga_wseq(NULL, index, (data & mask) | (vga_rseq(NULL, index) & ~mask)); | 81 | vga_wseq(regbase, index, (data & mask) | (vga_rseq(regbase, index) & ~mask)); |
82 | } | 82 | } |
83 | 83 | ||
84 | /* Write a value to a CRT register with a mask */ | 84 | /* Write a value to a CRT register with a mask */ |
85 | 85 | ||
86 | static inline void svga_wcrt_mask(u8 index, u8 data, u8 mask) | 86 | static inline void svga_wcrt_mask(void __iomem *regbase, u8 index, u8 data, u8 mask) |
87 | { | 87 | { |
88 | vga_wcrt(NULL, index, (data & mask) | (vga_rcrt(NULL, index) & ~mask)); | 88 | vga_wcrt(regbase, index, (data & mask) | (vga_rcrt(regbase, index) & ~mask)); |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline int svga_primary_device(struct pci_dev *dev) | 91 | static inline int svga_primary_device(struct pci_dev *dev) |
@@ -96,27 +96,27 @@ static inline int svga_primary_device(struct pci_dev *dev) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | void svga_wcrt_multi(const struct vga_regset *regset, u32 value); | 99 | void svga_wcrt_multi(void __iomem *regbase, const struct vga_regset *regset, u32 value); |
100 | void svga_wseq_multi(const struct vga_regset *regset, u32 value); | 100 | void svga_wseq_multi(void __iomem *regbase, const struct vga_regset *regset, u32 value); |
101 | 101 | ||
102 | void svga_set_default_gfx_regs(void); | 102 | void svga_set_default_gfx_regs(void __iomem *regbase); |
103 | void svga_set_default_atc_regs(void); | 103 | void svga_set_default_atc_regs(void __iomem *regbase); |
104 | void svga_set_default_seq_regs(void); | 104 | void svga_set_default_seq_regs(void __iomem *regbase); |
105 | void svga_set_default_crt_regs(void); | 105 | void svga_set_default_crt_regs(void __iomem *regbase); |
106 | void svga_set_textmode_vga_regs(void); | 106 | void svga_set_textmode_vga_regs(void __iomem *regbase); |
107 | 107 | ||
108 | void svga_settile(struct fb_info *info, struct fb_tilemap *map); | 108 | void svga_settile(struct fb_info *info, struct fb_tilemap *map); |
109 | void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area); | 109 | void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area); |
110 | void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect); | 110 | void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect); |
111 | void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit); | 111 | void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit); |
112 | void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor); | 112 | void svga_tilecursor(void __iomem *regbase, struct fb_info *info, struct fb_tilecursor *cursor); |
113 | int svga_get_tilemax(struct fb_info *info); | 113 | int svga_get_tilemax(struct fb_info *info); |
114 | void svga_get_caps(struct fb_info *info, struct fb_blit_caps *caps, | 114 | void svga_get_caps(struct fb_info *info, struct fb_blit_caps *caps, |
115 | struct fb_var_screeninfo *var); | 115 | struct fb_var_screeninfo *var); |
116 | 116 | ||
117 | int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node); | 117 | int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node); |
118 | int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node); | 118 | int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node); |
119 | void svga_set_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, u32 hmul, u32 hdiv, u32 vmul, u32 vdiv, u32 hborder, int node); | 119 | void svga_set_timings(void __iomem *regbase, const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, u32 hmul, u32 hdiv, u32 vmul, u32 vdiv, u32 hborder, int node); |
120 | 120 | ||
121 | int svga_match_format(const struct svga_fb_format *frm, struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix); | 121 | int svga_match_format(const struct svga_fb_format *frm, struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix); |
122 | 122 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index ed6ebe690f4a..a5c6da5d8df8 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -309,8 +309,6 @@ extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | |||
309 | struct page **pagep, swp_entry_t *ent); | 309 | struct page **pagep, swp_entry_t *ent); |
310 | #endif | 310 | #endif |
311 | 311 | ||
312 | extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | ||
313 | |||
314 | #ifdef CONFIG_SWAP | 312 | #ifdef CONFIG_SWAP |
315 | /* linux/mm/page_io.c */ | 313 | /* linux/mm/page_io.c */ |
316 | extern int swap_readpage(struct page *); | 314 | extern int swap_readpage(struct page *); |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 69f39974c041..4e5b0213fdc1 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -37,9 +37,13 @@ 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 | struct user_namespace; | ||
41 | extern struct user_namespace init_user_ns; | ||
42 | |||
40 | struct uts_namespace { | 43 | struct uts_namespace { |
41 | struct kref kref; | 44 | struct kref kref; |
42 | struct new_utsname name; | 45 | struct new_utsname name; |
46 | struct user_namespace *user_ns; | ||
43 | }; | 47 | }; |
44 | extern struct uts_namespace init_uts_ns; | 48 | extern struct uts_namespace init_uts_ns; |
45 | 49 | ||
@@ -50,7 +54,7 @@ static inline void get_uts_ns(struct uts_namespace *ns) | |||
50 | } | 54 | } |
51 | 55 | ||
52 | extern struct uts_namespace *copy_utsname(unsigned long flags, | 56 | extern struct uts_namespace *copy_utsname(unsigned long flags, |
53 | struct uts_namespace *ns); | 57 | struct task_struct *tsk); |
54 | extern void free_uts_ns(struct kref *kref); | 58 | extern void free_uts_ns(struct kref *kref); |
55 | 59 | ||
56 | static inline void put_uts_ns(struct uts_namespace *ns) | 60 | static inline void put_uts_ns(struct uts_namespace *ns) |
@@ -67,12 +71,12 @@ static inline void put_uts_ns(struct uts_namespace *ns) | |||
67 | } | 71 | } |
68 | 72 | ||
69 | static inline struct uts_namespace *copy_utsname(unsigned long flags, | 73 | static inline struct uts_namespace *copy_utsname(unsigned long flags, |
70 | struct uts_namespace *ns) | 74 | struct task_struct *tsk) |
71 | { | 75 | { |
72 | if (flags & CLONE_NEWUTS) | 76 | if (flags & CLONE_NEWUTS) |
73 | return ERR_PTR(-EINVAL); | 77 | return ERR_PTR(-EINVAL); |
74 | 78 | ||
75 | return ns; | 79 | return tsk->nsproxy->uts_ns; |
76 | } | 80 | } |
77 | #endif | 81 | #endif |
78 | 82 | ||
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h new file mode 100644 index 000000000000..7054a7a8065e --- /dev/null +++ b/include/linux/v4l2-mediabus.h | |||
@@ -0,0 +1,108 @@ | |||
1 | /* | ||
2 | * Media Bus API header | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
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_V4L2_MEDIABUS_H | ||
12 | #define __LINUX_V4L2_MEDIABUS_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/videodev2.h> | ||
16 | |||
17 | /* | ||
18 | * These pixel codes uniquely identify data formats on the media bus. Mostly | ||
19 | * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is | ||
20 | * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the | ||
21 | * data format is fixed. Additionally, "2X8" means that one pixel is transferred | ||
22 | * in two 8-bit samples, "BE" or "LE" specify in which order those samples are | ||
23 | * transferred over the bus: "LE" means that the least significant bits are | ||
24 | * transferred first, "BE" means that the most significant bits are transferred | ||
25 | * first, and "PADHI" and "PADLO" define which bits - low or high, in the | ||
26 | * incomplete high byte, are filled with padding bits. | ||
27 | * | ||
28 | * The pixel codes are grouped by type, bus_width, bits per component, samples | ||
29 | * per pixel and order of subsamples. Numerical values are sorted using generic | ||
30 | * numerical sort order (8 thus comes before 10). | ||
31 | * | ||
32 | * As their value can't change when a new pixel code is inserted in the | ||
33 | * enumeration, the pixel codes are explicitly given a numerical value. The next | ||
34 | * free values for each category are listed below, update them when inserting | ||
35 | * new pixel codes. | ||
36 | */ | ||
37 | enum v4l2_mbus_pixelcode { | ||
38 | V4L2_MBUS_FMT_FIXED = 0x0001, | ||
39 | |||
40 | /* RGB - next is 0x1009 */ | ||
41 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001, | ||
42 | V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002, | ||
43 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003, | ||
44 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 0x1004, | ||
45 | V4L2_MBUS_FMT_BGR565_2X8_BE = 0x1005, | ||
46 | V4L2_MBUS_FMT_BGR565_2X8_LE = 0x1006, | ||
47 | V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, | ||
48 | V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, | ||
49 | |||
50 | /* YUV (including grey) - next is 0x2013 */ | ||
51 | V4L2_MBUS_FMT_Y8_1X8 = 0x2001, | ||
52 | V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, | ||
53 | V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, | ||
54 | V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004, | ||
55 | V4L2_MBUS_FMT_YVYU8_1_5X8 = 0x2005, | ||
56 | V4L2_MBUS_FMT_UYVY8_2X8 = 0x2006, | ||
57 | V4L2_MBUS_FMT_VYUY8_2X8 = 0x2007, | ||
58 | V4L2_MBUS_FMT_YUYV8_2X8 = 0x2008, | ||
59 | V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009, | ||
60 | V4L2_MBUS_FMT_Y10_1X10 = 0x200a, | ||
61 | V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b, | ||
62 | V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c, | ||
63 | V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f, | ||
64 | V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010, | ||
65 | V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011, | ||
66 | V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012, | ||
67 | V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, | ||
68 | V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, | ||
69 | |||
70 | /* Bayer - next is 0x3013 */ | ||
71 | V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, | ||
72 | V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, | ||
73 | V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b, | ||
74 | V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c, | ||
75 | V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009, | ||
76 | V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 0x300d, | ||
77 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 0x3003, | ||
78 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 0x3004, | ||
79 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 0x3005, | ||
80 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 0x3006, | ||
81 | V4L2_MBUS_FMT_SBGGR10_1X10 = 0x3007, | ||
82 | V4L2_MBUS_FMT_SGBRG10_1X10 = 0x300e, | ||
83 | V4L2_MBUS_FMT_SGRBG10_1X10 = 0x300a, | ||
84 | V4L2_MBUS_FMT_SRGGB10_1X10 = 0x300f, | ||
85 | V4L2_MBUS_FMT_SBGGR12_1X12 = 0x3008, | ||
86 | V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010, | ||
87 | V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011, | ||
88 | V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012, | ||
89 | }; | ||
90 | |||
91 | /** | ||
92 | * struct v4l2_mbus_framefmt - frame format on the media bus | ||
93 | * @width: frame width | ||
94 | * @height: frame height | ||
95 | * @code: data format code (from enum v4l2_mbus_pixelcode) | ||
96 | * @field: used interlacing type (from enum v4l2_field) | ||
97 | * @colorspace: colorspace of the data (from enum v4l2_colorspace) | ||
98 | */ | ||
99 | struct v4l2_mbus_framefmt { | ||
100 | __u32 width; | ||
101 | __u32 height; | ||
102 | __u32 code; | ||
103 | __u32 field; | ||
104 | __u32 colorspace; | ||
105 | __u32 reserved[7]; | ||
106 | }; | ||
107 | |||
108 | #endif | ||
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h new file mode 100644 index 000000000000..ed29cbbebfef --- /dev/null +++ b/include/linux/v4l2-subdev.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * V4L2 subdev userspace API | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
7 | * Sakari Ailus <sakari.ailus@iki.fi> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_V4L2_SUBDEV_H | ||
24 | #define __LINUX_V4L2_SUBDEV_H | ||
25 | |||
26 | #include <linux/ioctl.h> | ||
27 | #include <linux/types.h> | ||
28 | #include <linux/v4l2-mediabus.h> | ||
29 | |||
30 | /** | ||
31 | * enum v4l2_subdev_format_whence - Media bus format type | ||
32 | * @V4L2_SUBDEV_FORMAT_TRY: try format, for negotiation only | ||
33 | * @V4L2_SUBDEV_FORMAT_ACTIVE: active format, applied to the device | ||
34 | */ | ||
35 | enum v4l2_subdev_format_whence { | ||
36 | V4L2_SUBDEV_FORMAT_TRY = 0, | ||
37 | V4L2_SUBDEV_FORMAT_ACTIVE = 1, | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * struct v4l2_subdev_format - Pad-level media bus format | ||
42 | * @which: format type (from enum v4l2_subdev_format_whence) | ||
43 | * @pad: pad number, as reported by the media API | ||
44 | * @format: media bus format (format code and frame size) | ||
45 | */ | ||
46 | struct v4l2_subdev_format { | ||
47 | __u32 which; | ||
48 | __u32 pad; | ||
49 | struct v4l2_mbus_framefmt format; | ||
50 | __u32 reserved[8]; | ||
51 | }; | ||
52 | |||
53 | /** | ||
54 | * struct v4l2_subdev_crop - Pad-level crop settings | ||
55 | * @which: format type (from enum v4l2_subdev_format_whence) | ||
56 | * @pad: pad number, as reported by the media API | ||
57 | * @rect: pad crop rectangle boundaries | ||
58 | */ | ||
59 | struct v4l2_subdev_crop { | ||
60 | __u32 which; | ||
61 | __u32 pad; | ||
62 | struct v4l2_rect rect; | ||
63 | __u32 reserved[8]; | ||
64 | }; | ||
65 | |||
66 | /** | ||
67 | * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration | ||
68 | * @pad: pad number, as reported by the media API | ||
69 | * @index: format index during enumeration | ||
70 | * @code: format code (from enum v4l2_mbus_pixelcode) | ||
71 | */ | ||
72 | struct v4l2_subdev_mbus_code_enum { | ||
73 | __u32 pad; | ||
74 | __u32 index; | ||
75 | __u32 code; | ||
76 | __u32 reserved[9]; | ||
77 | }; | ||
78 | |||
79 | /** | ||
80 | * struct v4l2_subdev_frame_size_enum - Media bus format enumeration | ||
81 | * @pad: pad number, as reported by the media API | ||
82 | * @index: format index during enumeration | ||
83 | * @code: format code (from enum v4l2_mbus_pixelcode) | ||
84 | */ | ||
85 | struct v4l2_subdev_frame_size_enum { | ||
86 | __u32 index; | ||
87 | __u32 pad; | ||
88 | __u32 code; | ||
89 | __u32 min_width; | ||
90 | __u32 max_width; | ||
91 | __u32 min_height; | ||
92 | __u32 max_height; | ||
93 | __u32 reserved[9]; | ||
94 | }; | ||
95 | |||
96 | /** | ||
97 | * struct v4l2_subdev_frame_interval - Pad-level frame rate | ||
98 | * @pad: pad number, as reported by the media API | ||
99 | * @interval: frame interval in seconds | ||
100 | */ | ||
101 | struct v4l2_subdev_frame_interval { | ||
102 | __u32 pad; | ||
103 | struct v4l2_fract interval; | ||
104 | __u32 reserved[9]; | ||
105 | }; | ||
106 | |||
107 | /** | ||
108 | * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration | ||
109 | * @pad: pad number, as reported by the media API | ||
110 | * @index: frame interval index during enumeration | ||
111 | * @code: format code (from enum v4l2_mbus_pixelcode) | ||
112 | * @width: frame width in pixels | ||
113 | * @height: frame height in pixels | ||
114 | * @interval: frame interval in seconds | ||
115 | */ | ||
116 | struct v4l2_subdev_frame_interval_enum { | ||
117 | __u32 index; | ||
118 | __u32 pad; | ||
119 | __u32 code; | ||
120 | __u32 width; | ||
121 | __u32 height; | ||
122 | struct v4l2_fract interval; | ||
123 | __u32 reserved[9]; | ||
124 | }; | ||
125 | |||
126 | #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) | ||
127 | #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) | ||
128 | #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \ | ||
129 | _IOWR('V', 21, struct v4l2_subdev_frame_interval) | ||
130 | #define VIDIOC_SUBDEV_S_FRAME_INTERVAL \ | ||
131 | _IOWR('V', 22, struct v4l2_subdev_frame_interval) | ||
132 | #define VIDIOC_SUBDEV_ENUM_MBUS_CODE \ | ||
133 | _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum) | ||
134 | #define VIDIOC_SUBDEV_ENUM_FRAME_SIZE \ | ||
135 | _IOWR('V', 74, struct v4l2_subdev_frame_size_enum) | ||
136 | #define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \ | ||
137 | _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum) | ||
138 | #define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop) | ||
139 | #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop) | ||
140 | |||
141 | #endif | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5f6f47044abf..aa6c393b7ae9 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -70,6 +70,7 @@ | |||
70 | * Moved from videodev.h | 70 | * Moved from videodev.h |
71 | */ | 71 | */ |
72 | #define VIDEO_MAX_FRAME 32 | 72 | #define VIDEO_MAX_FRAME 32 |
73 | #define VIDEO_MAX_PLANES 8 | ||
73 | 74 | ||
74 | #ifndef __KERNEL__ | 75 | #ifndef __KERNEL__ |
75 | 76 | ||
@@ -157,9 +158,23 @@ enum v4l2_buf_type { | |||
157 | /* Experimental */ | 158 | /* Experimental */ |
158 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, | 159 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, |
159 | #endif | 160 | #endif |
161 | V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, | ||
162 | V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, | ||
160 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 163 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
161 | }; | 164 | }; |
162 | 165 | ||
166 | #define V4L2_TYPE_IS_MULTIPLANAR(type) \ | ||
167 | ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \ | ||
168 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) | ||
169 | |||
170 | #define V4L2_TYPE_IS_OUTPUT(type) \ | ||
171 | ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \ | ||
172 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \ | ||
173 | || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \ | ||
174 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ | ||
175 | || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ | ||
176 | || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) | ||
177 | |||
163 | enum v4l2_tuner_type { | 178 | enum v4l2_tuner_type { |
164 | V4L2_TUNER_RADIO = 1, | 179 | V4L2_TUNER_RADIO = 1, |
165 | V4L2_TUNER_ANALOG_TV = 2, | 180 | V4L2_TUNER_ANALOG_TV = 2, |
@@ -245,6 +260,11 @@ struct v4l2_capability { | |||
245 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ | 260 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ |
246 | #define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ | 261 | #define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ |
247 | 262 | ||
263 | /* Is a video capture device that supports multiplanar formats */ | ||
264 | #define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000 | ||
265 | /* Is a video output device that supports multiplanar formats */ | ||
266 | #define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000 | ||
267 | |||
248 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 268 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
249 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 269 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
250 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ | 270 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ |
@@ -319,6 +339,13 @@ struct v4l2_pix_format { | |||
319 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ | 339 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ |
320 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ | 340 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ |
321 | 341 | ||
342 | /* two non contiguous planes - one Y, one Cr + Cb interleaved */ | ||
343 | #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ | ||
344 | #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ | ||
345 | |||
346 | /* three non contiguous planes - Y, Cb, Cr */ | ||
347 | #define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */ | ||
348 | |||
322 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 349 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
323 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 350 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
324 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 351 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
@@ -328,6 +355,10 @@ struct v4l2_pix_format { | |||
328 | #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ | 355 | #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ |
329 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ | 356 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ |
330 | #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ | 357 | #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ |
358 | #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */ | ||
359 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ | ||
360 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ | ||
361 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ | ||
331 | /* 10bit raw bayer DPCM compressed to 8 bits */ | 362 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
332 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') | 363 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') |
333 | /* | 364 | /* |
@@ -365,6 +396,7 @@ struct v4l2_pix_format { | |||
365 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ | 396 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ |
366 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ | 397 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ |
367 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ | 398 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ |
399 | #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ | ||
368 | 400 | ||
369 | /* | 401 | /* |
370 | * F O R M A T E N U M E R A T I O N | 402 | * F O R M A T E N U M E R A T I O N |
@@ -517,6 +549,62 @@ struct v4l2_requestbuffers { | |||
517 | __u32 reserved[2]; | 549 | __u32 reserved[2]; |
518 | }; | 550 | }; |
519 | 551 | ||
552 | /** | ||
553 | * struct v4l2_plane - plane info for multi-planar buffers | ||
554 | * @bytesused: number of bytes occupied by data in the plane (payload) | ||
555 | * @length: size of this plane (NOT the payload) in bytes | ||
556 | * @mem_offset: when memory in the associated struct v4l2_buffer is | ||
557 | * V4L2_MEMORY_MMAP, equals the offset from the start of | ||
558 | * the device memory for this plane (or is a "cookie" that | ||
559 | * should be passed to mmap() called on the video node) | ||
560 | * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer | ||
561 | * pointing to this plane | ||
562 | * @data_offset: offset in the plane to the start of data; usually 0, | ||
563 | * unless there is a header in front of the data | ||
564 | * | ||
565 | * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer | ||
566 | * with two planes can have one plane for Y, and another for interleaved CbCr | ||
567 | * components. Each plane can reside in a separate memory buffer, or even in | ||
568 | * a completely separate memory node (e.g. in embedded devices). | ||
569 | */ | ||
570 | struct v4l2_plane { | ||
571 | __u32 bytesused; | ||
572 | __u32 length; | ||
573 | union { | ||
574 | __u32 mem_offset; | ||
575 | unsigned long userptr; | ||
576 | } m; | ||
577 | __u32 data_offset; | ||
578 | __u32 reserved[11]; | ||
579 | }; | ||
580 | |||
581 | /** | ||
582 | * struct v4l2_buffer - video buffer info | ||
583 | * @index: id number of the buffer | ||
584 | * @type: buffer type (type == *_MPLANE for multiplanar buffers) | ||
585 | * @bytesused: number of bytes occupied by data in the buffer (payload); | ||
586 | * unused (set to 0) for multiplanar buffers | ||
587 | * @flags: buffer informational flags | ||
588 | * @field: field order of the image in the buffer | ||
589 | * @timestamp: frame timestamp | ||
590 | * @timecode: frame timecode | ||
591 | * @sequence: sequence count of this frame | ||
592 | * @memory: the method, in which the actual video data is passed | ||
593 | * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP; | ||
594 | * offset from the start of the device memory for this plane, | ||
595 | * (or a "cookie" that should be passed to mmap() as offset) | ||
596 | * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR; | ||
597 | * a userspace pointer pointing to this buffer | ||
598 | * @planes: for multiplanar buffers; userspace pointer to the array of plane | ||
599 | * info structs for this buffer | ||
600 | * @length: size in bytes of the buffer (NOT its payload) for single-plane | ||
601 | * buffers (when type != *_MPLANE); number of elements in the | ||
602 | * planes array for multi-plane buffers | ||
603 | * @input: input number from which the video data has has been captured | ||
604 | * | ||
605 | * Contains data exchanged by application and driver using one of the Streaming | ||
606 | * I/O methods. | ||
607 | */ | ||
520 | struct v4l2_buffer { | 608 | struct v4l2_buffer { |
521 | __u32 index; | 609 | __u32 index; |
522 | enum v4l2_buf_type type; | 610 | enum v4l2_buf_type type; |
@@ -532,6 +620,7 @@ struct v4l2_buffer { | |||
532 | union { | 620 | union { |
533 | __u32 offset; | 621 | __u32 offset; |
534 | unsigned long userptr; | 622 | unsigned long userptr; |
623 | struct v4l2_plane *planes; | ||
535 | } m; | 624 | } m; |
536 | __u32 length; | 625 | __u32 length; |
537 | __u32 input; | 626 | __u32 input; |
@@ -1622,12 +1711,56 @@ struct v4l2_mpeg_vbi_fmt_ivtv { | |||
1622 | * A G G R E G A T E S T R U C T U R E S | 1711 | * A G G R E G A T E S T R U C T U R E S |
1623 | */ | 1712 | */ |
1624 | 1713 | ||
1625 | /* Stream data format | 1714 | /** |
1715 | * struct v4l2_plane_pix_format - additional, per-plane format definition | ||
1716 | * @sizeimage: maximum size in bytes required for data, for which | ||
1717 | * this plane will be used | ||
1718 | * @bytesperline: distance in bytes between the leftmost pixels in two | ||
1719 | * adjacent lines | ||
1720 | */ | ||
1721 | struct v4l2_plane_pix_format { | ||
1722 | __u32 sizeimage; | ||
1723 | __u16 bytesperline; | ||
1724 | __u16 reserved[7]; | ||
1725 | } __attribute__ ((packed)); | ||
1726 | |||
1727 | /** | ||
1728 | * struct v4l2_pix_format_mplane - multiplanar format definition | ||
1729 | * @width: image width in pixels | ||
1730 | * @height: image height in pixels | ||
1731 | * @pixelformat: little endian four character code (fourcc) | ||
1732 | * @field: field order (for interlaced video) | ||
1733 | * @colorspace: supplemental to pixelformat | ||
1734 | * @plane_fmt: per-plane information | ||
1735 | * @num_planes: number of planes for this format | ||
1736 | */ | ||
1737 | struct v4l2_pix_format_mplane { | ||
1738 | __u32 width; | ||
1739 | __u32 height; | ||
1740 | __u32 pixelformat; | ||
1741 | enum v4l2_field field; | ||
1742 | enum v4l2_colorspace colorspace; | ||
1743 | |||
1744 | struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; | ||
1745 | __u8 num_planes; | ||
1746 | __u8 reserved[11]; | ||
1747 | } __attribute__ ((packed)); | ||
1748 | |||
1749 | /** | ||
1750 | * struct v4l2_format - stream data format | ||
1751 | * @type: type of the data stream | ||
1752 | * @pix: definition of an image format | ||
1753 | * @pix_mp: definition of a multiplanar image format | ||
1754 | * @win: definition of an overlaid image | ||
1755 | * @vbi: raw VBI capture or output parameters | ||
1756 | * @sliced: sliced VBI capture or output parameters | ||
1757 | * @raw_data: placeholder for future extensions and custom formats | ||
1626 | */ | 1758 | */ |
1627 | struct v4l2_format { | 1759 | struct v4l2_format { |
1628 | enum v4l2_buf_type type; | 1760 | enum v4l2_buf_type type; |
1629 | union { | 1761 | union { |
1630 | struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ | 1762 | struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ |
1763 | struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */ | ||
1631 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ | 1764 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ |
1632 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ | 1765 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
1633 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ | 1766 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
@@ -1635,7 +1768,6 @@ struct v4l2_format { | |||
1635 | } fmt; | 1768 | } fmt; |
1636 | }; | 1769 | }; |
1637 | 1770 | ||
1638 | |||
1639 | /* Stream type-dependent parameters | 1771 | /* Stream type-dependent parameters |
1640 | */ | 1772 | */ |
1641 | struct v4l2_streamparm { | 1773 | struct v4l2_streamparm { |
@@ -1808,16 +1940,6 @@ struct v4l2_dbg_chip_ident { | |||
1808 | /* Reminder: when adding new ioctls please add support for them to | 1940 | /* Reminder: when adding new ioctls please add support for them to |
1809 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1941 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
1810 | 1942 | ||
1811 | #ifdef __OLD_VIDIOC_ | ||
1812 | /* for compatibility, will go away some day */ | ||
1813 | #define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int) | ||
1814 | #define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm) | ||
1815 | #define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control) | ||
1816 | #define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio) | ||
1817 | #define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout) | ||
1818 | #define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap) | ||
1819 | #endif | ||
1820 | |||
1821 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ | 1943 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ |
1822 | 1944 | ||
1823 | #endif /* __LINUX_VIDEODEV2_H */ | 1945 | #endif /* __LINUX_VIDEODEV2_H */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 0ead399e08b5..17e7ccc322a5 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | struct backing_dev_info; | 10 | struct backing_dev_info; |
11 | 11 | ||
12 | extern spinlock_t inode_lock; | 12 | extern spinlock_t inode_wb_list_lock; |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * fs/fs-writeback.c | 15 | * fs/fs-writeback.c |