aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-12-16 06:25:38 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-12-16 06:25:38 -0500
commit8ab7913675726e5ae23b91221c0b5442d986d44a (patch)
treef2673dcb25e864cc87abe3f2d58db9bf9730f148 /include/linux
parent864b94adfcba752aa902ee34497bbe58b97aa8d3 (diff)
parent3a5dc1fafb016560315fe45bb4ef8bde259dd1bc (diff)
Merge branch 'x86/vt-d' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu into x86/apic-picks
Required to apply Jiangs x86 irq handling rework without creating a nightmare of conflicts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/atmel-mci.h2
-rw-r--r--include/linux/bitops.h7
-rw-r--r--include/linux/blk-mq.h17
-rw-r--r--include/linux/blkdev.h1
-rw-r--r--include/linux/bootmem.h1
-rw-r--r--include/linux/can/dev.h6
-rw-r--r--include/linux/clk-provider.h1
-rw-r--r--include/linux/clk/ti.h15
-rw-r--r--include/linux/cma.h8
-rw-r--r--include/linux/device-mapper.h2
-rw-r--r--include/linux/edac.h4
-rw-r--r--include/linux/eeprom_93cx6.h4
-rw-r--r--include/linux/efi.h6
-rw-r--r--include/linux/freezer.h50
-rw-r--r--include/linux/i2c/pmbus.h4
-rw-r--r--include/linux/iio/events.h2
-rw-r--r--include/linux/inetdevice.h2
-rw-r--r--include/linux/init_task.h12
-rw-r--r--include/linux/iommu.h22
-rw-r--r--include/linux/irq.h65
-rw-r--r--include/linux/irqdomain.h101
-rw-r--r--include/linux/irqhandler.h14
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/kernel_stat.h5
-rw-r--r--include/linux/kvm_host.h2
-rw-r--r--include/linux/libata.h4
-rw-r--r--include/linux/mbus.h1
-rw-r--r--include/linux/mfd/abx500/ab8500-sysctrl.h1
-rw-r--r--include/linux/mfd/arizona/registers.h50
-rw-r--r--include/linux/mfd/atmel-hlcdc.h85
-rw-r--r--include/linux/mfd/axp20x.h59
-rw-r--r--include/linux/mfd/core.h7
-rw-r--r--include/linux/mfd/dln2.h103
-rw-r--r--include/linux/mfd/max77686.h7
-rw-r--r--include/linux/mfd/max77693-private.h8
-rw-r--r--include/linux/mfd/rtsx_pci.h37
-rw-r--r--include/linux/mfd/samsung/core.h2
-rw-r--r--include/linux/mfd/samsung/s2mps13.h186
-rw-r--r--include/linux/mfd/syscon/imx6q-iomuxc-gpr.h39
-rw-r--r--include/linux/mfd/tc3589x.h8
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/mm_types.h4
-rw-r--r--include/linux/mmc/card.h23
-rw-r--r--include/linux/mmc/core.h3
-rw-r--r--include/linux/mmc/dw_mmc.h7
-rw-r--r--include/linux/mmc/host.h1
-rw-r--r--include/linux/mmc/mmc.h3
-rw-r--r--include/linux/mmc/sdhci.h18
-rw-r--r--include/linux/mmc/sdio_func.h2
-rw-r--r--include/linux/mmzone.h9
-rw-r--r--include/linux/msi.h187
-rw-r--r--include/linux/nfs_xdr.h11
-rw-r--r--include/linux/of.h95
-rw-r--r--include/linux/of_pci.h12
-rw-r--r--include/linux/omap-gpmc.h199
-rw-r--r--include/linux/page-isolation.h8
-rw-r--r--include/linux/pci-acpi.h7
-rw-r--r--include/linux/pci.h3
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/percpu-refcount.h8
-rw-r--r--include/linux/perf_event.h37
-rw-r--r--include/linux/platform_data/hsmmc-omap.h90
-rw-r--r--include/linux/platform_data/mmc-atmel-mci.h22
-rw-r--r--include/linux/platform_data/mmc-omap.h27
-rw-r--r--include/linux/platform_data/pxa_sdhci.h5
-rw-r--r--include/linux/platform_data/serial-omap.h3
-rw-r--r--include/linux/pm_domain.h8
-rw-r--r--include/linux/power/charger-manager.h3
-rw-r--r--include/linux/power_supply.h6
-rw-r--r--include/linux/rcupdate.h19
-rw-r--r--include/linux/rcutiny.h2
-rw-r--r--include/linux/rcutree.h6
-rw-r--r--include/linux/regmap.h7
-rw-r--r--include/linux/regulator/consumer.h6
-rw-r--r--include/linux/regulator/driver.h8
-rw-r--r--include/linux/regulator/of_regulator.h9
-rw-r--r--include/linux/reset-controller.h2
-rw-r--r--include/linux/reset.h7
-rw-r--r--include/linux/ring_buffer.h2
-rw-r--r--include/linux/rtc.h21
-rw-r--r--include/linux/sched.h91
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/time.h17
-rw-r--r--include/linux/timekeeper_internal.h2
-rw-r--r--include/linux/timekeeping.h51
-rw-r--r--include/linux/vexpress.h19
-rw-r--r--include/linux/wait.h80
87 files changed, 1827 insertions, 288 deletions
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h
index 91b77f8d495d..9177947bf032 100644
--- a/include/linux/atmel-mci.h
+++ b/include/linux/atmel-mci.h
@@ -11,6 +11,7 @@
11 * @detect_pin: GPIO pin wired to the card detect switch 11 * @detect_pin: GPIO pin wired to the card detect switch
12 * @wp_pin: GPIO pin wired to the write protect sensor 12 * @wp_pin: GPIO pin wired to the write protect sensor
13 * @detect_is_active_high: The state of the detect pin when it is active 13 * @detect_is_active_high: The state of the detect pin when it is active
14 * @non_removable: The slot is not removable, only detect once
14 * 15 *
15 * If a given slot is not present on the board, @bus_width should be 16 * If a given slot is not present on the board, @bus_width should be
16 * set to 0. The other fields are ignored in this case. 17 * set to 0. The other fields are ignored in this case.
@@ -26,6 +27,7 @@ struct mci_slot_pdata {
26 int detect_pin; 27 int detect_pin;
27 int wp_pin; 28 int wp_pin;
28 bool detect_is_active_high; 29 bool detect_is_active_high;
30 bool non_removable;
29}; 31};
30 32
31/** 33/**
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index be5fd38bd5a0..5d858e02997f 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -18,8 +18,11 @@
18 * position @h. For example 18 * position @h. For example
19 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. 19 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
20 */ 20 */
21#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) 21#define GENMASK(h, l) \
22#define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l)) 22 (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
23
24#define GENMASK_ULL(h, l) \
25 (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
23 26
24extern unsigned int __sw_hweight8(unsigned int w); 27extern unsigned int __sw_hweight8(unsigned int w);
25extern unsigned int __sw_hweight16(unsigned int w); 28extern unsigned int __sw_hweight16(unsigned int w);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index c9be1589415a..15f7034aa377 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -167,6 +167,23 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw,
167 gfp_t gfp, bool reserved); 167 gfp_t gfp, bool reserved);
168struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag); 168struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag);
169 169
170enum {
171 BLK_MQ_UNIQUE_TAG_BITS = 16,
172 BLK_MQ_UNIQUE_TAG_MASK = (1 << BLK_MQ_UNIQUE_TAG_BITS) - 1,
173};
174
175u32 blk_mq_unique_tag(struct request *rq);
176
177static inline u16 blk_mq_unique_tag_to_hwq(u32 unique_tag)
178{
179 return unique_tag >> BLK_MQ_UNIQUE_TAG_BITS;
180}
181
182static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag)
183{
184 return unique_tag & BLK_MQ_UNIQUE_TAG_MASK;
185}
186
170struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index); 187struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index);
171struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int); 188struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int);
172 189
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index aac0f9ea952a..6d76b8b4aa2b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1136,7 +1136,6 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
1136/* 1136/*
1137 * tag stuff 1137 * tag stuff
1138 */ 1138 */
1139#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
1140extern int blk_queue_start_tag(struct request_queue *, struct request *); 1139extern int blk_queue_start_tag(struct request_queue *, struct request *);
1141extern struct request *blk_queue_find_tag(struct request_queue *, int); 1140extern struct request *blk_queue_find_tag(struct request_queue *, int);
1142extern void blk_queue_end_tag(struct request_queue *, struct request *); 1141extern void blk_queue_end_tag(struct request_queue *, struct request *);
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 4e2bd4c95b66..0995c2de8162 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -46,6 +46,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
46extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); 46extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
47 47
48extern unsigned long free_all_bootmem(void); 48extern unsigned long free_all_bootmem(void);
49extern void reset_node_managed_pages(pg_data_t *pgdat);
49extern void reset_all_zones_managed_pages(void); 50extern void reset_all_zones_managed_pages(void);
50 51
51extern void free_bootmem_node(pg_data_t *pgdat, 52extern void free_bootmem_node(pg_data_t *pgdat,
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 6992afc6ba7f..b37ea95bc348 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -99,6 +99,12 @@ inval_skb:
99 return 1; 99 return 1;
100} 100}
101 101
102static inline bool can_is_canfd_skb(const struct sk_buff *skb)
103{
104 /* the CAN specific type of skb is identified by its data length */
105 return skb->len == CANFD_MTU;
106}
107
102/* get data length from can_dlc with sanitized can_dlc */ 108/* get data length from can_dlc with sanitized can_dlc */
103u8 can_dlc2len(u8 can_dlc); 109u8 can_dlc2len(u8 can_dlc);
104 110
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index be21af149f11..2839c639f092 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -352,7 +352,6 @@ struct clk_divider {
352#define CLK_DIVIDER_READ_ONLY BIT(5) 352#define CLK_DIVIDER_READ_ONLY BIT(5)
353 353
354extern const struct clk_ops clk_divider_ops; 354extern const struct clk_ops clk_divider_ops;
355extern const struct clk_ops clk_divider_ro_ops;
356struct clk *clk_register_divider(struct device *dev, const char *name, 355struct clk *clk_register_divider(struct device *dev, const char *name,
357 const char *parent_name, unsigned long flags, 356 const char *parent_name, unsigned long flags,
358 void __iomem *reg, u8 shift, u8 width, 357 void __iomem *reg, u8 shift, u8 width,
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index f75acbf70e96..74e5341463c9 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -254,13 +254,26 @@ extern const struct clk_ops ti_clk_mux_ops;
254void omap2_init_clk_hw_omap_clocks(struct clk *clk); 254void omap2_init_clk_hw_omap_clocks(struct clk *clk);
255int omap3_noncore_dpll_enable(struct clk_hw *hw); 255int omap3_noncore_dpll_enable(struct clk_hw *hw);
256void omap3_noncore_dpll_disable(struct clk_hw *hw); 256void omap3_noncore_dpll_disable(struct clk_hw *hw);
257int omap3_noncore_dpll_set_parent(struct clk_hw *hw, u8 index);
257int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate, 258int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
258 unsigned long parent_rate); 259 unsigned long parent_rate);
260int omap3_noncore_dpll_set_rate_and_parent(struct clk_hw *hw,
261 unsigned long rate,
262 unsigned long parent_rate,
263 u8 index);
264long omap3_noncore_dpll_determine_rate(struct clk_hw *hw,
265 unsigned long rate,
266 unsigned long *best_parent_rate,
267 struct clk **best_parent_clk);
259unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw, 268unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
260 unsigned long parent_rate); 269 unsigned long parent_rate);
261long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw, 270long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
262 unsigned long target_rate, 271 unsigned long target_rate,
263 unsigned long *parent_rate); 272 unsigned long *parent_rate);
273long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw,
274 unsigned long rate,
275 unsigned long *best_parent_rate,
276 struct clk **best_parent_clk);
264u8 omap2_init_dpll_parent(struct clk_hw *hw); 277u8 omap2_init_dpll_parent(struct clk_hw *hw);
265unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate); 278unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
266long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, 279long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
@@ -278,6 +291,8 @@ int omap2_clk_disable_autoidle_all(void);
278void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); 291void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
279int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, 292int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
280 unsigned long parent_rate); 293 unsigned long parent_rate);
294int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate,
295 unsigned long parent_rate, u8 index);
281int omap2_dflt_clk_enable(struct clk_hw *hw); 296int omap2_dflt_clk_enable(struct clk_hw *hw);
282void omap2_dflt_clk_disable(struct clk_hw *hw); 297void omap2_dflt_clk_disable(struct clk_hw *hw);
283int omap2_dflt_clk_is_enabled(struct clk_hw *hw); 298int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
diff --git a/include/linux/cma.h b/include/linux/cma.h
index 0430ed05d3b9..a93438beb33c 100644
--- a/include/linux/cma.h
+++ b/include/linux/cma.h
@@ -18,12 +18,12 @@ struct cma;
18extern phys_addr_t cma_get_base(struct cma *cma); 18extern phys_addr_t cma_get_base(struct cma *cma);
19extern unsigned long cma_get_size(struct cma *cma); 19extern unsigned long cma_get_size(struct cma *cma);
20 20
21extern int __init cma_declare_contiguous(phys_addr_t size, 21extern int __init cma_declare_contiguous(phys_addr_t base,
22 phys_addr_t base, phys_addr_t limit, 22 phys_addr_t size, phys_addr_t limit,
23 phys_addr_t alignment, unsigned int order_per_bit, 23 phys_addr_t alignment, unsigned int order_per_bit,
24 bool fixed, struct cma **res_cma); 24 bool fixed, struct cma **res_cma);
25extern int cma_init_reserved_mem(phys_addr_t size, 25extern int cma_init_reserved_mem(phys_addr_t base,
26 phys_addr_t base, int order_per_bit, 26 phys_addr_t size, int order_per_bit,
27 struct cma **res_cma); 27 struct cma **res_cma);
28extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); 28extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align);
29extern bool cma_release(struct cma *cma, struct page *pages, int count); 29extern bool cma_release(struct cma *cma, struct page *pages, int count);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index e1707de043ae..ca6d2acc5eb7 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -64,6 +64,7 @@ typedef int (*dm_request_endio_fn) (struct dm_target *ti,
64 union map_info *map_context); 64 union map_info *map_context);
65 65
66typedef void (*dm_presuspend_fn) (struct dm_target *ti); 66typedef void (*dm_presuspend_fn) (struct dm_target *ti);
67typedef void (*dm_presuspend_undo_fn) (struct dm_target *ti);
67typedef void (*dm_postsuspend_fn) (struct dm_target *ti); 68typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
68typedef int (*dm_preresume_fn) (struct dm_target *ti); 69typedef int (*dm_preresume_fn) (struct dm_target *ti);
69typedef void (*dm_resume_fn) (struct dm_target *ti); 70typedef void (*dm_resume_fn) (struct dm_target *ti);
@@ -145,6 +146,7 @@ struct target_type {
145 dm_endio_fn end_io; 146 dm_endio_fn end_io;
146 dm_request_endio_fn rq_end_io; 147 dm_request_endio_fn rq_end_io;
147 dm_presuspend_fn presuspend; 148 dm_presuspend_fn presuspend;
149 dm_presuspend_undo_fn presuspend_undo;
148 dm_postsuspend_fn postsuspend; 150 dm_postsuspend_fn postsuspend;
149 dm_preresume_fn preresume; 151 dm_preresume_fn preresume;
150 dm_resume_fn resume; 152 dm_resume_fn resume;
diff --git a/include/linux/edac.h b/include/linux/edac.h
index e1e68da6f35c..da3b72e95db3 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -194,7 +194,8 @@ static inline char *mc_event_error_type(const unsigned int err_type)
194 * @MEM_DDR3: DDR3 RAM 194 * @MEM_DDR3: DDR3 RAM
195 * @MEM_RDDR3: Registered DDR3 RAM 195 * @MEM_RDDR3: Registered DDR3 RAM
196 * This is a variant of the DDR3 memories. 196 * This is a variant of the DDR3 memories.
197 * @MEM_DDR4: DDR4 RAM 197 * @MEM_LRDDR3 Load-Reduced DDR3 memory.
198 * @MEM_DDR4: Unbuffered DDR4 RAM
198 * @MEM_RDDR4: Registered DDR4 RAM 199 * @MEM_RDDR4: Registered DDR4 RAM
199 * This is a variant of the DDR4 memories. 200 * This is a variant of the DDR4 memories.
200 */ 201 */
@@ -216,6 +217,7 @@ enum mem_type {
216 MEM_XDR, 217 MEM_XDR,
217 MEM_DDR3, 218 MEM_DDR3,
218 MEM_RDDR3, 219 MEM_RDDR3,
220 MEM_LRDDR3,
219 MEM_DDR4, 221 MEM_DDR4,
220 MEM_RDDR4, 222 MEM_RDDR4,
221}; 223};
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h
index e50f98b0297a..eb0b1988050a 100644
--- a/include/linux/eeprom_93cx6.h
+++ b/include/linux/eeprom_93cx6.h
@@ -75,6 +75,10 @@ extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
75 const u8 word, u16 *data); 75 const u8 word, u16 *data);
76extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, 76extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
77 const u8 word, __le16 *data, const u16 words); 77 const u8 word, __le16 *data, const u16 words);
78extern void eeprom_93cx6_readb(struct eeprom_93cx6 *eeprom,
79 const u8 byte, u8 *data);
80extern void eeprom_93cx6_multireadb(struct eeprom_93cx6 *eeprom,
81 const u8 byte, u8 *data, const u16 bytes);
78 82
79extern void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable); 83extern void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable);
80 84
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 0949f9c7e872..0238d612750e 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -547,6 +547,9 @@ void efi_native_runtime_setup(void);
547#define SMBIOS_TABLE_GUID \ 547#define SMBIOS_TABLE_GUID \
548 EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) 548 EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
549 549
550#define SMBIOS3_TABLE_GUID \
551 EFI_GUID( 0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94 )
552
550#define SAL_SYSTEM_TABLE_GUID \ 553#define SAL_SYSTEM_TABLE_GUID \
551 EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) 554 EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
552 555
@@ -810,7 +813,8 @@ extern struct efi {
810 unsigned long mps; /* MPS table */ 813 unsigned long mps; /* MPS table */
811 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ 814 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */
812 unsigned long acpi20; /* ACPI table (ACPI 2.0) */ 815 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
813 unsigned long smbios; /* SM BIOS table */ 816 unsigned long smbios; /* SMBIOS table (32 bit entry point) */
817 unsigned long smbios3; /* SMBIOS table (64 bit entry point) */
814 unsigned long sal_systab; /* SAL system table */ 818 unsigned long sal_systab; /* SAL system table */
815 unsigned long boot_info; /* boot info table */ 819 unsigned long boot_info; /* boot info table */
816 unsigned long hcdp; /* HCDP table */ 820 unsigned long hcdp; /* HCDP table */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 7fd81b8c4897..6b7fd9cf5ea2 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -246,15 +246,6 @@ static inline int freezable_schedule_hrtimeout_range(ktime_t *expires,
246 * defined in <linux/wait.h> 246 * defined in <linux/wait.h>
247 */ 247 */
248 248
249#define wait_event_freezekillable(wq, condition) \
250({ \
251 int __retval; \
252 freezer_do_not_count(); \
253 __retval = wait_event_killable(wq, (condition)); \
254 freezer_count(); \
255 __retval; \
256})
257
258/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ 249/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
259#define wait_event_freezekillable_unsafe(wq, condition) \ 250#define wait_event_freezekillable_unsafe(wq, condition) \
260({ \ 251({ \
@@ -265,35 +256,6 @@ static inline int freezable_schedule_hrtimeout_range(ktime_t *expires,
265 __retval; \ 256 __retval; \
266}) 257})
267 258
268#define wait_event_freezable(wq, condition) \
269({ \
270 int __retval; \
271 freezer_do_not_count(); \
272 __retval = wait_event_interruptible(wq, (condition)); \
273 freezer_count(); \
274 __retval; \
275})
276
277#define wait_event_freezable_timeout(wq, condition, timeout) \
278({ \
279 long __retval = timeout; \
280 freezer_do_not_count(); \
281 __retval = wait_event_interruptible_timeout(wq, (condition), \
282 __retval); \
283 freezer_count(); \
284 __retval; \
285})
286
287#define wait_event_freezable_exclusive(wq, condition) \
288({ \
289 int __retval; \
290 freezer_do_not_count(); \
291 __retval = wait_event_interruptible_exclusive(wq, condition); \
292 freezer_count(); \
293 __retval; \
294})
295
296
297#else /* !CONFIG_FREEZER */ 259#else /* !CONFIG_FREEZER */
298static inline bool frozen(struct task_struct *p) { return false; } 260static inline bool frozen(struct task_struct *p) { return false; }
299static inline bool freezing(struct task_struct *p) { return false; } 261static inline bool freezing(struct task_struct *p) { return false; }
@@ -331,18 +293,6 @@ static inline void set_freezable(void) {}
331#define freezable_schedule_hrtimeout_range(expires, delta, mode) \ 293#define freezable_schedule_hrtimeout_range(expires, delta, mode) \
332 schedule_hrtimeout_range(expires, delta, mode) 294 schedule_hrtimeout_range(expires, delta, mode)
333 295
334#define wait_event_freezable(wq, condition) \
335 wait_event_interruptible(wq, condition)
336
337#define wait_event_freezable_timeout(wq, condition, timeout) \
338 wait_event_interruptible_timeout(wq, condition, timeout)
339
340#define wait_event_freezable_exclusive(wq, condition) \
341 wait_event_interruptible_exclusive(wq, condition)
342
343#define wait_event_freezekillable(wq, condition) \
344 wait_event_killable(wq, condition)
345
346#define wait_event_freezekillable_unsafe(wq, condition) \ 296#define wait_event_freezekillable_unsafe(wq, condition) \
347 wait_event_killable(wq, condition) 297 wait_event_killable(wq, condition)
348 298
diff --git a/include/linux/i2c/pmbus.h b/include/linux/i2c/pmbus.h
index 69280db02c41..ee3c2aba2a8e 100644
--- a/include/linux/i2c/pmbus.h
+++ b/include/linux/i2c/pmbus.h
@@ -40,6 +40,10 @@
40 40
41struct pmbus_platform_data { 41struct pmbus_platform_data {
42 u32 flags; /* Device specific flags */ 42 u32 flags; /* Device specific flags */
43
44 /* regulator support */
45 int num_regulators;
46 struct regulator_init_data *reg_init_data;
43}; 47};
44 48
45#endif /* _PMBUS_H_ */ 49#endif /* _PMBUS_H_ */
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h
index 8bbd7bc1043d..03fa332ad2a8 100644
--- a/include/linux/iio/events.h
+++ b/include/linux/iio/events.h
@@ -72,7 +72,7 @@ struct iio_event_data {
72 72
73#define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF) 73#define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF)
74 74
75#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF) 75#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0x7F)
76 76
77#define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF) 77#define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF)
78 78
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 0068708161ff..0a21fbefdfbe 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -242,7 +242,7 @@ static inline void in_dev_put(struct in_device *idev)
242static __inline__ __be32 inet_make_mask(int logmask) 242static __inline__ __be32 inet_make_mask(int logmask)
243{ 243{
244 if (logmask) 244 if (logmask)
245 return htonl(~((1<<(32-logmask))-1)); 245 return htonl(~((1U<<(32-logmask))-1));
246 return 0; 246 return 0;
247} 247}
248 248
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 77fc43f8fb72..3037fc085e8e 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -102,7 +102,7 @@ extern struct group_info init_groups;
102#define INIT_IDS 102#define INIT_IDS
103#endif 103#endif
104 104
105#ifdef CONFIG_TREE_PREEMPT_RCU 105#ifdef CONFIG_PREEMPT_RCU
106#define INIT_TASK_RCU_TREE_PREEMPT() \ 106#define INIT_TASK_RCU_TREE_PREEMPT() \
107 .rcu_blocked_node = NULL, 107 .rcu_blocked_node = NULL,
108#else 108#else
@@ -166,6 +166,15 @@ extern struct task_group root_task_group;
166# define INIT_RT_MUTEXES(tsk) 166# define INIT_RT_MUTEXES(tsk)
167#endif 167#endif
168 168
169#ifdef CONFIG_NUMA_BALANCING
170# define INIT_NUMA_BALANCING(tsk) \
171 .numa_preferred_nid = -1, \
172 .numa_group = NULL, \
173 .numa_faults = NULL,
174#else
175# define INIT_NUMA_BALANCING(tsk)
176#endif
177
169/* 178/*
170 * INIT_TASK is used to set up the first task table, touch at 179 * INIT_TASK is used to set up the first task table, touch at
171 * your own risk!. Base=0, limit=0x1fffff (=2MB) 180 * your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -237,6 +246,7 @@ extern struct task_group root_task_group;
237 INIT_CPUSET_SEQ(tsk) \ 246 INIT_CPUSET_SEQ(tsk) \
238 INIT_RT_MUTEXES(tsk) \ 247 INIT_RT_MUTEXES(tsk) \
239 INIT_VTIME(tsk) \ 248 INIT_VTIME(tsk) \
249 INIT_NUMA_BALANCING(tsk) \
240} 250}
241 251
242 252
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index e6a7c9ff72f2..b29a5982e1c3 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -22,6 +22,7 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/scatterlist.h>
25#include <trace/events/iommu.h> 26#include <trace/events/iommu.h>
26 27
27#define IOMMU_READ (1 << 0) 28#define IOMMU_READ (1 << 0)
@@ -97,6 +98,8 @@ enum iommu_attr {
97 * @detach_dev: detach device from an iommu domain 98 * @detach_dev: detach device from an iommu domain
98 * @map: map a physically contiguous memory region to an iommu domain 99 * @map: map a physically contiguous memory region to an iommu domain
99 * @unmap: unmap a physically contiguous memory region from an iommu domain 100 * @unmap: unmap a physically contiguous memory region from an iommu domain
101 * @map_sg: map a scatter-gather list of physically contiguous memory chunks
102 * to an iommu domain
100 * @iova_to_phys: translate iova to physical address 103 * @iova_to_phys: translate iova to physical address
101 * @add_device: add device to iommu grouping 104 * @add_device: add device to iommu grouping
102 * @remove_device: remove device from iommu grouping 105 * @remove_device: remove device from iommu grouping
@@ -114,6 +117,8 @@ struct iommu_ops {
114 phys_addr_t paddr, size_t size, int prot); 117 phys_addr_t paddr, size_t size, int prot);
115 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, 118 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
116 size_t size); 119 size_t size);
120 size_t (*map_sg)(struct iommu_domain *domain, unsigned long iova,
121 struct scatterlist *sg, unsigned int nents, int prot);
117 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova); 122 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
118 int (*add_device)(struct device *dev); 123 int (*add_device)(struct device *dev);
119 void (*remove_device)(struct device *dev); 124 void (*remove_device)(struct device *dev);
@@ -156,6 +161,9 @@ extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
156 phys_addr_t paddr, size_t size, int prot); 161 phys_addr_t paddr, size_t size, int prot);
157extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, 162extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
158 size_t size); 163 size_t size);
164extern size_t default_iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
165 struct scatterlist *sg,unsigned int nents,
166 int prot);
159extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova); 167extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
160extern void iommu_set_fault_handler(struct iommu_domain *domain, 168extern void iommu_set_fault_handler(struct iommu_domain *domain,
161 iommu_fault_handler_t handler, void *token); 169 iommu_fault_handler_t handler, void *token);
@@ -241,6 +249,13 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
241 return ret; 249 return ret;
242} 250}
243 251
252static inline size_t iommu_map_sg(struct iommu_domain *domain,
253 unsigned long iova, struct scatterlist *sg,
254 unsigned int nents, int prot)
255{
256 return domain->ops->map_sg(domain, iova, sg, nents, prot);
257}
258
244#else /* CONFIG_IOMMU_API */ 259#else /* CONFIG_IOMMU_API */
245 260
246struct iommu_ops {}; 261struct iommu_ops {};
@@ -293,6 +308,13 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
293 return -ENODEV; 308 return -ENODEV;
294} 309}
295 310
311static inline size_t iommu_map_sg(struct iommu_domain *domain,
312 unsigned long iova, struct scatterlist *sg,
313 unsigned int nents, int prot)
314{
315 return -ENODEV;
316}
317
296static inline int iommu_domain_window_enable(struct iommu_domain *domain, 318static inline int iommu_domain_window_enable(struct iommu_domain *domain,
297 u32 wnd_nr, phys_addr_t paddr, 319 u32 wnd_nr, phys_addr_t paddr,
298 u64 size, int prot) 320 u64 size, int prot)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 03f48d936f66..d09ec7a1243e 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -15,11 +15,13 @@
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/cpumask.h> 16#include <linux/cpumask.h>
17#include <linux/gfp.h> 17#include <linux/gfp.h>
18#include <linux/irqhandler.h>
18#include <linux/irqreturn.h> 19#include <linux/irqreturn.h>
19#include <linux/irqnr.h> 20#include <linux/irqnr.h>
20#include <linux/errno.h> 21#include <linux/errno.h>
21#include <linux/topology.h> 22#include <linux/topology.h>
22#include <linux/wait.h> 23#include <linux/wait.h>
24#include <linux/io.h>
23 25
24#include <asm/irq.h> 26#include <asm/irq.h>
25#include <asm/ptrace.h> 27#include <asm/ptrace.h>
@@ -27,11 +29,7 @@
27 29
28struct seq_file; 30struct seq_file;
29struct module; 31struct module;
30struct irq_desc; 32struct msi_msg;
31struct irq_data;
32typedef void (*irq_flow_handler_t)(unsigned int irq,
33 struct irq_desc *desc);
34typedef void (*irq_preflow_handler_t)(struct irq_data *data);
35 33
36/* 34/*
37 * IRQ line status. 35 * IRQ line status.
@@ -113,10 +111,14 @@ enum {
113 * 111 *
114 * IRQ_SET_MASK_OK - OK, core updates irq_data.affinity 112 * IRQ_SET_MASK_OK - OK, core updates irq_data.affinity
115 * IRQ_SET_MASK_NOCPY - OK, chip did update irq_data.affinity 113 * IRQ_SET_MASK_NOCPY - OK, chip did update irq_data.affinity
114 * IRQ_SET_MASK_OK_DONE - Same as IRQ_SET_MASK_OK for core. Special code to
115 * support stacked irqchips, which indicates skipping
116 * all descendent irqchips.
116 */ 117 */
117enum { 118enum {
118 IRQ_SET_MASK_OK = 0, 119 IRQ_SET_MASK_OK = 0,
119 IRQ_SET_MASK_OK_NOCOPY, 120 IRQ_SET_MASK_OK_NOCOPY,
121 IRQ_SET_MASK_OK_DONE,
120}; 122};
121 123
122struct msi_desc; 124struct msi_desc;
@@ -133,6 +135,8 @@ struct irq_domain;
133 * @chip: low level interrupt hardware access 135 * @chip: low level interrupt hardware access
134 * @domain: Interrupt translation domain; responsible for mapping 136 * @domain: Interrupt translation domain; responsible for mapping
135 * between hwirq number and linux irq number. 137 * between hwirq number and linux irq number.
138 * @parent_data: pointer to parent struct irq_data to support hierarchy
139 * irq_domain
136 * @handler_data: per-IRQ data for the irq_chip methods 140 * @handler_data: per-IRQ data for the irq_chip methods
137 * @chip_data: platform-specific per-chip private data for the chip 141 * @chip_data: platform-specific per-chip private data for the chip
138 * methods, to allow shared chip implementations 142 * methods, to allow shared chip implementations
@@ -151,6 +155,9 @@ struct irq_data {
151 unsigned int state_use_accessors; 155 unsigned int state_use_accessors;
152 struct irq_chip *chip; 156 struct irq_chip *chip;
153 struct irq_domain *domain; 157 struct irq_domain *domain;
158#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
159 struct irq_data *parent_data;
160#endif
154 void *handler_data; 161 void *handler_data;
155 void *chip_data; 162 void *chip_data;
156 struct msi_desc *msi_desc; 163 struct msi_desc *msi_desc;
@@ -315,6 +322,8 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
315 * any other callback related to this irq 322 * any other callback related to this irq
316 * @irq_release_resources: optional to release resources acquired with 323 * @irq_release_resources: optional to release resources acquired with
317 * irq_request_resources 324 * irq_request_resources
325 * @irq_compose_msi_msg: optional to compose message content for MSI
326 * @irq_write_msi_msg: optional to write message content for MSI
318 * @flags: chip specific flags 327 * @flags: chip specific flags
319 */ 328 */
320struct irq_chip { 329struct irq_chip {
@@ -351,6 +360,9 @@ struct irq_chip {
351 int (*irq_request_resources)(struct irq_data *data); 360 int (*irq_request_resources)(struct irq_data *data);
352 void (*irq_release_resources)(struct irq_data *data); 361 void (*irq_release_resources)(struct irq_data *data);
353 362
363 void (*irq_compose_msi_msg)(struct irq_data *data, struct msi_msg *msg);
364 void (*irq_write_msi_msg)(struct irq_data *data, struct msi_msg *msg);
365
354 unsigned long flags; 366 unsigned long flags;
355}; 367};
356 368
@@ -438,6 +450,18 @@ extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
438extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); 450extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
439extern void handle_nested_irq(unsigned int irq); 451extern void handle_nested_irq(unsigned int irq);
440 452
453extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
454#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
455extern void irq_chip_ack_parent(struct irq_data *data);
456extern int irq_chip_retrigger_hierarchy(struct irq_data *data);
457extern void irq_chip_mask_parent(struct irq_data *data);
458extern void irq_chip_unmask_parent(struct irq_data *data);
459extern void irq_chip_eoi_parent(struct irq_data *data);
460extern int irq_chip_set_affinity_parent(struct irq_data *data,
461 const struct cpumask *dest,
462 bool force);
463#endif
464
441/* Handling of unhandled and spurious interrupts: */ 465/* Handling of unhandled and spurious interrupts: */
442extern void note_interrupt(unsigned int irq, struct irq_desc *desc, 466extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
443 irqreturn_t action_ret); 467 irqreturn_t action_ret);
@@ -639,13 +663,6 @@ void arch_teardown_hwirq(unsigned int irq);
639void irq_init_desc(unsigned int irq); 663void irq_init_desc(unsigned int irq);
640#endif 664#endif
641 665
642#ifndef irq_reg_writel
643# define irq_reg_writel(val, addr) writel(val, addr)
644#endif
645#ifndef irq_reg_readl
646# define irq_reg_readl(addr) readl(addr)
647#endif
648
649/** 666/**
650 * struct irq_chip_regs - register offsets for struct irq_gci 667 * struct irq_chip_regs - register offsets for struct irq_gci
651 * @enable: Enable register offset to reg_base 668 * @enable: Enable register offset to reg_base
@@ -692,6 +709,8 @@ struct irq_chip_type {
692 * struct irq_chip_generic - Generic irq chip data structure 709 * struct irq_chip_generic - Generic irq chip data structure
693 * @lock: Lock to protect register and cache data access 710 * @lock: Lock to protect register and cache data access
694 * @reg_base: Register base address (virtual) 711 * @reg_base: Register base address (virtual)
712 * @reg_readl: Alternate I/O accessor (defaults to readl if NULL)
713 * @reg_writel: Alternate I/O accessor (defaults to writel if NULL)
695 * @irq_base: Interrupt base nr for this chip 714 * @irq_base: Interrupt base nr for this chip
696 * @irq_cnt: Number of interrupts handled by this chip 715 * @irq_cnt: Number of interrupts handled by this chip
697 * @mask_cache: Cached mask register shared between all chip types 716 * @mask_cache: Cached mask register shared between all chip types
@@ -716,6 +735,8 @@ struct irq_chip_type {
716struct irq_chip_generic { 735struct irq_chip_generic {
717 raw_spinlock_t lock; 736 raw_spinlock_t lock;
718 void __iomem *reg_base; 737 void __iomem *reg_base;
738 u32 (*reg_readl)(void __iomem *addr);
739 void (*reg_writel)(u32 val, void __iomem *addr);
719 unsigned int irq_base; 740 unsigned int irq_base;
720 unsigned int irq_cnt; 741 unsigned int irq_cnt;
721 u32 mask_cache; 742 u32 mask_cache;
@@ -740,12 +761,14 @@ struct irq_chip_generic {
740 * the parent irq. Usually GPIO implementations 761 * the parent irq. Usually GPIO implementations
741 * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private 762 * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private
742 * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask 763 * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask
764 * @IRQ_GC_BE_IO: Use big-endian register accesses (default: LE)
743 */ 765 */
744enum irq_gc_flags { 766enum irq_gc_flags {
745 IRQ_GC_INIT_MASK_CACHE = 1 << 0, 767 IRQ_GC_INIT_MASK_CACHE = 1 << 0,
746 IRQ_GC_INIT_NESTED_LOCK = 1 << 1, 768 IRQ_GC_INIT_NESTED_LOCK = 1 << 1,
747 IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2, 769 IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2,
748 IRQ_GC_NO_MASK = 1 << 3, 770 IRQ_GC_NO_MASK = 1 << 3,
771 IRQ_GC_BE_IO = 1 << 4,
749}; 772};
750 773
751/* 774/*
@@ -821,4 +844,22 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
821static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } 844static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
822#endif 845#endif
823 846
847static inline void irq_reg_writel(struct irq_chip_generic *gc,
848 u32 val, int reg_offset)
849{
850 if (gc->reg_writel)
851 gc->reg_writel(val, gc->reg_base + reg_offset);
852 else
853 writel(val, gc->reg_base + reg_offset);
854}
855
856static inline u32 irq_reg_readl(struct irq_chip_generic *gc,
857 int reg_offset)
858{
859 if (gc->reg_readl)
860 return gc->reg_readl(gc->reg_base + reg_offset);
861 else
862 return readl(gc->reg_base + reg_offset);
863}
864
824#endif /* _LINUX_IRQ_H */ 865#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index b0f9d16e48f6..676d7306a360 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -33,11 +33,14 @@
33#define _LINUX_IRQDOMAIN_H 33#define _LINUX_IRQDOMAIN_H
34 34
35#include <linux/types.h> 35#include <linux/types.h>
36#include <linux/irqhandler.h>
36#include <linux/radix-tree.h> 37#include <linux/radix-tree.h>
37 38
38struct device_node; 39struct device_node;
39struct irq_domain; 40struct irq_domain;
40struct of_device_id; 41struct of_device_id;
42struct irq_chip;
43struct irq_data;
41 44
42/* Number of irqs reserved for a legacy isa controller */ 45/* Number of irqs reserved for a legacy isa controller */
43#define NUM_ISA_INTERRUPTS 16 46#define NUM_ISA_INTERRUPTS 16
@@ -64,6 +67,16 @@ struct irq_domain_ops {
64 int (*xlate)(struct irq_domain *d, struct device_node *node, 67 int (*xlate)(struct irq_domain *d, struct device_node *node,
65 const u32 *intspec, unsigned int intsize, 68 const u32 *intspec, unsigned int intsize,
66 unsigned long *out_hwirq, unsigned int *out_type); 69 unsigned long *out_hwirq, unsigned int *out_type);
70
71#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
72 /* extended V2 interfaces to support hierarchy irq_domains */
73 int (*alloc)(struct irq_domain *d, unsigned int virq,
74 unsigned int nr_irqs, void *arg);
75 void (*free)(struct irq_domain *d, unsigned int virq,
76 unsigned int nr_irqs);
77 void (*activate)(struct irq_domain *d, struct irq_data *irq_data);
78 void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data);
79#endif
67}; 80};
68 81
69extern struct irq_domain_ops irq_generic_chip_ops; 82extern struct irq_domain_ops irq_generic_chip_ops;
@@ -77,6 +90,7 @@ struct irq_domain_chip_generic;
77 * @ops: pointer to irq_domain methods 90 * @ops: pointer to irq_domain methods
78 * @host_data: private data pointer for use by owner. Not touched by irq_domain 91 * @host_data: private data pointer for use by owner. Not touched by irq_domain
79 * core code. 92 * core code.
93 * @flags: host per irq_domain flags
80 * 94 *
81 * Optional elements 95 * Optional elements
82 * @of_node: Pointer to device tree nodes associated with the irq_domain. Used 96 * @of_node: Pointer to device tree nodes associated with the irq_domain. Used
@@ -84,6 +98,7 @@ struct irq_domain_chip_generic;
84 * @gc: Pointer to a list of generic chips. There is a helper function for 98 * @gc: Pointer to a list of generic chips. There is a helper function for
85 * setting up one or more generic chips for interrupt controllers 99 * setting up one or more generic chips for interrupt controllers
86 * drivers using the generic chip library which uses this pointer. 100 * drivers using the generic chip library which uses this pointer.
101 * @parent: Pointer to parent irq_domain to support hierarchy irq_domains
87 * 102 *
88 * Revmap data, used internally by irq_domain 103 * Revmap data, used internally by irq_domain
89 * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that 104 * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that
@@ -97,10 +112,14 @@ struct irq_domain {
97 const char *name; 112 const char *name;
98 const struct irq_domain_ops *ops; 113 const struct irq_domain_ops *ops;
99 void *host_data; 114 void *host_data;
115 unsigned int flags;
100 116
101 /* Optional data */ 117 /* Optional data */
102 struct device_node *of_node; 118 struct device_node *of_node;
103 struct irq_domain_chip_generic *gc; 119 struct irq_domain_chip_generic *gc;
120#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
121 struct irq_domain *parent;
122#endif
104 123
105 /* reverse map data. The linear map gets appended to the irq_domain */ 124 /* reverse map data. The linear map gets appended to the irq_domain */
106 irq_hw_number_t hwirq_max; 125 irq_hw_number_t hwirq_max;
@@ -110,6 +129,22 @@ struct irq_domain {
110 unsigned int linear_revmap[]; 129 unsigned int linear_revmap[];
111}; 130};
112 131
132/* Irq domain flags */
133enum {
134 /* Irq domain is hierarchical */
135 IRQ_DOMAIN_FLAG_HIERARCHY = (1 << 0),
136
137 /* Core calls alloc/free recursive through the domain hierarchy. */
138 IRQ_DOMAIN_FLAG_AUTO_RECURSIVE = (1 << 1),
139
140 /*
141 * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
142 * for implementation specific purposes and ignored by the
143 * core code.
144 */
145 IRQ_DOMAIN_FLAG_NONCORE = (1 << 16),
146};
147
113#ifdef CONFIG_IRQ_DOMAIN 148#ifdef CONFIG_IRQ_DOMAIN
114struct irq_domain *__irq_domain_add(struct device_node *of_node, int size, 149struct irq_domain *__irq_domain_add(struct device_node *of_node, int size,
115 irq_hw_number_t hwirq_max, int direct_max, 150 irq_hw_number_t hwirq_max, int direct_max,
@@ -220,8 +255,74 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr,
220 const u32 *intspec, unsigned int intsize, 255 const u32 *intspec, unsigned int intsize,
221 irq_hw_number_t *out_hwirq, unsigned int *out_type); 256 irq_hw_number_t *out_hwirq, unsigned int *out_type);
222 257
258/* V2 interfaces to support hierarchy IRQ domains. */
259extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
260 unsigned int virq);
261#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
262extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent,
263 unsigned int flags, unsigned int size,
264 struct device_node *node,
265 const struct irq_domain_ops *ops, void *host_data);
266extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
267 unsigned int nr_irqs, int node, void *arg,
268 bool realloc);
269extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs);
270extern void irq_domain_activate_irq(struct irq_data *irq_data);
271extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
272
273static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
274 unsigned int nr_irqs, int node, void *arg)
275{
276 return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false);
277}
278
279extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain,
280 unsigned int virq,
281 irq_hw_number_t hwirq,
282 struct irq_chip *chip,
283 void *chip_data);
284extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
285 irq_hw_number_t hwirq, struct irq_chip *chip,
286 void *chip_data, irq_flow_handler_t handler,
287 void *handler_data, const char *handler_name);
288extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
289extern void irq_domain_free_irqs_common(struct irq_domain *domain,
290 unsigned int virq,
291 unsigned int nr_irqs);
292extern void irq_domain_free_irqs_top(struct irq_domain *domain,
293 unsigned int virq, unsigned int nr_irqs);
294
295extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain,
296 unsigned int irq_base,
297 unsigned int nr_irqs, void *arg);
298
299extern void irq_domain_free_irqs_parent(struct irq_domain *domain,
300 unsigned int irq_base,
301 unsigned int nr_irqs);
302
303static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
304{
305 return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY;
306}
307#else /* CONFIG_IRQ_DOMAIN_HIERARCHY */
308static inline void irq_domain_activate_irq(struct irq_data *data) { }
309static inline void irq_domain_deactivate_irq(struct irq_data *data) { }
310static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
311 unsigned int nr_irqs, int node, void *arg)
312{
313 return -1;
314}
315
316static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
317{
318 return false;
319}
320#endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
321
223#else /* CONFIG_IRQ_DOMAIN */ 322#else /* CONFIG_IRQ_DOMAIN */
224static inline void irq_dispose_mapping(unsigned int virq) { } 323static inline void irq_dispose_mapping(unsigned int virq) { }
324static inline void irq_domain_activate_irq(struct irq_data *data) { }
325static inline void irq_domain_deactivate_irq(struct irq_data *data) { }
225#endif /* !CONFIG_IRQ_DOMAIN */ 326#endif /* !CONFIG_IRQ_DOMAIN */
226 327
227#endif /* _LINUX_IRQDOMAIN_H */ 328#endif /* _LINUX_IRQDOMAIN_H */
diff --git a/include/linux/irqhandler.h b/include/linux/irqhandler.h
new file mode 100644
index 000000000000..62d543004197
--- /dev/null
+++ b/include/linux/irqhandler.h
@@ -0,0 +1,14 @@
1#ifndef _LINUX_IRQHANDLER_H
2#define _LINUX_IRQHANDLER_H
3
4/*
5 * Interrupt flow handler typedefs are defined here to avoid circular
6 * include dependencies.
7 */
8
9struct irq_desc;
10struct irq_data;
11typedef void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc);
12typedef void (*irq_preflow_handler_t)(struct irq_data *data);
13
14#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 3d770f5564b8..446d76a87ba1 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -162,6 +162,7 @@ extern int _cond_resched(void);
162#endif 162#endif
163 163
164#ifdef CONFIG_DEBUG_ATOMIC_SLEEP 164#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
165 void ___might_sleep(const char *file, int line, int preempt_offset);
165 void __might_sleep(const char *file, int line, int preempt_offset); 166 void __might_sleep(const char *file, int line, int preempt_offset);
166/** 167/**
167 * might_sleep - annotation for functions that can sleep 168 * might_sleep - annotation for functions that can sleep
@@ -175,10 +176,14 @@ extern int _cond_resched(void);
175 */ 176 */
176# define might_sleep() \ 177# define might_sleep() \
177 do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) 178 do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
179# define sched_annotate_sleep() __set_current_state(TASK_RUNNING)
178#else 180#else
181 static inline void ___might_sleep(const char *file, int line,
182 int preempt_offset) { }
179 static inline void __might_sleep(const char *file, int line, 183 static inline void __might_sleep(const char *file, int line,
180 int preempt_offset) { } 184 int preempt_offset) { }
181# define might_sleep() do { might_resched(); } while (0) 185# define might_sleep() do { might_resched(); } while (0)
186# define sched_annotate_sleep() do { } while (0)
182#endif 187#endif
183 188
184#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) 189#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 8422b4ed6882..b9376cd5a187 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -77,11 +77,6 @@ static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
77 return kstat_cpu(cpu).irqs_sum; 77 return kstat_cpu(cpu).irqs_sum;
78} 78}
79 79
80/*
81 * Lock/unlock the current runqueue - to extract task statistics:
82 */
83extern unsigned long long task_delta_exec(struct task_struct *);
84
85extern void account_user_time(struct task_struct *, cputime_t, cputime_t); 80extern void account_user_time(struct task_struct *, cputime_t, cputime_t);
86extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t); 81extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t);
87extern void account_steal_time(cputime_t); 82extern void account_steal_time(cputime_t);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ea53b04993f2..a6059bdf7b03 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -703,7 +703,7 @@ void kvm_arch_sync_events(struct kvm *kvm);
703int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); 703int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
704void kvm_vcpu_kick(struct kvm_vcpu *vcpu); 704void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
705 705
706bool kvm_is_mmio_pfn(pfn_t pfn); 706bool kvm_is_reserved_pfn(pfn_t pfn);
707 707
708struct kvm_irq_ack_notifier { 708struct kvm_irq_ack_notifier {
709 struct hlist_node link; 709 struct hlist_node link;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index bd5fefeaf548..bfbc817c34ee 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1191,9 +1191,9 @@ extern void ata_scsi_unlock_native_capacity(struct scsi_device *sdev);
1191extern int ata_scsi_slave_config(struct scsi_device *sdev); 1191extern int ata_scsi_slave_config(struct scsi_device *sdev);
1192extern void ata_scsi_slave_destroy(struct scsi_device *sdev); 1192extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
1193extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 1193extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
1194 int queue_depth, int reason); 1194 int queue_depth);
1195extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, 1195extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
1196 int queue_depth, int reason); 1196 int queue_depth);
1197extern struct ata_device *ata_dev_pair(struct ata_device *adev); 1197extern struct ata_device *ata_dev_pair(struct ata_device *adev);
1198extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); 1198extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
1199extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); 1199extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index 550c88fb0267..611b69fa8594 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -61,6 +61,7 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
61} 61}
62#endif 62#endif
63 63
64int mvebu_mbus_save_cpu_target(u32 *store_addr);
64void mvebu_mbus_get_pcie_mem_aperture(struct resource *res); 65void mvebu_mbus_get_pcie_mem_aperture(struct resource *res);
65void mvebu_mbus_get_pcie_io_aperture(struct resource *res); 66void mvebu_mbus_get_pcie_io_aperture(struct resource *res);
66int mvebu_mbus_add_window_remap_by_id(unsigned int target, 67int mvebu_mbus_add_window_remap_by_id(unsigned int target,
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h
index adba89d9c660..689312745b2f 100644
--- a/include/linux/mfd/abx500/ab8500-sysctrl.h
+++ b/include/linux/mfd/abx500/ab8500-sysctrl.h
@@ -12,7 +12,6 @@
12 12
13int ab8500_sysctrl_read(u16 reg, u8 *value); 13int ab8500_sysctrl_read(u16 reg, u8 *value);
14int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value); 14int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value);
15void ab8500_restart(char mode, const char *cmd);
16 15
17#else 16#else
18 17
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index c0b075f6bc35..aacc10d7789c 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -125,6 +125,8 @@
125#define ARIZONA_MIC_BIAS_CTRL_1 0x218 125#define ARIZONA_MIC_BIAS_CTRL_1 0x218
126#define ARIZONA_MIC_BIAS_CTRL_2 0x219 126#define ARIZONA_MIC_BIAS_CTRL_2 0x219
127#define ARIZONA_MIC_BIAS_CTRL_3 0x21A 127#define ARIZONA_MIC_BIAS_CTRL_3 0x21A
128#define ARIZONA_HP_CTRL_1L 0x225
129#define ARIZONA_HP_CTRL_1R 0x226
128#define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293 130#define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293
129#define ARIZONA_HEADPHONE_DETECT_1 0x29B 131#define ARIZONA_HEADPHONE_DETECT_1 0x29B
130#define ARIZONA_HEADPHONE_DETECT_2 0x29C 132#define ARIZONA_HEADPHONE_DETECT_2 0x29C
@@ -279,8 +281,16 @@
279#define ARIZONA_AIF2_FRAME_CTRL_2 0x548 281#define ARIZONA_AIF2_FRAME_CTRL_2 0x548
280#define ARIZONA_AIF2_FRAME_CTRL_3 0x549 282#define ARIZONA_AIF2_FRAME_CTRL_3 0x549
281#define ARIZONA_AIF2_FRAME_CTRL_4 0x54A 283#define ARIZONA_AIF2_FRAME_CTRL_4 0x54A
284#define ARIZONA_AIF2_FRAME_CTRL_5 0x54B
285#define ARIZONA_AIF2_FRAME_CTRL_6 0x54C
286#define ARIZONA_AIF2_FRAME_CTRL_7 0x54D
287#define ARIZONA_AIF2_FRAME_CTRL_8 0x54E
282#define ARIZONA_AIF2_FRAME_CTRL_11 0x551 288#define ARIZONA_AIF2_FRAME_CTRL_11 0x551
283#define ARIZONA_AIF2_FRAME_CTRL_12 0x552 289#define ARIZONA_AIF2_FRAME_CTRL_12 0x552
290#define ARIZONA_AIF2_FRAME_CTRL_13 0x553
291#define ARIZONA_AIF2_FRAME_CTRL_14 0x554
292#define ARIZONA_AIF2_FRAME_CTRL_15 0x555
293#define ARIZONA_AIF2_FRAME_CTRL_16 0x556
284#define ARIZONA_AIF2_TX_ENABLES 0x559 294#define ARIZONA_AIF2_TX_ENABLES 0x559
285#define ARIZONA_AIF2_RX_ENABLES 0x55A 295#define ARIZONA_AIF2_RX_ENABLES 0x55A
286#define ARIZONA_AIF2_FORCE_WRITE 0x55B 296#define ARIZONA_AIF2_FORCE_WRITE 0x55B
@@ -2245,6 +2255,46 @@
2245#define ARIZONA_MICB3_ENA_WIDTH 1 /* MICB3_ENA */ 2255#define ARIZONA_MICB3_ENA_WIDTH 1 /* MICB3_ENA */
2246 2256
2247/* 2257/*
2258 * R549 (0x225) - HP Ctrl 1L
2259 */
2260#define ARIZONA_RMV_SHRT_HP1L 0x4000 /* RMV_SHRT_HP1L */
2261#define ARIZONA_RMV_SHRT_HP1L_MASK 0x4000 /* RMV_SHRT_HP1L */
2262#define ARIZONA_RMV_SHRT_HP1L_SHIFT 14 /* RMV_SHRT_HP1L */
2263#define ARIZONA_RMV_SHRT_HP1L_WIDTH 1 /* RMV_SHRT_HP1L */
2264#define ARIZONA_HP1L_FLWR 0x0004 /* HP1L_FLWR */
2265#define ARIZONA_HP1L_FLWR_MASK 0x0004 /* HP1L_FLWR */
2266#define ARIZONA_HP1L_FLWR_SHIFT 2 /* HP1L_FLWR */
2267#define ARIZONA_HP1L_FLWR_WIDTH 1 /* HP1L_FLWR */
2268#define ARIZONA_HP1L_SHRTI 0x0002 /* HP1L_SHRTI */
2269#define ARIZONA_HP1L_SHRTI_MASK 0x0002 /* HP1L_SHRTI */
2270#define ARIZONA_HP1L_SHRTI_SHIFT 1 /* HP1L_SHRTI */
2271#define ARIZONA_HP1L_SHRTI_WIDTH 1 /* HP1L_SHRTI */
2272#define ARIZONA_HP1L_SHRTO 0x0001 /* HP1L_SHRTO */
2273#define ARIZONA_HP1L_SHRTO_MASK 0x0001 /* HP1L_SHRTO */
2274#define ARIZONA_HP1L_SHRTO_SHIFT 0 /* HP1L_SHRTO */
2275#define ARIZONA_HP1L_SHRTO_WIDTH 1 /* HP1L_SHRTO */
2276
2277/*
2278 * R550 (0x226) - HP Ctrl 1R
2279 */
2280#define ARIZONA_RMV_SHRT_HP1R 0x4000 /* RMV_SHRT_HP1R */
2281#define ARIZONA_RMV_SHRT_HP1R_MASK 0x4000 /* RMV_SHRT_HP1R */
2282#define ARIZONA_RMV_SHRT_HP1R_SHIFT 14 /* RMV_SHRT_HP1R */
2283#define ARIZONA_RMV_SHRT_HP1R_WIDTH 1 /* RMV_SHRT_HP1R */
2284#define ARIZONA_HP1R_FLWR 0x0004 /* HP1R_FLWR */
2285#define ARIZONA_HP1R_FLWR_MASK 0x0004 /* HP1R_FLWR */
2286#define ARIZONA_HP1R_FLWR_SHIFT 2 /* HP1R_FLWR */
2287#define ARIZONA_HP1R_FLWR_WIDTH 1 /* HP1R_FLWR */
2288#define ARIZONA_HP1R_SHRTI 0x0002 /* HP1R_SHRTI */
2289#define ARIZONA_HP1R_SHRTI_MASK 0x0002 /* HP1R_SHRTI */
2290#define ARIZONA_HP1R_SHRTI_SHIFT 1 /* HP1R_SHRTI */
2291#define ARIZONA_HP1R_SHRTI_WIDTH 1 /* HP1R_SHRTI */
2292#define ARIZONA_HP1R_SHRTO 0x0001 /* HP1R_SHRTO */
2293#define ARIZONA_HP1R_SHRTO_MASK 0x0001 /* HP1R_SHRTO */
2294#define ARIZONA_HP1R_SHRTO_SHIFT 0 /* HP1R_SHRTO */
2295#define ARIZONA_HP1R_SHRTO_WIDTH 1 /* HP1R_SHRTO */
2296
2297/*
2248 * R659 (0x293) - Accessory Detect Mode 1 2298 * R659 (0x293) - Accessory Detect Mode 1
2249 */ 2299 */
2250#define ARIZONA_ACCDET_SRC 0x2000 /* ACCDET_SRC */ 2300#define ARIZONA_ACCDET_SRC 0x2000 /* ACCDET_SRC */
diff --git a/include/linux/mfd/atmel-hlcdc.h b/include/linux/mfd/atmel-hlcdc.h
new file mode 100644
index 000000000000..1279ab1644b5
--- /dev/null
+++ b/include/linux/mfd/atmel-hlcdc.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) 2014 Free Electrons
3 * Copyright (C) 2014 Atmel
4 *
5 * Author: Boris BREZILLON <boris.brezillon@free-electrons.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __LINUX_MFD_HLCDC_H
21#define __LINUX_MFD_HLCDC_H
22
23#include <linux/clk.h>
24#include <linux/regmap.h>
25
26#define ATMEL_HLCDC_CFG(i) ((i) * 0x4)
27#define ATMEL_HLCDC_SIG_CFG LCDCFG(5)
28#define ATMEL_HLCDC_HSPOL BIT(0)
29#define ATMEL_HLCDC_VSPOL BIT(1)
30#define ATMEL_HLCDC_VSPDLYS BIT(2)
31#define ATMEL_HLCDC_VSPDLYE BIT(3)
32#define ATMEL_HLCDC_DISPPOL BIT(4)
33#define ATMEL_HLCDC_DITHER BIT(6)
34#define ATMEL_HLCDC_DISPDLY BIT(7)
35#define ATMEL_HLCDC_MODE_MASK GENMASK(9, 8)
36#define ATMEL_HLCDC_PP BIT(10)
37#define ATMEL_HLCDC_VSPSU BIT(12)
38#define ATMEL_HLCDC_VSPHO BIT(13)
39#define ATMEL_HLCDC_GUARDTIME_MASK GENMASK(20, 16)
40
41#define ATMEL_HLCDC_EN 0x20
42#define ATMEL_HLCDC_DIS 0x24
43#define ATMEL_HLCDC_SR 0x28
44#define ATMEL_HLCDC_IER 0x2c
45#define ATMEL_HLCDC_IDR 0x30
46#define ATMEL_HLCDC_IMR 0x34
47#define ATMEL_HLCDC_ISR 0x38
48
49#define ATMEL_HLCDC_CLKPOL BIT(0)
50#define ATMEL_HLCDC_CLKSEL BIT(2)
51#define ATMEL_HLCDC_CLKPWMSEL BIT(3)
52#define ATMEL_HLCDC_CGDIS(i) BIT(8 + (i))
53#define ATMEL_HLCDC_CLKDIV_SHFT 16
54#define ATMEL_HLCDC_CLKDIV_MASK GENMASK(23, 16)
55#define ATMEL_HLCDC_CLKDIV(div) ((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT)
56
57#define ATMEL_HLCDC_PIXEL_CLK BIT(0)
58#define ATMEL_HLCDC_SYNC BIT(1)
59#define ATMEL_HLCDC_DISP BIT(2)
60#define ATMEL_HLCDC_PWM BIT(3)
61#define ATMEL_HLCDC_SIP BIT(4)
62
63#define ATMEL_HLCDC_SOF BIT(0)
64#define ATMEL_HLCDC_SYNCDIS BIT(1)
65#define ATMEL_HLCDC_FIFOERR BIT(4)
66#define ATMEL_HLCDC_LAYER_STATUS(x) BIT((x) + 8)
67
68/**
69 * Structure shared by the MFD device and its subdevices.
70 *
71 * @regmap: register map used to access HLCDC IP registers
72 * @periph_clk: the hlcdc peripheral clock
73 * @sys_clk: the hlcdc system clock
74 * @slow_clk: the system slow clk
75 * @irq: the hlcdc irq
76 */
77struct atmel_hlcdc {
78 struct regmap *regmap;
79 struct clk *periph_clk;
80 struct clk *sys_clk;
81 struct clk *slow_clk;
82 int irq;
83};
84
85#endif /* __LINUX_MFD_HLCDC_H */
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index d0e31a2287ac..81589d176ae8 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -14,6 +14,8 @@
14enum { 14enum {
15 AXP202_ID = 0, 15 AXP202_ID = 0,
16 AXP209_ID, 16 AXP209_ID,
17 AXP288_ID,
18 NR_AXP20X_VARIANTS,
17}; 19};
18 20
19#define AXP20X_DATACACHE(m) (0x04 + (m)) 21#define AXP20X_DATACACHE(m) (0x04 + (m))
@@ -49,11 +51,13 @@ enum {
49#define AXP20X_IRQ3_EN 0x42 51#define AXP20X_IRQ3_EN 0x42
50#define AXP20X_IRQ4_EN 0x43 52#define AXP20X_IRQ4_EN 0x43
51#define AXP20X_IRQ5_EN 0x44 53#define AXP20X_IRQ5_EN 0x44
54#define AXP20X_IRQ6_EN 0x45
52#define AXP20X_IRQ1_STATE 0x48 55#define AXP20X_IRQ1_STATE 0x48
53#define AXP20X_IRQ2_STATE 0x49 56#define AXP20X_IRQ2_STATE 0x49
54#define AXP20X_IRQ3_STATE 0x4a 57#define AXP20X_IRQ3_STATE 0x4a
55#define AXP20X_IRQ4_STATE 0x4b 58#define AXP20X_IRQ4_STATE 0x4b
56#define AXP20X_IRQ5_STATE 0x4c 59#define AXP20X_IRQ5_STATE 0x4c
60#define AXP20X_IRQ6_STATE 0x4d
57 61
58/* ADC */ 62/* ADC */
59#define AXP20X_ACIN_V_ADC_H 0x56 63#define AXP20X_ACIN_V_ADC_H 0x56
@@ -116,6 +120,15 @@ enum {
116#define AXP20X_CC_CTRL 0xb8 120#define AXP20X_CC_CTRL 0xb8
117#define AXP20X_FG_RES 0xb9 121#define AXP20X_FG_RES 0xb9
118 122
123/* AXP288 specific registers */
124#define AXP288_PMIC_ADC_H 0x56
125#define AXP288_PMIC_ADC_L 0x57
126#define AXP288_ADC_TS_PIN_CTRL 0x84
127
128#define AXP288_PMIC_ADC_EN 0x84
129#define AXP288_FG_TUNE5 0xed
130
131
119/* Regulators IDs */ 132/* Regulators IDs */
120enum { 133enum {
121 AXP20X_LDO1 = 0, 134 AXP20X_LDO1 = 0,
@@ -169,12 +182,58 @@ enum {
169 AXP20X_IRQ_GPIO0_INPUT, 182 AXP20X_IRQ_GPIO0_INPUT,
170}; 183};
171 184
185enum axp288_irqs {
186 AXP288_IRQ_VBUS_FALL = 2,
187 AXP288_IRQ_VBUS_RISE,
188 AXP288_IRQ_OV,
189 AXP288_IRQ_FALLING_ALT,
190 AXP288_IRQ_RISING_ALT,
191 AXP288_IRQ_OV_ALT,
192 AXP288_IRQ_DONE = 10,
193 AXP288_IRQ_CHARGING,
194 AXP288_IRQ_SAFE_QUIT,
195 AXP288_IRQ_SAFE_ENTER,
196 AXP288_IRQ_ABSENT,
197 AXP288_IRQ_APPEND,
198 AXP288_IRQ_QWBTU,
199 AXP288_IRQ_WBTU,
200 AXP288_IRQ_QWBTO,
201 AXP288_IRQ_WBTO,
202 AXP288_IRQ_QCBTU,
203 AXP288_IRQ_CBTU,
204 AXP288_IRQ_QCBTO,
205 AXP288_IRQ_CBTO,
206 AXP288_IRQ_WL2,
207 AXP288_IRQ_WL1,
208 AXP288_IRQ_GPADC,
209 AXP288_IRQ_OT = 31,
210 AXP288_IRQ_GPIO0,
211 AXP288_IRQ_GPIO1,
212 AXP288_IRQ_POKO,
213 AXP288_IRQ_POKL,
214 AXP288_IRQ_POKS,
215 AXP288_IRQ_POKN,
216 AXP288_IRQ_POKP,
217 AXP288_IRQ_TIMER,
218 AXP288_IRQ_MV_CHNG,
219 AXP288_IRQ_BC_USB_CHNG,
220};
221
222#define AXP288_TS_ADC_H 0x58
223#define AXP288_TS_ADC_L 0x59
224#define AXP288_GP_ADC_H 0x5a
225#define AXP288_GP_ADC_L 0x5b
226
172struct axp20x_dev { 227struct axp20x_dev {
173 struct device *dev; 228 struct device *dev;
174 struct i2c_client *i2c_client; 229 struct i2c_client *i2c_client;
175 struct regmap *regmap; 230 struct regmap *regmap;
176 struct regmap_irq_chip_data *regmap_irqc; 231 struct regmap_irq_chip_data *regmap_irqc;
177 long variant; 232 long variant;
233 int nr_cells;
234 struct mfd_cell *cells;
235 const struct regmap_config *regmap_cfg;
236 const struct regmap_irq_chip *regmap_irq_chip;
178}; 237};
179 238
180#endif /* __LINUX_MFD_AXP20X_H */ 239#endif /* __LINUX_MFD_AXP20X_H */
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 73e1709d4c09..a76bc100bf97 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -111,6 +111,13 @@ extern int mfd_add_devices(struct device *parent, int id,
111 struct resource *mem_base, 111 struct resource *mem_base,
112 int irq_base, struct irq_domain *irq_domain); 112 int irq_base, struct irq_domain *irq_domain);
113 113
114static inline int mfd_add_hotplug_devices(struct device *parent,
115 const struct mfd_cell *cells, int n_devs)
116{
117 return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs,
118 NULL, 0, NULL);
119}
120
114extern void mfd_remove_devices(struct device *parent); 121extern void mfd_remove_devices(struct device *parent);
115 122
116#endif 123#endif
diff --git a/include/linux/mfd/dln2.h b/include/linux/mfd/dln2.h
new file mode 100644
index 000000000000..004b24576da8
--- /dev/null
+++ b/include/linux/mfd/dln2.h
@@ -0,0 +1,103 @@
1#ifndef __LINUX_USB_DLN2_H
2#define __LINUX_USB_DLN2_H
3
4#define DLN2_CMD(cmd, id) ((cmd) | ((id) << 8))
5
6struct dln2_platform_data {
7 u16 handle; /* sub-driver handle (internally used only) */
8 u8 port; /* I2C/SPI port */
9};
10
11/**
12 * dln2_event_cb_t - event callback function signature
13 *
14 * @pdev - the sub-device that registered this callback
15 * @echo - the echo header field received in the message
16 * @data - the data payload
17 * @len - the data payload length
18 *
19 * The callback function is called in interrupt context and the data payload is
20 * only valid during the call. If the user needs later access of the data, it
21 * must copy it.
22 */
23
24typedef void (*dln2_event_cb_t)(struct platform_device *pdev, u16 echo,
25 const void *data, int len);
26
27/**
28 * dl2n_register_event_cb - register a callback function for an event
29 *
30 * @pdev - the sub-device that registers the callback
31 * @event - the event for which to register a callback
32 * @event_cb - the callback function
33 *
34 * @return 0 in case of success, negative value in case of error
35 */
36int dln2_register_event_cb(struct platform_device *pdev, u16 event,
37 dln2_event_cb_t event_cb);
38
39/**
40 * dln2_unregister_event_cb - unregister the callback function for an event
41 *
42 * @pdev - the sub-device that registered the callback
43 * @event - the event for which to register a callback
44 */
45void dln2_unregister_event_cb(struct platform_device *pdev, u16 event);
46
47/**
48 * dln2_transfer - issue a DLN2 command and wait for a response and the
49 * associated data
50 *
51 * @pdev - the sub-device which is issuing this transfer
52 * @cmd - the command to be sent to the device
53 * @obuf - the buffer to be sent to the device; it can be NULL if the user
54 * doesn't need to transmit data with this command
55 * @obuf_len - the size of the buffer to be sent to the device
56 * @ibuf - any data associated with the response will be copied here; it can be
57 * NULL if the user doesn't need the response data
58 * @ibuf_len - must be initialized to the input buffer size; it will be modified
59 * to indicate the actual data transferred;
60 *
61 * @return 0 for success, negative value for errors
62 */
63int dln2_transfer(struct platform_device *pdev, u16 cmd,
64 const void *obuf, unsigned obuf_len,
65 void *ibuf, unsigned *ibuf_len);
66
67/**
68 * dln2_transfer_rx - variant of @dln2_transfer() where TX buffer is not needed
69 *
70 * @pdev - the sub-device which is issuing this transfer
71 * @cmd - the command to be sent to the device
72 * @ibuf - any data associated with the response will be copied here; it can be
73 * NULL if the user doesn't need the response data
74 * @ibuf_len - must be initialized to the input buffer size; it will be modified
75 * to indicate the actual data transferred;
76 *
77 * @return 0 for success, negative value for errors
78 */
79
80static inline int dln2_transfer_rx(struct platform_device *pdev, u16 cmd,
81 void *ibuf, unsigned *ibuf_len)
82{
83 return dln2_transfer(pdev, cmd, NULL, 0, ibuf, ibuf_len);
84}
85
86/**
87 * dln2_transfer_tx - variant of @dln2_transfer() where RX buffer is not needed
88 *
89 * @pdev - the sub-device which is issuing this transfer
90 * @cmd - the command to be sent to the device
91 * @obuf - the buffer to be sent to the device; it can be NULL if the
92 * user doesn't need to transmit data with this command
93 * @obuf_len - the size of the buffer to be sent to the device
94 *
95 * @return 0 for success, negative value for errors
96 */
97static inline int dln2_transfer_tx(struct platform_device *pdev, u16 cmd,
98 const void *obuf, unsigned obuf_len)
99{
100 return dln2_transfer(pdev, cmd, obuf, obuf_len, NULL, NULL);
101}
102
103#endif
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
index 7e6dc4b2b795..553f7d09258a 100644
--- a/include/linux/mfd/max77686.h
+++ b/include/linux/mfd/max77686.h
@@ -131,13 +131,6 @@ enum max77686_opmode {
131 MAX77686_OPMODE_STANDBY, 131 MAX77686_OPMODE_STANDBY,
132}; 132};
133 133
134enum max77802_opmode {
135 MAX77802_OPMODE_OFF,
136 MAX77802_OPMODE_STANDBY,
137 MAX77802_OPMODE_LP,
138 MAX77802_OPMODE_NORMAL,
139};
140
141struct max77686_opmode_data { 134struct max77686_opmode_data {
142 int id; 135 int id;
143 int mode; 136 int mode;
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index fc17d56581b2..08dae01258b9 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -26,7 +26,6 @@
26 26
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28 28
29#define MAX77693_NUM_IRQ_MUIC_REGS 3
30#define MAX77693_REG_INVALID (0xff) 29#define MAX77693_REG_INVALID (0xff)
31 30
32/* Slave addr = 0xCC: PMIC, Charger, Flash LED */ 31/* Slave addr = 0xCC: PMIC, Charger, Flash LED */
@@ -330,6 +329,13 @@ enum max77693_irq_source {
330 MAX77693_IRQ_GROUP_NR, 329 MAX77693_IRQ_GROUP_NR,
331}; 330};
332 331
332#define SRC_IRQ_CHARGER BIT(0)
333#define SRC_IRQ_TOP BIT(1)
334#define SRC_IRQ_FLASH BIT(2)
335#define SRC_IRQ_MUIC BIT(3)
336#define SRC_IRQ_ALL (SRC_IRQ_CHARGER | SRC_IRQ_TOP \
337 | SRC_IRQ_FLASH | SRC_IRQ_MUIC)
338
333#define LED_IRQ_FLED2_OPEN BIT(0) 339#define LED_IRQ_FLED2_OPEN BIT(0)
334#define LED_IRQ_FLED2_SHORT BIT(1) 340#define LED_IRQ_FLED2_SHORT BIT(1)
335#define LED_IRQ_FLED1_OPEN BIT(2) 341#define LED_IRQ_FLED1_OPEN BIT(2)
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index 74346d5e7899..0c12628e91c6 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -558,6 +558,7 @@
558#define SD_SAMPLE_POINT_CTL 0xFDA7 558#define SD_SAMPLE_POINT_CTL 0xFDA7
559#define SD_PUSH_POINT_CTL 0xFDA8 559#define SD_PUSH_POINT_CTL 0xFDA8
560#define SD_CMD0 0xFDA9 560#define SD_CMD0 0xFDA9
561#define SD_CMD_START 0x40
561#define SD_CMD1 0xFDAA 562#define SD_CMD1 0xFDAA
562#define SD_CMD2 0xFDAB 563#define SD_CMD2 0xFDAB
563#define SD_CMD3 0xFDAC 564#define SD_CMD3 0xFDAC
@@ -707,6 +708,14 @@
707#define PM_CTRL1 0xFF44 708#define PM_CTRL1 0xFF44
708#define PM_CTRL2 0xFF45 709#define PM_CTRL2 0xFF45
709#define PM_CTRL3 0xFF46 710#define PM_CTRL3 0xFF46
711#define SDIO_SEND_PME_EN 0x80
712#define FORCE_RC_MODE_ON 0x40
713#define FORCE_RX50_LINK_ON 0x20
714#define D3_DELINK_MODE_EN 0x10
715#define USE_PESRTB_CTL_DELINK 0x08
716#define DELAY_PIN_WAKE 0x04
717#define RESET_PIN_WAKE 0x02
718#define PM_WAKE_EN 0x01
710#define PM_CTRL4 0xFF47 719#define PM_CTRL4 0xFF47
711 720
712/* Memory mapping */ 721/* Memory mapping */
@@ -752,6 +761,14 @@
752#define PHY_DUM_REG 0x1F 761#define PHY_DUM_REG 0x1F
753 762
754#define LCTLR 0x80 763#define LCTLR 0x80
764#define LCTLR_EXT_SYNC 0x80
765#define LCTLR_COMMON_CLOCK_CFG 0x40
766#define LCTLR_RETRAIN_LINK 0x20
767#define LCTLR_LINK_DISABLE 0x10
768#define LCTLR_RCB 0x08
769#define LCTLR_RESERVED 0x04
770#define LCTLR_ASPM_CTL_MASK 0x03
771
755#define PCR_SETTING_REG1 0x724 772#define PCR_SETTING_REG1 0x724
756#define PCR_SETTING_REG2 0x814 773#define PCR_SETTING_REG2 0x814
757#define PCR_SETTING_REG3 0x747 774#define PCR_SETTING_REG3 0x747
@@ -967,4 +984,24 @@ static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr)
967 return (u8 *)(pcr->host_cmds_ptr); 984 return (u8 *)(pcr->host_cmds_ptr);
968} 985}
969 986
987static inline int rtsx_pci_update_cfg_byte(struct rtsx_pcr *pcr, int addr,
988 u8 mask, u8 append)
989{
990 int err;
991 u8 val;
992
993 err = pci_read_config_byte(pcr->pci, addr, &val);
994 if (err < 0)
995 return err;
996 return pci_write_config_byte(pcr->pci, addr, (val & mask) | append);
997}
998
999static inline void rtsx_pci_write_be32(struct rtsx_pcr *pcr, u16 reg, u32 val)
1000{
1001 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg, 0xFF, val >> 24);
1002 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 1, 0xFF, val >> 16);
1003 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 2, 0xFF, val >> 8);
1004 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 3, 0xFF, val);
1005}
1006
970#endif 1007#endif
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 1825edacbda7..3fdb7cfbffb3 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -28,6 +28,7 @@
28#define MIN_800_MV 800000 28#define MIN_800_MV 800000
29#define MIN_750_MV 750000 29#define MIN_750_MV 750000
30#define MIN_600_MV 600000 30#define MIN_600_MV 600000
31#define MIN_500_MV 500000
31 32
32/* Macros to represent steps for LDO/BUCK */ 33/* Macros to represent steps for LDO/BUCK */
33#define STEP_50_MV 50000 34#define STEP_50_MV 50000
@@ -41,6 +42,7 @@ enum sec_device_type {
41 S5M8767X, 42 S5M8767X,
42 S2MPA01, 43 S2MPA01,
43 S2MPS11X, 44 S2MPS11X,
45 S2MPS13X,
44 S2MPS14X, 46 S2MPS14X,
45 S2MPU02, 47 S2MPU02,
46}; 48};
diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h
new file mode 100644
index 000000000000..ce5dda8958fe
--- /dev/null
+++ b/include/linux/mfd/samsung/s2mps13.h
@@ -0,0 +1,186 @@
1/*
2 * s2mps13.h
3 *
4 * Copyright (c) 2014 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * 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 */
18
19#ifndef __LINUX_MFD_S2MPS13_H
20#define __LINUX_MFD_S2MPS13_H
21
22/* S2MPS13 registers */
23enum s2mps13_reg {
24 S2MPS13_REG_ID,
25 S2MPS13_REG_INT1,
26 S2MPS13_REG_INT2,
27 S2MPS13_REG_INT3,
28 S2MPS13_REG_INT1M,
29 S2MPS13_REG_INT2M,
30 S2MPS13_REG_INT3M,
31 S2MPS13_REG_ST1,
32 S2MPS13_REG_ST2,
33 S2MPS13_REG_PWRONSRC,
34 S2MPS13_REG_OFFSRC,
35 S2MPS13_REG_BU_CHG,
36 S2MPS13_REG_RTCCTRL,
37 S2MPS13_REG_CTRL1,
38 S2MPS13_REG_CTRL2,
39 S2MPS13_REG_RSVD1,
40 S2MPS13_REG_RSVD2,
41 S2MPS13_REG_RSVD3,
42 S2MPS13_REG_RSVD4,
43 S2MPS13_REG_RSVD5,
44 S2MPS13_REG_RSVD6,
45 S2MPS13_REG_CTRL3,
46 S2MPS13_REG_RSVD7,
47 S2MPS13_REG_RSVD8,
48 S2MPS13_REG_WRSTBI,
49 S2MPS13_REG_B1CTRL,
50 S2MPS13_REG_B1OUT,
51 S2MPS13_REG_B2CTRL,
52 S2MPS13_REG_B2OUT,
53 S2MPS13_REG_B3CTRL,
54 S2MPS13_REG_B3OUT,
55 S2MPS13_REG_B4CTRL,
56 S2MPS13_REG_B4OUT,
57 S2MPS13_REG_B5CTRL,
58 S2MPS13_REG_B5OUT,
59 S2MPS13_REG_B6CTRL,
60 S2MPS13_REG_B6OUT,
61 S2MPS13_REG_B7CTRL,
62 S2MPS13_REG_B7OUT,
63 S2MPS13_REG_B8CTRL,
64 S2MPS13_REG_B8OUT,
65 S2MPS13_REG_B9CTRL,
66 S2MPS13_REG_B9OUT,
67 S2MPS13_REG_B10CTRL,
68 S2MPS13_REG_B10OUT,
69 S2MPS13_REG_BB1CTRL,
70 S2MPS13_REG_BB1OUT,
71 S2MPS13_REG_BUCK_RAMP1,
72 S2MPS13_REG_BUCK_RAMP2,
73 S2MPS13_REG_LDO_DVS1,
74 S2MPS13_REG_LDO_DVS2,
75 S2MPS13_REG_LDO_DVS3,
76 S2MPS13_REG_B6OUT2,
77 S2MPS13_REG_L1CTRL,
78 S2MPS13_REG_L2CTRL,
79 S2MPS13_REG_L3CTRL,
80 S2MPS13_REG_L4CTRL,
81 S2MPS13_REG_L5CTRL,
82 S2MPS13_REG_L6CTRL,
83 S2MPS13_REG_L7CTRL,
84 S2MPS13_REG_L8CTRL,
85 S2MPS13_REG_L9CTRL,
86 S2MPS13_REG_L10CTRL,
87 S2MPS13_REG_L11CTRL,
88 S2MPS13_REG_L12CTRL,
89 S2MPS13_REG_L13CTRL,
90 S2MPS13_REG_L14CTRL,
91 S2MPS13_REG_L15CTRL,
92 S2MPS13_REG_L16CTRL,
93 S2MPS13_REG_L17CTRL,
94 S2MPS13_REG_L18CTRL,
95 S2MPS13_REG_L19CTRL,
96 S2MPS13_REG_L20CTRL,
97 S2MPS13_REG_L21CTRL,
98 S2MPS13_REG_L22CTRL,
99 S2MPS13_REG_L23CTRL,
100 S2MPS13_REG_L24CTRL,
101 S2MPS13_REG_L25CTRL,
102 S2MPS13_REG_L26CTRL,
103 S2MPS13_REG_L27CTRL,
104 S2MPS13_REG_L28CTRL,
105 S2MPS13_REG_L30CTRL,
106 S2MPS13_REG_L31CTRL,
107 S2MPS13_REG_L32CTRL,
108 S2MPS13_REG_L33CTRL,
109 S2MPS13_REG_L34CTRL,
110 S2MPS13_REG_L35CTRL,
111 S2MPS13_REG_L36CTRL,
112 S2MPS13_REG_L37CTRL,
113 S2MPS13_REG_L38CTRL,
114 S2MPS13_REG_L39CTRL,
115 S2MPS13_REG_L40CTRL,
116 S2MPS13_REG_LDODSCH1,
117 S2MPS13_REG_LDODSCH2,
118 S2MPS13_REG_LDODSCH3,
119 S2MPS13_REG_LDODSCH4,
120 S2MPS13_REG_LDODSCH5,
121};
122
123/* regulator ids */
124enum s2mps13_regulators {
125 S2MPS13_LDO1,
126 S2MPS13_LDO2,
127 S2MPS13_LDO3,
128 S2MPS13_LDO4,
129 S2MPS13_LDO5,
130 S2MPS13_LDO6,
131 S2MPS13_LDO7,
132 S2MPS13_LDO8,
133 S2MPS13_LDO9,
134 S2MPS13_LDO10,
135 S2MPS13_LDO11,
136 S2MPS13_LDO12,
137 S2MPS13_LDO13,
138 S2MPS13_LDO14,
139 S2MPS13_LDO15,
140 S2MPS13_LDO16,
141 S2MPS13_LDO17,
142 S2MPS13_LDO18,
143 S2MPS13_LDO19,
144 S2MPS13_LDO20,
145 S2MPS13_LDO21,
146 S2MPS13_LDO22,
147 S2MPS13_LDO23,
148 S2MPS13_LDO24,
149 S2MPS13_LDO25,
150 S2MPS13_LDO26,
151 S2MPS13_LDO27,
152 S2MPS13_LDO28,
153 S2MPS13_LDO29,
154 S2MPS13_LDO30,
155 S2MPS13_LDO31,
156 S2MPS13_LDO32,
157 S2MPS13_LDO33,
158 S2MPS13_LDO34,
159 S2MPS13_LDO35,
160 S2MPS13_LDO36,
161 S2MPS13_LDO37,
162 S2MPS13_LDO38,
163 S2MPS13_LDO39,
164 S2MPS13_LDO40,
165 S2MPS13_BUCK1,
166 S2MPS13_BUCK2,
167 S2MPS13_BUCK3,
168 S2MPS13_BUCK4,
169 S2MPS13_BUCK5,
170 S2MPS13_BUCK6,
171 S2MPS13_BUCK7,
172 S2MPS13_BUCK8,
173 S2MPS13_BUCK9,
174 S2MPS13_BUCK10,
175
176 S2MPS13_REGULATOR_MAX,
177};
178
179/*
180 * Default ramp delay in uv/us. Datasheet says that ramp delay can be
181 * controlled however it does not specify which register is used for that.
182 * Let's assume that default value will be set.
183 */
184#define S2MPS13_BUCK_RAMP_DELAY 12500
185
186#endif /* __LINUX_MFD_S2MPS13_H */
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
index ff44374a1a4e..c877cad61a13 100644
--- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
+++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
@@ -395,4 +395,43 @@
395#define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17) 395#define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17)
396#define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14) 396#define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14)
397 397
398/* For imx6sx iomux gpr register field define */
399#define IMX6SX_GPR1_VDEC_SW_RST_MASK (0x1 << 20)
400#define IMX6SX_GPR1_VDEC_SW_RST_RESET (0x1 << 20)
401#define IMX6SX_GPR1_VDEC_SW_RST_RELEASE (0x0 << 20)
402#define IMX6SX_GPR1_VADC_SW_RST_MASK (0x1 << 19)
403#define IMX6SX_GPR1_VADC_SW_RST_RESET (0x1 << 19)
404#define IMX6SX_GPR1_VADC_SW_RST_RELEASE (0x0 << 19)
405#define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_MASK (0x3 << 13)
406#define IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK (0x3 << 17)
407#define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_EXT (0x3 << 13)
408
409#define IMX6SX_GPR4_FEC_ENET1_STOP_REQ (0x1 << 3)
410#define IMX6SX_GPR4_FEC_ENET2_STOP_REQ (0x1 << 4)
411
412#define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_MASK (0x1 << 3)
413#define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_LCDIF1 (0x0 << 3)
414#define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_LCDIF2 (0x1 << 3)
415
416#define IMX6SX_GPR5_CSI2_MUX_CTRL_MASK (0x3 << 27)
417#define IMX6SX_GPR5_CSI2_MUX_CTRL_EXT_PIN (0x0 << 27)
418#define IMX6SX_GPR5_CSI2_MUX_CTRL_CVD (0x1 << 27)
419#define IMX6SX_GPR5_CSI2_MUX_CTRL_VDAC_TO_CSI (0x2 << 27)
420#define IMX6SX_GPR5_CSI2_MUX_CTRL_GND (0x3 << 27)
421#define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_MASK (0x1 << 26)
422#define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_ENABLE (0x1 << 26)
423#define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_DISABLE (0x0 << 26)
424#define IMX6SX_GPR5_CSI1_MUX_CTRL_MASK (0x3 << 4)
425#define IMX6SX_GPR5_CSI1_MUX_CTRL_EXT_PIN (0x0 << 4)
426#define IMX6SX_GPR5_CSI1_MUX_CTRL_CVD (0x1 << 4)
427#define IMX6SX_GPR5_CSI1_MUX_CTRL_VDAC_TO_CSI (0x2 << 4)
428#define IMX6SX_GPR5_CSI1_MUX_CTRL_GND (0x3 << 4)
429
430#define IMX6SX_GPR5_DISP_MUX_DCIC2_LCDIF2 (0x0 << 2)
431#define IMX6SX_GPR5_DISP_MUX_DCIC2_LVDS (0x1 << 2)
432#define IMX6SX_GPR5_DISP_MUX_DCIC2_MASK (0x1 << 2)
433#define IMX6SX_GPR5_DISP_MUX_DCIC1_LCDIF1 (0x0 << 1)
434#define IMX6SX_GPR5_DISP_MUX_DCIC1_LVDS (0x1 << 1)
435#define IMX6SX_GPR5_DISP_MUX_DCIC1_MASK (0x1 << 1)
436
398#endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ 437#endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h
index e6088c2e2092..e1c12d84c26a 100644
--- a/include/linux/mfd/tc3589x.h
+++ b/include/linux/mfd/tc3589x.h
@@ -164,13 +164,10 @@ struct tc3589x_keypad_platform_data {
164 164
165/** 165/**
166 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data 166 * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data
167 * @gpio_base: first gpio number assigned to TC3589x. A maximum of
168 * %TC3589x_NR_GPIOS GPIOs will be allocated.
169 * @setup: callback for board-specific initialization 167 * @setup: callback for board-specific initialization
170 * @remove: callback for board-specific teardown 168 * @remove: callback for board-specific teardown
171 */ 169 */
172struct tc3589x_gpio_platform_data { 170struct tc3589x_gpio_platform_data {
173 int gpio_base;
174 void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); 171 void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base);
175 void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); 172 void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base);
176}; 173};
@@ -178,18 +175,13 @@ struct tc3589x_gpio_platform_data {
178/** 175/**
179 * struct tc3589x_platform_data - TC3589x platform data 176 * struct tc3589x_platform_data - TC3589x platform data
180 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) 177 * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*)
181 * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used.
182 * @gpio: GPIO-specific platform data 178 * @gpio: GPIO-specific platform data
183 * @keypad: keypad-specific platform data 179 * @keypad: keypad-specific platform data
184 */ 180 */
185struct tc3589x_platform_data { 181struct tc3589x_platform_data {
186 unsigned int block; 182 unsigned int block;
187 int irq_base;
188 struct tc3589x_gpio_platform_data *gpio; 183 struct tc3589x_gpio_platform_data *gpio;
189 const struct tc3589x_keypad_platform_data *keypad; 184 const struct tc3589x_keypad_platform_data *keypad;
190}; 185};
191 186
192#define TC3589x_NR_GPIOS 24
193#define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS)
194
195#endif 187#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b46461116cd2..f7606d3a0915 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -128,6 +128,7 @@ extern unsigned int kobjsize(const void *objp);
128#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 128#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
129#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 129#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
130#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ 130#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */
131#define VM_ARCH_2 0x02000000
131#define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ 132#define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */
132 133
133#ifdef CONFIG_MEM_SOFT_DIRTY 134#ifdef CONFIG_MEM_SOFT_DIRTY
@@ -155,6 +156,11 @@ extern unsigned int kobjsize(const void *objp);
155# define VM_MAPPED_COPY VM_ARCH_1 /* T if mapped copy of data (nommu mmap) */ 156# define VM_MAPPED_COPY VM_ARCH_1 /* T if mapped copy of data (nommu mmap) */
156#endif 157#endif
157 158
159#if defined(CONFIG_X86)
160/* MPX specific bounds table or bounds directory */
161# define VM_MPX VM_ARCH_2
162#endif
163
158#ifndef VM_GROWSUP 164#ifndef VM_GROWSUP
159# define VM_GROWSUP VM_NONE 165# define VM_GROWSUP VM_NONE
160#endif 166#endif
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 6e0b286649f1..004e9d17b47e 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -454,6 +454,10 @@ struct mm_struct {
454 bool tlb_flush_pending; 454 bool tlb_flush_pending;
455#endif 455#endif
456 struct uprobes_state uprobes_state; 456 struct uprobes_state uprobes_state;
457#ifdef CONFIG_X86_INTEL_MPX
458 /* address of the bounds directory */
459 void __user *bd_addr;
460#endif
457}; 461};
458 462
459static inline void mm_init_cpumask(struct mm_struct *mm) 463static inline void mm_init_cpumask(struct mm_struct *mm)
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index b0692d28f8e6..4d69c00497bd 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -88,6 +88,9 @@ struct mmc_ext_csd {
88 unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ 88 unsigned int data_tag_unit_size; /* DATA TAG UNIT size */
89 unsigned int boot_ro_lock; /* ro lock support */ 89 unsigned int boot_ro_lock; /* ro lock support */
90 bool boot_ro_lockable; 90 bool boot_ro_lockable;
91 bool ffu_capable; /* Firmware upgrade support */
92#define MMC_FIRMWARE_LEN 8
93 u8 fwrev[MMC_FIRMWARE_LEN]; /* FW version */
91 u8 raw_exception_status; /* 54 */ 94 u8 raw_exception_status; /* 54 */
92 u8 raw_partition_support; /* 160 */ 95 u8 raw_partition_support; /* 160 */
93 u8 raw_rpmb_size_mult; /* 168 */ 96 u8 raw_rpmb_size_mult; /* 168 */
@@ -509,24 +512,8 @@ static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
509 512
510#define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev) 513#define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev)
511 514
512#define mmc_list_to_card(l) container_of(l, struct mmc_card, node) 515extern int mmc_register_driver(struct device_driver *);
513#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) 516extern void mmc_unregister_driver(struct device_driver *);
514#define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d)
515
516/*
517 * MMC device driver (e.g., Flash card, I/O card...)
518 */
519struct mmc_driver {
520 struct device_driver drv;
521 int (*probe)(struct mmc_card *);
522 void (*remove)(struct mmc_card *);
523 int (*suspend)(struct mmc_card *);
524 int (*resume)(struct mmc_card *);
525 void (*shutdown)(struct mmc_card *);
526};
527
528extern int mmc_register_driver(struct mmc_driver *);
529extern void mmc_unregister_driver(struct mmc_driver *);
530 517
531extern void mmc_fixup_device(struct mmc_card *card, 518extern void mmc_fixup_device(struct mmc_card *card,
532 const struct mmc_fixup *table); 519 const struct mmc_fixup *table);
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index f206e29f94d7..cb2b0400d284 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -154,7 +154,8 @@ extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
154extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool, 154extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool,
155 bool, bool); 155 bool, bool);
156extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); 156extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
157extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd); 157extern int mmc_send_tuning(struct mmc_host *host);
158extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
158 159
159#define MMC_ERASE_ARG 0x00000000 160#define MMC_ERASE_ARG 0x00000000
160#define MMC_SECURE_ERASE_ARG 0x80000000 161#define MMC_SECURE_ERASE_ARG 0x80000000
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 001366927cf4..42b724e8d503 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -54,6 +54,7 @@ struct mmc_data;
54 * transfer is in progress. 54 * transfer is in progress.
55 * @use_dma: Whether DMA channel is initialized or not. 55 * @use_dma: Whether DMA channel is initialized or not.
56 * @using_dma: Whether DMA is in use for the current transfer. 56 * @using_dma: Whether DMA is in use for the current transfer.
57 * @dma_64bit_address: Whether DMA supports 64-bit address mode or not.
57 * @sg_dma: Bus address of DMA buffer. 58 * @sg_dma: Bus address of DMA buffer.
58 * @sg_cpu: Virtual address of DMA buffer. 59 * @sg_cpu: Virtual address of DMA buffer.
59 * @dma_ops: Pointer to platform-specific DMA callbacks. 60 * @dma_ops: Pointer to platform-specific DMA callbacks.
@@ -96,6 +97,7 @@ struct mmc_data;
96 * @quirks: Set of quirks that apply to specific versions of the IP. 97 * @quirks: Set of quirks that apply to specific versions of the IP.
97 * @irq_flags: The flags to be passed to request_irq. 98 * @irq_flags: The flags to be passed to request_irq.
98 * @irq: The irq value to be passed to request_irq. 99 * @irq: The irq value to be passed to request_irq.
100 * @sdio_id0: Number of slot0 in the SDIO interrupt registers.
99 * 101 *
100 * Locking 102 * Locking
101 * ======= 103 * =======
@@ -135,11 +137,11 @@ struct dw_mci {
135 struct mmc_command stop_abort; 137 struct mmc_command stop_abort;
136 unsigned int prev_blksz; 138 unsigned int prev_blksz;
137 unsigned char timing; 139 unsigned char timing;
138 struct workqueue_struct *card_workqueue;
139 140
140 /* DMA interface members*/ 141 /* DMA interface members*/
141 int use_dma; 142 int use_dma;
142 int using_dma; 143 int using_dma;
144 int dma_64bit_address;
143 145
144 dma_addr_t sg_dma; 146 dma_addr_t sg_dma;
145 void *sg_cpu; 147 void *sg_cpu;
@@ -154,7 +156,6 @@ struct dw_mci {
154 u32 stop_cmdr; 156 u32 stop_cmdr;
155 u32 dir_status; 157 u32 dir_status;
156 struct tasklet_struct tasklet; 158 struct tasklet_struct tasklet;
157 struct work_struct card_work;
158 unsigned long pending_events; 159 unsigned long pending_events;
159 unsigned long completed_events; 160 unsigned long completed_events;
160 enum dw_mci_state state; 161 enum dw_mci_state state;
@@ -193,6 +194,8 @@ struct dw_mci {
193 bool vqmmc_enabled; 194 bool vqmmc_enabled;
194 unsigned long irq_flags; /* IRQ flags */ 195 unsigned long irq_flags; /* IRQ flags */
195 int irq; 196 int irq;
197
198 int sdio_id0;
196}; 199};
197 200
198/* DMA ops for Internal/External DMAC interface */ 201/* DMA ops for Internal/External DMAC interface */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index df0c15396bbf..9f322706f7cb 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -289,6 +289,7 @@ struct mmc_host {
289#define MMC_CAP2_HS400_1_2V (1 << 16) /* Can support HS400 1.2V */ 289#define MMC_CAP2_HS400_1_2V (1 << 16) /* Can support HS400 1.2V */
290#define MMC_CAP2_HS400 (MMC_CAP2_HS400_1_8V | \ 290#define MMC_CAP2_HS400 (MMC_CAP2_HS400_1_8V | \
291 MMC_CAP2_HS400_1_2V) 291 MMC_CAP2_HS400_1_2V)
292#define MMC_CAP2_HSX00_1_2V (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
292#define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17) 293#define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
293 294
294 mmc_pm_flag_t pm_caps; /* supported pm features */ 295 mmc_pm_flag_t pm_caps; /* supported pm features */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 1cd00b3a75b9..49ad7a943638 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -296,6 +296,7 @@ struct _mmc_csd {
296#define EXT_CSD_SANITIZE_START 165 /* W */ 296#define EXT_CSD_SANITIZE_START 165 /* W */
297#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 297#define EXT_CSD_WR_REL_PARAM 166 /* RO */
298#define EXT_CSD_RPMB_MULT 168 /* RO */ 298#define EXT_CSD_RPMB_MULT 168 /* RO */
299#define EXT_CSD_FW_CONFIG 169 /* R/W */
299#define EXT_CSD_BOOT_WP 173 /* R/W */ 300#define EXT_CSD_BOOT_WP 173 /* R/W */
300#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 301#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
301#define EXT_CSD_PART_CONFIG 179 /* R/W */ 302#define EXT_CSD_PART_CONFIG 179 /* R/W */
@@ -332,6 +333,8 @@ struct _mmc_csd {
332#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ 333#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */
333#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ 334#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
334#define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ 335#define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */
336#define EXT_CSD_FIRMWARE_VERSION 254 /* RO, 8 bytes */
337#define EXT_CSD_SUPPORTED_MODE 493 /* RO */
335#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ 338#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */
336#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ 339#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */
337#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ 340#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index dba793e3a331..375af80bde7d 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -100,6 +100,12 @@ struct sdhci_host {
100#define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7) 100#define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7)
101/* Stop command (CMD12) can set Transfer Complete when not using MMC_RSP_BUSY */ 101/* Stop command (CMD12) can set Transfer Complete when not using MMC_RSP_BUSY */
102#define SDHCI_QUIRK2_STOP_WITH_TC (1<<8) 102#define SDHCI_QUIRK2_STOP_WITH_TC (1<<8)
103/* Controller does not support 64-bit DMA */
104#define SDHCI_QUIRK2_BROKEN_64_BIT_DMA (1<<9)
105/* need clear transfer mode register before send cmd */
106#define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10)
107/* Capability register bit-63 indicates HS400 support */
108#define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11)
103 109
104 int irq; /* Device IRQ */ 110 int irq; /* Device IRQ */
105 void __iomem *ioaddr; /* Mapped address */ 111 void __iomem *ioaddr; /* Mapped address */
@@ -130,6 +136,7 @@ struct sdhci_host {
130#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ 136#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */
131#define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */ 137#define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */
132#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ 138#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */
139#define SDHCI_USE_64_BIT_DMA (1<<12) /* Use 64-bit DMA */
133 140
134 unsigned int version; /* SDHCI spec. version */ 141 unsigned int version; /* SDHCI spec. version */
135 142
@@ -155,12 +162,19 @@ struct sdhci_host {
155 162
156 int sg_count; /* Mapped sg entries */ 163 int sg_count; /* Mapped sg entries */
157 164
158 u8 *adma_desc; /* ADMA descriptor table */ 165 void *adma_table; /* ADMA descriptor table */
159 u8 *align_buffer; /* Bounce buffer */ 166 void *align_buffer; /* Bounce buffer */
167
168 size_t adma_table_sz; /* ADMA descriptor table size */
169 size_t align_buffer_sz; /* Bounce buffer size */
160 170
161 dma_addr_t adma_addr; /* Mapped ADMA descr. table */ 171 dma_addr_t adma_addr; /* Mapped ADMA descr. table */
162 dma_addr_t align_addr; /* Mapped bounce buffer */ 172 dma_addr_t align_addr; /* Mapped bounce buffer */
163 173
174 unsigned int desc_sz; /* ADMA descriptor size */
175 unsigned int align_sz; /* ADMA alignment */
176 unsigned int align_mask; /* ADMA alignment mask */
177
164 struct tasklet_struct finish_tasklet; /* Tasklet structures */ 178 struct tasklet_struct finish_tasklet; /* Tasklet structures */
165 179
166 struct timer_list timer; /* Timer for timeouts */ 180 struct timer_list timer; /* Timer for timeouts */
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 50f0bc952328..aab032a6ae61 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -84,8 +84,6 @@ struct sdio_driver {
84 struct device_driver drv; 84 struct device_driver drv;
85}; 85};
86 86
87#define to_sdio_driver(d) container_of(d, struct sdio_driver, drv)
88
89/** 87/**
90 * SDIO_DEVICE - macro used to describe a specific SDIO device 88 * SDIO_DEVICE - macro used to describe a specific SDIO device
91 * @vend: the 16 bit manufacturer code 89 * @vend: the 16 bit manufacturer code
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 48bf12ef6620..ffe66e381c04 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -431,6 +431,15 @@ struct zone {
431 */ 431 */
432 int nr_migrate_reserve_block; 432 int nr_migrate_reserve_block;
433 433
434#ifdef CONFIG_MEMORY_ISOLATION
435 /*
436 * Number of isolated pageblock. It is used to solve incorrect
437 * freepage counting problem due to racy retrieving migratetype
438 * of pageblock. Protected by zone->lock.
439 */
440 unsigned long nr_isolate_pageblock;
441#endif
442
434#ifdef CONFIG_MEMORY_HOTPLUG 443#ifdef CONFIG_MEMORY_HOTPLUG
435 /* see spanned/present_pages for more description */ 444 /* see spanned/present_pages for more description */
436 seqlock_t span_seqlock; 445 seqlock_t span_seqlock;
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 44f4746d033b..8ac4a68ffae2 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -10,17 +10,12 @@ struct msi_msg {
10 u32 data; /* 16 bits of msi message data */ 10 u32 data; /* 16 bits of msi message data */
11}; 11};
12 12
13extern int pci_msi_ignore_mask;
13/* Helper functions */ 14/* Helper functions */
14struct irq_data; 15struct irq_data;
15struct msi_desc; 16struct msi_desc;
16void mask_msi_irq(struct irq_data *data);
17void unmask_msi_irq(struct irq_data *data);
18void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
19void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); 17void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
20void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
21void read_msi_msg(unsigned int irq, struct msi_msg *msg);
22void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); 18void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg);
23void write_msi_msg(unsigned int irq, struct msi_msg *msg);
24 19
25struct msi_desc { 20struct msi_desc {
26 struct { 21 struct {
@@ -48,6 +43,52 @@ struct msi_desc {
48 struct msi_msg msg; 43 struct msi_msg msg;
49}; 44};
50 45
46/* Helpers to hide struct msi_desc implementation details */
47#define msi_desc_to_dev(desc) (&(desc)->dev.dev)
48#define dev_to_msi_list(dev) (&to_pci_dev((dev))->msi_list)
49#define first_msi_entry(dev) \
50 list_first_entry(dev_to_msi_list((dev)), struct msi_desc, list)
51#define for_each_msi_entry(desc, dev) \
52 list_for_each_entry((desc), dev_to_msi_list((dev)), list)
53
54#ifdef CONFIG_PCI_MSI
55#define first_pci_msi_entry(pdev) first_msi_entry(&(pdev)->dev)
56#define for_each_pci_msi_entry(desc, pdev) \
57 for_each_msi_entry((desc), &(pdev)->dev)
58
59static inline struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc)
60{
61 return desc->dev;
62}
63#endif /* CONFIG_PCI_MSI */
64
65void __pci_read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
66void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
67void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg);
68
69u32 __pci_msix_desc_mask_irq(struct msi_desc *desc, u32 flag);
70u32 __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
71void pci_msi_mask_irq(struct irq_data *data);
72void pci_msi_unmask_irq(struct irq_data *data);
73
74/* Conversion helpers. Should be removed after merging */
75static inline void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
76{
77 __pci_write_msi_msg(entry, msg);
78}
79static inline void write_msi_msg(int irq, struct msi_msg *msg)
80{
81 pci_write_msi_msg(irq, msg);
82}
83static inline void mask_msi_irq(struct irq_data *data)
84{
85 pci_msi_mask_irq(data);
86}
87static inline void unmask_msi_irq(struct irq_data *data)
88{
89 pci_msi_unmask_irq(data);
90}
91
51/* 92/*
52 * The arch hooks to setup up msi irqs. Those functions are 93 * The arch hooks to setup up msi irqs. Those functions are
53 * implemented as weak symbols so that they /can/ be overriden by 94 * implemented as weak symbols so that they /can/ be overriden by
@@ -61,18 +102,142 @@ void arch_restore_msi_irqs(struct pci_dev *dev);
61 102
62void default_teardown_msi_irqs(struct pci_dev *dev); 103void default_teardown_msi_irqs(struct pci_dev *dev);
63void default_restore_msi_irqs(struct pci_dev *dev); 104void default_restore_msi_irqs(struct pci_dev *dev);
64u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
65u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag);
66 105
67struct msi_chip { 106struct msi_controller {
68 struct module *owner; 107 struct module *owner;
69 struct device *dev; 108 struct device *dev;
70 struct device_node *of_node; 109 struct device_node *of_node;
71 struct list_head list; 110 struct list_head list;
111#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
112 struct irq_domain *domain;
113#endif
72 114
73 int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev, 115 int (*setup_irq)(struct msi_controller *chip, struct pci_dev *dev,
74 struct msi_desc *desc); 116 struct msi_desc *desc);
75 void (*teardown_irq)(struct msi_chip *chip, unsigned int irq); 117 void (*teardown_irq)(struct msi_controller *chip, unsigned int irq);
118};
119
120#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
121
122#include <linux/irqhandler.h>
123#include <asm/msi.h>
124
125struct irq_domain;
126struct irq_chip;
127struct device_node;
128struct msi_domain_info;
129
130/**
131 * struct msi_domain_ops - MSI interrupt domain callbacks
132 * @get_hwirq: Retrieve the resulting hw irq number
133 * @msi_init: Domain specific init function for MSI interrupts
134 * @msi_free: Domain specific function to free a MSI interrupts
135 * @msi_check: Callback for verification of the domain/info/dev data
136 * @msi_prepare: Prepare the allocation of the interrupts in the domain
137 * @msi_finish: Optional callbacl to finalize the allocation
138 * @set_desc: Set the msi descriptor for an interrupt
139 * @handle_error: Optional error handler if the allocation fails
140 *
141 * @get_hwirq, @msi_init and @msi_free are callbacks used by
142 * msi_create_irq_domain() and related interfaces
143 *
144 * @msi_check, @msi_prepare, @msi_finish, @set_desc and @handle_error
145 * are callbacks used by msi_irq_domain_alloc_irqs() and related
146 * interfaces which are based on msi_desc.
147 */
148struct msi_domain_ops {
149 irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info,
150 msi_alloc_info_t *arg);
151 int (*msi_init)(struct irq_domain *domain,
152 struct msi_domain_info *info,
153 unsigned int virq, irq_hw_number_t hwirq,
154 msi_alloc_info_t *arg);
155 void (*msi_free)(struct irq_domain *domain,
156 struct msi_domain_info *info,
157 unsigned int virq);
158 int (*msi_check)(struct irq_domain *domain,
159 struct msi_domain_info *info,
160 struct device *dev);
161 int (*msi_prepare)(struct irq_domain *domain,
162 struct device *dev, int nvec,
163 msi_alloc_info_t *arg);
164 void (*msi_finish)(msi_alloc_info_t *arg, int retval);
165 void (*set_desc)(msi_alloc_info_t *arg,
166 struct msi_desc *desc);
167 int (*handle_error)(struct irq_domain *domain,
168 struct msi_desc *desc, int error);
169};
170
171/**
172 * struct msi_domain_info - MSI interrupt domain data
173 * @flags: Flags to decribe features and capabilities
174 * @ops: The callback data structure
175 * @chip: Optional: associated interrupt chip
176 * @chip_data: Optional: associated interrupt chip data
177 * @handler: Optional: associated interrupt flow handler
178 * @handler_data: Optional: associated interrupt flow handler data
179 * @handler_name: Optional: associated interrupt flow handler name
180 * @data: Optional: domain specific data
181 */
182struct msi_domain_info {
183 u32 flags;
184 struct msi_domain_ops *ops;
185 struct irq_chip *chip;
186 void *chip_data;
187 irq_flow_handler_t handler;
188 void *handler_data;
189 const char *handler_name;
190 void *data;
191};
192
193/* Flags for msi_domain_info */
194enum {
195 /*
196 * Init non implemented ops callbacks with default MSI domain
197 * callbacks.
198 */
199 MSI_FLAG_USE_DEF_DOM_OPS = (1 << 0),
200 /*
201 * Init non implemented chip callbacks with default MSI chip
202 * callbacks.
203 */
204 MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1),
205 /* Build identity map between hwirq and irq */
206 MSI_FLAG_IDENTITY_MAP = (1 << 2),
207 /* Support multiple PCI MSI interrupts */
208 MSI_FLAG_MULTI_PCI_MSI = (1 << 3),
209 /* Support PCI MSIX interrupts */
210 MSI_FLAG_PCI_MSIX = (1 << 4),
76}; 211};
77 212
213int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
214 bool force);
215
216struct irq_domain *msi_create_irq_domain(struct device_node *of_node,
217 struct msi_domain_info *info,
218 struct irq_domain *parent);
219int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
220 int nvec);
221void msi_domain_free_irqs(struct irq_domain *domain, struct device *dev);
222struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain);
223
224#endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */
225
226#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
227void pci_msi_domain_write_msg(struct irq_data *irq_data, struct msi_msg *msg);
228struct irq_domain *pci_msi_create_irq_domain(struct device_node *node,
229 struct msi_domain_info *info,
230 struct irq_domain *parent);
231int pci_msi_domain_alloc_irqs(struct irq_domain *domain, struct pci_dev *dev,
232 int nvec, int type);
233void pci_msi_domain_free_irqs(struct irq_domain *domain, struct pci_dev *dev);
234struct irq_domain *pci_msi_create_default_irq_domain(struct device_node *node,
235 struct msi_domain_info *info, struct irq_domain *parent);
236
237irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev,
238 struct msi_desc *desc);
239int pci_msi_domain_check_cap(struct irq_domain *domain,
240 struct msi_domain_info *info, struct device *dev);
241#endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */
242
78#endif /* LINUX_MSI_H */ 243#endif /* LINUX_MSI_H */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 983876f24aed..47ebb4fafd87 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1224,11 +1224,22 @@ struct nfs41_free_stateid_res {
1224 unsigned int status; 1224 unsigned int status;
1225}; 1225};
1226 1226
1227static inline void
1228nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
1229{
1230 kfree(cinfo->buckets);
1231}
1232
1227#else 1233#else
1228 1234
1229struct pnfs_ds_commit_info { 1235struct pnfs_ds_commit_info {
1230}; 1236};
1231 1237
1238static inline void
1239nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
1240{
1241}
1242
1232#endif /* CONFIG_NFS_V4_1 */ 1243#endif /* CONFIG_NFS_V4_1 */
1233 1244
1234#ifdef CONFIG_NFS_V4_2 1245#ifdef CONFIG_NFS_V4_2
diff --git a/include/linux/of.h b/include/linux/of.h
index 6545e7aec7bb..c55b50018ac4 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -267,14 +267,12 @@ extern int of_property_read_u64(const struct device_node *np,
267extern int of_property_read_string(struct device_node *np, 267extern int of_property_read_string(struct device_node *np,
268 const char *propname, 268 const char *propname,
269 const char **out_string); 269 const char **out_string);
270extern int of_property_read_string_index(struct device_node *np,
271 const char *propname,
272 int index, const char **output);
273extern int of_property_match_string(struct device_node *np, 270extern int of_property_match_string(struct device_node *np,
274 const char *propname, 271 const char *propname,
275 const char *string); 272 const char *string);
276extern int of_property_count_strings(struct device_node *np, 273extern int of_property_read_string_helper(struct device_node *np,
277 const char *propname); 274 const char *propname,
275 const char **out_strs, size_t sz, int index);
278extern int of_device_is_compatible(const struct device_node *device, 276extern int of_device_is_compatible(const struct device_node *device,
279 const char *); 277 const char *);
280extern int of_device_is_available(const struct device_node *device); 278extern int of_device_is_available(const struct device_node *device);
@@ -486,15 +484,9 @@ static inline int of_property_read_string(struct device_node *np,
486 return -ENOSYS; 484 return -ENOSYS;
487} 485}
488 486
489static inline int of_property_read_string_index(struct device_node *np, 487static inline int of_property_read_string_helper(struct device_node *np,
490 const char *propname, int index, 488 const char *propname,
491 const char **out_string) 489 const char **out_strs, size_t sz, int index)
492{
493 return -ENOSYS;
494}
495
496static inline int of_property_count_strings(struct device_node *np,
497 const char *propname)
498{ 490{
499 return -ENOSYS; 491 return -ENOSYS;
500} 492}
@@ -668,6 +660,70 @@ static inline int of_property_count_u64_elems(const struct device_node *np,
668} 660}
669 661
670/** 662/**
663 * of_property_read_string_array() - Read an array of strings from a multiple
664 * strings property.
665 * @np: device node from which the property value is to be read.
666 * @propname: name of the property to be searched.
667 * @out_strs: output array of string pointers.
668 * @sz: number of array elements to read.
669 *
670 * Search for a property in a device tree node and retrieve a list of
671 * terminated string values (pointer to data, not a copy) in that property.
672 *
673 * If @out_strs is NULL, the number of strings in the property is returned.
674 */
675static inline int of_property_read_string_array(struct device_node *np,
676 const char *propname, const char **out_strs,
677 size_t sz)
678{
679 return of_property_read_string_helper(np, propname, out_strs, sz, 0);
680}
681
682/**
683 * of_property_count_strings() - Find and return the number of strings from a
684 * multiple strings property.
685 * @np: device node from which the property value is to be read.
686 * @propname: name of the property to be searched.
687 *
688 * Search for a property in a device tree node and retrieve the number of null
689 * terminated string contain in it. Returns the number of strings on
690 * success, -EINVAL if the property does not exist, -ENODATA if property
691 * does not have a value, and -EILSEQ if the string is not null-terminated
692 * within the length of the property data.
693 */
694static inline int of_property_count_strings(struct device_node *np,
695 const char *propname)
696{
697 return of_property_read_string_helper(np, propname, NULL, 0, 0);
698}
699
700/**
701 * of_property_read_string_index() - Find and read a string from a multiple
702 * strings property.
703 * @np: device node from which the property value is to be read.
704 * @propname: name of the property to be searched.
705 * @index: index of the string in the list of strings
706 * @out_string: pointer to null terminated return string, modified only if
707 * return value is 0.
708 *
709 * Search for a property in a device tree node and retrieve a null
710 * terminated string value (pointer to data, not a copy) in the list of strings
711 * contained in that property.
712 * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
713 * property does not have a value, and -EILSEQ if the string is not
714 * null-terminated within the length of the property data.
715 *
716 * The out_string pointer is modified only if a valid string can be decoded.
717 */
718static inline int of_property_read_string_index(struct device_node *np,
719 const char *propname,
720 int index, const char **output)
721{
722 int rc = of_property_read_string_helper(np, propname, output, 1, index);
723 return rc < 0 ? rc : 0;
724}
725
726/**
671 * of_property_read_bool - Findfrom a property 727 * of_property_read_bool - Findfrom a property
672 * @np: device node from which the property value is to be read. 728 * @np: device node from which the property value is to be read.
673 * @propname: name of the property to be searched. 729 * @propname: name of the property to be searched.
@@ -866,4 +922,15 @@ static inline int of_changeset_update_property(struct of_changeset *ocs,
866/* CONFIG_OF_RESOLVE api */ 922/* CONFIG_OF_RESOLVE api */
867extern int of_resolve_phandles(struct device_node *tree); 923extern int of_resolve_phandles(struct device_node *tree);
868 924
925/**
926 * of_device_is_system_power_controller - Tells if system-power-controller is found for device_node
927 * @np: Pointer to the given device_node
928 *
929 * return true if present false otherwise
930 */
931static inline bool of_device_is_system_power_controller(const struct device_node *np)
932{
933 return of_property_read_bool(np, "system-power-controller");
934}
935
869#endif /* _LINUX_OF_H */ 936#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index 1fd207e7a847..ce0e5abeb454 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -59,13 +59,13 @@ int of_pci_get_host_bridge_resources(struct device_node *dev,
59#endif 59#endif
60 60
61#if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI) 61#if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI)
62int of_pci_msi_chip_add(struct msi_chip *chip); 62int of_pci_msi_chip_add(struct msi_controller *chip);
63void of_pci_msi_chip_remove(struct msi_chip *chip); 63void of_pci_msi_chip_remove(struct msi_controller *chip);
64struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node); 64struct msi_controller *of_pci_find_msi_chip_by_node(struct device_node *of_node);
65#else 65#else
66static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; } 66static inline int of_pci_msi_chip_add(struct msi_controller *chip) { return -EINVAL; }
67static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { } 67static inline void of_pci_msi_chip_remove(struct msi_controller *chip) { }
68static inline struct msi_chip * 68static inline struct msi_controller *
69of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; } 69of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
70#endif 70#endif
71 71
diff --git a/include/linux/omap-gpmc.h b/include/linux/omap-gpmc.h
new file mode 100644
index 000000000000..c2080eebbb47
--- /dev/null
+++ b/include/linux/omap-gpmc.h
@@ -0,0 +1,199 @@
1/*
2 * OMAP GPMC (General Purpose Memory Controller) defines
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10/* Maximum Number of Chip Selects */
11#define GPMC_CS_NUM 8
12
13#define GPMC_CONFIG_WP 0x00000005
14
15#define GPMC_IRQ_FIFOEVENTENABLE 0x01
16#define GPMC_IRQ_COUNT_EVENT 0x02
17
18#define GPMC_BURST_4 4 /* 4 word burst */
19#define GPMC_BURST_8 8 /* 8 word burst */
20#define GPMC_BURST_16 16 /* 16 word burst */
21#define GPMC_DEVWIDTH_8BIT 1 /* 8-bit device width */
22#define GPMC_DEVWIDTH_16BIT 2 /* 16-bit device width */
23#define GPMC_MUX_AAD 1 /* Addr-Addr-Data multiplex */
24#define GPMC_MUX_AD 2 /* Addr-Data multiplex */
25
26/* bool type time settings */
27struct gpmc_bool_timings {
28 bool cycle2cyclediffcsen;
29 bool cycle2cyclesamecsen;
30 bool we_extra_delay;
31 bool oe_extra_delay;
32 bool adv_extra_delay;
33 bool cs_extra_delay;
34 bool time_para_granularity;
35};
36
37/*
38 * Note that all values in this struct are in nanoseconds except sync_clk
39 * (which is in picoseconds), while the register values are in gpmc_fck cycles.
40 */
41struct gpmc_timings {
42 /* Minimum clock period for synchronous mode (in picoseconds) */
43 u32 sync_clk;
44
45 /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
46 u32 cs_on; /* Assertion time */
47 u32 cs_rd_off; /* Read deassertion time */
48 u32 cs_wr_off; /* Write deassertion time */
49
50 /* ADV signal timings corresponding to GPMC_CONFIG3 */
51 u32 adv_on; /* Assertion time */
52 u32 adv_rd_off; /* Read deassertion time */
53 u32 adv_wr_off; /* Write deassertion time */
54
55 /* WE signals timings corresponding to GPMC_CONFIG4 */
56 u32 we_on; /* WE assertion time */
57 u32 we_off; /* WE deassertion time */
58
59 /* OE signals timings corresponding to GPMC_CONFIG4 */
60 u32 oe_on; /* OE assertion time */
61 u32 oe_off; /* OE deassertion time */
62
63 /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
64 u32 page_burst_access; /* Multiple access word delay */
65 u32 access; /* Start-cycle to first data valid delay */
66 u32 rd_cycle; /* Total read cycle time */
67 u32 wr_cycle; /* Total write cycle time */
68
69 u32 bus_turnaround;
70 u32 cycle2cycle_delay;
71
72 u32 wait_monitoring;
73 u32 clk_activation;
74
75 /* The following are only on OMAP3430 */
76 u32 wr_access; /* WRACCESSTIME */
77 u32 wr_data_mux_bus; /* WRDATAONADMUXBUS */
78
79 struct gpmc_bool_timings bool_timings;
80};
81
82/* Device timings in picoseconds */
83struct gpmc_device_timings {
84 u32 t_ceasu; /* address setup to CS valid */
85 u32 t_avdasu; /* address setup to ADV valid */
86 /* XXX: try to combine t_avdp_r & t_avdp_w. Issue is
87 * of tusb using these timings even for sync whilst
88 * ideally for adv_rd/(wr)_off it should have considered
89 * t_avdh instead. This indirectly necessitates r/w
90 * variations of t_avdp as it is possible to have one
91 * sync & other async
92 */
93 u32 t_avdp_r; /* ADV low time (what about t_cer ?) */
94 u32 t_avdp_w;
95 u32 t_aavdh; /* address hold time */
96 u32 t_oeasu; /* address setup to OE valid */
97 u32 t_aa; /* access time from ADV assertion */
98 u32 t_iaa; /* initial access time */
99 u32 t_oe; /* access time from OE assertion */
100 u32 t_ce; /* access time from CS asertion */
101 u32 t_rd_cycle; /* read cycle time */
102 u32 t_cez_r; /* read CS deassertion to high Z */
103 u32 t_cez_w; /* write CS deassertion to high Z */
104 u32 t_oez; /* OE deassertion to high Z */
105 u32 t_weasu; /* address setup to WE valid */
106 u32 t_wpl; /* write assertion time */
107 u32 t_wph; /* write deassertion time */
108 u32 t_wr_cycle; /* write cycle time */
109
110 u32 clk;
111 u32 t_bacc; /* burst access valid clock to output delay */
112 u32 t_ces; /* CS setup time to clk */
113 u32 t_avds; /* ADV setup time to clk */
114 u32 t_avdh; /* ADV hold time from clk */
115 u32 t_ach; /* address hold time from clk */
116 u32 t_rdyo; /* clk to ready valid */
117
118 u32 t_ce_rdyz; /* XXX: description ?, or use t_cez instead */
119 u32 t_ce_avd; /* CS on to ADV on delay */
120
121 /* XXX: check the possibility of combining
122 * cyc_aavhd_oe & cyc_aavdh_we
123 */
124 u8 cyc_aavdh_oe;/* read address hold time in cycles */
125 u8 cyc_aavdh_we;/* write address hold time in cycles */
126 u8 cyc_oe; /* access time from OE assertion in cycles */
127 u8 cyc_wpl; /* write deassertion time in cycles */
128 u32 cyc_iaa; /* initial access time in cycles */
129
130 /* extra delays */
131 bool ce_xdelay;
132 bool avd_xdelay;
133 bool oe_xdelay;
134 bool we_xdelay;
135};
136
137struct gpmc_settings {
138 bool burst_wrap; /* enables wrap bursting */
139 bool burst_read; /* enables read page/burst mode */
140 bool burst_write; /* enables write page/burst mode */
141 bool device_nand; /* device is NAND */
142 bool sync_read; /* enables synchronous reads */
143 bool sync_write; /* enables synchronous writes */
144 bool wait_on_read; /* monitor wait on reads */
145 bool wait_on_write; /* monitor wait on writes */
146 u32 burst_len; /* page/burst length */
147 u32 device_width; /* device bus width (8 or 16 bit) */
148 u32 mux_add_data; /* multiplex address & data */
149 u32 wait_pin; /* wait-pin to be used */
150};
151
152extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
153 struct gpmc_settings *gpmc_s,
154 struct gpmc_device_timings *dev_t);
155
156struct gpmc_nand_regs;
157struct device_node;
158
159extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
160extern int gpmc_get_client_irq(unsigned irq_config);
161
162extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
163
164extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
165extern int gpmc_calc_divider(unsigned int sync_clk);
166extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
167extern int gpmc_cs_program_settings(int cs, struct gpmc_settings *p);
168extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
169extern void gpmc_cs_free(int cs);
170extern int gpmc_configure(int cmd, int wval);
171extern void gpmc_read_settings_dt(struct device_node *np,
172 struct gpmc_settings *p);
173
174extern void omap3_gpmc_save_context(void);
175extern void omap3_gpmc_restore_context(void);
176
177struct gpmc_timings;
178struct omap_nand_platform_data;
179struct omap_onenand_platform_data;
180
181#if IS_ENABLED(CONFIG_MTD_NAND_OMAP2)
182extern int gpmc_nand_init(struct omap_nand_platform_data *d,
183 struct gpmc_timings *gpmc_t);
184#else
185static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
186 struct gpmc_timings *gpmc_t)
187{
188 return 0;
189}
190#endif
191
192#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
193extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
194#else
195#define board_onenand_data NULL
196static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
197{
198}
199#endif
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 3fff8e774067..2dc1e1697b45 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -2,6 +2,10 @@
2#define __LINUX_PAGEISOLATION_H 2#define __LINUX_PAGEISOLATION_H
3 3
4#ifdef CONFIG_MEMORY_ISOLATION 4#ifdef CONFIG_MEMORY_ISOLATION
5static inline bool has_isolate_pageblock(struct zone *zone)
6{
7 return zone->nr_isolate_pageblock;
8}
5static inline bool is_migrate_isolate_page(struct page *page) 9static inline bool is_migrate_isolate_page(struct page *page)
6{ 10{
7 return get_pageblock_migratetype(page) == MIGRATE_ISOLATE; 11 return get_pageblock_migratetype(page) == MIGRATE_ISOLATE;
@@ -11,6 +15,10 @@ static inline bool is_migrate_isolate(int migratetype)
11 return migratetype == MIGRATE_ISOLATE; 15 return migratetype == MIGRATE_ISOLATE;
12} 16}
13#else 17#else
18static inline bool has_isolate_pageblock(struct zone *zone)
19{
20 return false;
21}
14static inline bool is_migrate_isolate_page(struct page *page) 22static inline bool is_migrate_isolate_page(struct page *page)
15{ 23{
16 return false; 24 return false;
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 64dacb7288a6..24c7728ca681 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -41,8 +41,13 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
41 41
42 if (pci_is_root_bus(pbus)) 42 if (pci_is_root_bus(pbus))
43 dev = pbus->bridge; 43 dev = pbus->bridge;
44 else 44 else {
45 /* If pbus is a virtual bus, there is no bridge to it */
46 if (!pbus->self)
47 return NULL;
48
45 dev = &pbus->self->dev; 49 dev = &pbus->self->dev;
50 }
46 51
47 return ACPI_HANDLE(dev); 52 return ACPI_HANDLE(dev);
48} 53}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5be8db45e368..a523cee3abb5 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -331,6 +331,7 @@ struct pci_dev {
331 unsigned int is_added:1; 331 unsigned int is_added:1;
332 unsigned int is_busmaster:1; /* device is busmaster */ 332 unsigned int is_busmaster:1; /* device is busmaster */
333 unsigned int no_msi:1; /* device may not use msi */ 333 unsigned int no_msi:1; /* device may not use msi */
334 unsigned int no_64bit_msi:1; /* device may only use 32-bit MSIs */
334 unsigned int block_cfg_access:1; /* config space access is blocked */ 335 unsigned int block_cfg_access:1; /* config space access is blocked */
335 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 336 unsigned int broken_parity_status:1; /* Device generates false positive parity */
336 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ 337 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */
@@ -449,7 +450,7 @@ struct pci_bus {
449 struct resource busn_res; /* bus numbers routed to this bus */ 450 struct resource busn_res; /* bus numbers routed to this bus */
450 451
451 struct pci_ops *ops; /* configuration access functions */ 452 struct pci_ops *ops; /* configuration access functions */
452 struct msi_chip *msi; /* MSI controller */ 453 struct msi_controller *msi; /* MSI controller */
453 void *sysdata; /* hook for sys-specific extension */ 454 void *sysdata; /* hook for sys-specific extension */
454 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ 455 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */
455 456
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1fa99a301817..97fb9f69aaed 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -522,6 +522,8 @@
522#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403 522#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403
523#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d 523#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d
524#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e 524#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e
525#define PCI_DEVICE_ID_AMD_15H_M60H_NB_F3 0x1573
526#define PCI_DEVICE_ID_AMD_15H_M60H_NB_F4 0x1574
525#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 527#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600
526#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 528#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601
527#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 529#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
index d5c89e0dd0e6..51ce60c35f4c 100644
--- a/include/linux/percpu-refcount.h
+++ b/include/linux/percpu-refcount.h
@@ -133,7 +133,13 @@ static inline bool __ref_is_percpu(struct percpu_ref *ref,
133 /* paired with smp_store_release() in percpu_ref_reinit() */ 133 /* paired with smp_store_release() in percpu_ref_reinit() */
134 smp_read_barrier_depends(); 134 smp_read_barrier_depends();
135 135
136 if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC)) 136 /*
137 * Theoretically, the following could test just ATOMIC; however,
138 * then we'd have to mask off DEAD separately as DEAD may be
139 * visible without ATOMIC if we race with percpu_ref_kill(). DEAD
140 * implies ATOMIC anyway. Test them together.
141 */
142 if (unlikely(percpu_ptr & __PERCPU_REF_ATOMIC_DEAD))
137 return false; 143 return false;
138 144
139 *percpu_countp = (unsigned long __percpu *)percpu_ptr; 145 *percpu_countp = (unsigned long __percpu *)percpu_ptr;
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 893a0d07986f..486e84ccb1f9 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -79,7 +79,7 @@ struct perf_branch_stack {
79 struct perf_branch_entry entries[0]; 79 struct perf_branch_entry entries[0];
80}; 80};
81 81
82struct perf_regs_user { 82struct perf_regs {
83 __u64 abi; 83 __u64 abi;
84 struct pt_regs *regs; 84 struct pt_regs *regs;
85}; 85};
@@ -580,34 +580,40 @@ extern u64 perf_event_read_value(struct perf_event *event,
580 580
581 581
582struct perf_sample_data { 582struct perf_sample_data {
583 u64 type; 583 /*
584 * Fields set by perf_sample_data_init(), group so as to
585 * minimize the cachelines touched.
586 */
587 u64 addr;
588 struct perf_raw_record *raw;
589 struct perf_branch_stack *br_stack;
590 u64 period;
591 u64 weight;
592 u64 txn;
593 union perf_mem_data_src data_src;
584 594
595 /*
596 * The other fields, optionally {set,used} by
597 * perf_{prepare,output}_sample().
598 */
599 u64 type;
585 u64 ip; 600 u64 ip;
586 struct { 601 struct {
587 u32 pid; 602 u32 pid;
588 u32 tid; 603 u32 tid;
589 } tid_entry; 604 } tid_entry;
590 u64 time; 605 u64 time;
591 u64 addr;
592 u64 id; 606 u64 id;
593 u64 stream_id; 607 u64 stream_id;
594 struct { 608 struct {
595 u32 cpu; 609 u32 cpu;
596 u32 reserved; 610 u32 reserved;
597 } cpu_entry; 611 } cpu_entry;
598 u64 period;
599 union perf_mem_data_src data_src;
600 struct perf_callchain_entry *callchain; 612 struct perf_callchain_entry *callchain;
601 struct perf_raw_record *raw; 613 struct perf_regs regs_user;
602 struct perf_branch_stack *br_stack; 614 struct perf_regs regs_intr;
603 struct perf_regs_user regs_user;
604 u64 stack_user_size; 615 u64 stack_user_size;
605 u64 weight; 616} ____cacheline_aligned;
606 /*
607 * Transaction flags for abort events:
608 */
609 u64 txn;
610};
611 617
612/* default value for data source */ 618/* default value for data source */
613#define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\ 619#define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\
@@ -624,9 +630,6 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
624 data->raw = NULL; 630 data->raw = NULL;
625 data->br_stack = NULL; 631 data->br_stack = NULL;
626 data->period = period; 632 data->period = period;
627 data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE;
628 data->regs_user.regs = NULL;
629 data->stack_user_size = 0;
630 data->weight = 0; 633 data->weight = 0;
631 data->data_src.val = PERF_MEM_NA; 634 data->data_src.val = PERF_MEM_NA;
632 data->txn = 0; 635 data->txn = 0;
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h
new file mode 100644
index 000000000000..67bbcf0785f6
--- /dev/null
+++ b/include/linux/platform_data/hsmmc-omap.h
@@ -0,0 +1,90 @@
1/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*
12 * struct omap_hsmmc_dev_attr.flags possibilities
13 *
14 * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
15 * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
16 * should be set if this is the case. See for example Section 22.5.3
17 * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
18 * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
19 *
20 * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
21 * don't work correctly on some MMC controller instances on some
22 * OMAP3 SoCs; this flag should be set if this is the case. See
23 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
24 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
25 * Revision F (October 2010) (SPRZ278F).
26 */
27#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
28#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
29#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2)
30
31struct omap_hsmmc_dev_attr {
32 u8 flags;
33};
34
35struct mmc_card;
36
37struct omap_hsmmc_platform_data {
38 /* back-link to device */
39 struct device *dev;
40
41 /* set if your board has components or wiring that limits the
42 * maximum frequency on the MMC bus */
43 unsigned int max_freq;
44
45 /* Integrating attributes from the omap_hwmod layer */
46 u8 controller_flags;
47
48 /* Register offset deviation */
49 u16 reg_offset;
50
51 /*
52 * 4/8 wires and any additional host capabilities
53 * need to OR'd all capabilities (ref. linux/mmc/host.h)
54 */
55 u32 caps; /* Used for the MMC driver on 2430 and later */
56 u32 pm_caps; /* PM capabilities of the mmc */
57
58 /* switch pin can be for card detect (default) or card cover */
59 unsigned cover:1;
60
61 /* use the internal clock */
62 unsigned internal_clock:1;
63
64 /* nonremovable e.g. eMMC */
65 unsigned nonremovable:1;
66
67 /* eMMC does not handle power off when not in sleep state */
68 unsigned no_regulator_off_init:1;
69
70 /* we can put the features above into this variable */
71#define HSMMC_HAS_PBIAS (1 << 0)
72#define HSMMC_HAS_UPDATED_RESET (1 << 1)
73#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
74 unsigned features;
75
76 int switch_pin; /* gpio (card detect) */
77 int gpio_wp; /* gpio (write protect) */
78
79 int (*set_power)(struct device *dev, int power_on, int vdd);
80 void (*remux)(struct device *dev, int power_on);
81 /* Call back before enabling / disabling regulators */
82 void (*before_set_reg)(struct device *dev, int power_on, int vdd);
83 /* Call back after enabling / disabling regulators */
84 void (*after_set_reg)(struct device *dev, int power_on, int vdd);
85 /* if we have special card, init it using this callback */
86 void (*init_card)(struct mmc_card *card);
87
88 const char *name;
89 u32 ocr_mask;
90};
diff --git a/include/linux/platform_data/mmc-atmel-mci.h b/include/linux/platform_data/mmc-atmel-mci.h
new file mode 100644
index 000000000000..399a2d5a14bd
--- /dev/null
+++ b/include/linux/platform_data/mmc-atmel-mci.h
@@ -0,0 +1,22 @@
1#ifndef __MMC_ATMEL_MCI_H
2#define __MMC_ATMEL_MCI_H
3
4#include <linux/platform_data/dma-atmel.h>
5#include <linux/platform_data/dma-dw.h>
6
7/**
8 * struct mci_dma_data - DMA data for MCI interface
9 */
10struct mci_dma_data {
11#ifdef CONFIG_ARM
12 struct at_dma_slave sdata;
13#else
14 struct dw_dma_slave sdata;
15#endif
16};
17
18/* accessor macros */
19#define slave_data_ptr(s) (&(s)->sdata)
20#define find_slave_dev(s) ((s)->sdata.dma_dev)
21
22#endif /* __MMC_ATMEL_MCI_H */
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h
index 51e70cf25cbc..5c188f4e9bec 100644
--- a/include/linux/platform_data/mmc-omap.h
+++ b/include/linux/platform_data/mmc-omap.h
@@ -10,32 +10,8 @@
10 10
11#define OMAP_MMC_MAX_SLOTS 2 11#define OMAP_MMC_MAX_SLOTS 2
12 12
13/*
14 * struct omap_mmc_dev_attr.flags possibilities
15 *
16 * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
17 * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
18 * should be set if this is the case. See for example Section 22.5.3
19 * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
20 * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
21 *
22 * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
23 * don't work correctly on some MMC controller instances on some
24 * OMAP3 SoCs; this flag should be set if this is the case. See
25 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
26 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
27 * Revision F (October 2010) (SPRZ278F).
28 */
29#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
30#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
31#define OMAP_HSMMC_SWAKEUP_MISSING BIT(2)
32
33struct mmc_card; 13struct mmc_card;
34 14
35struct omap_mmc_dev_attr {
36 u8 flags;
37};
38
39struct omap_mmc_platform_data { 15struct omap_mmc_platform_data {
40 /* back-link to device */ 16 /* back-link to device */
41 struct device *dev; 17 struct device *dev;
@@ -106,9 +82,6 @@ struct omap_mmc_platform_data {
106 unsigned vcc_aux_disable_is_sleep:1; 82 unsigned vcc_aux_disable_is_sleep:1;
107 83
108 /* we can put the features above into this variable */ 84 /* we can put the features above into this variable */
109#define HSMMC_HAS_PBIAS (1 << 0)
110#define HSMMC_HAS_UPDATED_RESET (1 << 1)
111#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
112#define MMC_OMAP7XX (1 << 3) 85#define MMC_OMAP7XX (1 << 3)
113#define MMC_OMAP15XX (1 << 4) 86#define MMC_OMAP15XX (1 << 4)
114#define MMC_OMAP16XX (1 << 5) 87#define MMC_OMAP16XX (1 << 5)
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
index 27d3156d093a..9e20c2fb4ffd 100644
--- a/include/linux/platform_data/pxa_sdhci.h
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -55,9 +55,4 @@ struct sdhci_pxa_platdata {
55 unsigned int quirks2; 55 unsigned int quirks2;
56 unsigned int pm_caps; 56 unsigned int pm_caps;
57}; 57};
58
59struct sdhci_pxa {
60 u8 clk_enable;
61 u8 power_mode;
62};
63#endif /* _PXA_SDHCI_H_ */ 58#endif /* _PXA_SDHCI_H_ */
diff --git a/include/linux/platform_data/serial-omap.h b/include/linux/platform_data/serial-omap.h
index c860c1b314c0..d09275f3cde3 100644
--- a/include/linux/platform_data/serial-omap.h
+++ b/include/linux/platform_data/serial-omap.h
@@ -38,9 +38,6 @@ struct omap_uart_port_info {
38 unsigned int dma_rx_timeout; 38 unsigned int dma_rx_timeout;
39 unsigned int autosuspend_timeout; 39 unsigned int autosuspend_timeout;
40 unsigned int dma_rx_poll_rate; 40 unsigned int dma_rx_poll_rate;
41 int DTR_gpio;
42 int DTR_inverted;
43 int DTR_present;
44 41
45 int (*get_context_loss_count)(struct device *); 42 int (*get_context_loss_count)(struct device *);
46 void (*enable_wakeup)(struct device *, bool); 43 void (*enable_wakeup)(struct device *, bool);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 73e938b7e937..2e0e06daf8c0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -72,8 +72,10 @@ struct generic_pm_domain {
72 bool max_off_time_changed; 72 bool max_off_time_changed;
73 bool cached_power_down_ok; 73 bool cached_power_down_ok;
74 struct gpd_cpuidle_data *cpuidle_data; 74 struct gpd_cpuidle_data *cpuidle_data;
75 void (*attach_dev)(struct device *dev); 75 int (*attach_dev)(struct generic_pm_domain *domain,
76 void (*detach_dev)(struct device *dev); 76 struct device *dev);
77 void (*detach_dev)(struct generic_pm_domain *domain,
78 struct device *dev);
77}; 79};
78 80
79static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) 81static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
@@ -104,7 +106,7 @@ struct generic_pm_domain_data {
104 struct notifier_block nb; 106 struct notifier_block nb;
105 struct mutex lock; 107 struct mutex lock;
106 unsigned int refcount; 108 unsigned int refcount;
107 bool need_restore; 109 int need_restore;
108}; 110};
109 111
110#ifdef CONFIG_PM_GENERIC_DOMAINS 112#ifdef CONFIG_PM_GENERIC_DOMAINS
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index 07e7945a1ff2..e97fc656a058 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -253,9 +253,6 @@ struct charger_manager {
253 struct device *dev; 253 struct device *dev;
254 struct charger_desc *desc; 254 struct charger_desc *desc;
255 255
256 struct power_supply *fuel_gauge;
257 struct power_supply **charger_stat;
258
259#ifdef CONFIG_THERMAL 256#ifdef CONFIG_THERMAL
260 struct thermal_zone_device *tzd_batt; 257 struct thermal_zone_device *tzd_batt;
261#endif 258#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3ed049673022..096dbced02ac 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -200,6 +200,12 @@ struct power_supply {
200 void (*external_power_changed)(struct power_supply *psy); 200 void (*external_power_changed)(struct power_supply *psy);
201 void (*set_charged)(struct power_supply *psy); 201 void (*set_charged)(struct power_supply *psy);
202 202
203 /*
204 * Set if thermal zone should not be created for this power supply.
205 * For example for virtual supplies forwarding calls to actual
206 * sensors or other supplies.
207 */
208 bool no_thermal;
203 /* For APM emulation, think legacy userspace. */ 209 /* For APM emulation, think legacy userspace. */
204 int use_for_apm; 210 int use_for_apm;
205 211
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 53ff1a752d7e..ed4f5939a452 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -57,7 +57,7 @@ enum rcutorture_type {
57 INVALID_RCU_FLAVOR 57 INVALID_RCU_FLAVOR
58}; 58};
59 59
60#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 60#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
61void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, 61void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
62 unsigned long *gpnum, unsigned long *completed); 62 unsigned long *gpnum, unsigned long *completed);
63void rcutorture_record_test_transition(void); 63void rcutorture_record_test_transition(void);
@@ -260,7 +260,7 @@ static inline int rcu_preempt_depth(void)
260void rcu_init(void); 260void rcu_init(void);
261void rcu_sched_qs(void); 261void rcu_sched_qs(void);
262void rcu_bh_qs(void); 262void rcu_bh_qs(void);
263void rcu_check_callbacks(int cpu, int user); 263void rcu_check_callbacks(int user);
264struct notifier_block; 264struct notifier_block;
265void rcu_idle_enter(void); 265void rcu_idle_enter(void);
266void rcu_idle_exit(void); 266void rcu_idle_exit(void);
@@ -348,8 +348,8 @@ extern struct srcu_struct tasks_rcu_exit_srcu;
348 */ 348 */
349#define cond_resched_rcu_qs() \ 349#define cond_resched_rcu_qs() \
350do { \ 350do { \
351 rcu_note_voluntary_context_switch(current); \ 351 if (!cond_resched()) \
352 cond_resched(); \ 352 rcu_note_voluntary_context_switch(current); \
353} while (0) 353} while (0)
354 354
355#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) 355#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP)
@@ -365,7 +365,7 @@ typedef void call_rcu_func_t(struct rcu_head *head,
365 void (*func)(struct rcu_head *head)); 365 void (*func)(struct rcu_head *head));
366void wait_rcu_gp(call_rcu_func_t crf); 366void wait_rcu_gp(call_rcu_func_t crf);
367 367
368#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 368#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
369#include <linux/rcutree.h> 369#include <linux/rcutree.h>
370#elif defined(CONFIG_TINY_RCU) 370#elif defined(CONFIG_TINY_RCU)
371#include <linux/rcutiny.h> 371#include <linux/rcutiny.h>
@@ -867,7 +867,7 @@ static inline void rcu_preempt_sleep_check(void)
867 * 867 *
868 * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), 868 * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
869 * it is illegal to block while in an RCU read-side critical section. 869 * it is illegal to block while in an RCU read-side critical section.
870 * In preemptible RCU implementations (TREE_PREEMPT_RCU) in CONFIG_PREEMPT 870 * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT
871 * kernel builds, RCU read-side critical sections may be preempted, 871 * kernel builds, RCU read-side critical sections may be preempted,
872 * but explicit blocking is illegal. Finally, in preemptible RCU 872 * but explicit blocking is illegal. Finally, in preemptible RCU
873 * implementations in real-time (with -rt patchset) kernel builds, RCU 873 * implementations in real-time (with -rt patchset) kernel builds, RCU
@@ -902,7 +902,9 @@ static inline void rcu_read_lock(void)
902 * Unfortunately, this function acquires the scheduler's runqueue and 902 * Unfortunately, this function acquires the scheduler's runqueue and
903 * priority-inheritance spinlocks. This means that deadlock could result 903 * priority-inheritance spinlocks. This means that deadlock could result
904 * if the caller of rcu_read_unlock() already holds one of these locks or 904 * if the caller of rcu_read_unlock() already holds one of these locks or
905 * any lock that is ever acquired while holding them. 905 * any lock that is ever acquired while holding them; or any lock which
906 * can be taken from interrupt context because rcu_boost()->rt_mutex_lock()
907 * does not disable irqs while taking ->wait_lock.
906 * 908 *
907 * That said, RCU readers are never priority boosted unless they were 909 * That said, RCU readers are never priority boosted unless they were
908 * preempted. Therefore, one way to avoid deadlock is to make sure 910 * preempted. Therefore, one way to avoid deadlock is to make sure
@@ -1062,6 +1064,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
1062 */ 1064 */
1063#define RCU_INIT_POINTER(p, v) \ 1065#define RCU_INIT_POINTER(p, v) \
1064 do { \ 1066 do { \
1067 rcu_dereference_sparse(p, __rcu); \
1065 p = RCU_INITIALIZER(v); \ 1068 p = RCU_INITIALIZER(v); \
1066 } while (0) 1069 } while (0)
1067 1070
@@ -1118,7 +1121,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
1118 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) 1121 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
1119 1122
1120#if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) 1123#if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL)
1121static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) 1124static inline int rcu_needs_cpu(unsigned long *delta_jiffies)
1122{ 1125{
1123 *delta_jiffies = ULONG_MAX; 1126 *delta_jiffies = ULONG_MAX;
1124 return 0; 1127 return 0;
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 38cc5b1e252d..0e5366200154 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -78,7 +78,7 @@ static inline void kfree_call_rcu(struct rcu_head *head,
78 call_rcu(head, func); 78 call_rcu(head, func);
79} 79}
80 80
81static inline void rcu_note_context_switch(int cpu) 81static inline void rcu_note_context_switch(void)
82{ 82{
83 rcu_sched_qs(); 83 rcu_sched_qs();
84} 84}
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 3e2f5d432743..52953790dcca 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -30,9 +30,9 @@
30#ifndef __LINUX_RCUTREE_H 30#ifndef __LINUX_RCUTREE_H
31#define __LINUX_RCUTREE_H 31#define __LINUX_RCUTREE_H
32 32
33void rcu_note_context_switch(int cpu); 33void rcu_note_context_switch(void);
34#ifndef CONFIG_RCU_NOCB_CPU_ALL 34#ifndef CONFIG_RCU_NOCB_CPU_ALL
35int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); 35int rcu_needs_cpu(unsigned long *delta_jiffies);
36#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ 36#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
37void rcu_cpu_stall_reset(void); 37void rcu_cpu_stall_reset(void);
38 38
@@ -43,7 +43,7 @@ void rcu_cpu_stall_reset(void);
43 */ 43 */
44static inline void rcu_virt_note_context_switch(int cpu) 44static inline void rcu_virt_note_context_switch(int cpu)
45{ 45{
46 rcu_note_context_switch(cpu); 46 rcu_note_context_switch();
47} 47}
48 48
49void synchronize_rcu_bh(void); 49void synchronize_rcu_bh(void);
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index c5ed83f49c4e..4419b99d8d6e 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -27,6 +27,7 @@ struct spmi_device;
27struct regmap; 27struct regmap;
28struct regmap_range_cfg; 28struct regmap_range_cfg;
29struct regmap_field; 29struct regmap_field;
30struct snd_ac97;
30 31
31/* An enum of all the supported cache types */ 32/* An enum of all the supported cache types */
32enum regcache_type { 33enum regcache_type {
@@ -340,6 +341,8 @@ struct regmap *regmap_init_spmi_ext(struct spmi_device *dev,
340struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, 341struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id,
341 void __iomem *regs, 342 void __iomem *regs,
342 const struct regmap_config *config); 343 const struct regmap_config *config);
344struct regmap *regmap_init_ac97(struct snd_ac97 *ac97,
345 const struct regmap_config *config);
343 346
344struct regmap *devm_regmap_init(struct device *dev, 347struct regmap *devm_regmap_init(struct device *dev,
345 const struct regmap_bus *bus, 348 const struct regmap_bus *bus,
@@ -356,6 +359,10 @@ struct regmap *devm_regmap_init_spmi_ext(struct spmi_device *dev,
356struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, 359struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id,
357 void __iomem *regs, 360 void __iomem *regs,
358 const struct regmap_config *config); 361 const struct regmap_config *config);
362struct regmap *devm_regmap_init_ac97(struct snd_ac97 *ac97,
363 const struct regmap_config *config);
364
365bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
359 366
360/** 367/**
361 * regmap_init_mmio(): Initialise register map 368 * regmap_init_mmio(): Initialise register map
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index f540b1496e2f..d17e1ff7ad01 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -101,6 +101,8 @@ struct regmap;
101 * Data passed is "struct pre_voltage_change_data" 101 * Data passed is "struct pre_voltage_change_data"
102 * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason. 102 * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason.
103 * Data passed is old voltage cast to (void *). 103 * Data passed is old voltage cast to (void *).
104 * PRE_DISABLE Regulator is about to be disabled
105 * ABORT_DISABLE Regulator disable failed for some reason
104 * 106 *
105 * NOTE: These events can be OR'ed together when passed into handler. 107 * NOTE: These events can be OR'ed together when passed into handler.
106 */ 108 */
@@ -115,6 +117,8 @@ struct regmap;
115#define REGULATOR_EVENT_DISABLE 0x80 117#define REGULATOR_EVENT_DISABLE 0x80
116#define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100 118#define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100
117#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200 119#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200
120#define REGULATOR_EVENT_PRE_DISABLE 0x400
121#define REGULATOR_EVENT_ABORT_DISABLE 0x800
118 122
119/** 123/**
120 * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event 124 * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event
@@ -284,7 +288,7 @@ devm_regulator_get(struct device *dev, const char *id)
284static inline struct regulator *__must_check 288static inline struct regulator *__must_check
285regulator_get_exclusive(struct device *dev, const char *id) 289regulator_get_exclusive(struct device *dev, const char *id)
286{ 290{
287 return NULL; 291 return ERR_PTR(-ENODEV);
288} 292}
289 293
290static inline struct regulator *__must_check 294static inline struct regulator *__must_check
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index fc0ee0ce8325..5f1e9ca47417 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -243,6 +243,8 @@ enum regulator_type {
243 * 243 *
244 * @enable_time: Time taken for initial enable of regulator (in uS). 244 * @enable_time: Time taken for initial enable of regulator (in uS).
245 * @off_on_delay: guard time (in uS), before re-enabling a regulator 245 * @off_on_delay: guard time (in uS), before re-enabling a regulator
246 *
247 * @of_map_mode: Maps a hardware mode defined in a DeviceTree to a standard mode
246 */ 248 */
247struct regulator_desc { 249struct regulator_desc {
248 const char *name; 250 const char *name;
@@ -285,6 +287,8 @@ struct regulator_desc {
285 unsigned int enable_time; 287 unsigned int enable_time;
286 288
287 unsigned int off_on_delay; 289 unsigned int off_on_delay;
290
291 unsigned int (*of_map_mode)(unsigned int mode);
288}; 292};
289 293
290/** 294/**
@@ -301,6 +305,9 @@ struct regulator_desc {
301 * NULL). 305 * NULL).
302 * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is 306 * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is
303 * insufficient. 307 * insufficient.
308 * @ena_gpio_initialized: GPIO controlling regulator enable was properly
309 * initialized, meaning that >= 0 is a valid gpio
310 * identifier and < 0 is a non existent gpio.
304 * @ena_gpio: GPIO controlling regulator enable. 311 * @ena_gpio: GPIO controlling regulator enable.
305 * @ena_gpio_invert: Sense for GPIO enable control. 312 * @ena_gpio_invert: Sense for GPIO enable control.
306 * @ena_gpio_flags: Flags to use when calling gpio_request_one() 313 * @ena_gpio_flags: Flags to use when calling gpio_request_one()
@@ -312,6 +319,7 @@ struct regulator_config {
312 struct device_node *of_node; 319 struct device_node *of_node;
313 struct regmap *regmap; 320 struct regmap *regmap;
314 321
322 bool ena_gpio_initialized;
315 int ena_gpio; 323 int ena_gpio;
316 unsigned int ena_gpio_invert:1; 324 unsigned int ena_gpio_invert:1;
317 unsigned int ena_gpio_flags; 325 unsigned int ena_gpio_flags;
diff --git a/include/linux/regulator/of_regulator.h b/include/linux/regulator/of_regulator.h
index f9217965aaa3..763953f7e3b8 100644
--- a/include/linux/regulator/of_regulator.h
+++ b/include/linux/regulator/of_regulator.h
@@ -6,24 +6,29 @@
6#ifndef __LINUX_OF_REG_H 6#ifndef __LINUX_OF_REG_H
7#define __LINUX_OF_REG_H 7#define __LINUX_OF_REG_H
8 8
9struct regulator_desc;
10
9struct of_regulator_match { 11struct of_regulator_match {
10 const char *name; 12 const char *name;
11 void *driver_data; 13 void *driver_data;
12 struct regulator_init_data *init_data; 14 struct regulator_init_data *init_data;
13 struct device_node *of_node; 15 struct device_node *of_node;
16 const struct regulator_desc *desc;
14}; 17};
15 18
16#if defined(CONFIG_OF) 19#if defined(CONFIG_OF)
17extern struct regulator_init_data 20extern struct regulator_init_data
18 *of_get_regulator_init_data(struct device *dev, 21 *of_get_regulator_init_data(struct device *dev,
19 struct device_node *node); 22 struct device_node *node,
23 const struct regulator_desc *desc);
20extern int of_regulator_match(struct device *dev, struct device_node *node, 24extern int of_regulator_match(struct device *dev, struct device_node *node,
21 struct of_regulator_match *matches, 25 struct of_regulator_match *matches,
22 unsigned int num_matches); 26 unsigned int num_matches);
23#else 27#else
24static inline struct regulator_init_data 28static inline struct regulator_init_data
25 *of_get_regulator_init_data(struct device *dev, 29 *of_get_regulator_init_data(struct device *dev,
26 struct device_node *node) 30 struct device_node *node,
31 const struct regulator_desc *desc)
27{ 32{
28 return NULL; 33 return NULL;
29} 34}
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index 41a4695fde08..ce6b962ffed4 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -12,11 +12,13 @@ struct reset_controller_dev;
12 * things to reset the device 12 * things to reset the device
13 * @assert: manually assert the reset line, if supported 13 * @assert: manually assert the reset line, if supported
14 * @deassert: manually deassert the reset line, if supported 14 * @deassert: manually deassert the reset line, if supported
15 * @status: return the status of the reset line, if supported
15 */ 16 */
16struct reset_control_ops { 17struct reset_control_ops {
17 int (*reset)(struct reset_controller_dev *rcdev, unsigned long id); 18 int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
18 int (*assert)(struct reset_controller_dev *rcdev, unsigned long id); 19 int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
19 int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id); 20 int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
21 int (*status)(struct reset_controller_dev *rcdev, unsigned long id);
20}; 22};
21 23
22struct module; 24struct module;
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 349f150ae12c..da5602bd77d7 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -10,6 +10,7 @@ struct reset_control;
10int reset_control_reset(struct reset_control *rstc); 10int reset_control_reset(struct reset_control *rstc);
11int reset_control_assert(struct reset_control *rstc); 11int reset_control_assert(struct reset_control *rstc);
12int reset_control_deassert(struct reset_control *rstc); 12int reset_control_deassert(struct reset_control *rstc);
13int reset_control_status(struct reset_control *rstc);
13 14
14struct reset_control *reset_control_get(struct device *dev, const char *id); 15struct reset_control *reset_control_get(struct device *dev, const char *id);
15void reset_control_put(struct reset_control *rstc); 16void reset_control_put(struct reset_control *rstc);
@@ -57,6 +58,12 @@ static inline int reset_control_deassert(struct reset_control *rstc)
57 return 0; 58 return 0;
58} 59}
59 60
61static inline int reset_control_status(struct reset_control *rstc)
62{
63 WARN_ON(1);
64 return 0;
65}
66
60static inline void reset_control_put(struct reset_control *rstc) 67static inline void reset_control_put(struct reset_control *rstc)
61{ 68{
62 WARN_ON(1); 69 WARN_ON(1);
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 49a4d6f59108..e2c13cd863bd 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -97,7 +97,7 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k
97 __ring_buffer_alloc((size), (flags), &__key); \ 97 __ring_buffer_alloc((size), (flags), &__key); \
98}) 98})
99 99
100int ring_buffer_wait(struct ring_buffer *buffer, int cpu); 100int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full);
101int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, 101int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
102 struct file *filp, poll_table *poll_table); 102 struct file *filp, poll_table *poll_table);
103 103
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index c2c28975293c..6d6be09a2fe5 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -19,11 +19,28 @@
19extern int rtc_month_days(unsigned int month, unsigned int year); 19extern int rtc_month_days(unsigned int month, unsigned int year);
20extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); 20extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
21extern int rtc_valid_tm(struct rtc_time *tm); 21extern int rtc_valid_tm(struct rtc_time *tm);
22extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 22extern time64_t rtc_tm_to_time64(struct rtc_time *tm);
23extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 23extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm);
24ktime_t rtc_tm_to_ktime(struct rtc_time tm); 24ktime_t rtc_tm_to_ktime(struct rtc_time tm);
25struct rtc_time rtc_ktime_to_tm(ktime_t kt); 25struct rtc_time rtc_ktime_to_tm(ktime_t kt);
26 26
27/**
28 * Deprecated. Use rtc_time64_to_tm().
29 */
30static inline void rtc_time_to_tm(unsigned long time, struct rtc_time *tm)
31{
32 rtc_time64_to_tm(time, tm);
33}
34
35/**
36 * Deprecated. Use rtc_tm_to_time64().
37 */
38static inline int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time)
39{
40 *time = rtc_tm_to_time64(tm);
41
42 return 0;
43}
27 44
28#include <linux/device.h> 45#include <linux/device.h>
29#include <linux/seq_file.h> 46#include <linux/seq_file.h>
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5e344bbe63ec..55f5ee7cc3d3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -243,6 +243,43 @@ extern char ___assert_task_state[1 - 2*!!(
243 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ 243 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
244 (task->flags & PF_FROZEN) == 0) 244 (task->flags & PF_FROZEN) == 0)
245 245
246#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
247
248#define __set_task_state(tsk, state_value) \
249 do { \
250 (tsk)->task_state_change = _THIS_IP_; \
251 (tsk)->state = (state_value); \
252 } while (0)
253#define set_task_state(tsk, state_value) \
254 do { \
255 (tsk)->task_state_change = _THIS_IP_; \
256 set_mb((tsk)->state, (state_value)); \
257 } while (0)
258
259/*
260 * set_current_state() includes a barrier so that the write of current->state
261 * is correctly serialised wrt the caller's subsequent test of whether to
262 * actually sleep:
263 *
264 * set_current_state(TASK_UNINTERRUPTIBLE);
265 * if (do_i_need_to_sleep())
266 * schedule();
267 *
268 * If the caller does not need such serialisation then use __set_current_state()
269 */
270#define __set_current_state(state_value) \
271 do { \
272 current->task_state_change = _THIS_IP_; \
273 current->state = (state_value); \
274 } while (0)
275#define set_current_state(state_value) \
276 do { \
277 current->task_state_change = _THIS_IP_; \
278 set_mb(current->state, (state_value)); \
279 } while (0)
280
281#else
282
246#define __set_task_state(tsk, state_value) \ 283#define __set_task_state(tsk, state_value) \
247 do { (tsk)->state = (state_value); } while (0) 284 do { (tsk)->state = (state_value); } while (0)
248#define set_task_state(tsk, state_value) \ 285#define set_task_state(tsk, state_value) \
@@ -259,11 +296,13 @@ extern char ___assert_task_state[1 - 2*!!(
259 * 296 *
260 * If the caller does not need such serialisation then use __set_current_state() 297 * If the caller does not need such serialisation then use __set_current_state()
261 */ 298 */
262#define __set_current_state(state_value) \ 299#define __set_current_state(state_value) \
263 do { current->state = (state_value); } while (0) 300 do { current->state = (state_value); } while (0)
264#define set_current_state(state_value) \ 301#define set_current_state(state_value) \
265 set_mb(current->state, (state_value)) 302 set_mb(current->state, (state_value))
266 303
304#endif
305
267/* Task command name length */ 306/* Task command name length */
268#define TASK_COMM_LEN 16 307#define TASK_COMM_LEN 16
269 308
@@ -1278,9 +1317,9 @@ struct task_struct {
1278 union rcu_special rcu_read_unlock_special; 1317 union rcu_special rcu_read_unlock_special;
1279 struct list_head rcu_node_entry; 1318 struct list_head rcu_node_entry;
1280#endif /* #ifdef CONFIG_PREEMPT_RCU */ 1319#endif /* #ifdef CONFIG_PREEMPT_RCU */
1281#ifdef CONFIG_TREE_PREEMPT_RCU 1320#ifdef CONFIG_PREEMPT_RCU
1282 struct rcu_node *rcu_blocked_node; 1321 struct rcu_node *rcu_blocked_node;
1283#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 1322#endif /* #ifdef CONFIG_PREEMPT_RCU */
1284#ifdef CONFIG_TASKS_RCU 1323#ifdef CONFIG_TASKS_RCU
1285 unsigned long rcu_tasks_nvcsw; 1324 unsigned long rcu_tasks_nvcsw;
1286 bool rcu_tasks_holdout; 1325 bool rcu_tasks_holdout;
@@ -1558,28 +1597,23 @@ struct task_struct {
1558 struct numa_group *numa_group; 1597 struct numa_group *numa_group;
1559 1598
1560 /* 1599 /*
1561 * Exponential decaying average of faults on a per-node basis. 1600 * numa_faults is an array split into four regions:
1562 * Scheduling placement decisions are made based on the these counts. 1601 * faults_memory, faults_cpu, faults_memory_buffer, faults_cpu_buffer
1563 * The values remain static for the duration of a PTE scan 1602 * in this precise order.
1603 *
1604 * faults_memory: Exponential decaying average of faults on a per-node
1605 * basis. Scheduling placement decisions are made based on these
1606 * counts. The values remain static for the duration of a PTE scan.
1607 * faults_cpu: Track the nodes the process was running on when a NUMA
1608 * hinting fault was incurred.
1609 * faults_memory_buffer and faults_cpu_buffer: Record faults per node
1610 * during the current scan window. When the scan completes, the counts
1611 * in faults_memory and faults_cpu decay and these values are copied.
1564 */ 1612 */
1565 unsigned long *numa_faults_memory; 1613 unsigned long *numa_faults;
1566 unsigned long total_numa_faults; 1614 unsigned long total_numa_faults;
1567 1615
1568 /* 1616 /*
1569 * numa_faults_buffer records faults per node during the current
1570 * scan window. When the scan completes, the counts in
1571 * numa_faults_memory decay and these values are copied.
1572 */
1573 unsigned long *numa_faults_buffer_memory;
1574
1575 /*
1576 * Track the nodes the process was running on when a NUMA hinting
1577 * fault was incurred.
1578 */
1579 unsigned long *numa_faults_cpu;
1580 unsigned long *numa_faults_buffer_cpu;
1581
1582 /*
1583 * numa_faults_locality tracks if faults recorded during the last 1617 * numa_faults_locality tracks if faults recorded during the last
1584 * scan window were remote/local. The task scan period is adapted 1618 * scan window were remote/local. The task scan period is adapted
1585 * based on the locality of the faults with different weights 1619 * based on the locality of the faults with different weights
@@ -1661,6 +1695,9 @@ struct task_struct {
1661 unsigned int sequential_io; 1695 unsigned int sequential_io;
1662 unsigned int sequential_io_avg; 1696 unsigned int sequential_io_avg;
1663#endif 1697#endif
1698#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
1699 unsigned long task_state_change;
1700#endif
1664}; 1701};
1665 1702
1666/* Future-safe accessor for struct task_struct's cpus_allowed. */ 1703/* Future-safe accessor for struct task_struct's cpus_allowed. */
@@ -2052,6 +2089,10 @@ static inline void tsk_restore_flags(struct task_struct *task,
2052 task->flags |= orig_flags & flags; 2089 task->flags |= orig_flags & flags;
2053} 2090}
2054 2091
2092extern int cpuset_cpumask_can_shrink(const struct cpumask *cur,
2093 const struct cpumask *trial);
2094extern int task_can_attach(struct task_struct *p,
2095 const struct cpumask *cs_cpus_allowed);
2055#ifdef CONFIG_SMP 2096#ifdef CONFIG_SMP
2056extern void do_set_cpus_allowed(struct task_struct *p, 2097extern void do_set_cpus_allowed(struct task_struct *p,
2057 const struct cpumask *new_mask); 2098 const struct cpumask *new_mask);
@@ -2760,7 +2801,7 @@ static inline int signal_pending_state(long state, struct task_struct *p)
2760extern int _cond_resched(void); 2801extern int _cond_resched(void);
2761 2802
2762#define cond_resched() ({ \ 2803#define cond_resched() ({ \
2763 __might_sleep(__FILE__, __LINE__, 0); \ 2804 ___might_sleep(__FILE__, __LINE__, 0); \
2764 _cond_resched(); \ 2805 _cond_resched(); \
2765}) 2806})
2766 2807
@@ -2773,14 +2814,14 @@ extern int __cond_resched_lock(spinlock_t *lock);
2773#endif 2814#endif
2774 2815
2775#define cond_resched_lock(lock) ({ \ 2816#define cond_resched_lock(lock) ({ \
2776 __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \ 2817 ___might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET);\
2777 __cond_resched_lock(lock); \ 2818 __cond_resched_lock(lock); \
2778}) 2819})
2779 2820
2780extern int __cond_resched_softirq(void); 2821extern int __cond_resched_softirq(void);
2781 2822
2782#define cond_resched_softirq() ({ \ 2823#define cond_resched_softirq() ({ \
2783 __might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \ 2824 ___might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \
2784 __cond_resched_softirq(); \ 2825 __cond_resched_softirq(); \
2785}) 2826})
2786 2827
diff --git a/include/linux/socket.h b/include/linux/socket.h
index ec538fc287a6..bb9b83640070 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -256,7 +256,7 @@ struct ucred {
256#define MSG_EOF MSG_FIN 256#define MSG_EOF MSG_FIN
257 257
258#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */ 258#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
259#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file 259#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exec for file
260 descriptor received through 260 descriptor received through
261 SCM_RIGHTS */ 261 SCM_RIGHTS */
262#if defined(CONFIG_COMPAT) 262#if defined(CONFIG_COMPAT)
diff --git a/include/linux/time.h b/include/linux/time.h
index 8c42cf8d2444..203c2ad40d71 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -39,9 +39,20 @@ static inline int timeval_compare(const struct timeval *lhs, const struct timeva
39 return lhs->tv_usec - rhs->tv_usec; 39 return lhs->tv_usec - rhs->tv_usec;
40} 40}
41 41
42extern unsigned long mktime(const unsigned int year, const unsigned int mon, 42extern time64_t mktime64(const unsigned int year, const unsigned int mon,
43 const unsigned int day, const unsigned int hour, 43 const unsigned int day, const unsigned int hour,
44 const unsigned int min, const unsigned int sec); 44 const unsigned int min, const unsigned int sec);
45
46/**
47 * Deprecated. Use mktime64().
48 */
49static inline unsigned long mktime(const unsigned int year,
50 const unsigned int mon, const unsigned int day,
51 const unsigned int hour, const unsigned int min,
52 const unsigned int sec)
53{
54 return mktime64(year, mon, day, hour, min, sec);
55}
45 56
46extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); 57extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);
47 58
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h
index 95640dcd1899..05af9a334893 100644
--- a/include/linux/timekeeper_internal.h
+++ b/include/linux/timekeeper_internal.h
@@ -42,6 +42,7 @@ struct tk_read_base {
42 * struct timekeeper - Structure holding internal timekeeping values. 42 * struct timekeeper - Structure holding internal timekeeping values.
43 * @tkr: The readout base structure 43 * @tkr: The readout base structure
44 * @xtime_sec: Current CLOCK_REALTIME time in seconds 44 * @xtime_sec: Current CLOCK_REALTIME time in seconds
45 * @ktime_sec: Current CLOCK_MONOTONIC time in seconds
45 * @wall_to_monotonic: CLOCK_REALTIME to CLOCK_MONOTONIC offset 46 * @wall_to_monotonic: CLOCK_REALTIME to CLOCK_MONOTONIC offset
46 * @offs_real: Offset clock monotonic -> clock realtime 47 * @offs_real: Offset clock monotonic -> clock realtime
47 * @offs_boot: Offset clock monotonic -> clock boottime 48 * @offs_boot: Offset clock monotonic -> clock boottime
@@ -77,6 +78,7 @@ struct tk_read_base {
77struct timekeeper { 78struct timekeeper {
78 struct tk_read_base tkr; 79 struct tk_read_base tkr;
79 u64 xtime_sec; 80 u64 xtime_sec;
81 unsigned long ktime_sec;
80 struct timespec64 wall_to_monotonic; 82 struct timespec64 wall_to_monotonic;
81 ktime_t offs_real; 83 ktime_t offs_real;
82 ktime_t offs_boot; 84 ktime_t offs_boot;
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 1caa6b04fdc5..9b63d13ba82b 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -10,7 +10,7 @@ extern int timekeeping_suspended;
10 * Get and set timeofday 10 * Get and set timeofday
11 */ 11 */
12extern void do_gettimeofday(struct timeval *tv); 12extern void do_gettimeofday(struct timeval *tv);
13extern int do_settimeofday(const struct timespec *tv); 13extern int do_settimeofday64(const struct timespec64 *ts);
14extern int do_sys_settimeofday(const struct timespec *tv, 14extern int do_sys_settimeofday(const struct timespec *tv,
15 const struct timezone *tz); 15 const struct timezone *tz);
16 16
@@ -25,14 +25,24 @@ struct timespec __current_kernel_time(void);
25/* 25/*
26 * timespec based interfaces 26 * timespec based interfaces
27 */ 27 */
28struct timespec get_monotonic_coarse(void); 28struct timespec64 get_monotonic_coarse64(void);
29extern void getrawmonotonic(struct timespec *ts); 29extern void getrawmonotonic64(struct timespec64 *ts);
30extern void ktime_get_ts64(struct timespec64 *ts); 30extern void ktime_get_ts64(struct timespec64 *ts);
31extern time64_t ktime_get_seconds(void);
32extern time64_t ktime_get_real_seconds(void);
31 33
32extern int __getnstimeofday64(struct timespec64 *tv); 34extern int __getnstimeofday64(struct timespec64 *tv);
33extern void getnstimeofday64(struct timespec64 *tv); 35extern void getnstimeofday64(struct timespec64 *tv);
34 36
35#if BITS_PER_LONG == 64 37#if BITS_PER_LONG == 64
38/**
39 * Deprecated. Use do_settimeofday64().
40 */
41static inline int do_settimeofday(const struct timespec *ts)
42{
43 return do_settimeofday64(ts);
44}
45
36static inline int __getnstimeofday(struct timespec *ts) 46static inline int __getnstimeofday(struct timespec *ts)
37{ 47{
38 return __getnstimeofday64(ts); 48 return __getnstimeofday64(ts);
@@ -53,7 +63,27 @@ static inline void ktime_get_real_ts(struct timespec *ts)
53 getnstimeofday64(ts); 63 getnstimeofday64(ts);
54} 64}
55 65
66static inline void getrawmonotonic(struct timespec *ts)
67{
68 getrawmonotonic64(ts);
69}
70
71static inline struct timespec get_monotonic_coarse(void)
72{
73 return get_monotonic_coarse64();
74}
56#else 75#else
76/**
77 * Deprecated. Use do_settimeofday64().
78 */
79static inline int do_settimeofday(const struct timespec *ts)
80{
81 struct timespec64 ts64;
82
83 ts64 = timespec_to_timespec64(*ts);
84 return do_settimeofday64(&ts64);
85}
86
57static inline int __getnstimeofday(struct timespec *ts) 87static inline int __getnstimeofday(struct timespec *ts)
58{ 88{
59 struct timespec64 ts64; 89 struct timespec64 ts64;
@@ -86,6 +116,19 @@ static inline void ktime_get_real_ts(struct timespec *ts)
86 getnstimeofday64(&ts64); 116 getnstimeofday64(&ts64);
87 *ts = timespec64_to_timespec(ts64); 117 *ts = timespec64_to_timespec(ts64);
88} 118}
119
120static inline void getrawmonotonic(struct timespec *ts)
121{
122 struct timespec64 ts64;
123
124 getrawmonotonic64(&ts64);
125 *ts = timespec64_to_timespec(ts64);
126}
127
128static inline struct timespec get_monotonic_coarse(void)
129{
130 return timespec64_to_timespec(get_monotonic_coarse64());
131}
89#endif 132#endif
90 133
91extern void getboottime(struct timespec *ts); 134extern void getboottime(struct timespec *ts);
@@ -182,7 +225,7 @@ static inline void timekeeping_clocktai(struct timespec *ts)
182/* 225/*
183 * RTC specific 226 * RTC specific
184 */ 227 */
185extern void timekeeping_inject_sleeptime(struct timespec *delta); 228extern void timekeeping_inject_sleeptime64(struct timespec64 *delta);
186 229
187/* 230/*
188 * PPS accessor 231 * PPS accessor
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index a4c9547aae64..f8e76e08ebe4 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -15,8 +15,6 @@
15#define _LINUX_VEXPRESS_H 15#define _LINUX_VEXPRESS_H
16 16
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/platform_device.h>
19#include <linux/reboot.h>
20#include <linux/regmap.h> 18#include <linux/regmap.h>
21 19
22#define VEXPRESS_SITE_MB 0 20#define VEXPRESS_SITE_MB 0
@@ -24,13 +22,6 @@
24#define VEXPRESS_SITE_DB2 2 22#define VEXPRESS_SITE_DB2 2
25#define VEXPRESS_SITE_MASTER 0xf 23#define VEXPRESS_SITE_MASTER 0xf
26 24
27#define VEXPRESS_RES_FUNC(_site, _func) \
28{ \
29 .start = (_site), \
30 .end = (_func), \
31 .flags = IORESOURCE_BUS, \
32}
33
34/* Config infrastructure */ 25/* Config infrastructure */
35 26
36void vexpress_config_set_master(u32 site); 27void vexpress_config_set_master(u32 site);
@@ -58,16 +49,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
58 49
59/* Platform control */ 50/* Platform control */
60 51
61unsigned int vexpress_get_mci_cardin(struct device *dev);
62u32 vexpress_get_procid(int site);
63void *vexpress_get_24mhz_clock_base(void);
64void vexpress_flags_set(u32 data); 52void vexpress_flags_set(u32 data);
65 53
66void vexpress_sysreg_early_init(void __iomem *base);
67int vexpress_syscfg_device_register(struct platform_device *pdev);
68
69/* Clocks */
70
71void vexpress_clk_init(void __iomem *sp810_base);
72
73#endif 54#endif
diff --git a/include/linux/wait.h b/include/linux/wait.h
index e4a8eb9312ea..2232ed16635a 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -13,9 +13,12 @@ typedef struct __wait_queue wait_queue_t;
13typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key); 13typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
14int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key); 14int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
15 15
16/* __wait_queue::flags */
17#define WQ_FLAG_EXCLUSIVE 0x01
18#define WQ_FLAG_WOKEN 0x02
19
16struct __wait_queue { 20struct __wait_queue {
17 unsigned int flags; 21 unsigned int flags;
18#define WQ_FLAG_EXCLUSIVE 0x01
19 void *private; 22 void *private;
20 wait_queue_func_t func; 23 wait_queue_func_t func;
21 struct list_head task_list; 24 struct list_head task_list;
@@ -258,11 +261,37 @@ __out: __ret; \
258 */ 261 */
259#define wait_event(wq, condition) \ 262#define wait_event(wq, condition) \
260do { \ 263do { \
264 might_sleep(); \
261 if (condition) \ 265 if (condition) \
262 break; \ 266 break; \
263 __wait_event(wq, condition); \ 267 __wait_event(wq, condition); \
264} while (0) 268} while (0)
265 269
270#define __wait_event_freezable(wq, condition) \
271 ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \
272 schedule(); try_to_freeze())
273
274/**
275 * wait_event - sleep (or freeze) until a condition gets true
276 * @wq: the waitqueue to wait on
277 * @condition: a C expression for the event to wait for
278 *
279 * The process is put to sleep (TASK_INTERRUPTIBLE -- so as not to contribute
280 * to system load) until the @condition evaluates to true. The
281 * @condition is checked each time the waitqueue @wq is woken up.
282 *
283 * wake_up() has to be called after changing any variable that could
284 * change the result of the wait condition.
285 */
286#define wait_event_freezable(wq, condition) \
287({ \
288 int __ret = 0; \
289 might_sleep(); \
290 if (!(condition)) \
291 __ret = __wait_event_freezable(wq, condition); \
292 __ret; \
293})
294
266#define __wait_event_timeout(wq, condition, timeout) \ 295#define __wait_event_timeout(wq, condition, timeout) \
267 ___wait_event(wq, ___wait_cond_timeout(condition), \ 296 ___wait_event(wq, ___wait_cond_timeout(condition), \
268 TASK_UNINTERRUPTIBLE, 0, timeout, \ 297 TASK_UNINTERRUPTIBLE, 0, timeout, \
@@ -290,11 +319,30 @@ do { \
290#define wait_event_timeout(wq, condition, timeout) \ 319#define wait_event_timeout(wq, condition, timeout) \
291({ \ 320({ \
292 long __ret = timeout; \ 321 long __ret = timeout; \
322 might_sleep(); \
293 if (!___wait_cond_timeout(condition)) \ 323 if (!___wait_cond_timeout(condition)) \
294 __ret = __wait_event_timeout(wq, condition, timeout); \ 324 __ret = __wait_event_timeout(wq, condition, timeout); \
295 __ret; \ 325 __ret; \
296}) 326})
297 327
328#define __wait_event_freezable_timeout(wq, condition, timeout) \
329 ___wait_event(wq, ___wait_cond_timeout(condition), \
330 TASK_INTERRUPTIBLE, 0, timeout, \
331 __ret = schedule_timeout(__ret); try_to_freeze())
332
333/*
334 * like wait_event_timeout() -- except it uses TASK_INTERRUPTIBLE to avoid
335 * increasing load and is freezable.
336 */
337#define wait_event_freezable_timeout(wq, condition, timeout) \
338({ \
339 long __ret = timeout; \
340 might_sleep(); \
341 if (!___wait_cond_timeout(condition)) \
342 __ret = __wait_event_freezable_timeout(wq, condition, timeout); \
343 __ret; \
344})
345
298#define __wait_event_cmd(wq, condition, cmd1, cmd2) \ 346#define __wait_event_cmd(wq, condition, cmd1, cmd2) \
299 (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ 347 (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \
300 cmd1; schedule(); cmd2) 348 cmd1; schedule(); cmd2)
@@ -315,6 +363,7 @@ do { \
315 */ 363 */
316#define wait_event_cmd(wq, condition, cmd1, cmd2) \ 364#define wait_event_cmd(wq, condition, cmd1, cmd2) \
317do { \ 365do { \
366 might_sleep(); \
318 if (condition) \ 367 if (condition) \
319 break; \ 368 break; \
320 __wait_event_cmd(wq, condition, cmd1, cmd2); \ 369 __wait_event_cmd(wq, condition, cmd1, cmd2); \
@@ -342,6 +391,7 @@ do { \
342#define wait_event_interruptible(wq, condition) \ 391#define wait_event_interruptible(wq, condition) \
343({ \ 392({ \
344 int __ret = 0; \ 393 int __ret = 0; \
394 might_sleep(); \
345 if (!(condition)) \ 395 if (!(condition)) \
346 __ret = __wait_event_interruptible(wq, condition); \ 396 __ret = __wait_event_interruptible(wq, condition); \
347 __ret; \ 397 __ret; \
@@ -375,6 +425,7 @@ do { \
375#define wait_event_interruptible_timeout(wq, condition, timeout) \ 425#define wait_event_interruptible_timeout(wq, condition, timeout) \
376({ \ 426({ \
377 long __ret = timeout; \ 427 long __ret = timeout; \
428 might_sleep(); \
378 if (!___wait_cond_timeout(condition)) \ 429 if (!___wait_cond_timeout(condition)) \
379 __ret = __wait_event_interruptible_timeout(wq, \ 430 __ret = __wait_event_interruptible_timeout(wq, \
380 condition, timeout); \ 431 condition, timeout); \
@@ -425,6 +476,7 @@ do { \
425#define wait_event_hrtimeout(wq, condition, timeout) \ 476#define wait_event_hrtimeout(wq, condition, timeout) \
426({ \ 477({ \
427 int __ret = 0; \ 478 int __ret = 0; \
479 might_sleep(); \
428 if (!(condition)) \ 480 if (!(condition)) \
429 __ret = __wait_event_hrtimeout(wq, condition, timeout, \ 481 __ret = __wait_event_hrtimeout(wq, condition, timeout, \
430 TASK_UNINTERRUPTIBLE); \ 482 TASK_UNINTERRUPTIBLE); \
@@ -450,6 +502,7 @@ do { \
450#define wait_event_interruptible_hrtimeout(wq, condition, timeout) \ 502#define wait_event_interruptible_hrtimeout(wq, condition, timeout) \
451({ \ 503({ \
452 long __ret = 0; \ 504 long __ret = 0; \
505 might_sleep(); \
453 if (!(condition)) \ 506 if (!(condition)) \
454 __ret = __wait_event_hrtimeout(wq, condition, timeout, \ 507 __ret = __wait_event_hrtimeout(wq, condition, timeout, \
455 TASK_INTERRUPTIBLE); \ 508 TASK_INTERRUPTIBLE); \
@@ -463,12 +516,27 @@ do { \
463#define wait_event_interruptible_exclusive(wq, condition) \ 516#define wait_event_interruptible_exclusive(wq, condition) \
464({ \ 517({ \
465 int __ret = 0; \ 518 int __ret = 0; \
519 might_sleep(); \
466 if (!(condition)) \ 520 if (!(condition)) \
467 __ret = __wait_event_interruptible_exclusive(wq, condition);\ 521 __ret = __wait_event_interruptible_exclusive(wq, condition);\
468 __ret; \ 522 __ret; \
469}) 523})
470 524
471 525
526#define __wait_event_freezable_exclusive(wq, condition) \
527 ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \
528 schedule(); try_to_freeze())
529
530#define wait_event_freezable_exclusive(wq, condition) \
531({ \
532 int __ret = 0; \
533 might_sleep(); \
534 if (!(condition)) \
535 __ret = __wait_event_freezable_exclusive(wq, condition);\
536 __ret; \
537})
538
539
472#define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \ 540#define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \
473({ \ 541({ \
474 int __ret = 0; \ 542 int __ret = 0; \
@@ -637,6 +705,7 @@ do { \
637#define wait_event_killable(wq, condition) \ 705#define wait_event_killable(wq, condition) \
638({ \ 706({ \
639 int __ret = 0; \ 707 int __ret = 0; \
708 might_sleep(); \
640 if (!(condition)) \ 709 if (!(condition)) \
641 __ret = __wait_event_killable(wq, condition); \ 710 __ret = __wait_event_killable(wq, condition); \
642 __ret; \ 711 __ret; \
@@ -830,6 +899,8 @@ void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int sta
830long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); 899long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state);
831void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); 900void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
832void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key); 901void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key);
902long wait_woken(wait_queue_t *wait, unsigned mode, long timeout);
903int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
833int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 904int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
834int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 905int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
835 906
@@ -886,6 +957,7 @@ extern int bit_wait_io_timeout(struct wait_bit_key *);
886static inline int 957static inline int
887wait_on_bit(void *word, int bit, unsigned mode) 958wait_on_bit(void *word, int bit, unsigned mode)
888{ 959{
960 might_sleep();
889 if (!test_bit(bit, word)) 961 if (!test_bit(bit, word))
890 return 0; 962 return 0;
891 return out_of_line_wait_on_bit(word, bit, 963 return out_of_line_wait_on_bit(word, bit,
@@ -910,6 +982,7 @@ wait_on_bit(void *word, int bit, unsigned mode)
910static inline int 982static inline int
911wait_on_bit_io(void *word, int bit, unsigned mode) 983wait_on_bit_io(void *word, int bit, unsigned mode)
912{ 984{
985 might_sleep();
913 if (!test_bit(bit, word)) 986 if (!test_bit(bit, word))
914 return 0; 987 return 0;
915 return out_of_line_wait_on_bit(word, bit, 988 return out_of_line_wait_on_bit(word, bit,
@@ -936,6 +1009,7 @@ wait_on_bit_io(void *word, int bit, unsigned mode)
936static inline int 1009static inline int
937wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) 1010wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode)
938{ 1011{
1012 might_sleep();
939 if (!test_bit(bit, word)) 1013 if (!test_bit(bit, word))
940 return 0; 1014 return 0;
941 return out_of_line_wait_on_bit(word, bit, action, mode); 1015 return out_of_line_wait_on_bit(word, bit, action, mode);
@@ -963,6 +1037,7 @@ wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode
963static inline int 1037static inline int
964wait_on_bit_lock(void *word, int bit, unsigned mode) 1038wait_on_bit_lock(void *word, int bit, unsigned mode)
965{ 1039{
1040 might_sleep();
966 if (!test_and_set_bit(bit, word)) 1041 if (!test_and_set_bit(bit, word))
967 return 0; 1042 return 0;
968 return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode); 1043 return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode);
@@ -986,6 +1061,7 @@ wait_on_bit_lock(void *word, int bit, unsigned mode)
986static inline int 1061static inline int
987wait_on_bit_lock_io(void *word, int bit, unsigned mode) 1062wait_on_bit_lock_io(void *word, int bit, unsigned mode)
988{ 1063{
1064 might_sleep();
989 if (!test_and_set_bit(bit, word)) 1065 if (!test_and_set_bit(bit, word))
990 return 0; 1066 return 0;
991 return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode); 1067 return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode);
@@ -1011,6 +1087,7 @@ wait_on_bit_lock_io(void *word, int bit, unsigned mode)
1011static inline int 1087static inline int
1012wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) 1088wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode)
1013{ 1089{
1090 might_sleep();
1014 if (!test_and_set_bit(bit, word)) 1091 if (!test_and_set_bit(bit, word))
1015 return 0; 1092 return 0;
1016 return out_of_line_wait_on_bit_lock(word, bit, action, mode); 1093 return out_of_line_wait_on_bit_lock(word, bit, action, mode);
@@ -1029,6 +1106,7 @@ wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned
1029static inline 1106static inline
1030int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) 1107int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode)
1031{ 1108{
1109 might_sleep();
1032 if (atomic_read(val) == 0) 1110 if (atomic_read(val) == 0)
1033 return 0; 1111 return 0;
1034 return out_of_line_wait_on_atomic_t(val, action, mode); 1112 return out_of_line_wait_on_atomic_t(val, action, mode);