aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-05-28 12:23:39 -0400
committerRob Herring <robh@kernel.org>2014-05-28 12:23:39 -0400
commit728dd198aa543397c88f6f8e35f4f187b2bbc09d (patch)
treed9f93149b69c3ece5849243a2836fbc511d3aae4 /include/linux
parente723e4429983333c6fbd3848de50333834d5e89c (diff)
parent45e0f0f5684327a72866a34aedc3fcf8eec51889 (diff)
Merge branch 'earlycon-dt' into for-next
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk-provider.h5
-rw-r--r--include/linux/clocksource.h16
-rw-r--r--include/linux/of.h22
-rw-r--r--include/linux/of_fdt.h1
-rw-r--r--include/linux/of_reserved_mem.h22
-rw-r--r--include/linux/serial_core.h22
-rw-r--r--include/linux/tty_ldisc.h5
7 files changed, 57 insertions, 36 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 511917416fb0..a6e4008a0bf7 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -498,10 +498,7 @@ struct clk_onecell_data {
498 498
499extern struct of_device_id __clk_of_table; 499extern struct of_device_id __clk_of_table;
500 500
501#define CLK_OF_DECLARE(name, compat, fn) \ 501#define CLK_OF_DECLARE(name, compat, fn) OF_DECLARE_1(clk, name, compat, fn)
502 static const struct of_device_id __clk_of_table_##name \
503 __used __section(__clk_of_table) \
504 = { .compatible = compat, .data = fn };
505 502
506#ifdef CONFIG_OF 503#ifdef CONFIG_OF
507int of_clk_add_provider(struct device_node *np, 504int of_clk_add_provider(struct device_node *np,
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 67301a405712..a16b497d5159 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -339,23 +339,13 @@ extern int clocksource_mmio_init(void __iomem *, const char *,
339 339
340extern int clocksource_i8253_init(void); 340extern int clocksource_i8253_init(void);
341 341
342struct device_node; 342#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
343typedef void(*clocksource_of_init_fn)(struct device_node *); 343 OF_DECLARE_1(clksrc, name, compat, fn)
344
344#ifdef CONFIG_CLKSRC_OF 345#ifdef CONFIG_CLKSRC_OF
345extern void clocksource_of_init(void); 346extern void clocksource_of_init(void);
346
347#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
348 static const struct of_device_id __clksrc_of_table_##name \
349 __used __section(__clksrc_of_table) \
350 = { .compatible = compat, \
351 .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
352#else 347#else
353static inline void clocksource_of_init(void) {} 348static inline void clocksource_of_init(void) {}
354#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
355 static const struct of_device_id __clksrc_of_table_##name \
356 __attribute__((unused)) \
357 = { .compatible = compat, \
358 .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn }
359#endif 349#endif
360 350
361#endif /* _LINUX_CLOCKSOURCE_H */ 351#endif /* _LINUX_CLOCKSOURCE_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 3bad8d106e0e..bf65335b4d05 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -757,4 +757,26 @@ static inline int of_get_available_child_count(const struct device_node *np)
757 return num; 757 return num;
758} 758}
759 759
760#ifdef CONFIG_OF
761#define _OF_DECLARE(table, name, compat, fn, fn_type) \
762 static const struct of_device_id __of_table_##name \
763 __used __section(__##table##_of_table) \
764 = { .compatible = compat, \
765 .data = (fn == (fn_type)NULL) ? fn : fn }
766#else
767#define _OF_DECLARE(table, name, compat, fn, fn_type) \
768 static const struct of_device_id __of_table_##name \
769 __attribute__((unused)) \
770 = { .compatible = compat, \
771 .data = (fn == (fn_type)NULL) ? fn : fn }
772#endif
773
774typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
775typedef void (*of_init_fn_1)(struct device_node *);
776
777#define OF_DECLARE_1(table, name, compat, fn) \
778 _OF_DECLARE(table, name, compat, fn, of_init_fn_1)
779#define OF_DECLARE_2(table, name, compat, fn) \
780 _OF_DECLARE(table, name, compat, fn, of_init_fn_2)
781
760#endif /* _LINUX_OF_H */ 782#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 5c0ab057eecf..05117899fcb4 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -83,6 +83,7 @@ extern void unflatten_device_tree(void);
83extern void unflatten_and_copy_device_tree(void); 83extern void unflatten_and_copy_device_tree(void);
84extern void early_init_devtree(void *); 84extern void early_init_devtree(void *);
85extern void early_get_first_memblock_info(void *, phys_addr_t *); 85extern void early_get_first_memblock_info(void *, phys_addr_t *);
86extern u64 fdt_translate_address(const void *blob, int node_offset);
86#else /* CONFIG_OF_FLATTREE */ 87#else /* CONFIG_OF_FLATTREE */
87static inline void early_init_fdt_scan_reserved_mem(void) {} 88static inline void early_init_fdt_scan_reserved_mem(void) {}
88static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } 89static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h
index 9b1fbb7f29fc..4669ddfdd5af 100644
--- a/include/linux/of_reserved_mem.h
+++ b/include/linux/of_reserved_mem.h
@@ -21,33 +21,19 @@ struct reserved_mem_ops {
21 struct device *dev); 21 struct device *dev);
22}; 22};
23 23
24typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem, 24typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem);
25 unsigned long node, const char *uname); 25
26#define RESERVEDMEM_OF_DECLARE(name, compat, init) \
27 _OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn)
26 28
27#ifdef CONFIG_OF_RESERVED_MEM 29#ifdef CONFIG_OF_RESERVED_MEM
28void fdt_init_reserved_mem(void); 30void fdt_init_reserved_mem(void);
29void fdt_reserved_mem_save_node(unsigned long node, const char *uname, 31void fdt_reserved_mem_save_node(unsigned long node, const char *uname,
30 phys_addr_t base, phys_addr_t size); 32 phys_addr_t base, phys_addr_t size);
31
32#define RESERVEDMEM_OF_DECLARE(name, compat, init) \
33 static const struct of_device_id __reservedmem_of_table_##name \
34 __used __section(__reservedmem_of_table) \
35 = { .compatible = compat, \
36 .data = (init == (reservedmem_of_init_fn)NULL) ? \
37 init : init }
38
39#else 33#else
40static inline void fdt_init_reserved_mem(void) { } 34static inline void fdt_init_reserved_mem(void) { }
41static inline void fdt_reserved_mem_save_node(unsigned long node, 35static inline void fdt_reserved_mem_save_node(unsigned long node,
42 const char *uname, phys_addr_t base, phys_addr_t size) { } 36 const char *uname, phys_addr_t base, phys_addr_t size) { }
43
44#define RESERVEDMEM_OF_DECLARE(name, compat, init) \
45 static const struct of_device_id __reservedmem_of_table_##name \
46 __attribute__((unused)) \
47 = { .compatible = compat, \
48 .data = (init == (reservedmem_of_init_fn)NULL) ? \
49 init : init }
50
51#endif 37#endif
52 38
53#endif /* __OF_RESERVED_MEM_H */ 39#endif /* __OF_RESERVED_MEM_H */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index f729be981da0..5bbb809ee197 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -285,6 +285,28 @@ static inline int uart_poll_timeout(struct uart_port *port)
285/* 285/*
286 * Console helpers. 286 * Console helpers.
287 */ 287 */
288struct earlycon_device {
289 struct console *con;
290 struct uart_port port;
291 char options[16]; /* e.g., 115200n8 */
292 unsigned int baud;
293};
294int setup_earlycon(char *buf, const char *match,
295 int (*setup)(struct earlycon_device *, const char *));
296
297extern int of_setup_earlycon(unsigned long addr,
298 int (*setup)(struct earlycon_device *, const char *));
299
300#define EARLYCON_DECLARE(name, func) \
301static int __init name ## _setup_earlycon(char *buf) \
302{ \
303 return setup_earlycon(buf, __stringify(name), func); \
304} \
305early_param("earlycon", name ## _setup_earlycon);
306
307#define OF_EARLYCON_DECLARE(name, compat, fn) \
308 _OF_DECLARE(earlycon, name, compat, fn, void *)
309
288struct uart_port *uart_get_console(struct uart_port *ports, int nr, 310struct uart_port *uart_get_console(struct uart_port *ports, int nr,
289 struct console *c); 311 struct console *c);
290void uart_parse_options(char *options, int *baud, int *parity, int *bits, 312void uart_parse_options(char *options, int *baud, int *parity, int *bits,
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index add26da2faeb..00c9d688d7b7 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -92,7 +92,10 @@
92 * This function is called by the low-level tty driver to signal 92 * This function is called by the low-level tty driver to signal
93 * that line discpline should try to send more characters to the 93 * that line discpline should try to send more characters to the
94 * low-level driver for transmission. If the line discpline does 94 * low-level driver for transmission. If the line discpline does
95 * not have any more data to send, it can just return. 95 * not have any more data to send, it can just return. If the line
96 * discipline does have some data to send, please arise a tasklet
97 * or workqueue to do the real data transfer. Do not send data in
98 * this hook, it may leads to a deadlock.
96 * 99 *
97 * int (*hangup)(struct tty_struct *) 100 * int (*hangup)(struct tty_struct *)
98 * 101 *