aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gpio/driver.h11
-rw-r--r--include/linux/padata.h3
-rw-r--r--include/linux/slab.h102
-rw-r--r--include/linux/tegra-powergate.h27
4 files changed, 83 insertions, 60 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 656a27efb2c8..82eac610ce1a 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -125,6 +125,13 @@ extern struct gpio_chip *gpiochip_find(void *data,
125int gpiod_lock_as_irq(struct gpio_desc *desc); 125int gpiod_lock_as_irq(struct gpio_desc *desc);
126void gpiod_unlock_as_irq(struct gpio_desc *desc); 126void gpiod_unlock_as_irq(struct gpio_desc *desc);
127 127
128enum gpio_lookup_flags {
129 GPIO_ACTIVE_HIGH = (0 << 0),
130 GPIO_ACTIVE_LOW = (1 << 0),
131 GPIO_OPEN_DRAIN = (1 << 1),
132 GPIO_OPEN_SOURCE = (1 << 2),
133};
134
128/** 135/**
129 * Lookup table for associating GPIOs to specific devices and functions using 136 * Lookup table for associating GPIOs to specific devices and functions using
130 * platform data. 137 * platform data.
@@ -152,9 +159,9 @@ struct gpiod_lookup {
152 */ 159 */
153 unsigned int idx; 160 unsigned int idx;
154 /* 161 /*
155 * mask of GPIOF_* values 162 * mask of GPIO_* values
156 */ 163 */
157 unsigned long flags; 164 enum gpio_lookup_flags flags;
158}; 165};
159 166
160/* 167/*
diff --git a/include/linux/padata.h b/include/linux/padata.h
index 86292beebfe2..438694650471 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -129,10 +129,9 @@ struct parallel_data {
129 struct padata_serial_queue __percpu *squeue; 129 struct padata_serial_queue __percpu *squeue;
130 atomic_t reorder_objects; 130 atomic_t reorder_objects;
131 atomic_t refcnt; 131 atomic_t refcnt;
132 atomic_t seq_nr;
132 struct padata_cpumask cpumask; 133 struct padata_cpumask cpumask;
133 spinlock_t lock ____cacheline_aligned; 134 spinlock_t lock ____cacheline_aligned;
134 spinlock_t seq_lock;
135 unsigned int seq_nr;
136 unsigned int processed; 135 unsigned int processed;
137 struct timer_list timer; 136 struct timer_list timer;
138}; 137};
diff --git a/include/linux/slab.h b/include/linux/slab.h
index c2bba248fa63..1e2f4fe12773 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -388,10 +388,55 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
388/** 388/**
389 * kmalloc - allocate memory 389 * kmalloc - allocate memory
390 * @size: how many bytes of memory are required. 390 * @size: how many bytes of memory are required.
391 * @flags: the type of memory to allocate (see kcalloc). 391 * @flags: the type of memory to allocate.
392 * 392 *
393 * kmalloc is the normal method of allocating memory 393 * kmalloc is the normal method of allocating memory
394 * for objects smaller than page size in the kernel. 394 * for objects smaller than page size in the kernel.
395 *
396 * The @flags argument may be one of:
397 *
398 * %GFP_USER - Allocate memory on behalf of user. May sleep.
399 *
400 * %GFP_KERNEL - Allocate normal kernel ram. May sleep.
401 *
402 * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools.
403 * For example, use this inside interrupt handlers.
404 *
405 * %GFP_HIGHUSER - Allocate pages from high memory.
406 *
407 * %GFP_NOIO - Do not do any I/O at all while trying to get memory.
408 *
409 * %GFP_NOFS - Do not make any fs calls while trying to get memory.
410 *
411 * %GFP_NOWAIT - Allocation will not sleep.
412 *
413 * %GFP_THISNODE - Allocate node-local memory only.
414 *
415 * %GFP_DMA - Allocation suitable for DMA.
416 * Should only be used for kmalloc() caches. Otherwise, use a
417 * slab created with SLAB_DMA.
418 *
419 * Also it is possible to set different flags by OR'ing
420 * in one or more of the following additional @flags:
421 *
422 * %__GFP_COLD - Request cache-cold pages instead of
423 * trying to return cache-warm pages.
424 *
425 * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
426 *
427 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
428 * (think twice before using).
429 *
430 * %__GFP_NORETRY - If memory is not immediately available,
431 * then give up at once.
432 *
433 * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
434 *
435 * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
436 *
437 * There are other flags available as well, but these are not intended
438 * for general use, and so are not documented here. For a full list of
439 * potential flags, always refer to linux/gfp.h.
395 */ 440 */
396static __always_inline void *kmalloc(size_t size, gfp_t flags) 441static __always_inline void *kmalloc(size_t size, gfp_t flags)
397{ 442{
@@ -502,61 +547,6 @@ int cache_show(struct kmem_cache *s, struct seq_file *m);
502void print_slabinfo_header(struct seq_file *m); 547void print_slabinfo_header(struct seq_file *m);
503 548
504/** 549/**
505 * kmalloc - allocate memory
506 * @size: how many bytes of memory are required.
507 * @flags: the type of memory to allocate.
508 *
509 * The @flags argument may be one of:
510 *
511 * %GFP_USER - Allocate memory on behalf of user. May sleep.
512 *
513 * %GFP_KERNEL - Allocate normal kernel ram. May sleep.
514 *
515 * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools.
516 * For example, use this inside interrupt handlers.
517 *
518 * %GFP_HIGHUSER - Allocate pages from high memory.
519 *
520 * %GFP_NOIO - Do not do any I/O at all while trying to get memory.
521 *
522 * %GFP_NOFS - Do not make any fs calls while trying to get memory.
523 *
524 * %GFP_NOWAIT - Allocation will not sleep.
525 *
526 * %GFP_THISNODE - Allocate node-local memory only.
527 *
528 * %GFP_DMA - Allocation suitable for DMA.
529 * Should only be used for kmalloc() caches. Otherwise, use a
530 * slab created with SLAB_DMA.
531 *
532 * Also it is possible to set different flags by OR'ing
533 * in one or more of the following additional @flags:
534 *
535 * %__GFP_COLD - Request cache-cold pages instead of
536 * trying to return cache-warm pages.
537 *
538 * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
539 *
540 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
541 * (think twice before using).
542 *
543 * %__GFP_NORETRY - If memory is not immediately available,
544 * then give up at once.
545 *
546 * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
547 *
548 * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
549 *
550 * There are other flags available as well, but these are not intended
551 * for general use, and so are not documented here. For a full list of
552 * potential flags, always refer to linux/gfp.h.
553 *
554 * kmalloc is the normal method of allocating memory
555 * in the kernel.
556 */
557static __always_inline void *kmalloc(size_t size, gfp_t flags);
558
559/**
560 * kmalloc_array - allocate memory for an array. 550 * kmalloc_array - allocate memory for an array.
561 * @n: number of elements. 551 * @n: number of elements.
562 * @size: element size. 552 * @size: element size.
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
index c98cfa406952..fd4498329c7c 100644
--- a/include/linux/tegra-powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -45,6 +45,7 @@ struct clk;
45 45
46#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 46#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
47 47
48#ifdef CONFIG_ARCH_TEGRA
48int tegra_powergate_is_powered(int id); 49int tegra_powergate_is_powered(int id);
49int tegra_powergate_power_on(int id); 50int tegra_powergate_power_on(int id);
50int tegra_powergate_power_off(int id); 51int tegra_powergate_power_off(int id);
@@ -52,5 +53,31 @@ int tegra_powergate_remove_clamping(int id);
52 53
53/* Must be called with clk disabled, and returns with clk enabled */ 54/* Must be called with clk disabled, and returns with clk enabled */
54int tegra_powergate_sequence_power_up(int id, struct clk *clk); 55int tegra_powergate_sequence_power_up(int id, struct clk *clk);
56#else
57static inline int tegra_powergate_is_powered(int id)
58{
59 return -ENOSYS;
60}
61
62static inline int tegra_powergate_power_on(int id)
63{
64 return -ENOSYS;
65}
66
67static inline int tegra_powergate_power_off(int id)
68{
69 return -ENOSYS;
70}
71
72static inline int tegra_powergate_remove_clamping(int id)
73{
74 return -ENOSYS;
75}
76
77static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk)
78{
79 return -ENOSYS;
80}
81#endif
55 82
56#endif /* _MACH_TEGRA_POWERGATE_H_ */ 83#endif /* _MACH_TEGRA_POWERGATE_H_ */